google / android-fhir

The Android FHIR SDK is a set of Kotlin libraries for building offline-capable, mobile-first healthcare applications using the HL7® FHIR® standard on Android.
https://google.github.io/android-fhir/
Apache License 2.0
465 stars 246 forks source link

Pack repeated groups even if there is only one group in the response #2564

Closed jingtang10 closed 2 weeks ago

jingtang10 commented 2 weeks ago

IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).

Description The current logic to pack repeated groups does not actually look at the questionnaire item at all. It simply packs multiple groups of the same id and assume they are from the same repeated group. This is fine unless if there is only one repeated group answer, the logic won't be able to distinguish this from non-repeated group.

The fix adds the questionnaire item to the logic so it packs if and only if it's a repeated group.

Alternative(s) considered Have you considered any alternatives? And if so, why have you chosen the approach in this PR?

Type Bug fix

Screenshots (if applicable)

Checklist

jingtang10 commented 2 weeks ago

thanks for the review aditya - addressed comments