SMART ICVP
0.1.0 - ci-build

SMART ICVP, 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-icvp/tree/main and changes regularly. See the Directory of published versions

StructureMap:

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

Generated Narrative: StructureMap DVCClaimtoDVCLM

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

uses "http://smart.who.int/icvp/StructureDefinition/DVCPayload" alias DVCPayload as source
uses "http://smart.who.int/icvp/StructureDefinition/ModelDVC" alias DVCModel as target
uses "http://smart.who.int/icvp/StructureDefinition/ModelVaccineDetails" alias ModelVaccineDetails as target

group DVCClaimtoDVCLM(source src : DVCPayload, target tgt : DVCModel) {
  src.n as name -> tgt.name = name "rule1";
  src.dob as dob -> tgt.dob = dob "rule2";
  src.s as sex -> tgt.sex = sex "rule3";
  src.ntl as nationality -> tgt.nationality = nationality "rule4";
  src.nid as id -> tgt.nid = id "rule5";
  src.gn as gName -> tgt.guardian = gName "rule6";
  src.v as v -> tgt.vaccineDetails as tv then mapVaccineDetails(v, tv) "rule7";
}

group mapVaccineDetails(source src : BackboneElement, target tgt : ModelVaccineDetails) {
  src.tg as tg ->  create('Coding') as coding,  coding.code = tg,  coding.system = 'http://id.who.int/icd/release/11/mms',  tgt.disease = coding "rule8";
  src.vp as vp ->  create('Coding') as coding,  coding.code = vp,  coding.system = 'http://id.who.int/icd/release/11/mms',  create('CodeableConcept') as code,  code.coding = coding,  tgt.vaccineClassification = code "rule9";
  src.mp as mp ->  create('Identifier') as id,  id.value = mp,  tgt.vaccineTradeItem = id "rule10";
  src.ma as ma -> tgt.manufacturer = ma "rule11";
  src.mid as mid ->  create('Identifier') as id,  id.value = mid,  tgt.manufacturerId = id "rule12";
  src.dt as dt -> tgt.date = dt "rule13";
  src.bo as bo -> tgt.batchNo = bo "rule14";
  src -> create('Period') as period then {
    src.vls as start -> period.start = start "rule15";
    src.vle as end -> period.end = end "rule16";
    src -> tgt.validityPeriod = period "rule17";
  } "rule18";
  src.cn as cn -> tgt.clinicianName = cn "rule19";
  src.is as is ->  tgt.issuer as issuer,  issuer.reference = append('Organization/', is) "rule21";
  src.dn as dn ->  create('Coding') as coding,  coding.code = dn,  coding.system = 'http://smart.who.int/icvp/CodeSystem/doseNumber',  create('CodeableConcept') as code,  code.coding = coding,  tgt.doseNumber = code "rule20";
}

// helper function
group generateNarrativeText(source src : Section, target text : string) {
  src -> text.status = 'empty' "setstatus";
  src -> text.div = '<div>narrative not available</div>' "setdiv";
}

group humanNameToHumanName(source sourceName, target targetName : HumanName) {
  sourceName.use as use -> targetName.use = use "CopyUse";
  sourceName.text as text -> targetName.text = text "CopyText";
  sourceName.family as family -> targetName.family = family "CopyFamily";
  sourceName.given as given -> targetName.given = given "CopyGiven";
  sourceName.prefix as prefix -> targetName.prefix = prefix "CopyPrefix";
  sourceName.suffix as suffix -> targetName.suffix = suffix "CopySuffix";
  // Copy the period using the previously defined group function
  sourceName.period as sourcePeriod -> targetName.period as targetPeriod then {
    sourcePeriod -> sourcePeriod then periodToPeriod(sourcePeriod, targetPeriod) "CopyPeriod";
  } "copyPeriod";
}

group periodToPeriod(source sourcePeriod, target targetPeriod : Period) {
  sourcePeriod.start as start -> targetPeriod.start = start "set period start";
  sourcePeriod.end as end -> targetPeriod.end = end "set period end";
}