Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

By default, disable items if all items they are depending on have also been disabled #1765

Closed
KhumboLihonga opened this issue Dec 12, 2022 · 4 comments · Fixed by #1790
Closed
Assignees
Labels
P2 Medium priority issue type:enhancement New feature or request

Comments

@KhumboLihonga
Copy link

Is your feature request related to a problem? Please describe.
Let's say there are 3 items - item 1, item 2 and item 3. Item 3 is enabled based on the response of item 2, and item 2 is enabled based on the response of item 1. Let's say item 1 is answered to enable item 2, and item 2 is answered to enable item 3. If the user decides to change item 1 in such a way that hides item 2, item 3 is still visible to the user.

Describe the solution you'd like
Since item 2 has been hidden, and item 3 solely depends on item 2, I expect item 3 to also be hidden.

Describe alternatives you've considered
The alternative is to make item 3 dependent on both item 2 and item 1 but this quickly gets complicated in bigger questionnaires.

Additional context
Here is a video showing this issue and the questionnaire that was used

Would you like to work on the issue?
Not sure who can look into this

@santosh-pingle santosh-pingle added type:enhancement New feature or request P2 Medium priority issue labels Dec 12, 2022
@santosh-pingle
Copy link
Collaborator

yes, it should hide all dependent questionnaire items and clear the captured answers from questionnaire response.

@aditya-07 aditya-07 self-assigned this Dec 27, 2022
@jingtang10 jingtang10 changed the title By default, hide items if all items they are depending on have also been hidden By default, hide items if all items they are depending on have also been disabled Jan 10, 2023
@jingtang10 jingtang10 changed the title By default, hide items if all items they are depending on have also been disabled By default, disable items if all items they are depending on have also been disabled Jan 10, 2023
@jingtang10
Copy link
Collaborator

Thanks for raising this @KhumboLihonga.

In some cases we might not want to clear answers to disabled questions, e.g.:

  • disabled questions might still be used for other calculations?
  • you might want to keep the input values in case the user re-enable the disabled questions

As a result, I'm not so sure this is the intended behaviour. I do feel this might have unintended consequences and I do want to keep as close to the standard as possible. We should double check with the SDC community first.

@KhumboLihonga
Copy link
Author

@jingtang10 thanks for following up on this. Will be waiting to hear what the findings are.

@jingtang10
Copy link
Collaborator

jingtang10 commented Jan 12, 2023

please see the discussion here https://chat.fhir.org/#narrow/stream/179255-questionnaire/topic/Enablewhen.20dependency

to summarise:

  • shouldn't need to change questionnaire
  • we'll fix the library behavior to not use disabled answers
  • we want to retain the answers that are temporarily disabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Medium priority issue type:enhancement New feature or request
Projects
Status: Complete
Development

Successfully merging a pull request may close this issue.

4 participants