diff --git a/input/fsh/examples/IMMZ.D1.QuestionnaireResponse.YF.fsh b/input/fsh/examples/IMMZ.D1.QuestionnaireResponse.YF.fsh new file mode 100644 index 0000000000..a9418e5943 --- /dev/null +++ b/input/fsh/examples/IMMZ.D1.QuestionnaireResponse.YF.fsh @@ -0,0 +1,47 @@ +Instance: Example.IMMZ.D1.QuestionnaireResponse.YF +InstanceOf: QuestionnaireResponse +Usage: #example +* status = #completed +* authored = "2023-10-18T19:20:20.913Z" +* questionnaire = Canonical(QIMMZD1ClientHistoryYellowFever) +* subject = Reference(patient654321) + +* item[+] + * linkId = "birth" + * answer.valueBoolean = false +* item[+] + * linkId = "booster" + * answer.valueBoolean = false +* item[+] + * linkId = "completedPrimarySeries" + * answer.valueBoolean = true +* item[+] + * linkId = "dateSeriesCompleted" + * answer.valueDate = "2023-01-01" +* item[+] + * linkId = "hivStatus" + * answer.valueCoding = IMMZ.D1#DE11 +* item[+] + * linkId = "pretermBirth" + * answer.valueBoolean = false +* item[+] + * linkId = "immunocompromised" + * answer.valueBoolean = false +* item[+] + * linkId = "OnART" + * answer.valueBoolean = true +* item[+] + * linkId = "severelyImmunosuppressed" + * answer.valueBoolean = true +* item[+] + * linkId = "artStartDate" + * answer.valueDate = "2022-06-01" +* item[+] + * linkId = "vaccineHistory" + * item[+] + * linkId = "vaccineType" + * answer.valueCoding = $ICD11#XM0N24 + * item[+] + * linkId = "vaccineDate" + * answer.valueDate = "2023-04-05" + diff --git a/input/fsh/models/IMMZD1ClientHistoryYellowFever.fsh b/input/fsh/models/IMMZD1ClientHistoryYellowFever.fsh index ecd54b1ece..4a06888d10 100644 --- a/input/fsh/models/IMMZD1ClientHistoryYellowFever.fsh +++ b/input/fsh/models/IMMZD1ClientHistoryYellowFever.fsh @@ -33,17 +33,12 @@ Description: "Data elements for the IMMZ.D1 Capture Client History Data Diction * ^code[+] = $SCT#370388006 * onART 0..1 boolean "Currently on ART" "The client is currently receiving antiretroviral therapy (ART)" * ^code[+] = IMMZ.D1#DE17 -* severelyImmunosuppressed 1..1 boolean "Severely immunosuppressed" "The client is known to be severely immunocompromised or immunosuppressed" - * ^code[+] = IMMZ.D1#DE92 - * ^code[=] = $LNC#96381-9 -* artStartDate 1..1 date "ART start date" "The date on which the client started or restarted antiretroviral therapy (ART)" - * ^code[+] = IMMZ.D1#DE49 * vaccineHistory 0..* BackboneElement "Vaccine History" "History of previous vaccine doses." * vaccineType 0..1 Coding "Vaccine type" "Vaccine type/category that was administered or was to be administered. Any vaccine code available in the IMMZ.Z Vaccine Library list of codes applies in this data element" * ^code[+] = IMMZ.D#DE19 * ^code[+] = $LNC#39236-5 * ^code[+] = $SCT#787859002 - * vaccineType from IMMZ.Z.DE9 + * vaccineType from IMMZ.Z.DE23 * vaccineDate 0..1 date "Date and time of vaccination" "Represents the visit/encounter date, which is the date and time when the vaccine was administered to the client" * ^code[+] = IMMZ.D#DE20 * ^code[+] = $LNC#30952-6 \ No newline at end of file diff --git a/input/fsh/questionnaires/QIMMZD1ClientHistoryYellowFever.fsh b/input/fsh/questionnaires/QIMMZD1ClientHistoryYellowFever.fsh new file mode 100644 index 0000000000..e8dddb8e36 --- /dev/null +++ b/input/fsh/questionnaires/QIMMZD1ClientHistoryYellowFever.fsh @@ -0,0 +1,74 @@ +Instance: QIMMZD1ClientHistoryYellowFever +InstanceOf: sdc-questionnaire-extr-smap +Title: "Capture Client History Questionnaire" +Description: "Immunization - Capture Client History Questionnaire" +Usage: #definition +* id = "IMMZD1ClientHistoryYellowFever" +* version = "2023" +* status = #draft +* subjectType = #Patient +* language = #en +* status = #draft +* contained[+] = IMMZ.D1.DE10 +* contained[+] = IMMZ.D1.DE103 + +* extension[+].url = "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-targetStructureMap" +* extension[=].valueCanonical = "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1QRToResources" + + +* insert Question(birth, Indicates if the client received a dose within 24 hours of birth. Whether a birth dose is counted as part of the primary series will depend on the antigen., boolean, false, false) +* item[=] + * code[+] = IMMZ.D1#DE109 +* insert Question(type, The type of dose in a series that the client received, choice, false, true) +* item[=] + * answerValueSet = Canonical(IMMZ.D1.DE103) + * code[+] = IMMZ.D1#DE103 +* insert Question(booster, Indicates if the client has completed the booster series of a product/antigen, boolean, false, false) +* item[=] + * code[+] = IMMZ.D1#DE102 +* insert Question(completedPrimarySeries, Indicates if the client has completed the primary vaccination series of a product/antigen. If the client has not yet completed their primary series\, it means they may be expected to receive more doses to complete their vaccination regimen for the respective product/antigen., boolean, false, false) +* item[=] + * code[+] = IMMZ.D1#DE8 +* insert Question(dateSeriesCompleted, The date when the client completed the primary vaccination series - per product/antigen, date, false, false) +* item[=] + * code[+] = IMMZ.D1#DE81 +* insert Question(hivStatus, The current human immunodeficiency virus HIV status of the client, choice, false, false) +* item[=] + * answerValueSet = Canonical(IMMZ.D1.DE10) + * code[+] = IMMZ.D1#DE10 + * code[+] = $LNC#55277-8 + * code[+] = $SCT#278977008 +* insert Question(pretermBirth, The infant was preterm; the mother gave birth to the infant when gestational age was less than 37 weeks, boolean, false, false) +* item[=] + * code[+] = IMMZ.D1#DE15 + * code[+] = $ICD11#KA21.4 + * code[+] = $LNC#76517-2 + * code[+] = $SCT#395507008 +* insert Question(immunocompromised, The client is known to be immunocompromised. This means the client has a weakened immune system and having a reduced ability to fight infections and other diseases, boolean, true, false) +* item[=] + * code[+] = IMMZ.D1#DE16 + * code[+] = $ICD11#4B4Z + * code[+] = $LNC#96381-9 + * code[+] = $SCT#370388006 +* insert Question(onART, The client is currently receiving antiretroviral therapy - ART, boolean, false, false) +* item[=] + * code[+] = IMMZ.D1#DE17 +* insert Question(severelyImmunosuppressed, The client is known to be severely immunocompromised or immunosuppressed, boolean, true, false) +* item[=] + * code[+] = IMMZ.D1#DE92 + * code[+] = $LNC#96381-9 +* insert Question(artStartDate, The date on which the client started or restarted antiretroviral therapy ART, date, false, false) +* item[=] + * code[+] = IMMZ.D1#DE49 +* insert Question(vaccineHistory, Vaccine History, group, false, true) +* item[=] + * insert Question(vaccineType, Vaccine type/category that was administered or was to be administered. Any vaccine code available in the IMMZ.Z Vaccine Library list of codes applies in this data element, choice, true, false) + * item[=] + * answerValueSet = Canonical(IMMZ.Z.DE23) + * code[+] = IMMZ.D#DE19 + * code[+] = $LNC#39236-5 + * code[+] = $SCT#787859002 + * insert Question(vaccineDate, Represents the visit/encounter date\, which is the date and time when the vaccine was administered to the client, date, true, false) + * item[=] + * code[+] = IMMZ.D#DE20 + * code[+] = $LNC#30952-6 \ No newline at end of file diff --git a/input/maps/IMMZD1YellowFeverLMToResources.fml b/input/maps/IMMZD1YellowFeverLMToResources.fml new file mode 100644 index 0000000000..7518af83e4 --- /dev/null +++ b/input/maps/IMMZD1YellowFeverLMToResources.fml @@ -0,0 +1,128 @@ +map "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1YellowFeverLMToResources" = "IMMZD1YellowFeverLMToResources" + +uses "http://smart.who.int/ig/smart-immunizations/StructureDefinition/IMMZD1ClientHistoryYellowFever" alias IMMZD1 as source +uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target + +group IMMZD1ToBundle (source immz : IMMZD1, target bundle: Bundle) { + immz -> bundle.type = 'collection' "SetCollection"; + + immz.patient as patient then { + + + immz.birth as content -> bundle.entry as entry, entry.resource = create('Observation') as obs then { + patient -> obs.subject = patient "SetPatient"; + content -> obs.code as code then { + content -> code.coding as coding then { + content -> coding.system = 'http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.D1' "SetObsSystem"; + content -> coding.code = 'DE109' "SetObsCode"; + } "SetObsCoding"; + } "SetObsCode"; + content -> obs.value = content "SetValue"; + } "SetBirthObservation"; + + immz.type as content -> bundle.entry as entry, entry.resource = create('Observation') as obs then { + patient -> obs.subject = patient "SetPatient"; + content -> obs.code as code then { + content -> code.coding as coding then { + content -> coding.system = 'http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.D1' "SetObsSystem"; + content -> coding.code = 'DE103' "SetObsCode"; + } "SetObsCoding"; + } "SetObsCode"; + content -> obs.valueCodeableConcept as code then { + content -> code.coding = content "SetCoding"; + } "SetCodeableConcept"; + } "SetTypeObservation"; + + immz.booster as content -> bundle.entry as entry, entry.resource = create('Observation') as obs then { + patient -> obs.subject = patient "SetPatient"; + content -> obs.code as code then { + content -> code.coding as coding then { + content -> coding.system = 'http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.D1' "SetObsSystem"; + content -> coding.code = 'DE102' "SetObsCode"; + } "SetObsCoding"; + } "SetObsCode"; + content -> obs.value = content "SetValue"; + } "SetBoosterObservation"; + + immz.completedPrimarySeries as content -> bundle.entry as entry, entry.resource = create('Observation') as obs then { + patient -> obs.subject = patient "SetPatient"; + content -> obs.code as code then { + content -> code.coding as coding then { + content -> coding.system = 'http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.D1' "SetObsSystem"; + content -> coding.code = 'DE8' "SetObsCode"; + } "SetObsCoding"; + } "SetObsCode"; + content -> obs.value = content "SetValue"; + } "SetPrimarySeriesObservation"; + + immz.dateSeriesCompleted as content -> bundle.entry as entry, entry.resource = create('Observation') as obs then { + patient -> obs.subject = patient "SetPatient"; + content -> obs.code as code then { + content -> code.coding as coding then { + content -> coding.system = 'http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.D1' "SetObsSystem"; + content -> coding.code = 'DE81' "SetObsCode"; + } "SetObsCoding"; + } "SetObsCode"; + content -> obs.value = content "SetValue"; + } "SetDateSeriesObservation"; + + immz.hivStatus as content -> bundle.entry as entry, entry.resource = create('Observation') as obs then { + patient -> obs.subject = patient "SetPatient"; + content -> obs.code as code then { + content -> code.coding as coding then { + content -> coding.system = 'http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.D1' "SetObsSystem"; + content -> coding.code = 'DE10' "SetObsCode"; + } "SetObsCoding"; + } "SetObsCode"; + content -> obs.valueCodeableConcept as code then { + content -> code.coding = content "SetCoding"; + } "SetCodeableConcept"; + } "SetHIVStatusObservation"; + + immz.pretermBirth as content -> bundle.entry as entry, entry.resource = create('Observation') as obs then { + patient -> obs.subject = patient "SetPatient"; + content -> obs.code as code then { + content -> code.coding as coding then { + content -> coding.system = 'http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.D1' "SetObsSystem"; + content -> coding.code = 'DE15' "SetObsCode"; + } "SetObsCoding"; + } "SetObsCode"; + content -> obs.value = content "SetValue"; + } "SetPretermBirthObservation"; + + immz.immunocompromised as content -> bundle.entry as entry, entry.resource = create('Observation') as obs then { + patient -> obs.subject = patient "SetPatient"; + content -> obs.code as code then { + content -> code.coding as coding then { + content -> coding.system = 'http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.D1' "SetObsSystem"; + content -> coding.code = 'DE16' "SetObsCode"; + } "SetObsCoding"; + } "SetObsCode"; + content -> obs.value = content "SetValue"; + } "SetImmunocompromisedObservation"; + + immz.onART as content -> bundle.entry as entry, entry.resource = create('Observation') as obs then { + patient -> obs.subject = patient "SetPatient"; + content -> obs.code as code then { + content -> code.coding as coding then { + content -> coding.system = 'http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.D1' "SetObsSystem"; + content -> coding.code = 'DE17' "SetObsCode"; + } "SetObsCoding"; + } "SetObsCode"; + content -> obs.value = content "SetValue"; + } "SetOnARTObservation"; + + immz.vaccineHistory as history -> bundle.entry as entry, entry.resource = create('Immunization') as imm then { + patient -> imm.patient = patient "SetPatient"; + history -> imm.status = 'completed' "SetStatus"; + + history.vaccineType as vaccine -> imm.vaccineCode as code then { + vaccine -> code.coding = vaccine "SetVaccineCoding"; + } "SetVaccineType"; + history.vaccineDate as date -> imm.occurrence = cast(date, 'dateTime') "SetDate"; + + } "SetVaccineHistoryObservation"; + + } "GetPatient"; + +} diff --git a/input/maps/IMMZD1YellowFeverQRToLM.fml b/input/maps/IMMZD1YellowFeverQRToLM.fml new file mode 100644 index 0000000000..5315f91a4f --- /dev/null +++ b/input/maps/IMMZD1YellowFeverQRToLM.fml @@ -0,0 +1,64 @@ +map "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1YellowFeverQRToLM" = "IMMZD1YellowFeverQRToLM" + +uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QResp as source +uses "http://smart.who.int/ig/smart-immunizations/StructureDefinition/IMMZD1ClientHistoryYellowFever" alias IMMZD1 as target + +group QRespToIMMZD1 ( source qr : QResp, target immz : IMMZD1) { + + qr.subject as patient -> immz.patient = patient "SetPatient"; + + qr.item as item then { + + item.answer first as answer where item.linkId = 'birth' then { + answer.value as content -> immz.birth = content "SetBirth"; + } "FirstAnswerForBirth"; + + item.answer as answer where item.linkId = 'type' then { + answer.value as coding -> immz.type = coding "SetVaccineType"; + } "AnswerForType"; + + item.answer first as answer where item.linkId = 'booster' then { + answer.value as content -> immz.booster = content "SetBooster"; + } "FirstAnswerForBooster"; + + item.answer first as answer where item.linkId = 'completedPrimarySeries' then { + answer.value as content -> immz.completedPrimarySeries = content "SetCompletedPrimarySeries"; + } "FirstAnswerForCompletedPrimarySeries"; + + item.answer first as answer where item.linkId = 'dateSeriesCompleted' then { + answer.value as content -> immz.dateSeriesCompleted = content "SetDateSeriesCompleted"; + } "FirstAnswerDateSeriesCompleted"; + + item.answer first as answer where item.linkId = 'hivStatus' then { + answer.value as coding -> immz.hivStatus = coding "SetHIVStatus"; + } "FirstAnswerForHIVStatus"; + + item.answer first as answer where item.linkId = 'pretermBirth' then { + answer.value as content -> immz.pretermBirth = content "SetPretermBirth"; + } "FirstAnswerForPretermBirth"; + + item.answer first as answer where item.linkId = 'immunocompromised' then { + answer.value as content -> immz.immunocompromised = content "SetImmunocompromised"; + } "FirstAnswerForImmunocompromised"; + + item.answer first as answer where item.linkId = 'onART' then { + answer.value as content -> immz.onART = content "SetOnART"; + } "FirstAnswerForOnART"; + + item as history where item.linkId = 'vaccineHistory' -> immz.vaccineHistory as vaccine then { + history.item as entry then { + entry.answer as answer where entry.linkId = 'vaccineType' then { + answer.value as coding -> vaccine.vaccineType = coding "SetVaccineType"; + } "AnswerForVaccineType"; + + entry.answer as answer where entry.linkId = 'vaccineDate' then { + answer.value as content -> vaccine.vaccineDate = content "SetVaccineDate"; + } "AnswerForVaccineDate"; + + } "HistoryLoop"; + + } "ForVaccineHistory"; + + } "processItems"; + +} diff --git a/input/maps/IMMZD1YellowFeverQRToResources.fml b/input/maps/IMMZD1YellowFeverQRToResources.fml new file mode 100644 index 0000000000..bc84cbd415 --- /dev/null +++ b/input/maps/IMMZD1YellowFeverQRToResources.fml @@ -0,0 +1,19 @@ +map "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1YellowFeverQRToResources" = "IMMZD1YellowFeverQRToResources" + +uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QResp as source +uses "http://smart.who.int/ig/smart-immunizations/StructureDefinition/IMMZD1ClientHistoryYellowFever" alias IMMZD1 as source +uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target + +imports "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1YellowFeverQRToLM" +imports "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1YellowFeverLMToResources" + +group QRespToBundle ( + source qr : QResp, + target bundle: Bundle +) { + qr -> create("http://smart.who.int/ig/smart-immunizations/StructureDefinition/IMMZD1ClientHistoryYellowFever") as model + then{ + qr -> model then QRespToIMMZD1( qr, model) "QRtoLM"; + qr -> bundle then IMMZD1ToBundle( model, bundle ) "LMtoBundle"; + } "QRtoBundle"; +} diff --git a/tools/maps.http b/tools/maps.http index 0c2a9def2b..af5b8d53d6 100644 --- a/tools/maps.http +++ b/tools/maps.http @@ -109,35 +109,35 @@ Content-Type: application/fhir+json;fhirVersion=4.0 < ../fsh-generated/resources/StructureDefinition-IMMZD1ClientHistoryMeasles.json ### Post the StructureMap for Contraindications with transform included -PUT {{host}}/StructureMap/IMMZD1QRToLM HTTP/1.1 +PUT {{host}}/StructureMap/IMMZD1MeaslesQRToLM HTTP/1.1 Accept: application/fhir+json;fhirVersion=4.0 Content-Type: text/fhir-mapping -< ../input/maps/IMMZD1QRToLM.fml +< ../input/maps/IMMZD1MeaslesQRToLM.fml ### Test Transform of QR to LM -POST {{host}}/StructureMap/$transform?source=http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1QRToLM +POST {{host}}/StructureMap/$transform?source=http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1MeaslesQRToLM Accept: application/fhir+json;fhirVersion=4.0 Content-Type: application/fhir+json;fhirVersion=4.0 -< ../fsh-generated/resources/QuestionnaireResponse-Example.IMMZ.D1.QuestionnaireResponse.2.json +< ../fsh-generated/resources/QuestionnaireResponse-Example.IMMZ.D1.QuestionnaireResponse.3.json ### Post the StructureMap for Client History with transform included -PUT {{host}}/StructureMap/IMMZD1LMToResources HTTP/1.1 +PUT {{host}}/StructureMap/IMMZD1MeaslesLMToResources HTTP/1.1 Accept: application/fhir+json;fhirVersion=4.0 Content-Type: text/fhir-mapping -< ../input/maps/IMMZD1LMToResources.fml +< ../input/maps/IMMZD1MeaslesLMToResources.fml ### Post the StructureMap for Client History with transform included -PUT {{host}}/StructureMap/IMMZD1QRToResources HTTP/1.1 +PUT {{host}}/StructureMap/IMMZD1MeaslesQRToResources HTTP/1.1 Accept: application/fhir+json;fhirVersion=4.0 Content-Type: text/fhir-mapping -< ../input/maps/IMMZD1QRToResources.fml +< ../input/maps/IMMZD1MeaslesQRToResources.fml ### Test Transform of QR to Resources -POST {{host}}/StructureMap/$transform?source=http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1QRToResources +POST {{host}}/StructureMap/$transform?source=http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1MeaslesQRToResources Accept: application/fhir+json;fhirVersion=4.0 Content-Type: application/fhir+json;fhirVersion=4.0