Generated Narrative: StructureMap Moh505Map #xD; map "http://example.org/StructureMap/Moh505Map" = "Moh505Map"#xD; #xD; // MOH 505 Health Facility Weekly Reporting Form QuestionnaireResponse to FHIR resources#xD; // Maps to: Encounter (facility + reporting period) and Observation per disease#xD; // PAGE 1: Reporting Site → Encounter#xD; // PAGE 2: Diseases, Conditions or Events → Observations (cases/deaths per disease)#xD; // PAGE 3: Laboratory Surveillance → Observations (malaria lab tests)#xD; #xD; uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QuestionnaireResponse as source#xD; uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target#xD; uses "http://hl7.org/fhir/StructureDefinition/Encounter" alias Encounter as target#xD; uses "http://hl7.org/fhir/StructureDefinition/Observation" alias Observation as target#xD; uses "http://hl7.org/fhir/StructureDefinition/BackboneElement" alias BackboneElement as source#xD; #xD; group Moh505Map(source src : QuestionnaireResponse, target bundle : Bundle) {#xD; src -> bundle.id = uuid() "bundleId";#xD; src -> bundle.type = 'transaction' "bundleType";#xD; // Create Encounter for the facility reporting context#xD; src -> bundle.entry as e then {#xD; src -> e.resource = create('Encounter') as encounter then MapMoh505Encounter(src, encounter) "execEncounter";#xD; src -> e.request as req, req.method = 'POST', req.url = 'Encounter' "encounterReq";#xD; } "encounterEntry";#xD; // Create Observations per disease from PAGE 2#xD; src.item as diseasesPage where linkId = '306799299' then {#xD; // ── AEFI ────────────────────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'aefi-summary' then {#xD; diseasesPage.item as u5c where linkId = 'aefi-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'aefi-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'aefi-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'aefi-deaths-over-5' then {#xD; summ.answer first as ans where valueCoding.code = 'yes' -> bundle.entry as e then {#xD; summ -> e.resource = create('Observation') as obs then CreateMoh505DiseaseObs(summ, u5c, o5c, u5d, o5d, obs) "obsCreate";#xD; summ -> e.request as req, req.method = 'POST', req.url = 'Observation' "reqCreate";#xD; } "aefiObs";#xD; } "o5d";#xD; } "u5d";#xD; } "o5c";#xD; } "u5c";#xD; } "aefi";#xD; // ── Bacterial Meningitis ─────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'bacterial-meningitis-summary' then {#xD; diseasesPage.item as u5c where linkId = 'bacterial-meningitis-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'bacterial-meningitis-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'bacterial-meningitis-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'bacterial-meningitis-deaths-over-5' then {#xD; summ.answer first as ans where valueCoding.code = 'yes' -> bundle.entry as e then {#xD; summ -> e.resource = create('Observation') as obs then CreateMoh505DiseaseObs(summ, u5c, o5c, u5d, o5d, obs) "obsCreate";#xD; summ -> e.request as req, req.method = 'POST', req.url = 'Observation' "reqCreate";#xD; } "bactMenObs";#xD; } "o5d";#xD; } "u5d";#xD; } "o5c";#xD; } "u5c";#xD; } "bacterialMeningitis";#xD; // ── Acute Jaundice ───────────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'acute-jaundice-summary' then {#xD; diseasesPage.item as u5c where linkId = 'acute-jaundice-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'acute-jaundice-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'acute-jaundice-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'acute-jaundice-deaths-over-5' then {#xD; summ.answer first as ans where valueCoding.code = 'yes' -> bundle.entry as e then {#xD; summ -> e.resource = create('Observation') as obs then CreateMoh505DiseaseObs(summ, u5c, o5c, u5d, o5d, obs) "obsCreate";#xD; summ -> e.request as req, req.method = 'POST', req.url = 'Observation' "reqCreate";#xD; } "ajObs";#xD; } "o5d";#xD; } "u5d";#xD; } "o5c";#xD; } "u5c";#xD; } "acuteJaundice";#xD; // ── Acute Malnutrition ───────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'acute-malnutrition-summary' then {#xD; diseasesPage.item as u5c where linkId = 'acute-malnutrition-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'acute-malnutrition-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'acute-malnutrition-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'acute-malnutrition-deaths-over-5' then {#xD; summ.answer first as ans where valueCoding.code = 'yes' -> bundle.entry as e then {#xD; summ -> e.resource = create('Observation') as obs then CreateMoh505DiseaseObs(summ, u5c, o5c, u5d, o5d, obs) "obsCreate";#xD; summ -> e.request as req, req.method = 'POST', req.url = 'Observation' "reqCreate";#xD; } "amObs";#xD; } "o5d";#xD; } "u5d";#xD; } "o5c";#xD; } "u5c";#xD; } "acuteMalnutrition";#xD; // ── AFP (Poliomyelitis) ──────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'afp-poliomyelitis-summary' then {#xD; diseasesPage.item as u5c where linkId = 'afp-poliomyelitis-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'afp-poliomyelitis-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'afp-poliomyelitis-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'afp-poliomyelitis-deaths-over-5' then {#xD; summ.answer first as ans where valueCoding.code = 'yes' -> bundle.entry as e then {#xD; summ -> e.resource = create('Observation') as obs then CreateMoh505DiseaseObs(summ, u5c, o5c, u5d, o5d, obs) "obsCreate";#xD; summ -> e.request as req, req.method = 'POST', req.url = 'Observation' "reqCreate";#xD; } "afpObs";#xD; } "o5d";#xD; } "u5d";#xD; } "o5c";#xD; } "u5c";#xD; } "afp";#xD; // ── Anthrax ──────────────────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'anthrax-summary' then {#xD; diseasesPage.item as u5c where linkId = 'anthrax-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'anthrax-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'anthrax-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'anthrax-deaths-over-5' then {#xD; summ.answer first as ans where valueCoding.code = 'yes' -> bundle.entry as e then {#xD; summ -> e.resource = create('Observation') as obs then CreateMoh505DiseaseObs(summ, u5c, o5c, u5d, o5d, obs) "obsCreate";#xD; summ -> e.request as req, req.method = 'POST', req.url = 'Observation' "reqCreate";#xD; } "anthraxObs";#xD; } "o5d";#xD; } "u5d";#xD; } "o5c";#xD; } "u5c";#xD; } "anthrax";#xD; // ── Cholera ──────────────────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'cholera-summary' then {#xD; diseasesPage.item as u5c where linkId = 'cholera-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'cholera-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'cholera-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'cholera-deaths-over-5' then {#xD; summ.answer first as ans where valueCoding.code = 'yes' -> bundle.entry as e then {#xD; summ -> e.resource = create('Observation') as obs then CreateMoh505DiseaseObs(summ, u5c, o5c, u5d, o5d, obs) "obsCreate";#xD; summ -> e.request as req, req.method = 'POST', req.url = 'Observation' "reqCreate";#xD; } "choleraObs";#xD; } "o5d";#xD; } "u5d";#xD; } "o5c";#xD; } "u5c";#xD; } "cholera";#xD; // ── Chikungunya ──────────────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'chikungunya-summary' then {#xD; diseasesPage.item as u5c where linkId = 'chikungunya-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'chikungunya-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'chikungunya-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'chikungunya-deaths-over-5' then {#xD; summ.answer first as ans where valueCoding.code = 'yes' -> bundle.entry as e then {#xD; summ -> e.resource = create('Observation') as obs then CreateMoh505DiseaseObs(summ, u5c, o5c, u5d, o5d, obs) "obsCreate";#xD; summ -> e.request as req, req.method = 'POST', req.url = 'Observation' "reqCreate";#xD; } "chikungunyaObs";#xD; } "o5d";#xD; } "u5d";#xD; } "o5c";#xD; } "u5c";#xD; } "chikungunya";#xD; // ── COVID-19 ─────────────────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'covid--19-summary' then {#xD; diseasesPage.item as u5c where linkId = 'covid-19-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'covid-19-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'covid-19-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'covid-19-deaths-over-5' then {#xD; summ.answer first as ans where valueCoding.code = 'yes' -> bundle.entry as e then {#xD; summ -> e.resource = create('Observation') as obs then CreateMoh505DiseaseObs(summ, u5c, o5c, u5d, o5d, obs) "obsCreate";#xD; summ -> e.request as req, req.method = 'POST', req.url = 'Observation' "reqCreate";#xD; } "covidObs";#xD; } "o5d";#xD; } "u5d";#xD; } "o5c";#xD; } "u5c";#xD; } "covid19";#xD; // ── Dengue ───────────────────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'dengue-summary' then {#xD; diseasesPage.item as u5c where linkId = 'dengue-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'dengue-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'dengue-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'dengue-deaths-over-5' then {#xD; summ.answer first as ans where valueCoding.code = 'yes' -> bundle.entry as e then {#xD; summ -> e.resource = create('Observation') as obs then CreateMoh505DiseaseObs(summ, u5c, o5c, u5d, o5d, obs) "obsCreate";#xD; summ -> e.request as req, req.method = 'POST', req.url = 'Observation' "reqCreate";#xD; } "dengueObs";#xD; } "o5d";#xD; } "u5d";#xD; } "o5c";#xD; } "u5c";#xD; } "dengue";#xD; // ── Dysentery (Bacillary) ────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'dysentery-bacillary-summary' then {#xD; diseasesPage.item as u5c where linkId = 'dysentery-bacillary-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'dysentery-bacillary-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'dysentery-bacillary-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'dysentery-bacillary-deaths-over-5' then {#xD; summ.answer first as ans where valueCoding.code = 'yes' -> bundle.entry as e then {#xD; summ -> e.resource = create('Observation') as obs then CreateMoh505DiseaseObs(summ, u5c, o5c, u5d, o5d, obs) "obsCreate";#xD; summ -> e.request as req, req.method = 'POST', req.url = 'Observation' "reqCreate";#xD; } "dysenteryObs";#xD; } "o5d";#xD; } "u5d";#xD; } "o5c";#xD; } "u5c";#xD; } "dysenteryBacillary";#xD; // ── Guinea Worm Disease ──────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'guinea-worm-disease-summary' then {#xD; diseasesPage.item as u5c where linkId = 'guinea-worm-disease-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'guinea-worm-disease-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'guinea-worm-disease-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'guinea-worm-disease-deaths-over-5' then {#xD; summ.answer first as ans where valueCoding.code = 'yes' -> bundle.entry as e then {#xD; summ -> e.resource = create('Observation') as obs then CreateMoh505DiseaseObs(summ, u5c, o5c, u5d, o5d, obs) "obsCreate";#xD; summ -> e.request as req, req.method = 'POST', req.url = 'Observation' "reqCreate";#xD; } "gwObs";#xD; } "o5d";#xD; } "u5d";#xD; } "o5c";#xD; } "u5c";#xD; } "guineaWorm";#xD; // ── Measles ──────────────────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'measles-summary' then {#xD; diseasesPage.item as u5c where linkId = 'measles-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'measles-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'measles-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'measles-deaths-over-5' then {#xD; summ.answer first as ans where valueCoding.code = 'yes' -> bundle.entry as e then {#xD; summ -> e.resource = create('Observation') as obs then CreateMoh505DiseaseObs(summ, u5c, o5c, u5d, o5d, obs) "obsCreate";#xD; summ -> e.request as req, req.method = 'POST', req.url = 'Observation' "reqCreate";#xD; } "measlesObs";#xD; } "o5d";#xD; } "u5d";#xD; } "o5c";#xD; } "u5c";#xD; } "measles";#xD; // ── Suspected Malaria ────────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'suspected-malaria-summary' then {#xD; diseasesPage.item as u5c where linkId = 'suspected-malaria-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'suspected-malaria-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'suspected-malaria-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'suspected-malaria-deaths-over-5' then {#xD; summ.answer first as ans where valueCoding.code = 'yes' -> bundle.entry as e then {#xD; summ -> e.resource = create('Observation') as obs then CreateMoh505DiseaseObs(summ, u5c, o5c, u5d, o5d, obs) "obsCreate";#xD; summ -> e.request as req, req.method = 'POST', req.url = 'Observation' "reqCreate";#xD; } "malariaObs";#xD; } "o5d";#xD; } "u5d";#xD; } "o5c";#xD; } "u5c";#xD; } "suspectedMalaria";#xD; // ── VHF ──────────────────────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'vhf-summary' then {#xD; diseasesPage.item as u5c where linkId = 'vhf-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'vhf-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'vhf-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'vhf-deaths-over-5' then {#xD; summ.answer first as ans where valueCoding.code = 'yes' -> bundle.entry as e then {#xD; summ -> e.resource = create('Observation') as obs then CreateMoh505DiseaseObs(summ, u5c, o5c, u5d, o5d, obs) "obsCreate";#xD; summ -> e.request as req, req.method = 'POST', req.url = 'Observation' "reqCreate";#xD; } "vhfObs";#xD; } "o5d";#xD; } "u5d";#xD; } "o5c";#xD; } "u5c";#xD; } "vhf";#xD; // ── Yellow Fever ─────────────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'yellow-fever-summary' then {#xD; diseasesPage.item as u5c where linkId = 'yellow-fever-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'yellow-fever-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'yellow-fever-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'yellow-fever-deaths-over-5' then {#xD; summ.answer first as ans where valueCoding.code = 'yes' -> bundle.entry as e then {#xD; summ -> e.resource = create('Observation') as obs then CreateMoh505DiseaseObs(summ, u5c, o5c, u5d, o5d, obs) "obsCreate";#xD; summ -> e.request as req, req.method = 'POST', req.url = 'Observation' "reqCreate";#xD; } "yfObs";#xD; } "o5d";#xD; } "u5d";#xD; } "o5c";#xD; } "u5c";#xD; } "yellowFever";#xD; // ── Typhoid ──────────────────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'typhoid-summary' then {#xD; diseasesPage.item as u5c where linkId = 'typhoid-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'typhoid-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'typhoid-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'typhoid-deaths-over-5' then {#xD; summ.answer first as ans where valueCoding.code = 'yes' -> bundle.entry as e then {#xD; summ -> e.resource = create('Observation') as obs then CreateMoh505DiseaseObs(summ, u5c, o5c, u5d, o5d, obs) "obsCreate";#xD; summ -> e.request as req, req.method = 'POST', req.url = 'Observation' "reqCreate";#xD; } "typhoidObs";#xD; } "o5d";#xD; } "u5d";#xD; } "o5c";#xD; } "u5c";#xD; } "typhoid";#xD; // ── Rift Valley Fever ────────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'rift-valley-fever-summary' then {#xD; diseasesPage.item as u5c where linkId = 'rift-valley-fever-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'rift-valley-fever-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'rift-valley-fever-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'rift-valley-fever-deaths-over-5' then {#xD; summ.answer first as ans where valueCoding.code = 'yes' -> bundle.entry as e then {#xD; summ -> e.resource = create('Observation') as obs then CreateMoh505DiseaseObs(summ, u5c, o5c, u5d, o5d, obs) "obsCreate";#xD; summ -> e.request as req, req.method = 'POST', req.url = 'Observation' "reqCreate";#xD; } "rvfObs";#xD; } "o5d";#xD; } "u5d";#xD; } "o5c";#xD; } "u5c";#xD; } "riftValleyFever";#xD; // ── Zika Virus ───────────────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'zika-virus-summary' then {#xD; diseasesPage.item as u5c where linkId = 'zika-virus-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'zika-virus-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'zika-virus-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'zika-virus-deaths-over-5' then {#xD; summ.answer first as ans where valueCoding.code = 'yes' -> bundle.entry as e then {#xD; summ -> e.resource = create('Observation') as obs then CreateMoh505DiseaseObs(summ, u5c, o5c, u5d, o5d, obs) "obsCreate";#xD; summ -> e.request as req, req.method = 'POST', req.url = 'Observation' "reqCreate";#xD; } "zikaObs";#xD; } "o5d";#xD; } "u5d";#xD; } "o5c";#xD; } "u5c";#xD; } "zikaVirus";#xD; // ── Deaths Due to Malaria ────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'deaths-due-to-malaria-summary' then {#xD; diseasesPage.item as u5c where linkId = 'deaths-due-to-malaria-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'deaths-due-to-malaria-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'deaths-due-to-malaria-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'deaths-due-to-malaria-deaths-over-5' then {#xD; summ.answer first as ans where valueCoding.code = 'yes' -> bundle.entry as e then {#xD; summ -> e.resource = create('Observation') as obs then CreateMoh505DiseaseObs(summ, u5c, o5c, u5d, o5d, obs) "obsCreate";#xD; summ -> e.request as req, req.method = 'POST', req.url = 'Observation' "reqCreate";#xD; } "malDeathObs";#xD; } "o5d";#xD; } "u5d";#xD; } "o5c";#xD; } "u5c";#xD; } "deathsDueToMalaria";#xD; } "diseasesPage";#xD; // Create Observations from PAGE 3: Laboratory Surveillance#xD; src.item as labPage where linkId = '3067992989898' then {#xD; // Malaria Microscopy observations#xD; labPage.item as u5Tested where linkId = 'malaria-tested-under-5' then {#xD; labPage.item as o5Tested where linkId = 'malaria-tested-over-5' then {#xD; labPage.item as u5Pos where linkId = 'malaria-positive-under-5' then {#xD; labPage.item as o5Pos where linkId = 'malaria-positive-over-5' then {#xD; src -> bundle.entry as e then {#xD; src -> e.resource = create('Observation') as obs then MapMalariaLabObs(u5Tested, o5Tested, u5Pos, o5Pos, obs) "malariaLabCreate";#xD; src -> e.request as req, req.method = 'POST', req.url = 'Observation' "malariaLabReq";#xD; } "malariaLabObs";#xD; } "o5Pos";#xD; } "u5Pos";#xD; } "o5Tested";#xD; } "u5Tested";#xD; } "labPage";#xD; }#xD; #xD; // Helper group: create Encounter from Moh505 Reporting Site page#xD; group MapMoh505Encounter(source src : QuestionnaireResponse, target encounter : Encounter) {#xD; src -> encounter.id = uuid() "encounterId";#xD; src -> encounter.status = 'finished' "status";#xD; src -> encounter.class as cls then {#xD; src -> cls.system = 'http://terminology.hl7.org/CodeSystem/v3-ActCode' "clsSys";#xD; src -> cls.code = 'VR' "clsCode";#xD; src -> cls.display = 'virtual' "clsDisplay";#xD; } "class";#xD; // Encounter type: weekly surveillance report#xD; src -> encounter.type as type then {#xD; src -> type.coding as cod then {#xD; src -> cod.system = 'http://example.org/CodeSystem/encounter-type' "typeSys";#xD; src -> cod.code = 'weekly-surveillance-report' "typeCode";#xD; src -> cod.display = 'MOH 505 Weekly Surveillance Report' "typeDisplay";#xD; } "typeCoding";#xD; } "type";#xD; // Location from reporting site#xD; src.item as reportSite where linkId = '151479012557' then {#xD; reportSite.item as item where linkId = '819946803677' then {#xD; item.answer first as ans -> encounter.location as loc, loc.location as locRef, locRef.reference = ('Location/' + ans.valueReference.reference) "facilityLocation";#xD; } "facilityLevelLocation";#xD; } "reportSite";#xD; }#xD; #xD; // Helper group: create a disease weekly count Observation (all 4 age/outcome components)#xD; group CreateMoh505DiseaseObs(source summaryItem : BackboneElement, source u5CasesItem : BackboneElement, source o5CasesItem : BackboneElement, source u5DeathsItem : BackboneElement, source o5DeathsItem : BackboneElement, target obs : Observation) {#xD; summaryItem -> obs.id = uuid() "obsId";#xD; summaryItem -> obs.status = 'final' "status";#xD; summaryItem -> obs.category as cat then {#xD; summaryItem -> cat.coding as cod, cod.system = 'http://terminology.hl7.org/CodeSystem/observation-category', cod.code = 'survey' "catCod";#xD; } "category";#xD; // Disease code derived from the summary question text#xD; summaryItem -> obs.code as code then {#xD; summaryItem -> code.coding as cod then {#xD; summaryItem -> cod.system = 'http://example.org/CodeSystem/moh505-disease' "codeSys";#xD; summaryItem -> cod.code = (summaryItem.linkId.replace('-summary', '')) "codeCode";#xD; summaryItem -> cod.display = (summaryItem.text) "codeDisplay";#xD; } "codeCoding";#xD; summaryItem -> code.text = (summaryItem.text) "codeText";#xD; } "diseaseCode";#xD; // Component: Under 5 Cases#xD; u5CasesItem.answer first as ans -> obs.component as comp then {#xD; ans -> comp.code as code, code.text = 'Under 5 Cases' "compCode";#xD; ans -> comp.valueInteger = ans.valueInteger "compValue";#xD; } "u5CasesComp";#xD; // Component: Over 5 Cases#xD; o5CasesItem.answer first as ans -> obs.component as comp then {#xD; ans -> comp.code as code, code.text = 'Over 5 Cases' "compCode";#xD; ans -> comp.valueInteger = ans.valueInteger "compValue";#xD; } "o5CasesComp";#xD; // Component: Under 5 Deaths#xD; u5DeathsItem.answer first as ans -> obs.component as comp then {#xD; ans -> comp.code as code, code.text = 'Under 5 Deaths' "compCode";#xD; ans -> comp.valueInteger = ans.valueInteger "compValue";#xD; } "u5DeathsComp";#xD; // Component: Over 5 Deaths#xD; o5DeathsItem.answer first as ans -> obs.component as comp then {#xD; ans -> comp.code as code, code.text = 'Over 5 Deaths' "compCode";#xD; ans -> comp.valueInteger = ans.valueInteger "compValue";#xD; } "o5DeathsComp";#xD; }#xD; #xD; // Helper group: create Malaria Lab Surveillance Observation#xD; group MapMalariaLabObs(source u5TestedItem : BackboneElement, source o5TestedItem : BackboneElement, source u5PosItem : BackboneElement, source o5PosItem : BackboneElement, target obs : Observation) {#xD; u5TestedItem -> obs.id = uuid() "obsId";#xD; u5TestedItem -> obs.status = 'final' "status";#xD; u5TestedItem -> obs.category as cat then {#xD; u5TestedItem -> cat.coding as cod, cod.system = 'http://terminology.hl7.org/CodeSystem/observation-category', cod.code = 'laboratory' "catCod";#xD; } "category";#xD; u5TestedItem -> obs.code as code then {#xD; u5TestedItem -> code.coding as cod then {#xD; u5TestedItem -> cod.system = 'http://loinc.org' "loincSys";#xD; u5TestedItem -> cod.code = '32700-7' "loincCode";#xD; u5TestedItem -> cod.display = 'Microscopy panel - Blood by Malaria smear' "loincDisplay";#xD; } "codeCoding";#xD; u5TestedItem -> code.text = 'Malaria Microscopy Results' "codeText";#xD; } "labCode";#xD; u5TestedItem.answer first as ans -> obs.component as comp then {#xD; ans -> comp.code as code, code.text = 'Malaria Microscopy Tested Under 5' "compCode";#xD; ans -> comp.valueInteger = ans.valueInteger "compValue";#xD; } "u5TestedComp";#xD; o5TestedItem.answer first as ans -> obs.component as comp then {#xD; ans -> comp.code as code, code.text = 'Malaria Microscopy Tested Over 5' "compCode";#xD; ans -> comp.valueInteger = ans.valueInteger "compValue";#xD; } "o5TestedComp";#xD; u5PosItem.answer first as ans -> obs.component as comp then {#xD; ans -> comp.code as code, code.text = 'Malaria Microscopy Positive Under 5' "compCode";#xD; ans -> comp.valueInteger = ans.valueInteger "compValue";#xD; } "u5PosComp";#xD; o5PosItem.answer first as ans -> obs.component as comp then {#xD; ans -> comp.code as code, code.text = 'Malaria Microscopy Positive Over 5' "compCode";#xD; ans -> comp.valueInteger = ans.valueInteger "compValue";#xD; } "o5PosComp";#xD; }#xD; #xD;
MOH 505 Health Facility Weekly Reporting Form QuestionnaireResponse to FHIR resources Maps to: Encounter (facility + reporting period) and Observation per disease PAGE 1: Reporting Site → Encounter PAGE 2: Diseases, Conditions or Events → Observations (cases/deaths per disease) PAGE 3: Laboratory Surveillance → Observations (malaria lab tests)
linkId = 'bacterial-meningitis-cases-under-5'
linkId = 'bacterial-meningitis-cases-over-5'
linkId = 'bacterial-meningitis-deaths-under-5'
linkId = 'bacterial-meningitis-deaths-over-5'
linkId = 'acute-jaundice-deaths-under-5'
linkId = 'acute-malnutrition-cases-under-5'
linkId = 'acute-malnutrition-cases-over-5'
linkId = 'acute-malnutrition-deaths-under-5'
linkId = 'acute-malnutrition-deaths-over-5'
linkId = 'afp-poliomyelitis-cases-under-5'
linkId = 'afp-poliomyelitis-cases-over-5'
linkId = 'afp-poliomyelitis-deaths-under-5'
linkId = 'afp-poliomyelitis-deaths-over-5'
linkId = 'dysentery-bacillary-cases-under-5'
linkId = 'dysentery-bacillary-cases-over-5'
linkId = 'dysentery-bacillary-deaths-under-5'
linkId = 'dysentery-bacillary-deaths-over-5'
linkId = 'guinea-worm-disease-cases-under-5'
linkId = 'guinea-worm-disease-cases-over-5'
linkId = 'guinea-worm-disease-deaths-under-5'
linkId = 'guinea-worm-disease-deaths-over-5'
linkId = 'suspected-malaria-cases-under-5'
linkId = 'suspected-malaria-cases-over-5'
linkId = 'suspected-malaria-deaths-under-5'
linkId = 'suspected-malaria-deaths-over-5'
linkId = 'rift-valley-fever-cases-under-5'
linkId = 'rift-valley-fever-cases-over-5'
linkId = 'rift-valley-fever-deaths-under-5'
linkId = 'rift-valley-fever-deaths-over-5'
linkId = 'deaths-due-to-malaria-summary'
linkId = 'deaths-due-to-malaria-cases-under-5'
linkId = 'deaths-due-to-malaria-cases-over-5'
linkId = 'deaths-due-to-malaria-deaths-under-5'
linkId = 'deaths-due-to-malaria-deaths-over-5'
Helper group: create Encounter from Moh505 Reporting Site page
'Location/' + ans.valueReference.reference
Helper group: create a disease weekly count Observation (all 4 age/outcome components)
summaryItem.linkId.replace('-summary', '')
Helper group: create Malaria Lab Surveillance Observation
Microscopy panel - Blood by Malaria smear