Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #103

Merged
merged 90 commits into from
Jul 1, 2024
Merged

Dev #103

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
0871157
Remove unused code
jtquach1 Apr 18, 2024
366c6d6
Add typing
jtquach1 Apr 18, 2024
1315d9b
Rename function and replace ternary with logical AND statement
jtquach1 Apr 18, 2024
6f5b5c1
Update patient view and medication request dropdown so text on smalle…
jtquach1 Apr 18, 2024
7d3a1d1
Prettier
jtquach1 Apr 18, 2024
fd1c0f4
Replace nested divs
jtquach1 Apr 18, 2024
75ef5e6
Remove unused types and REMS admin response since Document Status pag…
jtquach1 Apr 18, 2024
8e53c2c
Replace pre tag with preserved whitespace + wrapped text, switch pre-…
jtquach1 Apr 18, 2024
39c2517
Remove nested divs
jtquach1 Apr 18, 2024
aca63e5
Prettier
jtquach1 Apr 18, 2024
82e6389
Prettier
jtquach1 Apr 18, 2024
b5c55df
Remove unused variable only found in console log
jtquach1 Apr 19, 2024
7d8a550
Add missing dependency array
jtquach1 Apr 19, 2024
c70815e
Remove padding in tab panel only on xs screens
jtquach1 Apr 19, 2024
37bf687
Replace hardcoded path to REMS admin with env var
jtquach1 Apr 22, 2024
00f21bd
Rewrite processSavedQuestionnaireResponses so it doesn't append anoth…
jtquach1 Apr 22, 2024
f53f7de
Add whitespace
jtquach1 Apr 22, 2024
65a0614
WIP revamp useState to useReducer
jtquach1 Apr 23, 2024
009bebc
Remove unused imports
jtquach1 Apr 30, 2024
7ff855a
Fix bug where loading previous form for a 2nd time doesn't actually l…
jtquach1 Apr 30, 2024
922a75e
Remove unused imports
jtquach1 Apr 30, 2024
1b19b96
Rename variable and enum
jtquach1 Apr 30, 2024
44db8e3
Fix failing test
jtquach1 May 1, 2024
0b1b6f1
Merge remote-tracking branch 'origin/dev' into liquid-layout
jtquach1 May 20, 2024
b5893f1
Fix each child should have a unique key prop warning
jtquach1 May 20, 2024
eb5e048
Fix bug with modified loaded form being saved to EHR and then being r…
jtquach1 May 20, 2024
85ff34f
Rename variable
jtquach1 May 20, 2024
0092ff9
Add REMS Admin lookup table and handle multiple REMS admins with pati…
jtquach1 May 20, 2024
0ed34cf
Remove unused env var
jtquach1 May 20, 2024
ef3cfe9
Merge pull request #89 from mcode/liquid-layout
jtquach1 May 21, 2024
926808f
Merge remote-tracking branch 'origin/dev' into rems-admin-lookup-table
jtquach1 May 21, 2024
3155775
Remove duplicate CDS Hooks REMS Admin endpoints
jtquach1 May 21, 2024
feaad51
Intiial color contrast updates
May 22, 2024
f7d6ef1
Merge pull request #95 from mcode/rems-admin-lookup-table
plarocque4 May 23, 2024
6228c46
Migrate from react-app-rewired to vite and add vitest
jtquach1 May 22, 2024
8fb9cf3
Get existing Jest tests to work with vitest
jtquach1 May 22, 2024
d178b94
Update package-lock.json
jtquach1 May 23, 2024
b7f87fd
Capitalize React component names
jtquach1 May 23, 2024
6d0e921
Add back homepage setting
jtquach1 May 23, 2024
2d9ce7b
Revert back to Box instead of Stack
jtquach1 May 23, 2024
4bb7b27
Update package-lock.json
jtquach1 May 23, 2024
8d997a4
Rename files for real
jtquach1 May 23, 2024
2bfd05b
Fix git filename case on whole repo
jtquach1 May 23, 2024
3bd0f57
Revert lint script
jtquach1 May 23, 2024
cbf4cd5
Fix lint issues
jtquach1 May 23, 2024
1bff295
Update GitHub workflow Node version
jtquach1 May 23, 2024
41e5382
Fix linting issues
jtquach1 May 23, 2024
a116e05
Add flatten package in order to refactor types in submodule function …
jtquach1 May 23, 2024
5a893f5
Fix linting issues
jtquach1 May 23, 2024
97b551b
Fix linting issues
jtquach1 May 23, 2024
7e7267b
Make port configurable from .env
jtquach1 May 28, 2024
b2fffc9
Fix linting issues
jtquach1 May 28, 2024
9290ecc
Fix linting issues
jtquach1 May 28, 2024
982e6c5
Try to type cql-execution's Results.patientResults
jtquach1 May 28, 2024
e0cfa5d
Fix linting issues
jtquach1 May 28, 2024
aae1c35
Remove unused imports
jtquach1 May 28, 2024
799f091
Fix linting issues by trying to type LForms
jtquach1 May 29, 2024
3d8cdb7
Prettier
jtquach1 May 29, 2024
9a109a1
Rename type
jtquach1 May 29, 2024
17585e5
Update color of form title
May 29, 2024
cd7aa2f
Prettier update
May 29, 2024
5c5f66d
add help page
KeeyanGhoreshi May 30, 2024
c88298f
updated readme
KeeyanGhoreshi Jun 6, 2024
0bb351d
Point to rems-cds-hooks use-vite branch rebased off origin/main
jtquach1 Jun 6, 2024
6b7f4a4
Point to origin/main of rems-cds-hooks
jtquach1 Jun 6, 2024
3c29e8e
Merge pull request #96 from mcode/use-vite
jtquach1 Jun 6, 2024
74f36c6
Merge branch 'dev' into 655-contrast-compliance
Jun 7, 2024
eef0e54
Updates to be compatible with vite
Jun 7, 2024
71c5504
Update etasu to work with medication reference
Jun 12, 2024
0961fe2
Fix lint errors
Jun 12, 2024
bba15e8
Update prettier
Jun 12, 2024
de26f86
Merge pull request #100 from mcode/689-etasu-call
plarocque4 Jun 13, 2024
ef02e77
Apply suggestions from code review
KeeyanGhoreshi Jun 13, 2024
7acf658
Merge pull request #97 from mcode/655-contrast-compliance
plarocque4 Jun 14, 2024
6b7480d
remove unused code
KeeyanGhoreshi Jun 18, 2024
1ab006a
Bump ws
dependabot[bot] Jun 18, 2024
268023e
remove helpprops
KeeyanGhoreshi Jun 19, 2024
d3e663d
lint
KeeyanGhoreshi Jun 19, 2024
fe8e502
Bump braces from 3.0.2 to 3.0.3
dependabot[bot] Jun 21, 2024
e7ede36
minor change
KeeyanGhoreshi Jun 26, 2024
eec5b7e
Update README.md
jtquach1 Jun 26, 2024
e9004be
Merge pull request #99 from mcode/update_readme
plarocque4 Jun 26, 2024
14c53c1
Merge pull request #98 from mcode/add-help-page
avirgulto Jun 27, 2024
84d9e0c
Merge branch 'dev' into dependabot/npm_and_yarn/multi-3fea103ff2
smalho01 Jun 27, 2024
ad7919e
fixed package-lock conflict
smalho01 Jun 27, 2024
83725df
update ws
smalho01 Jun 27, 2024
7f26aa0
Merge pull request #101 from mcode/dependabot/npm_and_yarn/multi-3fea…
smalho01 Jun 27, 2024
07cf4b8
Merge branch 'dev' into dependabot/npm_and_yarn/braces-3.0.3
smalho01 Jun 27, 2024
4c5601a
update package-lock
smalho01 Jun 27, 2024
484ac3b
Merge pull request #102 from mcode/dependabot/npm_and_yarn/braces-3.0.3
smalho01 Jun 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
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_REMS_HOOKS_PATH = /cds-services/rems-
REACT_APP_SEND_FHIR_AUTH_ENABLED = false
17 changes: 0 additions & 17 deletions .eslintrc

This file was deleted.

15 changes: 15 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended'
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }]
}
};
2 changes: 1 addition & 1 deletion .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
node-version: '21.x'
- run: git submodule update --init
- run: npm install
- run: npm run lint
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"printWidth": 100,
"tabWidth": 2,
"singleQuote": true
}
}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:14-alpine
FROM node:21-alpine
WORKDIR /home/node/app/rems-smart-on-fhir
COPY --chown=node:node . .
RUN npm install
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:14-alpine
FROM node:21-alpine
WORKDIR /home/node/app/rems-smart-on-fhir
COPY --chown=node:node . .
RUN npm install
Expand Down
89 changes: 60 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 HTTPS, run the following command:

This application must be launched by an EHR or SMART sandbox imitating an EHR.
`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)

## 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:
Expand All @@ -22,31 +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_REMS_HOOKS_PATH | `/cds-services/rems-` |
| 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.\
Expand All @@ -60,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), 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.

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_`\**
19 changes: 0 additions & 19 deletions build.js

This file was deleted.

10 changes: 0 additions & 10 deletions config-overrides.js

This file was deleted.

35 changes: 35 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="manifest" href="/manifest.json" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<link
href="https://clinicaltables.nlm.nih.gov/lforms-versions/29.0.3/styles/lforms.min.css"
media="screen"
rel="stylesheet"
/>
<script src="https://kit.fontawesome.com/a076d05399.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui/dist/semantic.min.css" />
</head>
<body>
<div id="root"></div>

<!-- Vite needs this entrypoint to render the entire app -->
<script type="module" src="/src/index.tsx"></script>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
crossorigin="anonymous"
></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/stomp.js/2.3.3/stomp.min.js"></script>
<script src="https://clinicaltables.nlm.nih.gov/lforms-versions/29.3.1/lforms.min.js"></script>
<script src="https://clinicaltables.nlm.nih.gov/lforms-versions/29.3.1/fhir/lformsFHIRAll.min.js"></script>
</body>
</html>
Loading
Loading