Skip to content

Commit f3c4e5f

Browse files
authored
Merge pull request #119 from mcode/dev
Dev
2 parents 4e95146 + 0e34aef commit f3c4e5f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+21691
-17650
lines changed

.env

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
11
HTTPS = false
22
HTTPS_CERT_PATH = server.cert
33
HTTPS_KEY_PATH = server.key
4-
REACT_APP_ALT_DRUG = true
5-
REACT_APP_AUTH = http://localhost:8180
6-
REACT_APP_CDS_SERVICE = http://localhost:8090/cds-services
7-
REACT_APP_CLIENT = app-login
8-
REACT_APP_CLIENT_SCOPES = launch offline_access openid profile user/Patient.read patient/Patient.read user/Practitioner.read
9-
REACT_APP_DEFAULT_USER = pra1234
10-
REACT_APP_EHR_BASE = http://localhost:8080/test-ehr/r4
11-
REACT_APP_EHR_LINK = http://localhost:8080/ehr-server/
12-
REACT_APP_EHR_SERVER = http://localhost:8080/test-ehr/r4
13-
REACT_APP_EHR_SERVER_TO_BE_SENT_TO_REMS_ADMIN_FOR_PREFETCH = http://localhost:8080/test-ehr/r4
14-
REACT_APP_GENERATE_JWT = true
15-
REACT_APP_GH_PAGES=false
16-
REACT_APP_HOMEPAGE = http://localhost:8080
17-
REACT_APP_LAUNCH_URL = http://localhost:4040/launch
18-
REACT_APP_ORDER_SELECT = rems-order-select
19-
REACT_APP_ORDER_SIGN = rems-order-sign
20-
REACT_APP_PASSWORD = alice
21-
REACT_APP_PATIENT_FHIR_QUERY = Patient?_sort=identifier&_count=12
22-
REACT_APP_PATIENT_VIEW = rems-patient-view
23-
REACT_APP_PIMS_SERVER = http://localhost:5051/doctorOrders/api/addRx
24-
REACT_APP_PUBLIC_KEYS = http://localhost:3000/request-generator/.well-known/jwks.json
25-
REACT_APP_REALM = ClientFhirServer
26-
REACT_APP_RESPONSE_EXPIRATION_DAYS = 30
27-
REACT_APP_SERVER = http://localhost:8090
28-
REACT_APP_SMART_LAUNCH_URL = http://localhost:4040/
29-
REACT_APP_URL = http://localhost:3000
30-
REACT_APP_URL_FILTER = http://localhost:3000/*
31-
REACT_APP_USER = alice
4+
VITE_ALT_DRUG = true
5+
VITE_AUTH = http://localhost:8180
6+
VITE_CDS_SERVICE = http://localhost:8090/etasu/reset
7+
VITE_CLIENT = app-login
8+
VITE_CLIENT_SCOPES = launch offline_access openid profile user/Patient.read patient/Patient.read user/Practitioner.read
9+
VITE_DEFAULT_USER = pra1234
10+
VITE_EHR_BASE = http://localhost:8080/test-ehr/r4
11+
VITE_EHR_LINK = http://localhost:8080/ehr-server/
12+
VITE_EHR_SERVER = http://localhost:8080/test-ehr/r4
13+
VITE_EHR_SERVER_TO_BE_SENT_TO_REMS_ADMIN_FOR_PREFETCH = http://localhost:8080/test-ehr/r4
14+
VITE_GENERATE_JWT = true
15+
VITE_GH_PAGES=false
16+
VITE_HOMEPAGE = http://localhost:8080
17+
VITE_LAUNCH_URL = http://localhost:4040/launch
18+
VITE_PASSWORD = alice
19+
VITE_PATIENT_FHIR_QUERY = Patient?_sort=identifier&_count=12
20+
VITE_PIMS_SERVER = http://localhost:5051/doctorOrders/api/addRx
21+
VITE_PUBLIC_KEYS = http://localhost:3000/request-generator/.well-known/jwks.json
22+
VITE_REALM = ClientFhirServer
23+
VITE_RESPONSE_EXPIRATION_DAYS = 30
24+
VITE_SERVER = http://localhost:8090
25+
VITE_SMART_LAUNCH_URL = http://localhost:4040/
26+
VITE_URL = http://localhost:3000
27+
VITE_URL_FILTER = http://localhost:3000/*
28+
VITE_USER = alice

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,6 @@ src/db.json
6464

