Skip to content

Commit

Permalink
Merge pull request #107 from mcode/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
smalho01 authored Aug 12, 2024
2 parents ebbf619 + 65f0710 commit da8081f
Show file tree
Hide file tree
Showing 8 changed files with 11,417 additions and 10,657 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ REACT_APP_ETASU_STATUS_ENABLED = true
REACT_APP_PHARMACY_STATUS_ENABLED = true
REACT_APP_REMS_ADMIN_SERVER_BASE = http://localhost:8090
REACT_APP_SEND_FHIR_AUTH_ENABLED = false
USE_INTERMEDIARY=true
INTERMEDIARY_SERVER_BASE=http://localhost:3003
54 changes: 28 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ The [REMS](https://www.fda.gov/drugs/drug-safety-and-availability/risk-evaluatio

# Getting Started with REMS SMART on FHIR

To get started, first clone the repository using a method that is most convenient for you. If using HTTPS, run the following command:
To get started, first clone the repository using a method that is most convenient for you. If using HTTPS, run the following command:

`git clone https://github.com/mcode/rems-smart-on-fhir.git`

The following technologies must be installed on your computer to continue:
* [NPM](https://www.npmjs.com/)
* [Node](https://nodejs.org/en)

- [NPM](https://www.npmjs.com/)
- [Node](https://nodejs.org/en)

## Initialization

Expand Down Expand Up @@ -49,25 +50,24 @@ Your app is ready to be deployed!

See the section about [building and deploying](https://vitejs.dev/guide/build) for more information.


## Usage

The REMS SMART on FHIR app interacts with the [REMS Admin](https://github.com/mcode/rems-admin), and an [EHR](https://github.com/mcode/test-ehr). These apps are provided as part of the REMS ecosystem, but any individual part may be swapped out for something custom. The EHR in particular can be easily switched by launching the SMART app from a different EHR. Launching the app can be easily done through the [Request Generator](https://github.com/mcode/request-generator), a front end app for EHRs that sends and receives CDS Hooks. The SMART app must be launched through an EHR or through the Request Generator.
The REMS SMART on FHIR app interacts with the [REMS Admin](https://github.com/mcode/rems-admin), and an [EHR](https://github.com/mcode/test-ehr). These apps are provided as part of the REMS ecosystem, but any individual part may be swapped out for something custom. The EHR in particular can be easily switched by launching the SMART app from a different EHR. Launching the app can be easily done through the [Request Generator](https://github.com/mcode/request-generator), a front end app for EHRs that sends and receives CDS Hooks. The SMART app must be launched through an EHR or through the Request Generator.

Typically, a CDS Hook will be sent from the EHR to the REMS Admin, which will respond with cards that contain information about next steps. These cards may contain a link to a SMART app. Clicking on these links will launch the SMART app automatically.
Typically, a CDS Hook will be sent from the EHR to the REMS Admin, which will respond with cards that contain information about next steps. These cards may contain a link to a SMART app. Clicking on these links will launch the SMART app automatically.

The SMART app can also be launched manually from the Request Generator for convenience by clicking a button.
The SMART app can also be launched manually from the Request Generator for convenience by clicking a button.

Once launched, the SMART app will open a Questionnaire form, prepopulate any answers it can using the patient's health record, and then allow the user to manually input answers to any remaining questions. Once all required fields are filled, the form can be submitted back to the REMS Admin for approval.
Once launched, the SMART app will open a Questionnaire form, prepopulate any answers it can using the patient's health record, and then allow the user to manually input answers to any remaining questions. Once all required fields are filled, the form can be submitted back to the REMS Admin for approval.

## Routes

The REMS SMART on FHIR app handles four routes:

* `launch` - The launch page, used to fulfill SMART on FHIR standard launch handshake. It contains no front-facing components.
* `index` - The index page is the second step of the SMART on FHIR standard launch handshake. It renders the main content.
* `register` - The register page allows the user to save client ids for launching the app. If using an EHR with a client id other than the default, or if trying to connect to multiple different EHRs, the register page can help manage client ids.
* `help` - The help page provides a glossary and a visual guide to using the app.
- `launch` - The launch page, used to fulfill SMART on FHIR standard launch handshake. It contains no front-facing components.
- `index` - The index page is the second step of the SMART on FHIR standard launch handshake. It renders the main content.
- `register` - The register page allows the user to save client ids for launching the app. If using an EHR with a client id other than the default, or if trying to connect to multiple different EHRs, the register page can help manage client ids.
- `help` - The help page provides a glossary and a visual guide to using the app.

Typically, users will click on a link which opens the `launch` page, which automatically kicks off the process of launching and opening the `index` page. Users must manually visit the `register` and `help` pages if needed.

Expand All @@ -78,17 +78,19 @@ a) `REACT_APP_LAUNCH_URL=http://example.com PORT=6000 npm start` or b) by specif

Following are a list of modifiable paths:

| URI Name | Default Value | Description |
| --------------------------------- | ------------------------------------------------------------------------------------- | ----------------------------------------------- |
| GENERATE_SOURCEMAP | `false` | Set to 'true' to generate a sourcemap. A sourcemap allows the browser to reference untranspiled code. This is useful for debugging and developing, but should not be used in production. |
| PORT | `4040` | Which port to run the app on. Generally, there shouldn't be a reason to change the port for normal development work unless there is a conflict with another app already using the port. |
| REACT_APP_CLIENT_SCOPES | `launch openid profile user/Patient.read patient/Patient.read user/Practitioner.read` | When logging into the EHR, the scopes listed will be included in the request for an access token. Only resources listed in the scope can be requested by the SMART app. Adding additional resources to the scope may result in being denied an access token. |
| REACT_APP_DEFAULT_CLIENT_ID | `app-login` | When logging into the EHR, the app will use the provided client id in the request for an authorization code. This variable should be changed if this app is registered under a different client name in the EHR. You can also use the `/register` page to manage client ids for multiple EHR's. |
| REACT_APP_DEFAULT_ISS | `http://localhost:8080/test-ehr/r4` | This is the base url of the EHR that the app will attempt to authenticate against when launched standalone. This URL is not used when the app is launched from an EHR. |
| REACT_APP_DEVELOPER_MODE | `true` | When set to 'true', enables developer functions like allowing forms to be submitted without actually filling out all required fields. |
| REACT_APP_ETASU_STATUS_ENABLED | `true` | When set to 'true', shows the ETASU status on the main page. This allows the user to see progress towards completion of the REMS requirements. |
| REACT_APP_PHARMACY_STATUS_ENABLED | `true` | When set to 'true', shows the pharmacy status on the main page. This allows the user to track progress towards dispensing the medication from the pharmacy. |
| REACT_APP_REMS_ADMIN_SERVER_BASE | `http://localhost:8090` | The base url of the REMS admin server, which handles the ETASU and questionnaires. Should be changed to match the base url of the REMS admin you wish to submit information to. |
| REACT_APP_SEND_FHIR_AUTH_ENABLED | `false` | When set to 'true', the app will send the access token for the EHR to the REMS admin as part of the CDS Hook. Should be changed to false only if this functionality is required for the REMS admin to work, and is a trusted party. |

**Note that .env values can only be accessed by the React app starting with `REACT_APP_`\**
| URI Name | Default Value | Description |
| --------------------------------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| GENERATE_SOURCEMAP | `false` | Set to 'true' to generate a sourcemap. A sourcemap allows the browser to reference untranspiled code. This is useful for debugging and developing, but should not be used in production. |
| PORT | `4040` | Which port to run the app on. Generally, there shouldn't be a reason to change the port for normal development work unless there is a conflict with another app already using the port. |
| REACT_APP_CLIENT_SCOPES | `launch openid profile user/Patient.read patient/Patient.read user/Practitioner.read` | When logging into the EHR, the scopes listed will be included in the request for an access token. Only resources listed in the scope can be requested by the SMART app. Adding additional resources to the scope may result in being denied an access token. |
| REACT_APP_DEFAULT_CLIENT_ID | `app-login` | When logging into the EHR, the app will use the provided client id in the request for an authorization code. This variable should be changed if this app is registered under a different client name in the EHR. You can also use the `/register` page to manage client ids for multiple EHR's. |
| REACT_APP_DEFAULT_ISS | `http://localhost:8080/test-ehr/r4` | This is the base url of the EHR that the app will attempt to authenticate against when launched standalone. This URL is not used when the app is launched from an EHR. |
| REACT_APP_DEVELOPER_MODE | `true` | When set to 'true', enables developer functions like allowing forms to be submitted without actually filling out all required fields. |
| REACT_APP_ETASU_STATUS_ENABLED | `true` | When set to 'true', shows the ETASU status on the main page. This allows the user to see progress towards completion of the REMS requirements. |
| REACT_APP_PHARMACY_STATUS_ENABLED | `true` | When set to 'true', shows the pharmacy status on the main page. This allows the user to track progress towards dispensing the medication from the pharmacy. |
| REACT_APP_REMS_ADMIN_SERVER_BASE | `http://localhost:8090` | The base url of the REMS admin server, which handles the ETASU and questionnaires. Should be changed to match the base url of the REMS admin you wish to submit information to. |
| INTERMEDIARY_SERVER_BASE | `http://localhost:3003` | This is the REMS intermediary url used to make ETASU checks and CDS hooks calls, which the former forwards to a REMS admin. |
| REACT_APP_SEND_FHIR_AUTH_ENABLED | `false` | When set to 'true', the app will send the access token for the EHR to the REMS admin as part of the CDS Hook. Should be changed to false only if this functionality is required for the REMS admin to work, and is a trusted party. |
| USE_INTERMEDIARY | `true` | When set to true, the app will use the REMS intermediary when making CDS hooks calls and checking the ETASU. |

\*\*Note that .env values can only be accessed by the React app starting with `REACT_APP_`\*\*
Loading

0 comments on commit da8081f

Please sign in to comment.