← Back to team overview

dhis2-users team mailing list archive

Re: Deleting data elements with data attached to them

 

This can get a lot more complicated if you have already begun making charts, maps, report tables, etc.... and have saved favorites.

You should also make sure that the dataelementid is not used in any of the following tables:

Dataelementgroupmembers
Mapview
Chartdataelements
Datadictionarydataelements
datasetmembers
detargetmembers
expressiondataelement
programstage_dataelements
reporttable_dataelements
(there may be more!)

Dataelementids are also used in indicator defintions, but I don't think referential integrity is enforced.  You should also make sure that you are not using the data element in an numerator or denominator calculations.

If you make a copy of your database locally and you are comfortable using pgadmin you can try to delete the row with the data element you want to remove.  It will give you error messages that show which constraints are being violated and you can delete the reference(s) to the dataelements in those files first.

Randy


From: dhis2-users-bounces+rwilson=msh.org@xxxxxxxxxxxxxxxxxxx [mailto:dhis2-users-bounces+rwilson=msh.org@xxxxxxxxxxxxxxxxxxx] On Behalf Of Brajesh Murari
Sent: Tuesday, December 18, 2012 4:42 AM
To: Alvin Marcelo
Cc: dhis2-users; dhis2-users-bounces+alvin.marcelo=gmail.com@xxxxxxxxxxxxxxxxxxx; Olav Poppe
Subject: Re: [Dhis2-users] Deleting data elements with data attached to them

Also make sure that that "Number of Maternal Deaths" data element should not be part of or associated with any existing data set ( like data entry form ).

Am i right Bob !!!

Regards,
Brajesh
On Tue, Dec 18, 2012 at 4:43 AM, Bob Jolliffe <bobjolliffe@xxxxxxxxx<mailto:bobjolliffe@xxxxxxxxx>> wrote:
On 18 December 2012 00:08, Alvin B. Marcelo <alvin.marcelo@xxxxxxxxx<mailto:alvin.marcelo@xxxxxxxxx>> wrote:
I'm also interested in the answer to the question.

My presumption is that this constraint was placed to ensure that artifacts created from previously defined data elements are will always persist. Another way of saying this is:

If before I saved Number of Maternal Deaths in org_unit January 2012 = 10, deleting the data (10) will result in destroying some integrity that was built into DHIS2.

Am I right?


Yes that's right, Alvin and Nick.  So you would have to delete the datavalues in the database associated with this dataelement before you can remove the dataelement.


Sent from my BB Curve 9320

-----Original Message-----
From: <duttas@xxxxxxxxxxxx<mailto:duttas@xxxxxxxxxxxx>>
Sender: dhis2-users-bounces+alvin.marcelo=gmail.com@xxxxxxxxxxxxxxxxxxx<mailto:gmail.com@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 17 Dec 2012 23:04:16
To: <jason.p.pickering@xxxxxxxxx<mailto:jason.p.pickering@xxxxxxxxx>>; <tran.hispvietnam@xxxxxxxxx<mailto:tran.hispvietnam@xxxxxxxxx>>
Cc: <dhis2-users@xxxxxxxxxxxxxxxxxxx<mailto:dhis2-users@xxxxxxxxxxxxxxxxxxx>>; <op.registrering@xxxxxx<mailto:op.registrering@xxxxxx>>
Subject: [Dhis2-users] Deleting data elements with data attached to them

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-users
Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx<mailto:dhis2-users@xxxxxxxxxxxxxxxxxxx>
Unsubscribe : https://launchpad.net/~dhis2-users
More help   : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-users
Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx<mailto:dhis2-users@xxxxxxxxxxxxxxxxxxx>
Unsubscribe : https://launchpad.net/~dhis2-users
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~dhis2-users
Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx<mailto:dhis2-users@xxxxxxxxxxxxxxxxxxx>
Unsubscribe : https://launchpad.net/~dhis2-users
More help   : https://help.launchpad.net/ListHelp



--
Regards,
Brajesh


References