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 the initial value using the initial expression extension for reference type #1831

Closed
wants to merge 8 commits into from
Closed

Conversation

omarismail94
Copy link
Contributor

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

Fixes #1830

Description
When the Questionnaire Type is a Reference, but contains an initial expression extension that returns an ID, make this ID a reference type so that it can be displayed

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

No

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 6 commits February 6, 2023 10:04
* 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
@codecov
Copy link

codecov bot commented Feb 6, 2023

Codecov Report

Merging #1831 (a2e4cde) into master (0794d2a) will increase coverage by 43.49%.
The diff coverage is 0.00%.

❗ Current head a2e4cde differs from pull request most recent head 4d2c62a. Consider uploading reports for the commit 4d2c62a to get more accurate results

@@              Coverage Diff              @@
##             master    #1831       +/-   ##
=============================================
+ Coverage          0   43.49%   +43.49%     
- Complexity        0      409      +409     
=============================================
  Files             0      160      +160     
  Lines             0     6005     +6005     
  Branches          0     1132     +1132     
=============================================
+ Hits              0     2612     +2612     
- Misses            0     2935     +2935     
- Partials          0      458      +458     
Impacted Files Coverage Δ
...android/fhir/datacapture/mapping/ResourceMapper.kt 29.89% <0.00%> (ø)
...acapture/validation/MaxValueConstraintValidator.kt 75.00% <0.00%> (ø)
...id/fhir/datacapture/MoreQuestionnairesResponses.kt 100.00% <0.00%> (ø)
...ogle/android/fhir/sync/remote/RemoteFhirService.kt 0.00% <0.00%> (ø)
...droid/fhir/index/SearchParamDefinitionsProvider.kt 100.00% <0.00%> (ø)
...r/datacapture/views/QuestionnaireItemHeaderView.kt 82.35% <0.00%> (ø)
...ws/QuestionnaireItemAttachmentViewHolderFactory.kt 27.73% <0.00%> (ø)
...n/java/com/google/android/fhir/search/SearchDsl.kt 82.66% <0.00%> (ø)
...android/fhir/datacapture/utilities/FhirPathUtil.kt 0.00% <0.00%> (ø)
... and 151 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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.

As a general comment, should we use the question type as an input when we set initial answers?

For example, IdType may be converted to either a string, or a reference, depending on the question item type. Is this something that's specified in FHIR? Is there a fixed list of allowed mappings? Or is this something we just want to do in our code.

@sevenreup
Copy link

sevenreup commented Feb 7, 2023

@omarismail94 I managed to test the PR, but I found an issue where the initial expression value is not being set.
I used the same questionnaire you defined here. Still cannot get the initial value to show up

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
4 participants