Release Version 0.84
Introduction
Bahmni has Reports app or module. The Report app is enabled based on privilege. You can access the Reports app from Home dashboard. Generally, Admin user will have the privilege for reports app. When the user enter into report app, the user will see a list of configured reports. The user can launch any of the report with Start & End date, output format.
Every Bahmni implementation has its own config module. So, an implementer has to configure the required reports properly so that reports app will show all the configured ones. The configuration file is located at openmrs/apps/reports directory of the config module.
Reports can be used in couple ways in Bahmni
Standard Reports useful to management level people
Extract data from backend database to analyse various facts for different stockholders
Bahmni report module supports various output format
HTML
PDF
EXCEL
Custom EXCEL (Excel with pre-defined macro)
CSV
ODF (Openoffice format)
There are different ways reports defined in Bahmni
Canned Reports
Custom SQL
Jasper Reports
Generic reports (latest development in reports module)
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.
Sample Configuration
There is JSON file used for configuring reports. It is located at /var/www/bahmni_config/openmrs/apps/reports/reports.json.
app.json
"config": {
"paperSize": "A3", //The default paper size is A4. Supported sizes are A3 and A4.
"supportedFormats": ["pdf"], //List of available formats are html, pdf, excel, csv, custom excel, ods. When not defined, all the available formats will be listed.
}Canned reports
These reports meant to give specific or predefined information from Bahmni. There are minimal configuration available for these reports. Whenever new requirement from Client, even though there is a similarity in the existing report, we cannot reuse it. Hence Bahmni system end up with new canned reports and its makes more maintenance. So, there is Generic Reports which will eventually hoping to solve the problem.
Reference tables
Bahmni allows one to setup multiple type of age groups each with a name. Each report configuration can use their own age group by specifying their name in the configuration.
For example:
The report given below shows counts based on age-groups.
To display reports like this, you should insert age group configurations into the reference table "reporting_age_group" and then reference that from the report configuration.
Configuration
"nutritionProgram": {
"name": "Nutrition Program - <5 years children receiving (Vitamin A)",
"type": "obsCount",
"config": {
"ageGroupName": "Nutrition Program Vitamin A",
"conceptNames": ["Childhood Illness, Vitamin A Capsules Provided"]
}
}
You can insert entries into reporting_age_group using SQL commands. Given below a set of example INSERT SQL commands.
INSERT INTO reporting_age_group (name,report_group_name, min_years, min_days, max_years, max_days)
VALUES ('6 - 11 months', 'Nutrition Program Vitamin A',0,180,1,-1);
INSERT INTO reporting_age_group (name,report_group_name, min_years, min_days, max_years, max_days)
VALUES ('12 - 59 months', 'Nutrition Program Vitamin A',1,0,5,-1);
For certain reports one can also set some reference range for concepts.
1. Obs Count Report
There are three variants of this.
N.B:- If you are giving more than one concept name in the config, please make sure that all of them are of same data type, (Either coded concept or boolean concept). If a mix of datatypes are provided, it will always generate obs count report.
1.1 Obs count
Use this, if you just want to count the number of observations created for a concept (other than Boolean or Coded).
Example
Configuration
"nutritionProgram": {
"name": "Nutrition Program - <5 years children receiving (Vitamin A)", "type": "obsCount", "config": { "ageGroupName": "Nutrition Program Vitamin A",
"conceptNames": ["Childhood Illness, Vitamin A Capsules Provided"],
"locationTagNames": ["Report Location"],
"countOnlyClosedVisits":"false" }
}
Add the location Tag “Report location” in openmrs
And specify the location tag in config ex. "locationTagNames": ["Report Location” ],
1.2. Coded Obs count Boolean
To count the number of observations of a coded concept, classified by the user selection (coded answers).
Configuration
"nutritionProgram": {
"name": "Nutrition Program - Nutritional status of registered children"
,
"type":
"obsCount", "config": { "ageGroupName": "Nutritional Status For Registered Children", "conceptNames": ["Nutrition, Nutritional Status"], "locationTagNames": ["Report Location"]
}
}
Add the locationTag “Report location” in openmrs
And specify the location tag in config ex. "locationTagNames": ["Report Location” ]
1.3 Boolean concepts count
(to be renamed toBoolean Observations Count) Use this when you want to count the observations of type boolean, classified by the user selection: Yes/No (True/False).
Example
Configuration
"nutritionProgram": {
"name": "Nutrition Program - <5 yrs Children receiving (Deworming)",
"type": "obsCount", "config": { "ageGroupName": "All Ages", "conceptNames": ["Childhood Illness, Albendazole Given"] }
}
2. Coded Obs by Coded Obs (count)
Use this to count the two coded observations, both counted and displayed as a pivot table against each other.
Example
Configuration
"safeMotherhoodProgram": {
"name": "Safe Motherhood program - Type of delivery", "type": "CodedObsByCodedObs", "config": { "ageGroupName": "All Ages", "conceptPair": ["Delivery Note, Method of Delivery", "Delivery Note, Fetal Presentation"], "rowsGroupBy": ["Delivery Note, Method of Delivery"], "columnsGroupBy": ["Delivery Note, Fetal Presentation"] }
}
3. Diagnosis count
Lists count of all diagnosis entered via the Bahmni system.
Configuration
"nameOfReport": {
"name": "Name of Report", "type": "diagnosisCount", // Mandatory. Value should be exactly diagnosisCount "config": { "dateRangeRequired": false, // Optional. Used to display reports that do not require a date range in a different section. Default true "applyDateRangeFor": "visitStopDate|diagnosisDate", // Optional. Default value = 'visitStopDate'. Valid only when dateRangeRequire=true "visitsToConsider": "open|closed|all", // Optional field. Default value = 'all' "ageGroupName": "age group name defined in reporting_age_group.report_group_name" //Optional "concept": "concept_set_name", // Mandatory. Three level concept set structure, with a root_concept, header_concepts and leaf_concepts "rowsGroupBy": ["gender|agegroup_name|header_concept_name|leaf_concept_name"], // Optional field but when rowsGroupBy is specified, columnsGroupBy should also be specified. Default value is ["header_concept_name", "leaf_concept_name]
"columnsGroupBy": ["gender|agegroup_name|header_concept_name|leaf_concept_name"], //Optional field but when rowsGroupBy is specified, columnsGroupBy should also be specified. Default value is ["agegroup_name"]
"icd10ConceptSource": "ICD10-BD", // Optional field. Default value = 'ICD 10 - WHO'. If any implementation is using a different concept source for diagnosis coding, it can be set here.
"locationTagNames":["Report Location"] // Optional field. If any location tag is provided, only the encounters associated with the locations with those tags are counted. If this parameter is not set, all the encounters would be counted.
}
}
Currently, if there is a concept field specified, we do not have ICD10 code in the report. It is currently not clear if ICD10 codes are required to be setup for the diagnosis report to work. Once a decision is reached, all reports will follow the convention.
The age group is supposed to be present in the reporting_age_group table in openmrs database.
Example
Diagnosis Summary report
"OralnDentalReport": { "name": "Dental and Oral Report", "type": "diagnosisCount", "config": { "concept": "Oral diagnosis", "ageGroupName": "Age Groups", "rowsGroupBy": ["header_concept_name","leaf_concept_name"], "columnsGroupBy": ["gender","agegroup_name"] } }
Diagnosis report without age group
"OralnDentalReport1": {
"name": "Dental and Oral Report 1",
"type": "diagnosisCount",
"config": {
"locationTagNames":["Report Location"],
"icd10ConceptSource":"ICD10-BD",
"rowsGroupBy": [
"header_concept_name",
"leaf_concept_name"
],
"visitTypes":["IPD","OPD"],
"columnsGroupBy": [
"gender",
"agegroup_name"
]
}
},
Diagnosis report with age group
"OralnDentalReport2": {
"name": "Dental and Oral Report 2",
"type": "diagnosisCount",
"config": {
"locationTagNames":["Report Location"],
"icd10ConceptSource":"ICD10-BD",
"ageGroupName": "Registration",
"rowsGroupBy": [
"header_concept_name",
"leaf_concept_name"
],
"visitTypes":["IPD","OPD"],
"columnsGroupBy": [
"gender",
"agegroup_name"
]
}
},
4. Test Count
To list all tests, results and the count.
Configuration
"name": "Malaria Control Programme - Diagnosis and Result [check for Microscopy= 'PBS for Malaria, Filaria parasite', RDT= SUM('Malaria Ags', 'Malaria Abs')]", "type": "TestCount"
Example
6. Observation Template Report
Report for a template with all the fields and the values that were filled in a given timeframe.
Configuration
"vitalsTemplateReport":{
"name": "Vitals Template Report",
"type": "obsTemplate",
"config": {
"templateName": "Vitals",
"patientAttributes": ["caste", "education"],
"locationTagNames": ["Report Location"],
"applyDateRangeFor": "encounterCreateDate"
}
}name: Name of the Report.
templateName: Observation template for which the report needs to be generated.
patientAttributes: Patient attributes like caste, education to be displayed against each patient in report (Refer to image).
applyDateRangeFor: This additional parameter takes the following value encounterCreateDate or encounterDate, to apply the date range filter accordingly. The default value is encounterDate.
Add the location Tag “Report location” in openmrs
And specify the location tag in config ex. "locationTagNames": ["Report Location” ],
Example
7. OPD/IPD Visits Count Report
Listing the count of new/old OPD/IPD patients counts in a given time period
Configuration
"ipdOPd": {
"name": "OPD/IPD Visit Count",
"type": "IpdOpdVisitCount"
}
Example:
8. Numeric Concept Values Report
Listing the count of numeric concepts observations based on the result values range for the given age groups
Configuration
"HaemoglobinRange": {
"name": "Haemoglobin Range Based Report
",
"type":
"NumericConceptValuesCount",
"config": { "rangeGroupName": "Haemoglobin", "ageGroupName": "Haemoglobin", "conceptNames": ["Haemoglobin"], "countOncePerPatient": false
}
}
The default value of "countOncePerPatient" should be false. In this case, we count an observation as many times as it has been recorded.
The observation will be counted once within an encounter. All changes made to an observation within an encounter will be considered as one.
If the value of "countOncePerPatient" is set to true, then we only count the latest value of the observation for the given date range.
Example:
9. Obs Count By Concept Class Report
Listing the count of observations based on the concept class for the given date range
Configuration
"radiologyCount": {
"name": "Radiology(X-Ray) Count",
"type": "ObsCountByConceptClass",
"config": { "conceptClassNames": ["Radiology"] }
}
Example:
10. Obs Value Count Report
Listing the count of observations for each value for given concept names
Configuration
"ObsValueCount": {
"name": "Obs Value Counts for Albumin, MCH, Surgery Date and Posture(blood pressure)",
"type": "ObsValueCount",
"config": { "conceptNames": ["Albumin","MCH","Date of Surgery","Posture"] }
}
Example:
11. Patients With Lab Test Results Report
Listing the patients with lab test results along with test outcome, for a given list of lab tests and based on given test outcome (abnormal and/or normal)
Configuration
"patientsWithLabTest": {
"name": "Patients with labtest results for HIV ELISA, Albumin and MCH",
"type": "PatientsWithLabtestResults",
"config": { "conceptNames": ["HIV ELISA (Blood)","Albumin","MCH"]
"testOutcome": ["abnormal","normal"] }
}
For Example:
12. IPD Patients Report
In this report, we generate a list of IPD patients along with a number of fields including patient details, confirmed diagnosis (comma separated if there is more than one), observation values (comma separated if there is more than one) for configurable list of concepts, configurablelistof patient attributes and configurable list of address attributes.
Configuration
"ipdPatients": { "name": "IPD Patients Report", "type": "ipdPatients", "config": { "addressAttributes": ["address1", "city_village"], "patientAttributes": ["caste", "education"], "conceptNames": ["Height", "Weight"],
"locationTagNames": ["Report Location"],
"filterBy": "Date of Discharge" }}
Note: addressAttributes must be always in snake case Example: "city_village" instead of "cityVillage".
The date range filtering criteria can either be applied on "Date of Admission" or "Date of Discharge". We use "filterBy" parameter to specify the user criteria and distinguish between the two scenarios. If not configured, the "filterBy" parameter will be defaulted to "Date of Admission".
Add the location Tag “Report location” in openmrs
And specify the location tag in config ex. "locationTagNames": ["Report Location” ],
13. Visits Aggregate Count Report
In this report, we will generate the count of admission and discharges happened during the given date range, for each visit type.
Configuration
"visitAggregateCount": { "name": "Visit Aggregate Count Report", "type": "VisitAggregateCount", "config": { "type": "VisitAggregateCountReport",
"locationTagNames": ["Report Location"],
"visitTypes": "'IPD','OPD','EMERGENCY'" }}
Add the location Tag “Report location” in openmrs
And specify the location tag in config ex. "locationTagNames": ["Report Location” ],
14. Patient Program State Count Report
In this report, we will generate the count of patients who are admitted to different states of a program.
Note: If a program has no states it will open up a blank page. The parameter "programName" is a program which is already configured earlier in OpenMRS.
Configuration
"patientProgram": { "name": "Patient Program State Count Report", "type": "programStateCount", "config": { "programName": "Patient Overall Status" }}
Example: We have created a Patient Overall Status program and added three states 'Attending Clinic', 'Transferred OutOf' and 'Dead' to it. It shows the number of patients that have entered a state
within a given date range "From 2015-08-01 to 2015-08-13" .
If the patient is currently enrolled in a different state, still the count should be taken for the original state if it is in the date range and has not been deleted.
15. Patient Program State Transition Count Report
In this report, we will generate the count of patients who are under going a state transition of a program.
Note: If a program has no states it will open up a blank page. The parameter "programName" is a program which is already configured earlier in OpenMRS.
Configuration
"malariaProgram": {"name":"Malaria Program State Transition Report","type":"programStateTransitionReport","config":{"programName":"Malaria Program" }}
Example: We have created a Malaria Program and added three states 'First State', 'Second State' and 'Third State' to it. It shows the number of patients that have done a state transition
from 'First State' to 'Second State' and from 'Second State' to 'Third State' within a given date range "From 2015-08-02 to 2015-08-06" .
16. Patient Data Report
In this report, patient details are generatedwiththe following fields
- Patient ID
- Patient Name
- Age
- Gender
- DOB
- Address fields
- Patient Attributes
- Date of registration
Note: If no date range is specified then the data for all patients is returned.
Configuration
"patientInformation": {
"name": "Patient Information",
"type": "PatientReport"
}
17. Program Patient State Report
Patient details are generated with the following fields
- Sr. No.
- Patient Identifier
- Patient Name
- Patient Age
- enrolment date in the program
- states for the patient
- state start date
- state end date
- end date of the program for the patient
- outcome for the patient
Configuration
"programPatientStateReport":{"name": "Program Patient State Report","type": "PatientProgramReport","config": {"programName": "Malaria Program" }},
18. Program Enrollments Canned Report
Configurations
"programEnrollmentTemplateReport": {"name": "Program Enrollments", "type": "ProgramEnrollmentReport"}
19. Observation Canned Report
Configurations
"obsCannedReport": {"name": "Obs Canned Report", "type": "obsCannedReport", "config": {"patientAttributes": ["caste", "education"], "applyDateRangeFor": "ObsRecording", "addressAttributes": ["postal_code", "city_village"], "conceptNames": ["WEIGHT","Pulse", "Systolic"], "visitIndependentConcept": ["HEIGHT"], "enrolledProgram" :"HIV Program" , "showObsOnlyForProgramDuration": false }}
Patient Attributes : all the possible values from personattributetype.name column like {"HEIGHT","WEIGHT","Pulse"}. (REQUIRED)
Apply Date Rage For : "<tablename>.<columnname>" of type date(or datetime) where table should be one of [obs,encounter,patientidentifier,patientprogram,program,concept_view] PS patientidentifier & patientprogram are joined only is enrolledProgram is mentioned in config (REQUIRED) Values, ObsRecording,ProgramEnrollment
Addrress Attributes : column names of person_addrress table (REQUIRED)
concept names : only leaf level concept names, concept set are not supported (REQUIRED)
visit independent concepts : latest obs will be picked for them irrespective of visit. PS visits other than visit having latest obs will have no value for this field. (REQUIRED)
enrolled program : only one program name is supported (OPTIONAL : remove entire config if not required)
show obs only for program duration : filter only those obs taken in given program (REQUIRED)
20. Drug Order Reports:
The Bahmni documentation is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)