This feature helps ensure data quality on chosen variables. Based on the rules defined for those variables, a run for the patients yields a list of patients for whom the data is incomplete/erroneous. The results are displayed as a list of all data inconsistencies on a dashboard called the Data Quality Dashboard.
The rules can be customized by an implementer (Steps for the same will be updated later). These rules can be sometimes very complex and therefore the rules can be written in java/sql/groovy depending on the complexity.
This feature is influenced from the OpenMRS data integrity module (https://wiki.openmrs.org/display/docs/Data+Integrity+Module) and slightly modified to suit requirements.
The data integrity task is scheduled to run every day at 12:00AM by default. To change this setting, go to OpenMRS Administration > Manage Scheduler > click on Data Integrity Task link > Schedule and change the repeat interval .
Add the value for key in respective home/ locale_${en,fr, .. }.json.
{ "MODULE_LABEL_DATA_INTEGRITY_KEY": "Data integrity" } |
In clinical/locale_en.json,
{ "MODULE_LABEL_ERROR_REPORTS_KEY": "Error Reports", "DQ_PRINT_TITLE_DATA_QUALITY_REPORT": "Data Quality Report", "DQ_DASHBOARD": "Data Quality Dashboard", "DQ_COLUMN_TITLE_TREATMENT_REG_NO": "Treatment Reg No", "DQ_COLUMN_TITLE_NAME": "Name", "DQ_COLUMN_TITLE_EMR_ID": "EMR ID", "DQ_COLUMN_TITLE_NOTES": "Notes", "DQ_COLUMN_TITLE_ACTION": "Action", "DQ_COLUMN_TITLE_RULE_NAME":"Rule Name", "DQ_COLUMN_TITLE_REG_FACILITY":"Treatment facility" } |
The key for name is changed from "name" to "DQ_COLUMN_TITLE_NAME" and column "DQ_COLUMN_TITLE_REG_FACILITY" is added from 1.4 release |
Add the config below to extension-dataintegrity.json
{ "bahmni_clinical_patients_search_allpatients_app_clinical": { "id": "bahmni.clinical.patients.search.allPatients", "extensionPointId": "org.bahmni.patient.search", "type": "config", "extensionParams": { "searchHandler": "endtb.sqlSearch.dataIntegrity", "forwardUrl": "#/default/patient/{{patientUuid}}/dashboard?programUuid={{programUuid}}&enrollment={{enrollment}}", "translationKey": "MODULE_LABEL_ERROR_REPORTS_KEY", "view" : "tabular", "showPrint": true, "printHtmlLocation": "/bahmni_config/openmrs/apps/dataintegrity/patientListPrint.html", "searchColumns" : ["DQ_COLUMN_TITLE_TREATMENT_REG_NO", "DQ_COLUMN_TITLE_NAME"] }, "order": 1, "requiredPrivilege": "app:clinical" } } |
To hide print button on the DQ Dashboard set
"showPrint": false |
To configure columns to search on the DQ Dashboard, add the column keys to the list in searchColumns. The search facility can be enabled on all columns.
The configuration below will enable search on columns Treatment Reg No, Name of the patient.
"searchColumns" : ["DQ_COLUMN_TITLE_TREATMENT_REG_NO", "DQ_COLUMN_TITLE_NAME"] |
DQ Rules for EndTB are written in the the openmrs-module-bahmniendtb repository.
git clone https://github.com/Bahmni/openmrs-module-bahmniendtb |
2. Follow these steps to add a new DQ Rule :
INSERT INTO dataintegrity_rule ( rule_name, rule_category, handler_config, handler_classname, uuid ) VALUES ( "Baseline Firstling DST missing", "java", "java", "org.openmrs.module.bahmniendtb.dataintegrity.rules.RuleName", uuid()); |
mvn clean install |
sudo service openmrs restart |
The following are some sample DQ Rules
Open discussion with community Support for rule_group and schedule tables so that certain rules can be grouped and can be assigned specific groups to a different schedules. (open for discussion) Building ability to run rules per patient and making rule groups. |