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

FHIR IG Statistics: StructureMap/EncounterVisitMap

Packagehl7.fhir.uv.omop
Resource TypeStructureMap
IdEncounterVisitMap
FHIR VersionR5
Sourcehttp://hl7.org/fhir/uv/omop/https://build.fhir.org/ig/HL7/fhir-omop-ig/StructureMap-EncounterVisitMap.html
URLhttp://hl7.org/fhir/uv/omop/StructureMap/EncounterVisitMap
Version1.0.0-ballot
Statusdraft
Date2025-07-29T17:40:15+00:00
NameEncounterVisitMap
TitleMapping Encounter resource to VisitOccurrence OMOP Domain
Realmuv
Authorityhl7
DescriptionThis mapping maps FHIR Encounter instances to OMOP Visit Occurence 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 EncounterVisitMap

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

uses "http://hl7.org/fhir/StructureDefinition/Encounter" alias Encounter as source
uses "http://hl7.org/fhir/uv/omop/StructureDefinition/VisitOccurrence" alias VisitTable as target

group VisitOccurrence(source src : Encounter, target tgt : VisitTable) {
  src.class as s -> tgt then {
    s.coding as sc -> tgt then {
      sc.code as a ->  tgt.visit_concept_id = a,  tgt.visit_source_value = a,  tgt.visit_source_concept_id = a;
    };
  }; // src.id as id -> tgt.visit_occurrence_id = cast(id, "integer");
  src.actualPeriod as s -> tgt then {
    s.start as std ->  tgt.visit_start_date = cast(std, 'date'),  tgt.visit_start_datetime = std;
    s.end as ed ->  tgt.visit_end_date = cast(ed, 'date'),  tgt.visit_end_datetime = ed;
  };
  src.admission as s -> tgt then {
    s.admitSource as sa -> tgt then {
      sa.coding as sc -> tgt then {
        sc.code as code ->  tgt.admitted_from_concept_id = code,  tgt.admitted_from_source_value = code;
      };
    };
    s.dischargeDisposition as sd -> tgt then {
      sd.coding as sc -> tgt then {
        sc.code as code ->  tgt.discharged_to_concept_id = code,  tgt.discharged_to_source_value = code;
      };
    };
  };
}


Source

