FHIR © HL7.org  |  FHIRsmith 4.0.1  |  Server Home  |  XIG Home  |  XIG Stats  | 

FHIR IG analytics

Packagehl7.fhir.uv.sql-on-fhir
Resource TypeLibrary
IdLibrary-OmopFhirPatientJoin.json
FHIR VersionR6

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

Metadata
Title OMOP/FHIR Patient Match with Diagnoses
Version 3.0.0-ballot
Identifier urn:oid:2.16.840.1.113883.4.642.40.77.28.3
Jurisdiction World
Steward (Publisher) HL7 International / FHIR Infrastructure
Steward Contact HL7 International / FHIR Infrastructure
Description

Uses labels to disambiguate patient views from different sources and joins patient diagnoses for downstream analytics.

SELECT
  omop_person.person_id AS omop_person_id,
  fhir_patient.id AS fhir_patient_id,
  fhir_patient.name,
  diagnoses_view.code AS diagnosis_code,
  diagnoses_view.display AS diagnosis_display
FROM omop_person
JOIN fhir_patient
  ON omop_person.person_id = fhir_patient.mrn
JOIN diagnoses_view
  ON diagnoses_view.patient_id = fhir_patient.id
WHERE omop_person.source_system = :source_system
Type sql-query from http://hl7.org/fhir/uv/sql-on-fhir/CodeSystem/LibraryTypesCodes
Dependency Description: OMOP Person view
Resource: https://example.org/omop/ViewDefinition/Patient
Canonical URL: https://example.org/omop/ViewDefinition/Patient
Dependency Description: FHIR Patient view
Resource: https://example.org/fhir/ViewDefinition/Patient
Canonical URL: https://example.org/fhir/ViewDefinition/Patient
Dependency Description: Diagnosis facts view
Resource: https://example.org/ViewDefinition/diagnoses_view
Canonical URL: https://example.org/ViewDefinition/diagnoses_view
Parameters
Name Use Card. Type Documentation
source_system In 0..1 string Source system identifier for OMOP records
Library Content
application/sqlContent
Encoded data 
Generated using version 0.5.4 of the sample-content-ig Liquid templates

Source1

{
  "resourceType": "Library",
  "id": "OmopFhirPatientJoin",
  "meta": {
    "profile": [
      "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/SQLQuery"
    ]
  },
  "text": {
    "status": "extensions",
    "div": "<!-- snip (see above) -->"
  },
  "url": "http://hl7.org/fhir/uv/sql-on-fhir/Library/OmopFhirPatientJoin",
  "identifier": [
    {
      "system": "urn:ietf:rfc:3986",
      "value": "urn:oid:2.16.840.1.113883.4.642.40.77.28.3"
    }
  ],
  "version": "3.0.0-ballot",
  "name": "OmopFhirPatientJoin",
  "title": "OMOP/FHIR Patient Match with Diagnoses",
  "status": "active",
  "type": {
    "coding": [
      {
        "system": "http://hl7.org/fhir/uv/sql-on-fhir/CodeSystem/LibraryTypesCodes",
        "code": "sql-query"
      }
    ]
  },
  "date": "2026-08-13T15:42:34+00:00",
  "publisher": "HL7 International / FHIR Infrastructure",
  "contact": [
    {
      "name": "HL7 International / FHIR Infrastructure",
      "telecom": [
        {
          "system": "url",
          "value": "http://www.hl7.org/Special/committees/fiwg"
        }
      ]
    }
  ],
  "description": "Uses labels to disambiguate patient views from different sources and joins\npatient diagnoses for downstream analytics.\n\n```sql\nSELECT\n  omop_person.person_id AS omop_person_id,\n  fhir_patient.id AS fhir_patient_id,\n  fhir_patient.name,\n  diagnoses_view.code AS diagnosis_code,\n  diagnoses_view.display AS diagnosis_display\nFROM omop_person\nJOIN fhir_patient\n  ON omop_person.person_id = fhir_patient.mrn\nJOIN diagnoses_view\n  ON diagnoses_view.patient_id = fhir_patient.id\nWHERE omop_person.source_system = :source_system\n```",
  "jurisdiction": [
    {
      "coding": [
        {
          "system": "http://unstats.un.org/unsd/methods/m49/m49.htm",
          "code": "001",
          "display": "World"
        }
      ]
    }
  ],
  "relatedArtifact": [
    {
      "type": "depends-on",
      "label": "omop_person",
      "display": "OMOP Person view",
      "resource": "https://example.org/omop/ViewDefinition/Patient"
    },
    {
      "type": "depends-on",
      "label": "fhir_patient",
      "display": "FHIR Patient view",
      "resource": "https://example.org/fhir/ViewDefinition/Patient"
    },
    {
      "type": "depends-on",
      "label": "diagnoses_view",
      "display": "Diagnosis facts view",
      "resource": "https://example.org/ViewDefinition/diagnoses_view"
    }
  ],
  "parameter": [
    {
      "name": "source_system",
      "use": "in",
      "documentation": "Source system identifier for OMOP records",
      "type": "string"
    }
  ],
  "content": [
    {
      "extension": [
        {
          "url": "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/sql-text",
          "valueString": "SELECT\n  omop_person.person_id AS omop_person_id,\n  fhir_patient.id AS fhir_patient_id,\n  fhir_patient.name,\n  diagnoses_view.code AS diagnosis_code,\n  diagnoses_view.display AS diagnosis_display\nFROM omop_person\nJOIN fhir_patient\n  ON omop_person.person_id = fhir_patient.mrn\nJOIN diagnoses_view\n  ON diagnoses_view.patient_id = fhir_patient.id\nWHERE omop_person.source_system = :source_system"
        }
      ],
      "contentType": "application/sql",
      "data": "U0VMRUNUCiAgb21vcF9wZXJzb24ucGVyc29uX2lkIEFTIG9tb3BfcGVyc29uX2lkLAogIGZoaXJfcGF0aWVudC5pZCBBUyBmaGlyX3BhdGllbnRfaWQsCiAgZmhpcl9wYXRpZW50Lm5hbWUsCiAgZGlhZ25vc2VzX3ZpZXcuY29kZSBBUyBkaWFnbm9zaXNfY29kZSwKICBkaWFnbm9zZXNfdmlldy5kaXNwbGF5IEFTIGRpYWdub3Npc19kaXNwbGF5CkZST00gb21vcF9wZXJzb24KSk9JTiBmaGlyX3BhdGllbnQKICBPTiBvbW9wX3BlcnNvbi5wZXJzb25faWQgPSBmaGlyX3BhdGllbnQubXJuCkpPSU4gZGlhZ25vc2VzX3ZpZXcKICBPTiBkaWFnbm9zZXNfdmlldy5wYXRpZW50X2lkID0gZmhpcl9wYXRpZW50LmlkCldIRVJFIG9tb3BfcGVyc29uLnNvdXJjZV9zeXN0ZW0gPSA6c291cmNlX3N5c3RlbQ=="
    }
  ]
}