Customizing/Wrapping of Android Client

I would like to hear some ideas for how implementors can customize the Android client for their own needs for example

  1. Look and Feel
  2. Tabs displayed for a patient - Allergies, Vitals, etc
  3. Registration Form
  4. Ability to specify an end-point or criteria for selecting a list of patients instead of having to search for them
  5. Manual syncing and prompts when editing patient data

I am also wondering how this is done in the Android world, without forking the code, can one use the client as a library then add their own features and build an APK with a different module id?

Looking forward to some enlightenment and ideas

4 Likes

@ssmusoke each activity and fragment will have its respective xml file which defines its layout. you can customize the look using that (it can be found under resources directory), you can also tweak the styles.xml file which defines the overall style params of the app.

current implementation of registration form similarly has an xml file for register patient and some logic code handling it inside presenter. you can first make necessary changes in the xml file and necessary changes in the presenter to get the customized form you need !!

currently when you swipe down on almost every screen with some data it will get refreshed automatically and also if you dont have internet for a while then the changes you made will get saved locally and will automatically get synced to the server when your device gets online. you can change the prompts by editing the string.xml file which has all the prompt messages and their translations in hindi.

I would be able to help more on #2 and #4 if you can elaborate it a bit more :slight_smile: cc @f4ww4z @rishabh997

@saurabh How would I customize these files without forking the project and changing the code which will conflict with any new code that I can pull in?

#4 I would like to get a list of all patients who came to the facility in the last week (a custom end-point or a complicated query) - how can I change the default query that brings all patients, I do not know their names

#2 How can I change the registration form without forking the code and making my own

In that case just fork a state of repo you will be happy working with and then build upon that code maybe in a seperate branch and merge only those latest commits from the original repository to yours which is of use to you, it might get messy maybe there is a different way!!

you will have to change the retrofit interface (can be found inside api/restapi.java) and add a method there withe the specific query you want to work with and then change the xml and the driver code in the presenter to use the new retrofit method that you created instead of the current one used in implementation.

@saurabh just in case you did not know @ssmusoke, he does not like the idea of forking and having to maintain his own things. He likes to work within community maintained assets. That is his philosophy for UgandaEMR. Therefore, think hard to made the android client code more configurable. :smile:

And by the way, i have never seen any one use this android client in production. So if you can make @ssmusoke happy, you will get the satisfaction of seeing all your efforts in real production! Which is always one of the most encouraging aspects for developers, as a pay back or reward for all their sweat! If you did not know, he has OpenMRS running in over 1000 sites in Uganda. :slight_smile:

7 Likes

I get it now @dkayiwa :sweat_smile:,

Actually It will be really satisfying if the android client gets used in production solving some actual problems :slight_smile: we will try and make Android client more inline with refapp I think that would help!!.

Since the beginning of the project, we have been trying to replicate reference application into an android client and because of this, it is not customizable as @ssmusoke wants… But to implement what he is suggesting, we will first have to make a lot of change in the code with dropdowns to select the kind of form(page/UI) we need…

We were planning to change code to make it similar to the latest guidelines by google in the client 2.9x+ but now we can shift our focus to make it as much customizable as we can… For this, we need the following:

  1. Rest service for each feature we plan to add from Uganda emr…
  2. Ensure that endpoints are given in https://rest.openmrs.org/ work for Uganda EMR…

So I guess we will need complete support from the documentation team as well as the rest-endpoint team… With the above two features, we can start customizing android client…

but as of now, we cant do this…

@rishabh997 Actually you can use Reference Application as a baseline, with the ability to change some of these settings for different implementations, I am thinking of UgandaEMR as just one of those

I am not an expert on Android development, is there a way I can setup a new Android project that uses the OpenMRS android client as a module, so that one can override some settings and configurations?