Upload
others
View
4
Download
0
Embed Size (px)
Citation preview
HL7 FHIR DevDays 2020, Virtual Edition, November 17–20, 2020 | @FirelyTeam | #fhirdevdays | www.devdays.com/november-2020
HL7®, FHIR® and the flame Design mark are the registered trademarks of Health Level Seven International and are used with permission.
FHIR Questionnaires and Structured Data Capture
Brian Postlethwaite
1
Who am I?
• Brian Postlethwaite
• Senior Solutions Architect - Telstra Health
• HL7 International Patient Administration co-chair
• HL7 FHIR Management Group member
• .NET fhir-net-api and fhir-net-web-api contributor
• Implementer of SDC!
• Working with FHIR since 2014!
2
What is going to be covered?
• Uses
• FHIR Resource Definitions
• Workflows
• Validation & Handling Errors
• Creating Questionnaires
• Tools/Projects
• Rendering
• Pre-population
~ Survey Monkey for FHIR
Why did we standardize it?
3
Structured Data Capture (SDC) Implementation Guide
•Extensions to the core HL7 definitions• Advanced Rendering• Advanced Form Behaviour• Importing Data into Forms• Extraction of Data from Forms
•Close to publication
http://build.fhir.org/ig/HL7/sdc/
4
Uses of FHIR Questionnaires
• Assessments (Primary Care)
• Assessments (consumer)
• Surveys
• Gov't/Statutory forms
• Referrals template
• Admission form
• Care Plans
• Research
• Oncology
• Pathology
• Public Health Reporting
• Insurance/Payments
• General data entry
5
FHIR Questionnaire Artifacts
• Questionnaire Resource• Definitional Resource
• Similar to StructureDefinition
• May include ValueSet / Terminologies
• QuestionnaireResponse Resource• Record of responses
• Structure mirrors Questionnaire items
• Other• Extensions, Operations, Profiles, Implementation Guides (incl SDC)
6
Resource Definitions
Questionnaire
• Metadata
• Items (nested)• LinkId
• Text
• Item Type
• repeats
• Data rules (validation)
• Formatting hints
QuestionnaireResponse
• Context
• Items (nested)• LinkId (must match)
• Answer value
LinkId joins answer to definitionMUST MATCH
(including the nesting depth)
Item-Type Response Type Definition
group item(Group) An item with children, may be repeating. Could be a section, table or other layout (e.g. tabs)
display (none) Just a label to be displayed (no answer to be collected)
boolean valueBoolean Yes/no answer (checkbox, radio group or similar)
decimal valueDecimal Real number answer (restricted textbox, slider, …)
integer valueInteger Integer answer (restricted textbox, slider, …)
date valueDate Date answer (restricted textbox, date picker …)
dateTime valueDateTime Date and time answer (restricted textbox, date picker …)
time valueTime Time only answer (hour:minute:second) answer independent of date (restricted textbox, …)
string valueString Short free-text answer (single line textbox)
text valueString Longer free-text answer, potentially multi-paragraph (multi-line textbox)
url valueUri URL (website, FTP site, etc.) answer (restricted textbox)
choice valueCoding Coding drawn from a list of options (specified in either the option property, or via the ValueSet referenced in the options property) as an answer (radio buttons, checkboxes, combobox, autocomplete …)
open-choice valueCoding or valueString
Coding drawn from a list of options (as with the choice type) or a free-text entry in a string (similar controls to choice, except with ability to include textbox)
attachment valueAttachment Binary content such as a image, PDF, etc. as an answer (file selector …)
reference valueReference A reference to another resource, e.g. practitioner, organization, etc. (resource finder?)
quantity valueQuantity Question with a combination of a numeric value and unit. ()
http://hl7.org/fhir/valueset-item-type.html
8
Interaction with terminologies
Questionnaire structure• Item types
• Choice, open-choice
• Valueset reference (canonical!)• Item.answerValueSet
• Answer options• valueCoding, initialSelected
• Repeat
• Control selection• Radio buttons, comboboxes, checkboxes,
autocomplete
• Consider the number of potential entries in the list
Extensions• questionnaire-itemControl
• questionnaire-optionExclusive
• preferredTerminologyServer
• questionnaire-unitValueSet
• 11179-permitted-value-valueset
• 11179-permitted-value-conceptmap
Operations
Use the ValueSet $expand operation to either pre-load the values, or use the filter parameter for the auto-complete style usage
9
Initial Value
• Defaulted when creating initial QuestionnaireResponse
• Repeating groups• When a new repetition of a group is
added, initial values should be included
• When using answerOption, then it’s InitialSelected flag indicates which option is used
• May be done client, or server (during $populate)
• SDC: Initial Expression (FHIRpath)
10
Dynamic Behaviour - Enable when
• SDC: EnableWhen Expression (FHIRpath)
• Effects Validation and required
11
Sample Questionnaires
• Enable When radio buttons
• Chained enable when
• Enable When tests
• Bit of Everything – all item types
• Fitness study
• HACC MDS Survey
https://sqlonfhir-r4.azurewebsites.net/fhir/Questionnaire
12
Workflow
• Locate questionnaire to use (for given context)
• Load/render questionnaire (and referenced content)• Pre-populate questionnaire with other data (e.g., patient
demographics, observations etc)
• User enters data• Local validations may occur during data entry
• QuestionnaireResponse is validated by server• Errors/Warnings/issues reported to the user
• QuestionnaireResponse is saved to the target server• Data extracted into other resources
13
Fetching Questionnaires
• Standard FHIR Search API• e.g., by id, title, publisher,
context, etc.• Through references in a
directory
14
Rendering Questionnaires and Recording Responses in QuestionnaireResponse
• User interface to interpret definition, and create response data
• Definition guides user entry, may be different based on data entry device• Mobile, web, native application
• May be validated on client and server
• SDC Provides Advanced Rendering Guidance and Definitions
• LinkId joins answer in QuestionaireReponse to definitions in Questionnaire• MUST MATCH (including the nesting depth)
15
Posting Answers and Subsequently Fetching
• POST to FHIR server• Validates content (draft status may
permit invalid saves)
• May perform additional processing
• Standard FHIR Search API• QuestionnaireResponse.id
• Questionnaire Canonical
• patient demographics (through chaining)
• Status
• Note that individual responses are not directly searchable using the FHIR RESTful API.
• Requires additional processing to other resource types$extract
16
Validation and Handling Errors• FHIR json/xml valid (serialization)
• Core FHIR profile validation (maybe local profiles too)
• QuestionnaireResponse validation• Item Types/Datatypes (using linkId to match)
• Terminology
• Required Fields
• Enable When should be considered
• Repeating fields are per group repetition
• answerOptions/Extensions/Complex Validation
• Base Questionnaires through derivedFrom reference
• Custom validation?
• OperationOutcome• Content/messages appropriate to display to users?
• Location of issue – which control (via linkId)
Validation display example - SmartQedit R4 (smartqedit4.azurewebsites.net)
17
Complex Validation
• Cross field validation
• Conditional rules
• Complex calculations
• Custom Error messages
• Core resources can be profiled with invariants
• Extension adds this capability to Questionnaires
https://sqlonfhir-r4.azurewebsites.net/fhir/Questionnaire/sa-rtw-r4
18
Complex Validation – FhirPath Expression
http://hl7.org/fhir/extension-questionnaire-constraint.html
19
Creating Questionnaires
• Converting existing non FHIR definitions
• U.S National Library of Medicine's Form Builder for LHC-Forms/FHIR Questionnaire (STU3, R4)
• Grahame Grieve’s editor (FHIR Toolkit)
• Telstra Health SmartQ editor (broken)
http://smartqedit4.azurewebsites.net
• Beda Software editorhttp://ui.hl7.beda.software/
• https://fhirpower.bitrix24.site/Stoyan Halaliev (new)
• Using text editor
• Others?
(or combination of the above)
https://lhncbc.github.io/lforms-fhir-app/US National Library of Medicine (USA)
http://ui.hl7.beda.software/questionnaire/edit/dc66fb8f-60b9-4aea-bc4f-4d0e976320aaBeda Software
https://fhirpower.bitrix24.site/ Stoyan Halaliev (Germany)
https://github.com/brianpos/fhirpathtesterBrian Postlethwaite
24
Open-Source Projects
• https://github.com/lhncbc/formbuilder-lhcforms
• https://github.com/beda-software/sdc-hl7-sydney
• https://github.com/beda-software/aidbox-sdc
• https://github.com/FHIR/fhir.js
• https://github.com/gavinl/fhirq-renderer
• https://github.com/brianpos/fhirpathtester
• https://www.microsoft.com/store/productId/9NXV8QDQ154V
25
Pre-population
• Requires:• context/source
• mapping
• processing engine
• Knowledge of source structures(particularly profiled scope)
• Current $populate Options:• Observation based
• FHIRPath based
• StructureMap based
26
Pre-population – Observation based
• Low flexibility of Questionnaire structure in mapping
• Source• Context may be provided in parameter, or SMART
• Item.code for LOINC/SNOMED/other to search
• Extension questionnaire-observationLinkPeriod to define range to check for last observation to read
• Mapping• Item.code for LOINC/SNOMED/other for the values to be
extracted from the observation
• Groups can be used for extracting observation components
• If the system understands that codings like LOINC 21112-8 is patient.birthDate, then it may extract data like this also
28
Pre-population – FHIRPath based
• Source• Context may be provided in parameter, or SMART
• Extension questionnaire-launchContext
• Produces a bundle for processing
• Mapping• FHIR Path expressions for each property to map
• Extension “questionnaire-itemPopulationContext”
• Extension “sdc-questionnaire-initialExpression”
• Leverage variables to assist in calculations• Extension “variable” uses Expression datatype
More Flexible, requires knowledge of FHIRPath and FHIR Queries to create the mappings
29
Demo Pre-Population
https://smartqedit4.azurewebsites.net/Questionnaire/Populatehttps://smartqedit4.azurewebsites.net/Questionnaire/pmstest
http://sqlonfhir-r4.azurewebsites.net/fhir/Library
31
What did you learn?
• Questionnaire / QuestionnaireResponse• Basics
• Data Types
• Terminology Interactions
• Advanced Validation
• Form prefill from other FHIR resources ($populate)
• Open Source / Existing tooling
32
Contact
• During DevDays, you can find / reach me here:• Via Whova App – Speaker’s Gallery
• Email: [email protected]
• FHIR Chat: Zulip
• Other Relevant Sessions:• Customizable Universal Forms
• Ilya Beda
• Thursday 19th Nov 8:00am – 8:45am (check your schedule)
• In this session he is going to demonstrate at least $populate, $expand and $assemble operations.
33
Q&A
• Questionnaire / QuestionnaireResponse• Basics
• Data Types
• Terminology Interactions
• Structure Data Capture• Form prefill from other FHIR resources
• Advanced Validation
• Converting QuestionnaireResponse data into other resources
• Open Source / Existing tooling