Yes that function was introduced sort of under the radar. It works only for aggregate part of the data model.
Will be extended to tracker model at some point.
···
On Thu, Apr 14, 2016 at 1:27 AM, Jason Pickering jason.p.pickering@gmail.com wrote:
Yes, i did indeed overlook the native DHIS2 function, which Lars mentioned. Its good its there and supported by the core code. It was not there when I needed this function though.
It may be useful however to perform this operation via SQL in certain cases however. This function , and hopefully the one from the Java side, was developed specifically to be generic, only accepting a single paramater, the UID of the orgunit to delete. So, if you have other criteria (start date/end date, includeDescendants=true), you would need to feed both functions the UIDs of these sites in the proper manner. If there are children, the function will abort, as one could imagine a situation where you provide the function the UID of the root orgunit, and it would proceed to delete everything. So, its been made more with an atttempt to allow you to delete a site, but not entire branches at the same time, which could be easily achieved by simply calling the function multiple times in the correct order of sites to delete.
The other reason for having it, is it is used by the “merge_orgunits.sql”, which will perform the operation of merging orgunits (which was removed from the core for the time bering). Once the data has been merged (according to some strategies like MIN, MAX, LATEST, etc) the site to be removed will be deleted with this “delete_site_with_data.sql”.
Regards,
Jason
–
On Thu, Apr 14, 2016 at 2:09 AM, Calle Hedberg calle.hedberg@gmail.com wrote:
Lars,
Bugger! - I had overlooked that (and maybe Jason too?). But just to confirm - that dataPruning api call in reality works exactly like the pg function shared by Jason?
Otherwise - very nice to see that has been included. I’ve had some sessions deleting duplicated OrgUnits that have been embedded all over the place, and it can be a pain in the b… to track down all the bits and pieces
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
–
Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049
On 13 April 2016 at 16:53, Lars Helge Øverland lars@dhis2.org wrote:
Hi Mohamed,
in 2.22 we introduced a Web API feature for forcing delete of organisation units:
http://dhis2.github.io/dhis2-docs/master/en/developer/html/ch01s38.html
So if you are able to send a POST request to the following URL if will remove related data/completeness/approval records.
regards,
Lars
Data pruning will remove complete data set registrations, data approvals, data value audits and data values, in this case for an organisation unit.
/api/maintenance/dataPruning/organisationUnits/<org-unit-id>
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
On Wed, Apr 13, 2016 at 1:24 PM, Mohamed Bangura mbangs87@gmail.com wrote:
Hi all,
We are currently trying to delete old facilities from our main server
but nothing seems to be happening since these facilities already have
data.Is there a way one can do this or disable the facilities as this
is currently affecting the completeness of our data.
I need your help please.
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
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
http://www.dhis2.org
–
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
http://www.dhis2.org