Aka: Conditional Form Workflow for Sequenced Component Forms
This Thurs & Fri, @dkigen and I are privileged to be working with the @PalladiumKenya O3 engineering team in Nairobi. This is one of the issues we’ve been discussing:
Scenario: Palladium finds there are often multiple sets of forms required for a typical HIV clinician to do, depending on some patient characteristics (e.g. sex, age), some in-form answers (e.g. today’s temperature, LMP), and user roles (e.g. some are done by doctors, some only by nurses, etc).
Currently users manually select which forms to do for a given patient based on this logic. But this means open a form, close a form, open, close, open, close, open, close… which is painful.
These are just a few of the forms that can be triggered:
- Cervical Cancer Screening
- ART Adherence
- Pregnancy Screening: e.g. based on Age >15 or LMP >x days
- ILI/Flu Screening: e.g. if Temperature >38*C
- HIV Testing
- TB Screening
Vision: Each of these “mini-forms” (called component forms in O3 schema) should follow a clinical workflow that gets triggered automatically for the user, during a form workflow, so the outpatient end-user only has to follow the flow of a single form experience.
- E.g.: Based on appointment types, this is an ANC client who is HIV positive → Show component forms for HIV and ANC things.
Implementation Ideas:
- Use the form schema to define a workflow, where Component forms would be referenced in the form schema like usual (Referencing Component Forms)
- Trigger logic for each component form in the form schema, by extending the hideWhenExpression to apply to Component Forms, not just questions. This already covers cases like previous question answers in the current form, sex, and age. So e.g. for the Pregnancy Screening, it might look something like:
- { “hide”: { “hideWhenExpression”: “sex !== ‘M’” AND “LMP < 6weeks” }}
- These component forms would ideally also have configuration for if you need them to have their own encounter type to help with subsequent data review (e.g. “Cervical Cancer Screening Encounter”).
Questions:
- Feedback? Suggestions?
- Should we create a showWhenExpression instead? Is this a better user experience than the inverse logic of hideWhen? If so, what’s the lift?
- What challenges would we run into in order to apply User Roles also?
- Would extending the applications of hideWhenExpression to Component Forms also help us with extending hideWhen to things like Form Pages or Sections or Answer Options?
CC @samuel34 @dkayiwa @ibacher @frederic.deniger @mseaton @mogoodrich @ddesimone @slubwama