Skip to content

Commit 4499581

Browse files
authored
Merge pull request #145 from mcode/dev
Dev
2 parents 90e1f8e + 00a44c5 commit 4499581

31 files changed

+882
-209
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ VITE_AUTH = http://localhost:8180
66
VITE_CDS_SERVICE = http://localhost:8090/etasu/reset
77
VITE_CLIENT = app-login
88
VITE_CLIENT_SCOPES = launch offline_access openid profile user/Patient.read patient/Patient.read user/Practitioner.read
9+
VITE_USE_DEFAULT_USER = false
910
VITE_DEFAULT_USER = pra1234
1011
VITE_EHR_BASE = http://localhost:8080/test-ehr/r4
1112
VITE_EHR_SERVER = http://localhost:8080/test-ehr/r4

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
FROM node:21-alpine
22

3+
ARG VITE_URL
4+
ENV VITE_URL=$VITE_URL
5+
36
WORKDIR /home/node/app/request-generator
47
COPY --chown=node:node . .
58
RUN npm install
69
EXPOSE 3000
7-
COPY --chown=node:node . .
10+
11+
HEALTHCHECK --interval=30s --start-period=15s --timeout=10m --retries=10 CMD wget --no-verbose --tries=1 --spider ${VITE_URL} || exit 1
812

913
CMD npm run start

