Unique dataset section name

Hello all,

We are customising DHIS2 for MSF, and we have a scenario in which we have 2 different data sets having a data set section each, with the same name.

Ex:

  • Consultation (Data set section) under OPD-General (Dataset)

  • Consultation (Data set section) under OPD-Chronic (Dataset)

We saw that we have a unique constraint on the data set section name.

Also when we tried to work around this by trying to add an attribute to dataset section, called “display name”, we found out that, we cannot add attributes to dataset section.

Is there another way to model this?

Also it would be helpful for us to understand the rationale behind the unique constraint on data set section name, and attributes for data set section.

Thanks,
Aravind

Hi Aravind,

good point. There is actually a Hibernate-managed uniqueness constraint covering both datasetid + name, and hence there should not be a uniqueness constraint on name only. I have removed it in trunk and 2.15 now.

Does this imply that you do not need attributes for sections?

regards,

Lars

···

On Mon, May 5, 2014 at 12:38 PM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Hello all,

We are customising DHIS2 for MSF, and we have a scenario in which we have 2 different data sets having a data set section each, with the same name.

Ex:

  • Consultation (Data set section) under OPD-General (Dataset)
  • Consultation (Data set section) under OPD-Chronic (Dataset)

We saw that we have a unique constraint on the data set section name.

Also when we tried to work around this by trying to add an attribute to dataset section, called “display name”, we found out that, we cannot add attributes to dataset section.

Is there another way to model this?

Also it would be helpful for us to understand the rationale behind the unique constraint on data set section name, and attributes for data set section.

Thanks,
Aravind


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

Hi Lars,

Thanks for the quick response! We would not need the attributes for sections now.

Although, in-order to also support upload of sections with the same name but different datasets through the metadata api, should we also override haveUniqueNames in org.hisp.dhis.dataset.Section and return false?

When we tried to upload duplicate section names without this change through the metadata api, it did not seem to work.

···

Thanks,
Aravind

On Mon, May 5, 2014 at 4:28 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Aravind,

good point. There is actually a Hibernate-managed uniqueness constraint covering both datasetid + name, and hence there should not be a uniqueness constraint on name only. I have removed it in trunk and 2.15 now.

Does this imply that you do not need attributes for sections?

regards,

Lars

On Mon, May 5, 2014 at 12:38 PM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Hello all,

We are customising DHIS2 for MSF, and we have a scenario in which we have 2 different data sets having a data set section each, with the same name.

Ex:

  • Consultation (Data set section) under OPD-General (Dataset)
  • Consultation (Data set section) under OPD-Chronic (Dataset)

We saw that we have a unique constraint on the data set section name.

Also when we tried to work around this by trying to add an attribute to dataset section, called “display name”, we found out that, we cannot add attributes to dataset section.

Is there another way to model this?

Also it would be helpful for us to understand the rationale behind the unique constraint on data set section name, and attributes for data set section.

Thanks,
Aravind


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

You are correct. It has been fixed in trunk now.

regards,

Lars

···

On Tue, May 6, 2014 at 12:08 PM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Hi Lars,

Thanks for the quick response! We would not need the attributes for sections now.

Although, in-order to also support upload of sections with the same name but different datasets through the metadata api, should we also override haveUniqueNames in org.hisp.dhis.dataset.Section and return false?

When we tried to upload duplicate section names without this change through the metadata api, it did not seem to work.

Thanks,
Aravind

On Mon, May 5, 2014 at 4:28 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Aravind,

good point. There is actually a Hibernate-managed uniqueness constraint covering both datasetid + name, and hence there should not be a uniqueness constraint on name only. I have removed it in trunk and 2.15 now.

Does this imply that you do not need attributes for sections?

regards,

Lars

On Mon, May 5, 2014 at 12:38 PM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Hello all,

We are customising DHIS2 for MSF, and we have a scenario in which we have 2 different data sets having a data set section each, with the same name.

Ex:

  • Consultation (Data set section) under OPD-General (Dataset)
  • Consultation (Data set section) under OPD-Chronic (Dataset)

We saw that we have a unique constraint on the data set section name.

Also when we tried to work around this by trying to add an attribute to dataset section, called “display name”, we found out that, we cannot add attributes to dataset section.

Is there another way to model this?

Also it would be helpful for us to understand the rationale behind the unique constraint on data set section name, and attributes for data set section.

Thanks,
Aravind


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

Brilliant! Thanks!

···

-Aravind

On Tue, May 6, 2014 at 3:44 PM, Lars Helge Øverland larshelge@gmail.com wrote:

You are correct. It has been fixed in trunk now.

regards,

Lars

On Tue, May 6, 2014 at 12:08 PM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Hi Lars,

Thanks for the quick response! We would not need the attributes for sections now.

Although, in-order to also support upload of sections with the same name but different datasets through the metadata api, should we also override haveUniqueNames in org.hisp.dhis.dataset.Section and return false?

When we tried to upload duplicate section names without this change through the metadata api, it did not seem to work.

Thanks,
Aravind

On Mon, May 5, 2014 at 4:28 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Aravind,

good point. There is actually a Hibernate-managed uniqueness constraint covering both datasetid + name, and hence there should not be a uniqueness constraint on name only. I have removed it in trunk and 2.15 now.

Does this imply that you do not need attributes for sections?

regards,

Lars

On Mon, May 5, 2014 at 12:38 PM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Hello all,

We are customising DHIS2 for MSF, and we have a scenario in which we have 2 different data sets having a data set section each, with the same name.

Ex:

  • Consultation (Data set section) under OPD-General (Dataset)
  • Consultation (Data set section) under OPD-Chronic (Dataset)

We saw that we have a unique constraint on the data set section name.

Also when we tried to work around this by trying to add an attribute to dataset section, called “display name”, we found out that, we cannot add attributes to dataset section.

Is there another way to model this?

Also it would be helpful for us to understand the rationale behind the unique constraint on data set section name, and attributes for data set section.

Thanks,
Aravind


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