How to upgrade existing module to run on new openMrs Version 2.0.6

I am trying to update a module to run on openMRSVersion : 2.0.6 . If anybody can guide me through.

Can you start by taking a look at these?

Thanks for the response. Let me go through these and will let you know…

I did try these and able to on my ref app but now the thing is if i access patient dashboard having active Orders give me this error.

@siqlain, in the future, could you paste stack traces using tools like hastebin and the likes? It really helps the thread be more readable by others.

You have a NPE on line 53 of DrugordersFragmentController pointing here in the void. This probably means that you have local changes that we are not aware of (and hence it will be difficult to help.)

I can only suspect that this might have happened at line 52 instead:


and that maybe order is null and that the NPE comes from attempting order.getOrderId(). But who knows…

@mksd i actually think the above error must be because of this error. i further explored and got this error //Error //My config.xml where i provided the mapping

Code is uploaded here (mine version to support for openmrsVersion 2.0.6)

Original code is uploaded here (supports openmrsVersion 1.11.4)

Assuming the original version was working (the one depending on Core 1.11.4), it would be useful to see the commit that was bringing the changes between the two.

This module is not respecting basic Java naming conventions such as CamelCasing the class names (see here):

public class drugorders extends BaseOpenmrsObject implements Serializable {

Was that to avoid some sort of collision with Core’s DrugOrder?

Leading me to next question, why wouldn’t you just use Core’s drug order??

@mksd The one who developed this module was not me. It seems so to avoid collision the naming convention was not followed. Secondly this module covers my requirements this is the sole reason i am trying to port it on latest openmrs version.

Instead of making it from the scratch with plan orders,draft orders using native openmrs drug orders.

From what you’re saying it sounds to me that backward compatibility doesn’t seem to be an issue. If I’m correct I would strongly consider shunning that drugorder (sic) and refactor the module so that it uses Core’s DrugOrder. Are you in a position to do that?

Also @ibewes / @insiderish, what about your Pharmacy module at Banda Health? There is no active development on it, but would you advise to use it anyway? And if it’s being deprecated, what is it being replaced with?

Well right now i have to make this module run and for future i will refactor it to use Core DrugOrder. But for now i have to make it run.

@mksd The pharmacy module that we created was an initial design and not something that we completed or intend to continue working on. The features that we originally thought to put in the pharmacy module were moved into the OpenHMIS Inventory module. This module does not, however, support any of the core OpenMRS ordering systems.

Thanks @ibewes for clarifying. @siqlain as you see there are options around, in particular the new openmrs-owa-orderentry that represents a community effort to tackle ordering. If inventory tracking is also necessary then you could you look into combining that one with Banda’s openmrs-module-openhmis.inventory.

Regarding the module you are looking at, quoting myself from above:

By “the two” I mean the code base depending on 1.11.4 and the code base depending on 2.0.6.

@mksd Thanks for your time. i will check the above modules. And try to combine them .

If your needs go beyond the sole inventory tracking, but require the integration with an ERP system you may also look at Bahmni.

@mksd sorry for no response. Been busy with requirements, I did able to achieve the workaround for the pharmacy module. Thanks

@ibewes I was looking at the inventory and cashier module of openhmis. Is there any workaround to update inventory while creating a bill. Like i wanted to create a bill against a patient that will automatically update the inventory products quantity.Without having to create an inventory stockoperation.