Overview
A step-by-step build guide for a complete patient-access integration.
This section is a build guide. The pages that follow take you through a complete patient-access integration, server and client, one step at a time. Read them in order: each page starts from the thing the previous page produced. They assume you have been through the concepts, so the focus here is on building.
How it works
Your server starts a patient session and gets back a redirect URL. Your app sends the patient to it. The patient signs in to their hospital’s patient portal, such as MyChart, and approves access for your app. Medblocks handles the secure authorization through SMART on FHIR behind the scenes and sends the patient back. Your server then reads the result before your UI shows them connected.
You can bring the patient through two ways.
| Approach | When to use | What happens |
|---|---|---|
| Medblocks-hosted page | You want Medblocks to host the page where the patient searches for and picks their facility. | The patient finds their facility, signs in to that facility’s patient portal to approve access, and returns to your app. |
| Your own UI | You want to build the facility search inside your own app. | The patient picks a facility in your UI, signs in to that facility’s patient portal to approve access, and returns to your app. |
You can use both in the same product.
What you’ll build
The build follows these pages in order. By the end you will have brought a patient from a button in your app to records flowing in.
- Find connections. Look up the hospital or clinic the patient uses.
- Create patients. Give each patient a stable
patient_id, or let the session create one. - Create a patient session. Start the session and get back the
urlwhere the patient approves access. - Handle the return. Read who came back on your
return_url. - After connection. React to the result and to events.
- Get the data. Pull the records into your systems.
Before you start
You need two things. Create an API key in your workspace, and install the SDK and create the client. The Quickstart covers both in a minute.
