CDA-FHIR-Maps (R4)
0.3.0 - DSTU 1

This page is part of the CDA-FHIR-Maps (R4) (v0.3.0: DSTU 1) based on FHIR R4. . For a full list of available versions, see the Directory of published versions

StructureMap: FHIR to CDA types

Generated Narrative

Resource "FhirToCdaTypes" Version "2" Updated "2021-11-03T11:16:56.175+01:00"

url: http://fhir.ch/ig/cda-fhir-maps/StructureMap/FhirToCdaTypes

version: 0.3.0

name: FhirToCdaTypes

status: draft

date: 2022-02-11T11:14:39+01:00

publisher: ahdis

contact: ahdis: http://www.ahdis.ch/

description: Adapted from https://github.com/HL7/ccda-to-fhir/tree/master/mappings CDA: http://build.fhir.org/ig/ahdis/cda-core-2.0/branches/master/index.html FHIR: http://hl7.org/fhir/r4/

copyright: CC-BY-SA-4.0

structure

url: Identifier

mode: source

structure

url: II: InstanceIdentifier (V3 Data Type)

mode: target

group

name: Any

typeMode: none

input

name: src

mode: source

input

name: tgt

mode: target

rule

name: extension

Sources

-ContextElementVariableCondition
*srcextensionextension$this.url = 'http://hl7.org/fhir/StructureDefinition/iso21090-nullFlavor'

Targets

-ContextContextTypeElementVariable
*tgtvariablenullFlavornullFlavor

rule

name: nullFlavor

group

name: IdentifierII

extends: Any

typeMode: types

input

name: src

type: Identifier

mode: source

input

name: tgt

type: II

mode: target

rule

name: idAsUuid

Sources

-ContextElementVariableCondition
*srcvaluevaluesrc.system.empty() and src.value.startsWith('urn:uuid:')

target

context: tgt

contextType: variable

element: root

transform: evaluate

Parameters

-Value[x]
*value.substring(9).upper()

rule

name: idAsUuid

Sources

-ContextElementVariableCondition
*srcvaluevaluesrc.system = 'urn:ietf:rfc:3986'

target

context: tgt

contextType: variable

element: root

transform: evaluate

Parameters

-Value[x]
*value.substring(9).upper()

rule

name: system

Sources

-ContextElementVariableCondition
*srcvaluevaluesrc.system.startsWith('urn:oid:')

rule

name: oidident

group

name: IntegerINT

extends: Any

typeMode: types

input

name: src

type: integer

mode: source

input

name: tgt

type: INT

mode: target

rule

name: integer

Sources

-ContextElementVariable
*srcvaluev

target

context: tgt

contextType: variable

element: value

transform: copy

Parameters

-Value[x]
*v

group

name: InstantTS

extends: Any

typeMode: types

documentation: group Identifier(source src : Identifier, target tgt : II) extends Any <<types>> { src.system as system then { src.value as value then { value.value as v where system.value = 'urn:ietf:rfc:3986' -> tgt.root = cast(v, 'string') "noExtension"; system.value as v where system.value != 'urn:ietf:rfc:3986' -> tgt.root = v then { value.value as val -> tgt.extension = cast(val, 'string') "extension"; } "withExtension"; } "rootValue"; } "root"; src.value as value -> tgt.root = '123' "test"; src -> tgt.root = '123' "test"; src.assigner as a then { a.display as display then { display.value as val -> tgt.assigningAuthorityName = cast(val, 'string'); } "display"; } "assigner"; src.extension as ext where ext.url = 'http://hl7.org/fhir/cdaStructureDefinition/extension-displayable' -> tgt.displayable as displayable then { ext.value as v -> displayable.value = cast(v, 'string'); } "displayable"; }

input

name: src

type: instant

mode: source

input

name: tgt

type: TS

mode: target

rule

name: copy

Sources

-ContextElementVariable
*srcvaluev

target

context: tgt

contextType: variable

element: value

transform: copy

Parameters

-Value[x]
*v

group

name: DateTimeTS

extends: InstantTS

typeMode: types

input

name: src

type: dateTime

mode: source

input

name: tgt

type: TS

mode: target

group

name: DateTS

extends: InstantTS

typeMode: types

input

name: src

type: date

mode: source

input

name: tgt

type: TS

mode: target

group

name: CodeCS

extends: Any

typeMode: types

input

name: src

type: code

mode: source

input

name: tgt

type: CS

mode: target

rule

name: code

Sources

-ContextElementVariable
*srccodec

target

context: tgt

contextType: variable

element: value

transform: cast

parameter

value: c

parameter

value: string

group

name: CodeCE

extends: CodeCS

typeMode: types

input

name: src

type: code

mode: source

input

name: tgt

type: CE

mode: target

group

name: CodeCD

extends: CodeCS

typeMode: types

input

