Features/124 db specialty setup

Re-commit the changes from https://github.com/robworth/patientview/commit/5191864305777c07c04a990e20a144222422fb39.