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: [email protected] 
[mailto:[email protected]] On Behalf Of 
Brajesh Murari
Sent: Tuesday, December 18, 2012 4:42 AM
To: Alvin Marcelo
Cc: dhis2-users; 
[email protected]; 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 
<[email protected]<mailto:[email protected]>> wrote:
On 18 December 2012 00:08, Alvin B. Marcelo 
<[email protected]<mailto:[email protected]>> 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: <[email protected]<mailto:[email protected]>>
Sender: 
[email protected]<mailto:[email protected]>
Date: Mon, 17 Dec 2012 23:04:16
To: <[email protected]<mailto:[email protected]>>; 
<[email protected]<mailto:[email protected]>>
Cc: <[email protected]<mailto:[email protected]>>; 
<[email protected]<mailto:[email protected]>>
Subject: [Dhis2-users] Deleting data elements with data attached to them

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-users
Post to     : 
[email protected]<mailto:[email protected]>
Unsubscribe : https://launchpad.net/~dhis2-users
More help   : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-users
Post to     : 
[email protected]<mailto:[email protected]>
Unsubscribe : https://launchpad.net/~dhis2-users
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~dhis2-users
Post to     : 
[email protected]<mailto:[email protected]>
Unsubscribe : https://launchpad.net/~dhis2-users
More help   : https://help.launchpad.net/ListHelp



--
Regards,
Brajesh

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-users
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~dhis2-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to