/
Common Lab Test Module

Common Lab Test Module

Overview

This is a simple module, which can be used to create and customise forms to manage patients' laboratory test orders, samples and results.

Features

The module provides RESTful API and legacy OpenMRS interface, it provides:

  1. Administrative forms to create new Lab tests and define their set of results.

  2. Separate tab on patient's dashboard to create Lab test orders

  3. Collect and manage specimen samples (if required) to process

  4. Enter test results

  5. Attach scanned/documented reference files for test results

Module Structure

The module is structured according to OpenMRS conventions found here.

API

src/main/java/org.openmrs.module.commonlabtest.api.impl/CommonLabTestServiceImpl implements CommonLabTestService which extends OpenmrsService.

The unit tests can be found in

src/test/java/org.openmrs.module.commonlabtest package

src/test/resources/CommonLabTestService-initialData.xml contains the test data

OMOD

src/main/java/org.openmrs.module.commonlabtest.web.controller/... contains all Controllers for web app

src/main/java/org.openmrs.module.commonlabtest.web.resource/... contains all REST controllers

src/main/webapp/... contains the JSP files and related resources

Data Model

The LabTestType maps to commonlabtest_type, where all lab test types are stored, for example CD4 test, CBC test, Ultrasound test.

LabTestAttributeType maps to commonlabtest_attribute_type; against each LabTestType object a set of LabTestAttributeType is meant to be created, each representing an observation which will be captured when entering results. For example, for CBC test, some LabTestAttributeType can be RBC count, WBC count, Haemoglobin and Platelets.

A LabTest object maps to commonlabtest_test extends OpenMRS object, each patient lab test is referred by this object. This object contains a mandatory Order object, which is abstract OpenMRS object used for Lab tests and Drug orders.

LabTestSample object, which maps to commonlabtest_sample table, contains specimen samples (if the associated LabTestType requires a sample to process a test).

Test results for LabTest object are stored in LabTestAttribute (extends BaseAttribute abstract class) objects, which map to commonlabtest_attribute. An important thing to note here is that an attribute's value might be open-text, numeric, concept, drug, or even a location. The value_reference column contains the reference of the actual value. The Service API returns the associated object, while the RESTful API returns the reference value only.

 

The best documentation for developers is test cases. Check out the examples in unit tests for complete details. 

Setup

The module requires OpenMRS version 2.0.x or higher and Legacy UI module as prerequisite.

On installing the module, some data is created in the database:

  • Privileges: Add/Edit/Delete/View CommonLabTest Metadata, CommonLabTest Orders and CommonLabTest results

  • A concept (if one does not exist) named UNKNOWN LAB TEST TYPE (uuid b095450e-9ad0-11e8-844c-448a5b471032)

  • Default LabTestType: Unknown Test Type (uuid ee9b140e-9a29-11e8-a296-40b034c3cfee)

Global Properties

Following are the global properties that are created on installing the module:

  • commonlabtest.fileExtensions refers to the types of files that can be saved as attachments.

  • commonlabtest.fileDirectory refers to the directory that holds the uploaded attachments (located in OpenMRS application directory as .../complex_obs/commonLabTestFiles).

  • commonlabtest.specimenTypeConceptUuid = 162476AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA refers to the different types of samples, for example plasma etc.

  • commonlabtest.specimenSiteConceptUuid = 159959AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA refers to the source of collected sample, for example pulmonary tissue etc.

  • commonlabtest.testunitsConceptUuid = 5db4f53e-6218-4ae0-ae4e-5e0343b5d30 refers to the units in which sample can be quantified.

 

Global Properties

Please note if the global properties are not set up then errors may be encountered while using module. Therefore, setting