SQL on FHIR
            
            2.0.0 - release
  
            
          
This page is part of the SQL on FHIR (v2.0.0: Release) based on FHIR (HL7® FHIR® Standard) v5.0.0. This is the current published version. For a full list of available versions, see the Directory of published versions
This content is an example of the Shareable View Definition Logical Model and is not a FHIR Resource
    
{
  "resourceType": "https://sql-on-fhir.org/ig/StructureDefinition/ViewDefinition",
  "meta": {
    "profile": [
      "https://sql-on-fhir.org/ig/StructureDefinition/ShareableViewDefinition",
      "https://sql-on-fhir.org/ig/StructureDefinition/TabularViewDefinition"
    ]
  },
  "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()"
    }
  ],
  "url": "http://example.com/ShareablePatientDemographics",
  "name": "patient_demographics",
  "status": "draft",
  "resource": "Patient"
}
  
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 |