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 inequality operators (<, >, <=, >=) in the enable when statement #818

Closed
jingtang10 opened this issue Oct 7, 2021 · 4 comments · Fixed by #848 or #847
Closed

Implement inequality operators (<, >, <=, >=) in the enable when statement #818

jingtang10 opened this issue Oct 7, 2021 · 4 comments · Fixed by #848 or #847
Assignees
Labels
effort:small Small effort - 2 days P2 Medium priority issue type:enhancement New feature or request

Comments

@jingtang10
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
See documentation for enable when operators: https://www.hl7.org/fhir/valueset-questionnaire-enable-operator.html

At the moment we support exists/eq/not eq but none of the inequality operators.

Describe the solution you'd like
Code change needs to be made here:

private val Questionnaire.QuestionnaireItemEnableWhenComponent.predicate:

to support the 4 operators missing.

Describe alternatives you've considered
Don't think we can use things like fhir path engine. this needs to be implemented in the library.

Additional context
NA

Would you like to work on the issue?
NA

@jingtang10 jingtang10 added the type:enhancement New feature or request label Oct 7, 2021
@Tarun-Bhardwaj Tarun-Bhardwaj added effort:small Small effort - 2 days P2 Medium priority issue labels Oct 13, 2021
@santosh-pingle santosh-pingle self-assigned this Oct 18, 2021
@jingtang10
Copy link
Collaborator Author

@maimoonak can you briefly describe your use case? thanks!

@maimoonak
Copy link
Collaborator

We want to use Enable when for condition age >= 15 but this crashes

EnableWhen on answerInteger (crashes when value input for integer field)
kotlin.NotImplementedError: Enable when operator GREATER_OR_EQUAL is not implemented.
Sample Questionnaire crashes here

Alternate enableExpression is also not workingis is not supported
An alternate is to use enableExpression which also does not work and can be seen here

FHIR Reference

@santosh-pingle
Copy link
Collaborator

santosh-pingle commented Oct 21, 2021

@jingtang10 and me had below offline discussion.
UnitConverter file is required in datacapture to support Quantity dataType in inequality operator PR , therefore prior to inequality PR, it is required another PR which will have separate module with UnitConverter file which currently exist in engine module, then newly created module will be added as dependency module to engine and datacapture module, so that code duplication will be avoided for `UnitConverter'.

Its in progress.

@jingtang10
Copy link
Collaborator Author

linking #847 which was done to prepare for this change

@jingtang10 jingtang10 linked a pull request Nov 10, 2021 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:small Small effort - 2 days P2 Medium priority issue type:enhancement New feature or request
Projects
Archived in project
4 participants