From 58d7a811296b83848f39aca7fb2061a04db739f3 Mon Sep 17 00:00:00 2001 From: Richard Stanley <2528387+citizenrich@users.noreply.github.com> Date: Fri, 7 Jul 2023 16:01:20 -0400 Subject: [PATCH] add debug cql file --- input/cql/Debug.cql | 346 +++++++++++++ input/fsh/library.fsh | 17 + input/fsh/measure.fsh | 16 + .../Bundle-Example-HIVSimple.json | 459 ++++++++++++++++++ .../Bundle-Example-HIVSimple2.json | 356 ++++++++++++++ .../Debug/PatientCIEL/Bundle-ExampleCIEL.json | 126 +++++ .../PatientOMRS0/Bundle-ExampleOMRS0.json | 185 +++++++ .../Bundle-Example0.json | 328 +++++++++++++ 8 files changed, 1833 insertions(+) create mode 100644 input/cql/Debug.cql create mode 100644 input/tests/Debug/Patient-HIVSimple/Bundle-Example-HIVSimple.json create mode 100644 input/tests/Debug/Patient-HIVSimple2/Bundle-Example-HIVSimple2.json create mode 100644 input/tests/Debug/PatientCIEL/Bundle-ExampleCIEL.json create mode 100644 input/tests/Debug/PatientOMRS0/Bundle-ExampleOMRS0.json create mode 100644 input/tests/Debug/example-openmrs-Patient/Bundle-Example0.json diff --git a/input/cql/Debug.cql b/input/cql/Debug.cql new file mode 100644 index 000000000..74d668289 --- /dev/null +++ b/input/cql/Debug.cql @@ -0,0 +1,346 @@ +library Debug version '0.1.0' + +using FHIR version '4.0.1' + +include FHIRHelpers version '4.0.1' +include FHIRCommon version '4.0.1' called FC +include MERConcepts called Cx + +// parameter "Measurement Period" Interval +parameter "Measurement Period" Interval default Interval[@1990-01-01T, @2022-12-31T] + +context Patient + + +define "Deceased": + Patient.deceased is not null + and (Patient.deceased is true or Patient.deceased before end of "Measurement Period") + // and Patient.deceased.value.not() + // and Patient.deceased.not() + // // alternatively + // where P.deceased is false + // or P.deceased before Today() + + +// synthea +// define "HIV Condition": +// exists ["Condition": Cx."HIV Condition Positive"] +// // synthea +// or exists [Observation: Cx."Acquired immune deficiency syndrome (disorder)"] +// or exists [Encounter] E +// // where E.reasonCode in Cx."Acquired immune deficiency syndrome (disorder)" +// where (Last(E.reasonCode) ~ Cx."Acquired immune deficiency syndrome (disorder)") + + +// define "Is HIV Positive": +// "HIV Condition" + + +// define "Is HIV Negative": +// not "HIV Condition" + + +// define "HIV Test Results": +// case +// when "Is HIV Positive" then "HIV Positive Observation" +// when "Is HIV Negative" then "HIV Negative Observation" +// else null +// end + + +define "Pregnant": + exists ["Condition": Cx."Pregnancy (finding)"] + + +// define "HIV Test Exists": +// exists ([Observation: Cx."HIV 1 and 2 tests - Meaningful Use set"]) + + +// define "HIV Positive Observation": +// [Observation: Cx."HIV 1 and 2 tests - Meaningful Use set"] Observation +// where Observation.value = "Is HIV Positive" + + +// define "HIV Negative Observation": +// [Observation: Cx."HIV 1 and 2 tests - Meaningful Use set"] Observation +// where Observation.value = "Is HIV Negative" + +// this union is a placeholder for implementer or dak valuesets +// define "Viral Load Test Result": +// ["Observation": Cx."HIV 1 RNA NAA+probe (Specimen)"] Obs +// union ["Observation": Cx."HIV 1 RNA [#/volume] (viral load) in Serum or Plasma by NAA with probe detection"] Obs +// // where Obs.status = 'final' +// // and Obs.value is not null +// // synthea +// // when Obs.effective during "Measurement Period" + + +// define "Living with HIV and on ART with suppressed viral load results (<1000 copies/mL)": +// "Viral Load Test Result" Observation +// where Observation.value < 1000 '{copies}/mL' + + +// define "Living with HIV and on ART with unsuppressed viral load results (>1000 copies/mL)": +// "Viral Load Test Result" Observation +// where Observation.value >= 1000 '{copies}/mL' + + +// define "Suppressed": +// "Viral Load Test Result" Observation +// where Observation.value < 1000 '{copies}/mL' + + +// define "Unsuppressed": +// "Viral Load Test Result" Observation +// where Observation.value >= 1000 '{copies}/mL' + + +define "Contact date": + [Encounter] E + return E.period.start + + +// define "HIV Positive but no VL test": +// "Is HIV Positive" = true + + + +// Rest of HIVIndicators + +define "on ART PLIR": + ["Observation": Cx."Currently taking ARV"] o + where o.value.coding[0]= Cx."Coded Answer" + or o.value.coding[1]= Cx."Coded Answer" + or o.value.coding[2]= Cx."Coded Answer" + // and o.status in {'final', 'amended', 'corrected'} + // and o.effective in day of "Measurement Period" + + +define "on ART PLIR debug one": + ["Observation": Cx."Currently taking ARV"] o + with ["Encounter"] E + such that E.period during "Measurement Period" + // and o.status in {'final', 'amended', 'corrected'} + + +define "on ART PLIR debug two": + ["Observation": Cx."Currently taking ARV"] o + with [Encounter] E + such that E.period during "Measurement Period" + + +define "on ART PLIR debug three": + ( ["Observation": Cx."Currently taking ARV"] ) o + where o.value.coding[0]= Cx."Coded Answer" + or o.value.coding[1]= Cx."Coded Answer" + or o.value.coding[2]= Cx."Coded Answer" + + +define "ART Therapy Observation": + ["Observation": Cx."History of antiretroviral therapy (situation)"] O + where O.status = 'final' + +// to review +// ART Therapy Observation=[] +// ART Therapy Condition=[] + +define "ART Therapy Condition": + ["Condition": Cx."History of antiretroviral therapy (situation)"] C + where C.verificationStatus ~ FC."confirmed" + and C.clinicalStatus ~ FC."active" + + +// define "ART Therapy Medication": +// ["MedicationDispense": Cx."ART Medications"] M +// where M.status = 'completed' + +// synthea +define "ART Therapy Medication": + ["MedicationRequest": Cx."ART Medications"] M + // where M.status = 'active' + where M.authoredOn during "Measurement Period" + + + +define "ART Dates": + ("ART Therapy Observation" O return O.effective as dateTime) + union ("ART Therapy Condition" C return C.onset as dateTime) + union ("ART Therapy Medication" M return M.authoredOn) + // union ("ART Therapy Medication" M return M) + + + +define "Date of First Evidence of ART": + Min("ART Dates") + + +// define "PMTCT ART Status": +// case +// when "Date of First Evidence of ART" before start of "Measurement Period" then Cx."Currently taking ARV" +// when "Date of First Evidence of ART" during "Measurement Period" then Cx."New on ART" +// else null +// end + + +define "On ART": + exists ("ART Dates" D where D during "Measurement Period") + or exists ( + "ART Therapy Condition" C + where Interval[C.onset, C.abatement] overlaps "Measurement Period" + ) + + +// define "HIV Test Observation": +// [Observation: Cx."HIV 1 and 2 tests - Meaningful Use set"] O +// // where O.status = 'final' +// // and O.value is not null + + +// define "Date of First Evidence of HIV Status": +// Min("HIV Test Observation" O return O.effective) + + +// define "Date of First Evidence of HIV Positive": +// Min("HIV Positive Observation" O return O.effective) + + +// define "Date of First Evidence of HIV Negative": +// Min("HIV Negative Observation" O return O.effective) + + +// define "PMTCT HIV Status": +// case +// when "Date of First Evidence of HIV Positive" before start of "Measurement Period" then 'Known Positive' +// when "Date of First Evidence of HIV Positive" during "Measurement Period" then 'Newly Identified Positive' +// when "Date of First Evidence of HIV Negative" during "Measurement Period" then 'Newly Identified Negative' +// else null +// end + + +define "Newly enrolled on antiretroviral therapy (ART) during measurement period": + "Date of First Evidence of ART" during "Measurement Period" + + +define "Is Pregnant": + exists ([Condition: Cx."Pregnancy status - Reported"] C + where C.verificationStatus ~ FC."confirmed" + and C.clinicalStatus ~ FC."active" + and C.onset during "Measurement Period" + ) + + +// define "Is Breastfeeding": +// exists ([Observation: Cx."Postpartum state (finding)"] O +// where O.status = 'final' +// and O.effective during "Measurement Period" +// ) + + +define "Newly enrolled on antiretroviral therapy (ART) during measurement period (pregnant and breastfeeding)": + // "Is Pregnant" and "Is Breastfeeding" and "Date of First Evidence of ART" during "Measurement Period" + "Is Pregnant" and "Date of First Evidence of ART" during "Measurement Period" + + +define "Receiving antiretroviral therapy (ART) during measurement period": + exists ("ART Dates" D where D during "Measurement Period") + or exists ( + "ART Therapy Condition" C + where Interval[C.onset, C.abatement] overlaps "Measurement Period" + ) + + +define "Year Preceding the Measurement Period": + Interval[start of "Measurement Period" - 1 year, start of "Measurement Period") + + +define "Month Before the Year Preceding the Measurement Period": + Interval[start of "Year Preceding the Measurement Period" - 1 month, start of "Year Preceding the Measurement Period") + + +define "Receiving antiretroviral therapy (ART) at 12 months after initiating": + "Date of First Evidence of ART" during "Month Before the Year Preceding the Measurement Period" + and "Receiving antiretroviral therapy (ART) during measurement period" + + +define "Receiving antiretroviral therapy (ART) at 12 months after initiating (pregnant and breastfeeding)": + "Receiving antiretroviral therapy (ART) at 12 months after initiating" + and "Is Pregnant" + // and "Is Breastfeeding" + + +define "Initiated antiretroviral therapy (ART) in the 12 months prior to measurement period": + "Date of First Evidence of ART" during "Year Preceding the Measurement Period" + + +// define "Antenatal Care Visit": +// // [Encounter: Cx."Prenatal initial visit (regime/therapy)"] E +// [Encounter: Cx."Prenatal initial visit (regime/therapy)"] E +// where E.status = 'finished' +// and E.period during Interval[start of "Year Preceding the Measurement Period", end of "Measurement Period"] + + +// define "Live Birth Procedure": +// [Procedure: Cx."Livebirth (finding)"] P +// where P.status = 'completed' + + +// define "Antenatal Care Visit or Live Birth during the Measurement Period": +// ("Is Pregnant" and exists ("Antenatal Care Visit" V where V.period during "Measurement Period")) +// or exists ("Live Birth Procedure" P where P.performed during "Measurement Period") + + +// define "Antenatal Care Visit or Live Birth during Measurement Period (HIV Positive)": +// "Is HIV Positive" +// and "Antenatal Care Visit or Live Birth during the Measurement Period" + + +// define "HIV-positive, pregnant, and receiving antiretroviral therapy (ART) to reduce the risk of mother-to-child-transmission during pregnancy": +// "Is HIV Positive" +// and "Is Pregnant" +// and "Receiving antiretroviral therapy (ART) during measurement period" + + +define "Pregnant and receiving antiretroviral therapy (ART) to reduce the risk of mother-to-child-transmission during pregnancy": + "Is Pregnant" + and "Receiving antiretroviral therapy (ART) during measurement period" + +// define "Viral Load Test Result": +// ["Observation": Cx."Viral Load Test"] O +// where O.status = 'final' +// and O.value is not null + + +// define "Living with HIV and on ART with suppressed viral load results (<1000 copies/mL)": +// "Is HIV Positive" +// and Cx."Receiving antiretroviral therapy (ART) during measurement period" +// and exists ( +// Cx."Viral Load Test Result" R +// where R.effective during "Measurement Period" +// and R.value < 1000 '{copies}/mL' +// ) + + +// define "Received HIV Testing Services (HTS) and Received Test Results": +// ["Observation": Cx."HIV Testing Services"] O +// where O.status = 'final' +// and O.value is not null + + +// define "First antenatal care visit": +// First("Antenatal Care Visit" V sort by start of period) + + +// define "Date of First Evidence of HIV Status": +// Min("HIV Test Observation" O return O.effective) + + +// define "HIV Status Known at First Antenatal Care Visit": +// "Date of First Evidence of HIV Status" on or before start of "First antenatal care visit".period + + +// define "Receiving antiretroviral therapty (ART) and Viral Load Measurement in the past 12 months": +// "Receiving antiretroviral therapy (ART) during measurement period" +// and exists ( +// "Viral Load Test Result" R +// where R.effective during "Year Preceding the Measurement Period" +// ) \ No newline at end of file diff --git a/input/fsh/library.fsh b/input/fsh/library.fsh index 963dc521b..5d168574e 100644 --- a/input/fsh/library.fsh +++ b/input/fsh/library.fsh @@ -37,6 +37,23 @@ Description: "FHIRHelpers" * content.id = "ig-loader-FHIRHelpers.cql" +// ----------------------------- + + +Instance: Debug +InstanceOf: Library +Title: "Debug" +Description: "Debug" +* insert lib-common +* name = "Debug" +* title = "Debug" +* description = "Debug" +* version = "0.1.0" +* url = "https://path-global-health.github.io/MERindicators/Library/Debug" +// * identifier.value = "Debug" +* content.id = "ig-loader-Debug.cql" + + Instance: MERConcepts InstanceOf: Library Title: "MERConcepts" diff --git a/input/fsh/measure.fsh b/input/fsh/measure.fsh index 044fce529..1256fbe84 100644 --- a/input/fsh/measure.fsh +++ b/input/fsh/measure.fsh @@ -93,3 +93,19 @@ Description: "MERTXCURR" * insert common-numonly +Instance: MERDebug +InstanceOf: Measure +Title: "MERDebug" +Description: "MERDebug" +* id = "MERDebug" +* insert meas-common +* name = "MERDebug" +* title = "MERDebug" +* description = "MERDebug" +* url = "https://path-global-health.github.io/MERindicators/Measure/MERDebug" +* identifier[0].value = "MERDebug" +// only numerator +* scoring = $measure-scoring#cohort +* library[+] = Canonical(Debug) +* insert common-numonly + diff --git a/input/tests/Debug/Patient-HIVSimple/Bundle-Example-HIVSimple.json b/input/tests/Debug/Patient-HIVSimple/Bundle-Example-HIVSimple.json new file mode 100644 index 000000000..c5fdd77e1 --- /dev/null +++ b/input/tests/Debug/Patient-HIVSimple/Bundle-Example-HIVSimple.json @@ -0,0 +1,459 @@ +{ + "resourceType": "Bundle", + "id": "Example-HIVSimple", + "type": "transaction", + "entry": [ + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Patient/Patient-HIVSimple", + "request": { + "url": "Patient", + "method": "POST" + }, + "resource": { + "resourceType": "Patient", + "id": "Patient-HIVSimple", + "name": [ + { + "given": [ + "Mittens" + ], + "family": "Cat", + "text": "Mittens Cat" + } + ], + "gender": "female", + "birthDate": "1985-01-01" + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Organization/Organization-HIVSimple1", + "request": { + "url": "Organization", + "method": "POST" + }, + "resource": { + "resourceType": "Organization", + "id": "Organization-HIVSimple1", + "name": "Organization-HIVSimple Government Hospital", + "identifier": [ + { + "system": "https://github.com/synthetichealth/synthea", + "value": "Organization-HIVSimple1" + } + ] + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Location/Location-HIVSimple1", + "request": { + "url": "Location", + "method": "POST" + }, + "resource": { + "resourceType": "Location", + "id": "Location-HIVSimple1", + "identifier": [ + { + "system": "https://github.com/synthetichealth/synthea", + "value": "Location-HIVSimple1" + } + ], + "managingOrganization": { + "identifier": { + "system": "https://github.com/synthetichealth/synthea", + "value": "Organization-HIVSimple1" + } + } + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Condition/Condition-HIVSimple", + "request": { + "url": "Condition", + "method": "POST" + }, + "resource": { + "resourceType": "Condition", + "id": "Condition-HIVSimple", + "clinicalStatus": { + "coding": [ + { + "code": "active", + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical" + } + ] + }, + "verificationStatus": { + "coding": [ + { + "code": "confirmed", + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status" + } + ] + }, + "subject": { + "reference": "Patient/Patient-HIVSimple" + }, + "code": { + "coding": [ + { + "code": "86406008", + "system": "http://snomed.info/sct", + "display": "HIV - Human immunodeficiency virus infection" + } + ] + }, + "onsetDateTime": "2010-01-01" + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Condition/Condition-Pregnancy", + "request": { + "url": "Condition", + "method": "POST" + }, + "resource": { + "resourceType": "Condition", + "id": "Condition-Pregnancy", + "clinicalStatus": { + "coding": [ + { + "code": "inactive", + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical" + } + ] + }, + "verificationStatus": { + "coding": [ + { + "code": "confirmed", + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status" + } + ] + }, + "subject": { + "reference": "Patient/Patient-HIVSimple" + }, + "code": { + "coding": [ + { + "code": "77386006", + "system": "http://snomed.info/sct", + "display": "Pregnancy (finding)" + } + ] + }, + "onsetDateTime": "2020-01-01", + "abatementDateTime": "2020-09-30" + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Encounter/Encounter-HIVSimple", + "request": { + "url": "Encounter", + "method": "POST" + }, + "resource": { + "resourceType": "Encounter", + "id": "Encounter-HIVSimple", + "status": "finished", + "class": { + "code": "ACUTE", + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode" + }, + "subject": { + "reference": "Patient/Patient-HIVSimple" + }, + "serviceProvider": { + "identifier": { + "system": "https://github.com/synthetichealth/synthea", + "value": "Organization-HIVSimple1" + } + }, + "location": [ + { + "location": { + "reference": "Location/Location-HIVSimple1" + } + } + ], + "period": { + "start": "2011-01-01", + "end": "2011-01-01" + } + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/DiagnosticReport/DiagnosticReport-HIVSimple", + "request": { + "url": "DiagnosticReport", + "method": "POST" + }, + "resource": { + "resourceType": "DiagnosticReport", + "id": "DiagnosticReport-HIVSimple", + "status": "final", + "encounter": { + "reference": "Encounter/Encounter-HIVSimple" + }, + "subject": { + "reference": "Patient/Patient-HIVSimple" + }, + "result": [ + { + "reference": "Observation/Observation-HIVSimple" + } + ], + "code": { + "coding": [ + { + "code": "75622-1", + "system": "http://loinc.org", + "display": "HIV 1 and 2 tests - Meaningful Use set" + } + ] + } + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Observation/Observation-HIVSimple", + "request": { + "url": "Observation", + "method": "POST" + }, + "resource": { + "resourceType": "Observation", + "id": "Observation-HIVSimple", + "status": "final", + "encounter": { + "reference": "Encounter/Encounter-HIVSimple" + }, + "subject": { + "reference": "Patient/Patient-HIVSimple" + }, + "code": { + "coding": [ + { + "code": "75622-1", + "system": "http://loinc.org", + "display": "HIV 1 and 2 tests - Meaningful Use set" + } + ] + }, + "valueCodeableConcept": { + "coding": [ + { + "code": "165816005", + "system": "http://snomed.info/sct", + "display": "HIV Positive" + } + ] + } + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Encounter/Encounter-ViralLoad", + "request": { + "url": "Encounter", + "method": "POST" + }, + "resource": { + "resourceType": "Encounter", + "id": "Encounter-ViralLoad", + "status": "finished", + "class": { + "code": "ACUTE", + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode" + }, + "subject": { + "reference": "Patient/Patient-HIVSimple" + }, + "serviceProvider": { + "identifier": { + "system": "https://github.com/synthetichealth/synthea", + "value": "Organization-HIVSimple1" + } + }, + "location": [ + { + "location": { + "reference": "Location/Location-HIVSimple1" + } + } + ], + "period": { + "start": "2020-06-01", + "end": "2020-06-01" + } + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/DiagnosticReport/DiagnosticReport-ViralLoad", + "request": { + "url": "DiagnosticReport", + "method": "POST" + }, + "resource": { + "resourceType": "DiagnosticReport", + "id": "DiagnosticReport-ViralLoad", + "status": "final", + "subject": { + "reference": "Patient/Patient-HIVSimple" + }, + "encounter": { + "reference": "Encounter/Encounter-ViralLoad" + }, + "result": [ + { + "reference": "Observation/Observation-ViralLoad" + } + ], + "code": { + "coding": [ + { + "code": "25836-8", + "system": "http://loinc.org", + "display": "HIV 1 RNA [#/volume] (viral load) in Specimen by NAA with probe detection" + } + ] + } + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Observation/Observation-ViralLoad", + "request": { + "url": "Observation", + "method": "POST" + }, + "resource": { + "resourceType": "Observation", + "id": "Observation-ViralLoad", + "status": "final", + "subject": { + "reference": "Patient/Patient-HIVSimple" + }, + "encounter": { + "reference": "Encounter/Encounter-ViralLoad" + }, + "code": { + "coding": [ + { + "code": "25836-8", + "system": "http://loinc.org", + "display": "HIV 1 RNA [#/volume] (viral load) in Specimen by NAA with probe detection" + } + ] + }, + "valueQuantity": { + "value": 741660, + "unit": "copies/mL", + "system": "http://unitsofmeasure.org", + "code": "{copies}/mL" + }, + "issued": "2020-06-01T13:28:17.239+02:00" + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Encounter/Encounter2-ViralLoad", + "request": { + "url": "Encounter", + "method": "POST" + }, + "resource": { + "resourceType": "Encounter", + "id": "Encounter2-ViralLoad", + "status": "finished", + "class": { + "code": "ACUTE", + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode" + }, + "subject": { + "reference": "Patient/Patient-HIVSimple" + }, + "serviceProvider": { + "identifier": { + "system": "https://github.com/synthetichealth/synthea", + "value": "Organization-HIVSimple1" + } + }, + "location": [ + { + "location": { + "reference": "Location/Location-HIVSimple1" + } + } + ], + "period": { + "start": "2020-06-01", + "end": "2020-06-01" + } + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/DiagnosticReport/DiagnosticReport2-ViralLoad", + "request": { + "url": "DiagnosticReport", + "method": "POST" + }, + "resource": { + "resourceType": "DiagnosticReport", + "id": "DiagnosticReport2-ViralLoad", + "status": "final", + "subject": { + "reference": "Patient/Patient-HIVSimple" + }, + "encounter": { + "reference": "Encounter/Encounter2-ViralLoad" + }, + "result": [ + { + "reference": "Observation/Observation2-ViralLoad" + } + ], + "code": { + "coding": [ + { + "code": "25836-8", + "system": "http://loinc.org", + "display": "HIV 1 RNA [#/volume] (viral load) in Specimen by NAA with probe detection" + } + ] + } + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Observation/Observation2-ViralLoad", + "request": { + "url": "Observation", + "method": "POST" + }, + "resource": { + "resourceType": "Observation", + "id": "Observation2-ViralLoad", + "status": "final", + "subject": { + "reference": "Patient/Patient-HIVSimple" + }, + "encounter": { + "reference": "Encounter/Encounter2-ViralLoad" + }, + "code": { + "coding": [ + { + "code": "25836-8", + "system": "http://loinc.org", + "display": "HIV 1 RNA [#/volume] (viral load) in Specimen by NAA with probe detection" + } + ] + }, + "valueQuantity": { + "value": 800, + "unit": "copies/mL", + "system": "http://unitsofmeasure.org", + "code": "{copies}/mL" + }, + "issued": "2020-09-01T13:28:17.239+02:00" + } + } + ] +} diff --git a/input/tests/Debug/Patient-HIVSimple2/Bundle-Example-HIVSimple2.json b/input/tests/Debug/Patient-HIVSimple2/Bundle-Example-HIVSimple2.json new file mode 100644 index 000000000..dc1d1cb78 --- /dev/null +++ b/input/tests/Debug/Patient-HIVSimple2/Bundle-Example-HIVSimple2.json @@ -0,0 +1,356 @@ +{ + "resourceType": "Bundle", + "id": "Example-HIVSimple2", + "type": "transaction", + "entry": [ + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Patient/Patient-HIVSimple2", + "request": { + "url": "Patient", + "method": "POST" + }, + "resource": { + "resourceType": "Patient", + "id": "Patient-HIVSimple2", + "name": [ + { + "given": [ + "Mittens" + ], + "family": "Cat", + "text": "Mittens Cat" + } + ], + "gender": "female", + "birthDate": "1985-01-01" + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Organization/Organization-HIVSimple2", + "request": { + "url": "Organization", + "method": "POST" + }, + "resource": { + "resourceType": "Organization", + "id": "Organization-HIVSimple2", + "name": "Organization-HIVSimple2 Government Hospital", + "identifier": [ + { + "system": "https://github.com/synthetichealth/synthea", + "value": "Organization-HIVSimple2" + } + ] + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Location/Location-HIVSimple2", + "request": { + "url": "Location", + "method": "POST" + }, + "resource": { + "resourceType": "Location", + "id": "Location-HIVSimple2", + "identifier": [ + { + "system": "https://github.com/synthetichealth/synthea", + "value": "Location-HIVSimple2" + } + ], + "managingOrganization": { + "identifier": { + "system": "https://github.com/synthetichealth/synthea", + "value": "Organization-HIVSimple2" + } + } + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Condition/Condition-HIVSimple2", + "request": { + "url": "Condition", + "method": "POST" + }, + "resource": { + "resourceType": "Condition", + "id": "Condition-HIVSimple2", + "clinicalStatus": { + "coding": [ + { + "code": "active", + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical" + } + ] + }, + "verificationStatus": { + "coding": [ + { + "code": "confirmed", + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status" + } + ] + }, + "subject": { + "reference": "Patient/Patient-HIVSimple2" + }, + "code": { + "coding": [ + { + "code": "86406008", + "system": "http://snomed.info/sct", + "display": "HIV - Human immunodeficiency virus infection" + } + ] + }, + "onsetDateTime": "2010-01-01" + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Condition/Condition-Pregnancy2", + "request": { + "url": "Condition", + "method": "POST" + }, + "resource": { + "resourceType": "Condition", + "id": "Condition-Pregnancy2", + "clinicalStatus": { + "coding": [ + { + "code": "inactive", + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical" + } + ] + }, + "verificationStatus": { + "coding": [ + { + "code": "confirmed", + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status" + } + ] + }, + "subject": { + "reference": "Patient/Patient-HIVSimple2" + }, + "code": { + "coding": [ + { + "code": "77386006", + "system": "http://snomed.info/sct", + "display": "Pregnancy (finding)" + } + ] + }, + "onsetDateTime": "2020-01-01", + "abatementDateTime": "2020-09-30" + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Encounter/Encounter-HIVSimple2", + "request": { + "url": "Encounter", + "method": "POST" + }, + "resource": { + "resourceType": "Encounter", + "id": "Encounter-HIVSimple2", + "status": "finished", + "class": { + "code": "ACUTE", + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode" + }, + "subject": { + "reference": "Patient/Patient-HIVSimple2" + }, + "serviceProvider": { + "identifier": { + "system": "https://github.com/synthetichealth/synthea", + "value": "Organization-HIVSimple2" + } + }, + "location": [ + { + "location": { + "reference": "Location/Location-HIVSimple2" + } + } + ], + "period": { + "start": "2011-01-01", + "end": "2011-01-01" + } + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/DiagnosticReport/DiagnosticReport-HIVSimple2", + "request": { + "url": "DiagnosticReport", + "method": "POST" + }, + "resource": { + "resourceType": "DiagnosticReport", + "id": "DiagnosticReport-HIVSimple2", + "status": "final", + "encounter": { + "reference": "Encounter/Encounter-HIVSimple2" + }, + "subject": { + "reference": "Patient/Patient-HIVSimple2" + }, + "result": [ + { + "reference": "Observation/Observation-HIVSimple2" + } + ], + "code": { + "coding": [ + { + "code": "75622-1", + "system": "http://loinc.org", + "display": "HIV 1 and 2 tests - Meaningful Use set" + } + ] + } + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Observation/Observation-HIVSimple2", + "request": { + "url": "Observation", + "method": "POST" + }, + "resource": { + "resourceType": "Observation", + "id": "Observation-HIVSimple2", + "status": "final", + "encounter": { + "reference": "Encounter/Encounter-HIVSimple2" + }, + "subject": { + "reference": "Patient/Patient-HIVSimple2" + }, + "code": { + "coding": [ + { + "code": "75622-1", + "system": "http://loinc.org", + "display": "HIV 1 and 2 tests - Meaningful Use set" + } + ] + }, + "valueCodeableConcept": { + "coding": [ + { + "code": "165816005", + "system": "http://snomed.info/sct", + "display": "HIV Positive" + } + ] + } + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Encounter/Encounter-ViralLoad2", + "request": { + "url": "Encounter", + "method": "POST" + }, + "resource": { + "resourceType": "Encounter", + "id": "Encounter-ViralLoad2", + "status": "finished", + "class": { + "code": "ACUTE", + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode" + }, + "subject": { + "reference": "Patient/Patient-HIVSimple2" + }, + "serviceProvider": { + "identifier": { + "system": "https://github.com/synthetichealth/synthea", + "value": "Organization-HIVSimple2" + } + }, + "location": [ + { + "location": { + "reference": "Location/Location-HIVSimple2" + } + } + ], + "period": { + "start": "2020-06-01", + "end": "2020-06-01" + } + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/DiagnosticReport/DiagnosticReport-ViralLoad2", + "request": { + "url": "DiagnosticReport", + "method": "POST" + }, + "resource": { + "resourceType": "DiagnosticReport", + "id": "DiagnosticReport-ViralLoad2", + "status": "final", + "subject": { + "reference": "Patient/Patient-HIVSimple2" + }, + "encounter": { + "reference": "Encounter/Encounter-ViralLoad2" + }, + "result": [ + { + "reference": "Observation/Observation-ViralLoad2" + } + ], + "code": { + "coding": [ + { + "code": "25836-8", + "system": "http://loinc.org", + "display": "HIV 1 RNA [#/volume] (viral load) in Specimen by NAA with probe detection" + } + ] + } + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Observation/Observation-ViralLoad2", + "request": { + "url": "Observation", + "method": "POST" + }, + "resource": { + "resourceType": "Observation", + "id": "Observation-ViralLoad2", + "status": "final", + "subject": { + "reference": "Patient/Patient-HIVSimple2" + }, + "encounter": { + "reference": "Encounter/Encounter-ViralLoad2" + }, + "code": { + "coding": [ + { + "code": "25836-8", + "system": "http://loinc.org", + "display": "HIV 1 RNA [#/volume] (viral load) in Specimen by NAA with probe detection" + } + ] + }, + "valueQuantity": { + "value": 741660, + "unit": "copies/mL", + "system": "http://unitsofmeasure.org", + "code": "{copies}/mL" + } + } + } + ] +} diff --git a/input/tests/Debug/PatientCIEL/Bundle-ExampleCIEL.json b/input/tests/Debug/PatientCIEL/Bundle-ExampleCIEL.json new file mode 100644 index 000000000..7330df4e1 --- /dev/null +++ b/input/tests/Debug/PatientCIEL/Bundle-ExampleCIEL.json @@ -0,0 +1,126 @@ +{ + "resourceType": "Bundle", + "id": "ExampleCIEL", + "type": "transaction", + "entry": [ + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Patient/PatientCIEL", + "request": { + "url": "Patient", + "method": "POST" + }, + "resource": { + "resourceType": "Patient", + "id": "PatientCIEL", + "name": [ + { + "given": [ + "Mittens" + ], + "family": "Cat", + "text": "Mittens Cat" + } + ], + "gender": "female", + "birthDate": "1985-01-01" + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Organization/OrganizationCIEL", + "request": { + "url": "Organization", + "method": "POST" + }, + "resource": { + "resourceType": "Organization", + "id": "OrganizationCIEL", + "name": "OrganizationCIEL Government Hospital" + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Location/LocationCIEL", + "request": { + "url": "Location", + "method": "POST" + }, + "resource": { + "resourceType": "Location", + "id": "LocationCIEL" + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Condition/Condition-PregnancyCIEL", + "request": { + "url": "Condition", + "method": "POST" + }, + "resource": { + "resourceType": "Condition", + "id": "Condition-PregnancyCIEL", + "clinicalStatus": { + "coding": [ + { + "code": "inactive", + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical" + } + ] + }, + "verificationStatus": { + "coding": [ + { + "code": "confirmed", + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status" + } + ] + }, + "subject": { + "reference": "Patient/PatientCIEL" + }, + "code": { + "coding": [ + { + "code": "77386006", + "system": "http://snomed.info/sct", + "display": "Pregnancy (finding)" + } + ] + }, + "onsetDateTime": "2020-01-01", + "abatementDateTime": "2020-09-30" + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Observation/ObservationCIEL", + "request": { + "url": "Observation", + "method": "POST" + }, + "resource": { + "resourceType": "Observation", + "id": "ObservationCIEL", + "status": "final", + "subject": { + "reference": "Patient/PatientCIEL" + }, + "code": { + "coding": [ + { + "code": "160119", + "system": "https://openconceptlab.org/orgs/CIEL/sources/CIEL", + "display": "CURRENTLY TAKING ARV" + } + ] + }, + "valueCodeableConcept": { + "coding": [ + { + "code": "1065", + "system": "https://openconceptlab.org/orgs/CIEL/sources/CIEL", + "display": "YES" + } + ] + } + } + } + ] +} diff --git a/input/tests/Debug/PatientOMRS0/Bundle-ExampleOMRS0.json b/input/tests/Debug/PatientOMRS0/Bundle-ExampleOMRS0.json new file mode 100644 index 000000000..696180818 --- /dev/null +++ b/input/tests/Debug/PatientOMRS0/Bundle-ExampleOMRS0.json @@ -0,0 +1,185 @@ +{ + "resourceType": "Bundle", + "id": "ExampleOMRS0", + "type": "transaction", + "entry": [ + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Patient/PatientOMRS0", + "request": { + "url": "Patient", + "method": "POST" + }, + "resource": { + "resourceType": "Patient", + "id": "PatientOMRS0", + "meta": { + "profile": [ + "http://fhir.openmrs.org/core/StructureDefinition/omrs-patient" + ] + }, + "active": true, + "identifier": [ + { + "extension": [ + { + "url": "http://fhir.openmrs.org/core/StructureDefinition/omrs-patient-identifier-location", + "valueReference": { + "reference": "Location/a3b793f0-eb53-4cda-92ce-fe0a77106252", + "type": "Location", + "display": "Inpatient Ward" + } + } + ], + "use": "official", + "type": { + "coding": [ + { + "code": "MR", + "system": "http://terminology.hl7.org/CodeSystem/v2-0203" + } + ], + "text": "OpenMRS ID" + }, + "value": "4343534" + } + ], + "name": [ + { + "family": "Jeannette", + "given": [ + "Ricky" + ] + } + ], + "gender": "male", + "birthDate": "1996-12-12", + "telecom": [ + { + "value": "+256788232241", + "system": "phone" + } + ], + "address": [ + { + "use": "home", + "country": "Washington", + "city": "Washington", + "district": "Washington" + } + ], + "deceasedBoolean": false + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Location/LocationExample", + "request": { + "url": "Location", + "method": "POST" + }, + "resource": { + "resourceType": "Location", + "id": "a3b793f0-eb53-4cda-92ce-fe0a77106252", + "meta": { + "profile": [ + "http://fhir.openmrs.org/core/StructureDefinition/omrs-location" + ] + }, + "status": "active", + "name": "Outpatient Clinic", + "description": "Outpatient Clinic", + "type": [ + { + "coding": [ + { + "code": "SLEEP", + "system": "http://terminology.hl7.org/CodeSystem/v3-RoleCode", + "display": "Sleep disorders unit" + } + ] + } + ], + "telecom": [ + { + "system": "phone", + "value": "(+1) 734-677-7777" + }, + { + "system": "fax", + "value": "(+1) 734-677-6622" + }, + { + "system": "email", + "value": "hq@HL7.org" + } + ], + "address": { + "use": "home", + "line": [ + "3300 Washtenaw Avenue, Suite 227" + ], + "city": "Ann Arbor", + "district": "Mukono", + "state": "MI", + "postalCode": "48104", + "country": "USA" + }, + "position": { + "latitude": 42.2565, + "longitude": -83.69471 + } + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Observation/ObservationOMRS0", + "request": { + "url": "Observation", + "method": "POST" + }, + "resource": { + "resourceType": "Observation", + "id": "ObservationOMRS0", + "meta": { + "profile": [ + "http://fhir.openmrs.org/core/StructureDefinition/OpenMRS-observation" + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "exam" + } + ] + } + ], + "code": { + "coding": [ + { + "code": "160119", + "system": "https://openconceptlab.org/orgs/CIEL/sources/CIEL", + "display": "Currently taking ARV" + } + ], + "text": "Currently taking ARV" + }, + "status": "final", + "subject": { + "reference": "Patient/PatientOMRS0" + }, + "encounter": { + "reference": "Encounter/5b829d01-34bb-47d1-b1bb-9303c3a9ebcb" + }, + "valueCodeableConcept": { + "coding": [ + { + "code": "1065", + "system": "https://openconceptlab.org/orgs/CIEL/sources/CIEL", + "display": "Yes" + } + ] + } + } + } + ] +} diff --git a/input/tests/Debug/example-openmrs-Patient/Bundle-Example0.json b/input/tests/Debug/example-openmrs-Patient/Bundle-Example0.json new file mode 100644 index 000000000..e049c1e2e --- /dev/null +++ b/input/tests/Debug/example-openmrs-Patient/Bundle-Example0.json @@ -0,0 +1,328 @@ +{ + "resourceType": "Bundle", + "id": "Example0", + "type": "transaction", + "entry": [ + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Patient/example-openmrs-Patient", + "request": { + "url": "Patient", + "method": "POST" + }, + "resource": { + "resourceType": "Patient", + "id": "example-openmrs-Patient", + "meta": { + "profile": [ + "http://fhir.openmrs.org/core/StructureDefinition/omrs-patient" + ] + }, + "active": true, + "identifier": [ + { + "extension": [ + { + "url": "http://fhir.openmrs.org/core/StructureDefinition/omrs-patient-identifier-location", + "valueReference": { + "reference": "Location/a3b793f0-eb53-4cda-92ce-fe0a77106252", + "type": "Location", + "display": "Inpatient Ward" + } + } + ], + "use": "official", + "type": { + "coding": [ + { + "code": "MR", + "system": "http://terminology.hl7.org/CodeSystem/v2-0203" + } + ], + "text": "OpenMRS ID" + }, + "value": "4343534" + } + ], + "name": [ + { + "family": "Jeannette", + "given": [ + "Ricky" + ] + } + ], + "gender": "male", + "birthDate": "1996-12-12", + "telecom": [ + { + "value": "+256788232241", + "system": "phone" + } + ], + "address": [ + { + "use": "home", + "country": "Washington", + "city": "Washington", + "district": "Washington" + } + ], + "deceasedBoolean": false + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Location/LocationExample", + "request": { + "url": "Location", + "method": "POST" + }, + "resource": { + "resourceType": "Location", + "id": "a3b793f0-eb53-4cda-92ce-fe0a77106252", + "meta": { + "profile": [ + "http://fhir.openmrs.org/core/StructureDefinition/omrs-location" + ] + }, + "status": "active", + "name": "Outpatient Clinic", + "description": "Outpatient Clinic", + "type": [ + { + "coding": [ + { + "code": "SLEEP", + "system": "http://terminology.hl7.org/CodeSystem/v3-RoleCode", + "display": "Sleep disorders unit" + } + ] + } + ], + "telecom": [ + { + "system": "phone", + "value": "(+1) 734-677-7777" + }, + { + "system": "fax", + "value": "(+1) 734-677-6622" + }, + { + "system": "email", + "value": "hq@HL7.org" + } + ], + "address": { + "use": "home", + "line": [ + "3300 Washtenaw Avenue, Suite 227" + ], + "city": "Ann Arbor", + "district": "Mukono", + "state": "MI", + "postalCode": "48104", + "country": "USA" + }, + "position": { + "latitude": 42.2565, + "longitude": -83.69471 + } + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Condition/ConditionExample", + "request": { + "url": "Condition", + "method": "POST" + }, + "resource": { + "resourceType": "Condition", + "id": "a6867095-e2b1-4a68-9aaa-0d161a37ce9c", + "meta": { + "profile": [ + "http://fhir.openmrs.org/core/StructureDefinition/omrs-Condition" + ] + }, + "code": { + "coding": [ + { + "system": "https://openconceptlab.org/orgs/CIEL/sources/CIEL", + "code": "116128" + } + ] + }, + "subject": { + "reference": "Patient/example-openmrs-Patient", + "type": "Patient", + "identifier": { + "use": "official", + "value": "101-6" + }, + "display": "Horatio Hornblower (OpenMRS ID:101-6)" + }, + "recordedDate": "2019-06-18T06:37:26+03:00" + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Encounter/EncounterExample", + "request": { + "url": "Encounter", + "method": "POST" + }, + "resource": { + "resourceType": "Encounter", + "id": "5b829d01-34bb-47d1-b1bb-9303c3a9ebcb", + "meta": { + "profile": [ + "http://fhir.openmrs.org/core/StructureDefinition/omrs-encounter" + ] + }, + "status": "unknown", + "class": { + "code": "AMB", + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode" + }, + "subject": { + "reference": "Patient/example-openmrs-Patient", + "type": "Patient" + }, + "type": [ + { + "coding": [ + { + "code": "67a71486-1a54-468f-ac3e-7091a9a79584", + "display": "Vitals", + "system": "http://fhir.openmrs.org/code-system/encounter-type" + } + ] + } + ], + "period": { + "start": "2022-06-22", + "end": "2022-06-22" + }, + "location": [ + { + "location": { + "reference": "Location/a3b793f0-eb53-4cda-92ce-fe0a77106252" + } + } + ] + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/DiagnosticReport/example-Openmrs-DiagnosticReport", + "request": { + "url": "DiagnosticReport", + "method": "POST" + }, + "resource": { + "resourceType": "DiagnosticReport", + "id": "8a849d5e-6011-4279-a124-40ada5a687de", + "meta": { + "profile": [ + "http://fhir.openmrs.org/core/StructureDefinition/OpenMRS-diagnostic-report" + ] + }, + "code": { + "coding": [ + { + "code": "8480-6", + "system": "http://loinc.org", + "display": "Systolic blood pressure" + } + ] + }, + "subject": { + "reference": "Patient/example-openmrs-Patient" + }, + "encounter": { + "reference": "Encounter/5b829d01-34bb-47d1-b1bb-9303c3a9ebcb" + }, + "result": [ + { + "reference": "Observation/example-openmrs-Observation" + } + ], + "issued": "2011-03-04T11:45:33+11:00", + "status": "final" + } + }, + { + "fullUrl": "https://path-global-health.github.io/MERindicators/Observation/example-openmrs-Observation", + "request": { + "url": "Observation", + "method": "POST" + }, + "resource": { + "resourceType": "Observation", + "id": "example-openmrs-Observation", + "meta": { + "profile": [ + "http://fhir.openmrs.org/core/StructureDefinition/OpenMRS-observation" + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "exam" + } + ] + } + ], + "code": { + "coding": [ + { + "code": "431314004", + "system": "http://snomed.info/sct", + "display": "SpO2 - saturation of peripheral oxygen" + } + ], + "text": "Arterial blood oxygen saturation (pulse oximeter)" + }, + "status": "final", + "subject": { + "reference": "Patient/example-openmrs-Patient" + }, + "encounter": { + "reference": "Encounter/5b829d01-34bb-47d1-b1bb-9303c3a9ebcb" + }, + "valueQuantity": { + "value": 25, + "unit": "DEG C" + }, + "interpretation": [ + { + "coding": [ + { + "code": "H", + "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", + "display": "High" + } + ] + } + ], + "referenceRange": [ + { + "low": { + "value": 10 + }, + "high": { + "value": 272 + }, + "type": { + "coding": [ + { + "system": "http://fhir.openmrs.org/ext/obs/reference-range", + "code": "absolute" + } + ] + } + } + ] + } + } + ] +}