How can the address hierarchy be used as part of the registration from in the Android client?
I didn’t get your question, can you be more specific about what you are asking. We create following POJO classes separately for address storage.
As part of the registration screen below, I would like to use a drop down for available values instead of letting the user type in the details.
See example from UgandaEMR here
Okay I got it. So there is a dropdown option in Android Client. We use google places api to autofill the details. All you need to do is add your own API key in travis as environment variable on debug version. If you need to implement this from scratch, then here is the PR that might be useful. I think this is what you were asking, right ?
@rishabh997 the information is already available in OpenMRS via the address hierarchy module, which is used for other queries and analysis. Any chance of pointing to that instead?
I didn’t got a chance to look at it, I’ll go through it once and share my thoughts here.
I think there is no direct way to use the Address Hierarchy Module in Android Client unless we can receive them from any rest-API. Or if there is any possible way to download the mappings from reference application in JSON or CSV format, then we can tweak the code a little to provide dropdown autofill options through AutoCompleteTextView
@rishabh997 looks like there is currently no end-point for the address-hierarchy, it existed way before REST
@dkayiwa I am meaning getting the actual entries in the address layout via REST
@ssmusoke I have checked it in the swagger documentation as well I think there are currently no API endpoints to access and change AddressHierarchy as a resource.
@ssmusoke This would be a great addition to the Android client since now we use the Google Places API for the address fields, which will be a bit costly once we get more people downloading the app.
@ssmusoke as you noted this predates REST so there’s no OpenMRS REST endpoint… however there are a bunch method with an “AJAX controller” that return JSON that may be able to meet your needs… this is what the existing widget within OpenMRS uses.
Some of the methods are confusing, but I tried to add a fair amount of comments in the code.
I’d also support adding an “official” REST endpoint.
Take care, Mark
Great, thanks @ssmusoke.