Somebody please help and might review a module?

Hello, with the kind help of many of you, we wrote a module. Thank you for your help.

The module is supposed to do: A ‘doctor’ adds some drugs to a patient. Then, groups those drugs and creates a ‘prescription’. - Another person (in another room), the ‘receptionist’ will print out the ‘prescription’. But, s/he cannot change (or create) it. There is no supply management or ‘pharmacy’ inventory integrated.

Reason for the module: The doctor might or might not be aware of the correct spelling of a drug. - Given that s/he is, he might do a hand-written ‘prescription’. - The patient might give this hand-written prescription to a pharmacist, who him/herself might or might not be aware of the correct spelling … or might not be able to decipher the hand-writing. Problem: maybe the ‘wrong’ drug is given to the patient.

A/ Two requirements: a/ only 1 module to install (not 2 like it is surely correct, like for allergy - ui and api). b/ the drug list in French.

B/ Technical Running as a standalone. On ref app 2.5. Java8. Linux (but maybe on Windows also … hopefully not an issue)

C/ please help.

1/ So we wrote it. Since my team had something else urgently to do, work had been on me, and I am not a super-coder :slight_smile: … hm, could someone please maybe have a (very very strict) look and do sort of a code review. We want to put this module in place this year, and well it should be not too bad. it’s here

2/ while writing it, some questions arose (besides the coding). If someone had an idea, please share. thank you.

2.1/ using the standalone. starting it, setting privileges to roles (as described in the readme

  • works. Then, stop the server, re-start it - the privileges are not set to the roles, any more. Have to be reset. Can we avoid this?

Or even better: can we ourselves create roles (like doctor_advanced, reception_advanced) - with ‘our privileges’, which are there, right from start?

2.2/ question of the vocabulary ‘drug list’. we found one in the dropbox. it’s mainly in English. so I did some sql operations … to create a similar list in French. it’s very sparse. could somebody please tell me, what is this druglist (in English), is it free for use at all, where could there be a similar list in French? … we plan to have the simplest solution possible, that is, provide an cvs file to use. (hm, or, is it thought that we create our own list? translate all the English drug names?)

2.3/ programming question: there seem to be 2 sorts of privileges. a/ in omod: config.xml // those, we took b/ in api: [ModuleName]

Such, we took a/ . Reason: we can set those privileges in the admin-view. Whereas, the privilege of the, we did not found out where to set.

2.4/ Unit test question: Trying the module to create unit tests for OpenMRS - it seems not to work with: Eclipse Neon2, Java8. - someone please give some advice. Hm, if someone please could tell us how to write them, and give one running sample (and maybe the method signatures of those that should be there) … we will write them.

Hm, if such module existed somewhere, please also share. It seems to be a simple requirements and a requirement, that might be in need more often.

We are glad to maybe extend this or work with somebody who is working on a inventory. Or with somebody who has experience in OpenMRS and please could tell us, how to write it correctly and good.

Right now, we simply want the code to be run stably and maybe, that the roles do not disappear after restart … that is indeed a problem for production.

Thank you and have a good day @darius thank you for telling me to ask this question.

Have you looked at the inventory module from OpenHMIS which is now called Banda Health?

@dkayiwa Thank you very much for your answer. Thank you also for your advice. Yes, we have seen it. It’s nice however, that is not the point :slight_smile: … we have the requirement to print a prescription. The inventory is not kept in the small clinic. There are (only if say so) 5-7 doctors operating, and a receptionist will ‘finalize’ a visit and, also, print a prescription. The OpenHMIS seems not to provide this function.

We do have prescription printing scheduled to work on later this year. What is your release timeframe and are there any other reasons why using the OpenHMIS Inventory module does not work in your scenario?

Hello @ibewes, thank you very much for your comment, issue is, that we do not have a need for ‘something big’ like the openHMIS offers, however, as you mentioned, the OpenHMIS does not offer this (simple) print. - Our doctors have seen Bahmni (has it) and OpenEMR (has it) … however they liked OpenMRS for it’s usability and stability (java).

so … reason is, that we need it now. it was not there, and we needed something super-simple (not something big to be extended …) - as this clinic anyhow does not need an inventory. ‘later’ is a good word :slight_smile: … we need it in March.

Say, if you can include ‘our’ module into ‘yours’, that would be very nice.

Maybe @dkayiwa or @raff if you might know, could you please advice why the privileges are reset after restarting the server? That is very annoying :slight_smile: Thank you

Maybe @dkayiwa, maybe @darius the drug-list of the dropbox a/ is it free to use? b/ is there a french equivalent? (or might we translate them ourselves?)

Thank you

What do you mean by the privileges getting reset? Could you give an example?

Hello @dkayiwa, Thank you very much for your answer, please see the screenshot below (the ‘clicked’ privileges are those)

That is the role ‘doctor’, and the 2 new privileges shall be added. That is working. However, shut-down the server (and entirely closing the standalone app) - re-opening it (java -jar …) and starting the server again: These 2 privileges are not set, any more.

Also, I had a look at the database. When the server is ‘on’, there are these privileges added, as ‘privilege’, to the table role_privilege, to ‘Organizational: Doctor’, as ‘role’. Starting the server again - these 2 records are not there, any more.

Thank you very much for any advice and kind regards

Which version of the reference application are you using?

Hello @dkayiwa, Thank you very much for asking, it’s the standalone, 2.5

Are they built in privileges? Or ones that you have created yourself?

Hello @dkayiwa, Thank you very much for asking, - they are created by ourselves, added here: omod/src/main/resources/config.xml

Did you stop the referencedemodata module?

Hi @dkayiwa, Thank you very much for asking, no, that module is not listed at all, in the standalone of ref app 2.5, please see below, these are there, no module with ‘demo’.

Ah, when I was starting the app the first time, I did select: no data. Thank you for your help

Admin UI Module Allergy UI Module App Framework Module App UI Module Appointment Scheduling Module Appointment Scheduling UI Module Atlas Module Calculation Chart Search Module Core Apps Module Data Exchange Module EMR API Module Event Module FHIR Module Form Entry App Module HTML Form Entry HTML Form Entry Extensions for OpenMRS 1.9 Module HTML Form Entry UI Framework Integration Module HTML Widgets ID Generation Legacy UI Module Metadata Deploy Metadata Mapping Metadata Sharing Open Web Apps Module OpenMRS UI Framework Provider Management Module Reference Application Module Reference Metadata Module Registration App Module Registration Core Module Reporting Reporting Compatibility Reporting REST Rest Web Services OMOD Serialization Xstream UI Commons Module UI Library Module

I have been able to reproduce this and noticed that the built in roles are always reset on startup and hence their privileges cannot be dropped or new ones added, and preserved on a restart. So you would need to use new custom roles, for now. @darius is this the expected behavior?

Hi @dkayiwa, Thank you very much for trying it, and your advice. May I please ask - ‘new custom roles’ - do you mean:

  • i can create them in the module?


  • I have to ‘add’ a new role, and e.g. ‘copy’ the privileges and role-inheritances (if have) of a ‘doctor’ - so to say, “create an advanced doctor” with ‘my’ privileges added? - and this “advanced doctor” will be kept by restart?

Thank you very much and kind regards

Yes, this is expected behavior. Looking at the role definitions, the application roles are intentionally set up that way, and the system would basically break without them. It is a mistake that we are hardcoding the organizational roles, so you’ll have to find some workaround.

I assume you’re talking about something like openmrs_drug_1.10.0_20141226.sql in the CIEL dropbox folder? See Andy’s comments here. More or less, yes they are free to use, but probably not available in French. If you translate to French, I assume Andy would love to get your translations. You should ask him this question in the #implementing:terminology category.

@darius, Thank you very much for your answers,

as to the drugs sql, I did some queries and may I think, the ‘drugs’ are derived from the CIEL (if I correctly understand that the ‘CIEL’ is the big mysql db comprising all concept… tables). - Yes, in case we had translations we will ‘give them out’, of course.

as to the roles: The “doctor” role is an organisational role? It is named: Organizational: Doctor

however given additionally privileges, they disappear.

Edit: so trying this solution: copying a build-in role as to inherited roles and privileges, and adding ‘own’ privileges’ to this newly-created role - that works. it stays after restarting the server.

@dkayiwa @darius please a question - the ‘provider’ - what is it for exactly (what we had seen, to ‘register a patient’ - or other rights also?)

and, is it correct to set it: 1 time in the role (provider role) plus 2 times for a user (a/ provider account b/ provider role) = 3 times to set? or is that maybe not a need, or, is there a difference in the settings? Thank you

Hi @bci b c !, Did you manage to find a “standard” way to “just print” the prescription directly within OpenMRS?.. I tried to install your module however I could not compile it because it fails to get some dependency for the omod module (I think that some repository is missing in my maven config)… However I’ve tried the oderentryui module and seems very appropriate to define the “drug order” (aka “prescription”) … unfortunately it seems that there is no easy way to print the prescription once created (opposed to sending an electronic version to the pharmacy)… Any suggestion? thank you in advance!..