FHIR Cross-Version Mapping Pack, published by HL7 International / FHIR Infrastructure. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/fhir-cross-version/ and changes regularly. See the Directory of published versions
Page standards status: Draft | Maturity Level: 1 |
<StructureMap xmlns="http://hl7.org/fhir">
<id value="Questionnaire2to3"/>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml"><pre class="fml">
<span style="color: #cc00cc">/// <b>url</b> = </span><span style="color: blue">'http://hl7.org/fhir/StructureMap/Questionnaire2to3'</span>
<span style="color: #cc00cc">/// <b>name</b> = </span><span style="color: blue">'Questionnaire2to3'</span>
<span style="color: #cc00cc">/// <b>title</b> = </span><span style="color: blue">'Questionnaire Transforms: R2 to R3'</span>
<span style="color: #cc00cc">/// <b>status</b> = </span><span style="color: blue">'active'</span>
<b>uses</b><span style="color: navy"> "</span>http://hl7.org/fhir/1.0/Questionnaire<span style="color: navy">" </span><b>alias </b>QuestionnaireR2 <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> "</span>http://hl7.org/fhir/3.0/Questionnaire<span style="color: navy">" </span><b>alias </b>Questionnaire <b>as </b><b>target</b>
<b>imports</b><span style="color: navy"> "</span>http://hl7.org/fhir/StructureMap/*2to3<span style="color: navy">"
</span>
<b>group </b>Questionnaire<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>QuestionnaireR2, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>Questionnaire<span style="color: navy">)</span><b> extends </b>DomainResource<b> <<type+>></b><span style="color: navy"> {
</span> src.identifier<span style="color: navy"><b> -> </b></span>tgt.identifier <i>"Questionnaire-identifier"</i><span style="color: navy">;</span>
src.version<span style="color: navy"><b> -> </b></span>tgt.version <i>"Questionnaire-version"</i><span style="color: navy">;</span>
src.status<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span>tgt.status = <b>translate</b><span style="color: navy">(</span><span style="color: maroon">v</span><span style="color: navy">, </span><span style="color: blue">'http://hl7.org/fhir/ConceptMap/Questionnaire.status-R2toR3'</span><span style="color: navy">, </span><span style="color: blue">'code'</span><span style="color: navy">)</span> <i>"Questionnaire-status"</i><span style="color: navy">;</span>
src.date<span style="color: navy"><b> -> </b></span>tgt.date <i>"Questionnaire-date"</i><span style="color: navy">;</span>
src.publisher<span style="color: navy"><b> -> </b></span>tgt.publisher <i>"Questionnaire-publisher"</i><span style="color: navy">;</span>
src.telecom<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span> tgt.contact<b> as </b><span style="color: maroon">d</span><span style="color: navy">, </span> d.telecom<b> as </b><span style="color: maroon">v</span> <i>"Questionnaire-telecom"</i><span style="color: navy">;</span>
src.subjectType<span style="color: navy"><b> -> </b></span>tgt.subjectType <i>"Questionnaire-subjectType"</i><span style="color: navy">;</span>
src.group<b> as </b><span style="color: maroon">vs0</span><span style="color: navy"><b> -> </b></span>tgt.item<b> as </b><span style="color: maroon">vt0</span><b> then </b>qstGroup<span style="color: navy">(</span><span style="color: maroon">vs0</span><span style="color: navy">, </span><span style="color: maroon">vt0</span><span style="color: navy">)</span> <i>"Questionnaire-group"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>qstGroup<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span>, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy">)</span><b> extends </b>BackboneElement<span style="color: navy"> {
</span> src<span style="color: navy"><b> -> </b></span>tgt.type = <span style="color: blue">'group'</span> <i>"group-type"</i><span style="color: navy">;</span>
src.linkId<span style="color: navy"><b> -> </b></span>tgt.linkId <i>"group-linkId"</i><span style="color: navy">;</span>
src.title<span style="color: navy"><b> -> </b></span>tgt.text <i>"group-title"</i><span style="color: navy">;</span>
src.concept<span style="color: navy"><b> -> </b></span>tgt.code <i>"group-concept"</i><span style="color: navy">;</span>
src.text<b> as </b><span style="color: maroon">t</span><b> where </b>src.title.exists() and src.linkId.exists()<span style="color: navy"><b> -> </b></span> tgt.item<b> as </b><span style="color: maroon">i</span><span style="color: navy">, </span> i.linkId = <span style="color: navy">(</span>src.linkId + '-' + 'display'<span style="color: navy">)</span><span style="color: navy">, </span> i.text = <span style="color: maroon">t</span> <i>"group-text"</i><span style="color: navy">;</span>
src.text<b> where </b>src.title.empty()<span style="color: navy"><b> -> </b></span>tgt.text <i>"group-text"</i><span style="color: navy">;</span>
src.required<span style="color: navy"><b> -> </b></span>tgt.required <i>"group-required"</i><span style="color: navy">;</span>
src.repeats<span style="color: navy"><b> -> </b></span>tgt.repeats <i>"group-repeats"</i><span style="color: navy">;</span>
src.group<b> as </b><span style="color: maroon">vs0</span><span style="color: navy"><b> -> </b></span>tgt.item<b> as </b><span style="color: maroon">vt0</span><b> then </b>qstGroup<span style="color: navy">(</span><span style="color: maroon">vs0</span><span style="color: navy">, </span><span style="color: maroon">vt0</span><span style="color: navy">)</span> <i>"group-group"</i><span style="color: navy">;</span>
src.question<b> as </b><span style="color: maroon">vs0</span><span style="color: navy"><b> -> </b></span>tgt.item<b> as </b><span style="color: maroon">vt0</span><b> then </b>qstQuestion<span style="color: navy">(</span><span style="color: maroon">vs0</span><span style="color: navy">, </span><span style="color: maroon">vt0</span><span style="color: navy">)</span> <i>"group-question"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>qstQuestion<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span>, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy">)</span><b> extends </b>BackboneElement<span style="color: navy"> {
</span> src.type<span style="color: navy"><b> -> </b></span>tgt.type <i>"question-type"</i><span style="color: navy">;</span>
src.linkId<span style="color: navy"><b> -> </b></span>tgt.linkId <i>"question-linkId"</i><span style="color: navy">;</span>
src.concept<span style="color: navy"><b> -> </b></span>tgt.code <i>"question-concept"</i><span style="color: navy">;</span>
src.text<span style="color: navy"><b> -> </b></span>tgt.text <i>"question-text"</i><span style="color: navy">;</span>
src.required<span style="color: navy"><b> -> </b></span>tgt.required <i>"question-required"</i><span style="color: navy">;</span>
src.repeats<span style="color: navy"><b> -> </b></span>tgt.repeats <i>"question-repeats"</i><span style="color: navy">;</span>
src.options<span style="color: navy"><b> -> </b></span>tgt.options <i>"question-options"</i><span style="color: navy">;</span>
src.option<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span> tgt.option<b> as </b><span style="color: maroon">o</span><span style="color: navy">, </span> o.value<b> as </b><span style="color: maroon">v</span> <i>"question-option"</i><span style="color: navy">;</span>
src.group<b> as </b><span style="color: maroon">vs0</span><span style="color: navy"><b> -> </b></span>tgt.item<b> as </b><span style="color: maroon">vt0</span><b> then </b>qstGroup<span style="color: navy">(</span><span style="color: maroon">vs0</span><span style="color: navy">, </span><span style="color: maroon">vt0</span><span style="color: navy">)</span> <i>"question-group"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span></pre></div>
</text>
<extension
url="http://hl7.org/fhir/StructureDefinition/structuredefinition-wg">
<valueCode value="fhir"/>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm">
<valueInteger value="1">
<extension
url="http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom">
<valueCanonical
value="http://hl7.org/fhir/extensions/ImplementationGuide/hl7.fhir.uv.xver"/>
</extension>
</valueInteger>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
<valueCode value="draft">
<extension
url="http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom">
<valueCanonical
value="http://hl7.org/fhir/extensions/ImplementationGuide/hl7.fhir.uv.xver"/>
</extension>
</valueCode>
</extension>
<url value="http://hl7.org/fhir/StructureMap/Questionnaire2to3"/>
<version value="0.1.0"/>
<name value="Questionnaire2to3"/>
<title value="Questionnaire Transforms: R2 to R3"/>
<status value="active"/>
<date value="2024-02-22T03:16:50+00:00"/>
<publisher value="HL7 International / FHIR Infrastructure"/>
<contact>
<telecom>
<system value="url"/>
<value value="http://www.hl7.org/Special/committees/fiwg"/>
</telecom>
</contact>
<description value="QuestionnaireTransformsR2toR3"/>
<jurisdiction>
<coding>
<system value="http://unstats.un.org/unsd/methods/m49/m49.htm"/>
<code value="001"/>
</coding>
</jurisdiction>
<structure>
<url value="http://hl7.org/fhir/1.0/Questionnaire"/>
<mode value="source"/>
<alias value="QuestionnaireR2"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/3.0/Questionnaire"/>
<mode value="target"/>
<alias value="Questionnaire"/>
</structure>
<import value="http://hl7.org/fhir/StructureMap/*2to3"/>
<group>
<name value="Questionnaire"/>
<extends value="DomainResource"/>
<typeMode value="type-and-types"/>
<input>
<name value="src"/>
<type value="QuestionnaireR2"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="Questionnaire"/>
<mode value="target"/>
</input>
<rule>
<name value="Questionnaire-identifier"/>
<source>
<context value="src"/>
<element value="identifier"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="identifier"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="Questionnaire-version"/>
<source>
<context value="src"/>
<element value="version"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="version"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="Questionnaire-status"/>
<source>
<context value="src"/>
<element value="status"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<element value="status"/>
<transform value="translate"/>
<parameter>
<valueId value="v"/>
</parameter>
<parameter>
<valueString
value="http://hl7.org/fhir/ConceptMap/Questionnaire.status-R2toR3"/>
</parameter>
<parameter>
<valueString value="code"/>
</parameter>
</target>
</rule>
<rule>
<name value="Questionnaire-date"/>
<source>
<context value="src"/>
<element value="date"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="date"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="Questionnaire-publisher"/>
<source>
<context value="src"/>
<element value="publisher"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="publisher"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="Questionnaire-telecom"/>
<source>
<context value="src"/>
<element value="telecom"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<element value="contact"/>
<variable value="d"/>
</target>
<target>
<context value="d"/>
<element value="telecom"/>
<variable value="v"/>
</target>
</rule>
<rule>
<name value="Questionnaire-subjectType"/>
<source>
<context value="src"/>
<element value="subjectType"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="subjectType"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="Questionnaire-group"/>
<source>
<context value="src"/>
<element value="group"/>
<variable value="vs0"/>
</source>
<target>
<context value="tgt"/>
<element value="item"/>
<variable value="vt0"/>
</target>
<dependent>
<name value="qstGroup"/>
<parameter>
<valueId value="vs0"/>
</parameter>
<parameter>
<valueId value="vt0"/>
</parameter>
</dependent>
</rule>
</group>
<group>
<name value="qstGroup"/>
<extends value="BackboneElement"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<mode value="target"/>
</input>
<rule>
<name value="group-type"/>
<source>
<context value="src"/>
</source>
<target>
<context value="tgt"/>
<element value="type"/>
<transform value="copy"/>
<parameter>
<valueString value="group"/>
</parameter>
</target>
</rule>
<rule>
<name value="group-linkId"/>
<source>
<context value="src"/>
<element value="linkId"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="linkId"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="group-title"/>
<source>
<context value="src"/>
<element value="title"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="text"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="group-concept"/>
<source>
<context value="src"/>
<element value="concept"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="group-text"/>
<source>
<context value="src"/>
<element value="text"/>
<variable value="t"/>
<condition value="src.title.exists() and src.linkId.exists()"/>
</source>
<target>
<context value="tgt"/>
<element value="item"/>
<variable value="i"/>
</target>
<target>
<context value="i"/>
<element value="linkId"/>
<transform value="evaluate"/>
<parameter>
<valueString value="src.linkId + '-' + 'display'"/>
</parameter>
</target>
<target>
<context value="i"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="t"/>
</parameter>
</target>
</rule>
<rule>
<name value="group-text"/>
<source>
<context value="src"/>
<element value="text"/>
<variable value="vvv"/>
<condition value="src.title.empty()"/>
</source>
<target>
<context value="tgt"/>
<element value="text"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="group-required"/>
<source>
<context value="src"/>
<element value="required"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="required"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="group-repeats"/>
<source>
<context value="src"/>
<element value="repeats"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="repeats"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="group-group"/>
<source>
<context value="src"/>
<element value="group"/>
<variable value="vs0"/>
</source>
<target>
<context value="tgt"/>
<element value="item"/>
<variable value="vt0"/>
</target>
<dependent>
<name value="qstGroup"/>
<parameter>
<valueId value="vs0"/>
</parameter>
<parameter>
<valueId value="vt0"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="group-question"/>
<source>
<context value="src"/>
<element value="question"/>
<variable value="vs0"/>
</source>
<target>
<context value="tgt"/>
<element value="item"/>
<variable value="vt0"/>
</target>
<dependent>
<name value="qstQuestion"/>
<parameter>
<valueId value="vs0"/>
</parameter>
<parameter>
<valueId value="vt0"/>
</parameter>
</dependent>
</rule>
</group>
<group>
<name value="qstQuestion"/>
<extends value="BackboneElement"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<mode value="target"/>
</input>
<rule>
<name value="question-type"/>
<source>
<context value="src"/>
<element value="type"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="type"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="question-linkId"/>
<source>
<context value="src"/>
<element value="linkId"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="linkId"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="question-concept"/>
<source>
<context value="src"/>
<element value="concept"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="question-text"/>
<source>
<context value="src"/>
<element value="text"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="text"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="question-required"/>
<source>
<context value="src"/>
<element value="required"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="required"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="question-repeats"/>
<source>
<context value="src"/>
<element value="repeats"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="repeats"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="question-options"/>
<source>
<context value="src"/>
<element value="options"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="options"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="question-option"/>
<source>
<context value="src"/>
<element value="option"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<element value="option"/>
<variable value="o"/>
</target>
<target>
<context value="o"/>
<element value="value"/>
<variable value="v"/>
</target>
</rule>
<rule>
<name value="question-group"/>
<source>
<context value="src"/>
<element value="group"/>
<variable value="vs0"/>
</source>
<target>
<context value="tgt"/>
<element value="item"/>
<variable value="vt0"/>
</target>
<dependent>
<name value="qstGroup"/>
<parameter>
<valueId value="vs0"/>
</parameter>
<parameter>
<valueId value="vt0"/>
</parameter>
</dependent>
</rule>
</group>
</StructureMap>