Best Approach to Track Concept Usage (Diagnosis, Drugs, etc.) in OpenMRS for Personalization

Application Name: Reference Application Version Number: Replace this text with the version number of the above application your question is about.

Question: I’m working on a custom OpenMRS module (OMOD) where I want to track how frequently a doctor uses certain concepts (such as diagnoses, drugs, and symptoms). The goal is to suggest their most-used concepts as favorites for quicker selection.

I see two potential approaches:

  1. Overriding Core Services in OMOD
  • Create a custom service in my OMOD that extends OpenMRS services like ObsService and OrderService.
  • Track the usage of concepts whenever an observation or drug order is saved.
  1. Using OpenMRS Event Module
  • Listen for events related to saving observations and drug orders without modifying core services.
  • Use event listeners to track concept usage when a doctor records a diagnosis or prescribes a drug.

Questions:

  1. Is overriding OpenMRS services in an OMOD module a recommended way to track usage, or is it too intrusive?
  2. Would using the OpenMRS Event Module be a better approach in terms of maintainability and performance?
  3. Are there alternative approaches that OpenMRS developers would recommend for tracking concept usage?

I’d love to hear feedback on the best way to approach this while keeping the solution maintainable and aligned with OpenMRS best practices.

Thanks**

2 Likes

Subscribing to events raised by the event module when observations are created, looks like the best approach.