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

## : Physical Activity Minutes Q to O - TTL Representation

Draft as of 2026-06-25

Raw ttl | Download

    @prefix fhir: <http://hl7.org/fhir/> .
    @prefix owl: <http://www.w3.org/2002/07/owl#> .
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
    @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

    # - resource -------------------------------------------------------------------

     a fhir:StructureMap ;
      fhir:nodeRole fhir:treeRoot ;
      fhir:id [ fhir:v "PhysicalActivityMinutesQtoO"] ; #
      fhir:text [
    fhir:status [ fhir:v "generated" ] ;
    fhir:div [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: StructureMap PhysicalActivityMinutesQtoO</b></p><a name=\"PhysicalActivityMinutesQtoO\"> </a><a name=\"hcPhysicalActivityMinutesQtoO\"> </a><pre class=\"fml\">#xD;\n<b>map</b><span style=\"color: navy\"> \"</span>https://fhir.hl7.at/prenudge/appdata/r4/StructureMap/PhysicalActivityMinutesQtoO<span style=\"color: navy\">\" = \"</span>Physical Activity Minutes Q to O<span style=\"color: navy\">\"#xD;\n#xD;\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Physical Activity EHIS-PAQ Q7 / ATHIS PE7 to O (aggregate-only variant)</span>#xD;\n#xD;\n<b>uses</b><span style=\"color: navy\"> \"</span><a href=\"http://hl7.org/fhir/R4/questionnaireresponse.html\" title=\"QuestionnaireResponse\">http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse</a><span style=\"color: navy\">\" </span><b>alias </b>QR <b>as </b><b>source</b>#xD;\n<b>uses</b><span style=\"color: navy\"> \"</span><a href=\"http://hl7.org/fhir/R4/observation.html\" title=\"Observation\">http://hl7.org/fhir/StructureDefinition/Observation</a><span style=\"color: navy\">\" </span><b>alias </b>Obs <b>as </b><b>target</b>#xD;\n#xD;\n<b>imports</b><span style=\"color: navy\"> \"</span>http://hl7.org/fhir/StructureMap/*<span style=\"color: navy\">\"#xD;\n</span><b>imports</b><span style=\"color: navy\"> \"</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\">\"#xD;\n</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">---------------------------------------------------------------------------</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">Main entry group</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">---------------------------------------------------------------------------</span>#xD;\n<b>group </b>PhysicalActivityQuestionnaireResponseToObservation<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\"> {#xD;\n</span>  <span style=\"color: navy\">// </span><span style=\"color: green\">Shared base: identifier copy, derivedFrom, subject, issued.</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">SetObservationBase also sets method = SCT 87982008 (Manual) — correct for</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">all questionnaire-derived observations in this IG.</span>#xD;\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>\"Base\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">Explicitly confirm method = Manual (base already does this; listed for clarity).</span>#xD;\n  src<span style=\"color: navy\"><b> -&gt; </b></span>tgt.method = <b>cc</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://snomed.info/sct'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'87982008'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'Manual'</span><span style=\"color: navy\">)</span> <i>\"SetMethodManual\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">Target profile</span>#xD;\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-physical-activity-minutes-observation'</span> <i>\"SetProfile\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">Panel code</span>#xD;\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\">'101691-4'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'Duration of physical activity'</span><span style=\"color: navy\">)</span> <i>\"SetCode\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">effectiveDateTime from authored (EHIS-PAQ Q7 has no embedded date item)</span>#xD;\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>\"SetEffectiveDateTime\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">Map Q7 group to component[aggregateActivity]</span>#xD;\n  src.item<b> as </b><span style=\"color: maroon\">q7</span><b> where </b>linkId = 'Q7'<b> then </b>MapQ7ToAggregate<span style=\"color: navy\">(</span><span style=\"color: maroon\">q7</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">tgt</span><span style=\"color: navy\">)</span> <i>\"ProcessQ7\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">component[moderateActivity] : NOT mapped</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">Q7 asks for total leisure activity time without separating intensity levels.</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">There is no questionnaire source for a moderate-only figure.</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">component[vigorousActivity] : NOT mapped</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">Total leisure time maps directly to aggregateActivity (see MapQ7ToAggregate).</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">component[classificationMethod] : NOT mapped</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">method = Manual → component must be absent or self-rp (pa-manual-comp-01).</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">The map does not set it; a consuming system may add self-rp post-transform</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">if explicit documentation of the classification basis is required.</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">---------------------------------------------------------------------------</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">Q7 → component[aggregateActivity]  (LOINC 101691-4)</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">Formula: aggregateMinutes = (Q7-hours × 60) + Q7-minutes</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">This is a direct transcription of the patient-reported total time.</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">No intensity weighting is applied because Q7 does not capture intensity.</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">The ×2 vigorous weighting (WHO/IPAQ) is ONLY applied when a wearable</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">separately measures moderate and vigorous minutes (wearable variant).</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">Note on FML arithmetic / MaLaC-HD compatibility:</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">This map uses evaluate() with integer arithmetic (* 60, +) which is NOT</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">supported by MaLaC-HD 1.6.0. MaLaC-HD fails at parse time with</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">\"Param type 14 not implemented\" (integer literal in FHIRPath expression).</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">The questionnaire captures hours and minutes as separate integer items,</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">so no MaLaC-HD compatible rewrite exists without redesigning the questionnaire</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">or changing the output unit. Use matchbox or another evaluate()-capable engine.</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">---------------------------------------------------------------------------</span>#xD;\n<b>group </b>MapQ7ToAggregate<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\"> {#xD;\n</span>  src<span style=\"color: navy\"><b> -&gt; </b></span>tgt.component<b> as </b><span style=\"color: maroon\">aggComp</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>    <span style=\"color: navy\">// </span><span style=\"color: green\">Component discriminator code: LOINC 101691-4</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Note: same code as panel Observation.code — collision documented in profile.</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">obs-7 is not violated because Observation.value[x] is absent.</span>#xD;\n    src<span style=\"color: navy\"><b> -&gt; </b></span>aggComp.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\">'101691-4'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'Duration of physical activity'</span><span style=\"color: navy\">)</span> <i>\"SetAggregateCode\"</i><span style=\"color: navy\">;</span>#xD;\n    src<span style=\"color: navy\"><b> -&gt; </b></span>aggComp.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><b> then</b><span style=\"color: navy\"> {#xD;\n</span>      <span style=\"color: navy\">// </span><span style=\"color: green\">aggregateMinutes = (Q7-hours × 60) + Q7-minutes</span>#xD;\n      src<span style=\"color: navy\"><b> -&gt; </b></span>qty.value = evaluate<span style=\"color: navy\">(</span>src<span style=\"color: navy\">, </span>(item.where(linkId = 'Q7-hours').answer.valueInteger * 60) + item.where(linkId = 'Q7-minutes').answer.valueInteger<span style=\"color: navy\">)</span> <i>\"ComputeAggregateMinutes\"</i><span style=\"color: navy\">;</span>#xD;\n      src<span style=\"color: navy\"><b> -&gt; </b></span>qty.unit = <span style=\"color: blue\">'min/wk'</span> <i>\"SetUnit\"</i><span style=\"color: navy\">;</span>#xD;\n      src<span style=\"color: navy\"><b> -&gt; </b></span>qty.system = <span style=\"color: blue\">'http://unitsofmeasure.org'</span> <i>\"SetSystem\"</i><span style=\"color: navy\">;</span>#xD;\n      src<span style=\"color: navy\"><b> -&gt; </b></span>qty.code = <span style=\"color: blue\">'min/wk'</span> <i>\"SetUCUM\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"SetAggregateQuantity\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"MapAggregateComponent\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span></pre></div>"^^rdf:XMLLiteral ]
      ] ; #
      fhir:url [ fhir:v "https://fhir.hl7.at/prenudge/appdata/r4/StructureMap/PhysicalActivityMinutesQtoO"^^xsd:anyURI] ; #
      fhir:version [ fhir:v "0.1.0"] ; #
      fhir:name [ fhir:v "Physical Activity Minutes Q to O"] ; #
      fhir:status [ fhir:v "draft"] ; #
      fhir:date [ fhir:v "2026-06-25T12:51:02+00:00"^^xsd:dateTime] ; #
      fhir:publisher [ fhir:v "The PreNUDGE Consortium"] ; #
      fhir:contact ( [
    fhir:name [ fhir:v "The PreNUDGE Consortium" ] ;
        ( fhir:telecom [
    fhir:system [ fhir:v "url" ] ;
    fhir:value [ fhir:v "https://prenudge.at" ]     ] )
      ] [
    fhir:name [ fhir:v "The PreNUDGE Consortium" ] ;
        ( fhir:telecom [
    fhir:system [ fhir:v "url" ] ;
    fhir:value [ fhir:v "https://prenudge.at" ] ;
    fhir:use [ fhir:v "work" ]     ] )
      ] ) ; #
      fhir:description [ fhir:v "Physical Activity EHIS-PAQ Q7 / ATHIS PE7 to O (aggregate-only variant)"] ; #
      fhir:structure ( [
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse"^^xsd:anyURI ;
    fhir:link <http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse>     ] ;
    fhir:mode [ fhir:v "source" ] ;
    fhir:alias [ fhir:v "QR" ]
      ] [
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Observation"^^xsd:anyURI ;
    fhir:link <http://hl7.org/fhir/StructureDefinition/Observation>     ] ;
    fhir:mode [ fhir:v "target" ] ;
    fhir:alias [ fhir:v "Obs" ]
      ] ) ; #
      fhir:import ( [
    fhir:v "http://hl7.org/fhir/StructureMap/*"^^xsd:anyURI ;
    fhir:link <http://hl7.org/fhir/StructureMap/*>
      ] [
    fhir:v "https://fhir.hl7.at/prenudge/appdata/r4/StructureMap/QuestionnaireResponseToObservationBase"^^xsd:anyURI ;
    fhir:link <https://fhir.hl7.at/prenudge/appdata/r4/StructureMap/QuestionnaireResponseToObservationBase>
      ] ) ; #
      fhir:group ( [
    fhir:name [ fhir:v "PhysicalActivityQuestionnaireResponseToObservation" ] ;
    fhir:typeMode [ fhir:v "none" ] ;
    fhir:documentation [ fhir:v "---------------------------------------------------------------------------\r\nMain entry group\r\n---------------------------------------------------------------------------" ] ;
        ( fhir:input [
    fhir:name [ fhir:v "src" ] ;
    fhir:type [ fhir:v "QR" ] ;
    fhir:mode [ fhir:v "source" ]     ] [
    fhir:name [ fhir:v "tgt" ] ;
    fhir:type [ fhir:v "Obs" ] ;
    fhir:mode [ fhir:v "target" ]     ] ) ;
        ( fhir:rule [
    fhir:name [ fhir:v "Base" ] ;
          ( fhir:source [
    fhir:context [ fhir:v "src" ]       ] ) ;
          ( fhir:dependent [
    fhir:name [ fhir:v "SetObservationBase" ] ;
            ( fhir:variable [ fhir:v "src" ] [ fhir:v "tgt" ] )       ] )     ] [
    fhir:name [ fhir:v "SetMethodManual" ] ;
          ( fhir:source [
    fhir:context [ fhir:v "src" ]       ] ) ;
          ( fhir:target [
    fhir:context [ fhir:v "tgt" ] ;
    fhir:contextType [ fhir:v "variable" ] ;
    fhir:element [ fhir:v "method" ] ;
    fhir:transform [ fhir:v "cc" ] ;
            ( fhir:parameter [
    fhir:value [
    a fhir:string ;
    fhir:v "http://snomed.info/sct"           ]         ] [
    fhir:value [
    a fhir:string ;
    fhir:v "87982008"           ]         ] [
    fhir:value [
    a fhir:string ;
    fhir:v "Manual"           ]         ] )       ] )     ] [
    fhir:name [ fhir:v "SetProfile" ] ;
          ( fhir:source [
    fhir:context [ fhir:v "src" ]       ] ) ;
          ( fhir:target [
    fhir:context [ fhir:v "tgt" ] ;
    fhir:contextType [ fhir:v "variable" ] ;
    fhir:element [ fhir:v "meta" ] ;
    fhir:variable [ fhir:v "meta" ] ;
    fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
    fhir:value [
    a fhir:string ;
    fhir:v "Meta"           ]         ] )       ] [
    fhir:context [ fhir:v "meta" ] ;
    fhir:contextType [ fhir:v "variable" ] ;
    fhir:element [ fhir:v "profile" ] ;
    fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
    fhir:value [
    a fhir:string ;
    fhir:v "https://fhir.hl7.at/prenudge/appdata/r4/StructureDefinition/at-prenudge-physical-activity-minutes-observation"           ]         ] )       ] )     ] [
    fhir:name [ fhir:v "SetCode" ] ;
          ( fhir:source [
    fhir:context [ fhir:v "src" ]       ] ) ;
          ( fhir:target [
    fhir:context [ fhir:v "tgt" ] ;
    fhir:contextType [ fhir:v "variable" ] ;
    fhir:element [ fhir:v "code" ] ;
    fhir:transform [ fhir:v "cc" ] ;
            ( fhir:parameter [
    fhir:value [
    a fhir:string ;
    fhir:v "http://loinc.org"           ]         ] [
    fhir:value [
    a fhir:string ;
    fhir:v "101691-4"           ]         ] [
    fhir:value [
    a fhir:string ;
    fhir:v "Duration of physical activity"           ]         ] )       ] )     ] [
    fhir:name [ fhir:v "SetEffectiveDateTime" ] ;
          ( fhir:source [
    fhir:context [ fhir:v "src" ] ;
    fhir:element [ fhir:v "authored" ] ;
    fhir:variable [ fhir:v "authored" ]       ] ) ;
          ( fhir:target [
    fhir:context [ fhir:v "tgt" ] ;
    fhir:contextType [ fhir:v "variable" ] ;
    fhir:element [ fhir:v "effectiveDateTime" ] ;
    fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
    fhir:value [
    a fhir:id ;
    fhir:v "authored"           ]         ] )       ] )     ] [
    fhir:name [ fhir:v "ProcessQ7" ] ;
          ( fhir:source [
    fhir:context [ fhir:v "src" ] ;
    fhir:element [ fhir:v "item" ] ;
    fhir:variable [ fhir:v "q7" ] ;
    fhir:condition [ fhir:v "linkId = 'Q7'" ]       ] ) ;
          ( fhir:dependent [
    fhir:name [ fhir:v "MapQ7ToAggregate" ] ;
            ( fhir:variable [ fhir:v "q7" ] [ fhir:v "tgt" ] )       ] )     ] )
      ] [
    fhir:name [ fhir:v "MapQ7ToAggregate" ] ;
    fhir:typeMode [ fhir:v "none" ] ;
    fhir:documentation [ fhir:v "---------------------------------------------------------------------------\r\nQ7 → component[aggregateActivity]  (LOINC 101691-4)\r\nFormula: aggregateMinutes = (Q7-hours × 60) + Q7-minutes\r\nThis is a direct transcription of the patient-reported total time.\r\nNo intensity weighting is applied because Q7 does not capture intensity.\r\nThe ×2 vigorous weighting (WHO/IPAQ) is ONLY applied when a wearable\r\nseparately measures moderate and vigorous minutes (wearable variant).\r\nNote on FML arithmetic / MaLaC-HD compatibility:\r\nThis map uses evaluate() with integer arithmetic (* 60, +) which is NOT\r\nsupported by MaLaC-HD 1.6.0. MaLaC-HD fails at parse time with\r\n\"Param type 14 not implemented\" (integer literal in FHIRPath expression).\r\nThe questionnaire captures hours and minutes as separate integer items,\r\nso no MaLaC-HD compatible rewrite exists without redesigning the questionnaire\r\nor changing the output unit. Use matchbox or another evaluate()-capable engine.\r\n---------------------------------------------------------------------------" ] ;
        ( fhir:input [
    fhir:name [ fhir:v "src" ] ;
    fhir:type [ fhir:v "QR" ] ;
    fhir:mode [ fhir:v "source" ]     ] [
    fhir:name [ fhir:v "tgt" ] ;
    fhir:type [ fhir:v "Obs" ] ;
    fhir:mode [ fhir:v "target" ]     ] ) ;
        ( fhir:rule [
    fhir:name [ fhir:v "MapAggregateComponent" ] ;
          ( fhir:source [
    fhir:context [ fhir:v "src" ]       ] ) ;
          ( fhir:target [
    fhir:context [ fhir:v "tgt" ] ;
    fhir:contextType [ fhir:v "variable" ] ;
    fhir:element [ fhir:v "component" ] ;
    fhir:variable [ fhir:v "aggComp" ]       ] ) ;
          ( fhir:rule [
    fhir:name [ fhir:v "SetAggregateCode" ] ;
            ( fhir:source [
    fhir:context [ fhir:v "src" ]         ] ) ;
            ( fhir:target [
    fhir:context [ fhir:v "aggComp" ] ;
    fhir:contextType [ fhir:v "variable" ] ;
    fhir:element [ fhir:v "code" ] ;
    fhir:transform [ fhir:v "cc" ] ;
              ( fhir:parameter [
    fhir:value [
    a fhir:string ;
    fhir:v "http://loinc.org"             ]           ] [
    fhir:value [
    a fhir:string ;
    fhir:v "101691-4"             ]           ] [
    fhir:value [
    a fhir:string ;
    fhir:v "Duration of physical activity"             ]           ] )         ] )       ] [
    fhir:name [ fhir:v "SetAggregateQuantity" ] ;
            ( fhir:source [
    fhir:context [ fhir:v "src" ]         ] ) ;
            ( fhir:target [
    fhir:context [ fhir:v "aggComp" ] ;
    fhir:contextType [ fhir:v "variable" ] ;
    fhir:element [ fhir:v "value" ] ;
    fhir:variable [ fhir:v "qty" ] ;
    fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
    fhir:value [
    a fhir:string ;
    fhir:v "Quantity"             ]           ] )         ] ) ;
            ( fhir:rule [
    fhir:name [ fhir:v "ComputeAggregateMinutes" ] ;
              ( fhir:source [
    fhir:context [ fhir:v "src" ]           ] ) ;
              ( fhir:target [
    fhir:context [ fhir:v "qty" ] ;
    fhir:contextType [ fhir:v "variable" ] ;
    fhir:element [ fhir:v "value" ] ;
    fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
    fhir:value [
    a fhir:id ;
    fhir:v "src"               ]             ] [
    fhir:value [
    a fhir:string ;
    fhir:v "(item.where(linkId = 'Q7-hours').answer.valueInteger * 60) + item.where(linkId = 'Q7-minutes').answer.valueInteger"               ]             ] )           ] )         ] [
    fhir:name [ fhir:v "SetUnit" ] ;
              ( fhir:source [
    fhir:context [ fhir:v "src" ]           ] ) ;
              ( fhir:target [
    fhir:context [ fhir:v "qty" ] ;
    fhir:contextType [ fhir:v "variable" ] ;
    fhir:element [ fhir:v "unit" ] ;
    fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
    fhir:value [
    a fhir:string ;
    fhir:v "min/wk"               ]             ] )           ] )         ] [
    fhir:name [ fhir:v "SetSystem" ] ;
              ( fhir:source [
    fhir:context [ fhir:v "src" ]           ] ) ;
              ( fhir:target [
    fhir:context [ fhir:v "qty" ] ;
    fhir:contextType [ fhir:v "variable" ] ;
    fhir:element [ fhir:v "system" ] ;
    fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
    fhir:value [
    a fhir:string ;
    fhir:v "http://unitsofmeasure.org"               ]             ] )           ] )         ] [
    fhir:name [ fhir:v "SetUCUM" ] ;
              ( fhir:source [
    fhir:context [ fhir:v "src" ]           ] ) ;
              ( fhir:target [
    fhir:context [ fhir:v "qty" ] ;
    fhir:contextType [ fhir:v "variable" ] ;
    fhir:element [ fhir:v "code" ] ;
    fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
    fhir:value [
    a fhir:string ;
    fhir:v "min/wk"               ]             ] )           ] )         ] )       ] )     ] )
      ] ) . #