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

## : Sleep Quality Base (WHOQOL-BREF scale to LOINC) - JSON Representation

Active as of 2026-05-28

Raw json | Download

    {
      "resourceType" : "StructureMap",
      "id" : "SleepQualityBase",
      "text" : {
        "status" : "generated",
        "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: StructureMap SleepQualityBase</b></p><a name=\"SleepQualityBase\"> </a><a name=\"hcSleepQualityBase\"> </a><pre class=\"fml\">\r\n<b>map</b><span style=\"color: navy\"> &quot;</span>https://fhir.hl7.at/prenudge/appdata/r4/StructureMap/SleepQualityBase<span style=\"color: navy\">&quot; = &quot;</span>SleepQualityBase<span style=\"color: navy\">&quot;\r\n\r\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Sleep Quality Base (WHOQOL-BREF scale to LOINC)</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>\r\n<b>group </b>SetSleepQualityObservation<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<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-sleep-quality-observation'</span> <i>&quot;SetProfile&quot;</i><span style=\"color: navy\">;</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\">'61987-4'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'My sleep quality was...in past 7 days [PROMIS]'</span><span style=\"color: navy\">)</span> <i>&quot;SetCode&quot;</i><span style=\"color: navy\">;</span>\r\n  src.authored<b> as </b><span style=\"color: maroon\">authored</span><span style=\"color: navy\"><b> -&gt; </b></span> tgt.effectiveDateTime = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'dateTime'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">dt</span><span style=\"color: navy\">, </span> dt.value = <span style=\"color: maroon\">authored</span> <i>&quot;SetEffective&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\">https://loinc.org/61987-4 My sleep quality was...in past 7 days [PROMIS]</span>\r\n<span style=\"color: navy\">// </span><span style=\"color: green\">https://loinc.org/LL1023-2 [PROMIS] Very poor|Poor|Fair|Good|Very good</span>\r\n<b>group </b>MapWhoQolToLoinc<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">coding</span><span style=\"color: navy\"> : </span>Coding, <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>  coding.code<b> as </b><span style=\"color: maroon\">c</span><b> where </b>$this = 'S1'<span style=\"color: navy\"><b> -&gt; </b></span> tgt.value = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'CodeableConcept'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">cc</span><span style=\"color: navy\">, </span> cc.coding = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Coding'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">loinc</span><span style=\"color: navy\">, </span> loinc.system = <span style=\"color: blue\">'http://loinc.org'</span><span style=\"color: navy\">, </span> loinc.code = <span style=\"color: blue\">'LA9615-1'</span><span style=\"color: navy\">, </span> loinc.display = <span style=\"color: blue\">'Very poor'</span> <i>&quot;MapS1&quot;</i><span style=\"color: navy\">;</span>\r\n  coding.code<b> as </b><span style=\"color: maroon\">c</span><b> where </b>$this = 'S2'<span style=\"color: navy\"><b> -&gt; </b></span> tgt.value = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'CodeableConcept'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">cc</span><span style=\"color: navy\">, </span> cc.coding = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Coding'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">loinc</span><span style=\"color: navy\">, </span> loinc.system = <span style=\"color: blue\">'http://loinc.org'</span><span style=\"color: navy\">, </span> loinc.code = <span style=\"color: blue\">'LA8969-3'</span><span style=\"color: navy\">, </span> loinc.display = <span style=\"color: blue\">'Poor'</span> <i>&quot;MapS2&quot;</i><span style=\"color: navy\">;</span>\r\n  coding.code<b> as </b><span style=\"color: maroon\">c</span><b> where </b>$this = 'S3'<span style=\"color: navy\"><b> -&gt; </b></span> tgt.value = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'CodeableConcept'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">cc</span><span style=\"color: navy\">, </span> cc.coding = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Coding'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">loinc</span><span style=\"color: navy\">, </span> loinc.system = <span style=\"color: blue\">'http://loinc.org'</span><span style=\"color: navy\">, </span> loinc.code = <span style=\"color: blue\">'LA8968-5'</span><span style=\"color: navy\">, </span> loinc.display = <span style=\"color: blue\">'Fair'</span> <i>&quot;MapS3&quot;</i><span style=\"color: navy\">;</span>\r\n  coding.code<b> as </b><span style=\"color: maroon\">c</span><b> where </b>$this = 'S4'<span style=\"color: navy\"><b> -&gt; </b></span> tgt.value = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'CodeableConcept'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">cc</span><span style=\"color: navy\">, </span> cc.coding = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Coding'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">loinc</span><span style=\"color: navy\">, </span> loinc.system = <span style=\"color: blue\">'http://loinc.org'</span><span style=\"color: navy\">, </span> loinc.code = <span style=\"color: blue\">'LA8967-7'</span><span style=\"color: navy\">, </span> loinc.display = <span style=\"color: blue\">'Good'</span> <i>&quot;MapS4&quot;</i><span style=\"color: navy\">;</span>\r\n  coding.code<b> as </b><span style=\"color: maroon\">c</span><b> where </b>$this = 'S5'<span style=\"color: navy\"><b> -&gt; </b></span> tgt.value = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'CodeableConcept'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">cc</span><span style=\"color: navy\">, </span> cc.coding = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Coding'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">loinc</span><span style=\"color: navy\">, </span> loinc.system = <span style=\"color: blue\">'http://loinc.org'</span><span style=\"color: navy\">, </span> loinc.code = <span style=\"color: blue\">'LA13913-1'</span><span style=\"color: navy\">, </span> loinc.display = <span style=\"color: blue\">'Very Good'</span> <i>&quot;MapS5&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/SleepQualityBase",
      "version" : "0.1.0",
      "name" : "SleepQualityBase",
      "title" : "Sleep Quality Base (WHOQOL-BREF scale to LOINC)",
      "status" : "active",
      "date" : "2026-05-28T10:55:10+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" : "Sleep Quality Base (WHOQOL-BREF scale to LOINC)",
      "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/*"
      ],
      "group" : [
        {
          "name" : "SetSleepQualityObservation",
          "typeMode" : "none",
          "input" : [
            {
              "name" : "src",
              "type" : "QR",
              "mode" : "source"
            },
            {
              "name" : "tgt",
              "type" : "Obs",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "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-sleep-quality-observation"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "SetCode",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "code",
                  "transform" : "cc",
                  "parameter" : [
                    {
                      "valueString" : "http://loinc.org"
                    },
                    {
                      "valueString" : "61987-4"
                    },
                    {
                      "valueString" : "My sleep quality was...in past 7 days [PROMIS]"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "SetEffective",
              "source" : [
                {
                  "context" : "src",
                  "element" : "authored",
                  "variable" : "authored"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "effectiveDateTime",
                  "variable" : "dt",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "dateTime"
                    }
                  ]
                },
                {
                  "context" : "dt",
                  "contextType" : "variable",
                  "element" : "value",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "authored"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "MapWhoQolToLoinc",
          "typeMode" : "none",
          "documentation" : "https://loinc.org/61987-4 My sleep quality was...in past 7 days [PROMIS]\r\nhttps://loinc.org/LL1023-2 [PROMIS] Very poor|Poor|Fair|Good|Very good",
          "input" : [
            {
              "name" : "coding",
              "type" : "Coding",
              "mode" : "source"
            },
            {
              "name" : "tgt",
              "type" : "Obs",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "MapS1",
              "source" : [
                {
                  "context" : "coding",
                  "element" : "code",
                  "variable" : "c",
                  "condition" : "$this = 'S1'"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "value",
                  "variable" : "cc",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "CodeableConcept"
                    }
                  ]
                },
                {
                  "context" : "cc",
                  "contextType" : "variable",
                  "element" : "coding",
                  "variable" : "loinc",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Coding"
                    }
                  ]
                },
                {
                  "context" : "loinc",
                  "contextType" : "variable",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "http://loinc.org"
                    }
                  ]
                },
                {
                  "context" : "loinc",
                  "contextType" : "variable",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "LA9615-1"
                    }
                  ]
                },
                {
                  "context" : "loinc",
                  "contextType" : "variable",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "Very poor"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "MapS2",
              "source" : [
                {
                  "context" : "coding",
                  "element" : "code",
                  "variable" : "c",
                  "condition" : "$this = 'S2'"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "value",
                  "variable" : "cc",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "CodeableConcept"
                    }
                  ]
                },
                {
                  "context" : "cc",
                  "contextType" : "variable",
                  "element" : "coding",
                  "variable" : "loinc",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Coding"
                    }
                  ]
                },
                {
                  "context" : "loinc",
                  "contextType" : "variable",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "http://loinc.org"
                    }
                  ]
                },
                {
                  "context" : "loinc",
                  "contextType" : "variable",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "LA8969-3"
                    }
                  ]
                },
                {
                  "context" : "loinc",
                  "contextType" : "variable",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "Poor"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "MapS3",
              "source" : [
                {
                  "context" : "coding",
                  "element" : "code",
                  "variable" : "c",
                  "condition" : "$this = 'S3'"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "value",
                  "variable" : "cc",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "CodeableConcept"
                    }
                  ]
                },
                {
                  "context" : "cc",
                  "contextType" : "variable",
                  "element" : "coding",
                  "variable" : "loinc",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Coding"
                    }
                  ]
                },
                {
                  "context" : "loinc",
                  "contextType" : "variable",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "http://loinc.org"
                    }
                  ]
                },
                {
                  "context" : "loinc",
                  "contextType" : "variable",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "LA8968-5"
                    }
                  ]
                },
                {
                  "context" : "loinc",
                  "contextType" : "variable",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "Fair"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "MapS4",
              "source" : [
                {
                  "context" : "coding",
                  "element" : "code",
                  "variable" : "c",
                  "condition" : "$this = 'S4'"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "value",
                  "variable" : "cc",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "CodeableConcept"
                    }
                  ]
                },
                {
                  "context" : "cc",
                  "contextType" : "variable",
                  "element" : "coding",
                  "variable" : "loinc",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Coding"
                    }
                  ]
                },
                {
                  "context" : "loinc",
                  "contextType" : "variable",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "http://loinc.org"
                    }
                  ]
                },
                {
                  "context" : "loinc",
                  "contextType" : "variable",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "LA8967-7"
                    }
                  ]
                },
                {
                  "context" : "loinc",
                  "contextType" : "variable",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "Good"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "MapS5",
              "source" : [
                {
                  "context" : "coding",
                  "element" : "code",
                  "variable" : "c",
                  "condition" : "$this = 'S5'"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "value",
                  "variable" : "cc",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "CodeableConcept"
                    }
                  ]
                },
                {
                  "context" : "cc",
                  "contextType" : "variable",
                  "element" : "coding",
                  "variable" : "loinc",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Coding"
                    }
                  ]
                },
                {
                  "context" : "loinc",
                  "contextType" : "variable",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "http://loinc.org"
                    }
                  ]
                },
                {
                  "context" : "loinc",
                  "contextType" : "variable",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "LA13913-1"
                    }
                  ]
                },
                {
                  "context" : "loinc",
                  "contextType" : "variable",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "Very Good"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }