Dataset Assignation programmatically

Dear All,

I would like to ask if someone has already experinced a batch assignation of dataset to organization units directly in DHIS2 database? I have 10 datasets to assign to a thousands of orguints (which will vary in time) and it will be time consuming if using the Data Set Assignment Editor manually. Your suggestions are welcome.

I am using DHIS2 2.19.

This message and its attachments are confidential and solely for the intended recipients. If received in error, please delete them and notify the sender via reply e-mail immediately.

···

Thank you for your support.

Regards,

Tantely.

The best way would be through the Web API.

I think directly in the db might work (you can test it on a copy of your db). You will have to clear the server cache or restart.

You should also consider an upgrade, as you are a lot of versions behind now…

Knut

···

On Fri, Aug 5, 2016 at 11:35 AM, Raminosoa Rabemanantsoa, Tantely traminosoa@mikolo.org wrote:

Dear All,

I would like to ask if someone has already experinced a batch assignation of dataset to organization units directly in DHIS2 database? I have 10 datasets to assign to a thousands of orguints (which will vary in time) and it will be time consuming if using the Data Set Assignment Editor manually. Your suggestions are welcome.

I am using DHIS2 2.19.

Thank you for your support.

Regards,

Tantely.

This message and its attachments are confidential and solely for the intended recipients. If received in error, please delete them and notify the sender via reply e-mail immediately.


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

Knut Staring

Dept. of Informatics, University of Oslo

Norway: +4791880522

Skype: knutstar

http://dhis2.org

Dear Tantely,

The option would be using API but with the version you are using 2.19 the API is not well developed.

Are the Orgunits grouped or on the same level?

  1. Assign dataset to all Orgunits using Orgunit groups

If you have grouped Orgunits and you particularly interested in assigning to a given Orgunit group then select Orgunit group and assign by group.

Datasets==> Assign Orgunits==>select in group==> choose the group and click on Select in group. You can do this for all the groups and save

image

  1. Assign dataset to all Orgunits using Level

Datasets==>Assign organization unit==> Choose the level ==> Click on Select at Level.

Choose the different levels and save

image

Regards

···

On Fri, Aug 5, 2016 at 12:35 PM, Raminosoa Rabemanantsoa, Tantely traminosoa@mikolo.org wrote:

Dear All,

I would like to ask if someone has already experinced a batch assignation of dataset to organization units directly in DHIS2 database? I have 10 datasets to assign to a thousands of orguints (which will vary in time) and it will be time consuming if using the Data Set Assignment Editor manually. Your suggestions are welcome.

I am using DHIS2 2.19.

Thank you for your support.

Regards,

Tantely.

This message and its attachments are confidential and solely for the intended recipients. If received in error, please delete them and notify the sender via reply e-mail immediately.


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

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

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

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

Prosper Behumbiize, MPH
Global DHIS2 Implementation| HISP Uganda/University Of Oslo
+256 752 751 776 | +256 776 139 139

prosper@hispuganda.org | prosper@dhis2.org | Skype: prospertb

Look at https://play.dhis2.org/demo/api/dataSets/lyLU2wR22tC

and you will see something like

So you can just add them there and post the entire payload back. This is probably the easiest way.

You can also add them one at a time by POSTing to api/dataSets/A/organisationUnits/B

where A is the dataset UID and B is the organisation unit UID.

You can also insert them directly into the table “datasetsource” with SQL. You will need to clear your server cache after this for the changes to become visible.

Regards,

Jaosn

···

On Fri, Aug 5, 2016 at 11:38 AM, Knut Staring knutst@gmail.com wrote:

The best way would be through the Web API.

I think directly in the db might work (you can test it on a copy of your db). You will have to clear the server cache or restart.

You should also consider an upgrade, as you are a lot of versions behind now…

Knut


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 Fri, Aug 5, 2016 at 11:35 AM, Raminosoa Rabemanantsoa, Tantely traminosoa@mikolo.org wrote:

Dear All,

I would like to ask if someone has already experinced a batch assignation of dataset to organization units directly in DHIS2 database? I have 10 datasets to assign to a thousands of orguints (which will vary in time) and it will be time consuming if using the Data Set Assignment Editor manually. Your suggestions are welcome.

I am using DHIS2 2.19.

Thank you for your support.

Regards,

Tantely.

This message and its attachments are confidential and solely for the intended recipients. If received in error, please delete them and notify the sender via reply e-mail immediately.


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

Knut Staring

Dept. of Informatics, University of Oslo

Norway: +4791880522

Skype: knutstar

http://dhis2.org

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

Thank you for your explanation. I had a look at the link and it returned the following message instead of what you mentioned:

falsefalsefalseART monthly summaryrw------falsefalseART 2010falsefalsefalseCUSTOMfalselyLU2wR22tCfalse220Monthly00REPORTING_RATEtruetruefalsetruetruetruerw------L4XTzgbdza3WakikiL4XTzgbdza3

In addition to your explanation, could you please point me to a practical example of manipulating the data through the web API interface as I am new on this?

Regards,

Tantely.

This message and its attachments are confidential and solely for the intended recipients. If received in error, please delete them and notify the sender via reply e-mail immediately.

···

On Fri, Aug 5, 2016 at 12:57 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Look at https://play.dhis2.org/demo/api/dataSets/lyLU2wR22tC

and you will see something like

So you can just add them there and post the entire payload back. This is probably the easiest way.

You can also add them one at a time by POSTing to api/dataSets/A/organisationUnits/B

where A is the dataset UID and B is the organisation unit UID.

You can also insert them directly into the table “datasetsource” with SQL. You will need to clear your server cache after this for the changes to become visible.

Regards,

Jaosn

On Fri, Aug 5, 2016 at 11:38 AM, Knut Staring knutst@gmail.com wrote:

The best way would be through the Web API.

I think directly in the db might work (you can test it on a copy of your db). You will have to clear the server cache or restart.

You should also consider an upgrade, as you are a lot of versions behind now…

Knut


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

On Fri, Aug 5, 2016 at 11:35 AM, Raminosoa Rabemanantsoa, Tantely traminosoa@mikolo.org wrote:

Dear All,

I would like to ask if someone has already experinced a batch assignation of dataset to organization units directly in DHIS2 database? I have 10 datasets to assign to a thousands of orguints (which will vary in time) and it will be time consuming if using the Data Set Assignment Editor manually. Your suggestions are welcome.

I am using DHIS2 2.19.

Thank you for your support.

Regards,

Tantely.

This message and its attachments are confidential and solely for the intended recipients. If received in error, please delete them and notify the sender via reply e-mail immediately.


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

Knut Staring

Dept. of Informatics, University of Oslo

Norway: +4791880522

Skype: knutstar

http://dhis2.org

There are numerous examples in the documentation about how to work with the API. Have you had a look there?

This is a good start.

http://dhis2.github.io/dhis2-docs/2.22/en/developer/html/ch01s10.html

···

On Fri, Aug 5, 2016 at 12:48 PM, Raminosoa Rabemanantsoa, Tantely traminosoa@mikolo.org wrote:

Thank you for your explanation. I had a look at the link and it returned the following message instead of what you mentioned:

falsefalsefalseART monthly summaryrw------falsefalseART 2010falsefalsefalseCUSTOMfalselyLU2wR22tCfalse220Monthly00REPORTING_RATEtruetruefalsetruetruetruerw------L4XTzgbdza3WakikiL4XTzgbdza3

In addition to your explanation, could you please point me to a practical example of manipulating the data through the web API interface as I am new on this?

Regards,

Tantely.

This message and its attachments are confidential and solely for the intended recipients. If received in error, please delete them and notify the sender via reply e-mail immediately.

On Fri, Aug 5, 2016 at 12:57 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Look at https://play.dhis2.org/demo/api/dataSets/lyLU2wR22tC

and you will see something like

So you can just add them there and post the entire payload back. This is probably the easiest way.

You can also add them one at a time by POSTing to api/dataSets/A/organisationUnits/B

where A is the dataset UID and B is the organisation unit UID.

