-
Notifications
You must be signed in to change notification settings - Fork 296
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
Repeated Group: Fix Definition based extraction for multiple answers #1911
Repeated Group: Fix Definition based extraction for multiple answers #1911
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed this solution offline, it makes sense to iterate over the response and then fetch the corresponding questionnaire item since initially this was written assuming that there will be no repeated items. I was just wondering if it may help in performance if we have a map linkId to questionnaireItem instead of doing a find to get the item.
cc: @omarismail94 @santosh-pingle
datacapture/src/test/java/com/google/android/fhir/datacapture/mapping/ResourceMapperTest.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/mapping/ResourceMapper.kt
Outdated
Show resolved
Hide resolved
Thanks @nsabale7. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks so much for this PR 👍🙏
please see my comment below.
datacapture/src/main/java/com/google/android/fhir/datacapture/mapping/ResourceMapper.kt
Outdated
Show resolved
Hide resolved
…ns/fix_repeated_group_extraction # Conflicts: # datacapture/src/main/java/com/google/android/fhir/datacapture/mapping/ResourceMapper.kt
@jingtang10 @santosh-pingle Sorry for the delay. I have done the changes according to the comments given by Jing. I have modified the zipByLinkId and reused as per the point 2. Please review and let me know if any changes. |
.../main/java/com/google/android/fhir/datacapture/extensions/MoreQuestionnaireItemComponents.kt
Outdated
Show resolved
Hide resolved
.../main/java/com/google/android/fhir/datacapture/extensions/MoreQuestionnaireItemComponents.kt
Outdated
Show resolved
Hide resolved
.../main/java/com/google/android/fhir/datacapture/extensions/MoreQuestionnaireItemComponents.kt
Outdated
Show resolved
Hide resolved
…/nsabale7/android-fhir into ns/fix_repeated_group_extraction
@nsabale7 do you have any update regarding this PR? If it's stale, can we close it? |
@omarismail94 No, it needs final review. |
@nsabale7 could you first resolve the conflict in |
…ns/fix_repeated_group_extraction # Conflicts: # datacapture/src/main/java/com/google/android/fhir/datacapture/mapping/ResourceMapper.kt
@omarismail94 I have resolved the conflicts. Please review. |
nice change @nsabale7 to clean up the code! |
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #1794
Description
Iterating only questionnaire response items and finding the corresponding questionnaire item, as repeated groups answers create multiple response items with same linkId.
Alternative(s) considered
Another alternative can be to create a
mapOf<linkId, QuestionnaireItemComponent>
so that it can be used to find bylinkId
.val currentQuestionnaireItem = questionnaireItemList.find { it.linkId == currentQuestionnaireResponseItem.linkId }
can be replaced by map.Type
Choose one: (Bug fix | Feature | Documentation | Testing | Code health | Builds | Releases | Other)
Bug fix
Screenshots (if applicable)
Checklist
./gradlew spotlessApply
and./gradlew spotlessCheck
to check my code follows the style guide of this project../gradlew check
and./gradlew connectedCheck
to test my changes locally.