From d7c7d01e69e8072bb7d8400abf42e21fc12d4893 Mon Sep 17 00:00:00 2001 From: Luke Duncan Date: Wed, 21 Feb 2024 14:14:32 -0800 Subject: [PATCH] Added in logical model/questionnaire and maps for hepatitis B. Fixed required fields in measles, yellow fever, polio. --- ...MZ.D1.QuestionnaireResponse.HepatitisB.fsh | 53 ++++++++++++ .../models/IMMZD1ClientHistoryHepatitsB.fsh | 16 ++++ input/fsh/models/IMMZD1ClientHistoryPolio.fsh | 4 +- .../questionnaires/QIMMZD1ClientHistory.fsh | 2 +- .../QIMMZD1ClientHistoryHepatitisB.fsh | 80 +++++++++++++++++++ .../QIMMZD1ClientHistoryMeasles.fsh | 2 +- .../QIMMZD1ClientHistoryPolio.fsh | 6 +- .../QIMMZD1ClientHistoryYellowFever.fsh | 2 +- input/fsh/valuesets/IMMZ.D1.DE99.fsh | 9 +++ input/fsh/valuesets/IMMZ.Z.DE6.fsh | 18 +++++ input/maps/IMMZD1HepatitisBLMToResources.fml | 50 ++++++++++++ input/maps/IMMZD1HepatitisBQRToLM.fml | 26 ++++++ input/maps/IMMZD1HepatitisBQRToResources.fml | 19 +++++ 13 files changed, 279 insertions(+), 8 deletions(-) create mode 100644 input/fsh/examples/IMMZ.D1.QuestionnaireResponse.HepatitisB.fsh create mode 100644 input/fsh/models/IMMZD1ClientHistoryHepatitsB.fsh create mode 100644 input/fsh/questionnaires/QIMMZD1ClientHistoryHepatitisB.fsh create mode 100644 input/fsh/valuesets/IMMZ.D1.DE99.fsh create mode 100644 input/fsh/valuesets/IMMZ.Z.DE6.fsh create mode 100644 input/maps/IMMZD1HepatitisBLMToResources.fml create mode 100644 input/maps/IMMZD1HepatitisBQRToLM.fml create mode 100644 input/maps/IMMZD1HepatitisBQRToResources.fml diff --git a/input/fsh/examples/IMMZ.D1.QuestionnaireResponse.HepatitisB.fsh b/input/fsh/examples/IMMZ.D1.QuestionnaireResponse.HepatitisB.fsh new file mode 100644 index 0000000000..6e54048bec --- /dev/null +++ b/input/fsh/examples/IMMZ.D1.QuestionnaireResponse.HepatitisB.fsh @@ -0,0 +1,53 @@ +Instance: Example.IMMZ.D1.QuestionnaireResponse.HepatitisB +InstanceOf: QuestionnaireResponse +Usage: #example +* status = #completed +* authored = "2023-10-18T19:20:20.913Z" +* questionnaire = Canonical(QIMMZD1ClientHistoryHepatitisB) +* 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 = "hepbtype" + * answer.valueCoding = IMMZ.D1#DE100 +* item[+] + * linkId = "birthweight" + * answer.valueDecimal = 3000 +* item[+] + * linkId = "vaccineHistory" + * item[+] + * linkId = "vaccineType" + * answer.valueCoding = $ICD11#XM9V38 + * item[+] + * linkId = "vaccineDate" + * answer.valueDate = "2023-04-05" + diff --git a/input/fsh/models/IMMZD1ClientHistoryHepatitsB.fsh b/input/fsh/models/IMMZD1ClientHistoryHepatitsB.fsh new file mode 100644 index 0000000000..749e01b0e8 --- /dev/null +++ b/input/fsh/models/IMMZD1ClientHistoryHepatitsB.fsh @@ -0,0 +1,16 @@ +Logical: IMMZD1ClientHistoryHepatitisB +Title: "IMMZ.D1 Capture Client History for Hepatitis B" +Parent: IMMZD1ClientHistory +Description: "Data elements for the IMMZ.D1 Capture Client History Data Dictionary for Hepatitis B." + +* ^name = "IMMZ_D1_Client_History_HepatitisB" + +* birth 1..1 boolean "Birth dose" "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." + * ^code[+] = IMMZ.D1#DE109 +* birthweight 1..1 decimal "Birth weight in grams" "Represents the client's birth weight value measures in grams" + * ^code[+] = IMMZ.D1#DE29 + * ^code[+] = $ICD11#KA21 + * ^code[+] = $LOINC#8339-4 +* hepbtype 1..1 Coding "Type of hepatitis B dose" "The type of hepatitis B vaccine dose administered to the client" + * ^code[+] = IMMZ.D1#DE99 +* hepbtype from IMMZ.D1.DE99 \ No newline at end of file diff --git a/input/fsh/models/IMMZD1ClientHistoryPolio.fsh b/input/fsh/models/IMMZD1ClientHistoryPolio.fsh index d21d567c3a..7d3a0745e6 100644 --- a/input/fsh/models/IMMZD1ClientHistoryPolio.fsh +++ b/input/fsh/models/IMMZD1ClientHistoryPolio.fsh @@ -5,9 +5,9 @@ Description: "Data elements for the IMMZ.D1 Capture Client History Data Diction * ^name = "IMMZ_D1_Client_History_Polio" -* birth 0..1 boolean "Birth dose" "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." +* birth 1..1 boolean "Birth dose" "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." * ^code[+] = IMMZ.D1#DE109 -* poliotype 0..1 Coding "Type of polio dose" "The type of the polio vaccine dose administered to the client" +* poliotype 1..1 Coding "Type of polio dose" "The type of the polio vaccine dose administered to the client" * ^code[+] = IMMZ.D1#DE35 * ^code[+] = $ICD11#XM0N50 * poliotype from IMMZ.D1.DE35 diff --git a/input/fsh/questionnaires/QIMMZD1ClientHistory.fsh b/input/fsh/questionnaires/QIMMZD1ClientHistory.fsh index 5a4499e327..fff4068d99 100644 --- a/input/fsh/questionnaires/QIMMZD1ClientHistory.fsh +++ b/input/fsh/questionnaires/QIMMZD1ClientHistory.fsh @@ -16,7 +16,7 @@ Usage: #definition * extension[=].valueCanonical = "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1QRToResources" -* insert Question(type, The type of dose in a series that the client received, choice, false, true) +* insert Question(type, The type of dose in a series that the client received, choice, true, false) * item[=] * answerValueSet = Canonical(IMMZ.D1.DE103) * code[+] = IMMZ.D1#DE103 diff --git a/input/fsh/questionnaires/QIMMZD1ClientHistoryHepatitisB.fsh b/input/fsh/questionnaires/QIMMZD1ClientHistoryHepatitisB.fsh new file mode 100644 index 0000000000..af865b6724 --- /dev/null +++ b/input/fsh/questionnaires/QIMMZD1ClientHistoryHepatitisB.fsh @@ -0,0 +1,80 @@ +Instance: QIMMZD1ClientHistoryHepatitisB +InstanceOf: sdc-questionnaire-extr-smap +Title: "Capture Client History Questionnaire - Hepatitis B" +Description: "Immunization - Capture Client History Questionnaire for Hepatitis B Immunization" +Usage: #definition +* id = "IMMZD1ClientHistoryHepatitisB" +* version = "2023" +* status = #draft +* subjectType = #Patient +* language = #en +* status = #draft +* derivedFrom = Canonical(QIMMZD1ClientHistory) +* contained[+] = IMMZ.D1.DE10 +* contained[+] = IMMZ.D1.DE99 +* 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/IMMZD1HepatitisBQRToResources" + + +* 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, true, false) +* item[=] + * code[+] = IMMZ.D1#DE109 +* insert Question(type, The type of dose in a series that the client received, choice, true, false) +* 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(birthweight, Represents the client's birth weight value measures in grams, decimal, true, false) + * code[+] = IMMZ.D1#DE29 + * code[+] = $ICD11#KA21 + * code[+] = $LOINC#8339-4 +* insert Question(hebptype, The type of hepatitis B vaccine dose administered to the client, choice, true, false) +* item[=] + * answerValueSet = Canonical(IMMZ.D1.DE99) + * code[+] = IMMZ.D1#DE99 +* 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.DE6) + * 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/fsh/questionnaires/QIMMZD1ClientHistoryMeasles.fsh b/input/fsh/questionnaires/QIMMZD1ClientHistoryMeasles.fsh index 5c11963b42..a0972fa690 100644 --- a/input/fsh/questionnaires/QIMMZD1ClientHistoryMeasles.fsh +++ b/input/fsh/questionnaires/QIMMZD1ClientHistoryMeasles.fsh @@ -17,7 +17,7 @@ Usage: #definition * extension[=].valueCanonical = "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1MeaslesQRToResources" -* insert Question(type, The type of dose in a series that the client received, choice, false, true) +* insert Question(type, The type of dose in a series that the client received, choice, true, false) * item[=] * answerValueSet = Canonical(IMMZ.D1.DE103) * code[+] = IMMZ.D1#DE103 diff --git a/input/fsh/questionnaires/QIMMZD1ClientHistoryPolio.fsh b/input/fsh/questionnaires/QIMMZD1ClientHistoryPolio.fsh index 3fbfd05868..1984a5319b 100644 --- a/input/fsh/questionnaires/QIMMZD1ClientHistoryPolio.fsh +++ b/input/fsh/questionnaires/QIMMZD1ClientHistoryPolio.fsh @@ -18,10 +18,10 @@ Usage: #definition * extension[=].valueCanonical = "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1PolioQRToResources" -* 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) +* 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, true, false) * item[=] * code[+] = IMMZ.D1#DE109 -* insert Question(type, The type of dose in a series that the client received, choice, false, true) +* insert Question(type, The type of dose in a series that the client received, choice, true, false) * item[=] * answerValueSet = Canonical(IMMZ.D1.DE103) * code[+] = IMMZ.D1#DE103 @@ -55,7 +55,7 @@ Usage: #definition * insert Question(onART, The client is currently receiving antiretroviral therapy - ART, boolean, false, false) * item[=] * code[+] = IMMZ.D1#DE17 -* insert Question(poliotype, The type of the polio vaccine dose administered to the client, choice, false, false) +* insert Question(poliotype, The type of the polio vaccine dose administered to the client, choice, true, false) * item[=] * answerValueSet = Canonical(IMMZ.D1.DE35) * code[+] = IMMZ.D1#DE35 diff --git a/input/fsh/questionnaires/QIMMZD1ClientHistoryYellowFever.fsh b/input/fsh/questionnaires/QIMMZD1ClientHistoryYellowFever.fsh index 0f568a4bb4..5e69a12f14 100644 --- a/input/fsh/questionnaires/QIMMZD1ClientHistoryYellowFever.fsh +++ b/input/fsh/questionnaires/QIMMZD1ClientHistoryYellowFever.fsh @@ -17,7 +17,7 @@ Usage: #definition * extension[=].valueCanonical = "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1YellowFeverQRToResources" -* insert Question(type, The type of dose in a series that the client received, choice, false, true) +* insert Question(type, The type of dose in a series that the client received, choice, true, false) * item[=] * answerValueSet = Canonical(IMMZ.D1.DE103) * code[+] = IMMZ.D1#DE103 diff --git a/input/fsh/valuesets/IMMZ.D1.DE99.fsh b/input/fsh/valuesets/IMMZ.D1.DE99.fsh new file mode 100644 index 0000000000..d967002268 --- /dev/null +++ b/input/fsh/valuesets/IMMZ.D1.DE99.fsh @@ -0,0 +1,9 @@ +ValueSet: IMMZ.D1.DE99 +Title: "IMMZ.D1.DE99 ValueSet for Type of hepatitis B dose" +Description: "ValueSet for Type of hepatitis B dose for IMMZ.D1.DE87" + +* ^status = #active +* ^name = "IMMZ_D1_DE99" + +* IMMZ.D1#DE100 "Hepatitis B monovalent vaccine" +* IMMZ.D1#DE101 "Hepatitis B combination vaccine" diff --git a/input/fsh/valuesets/IMMZ.Z.DE6.fsh b/input/fsh/valuesets/IMMZ.Z.DE6.fsh new file mode 100644 index 0000000000..3d1dcf591f --- /dev/null +++ b/input/fsh/valuesets/IMMZ.Z.DE6.fsh @@ -0,0 +1,18 @@ +ValueSet: IMMZ.Z.DE6 +Title: "IMMZ.Z.DE6 Hepatitis B containing vaccines" +Description: "Vaccine terminology codes for hepatitis B." + +* ^status = #active +* ^name = "IMMZ_Z_DE6" + + +* $ICD11#XM9V38 "Hepatitis B, purified antigen" +* $ICD11#XM3G68 "Diphtheria, hepatitis B, tetanus vaccines" +* $ICD11#XM32L7 "Hemophilus influenzae B and hepatitis B vaccines" +* $ICD11#XM7JP3 "Diphtheria, hemophilus influenzae B, pertussis, tetanus, hepatitis B vaccines" +* $ICD11#XM0LT9 "Diphtheria, pertussis, poliomyelitis, tetanus, hepatitis B vaccines" +* $ICD11#XM5XP9 "Diphtheria, hemophilus influenzae B, pertussis, tetanus-hepatitis B, meningococcus A + C vaccines" +* $ICD11#XM84S1 "Diphtheria, hepatitis B, tetanus, acellular pertussis, inactivated polio virus, haemophilus Influenzae type B vaccines" +* $LOINC#30937-7 "Hepatitis B virus dose count in combination vaccine" +* $SCT#836374004 "Hepatitis B virus antigen-containing vaccine product" +* $SCT#871806004 "Haemophilus influenzae type b and Hepatitis B virus antigens only vaccine product" \ No newline at end of file diff --git a/input/maps/IMMZD1HepatitisBLMToResources.fml b/input/maps/IMMZD1HepatitisBLMToResources.fml new file mode 100644 index 0000000000..c8ed5a88c4 --- /dev/null +++ b/input/maps/IMMZD1HepatitisBLMToResources.fml @@ -0,0 +1,50 @@ +map "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1HepatitisBLMToResources" = "IMMZD1HepatitisBLMToResources" + +uses "http://smart.who.int/ig/smart-immunizations/StructureDefinition/IMMZD1ClientHistoryHepatitisB" alias IMMZD1 as source +uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target + +imports "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1LMToResources" + +group HepatitisBIMMZD1ToBundle (source immz : IMMZD1, target bundle: Bundle) extends IMMZD1ToBundle { + + 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.birthweight 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 = 'DE29' "SetObsCode"; + } "SetObsCoding"; + } "SetObsCode"; + content -> obs.value = content "SetValue"; + } "SetBirthWeightObservation"; + + immz.hepbtype 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 = 'DE99' "SetObsCode"; + } "SetObsCoding"; + } "SetObsCode"; + content -> obs.valueCodeableConcept as code then { + content -> code.coding = content "SetCoding"; + } "SetCodeableConcept"; + } "SetHepatitisBTypeObservation"; + + } "GetPatient"; + +} diff --git a/input/maps/IMMZD1HepatitisBQRToLM.fml b/input/maps/IMMZD1HepatitisBQRToLM.fml new file mode 100644 index 0000000000..992eb4a546 --- /dev/null +++ b/input/maps/IMMZD1HepatitisBQRToLM.fml @@ -0,0 +1,26 @@ +map "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1HepatitisBQRToLM" = "IMMZD1HepatitisBQRToLM" + +uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QResp as source +uses "http://smart.who.int/ig/smart-immunizations/StructureDefinition/IMMZD1ClientHistoryHepatitisB" alias IMMZD1 as target + +imports "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1QRToLM" + +group HepatitisBQRespToIMMZD1 ( source qr : QResp, target immz : IMMZD1) extends QRespToIMMZD1 { + + 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 first as answer where item.linkId = 'birthweight' then { + answer.value as content -> immz.birthweight = content "SetBirthWeight"; + } "FirstAnswerForBirthWeight"; + + item.answer first as answer where item.linkId = 'hepbtype' then { + answer.value as coding -> immz.hepbtype = coding "SetHepatitisBType"; + } "FirstAnswerForHepatitisBType"; + + } "processItems"; + +} \ No newline at end of file diff --git a/input/maps/IMMZD1HepatitisBQRToResources.fml b/input/maps/IMMZD1HepatitisBQRToResources.fml new file mode 100644 index 0000000000..a5c0d2ba84 --- /dev/null +++ b/input/maps/IMMZD1HepatitisBQRToResources.fml @@ -0,0 +1,19 @@ +map "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1HepatitisBQRToResources" = "IMMZD1HepatitisBQRToResources" + +uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QResp as source +uses "http://smart.who.int/ig/smart-immunizations/StructureDefinition/IMMZD1ClientHistoryHepatitisB" alias IMMZD1 as source +uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target + +imports "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1HepatitisBQRToLM" +imports "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1HepatitisBLMToResources" + +group QRespToBundle ( + source qr : QResp, + target bundle: Bundle +) { + qr -> create("http://smart.who.int/ig/smart-immunizations/StructureDefinition/IMMZD1ClientHistoryHepatitisB") as model + then{ + qr -> model then HepatitisBQRespToIMMZD1( qr, model) "QRtoLM"; + qr -> bundle then HepatitisBIMMZD1ToBundle( model, bundle ) "LMtoBundle"; + } "QRtoBundle"; +} \ No newline at end of file