Relationship type in Tracker Program for Water Point / Technician management

Dear All.

Evaluating DHIS2’s relational capabilities, particularly its ability to establish links between entities across different programs (such as technicians and water points) and to maintain a history of changes over time, like the reassignment of technicians.

Additionally, is it possible to extract or analyze data related to these program relationships?

Hi @Mr_jorge

There are logs of documentation and topics related to relationship type. For example, Relationship model - DHIS2 Documentation … There are also API endpoints that could be used: Analytics - DHIS2 Documentation

If these are two different tracked entity types then you would use TEI to TEI relationship across different programs. And If the Technicians are TEIs and the “water points” are events then you would use the event to TEIs relationship type.

Using the API you will be able to get the creation date of the relationship but I’m not sure there’s a record about when the relationship ends.

It would help if you could provide more details about the use-case or an example that we could look into please.

It depends on the analytics that you want. The Maps app (with some limitations - Jira) allow you to see relationships in a map. If you use program indications d2:relationshipCount() you can count how many relationships a TEI has. Then add these maps indicators to the Data Visualizer app / Dashboard app.

For deeper analytics, you would use the API endpoints such as /api/tracker/relationships and /api/analytics/enrollments/query .

Thanks!

Thank you @Gassim I will review the shared links. Consider this scenario: we have multiple water points, each associated with a single technician responsible for maintenance. Maintenance must occur periodically, and we need to track, for each water point, which technician was in charge, when their supervision period began and ended, and when the next technician’s supervision started. If a relationship is removed, all data linked to that relationship will be lost; however, these details are important to track. I have a separate question; I will make a new post for it right now.

Thank you George for the insight! I feel that this is a Water and Sanitation Tracker version use-case for monitoring the quality and availability of water wells so I’m triaging this to the @dhis2-tracker team for their expertise.

For a start, I can help by theorizing and discussing with you the scenario you mentioned. If I may rewrite your words in ‘dhis2 metadata speak/words’:

  • Let’s assume the Water Points and the Technicians to be Tracked Entity Instances.

  • These Water Points are enrolled in a Water Point Maintenance Tracker Program.

  • The association, Technician Assignment (Relationship Type) - an Event to TEI relationship. From: the repeatable Technician Assignment event → to: Technician TEI. The Water Point TEI would be enrolled in this program and the program stage where this Water Point TEI is enrolled is where the relationship is linked.

  • In this Tracker Program, we have a repeatable, Technician Assignment, program stage.

  • A new event is created each time a Technician is assigned to a Water Point.

  • The event will contain data elements start date and end date data elements, and assignment details as well as the Employee ID.

  • Each Technician will have TE attributes such as unique ID (to track the assignments to the Water Point TEIs).

  • When the next technician’s supervision starts (a new Event in the Technician Assignment program stage is created.

I understand that deleting the relationship (technician assignment event-to-TEI) will lose the data; however, since we are saving the start date, end data, employee id and assignment details in the program event, the data will be preserved (without relying on the deleted relationship anymore).

I hope this helps facilitate the discussion and open up for further questions about anything that is not clear.

Thanks!