{
"description": "Demonstrates SQL annotations that tooling can use to generate Library metadata.\\n\\n```sql\\n/*\\n@name: SqlOnFhirExample\\n@title: Blood Pressure Trend Report\\n@description: Return blood pressure observations for a patient in a date range\\n@version: 1.0.0\\n@status: active\\n@author: Clinical Informatics Team\\n@publisher: Regional Medical Center\\n*/\\n\\n-- @relatedDependency: https://example.org/ViewDefinition/patient_view as patient_view\\n-- @relatedDependency: https://example.org/ViewDefinition/blood_pressure_view as blood_pressure_view\\n-- @param: patient_id string Patient identifier\\n-- @param: from_date date Start date (inclusive)\\n-- @param: to_date date End date (inclusive)\\nSELECT\\n patient_view.id AS patient_id,\\n patient_view.name,\\n blood_pressure_view.systolic,\\n blood_pressure_view.diastolic,\\n blood_pressure_view.effective_date\\nFROM patient_view\\nJOIN blood_pressure_view\\n ON patient_view.id = blood_pressure_view.patient_id\\nWHERE patient_view.id = :patient_id\\n AND blood_pressure_view.effective_date >= :from_date\\n AND blood_pressure_view.effective_date <= :to_date\\nORDER BY blood_pressure_view.effective_date\\n```",
"_filename": "example/Library-SqlOnFhirExample.json",
"package_name": "hl7.fhir.uv.sql-on-fhir",
"date": "2026-08-14T02:49:31+10:00",
"meta": {
"profile": [ "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/SQLQuery" ]
},
"publisher": "HL7 International / FHIR Infrastructure",
"jurisdiction": [ {
"coding": [ {
"code": "001",
"system": "http://unstats.un.org/unsd/methods/m49/m49.htm",
"display": "World"
} ]
} ],
"content": [ {
"data": "LyoKQG5hbWU6IFNxbE9uRmhpckV4YW1wbGUKQHRpdGxlOiBCbG9vZCBQcmVzc3VyZSBUcmVuZCBSZXBvcnQKQGRlc2NyaXB0aW9uOiBSZXR1cm4gYmxvb2QgcHJlc3N1cmUgb2JzZXJ2YXRpb25zIGZvciBhIHBhdGllbnQgaW4gYSBkYXRlIHJhbmdlCkB2ZXJzaW9uOiAxLjAuMApAc3RhdHVzOiBhY3RpdmUKQGF1dGhvcjogQ2xpbmljYWwgSW5m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Vzc3VyZV92aWV3LmVmZmVjdGl2ZV9kYXRl",
"extension": [ {
"url": "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/sql-text",
"valueString": "/*\n@name: SqlOnFhirExample\n@title: Blood Pressure Trend Report\n@description: Return blood pressure observations for a patient in a date range\n@version: 1.0.0\n@status: active\n@author: Clinical Informatics Team\n@publisher: Regional Medical Center\n*/\n\n-- @relatedDependency: https://example.org/ViewDefinition/patient_view as patient_view\n-- @relatedDependency: https://example.org/ViewDefinition/blood_pressure_view as blood_pressure_view\n-- @param: patient_id string Patient identifier\n-- @param: from_date date Start date (inclusive)\n-- @param: to_date date End date (inclusive)\nSELECT\n patient_view.id AS patient_id,\n patient_view.name,\n blood_pressure_view.systolic,\n blood_pressure_view.diastolic,\n blood_pressure_view.effective_date\nFROM patient_view\nJOIN blood_pressure_view\n ON patient_view.id = blood_pressure_view.patient_id\nWHERE patient_view.id = :patient_id\n AND blood_pressure_view.effective_date >= :from_date\n AND blood_pressure_view.effective_date <= :to_date\nORDER BY blood_pressure_view.effective_date"
} ],
"contentType": "application/sql"
} ],
"name": "SqlOnFhirExample",
"type": "{:coding [{:system \\\"http://hl7.org/fhir/uv/sql-on-fhir/CodeSystem/LibraryTypesCodes\\\", :code \\\"sql-query\\\"}]}",
"experimental": null,
"resourceType": "Library",
"title": "Blood Pressure Trend Report",
"package_version": "3.0.0-ballot",
"author": [ {
"name": "Clinical Informatics Team"
} ],
"status": "active",
"id": "9897fa87-db71-47a7-988c-6204ac0f1539",
"kind": null,
"url": "http://hl7.org/fhir/uv/sql-on-fhir/Library/SqlOnFhirExample",
"identifier": [ {
"value": "urn:oid:2.16.840.1.113883.4.642.40.77.28.4",
"system": "urn:ietf:rfc:3986"
} ],
"version": "3.0.0-ballot",
"relatedArtifact": [ {
"type": "depends-on",
"label": "patient_view",
"resource": "https://example.org/ViewDefinition/patient_view"
}, {
"type": "depends-on",
"label": "blood_pressure_view",
"resource": "https://example.org/ViewDefinition/blood_pressure_view"
} ],
"contact": [ {
"name": "HL7 International / FHIR Infrastructure",
"telecom": [ {
"value": "http://www.hl7.org/Special/committees/fiwg",
"system": "url"
} ]
} ],
"parameter": [ {
"use": "in",
"name": "patient_id",
"type": "string",
"documentation": "Patient identifier"
}, {
"use": "in",
"name": "from_date",
"type": "date",
"documentation": "Start date for observations"
}, {
"use": "in",
"name": "to_date",
"type": "date",
"documentation": "End date for observations"
} ]
}