Way to show Enrollment Date on Tracker screen? Or set Registration Date programmatically?

Hi! I am programmatically creating enrollments in Tracker Capture using the REST API for historical data captured by a different system, and when my users go to the Tracker Capture screen, they see Registration Date in the listing, which shows the date that I uploaded the data to the system. I would like them to see the Enrollment Date instead, which I am programmatically setting to the original date of enrollment in the other system. It does not look like there is a way to display enrollment date in the list using DHIS2 2.37, correct? Is it possible in later versions? If not, is there a way to programmatically set the registration date to the enrollment date? Thanks!

Hi @stirone

I’m not sure if I understand your question, but I understand you have historical data captured in a different system than Dhis2.
In tracker capture in the working list, you can se the registration date, like this:

And the date for every tracked entity instance is the date you uploaded the data to the system, but you and other users would like to see the date of enrollment instead.
If you open a TEI, in my example, enter John Kelly in the top of my list - the Registration date is 06.03.2014
In the TEI dashboard you will see the date of enrollment is the same as registration date:

The registration date in working list is the enrollment date. Could you check in your instance, that when you enter a TEI, the enrollment date is the same as the registration date in the working list?

Caroline

1 Like

Hi! Apologies for not following up on this sooner. You do understand my question, but I lost you at the point of your example. When I create a new TEI, I am programmatically setting the Enrollment Date to the original Enrollment Date from the other system (some time in the past). The Registration Date, however, is the date that I programmatically created the TEI. Is there a way to change the registration date programmatically? Many thanks!

1 Like

Hi Stephen,

Regarding showing the enrollment date in the tracker capture working lists; This might be a bit of a challenge. The working list is a list of trackedEntities, which means that each trackedEntity might have multiple enrollments and multiple enrollment dates. The system would then not be sure of which enrollment date to show.

The registration date, or createdAt as it’s called in the API, is set by the system and cannot be changed by a user. This is to ensure data integrity. There is an attribute called createdAtClient which can be changed, but there is no simple way of displaying this in the working list.

My initial thoughts would be that this might be solved with some program rules. This is just a suggestion from my side, and it might not work as expected. If you create a Tracked Entity Attribute with the type Date, you might be able to create a program rule that assigns the enrollment date to this TEA. The TEA, which would be named Date of most recent enrollment or similar would then be the enrollment date of the newest imported enrollment, and could be shown in the working list. Keep in mind that there needs to be some logic that ensures that any data is not overwritten if the enrollment is updated. Could this be a possible solution? Give it a try and let us know if you need any further assistance!

Thanks.
Eirik

1 Like

This worked great, thank you! I actually forgot that I could set a TEI attribute with this value, and that I could customize the list so that attribute would show in the list. (Still learning DHIS2 here.) So I did that. Then, I created a program rule to populate it based on there being an incident date (I misspoke in my help request, I was meaning incident date). But that didn’t populate the TEI events already in there, so I added it to my JSON which is populating the values from the other system. This will work well. We are only in development currently, so when we go to test and prod, the values will be populated via my new JSON call to the API. And, they will show in the list. Thank you for your help!

2 Likes

Great to hear, Stephen. Happy to be of help!
Let me know if there is anything else we could help you with.

Thanks.
Eirik

1 Like