Fast/bulk delete of events

Hi,

We want to quickly (in groups) delete events related to a specific program and/or to a specific org unit (or list of org units). In DHIS2, we only managed to go one by one in the event capture app.

Can anyone recommend us any other convenient and faster way to do this, or if you are aware of an app that may help us?

We have also checked if it is possible to do it through the database, but we did not find easy to locate the table where the event data are stored and it is safe to delete them without loosing references to other objects.

Thank you!

Best,
Petar

···

--
_________________________________________________________________
Petar Jovanovic
Department of Service and Information System Engineering (ESSI)
Universitat Politècnica de Catalunya, BarcelonaTech
Barcelona, Spain
_____________ http://www.essi.upc.edu/~petar/ ___________________

Hi,

The easier way is to use the api/events endpoint and query for events uids you want to delete. Once you have them, you can send http delete method via curl or nodejs or python or php,etc and loop through each to delete them via api/events/uid.

Alex

···

On Wednesday, January 24, 2018, Petar Jovanovic petar@essi.upc.edu wrote:

Hi,

We want to quickly (in groups) delete events related to a specific program and/or to a specific org unit (or list of org units). In DHIS2, we only managed to go one by one in the event capture app.

Can anyone recommend us any other convenient and faster way to do this, or if you are aware of an app that may help us?

We have also checked if it is possible to do it through the database, but we did not find easy to locate the table where the event data are stored and it is safe to delete them without loosing references to other objects.

Thank you!

Best,

Petar


Petar Jovanovic

Department of Service and Information System Engineering (ESSI)

Universitat Politècnica de Catalunya, BarcelonaTech

Barcelona, Spain

_____________ http://www.essi.upc.edu/~petar/ ___________________


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


Alex Tumwesigye

Technical Advisor - DHIS2 (Consultant),
Ministry of Health/AFENET | HISP Uganda

Kampala

Uganda
+256 774149 775, + 256 759 800161

Skype ID: talexie

IT Consultant (Servers, Networks and Security, Health Information Systems - DHIS2, Disease Outbreak & Surveillance Systems) & Solar Consultant

"I don’t want to be anything other than what I have been - one tree hill "

Thanks a lot Alex!

Anyhow, it would be a convenient feature for end users to do it through the DHIS2 interface as well.

Best,

Petar

Obtener Outlook para Android

···

On Wed, Jan 24, 2018 at 9:32 PM +0100, “Alex Tumwesigye” atumwesigye@gmail.com wrote:

Hi,
The easier way is to use the api/events endpoint and query for events uids you want to delete. Once you have them, you can send http delete method via curl or nodejs or python or php,etc and loop through each to delete them via api/events/uid.

Alex

On Wednesday, January 24, 2018, Petar Jovanovic petar@essi.upc.edu wrote:

Hi,

We want to quickly (in groups) delete events related to a specific program and/or to a specific org unit (or list of org units). In DHIS2, we only managed to go one by one in the event capture app.

Can anyone recommend us any other convenient and faster way to do this, or if you are aware of an app that may help us?

We have also checked if it is possible to do it through the database, but we did not find easy to locate the table where the event data are stored and it is safe to delete them without loosing references to other objects.

Thank you!

Best,

Petar


Petar Jovanovic

Department of Service and Information System Engineering (ESSI)

Universitat Politècnica de Catalunya, BarcelonaTech

Barcelona, Spain

_____________ http://www.essi.upc.edu/~petar/ ___________________


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


Alex Tumwesigye

Technical Advisor - DHIS2 (Consultant),
Ministry of Health/AFENET | HISP Uganda

Kampala

Uganda
+256 774149 775, + 256 759 800161

Skype ID: talexie

IT Consultant (Servers, Networks and Security, Health Information Systems - DHIS2, Disease Outbreak & Surveillance Systems) & Solar Consultant

"I don’t want to be anything other than what I have been - one tree hill "

Hi,

For events without registration, bulk deleting directly in the database is easy:

  1. Delete all relevant data element records in the table trackedentitydatavalue (and if relevant trackedentitydatavalueaudit)

  2. Delete the “case” records in the table programstageinstance

Alex’ method using the webAPI is OK for moderate number of records, but can be painful for large numbers

Regards

Calle

···

On 24 January 2018 at 22:41, Petar Jovanovic petar@essi.upc.edu wrote:

Thanks a lot Alex!

Anyhow, it would be a convenient feature for end users to do it through the DHIS2 interface as well.

Best,

Petar

Obtener Outlook para Android

On Wed, Jan 24, 2018 at 9:32 PM +0100, “Alex Tumwesigye” atumwesigye@gmail.com wrote:

Hi,
The easier way is to use the api/events endpoint and query for events uids you want to delete. Once you have them, you can send http delete method via curl or nodejs or python or php,etc and loop through each to delete them via api/events/uid.

Alex

On Wednesday, January 24, 2018, Petar Jovanovic petar@essi.upc.edu wrote:

Hi,

We want to quickly (in groups) delete events related to a specific program and/or to a specific org unit (or list of org units). In DHIS2, we only managed to go one by one in the event capture app.

Can anyone recommend us any other convenient and faster way to do this, or if you are aware of an app that may help us?

We have also checked if it is possible to do it through the database, but we did not find easy to locate the table where the event data are stored and it is safe to delete them without loosing references to other objects.

Thank you!

Best,

Petar


Petar Jovanovic

Department of Service and Information System Engineering (ESSI)

Universitat Politècnica de Catalunya, BarcelonaTech

Barcelona, Spain

_____________ http://www.essi.upc.edu/~petar/ ___________________


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


Alex Tumwesigye

Technical Advisor - DHIS2 (Consultant),
Ministry of Health/AFENET | HISP Uganda

Kampala

Uganda
+256 774149 775, + 256 759 800161

Skype ID: talexie

IT Consultant (Servers, Networks and Security, Health Information Systems - DHIS2, Disease Outbreak & Surveillance Systems) & Solar Consultant

"I don’t want to be anything other than what I have been - one tree hill "


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


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


Hi Petar,

You might be able to adapt this script to your needs. This script will actually delete the orgunit, but I think the relevant part you need is here and here.

It sounds like in your case you want to delete the data, but not the orgunit itself.

You could then wrap this function in a loop, to remove the data in bulk, going one org unit at a time.

Hope this helps,

Jason

···

On Wed, Jan 24, 2018 at 11:01 PM, Calle Hedberg calle.hedberg@gmail.com wrote:

Hi,

For events without registration, bulk deleting directly in the database is easy:

  1. Delete all relevant data element records in the table trackedentitydatavalue (and if relevant trackedentitydatavalueaudit)
  1. Delete the “case” records in the table programstageinstance

Alex’ method using the webAPI is OK for moderate number of records, but can be painful for large numbers

Regards

Calle


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 24 January 2018 at 22:41, Petar Jovanovic petar@essi.upc.edu wrote:

Thanks a lot Alex!

Anyhow, it would be a convenient feature for end users to do it through the DHIS2 interface as well.

Best,

Petar

Obtener Outlook para Android

On Wed, Jan 24, 2018 at 9:32 PM +0100, “Alex Tumwesigye” atumwesigye@gmail.com wrote:

Hi,
The easier way is to use the api/events endpoint and query for events uids you want to delete. Once you have them, you can send http delete method via curl or nodejs or python or php,etc and loop through each to delete them via api/events/uid.

Alex

On Wednesday, January 24, 2018, Petar Jovanovic petar@essi.upc.edu wrote:

Hi,

We want to quickly (in groups) delete events related to a specific program and/or to a specific org unit (or list of org units). In DHIS2, we only managed to go one by one in the event capture app.

Can anyone recommend us any other convenient and faster way to do this, or if you are aware of an app that may help us?

We have also checked if it is possible to do it through the database, but we did not find easy to locate the table where the event data are stored and it is safe to delete them without loosing references to other objects.

Thank you!

Best,

Petar


Petar Jovanovic

Department of Service and Information System Engineering (ESSI)

Universitat Politècnica de Catalunya, BarcelonaTech

Barcelona, Spain

_____________ http://www.essi.upc.edu/~petar/ ___________________


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


Alex Tumwesigye

Technical Advisor - DHIS2 (Consultant),
Ministry of Health/AFENET | HISP Uganda

Kampala

Uganda
+256 774149 775, + 256 759 800161

Skype ID: talexie

IT Consultant (Servers, Networks and Security, Health Information Systems - DHIS2, Disease Outbreak & Surveillance Systems) & Solar Consultant

"I don’t want to be anything other than what I have been - one tree hill "


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


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


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