A Flutter package for working with FHIR® Questionnaires. FHIR® is the registered trademark of HL7 and is used with the permission of HL7. Use of the FHIR trademark does not constitute endorsement of this product by HL7.
This package takes care building the UI of a FHIR R4 Questionnaire, handle behavior and validations and finally generates the QuestionnaireResponse from the user answers.
So far this package only supports FHIR R4 Item Types | Item | Supported |
---|---|---|
Group | :white_check_mark: | |
Display | :white_check_mark: | |
Question | :ballot_box_with_check: | |
Boolean | :white_check_mark: | |
Decimal | :white_check_mark: | |
Integer | :white_check_mark: | |
Date | :white_check_mark: | |
DateTime | :white_check_mark: | |
Time | :white_check_mark: | |
String | :white_check_mark: | |
Text | :white_check_mark: | |
Url | :white_check_mark: | |
Choice | :white_check_mark: | |
OpenChoice | :white_check_mark: | |
Attachment | :white_check_mark: | |
Reference | :ballot_box_with_check: | |
Quantity | :white_check_mark: |
Just add a QuestionnaireView
widget to your widget tree and you will have your Questionnaire UI.
QuestionnaireView(
questionnaire: questionnaire, // A FHIR R4 Questionnaire instance
onAttachmentLoaded: onAttachmentLoaded, // A callback to handle attachment loading (explained below)
locale: locale, // The specific locale for the Button and validation texts
localizations: localizations, // To add support for extra localization
isLoading: loading, // Wether is some ongoing operation before loading the UI
onSubmit: onSubmit, // Callback to get the QuestionnaireResponse
controller: controller, // The QuestionnaireController to use for item view and response generation.
)
QuestionnaireView
requires an object of type Questionnaire this is the definition of the Questionnaire and will be used to build the Form UI and generate the Questions and Answers.isLoading = true
so the QuestionnaireView
will show a Shimmer loading effect view.QuestionnaireResponse
instance ready, you just have to set the subject or whatever extra data you consider necessary but the answers will covered.QuestionnaireView
, the purpose of this controller here is to allow you to use an instance of an extension of QuestionnaireController
so you can override the behavior and widgets.QuestionnaireView
implementation takes care of validations depending on each QuestionnaireItem
definition.