FHIR © HL7.org  |  FHIRsmith 4.0.1  |  Server Home  |  XIG Home  |  XIG Stats  | 

FHIR IG analytics

Packageethiopia.fhir.hiv
Resource TypeStructureMap
IdStructureMap-PregnancyFuturePlansToObservation.json
FHIR VersionR4
Sourcehttps://build.fhir.org/ig/jembi/ethiopia-hiv/StructureMap-PregnancyFuturePlansToObservation.html
URLhttp://moh.gov.et/fhir/hiv/StructureMap/PregnancyFuturePlansToObservation
Version1.0.1
Statusdraft
Date2026-02-09T05:22:58+00:00
NamePregnancyFuturePlansToObservation

Resources that use this resource

No resources found


Resources that this resource uses

No resources found


Narrative

Note: links and images are rebased to the (stated) source

Generated Narrative: StructureMap PregnancyFuturePlansToObservation

map "http://moh.gov.et/fhir/hiv/StructureMap/PregnancyFuturePlansToObservation" = "PregnancyFuturePlansToObservation"

uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" as source
uses "http://moh.gov.et/fhir/hiv/StructureDefinition/future-pregnancy-plans-observation" as target

group PregnancyFuturePlansToObservation(source src : QuestionnaireResponse, target tgt : Observation) {
  src -> tgt.id = uuid() "SetObservationId";
  src -> tgt.status = 'final' "SetStatusCodeValue";
  src -> tgt.code = cc('http://loinc.org', '86645-9') "SetCodeCodeableConcept";
  src.authored as authored -> tgt.effective = create('dateTime') as observationDate then {
    authored as authoredDate -> observationDate = authoredDate "SetObservationDate";
  } "ProcessObservationDate";
  src -> tgt.category = cc('http://hl7.org/fhir/observation-category', 'exam') "SetCategoryCodeableConcept";
  src.subject as patient -> tgt.subject = create('Reference') as subject then {
    patient as pat -> subject.reference = pat "SetPatientReference";
  } "ProcessPatientReference";
  src.author as author -> tgt.performer = create('Reference') as performer then {
    author as auth -> performer.reference = auth "SetAuthorReference";
  } "ProcessAuthorReference";
  src.encounter as QREncounter -> tgt.encounter = create('Reference') as ObsEncounter then {
    QREncounter as enc -> ObsEncounter.reference = enc "SetEncounterReference";
  } "ProcessAuthorReference";
  src.item as item where (linkId = 'want-to-be-pregnant') then {
    item.answer first as ans then {
      ans.value : Coding as futurePregnancyPlans -> tgt.value = create('CodeableConcept') as futurePregnancyPlansValue then {
        futurePregnancyPlans -> futurePregnancyPlansValue = translate(futurePregnancyPlans, 'http://moh.gov.et/fhir/hiv/ConceptMap/LOINCCodesToProprietary', 'code') "SetFuturePregnancyPlansCoding";
      };
    };
  };
}


Source1

{
  "resourceType": "StructureMap",
  "id": "PregnancyFuturePlansToObservation",
  "text": {
    "status": "generated",
    "div": "<!-- snip (see above) -->"
  },
  "url": "http://moh.gov.et/fhir/hiv/StructureMap/PregnancyFuturePlansToObservation",
  "version": "1.0.1",
  "name": "PregnancyFuturePlansToObservation",
  "status": "draft",
  "date": "2026-02-09T05:22:58+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/future-pregnancy-plans-observation",
      "mode": "target"
    }
  ],
  "group": [
    {
      "name": "PregnancyFuturePlansToObservation",
      "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": "86645-9"
                }
              ]
            }
          ]
        },
        {
          "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 = 'want-to-be-pregnant')"
            }
          ],
          "rule": [
            {
              "name": "answer",
              "source": [
                {
                  "context": "item",
                  "element": "answer",
                  "listMode": "first",
                  "variable": "ans"
                }
              ],
              "rule": [
                {
                  "name": "valueCoding",
                  "source": [
                    {
                      "context": "ans",
                      "type": "Coding",
                      "element": "value",
                      "variable": "futurePregnancyPlans"
                    }
                  ],
                  "target": [
                    {
                      "context": "tgt",
                      "contextType": "variable",
                      "element": "value",
                      "variable": "futurePregnancyPlansValue",
                      "transform": "create",
                      "parameter": [
                        {
                          "valueString": "CodeableConcept"
                        }
                      ]
                    }
                  ],
                  "rule": [
                    {
                      "name": "SetFuturePregnancyPlansCoding",
                      "source": [
                        {
                          "context": "futurePregnancyPlans"
                        }
                      ],
                      "target": [
                        {
                          "context": "futurePregnancyPlansValue",
                          "contextType": "variable",
                          "transform": "translate",
                          "parameter": [
                            {
                              "valueId": "futurePregnancyPlans"
                            },
                            {
                              "valueString": "http://moh.gov.et/fhir/hiv/ConceptMap/LOINCCodesToProprietary"
                            },
                            {
                              "valueString": "code"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}