SQL on FHIR
3.0.0-ballot - STU 3 Ballot International flag

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

Example ViewDefinition: Questionnaire Response Items

This view acts on the QuestionnaireResponse resource to produce a table named "questionnaire_response_items".

The table contains the following columns:

NameFhir TypeSQL TypeCollection
idstringString
questionnairecanonicalString
patient_idstringString
authoreddateTimeDateTime

Selection Rules:

ItemCollTypeDescription
.. questionnaire_response_itemsQuestionnaireResponse
... Select
.... idgetResourceKey()
Unique questionnaire response identifier
.... questionnairequestionnaire
Canonical URL of the questionnaire
.... patient_idsubject.getReferenceKey(Patient)
Patient identifier
.... authoredauthored
Date and time the response was authored
... Select
.... item_link_idlinkId
Unique identifier for this item within the questionnaire
.... item_texttext
Question text
.... answer_value_stringanswer.value.ofType(string)
String answer value
.... answer_value_integeranswer.value.ofType(integer)
Integer answer value
.... answer_value_booleananswer.value.ofType(boolean)
Boolean answer value
.... answer_value_dateanswer.value.ofType(date)
Date answer value