Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Purpose and Benefits

Reporting is an essential feature of any EMR. The data that is stored in the EMR needs to be exported and analyzed. Bahmni provides a reporting module for the same. There are some standard reports that come as a part of the reporting module and the implementer also has the ability to define some custom reports.   

Tip
iconfalse
titleSections

Child pages (Children Display)
alltrue

Panel
titleColorwhite
titleBGColor#668D3C
titleFeature Details

Reports Module - Feature Guide

Panel
titleColorwhite
titleBGColor#668D3C
titleUsage Details

Reports Module - User Guide

Configuring Reports

For configuring the reports, one can navigate to the reports.json file (/var/www/bahmni_config/openmrs/apps/reports/reports.json).  Any report configuration will have the following fields

KeyUsageMandatorynameThe name of the report that needs to be displayed on the screen

Y

type

The type of the canned report that needs to be used. (more details in the next section).

If it is a custom sql report, the respective type needs to be provided.

YconfigThe configuration required for the report to output properly. This depends on the type of the reportY

The following is a sample configuration of report in reports.json file.

Code Block
languagejs
titleSample Report Configuration
  "programDrugOrder": {
    "name": "Drug Order Export",
    "type": "ProgramDrugOrder",
    "config": {
      "programs": [
        "Second-line TB treatment register",
        "Basic management unit TB register"
      ],
      "patientAttributes": [
        "nationalIdentificationNumber",
        "patientAddress",
        "patientAddressLine2",
        "patientDistrict",
        "patientCountry",
        "telephoneNumber"
      ],
      "programAttributes": [
        "Registration Number",
        "Registration Facility"
      ]
    }
  }

 

Canned Reports

What are Canned Reports?

Canned reports are a standard set of reports that output data as per a template and can work for anything that qualifies to fit into that template. For instance we have a canned report for form observations. In this template if the implementer provides any form name, then the system would generate a patient wise report listing all the observations of that form for each patient in a row. Following are the canned reports provided by Bahmni. 

List of Canned Reports:

The name of the reports must be mentioned in the "type" section when configuring that particular report. 

obsTemplate

This report will be used to show all the values of the concepts that formulate an observation template. This is a patient level report. It would list all the different times a particular observation template is filled for the different patients. If any observation template is filled multiple times for the same patient we would see multiple rows for the same patient. 
Configuration:

 

Code Blocktitle

Configuration
"vitalsTemplateReport":{

        "name": "Vitals Template Report",

        "type": "obsTemplate",

        "config": {

            "templateName": "Vitals",

            "patientAttributes": ["caste", "education"],

            "applyDateRangeFor": "encounterCreateDate"

        }

    },

2) Config 

3) Description

4) Filters that they can configure

 

Custom Reports

Bahmni comes out of the box with canned reports.  But if the canned reports are not sufficient for an implementation, implementers can configure custom reports.  The custom reports can be created for MRS and OpenELIS.  The following is the configuration for custom reports.  The sqlPath denotes the path to the SQL query that needs to be executed.

Code Block
languagejs
titleCustom Report Configuration
{
  "genericOutpatientMorbidity": {
    "name": "Generic Outpatient Morbidity",
    "type": "MRSGeneric",
    "config": {
      "sqlPath": "/var/www/bahmni_config/openmrs/apps/reports/sql/diagnosisCountOPD.sql"
    }
  },
  "genericLaboratoryServices": {
    "name": "Generic Laboratory Services",
    "type": "ElisGeneric",
    "config": {
      "sqlPath": "/var/www/bahmni_config/openmrs/apps/reports/sql/testCount.sql"
    }
  }
}

The MRSGeneric type  denotes that the sql query is executed on OpenMRS.  The ElisGeneric type denotes that the sql query is executed on OpenELIS.  The following are some of the custom reports at one of our implementations.  This can be used as reference.

Configuring Report Export Formats

Bahmni Reports supports output formats like CSV, Excel and HTML.  We can restrict the formats as well.  The following configuration in reports/app.json helps in customizing the output formats.  The following is a sample configuration at one of our implementations.

Code Block
languagejs
  "config": {
    "paperSize": "A3",
    "supportedFormats": [
      "csv",
      "excel"
    ]
  }

 

Version Controlling Reports

The reports at an implementation site will be available in implementation specific config folder.  These report.json and associated sql files in this folder are generally text based.  They can be managed in standard version control systems like github.  Its a best practice to version control these files to maintain history and traceability across various releases of the product.