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
This view acts on the Condition resource to produce a table named "condition_flat".
The table contains the following columns:
| Name | Fhir Type | SQL Type | Collection |
|---|---|---|---|
| id | string | String | |
| patient_id | string | String | |
| encounter_id | string | String | |
| onset_datetime | dateTime | DateTime | |
| system | string | String | |
| code | string | String | |
| category | string | String | |
| clinical_status | string | String | |
| verification_status | string | String |
Selection Rules:
| Item | Coll | Type | Description |
|---|---|---|---|
![]() | Condition | ||
![]() ![]() | |||
![]() ![]() ![]() | getResourceKey() | ||
![]() ![]() ![]() | subject.getReferenceKey(Patient) | ||
![]() ![]() ![]() | encounter.getReferenceKey(Encounter) | ||
![]() ![]() ![]() | dateTime | onset.ofType(dateTime) | |
![]() ![]() | for each code.coding, or null | ||
![]() ![]() ![]() | uri | system | |
![]() ![]() ![]() | code | ||
![]() ![]() | for each category.coding, or null | ||
![]() ![]() ![]() | code | ||
![]() ![]() | for each clinicalStatus.coding, or null | ||
![]() ![]() ![]() | code | ||
![]() ![]() | for each verificationStatus.coding, or null | ||
![]() ![]() ![]() | code |
This will result in a "condition_flat" table that looks like this:
| id | patient_id | encounter_id | onset_datetime | system | code | category | clinical_status | verification_status |
| 7 | 28 | 9 | 2020-01-01T00:00:00Z | http://snomed.info/sct | 44054006 | encounter-diagnosis | active | confirmed |
| 8 | 29 | 10 | 2020-01-02T00:00:00Z | http://snomed.info/sct | 38341003 | problem-list-item | resolved | confirmed |