# Auto Unique Identifiers-Alphanumetical

**URL:** <https://community.dhis2.org/t/auto-unique-identifiers-alphanumetical/4741>\
**Category:** Support - Assistance technique\
**Created:** [2 December 2017 09:41 UTC](https://community.dhis2.org/t/auto-unique-identifiers-alphanumetical/4741 "2017-12-02T09:41:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stanley](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/stanley/32/44597_2.png) [@Stanley](https://community.dhis2.org/u/Stanley)\
**Post date:** [2 December 2017 09:41 UTC](https://community.dhis2.org/t/auto-unique-identifiers-alphanumetical/4741/1 "2017-12-02T09:41:20Z")

</div>

Hi,

Can anyone take me through how my tracker capture can automatically generate Unique IDs with a specific algorithm such as first two letters of the first name, first two letters of the surname, last two digits of the year of birth and area code.

Has anyone done this successfully? Or has anyone used another software to generate this kind of UIC.

Thanks

---

<div class="post-metadata">

**Author:** ![Calle\_Hedberg](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/calle_hedberg/32/33875_2.png) [@Calle\_Hedberg](https://community.dhis2.org/u/Calle_Hedberg)\
**Post date:** [2 December 2017 10:13 UTC](https://community.dhis2.org/t/auto-unique-identifiers-alphanumetical/4741/2 "2017-12-02T10:13:07Z")

</div>

Stanley,

See JIRA issue for this - Stian is currently working on it.

Regards

Calle

> **···**
>
> On 2 December 2017 at 11:41, Stanley Kalyati [skalyati@gmail.com](mailto:skalyati@gmail.com) wrote:
> 
> > Hi,
> 
> > Can anyone take me through how my tracker capture can automatically generate Unique IDs with a specific algorithm such as first two letters of the first name, first two letters of the surname, last two digits of the year of birth and area code.
> 
> > 
> 
> > Has anyone done this successfully? Or has anyone used another software to generate this kind of UIC.
> 
> > 
> 
> > Thanks
> 
> > * * *
> > 
> > Mailing list: [https://launchpad.net/~dhis2-devs](https://launchpad.net/~dhis2-devs)
> > 
> > Post to : [dhis2-devs@lists.launchpad.net](mailto:dhis2-devs@lists.launchpad.net)
> > 
> > Unsubscribe : [https://launchpad.net/~dhis2-devs](https://launchpad.net/~dhis2-devs)
> > 
> > More help : [https://help.launchpad.net/ListHelp](https://help.launchpad.net/ListHelp)
> 
> –
> 
> * * *
> 
> Calle Hedberg
> 
> 46D Alma Road, 7700 Rosebank, SOUTH AFRICA
> 
> Tel/fax (home): +27-21-685-6472
> 
> Cell: +27-82-853-5352
> 
> Iridium SatPhone: +8816-315-19119
> 
> Email: [calle.hedberg@gmail.com](mailto:calle.hedberg@gmail.com)
> 
> Skype: calle\_hedberg
> 
> * * *

---

<div class="post-metadata">

**Author:** ![Stanley](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/stanley/32/44597_2.png) [@Stanley](https://community.dhis2.org/u/Stanley)\
**Post date:** [2 December 2017 13:15 UTC](https://community.dhis2.org/t/auto-unique-identifiers-alphanumetical/4741/3 "2017-12-02T13:15:52Z")

</div>

Thanks Calle,

Regards

Stanley

> **···**
>
> On 2 December 2017 at 11:41, Stanley Kalyati [skalyati@gmail.com](mailto:skalyati@gmail.com) wrote:
> 
> > Hi,
> 
> > Can anyone take me through how my tracker capture can automatically generate Unique IDs with a specific algorithm such as first two letters of the first name, first two letters of the surname, last two digits of the year of birth and area code.
> 
> > 
> 
> > Has anyone done this successfully? Or has anyone used another software to generate this kind of UIC.
> 
> > 
> 
> > Thanks
> 
> > * * *
> > 
> > Mailing list: [https://launchpad.net/~dhis2-devs](https://launchpad.net/~dhis2-devs)
> > 
> > Post to : [dhis2-devs@lists.launchpad.net](mailto:dhis2-devs@lists.launchpad.net)
> > 
> > Unsubscribe : [https://launchpad.net/~dhis2-devs](https://launchpad.net/~dhis2-devs)
> > 
> > More help : [https://help.launchpad.net/ListHelp](https://help.launchpad.net/ListHelp)
> 
> –
> 
> * * *
> 
> Calle Hedberg
> 
> [46D Alma Road, 7700 Rosebank, SOUTH AFRICA](https://maps.google.com/?q=46D+Alma+Road,+7700+Rosebank,+SOUTH+AFRICA&entry=gmail&source=g)
> 
> Tel/fax (home): +27-21-685-6472
> 
> Cell: +27-82-853-5352
> 
> Iridium SatPhone: +8816-315-19119
> 
> Email: [calle.hedberg@gmail.com](mailto:calle.hedberg@gmail.com)
> 
> Skype: calle\_hedberg
> 
> * * *

---

<div class="post-metadata">

**Author:** ![sohel](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/sohel/32/26954_2.png) [@sohel](https://community.dhis2.org/u/sohel)\
**Post date:** [31 December 2018 09:40 UTC](https://community.dhis2.org/t/auto-unique-identifiers-alphanumetical/4741/4 "2018-12-31T09:40:32Z")

</div>

Hey have you found a solution for this?

---

<div class="post-metadata">

**Author:** ![Calle\_Hedberg](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/calle_hedberg/32/33875_2.png) [@Calle\_Hedberg](https://community.dhis2.org/u/Calle_Hedberg)\
**Post date:** [26 February 2019 08:28 UTC](https://community.dhis2.org/t/auto-unique-identifiers-alphanumetical/4741/5 "2019-02-26T08:28:26Z")

</div>

Hi,

Auto-generated numbers can now be a combination of sections (random numbers, dates, orgunits) - see the relevant manual(s) for details

Regards  
Calle

---

<div class="post-metadata">

**Author:** ![Terence\_Scott](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/terence_scott/32/26898_2.png) [@Terence\_Scott](https://community.dhis2.org/u/Terence_Scott)\
**Post date:** [26 February 2019 13:28 UTC](https://community.dhis2.org/t/auto-unique-identifiers-alphanumetical/4741/6 "2019-02-26T13:28:22Z")

</div>

Hi,

To add on to what Calle mentioned, you can see a previous post about this here:

> [@How to create entity attribute with generated value	based on others elements](https://community.dhis2.org/t/how-to-create-entity-attribute-with-generated-value-based-on-others-elements/5383/3):
>
> HI Gerard Yes, this is possible with Text Pattern as mentioned previously. One thing I would like to point out is that you create this all in the TE attribute. Therefore, create an attribute (e.g. Unique ID) and then select “Automatically generate”. In the pattern, you can then enter the TextPattern that you require. Please note that to create a string, you separate with - and not with +. This is an example I created: CURRENT\_DATE(yyyy-MM-ww)-“-”-ORG\_UNIT\_CODE(…)-“-”-“A”-SEQUENTIAL(###) The…

Good luck!

---

<div class="post-metadata">

**Author:** ![sohel](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/sohel/32/26954_2.png) [@sohel](https://community.dhis2.org/u/sohel)\
**Post date:** [3 March 2019 08:47 UTC](https://community.dhis2.org/t/auto-unique-identifiers-alphanumetical/4741/7 "2019-03-03T08:47:24Z")

</div>

Actually I was looking for a solution that concatenate few track entity attribute and generate unique identifier. Finally solved the issue by writing a program rule.

In my rule I have concatenated  
Unique Identifier code = First letter of Gender + Org unit code + First 2 character of patient name + birth rank + First 2 character of mother name.

 ![UIC_SAMPLE](https://dhis2.b-cdn.net/uploads/default/original/3X/b/6/b629c506c52795f9072a24094083f33de5b66d97.png)

---

<div class="post-metadata">

**Author:** ![md-rahim](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/m/57b2e6/32.png) [@md-rahim](https://community.dhis2.org/u/md-rahim)\
**Post date:** [23 February 2023 05:44 UTC](https://community.dhis2.org/t/auto-unique-identifiers-alphanumetical/4741/8 "2023-02-23T05:44:11Z")

</div>

Hi,

Is it working? Would you please share the logic or the rules you have created? thanks in advance
