-
Notifications
You must be signed in to change notification settings - Fork 293
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
Pack repeated groups into answers #1936
Conversation
engine/src/test-common/java/com/google/android/fhir/resource/TestingUtils.kt
Outdated
Show resolved
Hide resolved
@kevinmost @omarismail94 @nsabale7 can you please review? thanks! |
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.
Overall looks really good to me
.../src/main/java/com/google/android/fhir/datacapture/extensions/MoreQuestionnairesResponses.kt
Outdated
Show resolved
Hide resolved
.../src/main/java/com/google/android/fhir/datacapture/extensions/MoreQuestionnairesResponses.kt
Outdated
Show resolved
Hide resolved
updated description. |
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.
Do we need to add an Espresso test to verify that a user provided QR that gets answered is saved? i.e. mimicing the issue that Nitin had
engine/src/test-common/java/com/google/android/fhir/resource/TestingUtils.kt
Outdated
Show resolved
Hide resolved
.../src/main/java/com/google/android/fhir/datacapture/extensions/MoreQuestionnairesResponses.kt
Outdated
Show resolved
Hide resolved
.../src/main/java/com/google/android/fhir/datacapture/extensions/MoreQuestionnairesResponses.kt
Outdated
Show resolved
Hide resolved
.../src/main/java/com/google/android/fhir/datacapture/extensions/MoreQuestionnairesResponses.kt
Outdated
Show resolved
Hide resolved
.../src/main/java/com/google/android/fhir/datacapture/extensions/MoreQuestionnairesResponses.kt
Outdated
Show resolved
Hide resolved
i think the QVM test covers this sufficiently. i believe espresso tests (and any other integration tests) should cover broad cases. corner cases should be covered by unit tests. EDIT: spelling |
thanks both @kevinmost @omarismail94. omar - replied to your comments. ptal. |
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 Jing, great change!!
before validation borrows from sdk: google/android-fhir#1936
before validation borrows from sdk: google/android-fhir#1936 Co-authored-by: Sebastian <36365043+SebaMutuku@users.noreply.github.com> Co-authored-by: Peter Lubell-Doughtie <peter@ona.io>
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #1900
Description
In our in-memory representation of QuestionnaireResponse, we nest repeated groups under the parent questionnaire response item as individual answers. However user-provided qustionnaire response JSON has repeated groups flattened as repeated items. To make the QuestionnaireViewModel accept such JSON, we need to pack the repeated groups under the same questionnaire response item. Additionally, when questionnaire response is returned to the application, repeated groups need to be unpacked again.
We created two extension functions
QuestionnaireResponse.packRepeatedGroups
andQuestionnaireResponse.unpackRepeatedGroups
for this.Create packRepeatedGroup and unpackRepeatedGroup functions
Alternative(s) considered
NA
Type
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.