SQL on FHIR
2.1.0-pre - release International flag

SQL on FHIR, published by SQL on FHIR Working Group. This guide is not an authorized publication; it is the continuous build for version 2.1.0-pre 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

: Active Patients - XML Representation

Active as of 2026-06-13

Raw xml | Download


<Library xmlns="http://hl7.org/fhir">
  <id value="ActivePatientsView"/>
  <meta>
    <profile value="https://sql-on-fhir.org/ig/StructureDefinition/SQLView"/>
  </meta>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: Library ActivePatientsView</b></p><a name="ActivePatientsView"> </a><a name="hcActivePatientsView"> </a><div style="display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%"><p style="margin-bottom: 0px"/><p style="margin-bottom: 0px">Profile: <a href="StructureDefinition-SQLView.html">SQL View Library</a></p></div><h2>Related Artifacts</h2><table class="grid"><tr><td>Depends On</td><td>patient_view</td><td><code>https://example.org/ViewDefinition/patient_view</code></td></tr></table><h2>Contents</h2><p><code>application/sql</code></p><pre><code>SELECT
  patient_view.id AS patient_id,
  patient_view.name AS patient_name,
  patient_view.birth_date
FROM patient_view
WHERE patient_view.active = true</code></pre></div>
  </text>
  <url value="https://sql-on-fhir.org/ig/Library/ActivePatientsView"/>
  <version value="2.1.0-pre"/>
  <name value="ActivePatientsView"/>
  <title value="Active Patients"/>
  <status value="active"/>
  <type>
    <coding>
      <system
              value="https://sql-on-fhir.org/ig/CodeSystem/LibraryTypesCodes"/>
      <code value="sql-view"/>
    </coding>
  </type>
  <date value="2026-06-13T00:26:08+00:00"/>
  <publisher value="SQL on FHIR Working Group"/>
  <contact>
    <name value="SQL on FHIR Working Group"/>
    <telecom>
      <system value="url"/>
      <value value="https://sql-on-fhir.org"/>
    </telecom>
  </contact>
  <description
               value="Selects the identifier, name, and birth date of every active patient. Other
queries reference this view by its canonical URL and use the `active_patients`
label as a table name.

```sql
SELECT
  patient_view.id AS patient_id,
  patient_view.name AS patient_name,
  patient_view.birth_date
FROM patient_view
WHERE patient_view.active = true
```"/>
  <jurisdiction>
    <coding>
      <system value="http://unstats.un.org/unsd/methods/m49/m49.htm"/>
      <code value="001"/>
      <display value="World"/>
    </coding>
  </jurisdiction>
  <relatedArtifact>
    <type value="depends-on"/>
    <label value="patient_view"/>
    <resource value="https://example.org/ViewDefinition/patient_view"/>
  </relatedArtifact>
  <content>
    <extension url="https://sql-on-fhir.org/ig/StructureDefinition/sql-text">
      <valueString
                   value="SELECT
  patient_view.id AS patient_id,
  patient_view.name AS patient_name,
  patient_view.birth_date
FROM patient_view
WHERE patient_view.active = true"/>
    </extension>
    <contentType value="application/sql"/>
    <data
          value="U0VMRUNUCiAgcGF0aWVudF92aWV3LmlkIEFTIHBhdGllbnRfaWQsCiAgcGF0aWVudF92aWV3Lm5hbWUgQVMgcGF0aWVudF9uYW1lLAogIHBhdGllbnRfdmlldy5iaXJ0aF9kYXRlCkZST00gcGF0aWVudF92aWV3CldIRVJFIHBhdGllbnRfdmlldy5hY3RpdmUgPSB0cnVl"/>
  </content>
</Library>