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

: Questionnaire Response Items

Raw xml | Download


<ViewDefinition xmlns="http://hl7.org/fhir"
                resourceDefinition="http://hl7.org/fhir/StructureDefinition/ViewDefinition|3.1.0-draft">
  <id value="QuestionnaireResponseItems"/>
  <language value="en"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: ViewDefinition QuestionnaireResponseItems</b></p><a name="QuestionnaireResponseItems"> </a><a name="hcQuestionnaireResponseItems"> </a><p>This view acts on the QuestionnaireResponse resource to produce a table named &quot;<code>questionnaire_response_items</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>id</td><td>string</td><td>String</td><td></td></tr><tr><td>questionnaire</td><td>string</td><td>String</td><td></td></tr><tr><td>patient_id</td><td>string</td><td>String</td><td></td></tr><tr><td>authored</td><td>dateTime</td><td>DateTime</td><td></td></tr><tr><td>item_link_id</td><td>string</td><td>String</td><td></td></tr><tr><td>item_text</td><td>string</td><td>String</td><td></td></tr><tr><td>answer_value_string</td><td>string</td><td>String</td><td></td></tr><tr><td>answer_value_integer</td><td>integer</td><td>Integer</td><td></td></tr><tr><td>answer_value_boolean</td><td>boolean</td><td>Boolean</td><td></td></tr><tr><td>answer_value_date</td><td>dateTime</td><td>DateTime</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"/> questionnaire_response_items</td><td style="" class="hierarchy xhtCellBorder1"></td><td style="" class="hierarchy xhtCellBorder1">QuestionnaireResponse</td><td style="" class="hierarchy xhtCellBorder1"/></tr>
