Narratif généré : StructureMap CdaToBundle #xD; map "https://interop.esante.gouv.fr/ig/fhir/mappingcdafhir/StructureMap/CdaToBundle" = "CdaToBundle"#xD; #xD; // Mapping de CDA 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/AssignedAuthor" alias AssignedAuthor as source#xD; uses "http://hl7.org/cda/stds/core/StructureDefinition/AssignedEntity" alias AssignedEntity as source#xD; uses "http://hl7.org/cda/stds/core/StructureDefinition/CustodianOrganization" alias CustodianOrganization 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/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/Organization" alias Organization as target#xD; #xD; imports "https://interop.esante.gouv.fr/ig/fhir/mappingcdafhir/StructureMap/CdaToFHIRTypes"#xD; #xD; // _________________________ Document Level Template _________________________#xD; group CdaToBundle(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 {#xD; cda then ClinicalDocumentToBundle(cda, patient, composition, bundle) "cdatobundle";#xD; } "ClinicalDocumentToBody";#xD; }#xD; #xD; group ClinicalDocumentToBundle(source cda : ClinicalDocument, target patient : Patient, target composition : Composition, target bundle : Bundle) {#xD; cda -> bundle.id = uuid() "id";#xD; cda.id as cdaId -> bundle.identifier as identifier then {#xD; cdaId.root as root where cdaId.extension.exists() -> identifier.system = translate(root, '#oid2uri', 'uri') "system";#xD; cdaId.extension as extension -> identifier.value = extension "value";#xD; cdaId.root as root where cdaId.extension.empty() -> identifier.system = 'urn:ietf:rfc:3986' "systemOid";#xD; cdaId.root as root where cdaId.extension.empty() -> identifier.value = append('urn:oid:', root) "valueOid";#xD; } "identifier";#xD; cda -> bundle.type = 'document' "type";#xD; cda.effectiveTime as effectiveTime -> bundle.timestamp = create('instant') as timestamp then TSInstant(effectiveTime, timestamp) "timestamp";#xD; cda then ClinicalDocumentComposition(cda, composition, patient, bundle) "composition";#xD; cda.component as cdaComponent then {#xD; cdaComponent.structuredBody as body then {#xD; body.component as bodyComponent then {#xD; bodyComponent.section as srcSection where $this.code.empty() -> composition.section as tgtSection then ClinicalDocumentSection(cda, srcSection, patient, tgtSection, bundle);#xD; } "bodyComponent";#xD; } "body";#xD; } "cdaComponent";#xD; }#xD; #xD; // // _________________________ Section Level Templates _________________________#xD; group ClinicalDocumentSection(source cda : ClinicalDocument, source src : Section, source patient : Patient, target tgt, target bundle : Bundle) {#xD; src.title as t -> tgt.title = (t.xmlText);#xD; src.code as srcCode -> tgt.code = srcCode;#xD; src.text as cdaText -> tgt.text as fhirText then {#xD; cdaText -> fhirText.status = 'generated' "narrativeStatus";#xD; cdaText as t -> fhirText.div = t "narrativeText";#xD; } "cdaText";#xD; src.section as srcSection -> tgt.section as tgtSection then ClinicalDocumentSection(cda, srcSection, patient, tgtSection, bundle);#xD; }#xD; #xD; // _________________________ Entry Level Templates ________________________#xD; // _________________________ Header Level Templates _________________________#xD; group ClinicalDocumentComposition(source src : ClinicalDocument, target tgt : Composition, target patientResource : Patient, target bundle : Bundle) {#xD; src.languageCode as languageCode -> tgt.language = create('code') as code then CSCode(languageCode, code);#xD; src.id as id where src.setId.exists().not() -> tgt.identifier = create('Identifier') as identifier then II(id, identifier) "identifier";#xD; src.setId as setId -> tgt.identifier = create('Identifier') as identifier then II(setId, identifier) "setIdentifier";#xD; src -> tgt.status = 'final' "status";#xD; src.code as srcCode -> tgt.type = create('CodeableConcept') as cc then CDCodeableConcept(srcCode, cc);#xD; src.title as t -> tgt.title = (t.xmlText);#xD; src.recordTarget as recordTarget then {#xD; recordTarget.patientRole as patient -> tgt.subject = create('Reference') as reference, reference.reference = ('urn:uuid:' + %patientResource.id) then ClinicalDocumentPatientRole(patient, patientResource, bundle) "subject";#xD; } "patientRole";#xD; src.componentOf as comp -> bundle.entry as e, e.resource = create('Encounter') as encounter, encounter.id = uuid() as uuid, e.fullUrl = append('urn:uuid:', uuid) then {#xD; comp.encompassingEncounter as srcEnc -> tgt.encounter = create('Reference') as reference, reference.reference = ('urn:uuid:' + %encounter.id) then ClinicalDocumentEncounter(srcEnc, bundle, encounter) "srcEncounter";#xD; } "encompassingEncounter";#xD; src.effectiveTime as effectiveTime -> tgt.date = create('dateTime') as date then TSDateTime(effectiveTime, date) "compositionDate";#xD; src.author as srcAuthor -> bundle.entry as e, e.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid2, e.fullUrl = append('urn:uuid:', uuid2), bundle.entry as eRole, eRole.resource = create('PractitionerRole') as practitionerRole, practitionerRole.id = uuid() as uuidRole, eRole.fullUrl = append('urn:uuid:', uuidRole), tgt.author = create('Reference') as reference, reference.reference = ('urn:uuid:' + %practitionerRole.id) then {#xD; srcAuthor -> practitioner.meta = create('Meta') as meta then {#xD; srcAuthor -> meta.profile = 'https://interop.esante.gouv.fr/ig/fhir/annuaire/StructureDefinition/as-practitioner' "practitionerProfile";#xD; } "practitionerMeta";#xD; srcAuthor -> practitionerRole.meta = create('Meta') as metaRole then {#xD; srcAuthor -> metaRole.profile = 'https://interop.esante.gouv.fr/ig/fhir/annuaire/StructureDefinition/as-practitionerrole' "practitionerRoleProfile";#xD; } "practitionerRoleMeta";#xD; srcAuthor -> practitionerRole.practitioner = create('Reference') as refPract, refPract.reference = ('urn:uuid:' + %practitioner.id) "practitionerRef";#xD; srcAuthor.assignedAuthor as assignedAuthor then {#xD; assignedAuthor.id as id -> practitioner.identifier = create('Identifier') as identifier then {#xD; id -> identifier then II(id, identifier) "baseIdentifier";#xD; id where root = '1.2.250.1.71.4.2.1' -> identifier.type = create('CodeableConcept') as type then {#xD; id -> type.coding = create('Coding') as coding then {#xD; id -> coding.system = 'https://hl7.fr/ig/fhir/core/CodeSystem/fr-core-cs-v2-0203' "system";#xD; id -> coding.code = 'IDNPS' "code";#xD; } "coding";#xD; } "idNatPs";#xD; } "identifier";#xD; assignedAuthor.addr as addr -> practitioner.address = create('Address') as address then ADAddress(addr, address);#xD; assignedAuthor.telecom as tlc -> practitioner.telecom = create('ContactPoint') as contactPoint then TELContactPoint(tlc, contactPoint);#xD; assignedAuthor.assignedPerson as assPerson then {#xD; assPerson.name as pName -> practitioner.name = create('HumanName') as humanName then ENHumanName(pName, humanName);#xD; } "name";#xD; assignedAuthor.code as roleCode -> practitionerRole.code = create('CodeableConcept') as cc then CDCodeableConcept(roleCode, cc) "roleCode";#xD; assignedAuthor.code as roleCode where code.contains('/') -> practitioner.qualification as qualification then {#xD; roleCode -> qualification.code = create('CodeableConcept') as qualCode then {#xD; roleCode.code as fullCode -> qualCode.coding = create('Coding') as coding then {#xD; fullCode -> coding.code = (%fullCode.substring(%fullCode.indexOf('/') + 1)) "savoirFaireCode";#xD; fullCode -> coding.system = 'https://mos.esante.gouv.fr/NOS/TRE_R38-SpecialiteOrdinale/FHIR/TRE-R38-SpecialiteOrdinale' "systemSavoirFaire";#xD; roleCode.displayName as display -> coding.display = display "display";#xD; } "coding";#xD; } "qualCode";#xD; } "savoirFaire";#xD; assignedAuthor.code as roleCode where code.contains('/') and code.contains('_') -> practitioner.qualification as qualification then {#xD; roleCode -> qualification.code = create('CodeableConcept') as qualCode then {#xD; roleCode.code as fullCode -> qualCode.coding = create('Coding') as coding then {#xD; fullCode -> coding.code = (%fullCode.substring(%fullCode.indexOf('_') + 1).substring(0, %fullCode.substring(%fullCode.indexOf('_') + 1).indexOf('/'))) "professionCode";#xD; fullCode -> coding.system = 'https://mos.esante.gouv.fr/NOS/TRE_G15-ProfessionSante/FHIR/TRE-G15-ProfessionSante' "systemProfession";#xD; fullCode where %fullCode.substring(%fullCode.indexOf('_') + 1).substring(0, %fullCode.substring(%fullCode.indexOf('_') + 1).indexOf('/')) = '10' -> coding.display = 'Médecin' "displayMedecin";#xD; } "coding";#xD; } "qualCode";#xD; } "profession";#xD; assignedAuthor.representedOrganization as srcOrg -> bundle.entry as e2, e2.resource = create('Organization') as organization, organization.id = uuid() as uuid3, e2.fullUrl = append('urn:uuid:', uuid3), practitionerRole.organization = create('Reference') as refOrg, refOrg.reference = ('urn:uuid:' + %organization.id) then ClinicalDocumentOrganization(srcOrg, organization);#xD; } "author";#xD; } "srcAuthor";#xD; src.informant as srcInformant -> bundle.entry as e, e.resource = create('RelatedPerson') as relatedPerson, relatedPerson.id = uuid() as uuidRelated, e.fullUrl = append('urn:uuid:', uuidRelated) then {#xD; srcInformant.relatedEntity as relatedEntity then {#xD; relatedEntity -> relatedPerson.patient = create('Reference') as patientRef, patientRef.reference = ('urn:uuid:' + %patientResource.id) "patientRef";#xD; relatedEntity.code as relationCode -> relatedPerson.relationship = create('CodeableConcept') as cc then CDCodeableConcept(relationCode, cc) "relationship";#xD; relatedEntity.addr as addr -> relatedPerson.address = create('Address') as address then ADAddress(addr, address) "address";#xD; relatedEntity.telecom as tlc -> relatedPerson.telecom = create('ContactPoint') as contactPoint then TELContactPoint(tlc, contactPoint);#xD; relatedEntity.relatedPerson as relPerson then {#xD; relPerson.name as pName -> relatedPerson.name = create('HumanName') as humanName then ENHumanName(pName, humanName);#xD; } "relatedPersonName";#xD; };#xD; };#xD; src.confidentialityCode as confCode -> tgt.confidentiality = create('code') as code then CSCode(confCode, code);#xD; src.legalAuthenticator as legalAuth -> bundle.entry as e, e.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid2, e.fullUrl = append('urn:uuid:', uuid2) then {#xD; legalAuth -> tgt.attester as attester then {#xD; legalAuth -> attester.mode = 'legal' "mode";#xD; legalAuth.time as time -> attester.time = create('dateTime') as dt then TSDateTime(time, dt);#xD; legalAuth.assignedEntity as entity -> attester.party = create('Reference') as reference, reference.reference = ('urn:uuid:' + %practitioner.id) then ClinicalDocumentEntityPractitioner(entity, practitioner) "entity";#xD; } "attester";#xD; } "legalAuth";#xD; src.authenticator as auth -> bundle.entry as e, e.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid2, e.fullUrl = append('urn:uuid:', uuid2) then {#xD; auth -> tgt.attester as attester then {#xD; auth -> attester.mode = 'official' "mode";#xD; auth.time as time -> attester.time = create('dateTime') as dt then TSDateTime(time, dt);#xD; auth.assignedEntity as entity -> attester.party = create('Reference') as reference, reference.reference = ('urn:uuid:' + %practitioner.id) then ClinicalDocumentEntityPractitioner(entity, practitioner) "entity";#xD; } "attester";#xD; } "auth";#xD; src.custodian as custodian -> bundle.entry as e then {#xD; custodian.assignedCustodian as assignedCustodian -> e.resource = create('Organization') as organization, organization.id = uuid() as uuid3, e.fullUrl = append('urn:uuid:', uuid3) then {#xD; assignedCustodian.representedCustodianOrganization as srcOrg -> tgt.custodian = create('Reference') as reference, reference.reference = ('urn:uuid:' + %organization.id) then ClinicalDocumentOrganization(srcOrg, organization) "assignedCustodian";#xD; } "custodian";#xD; } "cust";#xD; src.documentationOf as docOf then {#xD; docOf.serviceEvent as serviceEvent -> tgt.event as event then {#xD; serviceEvent.code as eventCode -> event.code = create('CodeableConcept') as cc then CDCodeableConcept(eventCode, cc) "eventCode";#xD; serviceEvent.effectiveTime as effectivetime -> event.period = create('Period') as period then IVLTSPeriod(effectivetime, period) "eventTime"; // performerType: for src.performer.typeCode ...#xD; } "docOf";#xD; };#xD; src.relatedDocument as relatedDoc -> tgt.relatesTo as relates then {#xD; relatedDoc.typeCode as typeCode -> relates.code = typeCode;#xD; relatedDoc.parentDocument as parentDoc then {#xD; parentDoc.setId as sid -> relates.targetIdentifier = sid;#xD; } "parentDoc";#xD; } "relatedDoc";#xD; }#xD; #xD; group ClinicalDocumentEntityPractitioner(source src : AssignedEntity, target tgt : Practitioner) {#xD; src -> tgt.meta = create('Meta') as meta then {#xD; src -> meta.profile = 'https://interop.esante.gouv.fr/ig/fhir/annuaire/StructureDefinition/as-practitioner' "profile";#xD; } "meta";#xD; src.id as srcId -> tgt.identifier = create('Identifier') as identifier then {#xD; srcId -> identifier then II(srcId, identifier) "baseIdentifier";#xD; srcId where root = '1.2.250.1.71.4.2.1' -> identifier.type = create('CodeableConcept') as type then {#xD; srcId -> type.coding = create('Coding') as coding then {#xD; srcId -> coding.system = 'https://hl7.fr/ig/fhir/core/CodeSystem/fr-core-cs-v2-0203' "system";#xD; srcId -> coding.code = 'IDNPS' "code";#xD; } "coding";#xD; } "idNatPs";#xD; } "identifier";#xD; src.addr as srcAddr -> tgt.address = create('Address') as address then ADAddress(srcAddr, address);#xD; src.telecom as srcTelecom -> tgt.telecom = create('ContactPoint') as contactPoint then TELContactPoint(srcTelecom, contactPoint);#xD; src.assignedPerson as person then {#xD; person.name as pName -> tgt.name = create('HumanName') as humanName then ENHumanName(pName, humanName);#xD; } "name";#xD; }#xD; #xD; group ClinicalDocumentOrganization(source src : CustodianOrganization, target tgt : Organization) {#xD; src -> tgt.meta = create('Meta') as meta then {#xD; src -> meta.profile = 'https://interop.esante.gouv.fr/ig/fhir/annuaire/StructureDefinition/as-organization' "profile";#xD; } "meta";#xD; src.id as srcId -> tgt.identifier = create('Identifier') as identifier then II(srcId, identifier);#xD; src.name as v -> tgt.name = (v.other);#xD; src.telecom as srcTelecom -> tgt.telecom = create('ContactPoint') as contactPoint then TELContactPoint(srcTelecom, contactPoint);#xD; src.addr as srcAddr -> tgt.address = create('Address') as address then ADAddress(srcAddr, address);#xD; }#xD; #xD; group ClinicalDocumentPatientRole(source src : PatientRole, target tgt : Patient, target bundle : Bundle) {#xD; // src.id -> tgt.identifier;#xD; // Patient.identifier.type for EPR context, because there is only the identifier "LocalPid" allowed, LocalPid requires an type -> http://build.fhir.org/ig/hl7ch/ch-core/branches/master/StructureDefinition-ch-core-composition-patient-epr.html#xD; // Modification NR#xD; src.id as id -> tgt.identifier = create('Identifier') as identifier then setFrPatientIdentifier(id, identifier);#xD; src.addr as srcAddr -> tgt.address = create('Address') as address then ADAddress(srcAddr, address);#xD; src.telecom as srcTelecom -> tgt.telecom = create('ContactPoint') as contactPoint then TELContactPoint(srcTelecom, contactPoint);#xD; src.patient as patient then {#xD; patient.name as patientName -> tgt.name = create('HumanName') as humanName then ENHumanName(patientName, humanName);#xD; patient.administrativeGenderCode as gender then {#xD; gender.code as v -> tgt.gender = translate(v, 'https://interop.esante.gouv.fr/ig/fhir/mappingcdafhir/ConceptMap/cm-v3-administrative-gender', 'code') "gender";#xD; } "gender";#xD; patient.birthTime as birthTime -> tgt.birthDate = create('date') as date then TSDate(birthTime, date) "birthDate";#xD; patient.deceasedInd as indicator where patient.deceasedTime.empty() -> tgt.deceased = create('boolean') as bool then boolean(indicator, bool) "deceasedBL";#xD; patient.deceasedTime as dTime -> tgt.deceased = dTime;#xD; patient.maritalStatusCode as mStatus -> tgt.maritalStatus = mStatus "maritalStatus";#xD; patient.languageCommunication as language -> tgt.communication as communication then {#xD; language.languageCode as lCode -> communication.language = lCode "communication"; // preference: for language.preferenceInd make communication.preferred#xD; } "language";#xD; } "patientrole";#xD; src.providerOrganization as org -> bundle.entry as e, e.resource = create('Organization') as organization, organization.id = uuid() as uuid3, e.fullUrl = append('urn:uuid:', uuid3) then {#xD; org -> tgt.managingOrganization = create('Reference') as reference, reference.reference = ('urn:uuid:' + %organization.id) "reference";#xD; org.id as orgId -> organization.identifier = create('Identifier') as identifier then II(orgId, identifier);#xD; org.name as v -> organization.name = (v.other);#xD; org.telecom as orgTel -> organization.telecom = create('ContactPoint') as contactPoint then TELContactPoint(orgTel, contactPoint);#xD; org.addr as orgAddr -> organization.address = create('Address') as address then ADAddress(orgAddr, address);#xD; } "organization";#xD; }#xD; #xD; group setFrPatientIdentifier(source id : II, target identifier : Identifier) {#xD; id -> identifier, identifier.type as type, type.coding as coding, coding.system as system, coding.code as code then {#xD; // src -> system.value = 'http://terminology.hl7.org/CodeSystem/v2-0203' "system";#xD; // INS-NIR - 1.2.250.1.213.1.4.8#xD; id where (id.root = '1.2.250.1.213.1.4.8') -> system.value = 'https://hl7.fr/ig/fhir/core/CodeSystem/fr-core-cs-v2-0203' "system";#xD; id where (id.root = '1.2.250.1.213.1.4.8') -> code.value = 'INS-NIR' "code";#xD; // IPP - 1.2.3.4.5.6.7.8.9.10#xD; id where (id.root = '1.2.3.4.5.6.7.8.9.10') -> system.value = 'http://terminology.hl7.org/CodeSystem/v2-0203' "system";#xD; id where (id.root = '1.2.3.4.5.6.7.8.9.10') -> code.value = 'PI' "code";#xD; } "identifierType";#xD; id.extension as extension -> identifier.value as value, value.value = extension;#xD; id.root as root -> identifier.system as system, system.value = append('urn:oid:', root);#xD; }#xD; #xD; // Fin modification NR#xD; // Etat initial#xD; // src -> tgt.identifier as identifier then {#xD; // src.id as id -> identifier.type as type, type.coding as coding, coding.system as system, coding.code as code then {#xD; // src -> system.value = 'http://terminology.hl7.org/CodeSystem/v2-0203' "system";#xD; // src -> code.value = 'MR' "code";#xD; // id.extension as extension -> identifier.value as value, value.value = extension "extension";#xD; // id.root as root -> identifier.system as system, system.value = append('urn:oid:', root) "root";#xD; // } "id";#xD; // } "identifier";#xD; // Fin état initial#xD; group ClinicalDocumentEncounter(source src : EncompassingEncounter, target bundle : Bundle, target tgt : Encounter) {#xD; src.id as Id -> tgt.identifier = create('Identifier') as identifier then II(Id, identifier);#xD; src -> tgt.status = 'finished' "status";#xD; src.code as srcCode -> tgt.class = create('Coding') as coding then {#xD; srcCode.code as code -> coding.code = cast(code, 'string');#xD; srcCode.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');#xD; srcCode.displayName as display -> coding.display = cast(display, 'string');#xD; } "class";#xD; src.code as srcCode -> tgt.type = create('CodeableConcept') as cc then CDCodeableConcept(srcCode, cc);#xD; src.effectiveTime as effTime -> tgt.period = create('Period') as period then IVLTSPeriod(effTime, period);#xD; src where admissionReferralSourceCode.exists() or dischargeDispositionCode.exists() -> tgt.hospitalization as hosp then {#xD; src.admissionReferralSourceCode as admRef -> hosp.admitSource = create('CodeableConcept') as cc then CDCodeableConcept(admRef, cc) "adminReferral";#xD; src.dischargeDispositionCode as discDispo -> hosp.dischargeDisposition = create('CodeableConcept') as cc then CDCodeableConcept(discDispo, cc) "discDisposition";#xD; } "hospitalization";#xD; src.encounterParticipant as srcPart -> tgt.participant as tgtPart then {#xD; srcPart.typeCode as code -> tgtPart.type = cc('http://terminology.hl7.org/CodeSystem/v3-ParticipationType', code);#xD; srcPart.time as srcTime -> tgtPart.period = create('Period') as period then IVLTSPeriod(srcTime, period);#xD; srcPart.assignedEntity as entity -> bundle.entry as e, e.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid2, e.fullUrl = append('urn:uuid:', uuid2) then {#xD; entity -> tgtPart.individual = create('Reference') as reference, reference.reference = ('urn:uuid:' + %practitioner.id) then ClinicalDocumentEntityPractitioner(entity, practitioner) "entry";#xD; } "entity";#xD; } "participant";#xD; src.location as srcLocation then {#xD; srcLocation.healthCareFacility as facility -> bundle.entry as e, e.resource = create('Location') as location, location.id = uuid() as uuid2, e.fullUrl = append('urn:uuid:', uuid2) then {#xD; facility -> tgt.location as tgtLocation, tgtLocation.location = create('Reference') as reference, reference.reference = ('urn:uuid:' + %location.id) then ClinicalDocumentLocation(facility, bundle, location) "facLocation";#xD; } "facility";#xD; };#xD; }#xD; #xD; group ClinicalDocumentLocation(source src : HealthCareFacility, target bundle : Bundle, target tgt : Location) {#xD; src.id as srcIdentifier -> tgt.identifier = create('Identifier') as identifier then II(srcIdentifier, identifier);#xD; src.code as srcCode -> tgt.type = create('CodeableConcept') as cc then {#xD; srcCode.code as code -> cc.coding = create('Coding') as coding then {#xD; code -> coding.code = code "code";#xD; code -> coding.system = 'https://mos.esante.gouv.fr/NOS/TRE_R02-SecteurActivite/FHIR/TRE-R02-SecteurActivite' "system";#xD; srcCode.displayName as display -> coding.display = display "display";#xD; } "coding";#xD; } "locationType";#xD; src.location as location then {#xD; // place names are usually stored with no parts location.name as srcName -> tgt.name = cast(srcName, 'string');#xD; location.addr as locAddr -> tgt.address = create('Address') as address then ADAddress(locAddr, address);#xD; location.serviceProviderOrganization as srcOrg -> bundle.entry as e, e.resource = create('Organization') as organization, organization.id = uuid() as uuid3, e.fullUrl = append('urn:uuid:', uuid3) then {#xD; srcOrg -> tgt.managingOrganization = create('Reference') as reference, reference.reference = ('urn:uuid:' + %organization.id) then ClinicalDocumentOrganization(srcOrg, organization) "organization";#xD; } "org";#xD; }; // place names are usually stored with no parts#xD; }#xD; #xD; // _________________________ Template Type not specified ___________________#xD; group NarrativeLink(source url, target ext : Extension) {#xD; url -> ext.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink' "url";#xD; url -> ext.value = create('url') as value, value.value = url "value";#xD; }#xD; #xD;
Mapping de CDA 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
%fullCode.substring(%fullCode.indexOf('/') + 1)
code.contains('/') and code.contains('_')
%fullCode.substring(%fullCode.indexOf('_') + 1).substring(0, %fullCode.substring(%fullCode.indexOf('_') + 1).indexOf('/'))
%fullCode.substring(%fullCode.indexOf('_') + 1).substring(0, %fullCode.substring(%fullCode.indexOf('_') + 1).indexOf('/')) = '10'
performerType: for src.performer.typeCode ...
preference: for language.preferenceInd make communication.preferred
Fin modification NR Etat initial src -> tgt.identifier as identifier then { src.id as id -> identifier.type as type, type.coding as coding, coding.system as system, coding.code as code then { src -> system.value = 'http://terminology.hl7.org/CodeSystem/v2-0203' "system"; src -> code.value = 'MR' "code"; id.extension as extension -> identifier.value as value, value.value = extension "extension"; id.root as root -> identifier.system as system, system.value = append('urn:oid:', root) "root"; } "id"; } "identifier"; Fin état initial
admissionReferralSourceCode.exists() or dischargeDispositionCode.exists()
place names are usually stored with no parts