-
Notifications
You must be signed in to change notification settings - Fork 315
Fix answer option match for coding initial expression #2887
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
base: master
Are you sure you want to change the base?
Fix answer option match for coding initial expression #2887
Conversation
assertThat(selectedOption.initialSelected).isTrue() | ||
assertThat(question.answerOption.count { it.initialSelected }).isEqualTo(1) |
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.
this is just testing the createObservationChoiceQuestionnaire
function no? i don't think this is necessary.
the important thing in the test case is below: the generated questionnaire response from the population process includes selected answers.
=====
actually, this reveals a problem in the populate function (thanks laz for pointing out) i dont' think it should change the questionnaire... can you fix that?
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 @jingtang10 for the feedback. Yes absolutely.
To confirm, refactoring populate function to modify/update only the questionnaireResponse answers. (rather than current approach of modifying questionnaire's initial or answerOption.selectedAnswer)
cc: @LZRS
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.
Update I've modified functions based on feedback.
Please feel free to let me know if any changes are required.
CC: @LZRS , @jingtang10
datacapture/src/test/java/com/google/android/fhir/datacapture/mapping/ResourceMapperTest.kt
Outdated
Show resolved
Hide resolved
…f github.com:parthfloyd/android-fhir into fix-answer-option-match-for-coding-initialExpression
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #2880
Description
Replaced deep equal check for answerOption in populateInitialValues to a more custom logic for Coding Type & keeping the behavior same for other types.
Alternative(s) considered
None | Looking forward to feedback
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.