SQL on FHIR
2.1.0-pre - release International flag

SQL on FHIR - Local Development build (v2.1.0-pre) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

Example ViewDefinition: EncounterFlat

draft

Generated Narrative: ViewDefinition EncounterFlat

This view acts on the Encounter resource for version R4 to produce a table named "encounter_flat".

The table contains the following columns:

NameFhir TypeSQL TypeCollectionNotes
idstringString
statusstringString
patient_idstringString
service_org_idstringString
period_startdateTimeDateTime
period_enddateTimeDateTime
EpisodeOfCareIdstringString
type_sysuriStringThis column is not defined as a collection, but the path statement 'system' might return multiple values for the column 'type_sys' for some inputs
type_codestringStringThis column is not defined as a collection, but the path statement 'code' might return multiple values for the column 'type_code' for some inputs
practitioner_idstringString
location_idstringString

Selection Rules:

ItemCollTypeDescription
.. encounter_flatEncounter
... Select
.... idgetResourceKey()
.... statusstatus
.... patient_idsubject.getReferenceKey(Patient)
.... service_org_idserviceProvider.getReferenceKey(Organization)
.... period_startperiod.start
.... period_endperiod.end
.... EpisodeOfCareIdepisodeOfCare.getReferenceKey(EpisodeOfCare)
... Selectfor each type.coding, or null
.... type_syssystem
.... type_codecode
... Selectfor each participant, or null
.... practitioner_idindividual.getReferenceKey(Practitioner)
... Selectfor each location, or null
.... location_idlocation.getReferenceKey(Location)