eSaude Pharmacy Technical Specification v2.0.0
The first version of the tech spec can be found here. The old version is more of a technical strategy document, and this document aims to be a more typical typical technical specification. For other resources see the +eSaude Pharmacy Resources  page.

Overview

The eSaude Pharmacy system is an OpenMRS module that provides a REST API that exposes resources that support the pharmacy workflows required by the eSaude community.

The OpenMRS should be compatible with OpenMRS v1.11.5 and higher. All database operations should be versioned and done using Liquibase, and all code should be unit tested.

Like all OpenMRS modules, the eSaude Pharmacy should have a service registered with OpenMRS, a data access object, and a module activator. Hibernate should be used for ORM.

Features

Each supported feature is enumerated below along a technical description and implementation notes.

Prescriptions

PrescriptionResource will be class responsible for attending all the actions performed by a prescription in the Pharmacy context such as: 

List all active

/prescription

Search

To find only the prescriptions for a specific patient, we use the patient parameter.

/prescription?patient=uuid

Get (by Id)

/prescription/uuid

To get a specific prescription, we append the /uuid to the resource.

Create

To we create, we POST to:

/prescription

TODO: add the required and option request parameters.

Delete (void)

The PrescriptionResource actions/executions will also be encapsulated on the PrescriptionService class where we will include all the business logic around the prescription context. 

🔧  Adapter

Since, for the moment, we need to support prescriptions stored in the obs table, we are implementing an AOP adapter that wraps the OpenMRS order service. This adapter will intercept all calls to the order server, and for drug orders, will save to and load from the obs table (using the OpenMRS obs service).

The adapter should be complete transparent to the rest of the code base, so that when we’re ready to stop using the obs table, we can simply disable the AOP wrapper and everything should continue to function as normal.