Deleting data elements and categories

Hi everyone ,
Are there any possibilities to delete categories and data elements from the system , unless they have been already used and data inserted ?
We don want to use anymore them anymore in our platform .

The system is administered by one of the DHIS2 hosting providers but we would like to proceed by ourself, if it is possible.
Thanks
Paolo

Hi @p.belardi

If the metadata is already associated with data values, it’s not possible to delete the metadata with just one click in the Maintenance app because of association with the data value. I think the recommended approach is to remove the metadata from programs or data sets first, and then changing the sharing settings so they’re only visible to one user only.

Thanks!

1 Like

@p.belardi I would agree with @Gassim that the easiest way is to simply “hide” the metadata from all users by changing the “Public access” sharing property to “No access” and removing/changing any other groups that this metadata may be shared with to “No access”. This will hide the metadata from all users except super users.

There is currently no way via DHIS2 to delete metadata which has data attached to it, or which may be used by other objects such as dashboards, visualizations, etc. A script has been developed for organization units which could serve as the basis for developing your own script for other types of objects. You could also use the API to

  1. Delete all data associated with the data element
  2. Find and remove any visualizations or other objects which might be associated with the data element. You will either need to remove the visualization, or alter it so that it is no longer contains any association to the data element.

Altogether, its not a super-straightforward process, but can be done if you are determined. The easier solution though would be to simply “hide” the data element from being publicly accessible to any user.

Good luck!

Best regards,
Jason

1 Like