Narratif généré : StructureMap CdaFrToBundle #xD; map "https://interop.esante.gouv.fr/ig/fhir/mappingcdafhir/StructureMap/CdaFrToBundle" = "CdaFrToBundle"#xD; #xD; // Mapping de CDAFr vers FHIR Bundle (A partir des sources de Oliver Egger)#xD; #xD; uses "http://hl7.org/cda/stds/core/StructureDefinition/ClinicalDocument" alias ClinicalDocument as source#xD; uses "http://hl7.org/cda/stds/core/StructureDefinition/Section" alias Section as source#xD; uses "http://hl7.org/cda/stds/core/StructureDefinition/PatientRole" alias PatientRole as source#xD; uses "http://hl7.org/cda/stds/core/StructureDefinition/DataEnterer" alias DataEnterer as source#xD; uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target#xD; uses "http://hl7.org/fhir/StructureDefinition/Composition" alias Composition as target#xD; uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as target#xD; uses "http://hl7.org/fhir/StructureDefinition/Person" alias Person as target#xD; uses "http://hl7.org/fhir/StructureDefinition/Practitioner" alias Practitioner as target#xD; uses "http://hl7.org/fhir/StructureDefinition/PractitionerRole" alias PractitionerRole as target#xD; uses "http://hl7.org/fhir/StructureDefinition/Organization" alias Organization as target#xD; #xD; imports "https://interop.esante.gouv.fr/ig/fhir/mappingcdafhir/StructureMap/CdaToFHIRTypes"#xD; imports "https://interop.esante.gouv.fr/ig/fhir/mappingcdafhir/StructureMap/CdaToBundle"#xD; #xD; // _________________________ Document Level Template _________________________#xD; // source: https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.756.5.30.1.1.10.1.14#xD; // target: http://build.fhir.org/ig/hl7ch/ch-core/branches/master/StructureDefinition-ch-core-document.html#xD; group CdaFrToBundle(source cda : ClinicalDocument, target bundle : Bundle) {#xD; cda -> bundle.entry as e, e.resource = create('Composition') as composition, composition.id = uuid() as uuid, e.fullUrl = append('urn:uuid:', uuid), bundle.entry as e2, e2.resource = create('Patient') as patient, patient.id = uuid() as uuid2, e2.fullUrl = append('urn:uuid:', uuid2) then ClinicalDocumentFrToBundle(cda, patient, composition, bundle) "ClinicalDocumentToBody";#xD; }#xD; #xD; // source: https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.756.5.30.1.1.10.1.14#xD; // target: http://build.fhir.org/ig/hl7ch/ch-core/branches/master/StructureDefinition-ch-core-document.html#xD; // group ClinicalDocumentFrToBundle(source cda : ClinicalDocument, target patient : Patient, target composition : Composition, target bundle : Bundle)#xD; // extends ClinicalDocumentToBundle {#xD; // cda then ClinicalDocumentCompositionFr(cda, composition, patient, bundle) "composition";#xD; // cda.component as component then {#xD; // component.structuredBody as body then {#xD; // body.component as component then {#xD; // component.section as srcSection where (templateId.where(root='2.16.756.5.30.1.1.10.3.2')) -> composition.section as tgtSection#xD; // then ClinicalDocumentSection(cda, srcSection, patient, tgtSection, bundle);#xD; // component.section as srcSection where (templateId.where(root='2.16.756.5.30.1.1.10.3.45')) -> composition.section as tgtSection#xD; // then SectionOriginalRepresentation(cda, srcSection, patient, tgtSection, bundle);#xD; // } "component";#xD; // } "body";#xD; // } "component";#xD; // }#xD; // _________________________ Section Level Templates _________________________#xD; // source: https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.756.5.30.1.1.10.1.14#xD; // target: http://build.fhir.org/ig/hl7ch/ch-core/branches/master/StructureDefinition-ch-core-composition-definitions.html#Composition.section#xD; // TODO: not excplicitly modeled in CH-Core#xD; group SectionOriginalRepresentation(source cda : ClinicalDocument, source src : Section, source patient : Patient, target tgt, target bundle : Bundle) extends ClinicalDocumentSection {#xD; src.entry as cdaEntry -> bundle.entry as e, e.resource = create('Binary') as binary, binary.id = uuid() as uuid, e.fullUrl = append('urn:uuid:', uuid) as urnuuid, tgt.entry = create('Reference') as reference, reference.reference = urnuuid then {#xD; cdaEntry.observationMedia as observationMedia then {#xD; observationMedia then ObservationMedia(observationMedia, binary) "observationMedia";#xD; observationMedia.ID as value -> reference.extension as ext then NarrativeLink(value, ext) "narrativeLink";#xD; };#xD; } "cdaEntry";#xD; }#xD; #xD; // _________________________ Entry Level Templates ________________________#xD; // source: https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.756.5.30.1.1.10.4.83#xD; // TODO: not excplicitly modeled in CH-Core#xD; group ObservationMedia(source observationMedia, target binary : Binary) {#xD; observationMedia.value as value then {#xD; value.mediaType as mediaType -> binary.contentType = mediaType "contentType";#xD; value -> binary.data = (value.dataBase64Binary) "dataString";#xD; };#xD; observationMedia.languageCode as languageCode then {#xD; languageCode.code as lang -> binary.language = lang "lang";#xD; };#xD; }#xD; #xD; // _________________________ Header Level Templates _________________________#xD; // source: https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.756.5.30.1.1.10.9.36#xD; // target: http://build.fhir.org/ig/hl7ch/ch-core/branches/master/StructureDefinition-ch-ext-epr-confidentialitycode.html#xD; group ChExtEprConfidentialityCode(source src : CE, target ext : Extension) {#xD; src -> ext.url = 'http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-epr-confidentialitycode' "url";#xD; src -> ext.value = create('CodeableConcept') as value then CECodeableConcept(src, value) "code";#xD; }#xD; #xD; // source: https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.756.5.30.1.1.10.9.36#xD; // target: http://build.fhir.org/ig/hl7ch/ch-core/branches/master/StructureDefinition-ch-ext-epr-informationrecipient.html#xD; group ChExtEprInformationRecipient(source src : IntendedRecipient, target patient : Patient, target ext : Extension) {#xD; src -> ext.url = 'http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-epr-informationrecipient' "url";#xD; src -> ext.value = create('Reference') as reference, reference.reference = ('urn:uuid:' + %patient.id) "value";#xD; src.addr as addr -> patient.address as address then ADAddress(addr, address) "address";#xD; src.informationRecipient as informationRecipient then {#xD; informationRecipient.name as cdaname -> patient.name as fhirname then ENHumanName(cdaname, fhirname);#xD; };#xD; }#xD; #xD; // source: https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.756.5.30.1.1.10.9.36#xD; // target: http://build.fhir.org/ig/hl7ch/ch-core/branches/master/StructureDefinition-ch-ext-epr-informationrecipient.html#xD; group ChExtEprInformationRecipientOrganization(source src : IntendedRecipient, target organization : Organization, target ext : Extension) {#xD; src -> ext.url = 'http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-epr-informationrecipient' "url";#xD; src -> ext.value = create('Reference') as reference, reference.reference = ('urn:uuid:' + %organization.id) "value";#xD; src.receivedOrganization as receivedOrganization then ClinicalDocumentOrganization(receivedOrganization, organization) "organization";#xD; }#xD; #xD; // source: https://art-decor.org/art-decor/decor-templates--hl7chcda-?section=templates&id=2.16.756.5.30.1.1.10.2.7#xD; // target: http://build.fhir.org/ig/hl7ch/ch-core/StructureDefinition-ch-ext-epr-dataenterer.html#xD; group ChExtEprDataEnterer(source src : DataEnterer, target bundle : Bundle, target practitionerRole : PractitionerRole, target ext : Extension) {#xD; src -> ext.url = 'http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-epr-dataenterer' "url";#xD; src.assignedEntity as assignedEntity -> ext.extension as ext, ext.url = 'enterer', ext.value = create('Reference') as reference, reference.reference = ('urn:uuid:' + %practitionerRole.id) "PractitionerRole";#xD; src.time as time -> ext.extension as exttime then ChExtEprTime(time, exttime);#xD; src.assignedEntity as assignedEntity then {#xD; assignedEntity -> bundle.entry as e, e.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid, e.fullUrl = append('urn:uuid:', uuid), practitionerRole.practitioner = create('Reference') as reference, reference.reference = append('urn:uuid:', uuid) then ClinicalDocumentEntityPractitioner(assignedEntity, practitioner) "Practitioner";#xD; assignedEntity.representedOrganization as representedOrganization -> bundle.entry as e, e.resource = create('Organization') as organization, organization.id = uuid() as uuid2, e.fullUrl = append('urn:uuid:', uuid2), practitionerRole.organization = create('Reference') as referenceOrg, referenceOrg.reference = append('urn:uuid:', uuid2) then ClinicalDocumentOrganization(representedOrganization, organization) "Organization";#xD; };#xD; }#xD; #xD; // // _________________________ Template Type not specified ___________________#xD; // // source: https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.756.5.30.1.1.10.9.36#xD; // // target: http://build.fhir.org/ig/hl7ch/ch-core/branches/master/StructureDefinition-ch-core-composition-epr.html#xD; group ClinicalDocumentCompositionFr(source src : ClinicalDocument, target tgt : Composition, target patientResource : Patient, target bundle : Bundle) {#xD; src.confidentialityCode as confidentialityCode then {#xD; confidentialityCode.code as v where ('http://fhir.ch/ig/ch-epr-term/ValueSet/DocumentEntry.confidentialityCode'.resolve().compose.include.concept.where($this.code = src.confidentialityCode.code).exists()) -> tgt.confidentiality = translate(v, 'http://fhir.ch/ig/ch-core/ConceptMap/documententry-confidentialitycode-to-fhir', 'code') as fhirconf, fhirconf.extension as ext then ChExtEprConfidentialityCode(confidentialityCode, ext) "confCode";#xD; };#xD; src.informationRecipient as informationRecipient -> bundle.entry as e then {#xD; informationRecipient.intendedRecipient as intendedRecipient where $this.receivedOrganization.exists() = false -> e.resource = create('Patient') as recipient, recipient.id = uuid() as uuid, e.fullUrl = append('urn:uuid:', uuid), tgt.extension as ext then ChExtEprInformationRecipient(intendedRecipient, recipient, ext) "informationRecipient";#xD; informationRecipient.intendedRecipient as intendedRecipient then {#xD; intendedRecipient.receivedOrganization -> e.resource = create('Organization') as recipient, recipient.id = uuid() as uuid2, e.fullUrl = append('urn:uuid:', uuid2), tgt.extension as ext then ChExtEprInformationRecipientOrganization(intendedRecipient, recipient, ext) "informationRecipientOrganization";#xD; } "intendedRecipientAsOrganization";#xD; } "entry";#xD; src.dataEnterer as dataEnterer -> bundle.entry as e, e.resource = create('PractitionerRole') as practitionerRole, practitionerRole.id = uuid() as uuid, e.fullUrl = append('urn:uuid:', uuid), tgt.extension as ext then ChExtEprDataEnterer(dataEnterer, bundle, practitionerRole, ext);#xD; }#xD; #xD;
Mapping de CDAFr vers FHIR Bundle (A partir des sources de Oliver Egger)
Agence du Numérique en Santé (ANS) - 2-10 Rue d'Oradour-sur-Glane, 75015 Paris
_________________________ Document Level Template _________________________ source: https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.756.5.30.1.1.10.1.14 target: http://build.fhir.org/ig/hl7ch/ch-core/branches/master/StructureDefinition-ch-core-document.html
source: https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.756.5.30.1.1.10.1.14 target: http://build.fhir.org/ig/hl7ch/ch-core/branches/master/StructureDefinition-ch-core-document.html group ClinicalDocumentFrToBundle(source cda : ClinicalDocument, target patient : Patient, target composition : Composition, target bundle : Bundle) extends ClinicalDocumentToBundle { cda then ClinicalDocumentCompositionFr(cda, composition, patient, bundle) "composition"; cda.component as component then { component.structuredBody as body then { body.component as component then { component.section as srcSection where (templateId.where(root='2.16.756.5.30.1.1.10.3.2')) -> composition.section as tgtSection then ClinicalDocumentSection(cda, srcSection, patient, tgtSection, bundle); component.section as srcSection where (templateId.where(root='2.16.756.5.30.1.1.10.3.45')) -> composition.section as tgtSection then SectionOriginalRepresentation(cda, srcSection, patient, tgtSection, bundle); } "component"; } "body"; } "component"; } _________________________ Section Level Templates _________________________ source: https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.756.5.30.1.1.10.1.14 target: http://build.fhir.org/ig/hl7ch/ch-core/branches/master/StructureDefinition-ch-core-composition-definitions.html#Composition.section TODO: not excplicitly modeled in CH-Core
_________________________ Entry Level Templates ________________________ source: https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.756.5.30.1.1.10.4.83 TODO: not excplicitly modeled in CH-Core
_________________________ Header Level Templates _________________________ source: https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.756.5.30.1.1.10.9.36 target: http://build.fhir.org/ig/hl7ch/ch-core/branches/master/StructureDefinition-ch-ext-epr-confidentialitycode.html
source: https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.756.5.30.1.1.10.9.36 target: http://build.fhir.org/ig/hl7ch/ch-core/branches/master/StructureDefinition-ch-ext-epr-informationrecipient.html
source: https://art-decor.org/art-decor/decor-templates--hl7chcda-?section=templates&id=2.16.756.5.30.1.1.10.2.7 target: http://build.fhir.org/ig/hl7ch/ch-core/StructureDefinition-ch-ext-epr-dataenterer.html
// _________________________ Template Type not specified ___________________ // source: https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.756.5.30.1.1.10.9.36 // target: http://build.fhir.org/ig/hl7ch/ch-core/branches/master/StructureDefinition-ch-core-composition-epr.html
('http://fhir.ch/ig/ch-epr-term/ValueSet/DocumentEntry.confidentialityCode'.resolve().compose.include.concept.where($this.code = src.confidentialityCode.code).exists())
$this.receivedOrganization.exists() = false