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?
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?
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.