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: SHCtoDDCC

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


uses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-bundle-dm" alias SHCVaccinationBundleDM as source
uses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-general-dm" alias SHCPatientDM as source
uses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-dm" alias SHCImmunizationDM as source
uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target
uses "http://worldhealthorganization.github.io/ddcc/StructureDefinition/DDCCDocument" alias DDCCDocument as produced
uses "http://worldhealthorganization.github.io/ddcc/StructureDefinition/DDCCPatient" alias DDCCPatient as produced
uses "http://worldhealthorganization.github.io/ddcc/StructureDefinition/DDCCComposition" alias DDCCComposition as produced
uses "http://worldhealthorganization.github.io/ddcc/StructureDefinition/DDCCOrganization" alias DDCCOrganization as produced
uses "http://worldhealthorganization.github.io/ddcc/StructureDefinition/DDCCCountryOfVaccination" alias DDCCCountryOfVaccination as produced
uses "http://worldhealthorganization.github.io/ddcc/StructureDefinition/DDCCVaccineBrand" alias DDCCVaccineBrand as produced
uses "http://worldhealthorganization.github.io/ddcc/StructureDefinition/DDCCImmunization" alias DDCCImmunization as produced

group SHCtoDDCC(source shc : SHCVaccinationBundleDM, target ddcc : Bundle) {
  shc.entry as patientEntrySHC then {
    patientEntrySHC.resource : Patient first as patientSHC then {
      shc.entry as immunizationEntrySHC then {
        immunizationEntrySHC.resource : Immunization as immunizationSHC then {
          immunizationEntrySHC -> ddcc.type = 'collection' "Bundle type";
          immunizationEntrySHC -> ddcc.entry as ddccEntry then {
            immunizationSHC -> ddccEntry.resource = create('Bundle') as ddccdocument then {
              immunizationSHC -> ddccdocument.type = 'document' "DDCC Document type";
              patientSHC -> ddccdocument.entry as ddccDocumentEntry then {
                patientSHC -> ddccDocumentEntry.resource = create('Patient') as patientDDCC then SHCPatienttoDDCC(patientSHC, patientDDCC) "DDCC Document patient resource";
              } "DDCC Document patient entry";
              immunizationSHC -> ddccdocument.entry as ddccDocumentEntry then {
                immunizationSHC -> ddccDocumentEntry.resource = create('Immunization') as immunizationDDCC then SHCImmunizationtoDDCC(immunizationSHC, immunizationDDCC) "DDCC Document immunization resource";
              } "DDCC Document immunization entry";
            } "DDCC Document bundle";
          } "DDCC Document entry";
        } "Is immunization entry";
      } "For each immunization entry";
    } "Is Patient entry";
  } "map patient";
}

group SHCPatienttoDDCC(source patient : SHCPatientDM, target patientDDCC : DDCCPatient) {
  immunization.status as status -> immunizationDDCC.status = status "Status";
  immunization.coding as coding -> immunizationDDCC.coding = coding "Coding";
  immunization.occurrence as occurrenceDateTime -> immunizationDDCC.occurrence = occurrenceDateTime "Occurrence DateTime";
  immunization.manfacturer as manfacturer -> immunizationDDCC.manfacturer = manfacturer "Manufacturer";
  immunization.lotNumber as lotNumber -> immunizationDDCC.lotNumber = lotNumber "Lot Number";
}

group SHCImmunizationtoDDCC(source immunization : SHCImmunizationDM, target immunizationDDCC : DDCCImmunization) {
  immunization.status as status -> immunizationDDCC.status = status "Status";
  immunization.coding as coding -> immunizationDDCC.coding = coding "Coding";
  immunization.occurrence as occurrenceDateTime -> immunizationDDCC.occurrence = occurrenceDateTime "Occurrence DateTime";
  immunization.manfacturer as manfacturer -> immunizationDDCC.manfacturer = manfacturer "Manufacturer";
  immunization.lotNumber as lotNumber -> immunizationDDCC.lotNumber = lotNumber "Lot Number";
}