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

FHIR IG Statistics: StructureMap/AllergyMap

Packagehl7.fhir.uv.omop
TypeStructureMap
IdAllergyMap
FHIR VersionR5
Sourcehttp://hl7.org/fhir/uv/omop/https://build.fhir.org/ig/HL7/fhir-omop-ig/StructureMap-AllergyMap.html
URLhttp://hl7.org/fhir/uv/omop/StructureMap/AllergyMap
Version1.0.0-ballot
Statusdraft
Date2025-07-22T19:48:02+00:00
NameAllergyMap
TitleMapping Allergy resource to Observation OMOP Domain
Realmuv
Authorityhl7
DescriptionThis mapping maps FHIR AllergyIntolerance instances to OMOP Observation Table objects.

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 AllergyMap

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

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

group Observation(source src : Allergy, target tgt : ObservationTable) {
  src.code as s -> tgt then {
    s.coding as sc -> tgt then {
      sc.code ->  tgt.observation_concept_id,  tgt.observation_source_value,  tgt.observation_source_concept_id;
    };
  }; // src.id as id -> tgt.observation_id = cast(id, "integer");
  src.onset : dateTime as osd ->  tgt.observation_date = cast(osd, 'date'),  tgt.observation_datetime = osd; // src.patient as s -> tgt then {
  src.reaction as s -> tgt then {
    s.manifestation as sman -> tgt then {
      sman.concept as smanc -> tgt then {
        smanc.coding as sc -> tgt then {
          sc.code ->  tgt.value_as_concept_id,  tgt.value_source_value;
        };
      };
    };
  };
}


Source

{
  "resourceType": "StructureMap",
  "id": "AllergyMap",
  "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/AllergyMap",
  "version": "1.0.0-ballot",
  "name": "AllergyMap",
  "title": "Mapping Allergy 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 AllergyIntolerance instances to OMOP Observation Table objects.",
  "jurisdiction": [
    {
      "coding": [
        {
          "system": "http://unstats.un.org/unsd/methods/m49/m49.htm",
          "code": "001",
          "display": "World"
        }
      ]
    }
  ],
  "structure": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/AllergyIntolerance",
      "mode": "source",
      "alias": "Allergy"
    },
    {
      "url": "http://hl7.org/fhir/uv/omop/StructureDefinition/Observation",
      "mode": "target",
      "alias": "ObservationTable"
    }
  ],
  "group": [
    {
      "name": "Observation",
      "input": [
        {
          "name": "src",
          "type": "Allergy",
          "mode": "source"
        },
        {
          "name": "tgt",
          "type": "ObservationTable",
          "mode": "target"
        }
      ],
      "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"
                    }
                  ],
                  "target": [
                    {
                      "context": "tgt",
                      "element": "observation_concept_id"
                    },
                    {
                      "context": "tgt",
                      "element": "observation_source_value"
                    },
                    {
                      "context": "tgt",
                      "element": "observation_source_concept_id"
                    }
                  ]
                }
              ]
            }
          ],
          "documentation": "src.id as id -> tgt.observation_id = cast(id, \"integer\");"
        },
        {
          "name": "onsetDateTime",
          "source": [
            {
              "context": "src",
              "type": "dateTime",
              "element": "onset",
              "variable": "osd"
            }
          ],
          "target": [
            {
              "context": "tgt",
              "element": "observation_date",
              "transform": "cast",
              "parameter": [
                {
                  "valueId": "osd"
                },
                {
                  "valueString": "date"
                }
              ]
            },
            {
              "context": "tgt",
              "element": "observation_datetime",
              "transform": "copy",
              "parameter": [
                {
                  "valueId": "osd"
                }
              ]
            }
          ],
          "documentation": "src.patient as s -> tgt then {"
        },
        {
          "name": "reaction",
          "source": [
            {
              "context": "src",
              "element": "reaction",
              "variable": "s"
            }
          ],
          "target": [
            {
              "transform": "copy",
              "parameter": [
                {
                  "valueId": "tgt"
                }
              ]
            }
          ],
          "rule": [
            {
              "name": "manifestation",
              "source": [
                {
                  "context": "s",
                  "element": "manifestation",
                  "variable": "sman"
                }
              ],
              "target": [
                {
                  "transform": "copy",
                  "parameter": [
                    {
                      "valueId": "tgt"
                    }
                  ]
                }
              ],
              "rule": [
                {
                  "name": "concept",
                  "source": [
                    {
                      "context": "sman",
                      "element": "concept",
                      "variable": "smanc"
                    }
                  ],
                  "target": [
                    {
                      "transform": "copy",
                      "parameter": [
                        {
                          "valueId": "tgt"
                        }
                      ]
                    }
                  ],
                  "rule": [
                    {
                      "name": "coding",
                      "source": [
                        {
                          "context": "smanc",
                          "element": "coding",
                          "variable": "sc"
                        }
                      ],
                      "target": [
                        {
                          "transform": "copy",
                          "parameter": [
                            {
                              "valueId": "tgt"
                            }
                          ]
                        }
                      ],
                      "rule": [
                        {
                          "name": "code",
                          "source": [
                            {
                              "context": "sc",
                              "element": "code"
                            }
                          ],
                          "target": [
                            {
                              "context": "tgt",
                              "element": "value_as_concept_id"
                            },
                            {
                              "context": "tgt",
                              "element": "value_source_value"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}