Generated Narrative: StructureMap CertDIVOCtoCoreDataSet #xD; map "http://smart.who.int/ddcc/StructureMap/CertDIVOCtoCoreDataSet" = "CertDIVOCtoCoreDataSet"#xD; #xD; // Structure map transforming CertDIVOC logical model to bundle of Core Data Set logical model#xD; #xD; uses "http://smart.who.int/ddcc/StructureDefinition/CertDIVOC" alias DIVOC as source#xD; uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias DDCCBundle as target#xD; uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet" alias DDCC as target#xD; uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS" alias DDCCVS as target#xD; uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetTR" alias DDCCTR as target#xD; #xD; group CertDIVOCtoCoreDataSetBundle(source src : DIVOC, target ddccBundle : DDCCBundle) {#xD; src.type as type then {#xD; type where type = 'ProofOfVaccinationCredential' then {#xD; src.evidence as evidence -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS') as ddcc then {#xD; src.credentialSubject as credentialSubject then CredentialSubjecttoCoreDataSet(credentialSubject, ddcc) "set patient";#xD; src -> ddcc.certificate as certificate then CertDIVOCtoCoreDataSetCertificate(src, evidence, certificate) "set certificate";#xD; evidence -> ddcc.vaccination as vaccination then EvidencetoCoreDataSetVS(evidence, vaccination) "set vaccination";#xD; evidence -> outentry.resource = ddcc "set outentry";#xD; };#xD; } "ProofOfVaccinationCredential";#xD; type where type = 'ProofOfTestCertificateCredential' then {#xD; src.evidence as evidence -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetTR') as ddcc then {#xD; src.credentialSubject as credentialSubject then CredentialSubjecttoCoreDataSet(credentialSubject, ddcc) "set patient";#xD; src -> ddcc.certificate as certificate then CertDIVOCtoCoreDataSetCertificate(src, evidence, certificate) "set certificate";#xD; evidence -> ddcc.test as test then EvidencetoCoreDataSetTR(evidence, test) "set test";#xD; evidence -> outentry.resource = ddcc "set outentry";#xD; };#xD; } "ProofOfTestCertificateCredential";#xD; };#xD; }#xD; #xD; group CredentialSubjecttoCoreDataSet(source credentialSubject, target ddcc : DDCC) {#xD; credentialSubject.name as name -> ddcc.name = name "set name";#xD; credentialSubject.dob as birthDate -> ddcc.birthDate = birthDate "set birthDate";#xD; credentialSubject.id as id -> create('Identifier') as identifier, identifier.value = id then {#xD; id -> ddcc.identifier = identifier "set identifier";#xD; } "identifier";#xD; }#xD; #xD; group CertDIVOCtoCoreDataSetCertificate(source src : DIVOC, source evidence, target certificate) {#xD; evidence.certificateId as certificateId -> certificate.hcid as hcid, hcid.value = certificateId "set hcid";#xD; src.context as context then {#xD; context where (context.contains('cowin.gov.in')) -> certificate.version = context "set version";#xD; };#xD; evidence -> certificate.period = create('Period') as period then {#xD; evidence.effectiveStart as effectiveStart -> period.start = effectiveStart "set period start";#xD; evidence.effectiveUntil as effectiveUntil -> period.end = effectiveUntil "set period end";#xD; } "period";#xD; src.issuer as issuer -> certificate.issuer = create('Reference') as issuer, issuer.display = issuer "set issuer";#xD; }#xD; #xD; group EvidencetoCoreDataSetVS(source evidence, target vaccination) {#xD; evidence.icd11Code as icd11Code -> vaccination.vaccine as coding, coding.system = 'http://id.who.int/icd11/mms', coding.code = icd11Code "set vaccine";#xD; evidence.vaccine as vaccine -> vaccination.brand as coding, coding.code = vaccine "set brand";#xD; evidence.manufacturer as manufacturer -> vaccination.manufacturer as coding, coding.code = manufacturer "set manufacturer";#xD; evidence.batch as batch -> vaccination.lot = batch "set lot";#xD; evidence.date as date -> vaccination.date = date "set date";#xD; evidence.dose as dose -> vaccination.dose = dose "set dose";#xD; evidence.totalDoses as totalDoses -> vaccination.totalDoses = totalDoses "set totalDoses";#xD; evidence.facility as facility then {#xD; facility.address as address then {#xD; address.addressCountry as addressCountry -> vaccination.country as coding, coding.system = 'urn:iso:std:iso:3166', coding.code = addressCountry "set country";#xD; };#xD; facility.name as name -> vaccination.centre = name "set centre";#xD; };#xD; evidence.verifier as verifier then {#xD; verifier.name as name -> vaccination.practitioner as practitioner, practitioner.value = name "set practitioner";#xD; };#xD; }#xD; #xD; group EvidencetoCoreDataSetTR(source evidence, target test) {#xD; evidence.disease as disease then {#xD; disease where disease = 'COVID-19' -> test.pathogen as coding, coding.system = 'http://id.who.int/icd11/mms', coding.code = 'XN109' "set COVID19 pathogen";#xD; disease where (disease = 'COVID-19').not() -> test.pathogen as coding, coding.code = disease "set other pathogen";#xD; };#xD; evidence.testType as testType then {#xD; testType -> test.type as coding, coding.code = testType "set default type";#xD; testType -> c('http://smart.who.int/ddcc/CodeSystem/lab-test-type-divoc', testType) as coded then {#xD; testType where coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-divoc') -> test.type = translate(coded, 'http://smart.who.int/ddcc/ConceptMap/lab-test-type-divoc-to-icd11', 'Coding') "translate DIVOC type";#xD; } "coding";#xD; };#xD; evidence.sampleOrigin as sampleOrigin then {#xD; sampleOrigin -> test.origin as coding, coding.code = sampleOrigin "set default origin";#xD; sampleOrigin -> c('http://smart.who.int/ddcc/CodeSystem/lab-test-sample-origin-divoc', sampleOrigin) as coded then {#xD; sampleOrigin where coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-sample-origin-divoc') -> test.origin = translate(coded, 'http://smart.who.int/ddcc/ConceptMap/lab-test-sample-origin-divoc-to-icd11', 'Coding') "translate DIVOC origin";#xD; } "coding";#xD; };#xD; evidence.result as result then {#xD; result -> test.result as coding, coding.code = result "set default result";#xD; result -> c('http://smart.who.int/ddcc/CodeSystem/lab-test-qual-result-divoc', result) as coded then {#xD; result where coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-qual-result-divoc') -> test.result = translate(coded, 'http://smart.who.int/ddcc/ConceptMap/lab-test-qual-result-divoc-to-icd11', 'Coding') "translate DIVOC result";#xD; } "coded";#xD; };#xD; evidence.sampleCollectionTimestamp as date -> test.date = date "set date";#xD; evidence.testName as testName -> test.brand as coding, coding.code = testName "set brand";#xD; evidence.manufacturer as manufacturer -> test.manufacturer as coding, coding.code = manufacturer "set manufacturer";#xD; evidence.facility as facility then {#xD; facility.address as address then {#xD; address.addressCountry as addressCountry -> test.country as coding, coding.system = 'urn:iso:std:iso:3166', coding.code = addressCountry "set country";#xD; };#xD; facility.name as name -> test.centre as coding, coding.code = name "set centre";#xD; };#xD; }#xD; #xD;
Structure map transforming CertDIVOC logical model to bundle of Core Data Set logical model
type = 'ProofOfTestCertificateCredential'