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/IMMZD1QRToLM Version: 0.1.0
Draft as of 2024-05-30 Computable Name: IMMZD1QRToLM
map "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD1QRToLM" = "IMMZD1QRToLM"

uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QResp as source
uses "http://smart.who.int/ig/smart-immunizations/StructureDefinition/IMMZD1ClientHistory" alias IMMZD1 as target

group QRespToIMMZD1(source qr : QResp, target immz : IMMZD1) {
  qr.subject as patient -> immz.patient = patient "SetPatient";
  qr.item as item then {
    item.answer as answer where item.linkId = 'type' then {
      answer.value as coding -> immz.type = coding "SetVaccineType";
    } "AnswerForType";
    item.answer first as answer where item.linkId = 'booster' then {
      answer.value as content -> immz.booster = content "SetBooster";
    } "FirstAnswerForBooster";
    item.answer first as answer where item.linkId = 'completedPrimarySeries' then {
      answer.value as content -> immz.completedPrimarySeries = content "SetCompletedPrimarySeries";
    } "FirstAnswerForCompletedPrimarySeries";
    item.answer first as answer where item.linkId = 'dateSeriesCompleted' then {
      answer.value as content -> immz.dateSeriesCompleted = content "SetDateSeriesCompleted";
    } "FirstAnswerDateSeriesCompleted";
    item.answer first as answer where item.linkId = 'hivStatus' then {
      answer.value as coding -> immz.hivStatus = coding "SetHIVStatus";
    } "FirstAnswerForHIVStatus";
    item.answer first as answer where item.linkId = 'pretermBirth' then {
      answer.value as content -> immz.pretermBirth = content "SetPretermBirth";
    } "FirstAnswerForPretermBirth";
    item.answer first as answer where item.linkId = 'immunocompromised' then {
      answer.value as content -> immz.immunocompromised = content "SetImmunocompromised";
    } "FirstAnswerForImmunocompromised";
    item.answer first as answer where item.linkId = 'onART' then {
      answer.value as content -> immz.onART = content "SetOnART";
    } "FirstAnswerForOnART";
    item as history where item.linkId = 'vaccineHistory' -> immz.vaccineHistory as vaccine then {
      history.item as entry then {
        entry.answer as answer where entry.linkId = 'vaccineType' then {
          answer.value as coding -> vaccine.vaccineType = coding "SetVaccineType";
        } "AnswerForVaccineType";
        entry.answer as answer where entry.linkId = 'vaccineDate' then {
          answer.value as content -> vaccine.vaccineDate = content "SetVaccineDate";
        } "AnswerForVaccineDate";
      } "HistoryLoop";
    } "ForVaccineHistory";
  } "processItems";
}