Sending a message to the Orderer - Drug Order / Pharmacy Module

Hello All, I am working on a Drug Order module and a Pharmacy module. The orders placed using the Drug Order module can be viewed as a list in the Pharmacy page from where the user (Pharmacist) can select a drug and change its status to dispatch/hold/drop Here, I also want to have the utility which allows the Pharmacist to send a message to the Drug Ordering user (Physician). Any ideas on how I can implement this will be appreciated…

Attached is an image of the Pharmacy module

1 Like

What kind of message do you want to send? SMS? Email? Or something else?

I am not sure which approach would be best…Could you give me ideas/examples of any other module where this has been implemented.

The Openmrs API only handles placing of orders and doesn’t handle dispensing, you’d have to write a custom module if none exists that handles dispensing, you can possibly use the event module to fire events from your module to external applications whenever medications are dispensed

Has this been used in any module ? Only to send a message to another user. I don’t want to go deep into Dispensing module creation. But I need to view an example where the a message or a mail has been sent to another person.

Openmrs has already a message service that you can use to send email, all you need to do is set certain global properties prefixed with mail that give it access to the SMTP server you wish to use. But there is still something not clear to me, when do you want to send the message? Is it when the order is placed? Because this is the only thing the API handles, from your original email you mentioned that you wanted to notify the user when the status changes to dispatch/hold/drop which the API doesn’t support.

My team (OpenHMIS) has created an inventory module which handles some of the functionality required for dispensing. We had planned on creating a pharmacy module a while ago but found that general inventory features were more important to our clients and switched to that instead. We now often get requests for some type of pharmacy module and so we would be very interested in consuming the orders that your module generates.

Do you have version of these modules that is available to test?

Thanks for reply. There will not be any automatic message firing to the drug ordering Physician when the order is dispensed/canceled. It is just an option - If the Pharmacist places an Order on Hold or Cancel status for reasons like “drug unavailable at the time” or “drug not allowed to be sold in the country”, she/he may enter the reason for not dispatching the drug and want to inform the ordering Physician about the same.

From the image attached earlier, if the Pharmacist check marks the checkbox “Forward message to ordering physician”, the message in the corresponding field will be made forwarded to the ordering Physician

Then as I mentioned earlier, you can use the message service to send the email to the Physician

There is also alerts in OpenMRS, alternatively you could send an alert to the Physician

I would suggest that this actually points to a gap in the omrs functionality. There is no place to for providers to see a list of “things” they need to do. Things could comprise any of the following:

  • Patients waiting for an encounter
  • Orders that need processing
  • Others?

Having a process, service, and page for this kind of information would help omrs to facilitate some type of patient flow and associated an institutional workflow. This is a common feature that institutions are looking for and likely something that would help drive module development. Has there been any thoughts or discussion on adding something like this?

1 Like

Yes, this is definitely a gap in OpenMRS: we don’t have any sort of “Inbox”, and the mechanism for alerting users is not good.

@ibewes, it’s definitely desirable to add this, and we have not previously discussed a design. Would you like to kick off a conversation? Maybe start a new Talk topic and schedule a design call?

Hello, Sorry, I lost this thread…Please find below the links to my modules

@hariniparth: Could you please upload the step by step screenshots in file to easily understand the behavior/working by just looking it.

Thank you. HPardess

Hi @hariniparth, I am a newbie to OpenMRS module development and Spring framework. I got access to Drug Orders module on your github page and was able to compile it. When I uploaded the omod file in OpenMRS, it shows two links ‘Manage module’ and ‘Administration’ under the heading of Drug Orders module. But on clicking Manage module link, it displays nothing just the following screenshot.

And throws an exception when I tried to access Administration page:

Please help me with this. I second @hpardess that a step by step screenshots based ReadMe file would definitely help developers explore your module easily.

I look forward to your kind cooperation.

Many thanks, Tahira

Hello Tahira,

Thanks for reaching out to me. Here is the link to the Drug Order and Pharmacy module repository -

I will be happy to share the user guide for this module as well after making a few changes. I will get back to you with that soon.

Also, here is the link to the Youtube videos describing the functionality of the module.


Regards, Harini

Thanks for responding Harini. Highly appreciated.

Hoping to hear from you soon :slight_smile:

Hi Tahira,

Please find the link to the User Guide here - User Guide

Thanks, Harini

Thanks Harini, it is really helpful.

Hi Harini,

I am unable to upload this module in OpenMRS. After uploading it says that the module is started successfully but in actual, it didn’t…

And when I explicitly start it, it does not start because of an error.