Skip to content

Instantly share code, notes, and snippets.

@louismullie
Last active March 25, 2021 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save louismullie/23d128c93e4bd0a2ecd8c09d5cf975db to your computer and use it in GitHub Desktop.
Save louismullie/23d128c93e4bd0a2ecd8c09d5cf975db to your computer and use it in GitHub Desktop.
coda19-dashboard-requests
// Requête no. 1
{
"header": {},
"body": {
"selectors": [
{
"resource": "Patient",
"filters": [
{ "path": "code",
"operator": "matches",
"value": {
"coding": [{ "system": "http://loinc.org", "code": "94531-1" }]
}
},
],
"fields": []
}],
"options": {
"measures": {
"categorical": [ "count"]
}
}
}
}
// Requête no. 2
{
"header": {},
"body": {
"selectors": [
{
"resource": "Observation",
"filters": [
{ "path": "code",
"operator": "matches",
"value": {
"coding": [{ "system": "http://loinc.org", "code": "94531-1" }]
}
},
{ "path": "interpretation",
"operator": "matches",
"value": {
"interpretation": [{ 
"coding": [{ "system": "http://snomed.info/sct", "code": "10828004" }]
}]
}
}
],
"fields": []
}],
"options": {
"measures": {
"categorical": [ "count"]
}
}
}
}
// Requête no. 3
{
"header": {},
"body": {
"selectors": [
{
"resource": "Patient",
"filters": [
{ "path": "deceasedBoolean",
"operator": "matches",
"value": true
},
{ "path": "deceasedDateTime",
"operator": "on",
"value": "YYYY-MM-DD"
},
]
"fields": []
}],
"options": {
"measures": {
"categorical": [ "count"]
}
}
}
}
// Requête no. 4.1 (get positive tests)
{
"header": {},
"body": {
"selectors": [
{
"resource": "Observation",
"filters": [
{ "path": "code",
"operator": "matches",
"value": {
"coding": [{ "system": "http://loinc.org", "code": "94531-1" }]
}
},
{ "path": "interpretation",
"operator": "matches",
"value": {
"interpretation": [{ 
"coding": [{ "system": "http://snomed.info/sct", "code": "10828004" }]
}]
}
}
],
"fields": []
}],
"options": {
"measures": {
"categorical": [ "count"]
},
"breakdown": {
"resource": {
"type": "Observation",
"field": "issued"
},
"slices": {
"min": timestamp(period_start),
"max": timestamp(period_end),
"step": 1209600,
"units": "seconds"
}
}
}
}
}
// Requête no. 4.2 (get total tests)
// Same as 4.1 but remove positive interpretation condition.
// Requête no. 5
// Same as 4.1
// Requête no. 6
{
"header": { },
"body": {
"selectors": [
{
"resource": "Encounter",
"filters": [ {
"path": "period.start",
"operator": "after",
"value": "YYYY-MM-DDThh:mm:ss+zz:zz",
}],
"fields": []
}
],
"joins": [
{
"resource": "Location",
"filters": [ {
"path": "type",
"operator": "matches",
"value": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v3-RoleCode",
"code": "ICU"
}
]
],
"fields": []
}
],
"options": {
"measures": {
"categorical": [ "count"]
},
"breakdown": {
"resource": {
"type": "Encounter",
"field": "period.start"
},
"slices": {
"min": timestamp(period_start),
"max": timestamp(period_end),
"step": 1209600,
"units": "seconds"
}
}
}
}
}
// Requête no. 7
// Denominators are hard-coded per site
{
"header": { },
"body": {
"selectors": [
{
"resource": "Encounter",
"filters": [ {
"path": "period.start",
"operator": "after",
"value": "YYYY-MM-DDThh:mm:ss+zz:zz",
}],
"fields": []
}
],
"joins": [
{
"resource": "Location",
"filters": [ {
"path": "type",
"operator": "matches",
"value": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v3-RoleCode",
"code": "ICU"
}
]
} ],
"fields": []
}
],
"options": {
"measures": {
"categorical": [ "count"]
}
}
}
}
// Requête no. 8
// Same as no. 7, but change Location code to HU (hospital unit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment