Skip to content
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

Implement answerOption initialSelected to set initial value for choice #2032

Merged
merged 21 commits into from
Sep 12, 2023

Conversation

maimoonak
Copy link
Collaborator

@maimoonak maimoonak commented Jun 12, 2023

Fixes #2035

Description
Fhir spec allows to add boolean property to set initial selection of answerOptions as defined here . Also Rule 11 specifies that "If one or more answerOption is present, initial cannot be present. Use answerOption.initialSelected instead"

Alternative(s) considered
Rule specifies to use only one of the property for initial answers. When we are creating responseItem we are setting initial value hence updating answer there.

Type
Choose one: (Bug fix | Feature)

Screenshots

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).

@maimoonak maimoonak requested review from a team and santosh-pingle as code owners June 12, 2023 17:37
@maimoonak maimoonak requested a review from aditya-07 June 12, 2023 17:37
@maimoonak maimoonak marked this pull request as draft June 12, 2023 17:39
@maimoonak maimoonak marked this pull request as ready for review June 13, 2023 07:32
ndegwamartin added a commit to opensrp/android-fhir that referenced this pull request Jun 15, 2023
  - With unmerged PR #1
  - With unmerged PR google#1917
  - With unmerged PR google#1978
  - With unmerged PR google#1907
  - With unmerged PR google#2016
  - With unmerged PR google#2032
ndegwamartin added a commit to opensrp/android-fhir that referenced this pull request Jun 26, 2023
      - With unmerged PR #1
      - With unmerged PR google#1917
      - With unmerged PR google#1978
      - With unmerged PR google#1907
      - With unmerged PR google#2016
      - With unmerged PR google#2032
      - With unmerged PR google#1669
ndegwamartin added a commit to opensrp/android-fhir that referenced this pull request Jun 26, 2023
   - With unmerged PR #1
   - With unmerged PR google#1917
   - With unmerged PR google#1978
   - With unmerged PR google#1907
   - With unmerged PR google#2032
   - With unmerged PR google#1669
   - With unmerged PR google#2047
Copy link
Collaborator

@jingtang10 jingtang10 left a comment

Choose a reason for hiding this comment

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

Thanks @maimoonak! Great job! 🙏🙏🙏

@maimoonak maimoonak assigned jingtang10 and unassigned maimoonak Jul 25, 2023
ndegwamartin added a commit to opensrp/android-fhir that referenced this pull request Aug 23, 2023
- With unmerged PR google#2032
- With unmerged PR #1
- With unmerged PR google#1669
- With unmerged PR google#2132
- With unmerged PR #9
ndegwamartin added a commit to opensrp/android-fhir that referenced this pull request Aug 23, 2023
- With unmerged PR google#2032
- With unmerged PR #1
- With unmerged PR google#1669
- With unmerged PR google#2132
ndegwamartin added a commit to opensrp/android-fhir that referenced this pull request Aug 28, 2023
    - With unmerged PR google#2032
    - With unmerged PR #1
    - With unmerged PR google#1669
    - With unmerged PR google#2132
    - With unmerged PR #9
    - With unmerged PR google#2076
    - With unmerged PR #10
Copy link
Collaborator

@jingtang10 jingtang10 left a comment

Choose a reason for hiding this comment

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

Thanks @maimoonak - i do have some comments but this PR is good to be merged. Please just address the comments (in some cases just acknowledge them and create todo/issue). Thanks again for the great work! 🎉🙏👍

ndegwamartin added a commit to opensrp/android-fhir that referenced this pull request Sep 7, 2023
        - With unmerged PR google#2032
        - With unmerged PR #1
        - With unmerged PR google#1669
        - With unmerged PR google#2132
        - With unmerged PR #9
        - With unmerged PR google#2076
        - With unmerged PR #10
ndegwamartin added a commit to opensrp/android-fhir that referenced this pull request Sep 7, 2023
        - With unmerged PR google#2032
        - With unmerged PR #1
        - With unmerged PR google#1669
        - With unmerged PR google#2132
        - With unmerged PR #9
        - With unmerged PR google#2076
        - With unmerged PR #10
@maimoonak
Copy link
Collaborator Author

@jingtang10 the mentioned changes are done and we need to communicate to users in next release about this change... the use of initialSelected instead on initial property for choice questions (and these are breaking changes if anyone was using initial for choice questions).
Also an additional clause was added to by-pass the Rule when initial was set (questionnaire.item was modified by ResourceMapper) incase of initial-expression. An issue is created here #2161 to track it.

@jingtang10 jingtang10 enabled auto-merge (squash) September 12, 2023 14:00
@jingtang10 jingtang10 merged commit 18d6980 into google:master Sep 12, 2023
2 of 3 checks passed
@jingtang10 jingtang10 deleted the option-init-selected branch September 12, 2023 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

Implement answerOption initialSelected to set initial value for choice
4 participants