Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Conversation

@KeeyanGhoreshi
Copy link

@KeeyanGhoreshi KeeyanGhoreshi commented Sep 13, 2022

Adds an initial value to the boolean question so that questions associated with "false" will show up when the page loads, rather than requiring the user to double click the checkbox.

Other solutions were looked into to see if the checkbox could be changed into a radio button so that the form could continue to use its 3 value logic (T, F, Null) but it doesn't seem like LForms supports it. Another option would be to write some javascript that searches the DOM after it's built to replace LForm HTML with custom HTML, and then hook that back in to the internal QuestionnaireResponse keeping track of the answers, much like the attestation button or filter button are added to the form already, but that would require quite a bit of work for little benefit.

A more robust option would be to break this form out into an adaptive form where the provider is only shown this question first, before clicking the "next question" button, at which point logic on CRD would return the appropriate form depending on the answer to this boolean. This would replace the enableWhen logic and would probably be the most "correct" option.

Copy link

@zacharyrobin zacharyrobin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works on my end. Loads in initially false and all the questions for patients who can get pregnant are hidden. They also all load correctly when you hit the checkbox.

@smalho01 smalho01 merged commit 0af144a into master Sep 20, 2022
@smalho01 smalho01 deleted the iPledge-initial-condition branch November 2, 2022 18:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants