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

## : Sitting Hours Q to O - JSON Representation

Active as of 2026-06-25

Raw json | Download

    {
      "resourceType" : "StructureMap",
      "id" : "SittingHoursQuestionnaireResponseToObservation",
      "text" : {
        "status" : "generated",
        "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: StructureMap SittingHoursQuestionnaireResponseToObservation</b></p><a name=\"SittingHoursQuestionnaireResponseToObservation\"> </a><a name=\"hcSittingHoursQuestionnaireResponseToObservation\"> </a><pre class=\"fml\">\r\n<b>map</b><span style=\"color: navy\"> &quot;</span>https://fhir.hl7.at/prenudge/appdata/r4/StructureMap/SittingHoursQuestionnaireResponseToObservation<span style=\"color: navy\">&quot; = &quot;</span>SittingHoursQuestionnaireResponseToObservation<span style=\"color: navy\">&quot;\r\n\r\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Sitting Hours EHIS-PAQ Q9 / ATHIS PE9 to O</span>\r\n\r\n<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>\r\n<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>\r\n\r\n<b>imports</b><span style=\"color: navy\"> &quot;</span>http://hl7.org/fhir/StructureMap/*<span style=\"color: navy\">&quot;\r\n</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;\r\n</span>\r\n<span style=\"color: navy\">// </span><span style=\"color: green\">---------------------------------------------------------------------------</span>\r\n<span style=\"color: navy\">// </span><span style=\"color: green\">Main entry group</span>\r\n<span style=\"color: navy\">// </span><span style=\"color: green\">---------------------------------------------------------------------------</span>\r\n<b>group </b>SittingHoursQuestionnaireResponseToObservation<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\"> {\r\n</span>  <span style=\"color: navy\">// </span><span style=\"color: green\">Shared base: identifier copy, derivedFrom, subject, issued, status, method.</span>\r\n  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>\r\n  <span style=\"color: navy\">// </span><span style=\"color: green\">Target profile</span>\r\n  src<span style=\"color: navy\"><b> -&gt; </b></span> tgt.meta = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Meta'</span><span style=\"color: navy\">)</span><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-sitting-hours-observation'</span> <i>&quot;SetProfile&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">// </span><span style=\"color: green\">Observation code</span>\r\n  src<span style=\"color: navy\"><b> -&gt; </b></span>tgt.code = <b>cc</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://loinc.org'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'87705-0'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'Sedentary activity 24 hour'</span><span style=\"color: navy\">)</span> <i>&quot;SetCode&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">// </span><span style=\"color: green\">effectiveDateTime from authored (Q9 has no embedded date sub-item)</span>\r\n  src.authored<b> as </b><span style=\"color: maroon\">authored</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.effectiveDateTime = <span style=\"color: maroon\">authored</span> <i>&quot;SetEffectiveDateTime&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">// </span><span style=\"color: green\">Map Q9 group to Observation.value</span>\r\n  src.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = 'Q9'<b> then </b>MapQ9ToSittingHours<span style=\"color: navy\">(</span><span style=\"color: maroon\">item</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">tgt</span><span style=\"color: navy\">)</span> <i>&quot;ProcessQ9&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">---------------------------------------------------------------------------</span>\r\n<span style=\"color: navy\">// </span><span style=\"color: green\">Q9 → Observation.valueQuantity (h)</span>\r\n<span style=\"color: navy\">// </span><span style=\"color: green\">Only Q9-hours (integer) is mapped to Observation.valueQuantity.value.</span>\r\n<span style=\"color: navy\">// </span><span style=\"color: green\">Q9-minutes is not included because MaLaC-HD does not support evaluate()</span>\r\n<span style=\"color: navy\">// </span><span style=\"color: green\">with complex FHIRPath expressions (arithmetic or multi-token paths).</span>\r\n<span style=\"color: navy\">// </span><span style=\"color: green\">Sub-hour precision requires an engine that supports evaluate(), e.g. matchbox.</span>\r\n<span style=\"color: navy\">// </span><span style=\"color: green\">---------------------------------------------------------------------------</span>\r\n<b>group </b>MapQ9ToSittingHours<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\"> {\r\n</span>  src.item<b> as </b><span style=\"color: maroon\">hoursItem</span><b> where </b>linkId = 'Q9-hours'<b> then</b><span style=\"color: navy\"> {\r\n</span>    hoursItem.answer<b> as </b><span style=\"color: maroon\">hoursAnswer</span><b> then</b><span style=\"color: navy\"> {\r\n</span>      hoursAnswer.valueInteger<b> as </b><span style=\"color: maroon\">hoursElem</span><b> then</b><span style=\"color: navy\"> {\r\n</span>        hoursElem.value<b> as </b><span style=\"color: maroon\">numVal</span><span style=\"color: navy\"><b> -&gt; </b></span> tgt.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\">'h'</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\">'h'</span> <i>&quot;SetSittingQuantity&quot;</i><span style=\"color: navy\">;</span>\r\n      <span style=\"color: navy\">}</span> <i>&quot;ExtractValue&quot;</i><span style=\"color: navy\">;</span>\r\n    <span style=\"color: navy\">}</span> <i>&quot;ExtractHoursAnswer&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;ProcessHoursItem&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span></pre></div>"
      },
      "url" : "https://fhir.hl7.at/prenudge/appdata/r4/StructureMap/SittingHoursQuestionnaireResponseToObservation",
      "version" : "0.1.0",
      "name" : "SittingHoursQuestionnaireResponseToObservation",
      "title" : "Sitting Hours Q to O",
      "status" : "active",
      "date" : "2026-06-25T12:51:02+00:00",
      "publisher" : "The PreNUDGE Consortium",
      "contact" : [
        {
          "name" : "The PreNUDGE Consortium",
          "telecom" : [
            {
              "system" : "url",
              "value" : "https://prenudge.at"
            }
          ]
        },
        {
          "name" : "The PreNUDGE Consortium",
          "telecom" : [
            {
              "system" : "url",
              "value" : "https://prenudge.at",
              "use" : "work"
            }
          ]
        }
      ],
      "description" : "Sitting Hours EHIS-PAQ Q9 / ATHIS PE9 to O",
      "structure" : [
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse",
          "mode" : "source",
          "alias" : "QR"
        },
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/Observation",
          "mode" : "target",
          "alias" : "Obs"
        }
      ],
      "import" : [
        "http://hl7.org/fhir/StructureMap/*"🔗 ,
        "https://fhir.hl7.at/prenudge/appdata/r4/StructureMap/QuestionnaireResponseToObservationBase"
      ],
      "group" : [
        {
          "name" : "SittingHoursQuestionnaireResponseToObservation",
          "typeMode" : "none",
          "documentation" : "---------------------------------------------------------------------------\r\nMain entry group\r\n---------------------------------------------------------------------------",
          "input" : [
            {
              "name" : "src",
              "type" : "QR",
              "mode" : "source"
            },
            {
              "name" : "tgt",
              "type" : "Obs",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "Base",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "dependent" : [
                {
                  "name" : "SetObservationBase",
                  "variable" : [
                    "src",
                    "tgt"
                  ]
                }
              ]
            },
            {
              "name" : "SetProfile",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "meta",
                  "variable" : "meta",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Meta"
                    }
                  ]
                },
                {
                  "context" : "meta",
                  "contextType" : "variable",
                  "element" : "profile",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "https://fhir.hl7.at/prenudge/appdata/r4/StructureDefinition/at-prenudge-sitting-hours-observation"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "SetCode",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "code",
                  "transform" : "cc",
                  "parameter" : [
                    {
                      "valueString" : "http://loinc.org"
                    },
                    {
                      "valueString" : "87705-0"
                    },
                    {
                      "valueString" : "Sedentary activity 24 hour"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "SetEffectiveDateTime",
              "source" : [
                {
                  "context" : "src",
                  "element" : "authored",
                  "variable" : "authored"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "effectiveDateTime",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "authored"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "ProcessQ9",
              "source" : [
                {
                  "context" : "src",
                  "element" : "item",
                  "variable" : "item",
                  "condition" : "linkId = 'Q9'"
                }
              ],
              "dependent" : [
                {
                  "name" : "MapQ9ToSittingHours",
                  "variable" : [
                    "item",
                    "tgt"
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "MapQ9ToSittingHours",
          "typeMode" : "none",
          "documentation" : "---------------------------------------------------------------------------\r\nQ9 → Observation.valueQuantity (h)\r\nOnly Q9-hours (integer) is mapped to Observation.valueQuantity.value.\r\nQ9-minutes is not included because MaLaC-HD does not support evaluate()\r\nwith complex FHIRPath expressions (arithmetic or multi-token paths).\r\nSub-hour precision requires an engine that supports evaluate(), e.g. matchbox.\r\n---------------------------------------------------------------------------",
          "input" : [
            {
              "name" : "src",
              "type" : "QR",
              "mode" : "source"
            },
            {
              "name" : "tgt",
              "type" : "Obs",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "ProcessHoursItem",
              "source" : [
                {
                  "context" : "src",
                  "element" : "item",
                  "variable" : "hoursItem",
                  "condition" : "linkId = 'Q9-hours'"
                }
              ],
              "rule" : [
                {
                  "name" : "ExtractHoursAnswer",
                  "source" : [
                    {
                      "context" : "hoursItem",
                      "element" : "answer",
                      "variable" : "hoursAnswer"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "ExtractValue",
                      "source" : [
                        {
                          "context" : "hoursAnswer",
                          "element" : "valueInteger",
                          "variable" : "hoursElem"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "SetSittingQuantity",
                          "source" : [
                            {
                              "context" : "hoursElem",
                              "element" : "value",
                              "variable" : "numVal"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "tgt",
                              "contextType" : "variable",
                              "element" : "value",
                              "variable" : "qty",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Quantity"
                                }
                              ]
                            },
                            {
                              "context" : "qty",
                              "contextType" : "variable",
                              "element" : "value",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueId" : "numVal"
                                }
                              ]
                            },
                            {
                              "context" : "qty",
                              "contextType" : "variable",
                              "element" : "unit",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "h"
                                }
                              ]
                            },
                            {
                              "context" : "qty",
                              "contextType" : "variable",
                              "element" : "system",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "http://unitsofmeasure.org"
                                }
                              ]
                            },
                            {
                              "context" : "qty",
                              "contextType" : "variable",
                              "element" : "code",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "h"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }