Skip to main content

Walkthrough: Provider-Facing App

Introduction

This section will help you build a provider facing linked application 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 Provider on the App User Type.
  3. Set the Client Type to Public.
  4. For the Scopes select the following:
patient/*.read openid profile launch launch/patient
  1. Set the Redirect Urls as :
    • http://localhost:3000/login-callback
    • http://localhost:3000
  2. Go to the Next step.

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:
patient/*.read openid profile launch launch/patient
  1. 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.

You should see a screen like this upon creation: App Creation Success screenshot 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 provider 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 Clinician option.
  3. Select the Web option.
  4. Select Patient Viewer Web App (NextJS).

Now change your directory to your newly created app folder and run:

npm install

You can now run the application by using:

npm run dev

Testing your app

  1. Once your app is running, in your browser go to http://localhost:3000/.
  2. You should see a template screen, here press the Launch with MeldRx button.
  3. On the Epic MyChart screen login as an EHR(username: FHIR / password: EpicFhir11!). You can find the details for other EHRs here.
  4. For the Department keep the default value of EMC FAMILY MEDICINE and press continue.
  5. Search for one of the test patients (i.e. Theodore Mychart), select them and press Accept.
  6. Grant access for that patient to your app.
  7. On the MeldRx consent press Allow Access.
  8. You should see on a Patient Sphere page with the details of the patient that you selected.