0.2.0 - ci-build
OKTonFHIR - Local Development build (v0.2.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions
| Draft as of 2025-11-14 |
<StructureMap xmlns="http://hl7.org/fhir">
<id value="OktMessage-EpisodeOfCare"/>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap OktMessage-EpisodeOfCare</b></p><a name="OktMessage-EpisodeOfCare"> </a><a name="hcOktMessage-EpisodeOfCare"> </a><pre class="fml">
<b>map</b><span style="color: navy"> "</span>http://hl7.no/fhir/ig/okt/StructureMap/OktMessage-EpisodeOfCare<span style="color: navy">" = "</span>OktMessageEpisodeOfCare<span style="color: navy">"
</span><span style="color: navy">// </span><span style="color: green">Map OktMessage to EpisodeOfCare</span>
<b>uses</b><span style="color: navy"> "</span><a href="StructureDefinition-OktMessage.html" title="Logical Model for OktMessage">http://hl7.no/fhir/ig/okt/StructureDefinition/OktMessage</a><span style="color: navy">" </span><b>alias </b>NhnOktMessage <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> "</span><a href="StructureDefinition-OktEpisodeOfCare.html" title="OktEpisodeOfCare">http://hl7.no/fhir/ig/okt/StructureDefinition/OktEpisodeOfCare</a><span style="color: navy">" </span><b>alias </b>FhirEpisodeOfCare <b>as </b><b>target</b>
<b>group </b>OktMessageToEpisodeOfCare<span style="color: navy">(</span><b>source</b> <span style="color: maroon">source</span><span style="color: navy"> : </span>NhnOktMessage, <b>target</b> <span style="color: maroon">target</span><span style="color: navy"> : </span>FhirEpisodeOfCare<span style="color: navy">)</span><b> <<types>></b><span style="color: navy"> {
</span> source.weeklyExtent<b> as </b><span style="color: maroon">weeklyExtent</span><span style="color: navy"><b> -> </b></span> target.extension = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Extension'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">weeklyExtentExtensionVariable</span><span style="color: navy">, </span> weeklyExtentExtensionVariable.url = <span style="color: blue">'http://hl7.no/fhir/ig/okt/StructureDefinition/WeeklyExtentRatio'</span><span style="color: navy">, </span> weeklyExtentExtensionVariable.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Ratio'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">weeklyExtentExtensionVariableValueRatio</span><span style="color: navy">, </span> weeklyExtentExtensionVariableValueRatio.numerator = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Quantity'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">numeratorVariable</span><span style="color: navy">, </span> numeratorVariable.value = <span style="color: maroon">weeklyExtent</span><span style="color: navy">, </span> numeratorVariable.unit = <span style="color: blue">'h'</span><span style="color: navy">, </span> numeratorVariable.system = <span style="color: blue">'http://unitsofmeasure.org'</span><span style="color: navy">, </span> numeratorVariable.code = <span style="color: blue">'h'</span><span style="color: navy">, </span> weeklyExtentExtensionVariableValueRatio.denominator = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Quantity'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">denominatorVariable</span><span style="color: navy">, </span> denominatorVariable.value = <span style="color: blue">'1'</span><span style="color: navy">, </span> denominatorVariable.unit = <span style="color: blue">'wk'</span><span style="color: navy">, </span> denominatorVariable.system = <span style="color: blue">'http://unitsofmeasure.org'</span><span style="color: navy">, </span> denominatorVariable.code = <span style="color: blue">'wk'</span> <i>"mapWeeklyExtent"</i><span style="color: navy">;</span>
source.serviceDescription<b> as </b><span style="color: maroon">serviceDescription</span><span style="color: navy"><b> -> </b></span> target.extension = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Extension'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">descrExtensionVariable</span><span style="color: navy">, </span> descrExtensionVariable.url = <span style="color: blue">'http://hl7.no/fhir/ig/okt/StructureDefinition/ServiceDescriptionMarkdown'</span><span style="color: navy">, </span> descrExtensionVariable.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'markdown'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">descrExtensionVariableValueMd</span><span style="color: navy">, </span> descrExtensionVariableValueMd.value = <span style="color: maroon">serviceDescription</span> <i>"mapServiceDescription"</i><span style="color: navy">;</span>
source<b> where </b>temporaryCessation != true<span style="color: navy"><b> -> </b></span> target.status = <b>create</b><span style="color: navy">(</span><span style="color: blue">'code'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">statusVariable</span><span style="color: navy">, </span> statusVariable.value = <span style="color: blue">'active'</span> <i>"mapStatus"</i><span style="color: navy">;</span>
source<b> where </b>temporaryCessation = true<span style="color: navy"><b> -> </b></span> target.status = <b>create</b><span style="color: navy">(</span><span style="color: blue">'code'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">statusVariable</span><span style="color: navy">, </span> statusVariable.value = <span style="color: blue">'onhold'</span> <i>"mapStatus"</i><span style="color: navy">;</span>
source.stayType<b> as </b><span style="color: maroon">stayType</span><span style="color: navy"><b> -> </b></span>target.type = <b>cc</b><span style="color: navy">(</span><span style="color: blue">'http://hl7.no/fhir/ig/okt/CodeSystem/OktStayTypeCs'</span><span style="color: navy">, </span><span style="color: maroon">stayType</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">typeVariable</span> <i>"mapStayType"</i><span style="color: navy">;</span>
source<span style="color: navy"><b> -> </b></span>target.period = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Period'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">period</span><b> then</b><span style="color: navy"> {
</span> source.startDate<b> as </b><span style="color: maroon">startDate</span><span style="color: navy"><b> -> </b></span>period.start = <span style="color: maroon">startDate</span> <i>"setStart"</i><span style="color: navy">;</span>
source.endDate<b> as </b><span style="color: maroon">endDate</span><span style="color: navy"><b> -> </b></span>period.end = <span style="color: maroon">endDate</span> <i>"setEnd"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"mapPeriod"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span></pre></div>
</text>
<url
value="http://hl7.no/fhir/ig/okt/StructureMap/OktMessage-EpisodeOfCare"/>
<version value="0.2.0"/>
<name value="OktMessageEpisodeOfCare"/>
<status value="draft"/>
<experimental value="true"/>
<date value="2025-11-14T11:11:36+00:00"/>
<publisher value="HL7 Norway"/>
<contact>
<name value="HL7 Norway"/>
<telecom>
<system value="url"/>
<value value="http://hl7.no/"/>
</telecom>
</contact>
<description value="Map OktMessage to EpisodeOfCare"/>
<structure>
<url value="http://hl7.no/fhir/ig/okt/StructureDefinition/OktMessage"/>
<mode value="source"/>
<alias value="NhnOktMessage"/>
</structure>
<structure>
<url
value="http://hl7.no/fhir/ig/okt/StructureDefinition/OktEpisodeOfCare"/>
<mode value="target"/>
<alias value="FhirEpisodeOfCare"/>
</structure>
<group>
<name value="OktMessageToEpisodeOfCare"/>
<typeMode value="types"/>
<input>
<name value="source"/>
<type value="NhnOktMessage"/>
<mode value="source"/>
</input>
<input>
<name value="target"/>
<type value="FhirEpisodeOfCare"/>
<mode value="target"/>
</input>
<rule>
<name value="mapWeeklyExtent"/>
<source>
<context value="source"/>
<element value="weeklyExtent"/>
<variable value="weeklyExtent"/>
</source>
<target>
<context value="target"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="weeklyExtentExtensionVariable"/>
<transform value="create"/>
<parameter>
<valueString value="Extension"/>
</parameter>
</target>
<target>
<context value="weeklyExtentExtensionVariable"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://hl7.no/fhir/ig/okt/StructureDefinition/WeeklyExtentRatio"/>
</parameter>
</target>
<target>
<context value="weeklyExtentExtensionVariable"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="weeklyExtentExtensionVariableValueRatio"/>
<transform value="create"/>
<parameter>
<valueString value="Ratio"/>
</parameter>
</target>
<target>
<context value="weeklyExtentExtensionVariableValueRatio"/>
<contextType value="variable"/>
<element value="numerator"/>
<variable value="numeratorVariable"/>
<transform value="create"/>
<parameter>
<valueString value="Quantity"/>
</parameter>
</target>
<target>
<context value="numeratorVariable"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="weeklyExtent"/>
</parameter>
</target>
<target>
<context value="numeratorVariable"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="copy"/>
<parameter>
<valueString value="h"/>
</parameter>
</target>
<target>
<context value="numeratorVariable"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://unitsofmeasure.org"/>
</parameter>
</target>
<target>
<context value="numeratorVariable"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="h"/>
</parameter>
</target>
<target>
<context value="weeklyExtentExtensionVariableValueRatio"/>
<contextType value="variable"/>
<element value="denominator"/>
<variable value="denominatorVariable"/>
<transform value="create"/>
<parameter>
<valueString value="Quantity"/>
</parameter>
</target>
<target>
<context value="denominatorVariable"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueString value="1"/>
</parameter>
</target>
<target>
<context value="denominatorVariable"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="copy"/>
<parameter>
<valueString value="wk"/>
</parameter>
</target>
<target>
<context value="denominatorVariable"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://unitsofmeasure.org"/>
</parameter>
</target>
<target>
<context value="denominatorVariable"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="wk"/>
</parameter>
</target>
</rule>
<rule>
<name value="mapServiceDescription"/>
<source>
<context value="source"/>
<element value="serviceDescription"/>
<variable value="serviceDescription"/>
</source>
<target>
<context value="target"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="descrExtensionVariable"/>
<transform value="create"/>
<parameter>
<valueString value="Extension"/>
</parameter>
</target>
<target>
<context value="descrExtensionVariable"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://hl7.no/fhir/ig/okt/StructureDefinition/ServiceDescriptionMarkdown"/>
</parameter>
</target>
<target>
<context value="descrExtensionVariable"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="descrExtensionVariableValueMd"/>
<transform value="create"/>
<parameter>
<valueString value="markdown"/>
</parameter>
</target>
<target>
<context value="descrExtensionVariableValueMd"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="serviceDescription"/>
</parameter>
</target>
</rule>
<rule>
<name value="mapStatus"/>
<source>
<context value="source"/>
<condition value="temporaryCessation != true"/>
</source>
<target>
<context value="target"/>
<contextType value="variable"/>
<element value="status"/>
<variable value="statusVariable"/>
<transform value="create"/>
<parameter>
<valueString value="code"/>
</parameter>
</target>
<target>
<context value="statusVariable"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueString value="active"/>
</parameter>
</target>
</rule>
<rule>
<name value="mapStatus"/>
<source>
<context value="source"/>
<condition value="temporaryCessation = true"/>
</source>
<target>
<context value="target"/>
<contextType value="variable"/>
<element value="status"/>
<variable value="statusVariable"/>
<transform value="create"/>
<parameter>
<valueString value="code"/>
</parameter>
</target>
<target>
<context value="statusVariable"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueString value="onhold"/>
</parameter>
</target>
</rule>
<rule>
<name value="mapStayType"/>
<source>
<context value="source"/>
<element value="stayType"/>
<variable value="stayType"/>
</source>
<target>
<context value="target"/>
<contextType value="variable"/>
<element value="type"/>
<variable value="typeVariable"/>
<transform value="cc"/>
<parameter>
<valueString
value="http://hl7.no/fhir/ig/okt/CodeSystem/OktStayTypeCs"/>
</parameter>
<parameter>
<valueId value="stayType"/>
</parameter>
</target>
</rule>
<rule>
<name value="mapPeriod"/>
<source>
<context value="source"/>
</source>
<target>
<context value="target"/>
<contextType value="variable"/>
<element value="period"/>
<variable value="period"/>
<transform value="create"/>
<parameter>
<valueString value="Period"/>
</parameter>
</target>
<rule>
<name value="setStart"/>
<source>
<context value="source"/>
<element value="startDate"/>
<variable value="startDate"/>
</source>
<target>
<context value="period"/>
<contextType value="variable"/>
<element value="start"/>
<transform value="copy"/>
<parameter>
<valueId value="startDate"/>
</parameter>
</target>
</rule>
<rule>
<name value="setEnd"/>
<source>
<context value="source"/>
<element value="endDate"/>
<variable value="endDate"/>
</source>
<target>
<context value="period"/>
<contextType value="variable"/>
<element value="end"/>
<transform value="copy"/>
<parameter>
<valueId value="endDate"/>
</parameter>
</target>
</rule>
</rule>
</group>
</StructureMap>