FHIR © HL7.org  |  Server Home  |  XIG Home  |  Server Source  |  FHIR  

FHIR IG Statistics: StructureMap/ObservationMap

Packagehl7.fhir.uv.omop
TypeStructureMap
IdObservationMap
FHIR VersionR5
Sourcehttp://hl7.org/fhir/uv/omop/https://build.fhir.org/ig/HL7/fhir-omop-ig/StructureMap-ObservationMap.html
URLhttp://hl7.org/fhir/uv/omop/StructureMap/ObservationMap
Version1.0.0-ballot
Statusdraft
Date2025-07-22T19:48:02+00:00
NameObservationMap
TitleMapping Observation resource to Observation OMOP Domain
Realmuv
Authorityhl7
DescriptionThis mapping maps FHIR Observation instances that are NOT considered measurements to OMOP Observation Table objects. Currently, this is done by considering the category code and mapping 'social-history', 'imaging', 'survey', 'exam', 'therapy', 'activity', and 'procedure' Observations.

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 ObservationMap

/// url = 'http://hl7.org/fhir/uv/omop/StructureMap/ObservationMap'
/// name = 'ObservationMap'
/// title = 'Mapping Observation resource to  Observation OMOP Domain'
/// status = 'draft'

uses "http://hl7.org/fhir/StructureDefinition/Observation" alias Observation as source
uses "http://hl7.org/fhir/uv/omop/StructureDefinition/Observation" alias ObsTable as target

group Observe(source src : Observation, target tgt : ObsTable) {
  src where ('social-history' | 'imaging' | 'survey' | 'exam' | 'therapy' | 'activity' | 'procedure').supersetOf(Observation.category.coding.code) then {
    src.code as s -> tgt then {
      s.coding as sc -> tgt then {
        sc.code as a -> tgt.observation_concept_id = a;
      };
    }; // src.id as id -> tgt.observation_id = cast(id, "integer");
    src.effective : dateTime as a ->  tgt.observation_datetime = a,  tgt.observation_date = cast(a, 'date'); // src.subject as s -> tgt then {
    src.effective : instant as einst ->  tgt.observation_datetime = cast(einst, 'dateTime'),  tgt.observation_date = cast(einst, 'date');
    src.effective : Period as s -> tgt then {
      s.start as ss ->  tgt.observation_datetime = cast(ss, 'dateTime'),  tgt.observation_date = cast(ss, 'date');
    };
    src.issued as s where (s.toDate != src.effectiveDate) -> tgt.observation_source_value = cast(s, 'string');
    src.value : Quantity as s -> tgt then {
      s.value as a -> tgt.value_as_number = a;
      s.unit as b -> tgt.unit_concept_id = b;
    }; // src.performer as s -> tgt then {
    src.value : CodeableConcept as s -> tgt then {
      s.coding as sc -> tgt then {
        sc.code as a -> tgt.value_as_concept_id = a;
      };
    };
    src.value : string as b -> tgt.value_as_string = b;
    src.note as d -> tgt.observation_source_value = d;
  } "OnlyObs";
}


Source

