Best practice for adding new features to an implementations module

Hi all

I would like to know what the best practice is for adding new features to an implementations module. I’ve been assigned the task of adding a new feature to an implementations reporting module which happens to be the same as REPORT-288. The implementation uses platform 1.9.11 and have no plans of upgrading anytime soon. So what ever change I’m making has to be compatible with that version of platform. They use Reporting module version 0.9.5 but the latest release of reporting is 0.11.0 and the master is already at 0.11.1. My fear now is compatibility issues. There is a wide gap between the version differences of what they are using and the current master branch of openmrs reporting. Like 5 or 6 releases are between. And modules don’t have maintenance branches like in core where I could have maybe just checkout 0.9.5 branch, make the change, package the omod and deliver to them. The objective is that, what ever change I make will be beneficial to the general openmrs community, hence I claimed REPORT-288, but my code may have changes that have more to do with fixing compatibility problems than they have to do with the feature. And that will not be beneficial to openmrs hence the code will not be merged. I would not want to tell them to upgrade their platform just because of this one feature I’m adding to the reporting module. And they also made it clear that an upgrade is not in sight now.

I am currently having some problems creating reports and I suspect it has something to do with compatibility as it worked fine on other platform versions. I just setup my environment using the sdk which runs platform 1.9.11, and all the modules they currently have and their exact versions which some are 2 or 3 versions back. The only difference between my server and theirs is the version of reporting module and its dependencies. Since I’m working on the master branch of reporting, I’m using the latest version of the module and its dependencies. To test the reporting functionality on this setup, I tried creating a reporting like I have done on different platform versions running this same version of reporting module. I created a simple patient data set, then created a custom report and added the dataset. When I run the report I get this exception . But doing the same on other servers running different versions of platform, specifically 1.11.x and 2.0 I get no error.

cc @mseaton

Are you using the same version of MySQL? Or do both servers have this in the database connection string? “zeroDateTimeBehavior=convertToNull”

If you need a maintenance branch for any module, it can be created very easily. But you will most times not find a need for it. If you ever have to deal with compatibility issues, they will rarely be more than 1%, basing on what i have seen changed in modules to support platform 2.x In summary, do not worry about them. If you come across any, the community will guide you accordingly.

1 Like

Thanks @dkayiwa

I exported their database and imported into mine.

Hi @ivange94. For some background, many of our PIH sites are still on 1.9.x platform versions too, for example in Malawi, Rwanda, and Lesotho. I have made it a priority to ensure that the reporting module can continue to operate on a 1.9.x environment. I hope that you will have the ability to upgrade the reporting module version (and it’s dependencies if needed) to their latest versions for this project. If for no other reason, a large number of the changes between reporting 0.9.5 and 0.11.1 will be bug fixes.

From your stack trace, this is the line that is relevant: Caused by: java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Timestamp

Did you try the solution that @dkayiwa suggested? What is the value from your connection.url property in your file? If it does not have “zeroDateTimeBehavior=convertToNull”, try adding that to the url and see if that helps your problem.

Regards, Mike

1 Like

@mseaton apparently I did not understand @dkayiwa question about this till now[quote=“mseaton, post:5, topic:9916”] zeroDateTimeBehavior=convertToNull [/quote]

When I was having those problems, I destroyed the servers. They were created using the openmrs-sdk. I’ll try again and see. Thanks.