Skip to content

Conversation

parthfloyd
Copy link
Contributor

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

  • I have read and acknowledged the Code of conduct.
  • I have read the Contributing page.
  • I have signed the Google Individual CLA, or I am covered by my company's Corporate CLA.
  • I have discussed my proposed solution with code owners in the linked issue(s) and we have agreed upon the general approach.
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the style guide of this project.
  • I have run ./gradlew check and ./gradlew connectedCheck to test my changes locally.
  • I have built and run the demo app(s) to verify my change fixes the issue and/or does not break the demo app(s).

Comment on lines +3184 to +3185
assertThat(selectedOption.initialSelected).isTrue()
assertThat(question.answerOption.count { it.initialSelected }).isEqualTo(1)
Copy link
Collaborator

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?

)

val question = questionnaire.item.single()
assertThat(question.answerOption.none { it.initialSelected }).isTrue()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line the same

@github-project-automation github-project-automation bot moved this from New to PR under Review in Android FHIR SDK Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: PR under Review
Development

Successfully merging this pull request may close these issues.

InitialExpression with result of type Coding should ignore display
2 participants