SQL on FHIR, published by HL7 International / FHIR Infrastructure. This guide is not an authorized publication; it is the continuous build for version 3.0.0-ballot built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/sql-on-fhir/ and changes regularly. See the Directory of published versions
| Page standards status: Informative |
{
"resourceType" : "Library",
"id" : "ActivePatientAddressesQuery",
"meta" : {
"profile" : [
🔗 "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/SQLQuery"
]
},
"language" : "en",
"text" : {
"status" : "extensions",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n <table class=\"narrative-table\">\n <tbody>\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Metadata</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Title</th>\n\n\n\n<td class=\"content-container\">Active Patient Addresses</td>\n\n\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Version</th>\n\n\n\n<td class=\"content-container\">3.0.0-ballot</td>\n\n\n</tr>\n\n\n\n\n\n\n\n \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Identifier</th>\n\n\n\n<td class=\"content-container\">urn:oid:2.16.840.1.113883.4.642.40.77.28.1</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Jurisdiction</th>\n\n\n\n<td class=\"content-container\">\n World\n\n\n</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Steward (Publisher)</th>\n\n\n\n<td class=\"content-container\">HL7 International / FHIR Infrastructure</td>\n\n\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Steward Contact</th>\n\n\n\n<td class=\"content-container\">HL7 International / FHIR Infrastructure</td>\n\n\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Description</th>\n\n\n\n<td class=\"content-container\"><div><p>Joins the <a href=\"Library-ActivePatientsView.html\">Active Patients</a> view to patient\naddresses. The <code>active_patients</code> label resolves to the referenced SQLView, which\nthe executing engine may materialize or inline.</p>\n<pre><code class=\"language-sql\">SELECT\n active_patients.patient_id,\n active_patients.patient_name,\n patient_address_view.city,\n patient_address_view.state\nFROM active_patients\nJOIN patient_address_view\n ON active_patients.patient_id = patient_address_view.patient_id\n</code></pre>\n</div></td>\n\n\n</tr>\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n\n\n<td class=\"content-container\">\n sql-query from <a href=\"CodeSystem-LibraryTypesCodes.html\">http://hl7.org/fhir/uv/sql-on-fhir/CodeSystem/LibraryTypesCodes</a> \n\n\n</td>\n\n\n</tr>\n\n\n\n<tr>\n \n \n \n \n \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n \n \n <td class=\"content-container\">\n \n <em>Description</em>: Active Patients view\n \n <br/>\n \n \n \n \n \n \n <em>Resource</em>: <a href=\"Library-ActivePatientsView.html\">Active Patients</a>\n <br/>\n <em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/sql-on-fhir/Library/ActivePatientsView</tt>\n \n \n \n </td>\n</tr>\n\n<tr>\n \n \n \n \n \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n \n \n <td class=\"content-container\">\n \n <em>Description</em>: Patient address view\n \n <br/>\n \n \n \n \n \n \n <em>Resource</em>: <code>https://example.org/ViewDefinition/patient_address_view</code>\n <br/>\n <em>Canonical URL</em>: <tt>https://example.org/ViewDefinition/patient_address_view</tt>\n \n \n \n </td>\n</tr>\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"parameters\"> </a>Parameters</th>\n\n\n</tr>\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Parameter</th>\n\n\n\n<td class=\"content-container\">None</td>\n\n\n</tr>\n\n\n\n\n\n\n\n <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Library Content</th>\n\n\n</tr>\n \n \n <tr>\n <th scope=\"row\" class=\"row-header\">application/sqlContent</th>\n <td>\n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code>Encoded data </code></pre>\n </td>\n </tr>\n \n \n\n<tr>\n <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.5.4 of the sample-content-ig Liquid templates</th>\n</tr>\n\n </tbody>\n </table>\n</div>"
},
"url" : "http://hl7.org/fhir/uv/sql-on-fhir/Library/ActivePatientAddressesQuery",
"identifier" : [
{
"system" : "urn:ietf:rfc:3986",
"value" : "urn:oid:2.16.840.1.113883.4.642.40.77.28.1"
}
],
"version" : "3.0.0-ballot",
"name" : "ActivePatientAddressesQuery",
"title" : "Active Patient Addresses",
"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" : "Joins the [Active Patients](Library-ActivePatientsView.html) view to patient\naddresses. The `active_patients` label resolves to the referenced SQLView, which\nthe executing engine may materialize or inline.\n\n```sql\nSELECT\n active_patients.patient_id,\n active_patients.patient_name,\n patient_address_view.city,\n patient_address_view.state\nFROM active_patients\nJOIN patient_address_view\n ON active_patients.patient_id = patient_address_view.patient_id\n```",
"jurisdiction" : [
{
"coding" : [
{
"system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
"code" : "001",
"display" : "World"
}
]
}
],
"relatedArtifact" : [
{
"type" : "depends-on",
"label" : "active_patients",
"display" : "Active Patients view",
"resource" : "http://hl7.org/fhir/uv/sql-on-fhir/Library/ActivePatientsView"
},
{
"type" : "depends-on",
"label" : "patient_address_view",
"display" : "Patient address view",
"resource" : "https://example.org/ViewDefinition/patient_address_view"
}
],
"content" : [
{
"extension" : [
{
"url" : "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/sql-text",
"valueString" : "SELECT\n active_patients.patient_id,\n active_patients.patient_name,\n patient_address_view.city,\n patient_address_view.state\nFROM active_patients\nJOIN patient_address_view\n ON active_patients.patient_id = patient_address_view.patient_id"
}
],
"contentType" : "application/sql",
"data" : "U0VMRUNUCiAgYWN0aXZlX3BhdGllbnRzLnBhdGllbnRfaWQsCiAgYWN0aXZlX3BhdGllbnRzLnBhdGllbnRfbmFtZSwKICBwYXRpZW50X2FkZHJlc3Nfdmlldy5jaXR5LAogIHBhdGllbnRfYWRkcmVzc192aWV3LnN0YXRlCkZST00gYWN0aXZlX3BhdGllbnRzCkpPSU4gcGF0aWVudF9hZGRyZXNzX3ZpZXcKICBPTiBhY3RpdmVfcGF0aWVudHMucGF0aWVudF9pZCA9IHBhdGllbnRfYWRkcmVzc192aWV3LnBhdGllbnRfaWQ="
}
]
}