From c88298fc4a3be278d655f9b71d61dc0c013f6862 Mon Sep 17 00:00:00 2001 From: KeeyanGhoreshi Date: Thu, 6 Jun 2024 01:55:51 -0400 Subject: [PATCH 1/4] updated readme --- .env | 2 -- README.md | 88 +++++++++++++++++++++++++++++++++++++------------------ 2 files changed, 60 insertions(+), 30 deletions(-) diff --git a/.env b/.env index c82c190..59229a8 100644 --- a/.env +++ b/.env @@ -1,4 +1,3 @@ -BROWSER=none GENERATE_SOURCEMAP=false PORT=4040 REACT_APP_CLIENT_SCOPES = launch openid profile user/Patient.read patient/Patient.read user/Practitioner.read @@ -6,7 +5,6 @@ REACT_APP_DEFAULT_CLIENT_ID = app-login REACT_APP_DEFAULT_ISS = http://localhost:8080/test-ehr/r4 REACT_APP_DEVELOPER_MODE = true REACT_APP_ETASU_STATUS_ENABLED = true -REACT_APP_PHARMACY_SERVER_BASE = http://localhost:5051 REACT_APP_PHARMACY_STATUS_ENABLED = true REACT_APP_REMS_ADMIN_SERVER_BASE = http://localhost:8090 REACT_APP_SEND_FHIR_AUTH_ENABLED = false diff --git a/README.md b/README.md index 2227498..b0ce31a 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,27 @@ +# Description + +The [REMS](https://www.fda.gov/drugs/drug-safety-and-availability/risk-evaluation-and-mitigation-strategies-rems) [SMART on FHIR](https://docs.smarthealthit.org/) application is a multipurpose app that handles sending [CDS Hooks](https://cds-hooks.org/), filling out Questionnaire forms, and submitting REMS bundles for approval. This app fulfills the data gathering and submission portion of the REMS authorization workflow, allowing users to find and fill out forms required for prescribing and dispensing REMS medications. It adheres to the [DaVinci DTR Implementation Guide](https://build.fhir.org/ig/HL7/davinci-dtr/) standards for discovering, gathering, prepopulating, and opening forms. + # Getting Started with REMS SMART on FHIR -The REMS SMART on FHIR application can be launched from an EHR that does not support CDS Hooks. The application will interact with the REMS Administrator using CDS Hooks on behalf of the EHR, allowing the provider to complete the normal REMS workflow. +To get started, first clone the repository using a method that is most convenient for you. If using git, run the following command: + +`git clone https://github.com/mcode/rems-smart-on-fhir.git` -This application must be launched by an EHR or SMART sandbox imitating an EHR. +The following technologies must be installed on your computer to continue: +* [NPM](https://www.npmjs.com/) +* [Node](https://nodejs.org/en) ## Initialization -After cloning the repository, the submodules must be initialized. To do this you can run: +After cloning the repository, the submodules must be initialized. Run the following command: ### `git submodule update --init` +Next, install the required dependencies by running the following: + +### `npm install` + ## Available Scripts In the project directory, you can run: @@ -22,30 +34,6 @@ Open [http://localhost:4040](http://localhost:4040) to view it in the browser. The page will reload if you make edits.\ You will also see any lint errors in the console. -### How To Override Defaults - -The .env file contains the default URI paths, which can be overwritten from the start command as follows: -a) `REACT_APP_LAUNCH_URL=http://example.com PORT=6000 npm start` or b) by specifying the environment variables and desired values in a `.env.local`. - -Following are a list of modifiable paths: - -| URI Name | Default | -| --------------------------------- | ------------------------------------------------------------------------------------- | -| BROWSER | `none` | -| GENERATE_SOURCEMAP | `false` | -| PORT | `4040` | -| REACT_APP_CLIENT_SCOPES | `launch openid profile user/Patient.read patient/Patient.read user/Practitioner.read` | -| REACT_APP_DEFAULT_CLIENT_ID | `app-login` | -| REACT_APP_DEFAULT_ISS | `http://localhost:8080/test-ehr/r4` | -| REACT_APP_DEVELOPER_MODE | `true` | -| REACT_APP_ETASU_STATUS_ENABLED | `true` | -| REACT_APP_PHARMACY_SERVER_BASE | `http://localhost:5051` | -| REACT_APP_PHARMACY_STATUS_ENABLED | `true` | -| REACT_APP_REMS_ADMIN_SERVER_BASE | `http://localhost:8090` | -| REACT_APP_SEND_FHIR_AUTH_ENABLED | `false` | - -_Note that .env values can only be accessed by the React app starting with `REACT_APP_`\_ - ### `npm test` Launches the test runner in the interactive watch mode.\ @@ -59,4 +47,48 @@ It correctly bundles React in production mode and optimizes the build for the be The build is minified and the filenames include the hashes.\ Your app is ready to be deployed! -See the section about [deployment](https://create-react-app.dev/docs/deployment/) for more information. +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), an [EHR](https://github.com/mcode/test-ehr), and the [Pharmacy Information Management System](https://github.com/mcode/pims). 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 recieves 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. + +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. + +## 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. + +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. + +## Environment Variables + +The .env file contains the default URI paths, which can be overwritten from the start command as follows: +a) `REACT_APP_LAUNCH_URL=http://example.com PORT=6000 npm start` or b) by specifying the environment variables and desired values in a `.env.local`. + +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_`\_ From ef02e772357d1e5b85c919be166a9e418870930e Mon Sep 17 00:00:00 2001 From: Keeyan Date: Thu, 13 Jun 2024 14:02:47 -0400 Subject: [PATCH 2/4] Apply suggestions from code review Co-authored-by: Joyce Quach <33106214+jtquach1@users.noreply.github.com> --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b0ce31a..3182c1d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ 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 git, 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` @@ -52,7 +52,7 @@ See the section about [building and deploying](https://vitejs.dev/guide/build) f ## Usage -The REMS SMART on FHIR app interacts with the [REMS Admin](https://github.com/mcode/rems-admin), an [EHR](https://github.com/mcode/test-ehr), and the [Pharmacy Information Management System](https://github.com/mcode/pims). 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 recieves 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), an [EHR](https://github.com/mcode/test-ehr), and the [Pharmacy Information Management System](https://github.com/mcode/pims). 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. @@ -91,4 +91,4 @@ Following are a list of modifiable paths: | 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_`\_ +**Note that .env values can only be accessed by the React app starting with `REACT_APP_`\** From e7ede36faca86df0e1adb480272ca88c1f4fba5a Mon Sep 17 00:00:00 2001 From: KeeyanGhoreshi Date: Wed, 26 Jun 2024 12:09:12 -0400 Subject: [PATCH 3/4] minor change --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3182c1d..396c72c 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ See the section about [building and deploying](https://vitejs.dev/guide/build) f ## Usage -The REMS SMART on FHIR app interacts with the [REMS Admin](https://github.com/mcode/rems-admin), an [EHR](https://github.com/mcode/test-ehr), and the [Pharmacy Information Management System](https://github.com/mcode/pims). 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 recieves 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. From eec5b7e307fe520b4bfecf6e24a958a036bd0f85 Mon Sep 17 00:00:00 2001 From: Joyce Quach <33106214+jtquach1@users.noreply.github.com> Date: Wed, 26 Jun 2024 12:36:35 -0400 Subject: [PATCH 4/4] Update README.md Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 396c72c..4ebe521 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ See the section about [building and deploying](https://vitejs.dev/guide/build) f ## 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 recieves 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.