SQL on FHIR
3.1.0-draft - CI Build 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.1.0-draft 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

: Patient and Contact Address Union

Raw xml | Download


<ViewDefinition xmlns="http://hl7.org/fhir"
                resourceDefinition="http://hl7.org/fhir/StructureDefinition/ViewDefinition|3.1.0-draft">
  <id value="PatientAndContactAddressUnion"/>
  <language value="en"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: ViewDefinition PatientAndContactAddressUnion</b></p><a name="PatientAndContactAddressUnion"> </a><a name="hcPatientAndContactAddressUnion"> </a><p>This view acts on the Patient resource to produce a table named &quot;<code>patient_and_contact_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>resource_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>city</td><td>string</td><td>String</td><td></td></tr><tr><td>zip</td><td>string</td><td>String</td><td></td></tr><tr><td>is_patient</td><td>boolean</td><td>Boolean</td><td></td></tr></table><p>Selection Rules:</p><table border="1" cellpadding="0" cellspacing="0" class="xhtTableBorder1"><tr class="xhtRowBorder2"><th scope="col" style="" class="hierarchy xhtCellBorder1"><span title="The linkID for the item">Item</span></th><th scope="col" style="" class="hierarchy xhtCellBorder1"><span title="Text for the item">Coll</span></th><th scope="col" style="" class="hierarchy xhtCellBorder1"><span title="Minimum and Maximum # of times the item can appear in the instance">Type</span></th><th scope="col" style="" class="hierarchy xhtCellBorder1"><span title="The type of the item">Description</span></th></tr><tr class="xhtRowBorder1 xhtRowEven"><td style="background-image: url(tbl_bck1.png)" class="hierarchy xhtCellBorder1 xhtCellNoWrap"><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_and_contact_addresses</td><td style="" class="hierarchy xhtCellBorder1"></td><td style="" class="hierarchy xhtCellBorder1">Patient</td><td style="" class="hierarchy xhtCellBorder1"/></tr>
<tr class="xhtRowBorder1 xhtRowOdd"><td style="background-image: url(tbl_bck01.png)" class="hierarchy xhtCellBorder1 xhtCellNoWrap"><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_and_contact_addresses / </span>Select</td><td style="" class="hierarchy xhtCellBorder1"/><td style="" class="hierarchy xhtCellBorder1"/><td style="" class="hierarchy xhtCellBorder1"/></tr>
<tr class="xhtRowBorder1 xhtRowEven"><td style="background-image: url(tbl_bck000.png)" class="hierarchy xhtCellBorder1 xhtCellNoWrap"><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: 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_and_contact_addresses / Select / </span>resource_id</td><td style="" class="hierarchy xhtCellBorder1"></td><td style="" class="hierarchy xhtCellBorder1"/><td style="" class="hierarchy xhtCellBorder1"><span style="font-size: 11px"><code>getResourceKey()</code></span></td></tr>
</table></div>
  </text>
  <name value="patient_and_contact_addresses"/>
  <status value="draft"/>
  <resource value="Patient"/>
  <select>
    <column>
      <path value="getResourceKey()"/>
      <name value="resource_id"/>
    </column>
    <unionAll>
      <column>
        <path value="line.join('
')"/>
        <name value="street"/>
      </column>
      <column>
        <path value="city"/>
        <name value="city"/>
      </column>
      <column>
        <path value="postalCode"/>
        <name value="zip"/>
      </column>
      <column>
        <path value="true"/>
        <name value="is_patient"/>
      </column>
      <forEach value="address"/>
    </unionAll>
    <unionAll>
      <column>
        <path value="line.join('
')"/>
        <name value="street"/>
      </column>
      <column>
        <path value="city"/>
        <name value="city"/>
      </column>
      <column>
        <path value="postalCode"/>
        <name value="zip"/>
      </column>
      <column>
        <path value="false"/>
        <name value="is_patient"/>
      </column>
      <forEach value="contact.address"/>
    </unionAll>
  </select>
</ViewDefinition>