name: src

type: code

mode: source

input

name: tgt

type: CD

mode: target

group

name: CodingCE

extends: Any

typeMode: types

input

name: src

type: Coding

mode: source

input

name: tgt

type: CE

mode: target

rule

name: code

Sources

-ContextElementVariable
*srccodecode

target

context: tgt

contextType: variable

element: code

transform: copy

Parameters

-Value[x]
*code

rule

name: system

Sources

-ContextElementVariableCondition
*srcsystemsystem$this.startsWith('http:')

target

context: tgt

contextType: variable

element: codeSystem

transform: translate

parameter

value: system

parameter

value: #uri2oid

parameter

value: code

rule

name: system

Sources

-ContextElementVariableCondition
*srcsystemsystem$this.startsWith('urn:oid:')

rule

name: oidident

rule

name: systemName1

Sources

-ContextElementVariableCondition
*srcsystemsystem$this.startsWith('http:')

target

context: tgt

contextType: variable

element: codeSystemName

transform: translate

parameter

value: system

parameter

value: #uri2system

parameter

value: code

rule

name: systemName2

Sources

-ContextElementVariableCondition
*srcsystemsystem$this.startsWith('urn:oid:')

target

context: tgt

contextType: variable

element: codeSystemName

transform: translate

parameter

value: system

parameter

value: #oid2system

parameter

value: code

rule

name: display

Sources

-ContextElementVariable
*srcdisplaydisplay

target

context: tgt

contextType: variable

element: displayName

transform: copy

Parameters

-Value[x]
*display

group

name: CodeableConceptCE

extends: Any

typeMode: types

input

name: src

type: CodeableConcept

mode: source

input

name: tgt

type: CE

mode: target

rule

name: text

Sources

-ContextElementVariable
*srctexttext

target

context: tgt

contextType: variable

element: orginialText

variable: originalText

target

context: originalText

contextType: variable

element: data

transform: copy

Parameters

-Value[x]
*text

rule

name: first

Sources

-ContextElementListModeVariable
*srccodingfirstcoding

Dependents

-NameVariable
*CodingCEcoding, tgt

rule

name: translation

Sources

-ContextElementListModeVariable
*srccodingnot_firstcoding

Targets

-ContextContextTypeElementVariable
*tgtvariabletranslationtranslation

Dependents

-NameVariable
*CodingCEcoding, translation

group

name: AddressAD

extends: Any

typeMode: types

documentation: group CECodeableConcept(source src : CE, target tgt : CodeableConcept) extends Any <<types>> { src.originalText -> tgt.text; src -> tgt.coding as coding then { src.code as code -> coding.code = cast(code, 'string'); src.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri'); src.displayName as display -> coding.display = cast(display, 'string'); } "code"; src.translation as translation -> tgt.coding as coding then { translation.code as code -> coding.code = cast(code, 'string'); translation.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri'); translation.displayName as display -> coding.display = cast(display, 'string'); } "translation"; } group CSCodeableConcept(source src : CS, target tgt : CodeableConcept) extends CECodeableConcept <<types>> { } group CDCodeableConcept(source src : CD, target tgt : CodeableConcept) extends CECodeableConcept <<types>> { }

input

name: src

type: Address

mode: source

input

name: tgt

type: AD

mode: target

rule

name: streetAddress

Sources

-ContextElementVariable
*srclinev

target

context: tgt

contextType: variable

element: streetAddressLine

variable: line

target

context: line

contextType: variable

element: data

transform: copy

Parameters

-Value[x]
*v

rule

name: postalCode

Sources

-ContextElementVariable
*srcpostalCodev

target

context: tgt

contextType: variable

element: postalCode

variable: postalCode

target

context: postalCode

contextType: variable

element: data

transform: copy

Parameters

-Value[x]
*v

rule

name: nullFlavor

Sources

-ContextCondition
*src$this.postalCode.exists() = false

target

context: tgt

contextType: variable

element: postalCode

variable: postalCode

target

context: postalCode

contextType: variable

element: nullFlavor

transform: copy

Parameters

-Value[x]
*NI

rule

name: city

Sources

-ContextElementVariable
*srccityv

target

context: tgt

contextType: variable

element: city

variable: city

target

context: city

contextType: variable

element: data

transform: copy

Parameters

-Value[x]
*v

rule

name: nullFlavor

Sources

-ContextCondition
*src$this.city.exists() = false

target

context: tgt

contextType: variable

element: city

variable: city

target

context: city

contextType: variable

element: nullFlavor

transform: copy

Parameters

-Value[x]
*NI

rule

name: state

Sources

-ContextElementVariable
*srcstatev

target

context: tgt

contextType: variable

element: state

variable: state

target

context: state

contextType: variable

element: data

transform: copy

Parameters

-Value[x]
*v

rule

name: district

Sources

