SMART ICVP
0.1.0 - ci-build

This page is part of the ICVP (v0.1.0: Releases Draft) based on FHIR (HL7® FHIR® Standard) R4. This is the current published version in its permanent home (it will always be available at this URL). For a full list of available versions, see the Directory of published versions

StructureMap:

Official URL: http://smart.who.int/icvp/StructureMap/DVCQRtoDVCLM Version: 0.1.0
Draft as of 2024-10-07 Computable Name: DVCQRtoDVCLM

Generated Narrative: StructureMap DVCQRtoDVCLM

map "http://smart.who.int/icvp/StructureMap/DVCQRtoDVCLM" = "DVCQRtoDVCLM"

uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QuestionnaireResponse as source
uses "http://smart.who.int/icvp/StructureDefinition/ModelDVC" alias DVCLogicalModel as target
uses "http://smart.who.int/icvp/StructureDefinition/ModelVaccineDetails" alias ModelVaccineDetails as target
uses "http://smart.who.int/icvp/StructureDefinition/DVCPayload" alias DVCClaim as target

group DVCQRtoDVCLM(source qr : QuestionnaireResponse, target lm : DVCLogicalModel) {
  qr.item as item where linkId.value in ('name') then {
    item.answer as answer then {
      answer.value as name -> lm.name = name "rule1";
    } "rule1a";
  } "rule1b";
  qr.item as item where linkId.value in ('dob') then {
    item.answer as answer then {
      answer.value as dob -> lm.dob = dob "rule2";
    } "rule2a";
  } "rule2b";
  qr.item as item where linkId.value in ('sex') then {
    item.answer as answer then {
      answer.value as sex -> lm.sex = sex "rule3";
    } "rule3a";
  } "rule3b";
  qr.item as item where linkId.value in ('nationality') then {
    item.answer as answer then {
      answer.value as nationality -> lm.nationality = nationality "rule4";
    } "rule4a";
  } "rule4b";
  qr.item as item where linkId.value in ('nid') then {
    item.answer as answer then {
      answer.value as nid -> lm.nid = nid "rule5";
    } "rule5a";
  } "rule5b";
  qr.item as item where linkId.value in ('guardian') then {
    item.answer as answer then {
      answer.value as guardian -> lm.guardian = guardian "rule6";
    } "rule6a";
  } "rule6b";
  qr.item as item where linkId.value in ('vaccineDetails') -> lm.vaccineDetails as v then mapVaccineDetails(item, v) "rule7";
}

group mapVaccineDetails(source s : BackboneElement, target v : ModelVaccineDetails) {
  s.item as item where linkId.value in ('doseNumber') then {
    item.answer as answer then {
      answer.value as doseNumber -> v.doseNumber = doseNumber "rule7";
    } "rule7a";
  } "rule7b";
  s.item as item where linkId.value in ('disease') then {
    item.answer as answer then {
      answer.value as disease -> v.disease = disease "rule8";
    } "rule8a";
  } "rule8b";
  s.item as item where linkId.value in ('vaccineClassification') then {
    item.answer as answer then {
      answer.value as vaccine -> v.vaccineClassification = vaccine "rule9";
    } "rule9a";
  } "rule9b";
  s.item as item where linkId.value in ('vaccineTradeItem') then {
    item.answer as answer then {
      answer.value as vaccine -> v.vaccineTradeItem = vaccine "rule10";
    } "rule10a";
  } "rule10b";
  s.item as item where linkId.value in ('date') then {
    item.answer as answer then {
      answer.value as date -> v.date = date "rule11";
    } "rule11a";
  } "rule11b";
  s.item as item where linkId.value in ('clinicianName') then {
    item.answer as answer then {
      answer.value as clinicianName -> v.clinicianName = clinicianName "rule12";
    } "rule12a";
  } "rule12b";
  s.item as item where linkId.value in ('manufacturerId') then {
    item.answer as answer then {
      answer.value as mid -> v.manufacturerId = mid "rule13";
    } "rule13a";
  } "rule13b";
  s.item as item where linkId.value in ('manufacturer') then {
    item.answer as answer then {
      answer.value as manufacturer -> v.manufacturer = manufacturer "rule14";
    } "rule14a";
  } "rule14b";
  s.item as item where linkId.value in ('batchNo') then {
    item.answer as answer then {
      answer.value as batchNo -> v.batchNo = batchNo "rule15";
    } "rule15a";
  } "rule15b";
  s.item as item where linkId.value in ('validityPeriod') then {
    item -> v.validityPeriod as period then {
      item.item as item where linkId.value in ('startDate') then {
        item.answer as answer then {
          answer.validityPeriod as start -> period.start = start "rule16";
        } "rule16a";
      } "rule16b";
      item.item as item where linkId.value in ('endDate') then {
        item.answer as answer then {
          answer.validityPeriod as end -> period.end = end "rule17";
        } "rule17a";
      } "rule17b";
    } "rule18";
  } "rule19";
}