# Mapping Observation laboratory resources to Measurement OMOP Domain - Data Management with FHIR v0.1.0

* [**Table of Contents**](toc.md)
* [**Artifacts Summary**](artifacts.md)
* **Mapping Observation laboratory resources to Measurement OMOP Domain**

## StructureMap: Mapping Observation laboratory resources to Measurement OMOP Domain 

| | |
| :--- | :--- |
| *Official URL*:https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreFHIR2OMOPMeasurement | *Version*:0.1.0 |
| Draft as of 2025-10-23 | *Computable Name*:CoreFHIR2OMOPMeasurement |

 
Mapping Observation laboratory resources to Measurement OMOP Domain 

```

map "https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreFHIR2OMOPMeasurement" = "CoreFHIR2OMOPMeasurement"

// Mapping Observation laboratory resources to Measurement OMOP Domain

uses "http://hl7.org/fhir/StructureDefinition/Observation" alias LabObs as source
uses "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/LogicalBundle" alias LogicalBundle as target
uses "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/OMOPMeasurement" alias MeasurementTable as target

imports "https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreSimpleObservation2OMOPMeasurement"

// imports "https://interop.aphp.fr/ig/fhir/dm/StructureMap/ComplexMeasurement"
// imports "https://interop.aphp.fr/ig/fhir/dm/StructureMap/*Measurement"
group Observation(source src : LabObs, target tgtBundle : LogicalBundle) {
  src -> tgtBundle.logicalId = uuid() "setId";
  src -> tgtBundle.type = 'transaction' "setType";
  src where code.coding.code in ('14682-9' | '22664-7' | '77147-7') -> tgtBundle.entry as newEntry then {
    src -> newEntry.measurement = create('MeasurementTable') as newMeasurement then {
      src then SimpleObservation(src, newMeasurement) "transformSimpleObservation";
    } "createSimpleObservation";
  } "newEntrySimpleObservation";
// src where code.coding.code in ('50197-3') -> tgtBundle.entry as newEntry then {         src -> newEntry.measurement = create("MeasurementTable") as newMeasurement then {             src then ComplexMeasurement(src, newMeasurement) "transformComplexMeasurement";         } "createComplexMeasurement";     } "newEntryComplexMeasurement";
}


```



## Resource Content

```json
{
  "resourceType" : "StructureMap",
  "id" : "CoreFHIR2OMOPMeasurement",
  "url" : "https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreFHIR2OMOPMeasurement",
  "version" : "0.1.0",
  "name" : "CoreFHIR2OMOPMeasurement",
  "title" : "Mapping Observation laboratory resources to Measurement OMOP Domain",
  "status" : "draft",
  "date" : "2025-10-23T20:49:03+00:00",
  "publisher" : "AP-HP",
  "contact" : [
    {
      "name" : "AP-HP",
      "telecom" : [
        {
          "system" : "url",
          "value" : "https://aphp.fr"
        }
      ]
    }
  ],
  "description" : "Mapping Observation laboratory resources to Measurement OMOP Domain",
  "jurisdiction" : [
    {
      "coding" : [
        {
          "system" : "urn:iso:std:iso:3166",
          "code" : "FR",
          "display" : "France"
        }
      ]
    }
  ],
  "structure" : [
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/Observation",
      "mode" : "source",
      "alias" : "LabObs"
    },
    {
      "url" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/LogicalBundle",
      "mode" : "target",
      "alias" : "LogicalBundle"
    },
    {
      "url" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/OMOPMeasurement",
      "mode" : "target",
      "alias" : "MeasurementTable"
    }
  ],
  "import" : [
    "https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreSimpleObservation2OMOPMeasurement"
  ],
  "group" : [
    {
      "name" : "Observation",
      "typeMode" : "none",
      "documentation" : "imports \"https://interop.aphp.fr/ig/fhir/dm/StructureMap/ComplexMeasurement\"\r\nimports \"https://interop.aphp.fr/ig/fhir/dm/StructureMap/*Measurement\"",
      "input" : [
        {
          "name" : "src",
          "type" : "LabObs",
          "mode" : "source"
        },
        {
          "name" : "tgtBundle",
          "type" : "LogicalBundle",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "setId",
          "source" : [
            {
              "context" : "src"
            }
          ],
          "target" : [
            {
              "context" : "tgtBundle",
              "contextType" : "variable",
              "element" : "logicalId",
              "transform" : "uuid"
            }
          ]
        },
        {
          "name" : "setType",
          "source" : [
            {
              "context" : "src"
            }
          ],
          "target" : [
            {
              "context" : "tgtBundle",
              "contextType" : "variable",
              "element" : "type",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "transaction"
                }
              ]
            }
          ]
        },
        {
          "name" : "newEntrySimpleObservation",
          "source" : [
            {
              "context" : "src",
              "condition" : "code.coding.code in ('14682-9' | '22664-7' | '77147-7')"
            }
          ],
          "target" : [
            {
              "context" : "tgtBundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "newEntry"
            }
          ],
          "rule" : [
            {
              "name" : "createSimpleObservation",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "newEntry",
                  "contextType" : "variable",
                  "element" : "measurement",
                  "variable" : "newMeasurement",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "MeasurementTable"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "transformSimpleObservation",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "SimpleObservation",
                      "variable" : ["src", "newMeasurement"]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

```
