Recommended way of doing customizations to OpenMRS Prior to 2.0

As from OpenMRS 2.0 most customizations only require modification of modules without any need to play with core. Now I need to do some UI customization to an OpenMRS implementation running on 1.9.11. What is the recommended way to do this? I can only think of forking core and making these changes since the legacyui is still attached to core in that version.

What kind of customisations? Did you evaluate all the extension points that the legacyui provides? https://wiki.openmrs.org/display/docs/Module+Extension+Points

@dkayiwa thanks for your response.

I don’t think extension points will cut it. I’m not trying to add new features but modify existing behaviors. For example,

The current patient registration form limits birthdate to 1958. We need to go below that.

The system does not allow us to change program location without setting a completion date. We’ll need to be able to change program location without having to set completion date.

When adding patient to a program, we want to dynamically hide/show more options depending on the users selections, etc

If the limitations are at the service layer, you could try AOP https://wiki.openmrs.org/display/docs/OpenMRS+AOP

If a few bits of the user interface without extension points, providing a custom page via your module is more sustainable than forking.

1 Like

So in essence even a change as small as changing the minimum birthdate limit when registering a patient will need rewrite of the whole patient registration page and controllers too since the controllers in core will not be able to handle my custom pages as their urls will change.

Isn’t the minimum birthdate limit enforced in the validators instead of the view?

I’m not sure. Haven’t actually looked at the code. Just guessed it’s a UI issue. I’m talking of this

From the image above you see that the bottom limit is 1958.

For that one, i would recommend that you simply raise a pull request against the 1.9.x branch where you change the hard coded 60 in showCalendar(this,60) to a setting via a global property: https://github.com/openmrs/openmrs-core/blob/1.9.x/webapp/src/main/webapp/WEB-INF/view/portlets/addPersonForm.jsp#L37

That way, you do not have to fork. :smile:

1 Like

@dkayiwa thanks.

I’m having issues developing on 1.9.11.

  1. mvn clean install fails with https://pastebin.com/i2SERLyc, I’m forced to skip the tests. During the build I also get a lot of exceptions https://pastebin.com/7TQ4YuCy.

  2. mvn jetty:run fails with plugin not found error. After skipping the build, I moved to webapp and tried to start the jetty server but I got this https://pastebin.com/A0BRnsbX.

So I decided to use tomcat since jetty won’t work with 1.9.11. I skipped the build. Copied the .war to tomcat webapp folder and started tomcat. I get this error during setup.

As for the compiler error, did you get a chance to look at this? Problems with the installation of openmrs openmrs-api

Thought versions of core below 2.0 should be compiled with Java 7? I’m trying to compile 1.9.11.

Java 7 is fine. But it should be the latest of 7

Ok. Let me upgrade my version of Java 7 then. What about the jetty plugin? There isn’t one in 1.9.x?

Finally found time to check. I do have the latest Java 7 installed.

@dkayiwa I had to downgrade maven to 3.0.4 for this build successfully. But I’m still having some troubles with jetty even though the error message has changed.

@dkayiwa while the jetty server starts now. It throws a lot of errors in the logs https://pastebin.com/6Mfi9dx7 and accessing it from the browser returns 404.

Which version of the openmrs platform are you running?

OpenMRS Platform 1.9.11

What does this command return? mvn -v