Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 27 Next »

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.   

Configuring the Reports Module 

To configure multiple reports module refer here


Follow these steps to configure the reporting module and then run reports in Bahmni

1.  Configure reports app on home page: 

Home page of user

Go to openmrs/apps/home/extension.json of your config and add the code snippet below:

"reports": {
  "id": "bahmni.reports",
  "extensionPointId": "org.bahmni.home.dashboard",
  "type": "link",
  "translationKey": "MODULE_LABEL_REPORTS_KEY",
  "url": "../reports/#/dashboard",
  "icon": "fa-user",
  "order": 8,
  "requiredPrivilege": "app:reports"
}

Key Fields 

These are the attributes of the above configuration

KeyUseMandatory
"id"

Specific Id for reports app.

Yes
"extensionPointId"Needed for configuring the reports.Yes
"type"Making reports app link on home page.Yes
"translationKey"
Show name in particular locale used by app.Yes
"url"
To redirect to reports page.Yes
"icon"
To display icon.No
"order"
Display in specific order.No
"requiredPrivilege"
This is needed privilege for displaying reports module.Yes

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

KeyUsageMandatory
nameThe 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.

Y
configThe 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.

Sample 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. 

  1. 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:

     

    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.


Custom 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.

  "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.


  • No labels