6565
# Environment variable files
6666
.env.local
67+
68+
# Mac OS files
69+
**/.DS_Store

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
FROM node:14-alpine
1+
FROM node:21-alpine
2+
23
WORKDIR /home/node/app/request-generator
34
COPY --chown=node:node . .
45
RUN npm install
5-
COPY --chown=node:node . .
66
EXPOSE 3000
7+
COPY --chown=node:node . .
8+
79
CMD npm run start

Dockerfile.dev

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
FROM node:14-alpine
1+
FROM node:21-alpine
22
WORKDIR /home/node/app/request-generator
33
COPY --chown=node:node . .
44
RUN npm install
55
EXPOSE 3000
6-
EXPOSE 3001
76
CMD ./dockerRunnerDev.sh

How-To-Launch-SMART-on-FHIR-Apps.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,31 @@ SMART_ENDPOINT = https://smartlauncher.interop.community/sample-app/launch?clien
1515
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.
1616

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

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

27-
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.
28-
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.
29-
3. `REACT_APP_SMART_LAUNCH_URL`, `SMART_ENDPOINT`: This is taken from Apps > Sample App > Settings > Registered App Details > App Launch URI\*.
27+
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.
28+
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.
29+
3. `VITE_SMART_LAUNCH_URL`, `SMART_ENDPOINT`: This is taken from Apps > Sample App > Settings > Registered App Details > App Launch URI\*.
3030

3131
## How to run
3232

3333
1. Start request-generator normally and go to `http://localhost:3000/`. Click the "Authorize" button.
3434
2. Start rems-admin normally.
3535
3. In request-generator, click the "Select a Patient" button.
3636
4. Select Jon Snow (id: 130803).
37-
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.
37+
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.
3838
6. Click the "Authorize" button.
3939
7. You should see the expected SMART on FHIR app launch properly.
4040
8. Go back to request-generator and issue an order-sign hook, and click on the "Patient Enrollment Form" button.
4141
9. You should see the expected SMART on FHIR app launch.
4242

4343
## Running other Registered SMART on FHIR Apps from Meld
4444

45-
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.
45+
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.

README.md

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@ This project provides a small web application that is capable of generating requ
2222

2323
- `npm start`
2424

25-
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.
25+
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.
26+
27+
## Running with docker
28+
29+
Run the following commands
30+
31+
- `docker build -t reqgen .`
32+
- `docker run -p 3000:3000 reqgen`
2633

2734
## Keys
2835

@@ -31,7 +38,7 @@ Embedded in the application are the public and private keys used to generate and
3138
### How To Override Defaults
3239

3340
The .env file contains the default URI paths, which can be overwritten from the start command as follows:
34-
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`.
41+
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`.
3542

3643
Following are a list of modifiable paths:
3744

