Reporting rate based on a date element

We are working on a custom DHIS2 app which imports data from Excel files. We have an element ‘Entry Date’ that gets uploaded. Now, how do we calculate reporting rate based on this element. For example -

Entry Date within 10th of next month == TIMELY
Entry date after 10th of next month == LATE
Report not yet uploaded == NO REPORT

above 3 to make 100%

Any idea would be appreciated.

Hi @Mahmud,

There is not a simple way in DHIS2 right now to monitor reporting timeliness and completeness. Timeliness and completeness of aggregated data is done through marking the data set complete in the data entry application. The easiest option would be to put all of your data element that you are importing into a single data set, and have the user after importing the data go into the data entry application and mark that form complete. The added benefit of this is that they could also perform validation rule data quality checks and change any data that violates a validation rule. This is actually a common procedure on some global USAID/PEPFAR databases.

You will have to use a custom script to motor data element timeliness. There is a timestamp associated with each data value that is entered. You will have to extract that information from the server logs to monitor timeless.

There are two generic ways to monitor for data element completeness. Both use predictors.

  1. The first is based upon the reporting history. Essentually it will count the reporting completeness if, for example, the data element has been reported on in the last 12 months. For this the denominator data element you can make a predictor that will record a 1 value if the data element has been reported, for example, in the last 12 months. In this example the denominator predictor generator is if(DE UID >= 0,1,0) with a sequential same count of 12. Then the numerator predictor is essentially the same but with a sequential sample count to 0. You’ll then need to make a standard indicator with your data elements that you’ve assigned your predictor output to.

  2. The second case is manually imputing your denominator based upon the number of org units you expect to report on it. In this case you are not concerned with prior reporting history and you know how many org units should be reporting on the data element every month. The numerator is the same as in the example above, but in the denominator of the indicator you put in the org unit group from the org unit counts tab in the denominator expression builder.

Note about predictors. You need to make sure that you assign an org unit level to each predictor you make. It is required for your predictor to work. Also please take a look as this post on running predictors and some other helpful information: Steps: To create and use Predictor - #6 by hamza

Also attached is a ppt with guidance on using predictors. DQ Predictors and Validation Rules_June 2020 HISP TOT V2.pptx (2.5 MB)

Please let me know if you have any questions.

All the best,
Scott

1 Like

Hi @Scott thanks for taking time to explain about predictors, that will help us in other area. In this question, the requirements was not that complicated, let me rephrase.

We are uploading the complete dataset elements from Excel and setting Complete flag via API, no problem. We cannot use the uploaded datetime for reporting rate - as that is actually ‘upload datetime’, and in the Excel file we have a ‘Receive Date’ manually filled in by the person who entered data manually in the Excel file.

We want to calculate reporting timeliness based on that ‘Receive Date Element’, which is 1 per dataset per facility per period. Now we want to calculate -

Entry Date Element value within 10th of next month == TIMELY
Entry date Element value after 10th of next month == LATE
Report not yet uploaded (no data) == NO REPORT

Please review and guide at your convenience.

Hi @Mahmud, sorry for the delay.

You will not be able to calculate data element timeliness without a custom script to monitor the logs. You can monitor no report (no data) via predictors though as previously described.

@brian might have some ideas on how you can pull the timestamp of the data entry and analyze that outside of DHIS2.

1 Like

Hi @Mahmud . Interesting question. I have a slightly different interpetation of your problem - please let me know if incorrect.

The datasets you have uploaded contain a date-type data element, called “Entry Date”. The value of this data element is the date that the report was manually received by the data entry clerk for entry into Excel.

You want to calculate the number of days between this date-type data element value, and the first day of the reporting period.

Unfortunately, this is also not possible in DHIS2. There are limited functions available for aggregate-level calculations based on date type data elements in indicators or predictors. The only similar one I can find is [days] for calculating total days in period.

The type of calculation could be done in tracker with program indicators: if(d2:daysBetween(V{analytics_start_date}, V{dataElement.uid})<10, 1, 0) etc
But the d2: time functions do not currently work in the aggregate data model.

The date-type aggregate data element exists in Play demo but seems under-utilized, so if you would like these functions for aggregate indicators with dates available, you can post a Jira ticket.

In the meantime, I recommend you calculate this indicator within your custom app, and then upload that value as a different data element to the aggregate dataset.

2 Likes

@brian we exactly did what we proposed, calculated the difference in days and updated the value in a new element in our custom app. Thanks!

2 Likes