Starter FHIR Implementation Guide
1.0.1 - draft International flag

Starter FHIR Implementation Guide, published by Jembi Health Systems. This guide is not an authorized publication; it is the continuous build for version 1.0.1 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/jembi/Starter-FHIR-IG/ and changes regularly. See the Directory of published versions

: Map Breastfeeding Question to an Observation - TTL Representation

Active as of 2024-12-11

Raw ttl | Download


@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@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 "QRBreastfeedingStatusToObservation"] ; # 
  fhir:text [
fhir:status [ fhir:v "generated" ] ;
fhir:div "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: StructureMap QRBreastfeedingStatusToObservation</b></p><a name=\"QRBreastfeedingStatusToObservation\"> </a><a name=\"hcQRBreastfeedingStatusToObservation\"> </a><a name=\"QRBreastfeedingStatusToObservation-en-US\"> </a><pre class=\"fml\">\r\n<b>map</b><span style=\"color: navy\"> &quot;</span>http://jembi.org/fhir/StructureMap/QRBreastfeedingStatusToObservation<span style=\"color: navy\">&quot; = &quot;</span>QRBreastfeedingStatusToObservation<span style=\"color: navy\">&quot;\r\n\r\n</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>as </b><b>source</b>\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span><a href=\"StructureDefinition-breastfeeding-status-observation.html\" title=\"Observation - Breastfeeding Status\">http://jembi.org/fhir/StructureDefinition/breastfeeding-status-observation</a><span style=\"color: navy\">&quot; </span><b>as </b><b>target</b>\r\n\r\n<b>group </b>QRBreastfeedingStatusToObservation<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>QuestionnaireResponse, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\"> : </span>Observation<span style=\"color: navy\">)</span><span style=\"color: navy\"> {\r\n</span>  src<span style=\"color: navy\"><b> -&gt; </b></span>tgt.id = <b>uuid</b><span style=\"color: navy\">(</span><span style=\"color: navy\">)</span> <i>&quot;SetObservationId&quot;</i><span style=\"color: navy\">;</span>\r\n  src<span style=\"color: navy\"><b> -&gt; </b></span>tgt.meta<b> as </b><span style=\"color: maroon\">meta</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    src<span style=\"color: navy\"><b> -&gt; </b></span>meta.profile = <span style=\"color: blue\">'http://jembi.org/fhir/StructureDefinition/breastfeeding-status-observation'</span> <i>&quot;SetObservationMetaProfile&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;SetObservationMeta&quot;</i><span style=\"color: navy\">;</span>\r\n  src<span style=\"color: navy\"><b> -&gt; </b></span>tgt.status = <span style=\"color: blue\">'final'</span> <i>&quot;SetObservationStatus&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\">'63895-7'</span><span style=\"color: navy\">)</span> <i>&quot;SetObservationCode&quot;</i><span style=\"color: navy\">;</span>\r\n  src<span style=\"color: navy\"><b> -&gt; </b></span> tgt.code<b> as </b><span style=\"color: maroon\">code</span><span style=\"color: navy\">, </span> code.text = <span style=\"color: blue\">'Breastfeeding status'</span> <i>&quot;SetObservationCodeText&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.effective = <span style=\"color: maroon\">authored</span> <i>&quot;SetObservationEffectiveDateTime&quot;</i><span style=\"color: navy\">;</span>\r\n  src<span style=\"color: navy\"><b> -&gt; </b></span>tgt.category = <b>cc</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://terminology.hl7.org/CodeSystem/observation-category'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'exam'</span><span style=\"color: navy\">)</span> <i>&quot;SetObservationCategory&quot;</i><span style=\"color: navy\">;</span>\r\n  src.subject<b> as </b><span style=\"color: maroon\">patient</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.subject = <span style=\"color: maroon\">patient</span> <i>&quot;SetObservationSubjectReference&quot;</i><span style=\"color: navy\">;</span>\r\n  src.author<b> as </b><span style=\"color: maroon\">author</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.performer = <span style=\"color: maroon\">author</span> <i>&quot;SetObservationPerfomerReference&quot;</i><span style=\"color: navy\">;</span>\r\n  src.encounter<b> as </b><span style=\"color: maroon\">encounter</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.encounter = <span style=\"color: maroon\">encounter</span> <i>&quot;SetObservationEncounterReference&quot;</i><span style=\"color: navy\">;</span>\r\n  src.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>(linkId = '1.1')<b> then</b><span style=\"color: navy\"> {\r\n</span>    item.answer first<b> as </b><span style=\"color: maroon\">ans</span><b> then</b><span style=\"color: navy\"> {\r\n</span>      ans.value<span style=\"color: navy\"> : </span>Coding<b> as </b><span style=\"color: maroon\">breastfeeding</span><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\">obsValue</span><b> then</b><span style=\"color: navy\"> {\r\n</span>        breastfeeding<span style=\"color: navy\"><b> -&gt; </b></span>obsValue.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\">coding</span><b> then</b><span style=\"color: navy\"> {\r\n</span>          breastfeeding<span style=\"color: navy\"><b> -&gt; </b></span>coding.system = <b>translate</b><span style=\"color: navy\">(</span><span style=\"color: maroon\">breastfeeding</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'http://jembi.org/fhir/ConceptMap/LOINCCodesToProprietary'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'system'</span><span style=\"color: navy\">)</span> <i>&quot;SetObservationValueCodingSystem&quot;</i><span style=\"color: navy\">;</span>\r\n          breastfeeding<span style=\"color: navy\"><b> -&gt; </b></span>coding.code = <b>translate</b><span style=\"color: navy\">(</span><span style=\"color: maroon\">breastfeeding</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'http://jembi.org/fhir/ConceptMap/LOINCCodesToProprietary'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'code'</span><span style=\"color: navy\">)</span> <i>&quot;SetObservationValueCodingCode&quot;</i><span style=\"color: navy\">;</span>\r\n        <span style=\"color: navy\">}</span> <i>&quot;SetObservationValueCoding&quot;</i><span style=\"color: navy\">;</span>\r\n      <span style=\"color: navy\">}</span><span style=\"color: navy\">;</span>\r\n    <span style=\"color: navy\">}</span><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span></pre></div>"
  ] ; # 
  fhir:url [ fhir:v "http://jembi.org/fhir/StructureMap/QRBreastfeedingStatusToObservation"^^xsd:anyURI] ; # 
  fhir:version [ fhir:v "1.0.1"] ; # 
  fhir:name [ fhir:v "QRBreastfeedingStatusToObservation"] ; # 
  fhir:status [ fhir:v "active"] ; # 
  fhir:date [ fhir:v "2024-12-11T06:22:36+00:00"^^xsd:dateTime] ; # 
  fhir:publisher [ fhir:v "Jembi Health Systems"] ; # 
  fhir:contact ( [
fhir:name [ fhir:v "Jembi Health Systems" ] ;
    ( fhir:telecom [
fhir:system [ fhir:v "url" ] ;
fhir:value [ fhir:v "https://www.jembi.org/" ]     ] [
fhir:system [ fhir:v "email" ] ;
fhir:value [ fhir:v "info@jembi.org" ]     ] )
  ] [
fhir:name [ fhir:v "Richard Langford" ] ;
    ( fhir:telecom [
fhir:system [ fhir:v "email" ] ;
fhir:value [ fhir:v "richard.langford@jembi.org" ] ;
fhir:use [ fhir:v "work" ]     ] )
  ] ) ; # 
  fhir:jurisdiction ( [
    ( fhir:coding [
fhir:system [ fhir:v "http://unstats.un.org/unsd/methods/m49/m49.htm"^^xsd:anyURI ] ;
fhir:code [ fhir:v "001" ] ;
fhir:display [ fhir:v "World" ]     ] )
  ] ) ; # 
  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:url [
fhir:v "http://jembi.org/fhir/StructureDefinition/breastfeeding-status-observation"^^xsd:anyURI ;
fhir:link <http://jembi.org/fhir/StructureDefinition/breastfeeding-status-observation>     ] ;
fhir:mode [ fhir:v "target" ]
  ] ) ; # 
  fhir:group ( [
fhir:name [ fhir:v "QRBreastfeedingStatusToObservation" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "QuestionnaireResponse" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:type [ fhir:v "Observation" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "SetObservationId" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:transform [ fhir:v "uuid" ]       ] )     ] [
fhir:name [ fhir:v "SetObservationMeta" ] ;
      ( 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:rule [
fhir:name [ fhir:v "SetObservationMetaProfile" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "meta" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "profile" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "http://jembi.org/fhir/StructureDefinition/breastfeeding-status-observation" ]           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "SetObservationStatus" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "final" ]         ] )       ] )     ] [
fhir:name [ fhir:v "SetObservationCode" ] ;
      ( 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 [ fhir:v "http://loinc.org" ]         ] [
fhir:value [ fhir:v "63895-7" ]         ] )       ] )     ] [
fhir:name [ fhir:v "SetObservationCodeText" ] ;
      ( 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:variable [ fhir:v "code" ]       ] [
fhir:context [ fhir:v "code" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Breastfeeding status" ]         ] )       ] )     ] [
fhir:name [ fhir:v "SetObservationEffectiveDateTime" ] ;
      ( 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 "effective" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "authored" ]         ] )       ] )     ] [
fhir:name [ fhir:v "SetObservationCategory" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "category" ] ;
fhir:transform [ fhir:v "cc" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "http://terminology.hl7.org/CodeSystem/observation-category" ]         ] [
fhir:value [ fhir:v "exam" ]         ] )       ] )     ] [
fhir:name [ fhir:v "SetObservationSubjectReference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "patient" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "patient" ]         ] )       ] )     ] [
fhir:name [ fhir:v "SetObservationPerfomerReference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "author" ] ;
fhir:variable [ fhir:v "author" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "performer" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "author" ]         ] )       ] )     ] [
fhir:name [ fhir:v "SetObservationEncounterReference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "encounter" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "encounter" ]         ] )       ] )     ] [
fhir:name [ fhir:v "item" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "item" ] ;
fhir:variable [ fhir:v "item" ] ;
fhir:condition [ fhir:v "(linkId = '1.1')" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "answer" ] ;
        ( fhir:source [
fhir:context [ fhir:v "item" ] ;
fhir:element [ fhir:v "answer" ] ;
fhir:listMode [ fhir:v "first" ] ;
fhir:variable [ fhir:v "ans" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "valueCoding" ] ;
          ( fhir:source [
fhir:context [ fhir:v "ans" ] ;
fhir:type [ fhir:v "Coding" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "breastfeeding" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "obsValue" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "SetObservationValueCoding" ] ;
            ( fhir:source [
fhir:context [ fhir:v "breastfeeding" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "obsValue" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Coding" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "SetObservationValueCodingSystem" ] ;
              ( fhir:source [
fhir:context [ fhir:v "breastfeeding" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "breastfeeding" ]                 ] [
fhir:value [ fhir:v "http://jembi.org/fhir/ConceptMap/LOINCCodesToProprietary" ]                 ] [
fhir:value [ fhir:v "system" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "SetObservationValueCodingCode" ] ;
              ( fhir:source [
fhir:context [ fhir:v "breastfeeding" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "translate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "breastfeeding" ]                 ] [
fhir:value [ fhir:v "http://jembi.org/fhir/ConceptMap/LOINCCodesToProprietary" ]                 ] [
fhir:value [ fhir:v "code" ]                 ] )               ] )             ] )           ] )         ] )       ] )     ] )
  ] ) . #