Skip to content

Commit

Permalink
Merge pull request #205 from cqframework/routines-tests
Browse files Browse the repository at this point in the history
Tests for routines
  • Loading branch information
Capt-Mac authored Aug 25, 2022
2 parents 80056cc + 70e8cd4 commit 972d2cb
Show file tree
Hide file tree
Showing 42 changed files with 1,200 additions and 130 deletions.
28 changes: 28 additions & 0 deletions input/examples/condition-cancer-diagnosis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"resourceType": "Condition",
"id": "cancer-diagnosis",
"clinicalStatus": {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
"code": "active",
"display": "Active"
} ]
},
"category": [ {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/condition-category",
"code": "encounter-diagnosis",
"display": "Encounter Diagnosis"
} ]
} ],
"code": {
"coding": [ {
"system": "http://hl7.org/fhir/sid/icd-10-cm",
"code": "C43",
"display": "Malignant melanoma of skin"
} ]
},
"subject": {
"reference": "Patient/example-opioidcds"
}
}
28 changes: 28 additions & 0 deletions input/examples/condition-end-of-life.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"resourceType": "Condition",
"id": "end-of-life",
"clinicalStatus": {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
"code": "active",
"display": "Active"
} ]
},
"category": [ {
"coding": [ {
"system": "http://hl7.org/fhir/us/core/CodeSystem/condition-category",
"code": "health-concern",
"display": "Health Concern"
} ]
} ],
"code": {
"coding": [ {
"system": "http://snomed.info/sct",
"code": "170969009",
"display": "Prognosis bad"
} ]
},
"subject": {
"reference": "Patient/example-opioidcds"
}
}
28 changes: 28 additions & 0 deletions input/examples/condition-terminal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"resourceType": "Condition",
"id": "terminal",
"clinicalStatus": {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
"code": "active",
"display": "Active"
} ]
},
"category": [ {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/condition-category",
"code": "encounter-diagnosis",
"display": "Encounter Diagnosis"
} ]
} ],
"code": {
"coding": [ {
"system": "http://snomed.info/sct",
"code": "708248004",
"display": "End stage liver disease"
} ]
},
"subject": {
"reference": "Patient/example-opioidcds"
}
}
39 changes: 39 additions & 0 deletions input/examples/encounter-cancer-diagnosis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"resourceType": "Encounter",
"id": "cancer-diagnosis",
"extension": [ {
"url": "http://fhir.org/guides/cdc/opioid-cds/StructureDefinition/dataDateRoller",
"extension": [ {
"url": "dateLastUpdated",
"valueDateTime": "2022-08-24"
}, {
"url": "frequency",
"valueDuration": {
"value": 30.0,
"unit": "days",
"system": "http://unitsofmeasure.org",
"code": "d"
}
} ]
} ],
"status": "finished",
"type": [ {
"coding": [ {
"system": "http://www.ama-assn.org/go/cpt",
"code": "99203",
"display": "Office or other outpatient visit for the evaluation and management of a new patient, which requires a medically appropriate history and/or examination and low level of medical decision making. When using time for code selection, 30-44 minutes of total time is spent on the date of the encounter."
} ]
} ],
"subject": {
"reference": "Patient/example-opioidcds"
},
"period": {
"start": "2022-04-24",
"end": "2022-04-24"
},
"diagnosis": [ {
"condition": {
"reference": "Condition/cancer-diagnosis"
}
} ]
}
46 changes: 46 additions & 0 deletions input/examples/encounter-oncologist-participant.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"resourceType": "Encounter",
"id": "oncologist-participant",
"extension": [ {
"url": "http://fhir.org/guides/cdc/opioid-cds/StructureDefinition/dataDateRoller",
"extension": [ {
"url": "dateLastUpdated",
"valueDateTime": "2022-08-24"
}, {
"url": "frequency",
"valueDuration": {
"value": 30.0,
"unit": "days",
"system": "http://unitsofmeasure.org",
"code": "d"
}
} ]
} ],
"status": "finished",
"type": [ {
"coding": [ {
"system": "http://www.ama-assn.org/go/cpt",
"code": "99203",
"display": "Office or other outpatient visit for the evaluation and management of a new patient, which requires a medically appropriate history and/or examination and low level of medical decision making. When using time for code selection, 30-44 minutes of total time is spent on the date of the encounter."
} ]
} ],
"subject": {
"reference": "Patient/example-opioidcds"
},
"participant": [ {
"type": [ {
"coding": [ {
"system": "http://nucc.org/provider-taxonomy",
"code": "207RX0202X",
"display": "Medical Oncology"
} ]
} ],
"individual": {
"reference": "PractitionerRole/oncology-specialist"
}
} ],
"period": {
"start": "2022-03-24",
"end": "2022-03-24"
}
}
54 changes: 54 additions & 0 deletions input/examples/medicationdispense-ambulatory-opioid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"resourceType": "MedicationDispense",
"id": "ambulatory-opioid",
"extension": [ {
"url": "http://fhir.org/guides/cdc/opioid-cds/StructureDefinition/dataDateRoller",
"extension": [ {
"url": "dateLastUpdated",
"valueDateTime": "2022-08-24"
}, {
"url": "frequency",
"valueDuration": {
"value": 30.0,
"unit": "days",
"system": "http://unitsofmeasure.org",
"code": "d"
}
} ]
} ],
"status": "completed",
"category": {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/medicationrequest-category",
"code": "community",
"display": "Community"
} ]
},
"medicationCodeableConcept": {
"coding": [ {
"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
"code": "1010603",
"display": "Suboxone 2 MG / 0.5 MG Sublingual Film"
} ]
},
"subject": {
"reference": "Patient/example-opioidcds"
},
"whenHandedOver": "2022-07-24",
"dosageInstruction": [ {
"timing": {
"repeat": {
"frequency": 1,
"period": 1.0,
"periodUnit": "d"
}
},
"asNeededBoolean": false,
"doseAndRate": [ {
"doseQuantity": {
"value": 1.0,
"unit": "film"
}
} ]
} ]
}
68 changes: 68 additions & 0 deletions input/examples/medicationrequest-ambulatory-opioid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"resourceType": "MedicationRequest",
"id": "ambulatory-opioid",
"extension": [ {
"url": "http://fhir.org/guides/cdc/opioid-cds/StructureDefinition/dataDateRoller",
"extension": [ {
"url": "dateLastUpdated",
"valueDateTime": "2022-08-24"
}, {
"url": "frequency",
"valueDuration": {
"value": 30.0,
"unit": "days",
"system": "http://unitsofmeasure.org",
"code": "d"
}
} ]
} ],
"status": "active",
"intent": "order",
"category": [ {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/medicationrequest-category",
"code": "community",
"display": "Community"
} ]
} ],
"medicationCodeableConcept": {
"coding": [ {
"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
"code": "1010603",
"display": "Suboxone 2 MG / 0.5 MG Sublingual Film"
} ]
},
"subject": {
"reference": "Patient/example-opioidcds"
},
"authoredOn": "2022-07-24",
"dosageInstruction": [ {
"timing": {
"repeat": {
"frequency": 1,
"period": 1.0,
"periodUnit": "d"
}
},
"asNeededBoolean": false,
"doseAndRate": [ {
"doseQuantity": {
"value": 1.0,
"unit": "film"
}
} ]
} ],
"dispenseRequest": {
"validityPeriod": {
"start": "2022-07-24",
"end": "2022-10-24"
},
"numberOfRepeatsAllowed": 1,
"expectedSupplyDuration": {
"value": 30,
"unit": "days",
"system": "http://unitsofmeasure.org",
"code": "d"
}
}
}
16 changes: 16 additions & 0 deletions input/examples/practitionerrole-oncology-specialist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"resourceType": "PractitionerRole",
"id": "oncology-specialist",
"active": true,
"period": {
"start": "2021-11-24",
"end": "2023-11-24"
},
"specialty": [ {
"coding": [ {
"system": "http://nucc.org/provider-taxonomy",
"code": "207RX0202X",
"display": "Medical Oncology"
} ]
} ]
}
32 changes: 32 additions & 0 deletions input/examples/servicerequest-palliative-care.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"resourceType": "ServiceRequest",
"id": "palliative-care",
"extension": [ {
"url": "http://fhir.org/guides/cdc/opioid-cds/StructureDefinition/dataDateRoller",
"extension": [ {
"url": "dateLastUpdated",
"valueDateTime": "2022-08-24"
}, {
"url": "frequency",
"valueDuration": {
"value": 30.0,
"unit": "days",
"system": "http://unitsofmeasure.org",
"code": "d"
}
} ]
} ],
"status": "active",
"intent": "order",
"code": {
"coding": [ {
"system": "http://snomed.info/sct",
"code": "103735009",
"display": "Palliative care"
} ]
},
"subject": {
"reference": "Patient/example-opioidcds"
},
"authoredOn": "2022-07-24"
}
2 changes: 1 addition & 1 deletion input/pagecontent/cql/OpioidCDSRoutines.cql
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ define "Opioid Dispense with Ambulatory Abuse Potential In Past 90 Days":
define "Has Opioid Dispense with Ambulatory Abuse Potential In Past 90 Days":
if (Config."Opioid Naive Prescription Condition Is Enabled") then
exists ("Opioid RX with Ambulatory Abuse Potential In Past 90 Days")
exists ("Opioid Dispense with Ambulatory Abuse Potential In Past 90 Days")
else
false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"extension": [
{
"url": "dateLastUpdated",
"valueDateTime": "2022-08-22"
"valueDateTime": "2022-08-24"
},
{
"url": "frequency",
Expand Down Expand Up @@ -61,7 +61,7 @@
"encounter": {
"reference": "Encounter/example-rec-01-in-outpatient-opioid-context"
},
"authoredOn": "2022-08-22",
"authoredOn": "2022-08-24",
"dosageInstruction": [
{
"timing": {
Expand All @@ -84,8 +84,8 @@
],
"dispenseRequest": {
"validityPeriod": {
"start": "2022-08-22T00:00:00-06:00",
"end": "2022-11-22T00:00:00-07:00"
"start": "2022-08-24T00:00:00-06:00",
"end": "2022-11-24T00:00:00-07:00"
},
"numberOfRepeatsAllowed": 1,
"expectedSupplyDuration": {
Expand Down
Loading

0 comments on commit 972d2cb

Please sign in to comment.