Retiring products when drugs are retried from Bahmni OpenMRS

I would like to get thoughts on what should happen to products in Odoo when the drugs are retired from OpenMRS. Few scenarios below:

  1. As soon as the drug is retired in OpenMRS, it would not be available for prescribing under medication tab. So the possibility of the product coming to new sale quotation is not a case. The product can stay as is in Odoo.
  2. But if the retired drug has a similar/same name, then it would cause confusions in Odoo when doing stock management activities like procurement, stock moves etc.

Possible Solution: Odoo also has an option to mark products as inactive. Should we consider marking retired drugs as inactive products in Odoo ?

@angshuonline @akhilmalhotra @gsluthra @sthote @shilpa @gokul @abhinab

Even if the hospital is no longer prescribing the drug, the hospital pharmacy may still be selling it to other patients bringing prescriptions from other facilities. I would prefer to let the pharmacy decide whether to mark a product inactive.

As far as the OpenMRS/Bahmni is concerned, it should raise an event when a drug concept is marked inactive, to allow for some action in downstream systems.

Agree with @akhilmalhotra . That scenario is possible. But, in some facilities they might want to auto-matically mark a drug which is retired in Bahmni as Inactive in Odoo (and someone can still mark it as Active in Odoo manually if they so want).

I think we should support this automated scenario of marking drug inactive in Odoo, but introduce a configuration which allows switching this behavior off, for facililities that don’t want this to happen automatically (configuration in odoo: dontMarkDrugsAsInactive).

I think it is important to understand the use case for the drug. OpenMRS needs to be able to document prior use of medications which may no longer be actively prescribed. If a drug is retired in OpenMRS due to an error, then it seems like that should be propagated and removed elsewhere. If the drug is no longer available (or even recommended) for use, then it should not be available for prospective use. I am not sure we have thought that through all the way when it comes to the UI.

If we enhance the “Manage Concept Drugs” screen to include custom attributes, we can introduce a new attribute of type “Boolean” named “Delete on Odoo.” This attribute will serve the purpose of determining whether the drug should be deleted on Odoo. By introducing this we leave the decision to user like what needs to be done for this drug on Odoo.

PS: The “Saleable” attribute is used for syncing concepts in Odoo.

@gsluthra @mohant @akhilmalhotra

Hi @gokul @akanter @gsluthra @akhilmalhotra @mohant for this wonderful topic. @gokul first of all am thinking we cannot name the attribute “Delete on Odoo” as it’s not possible to delete products which have some existing documents but rather we can just call it “Archive in/on Odoo”. Also when it comes to this proposed solution, I just want to bring in the scenario where;

  1. the Purchase UoMs may not be the same as Dispensing UoMs
  2. where there is need for manufacturing (may also arise from1 above),
  3. there are multiple variants etc will you also trigger the archiving of all the associated products or just those that are directly mapped to what’s prescribed from Bahmni EMR??

In our case, we have a one-to-one mapping between Bahmni EMR and ODOO. Therefore, if one drug is retired or deleted, we expect the corresponding drug to be updated in ODOO.

However, ODOO can have other variants/drugs that are not present in EMR. We assume that these drugs will be prescribed by other doctors who are not users of EMR.

That’s great then. I have implemented the scenarios described above, maybe it’s worth thinking about them as well. Just in case…