Ethiopia FHIR Implementation Guide - HIV Treatment & Care Services
1.0.1 - ci-build Ethiopia flag

Ethiopia FHIR Implementation Guide - HIV Treatment & Care Services, 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/ethiopia-hiv/ and changes regularly. See the Directory of published versions

: Map Pregnancy Status Question to an Observation - JSON Representation

Draft as of 2024-10-14

Raw json | Download

{
  "resourceType" : "StructureMap",
  "id" : "PregnancyStatusToObservation",
  "text" : {
    "status" : "generated",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: StructureMap PregnancyStatusToObservation</b></p><a name=\"PregnancyStatusToObservation\"> </a><a name=\"hcPregnancyStatusToObservation\"> </a><a name=\"PregnancyStatusToObservation-en-US\"> </a><pre class=\"fml\">\r\n<b>map</b><span style=\"color: navy\"> &quot;</span>http://moh.gov.et/fhir/hiv/StructureMap/PregnancyStatusToObservation<span style=\"color: navy\">&quot; = &quot;</span>PregnancyStatusToObservation<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-pregnancy-status-observation.html\" title=\"Observation - Pregnancy Status Reported\">http://moh.gov.et/fhir/hiv/StructureDefinition/pregnancy-status-observation</a><span style=\"color: navy\">&quot; </span><b>as </b><b>target</b>\r\n\r\n<b>group </b>PregnancyStatusToObservation<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.status = <span style=\"color: blue\">'final'</span> <i>&quot;SetStatusCodeValue&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\">'11449-6'</span><span style=\"color: navy\">)</span> <i>&quot;SetCodeCodeableConcept&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 = <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\">observationDate</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    authored<b> as </b><span style=\"color: maroon\">authoredDate</span><span style=\"color: navy\"><b> -&gt; </b></span>observationDate = <span style=\"color: maroon\">authoredDate</span> <i>&quot;SetObservationDate&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;ProcessObservationDate&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://hl7.org/fhir/observation-category'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'exam'</span><span style=\"color: navy\">)</span> <i>&quot;SetCategoryCodeableConcept&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 = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Reference'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">subject</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    patient<b> as </b><span style=\"color: maroon\">pat</span><span style=\"color: navy\"><b> -&gt; </b></span>subject.reference = <span style=\"color: maroon\">pat</span> <i>&quot;SetPatientReference&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;ProcessPatientReference&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 = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Reference'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">performer</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    author<b> as </b><span style=\"color: maroon\">auth</span><span style=\"color: navy\"><b> -&gt; </b></span>performer.reference = <span style=\"color: maroon\">auth</span> <i>&quot;SetAuthorReference&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;ProcessAuthorReference&quot;</i><span style=\"color: navy\">;</span>\r\n  src.encounter<b> as </b><span style=\"color: maroon\">QREncounter</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.encounter = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Reference'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">ObsEncounter</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    QREncounter<b> as </b><span style=\"color: maroon\">enc</span><span style=\"color: navy\"><b> -&gt; </b></span>ObsEncounter.reference = <span style=\"color: maroon\">enc</span> <i>&quot;SetEncounterReference&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;ProcessAuthorReference&quot;</i><span style=\"color: navy\">;</span>\r\n  src.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>(linkId = 'pregnant')<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\">pregnancyStatus</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\">pregnancyStatusValue</span><b> then</b><span style=\"color: navy\"> {\r\n</span>        pregnancyStatus<span style=\"color: navy\"><b> -&gt; </b></span>pregnancyStatusValue = <b>translate</b><span style=\"color: navy\">(</span><span style=\"color: maroon\">pregnancyStatus</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'http://moh.gov.et/fhir/hiv/ConceptMap/LOINCCodesToProprietary'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'code'</span><span style=\"color: navy\">)</span> <i>&quot;SetPregnancyStatusCoding&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>"
  },
  "url" : "http://moh.gov.et/fhir/hiv/StructureMap/PregnancyStatusToObservation",
  "version" : "1.0.1",
  "name" : "PregnancyStatusToObservation",
  "status" : "draft",
  "date" : "2024-10-14T10:58:37+00:00",
  "publisher" : "Jembi Health Systems",
  "contact" : [
    {
      "name" : "Jembi Health Systems",
      "telecom" : [
        {
          "system" : "url",
          "value" : "https://www.jembi.org"
        },
        {
          "system" : "email",
          "value" : "info@jembi.org"
        }
      ]
    },
    {
      "name" : "Jembi Health Systems",
      "telecom" : [
        {
          "system" : "email",
          "value" : "info@jembi.org",
          "use" : "work"
        }
      ]
    }
  ],
  "jurisdiction" : [
    {
      "coding" : [
        {
          "system" : "urn:iso:std:iso:3166",
          "code" : "ET",
          "display" : "Ethiopia"
        }
      ]
    }
  ],
  "structure" : [
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse",
      "mode" : "source"
    },
    {
      "url" : "http://moh.gov.et/fhir/hiv/StructureDefinition/pregnancy-status-observation",
      "mode" : "target"
    }
  ],
  "group" : [
    {
      "name" : "PregnancyStatusToObservation",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "src",
          "type" : "QuestionnaireResponse",
          "mode" : "source"
        },
        {
          "name" : "tgt",
          "type" : "Observation",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "SetObservationId",
          "source" : [
            {
              "context" : "src"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "id",
              "transform" : "uuid"
            }
          ]
        },
        {
          "name" : "SetStatusCodeValue",
          "source" : [
            {
              "context" : "src"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "status",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "final"
                }
              ]
            }
          ]
        },
        {
          "name" : "SetCodeCodeableConcept",
          "source" : [
            {
              "context" : "src"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "code",
              "transform" : "cc",
              "parameter" : [
                {
                  "valueString" : "http://loinc.org"
                },
                {
                  "valueString" : "11449-6"
                }
              ]
            }
          ]
        },
        {
          "name" : "ProcessObservationDate",
          "source" : [
            {
              "context" : "src",
              "element" : "authored",
              "variable" : "authored"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "effective",
              "variable" : "observationDate",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "dateTime"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "SetObservationDate",
              "source" : [
                {
                  "context" : "authored",
                  "variable" : "authoredDate"
                }
              ],
              "target" : [
                {
                  "context" : "observationDate",
                  "contextType" : "variable",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "authoredDate"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "SetCategoryCodeableConcept",
          "source" : [
            {
              "context" : "src"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "category",
              "transform" : "cc",
              "parameter" : [
                {
                  "valueString" : "http://hl7.org/fhir/observation-category"
                },
                {
                  "valueString" : "exam"
                }
              ]
            }
          ]
        },
        {
          "name" : "ProcessPatientReference",
          "source" : [
            {
              "context" : "src",
              "element" : "subject",
              "variable" : "patient"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "subject",
              "variable" : "subject",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "SetPatientReference",
              "source" : [
                {
                  "context" : "patient",
                  "variable" : "pat"
                }
              ],
              "target" : [
                {
                  "context" : "subject",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "pat"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "ProcessAuthorReference",
          "source" : [
            {
              "context" : "src",
              "element" : "author",
              "variable" : "author"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "performer",
              "variable" : "performer",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "SetAuthorReference",
              "source" : [
                {
                  "context" : "author",
                  "variable" : "auth"
                }
              ],
              "target" : [
                {
                  "context" : "performer",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "auth"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "ProcessAuthorReference",
          "source" : [
            {
              "context" : "src",
              "element" : "encounter",
              "variable" : "QREncounter"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "encounter",
              "variable" : "ObsEncounter",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "SetEncounterReference",
              "source" : [
                {
                  "context" : "QREncounter",
                  "variable" : "enc"
                }
              ],
              "target" : [
                {
                  "context" : "ObsEncounter",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "enc"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "item",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "item",
              "condition" : "(linkId = 'pregnant')"
            }
          ],
          "rule" : [
            {
              "name" : "answer",
              "source" : [
                {
                  "context" : "item",
                  "element" : "answer",
                  "listMode" : "first",
                  "variable" : "ans"
                }
              ],
              "rule" : [
                {
                  "name" : "valueCoding",
                  "source" : [
                    {
                      "context" : "ans",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "pregnancyStatus"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgt",
                      "contextType" : "variable",
                      "element" : "value",
                      "variable" : "pregnancyStatusValue",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "CodeableConcept"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "SetPregnancyStatusCoding",
                      "source" : [
                        {
                          "context" : "pregnancyStatus"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "pregnancyStatusValue",
                          "contextType" : "variable",
                          "transform" : "translate",
                          "parameter" : [
                            {
                              "valueId" : "pregnancyStatus"
                            },
                            {
                              "valueString" : "http://moh.gov.et/fhir/hiv/ConceptMap/LOINCCodesToProprietary"
                            },
                            {
                              "valueString" : "code"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}