So with inconsistent behavior of loading various size of state files through the openmrs interface, I wrote a python script to directly load the address_hierarchy_entry. Now there are 652516 records from 35 state files but this is what I get from openmrs -
"Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /openmrs/module/addresshierarchy/admin/manageAddressHierarchy.form.
Reason: Error reading from remote server
"
So it still doesn’t work - should we disable this altogether so the user can enter whatever village, tehsil, district and state without entries in address_hierarchy_entry or restrict it to just village/town/city, district, state ?
From your code, if I am right, it is apparent that you are loading data into the openMRS database directly. It would be interesting to know why the exception thrown indicates “/openmrs/module/addresshierarchy/admin/manageAddressHierarchy.form”. Please can you share the execution steps.
Yes, that is right. The idea was to reduce one hop by directly loading into the database. I was then refreshing the openmrs address hierarchy page to see if openmrs saw the hierarchy the way I expected it to.
With only a few states loaded, I could see this via the openmrs upload form.
So I am still unsure if my entire approach is right. I just wanted to get the basics working so the users could add a range of historical clinical forms from various parts of India.
I am trying out a slightly different approach, will update here if it works,
If I have understood you correctly, you are referring to data migration. To the best of my knowledge I don’t think the system does a validation to check if the address entered is a valid one or is present in the address hierarchy.
Address Hierarchy is useful more in terms of auto populating other fields such as District, State etc., when we enter a Village that is not listed it permits free text on all the address fields.
We are also analyzing the issue reported in parallel, but wanted to inform you that data migration should not have dependency on the address hierarchy table. As person_address actually stores the address itself and not the link to the address_hierarchy_entry table.