{
  "resourceType": "StructureMap",
  "id": "EncounterVisitMap",
  "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/EncounterVisitMap",
  "version": "1.0.0-ballot",
  "name": "EncounterVisitMap",
  "title": "Mapping Encounter resource to VisitOccurrence OMOP Domain",
  "status": "draft",
  "date": "2025-07-29T17:40:15+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 Encounter instances to OMOP Visit Occurence 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/Encounter",
      "mode": "source",
      "alias": "Encounter"
    },
    {
      "url": "http://hl7.org/fhir/uv/omop/StructureDefinition/VisitOccurrence",
      "mode": "target",
      "alias": "VisitTable"
    }
  ],
  "group": [
    {
      "name": "VisitOccurrence",
      "input": [
        {
          "name": "src",
          "type": "Encounter",
          "mode": "source"
        },
        {
          "name": "tgt",
          "type": "VisitTable",
          "mode": "target"
        }
      ],
      "rule": [
        {
          "name": "class",
          "source": [
            {
              "context": "src",
              "element": "class",
              "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": "visit_concept_id",
                      "transform": "copy",
                      "parameter": [
                        {
                          "valueId": "a"
                        }
                      ]
                    },
                    {
                      "context": "tgt",
                      "element": "visit_source_value",
                      "transform": "copy",
                      "parameter": [
                        {
                          "valueId": "a"
                        }
                      ]
                    },
                    {
                      "context": "tgt",
                      "element": "visit_source_concept_id",
                      "transform": "copy",
                      "parameter": [
                        {
                          "valueId": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "documentation": "src.id as id -> tgt.visit_occurrence_id = cast(id, \"integer\");"
        },
        {
          "name": "actualPeriod",
          "source": [
            {
              "context": "src",
              "element": "actualPeriod",
              "variable": "s"
            }
          ],
          "target": [
            {
              "transform": "copy",
              "parameter": [
                {
                  "valueId": "tgt"
                }
              ]
            }
          ],
          "rule": [
            {
              "name": "start",
              "source": [
                {
                  "context": "s",
                  "element": "start",
                  "variable": "std"
                }
              ],
              "target": [
                {
                  "context": "tgt",
                  "element": "visit_start_date",
                  "transform": "cast",
                  "parameter": [
                    {
                      "valueId": "std"
                    },
                    {
                      "valueString": "date"
                    }
                  ]
                },
                {
                  "context": "tgt",
                  "element": "visit_start_datetime",
                  "transform": "copy",
                  "parameter": [
                    {
                      "valueId": "std"
                    }
                  ]
                }
              ]
            },
            {
              "name": "end",
              "source": [
                {
                  "context": "s",
                  "element": "end",
                  "variable": "ed"
                }
              ],
              "target": [
                {
                  "context": "tgt",
                  "element": "visit_end_date",
                  "transform": "cast",
                  "parameter": [
                    {
                      "valueId": "ed"
                    },
                    {
                      "valueString": "date"
                    }
                  ]
                },
                {
                  "context": "tgt",
                  "element": "visit_end_datetime",
                  "transform": "copy",
                  "parameter": [
                    {
                      "valueId": "ed"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name": "admission",
          "source": [
            {
              "context": "src",
              "element": "admission",
              "variable": "s"
            }
          ],
          "target": [
            {
              "transform": "copy",
              "parameter": [
                {
                  "valueId": "tgt"
                }
              ]
            }
          ],
          "rule": [
            {
              "name": "admitSource",
              "source": [
                {
                  "context": "s",
                  "element": "admitSource",
                  "variable": "sa"
                }
              ],
              "target": [
                {
                  "transform": "copy",
                  "parameter": [
                    {
                      "valueId": "tgt"
                    }
                  ]
                }
              ],
              "rule": [
                {
                  "name": "coding",
                  "source": [
                    {
                      "context": "sa",
                      "element": "coding",
                      "variable": "sc"
                    }
                  ],
                  "target": [
                    {
                      "transform": "copy",
                      "parameter": [
                        {
                          "valueId": "tgt"
                        }
                      ]
                    }
                  ],
                  "rule": [
                    {
                      "name": "code",
                      "source": [
                        {
                          "context": "sc",
                          "element": "code",
                          "variable": "code"
                        }
                      ],
                      "target": [
                        {
                          "context": "tgt",
                          "element": "admitted_from_concept_id",
                          "transform": "copy",
                          "parameter": [
                            {
                              "valueId": "code"
                            }
                          ]
                        },
                        {
                          "context": "tgt",
                          "element": "admitted_from_source_value",
                          "transform": "copy",
                          "parameter": [
                            {
                              "valueId": "code"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name": "dischargeDisposition",
              "source": [
                {
                  "context": "s",
                  "element": "dischargeDisposition",
                  "variable": "sd"
                }
              ],
              "target": [
                {
                  "transform": "copy",
                  "parameter": [
                    {
                      "valueId": "tgt"
                    }
                  ]
                }
              ],
              "rule": [
                {
                  "name": "coding",
                  "source": [
                    {
                      "context": "sd",
                      "element": "coding",
                      "variable": "sc"
                    }
                  ],
                  "target": [
                    {
                      "transform": "copy",
                      "parameter": [
                        {
                          "valueId": "tgt"
                        }
                      ]
                    }
                  ],
                  "rule": [
                    {
                      "name": "code",
                      "source": [
                        {
                          "context": "sc",
                          "element": "code",
                          "variable": "code"
                        }
                      ],
                      "target": [
                        {
                          "context": "tgt",
                          "element": "discharged_to_concept_id",
                          "transform": "copy",
                          "parameter": [
                            {
                              "valueId": "code"
                            }
                          ]
                        },
                        {
                          "context": "tgt",
                          "element": "discharged_to_source_value",
                          "transform": "copy",
                          "parameter": [
                            {
                              "valueId": "code"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}