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

App crash when form loaded in edit mode contains unanswered repeat group item #3542

Open
Rkareko opened this issue Oct 7, 2024 · 0 comments

Comments

@Rkareko
Copy link
Contributor

Rkareko commented Oct 7, 2024

Describe the bug
This tickets tracks the google/android-fhir#2685. It is a fix for the app crash bug reported https://github.com/ona-health/hisp-wdf-fhir-resources/issues/522

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Device: [e.g. Samsung Galaxy A2 emulator]
  • Android version: [e.g. Settings -> About phone -> Android version]
  • Build number: [e.g. Settings -> About phone -> Build number]
  • Version [e.g. 24]

Additional context
When a form containing a repeat group item whose fields have not been filled out is saved the generated QuestionnaireResponse does not have response items for the corresponding repeat group items. When opening the form in edit mode the check for whether the QuestionnareResponse contains response items that correspond to the Questionnaire items fails for the repeat group.
The QuestionnaireViewModel.addMissingResponseItems is responsible for adding empty QuestionnaireResponse items for each Questionnaire item. It appears that this does not happen for repeat group items.

The hot fix for this would be to update the QuestionnaireItemComponent.createQuestionnaireResponseItem() to handle repeat group items as well.
From a UI/UX perspective the above change would mean that repeat group items would always be expanded when opening the form in edit mode, example of this show below :

Current appearance of the Medicine repeat group
repeat_group_collapsed

Appearance of the Medicine repeat group when form is open in edit mode after the proposed change
repeat_group_expanded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant