It is possible for a user to setup OpenREM using PostgreSQL without carrying out the manual database migration that enables the database to calculate median values. As the code stands, if this happens OpenREM users are given the option of calculating median values for charts, but the calculations fail and the user is presented with blank charts without any explanation of what has happened.
If the installer follows the on-line instructions then this should not be an issue. However, it may be better to remove the possibility of blank charts appearing.
There's a variable called
median_available that is currently set to
true if the OpenREM install uses PostgreSQL. It is assumed that the user has carried out the manual database migration to enable the
Median annotate function. If
both appear as options for the chart average.
true could be tightened to check for PostgreSQL and check for a working
Median annotate function. I don't know how to elegantly do this at the moment though.