Skip to main content

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:

MeldRx App Setup

Log in to MeldRx and navigate to the apps page (MeldRx > Apps) and press Register App.

Step 1

Provide app details

  1. Give your app a Name.
  2. Select System on the App User Type.
  3. For the Scopes select all scopes.

Step 2

Connect linked apps

  1. Select a Add Linked App.
  2. Choose Epic as the Linked App Provider.
  3. Choose to use your own credentials.
  4. Give your linked app a name.
  5. In the Client Id paste in the Non-Production Client ID from the your Epic app.
  6. Match the Scopes with the scopes from your app above.
  7. Select Hosted JWKS.
  8. Add the Linked App.

Step 3

Provide workspace details

  1. Select Yes to workspace creation.
  2. Give your Workspace a name.
  3. Select the same FHIR API Provider as you did in the Linked app e.g. Epic, if not already selected.
  4. Select the Epic Sandbox url from the dropdown.
  5. 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]
  1. Supply the directory where you want to create your app.
  2. Select the Backend option.
  3. Select the Server option.
  4. Select Creatine Clearance System App (Python).
  5. Open the app in a code editor.
  6. Update the .env to set MELDRX_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