PreNUDGE FHIR® IG for Data Provider / Data from Apps (R4)
0.1.0 - ci-build

PreNUDGE FHIR® IG for Data Provider / Data from Apps (R4) - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

## : Work-SoC Q score to O score - XML Representation

Active as of 2026-06-25

Raw xml | Download

    <StructureMap xmlns="http://hl7.org/fhir">
      <id value="WorkSocQuestionnaireResponseToObservation"/>
      <text>
        <status value="generated"/>
        <div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap WorkSocQuestionnaireResponseToObservation</b></p><a name="WorkSocQuestionnaireResponseToObservation"> </a><a name="hcWorkSocQuestionnaireResponseToObservation"> </a><pre class="fml">
    <b>map</b><span style="color: navy"> &quot;</span>https://fhir.hl7.at/prenudge/appdata/r4/StructureMap/WorkSocQuestionnaireResponseToObservation<span style="color: navy">&quot; = &quot;</span>WorkSocQuestionnaireResponseToObservation<span style="color: navy">&quot;

    </span><span style="color: navy">// </span><span style="color: green">Work-SoC Q score to O score</span>

    <b>uses</b><span style="color: navy"> &quot;</span><a href="http://hl7.org/fhir/R4/questionnaireresponse.html" title="QuestionnaireResponse">http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse</a><span style="color: navy">&quot; </span><b>alias </b>QR <b>as </b><b>source</b>
    <b>uses</b><span style="color: navy"> &quot;</span><a href="http://hl7.org/fhir/R4/observation.html" title="Observation">http://hl7.org/fhir/StructureDefinition/Observation</a><span style="color: navy">&quot; </span><b>alias </b>Obs <b>as </b><b>target</b>

    <b>imports</b><span style="color: navy"> &quot;</span>http://hl7.org/fhir/StructureMap/*<span style="color: navy">&quot;
    </span><b>imports</b><span style="color: navy"> &quot;</span><a href="StructureMap-QuestionnaireResponseToObservationBase.html" title="Shared base for Q to O">https://fhir.hl7.at/prenudge/appdata/r4/StructureMap/QuestionnaireResponseToObservationBase</a><span style="color: navy">&quot;
    </span>
    <b>group </b>WorkSocQuestionnaireResponseToObservation<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>QR, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>Obs<span style="color: navy">)</span><span style="color: navy"> {
    </span>  src<b> then </b>SetObservationBase<span style="color: navy">(</span><span style="color: maroon">src</span><span style="color: navy">, </span><span style="color: maroon">tgt</span><span style="color: navy">)</span> <i>&quot;Base&quot;</i><span style="color: navy">;</span>
      src<span style="color: navy"><b> -&gt; </b></span> tgt.meta<b> as </b><span style="color: maroon">meta</span><span style="color: navy">, </span> meta.profile = <span style="color: blue">'https://fhir.hl7.at/prenudge/appdata/r4/StructureDefinition/at-prenudge-work-soc-score-observation'</span> <i>&quot;SetProfile&quot;</i><span style="color: navy">;</span>
      src<span style="color: navy"><b> -&gt; </b></span>tgt.code = <b>cc</b><span style="color: navy">(</span><span style="color: blue">'https://fhir.hl7.at/prenudge/appdata/r4/CodeSystem/prenudge-workability'</span><span style="color: navy">, </span><span style="color: blue">'work-soc-category-score'</span><span style="color: navy">, </span><span style="color: blue">'Work-SoC category score'</span><span style="color: navy">)</span> <i>&quot;SetCode&quot;</i><span style="color: navy">;</span>
      src.item<b> as </b><span style="color: maroon">workSocGroup</span><b> where </b>linkId = 'work-soc'<b> then</b><span style="color: navy"> {
    </span>    workSocGroup.item<b> as </b><span style="color: maroon">scoreItem</span><b> where </b>linkId = 'work-soc-comprehensibility-score'<b> then </b>MapComprehensibilityScore<span style="color: navy">(</span><span style="color: maroon">scoreItem</span><span style="color: navy">, </span><span style="color: maroon">tgt</span><span style="color: navy">)</span> <i>&quot;MapComprehensibilityScore&quot;</i><span style="color: navy">;</span>
        workSocGroup.item<b> as </b><span style="color: maroon">scoreItem</span><b> where </b>linkId = 'work-soc-manageability-score'<b> then </b>MapManageabilityScore<span style="color: navy">(</span><span style="color: maroon">scoreItem</span><span style="color: navy">, </span><span style="color: maroon">tgt</span><span style="color: navy">)</span> <i>&quot;MapManageabilityScore&quot;</i><span style="color: navy">;</span>
        workSocGroup.item<b> as </b><span style="color: maroon">scoreItem</span><b> where </b>linkId = 'work-soc-meaningfulness-score'<b> then </b>MapMeaningfulnessScore<span style="color: navy">(</span><span style="color: maroon">scoreItem</span><span style="color: navy">, </span><span style="color: maroon">tgt</span><span style="color: navy">)</span> <i>&quot;MapMeaningfulnessScore&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;ProcessWorkSoc&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">// </span><span style="color: green">TODO: Comment/Note mapping disabled due to MaLaC-HD limitation</span>
    <span style="color: navy">// </span><span style="color: green">See: https://gitlab.com/cdehealth/malac-hd/-/issues/128</span>
    <span style="color: navy">}

    </span><b>group </b>MapComprehensibilityScore<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>QR, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>Obs<span style="color: navy">)</span><span style="color: navy"> {
    </span>  src.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
    </span>    answer.valueDecimal<b> as </b><span style="color: maroon">val</span><b> then</b><span style="color: navy"> {
    </span>      val.value<b> as </b><span style="color: maroon">numVal</span><span style="color: navy"><b> -&gt; </b></span> tgt.component<b> as </b><span style="color: maroon">comp</span><span style="color: navy">, </span> comp.code = <b>cc</b><span style="color: navy">(</span><span style="color: blue">'https://fhir.hl7.at/prenudge/appdata/r4/CodeSystem/prenudge-workability'</span><span style="color: navy">, </span><span style="color: blue">'work-soc-comprehensibility'</span><span style="color: navy">, </span><span style="color: blue">'Work-SoC comprehensibility score'</span><span style="color: navy">)</span><span style="color: navy">, </span> comp.value = <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">qty</span><span style="color: navy">, </span> qty.value = <span style="color: maroon">numVal</span><span style="color: navy">, </span> qty.unit = <span style="color: blue">'score'</span><span style="color: navy">, </span> qty.system = <span style="color: blue">'http://unitsofmeasure.org'</span><span style="color: navy">, </span> qty.code = <span style="color: blue">'{score}'</span> <i>&quot;SetComponent&quot;</i><span style="color: navy">;</span>
        <span style="color: navy">}</span> <i>&quot;ExtractValue&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;ProcessAnswer&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}

    </span><b>group </b>MapManageabilityScore<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>QR, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>Obs<span style="color: navy">)</span><span style="color: navy"> {
    </span>  src.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
    </span>    answer.valueDecimal<b> as </b><span style="color: maroon">val</span><b> then</b><span style="color: navy"> {
    </span>      val.value<b> as </b><span style="color: maroon">numVal</span><span style="color: navy"><b> -&gt; </b></span> tgt.component<b> as </b><span style="color: maroon">comp</span><span style="color: navy">, </span> comp.code = <b>cc</b><span style="color: navy">(</span><span style="color: blue">'https://fhir.hl7.at/prenudge/appdata/r4/CodeSystem/prenudge-workability'</span><span style="color: navy">, </span><span style="color: blue">'work-soc-manageability'</span><span style="color: navy">, </span><span style="color: blue">'Work-SoC manageability score'</span><span style="color: navy">)</span><span style="color: navy">, </span> comp.value = <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">qty</span><span style="color: navy">, </span> qty.value = <span style="color: maroon">numVal</span><span style="color: navy">, </span> qty.unit = <span style="color: blue">'score'</span><span style="color: navy">, </span> qty.system = <span style="color: blue">'http://unitsofmeasure.org'</span><span style="color: navy">, </span> qty.code = <span style="color: blue">'{score}'</span> <i>&quot;SetComponent&quot;</i><span style="color: navy">;</span>
        <span style="color: navy">}</span> <i>&quot;ExtractValue&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;ProcessAnswer&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}

    </span><b>group </b>MapMeaningfulnessScore<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>QR, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>Obs<span style="color: navy">)</span><span style="color: navy"> {
    </span>  src.answer<b> as </b><span style="color: maroon">answer</span><b> then</b><span style="color: navy"> {
    </span>    answer.valueDecimal<b> as </b><span style="color: maroon">val</span><b> then</b><span style="color: navy"> {
    </span>      val.value<b> as </b><span style="color: maroon">numVal</span><span style="color: navy"><b> -&gt; </b></span> tgt.component<b> as </b><span style="color: maroon">comp</span><span style="color: navy">, </span> comp.code = <b>cc</b><span style="color: navy">(</span><span style="color: blue">'https://fhir.hl7.at/prenudge/appdata/r4/CodeSystem/prenudge-workability'</span><span style="color: navy">, </span><span style="color: blue">'work-soc-meaningfulness'</span><span style="color: navy">, </span><span style="color: blue">'Work-SoC meaningfulness score'</span><span style="color: navy">)</span><span style="color: navy">, </span> comp.value = <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">qty</span><span style="color: navy">, </span> qty.value = <span style="color: maroon">numVal</span><span style="color: navy">, </span> qty.unit = <span style="color: blue">'score'</span><span style="color: navy">, </span> qty.system = <span style="color: blue">'http://unitsofmeasure.org'</span><span style="color: navy">, </span> qty.code = <span style="color: blue">'{score}'</span> <i>&quot;SetComponent&quot;</i><span style="color: navy">;</span>
        <span style="color: navy">}</span> <i>&quot;ExtractValue&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;ProcessAnswer&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}

    </span></pre></div>
      </text>
      <url
           value="https://fhir.hl7.at/prenudge/appdata/r4/StructureMap/WorkSocQuestionnaireResponseToObservation"/>
      <version value="0.1.0"/>
      <name value="WorkSocQuestionnaireResponseToObservation"/>
      <title value="Work-SoC Q score to O score"/>
      <status value="active"/>
      <date value="2026-06-25T12:51:02+00:00"/>
      <publisher value="The PreNUDGE Consortium"/>
      <contact>
        <name value="The PreNUDGE Consortium"/>
        <telecom>
          <system value="url"/>
          <value value="https://prenudge.at"/>
        </telecom>
      </contact>
      <contact>
        <name value="The PreNUDGE Consortium"/>
        <telecom>
          <system value="url"/>
          <value value="https://prenudge.at"/>
          <use value="work"/>
        </telecom>
      </contact>
      <description value="Work-SoC Q score to O score"/>
      <structure>
        <url
             value="http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse"/>
        <mode value="source"/>
        <alias value="QR"/>
      </structure>
      <structure>
        <url value="http://hl7.org/fhir/StructureDefinition/Observation"/>
        <mode value="target"/>
        <alias value="Obs"/>
      </structure>
      <import value="http://hl7.org/fhir/StructureMap/*"/>
      <import
              value="https://fhir.hl7.at/prenudge/appdata/r4/StructureMap/QuestionnaireResponseToObservationBase"/>
      <group>
        <name value="WorkSocQuestionnaireResponseToObservation"/>
        <typeMode value="none"/>
        <input>
          <name value="src"/>
          <type value="QR"/>
          <mode value="source"/>
        </input>
        <input>
          <name value="tgt"/>
          <type value="Obs"/>
          <mode value="target"/>
        </input>
        <rule>
          <name value="Base"/>
          <source>
            <context value="src"/>
          </source>
          <dependent>
            <name value="SetObservationBase"/>
            <variable value="src"/>
            <variable value="tgt"/>
          </dependent>
        </rule>
        <rule>
          <name value="SetProfile"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="meta"/>
            <variable value="meta"/>
          </target>
          <target>
            <context value="meta"/>
            <contextType value="variable"/>
            <element value="profile"/>
            <transform value="copy"/>
            <parameter>
              <valueString
                           value="https://fhir.hl7.at/prenudge/appdata/r4/StructureDefinition/at-prenudge-work-soc-score-observation"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="SetCode"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="code"/>
            <transform value="cc"/>
            <parameter>
              <valueString
                           value="https://fhir.hl7.at/prenudge/appdata/r4/CodeSystem/prenudge-workability"/>
            </parameter>
            <parameter>
              <valueString value="work-soc-category-score"/>
            </parameter>
            <parameter>
              <valueString value="Work-SoC category score"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="ProcessWorkSoc"/>
          <source>
            <context value="src"/>
            <element value="item"/>
            <variable value="workSocGroup"/>
            <condition value="linkId = 'work-soc'"/>
          </source>
          <rule>
            <name value="MapComprehensibilityScore"/>
            <source>
              <context value="workSocGroup"/>
              <element value="item"/>
              <variable value="scoreItem"/>
              <condition value="linkId = 'work-soc-comprehensibility-score'"/>
            </source>
            <dependent>
              <name value="MapComprehensibilityScore"/>
              <variable value="scoreItem"/>
              <variable value="tgt"/>
            </dependent>
          </rule>
          <rule>
            <name value="MapManageabilityScore"/>
            <source>
              <context value="workSocGroup"/>
              <element value="item"/>
              <variable value="scoreItem"/>
              <condition value="linkId = 'work-soc-manageability-score'"/>
            </source>
            <dependent>
              <name value="MapManageabilityScore"/>
              <variable value="scoreItem"/>
              <variable value="tgt"/>
            </dependent>
          </rule>
          <rule>
            <name value="MapMeaningfulnessScore"/>
            <source>
              <context value="workSocGroup"/>
              <element value="item"/>
              <variable value="scoreItem"/>
              <condition value="linkId = 'work-soc-meaningfulness-score'"/>
            </source>
            <dependent>
              <name value="MapMeaningfulnessScore"/>
              <variable value="scoreItem"/>
              <variable value="tgt"/>
            </dependent>
          </rule>
        </rule>
      </group>
      <group>
        <name value="MapComprehensibilityScore"/>
        <typeMode value="none"/>
        <input>
          <name value="src"/>
          <type value="QR"/>
          <mode value="source"/>
        </input>
        <input>
          <name value="tgt"/>
          <type value="Obs"/>
          <mode value="target"/>
        </input>
        <rule>
          <name value="ProcessAnswer"/>
          <source>
            <context value="src"/>
            <element value="answer"/>
            <variable value="answer"/>
          </source>
          <rule>
            <name value="ExtractValue"/>
            <source>
              <context value="answer"/>
              <element value="valueDecimal"/>
              <variable value="val"/>
            </source>
            <rule>
              <name value="SetComponent"/>
              <source>
                <context value="val"/>
                <element value="value"/>
                <variable value="numVal"/>
              </source>
              <target>
                <context value="tgt"/>
                <contextType value="variable"/>
                <element value="component"/>
                <variable value="comp"/>
              </target>
              <target>
                <context value="comp"/>
                <contextType value="variable"/>
                <element value="code"/>
                <transform value="cc"/>
                <parameter>
                  <valueString
                               value="https://fhir.hl7.at/prenudge/appdata/r4/CodeSystem/prenudge-workability"/>
                </parameter>
                <parameter>
                  <valueString value="work-soc-comprehensibility"/>
                </parameter>
                <parameter>
                  <valueString value="Work-SoC comprehensibility score"/>
                </parameter>
              </target>
              <target>
                <context value="comp"/>
                <contextType value="variable"/>
                <element value="value"/>
                <variable value="qty"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Quantity"/>
                </parameter>
              </target>
              <target>
                <context value="qty"/>
                <contextType value="variable"/>
                <element value="value"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="numVal"/>
                </parameter>
              </target>
              <target>
                <context value="qty"/>
                <contextType value="variable"/>
                <element value="unit"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="score"/>
                </parameter>
              </target>
              <target>
                <context value="qty"/>
                <contextType value="variable"/>
                <element value="system"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="http://unitsofmeasure.org"/>
                </parameter>
              </target>
              <target>
                <context value="qty"/>
                <contextType value="variable"/>
                <element value="code"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="{score}"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </group>
      <group>
        <name value="MapManageabilityScore"/>
        <typeMode value="none"/>
        <input>
          <name value="src"/>
          <type value="QR"/>
          <mode value="source"/>
        </input>
        <input>
          <name value="tgt"/>
          <type value="Obs"/>
          <mode value="target"/>
        </input>
        <rule>
          <name value="ProcessAnswer"/>
          <source>
            <context value="src"/>
            <element value="answer"/>
            <variable value="answer"/>
          </source>
          <rule>
            <name value="ExtractValue"/>
            <source>
              <context value="answer"/>
              <element value="valueDecimal"/>
              <variable value="val"/>
            </source>
            <rule>
              <name value="SetComponent"/>
              <source>
                <context value="val"/>
                <element value="value"/>
                <variable value="numVal"/>
              </source>
              <target>
                <context value="tgt"/>
                <contextType value="variable"/>
                <element value="component"/>
                <variable value="comp"/>
              </target>
              <target>
                <context value="comp"/>
                <contextType value="variable"/>
                <element value="code"/>
                <transform value="cc"/>
                <parameter>
                  <valueString
                               value="https://fhir.hl7.at/prenudge/appdata/r4/CodeSystem/prenudge-workability"/>
                </parameter>
                <parameter>
                  <valueString value="work-soc-manageability"/>
                </parameter>
                <parameter>
                  <valueString value="Work-SoC manageability score"/>
                </parameter>
              </target>
              <target>
                <context value="comp"/>
                <contextType value="variable"/>
                <element value="value"/>
                <variable value="qty"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Quantity"/>
                </parameter>
              </target>
              <target>
                <context value="qty"/>
                <contextType value="variable"/>
                <element value="value"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="numVal"/>
                </parameter>
              </target>
              <target>
                <context value="qty"/>
                <contextType value="variable"/>
                <element value="unit"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="score"/>
                </parameter>
              </target>
              <target>
                <context value="qty"/>
                <contextType value="variable"/>
                <element value="system"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="http://unitsofmeasure.org"/>
                </parameter>
              </target>
              <target>
                <context value="qty"/>
                <contextType value="variable"/>
                <element value="code"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="{score}"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </group>
      <group>
        <name value="MapMeaningfulnessScore"/>
        <typeMode value="none"/>
        <input>
          <name value="src"/>
          <type value="QR"/>
          <mode value="source"/>
        </input>
        <input>
          <name value="tgt"/>
          <type value="Obs"/>
          <mode value="target"/>
        </input>
        <rule>
          <name value="ProcessAnswer"/>
          <source>
            <context value="src"/>
            <element value="answer"/>
            <variable value="answer"/>
          </source>
          <rule>
            <name value="ExtractValue"/>
            <source>
              <context value="answer"/>
              <element value="valueDecimal"/>
              <variable value="val"/>
            </source>
            <rule>
              <name value="SetComponent"/>
              <source>
                <context value="val"/>
                <element value="value"/>
                <variable value="numVal"/>
              </source>
              <target>
                <context value="tgt"/>
                <contextType value="variable"/>
                <element value="component"/>
                <variable value="comp"/>
              </target>
              <target>
                <context value="comp"/>
                <contextType value="variable"/>
                <element value="code"/>
                <transform value="cc"/>
                <parameter>
                  <valueString
                               value="https://fhir.hl7.at/prenudge/appdata/r4/CodeSystem/prenudge-workability"/>
                </parameter>
                <parameter>
                  <valueString value="work-soc-meaningfulness"/>
                </parameter>
                <parameter>
                  <valueString value="Work-SoC meaningfulness score"/>
                </parameter>
              </target>
              <target>
                <context value="comp"/>
                <contextType value="variable"/>
                <element value="value"/>
                <variable value="qty"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Quantity"/>
                </parameter>
              </target>
              <target>
                <context value="qty"/>
                <contextType value="variable"/>
                <element value="value"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="numVal"/>
                </parameter>
              </target>
              <target>
                <context value="qty"/>
                <contextType value="variable"/>
                <element value="unit"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="score"/>
                </parameter>
              </target>
              <target>
                <context value="qty"/>
                <contextType value="variable"/>
                <element value="system"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="http://unitsofmeasure.org"/>
                </parameter>
              </target>
              <target>
                <context value="qty"/>
                <contextType value="variable"/>
                <element value="code"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="{score}"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </group>
    </StructureMap>