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.
Draft as of 2024-04-24 |
@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
# - resource -------------------------------------------------------------------
a fhir:StructureMap ;
fhir:nodeRole fhir:treeRoot ;
fhir:id [ fhir:v "CertSHCtoCoreDataSet"] ; #
fhir:meta [
fhir:versionId [ fhir:v "6" ] ;
fhir:lastUpdated [ fhir:v "2023-02-07T17:09:07.618+00:00"^^xsd:dateTime ]
] ; #
fhir:text [
fhir:status [ fhir:v "generated" ] ;
fhir:div "<div xmlns=\"http://www.w3.org/1999/xhtml\"><pre>map "http://smart.who.int/ddcc/StructureMap/CertSHCtoCoreDataSet" = "CertSHCtoCoreDataSet"\r\n\r\n// Structure map transforming CertSHC logical model to bundle of Core Data Set logical model\r\n\r\nuses "http://smart.who.int/ddcc/StructureDefinition/CertSHC" alias JWTPayload as source\r\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" alias DDCCBundle as target\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet" alias DDCC as produced\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet.VS" alias DDCCVS as produced\r\n\r\nimports "http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetVS"\r\nimports "http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetTR"\r\n\r\ngroup CertSHCtoCoreDataSetBundle(source src : JWTPayload, target ddccBundle : Bundle) {\r\n src.vc as vc then {\r\n vc.credentialSubject as credentialSubject then {\r\n credentialSubject.fhirBundle as fhirBundle then {\r\n fhirBundle.entry as patientEntrySHC then {\r\n patientEntrySHC.resource : Patient first as patient then {\r\n fhirBundle.entry as entry then {\r\n entry.resource : Immunization as immunization -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet.VS') as ddcc then {\r\n immunization then PatientToDDCCVS(patient, ddcc) "set patient";\r\n immunization -> ddcc.vaccination as vaccination then ImmunizationToDDCC(immunization, vaccination) "set vaccination";\r\n immunization then CertSHCtoCoreDataSet(src, ddcc) "set ddcc";\r\n immunization -> outentry.resource = ddcc "set outentry";\r\n } "immunizations";\r\n entry.resource : Observation as lab -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet.TR') as ddcc then {\r\n lab then PatientToDDCCTR(patient, ddcc) "set patient";\r\n lab -> ddcc.test as test then LabToDDCC(lab, test) "set test";\r\n lab then CertSHCtoCoreDataSet(src, ddcc) "set ddcc";\r\n lab -> outentry.resource = ddcc "set outentry";\r\n } "labs";\r\n } "entries";\r\n } "get patient";\r\n } "find patient";\r\n };\r\n };\r\n };\r\n}\r\n\r\ngroup CertSHCtoCoreDataSet(source src : JWTPayload, target ddcc : DDCC) {\r\n src -> ddcc.certificate as cert then {\r\n src.iss -> cert.issuer = create('Reference') as issuer then {\r\n src.iss as iss -> issuer.reference = iss "set issuer";\r\n } "issuer";\r\n src -> cert.period = create('Period') as period then {\r\n src then JwtToPeriod(src, period) "set period";\r\n } "period";\r\n } "certificate";\r\n}\r\n\r\ngroup JwtToPeriod(source src : JWTPayload, target tgt : Period) {\r\n src.nbf as nbf -> append(nbf, ' seconds') as epoch, tgt.start = (@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()) "set period start to notBefore";\r\n src.iat as iat -> append(iat, ' seconds') as epoch, tgt.start = (@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()) "set period start to issuedAt";\r\n src.exp as exp -> append(exp, ' seconds') as epoch, tgt.end = (@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()) "set period end";\r\n}\r\n\r\n</pre></div>"
] ; #
fhir:url [ fhir:v "http://smart.who.int/ddcc/StructureMap/CertSHCtoCoreDataSet"^^xsd:anyURI] ; #
fhir:version [ fhir:v "1.0.0"] ; #
fhir:name [ fhir:v "CertSHCtoCoreDataSet"] ; #
fhir:status [ fhir:v "draft"] ; #
fhir:date [ fhir:v "2024-04-24T00:11:34+00:00"^^xsd:dateTime] ; #
fhir:publisher [ fhir:v "WHO"] ; #
fhir:contact ( [
fhir:name [ fhir:v "WHO" ] ;
( fhir:telecom [
fhir:system [ fhir:v "url" ] ;
fhir:value [ fhir:v "http://who.int" ] ] )
] ) ; #
fhir:description [ fhir:v "Structure map transforming CertSHC logical model to bundle of Core Data Set logical model"] ; #
fhir:jurisdiction ( [
( fhir:coding [
fhir:system [ fhir:v "http://unstats.un.org/unsd/methods/m49/m49.htm"^^xsd:anyURI ] ;
fhir:code [ fhir:v "001" ] ] )
] ) ; #
fhir:structure ( [
fhir:url [
fhir:v "http://smart.who.int/ddcc/StructureDefinition/CertSHC"^^xsd:anyURI ;
fhir:link <http://smart.who.int/ddcc/StructureDefinition/CertSHC> ] ;
fhir:mode [ fhir:v "source" ] ;
fhir:alias [ fhir:v "JWTPayload" ]
] [
fhir:url [
fhir:v "http://hl7.org/fhir/StructureDefinition/Bundle"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/Bundle> ] ;
fhir:mode [ fhir:v "target" ] ;
fhir:alias [ fhir:v "DDCCBundle" ]
] [
fhir:url [
fhir:v "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet"^^xsd:anyURI ;
fhir:link <http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet> ] ;
fhir:mode [ fhir:v "produced" ] ;
fhir:alias [ fhir:v "DDCC" ]
] [
fhir:url [
fhir:v "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet.VS"^^xsd:anyURI ;
fhir:link <http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet.VS> ] ;
fhir:mode [ fhir:v "produced" ] ;
fhir:alias [ fhir:v "DDCCVS" ]
] ) ; #
fhir:import ( [
fhir:v "http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetVS"^^xsd:anyURI ;
fhir:link <http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetVS>
] [
fhir:v "http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetTR"^^xsd:anyURI ;
fhir:link <http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetTR>
] ) ; #
fhir:group ( [
fhir:name [ fhir:v "CertSHCtoCoreDataSetBundle" ] ;
fhir:typeMode [ fhir:v "none" ] ;
( fhir:input [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "JWTPayload" ] ;
fhir:mode [ fhir:v "source" ] ] [
fhir:name [ fhir:v "ddccBundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ] ] ) ;
( fhir:rule [
fhir:name [ fhir:v "vc" ] ;
( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "vc" ] ;
fhir:variable [ fhir:v "vc" ] ] ) ;
( fhir:rule [
fhir:name [ fhir:v "credentialSubject" ] ;
( fhir:source [
fhir:context [ fhir:v "vc" ] ;
fhir:element [ fhir:v "credentialSubject" ] ;
fhir:variable [ fhir:v "credentialSubject" ] ] ) ;
( fhir:rule [
fhir:name [ fhir:v "fhirBundle" ] ;
( fhir:source [
fhir:context [ fhir:v "credentialSubject" ] ;
fhir:element [ fhir:v "fhirBundle" ] ;
fhir:variable [ fhir:v "fhirBundle" ] ] ) ;
( fhir:rule [
fhir:name [ fhir:v "find patient" ] ;
( fhir:source [
fhir:context [ fhir:v "fhirBundle" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "patientEntrySHC" ] ] ) ;
( fhir:rule [
fhir:name [ fhir:v "get patient" ] ;
( fhir:source [
fhir:context [ fhir:v "patientEntrySHC" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:listMode [ fhir:v "first" ] ;
fhir:variable [ fhir:v "patient" ] ] ) ;
( fhir:rule [
fhir:name [ fhir:v "entries" ] ;
( fhir:source [
fhir:context [ fhir:v "fhirBundle" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "entry" ] ] ) ;
( fhir:rule [
fhir:name [ fhir:v "immunizations" ] ;
( fhir:source [
fhir:context [ fhir:v "entry" ] ;
fhir:type [ fhir:v "Immunization" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "immunization" ] ] ) ;
( fhir:target [
fhir:context [ fhir:v "ddccBundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "outentry" ] ] [
fhir:contextType [ fhir:v "variable" ] ;
fhir:variable [ fhir:v "ddcc" ] ;
fhir:transform [ fhir:v "create" ] ;
( fhir:parameter [
fhir:value [ fhir:v "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet.VS" ] ] ) ] ) ;
( fhir:rule [
fhir:name [ fhir:v "set patient" ] ;
( fhir:source [
fhir:context [ fhir:v "immunization" ] ] ) ;
( fhir:dependent [
fhir:name [ fhir:v "PatientToDDCCVS" ] ;
( fhir:variable [ fhir:v "patient" ] [ fhir:v "ddcc" ] ) ] ) ] [
fhir:name [ fhir:v "set vaccination" ] ;
( fhir:source [
fhir:context [ fhir:v "immunization" ] ] ) ;
( fhir:target [
fhir:context [ fhir:v "ddcc" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "vaccination" ] ;
fhir:variable [ fhir:v "vaccination" ] ] ) ;
( fhir:dependent [
fhir:name [ fhir:v "ImmunizationToDDCC" ] ;
( fhir:variable [ fhir:v "immunization" ] [ fhir:v "vaccination" ] ) ] ) ] [
fhir:name [ fhir:v "set ddcc" ] ;
( fhir:source [
fhir:context [ fhir:v "immunization" ] ] ) ;
( fhir:dependent [
fhir:name [ fhir:v "CertSHCtoCoreDataSet" ] ;
( fhir:variable [ fhir:v "src" ] [ fhir:v "ddcc" ] ) ] ) ] [
fhir:name [ fhir:v "set outentry" ] ;
( fhir:source [
fhir:context [ fhir:v "immunization" ] ] ) ;
( fhir:target [
fhir:context [ fhir:v "outentry" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:transform [ fhir:v "copy" ] ;
( fhir:parameter [
fhir:value [ fhir:v "ddcc" ] ] ) ] ) ] ) ] [
fhir:name [ fhir:v "labs" ] ;
( fhir:source [
fhir:context [ fhir:v "entry" ] ;
fhir:type [ fhir:v "Observation" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "lab" ] ] ) ;
( fhir:target [
fhir:context [ fhir:v "ddccBundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "outentry" ] ] [
fhir:contextType [ fhir:v "variable" ] ;
fhir:variable [ fhir:v "ddcc" ] ;
fhir:transform [ fhir:v "create" ] ;
( fhir:parameter [
fhir:value [ fhir:v "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet.TR" ] ] ) ] ) ;
( fhir:rule [
fhir:name [ fhir:v "set patient" ] ;
( fhir:source [
fhir:context [ fhir:v "lab" ] ] ) ;
( fhir:dependent [
fhir:name [ fhir:v "PatientToDDCCTR" ] ;
( fhir:variable [ fhir:v "patient" ] [ fhir:v "ddcc" ] ) ] ) ] [
fhir:name [ fhir:v "set test" ] ;
( fhir:source [
fhir:context [ fhir:v "lab" ] ] ) ;
( fhir:target [
fhir:context [ fhir:v "ddcc" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "test" ] ;
fhir:variable [ fhir:v "test" ] ] ) ;
( fhir:dependent [
fhir:name [ fhir:v "LabToDDCC" ] ;
( fhir:variable [ fhir:v "lab" ] [ fhir:v "test" ] ) ] ) ] [
fhir:name [ fhir:v "set ddcc" ] ;
( fhir:source [
fhir:context [ fhir:v "lab" ] ] ) ;
( fhir:dependent [
fhir:name [ fhir:v "CertSHCtoCoreDataSet" ] ;
( fhir:variable [ fhir:v "src" ] [ fhir:v "ddcc" ] ) ] ) ] [
fhir:name [ fhir:v "set outentry" ] ;
( fhir:source [
fhir:context [ fhir:v "lab" ] ] ) ;
( fhir:target [
fhir:context [ fhir:v "outentry" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:transform [ fhir:v "copy" ] ;
( fhir:parameter [
fhir:value [ fhir:v "ddcc" ] ] ) ] ) ] ) ] ) ] ) ] ) ] ) ] ) ] ) ] )
] [
fhir:name [ fhir:v "CertSHCtoCoreDataSet" ] ;
fhir:typeMode [ fhir:v "none" ] ;
( fhir:input [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "JWTPayload" ] ;
fhir:mode [ fhir:v "source" ] ] [
fhir:name [ fhir:v "ddcc" ] ;
fhir:type [ fhir:v "DDCC" ] ;
fhir:mode [ fhir:v "target" ] ] ) ;
( fhir:rule [
fhir:name [ fhir:v "certificate" ] ;
( fhir:source [
fhir:context [ fhir:v "src" ] ] ) ;
( fhir:target [
fhir:context [ fhir:v "ddcc" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "certificate" ] ;
fhir:variable [ fhir:v "cert" ] ] ) ;
( fhir:rule [
fhir:name [ fhir:v "issuer" ] ;
( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "iss" ] ] ) ;
( fhir:target [
fhir:context [ fhir:v "cert" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "issuer" ] ;
fhir:variable [ fhir:v "issuer" ] ;
fhir:transform [ fhir:v "create" ] ;
( fhir:parameter [
fhir:value [ fhir:v "Reference" ] ] ) ] ) ;
( fhir:rule [
fhir:name [ fhir:v "set issuer" ] ;
( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "iss" ] ;
fhir:variable [ fhir:v "iss" ] ] ) ;
( fhir:target [
fhir:context [ fhir:v "issuer" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "copy" ] ;
( fhir:parameter [
fhir:value [ fhir:v "iss" ] ] ) ] ) ] ) ] [
fhir:name [ fhir:v "period" ] ;
( fhir:source [
fhir:context [ fhir:v "src" ] ] ) ;
( fhir:target [
fhir:context [ fhir:v "cert" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "period" ] ;
fhir:variable [ fhir:v "period" ] ;
fhir:transform [ fhir:v "create" ] ;
( fhir:parameter [
fhir:value [ fhir:v "Period" ] ] ) ] ) ;
( fhir:rule [
fhir:name [ fhir:v "set period" ] ;
( fhir:source [
fhir:context [ fhir:v "src" ] ] ) ;
( fhir:dependent [
fhir:name [ fhir:v "JwtToPeriod" ] ;
( fhir:variable [ fhir:v "src" ] [ fhir:v "period" ] ) ] ) ] ) ] ) ] )
] [
fhir:name [ fhir:v "JwtToPeriod" ] ;
fhir:typeMode [ fhir:v "none" ] ;
( fhir:input [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "JWTPayload" ] ;
fhir:mode [ fhir:v "source" ] ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:type [ fhir:v "Period" ] ;
fhir:mode [ fhir:v "target" ] ] ) ;
( fhir:rule [
fhir:name [ fhir:v "set period start to notBefore" ] ;
( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "nbf" ] ;
fhir:variable [ fhir:v "nbf" ] ] ) ;
( fhir:target [
fhir:contextType [ fhir:v "variable" ] ;
fhir:variable [ fhir:v "epoch" ] ;
fhir:transform [ fhir:v "append" ] ;
( fhir:parameter [
fhir:value [ fhir:v "nbf" ] ] [
fhir:value [ fhir:v " seconds" ] ] ) ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "start" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
( fhir:parameter [
fhir:value [ fhir:v "@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()" ] ] ) ] ) ] [
fhir:name [ fhir:v "set period start to issuedAt" ] ;
( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "iat" ] ;
fhir:variable [ fhir:v "iat" ] ] ) ;
( fhir:target [
fhir:contextType [ fhir:v "variable" ] ;
fhir:variable [ fhir:v "epoch" ] ;
fhir:transform [ fhir:v "append" ] ;
( fhir:parameter [
fhir:value [ fhir:v "iat" ] ] [
fhir:value [ fhir:v " seconds" ] ] ) ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "start" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
( fhir:parameter [
fhir:value [ fhir:v "@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()" ] ] ) ] ) ] [
fhir:name [ fhir:v "set period end" ] ;
( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "exp" ] ;
fhir:variable [ fhir:v "exp" ] ] ) ;
( fhir:target [
fhir:contextType [ fhir:v "variable" ] ;
fhir:variable [ fhir:v "epoch" ] ;
fhir:transform [ fhir:v "append" ] ;
( fhir:parameter [
fhir:value [ fhir:v "exp" ] ] [
fhir:value [ fhir:v " seconds" ] ] ) ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "end" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
( fhir:parameter [
fhir:value [ fhir:v "@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()" ] ] ) ] ) ] )
] ) . #
IG © 2021+ WHO. Package who.ddcc#1.0.0 based on FHIR 4.0.1. Generated 2024-04-24
Links: Table of Contents |
QA Report
| Issues
| Version History | License