Skip to content

Repopulate repeating groups relies on QuestionnaireResponse ordering #1940

@liambarnes

Description

@liambarnes

Describe the bug
If a user removes an item from a repeating item that was prepopulated and then subsequently attempts repopulation, the repopulate service does not correctly provide data. It appears to rely on the order of the original items in the QuestionnaireResponse when it compares to the populate information.

To Reproduce

  1. Launch CCMP form
  2. Create new reponse
  3. Navigate to "Recorded problems/diagnoses" in the "Clinical details" section.
  4. Remove an item from the top of the table
  5. Click repopulate
  6. Compare original order of table (image 1) with the repopulate suggestions (image 2)
Image Image
  1. Note how all table entries now mismatch and suggestions are to replace all with new ones rather than just the missing one.

This is a realistic scenario if a user has curated a repeating group and removed unwanted items. Then they save progress and return at a later date. They attempt repopulation to update with any new information but are presented with a large amount of noisy changes.

Expected behavior
Just differences should be presented and not be reliant on a specific order to be maintained.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions