How rubailly/openmrs-module-pharmacymanagement works
• An API module (located under the “api” directory) that encapsulates the business logic, data models (e.g., DrugOrder, Pharmacy, Inventory classes), service implementations, and data access objects.
• A Web module (located under the “omod” directory) that provides the user interface elements, such as controllers and JSP-based views, and extends OpenMRS UI components (for instance, via portlets and HTML extensions).
In addition, the repository contains a .github folder with multiple GitHub Actions workflows to handle CI tasks (verify pull requests, deploy snapshots, and perform releases), which is an essential part of the project’s deployment pipeline.
Component Identification
– Domain models (e.g., DrugAndSolde, DrugOrderPrescription, etc.)
– Data access layer (DAO classes and Hibernate ORM configurations)
– Service layer (business logic with classes like DrugOrderServiceImpl)
• OMODULE (OMOD): Represent the “omod” module. This encompasses:
– The presentation and UI layer (JSP files, controllers such as DrugOrderView, PharmacyViewController, etc.)
– View extensions for the OpenMRS UI (the “extension” and “view/extn” packages)
• Database: Although not explicitly defined in a “db” folder, the presence of Hibernate mapping files (e.g., CmdDrug.hbm.xml) and DAO classes indicates underlying relational database interactions.
• External Dependencies: Include Maven as the build and dependency management tool and denote potential integration with the OpenMRS Maven repositories (for SNAPSHOT and release deployments).
Relationships and Interconnections
• Directional flows between the UI layer (omod) and the API layer: UI controllers in omod will invoke services defined in the API to process data (such as drug orders, consumption, and inventory).
• That the API layer interacts with the Database using DAOs and Hibernate mappings.
• That the CI/CD pipeline sits “outside” the running system, triggering builds, tests, and deployments whenever code is committed.
Architectural Patterns and Principles
• The code structure follows a layered architecture – splitting data models, business logic, and presentation.
• There is a clear separation of concerns between the API (back-end services) and the OMOD (head-end user interface).
• Use of Maven and GitHub Actions contributes to a continuous integration/deployment workflow.
• Dependency directions such as “omod” depending on “api” for core functionalities and “api” relying on persistence (Hibernate) to communicate with the database.
Relevant Technologies
• Java and Maven for application development and build management.
• GitHub Actions for CI/CD operations.
• OpenMRS framework as the host platform.
• Hibernate (ORM) for database mapping.
• Standard Java EE web technologies (servlets/JSP) for the UI layer.
Detailed Elements to Capture
• OMODULE (OMOD): Include the web layers (JSP pages, web controllers, and portlets) that interact with end-users.
• Database & External Repositories: Always include these as external systems that the API interacts with.