WHO Digital Documentation of COVID-19 Certificates (DDCC)
1.0.0 - CI Build International flag

This is the continuous build for version 1.0.0. This version is based on the current content of https://github.com/WorldHealthOrganization/ddcc and changes regularly.

StructureMap: ResourcesToCoreDataSet

Official URL: http://worldhealthorganization.github.io/ddcc/StructureMap/ResourcesToCoreDataSet Version: 1.0.0
Draft as of 2022-06-01 Computable Name: ResourcesToCoreDataSet
map "http://worldhealthorganization.github.io/ddcc/StructureMap/ResourcesToCoreDataSet" = "ResourcesToCoreDataSet"


uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as source
uses "http://hl7.org/fhir/StructureDefinition/HumanName" alias HumanName as produced
uses "http://worldhealthorganization.github.io/ddcc/StructureDefinition/DDCCPatient" alias DDCCPatient as source
uses "http://worldhealthorganization.github.io/ddcc/StructureDefinition/DDCCImmunization" alias DDCCImmunization as source
uses "http://worldhealthorganization.github.io/ddcc/StructureDefinition/DDCCImmunizationRecommendation" alias DDCCImmunizationRecommendation as source
uses "http://worldhealthorganization.github.io/ddcc/StructureDefinition/DDCCCoreDataSetPoV" alias DDCCPoV as target

group ResourcesToCoreDataSet(source bundle : Bundle, target ddcc : DDCCPoV) {
  bundle.entry as entry then {
    entry.resource : Patient as patient then PatientToHeader(patient, ddcc) "set header";
  } "set header from patient";
}

group PatientToHeader(source patient : DDCCPatient, target ddcc : DDCCPoV) {
  patient.name as name then {
    name as src -> ddcc as tgt then NameToText(src, tgt) "setting name";
  } "set name";
}

group NameToText(source src : HumanName, target tgt) {
  src.given as given -> tgt.name = given "set here";
}