FHIR © HL7.org  |  Server Home  |  XIG Home  |  Server Source  |  FHIR  

FHIR IG Statistics: StructureMap/SHCToCoreDataSetTR

Packagewho.ddcc
TypeStructureMap
IdSHCToCoreDataSetTR
FHIR VersionR4
Sourcehttp://smart.who.int/ddcc/https://build.fhir.org/ig/WorldHealthOrganization/ddcc/StructureMap-SHCToCoreDataSetTR.html
URLhttp://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetTR
Version1.0.0
Statusdraft
Date2025-06-24T09:07:32+00:00
NameSHCToCoreDataSetTR
Realmuv
Authoritywho

Resources that use this resource

No resources found


Resources that this resource uses

No resources found


Narrative

Note: links and images are rebased to the (stated) source

Generated Narrative: StructureMap SHCToCoreDataSetTR

map "http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetTR" = "SHCToCoreDataSetTR"

uses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-infectious-disease-laboratory-bundle-dm" alias SHCLabBundleDM 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-infectious-disease-laboratory-result-observation-dm" alias SHCLabDM as source
uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias DDCCBundle as target
uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetTR" alias DDCCTR as target

group SHCToTR(source shc : SHCLabBundleDM, target ddccBundle : DDCCBundle) {
  shc.entry as patientEntrySHC then {
    patientEntrySHC.resource : Patient first as patient then {
      shc.entry as entry then {
        // entry.resource : Immunization as immunization where vaccineCode.memberOf('http://smart.who.int/ddcc/ValueSet/who-ddcc-allowed-vaccines-covid-19') ->  ddccBundle.entry as outentry,  create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS') as ddcc then {
        entry.resource : Observation as lab ->  ddccBundle.entry as outentry,  create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetTR') as ddcc then {
          lab then PatientToDDCCTR(patient, ddcc) "set patient";
          lab -> ddcc.test as test then LabToDDCC(lab, test) "set test";
          lab -> outentry.resource = ddcc "set outentry";
        } "labs";
      } "entries";
    } "get patient";
  } "find patient";
}

group PatientToDDCCTR(source patient : SHCPatientDM, target tgt : DDCCTR) {
  patient.name as name then NameToText(name, tgt) "set name";
  patient.birthDate as birthDate -> tgt.birthDate = birthDate "set birthDate";
  patient.identifier first as identifier -> tgt.identifier = identifier "set identifier";
}

group NameToText(source name : HumanName, target ddcc) {
  // append doesn't work until ddcc.name is set
  name.given first as given -> ddcc.name = (given.replaceMatches('