FHIR IG analytics| Package | hl7.fhir.uv.omop |
| Resource Type | StructureMap |
| Id | StructureMap-EncounterVisitMap.json |
| FHIR Version | R5 |
| Source | https://build.fhir.org/ig/HL7/fhir-omop-ig/StructureMap-EncounterVisitMap.html |
| URL | http://hl7.org/fhir/uv/omop/StructureMap/EncounterVisitMap |
| Version | 1.0.0 |
| Status | draft |
| Date | 2026-04-02T22:51:15+00:00 |
| Name | EncounterVisitMap |
| Title | Mapping Encounter resource to VisitOccurrence OMOP Domain |
| Realm | uv |
| Authority | hl7 |
| Description | This mapping maps FHIR Encounter instances to OMOP Visit Occurence Table objects. |
No resources found
No resources found
Note: links and images are rebased to the (stated) source
Generated Narrative: StructureMap EncounterVisitMap
Language: en
/// 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.id -> tgt.visit_occurrence_id = '1'; // OMOP Visit Occurrence ID would be a map from FHIR ID to an external key src.subject -> tgt.person_id = '1'; // OMOP Person ID would be a map from the FHIR Encounter Subject reference to an external key src.class as s -> tgt then { s.coding as sc -> tgt then { sc.code as a -> tgt.visit_concept_id = translate(a, 'http://hl7.org/fhir/uv/omop/ConceptMap/EncounterClass', 'code'), tgt.visit_source_value = a; }; }; src.actualPeriod as s -> tgt then { s.start as std -> tgt.visit_start_date = (src.actualPeriod.start.toString().substring(0, 10)), tgt.visit_start_datetime = std; s.end as ed -> tgt.visit_end_date = (src.actualPeriod.end.toString().substring(0, 10)), 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 = translate(code, 'http://hl7.org/fhir/uv/omop/ConceptMap/EncounterAdmitSource', '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 = translate(code, 'http://hl7.org/fhir/uv/omop/ConceptMap/EncounterDischargeDisposition', 'code'), tgt.discharged_to_source_value = code; }; }; }; }
{
"resourceType": "StructureMap",
"id": "EncounterVisitMap",
"language": "en",
"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",
"name": "EncounterVisitMap",
"title": "Mapping Encounter resource to VisitOccurrence OMOP Domain",
"status": "draft",
"date": "2026-04-02T22:51: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": "id",
"source": [
{
"context": "src",
"element": "id"
}
],
"target": [
{
"context": "tgt",
"element": "visit_occurrence_id",
"transform": "copy",
"parameter": [
{
"valueString": "1"
}
]
}
],
"documentation": "OMOP Visit Occurrence ID would be a map from FHIR ID to an external key"
},
{
"name": "subject",
"source": [
{
"context": "src",
"element": "subject"
}
],
"target": [
{
"context": "tgt",
"element": "person_id",
"transform": "copy",
"parameter": [
{
"valueString": "1"
}
]
}
],
"documentation": "OMOP Person ID would be a map from the FHIR Encounter Subject reference to an external key"
},
{
"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": "translate",
"parameter": [
{
"valueId": "a"
},
{
"valueString": "http://hl7.org/fhir/uv/omop/ConceptMap/EncounterClass"
},
{
"valueString": "code"
}
]
},
{
"context": "tgt",
"element": "visit_source_value",
"transform": "copy",
"parameter": [
{
"valueId": "a"
}
]
}
]
}
]
}
]
},
{
"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": "evaluate",
"parameter": [
{
"valueString": "src.actualPeriod.start.toString().substring(0, 10)"
}
]
},
{
"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": "evaluate",
"parameter": [
{
"valueString": "src.actualPeriod.end.toString().substring(0, 10)"
}
]
},
{
"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": "translate",
"parameter": [
{
"valueId": "code"
},
{
"valueString": "http://hl7.org/fhir/uv/omop/ConceptMap/EncounterAdmitSource"
},
{
"valueString": "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": "translate",
"parameter": [
{
"valueId": "code"
},
{
"valueString": "http://hl7.org/fhir/uv/omop/ConceptMap/EncounterDischargeDisposition"
},
{
"valueString": "code"
}
]
},
{
"context": "tgt",
"element": "discharged_to_source_value",
"transform": "copy",
"parameter": [
{
"valueId": "code"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}