Healthlocker is a secure platform powered by the South London and Maudsley NHS Foundation Trust (the trust) that promotes supported self-management and opportunities to improve communication between service users, carers and clinicians. A full list of features can be found here.
- Clone the repo
cd
in the repo- Update the line in the Vagrantfile that says "Your path to Healthlocker here" with the path to where you cloned the repo
- Run the command
vagrant up
in the terminal
This will take a few minutes to set up but once it is complete you will be able to
visit localhost:4000
from your browser
and checkout the styleguide.
You will not be able to access any data from the ePJS database
More instructions on how to use vagrant can be found here
Ready to run in production? Please check the deployment guides.
We use ExUnit
and
wallaby
for testing. Wallaby has a
dependency on phantomjs. You can follow their
instructions to install it.
After that you should be able to run mix test
and see lots of green!
You can view all of the routes by running mix phoenix.routes
in your terminal.
- Official website: http://www.phoenixframework.org/
- Guides: http://phoenixframework.org/docs/overview
- Phoenix Docs: https://hexdocs.pm/phoenix
- Ecto Docs: https://hexdocs.pm/ecto/Ecto.html
The dropdown options for security questions, hours slept and wake count from the sleep tracker, and symptom scale from the symptom tracker can be updated by following the instructions in this document.
The stories and tips can be written using markdown. This will allow you to style the text as you write it.
You can find a guide to common things you may want to do with markdown in this repository.
In addition to formatting the text with markdown, be sure to include #story
or #tip
(with an additional category tag) so the story or tip displays on
the correct page.
- Tips can be added in by admin users, and can be viewed either in full or filtered by tag
- Story content can be input by admin users, and are displayed in cards with a story preview
- Stories can be expanded to view the full individual story
- Three-step sign up process
- Login
- Coping strategies
- view full list they have made
- view individual coping strategies
- edit and delete coping strategies
- Goals
- view full list they have made
- view individual goals
- edit and delete goals
- mark as important to display at the top of the goals page
- mark as achieved once a goal is completed
- Static info pages:
- Support page
- Terms of service (also linked in sign up)
- Privacy statement (also linked in sign up)
- About
- Account
- update their name (only if not a carer or service user), and phone number
- update consent for sharing data with researchers, and consent to be contacted
- update password and security Q&A
- connect to their NHS health record
- connect as a carer for a service user
- disconnect from their NHS health record
- Feedback can be sent about the site from a form. This is done using Bamboo and Amazon SES
- Track sleep, a custom problem, or input daily diary entries
- Reset forgotten password. Uses a custom made forgotten password controller
- Clinician caseload
- Clinicians can click on Healthlocker connected users to view goals and coping strategies, tracking data, contact details, and messaging
- Clinicians can click on carers to message or get contact details
- Styleguide
The Healthlocker App is deployed to "Production" in the following configuration:
To edit this diagram, open:
https://docs.google.com/drawings/d/1VwpBVKzqSX0q81KsKSKAOS7wtYcqZqARKAFTKJUaowg
The cluster of Web Servers is two or more Linux VMs behind a load balancer.
There are 4 pieces to the puzzle:
-
Azure Load Balancer: https://azure.microsoft.com/en-gb/services/load-balancer - All web traffic is handled through the load balancer which performs continous health checks on the application server(s) and routes requests in a "round-robin" to balance load.
- There is no "specification" for Load Balancers on Azure and pricing is FREE!
-
Linux Virtual Machines (VMs): https://azure.microsoft.com/en-gb/services/virtual-machines - these run our Phoenix Web Application. The Application is compiled as an executable which runs on "BEAM" (the Erlang Virtual Machine). The VMs are actively monitored and can be scaled up dynamically dependent on request volume.
-
Azure PostgreSQL Database-as-a-Service: https://azure.microsoft.com/en-us/services/postgresql - all application data is stored in an Azure Database instance which is encrypted at rest, scales dynamically/transparently ("built-in high availability") and backed up transparently. Data is Only accessible from the Production VMs
-
Azure SQL Server (Database-as-a-Service): https://azure.microsoft.com/en-gb/services/sql-database - Stores a read-only snapshot of the "Care Notes" (ePJS) Database. This contains the patients personal health information and is controlled by the "SLaM" IT team. Access is restricted to the Production Healthlocker VMs and patient (personal) data is only viewable by the patient and authorized healthcare professionals.
- Tips can be added in, and can be viewed either in full or filtered by tag
- Story content can be input by users, and are displayed in cards with a story preview
- Stories can be expanded to view the full individual story
- Support page is available in full
- Three-step sign up process
- Login
- Users can only post content when logged in
- Users can create, view, update and delete coping strategies they have made
- Users can create, view, update, and delete goals they have made
- Goals can be marked as important and are displayed at the top of the goals page
- Users can visit their account page where they can update their name, email, or phone number
- Users can update their consent for sharing data with researchers in their account
- Users can update their password and security Q&A in their account
- Terms of service can be accessed from the footer and is linked in sign up
- Privacy statement can be accessed from the footer and is linked in sign up
- Feedback can be sent about the site from a form. This is done using Bamboo and Amazon SES
- Logged in users can track their sleep over time using the sleep tracker in toolkit
- Users who have tracked sleep can view:
- hours slept each night over the past week
- average number of hours slept over the past week
- times they woke up each night for the past week
- notes they made about their sleep from the past week
- Users can view the previous 7 days sleep data, or go forward once they've gone back.
- Styleguide
The Healthlocker App is deployed to "Production" in the following configuration:
To edit this diagram, open:
https://docs.google.com/drawings/d/1VwpBVKzqSX0q81KsKSKAOS7wtYcqZqARKAFTKJUaowg
The cluster of Web Servers is two or more Linux VMs behind a load balancer.
There are 4 pieces to the puzzle
- Azure Load Balancer: https://azure.microsoft.com/en-gb/services/load-balancer - All web traffic is handled through the load balancer which performs continous health checks on the application server(s) and routes requests in a "round-robin" to balance load.
- Linux Virtual Machines (VMs): https://azure.microsoft.com/en-gb/services/virtual-machines - these run our Phoenix Web Application. The Application is compiled as an executable which runs on "BEAM" (the Erlang Virtual Machine). The VMs are actively monitored and can be scaled up dynamically dependent on request volume.
- Azure PostgreSQL Database-as-a-Service: https://azure.microsoft.com/en-us/services/postgresql - all application data is stored in an Azure Database instance which is encrypted at rest, scales dynamically/transparently ("built-in high availability") and backed up transparently. Data is Only accessible from the Production VMs
- Azure SQL Server (Database-as-a-Service): https://azure.microsoft.com/en-gb/services/sql-database - Stores a read-only snapshot of the "Care Notes" (ePJS) Database. This contains the patients personal health information and is controlled by the "SLaM" IT team. Access is restricted to the Production Healthlocker VMs and patient (personal) data is only viewable by the patient and authorized healthcare professionals.
Resource Description | Exact Specification | Resource Quantity | Estimated Monthly Cost |
---|---|---|---|
Linux VM (Prod) | "Azure D1 V2" Linux VM: 3.5Gb RAM, 1CPU Core, 50GB Hard disk | 2 | £75.41 |
PostgreSQL Database (Prod) | "Standard Tier" Servers ("100 Compute Units") with 125GB SSD | 2 | £128.42 |
Load Balancer configured to proxy to Prod VMs | Azure Standard HTTP Load Balancer | 1 | FREE |
Linux VM (Build/Staging) | "Azure A0" Linux VM: 0.75Gb RAM, 1CPU Core, 20GB Hard disk | 1 | £11.09 |
PostgreSQL Database (Prod) | "Basic Tier" Server ("50 Compute Units") with 50GB SSD | 1 | £13.36 |
Load Balancer (Staging) | Azure Standard HTTP Load Balancer | 1 | FREE |
ePJS Snapshot MS SQL Server | 100 eDTUs, 100 GB Storage per pool, 200 DBs per pool | 1 | £166.35 |
We use Travis-CI for our continuous integration. see: https://github.com/dwyl/learn-travis
Release build command:
mix edeliver upgrade production --verbose --auto-version=revision
In the interest of reproducibility we have produced a
step-by-step guide to deploying a Phoenix Web Application to
Microsoft Azure:
https://github.com/dwyl/learn-microsoft-azure
Unlike most application development Agencies, that attempt to "Lock-in" clients, the team building Healthlocker are focussed on building capacity within the NHS to support and extend Healthlocker.
The following learning resources are community-maintained and 100% free/open:
- Continuous Integration / Deployment: https://github.com/dwyl/learn-travis
- Elixir Programming Language: https://github.com/dwyl/learn-elixir
- Phoenix Web Applciation Framework: https://github.com/dwyl/learn-phoenix-framework
- Mobile-first User Interface Library: https://github.com/dwyl/learn-tachyons