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

Questionnaire Constraint support #2003

Closed
FikriMilano opened this issue May 7, 2023 · 8 comments
Closed

Questionnaire Constraint support #2003

FikriMilano opened this issue May 7, 2023 · 8 comments
Assignees

Comments

@FikriMilano
Copy link
Collaborator

FikriMilano commented May 7, 2023

Is your feature request related to a problem? Please describe.
Do custom validation for a given questionnaire.item with a FHIRPath custom predicate and custom error message.

Use case:
There is a vaccination date field, and we want to make sure that when the user inputs a date. The date must not be before the Patient's DOB.

What should happen:
If the user inputs a date that's before the Patient's DOB. Then show a custom error message below the field: “Date must not be before the DoB”.

Describe the solution you'd like
Add support for Questionnaire Constraint extension to do this.

Describe alternatives you've considered
N/A

Additional context

Would you like to work on the issue?
N/A

@FikriMilano
Copy link
Collaborator Author

@FikriMilano
Copy link
Collaborator Author

another use case is:
enter phone number field
confirm phone number field

if the 2 values are different, then show validation error

cc @mmweru

@FikriMilano
Copy link
Collaborator Author

@jingtang10 it has been finalized that I'm working on this

@FikriMilano
Copy link
Collaborator Author

@shelaghm Should we use the pop-up dialog that displays a list of errors to show a global level error message from this constraint-extension to the user?
What do you suggest?

Screen Shot 2023-10-20 at 13 31 38

@pld
Copy link
Collaborator

pld commented Oct 23, 2023

if we go w/that, is there a setting to disable the "submit anyway" button? there are projects that would not want to have that option available

@FikriMilano
Copy link
Collaborator Author

@pld the visibility of "submit anyway" button is not configurable.
We can discuss to make it configurable, @jingtang10 @santosh-pingle

A question:
Do we have a use case to not use the error dialog itself? or are we ok for that dialog to start showing up in OpenSRP 2? My concern is, our SDK snapshot release should have the latest code on master. So, this dialog should now popping up on our OpenSRP 2 if there are validation errors. This is regardless of what causes the validation errors i.e. it could be from required field or others, so it's not only from this constraint extension.

@jingtang10
Copy link
Collaborator

Closing this in favour of #1849 which was opened first.

@jingtang10
Copy link
Collaborator

if we go w/that, is there a setting to disable the "submit anyway" button? there are projects that would not want to have that option available

@pld we don't have this as a customized option at the moment. but as @FikriMilano said we might be able to add this. i'll create an issue for this.

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

No branches or pull requests

3 participants