The aim of this project is to produce CDA documents from OpenMRS data objects based upon user requests.

Clinical Document Architecture(CDA) is an XML-based standard for exchange of health information records, it is meant to ensure interoperability.

The CDA generator module uses the MDHT API to produce and validate CDA Documents.


This document will cover following information :-

  1. What types of CDA Documents or Messages are currently supported by the CDA Generator module
  2. Design of the Module
  3. How users can extend on CDA Generator module
  4. How we are populating sections of APHP CDA Message
  5. Installation of the Module
  6. Potential Improvements
  7. Screenshots
  8. Quick Demonstration
  9. Sample APHP Documents produced by the CDA Generator module

What types of CDA Documents or Messages are currently generated by the CDA Generator module ?

This release of module only supports the generation of an APHP CDA Document type. However, developers are free to write up new CDA documents  which can be added to the module. There are many types of CDA documents (APHP, APS, APL ,APE, e.t.c) that may be found on the IHE profile page.


Design of the Module

During this summer our focus was to generate APHP CDA message, but there are many types of IHE profile or CDA documents types.

However, our module was designed to be configured in a manner that allows users to write their own CDA message handlers.


We have designed our module to ensure that our work is flexible, and can be extended further. If someone wants to add new CDA type documents other than APHP, our module accommodates this change. Our design consists of an hierarchy of classes (or as we call them, an hierarchy of handlers. BaseCdaTypeHandler serves as the base class which contains all attributes necessary for CDA document. All other handlers extend this BaseCdaTypeHandler (example APHP handler, APS handler or some other handler).

Our module uses the BaseCDATypeHandler to make our work as generic as possible.

If we want to add a new CDA Document Type, all we need to do is create a class, extend from this BasCdaTypeHandler class and use setter methods to add values. Its as simple as that!

The same design approach is followed for Section as well. There we have BaseCdaSectionhandler and child handlers extending upon it.


Class Diagrams



The class digram above depicts how different Document handler classes extend on the BaseCdaTypeHandler.            



How can users extend on the CDA Generator module?

Users can extend the module by adding new CDA document Types or Editing existing ones (not recommended). Each CDA document consist of few sections and users can also add new sections to the module or Edit existing ones. The Editing/Adding/Deleting of Sections and CDA document types can be done programmatically through code not the User Interface.


1) Steps to Add a new CDA Document Type


Image showing location to add new CDA Document Type



Sample Code

package org.openmrs.module.CDAGenerator.CDAHandlers;

public class MyCDADocument extends BaseCdaTypeHandler
    public MyCDADocument()
    this.documentDescription="to add new cda document type";
    this.templateid="some free text";//required attribute,not null
    this.formatCode=null; //optional attribute


2) Steps to Add a new Section


Image showing location to add new sections

Sample Code

package org.openmrs.module.CDAGenerator.SectionHandlers;
public class MySection extends BaseCdaSectionHandler

public ChiefComplaintSection()
    this.sectionName="My Section";
    this.templateid="";//ihe specific id
    this.sectionDescription="This is my new section";
    this.code="";//Ihe specific code for section


Similarly one can edit or delete any Sections or CDA document type.

Populating sections of the APHP CDA Message

We have used OpenMRS Concept Dictionary to populate APHP CDA message section with answers. We used IHE APHP Document value sets which list out specific concepts that must be used for specific sections. We are updating the MVP-CIEL Concept dictionary with LOINC codes,  SNOMED codes and new concept that our module needs.

Installation of the Module

Installation of the OpenMRS CDA Generator Module

Potential Improvements


1) Administration tab (After the module is loaded)


2) Export CDA Document Link


3) Validation of Export CDA Form




4) Successful Generation of CDA Document


5) Error report (If generated document is invalid)


6) Manage CDA Section Link

It lists out all sections present in our module and also provide details of each section




7) Manage CDA Type Link

It lists out all CDA Document types present in our module and also provide details of each document type



Quick Demonstration

Please watch demonstration of module :


Sample CDA Documents for review

For a sample document generated using the OpenMRS CDA generator module, see here 


Source code: