FHIR Questionnaire: Connectathon 6
February 28, 2014 4 Comments
The theme for the next FHIR Connectathon has just been decided by the FHIR Management Group, and this time round we’re going to explore the Questionnaire resource. The reason for choosing this is that there is interest in this resource from a number of significant organizations in the healthcare space, and because it supports one of the core requirements in healthcare – the ability to collect information using a form, and to extract information from that form to populate or update a medical record, while always keeping a ‘copy’ of the form.
It’s important to appreciate that the purpose of the Questionnaire is in the collection of information – not to act as a ‘repository’ of that data for later searching. In other words, if the Questionnaire collects something that needs to be recorded outside of that form – like a Condition – then the correct thing to do is to create a formal Condition resource and store that. Searching for data within the Questionnaire is certainly technically feasible, but is discouraged – the spec doesn’t even define any standard search parameters for this.
It is still possible to refer to a Resource from the Questionnaire – you might want to do this if sending a completed Questionnaire to someone else and wish to include the created resources in a bundle – but to do that you must have already extracted the data, created the resource, and then placed a reference to it within the Questionnaire. In some ways, this is like a FHIR Document – where the Questionnaire is analogous to the Composition resource – although the purpose is quite different. And, like a document, you can include all the resources in a bundle and sign it. (We talked about signing in the post on tamper proof auditing)
If you want to be able to record that the resource was created from data in a questionnaire, then the Provenance resource should be used. Provenance.target would refer to the resource, and Provenance.agent would refer to the Questionnaire.
At a high level, there are at 2 ways to use the Questionnaire:
- As a ‘template’, containing only the questions – and potentially layout. (Template is a really overloaded term unfortunately).
- As a ‘form instance’, containing the questions and the answers to those questions, or with the answers only (in which you would need to refer to something else to render it).
The Questionnaire.status property is used to distinguish a specific resource – the diagram below shows how this works.
When it comes to using a Questionnaire to create a form, a common workflow might be:
- Select a blank Questionnaire from a set established as templates. These would be Questionnaire resources with a code of ‘published’.
- Prepopulate the Questionnaire from data sources if available. For example, you might want to include the current medication list or conditions.
- Render the Questionnaire as a form for the user to complete
- Save the completed Questionnaire as an interim Questionnaire.
- Complete the Questionnaire.
- Construct any other resources from the Questionnaire, and place a reference to them in the Questionnaire.
- Save the Questionnaire resource
To store a Questionnaire, you save the resource in the data store in the same way as any other resource. As described above, there may be other resources that were created on the basis of data entered in the Questionnaire that can be referred to from the Questionnaire.
To display a completed Questionnaire (form) to an end user, the simplest way is to store that rendition in the text property of the resource. In that way, any system with minimal FHIR compliance can retrieve and display it. This also gives the creator of the form control over the display format, which senders often require. Of course, as the resource contains structured data it can be rendered in a different way if required – e.g. on a mobile device. If storage space is an issue, then an alternative is to store the answers only in the Questionnaire – with a minimal text property – and require the consumer to retrieve a display template and render locally. The same applies to the a template: you could include the layout in the text element, or require that the recipient render it.
Well that’s an overview of the Questionnaire resource. In the next post we’ll dig a bit more into its structure, and go over this workflow in more detail.