You can also insert them directly into the table “datasetsource” with SQL. You will need to clear your server cache after this for the changes to become visible.

Regards,

Jaosn

On Fri, Aug 5, 2016 at 11:38 AM, Knut Staring knutst@gmail.com wrote:

The best way would be through the Web API.

I think directly in the db might work (you can test it on a copy of your db). You will have to clear the server cache or restart.

You should also consider an upgrade, as you are a lot of versions behind now…

Knut


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

On Fri, Aug 5, 2016 at 11:35 AM, Raminosoa Rabemanantsoa, Tantely traminosoa@mikolo.org wrote:

Dear All,

I would like to ask if someone has already experinced a batch assignation of dataset to organization units directly in DHIS2 database? I have 10 datasets to assign to a thousands of orguints (which will vary in time) and it will be time consuming if using the Data Set Assignment Editor manually. Your suggestions are welcome.

I am using DHIS2 2.19.

Thank you for your support.

Regards,

Tantely.

This message and its attachments are confidential and solely for the intended recipients. If received in error, please delete them and notify the sender via reply e-mail immediately.


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

Knut Staring

Dept. of Informatics, University of Oslo

Norway: +4791880522

Skype: knutstar

http://dhis2.org

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

I see. Thank you for your suggestion. I will familiarise myself with that as it will be helpfull for interacting with DHIS2.

Thank you for your support!

Regards,

Tantely.

This message and its attachments are confidential and solely for the intended recipients. If received in error, please delete them and notify the sender via reply e-mail immediately.

···

On Fri, Aug 5, 2016 at 1:58 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

There are numerous examples in the documentation about how to work with the API. Have you had a look there?

This is a good start.

http://dhis2.github.io/dhis2-docs/2.22/en/developer/html/ch01s10.html

On Fri, Aug 5, 2016 at 12:48 PM, Raminosoa Rabemanantsoa, Tantely traminosoa@mikolo.org wrote:

Thank you for your explanation. I had a look at the link and it returned the following message instead of what you mentioned:

falsefalsefalseART monthly summaryrw------falsefalseART 2010falsefalsefalseCUSTOMfalselyLU2wR22tCfalse220Monthly00REPORTING_RATEtruetruefalsetruetruetruerw------L4XTzgbdza3WakikiL4XTzgbdza3

In addition to your explanation, could you please point me to a practical example of manipulating the data through the web API interface as I am new on this?

Regards,

Tantely.

This message and its attachments are confidential and solely for the intended recipients. If received in error, please delete them and notify the sender via reply e-mail immediately.


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

On Fri, Aug 5, 2016 at 12:57 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Look at https://play.dhis2.org/demo/api/dataSets/lyLU2wR22tC

and you will see something like

So you can just add them there and post the entire payload back. This is probably the easiest way.

You can also add them one at a time by POSTing to api/dataSets/A/organisationUnits/B

where A is the dataset UID and B is the organisation unit UID.

You can also insert them directly into the table “datasetsource” with SQL. You will need to clear your server cache after this for the changes to become visible.

Regards,

Jaosn

On Fri, Aug 5, 2016 at 11:38 AM, Knut Staring knutst@gmail.com wrote:

The best way would be through the Web API.

I think directly in the db might work (you can test it on a copy of your db). You will have to clear the server cache or restart.

You should also consider an upgrade, as you are a lot of versions behind now…

Knut


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

On Fri, Aug 5, 2016 at 11:35 AM, Raminosoa Rabemanantsoa, Tantely traminosoa@mikolo.org wrote:

Dear All,

I would like to ask if someone has already experinced a batch assignation of dataset to organization units directly in DHIS2 database? I have 10 datasets to assign to a thousands of orguints (which will vary in time) and it will be time consuming if using the Data Set Assignment Editor manually. Your suggestions are welcome.

I am using DHIS2 2.19.

Thank you for your support.

Regards,

Tantely.

This message and its attachments are confidential and solely for the intended recipients. If received in error, please delete them and notify the sender via reply e-mail immediately.


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

Knut Staring

Dept. of Informatics, University of Oslo

Norway: +4791880522

Skype: knutstar

http://dhis2.org