manually merge stuff from https://github.com/robworth/patientview/pull/115
Merge remote-tracking branch 'origin/develop' into develop
tweaks to patch 25, and some test stuff