Calculate transferred patients

Hi all, I have a question about the transfer function in Tracker capture app. We have the function to transfer a patient to a new orgunit. But is there a way to calculate the transferred patients using this function without using adding any data element?

Thank you for your help,

Huyen.

Hello @lehuyen! Thanks for this great question, which relates to some new features upcoming for tracker analytics.

A patient’s “transfer” is represented in DHIS2 as a change in the “ownership” of the TEI for a given program. There can be a temporary transfer of ownership (one-time referral) or a permanent transfer.

These changes in ownership are recorded in the database in the following tables

Temporary Permanent
Current programtempowner trackedentityprogramowner
History programtempownershipaudit programownershiphistory

Unfortunately, these data are not yet exposed through the API or the core DHIS2 analytics apps.

There are some features currently being developed that would help analysis of transfers

These features are being targeted for a v2.38 release in 2022

In the meantime, you could use SQL views to make some joins of the ownership tables above, and extract the information you need.

One last thing to note is that ownership is recorded at the TEI-program level, not by enrollment. This means a patient’s record can be “owned” by a different orgUnit per program, but a repeatable program, such as a pregnancy tracker or malaria register, there is only one owner for all the patient’s enrollments.

I hope this information is useful!

2 Likes

Thanks Brian, good to hear there will be some analysis for transfer function. Actually I’m working with ART program where patients get transferred to new facility and the new facility wants to calculate how many patients were transferred in. Based on what you said, I would be able to calculate how many patients owned by that facility, but can I differ the transferred in patients with the other patients?

Yes, you could use sqlView to join the trackedentityprogramowner table with programinstance table (enrollments). This sample SQL view displays enrollments where the enrolling orgUnit is different than the current ownership orgUnit – so you could do a summary of these by “transfer-in” (ownership) orgunit, for example. To try it, open an enrollment in the Tracker Capture app on any play.dhis2.org instance and make a permanent transfer. Then import the SQL view metadata, go to SQL views in maintenance app, and under ownership_change_test select “show SQL view”. You should see something like this.

To get a fuller overview, if there may be multiple transfers per patient (Clinic A-> Clinic B-> Clinic C) you would need a more advanced query based on the programownershiphistory table.

Actually, based on your use case, you may also be interested in the HIV Case Surveillance metadata package which was recently released. The development process spurred many of the features above re: ownership analytics, and @stratosilva created some detailed tutorials for supporting HIV analytics by routinely updating the enrollment orgUnit to the latest ownership orgUnit.

Thank you. I will check that out

1 Like