Relationship of enrollments to other metadata in API

Hi there,

I thought I’d check in here with the DHIS2 devs first before raising this as a bug in JIRA.

It seems like when querying the API for trackedEntityInstances, the ‘enrollments’ field is always empty, even if that TEI might have enrollments.

i.e. When asking for the following TEI, enrollments is []

But an enrollment for this TEI clearly exists here:

This isn’t a rare case, it happens for all TEIs:

It seems to be present in all versions as well, hence my reason for asking if this is expected somehow.


1 Like

As I didn’t get a response from any dev saying this was a known issue I went ahead and created it as a JIRA issue to investigate further:

1 Like

Hi @Jasper_Timm,

sorry for the late reply. By default, we try to avoid including extra data in our tracker payloads (It can get huge if you want everything). So by default, we don’t include, for example, enrollments. You can however add the following parameter to your url to include them:

?fields=all (Includes all data)

Thanks @Stian. I discussed this in the JIRA issue with Gintare.

I can understand not fully listing the enrollments for performance, but I think the confusing part is that the enrollments field is returned as an empty array at the moment, implying it has none. I think the better option would be either not returning the field at all or returning it only with the enrollment’s UID.

1 Like