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 xmlns="http://hl7.org/fhir">
<id value="CdaToFhirTypes"/>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>map "http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaToFhirTypes" = "CdaToFhirTypes"
// 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/
conceptmap "addressUse" {
prefix s = "http://terminology.hl7.org/ValueSet/v3-AddressUse"
prefix t = "http://hl7.org/fhir/valueset-address-use.html"
s:H == t:home
s:HP == t:home
s:HV == t:home
s:WP == t:work
s:DIR == t:work
s:PUB == t:work
s:TMP == t:temp
s:OLD == t:old
s:BAD == t:old
}
uses "http://hl7.org/fhir/cda/StructureDefinition/ED" alias ED as source
uses "http://hl7.org/fhir/cda/StructureDefinition/II" as source
uses "http://hl7.org/fhir/StructureDefinition/Identifier" as target
uses "http://hl7.org/fhir/cda/StructureDefinition/TS" as source
uses "http://hl7.org/fhir/StructureDefinition/instant" as target
uses "http://hl7.org/fhir/cda/StructureDefinition/CS" as source
uses "http://hl7.org/fhir/StructureDefinition/code" as target
uses "http://hl7.org/fhir/cda/StructureDefinition/CE" as source
uses "http://hl7.org/fhir/StructureDefinition/CodeableConcept" as target
uses "http://hl7.org/fhir/cda/StructureDefinition/ST" as source
uses "http://hl7.org/fhir/StructureDefinition/string" as target
uses "http://hl7.org/fhir/cda/StructureDefinition/EN" as source
uses "http://hl7.org/fhir/StructureDefinition/HumanName" as target
uses "http://hl7.org/fhir/cda/StructureDefinition/AD" as source
uses "http://hl7.org/fhir/StructureDefinition/Address" as target
uses "http://hl7.org/fhir/cda/StructureDefinition/TEL" as source
uses "http://hl7.org/fhir/StructureDefinition/ContactPoint" as target
uses "http://hl7.org/fhir/cda/StructureDefinition/BL" as source
uses "http://hl7.org/fhir/StructureDefinition/boolean" as target
uses "http://hl7.org/fhir/cda/StructureDefinition/IVL_TS" as source
uses "http://hl7.org/fhir/StructureDefinition/Period" as target
group Any(source src, target tgt) {
}
group II(source src : II, target tgt : Identifier) extends Any <<types>> {
src.root as r where src.extension.exists() -> tgt.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') "root1";
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";
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";
src.extension as e -> tgt.value = e;
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.
src.displayable as displayable -> tgt.extension as ext then {
displayable -> ext.url = 'http://hl7.org/fhir/cdaStructureDefinition/extension-displayable' "url";
displayable.value as v -> ext.value = cast(v, 'string');
} "extension";
}
group INT(source src : INT, target tgt : integer) extends Any <<types>> {
src.value as v -> tgt.value = v "integer";
}
group TemplateID(source template : II, target tgt) {
template -> tgt.extension as ext then {
template -> ext.url = 'http://hl7.org/fhir/cda/StructureDefinition/templateID' "url";
template -> ext.value = create('Identifier') as value then II(template, value) "value";
} "templateId";
}
group Negation(source negation : BL, target tgt) {
negation -> tgt.modifierExtension as ext then {
negation -> ext.url = 'http://hl7.org/fhir/cda/StructureDefinition/negationIndicator' "url";
negation as neg -> ext.value = create('boolean'), ext.value = neg "value";
} "negation";
}
group TSInstant(source src : TS, target tgt : instant) extends Any <<types>> {
src.value as v -> tgt.value = cast(v, 'string');
}
group TSDateTime(source src : TS, target tgt : dateTime) extends TSInstant <<types>> {
}
group TSDate(source src : TS, target tgt : date) extends TSInstant <<types>> {
}
group IVLTSPeriod(source src : IVL_TS, target tgt : Period) extends Any <<types>> {
src.low -> tgt.start;
src.high -> tgt.end;
}
group IVLTSDateTime(source src : IVL_TS, target tgt : dateTime) extends Any <<types>> {
src.low as s then TSDateTime(s, tgt);
}
group STstring(source src : ST, target tgt : string) extends Any <<types>> {
src as v -> tgt.value = cast(v, 'string') "value";
}
group EDstring(source src : ED, target tgt : string) extends STstring <<types>> {
}
group ONstring(source src : ON, target tgt : string) extends STstring <<types>> {
}
group CSCode(source src : CS, target tgt : code) extends Any <<types>> {
src.code as c -> tgt.value = cast(c, 'string');
}
group CECode(source src : CE, target tgt : code) extends CSCode <<types>> {
}
group CDCode(source src : CD, target tgt : code) extends CSCode <<types>> {
}
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');
};
}
group CSCodeableConcept(source src : CS, target tgt : CodeableConcept) extends CECodeableConcept <<types>> {
}
group CDCodeableConcept(source src : CD, target tgt : CodeableConcept) extends CECodeableConcept <<types>> {
}
group ENHumanName(source src : EN, target tgt : HumanName) extends Any <<types>> {
src.family as v -> tgt.family = (v.dataString);
src.given as v -> tgt.given = (v.dataString);
src.prefix as v -> tgt.prefix = (v.dataString);
src.suffix as v -> tgt.suffix = (v.dataString);
// src.use as c -> tgt.use = translate(c, 'http://hl7.org/fhir/ConceptMap/cm-name-use-v3', 'code');
src.validTime -> tgt.period;
}
group ADAddress(source src : AD, target tgt : Address) extends Any <<types>> {
src.country as v -> tgt.country = (v.dataString);
src.state as v -> tgt.state = (v.dataString);
src.county as v -> tgt.district = (v.dataString);
src.city as v -> tgt.city = (v.dataString);
src.postalCode as v -> tgt.postalCode = (v.dataString);
src.streetAddressLine as v -> tgt.line = (v.dataString) "streetAddress";
src.streetName as v -> tgt.line = (v.dataString);
src.houseNumber as v -> tgt.line = (v.dataString);
src.use as c -> tgt.use = translate(c, '#addressUse', 'code') "addressUse";
src.useablePeriod -> tgt.period;
}
group TELContactPoint(source src : TEL, target tgt : ContactPoint) extends Any <<types>> {
src.value as v where (src.value.startsWith('tel:')) -> tgt.value = (v.substring(4)), tgt.system = 'phone' "valuetel";
src.value as v where (src.value.startsWith('fax:')) -> tgt.value = (v.substring(4)), tgt.system = 'fax' "valuefax";
src.value as v where (src.value.startsWith('mailto:')) -> tgt.value = (v.substring(7)), tgt.system = 'email' "valuemail";
src.value as v where (src.value.startsWith('http:')) -> tgt.value = (v.substring(5)), tgt.system = 'url' "valuehttp";
src.use where (src.use.startsWith('H')) -> tgt.use = 'home' "usehome";
src.use where ((src.use = 'WP') or (src.use = 'DIR') or (src.use = 'PUB')) -> tgt.use = 'work' "usework";
src.use where (src.use = 'BAD') -> tgt.use = 'old' "usebad";
src.use where (src.use = 'TMP') -> tgt.use = 'temp' "usetmp";
src.use where (src.use = 'MC') -> tgt.use = 'mobile' "usemobile";
src.useablePeriod -> tgt.period;
}
group PQQuantity(source src : PQ, target tgt : Quantity) extends Any <<types>> {
// src.unit as unit -> tgt.code = unit;
src.unit as unit -> tgt.unit = unit;
src.value as value -> tgt.value = value;
}
group RTOPQPQRatio(source src : RTO_PQ_PQ, target tgt : Ratio) extends Any <<types>> {
src.numerator as numerator -> tgt.numerator as targetNumerator then PQQuantity(numerator, targetNumerator);
src.denominator as denominator -> tgt.denominator as targetDenominator then PQQuantity(denominator, targetDenominator);
}
</pre>
</div>
</text>
<contained>
<ConceptMap>
<id value="addressUse"/>
<status value="draft"/>
<group>
<source value="http://terminology.hl7.org/ValueSet/v3-AddressUse"/>
<target value="http://hl7.org/fhir/valueset-address-use.html"/>
<element>
<code value="H"/>
<target>
<code value="home"/>
<equivalence value="equivalent"/>
<comment value="home address -> home"/>
</target>
</element>
<element>
<code value="HP"/>
<target>
<code value="home"/>
<equivalence value="equivalent"/>
<comment
value="primary home -> home, http://hl7.org/fhir/v3/AddressUse/cs.html"/>
</target>
</element>
<element>
<code value="HV"/>
<target>
<code value="home"/>
<equivalence value="equivalent"/>
<comment
value="vacation home -> home, http://hl7.org/fhir/v3/AddressUse/cs.html"/>
</target>
</element>
<element>
<code value="WP"/>
<target>
<code value="work"/>
<equivalence value="equivalent"/>
<comment value="work place -> work"/>
</target>
</element>
<element>
<code value="DIR"/>
<target>
<code value="work"/>
<equivalence value="equivalent"/>
<comment
value="direct -> work, http://hl7.org/fhir/v3/AddressUse/cs.html"/>
</target>
</element>
<element>
<code value="PUB"/>
<target>
<code value="work"/>
<equivalence value="equivalent"/>
<comment
value="public -> work, http://hl7.org/fhir/v3/AddressUse/cs.html"/>
</target>
</element>
<element>
<code value="TMP"/>
<target>
<code value="temp"/>
<equivalence value="equivalent"/>
<comment value="temporary address -> Temporary"/>
</target>
</element>
<element>
<code value="OLD"/>
<target>
<code value="old"/>
<equivalence value="equivalent"/>
<comment value="no longer in use -> Old / Incorrect"/>
</target>
</element>
<element>
<code value="BAD"/>
<target>
<code value="old"/>
<equivalence value="equivalent"/>
<comment value="bad address -> Old / Incorrect"/>
</target>
</element>
</group>
</ConceptMap>
</contained>
<extension url="http://fhir.ch/reference">
<valueReference>
<reference value="#addressUse"/>
</valueReference>
</extension>
<url value="http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaToFhirTypes"/>
<version value="0.3.0"/>
<name value="CdaToFhirTypes"/>
<status value="draft"/>
<date value="2022-02-11T11:14:39+01:00"/>
<publisher value="ahdis"/>
<contact>
<name value="ahdis"/>
<telecom>
<system value="url"/>
<value value="http://www.ahdis.ch/"/>
</telecom>
</contact>
<description
value="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 value="CC-BY-SA-4.0"/>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/ED"/>
<mode value="source"/>
<alias value="ED"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/II"/>
<mode value="source"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Identifier"/>
<mode value="target"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/TS"/>
<mode value="source"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/instant"/>
<mode value="target"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/CS"/>
<mode value="source"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/code"/>
<mode value="target"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/CE"/>
<mode value="source"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/CodeableConcept"/>
<mode value="target"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/ST"/>
<mode value="source"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/string"/>
<mode value="target"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/EN"/>
<mode value="source"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/HumanName"/>
<mode value="target"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/AD"/>
<mode value="source"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Address"/>
<mode value="target"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/TEL"/>
<mode value="source"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/ContactPoint"/>
<mode value="target"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/BL"/>
<mode value="source"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/boolean"/>
<mode value="target"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/IVL_TS"/>
<mode value="source"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Period"/>
<mode value="target"/>
</structure>
<group>
<name value="Any"/>
<typeMode value="none"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<mode value="target"/>
</input>
</group>
<group>
<name value="II"/>
<extends value="Any"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="II"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="Identifier"/>
<mode value="target"/>
</input>
<rule>
<name value="root1"/>
<source>
<context value="src"/>
<element value="root"/>
<variable value="r"/>
<condition value="src.extension.exists()"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="translate"/>
<parameter>
<valueId value="r"/>
</parameter>
<parameter>
<valueString value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
</parameter>
<parameter>
<valueString value="uri"/>
</parameter>
</target>
</rule>
<rule>
<name value="rootuuid"/>
<source>
<context value="src"/>
<element value="root"/>
<variable value="r"/>
<condition
value="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}')"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="urn:ietf:rfc:3986"/>
</parameter>
</target>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + r.lower()"/>
</parameter>
</target>
</rule>
<rule>
<name value="rootoid"/>
<source>
<context value="src"/>
<element value="root"/>
<variable value="r"/>
<condition
value="src.extension.empty() and src.root.contains('.')"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="urn:ietf:rfc:3986"/>
</parameter>
</target>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="append"/>
<parameter>
<valueString value="urn:oid:"/>
</parameter>
<parameter>
<valueId value="r"/>
</parameter>
</target>
</rule>
<rule>
<name value="extension"/>
<source>
<context value="src"/>
<element value="extension"/>
<variable value="e"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="e"/>
</parameter>
</target>
</rule>
<rule>
<name value="assigningAuthorityName"/>
<source>
<context value="src"/>
<element value="assigningAuthorityName"/>
<variable value="s"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="assigner"/>
<variable value="a"/>
</target>
<target>
<context value="a"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueId value="s"/>
</parameter>
</target>
</rule>
<rule>
<name value="extension"/>
<source>
<context value="src"/>
<element value="displayable"/>
<variable value="displayable"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext"/>
</target>
<rule>
<name value="url"/>
<source>
<context value="displayable"/>
</source>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://hl7.org/fhir/cdaStructureDefinition/extension-displayable"/>
</parameter>
</target>
</rule>
<rule>
<name value="value"/>
<source>
<context value="displayable"/>
<element value="value"/>
<variable value="v"/>
</source>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="cast"/>
<parameter>
<valueId value="v"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<documentation
value="there's no equivalent for displayable in FHIR - and it probably will never matter, but if it does, it might map to Identifier.use."/>
</rule>
</group>
<group>
<name value="INT"/>
<extends value="Any"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="INT"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="integer"/>
<mode value="target"/>
</input>
<rule>
<name value="integer"/>
<source>
<context value="src"/>
<element value="value"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="v"/>
</parameter>
</target>
</rule>
</group>
<group>
<name value="TemplateID"/>
<typeMode value="none"/>
<input>
<name value="template"/>
<type value="II"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<mode value="target"/>
</input>
<rule>
<name value="templateId"/>
<source>
<context value="template"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext"/>
</target>
<rule>
<name value="url"/>
<source>
<context value="template"/>
</source>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://hl7.org/fhir/cda/StructureDefinition/templateID"/>
</parameter>
</target>
</rule>
<rule>
<name value="value"/>
<source>
<context value="template"/>
</source>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="value"/>
<transform value="create"/>
<parameter>
<valueString value="Identifier"/>
</parameter>
</target>
<dependent>
<name value="II"/>
<variable value="template"/>
<variable value="value"/>
</dependent>
</rule>
</rule>
</group>
<group>
<name value="Negation"/>
<typeMode value="none"/>
<input>
<name value="negation"/>
<type value="BL"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<mode value="target"/>
</input>
<rule>
<name value="negation"/>
<source>
<context value="negation"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="modifierExtension"/>
<variable value="ext"/>
</target>
<rule>
<name value="url"/>
<source>
<context value="negation"/>
</source>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://hl7.org/fhir/cda/StructureDefinition/negationIndicator"/>
</parameter>
</target>
</rule>
<rule>
<name value="value"/>
<source>
<context value="negation"/>
<variable value="neg"/>
</source>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="create"/>
<parameter>
<valueString value="boolean"/>
</parameter>
</target>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="neg"/>
</parameter>
</target>
</rule>
</rule>
</group>
<group>
<name value="TSInstant"/>
<extends value="Any"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="TS"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="instant"/>
<mode value="target"/>
</input>
<rule>
<name value="value"/>
<source>
<context value="src"/>
<element value="value"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="cast"/>
<parameter>
<valueId value="v"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</group>
<group>
<name value="TSDateTime"/>
<extends value="TSInstant"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="TS"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="dateTime"/>
<mode value="target"/>
</input>
</group>
<group>
<name value="TSDate"/>
<extends value="TSInstant"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="TS"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="date"/>
<mode value="target"/>
</input>
</group>
<group>
<name value="IVLTSPeriod"/>
<extends value="Any"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="IVL_TS"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="Period"/>
<mode value="target"/>
</input>
<rule>
<name value="low"/>
<source>
<context value="src"/>
<element value="low"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="start"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="high"/>
<source>
<context value="src"/>
<element value="high"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="end"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</group>
<group>
<name value="IVLTSDateTime"/>
<extends value="Any"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="IVL_TS"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="dateTime"/>
<mode value="target"/>
</input>
<rule>
<name value="low"/>
<source>
<context value="src"/>
<element value="low"/>
<variable value="s"/>
</source>
<dependent>
<name value="TSDateTime"/>
<variable value="s"/>
<variable value="tgt"/>
</dependent>
</rule>
</group>
<group>
<name value="STstring"/>
<extends value="Any"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="ST"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="string"/>
<mode value="target"/>
</input>
<rule>
<name value="value"/>
<source>
<context value="src"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="cast"/>
<parameter>
<valueId value="v"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</group>
<group>
<name value="EDstring"/>
<extends value="STstring"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="ED"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="string"/>
<mode value="target"/>
</input>
</group>
<group>
<name value="ONstring"/>
<extends value="STstring"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="ON"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="string"/>
<mode value="target"/>
</input>
</group>
<group>
<name value="CSCode"/>
<extends value="Any"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="CS"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="code"/>
<mode value="target"/>
</input>
<rule>
<name value="code"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="c"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="cast"/>
<parameter>
<valueId value="c"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</group>
<group>
<name value="CECode"/>
<extends value="CSCode"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="CE"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="code"/>
<mode value="target"/>
</input>
</group>
<group>
<name value="CDCode"/>
<extends value="CSCode"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="CD"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="code"/>
<mode value="target"/>
</input>
</group>
<group>
<name value="CECodeableConcept"/>
<extends value="Any"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="CE"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="CodeableConcept"/>
<mode value="target"/>
</input>
<rule>
<name value="originalText"/>
<source>
<context value="src"/>
<element value="originalText"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="text"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="code"/>
<source>
<context value="src"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="src"/>
<element value="codeSystem"/>
<variable value="system"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="translate"/>
<parameter>
<valueId value="system"/>
</parameter>
<parameter>
<valueString value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
</parameter>
<parameter>
<valueString value="uri"/>
</parameter>
</target>
</rule>
<rule>
<name value="displayName"/>
<source>
<context value="src"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="translation"/>
<source>
<context value="src"/>
<element value="translation"/>
<variable value="translation"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="translation"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="translation"/>
<element value="codeSystem"/>
<variable value="system"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="translate"/>
<parameter>
<valueId value="system"/>
</parameter>
<parameter>
<valueString value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
</parameter>
<parameter>
<valueString value="uri"/>
</parameter>
</target>
</rule>
<rule>
<name value="displayName"/>
<source>
<context value="translation"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
</group>
<group>
<name value="CSCodeableConcept"/>
<extends value="CECodeableConcept"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="CS"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="CodeableConcept"/>
<mode value="target"/>
</input>
</group>
<group>
<name value="CDCodeableConcept"/>
<extends value="CECodeableConcept"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="CD"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="CodeableConcept"/>
<mode value="target"/>
</input>
</group>
<group>
<name value="ENHumanName"/>
<extends value="Any"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="EN"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="HumanName"/>
<mode value="target"/>
</input>
<rule>
<name value="family"/>
<source>
<context value="src"/>
<element value="family"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="family"/>
<transform value="evaluate"/>
<parameter>
<valueString value="v.dataString"/>
</parameter>
</target>
</rule>
<rule>
<name value="given"/>
<source>
<context value="src"/>
<element value="given"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="given"/>
<transform value="evaluate"/>
<parameter>
<valueString value="v.dataString"/>
</parameter>
</target>
</rule>
<rule>
<name value="prefix"/>
<source>
<context value="src"/>
<element value="prefix"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="prefix"/>
<transform value="evaluate"/>
<parameter>
<valueString value="v.dataString"/>
</parameter>
</target>
</rule>
<rule>
<name value="suffix"/>
<source>
<context value="src"/>
<element value="suffix"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="suffix"/>
<transform value="evaluate"/>
<parameter>
<valueString value="v.dataString"/>
</parameter>
</target>
</rule>
<rule>
<name value="validTime"/>
<source>
<context value="src"/>
<element value="validTime"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="period"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<documentation
value="src.use as c -> tgt.use = translate(c, 'http://hl7.org/fhir/ConceptMap/cm-name-use-v3', 'code');"/>
</rule>
</group>
<group>
<name value="ADAddress"/>
<extends value="Any"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="AD"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="Address"/>
<mode value="target"/>
</input>
<rule>
<name value="country"/>
<source>
<context value="src"/>
<element value="country"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="country"/>
<transform value="evaluate"/>
<parameter>
<valueString value="v.dataString"/>
</parameter>
</target>
</rule>
<rule>
<name value="state"/>
<source>
<context value="src"/>
<element value="state"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="state"/>
<transform value="evaluate"/>
<parameter>
<valueString value="v.dataString"/>
</parameter>
</target>
</rule>
<rule>
<name value="county"/>
<source>
<context value="src"/>
<element value="county"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="district"/>
<transform value="evaluate"/>
<parameter>
<valueString value="v.dataString"/>
</parameter>
</target>
</rule>
<rule>
<name value="city"/>
<source>
<context value="src"/>
<element value="city"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="city"/>
<transform value="evaluate"/>
<parameter>
<valueString value="v.dataString"/>
</parameter>
</target>
</rule>
<rule>
<name value="postalCode"/>
<source>
<context value="src"/>
<element value="postalCode"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="postalCode"/>
<transform value="evaluate"/>
<parameter>
<valueString value="v.dataString"/>
</parameter>
</target>
</rule>
<rule>
<name value="streetAddress"/>
<source>
<context value="src"/>
<element value="streetAddressLine"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="line"/>
<transform value="evaluate"/>
<parameter>
<valueString value="v.dataString"/>
</parameter>
</target>
</rule>
<rule>
<name value="streetName"/>
<source>
<context value="src"/>
<element value="streetName"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="line"/>
<transform value="evaluate"/>
<parameter>
<valueString value="v.dataString"/>
</parameter>
</target>
</rule>
<rule>
<name value="houseNumber"/>
<source>
<context value="src"/>
<element value="houseNumber"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="line"/>
<transform value="evaluate"/>
<parameter>
<valueString value="v.dataString"/>
</parameter>
</target>
</rule>
<rule>
<name value="addressUse"/>
<source>
<context value="src"/>
<element value="use"/>
<variable value="c"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="use"/>
<transform value="translate"/>
<parameter>
<valueId value="c"/>
</parameter>
<parameter>
<valueString value="#addressUse"/>
</parameter>
<parameter>
<valueString value="code"/>
</parameter>
</target>
</rule>
<rule>
<name value="useablePeriod"/>
<source>
<context value="src"/>
<element value="useablePeriod"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="period"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</group>
<group>
<name value="TELContactPoint"/>
<extends value="Any"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="TEL"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="ContactPoint"/>
<mode value="target"/>
</input>
<rule>
<name value="valuetel"/>
<source>
<context value="src"/>
<element value="value"/>
<variable value="v"/>
<condition value="(src.value.startsWith('tel:'))"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="v.substring(4)"/>
</parameter>
</target>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="phone"/>
</parameter>
</target>
</rule>
<rule>
<name value="valuefax"/>
<source>
<context value="src"/>
<element value="value"/>
<variable value="v"/>
<condition value="(src.value.startsWith('fax:'))"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="v.substring(4)"/>
</parameter>
</target>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="fax"/>
</parameter>
</target>
</rule>
<rule>
<name value="valuemail"/>
<source>
<context value="src"/>
<element value="value"/>
<variable value="v"/>
<condition value="(src.value.startsWith('mailto:'))"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="v.substring(7)"/>
</parameter>
</target>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="email"/>
</parameter>
</target>
</rule>
<rule>
<name value="valuehttp"/>
<source>
<context value="src"/>
<element value="value"/>
<variable value="v"/>
<condition value="(src.value.startsWith('http:'))"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="v.substring(5)"/>
</parameter>
</target>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="url"/>
</parameter>
</target>
</rule>
<rule>
<name value="usehome"/>
<source>
<context value="src"/>
<element value="use"/>
<condition value="(src.use.startsWith('H'))"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="use"/>
<transform value="copy"/>
<parameter>
<valueString value="home"/>
</parameter>
</target>
</rule>
<rule>
<name value="usework"/>
<source>
<context value="src"/>
<element value="use"/>
<condition
value="((src.use = 'WP') or (src.use = 'DIR') or (src.use = 'PUB'))"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="use"/>
<transform value="copy"/>
<parameter>
<valueString value="work"/>
</parameter>
</target>
</rule>
<rule>
<name value="usebad"/>
<source>
<context value="src"/>
<element value="use"/>
<condition value="(src.use = 'BAD')"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="use"/>
<transform value="copy"/>
<parameter>
<valueString value="old"/>
</parameter>
</target>
</rule>
<rule>
<name value="usetmp"/>
<source>
<context value="src"/>
<element value="use"/>
<condition value="(src.use = 'TMP')"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="use"/>
<transform value="copy"/>
<parameter>
<valueString value="temp"/>
</parameter>
</target>
</rule>
<rule>
<name value="usemobile"/>
<source>
<context value="src"/>
<element value="use"/>
<condition value="(src.use = 'MC')"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="use"/>
<transform value="copy"/>
<parameter>
<valueString value="mobile"/>
</parameter>
</target>
</rule>
<rule>
<name value="useablePeriod"/>
<source>
<context value="src"/>
<element value="useablePeriod"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="period"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</group>
<group>
<name value="PQQuantity"/>
<extends value="Any"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="PQ"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="Quantity"/>
<mode value="target"/>
</input>
<rule>
<name value="unit"/>
<source>
<context value="src"/>
<element value="unit"/>
<variable value="unit"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="copy"/>
<parameter>
<valueId value="unit"/>
</parameter>
</target>
<documentation value="src.unit as unit -> tgt.code = unit;"/>
</rule>
<rule>
<name value="value"/>
<source>
<context value="src"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
</rule>
</group>
<group>
<name value="RTOPQPQRatio"/>
<extends value="Any"/>
<typeMode value="types"/>
<input>
<name value="src"/>
<type value="RTO_PQ_PQ"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="Ratio"/>
<mode value="target"/>
</input>
<rule>
<name value="numerator"/>
<source>
<context value="src"/>
<element value="numerator"/>
<variable value="numerator"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="numerator"/>
<variable value="targetNumerator"/>
</target>
<dependent>
<name value="PQQuantity"/>
<variable value="numerator"/>
<variable value="targetNumerator"/>
</dependent>
</rule>
<rule>
<name value="denominator"/>
<source>
<context value="src"/>
<element value="denominator"/>
<variable value="denominator"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="denominator"/>
<variable value="targetDenominator"/>
</target>
<dependent>
<name value="PQQuantity"/>
<variable value="denominator"/>
<variable value="targetDenominator"/>
</dependent>
</rule>
</group>
</StructureMap>