🚀 Deployment
Quick Deployment
The Hikma Health EHR is a flexible platform that can be deployed to any cloud host you choose, and the mobile application can run on all modern android devices. This guide will show how to set up the entire platform in 30 minutes.
After completing the guide you will have a base installation of the HH EHR system ready for further customizations and usage.
Structure
The EHR platform is made of 4 components; a database, a server, an admin portal, and a mobile application. Click on any of the component links to learn more about them, or to download the source code.
Each of these components will need to be set up before the EHR is ready for use. We should set them up in the following order:
- Database
- Backend Server (API)
- Administrator Portal
- Mobile application
This is the back-to-front strategy where we start with the "most backend" item that no users typically engage with and finish with the tools that people interact with. We do this because each component we set up is needed for the one - this is how they are connected.
Hosting set up
Our EHR can be hosted on almost any hosting service you choose, so create an account with your favorite provider and proceed. For this guide, we will use Render as our hosting provider. They offer a secure service that is relatively simple to get started with.
Create an account and follow the instructions needed to complete your account creation. Some hosting providers will require a working credit/debit card, while others will let you get started without one.
At the time of this writing, you do not need a credit card to sign up.
Backend set up
The Hikma Health EHR system is powered by a python backend and a postgresql database. The administrator dashboard and mobile applications all send data and queries to the backend which communicates with the database to carry out any requests. All authentication and authorization happens in the backend as well.
With the render quick deploy, you can deploy both the backend and database.
To deploy the database, follow the following steps:
- If you are not already signed in, sign into your render.com account in your browser.
- Fork the backend repository found here repository onto your own ogranizations repository.
- On the repository homepage, known as the README, click on the "Deploy to Render" button. This will open a new render page.
- On the Render portal, enter a new name for the backend blueprint.
- Click "create".
- Wait for all the deployments to complete. At which point your database and backend have both been set up for you.
- Navigate back to the dashboard to make sure you can see the instances.
NOTE: Make sure to update the instance type from starter to standard when ready to go to production. all starter databases are deleted after 90 days
Admin portal set up
The administrator portal is a React based web application (built on JavaScript/TypeScript & Next.js) for administrators to manage clinician accounts, view reports, export data, and edit forms. This is a powerful portal so access to it should be limited to only those with the right permissions.
The portal source code can be found in this repository, you can investigate the package.json file to see the dependencies and supported commands
To deploy to render.com follow these instructions"
- Clone the portal repository to your own github organization or account
- Fork the backend repository found here repository onto your own ogranizations repository.
- On the repository home page, known as the README, find the one click on the "Deploy to Render" button. This will open a new render page
- On the Render portal, enter a new name for the admin portal blueprint
- Click on create
- Wait for all the deployments to complete. After the deployment, your admin portal is almost ready.
- Navigate back to the dashboard
- Open the new web service you just created
- Open the environment tab
- You need to replace the value of "NEXT_PUBLIC_HIKMA_API" with the URL of your backend - you can find this on the backend deployment we just did.
- This will trigger a new deploy process, wait for a few minutes for the deployment to complete.
- Open the URL of your deployment and sign in to test it (you can get the default credentials by contacting ally[at]hikmahealth(dot)org)
- 🔥 DO NOT FORGET TO CHANGE THE PASSWORD. Go to users list > edit user > then enter the new password there
Mobile set up
The android application is the primary data collection tool for the Hikma Health EHR system. You can choose to either manually install the application on your devices by running the code from the repository, or by simply downloading the app from the play store (recommended).
To get started with the mobile application, you must have a working backend, database, and administrator portal. Here is how you can connect the application to the rest of your system.
- Open your administrator portal and navigate to the "Activate App" page. This will show you the QR code needed to link your application.
- Download the application from the play store
- After opening the application, on the sign in page, click on the "Register with QR code" to open the QR code scanner
- Use your phone to scan the QR code opened in step 1 above. This will tell your mobile application where to send data to.
- Once linked, you can use your credentials to sign into the application
- From here you can proceed with patient registration, recording visits and more.
Troubleshooting
If you experience any issues with your deployment process, the first step should be to look at the logs (whether this is the browser console or the server logs). If the issue is still not clear, please file an issue directly on github or send us an email. Please include as much detail as possible, we prefer if you include too much details and screenshots / videos. If you are stuck for more than 15 minutes, please reach out.
Next steps
At this point you are ready to start customizing your deployment by setting up different forms and registering clinicians.