Tracker Capture and Capture apps questions&proposal

Dear @tracker-frontend and @tracker-backend developers,

Currently I am working on importing old data from some old custom made app to the DHIS tracker. Original data stored in MSSQL database, and the data structure is completely different as it was tailored to that old app’s logic. For this purpose I have developed importing app and during this period I have faced many challenges, most of which have been solved by using non-standard ways, especially async calls on useDataQuery and useDataMutation hooks.

From the issues and tasks which I faced during this interesting development experience I brought up few questions and proposals for the tracker API&APP developers.

1. Question regarding tracker API point - POST …/api/trackedEntityInstances/

I have used useDataMutation hook to create a new TEIs. And have few questions on the result of the created TEI:

> {
>   "created": "2024-08-03T09:23:29.512",
>   "orgUnit": "hPaX56wCjsw",
>   "createdAtClient": "2024-03-19T02:00:00.000",
>   "trackedEntityInstance": "ylOloFfgGqz",
>   "trackedEntityType": "gAkFSYjEBoP",
>   "enrollments": [
>     {
>       "createdAtClient": "2024-03-19T02:00:00.000",
>       "program": "vXMY3ACeWzL",
>       "created": "2024-08-03T09:23:29.532",
>       "orgUnit": "hPaX56wCjsw",
>       "enrollment": "iwP1Ey2pAel",
>       "trackedEntityInstance": "ylOloFfgGqz",
>       "trackedEntityType": "gAkFSYjEBoP",
>       "enrollmentDate": "2024-03-19T02:00:00.000",
>       "status": "ACTIVE",
>       "events": [
>         {
>           "dueDate": "2024-08-03T09:23:29.557",
>           "createdAtClient": "2024-03-19T02:00:00.000",
>           "program": "vXMY3ACeWzL",
>           "event": "V8s5BR3KBlN",
>           "programStage": "EJYTLHjoVGH",
>           "orgUnit": "hPaX56wCjsw",
>           "enrollment": "iwP1Ey2pAel",
>           "trackedEntityInstance": "ylOloFfgGqz",
>           "enrollmentStatus": "ACTIVE",
>           "status": "COMPLETED",
>           "eventDate": "2024-03-19T02:00:00.000",
>           "created": "2024-08-03T09:23:29.557",
>           "completedDate": "2024-03-19T02:00:00.000",
>           "completedBy": "some_staff",
>           "dataValues": [
>             {
>               "created": "2024-08-03T09:23:29.554",
>               "dataElement": "n1zMMq13TKE",
>               "value": "pl_NGO"
>             }
>           ]
>         }
>       ],
>       "attributes": [
>         {
>           "created": "2024-08-03T09:23:29.514",
>           "valueType": "TEXT",
>           "attribute": "unMdH8uzA5f",
>           "value": "XX"
>         }
>      
>       ]
>     }
>   ],
>   "attributes": [
>     {
>       "created": "2024-08-03T09:23:29.515",
>       "valueType": "DATE",
>       "attribute": "goaci6BeHfM",
>       "value": "1999-01-01"
>     }
>   ]
> }

this is a sample of created TEI.

Question: Why the “created ” field can be assigned only by the server? This is not convenient and makes some confusion especially when the final user importing data where the original created date must be preserved and it is different from the server’s date.

In my example originally I set all created date the same as the enrollmentDate and eventDate accordingly, but got the date assigned by the server, which is violation of the data integrity and preservation of original data.

Would be great if the created date can be accepted as it is if provided, otherwise set by the server.

2. Question regarding list of registered client’s screen in Tracker Capture & Capture apps

From the previous question I have following issue:

As long as the “created ” field assigned by the server, in Tracker Capture & Capture apps the registration date is not correct (see pic1. & pic3), or there must be ability to select to show enrollmentDate instead(see pic.2 & pic4). Or even the user should be provided choice of display either “created ” or “createdAtClient ” field then:


Pic.1 Tracker Capture app - list of registered client’s screen
image
Pic.2 Tracker Capture app - Show\Hide columns widget for the list of registered client’s screen


Pic.3 Capture app - list of registrations screen

image
Pic.4 Tracker Capture app - Show\Hide columns widget for the list of registered client’s screen

3. Proposal regarding displaying long list of events in the program stages

During the data import I have found that some client’s have many events inside some program stages. In my case I had up-to 50 events… And these events displaying in long list, which is not quite comfortable to scroll and sort by the date of registration if it is needed.
image
Pic.5 List of events from Tracker Capture app. Shown only part of long list


Pic.6 List of events from the Capture app.

I do understand the tracker Capture program will not be maintained in the future, and probably there will not be any changes or improvements. But anyway I would like to propose to make that long list of events scrollable inside of some DIV , instead of pushing button SHOW 5 MORE in the Capture app or just providing long list of events as in the Tracker Capture app.

Thank you for you support and the great jobs you are doing!
Looking forward to hearing from the teams :slight_smile:

Regards,
Ulanbek

1 Like