## Reading material ### 1. Questionnaire resources The [Questionnaire](https://www.hl7.org/fhir/questionnaire.html) resource is a structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection. Questionnaires are suitable for direct data capture (and presentation) of raw data for humans, when there is a need for tight control over data capture and there is no tuned user-interface. With a Questionnaire you can control how questions are phrased, the order (and conditionality) of questions and constraints on allowed responses (e.g. min/max values, list of allowed values). Keep in mind, however, that a Questionnaire often makes it necessary to convert responses to other resources if you want to (re)use the data for querying, analysis and combining data from different sources. The Questionnaire itself has no consistent representation. An instance of the Questionnaire resource contains the definition of a questionnaire. The actual responses to the questionnaire are instances of the resource [QuestionnaireResponse](https://www.hl7.org/fhir/questionnaireresponse.html) and contain a reference to the Questionnaire resource. #### 1.1 Questionnaire Below is a graphical representation of the Questionnaire resource. It consists of metadata (e.g. name, title, date and publisher) and questionnaire items. {{render:Questionnaire-png}} A Questionnaire consists of 3 types of items: 1. `Groups`. These items organize the content of the questionnaire. They must have children and cannot have an answer. 2. `Questions`. These are the actual questions of the questionnaire. They have (optional) answers. 3. `Display`. This item can be used to provide additional text. A display item cannot have children or answers. Group items and question items can have nested items. Below is an example of a question in a questionnaire containing two sub items: a nested display item and a nested question item. {{render:QuestionnaireExample-png}} For example, the xml of this item would be as following: ``` ``` Instead of using the option element you could also use the options element (but not both). Note that in this case you would need to define a ValueSet with the options and refer to this ValueSet. For example: ``` ``` If you wan’t to define a default answer for a question, you can use the initial element. For example, you could initially set the answer of the above question to ‘Cheese’ if you know that this will apply to most people answering this question. When completing the questionnaire, they can either keep this answer or change it to another option. Finally, the element ‘subjectType’ can be used to define the possible resource type(s) of the subject of a Questionnaire (e.g. a Patient). #### 1.2 QuestionnaireResponse A QuestionnaireResponse provides a complete or partial list of answers to a set of questions filles when responding to a questionnaire. A QuestionnaireResponse can be used as stand-alone to send structured data or reference to a Questionnaire that contains the definition of the questionnaire. The QuestionnaireResponse should have the exact same structure as the Questionnaire it is referring to. For example, the xml of a response to the item described above, would look like this: ``` ``` Note that the text elements are not required in the QuestionnaireResponse, but they provide additional context, especially if you use this resource without the Questionnaire. Other important (although not mandatory) elements are subject, author and source. The subject refers to the resource that the questions are about (e.g. an instance of the Patient resource). The author is the one who recorded the answers and the source is the one who answered the questions. These are not necessarily the same. For example, a physician could record answers to questions asked to a patient. In this case, the physician is the author and the patient is the source. Of course, there are cases in which the patient is author as well. #### 1.3 Other resources Other resources that you may need when defining questionnaires are ValueSet, CodeSystem and DataElement. ValueSet and CodeSystem can be used in the definition of answer options. DataElement can be used to define and share common data elements in a questionnaire. DataElement can also be used in the `Questionnaire.item.definition` element to populate an item with data that is stored elsewhere (e.g. the gender of a Patient). The `Questionnaire.item.definition` element can either refer to a DataElement or an ElementDefinition in a StructureDefinition. In the first case, the reference would be for example: `http://hl7.org/fhir/DataElement/gender` In the second case, the reference should contain the name of the StructureDefinition, followed by #, followed by the `Element.id` of the ElementDefinition. An example is given below: `http://hl7.org/fhir/StructureDefinition/Observation#Observation.value[x]` #### 1.4 Profiling questionnaire resources It is not necessary to profile QuestionnaireResponse to control your data if you use Questionnaire. You can validate QuestionnaireResponses against the Questionnaire that they reference (although there’s no standard operation to do this yet). Because of the similarities between the Questionnaire and StructureDefinition resources there have even been discussions to merge the two. We believe, however, that it is better practice to use the Questionnaire resource for the definition of your questionnaire than to profile QuestionnaireResponse. But it also depends on what else you want to do with the Questionnaire resource. If you want to share your questionnaire you will definitely need it. ### 2. Structured data capture (SDC) Structured Data Capture (SDC) are parallel efforts in IHE (custom schema) and FHIR to support standardization in Questionnaire usage and sharing of data elements, as well as enabling pre- and auto-population. The SDC Initiative develops standards on the design, query and return of forms, minimum data element attributes and submission of completed forms to external repositories. Structured data capture is used for example for clinical research and public health forms. sdsdsdsd The SDC Initiative aims to provide: 1. Support of more sophisticated questionnaires (e.g. for clinical research and auditing) 2. Support of pre- and auto-population 3. Standards for sharing common data elements between registries to enable broader and more consistent data element use #### 2.1 SDC Implementation Guide The SDC implementation guide (http://hl7.org/fhir/us/sdc/index.html) provides an infrastructure to standardize the capture and expanded use of patient-level data collected within an EHR. The SDC implementation guide provides a couple of profiles that SDC implementations are expected to conform to: - SDC Data Element (DE) Profile - SDC Questionnaire Profile - SDC Questionnaire Response Profile - SDC Value Set Profile - SDC Code System Profile #### 2.2 Pre- and auto-population Pre- and auto-population are used to (automatically) extract data that is already available elsewhere (e.g. gender of a patient). This saves time and errors caused by double registration of data. The difference between pre- and auto-population is as following. In pre-population responses are pre-populated with EHR-provided patient data and completed by a third party. In auto-population the required data is already available in the data entry system and automatically extracted. The FHIR standard includes a couple of operations that support pre- or auto-population of a questionnaire: - `$populate` – returns QuestionnaireResponse - `$populatehtml` – returns HTML with active submit button - `$populatelink` – returns URL to site displaying interactive and partially populated form To enable questionnaire population you need: - Extension linking to data element with mapping - ConceptMap linking questionnaire questions to data elements with mappings - ConceptMap linking questionnaire questions to source data