Walkthrough: Backend System App
Introduction
This section will help you build a System App with MeldRx. This example will be linked with Epic, however you can choose a different EHR.
Prerequisites
Before getting started, please make sure you have the following:
- An account with Epic FHIR developer portal
- A MeldRx Developer account (sign up at MeldRx)
- Dowload or update the create-meldrx-app CLI
MeldRx App Setup
Log in to MeldRx and navigate to the apps page (MeldRx > Apps
) and press Register App
.
Step 1
Provide app details
- Give your app a Name.
- Select
System
on theApp User Type
. - For the
Scopes
select all scopes.
Step 2
Connect linked apps
- Select a
Add Linked App
. - Choose
Epic
as the Linked App Provider. - Choose to use your own credentials.
- Give your linked app a name.
- In the
Client Id
paste in theNon-Production Client ID
from the your Epic app. - Match the
Scopes
with the scopes from your app above. - Select
Hosted JWKS
. - Add the Linked App.
Step 3
Provide workspace details
- Select
Yes
to workspace creation. - Give your Workspace a name.
- Select the same
FHIR API Provider
as you did in the Linked app e.g.Epic
, if not already selected. - Select the
Epic Sandbox
url from the dropdown. - Once the validation is complete press
Create
.
Once created, you can follow the steps on this page to create your MeldRx app. Here you can find the commands you need to run to bootstrap your application using the create-meldrx-app CLI.
Creating the app
Now that you've set up an app and workspace that are linked with Epic, you can move on to coding the app. We will be using the create-meldRx-app CLI to get a quick template for a patient facing app.
Installation
npm i -g create-meldrx-app
Using the Tool
Navigate to the path where you want to create your application and run:
npx create-meldrx-app --meldrx-app-id [clientId] --workspace-url [workspaceUrl]
- Supply the directory where you want to create your app.
- Select the
Backend
option. - Select the
Server
option. - Select
Creatine Clearance System App (Python)
. - Open the app in a code editor.
- Update the
.env
to setMELDRX_CLIENT_SECRET
to your client secret.
Now change your directory to your newly created app folder and run:
pip install -r requirements.txt
You can now run the application by using:
python3 -m streamlit run main.py