I have an Access database with individual students that I want to load into DHIS2. One option could be to go directly to Postgres (via ODBC) - is there an SQL script available for the necessary inserts which I could start from if I were to choose this route?
Alternatively, since there are thousands rather than millions, I can probably use the TEI import functionality in the Import/Export module. I did not see the format spelled out in documentation, but something like the attached format seems to work fine. tei_enrolled2.json (436 Bytes)
However, I also have pictures of the students - how do I go about importing those?
Thanks, Gassim. So basically I need to write a script, in order to get the ID that DHIS2 creates for the file resource (or rather image), and then provide that in a subsequent API call to create the data value?
However, I keep getting this message:
The content is being processed and is not available yet. Try again later.
The content requested is in transit to the file store and will be available at a later time.
Youāre welcome! It does seem like the best approach and if it doesnāt work, we could still ask for support, but I hope it does. All the info is detailed specifically for this task here: Working with file data values
If the request response is ā202 acceptedā then the file āstorageStatusā will be āPENDINGā, so if this is what you are getting then I think that the message you are receiving is because the file must be referenced by the data value otherwise it will be purged by the system within two hours of the upload (as described in the api docs).
If the request response is different would it be possible to share the full request & response please?
Hey @Knut_Staring . Someone from @tracker-backend can probably explain better but it is important to understand that the fileResources endpoint works async if I am not mistaken. This means that you would be importing fileResources (via a script or something) and then you would be including the references obtained in the TEI metadata.
There are a couple of issues that I see with this approach: the TEI endpoint doesnāt complain in case of a missing resources ([DHIS2-12005] - Jira). On the same JIRA issue you can find a tested but poor solution I developed to see if you have TEI linking to missing file resources (that can happen when importing images).