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 - JSON Representation

Active as of 2026-06-13

Raw json | Download

{
  "resourceType" : "Library",
  "id" : "ActivePatientsView",
  "meta" : {
    "profile" : [
      🔗 "https://sql-on-fhir.org/ig/StructureDefinition/SQLView"
    ]
  },
  "text" : {
    "status" : "generated",
    "div" : "<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\n  patient_view.id AS patient_id,\n  patient_view.name AS patient_name,\n  patient_view.birth_date\nFROM patient_view\nWHERE patient_view.active = true</code></pre></div>"
  },
  "url" : "https://sql-on-fhir.org/ig/Library/ActivePatientsView",
  "version" : "2.1.0-pre",
  "name" : "ActivePatientsView",
  "title" : "Active Patients",
  "status" : "active",
  "type" : {
    "coding" : [
      {
        "system" : "https://sql-on-fhir.org/ig/CodeSystem/LibraryTypesCodes",
        "code" : "sql-view"
      }
    ]
  },
  "date" : "2026-06-13T00:26:08+00:00",
  "publisher" : "SQL on FHIR Working Group",
  "contact" : [
    {
      "name" : "SQL on FHIR Working Group",
      "telecom" : [
        {
          "system" : "url",
          "value" : "https://sql-on-fhir.org"
        }
      ]
    }
  ],
  "description" : "Selects the identifier, name, and birth date of every active patient. Other\nqueries reference this view by its canonical URL and use the `active_patients`\nlabel as a table name.\n\n```sql\nSELECT\n  patient_view.id AS patient_id,\n  patient_view.name AS patient_name,\n  patient_view.birth_date\nFROM patient_view\nWHERE patient_view.active = true\n```",
  "jurisdiction" : [
    {
      "coding" : [
        {
          "system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
          "code" : "001",
          "display" : "World"
        }
      ]
    }
  ],
  "relatedArtifact" : [
    {
      "type" : "depends-on",
      "label" : "patient_view",
      "resource" : "https://example.org/ViewDefinition/patient_view"
    }
  ],
  "content" : [
    {
      "extension" : [
        {
          "url" : "https://sql-on-fhir.org/ig/StructureDefinition/sql-text",
          "valueString" : "SELECT\n  patient_view.id AS patient_id,\n  patient_view.name AS patient_name,\n  patient_view.birth_date\nFROM patient_view\nWHERE patient_view.active = true"
        }
      ],
      "contentType" : "application/sql",
      "data" : "U0VMRUNUCiAgcGF0aWVudF92aWV3LmlkIEFTIHBhdGllbnRfaWQsCiAgcGF0aWVudF92aWV3Lm5hbWUgQVMgcGF0aWVudF9uYW1lLAogIHBhdGllbnRfdmlldy5iaXJ0aF9kYXRlCkZST00gcGF0aWVudF92aWV3CldIRVJFIHBhdGllbnRfdmlldy5hY3RpdmUgPSB0cnVl"
    }
  ]
}