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

🐛 Bug report: Missing enableWhenBehavior for items with multiple enableWhen, resulting in incorrect questionnaire behaviour when used with Spezi #64

Open
1 task done
lukaskollmer opened this issue Dec 2, 2024 · 0 comments · May be fixed by #65
Assignees
Labels
bug Something isn't working

Comments

@lukaskollmer
Copy link
Contributor

lukaskollmer commented Dec 2, 2024

Description

The FHIR spec says that "If there are more than one enableWhen, enableBehavior must be specified".

However, this is not the case for questionnaires created using phoenix; by default adding multiple enableWhens does not also add an enableBehavior field. The field is only added once the user changes the "at least one condition / all conditions must be fulfilled" radio button.

Reproduction

  1. Add multiple conditions to a question
  2. See that the "At least one condition must be fulfilled" option is selected by default
  3. Preview/Download the JSON for the questionnaire
  4. See that there is no enableBehavior field for the item.

Expected behavior

the behaviour should follow the specification

Additional context

This is actually kinda bad, because the default selection in the UI is for the any option, whereas ResearchKitOnFHIR currently defaults missing enableBehavior fields to .all, meaning that if a user were to create a conditional question using the website, with the intention of requiring any of the conditions to be true, saw that option already selected, exported the questionnaire without changing this option, and then imported the JSON into Spezi, it would result in an incorrect questionnaire behaviour (requiring all conditions to be true instead of just a single one).

Code of Conduct

  • I agree to follow this project's Code of Conduct and Contributing Guidelines
@lukaskollmer lukaskollmer added the bug Something isn't working label Dec 2, 2024
@lukaskollmer lukaskollmer self-assigned this Dec 3, 2024
@lukaskollmer lukaskollmer linked a pull request Dec 7, 2024 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant