SQL on FHIR
2.1.0-pre - release
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/FHIR/sql-on-fhir-v2/ and changes regularly. See the Directory of published versions
{
"resourceType" : "https://sql-on-fhir.org/ig/StructureDefinition/ViewDefinition",
"id" : "ShareablePatientDemographics",
"meta" : {
"profile" : [
🔗 "https://sql-on-fhir.org/ig/StructureDefinition/ShareableViewDefinition"🔗 ,
"https://sql-on-fhir.org/ig/StructureDefinition/TabularViewDefinition"
]
},
"url" : "https://sql-on-fhir.org/ig/StructureDefinition/ShareablePatientDemographics",
"name" : "patient_demographics",
"status" : "draft",
"resource" : "Patient",
"fhirVersion" : [
"4.0",
"5.0"
],
"select" : [
{
"column" : [
{
"path" : "getResourceKey()",
"name" : "id",
"type" : "string"
},
{
"path" : "gender",
"name" : "gender",
"type" : "code"
}
]
},
{
"column" : [
{
"path" : "given.join(' ')",
"name" : "given_name",
"description" : "A single given name field with all names joined together.",
"type" : "string"
},
{
"path" : "family",
"name" : "family_name",
"type" : "string"
}
],
"forEach" : "name.where(use = 'official').first()"
}
]
}
This will result in a “patient_demographics” table that looks like this:
| id | gender | given_name | family_name |
|---|---|---|---|
| 1 | female | Malvina Gerda | Vicario |
| 2 | male | Yolotzin Adel | Bristow |
| 3 | other | Jin Gomer | Aarens |