Narratif généré : StructureMap CdaToFHIRTypes #xD; map "https://interop.esante.gouv.fr/ig/fhir/mappingcdafhir/StructureMap/CdaToFHIRTypes" = "CdaToFHIRTypes"#xD; #xD; // Mapping de CDA vers les FHIR Types (A partir des sources de Oliver Egger)#xD; #xD; uses "http://hl7.org/cda/stds/core/StructureDefinition/ED" alias ED as source#xD; uses "http://hl7.org/cda/stds/core/StructureDefinition/PN" alias PN as source#xD; uses "http://hl7.org/cda/stds/core/StructureDefinition/II" alias II as source#xD; uses "http://hl7.org/fhir/StructureDefinition/Identifier" alias Identifier as target#xD; uses "http://hl7.org/cda/stds/core/StructureDefinition/TS" alias TS as source#xD; uses "http://hl7.org/fhir/StructureDefinition/instant" alias instant as target#xD; uses "http://hl7.org/cda/stds/core/StructureDefinition/CS" alias CS as source#xD; uses "http://hl7.org/fhir/StructureDefinition/code" alias code as target#xD; uses "http://hl7.org/cda/stds/core/StructureDefinition/CE" alias CE as source#xD; uses "http://hl7.org/fhir/StructureDefinition/CodeableConcept" alias CodeableConcept as target#xD; uses "http://hl7.org/cda/stds/core/StructureDefinition/ST" alias ST as source#xD; uses "http://hl7.org/fhir/StructureDefinition/string" alias string as target#xD; uses "http://hl7.org/cda/stds/core/StructureDefinition/EN" alias EN as source#xD; uses "http://hl7.org/fhir/StructureDefinition/HumanName" alias HumanName as target#xD; uses "http://hl7.org/cda/stds/core/StructureDefinition/AD" alias AD as source#xD; uses "http://hl7.org/fhir/StructureDefinition/Address" alias Address as target#xD; uses "http://hl7.org/cda/stds/core/StructureDefinition/TEL" alias TEL as source#xD; uses "http://hl7.org/fhir/StructureDefinition/ContactPoint" alias ContactPoint as target#xD; uses "http://hl7.org/cda/stds/core/StructureDefinition/BL" alias BL as source#xD; uses "http://hl7.org/fhir/StructureDefinition/boolean" alias boolean as target#xD; uses "http://hl7.org/cda/stds/core/StructureDefinition/IVL-TS" alias IVL_TS as source#xD; uses "http://hl7.org/fhir/StructureDefinition/Period" alias Period as target#xD; #xD; group Any(source src, target tgt) {#xD; src -> tgt "base";#xD; }#xD; #xD; group II(source src : II, target tgt : Identifier) extends Any <<types>> {#xD; src.root as r where src.extension.exists() -> tgt.system = append('urn:oid:', r) "root1";#xD; src.root as r where src.extension.empty() and src.root.matches('[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}') -> tgt.system = 'urn:ietf:rfc:3986', tgt.value = ('urn:uuid:' + r.lower()) "rootuuid";#xD; src.root as r where src.extension.empty() and src.root.contains('.') -> tgt.system = 'urn:ietf:rfc:3986', tgt.value = append('urn:oid:', r) "rootoid";#xD; src.extension as e -> tgt.value = e;#xD; src.assigningAuthorityName as s -> tgt.assigner as a, a.display = s; // there's no equivalent for displayable in FHIR - and it probably will never matter, but if it does, it might map to Identifier.use.#xD; src.displayable as displayable -> tgt.extension as ext then {#xD; displayable -> ext.url = 'http://hl7.org/fhir/cdaStructureDefinition/extension-displayable' "url";#xD; displayable.value as v -> ext.value = cast(v, 'string');#xD; } "extension";#xD; }#xD; #xD; group INT(source src : INT, target tgt : integer) extends Any <<types>> {#xD; src.value as v -> tgt.value = v "integer";#xD; }#xD; #xD; group TemplateID(source template : II, target tgt) {#xD; template -> tgt.extension as ext then {#xD; template -> ext.url = 'http://hl7.org/cda/stds/core/StructureDefinition/templateID' "url";#xD; template -> ext.value = create('Identifier') as value then II(template, value) "value";#xD; } "templateId";#xD; }#xD; #xD; group Negation(source negation : BL, target tgt) {#xD; negation -> tgt.modifierExtension as ext then {#xD; negation -> ext.url = 'http://hl7.org/cda/stds/core/StructureDefinition/negationIndicator' "url";#xD; negation as neg -> ext.value = create('boolean'), ext.value = neg "value";#xD; } "negation";#xD; }#xD; #xD; group TSInstant(source src : TS, target tgt : instant) extends Any <<types>> {#xD; src.value as v -> tgt.value = cast(v, 'string');#xD; }#xD; #xD; group TSDateTime(source src : TS, target tgt : dateTime) extends TSInstant <<types>> {#xD; src -> tgt "inherit";#xD; }#xD; #xD; group TSDate(source src : TS, target tgt : date) extends TSInstant <<types>> {#xD; src -> tgt "inherit";#xD; }#xD; #xD; group IVLTSPeriod(source src : IVL_TS, target tgt : Period) extends Any <<types>> {#xD; src.low as low -> tgt.start = create('dateTime') as start then TSDateTime(low, start);#xD; src.high as high -> tgt.end = create('dateTime') as end then TSDateTime(high, end);#xD; }#xD; #xD; group IVLTSDateTime(source src : IVL_TS, target tgt : dateTime) extends Any <<types>> {#xD; src.low as s then TSDateTime(s, tgt);#xD; }#xD; #xD; group STstring(source src : ST, target tgt : string) {#xD; src as v -> tgt.value = cast(v, 'string') "value";#xD; }#xD; #xD; group EDstring(source src : ED, target tgt : string) extends STstring <<types>> {#xD; src -> tgt "inherit";#xD; }#xD; #xD; group ONstring(source src : ON, target tgt : string) extends STstring <<types>> {#xD; src -> tgt "inherit";#xD; }#xD; #xD; group CSCode(source src : CS, target tgt : code) {#xD; src.code as c -> tgt.value = cast(c, 'string');#xD; }#xD; #xD; group CECode(source src : CE, target tgt : code) extends CSCode <<types>> {#xD; src -> tgt "inherit";#xD; }#xD; #xD; group CDCode(source src : CD, target tgt : code) extends CSCode <<types>> {#xD; src -> tgt "inherit";#xD; }#xD; #xD; group CECodeableConcept(source src : CE, target tgt : CodeableConcept) {#xD; src.originalText as originalText -> tgt.text = originalText "setOriginalText";#xD; src -> tgt.coding as coding then {#xD; src.code as code -> coding.code = cast(code, 'string');#xD; src.codeSystem as system -> coding.system = append('urn:oid:', system);#xD; src.displayName as display -> coding.display = cast(display, 'string');#xD; } "code";#xD; src.translation as translation -> tgt.coding as coding then {#xD; translation.code as code -> coding.code = cast(code, 'string');#xD; translation.codeSystem as system -> coding.system = append('urn:oid:', system);#xD; translation.displayName as display -> coding.display = cast(display, 'string');#xD; };#xD; }#xD; #xD; group CSCodeableConcept(source src : CS, target tgt : CodeableConcept) extends CECodeableConcept <<types>> {#xD; src -> tgt "inherit";#xD; }#xD; #xD; group CDCodeableConcept(source src : CD, target tgt : CodeableConcept) extends CECodeableConcept <<types>> {#xD; src -> tgt "inherit";#xD; }#xD; #xD; group ENHumanName(source src : EN, target tgt : HumanName) {#xD; src.item as item then {#xD; item.family as v -> tgt.family = (v.xmlText);#xD; item.given as v -> tgt.given = (v.xmlText);#xD; item.prefix as v -> tgt.prefix = (v.xmlText);#xD; item.suffix as v -> tgt.suffix = (v.xmlText);#xD; };#xD; src.validTime as validTime -> tgt.period = validTime;#xD; }#xD; #xD; group PNHumanName(source src : PN, target tgt : HumanName) extends ENHumanName <<types>> {#xD; src -> tgt "inherit";#xD; }#xD; #xD; group ADAddress(source src : AD, target tgt : Address) {#xD; src.item as item then {#xD; item.country as v -> tgt.country = (v.xmlText);#xD; item.state as v -> tgt.state = (v.xmlText);#xD; item.county as v -> tgt.district = (v.xmlText);#xD; item.city as v -> tgt.city = (v.xmlText);#xD; item.postalCode as v -> tgt.postalCode = (v.xmlText);#xD; item.streetAddressLine as v -> tgt.line = (v.xmlText);#xD; item -> tgt.line as line then {#xD; item where src.censusTract.exists() then {#xD; item.censusTract as v -> line.extension as ext1 then CensusTract(v, ext1) "line";#xD; } "sfgfdsg";#xD; } "CensusTract";#xD; // as streetAddress then{#xD; // src.censusTract as v->tgt.line as line, line.extension as ext1 then CensusTract(v, ext1) "line";#xD; // src.censusTract as v ->tgt.line as line, line.extension as ext1 then CensusTract(v, ext1) "line";#xD; item.streetName as v -> tgt.line = (v.xmlText);#xD; item.houseNumber as v -> tgt.line = (v.xmlText);#xD; };#xD; src.useablePeriod as useablePeriod -> tgt.period = useablePeriod;#xD; }#xD; #xD; group TELContactPoint(source src : TEL, target tgt : ContactPoint) {#xD; src.value as v where (src.value.startsWith('tel:')) -> tgt.value = (v.substring(4)), tgt.system = 'phone' "valuetel";#xD; src.value as v where (src.value.startsWith('fax:')) -> tgt.value = (v.substring(4)), tgt.system = 'fax' "valuefax";#xD; src.value as v where (src.value.startsWith('mailto:')) -> tgt.value = (v.substring(7)), tgt.system = 'email' "valuemail";#xD; src.value as v where (src.value.startsWith('http:')) -> tgt.value = (v.substring(5)), tgt.system = 'url' "valuehttp";#xD; src.use where (src.use.startsWith('H')) -> tgt.use = 'home' "usehome";#xD; src.use where ((src.use = 'WP') or (src.use = 'DIR') or (src.use = 'PUB')) -> tgt.use = 'work' "usework";#xD; src.use where (src.use = 'BAD') -> tgt.use = 'old' "usebad";#xD; src.use where (src.use = 'TMP') -> tgt.use = 'temp' "usetmp";#xD; src.use where (src.use = 'MC') -> tgt.use = 'mobile' "usemobile";#xD; src.useablePeriod as useablePeriod -> tgt.period = useablePeriod; // use: for src.use as c make tgt.use = translate(c, 'http://hl7.org/fhir/ConceptMap/cm-telecom-use-v3', 'code')#xD; }#xD; #xD; group PQQuantity(source src : PQ, target tgt : Quantity) {#xD; src.unit as unit -> tgt.unit = unit;#xD; src.unit as unit -> tgt.code = unit;#xD; src.unit as unit -> tgt.system = 'http://unitsofmeasure.org';#xD; src.value as value -> tgt.value = value;#xD; }#xD; #xD; group RTOPQPQRatio(source src : RTO_PQ_PQ, target tgt : Ratio) {#xD; src.numerator as numerator -> tgt.numerator as targetNumerator then PQQuantity(numerator, targetNumerator);#xD; src.denominator as denominator -> tgt.denominator as targetDenominator then PQQuantity(denominator, targetDenominator);#xD; }#xD; #xD;
Mapping de CDA vers les FHIR Types (A partir des sources de Oliver Egger)
Agence du Numérique en Santé (ANS) - 2-10 Rue d'Oradour-sur-Glane, 75015 Paris
src.extension.empty() and src.root.contains('.')
there's no equivalent for displayable in FHIR - and it probably will never matter, but if it does, it might map to Identifier.use.
((src.use = 'WP') or (src.use = 'DIR') or (src.use = 'PUB'))
use: for src.use as c make tgt.use = translate(c, 'http://hl7.org/fhir/ConceptMap/cm-telecom-use-v3', 'code')