Automatic generate Unique Id using Org_Unit_Code patterns

Hello,
I´m using Tracker capture for a Malaria Program. There is a requirement where each malaria case has to be identified in a unique way using a pattern (mask) taken from the org unit code. This is the code structure currently setup for the org unit:

##@@@@@@######
The characters that need to be extracted are in the middle of the Org Unit Code, from the character 4 to the 9 (6 characters)

the ORG_UNIT_CODE(^…) function (or mask) extract characters from the edges, but not in the middle, so it did not work

The other try we´ve done is using the “d2” (d2:substring) but this is not applying, it seems just works along with Program Rules

DHIS2 version in use is 2.30

Any idea would be much appreciated

1 Like

Hi @anamariaelsal,

currently, we only support taking substrings from the start or the end of a code. Feel free to add a jira ticket with a suggestion to improve this.

2 Likes