WHO Immunization Implementation Guide
0.1.0 - CI Build International flag

WHO Immunization Implementation Guide, published by World Health Organization (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-immunizations and changes regularly. See the Directory of published versions

StructureMap:

Official URL: http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZCQRToLM Version: 0.1.0
Draft as of 2024-05-30 Computable Name: IMMZCQRToLM
map "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZCQRToLM" = "IMMZCQRToLM"

uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QResp as source
uses "http://smart.who.int/ig/smart-immunizations/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 where item.linkId = 'name' then NameToIMMZC(item, immzc) "SetNames";
    item where item.linkId = 'caregiver' -> immzc.caregiver as caregiver then NameToIMMZC(item, caregiver) "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";
    item.answer first as answer where item.linkId = 'firstName' then {
      answer.value as content -> immzc.firstName = content "SetFirstName";
    } "FirstAnswerForFirstName";
    item.answer first as answer where item.linkId = 'familyName' then {
      answer.value as content -> immzc.familyName = content "SetFamilyName";
    } "FirstAnswerForFamilyName";
  } "processNameItems";
}