Hi DHIS2 Community,
I wanted to share a workaround I used to generate automatically created unique IDs (UIDs) in an Event program, particularly for a Vehicle Request module we built to support our organization’s operational data needs.
Since Event programs don’t natively support autogenerated UIDs like Tracked Entity programs, I used a program rule function to simulate this behavior.
How I did it:
I used the d2:concatenate function in a program rule to combine several data elements that are unique per request:
d2:concatenate( d2:left( #{Staff name}, 3 ), #{Time}, #{Date} )
This approach generates a semi-unique code for each vehicle request. It has worked well so far in reducing confusion and ensuring we can reference each request distinctly.
We’ve also built in email-based approval for supervisors—no DHIS2 login required. Our next step is to link the email responses back into DHIS2 by updating an option set value in the corresponding event.
Below are images of what the email approval looks like and how the Event program UID is working so far.