Cannot enroll TEI from another OU

Dear all,

We have a TEI from OU (say X) registered in a program. Whenever we try registering that TEI to another program B in another OU (say Y), we get:

"Failed to update the tracked entity instance in the server".

The OU in the error refers to the parent OU of the TEI where it was first registered in a different program.

Is this a permission configuration issue? Unsure why the user needs to have write access to the parent OU X to enroll this TEI in OU Y.

2 Likes

Hi Aatish,

in DHIS 2, a user is assigned to one or more roots in the org unit hierarchy, either “data input” org unit and potentially “data output” org unit. The “data input” org unit refers to the root of the sub-hierarchy in which the user can enter data, enroll TEIs and so on. So there is the chance that you are trying to enroll a TEI outside/above the “data input” root org units assigned to the user which you are authenticating as in your request.

You could let us know the current org hierarchy, i.e. is OU Y above OU X in the hierarchy? Also, which root org unit is your current user assigned to?

regards,

Lars

3 Likes

Hi Lars,

Here is the current hierarchy:

Nepal
--Province 3
----Kathmandu
------OU Y  <----- (User is trying to enroll TEI in a program here)
----Bhaktapur
------OU X  <----- (TEI is already enrolled in a different program here)

The user is trying to enroll patient registered in a program from “OU X” to a program at “OU Y”. The user has “Data Capture” set to OU Y, and data
output set to “Nepal”.

Is OU Y above OU X in the hierarchy?

No.

Which root org unit is your current user assigned to?

Only OU Y for data capture.

1 Like

Hi @Aatish_Neupane,
What version are you on? Do you experience this in the tracker capture web app, or are you building your own? On 2.30 and later the above should based on your description work without error, as long as the user in OU Y has access to the tracked entity instance:

  • She has to have “Search” org unit scope set to a level that encapsulates OU X.
  • She has to have at least “Data:Read” access to the tracked entity type in question.

Markus

2 Likes

Hi @Markus,

We’re on DHIS 2.30. Yes, we are using Tracker capture app.

She has to have “Search” org unit scope set to a level that encapsulates OU X.

Checked. The user has access to whole Nepal as search unit.

For Data:Read, here is the sharing settings on the TEI Type:

Thank you.

1 Like

What is your programs Access level?
If it is set to “Closed”, noone outside the owning organisation unit will be able to access it.

You can read a bit more here:
https://docs.dhis2.org/master/en/developer/html/webapi_tracker_api.html#webapi_tracker_ownership_management

Markus

1 Like

Hi @Markus,

Programs are in “Open” access level. Really strange.

1 Like