WHO Immunization Implementation Guide
0.2.0 - ci-build

WHO Immunization Implementation Guide, published by WHO. This guide is not an authorized publication; it is the continuous build for version 0.2.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/immunizations/StructureMap/IMMZCQRToLM Version: 0.2.0
Draft as of 2024-12-18 Computable Name: IMMZCQRToLM

Immunization Client Registry - Transform QuestionnaireResponse to Logical Model

Generated Narrative: StructureMap IMMZCQRToLM

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

// Immunization Client Registry - Transform QuestionnaireResponse to Logical Model

uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QResp as source
uses "http://smart.who.int/immunizations/StructureDefinition/IMMZCClientregistration" 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 = 'uniqueIdentifier' then {
      answer.value as content -> immzc.uniqueIdentifier = content "SetIdentifier";
    } "FirstAnswerForIdentifier";
    item.answer first as answer where item.linkId = 'name' 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";
    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 = 'dateOfBirth' then {
      answer.value as content -> immzc.dateOfBirth = content "SetBirthDate";
    } "FirstAnswerForBirthDate";
    item.answer first as answer where item.linkId = 'age' then {
      answer.value as content -> immzc.age = content "SetAge";
    } "FirstAnswerForAge";
    item as caregiver where item.linkId = 'caregiversMultiple' -> immzc.caregiversMultiple as caretgt then {
      caregiver.item as cgitem then {
        cgitem.answer first as answer where cgitem.linkId = 'caregiversFullName' then {
          answer.value as content -> caretgt.caregiversFullName = content "SetFullName";
        } "FirstAnswerForFullName";
        cgitem.answer first as answer where cgitem.linkId = 'caregiversFirstName' then {
          answer.value as content -> caretgt.caregiversFirstName = content "SetFirstName";
        } "FirstAnswerForFirstName";
        cgitem.answer first as answer where cgitem.linkId = 'caregiversFamilyName' then {
          answer.value as content -> caretgt.caregiversFamilyName = content "SetFamilyName";
        } "FirstAnswerForFamilyName";
      } "caregiverItems";
    } "AnswerForCaregiverMultiple";
    item.answer first as answer where item.linkId = 'contactPhoneNumber' then {
      answer.value as content -> immzc.contactPhoneNumber = content "SetPhone";
    } "FirstAnswerForPhone";
    item.answer first as answer where item.linkId = 'address' then {
      answer.value as content -> immzc.address = content "SetAddress";
    } "FirstAnswerForAddress";
  } "processItems";
}