DHIS 2

Aoa SIir,
Kindly tell me the procedure how data elements id is Created ?

Will i generate it dynamically ?

Hi Omer,
Have you had a look at our user manual?

https://docs.dhis2.org/master/en/developer/html/webapi_system_resource.html#d0e11013

You can also generate these your self. They are just 11 character codes, which start with a letter, followed by a combination of letters and numbers.

Regards,

Jason

···

On Thu, Aug 3, 2017 at 10:33 AM, Omer Butt omerbutt2521@gmail.com wrote:

Aoa SIir,
Kindly tell me the procedure how data elements id is Created ?

Will i generate it dynamically ?


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

Omer,

Jason explains about UIDs, but you are actually asking about internal dataelementid numbers?

Then note that all internal id numbers (e.g. dataelementid, organisationunitid, periodid, etc) are generated sequentially from a hibernate sequence. if you look at any of your postgresql databases in e.g. pgAdmin, then expand “schemas”, you will see there is one Sequence defined called hibernate_sequence - that’s the one being used to generate all kinds of internal ids

You CAN generate such internal ids yourself, but you must be very careful:

  • make sure the instance if offline

  • make absolutely sure that you generate numbers higher than the current hibernate_sequence

  • make absolutely sure that you update the hibernate_sequence current/next numbers to something larger than the highest number you have generated yourself.

In general I’ve only used the above method when absolutely necessary - much better to use the API and let it handle the inserts.

Regards

Calle

···

On 3 August 2017 at 10:42, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Omer,
Have you had a look at our user manual?

https://docs.dhis2.org/master/en/developer/html/webapi_system_resource.html#d0e11013

You can also generate these your self. They are just 11 character codes, which start with a letter, followed by a combination of letters and numbers.

Regards,

Jason


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Thu, Aug 3, 2017 at 10:33 AM, Omer Butt omerbutt2521@gmail.com wrote:

Aoa SIir,
Kindly tell me the procedure how data elements id is Created ?

Will i generate it dynamically ?


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049


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

Skype: calle_hedberg