bhima icon indicating copy to clipboard operation
bhima copied to clipboard

Feedback on System Usage Statistics

Open jniles opened this issue 3 years ago • 8 comments

We have received the following feedback about our system usage statistics report:

Can we put the totals under each column and the current report?

The question I am asking of this data: Do we start registering and having patient pay prior to 8AM or does our team delay registering patient and receiving payments until after 8AM.  The delay at the registration and the payment window delays the rest of the work to see and treat our patients efficiently. 

7h 3 4 6 Dimanche 24 Octobre 2021

I believe that we already have the totals on the report already. So we'll just need to find a way to make this data more easily accessible to the MD.

jniles avatar Oct 28 '21 06:10 jniles

It is not clear what is desired here. Here is an example System Usage Statistics output: image

Also, I found it very odd that there were stock movements from midnight through 6am. Is these times real? I suspect these are not the real times so why are these odd times occurring?

jmcameron avatar Nov 09 '21 17:11 jmcameron

Also, I found it very odd that there were stock movements from midnight through 6am. Is these times real? I suspect these are not the real times so why are these odd times occurring?

I checked the code and the SQL for times for all this data is based on SQL table 'created_at' fields which are created automatically when the rows are created. So these should depend only on the server computer system time.

jmcameron avatar Nov 09 '21 17:11 jmcameron

I did some tests with a local dev sandbox and had no problem with the created_at date/times corresponding to when the entries occurred and the System Usage Statistics page is correct also. So it seems likely that this has to do with some issue of the computer system time on the server - or how the database archives are created that we can download and use for testing.

jmcameron avatar Nov 09 '21 17:11 jmcameron

For reasons I do not understand, the created_at timestamps in production data that I was able to download do not correspond to the same data at the production site. I requested that the System Usage stats be generated on-site for the same day I did above (in https://github.com/IMA-WorldHealth/bhima/issues/6062#issuecomment-964346494) and received this: image

Notice that there are no entries before 8am. So perhaps the process of uploading production date from the site to the cloud is that the created_at data is not being transmitted but is being constructed on the "cloud" side. The difference in the listed columns is because the production site is running an older version of BHIMA.

jmcameron avatar Nov 10 '21 18:11 jmcameron

I did an experiment and used the 'date' field where available instead of 'created_at' and it improved the results using my copy of the production data. Unfortunately, the Cash Payments data is still not being handled correctly (which leads to the "active users" column being incorrect also. image

jmcameron avatar Nov 10 '21 18:11 jmcameron

In order to address this issue, further details are needed about how data is uploaded from production sites to the backups.bhi.ma server. It seems like there is a problem with the "created_at" data for most of the tables involved in the queries for this report. Either the computers at the production sites have incorrect system time settings or possibly the upload process is not transmitting the "created_at" fields.

jmcameron avatar Nov 11 '21 15:11 jmcameron

Before working on this issue with bhima_test, make sure this pull request is merged first: https://github.com/IMA-WorldHealth/bhima/pull/6094

jmcameron avatar Nov 17 '21 01:11 jmcameron

The medical director at one of our production sites noticed that the System Usage Report for "today" produced results with data in the "future". He notes:

I just created this Statistique d'utilisation du système 8h 49 le 15th Nov 2021. But this report has data from the "future" activity today. See the attached report.

Is is this correct or is the real date that is being used by this system the 14th?

A related but not exactly the same point: My thinking is that this system should use the date from the server to report the date of work and not the date or time from the individual computers as these may be incorrect.

Here is the report: image

jmcameron avatar Nov 17 '21 01:11 jmcameron