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

Allow usage of variable and context in answer expression #2039

Merged
merged 23 commits into from
Sep 13, 2023

Conversation

maimoonak
Copy link
Collaborator

Fixes #[issue number]

Description
Currently the answer-expression option loading by fhirpath just evaluates the simple version of expression and does not make use of context, variables, and other context data fhirPathEngine.evaluate(questionnaireResponse, expression.expression). This should use ExpressionEvaluator evaluateExpression method with all context data.

Type
Choose one: Feature

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 13, 2023 15:00
@santosh-pingle
Copy link
Collaborator

@maimoonak
Can you please check on your local machine to see if the build is successful and the unit and Android tests pass as expected?

@omarismail94
I'm not sure, but I'm unable to fetch the detailed log of the Kokoro build failure.
May be not having enough permissions?

@omarismail94
Copy link
Contributor

omarismail94 commented Jun 26, 2023

@maimoonak there is a test that fails:

com.google.android.fhir.datacapture.QuestionnaireViewModelTest > resolveAnswerExpression() should return questionnaire item answer options for answer expression with fhirpath and variable FAILED
    com.google.common.truth.AssertionErrorWithFacts at QuestionnaireViewModelTest.kt:4032

can you fix that?

image

@jingtang10
Copy link
Collaborator

please wait until #2034 is merged. that PR changes the questionnaire view item.

@maimoonak maimoonak assigned jingtang10 and unassigned maimoonak Jul 25, 2023
@jingtang10 jingtang10 enabled auto-merge (squash) September 13, 2023 18:20
@jingtang10 jingtang10 merged commit 66accf7 into google:master Sep 13, 2023
1 of 2 checks passed
@jingtang10 jingtang10 deleted the answer-exp-variable branch September 13, 2023 19:48
Comment on lines +203 to +204
questionnaireResponse: QuestionnaireResponse,
questionnaireItemParentMap: Map<QuestionnaireItemComponent, QuestionnaireItemComponent>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess these 2 were not needed in this API invocation

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.

7 participants