Welcome to the RecordOp Quickstart, a full-stack Typescript application using a React client and Express server.
We demonstrate using the RecordOp API to fetch data from an Electronic Health Record using FHIR and presenting retrieved patient information in a React frontend. Our objective is to showcase the most straightforward and consistent means of fetching data and expanding details with FHIR and RecordOp.
We will use two RecordOp endpoints: POST /secureshare and POST /fhir/{query}.
Table of Contents
1. Clone the repository
git clone https://github.com/RecordOp/quickstart
cd quickstart2. Prerequisites
We assume you have installed npm and are running node >= v16.
We also assume you have a RecordOp account and an app registered with at least the following scopes: Patient, Practitioner, Organization.
3. Run the Quickstart
Running the Server
1. First install server dependencies.
2. Then, setup the server environment variables.
Copy the provided server/.env.sample file into server/.env and set the required environment variables:
PORT: Port to start the Express server onRECORDOP_API_ENDPOINT: The RecordOp API endpointRECORDOP_API_KEY: Your API key obtained from the RecordOp DashboardRECORDOP_APP_ID: Your app ID obtained from the RecordOp DashboardRECORDOP_CALLBACK_URL: The URL that the user will be redirected to after they grant data access through RecordOp SecureShare. RecordOp appends the SecureShare session id (sid) and patient FHIR id (pfid) to the callbackUrl as query parameters upon redirection to the callbackUrl from SecureShare.
The sample environment variables PORT, RECORDOP_API_ENDPOINT, and RECORDOP_CALLBACK_URL can be left as is to run the sample application.
3. Finally, start the server.
- Run
npm run build - Run
npm run startornpm run dev
The server will be accessible at http://localhost:{process.env.PORT}.
Running the Client
1. First install client dependencies.
2. Then, set the client environment variables.
Copy the provided client/.env.sample file into client/.env and ensure the required environment variables are set:
VITE_SERVER_URL: The URL of the Express server
The sample environment variable VITE_SERVER_URL can be left as is to run the sample application.
3. Finally, start the client.
- Run
npm run build - Run
npm run previewornpm run dev
The client will be accessible at http://localhost:5173
Sandbox Credentials
Use any of the sandbox patient credentials found in our docs to simulate patient EHR authorization.
Get support
If you find a bug, have questions, or want to suggest a change please contact us at support@recordop.com or create an issue.
