Skip to content
Merged

Dev #119

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
1d13d52
Rework request box and patient box as components instead of classes
Feb 28, 2024
571e995
Remove unused components
Mar 5, 2024
cebc776
Update request builder
Mar 5, 2024
e4ada30
Remove commented out code
Mar 7, 2024
1d8de32
Remove unused code and fix bug on settings page patientFhirQuery
Mar 8, 2024
0987bd3
Remove unused code
Mar 8, 2024
89c1734
Merge pull request #108 from mcode/540-functional-components
avirgulto Mar 13, 2024
7425741
add launch (#107)
KeeyanGhoreshi Mar 18, 2024
bd33f2a
Remove extra api calls (#110)
avirgulto Mar 19, 2024
858a2ea
Refactor to use enum-like consts for sidebar sections, remove finishe…
jtquach1 Mar 15, 2024
9bb94d7
Remove unused code
jtquach1 Mar 15, 2024
dafbbe6
WIP add Medications section and elements
jtquach1 Mar 19, 2024
7b13962
Supply correct argument to MedicationElement and GET MedicationReques…
jtquach1 Mar 19, 2024
ee6bb0b
Merge pull request #111 from mcode/patient-portal-medication-status
avirgulto Mar 21, 2024
35bbb1d
Add vite (#109)
KeeyanGhoreshi Mar 27, 2024
2ed68c8
Remove duplicate refresh (#115)
avirgulto Apr 1, 2024
975f128
Add in etasu status to request generator
Mar 26, 2024
f4550bc
Clean up duplicate env variables
Mar 26, 2024
b69f5a3
add launch
KeeyanGhoreshi Mar 1, 2024
c72f90b
consolidate code
KeeyanGhoreshi Mar 7, 2024
e39d1b9
initial changes
KeeyanGhoreshi Mar 14, 2024
359e3d5
fix errors
KeeyanGhoreshi Mar 14, 2024
6760a29
update env
KeeyanGhoreshi Mar 14, 2024
438ef5d
make docker work
KeeyanGhoreshi Mar 20, 2024
f0f4be7
make etasu component modular and add to patient portal
KeeyanGhoreshi Mar 27, 2024
a5ea116
Remove /auth in patient portal login
Apr 3, 2024
492d1b0
Merge pull request #113 from mcode/etasu-status-patient-portal
avirgulto Apr 3, 2024
334399c
Ignore .DS_Store files
jtquach1 Mar 27, 2024
dbc71c3
Fix typo in sx prop
jtquach1 Mar 28, 2024
17e8370
Update package-lock.json
jtquach1 Mar 28, 2024
791e200
Create table in SettingsSection and store initial state for all REMS …
jtquach1 Mar 28, 2024
f80e2cf
Remove gray background for QuestionnaireResponse table entirely
jtquach1 Mar 28, 2024
bbed0b7
Fire order-sign hook only on REMS drugs, remove env vars, and fix typ…
jtquach1 Mar 28, 2024
eef1a27
WIP SettingsSection add delete/add buttons, change table cell widths,…
jtquach1 Apr 1, 2024
ec4c561
Fix adding/deleting/reset settings functionality
jtquach1 Apr 1, 2024
7521aac
Allow adding of new row directly under a given row
jtquach1 Apr 1, 2024
20daaf1
Add back deleted comment
jtquach1 Apr 1, 2024
26a4ec4
Make REMS admin reset field use full path instead of the URL origin
jtquach1 Apr 2, 2024
4df8769
Make table scrollable and have sticky header, add tooltips over add/d…
jtquach1 Apr 2, 2024
cfb5885
Fix export line
jtquach1 Apr 3, 2024
06bdf2e
Merge pull request #114 from mcode/rems_admins_lookup_table
jtquach1 Apr 3, 2024
62230dc
Rework etasu endpoint to call new standards based endpoint (#116)
avirgulto Apr 5, 2024
b54fff9
Update to send rxnorm code
Apr 8, 2024
1460f26
Merge pull request #117 from mcode/667-etasu-pims-update
avirgulto Apr 8, 2024
598a44b
Fix typos and remove unused imports while updating VS Code Workspace …
jtquach1 Apr 2, 2024
ca5ec39
Merge pull request #118 from mcode/fix_typos_found_during_rems_526
smalho01 Apr 8, 2024
0e34aef
Merge branch 'main' into dev
smalho01 Apr 8, 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
53 changes: 25 additions & 28 deletions .env
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
HTTPS = false
HTTPS_CERT_PATH = server.cert
HTTPS_KEY_PATH = server.key
REACT_APP_ALT_DRUG = true
REACT_APP_AUTH = http://localhost:8180
REACT_APP_CDS_SERVICE = http://localhost:8090/cds-services
REACT_APP_CLIENT = app-login
REACT_APP_CLIENT_SCOPES = launch offline_access openid profile user/Patient.read patient/Patient.read user/Practitioner.read
REACT_APP_DEFAULT_USER = pra1234
REACT_APP_EHR_BASE = http://localhost:8080/test-ehr/r4
REACT_APP_EHR_LINK = http://localhost:8080/ehr-server/
REACT_APP_EHR_SERVER = http://localhost:8080/test-ehr/r4
REACT_APP_EHR_SERVER_TO_BE_SENT_TO_REMS_ADMIN_FOR_PREFETCH = http://localhost:8080/test-ehr/r4
REACT_APP_GENERATE_JWT = true
REACT_APP_GH_PAGES=false
REACT_APP_HOMEPAGE = http://localhost:8080
REACT_APP_LAUNCH_URL = http://localhost:4040/launch
REACT_APP_ORDER_SELECT = rems-order-select
REACT_APP_ORDER_SIGN = rems-order-sign
REACT_APP_PASSWORD = alice
REACT_APP_PATIENT_FHIR_QUERY = Patient?_sort=identifier&_count=12
REACT_APP_PATIENT_VIEW = rems-patient-view
REACT_APP_PIMS_SERVER = http://localhost:5051/doctorOrders/api/addRx
REACT_APP_PUBLIC_KEYS = http://localhost:3000/request-generator/.well-known/jwks.json
REACT_APP_REALM = ClientFhirServer
REACT_APP_RESPONSE_EXPIRATION_DAYS = 30
REACT_APP_SERVER = http://localhost:8090
REACT_APP_SMART_LAUNCH_URL = http://localhost:4040/
REACT_APP_URL = http://localhost:3000
REACT_APP_URL_FILTER = http://localhost:3000/*
REACT_APP_USER = alice
VITE_ALT_DRUG = true
VITE_AUTH = http://localhost:8180
VITE_CDS_SERVICE = http://localhost:8090/etasu/reset
VITE_CLIENT = app-login
VITE_CLIENT_SCOPES = launch offline_access openid profile user/Patient.read patient/Patient.read user/Practitioner.read
VITE_DEFAULT_USER = pra1234
VITE_EHR_BASE = http://localhost:8080/test-ehr/r4
VITE_EHR_LINK = http://localhost:8080/ehr-server/
VITE_EHR_SERVER = http://localhost:8080/test-ehr/r4
VITE_EHR_SERVER_TO_BE_SENT_TO_REMS_ADMIN_FOR_PREFETCH = http://localhost:8080/test-ehr/r4
VITE_GENERATE_JWT = true
VITE_GH_PAGES=false
VITE_HOMEPAGE = http://localhost:8080
VITE_LAUNCH_URL = http://localhost:4040/launch
VITE_PASSWORD = alice
VITE_PATIENT_FHIR_QUERY = Patient?_sort=identifier&_count=12
VITE_PIMS_SERVER = http://localhost:5051/doctorOrders/api/addRx
VITE_PUBLIC_KEYS = http://localhost:3000/request-generator/.well-known/jwks.json
VITE_REALM = ClientFhirServer
VITE_RESPONSE_EXPIRATION_DAYS = 30
VITE_SERVER = http://localhost:8090
VITE_SMART_LAUNCH_URL = http://localhost:4040/
VITE_URL = http://localhost:3000
VITE_URL_FILTER = http://localhost:3000/*
VITE_USER = alice
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@ src/db.json

# Environment variable files
.env.local

# Mac OS files
**/.DS_Store
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM node:14-alpine
FROM node:21-alpine

WORKDIR /home/node/app/request-generator
COPY --chown=node:node . .
RUN npm install
COPY --chown=node:node . .
EXPOSE 3000
COPY --chown=node:node . .

CMD npm run start
3 changes: 1 addition & 2 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM node:14-alpine
FROM node:21-alpine
WORKDIR /home/node/app/request-generator
COPY --chown=node:node . .
RUN npm install
EXPOSE 3000
EXPOSE 3001
CMD ./dockerRunnerDev.sh
20 changes: 10 additions & 10 deletions How-To-Launch-SMART-on-FHIR-Apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,31 @@ SMART_ENDPOINT = https://smartlauncher.interop.community/sample-app/launch?clien
Set these environment variables in your `.env.local` to overwrite the default values in the `.env`. You must be added to the REMS sandbox on Meld to log in and authenticate when running request-generator locally.

```.env
REACT_APP_CLIENT = ed8b940e-4aaa-4209-b17d-69dfe67543b9
REACT_APP_EHR_BASE = https://gw.interop.community/REMS/data
REACT_APP_EHR_SERVER_TO_BE_SENT_TO_REMS_ADMIN_FOR_PREFETCH = https://gw.interop.community/REMS/data
REACT_APP_EHR_SERVER = https://gw.interop.community/REMS/data
REACT_APP_SMART_LAUNCH_URL = https://smartlauncher.interop.community/sample-app/launch?client_id=sampleapp&platform=meld
VITE_CLIENT = ed8b940e-4aaa-4209-b17d-69dfe67543b9
VITE_EHR_BASE = https://gw.interop.community/REMS/data
VITE_EHR_SERVER_TO_BE_SENT_TO_REMS_ADMIN_FOR_PREFETCH = https://gw.interop.community/REMS/data
VITE_EHR_SERVER = https://gw.interop.community/REMS/data
VITE_SMART_LAUNCH_URL = https://smartlauncher.interop.community/sample-app/launch?client_id=sampleapp&platform=meld
```

### Where to grab the environment variable values if using a Meld Sandbox

1. `REACT_APP_CLIENT`: This is taken from Apps > Request Generator > Settings > Registered App Details > Client Id. Request Generator refers to the registered mcode/request-generator app in your Meld sandbox.
2. `REACT_APP_EHR_BASE`, `REACT_APP_EHR_SERVER_TO_BE_SENT_TO_REMS_ADMIN_FOR_PREFETCH`, `REACT_APP_EHR_SERVER`: These are taken from your Meld sandbox's sidebar, under Settings > Sandbox > Secured FHIR Server URL.
3. `REACT_APP_SMART_LAUNCH_URL`, `SMART_ENDPOINT`: This is taken from Apps > Sample App > Settings > Registered App Details > App Launch URI\*.
1. `VITE_CLIENT`: This is taken from Apps > Request Generator > Settings > Registered App Details > Client Id. Request Generator refers to the registered mcode/request-generator app in your Meld sandbox.
2. `VITE_EHR_BASE`, `VITE_EHR_SERVER_TO_BE_SENT_TO_REMS_ADMIN_FOR_PREFETCH`, `VITE_EHR_SERVER`: These are taken from your Meld sandbox's sidebar, under Settings > Sandbox > Secured FHIR Server URL.
3. `VITE_SMART_LAUNCH_URL`, `SMART_ENDPOINT`: This is taken from Apps > Sample App > Settings > Registered App Details > App Launch URI\*.

## How to run

1. Start request-generator normally and go to `http://localhost:3000/`. Click the "Authorize" button.
2. Start rems-admin normally.
3. In request-generator, click the "Select a Patient" button.
4. Select Jon Snow (id: 130803).
5. Click the "Launch SMART on FHIR app" button. This opens the SMART on FHIR app launch page provided as values to the `REACT_APP_SMART_LAUNCH_URL` and `SMART_ENDPOINT` environment variables.
5. Click the "Launch SMART on FHIR app" button. This opens the SMART on FHIR app launch page provided as values to the `VITE_SMART_LAUNCH_URL` and `SMART_ENDPOINT` environment variables.
6. Click the "Authorize" button.
7. You should see the expected SMART on FHIR app launch properly.
8. Go back to request-generator and issue an order-sign hook, and click on the "Patient Enrollment Form" button.
9. You should see the expected SMART on FHIR app launch.

## Running other Registered SMART on FHIR Apps from Meld

Log in to Meld at https://meld.interop.community/. Go to My Sandboxes > REMS > Apps to try out the other Registered Apps. The example above manually tests (1). You can try the remaining options after (2) just by changing the `REACT_APP_SMART_LAUNCH_URL` and `SMART_ENDPOINT` environment variables.
Log in to Meld at https://meld.interop.community/. Go to My Sandboxes > REMS > Apps to try out the other Registered Apps. The example above manually tests (1). You can try the remaining options after (2) just by changing the `VITE_SMART_LAUNCH_URL` and `SMART_ENDPOINT` environment variables.
67 changes: 37 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ This project provides a small web application that is capable of generating requ

- `npm start`

This should open a browser window directed to the value set in `REACT_APP_URL` followed by the string `/request-generator`. The request-generator assumes the REMS Admin is running on the default value set for `REACT_APP_SERVER`. This can be changed in the properties file [.env](./.env). [The following section](./README.md#how-to-override-defaults) lists the default values for these environment variables.
This should open a browser window directed to the value set in `VITE_URL` followed by the string `/request-generator`. The request-generator assumes the REMS Admin is running on the default value set for `VITE_SERVER`. This can be changed in the properties file [.env](./.env). [The following section](./README.md#how-to-override-defaults) lists the default values for these environment variables.

## Running with docker

Run the following commands

- `docker build -t reqgen .`
- `docker run -p 3000:3000 reqgen`

## Keys

Expand All @@ -31,7 +38,7 @@ Embedded in the application are the public and private keys used to generate and
### 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`.
a) `VITE_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:

Expand All @@ -40,34 +47,34 @@ Following are a list of modifiable paths:
| HTTPS | `false` |
| HTTPS_CERT_PATH | `server.cert` |
| HTTPS_KEY_PATH | `server.key` |
| REACT_APP_ALT_DRUG | `true` |
| REACT_APP_AUTH | `http://localhost:8180` |
| REACT_APP_CDS_SERVICE | `http://localhost:8090/cds-services` |
| REACT_APP_CLIENT | `app-login` |
| REACT_APP_CLIENT_SCOPES | `launch offline_access openid profile user/Patient.read patient/Patient.read user/Practitioner.read` |
| REACT_APP_DEFAULT_USER | `pra1234` |
| REACT_APP_EHR_BASE | `http://localhost:8080/test-ehr/r4` |
| REACT_APP_EHR_LINK | `http://localhost:8080/ehr-server/` |
| REACT_APP_EHR_SERVER | `http://localhost:8080/test-ehr/r4` |
| REACT_APP_EHR_SERVER_TO_BE_SENT_TO_REMS_ADMIN_FOR_PREFETCH | `http://localhost:8080/test-ehr/r4` |
| REACT_APP_GENERATE_JWT | `true` |
| REACT_APP_GH_PAGES | `false` |
| REACT_APP_HOMEPAGE | `http://localhost:8080` |
| REACT_APP_LAUNCH_URL | `http://localhost:4040/launch` |
| REACT_APP_ORDER_SELECT | `rems-order-select` |
| REACT_APP_ORDER_SIGN | `rems-order-sign` |
| REACT_APP_PASSWORD | `alice` |
| REACT_APP_PATIENT_FHIR_QUERY | `Patient?_sort=identifier&_count=12` |
| REACT_APP_PATIENT_VIEW | `rems-patient-view` |
| REACT_APP_PIMS_SERVER | `http://localhost:5051/doctorOrders/api/addRx` |
| REACT_APP_PUBLIC_KEYS | `http://localhost:3000/request-generator/.well-known/jwks.json` |
| REACT_APP_REALM | `ClientFhirServer` |
| REACT_APP_RESPONSE_EXPIRATION_DAYS | `30` |
| REACT_APP_SERVER | `http://localhost:8090` |
| REACT_APP_SMART_LAUNCH_URL | `http://localhost:4040/` |
| REACT_APP_URL | `http://localhost:3000` |
| REACT_APP_URL_FILTER | `http://localhost:3000/*` |
| REACT_APP_USER | `alice` |
| VITE_ALT_DRUG | `true` |
| VITE_AUTH | `http://localhost:8180` |
| VITE_CDS_SERVICE | `http://localhost:8090/cds-services` |
| VITE_CLIENT | `app-login` |
| VITE_CLIENT_SCOPES | `launch offline_access openid profile user/Patient.read patient/Patient.read user/Practitioner.read` |
| VITE_DEFAULT_USER | `pra1234` |
| VITE_EHR_BASE | `http://localhost:8080/test-ehr/r4` |
| VITE_EHR_LINK | `http://localhost:8080/ehr-server/` |
| VITE_EHR_SERVER | `http://localhost:8080/test-ehr/r4` |
| VITE_EHR_SERVER_TO_BE_SENT_TO_REMS_ADMIN_FOR_PREFETCH | `http://localhost:8080/test-ehr/r4` |
| VITE_GENERATE_JWT | `true` |
| VITE_GH_PAGES | `false` |
| VITE_HOMEPAGE | `http://localhost:8080` |
| VITE_LAUNCH_URL | `http://localhost:4040/launch` |
| VITE_ORDER_SELECT | `rems-order-select` |
| VITE_ORDER_SIGN | `rems-order-sign` |
| VITE_PASSWORD | `alice` |
| VITE_PATIENT_FHIR_QUERY | `Patient?_sort=identifier&_count=12` |
| VITE_PATIENT_VIEW | `rems-patient-view` |
| VITE_PIMS_SERVER | `http://localhost:5051/doctorOrders/api/addRx` |
| VITE_PUBLIC_KEYS | `http://localhost:3000/request-generator/.well-known/jwks.json` |
| VITE_REALM | `ClientFhirServer` |
| VITE_RESPONSE_EXPIRATION_DAYS | `30` |
| VITE_SERVER | `http://localhost:8090` |
| VITE_SMART_LAUNCH_URL | `http://localhost:4040/` |
| VITE_URL | `http://localhost:3000` |
| VITE_URL_FILTER | `http://localhost:3000/*` |
| VITE_USER | `alice` |

## How to launch as a SMART on FHIR app

Expand Down
7 changes: 4 additions & 3 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<link rel="manifest" href="manifest.json">
<link rel="shortcut icon" href="favicon.ico">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

Expand All @@ -35,14 +35,15 @@
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

You can add webfonts, meta tags, or analytics to this file.
You can add web fonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
<script src="https://cdn.jsdelivr.net/npm/fhirclient/build/fhir-client.js">
</script>
<script type="module" src="/src/index.jsx"></script>
</body>


Expand Down
Loading