<?xml version="1.0" encoding="UTF-8"?>

<Library xmlns="http://hl7.org/fhir">
  <id value="ActivePatientsView"/>
  <meta>
    <profile value="http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/SQLView"/>
  </meta>
  <language value="en"/>
  <text>
    <status value="extensions"/><div xmlns="http://www.w3.org/1999/xhtml">
  <table class="narrative-table">
    <tbody>
<tr>


<th colspan="2" scope="row" class="row-header">Metadata</th>


</tr>

<tr>


<th scope="row" class="row-header">Title</th>



<td class="content-container">Active Patients</td>


</tr>



<tr>


<th scope="row" class="row-header">Version</th>



<td class="content-container">3.0.0-ballot</td>


</tr>







  
<tr>


<th scope="row" class="row-header">Identifier</th>



<td class="content-container">urn:oid:2.16.840.1.113883.4.642.40.77.28.2</td>


</tr>










<tr>


<th scope="row" class="row-header">Jurisdiction</th>



<td class="content-container">
    World


</td>


</tr>








<tr>


<th scope="row" class="row-header">Steward (Publisher)</th>



<td class="content-container">HL7 International / FHIR Infrastructure</td>


</tr>



<tr>


<th scope="row" class="row-header">Steward Contact</th>



<td class="content-container">HL7 International / FHIR Infrastructure</td>


</tr>







<tr>


<th scope="row" class="row-header">Description</th>



<td class="content-container"><div><p>Selects the identifier, name, and birth date of every active patient. Other
queries reference this view by its canonical URL and use the <code>active_patients</code>
label as a table name.</p>
<pre><code class="language-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
</code></pre>
</div></td>


</tr>






<tr>


<th scope="row" class="row-header">Type</th>



<td class="content-container">
    sql-view from <a href="CodeSystem-LibraryTypesCodes.html">http://hl7.org/fhir/uv/sql-on-fhir/CodeSystem/LibraryTypesCodes</a> 


</td>


</tr>



<tr>
  
  
  
  
  

<th scope="row" class="row-header">Dependency</th>


  
  
  <td class="content-container">
    
    
    
    
    
    <em>Resource</em>: <code>https://example.org/ViewDefinition/patient_view</code>
    <br/>
    <em>Canonical URL</em>: <tt>https://example.org/ViewDefinition/patient_view</tt>
    
    
    
  </td>
</tr>








<tr>


<th colspan="2" scope="row" class="row-header"><a name="parameters"> </a>Parameters</th>


</tr>


<tr>


<th scope="row" class="row-header">Parameter</th>



<td class="content-container">None</td>


</tr>







  <tr>


<th colspan="2" scope="row" class="row-header">Library Content</th>


</tr>
  
    
    <tr>
      <th scope="row" class="row-header">application/sqlContent</th>
      <td>
        <pre style="border: none;" class="content-container highlight language-cql"><code>Encoded data </code></pre>
      </td>
    </tr>
    
  

<tr>
  <th colspan="2" scope="row" class="row-header">Generated using version 0.5.4 of the sample-content-ig Liquid templates</th>
</tr>

    </tbody>
  </table>
</div>
  </text>
  <url value="http://hl7.org/fhir/uv/sql-on-fhir/Library/ActivePatientsView"/>
  <identifier>
    <system value="urn:ietf:rfc:3986"/>
    <value value="urn:oid:2.16.840.1.113883.4.642.40.77.28.2"/>
  </identifier>
  <version value="3.0.0-ballot"/>
  <name value="ActivePatientsView"/>
  <title value="Active Patients"/>
  <status value="active"/>
  <type>
    <coding>
      <system value="http://hl7.org/fhir/uv/sql-on-fhir/CodeSystem/LibraryTypesCodes"/>
      <code value="sql-view"/>
    </coding>
  </type>
  <date value="2026-08-13T15:42:34+00:00"/>
  <publisher value="HL7 International / FHIR Infrastructure"/>
  <contact>
    <name value="HL7 International / FHIR Infrastructure"/>
    <telecom>
      <system value="url"/>
      <value value="http://www.hl7.org/Special/committees/fiwg"/>
    </telecom>
  </contact>
  <description value="Selects the identifier, name, and birth date of every active patient. Other&#xA;queries reference this view by its canonical URL and use the `active_patients`&#xA;label as a table name.&#xA;&#xA;```sql&#xA;SELECT&#xA;  patient_view.id AS patient_id,&#xA;  patient_view.name AS patient_name,&#xA;  patient_view.birth_date&#xA;FROM patient_view&#xA;WHERE patient_view.active = true&#xA;```"/>
  <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="http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/sql-text">
      <valueString value="SELECT&#xA;  patient_view.id AS patient_id,&#xA;  patient_view.name AS patient_name,&#xA;  patient_view.birth_date&#xA;FROM patient_view&#xA;WHERE patient_view.active = true"/>
    </extension>
    <contentType value="application/sql"/>
    <data value="U0VMRUNUCiAgcGF0aWVudF92aWV3LmlkIEFTIHBhdGllbnRfaWQsCiAgcGF0aWVudF92aWV3Lm5hbWUgQVMgcGF0aWVudF9uYW1lLAogIHBhdGllbnRfdmlldy5iaXJ0aF9kYXRlCkZST00gcGF0aWVudF92aWV3CldIRVJFIHBhdGllbnRfdmlldy5hY3RpdmUgPSB0cnVl"/>
  </content>
</Library>