Dockerfile.dev

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
FROM node:21-alpine
22
WORKDIR /home/node/app/request-generator
3+
4+
ARG VITE_URL
5+
ENV VITE_URL=$VITE_URL
6+
37
COPY --chown=node:node . .
48
RUN npm install
59
EXPOSE 3000
10+
EXPOSE 3001
11+
12+
HEALTHCHECK --interval=30s --start-period=15s --timeout=10m --retries=10 CMD wget --no-verbose --tries=1 --spider ${VITE_URL} || exit 1
13+
614
CMD ./dockerRunnerDev.sh

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ Following are a list of modifiable paths:
116116
| VITE_CDS_SERVICE | `http://localhost:8090/cds-services` | The base URL of the CDS Service. This will typically be the REMS Admin. |
117117
| VITE_CLIENT | `app-login` | The default client to use for the SMART launch. Can be modified directly when launching the app. |
118118
| VITE_CLIENT_SCOPES | `launch offline_access openid profile user/Patient.read patient/Patient.read user/Practitioner.read` | The default scopes to use for the SMART launch. Can be modified directly when launching the app. |
119+
| VITE_USE_DEFAULT_USER | `false` | When true, override the logged in user with the default user. |
119120
| VITE_DEFAULT_USER | `pra1234` | The default user to log in as when SMART launching. It should be the FHIR id of a practitioner resource. |
120121
| VITE_EHR_BASE | `http://localhost:8080/test-ehr/r4` | The default base url for the EHR. Can be modified directly when launching the app. |
121122
| VITE_EHR_SERVER | `http://localhost:8080/test-ehr/r4` | The default base url for the EHR FHIR Server. Generally, this should be the same as the EHR_BASE. |

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"scripts": {
3232
"start": "vite",
3333
"production": "json-server --watch src/db.json -p 3000 --host 0.0.0.0 --static build",
34-
"build": "node build",
34+
"build": "vite build",
3535
"test": "react-scripts test --env=jsdom",
3636
"eject": "react-scripts eject",
3737
"lint": "eslint \"**/*.{js,jsx}\"",

src/components/App.jsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { ThemeProvider } from '@mui/styles';
1+
import { ThemeProvider } from '@mui/material';
2+
23
import React, { useEffect } from 'react';
34
import { BrowserRouter, HashRouter, Route, Routes } from 'react-router-dom';
45
import Gateway from '../containers/Gateway/Gateway';
@@ -10,9 +11,10 @@ import theme from '../containers/styles/theme';
1011
import { SettingsContext } from '../containers/ContextProvider/SettingsProvider';
1112
import { actionTypes } from '../containers/ContextProvider/reducer';
1213

13-
const isGhPages = process.env.VITE_GH_PAGES === 'true';
14+
const isGhPages = process.env.VITE_GH_PAGES.trim() === 'true';
1415
const Router = isGhPages ? HashRouter : BrowserRouter;
1516
const redirect = isGhPages ? '/request-generator/#/index' : '/index';
17+
console.log('redirect: ' + redirect);
1618
const App = () => {
1719
const [, dispatch] = React.useContext(SettingsContext);
1820
useEffect(() => {
@@ -26,8 +28,10 @@ const App = () => {
2628
<Router>
2729
<Routes>
2830
<Route path="/launch" element={<Launch redirect={redirect} />} />
29-
<Route path="/index" element={<Index />} />
31+
<Route path="/index" element={<ThemeProvider theme={theme}><Index/></ThemeProvider>} />
3032
<Route path="/register" element={<RegisterPage />} />
33+
{/* forcibly enter backoffice workflow */}
34+
<Route path="/index/backoffice" element={<ThemeProvider theme={theme}><Index backoffice={true}/></ThemeProvider> } />
3135
<Route
3236
path="/patient-portal"
3337
element={

src/components/Auth/Login.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const Login = props => {
2222
params.append('client_id', env.get('VITE_CLIENT').asString());
2323
axios
2424
.post(
25+
// this change breaks the patient portal login!
2526
`${env.get('VITE_AUTH').asString()}/realms/${env
2627
.get('VITE_REALM')
2728
.asString()}/protocol/openid-connect/token`,

src/components/Dashboard/Dashboard.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const Dashboard = props => {
102102
}}
103103
>
104104
<Toolbar />
105-
<Box sx={{ overflow: 'auto', marginTop: '31px' }}>
105+
<Box sx={{ overflow: 'auto', marginTop: '51px' }}>
106106
<List>
107107
{createIcons().map((option, index) => (
108108
<div key={`icon-${index}`}>

src/components/DisplayBox/DisplayBox.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ const DisplayBox = props => {
242242
// -- Detail (ReactMarkdown supports Github-flavored markdown) --
243243
const detailSection = card.detail ? (
244244
<div>
245-
<ReactMarkdown source={card.detail} />
245+
<ReactMarkdown source={card.detail}>{card.detail}</ReactMarkdown>
246246
</div>
247247
) : (
248248
<p style={{ color: 'grey' }}>None</p>
@@ -358,8 +358,8 @@ const DisplayBox = props => {
358358
{/* Forms */}
359359
{linksSection.length !== 0 ? (
360360
<div>
361-
<Typography color="text.secondary">Required Forms</Typography>
362361
<Typography variant="div">{detailSection}</Typography>
362+
<Typography color="text.secondary">Required Forms</Typography>
363363
<List className={'links-section'}>{linksSection}</List>
364364
</div>
365365
) : (

src/components/RequestBox/PatientSearchBar/PatientSearchBar.jsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { Autocomplete, Box, TextField, IconButton } from '@mui/material';
1+
import { Autocomplete, Box, TextField } from '@mui/material';
2+
import { Grid, Button } from '@mui/material';
3+
import PeopleIcon from '@mui/icons-material/People';
4+
25
import { useEffect, useState } from 'react';
36
import { PrefetchTemplate } from '../../../PrefetchTemplate';
47
import { defaultValues } from '../../../util/data';
@@ -32,9 +35,16 @@ const PatientSearchBar = props => {
3235
return filteredListOfPatients.length;
3336
}
3437

38+
const showAllPatients = () => {
39+
props.callback('patient', {});
40+
props.callback('expanded', false);
41+
};
42+
3543
function patientSearchBar() {
3644
return (
3745
<Box className="search-box-container">
46+
<Grid container>
47+
<Grid item xs={9}>
3848
<span className="search-header">
3949
<p>Filter patient list</p>
4050
<Autocomplete
@@ -52,6 +62,13 @@ const PatientSearchBar = props => {
5262
records
5363
</p>
5464
</span>
65+
</Grid>
66+
<Grid item xs={3}>
67+
<Button variant="contained" startIcon={<PeopleIcon />} onClick={() => { showAllPatients(); }} style={{padding:'10px','paddingLeft':'20px', 'paddingRight':'20px'}}>
68+
Select all Patients
69+
</Button>
70+
</Grid>
71+
</Grid>
5572
{displayFilteredPatientList(input, listOfPatients[0])}
5673
</Box>
5774
);
@@ -82,7 +99,8 @@ const PatientSearchBar = props => {
8299
clearCallback={props.clearCallback}
83100
options={options}
84101
responseExpirationDays={props.responseExpirationDays}
85-
defaultUser={props.defaultUser}
102+
user={props.user}
103+
showButtons={props.showButtons}
86104
/>
87105
</span>
88106
);

0 commit comments

Comments
 (0)