MDR-TB Module Developer Guide

This is a work-in-progress guide for new developers working with the MDR-TB module.  Currently it is just a collection of tips and information, but hopefully as it grows it will be fleshed out and better organized.

Accessing and Adding Concepts

The MDR-TB module has a set of core concepts that it requires to operate.  It expects these concepts to exist within the system's concept dictionary, and references them through the concept source "org.openmrs.module.mdrtb". 

All MDR-TB concept mappings can be found in MdrtbConcepts.class, which defines a static String constant for each concept mapping, like so:

... // Vitals public final static String [] WEIGHT = {"WEIGHT"}; public final static String [] PULSE = {"PULSE"}; public final static String [] TEMPERATURE = {"TEMPERATURE"}; public final static String [] RESPIRATORY_RATE = {"RESPIRATORY RATE"}; public final static String [] SYSTOLIC_BLOOD_PRESSURE = {"SYSTOLIC BLOOD PRESSURE"}; ...

To access a concept, use the MDR-TB service method getConcept, passing the appropriate constant. For example:

// retrieves the concept "Hospitalized" Context.getService(MdrtbService.class).getConcept(MdrtbConcepts.HOSPITALIZED)

If you need to add a new concept to the MDR-TB module, you should add that concept to the reference implementation of the MDR-TB module (currently the ZL/PIH installation in Haiti) with the appropriate mapping. Then create a constant for that mapping in MdrtbConcepts.java.

From the reference implementation, you will need to use the Metadata Sharing module to create an updated version of the MDR-TB metadata package containing your new concept. If the concept you have added is not directly referenced by an existing concept already within the MDR-TB package, add the concept  to the MDR-TB MODULE 2.0 CORE CONCEPT SET concept. Then you should be able to create a new version of the metadata package by making a copy of the original using the metadata sharing module... the metadata sharing module should pick up the new concept automatically since it is a child of the MDR-TB 2.0 Concept Concept Set.

You should publish this new package by replacing the existing Core Metadata package on the main MDR-TB 2.0 page, where you should also post the updated war.

Finally you should contact Andy Kanter at MVP and inform him of the new concept, so he can add the concept to the MVP, providing out-of-the-box support for the MDR-TB module for all users of the MVP dictionary.