Re: [Dhis2-devs] DELETING FACILITIES WITH DATA FROM THE DHIS

2016-04-15 Thread Lars Helge Øverland
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. regards, Lars On Thu, Apr 14, 2016 at 1:27 AM, Jason Pickering < jason.p.picker...@gmail.com> wrote: > Yes, i did indeed overlook

Re: [Dhis2-devs] DELETING FACILITIES WITH DATA FROM THE DHIS

2016-04-13 Thread Jason Pickering
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

Re: [Dhis2-devs] DELETING FACILITIES WITH DATA FROM THE DHIS

2016-04-13 Thread Calle Hedberg
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

Re: [Dhis2-devs] DELETING FACILITIES WITH DATA FROM THE DHIS

2016-04-13 Thread Jose Garcia Muñoz
Hi Lars, good to know! Will also delete trackedentitydatavalues? other questions... what do you think... 1) about adding startDate and endDate (or periods) as parameters? 2) about adding a inlcudeDescendants=true as parameter? so we can remove data from the descendants org. units as well...

Re: [Dhis2-devs] DELETING FACILITIES WITH DATA FROM THE DHIS

2016-04-13 Thread Ime Asangansi
Hi devs, In line with this, are there any plans to restore the 'organizational units merge' functionality that was removed in a previous version? Thanks, Ime On 4/13/2016 12:39 PM, Jason Pickering wrote: Hi there. I have added a Postgresql function to delete a site with data here

Re: [Dhis2-devs] DELETING FACILITIES WITH DATA FROM THE DHIS

2016-04-13 Thread Lars Helge Øverland
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.

Re: [Dhis2-devs] DELETING FACILITIES WITH DATA FROM THE DHIS

2016-04-13 Thread Jason Pickering
Hi there. I have added a Postgresql function to delete a site with data here . Use at your own risk, but we have used this successfully in production systems. Regards, Jason On Wed, Apr 13, 2016 at 8:37

Re: [Dhis2-devs] DELETING FACILITIES WITH DATA FROM THE DHIS

2016-04-13 Thread Calle Hedberg
Hi, Alex and my posts crossed: if you want to keep that historic data, follow Alex' suggestion. But if you want to get rid of it - the data might be irrelevant or duplicates - then using a script is easiest. As far as I know, there is no "Prune Organisational Units" functionality (which would

Re: [Dhis2-devs] DELETING FACILITIES WITH DATA FROM THE DHIS

2016-04-13 Thread Calle Hedberg
Mohamed, I find that the far easiest way of doing this is to 1. Identify all the facilities you want to delete 2. Use a script (simple) to delete any datavalue records linked to those facilities 3. Delete the facilities in the normal user interface, to ensure all related meta-data is removed.

Re: [Dhis2-devs] DELETING FACILITIES WITH DATA FROM THE DHIS

2016-04-13 Thread Alex Tumwesigye
Dear Mohamed, Untag them from datasets. They will not affect your reporting rates and completeness. If you delete them, you will be deleting historical data (which I think you want). How I have solved this problem in Uganda, I always tag them as closed or Non functional using an organisation

[Dhis2-devs] DELETING FACILITIES WITH DATA FROM THE DHIS

2016-04-13 Thread Mohamed Bangura
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.