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
Contents:
This page provides a list of the FHIR artifacts defined as part of this implementation guide.
These are custom operations that can be supported by and/or invoked by systems conforming to this implementation guide.
| SQL Export |
Export one or more ViewDefinitions, SQLQuery Libraries and SQLView Libraries as a single asynchronous job, using the FHIR Asynchronous Interaction Request Pattern. |
| SQL Run |
Execute a ViewDefinition, SQLQuery Library or SQLView Library and return the result in the requested output format. |
These define the properties by which a RESTful server can be searched. They can also be used for sorting and including related resources.
| ViewDefinitionContextQuantitySearchParam |
A quantity- or range-valued use context assigned to the view definition |
| ViewDefinitionContextSearchParam |
A use context assigned to the view definition |
| ViewDefinitionContextTypeQuantitySearchParam |
A use context type and quantity- or range-based value assigned to the view definition |
| ViewDefinitionContextTypeSearchParam |
A type of use context assigned to the view definition |
| ViewDefinitionContextTypeValueSearchParam |
A use context type and value assigned to the view definition |
| ViewDefinitionDateSearchParam |
The view definition publication date |
| ViewDefinitionDescriptionSearchParam |
The description of the view definition |
| ViewDefinitionIdentifierSearchParam |
External identifier for the view definition |
| ViewDefinitionJurisdictionSearchParam |
Intended jurisdiction for the view definition |
| ViewDefinitionNameSearchParam |
Computationally friendly name of the view definition |
| ViewDefinitionProfileSearchParam |
A FHIR profile the view definition is intended to be executed against |
| ViewDefinitionPublisherSearchParam |
Name of the publisher of the view definition |
| ViewDefinitionResourceSearchParam |
The FHIR resource type the view definition is based upon |
| ViewDefinitionStatusSearchParam |
The current status of the view definition |
| ViewDefinitionTitleSearchParam |
The human-friendly name of the view definition |
| ViewDefinitionUrlSearchParam |
The uri that identifies the view definition |
| ViewDefinitionVersionSearchParam |
The business version of the view definition |
'Additional' resources that are not yet published in the FHIR core specification.
| View Definition |
A ViewDefinition represents a tabular projection of a FHIR resource, where the columns and inclusion criteria are defined by FHIRPath expressions. |
These define constraints on FHIR resources for systems conforming to this implementation guide.
| SQL Query Library |
The SQLQuery profile represents a SQL query that runs against ViewDefinition tables. It bundles the SQL, dependencies, and parameters for sharing and versioning. |
| SQL View Library |
The SQLView profile represents a reusable, named SQL query that other queries reference as a virtual table source, analogous to a SQL view. It bundles the SQL and its dependencies for sharing and versioning. Unlike SQLQuery, an SQLView cannot declare parameters. |
| Shareable View Definition |
A profile for View Definitions intended to be shared between multiple systems. This requires that the View Definition have a defined URL and name. It also requires declaration of the FHIR version that the view is intended to be executed over, and the FHIR type of each column. This ensures consistent interpretation of the view across different view runner implementations. |
| Tabular View Definition |
A profile for View Definitions where each resulting field must contain only a simple scalar value. This is sometimes referred to as 'CSV Mode', but applies to any system that explicitly constrains its views or tables to tabular data. |
These define constraints on FHIR data types for systems conforming to this implementation guide.
| SQL Text |
Plain-text SQL query for human readability. Supplements the base64-encoded Attachment.data. |
These define sets of codes used by systems conforming to this implementation guide.
| All SQL Content Type Codes |
ValueSet of all codes from SQL Content Type Codes codesystem |
| Export Output Format Codes |
Output format codes supported by the export operations. Excludes fhir, which applies to the run operations only; see Common Operation Behavior. |
| Export Status Codes |
ValueSet of all codes from Export Status Codes codesystem |
| Output Format Codes |
ValueSet of all codes from the Output Format Codes code system. Used by the synchronous run operations; see Common Operation Behavior. |
These define new code systems used by systems conforming to this implementation guide.
| Export Status Code System |
Export status codes for SQL on FHIR. |
| Output Format Code System |
Output format codes for SQL on FHIR. |
| SQL Content Type Codes |
Permitted contentType values for SQLQuery attachments, including dialect-specific variants. |
| SQL Library Types Code System |
Library types for SQL on FHIR. |
These are example instances that show what data produced and consumed by systems conforming with this implementation guide might look like.
| Active Patient Addresses |
A SQL query that composes the ActivePatientsView, demonstrating an SQLQuery that references an SQLView as a virtual table. |
| Active Patients |
A reusable SQL view selecting active patients, intended to be referenced as a virtual table by other queries. |
| Blood Pressure Trend Report |
Annotated SQL query example demonstrating how tooling can derive Library metadata. |
| CodeSystem Hierarchy |
Demonstrates using |
| Condition Flat |
A simple view for flattening a Condition resource. Some of the more commonly used fields are included in this flat view. A notable point is flattening of |
| Encounter Flat |
A simple view for flattening an Encounter resource. Some of the more commonly used fields are included in this flat view. Note this is valid for an R4 Encounter resource but not R5 (hence the |
| OMOP/FHIR Patient Match with Diagnoses |
Disambiguates OMOP and FHIR Patient views and joins diagnoses for context. |
| Patient Addresses |
An example of unnesting patient addresses into multiple rows. This view uses |
| Patient Demographics |
A minimal example of a patient demographics view. This view uses the first 'official' patient name for our demographics table. |
| Patient Names with Index |
An example demonstrating the use of %rowIndex to capture the position of elements within a collection. This is useful for preserving FHIR ordering semantics and creating surrogate keys that combine resource ID with element position. |
| Patient and Contact Address Union |
An example of unnesting patient addresses and contact addresss into multiple rows, which are unioned together into a single table. |
| Questionnaire Response Items |
Demonstrates using the |
| Shareable Patient Demographics |
Creates the same view as the 'PatientDemographics' example, but applies both the ShareableViewDefinition and TabularViewDefinition profiles. |
| US Core Blood Pressures |
A simple view of blood pressure observations, with separate columns for systolic and diastolic values. |
| Unique Patient Addresses |
A SQL query that retrieves the most recent address per patient with a city filter. |
These are resources that are used within this implementation guide that do not fit into one of the other categories.
| ViewDefinition Operations |
All the ViewDefinition operations defined by this guide. |