WHO SMART Guidelines - Measles Immunization
0.1.0 - ci-build

WHO SMART Guidelines - Measles Immunization, published by WHO. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/WorldHealthOrganization/smart-example-immz and changes regularly. See the Directory of published versions

StructureMap:

Official URL: http://smart.who.int/immunizations-measles/StructureMap/IMMZCQRToLM Version: 0.1.0
Draft as of 2024-08-12 Computable Name: IMMZCQRToLM

Immunization Client Registry - Extract QuestionnaireResponse to Logical Model

Generated Narrative: StructureMap IMMZCQRToLM

map "http://smart.who.int/immunizations-measles/StructureMap/IMMZCQRToLM" = "IMMZCQRToLM"

// Immunization Client Registry - Extract QuestionnaireResponse to Logical Model

uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QResp as source
uses "http://smart.who.int/immunizations-measles/StructureDefinition/IMMZCRegisterClient" alias IMMZC as target

group QRespToIMMZC(source qr : QResp, target immzc : IMMZC) {
  qr.item as item then {
    item.answer first as answer where item.linkId = 'uniqueId' then {
      answer.value as content -> immzc.uniqueId = content "SetIdentifier";
    } "FirstAnswerForIdentifier";
    item as name where item.linkId = 'name' then NameToIMMZC(name, immzc) "SetNames";
    item.answer first as answer where item.linkId = 'sex' then {
      answer.value as coding then {
        coding.code as content -> immzc.sex = content "SetSex";
      } "ProcessCoding";
    } "FirstAnswerForIdentifier";
    item.answer first as answer where item.linkId = 'birthDate' then {
      answer.value as content -> immzc.birthDate = content "SetBirthDate2";
    } "FirstAnswerForBirthDate";
    item.answer as caregiver where item.linkId = 'caregiver' -> immzc.caregiver as caretgt then NameToIMMZC(caregiver, caretgt) "SetCaregiver";
    item.answer first as answer where item.linkId = 'phone' then {
      answer.value as content -> immzc.phone = content "SetPhone";
    } "FirstAnswerForPhone";
    item.answer first as answer where item.linkId = 'administrativeArea' then {
      answer.value as coding -> immzc.administrativeArea as area then {
        coding -> area.coding = coding "SetCodingValue";
        coding.display as display -> area.text = display "SetDisplay";
      } "SetCoding";
    } "FirstAnswerForAdministrativeArea";
    item.answer first as answer where item.linkId = 'healthWorker' then {
      answer.value as content -> immzc.healthWorker = content "SetHealthWorker";
    } "FirstAnswerForHealthWorker";
  } "processItems";
}

group NameToIMMZC(source name, target immzc) {
  name.item as item then {
    item.answer first as answer where item.linkId = 'fullName' then {
      answer.value as content -> immzc.name = content "SetFullName";
    } "FirstAnswerForFullName";
  } "processNameItems";
}