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

Populate initial value from dropdown list for questionnaire items with type reference #2065

Merged
merged 27 commits into from
Aug 16, 2023

Conversation

LZRS
Copy link
Collaborator

@LZRS LZRS commented Jul 5, 2023

IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).

Fixes #1830, and close #1831

Description
Adds support for setting initial values using initial expressions for questionnaire field items of type reference in the following forms

Using Resource.id expression

   },
        {
          "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
          "valueExpression": {
            "language": "text/fhirpath",
            "expression": "Patient.id"
          }
        }

and Using Resource

       {
          "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
          "valueExpression": {
            "language": "text/fhirpath",
            "expression": "Patient"
          }
        },

Also adds fix for the autocomplete textview being set to empty when a dropdown item (using the choiceColumn) is selected. Seems to have been occuring when the displayString no longer evaluated to a unique string and .singleOrNull() always evaluated to null

Alternative(s) considered
Have you considered any alternatives? And if so, why have you chosen the approach in this PR?

Type
Choose one: (Bug fix | Feature | Documentation | Testing | Code health | Builds | Releases | Other)

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

omarismail94 and others added 14 commits February 6, 2023 10:04
…e#1778)

* Added custom search paramter.

* Review changes : Injecting ResourceIndexer into ResourceDao
* Show submit button in review mode

* Added tests

* Review comments: Updated the fragment result listener to check explicit result values
* Fix for removing old indexes when resource is updated

* Added comments
Sometimes choiceColumn evaluated to similar 'display' text across many options, and the autocompletetextview text would get set to null
@LZRS LZRS requested review from a team and santosh-pingle as code owners July 5, 2023 22:31
@LZRS LZRS requested a review from omarismail94 July 5, 2023 22:31
@omarismail94 omarismail94 self-assigned this Jul 18, 2023
@omarismail94
Copy link
Contributor

@LZRS Can you add a description of what this change does in the Description section above?

@omarismail94 omarismail94 assigned LZRS and unassigned omarismail94 Jul 18, 2023
@LZRS LZRS requested a review from omarismail94 July 25, 2023 08:29
@LZRS LZRS marked this pull request as draft July 27, 2023 08:56
@LZRS LZRS marked this pull request as ready for review August 2, 2023 12:44
@LZRS
Copy link
Collaborator Author

LZRS commented Aug 2, 2023

@omarismail94 I've added the relevant description and addressed the comments

Co-authored-by: Omar Ismail <44980219+omarismail94@users.noreply.github.com>
@LZRS LZRS requested a review from omarismail94 August 14, 2023 13:27
Copy link
Contributor

@omarismail94 omarismail94 left a comment

Choose a reason for hiding this comment

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

Great change!

auto-merge was automatically disabled August 16, 2023 04:17

Head branch was pushed to by a user without write access

@LZRS LZRS requested a review from omarismail94 August 16, 2023 04:18
Copy link
Contributor

@omarismail94 omarismail94 left a comment

Choose a reason for hiding this comment

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

Nice catch! Good to see our testing also caught it :D

@omarismail94 omarismail94 enabled auto-merge (squash) August 16, 2023 08:22
@omarismail94 omarismail94 merged commit 4b2ae40 into google:master Aug 16, 2023
2 of 3 checks passed
* Returns the unique identifier of a [Type]. Used to differentiate between item answer options that
* may have similar display strings
*/
fun Type.identifierString(context: Context): String =
Copy link
Collaborator

Choose a reason for hiding this comment

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

slightly worried we're not dealing with identify of codes carefully enough. can we make this function much more rigorous please?

for example, comparing two coding just by code but not by system doesn't meet the brief of returning "unique identifier".

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.

Use initial expressions to select the initial value from a dropdown list populated using answer expressions
5 participants