V{enrollment_status} == ‘COMPLETED’ - Program Rule expression not working

[V{enrollment_status} == ‘COMPLETED’ program rule condition is not working in web DHIS2 instance. My use case is I need to restrict any changes to the enrollment when the enrollment is completed.

How can we achieve this?

Thanks.

Hi @ramavat

What is the program action that you selected in the case the expression is valid?

Program action will be the preventing adding new events to the stage.

What basically I need, if we complete the current enrollment, any changes to the enrollment which completed, should be restricted, no one should be able to do anything in that enrollment as it is completed.

Hi @ramavat,

This is a known issue actually and the JIRA issue for it is here: Jira

The engineering team is working on a multi-platform rule engine for v42 (which will also work in 2.41) where this variable is supported. So if you are on either of these versions, this should likely work within the next few months (When the Capture app version with this support is released).

Best,
Karoline

1 Like

Thank you for your reply. We are using DHIS2 version 2.41.2

Is there any possible way to restrict any changes to the enrollment when the enrollment is complete?

Hey

When you say changes to the enrollment, do you mean the TEIs attributes or the program stages as you mentioned above ‘prevent adding new events to the stage’?

Thanks!

I mean to say changes to program stages and events. if we can restrict them somehow.

Great, so your action selection “Prevent adding new events to stage” should work? The issue is from the expression currently not being validated.

Yes, action will work but what should be the expression here. Condition is I need to check that enrollment is completed, then only will restrict the access.

Also, can we restrict the TEI changes as well?

This is a feature request, please follow up here: Make a section read only for some roles or userGroups - #13 by Gassim