This repository was archived by the owner on Sep 11, 2023. It is now read-only.
add initial condition of "false" to pregnancy question #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.