Merge and Deleting Facilities

Dear All,
On previous DHIS2 version we were using merge for duplicate sites but
on version 2.22 i can't find merge. Please can someone help me?

Also, after merging i will like to remove the duplicate facility, what
are the procedures to remove or delete a facility.

Thanks in advance for your help

···

--
Regards,

Gerald

Hi Gerald,
This has been raised a few times on the list already. There were some serious flaws with that functionality, and it was removed and has yet to be put back in place.

In the meantime, you can try this

https://github.com/dhis2/dhis2-utils/blob/master/resources/sql/merge_orgunits.sql

and call it directly from the database with

SELECT * FROM merge_organisationunits(‘SOURCE’, ‘DESTINATION’, ‘STRATEGY’);

where

SOURCE = the source orgunit UID

DESTINATION = the destination orgunit UID

STRATEGY= one of SUM,MAX,MIN,AVG,LAST,FIRST

each of those paramaters should be encased with single-quotes.

It goes without saying, this should be thoroughly tested on your non-production system before attempting it on your production machine, as it is a destructive function (meaning things get permanently deleted).

Regards,

Jason

···

On Fri, Jul 29, 2016 at 6:05 PM, gerald thomas gerald17006@gmail.com wrote:

Dear All,

On previous DHIS2 version we were using merge for duplicate sites but

on version 2.22 i can’t find merge. Please can someone help me?

Also, after merging i will like to remove the duplicate facility, what

are the procedures to remove or delete a facility.

Thanks in advance for your help

Regards,

Gerald


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

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

Dear Jason,
Thanks for your help and i will do a test on my laptop.

How can i delete these facilities after merging

···

On 7/29/16, Jason Pickering <jason.p.pickering@gmail.com> wrote:

Hi Gerald,
This has been raised a few times on the list already. There were some
serious flaws with that functionality, and it was removed and has yet to be
put back in place.

In the meantime, you can try this

dhis2-utils/resources/sql/merge_orgunits.sql at master · dhis2/dhis2-utils · GitHub

and call it directly from the database with

SELECT * FROM merge_organisationunits('SOURCE', 'DESTINATION', 'STRATEGY');

where

SOURCE = the source orgunit UID
DESTINATION = the destination orgunit UID
STRATEGY= one of SUM,MAX,MIN,AVG,LAST,FIRST

each of those paramaters should be encased with single-quotes.

It goes without saying, this should be thoroughly tested on your
non-production system before attempting it on your production machine, as
it is a destructive function (meaning things get permanently deleted).

Regards,
Jason

On Fri, Jul 29, 2016 at 6:05 PM, gerald thomas <gerald17006@gmail.com> > wrote:

Dear All,
On previous DHIS2 version we were using merge for duplicate sites but
on version 2.22 i can't find merge. Please can someone help me?

Also, after merging i will like to remove the duplicate facility, what
are the procedures to remove or delete a facility.

Thanks in advance for your help

--
Regards,

Gerald

_______________________________________________
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

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

--
Regards,

Gerald

They are deleted when you perform the merge by that function.

···

On Fri, Jul 29, 2016, 19:01 gerald thomas gerald17006@gmail.com wrote:

Dear Jason,

Thanks for your help and i will do a test on my laptop.

How can i delete these facilities after merging

On 7/29/16, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Gerald,

This has been raised a few times on the list already. There were some

serious flaws with that functionality, and it was removed and has yet to be

put back in place.

In the meantime, you can try this

https://github.com/dhis2/dhis2-utils/blob/master/resources/sql/merge_orgunits.sql

and call it directly from the database with

SELECT * FROM merge_organisationunits(‘SOURCE’, ‘DESTINATION’, ‘STRATEGY’);

where

SOURCE = the source orgunit UID

DESTINATION = the destination orgunit UID

STRATEGY= one of SUM,MAX,MIN,AVG,LAST,FIRST

each of those paramaters should be encased with single-quotes.

It goes without saying, this should be thoroughly tested on your

non-production system before attempting it on your production machine, as

it is a destructive function (meaning things get permanently deleted).

Regards,

Jason

On Fri, Jul 29, 2016 at 6:05 PM, gerald thomas gerald17006@gmail.com > > > wrote:

Dear All,

On previous DHIS2 version we were using merge for duplicate sites but

on version 2.22 i can’t find merge. Please can someone help me?

Also, after merging i will like to remove the duplicate facility, what

are the procedures to remove or delete a facility.

Thanks in advance for your help

Regards,

Gerald


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

Jason P. Pickering

email: jason.p.pickering@gmail.com

tel:+46764147049

Regards,

Gerald

hello Jason,

Please how could we run this without creating a function ?

Sincerely

···

=========================
EKANI Guy

Le Vendredi 29 juillet 2016 18h16, Jason Pickering jason.p.pickering@gmail.com a écrit :

They are deleted when you perform the merge by that function.

On Fri, Jul 29, 2016, 19:01 gerald thomas gerald17006@gmail.com wrote:

Dear Jason,

Thanks for your help and i will do a test on my laptop.

How can i delete these facilities after merging

On 7/29/16, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Gerald,

This has been raised a few times on the list already. There were some

serious flaws with that functionality, and it was removed and has yet to be

put back in place.

In the meantime, you can try this

https://github.com/dhis2/dhis2-utils/blob/master/resources/sql/merge_orgunits.sql

and call it directly from the database with

SELECT * FROM merge_organisationunits(‘SOURCE’, ‘DESTINATION’, ‘STRATEGY’);

where

SOURCE = the source orgunit UID

DESTINATION = the destination orgunit UID

STRATEGY= one of SUM,MAX,MIN,AVG,LAST,FIRST

each of those paramaters should be encased with single-quotes.

It goes without saying, this should be thoroughly tested on your

non-production system before attempting it on your production machine, as

it is a destructive function (meaning things get permanently deleted).

Regards,

Jason

On Fri, Jul 29, 2016 at 6:05 PM, gerald thomas gerald17006@gmail.com > > > wrote:

Dear All,

On previous DHIS2 version we were using merge for duplicate sites but

on version 2.22 i can’t find merge. Please can someone help me?

Also, after merging i will like to remove the duplicate facility, what

are the procedures to remove or delete a facility.

Thanks in advance for your help

Regards,

Gerald


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

Jason P. Pickering

email: jason.p.pickering@gmail.com

tel:+46764147049

Regards,

Gerald


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

Hi Guy,

Well, not really sure you can- This functionality has been removed from the core, so this SQL script is only a work around until it gets back in.

Regards,

Jason

···

On Tue, Aug 30, 2016 at 11:04 AM, Guy Ekani constyekani@yahoo.fr wrote:

hello Jason,

Please how could we run this without creating a function ?

Sincerely

EKANI Guy

=========================

Le Vendredi 29 juillet 2016 18h16, Jason Pickering jason.p.pickering@gmail.com a écrit :

They are deleted when you perform the merge by that function.

On Fri, Jul 29, 2016, 19:01 gerald thomas gerald17006@gmail.com wrote:

Dear Jason,

Thanks for your help and i will do a test on my laptop.

How can i delete these facilities after merging

On 7/29/16, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Gerald,

This has been raised a few times on the list already. There were some

serious flaws with that functionality, and it was removed and has yet to be

put back in place.

In the meantime, you can try this

https://github.com/dhis2/dhis2-utils/blob/master/resources/sql/merge_orgunits.sql

and call it directly from the database with

SELECT * FROM merge_organisationunits(‘SOURCE’, ‘DESTINATION’, ‘STRATEGY’);

where

SOURCE = the source orgunit UID

DESTINATION = the destination orgunit UID

STRATEGY= one of SUM,MAX,MIN,AVG,LAST,FIRST

each of those paramaters should be encased with single-quotes.

It goes without saying, this should be thoroughly tested on your

non-production system before attempting it on your production machine, as

it is a destructive function (meaning things get permanently deleted).

Regards,

Jason

On Fri, Jul 29, 2016 at 6:05 PM, gerald thomas gerald17006@gmail.com

wrote:

Dear All,

On previous DHIS2 version we were using merge for duplicate sites but

on version 2.22 i can’t find merge. Please can someone help me?

Also, after merging i will like to remove the duplicate facility, what

are the procedures to remove or delete a facility.

Thanks in advance for your help

Regards,

Gerald


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

Jason P. Pickering

email: jason.p.pickering@gmail.com

tel:+46764147049

Regards,

Gerald


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

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

1 Like

Dear @Jason Pickering This is wonderful, however, I think it will require a video tutorial to make it simple

@Waheed , thank you for your post. This topic is from 2016 so there has been many changes since.You’re able to use import/export app to perform these tasks. Thank you! (:

Update: I thought it would work! Thank you for the correction @jason. :+1:

@Waheed it might be a good idea to create a feature request to see if it’s possible to bring a better implementation of this. Would you like to create it on jira.dhis2.org? Thank you!