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

Cqf expression implementation for dynamic question title #1959

Merged
merged 30 commits into from
May 17, 2023

Conversation

maimoonak
Copy link
Collaborator

@maimoonak maimoonak commented Apr 7, 2023

Fixes #1945

Description
Display questionnaire.item.text from FHIRPath expression. In a nutshell, it's like calculated expression which's for answer, but this time for questionnaire.item.text. Advance rendering questionnaireallows the cf-expression on title to display it based on other question`s answers example

Type
Choose one: Feature

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

@FikriMilano
Copy link
Collaborator

@maimoonak awesome work here!
I will spare some time tomorrow to review this.

Copy link
Collaborator

@FikriMilano FikriMilano left a comment

Choose a reason for hiding this comment

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

nicely done! 🚀

can you write a test that makes sure when an answer from a QuestionnaireItem was changed, the next QuestionnaireItem.title is updated?

Copy link
Collaborator

@FikriMilano FikriMilano left a comment

Choose a reason for hiding this comment

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

@maimoonak can you also check if the dynamic title works with variable expression?
Try to save the answer to variable expression, then call that variable in cqf expression.

I tried this, it doesn't seem to work, though it works with calculated expression

@maimoonak
Copy link
Collaborator Author

Good catch! Thanks for this. Feedback resolved and PR is ready for review

@jingtang10
Copy link
Collaborator

@shelaghm please take a look at the video @maimoonak attached.

Copy link
Collaborator

@santosh-pingle santosh-pingle left a comment

Choose a reason for hiding this comment

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

@maimoonak thanks!
Is there a way to add unit test to HeaderViewTest and GroupHeaderViewTest where dynamic text from cqf expression can be shown, or android test to QuestionnaireUiEspressoTest ?
otherwise it looks good to me.

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.

Great change! Thanks very much! Just a few comments below:

@dubdabasoduba dubdabasoduba requested a review from a team as a code owner May 5, 2023 08:02
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!

@jingtang10 jingtang10 enabled auto-merge (squash) May 17, 2023 13:59
@jingtang10 jingtang10 merged commit 32939ce into google:master May 17, 2023
1 of 2 checks passed
@jingtang10 jingtang10 deleted the cqf-expression branch May 17, 2023 14:30
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.

CQF expression support
6 participants