@@ -40,34 +47,34 @@ Following are a list of modifiable paths:
4047
| HTTPS | `false` |
4148
| HTTPS_CERT_PATH | `server.cert` |
4249
| HTTPS_KEY_PATH | `server.key` |
43-
| REACT_APP_ALT_DRUG | `true` |
44-
| REACT_APP_AUTH | `http://localhost:8180` |
45-
| REACT_APP_CDS_SERVICE | `http://localhost:8090/cds-services` |
46-
| REACT_APP_CLIENT | `app-login` |
47-
| REACT_APP_CLIENT_SCOPES | `launch offline_access openid profile user/Patient.read patient/Patient.read user/Practitioner.read` |
48-
| REACT_APP_DEFAULT_USER | `pra1234` |
49-
| REACT_APP_EHR_BASE | `http://localhost:8080/test-ehr/r4` |
50-
| REACT_APP_EHR_LINK | `http://localhost:8080/ehr-server/` |
51-
| REACT_APP_EHR_SERVER | `http://localhost:8080/test-ehr/r4` |
52-
| REACT_APP_EHR_SERVER_TO_BE_SENT_TO_REMS_ADMIN_FOR_PREFETCH | `http://localhost:8080/test-ehr/r4` |
53-
| REACT_APP_GENERATE_JWT | `true` |
54-
| REACT_APP_GH_PAGES | `false` |
55-
| REACT_APP_HOMEPAGE | `http://localhost:8080` |
56-
| REACT_APP_LAUNCH_URL | `http://localhost:4040/launch` |
57-
| REACT_APP_ORDER_SELECT | `rems-order-select` |
58-
| REACT_APP_ORDER_SIGN | `rems-order-sign` |
59-
| REACT_APP_PASSWORD | `alice` |
60-
| REACT_APP_PATIENT_FHIR_QUERY | `Patient?_sort=identifier&_count=12` |
61-
| REACT_APP_PATIENT_VIEW | `rems-patient-view` |
62-
| REACT_APP_PIMS_SERVER | `http://localhost:5051/doctorOrders/api/addRx` |
63-
| REACT_APP_PUBLIC_KEYS | `http://localhost:3000/request-generator/.well-known/jwks.json` |
64-
| REACT_APP_REALM | `ClientFhirServer` |
65-
| REACT_APP_RESPONSE_EXPIRATION_DAYS | `30` |
66-
| REACT_APP_SERVER | `http://localhost:8090` |
67-
| REACT_APP_SMART_LAUNCH_URL | `http://localhost:4040/` |
68-
| REACT_APP_URL | `http://localhost:3000` |
69-
| REACT_APP_URL_FILTER | `http://localhost:3000/*` |
70-
| REACT_APP_USER | `alice` |
50+
| VITE_ALT_DRUG | `true` |
51+
| VITE_AUTH | `http://localhost:8180` |
52+
| VITE_CDS_SERVICE | `http://localhost:8090/cds-services` |
53+
| VITE_CLIENT | `app-login` |
54+
| VITE_CLIENT_SCOPES | `launch offline_access openid profile user/Patient.read patient/Patient.read user/Practitioner.read` |
55+
| VITE_DEFAULT_USER | `pra1234` |
56+
| VITE_EHR_BASE | `http://localhost:8080/test-ehr/r4` |
57+
| VITE_EHR_LINK | `http://localhost:8080/ehr-server/` |
58+
| VITE_EHR_SERVER | `http://localhost:8080/test-ehr/r4` |
59+
| VITE_EHR_SERVER_TO_BE_SENT_TO_REMS_ADMIN_FOR_PREFETCH | `http://localhost:8080/test-ehr/r4` |
60+
| VITE_GENERATE_JWT | `true` |
61+
| VITE_GH_PAGES | `false` |
62+
| VITE_HOMEPAGE | `http://localhost:8080` |
63+
| VITE_LAUNCH_URL | `http://localhost:4040/launch` |
64+
| VITE_ORDER_SELECT | `rems-order-select` |
65+
| VITE_ORDER_SIGN | `rems-order-sign` |
66+
| VITE_PASSWORD | `alice` |
67+
| VITE_PATIENT_FHIR_QUERY | `Patient?_sort=identifier&_count=12` |
68+
| VITE_PATIENT_VIEW | `rems-patient-view` |
69+
| VITE_PIMS_SERVER | `http://localhost:5051/doctorOrders/api/addRx` |
70+
| VITE_PUBLIC_KEYS | `http://localhost:3000/request-generator/.well-known/jwks.json` |
71+
| VITE_REALM | `ClientFhirServer` |
72+
| VITE_RESPONSE_EXPIRATION_DAYS | `30` |
73+
| VITE_SERVER | `http://localhost:8090` |
74+
| VITE_SMART_LAUNCH_URL | `http://localhost:4040/` |
75+
| VITE_URL | `http://localhost:3000` |
76+
| VITE_URL_FILTER | `http://localhost:3000/*` |
77+
| VITE_USER | `alice` |
7178

7279
## How to launch as a SMART on FHIR app
7380

public/index.html renamed to index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
manifest.json provides metadata used when your web app is added to the
1010
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
1111
-->
12-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
13-
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
12+
<link rel="manifest" href="manifest.json">
13+
<link rel="shortcut icon" href="favicon.ico">
1414
<!-- Latest compiled and minified CSS -->
1515
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
1616

@@ -35,14 +35,15 @@
3535
This HTML file is a template.
3636
If you open it directly in the browser, you will see an empty page.
3737
38-
You can add webfonts, meta tags, or analytics to this file.
38+
You can add web fonts, meta tags, or analytics to this file.
3939
The build step will place the bundled scripts into the <body> tag.
4040
4141
To begin the development, run `npm start` or `yarn start`.
4242
To create a production bundle, use `npm run build` or `yarn build`.
4343
-->
4444
<script src="https://cdn.jsdelivr.net/npm/fhirclient/build/fhir-client.js">
4545
</script>
46+
<script type="module" src="/src/index.jsx"></script>
4647
</body>
4748

4849

0 commit comments

Comments
 (0)