Generate and save the templates:- From datasense homepage navigate to Templates tab. Search for the DHIS dataset for which you want to setup the report. This will generate 3 templates.
Query Template Suggestion:- This is a json file template for list of queries with a name for each cell for that DHIS dataset. The template will have dummy queries which need to be replaced by actual queries. This should be stored as a json file in "/opt/datasense/lib/dhis_config/aqs_query" folder.
Post Template Suggestion:- This is a freemarker file template which will be parsed to get the JSON payload. For each cell in DHIS the value will be put from query-results in above template. This should be stored as a freemarker template file in "/opt/datasense/lib/dhis_config/templates" folder.
Config Template Suggestion:- This is a JSON file template which stores the path for above two templates and list of all query-names need to be executed. This should be stored as a json file "/opt/datasense/lib/dhis_config/aqs_config" folder. In this file, you need to replace "[path_to_config]" with "/opt/datasense/lib/dhis_config". It will have names for query file and template files, you will have to change them to above two file names respectively.
Map HRM facility to DHIS Organisation:-Datasense works with HRM facilities and stores data against them. DHIS has a concept of Organisations and it accepts reports against them. In datasensefirst you have to map the HRM facility to a DHIS Organisation. From data-sense homepage navigate to Manage Facilities tab. Here all the facilities will be listed whose data is stored in datasense. Click on the action button for the facility you want to map. It will lead to the search box for DHIS Organisations where you can search and map it to the facility.
Map datasense report to DHIS Dataset:- You need to map a datasense-report to DHIS dataset to tell the system the report content goes to which dataset. To do this from datasense homepage navigate to Manage Reports tab. All the reports which are put as a part of step 1 will be listed there. You need to click on the action buttonfor the report you want to map. This will lead to a search box for DHIS datasets. You can search and map the dataset.
...
Expand
title
Datasense schema description needed for DHIS2 reports queries
Info
Below are the table-names and relevant columns which will be needed for DHIS2 reporting.
patient:- This tables stores all the information about patients personal data.
patient_hid => HealthId of the patient.
dob => needed when we have to write queries for specific age groups.
gender
present_location_id => present address of patient stored in form of catchment codes. This column can be used when we have to write queries area wise.
encounter:- This table stores information related to encounters.
encounter_id
encounter_datetime => stores the date when this encounter was recorded in CHW-Device/Hospitals.
visit_type.
encounter_type
patient_hid
facility_id => stores the HRM code for the hospital/community-clinic where the encounter happened.
procedures:- This tables stores all the procedures performed in hospitals. While writing queries for procedure we should prefer to use reference-term-code(codings from ICD-10, LOINC etc) if defined for that procedure's concept otherwise concept_uuid for that procedure.
procedure_id
patient_hid
encounter_id
start_date
end_date
procedure_uuid => uuid of TR procedure concept. In the query we need to compare it with the uuid of the procedure concept from TR.
procedure_code => reference-term-code for the procedure concept defined in TR.
diagnosis_uuid => If there was a diagnosis as a part of procedure this will be populated. This also is the concept_uuid of the diagnosis in TR.
diagnosis_code => reference-term-code for the diagnosis concept defined in TR.
diagnosis:- This tables stores all the diagnoses information. While writing queries for diagnosis we should prefer to use reference-term-code(codings from ICD-10, LOINC etc) if defined for that diagnosis's concept otherwise concept_uuid for that diagnosis.
diagnosis_id
patient_hid
encounter_id
diagnosis_datetime
diagnosis_code => reference-term-code for the diagnosis concept defined in TR.
diagnosis_concept_id => uuid of TR diagnosis concept. In the query we need to compare it with the uuid of the diagnosis concept from TR.
immunization:- This table stores all the immunization done. While writing queries for immunization we need to compare drug_id column with uuid of the same drug in TR.
immunziation_id
patient_hid
encounter_id
drug_id => uuid of the TR drug which was given as immunization.
datetime
prescribed_drug:- This table stores all the prescribed drugs.
prescribed_drug_id
patient_hid
encounter_id
prescription_datetime
drug_code => uuid of the TR drug which was given as prescription.
non_coded_name => The name of the drug if it is not from TR. It is not advised to create local drugs and report on them because of consistency issues.
diagnostic_order:- All sort of orderables (Lab order, Radiology Order etc) are stored in this table. While writing queries for diagnostic-orders we should prefer to use reference-term-code(codings from ICD-10, LOINC etc) if defined for that diagnostic-order's concept otherwise concept_uuid for that diagnostic order.
order_id
patient_hid
encounter_id
order_datetime
order_category => Type of order (Lab order, Radiology Order etc)
code => reference-term-code for the order concept defined in TR.
order_concept => uuid of TR order concept. In the query we need to compare it with the uuid of the order concept from TR.
diagnostic_report:- This table stores the results of the orders.
report_id
patient_hid
encounter_id
order_id => ID of the order for which this report is
report_datetime
observation:- This table stores the generic observation which doesn't come any of the above category. Diagnostic Reports will also have results in form of observations.
observation_id
patient_hid
encounter_id
code => reference-term-code for the observation concept defined in TR.
concept_id => uuid of TR observation concept. In the query we need to compare it with the uuid of the observation concept from TR.
parent_id => for a nested observation, all the child observation will have id of their parent observation.
value => value of this observation.
report_id => populated if obs is part of a diagnostic_report.
...
Once a report is setup in datasense, it can be scheduled for post to DHIS one time or periodically. From datasense homepage navigate to Mangae Reports tab. The reports which are mapped to DHIS datasets will have a calender icon. Click on the icon and this will lead to schedule reports page. On this page, it will show all the facilities with a checkbox that have data in datasense and this report is applicable for them. Check all the facilities for which the data should be posted.