-ContextElementVariable
*srcdistrictv

target

context: tgt

contextType: variable

element: county

variable: county

target

context: county

contextType: variable

element: data

transform: copy

Parameters

-Value[x]
*v

rule

name: country

Sources

-ContextElementVariable
*srccountryv

target

context: tgt

contextType: variable

element: country

variable: country

target

context: country

contextType: variable

element: data

transform: copy

Parameters

-Value[x]
*v

rule

name: nullFlavor

Sources

-ContextCondition
*src$this.country.exists() = false

target

context: tgt

contextType: variable

element: country

variable: country

target

context: country

contextType: variable

element: nullFlavor

transform: copy

Parameters

-Value[x]
*NI

rule

name: addressUse

Sources

-ContextElementVariable
*srcusec

target

context: tgt

contextType: variable

element: use

transform: translate

parameter

value: c

parameter

value: #addressUse

parameter

value: code

group

name: ContactPointTEL

extends: Any

typeMode: types

input

name: src

type: ContactPoint

mode: source

input

name: tgt

type: TEL

mode: target

rule

name: value

Sources

-ContextElementVariable
*srcvaluevalue

target

context: tgt

contextType: variable

element: value

transform: evaluate

Parameters

-Value[x]
*iif(%src.system = 'phone', 'tel:', '') + iif(%src.system = 'fax', 'fax:', '') + iif(%src.system = 'email', 'mailto:', '') + iif(%src.system = 'url', 'http:', '') + value

rule

name: use

Sources

-ContextElementVariableCondition
*srcuseuse$this = 'home'

target

context: tgt

contextType: variable

element: use

transform: copy

Parameters

-Value[x]
*HP

rule

name: use

Sources

-ContextElementVariableCondition
*srcuseuse$this = 'work'

target

context: tgt

contextType: variable

element: use

transform: copy

Parameters

-Value[x]
*WP

rule

name: use

Sources

-ContextElementVariableCondition
*srcuseuse$this = 'old'

target

context: tgt

contextType: variable

element: use

transform: copy

Parameters

-Value[x]
*BAD

rule

name: use

Sources

-ContextElementVariableCondition
*srcuseuse$this = 'temp'

target

context: tgt

contextType: variable

element: use

transform: copy

Parameters

-Value[x]
*TMP

rule

name: use

Sources

-ContextElementVariableCondition
*srcuseuse$this = 'mobile'

target

context: tgt

contextType: variable

element: use

transform: copy

Parameters

-Value[x]
*MC

group

name: HumanNameEN

extends: Any

typeMode: types

input

name: src

type: HumanName

mode: source

input

name: tgt

type: EN

mode: target

rule

name: family

Sources

-ContextElementVariable
*srcfamilyv

target

context: tgt

contextType: variable

element: family

variable: family

target

context: family

contextType: variable

element: data

transform: copy

Parameters

-Value[x]
*v

rule

name: given

Sources

-ContextElementVariable
*srcgivenv

target

context: tgt

contextType: variable

element: given

variable: given

target

context: given

contextType: variable

element: data

transform: copy

Parameters

-Value[x]
*v

rule

name: prefix

Sources

-ContextElementVariable
*srcprefixv

target

context: tgt

contextType: variable

element: prefix

variable: prefix

target

context: prefix

contextType: variable

element: data

transform: copy

Parameters

-Value[x]
*v

rule

name: suffix

Sources

-ContextElementVariable
*srcsuffixv

target

context: tgt

contextType: variable

element: suffix

variable: suffix

target

context: suffix

contextType: variable

element: data

transform: copy

Parameters

-Value[x]
*v

group

name: QuantityPQ

extends: Any

typeMode: types

input

name: src

type: Quantity

mode: source

input

name: tgt

type: PQ

mode: target

rule

name: code

Sources

-ContextElementVariable
*srccodecode

target

context: tgt

contextType: variable

element: unit

transform: copy

Parameters

-Value[x]
*code

rule

name: value

Sources

-ContextElementVariable
*srcvaluevalue

target

context: tgt

contextType: variable

element: value

transform: copy

Parameters

-Value[x]
*value

group

name: RatioRTOPQPQ

extends: Any

typeMode: types

input

name: src

type: Ratio

mode: source

input

name: tgt

type: RTO_PQ_PQ

mode: target

rule

name: numerator

Sources

-ContextElementVariable
*srcnumeratornumerator

Targets

-ContextContextTypeElementVariable
*tgtvariablenumeratortargetNumerator

Dependents

-NameVariable
*QuantityPQnumerator, targetNumerator

rule

name: denominator

Sources

-ContextElementVariable
*srcdenominatordenominator

Targets

-ContextContextTypeElementVariable
*tgtvariabledenominatortargetDenominator

Dependents

-NameVariable
*QuantityPQdenominator, targetDenominator