Bulk import of images into tracker based on parsed filenames

Good Day,

Objective: Perform a bulk import of images into tracker based on parsing their file name (e.g. [Patient ID]_001)

Question: Has anyone developed a tool to allow DHIS2 to import a file into a tracker app by parsing the file name?

Thank you for your consideration.

Tags:
@jaime.bosque

Thanks for posting to the community! I’ll ask support for your question…

Hi @rickettspc .

This question arose during the Tracker Academy and if I got it right you have a machine which is used to take several pictures which later on are stored like [PATIENT_ID]_001, [PATIENT_ID]_002, etc in a different system. The goal would be importing those files into DHIS2 and linking them to the patient.

As far as I know there is no such tool developed but maybe someone in the CoP can help you out.

If I were to develop a script for this task I would use the endpoint fileResources to upload the files per patient, each fileResource should return a UID . Those should later on be linked to the TEI (and I am not sure how you want to do this nor how it could be done, to be honest -pinging the @dhis2-tracker ) which could be easily done by making another request to the API in order to retrieve the UID of the TEI (or data element, or attributes, or…) by cross referencing the PATIENT_ID which can be easily trimmed by any string parsing method.

This might help: Developer Manual - DHIS2 Documentation

Cheers.

1 Like