View Definitions

Author and manage the ViewDefinitions that SQL on FHIR runs flatten resources with.

patient_addresses

Create New

Definition (JSON)

Runs as you type — results follow the current definition, saved or not

{
"resourceType": "ViewDefinition",
"resourceDefinition": "http://hl7.org/fhir/StructureDefinition/ViewDefinition|3.0.0-ballot",
"id": "PatientAddresses",
"language": "en",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: ViewDefinition PatientAddresses</b></p><a name=\"PatientAddresses\"> </a><a name=\"hcPatientAddresses\"> </a><p>This view acts on the Patient resource to produce a table named &quot;<code>patient_addresses</code>&quot;.</p><p>The table contains the following columns:</p><table class=\"grid\"><tr><th>Name</th><th>Fhir Type</th><th>SQL Type</th><th>Collection</th></tr><tr><td>patient_id</td><td>string</td><td>String</td><td></td></tr><tr><td>street</td><td>string</td><td>String</td><td></td></tr><tr><td>use</td><td>string</td><td>String</td><td></td></tr><tr><td>city</td><td>string</td><td>String</td><td></td></tr><tr><td>zip</td><td>string</td><td>String</td><td></td></tr></table><p>Selection Rules:</p><table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" style=\"border: 1px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top;\"><tr style=\"border: 2px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top\"><th scope=\"col\" style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><span title=\"The linkID for the item\">Item</span></th><th scope=\"col\" style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><span title=\"Text for the item\">Coll</span></th><th scope=\"col\" style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><span title=\"Minimum and Maximum # of times the item can appear in the instance\">Type</span></th><th scope=\"col\" style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px\" class=\"hierarchy\"><span title=\"The type of the item\">Description</span></th></tr><tr style=\"border: 1px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white\"><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck1.png)\" class=\"hierarchy\"><img src=\"tbl_spacer.png\" alt=\"\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"icon_vd_view.png\" alt=\"\" style=\"background-color: white; background-color: inherit\" title=\"QuestionnaireRoot\" class=\"hierarchy\"/> patient_addresses</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"></td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\">Patient</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/></tr>\r\n<tr style=\"border: 1px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: #F7F7F7\"><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck11.png)\" class=\"hierarchy\"><img src=\"tbl_spacer.png\" alt=\"\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"tbl_vjoin.png\" alt=\"\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"icon_vd_select.png\" alt=\"\" style=\"background-color: #F7F7F7; background-color: inherit\" title=\"Select\" class=\"hierarchy\"/> <span style=\"position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0\" class=\"sr-only\">patient_addresses / </span>Select</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/></tr>\r\n<tr style=\"border: 1px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white\"><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck100.png)\" class=\"hierarchy\"><img src=\"tbl_spacer.png\" alt=\"\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"tbl_vline.png\" alt=\"\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"tbl_vjoin_end.png\" alt=\"\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"icon_vd_col.png\" alt=\"\" style=\"background-color: white; background-color: inherit\" title=\"Column\" class=\"hierarchy\"/> <span style=\"position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0\" class=\"sr-only\">patient_addresses / Select / </span>patient_id</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"></td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"><span style=\"font-size: 11px\"><code>getResourceKey()</code></span></td></tr>\r\n<tr style=\"border: 1px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: #F7F7F7\"><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck01.png)\" class=\"hierarchy\"><img src=\"tbl_spacer.png\" alt=\"\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"tbl_vjoin_end.png\" alt=\"\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"icon_vd_select.png\" alt=\"\" style=\"background-color: #F7F7F7; background-color: inherit\" title=\"Select\" class=\"hierarchy\"/> <span style=\"position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0\" class=\"sr-only\">patient_addresses / </span>Select</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"><span style=\"font-size: 11px\">for each <code>address</code></span></td></tr>\r\n<tr style=\"border: 1px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white\"><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck010.png)\" class=\"hierarchy\"><img src=\"tbl_spacer.png\" alt=\"\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"tbl_blank.png\" alt=\"\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"tbl_vjoin.png\" alt=\"\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"icon_vd_col.png\" alt=\"\" style=\"background-color: white; background-color: inherit\" title=\"Column\" class=\"hierarchy\"/> <span style=\"position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0\" class=\"sr-only\">patient_addresses / Select / </span>street</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"></td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"><span style=\"font-size: 11px\"><code>line.join('\n')</code></span><br/>The full street address, including newlines if present.</td></tr>\r\n<tr style=\"border: 1px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: #F7F7F7\"><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck010.png)\" class=\"hierarchy\"><img src=\"tbl_spacer.png\" alt=\"\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"tbl_blank.png\" alt=\"\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"tbl_vjoin.png\" alt=\"\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"icon_vd_col.png\" alt=\"\" style=\"background-color: #F7F7F7; background-color: inherit\" title=\"Column\" class=\"hierarchy\"/> <span style=\"position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0\" class=\"sr-only\">patient_addresses / Select / </span>use</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"></td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"><span style=\"font-size: 11px\"><code>use</code></span></td></tr>\r\n<tr style=\"border: 1px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white\"><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck010.png)\" class=\"hierarchy\"><img src=\"tbl_spacer.png\" alt=\"\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"tbl_blank.png\" alt=\"\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"tbl_vjoin.png\" alt=\"\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"icon_vd_col.png\" alt=\"\" style=\"background-color: white; background-color: inherit\" title=\"Column\" class=\"hierarchy\"/> <span style=\"position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0\" class=\"sr-only\">patient_addresses / Select / </span>city</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"></td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"><span style=\"font-size: 11px\"><code>city</code></span></td></tr>\r\n<tr style=\"border: 1px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: #F7F7F7\"><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck000.png)\" class=\"hierarchy\"><img src=\"tbl_spacer.png\" alt=\"\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"tbl_blank.png\" alt=\"\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"tbl_vjoin_end.png\" alt=\"\" style=\"background-color: inherit\" class=\"hierarchy\"/><img src=\"icon_vd_col.png\" alt=\"\" style=\"background-color: #F7F7F7; background-color: inherit\" title=\"Column\" class=\"hierarchy\"/> <span style=\"position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0\" class=\"sr-only\">patient_addresses / Select / </span>zip</td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"></td><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"/><td style=\"vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 1px #F0F0F0 solid; padding:0px 4px 0px 4px\" class=\"hierarchy\"><span style=\"font-size: 11px\"><code>postalCode</code></span></td></tr>\r\n</table></div>"
Cancel

Guided form

No issues.

Checked as you type: structure, cardinality, required bindings, and FHIRPath syntax / SQL-on-FHIR rules

ViewDefinition ViewDefinition
+ Add Element
id id

Logical id of this artifact

meta Meta

Metadata about the resource

+ Add Element
versionId id

Version specific identifier

lastUpdated instant

When the resource version last changed

language code required on save

Language of the resource content

text Narrative

Text summary of the resource, for human interpretation

+ Add Element
status code required on save

generated | extensions | additional | empty

div xhtml

Limited xhtml content

resourceDefinition canonical

Canonical of the definition of this additional resource

name string

Name for this view definition (computer friendly)

status code required on save

draft | active | retired | unknown

resource code required on save

FHIR resource for the ViewDefinition

select BackboneElement

A collection of columns and nested selects to include in the view.

[0] BackboneElement

A collection of columns and nested selects to include in the view.

+ Add Element
column BackboneElement

A column to be produced in the resulting table.

[0] BackboneElement

A column to be produced in the resulting table.

+ Add Element
path string

FHIRPath expression that creates a column and defines its content

name string

Column name produced in the output

[1] BackboneElement

A collection of columns and nested selects to include in the view.

+ Add Element
column BackboneElement

A column to be produced in the resulting table.

[0] BackboneElement

A column to be produced in the resulting table.

+ Add Element
path string

FHIRPath expression that creates a column and defines its content

name string

Column name produced in the output

description markdown

Description of the column

[1] BackboneElement

A column to be produced in the resulting table.

+ Add Element
path string

FHIRPath expression that creates a column and defines its content

name string

Column name produced in the output

[2] BackboneElement

A column to be produced in the resulting table.

+ Add Element
path string

FHIRPath expression that creates a column and defines its content

name string

Column name produced in the output

[3] BackboneElement

A column to be produced in the resulting table.

+ Add Element
path string

FHIRPath expression that creates a column and defines its content

name string

Column name produced in the output

forEach string

A FHIRPath expression to retrieve the parent element(s) used in the containing select. The default is effectively `$this`.

Results

50 rows · 5 ms
patient_idstreetusecityzip
cc4d91b1-f7fa-1b71-b2dc-e1deaa8c1b23906 Larkin Trail Suite 48North Adams01247
3531b381-6226-6483-d895-81db0f093637248 Schoen MissionDanvers01923
3b396703-24db-c472-4252-382bc986b7f0888 Gleichner RoadFitchburg01420
30930edd-aabc-02c2-efb1-bdc3926f64d6497 Streich Byway Unit 98Norfolk00000
fd97950c-5eb3-11ee-0b35-859a567af259549 Stark Ranch Apt 28Framingham01701
4a333f17-8735-6552-a0b6-5651679268ab230 Kilback Boulevard Suite 1Ashby00000
0d46ac7a-3858-7875-6e3a-4810f65a9673617 Abshire TerraceOxford01540
676feac5-1ea1-47df-8237-cc03f89fb7fb851 Hudson RowQuincy02171
f8c2ceae-18e1-9a3e-6f18-22439eecd1ff689 Frami Walk Unit 27Newton02458
9b885218-598e-e06e-6f0b-c07effc3137e365 Aufderhar ExtensionWestwood00000
a71da5c8-25b0-2cb4-ca03-b6f5582546ae738 Fay Throughway Suite 13New Bedford02743
5ab84787-2389-9f80-6d3a-0096bd4fe8a0937 Bayer Vista Unit 8Worcester01604
5c3fc310-5a20-099d-546d-953e22767d02809 Kozey Wall Apt 29Ludlow00000
2c379d9f-03f1-7c6f-83d0-7472bfe270871092 Kihn DriveMedway00000
3ba5d48e-6dc8-0912-e010-56ae49d4cb7e339 Hane Brook Unit 97Lawrence01840
3f7c567f-915f-7ad8-8f9c-4df471cecba4285 O'Keefe UnionWorcester01583
a117066c-a777-9755-5654-c4a135a746e9555 Erdman Hollow Apt 71Norwood02062
5300ca6f-c29f-4f41-5413-16c42a8d7cb0183 Gaylord ParadeSutton00000
45933b9e-b8b8-1e87-cf7c-89951cd0a37c694 Fadel Harbor Unit 58Malden02148
ca8e525b-98f1-92ff-5cea-982b2740365a1017 Block WalkSandwich02563
21880e29-9021-a63a-1dbf-c7825b79219a397 Braun Pathway Unit 62Northampton01062
415a7a79-bab9-da72-5a98-6e8b832468a1720 Connelly Light Suite 50Kingston02364
7a58a1f8-0367-7445-9521-92d57b3e1dab135 Rath ParkCambridge02472
8050d1da-69b0-c27d-1e19-3fe3a5de51d6456 Larson ApproachDeerfield01342
bab75f7d-aa2e-0818-8bd5-93c8c1d770f2696 Wisoky Glen Unit 16Northwest Harwich00000
cd9db86b-5f1b-ebe1-5ba9-61a8e17387131047 Gerlach Trail Unit 46Townsend01469
b959c8e6-92d9-9f50-5927-c9cfb0213f11193 Champlin ParadeCarlisle00000
51150f80-2c6b-b0f4-ecc5-bc2d2606e974700 Eichmann CommonStoughton00000
33642bb5-824b-cc04-d852-99bf6cdecd40720 Barton Mill Unit 69Norton00000
54f145e2-de42-b410-ed3d-6bdcb64df11d677 Ferry BayQuincy02171
1e835ca8-8a3e-6e5d-fc14-76792f590ee8912 Krajcik Center Suite 56Dighton00000
8156eda3-62c7-0885-de92-d2885cc2ef25392 Murphy MewsBarnstable02673
3deedebd-8ec4-d312-a825-c7f81335f1c0125 Romaguera TerraceLawrence01841
e2825dc5-42f1-27f0-39d4-0acd0726547f275 Lang Light Unit 95Chicopee01020
ef5bd2b3-f96c-015b-d8bc-79c61f5cefec111 Cassin Burg Unit 79Melrose02176
5ec91c7b-1328-8c9f-bf20-9f993f804533322 Ebert Divide Unit 88Waltham02452
b835309a-26ff-bd02-0d63-7c0adb20f418921 Satterfield BywayTaunton02780
3316332a-eb7e-edc5-2362-73b6cc30ff4c738 Treutel StravenueShrewsbury00000
a8901f0d-d393-e01b-ea66-e8e8a1a110a7503 Lang PassagePlymouth02360
94d059a8-7642-edae-d2a4-f03079daca5c213 Gleason OrchardBoston02120
cc133976-02f0-8ec6-4993-31722c7cdaba896 Hegmann Common Unit 37Marlborough01752
874899cb-74e1-0b68-d15b-07186f1e2ef7444 Monahan ParadeBoston02152
61ea7940-81fc-67a2-f89b-570bb02b7926753 Walker WellEaston00000
52201ac3-3738-e417-2fd3-55f2a6fd56f9249 Gerhold Walk Suite 81Cambridge02472
93e9de91-4244-31fc-030a-7eba02cd3536513 Erdman SpurGill00000
ba6fa473-0b8d-d41b-8195-2c669fc77cc1345 Cartwright Glen Apt 55Taunton02767
3e46d84b-59d9-d6fb-8200-213723f62198806 Brakus MillFall River02790
839405d4-5c4a-bd85-0a3e-d955440da810537 Rippin OrchardChelsea02149
8904a6ea-8c65-571d-6fd1-b2d55980c1b1783 Kuhic Forge Unit 93Boston02120
a15829a3-c93d-2e4e-4a79-5ee4871dd517773 Cole GroveWestford00000