I have five stages named observation 1, observation 2, observation 3, observation 4 and observation 5.
I renamed the event/report dates: date of observation 1, date of observation 2, etc.
I want to validate these dates so that date of observation 1 < date of observation 2, date of observation 2 < date of observation 3, date of observation 3 < date of observation 4 and date of observation 4 < date of observation 5.
I don’t think there is a function or variable for that but one workaround could be store each date in a data element per stage and then create an “Error on complete” or “Show error” action comparing the dates.
In this example I have 3 stages (stage 1, Stage 2 and Stage 3) and in each one I added a data element to save the value (I tried this with calculated variables but the outcome was not the same):
I created three “Assign value” rules (one per stage) to assign the amount of days between the event date and the current date. Is important to prioritize the assignment over the error message.
Finally I created the “error” rules. Since I’m storing the amount of days, the condition was configured to show an error if stage2’s number of days was greater or equal to number of days in stage1. This comparison will depend on what you save in the DE
As far as I know, in web (capture app) is not currently possible to assign the “current date” as the report date but you could generate the event after the enrollment and assign either the enrollment or incident date.
If you are using the android app, then what you are looking for is the default behavior: each event is created with the current date and the user can change it later if needed.