Can we trigger program enrollment completion using program rule or something?
We have a need to complete the enrollment of the program with specifying certain fields with reason to complete etc, so form needs to be submitted with completing.
Any idea how can we do this?
Also, what the major difference between Program Enrollment Complete and Cancel?
Yes, you can use a program rule to make sure that ‘completion’ will only work if specific fields are completed.
Action type
Required settings
Description
Error on complete
Data element to display error next to
Tracked entity attribute to display error next to
Static text
Expression to evaluate and display after static text
Used whenever you’ve cross-consistencies in the form that must be strictly adhered to. This action prevents the user from continuing until the error is resolved. This action differs from the regular Show error since the error is not shown until the user tries to actually complete the form. If you don’t select a data element or a tracked entity attribute to display the error next to, make sure you write a comprehensive error message that helps the user to fix the error.
When creating the program rule, you will specify which field is required and the validation you would like to check. For instance, whether the field should be greater than a certain number or that it shouldn’t be blank.
There are a number of resources that help with creating program rules. The Learner's Guide to Program Rules - DHIS2 Documentation gives a quick and easy intro to using program rules. Let me know if you have any questions!
Would you like to explain this question further? Canceling will basically not save the changes you made to the form.