{
  "resourceType": "StructureMap",
  "id": "ObservationMap",
  "text": {
    "status": "generated",
    "div": "<!-- snip (see above) -->"
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
      "valueCode": "brr"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
      "valueInteger": 1,
      "_valueInteger": {
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom",
            "valueCanonical": "http://hl7.org/fhir/uv/omop/ImplementationGuide/hl7.fhir.uv.omop"
          }
        ]
      }
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
      "valueCode": "informative",
      "_valueCode": {
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom",
            "valueCanonical": "http://hl7.org/fhir/uv/omop/ImplementationGuide/hl7.fhir.uv.omop"
          }
        ]
      }
    }
  ],
  "url": "http://hl7.org/fhir/uv/omop/StructureMap/ObservationMap",
  "version": "1.0.0-ballot",
  "name": "ObservationMap",
  "title": "Mapping Observation resource to  Observation OMOP Domain",
  "status": "draft",
  "date": "2025-07-22T19:48:02+00:00",
  "publisher": "HL7 International / Biomedical Research and Regulation",
  "contact": [
    {
      "name": "HL7 International / Biomedical Research and Regulation",
      "telecom": [
        {
          "system": "url",
          "value": "http://www.hl7.org/Special/committees/rcrim"
        }
      ]
    }
  ],
  "description": "This mapping maps FHIR Observation instances that are NOT considered measurements to OMOP Observation Table objects.  Currently, this is done by considering the category code and mapping 'social-history', 'imaging', 'survey', 'exam', 'therapy', 'activity', and 'procedure' Observations.",
  "jurisdiction": [
    {
      "coding": [
        {
          "system": "http://unstats.un.org/unsd/methods/m49/m49.htm",
          "code": "001",
          "display": "World"
        }
      ]
    }
  ],
  "structure": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/Observation",
      "mode": "source",
      "alias": "Observation"
    },
    {
      "url": "http://hl7.org/fhir/uv/omop/StructureDefinition/Observation",
      "mode": "target",
      "alias": "ObsTable"
    }
  ],
  "group": [
    {
      "name": "Observe",
      "input": [
        {
          "name": "src",
          "type": "Observation",
          "mode": "source"
        },
        {
          "name": "tgt",
          "type": "ObsTable",
          "mode": "target"
        }
      ],
      "rule": [
        {
          "name": "OnlyObs",
          "source": [
            {
              "context": "src",
              "condition": "('social-history' | 'imaging' | 'survey' | 'exam' | 'therapy' | 'activity' | 'procedure').supersetOf(Observation.category.coding.code)"
            }
          ],
          "rule": [
            {
              "name": "code",
              "source": [
                {
                  "context": "src",
                  "element": "code",
                  "variable": "s"
                }
              ],
              "target": [
                {
                  "transform": "copy",
                  "parameter": [
                    {
                      "valueId": "tgt"
                    }
                  ]
                }
              ],
              "rule": [
                {
                  "name": "coding",
                  "source": [
                    {
                      "context": "s",
                      "element": "coding",
                      "variable": "sc"
                    }
                  ],
                  "target": [
                    {
                      "transform": "copy",
                      "parameter": [
                        {
                          "valueId": "tgt"
                        }
                      ]
                    }
                  ],
                  "rule": [
                    {
                      "name": "code",
                      "source": [
                        {
                          "context": "sc",
                          "element": "code",
                          "variable": "a"
                        }
                      ],
                      "target": [
                        {
                          "context": "tgt",
                          "element": "observation_concept_id",
                          "transform": "copy",
                          "parameter": [
                            {
                              "valueId": "a"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ],
              "documentation": "src.id as id -> tgt.observation_id = cast(id, \"integer\");"
            },
            {
              "name": "effectiveDateTime",
              "source": [
                {
                  "context": "src",
                  "type": "dateTime",
                  "element": "effective",
                  "variable": "a"
                }
              ],
              "target": [
                {
                  "context": "tgt",
                  "element": "observation_datetime",
                  "transform": "copy",
                  "parameter": [
                    {
                      "valueId": "a"
                    }
                  ]
                },
                {
                  "context": "tgt",
                  "element": "observation_date",
                  "transform": "cast",
                  "parameter": [
                    {
                      "valueId": "a"
                    },
                    {
                      "valueString": "date"
                    }
                  ]
                }
              ],
              "documentation": "src.subject as s -> tgt then {"
            },
            {
              "name": "effectiveInstant",
              "source": [
                {
                  "context": "src",
                  "type": "instant",
                  "element": "effective",
                  "variable": "einst"
                }
              ],
              "target": [
                {
                  "context": "tgt",
                  "element": "observation_datetime",
                  "transform": "cast",
                  "parameter": [
                    {
                      "valueId": "einst"
                    },
                    {
                      "valueString": "dateTime"
                    }
                  ]
                },
                {
                  "context": "tgt",
                  "element": "observation_date",
                  "transform": "cast",
                  "parameter": [
                    {
                      "valueId": "einst"
                    },
                    {
                      "valueString": "date"
                    }
                  ]
                }
              ]
            },
            {
              "name": "effectivePeriod",
              "source": [
                {
                  "context": "src",
                  "type": "Period",
                  "element": "effective",
                  "variable": "s"
                }
              ],
              "target": [
                {
                  "transform": "copy",
                  "parameter": [
                    {
                      "valueId": "tgt"
                    }
                  ]
                }
              ],
              "rule": [
                {
                  "name": "start",
                  "source": [
                    {
                      "context": "s",
                      "element": "start",
                      "variable": "ss"
                    }
                  ],
                  "target": [
                    {
                      "context": "tgt",
                      "element": "observation_datetime",
                      "transform": "cast",
                      "parameter": [
                        {
                          "valueId": "ss"
                        },
                        {
                          "valueString": "dateTime"
                        }
                      ]
                    },
                    {
                      "context": "tgt",
                      "element": "observation_date",
                      "transform": "cast",
                      "parameter": [
                        {
                          "valueId": "ss"
                        },
                        {
                          "valueString": "date"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name": "issued",
              "source": [
                {
                  "context": "src",
                  "element": "issued",
                  "variable": "s",
                  "condition": "(s.toDate != src.effectiveDate)"
                }
              ],
              "target": [
                {
                  "context": "tgt",
                  "element": "observation_source_value",
                  "transform": "cast",
                  "parameter": [
                    {
                      "valueId": "s"
                    },
                    {
                      "valueString": "string"
                    }
                  ]
                }
              ]
            },
            {
              "name": "valueQuantity",
              "source": [
                {
                  "context": "src",
                  "type": "Quantity",
                  "element": "value",
                  "variable": "s"
                }
              ],
              "target": [
                {
                  "transform": "copy",
                  "parameter": [
                    {
                      "valueId": "tgt"
                    }
                  ]
                }
              ],
              "rule": [
                {
                  "name": "value",
                  "source": [
                    {
                      "context": "s",
                      "element": "value",
                      "variable": "a"
                    }
                  ],
                  "target": [
                    {
                      "context": "tgt",
                      "element": "value_as_number",
                      "transform": "copy",
                      "parameter": [
                        {
                          "valueId": "a"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name": "unit",
                  "source": [
                    {
                      "context": "s",
                      "element": "unit",
                      "variable": "b"
                    }
                  ],
                  "target": [
                    {
                      "context": "tgt",
                      "element": "unit_concept_id",
                      "transform": "copy",
                      "parameter": [
                        {
                          "valueId": "b"
                        }
                      ]
                    }
                  ]
                }
              ],
              "documentation": "src.performer as s -> tgt then {"
            },
            {
              "name": "valueCodeableConcept",
              "source": [
                {
                  "context": "src",
                  "type": "CodeableConcept",
                  "element": "value",
                  "variable": "s"
                }
              ],
              "target": [
                {
                  "transform": "copy",
                  "parameter": [
                    {
                      "valueId": "tgt"
                    }
                  ]
                }
              ],
              "rule": [
                {
                  "name": "coding",
                  "source": [
                    {
                      "context": "s",
                      "element": "coding",
                      "variable": "sc"
                    }
                  ],
                  "target": [
                    {
                      "transform": "copy",
                      "parameter": [
                        {
                          "valueId": "tgt"
                        }
                      ]
                    }
                  ],
                  "rule": [
                    {
                      "name": "code",
                      "source": [
                        {
                          "context": "sc",
                          "element": "code",
                          "variable": "a"
                        }
                      ],
                      "target": [
                        {
                          "context": "tgt",
                          "element": "value_as_concept_id",
                          "transform": "copy",
                          "parameter": [
                            {
                              "valueId": "a"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name": "valueString",
              "source": [
                {
                  "context": "src",
                  "type": "string",
                  "element": "value",
                  "variable": "b"
                }
              ],
              "target": [
                {
                  "context": "tgt",
                  "element": "value_as_string",
                  "transform": "copy",
                  "parameter": [
                    {
                      "valueId": "b"
                    }
                  ]
                }
              ]
            },
            {
              "name": "note",
              "source": [
                {
                  "context": "src",
                  "element": "note",
                  "variable": "d"
                }
              ],
              "target": [
                {
                  "context": "tgt",
                  "element": "observation_source_value",
                  "transform": "copy",
                  "parameter": [
                    {
                      "valueId": "d"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}