Same report date for 2 different events

Hi, Community
in a tracker program, is it possible not to allow entering the same report date for 2 different events?
Thank you

could you share an example please? (: Thanks!

in a tracker programme, a patient cannot visit the care center more than once a day. but some users mistakenly enter the same date of the event report, as if the patient visited the care center twice on the same day, when this is not possible.
To avoid this type of error, can we not authorize the entry of an event date more than once for the same patient?
Thank you.

1 Like

Good question, thanks! @tracker-analytics ! (:


I believe here you mean more than once during the same day but okay on other days, right? (:

I mean that the application must not allow the entry of two events for the same date

Hi @elmoujarrade and @Gassim,
There isn’t a quick solution in tracker to prevent this behavior. But it is possible with some program rule trickery.
Step 1: Create a date-type data element called VISIT DATE
Step 2: Create a program rule to ASSIGN the event date to the VISIT DATE Data element (expression is true)
Step 3: Create a program rule variable for the VISIT DATE in previous event, called PREVIOUS_EVENT_DATE
Step 4: Create a program rule to SHOW ERROR if V{event_date} = V{PREVIOUS_EVENT_DATE}. Text of the error message could be something like “An event for [stage name] already exists”

This should prevent users from entering two events with the same date into a repeatable stage.


Hi Brian,
Nice trick! I thought about using a program rule but I wasn’t sure how to get the:

Thanks! I hope this solves the issue @elmoujarrade :+1:

Hi,@brian Hi, @Gassim
I was able to do the first step only.
Do you want to give me more details, with screenshots please.
Thank you for your support.