<tr class="xhtRowBorder1 xhtRowOdd"><td style="background-image: url(tbl_bck11.png)" class="hierarchy xhtCellBorder1 xhtCellNoWrap"><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">questionnaire_response_items / </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_bck110.png)" class="hierarchy xhtCellBorder1 xhtCellNoWrap"><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.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">questionnaire_response_items / Select / </span>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><br/>Unique questionnaire response identifier</td></tr>
<tr class="xhtRowBorder1 xhtRowOdd"><td style="background-image: url(tbl_bck110.png)" class="hierarchy xhtCellBorder1 xhtCellNoWrap"><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.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">questionnaire_response_items / Select / </span>questionnaire</td><td style="" class="hierarchy xhtCellBorder1"></td><td style="" class="hierarchy xhtCellBorder1"/><td style="" class="hierarchy xhtCellBorder1"><span style="font-size: 11px"><code>questionnaire</code></span><br/>Canonical URL of the questionnaire</td></tr>
<tr class="xhtRowBorder1 xhtRowEven"><td style="background-image: url(tbl_bck110.png)" class="hierarchy xhtCellBorder1 xhtCellNoWrap"><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.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">questionnaire_response_items / Select / </span>patient_id</td><td style="" class="hierarchy xhtCellBorder1"></td><td style="" class="hierarchy xhtCellBorder1"/><td style="" class="hierarchy xhtCellBorder1"><span style="font-size: 11px"><code>subject.getReferenceKey(Patient)</code></span><br/>Patient identifier</td></tr>
<tr class="xhtRowBorder1 xhtRowOdd"><td style="background-image: url(tbl_bck100.png)" class="hierarchy xhtCellBorder1 xhtCellNoWrap"><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: #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">questionnaire_response_items / Select / </span>authored</td><td style="" class="hierarchy xhtCellBorder1"></td><td style="" class="hierarchy xhtCellBorder1"/><td style="" class="hierarchy xhtCellBorder1"><span style="font-size: 11px"><code>authored</code></span><br/>Date and time the response was authored</td></tr>
<tr class="xhtRowBorder1 xhtRowEven"><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: white; 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">questionnaire_response_items / </span>Select</td><td style="" class="hierarchy xhtCellBorder1"/><td style="" class="hierarchy xhtCellBorder1"/><td style="" class="hierarchy xhtCellBorder1"/></tr>
<tr class="xhtRowBorder1 xhtRowOdd"><td style="background-image: url(tbl_bck010.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.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">questionnaire_response_items / Select / </span>item_link_id</td><td style="" class="hierarchy xhtCellBorder1"></td><td style="" class="hierarchy xhtCellBorder1"/><td style="" class="hierarchy xhtCellBorder1"><span style="font-size: 11px"><code>linkId</code></span><br/>Unique identifier for this item within the questionnaire</td></tr>
<tr class="xhtRowBorder1 xhtRowEven"><td style="background-image: url(tbl_bck010.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.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">questionnaire_response_items / Select / </span>item_text</td><td style="" class="hierarchy xhtCellBorder1"></td><td style="" class="hierarchy xhtCellBorder1"/><td style="" class="hierarchy xhtCellBorder1"><span style="font-size: 11px"><code>text</code></span><br/>Question text</td></tr>
<tr class="xhtRowBorder1 xhtRowOdd"><td style="background-image: url(tbl_bck001.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_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">questionnaire_response_items / Select / </span>Select</td><td style="" class="hierarchy xhtCellBorder1"/><td style="" class="hierarchy xhtCellBorder1"/><td style="" class="hierarchy xhtCellBorder1"><span style="font-size: 11px">for each <code>answer</code>, or null</span></td></tr>
<tr class="xhtRowBorder1 xhtRowEven"><td style="background-image: url(tbl_bck0010.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_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">questionnaire_response_items / Select / Select / </span>answer_value_string</td><td style="" class="hierarchy xhtCellBorder1"></td><td style="" class="hierarchy xhtCellBorder1"/><td style="" class="hierarchy xhtCellBorder1"><span style="font-size: 11px"><code>value.ofType(string)</code></span><br/>String answer value</td></tr>
<tr class="xhtRowBorder1 xhtRowOdd"><td style="background-image: url(tbl_bck0010.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_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">questionnaire_response_items / Select / Select / </span>answer_value_integer</td><td style="" class="hierarchy xhtCellBorder1"></td><td style="" class="hierarchy xhtCellBorder1"/><td style="" class="hierarchy xhtCellBorder1"><span style="font-size: 11px"><code>value.ofType(integer)</code></span><br/>Integer answer value</td></tr>
<tr class="xhtRowBorder1 xhtRowEven"><td style="background-image: url(tbl_bck0010.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_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">questionnaire_response_items / Select / Select / </span>answer_value_boolean</td><td style="" class="hierarchy xhtCellBorder1"></td><td style="" class="hierarchy xhtCellBorder1"/><td style="" class="hierarchy xhtCellBorder1"><span style="font-size: 11px"><code>value.ofType(boolean)</code></span><br/>Boolean answer value</td></tr>
<tr class="xhtRowBorder1 xhtRowOdd"><td style="background-image: url(tbl_bck0000.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_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">questionnaire_response_items / Select / Select / </span>answer_value_date</td><td style="" class="hierarchy xhtCellBorder1"></td><td style="" class="hierarchy xhtCellBorder1"/><td style="" class="hierarchy xhtCellBorder1"><span style="font-size: 11px"><code>value.ofType(date)</code></span><br/>Date answer value</td></tr>
</table></div>
  </text>
  <name value="questionnaire_response_items"/>
  <status value="draft"/>
  <resource value="QuestionnaireResponse"/>
  <select>
    <column>
      <path value="getResourceKey()"/>
      <name value="id"/>
      <description value="Unique questionnaire response identifier"/>
    </column>
    <column>
      <path value="questionnaire"/>
      <name value="questionnaire"/>
      <description value="Canonical URL of the questionnaire"/>
    </column>
    <column>
      <path value="subject.getReferenceKey(Patient)"/>
      <name value="patient_id"/>
      <description value="Patient identifier"/>
    </column>
    <column>
      <path value="authored"/>
      <name value="authored"/>
      <description value="Date and time the response was authored"/>
    </column>
  </select>
  <select>
    <column>
      <path value="linkId"/>
      <name value="item_link_id"/>
      <description
                   value="Unique identifier for this item within the questionnaire"/>
    </column>
    <column>
      <path value="text"/>
      <name value="item_text"/>
      <description value="Question text"/>
    </column>
    <select>
      <column>
        <path value="value.ofType(string)"/>
        <name value="answer_value_string"/>
        <description value="String answer value"/>
      </column>
      <column>
        <path value="value.ofType(integer)"/>
        <name value="answer_value_integer"/>
        <description value="Integer answer value"/>
      </column>
      <column>
        <path value="value.ofType(boolean)"/>
        <name value="answer_value_boolean"/>
        <description value="Boolean answer value"/>
      </column>
      <column>
        <path value="value.ofType(date)"/>
        <name value="answer_value_date"/>
        <description value="Date answer value"/>
      </column>
      <forEachOrNull value="answer"/>
    </select>
    <repeat value="item"/>
    <repeat value="answer.item"/>
  </select>
</ViewDefinition>