Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
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`.
Expand Down
2 changes: 1 addition & 1 deletion src/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const isGhPages = process.env.VITE_GH_PAGES === 'true';
const Router = isGhPages ? HashRouter : BrowserRouter;
const redirect = isGhPages ? '/request-generator/#/index' : '/index';
const App = () => {
const [state, dispatch] = React.useContext(SettingsContext);
const [, dispatch] = React.useContext(SettingsContext);
useEffect(() => {
dispatch({
type: actionTypes.updateSetting,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dashboard/Dashboard.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { memo, useState, useEffect } from 'react';
import { memo, useState, useEffect } from 'react';
import useStyles from './styles';
import Box from '@mui/material/Box';
import Drawer from '@mui/material/Drawer';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dashboard/FormElement.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { memo } from 'react';
import { memo } from 'react';
import { retrieveLaunchContext } from '../../util/util';
import { Paper } from '@mui/material';
import useStyles from './styles.jsx';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dashboard/ListSelections/EmptySection.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { memo } from 'react';
import { memo } from 'react';
import useStyles from '../styles';

const EmptySection = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import React, { memo, useState, useEffect } from 'react';
import { memo, useState, useEffect } from 'react';
import { Paper, Typography } from '@mui/material';
import FormControlLabel from '@mui/material/FormControlLabel';
import useStyles from '../styles';
import { MedicationStatus } from '../../MedicationStatus/MedicationStatus';
import axios from 'axios';

const MedicationsSection = props => {
const classes = useStyles();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { memo, useState, useEffect, Fragment } from 'react';
import { memo } from 'react';
import useStyles from '../styles';
import TasksSection from '../../RequestDashboard/TasksSection';

Expand Down
9 changes: 5 additions & 4 deletions src/components/DisplayBox/displayBox.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
td, th{
padding:0px 4px;
border:1px solid;
}
td,
th {
padding: 0px 4px;
border: 1px solid;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Box, Button, Typography, ButtonGroup } from '@mui/material';
import React from 'react';
import './InProgressFormBoxStyle.css';

const InProgressFormBox = props => {
return props.qrResponse?.questionnaire ? (
<Box className={'inprogress-container'}>
<Box className={'in-progress-container'}>
<Typography variant="h6" color="text.primary" gutterBottom>
In Progress Form
</Typography>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.inprogress-container {
background-color:#f8f8f8;
border: 1px solid black;
border-radius: 5px;
padding:20px;
margin:20px 0 20px 0;
}
.in-progress-container {
background-color: #f8f8f8;
border: 1px solid black;
border-radius: 5px;
padding: 20px;
margin: 20px 0 20px 0;
}
14 changes: 7 additions & 7 deletions src/components/RequestBox/PatientSearchBar/PatientSearchBar.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Autocomplete, Box, TextField, IconButton } from '@mui/material';
import React, { useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import { PrefetchTemplate } from '../../../PrefetchTemplate';
import { defaultValues } from '../../../util/data';

Expand All @@ -26,12 +26,12 @@ const PatientSearchBar = props => {
return '';
}

function getFilteredLength(searchstring, listOfPatients) {
function getFilteredLength(searchString, listOfPatients) {
const filteredListOfPatients = listOfPatients[0].filter(element => {
if (searchstring === '') {
if (searchString === '') {
return element;
} else {
return element.name.toLowerCase().includes(searchstring);
return element.name.toLowerCase().includes(searchString);
}
});

Expand Down Expand Up @@ -63,12 +63,12 @@ const PatientSearchBar = props => {
);
}

function displayFilteredPatientList(searchstring, listOfPatients) {
function displayFilteredPatientList(searchString, listOfPatients) {
const filteredListOfPatients = listOfPatients.filter(element => {
if (searchstring === '') {
if (searchString === '') {
return element;
} else {
return element.name.toLowerCase().includes(searchstring);
return element.name.toLowerCase().includes(searchString);
}
});
return (
Expand Down
6 changes: 3 additions & 3 deletions src/components/RequestBox/RequestBox.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button, ButtonGroup, Grid } from '@mui/material';
import _ from 'lodash';
import React, { useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import buildNewRxRequest from '../../util/buildScript.2017071.js';
import MuiAlert from '@mui/material/Alert';
import Snackbar from '@mui/material/Snackbar';
Expand Down Expand Up @@ -54,7 +54,7 @@ const RequestBox = props => {
submitInfo(prepPrefetch(), null, patient, 'patient-view');
};

const submitOrderSelect = () => {
const _submitOrderSelect = () => {
if (!_.isEmpty(request)) {
submitInfo(prepPrefetch(), request, patient, 'order-select');
}
Expand Down Expand Up @@ -240,7 +240,7 @@ const RequestBox = props => {
},
body: serializer.serializeToString(newRx)
})
.then(response => {
.then(() => {
console.log('Successfully sent NewRx to PIMS');

// create the MedicationDispense
Expand Down
12 changes: 4 additions & 8 deletions src/components/RequestDashboard/Home.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React, { memo, useState } from 'react';
import { memo, useState } from 'react';
import { Button, Grid, Tooltip } from '@mui/material';
import PersonIcon from '@mui/icons-material/Person';
import AssignmentIcon from '@mui/icons-material/Assignment';
import SettingsIcon from '@mui/icons-material/Settings';

import useStyles from './styles';
import PatientSection from './PatientSection';
import { SettingsContext } from '../../containers/ContextProvider/SettingsProvider';
import SettingsSection from './SettingsSection';
import TasksSection from './TasksSection';

Expand All @@ -16,7 +15,6 @@ const Home = props => {
const taskButton = 'View Tasks';
const settingsButton = 'Settings';
const [section, setSection] = useState('');
const [state, dispatch] = React.useContext(SettingsContext);

const openSection = buttonId => {
setSection(buttonId);
Expand Down Expand Up @@ -79,12 +77,10 @@ const Home = props => {

// render content of each view, makes other content invisible so it doesn't rerender every time
const renderSectionView = () => {
let renderSection = <div>Loading...</div>;

if (section) {
let patientRenderClass = section === patientButton ? '' : classes.disappear;
let taskRenderClass = section === taskButton ? '' : classes.disappear;
let settingsRenderClass = section === settingsButton ? '' : classes.disappear;
const patientRenderClass = section === patientButton ? '' : classes.disappear;
const taskRenderClass = section === taskButton ? '' : classes.disappear;
const settingsRenderClass = section === settingsButton ? '' : classes.disappear;

return (
<div className={classes.mainSectionView}>
Expand Down
5 changes: 2 additions & 3 deletions src/components/RequestDashboard/PatientSection.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React, { memo } from 'react';
import { memo, useContext } from 'react';

import useStyles from './styles';
import RequestBuilder from '../../containers/RequestBuilder';
import { SettingsContext } from '../../containers/ContextProvider/SettingsProvider';

const PatientSection = props => {
const [state, dispatch] = React.useContext(SettingsContext);
const [state, dispatch] = useContext(SettingsContext);
return (
<div>
{state.startup ? (
Expand Down
7 changes: 3 additions & 4 deletions src/components/RequestDashboard/TasksSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const taskStatus = Object.freeze({
const TasksSection = props => {
const classes = useStyles();
const [tasks, setTasks] = useState([]);
const [state, dispatch] = React.useContext(SettingsContext);
const [state] = React.useContext(SettingsContext);
const [value, setValue] = useState(0);
const [open, setOpen] = useState(false);
const [taskToDelete, setTaskToDelete] = useState('');
Expand Down Expand Up @@ -191,7 +191,7 @@ const TasksSection = props => {
retrieveLaunchContext(smartLink, patient, props.client.state).then(result => {
updateTaskStatus(lTask, 'in-progress');
lTask.status = 'in-progress';
props.client.update(washTask(lTask)).then(e => {
props.client.update(washTask(lTask)).then(_e => {
fetchTasks();
});
window.open(result.url, '_blank');
Expand Down Expand Up @@ -416,8 +416,7 @@ const TasksSection = props => {

const renderPortalView = () => {
const patientTasks = tasks.filter(t => t.owner?.id === state.patient?.id);

return <>{renderTasks(patientTasks)}</>;
return renderTasks(patientTasks);
};

return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/RequestDashboard/styles.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { makeStyles } from '@mui/styles';
export default makeStyles(
theme => ({
() => ({
disappear: {
display: 'none'
},
Expand Down
1 change: 0 additions & 1 deletion src/components/SMARTBox/EHRLaunchBox.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import './smart.css';
import env from 'env-var';

Expand Down
12 changes: 6 additions & 6 deletions src/components/SMARTBox/PatientBox.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import { getAge, getDrugCodeFromMedicationRequest } from '../../util/fhir';
import './smart.css';
import { Button } from '@mui/material';
Expand Down Expand Up @@ -30,7 +30,7 @@ const PatientBox = props => {
numInProgressForms: 0,
name: 'N/A',
fullName: 'N/A',
formatBirthdate: '',
formatBirthDate: '',
options: [],
responseOptions: []
});
Expand Down Expand Up @@ -495,12 +495,12 @@ const PatientBox = props => {
);
};

const makeQuestionnaireTable = (columns, options, type, patient) => {
const makeQuestionnaireTable = (columns, options, type, _patient) => {
return (
<TableContainer
key={type}
component={Paper}
sx={{ blackgroundColor: '#ddd', border: '1px solid #535353' }}
sx={{ backgroundColor: '#ddd', border: '1px solid #535353' }}
>
<Table sx={{ maxHeight: 440, justifyContent: 'center' }} stickyHeader>
<TableHead sx={{ borderBottom: '1px solid #535353' }}>
Expand Down Expand Up @@ -548,7 +548,7 @@ const PatientBox = props => {
if (patient.birthDate) {
setState(prevState => ({
...prevState,
formatBirthdate: new Date(patient.birthDate).toDateString()
formatBirthDate: new Date(patient.birthDate).toDateString()
}));
}
};
Expand All @@ -568,7 +568,7 @@ const PatientBox = props => {
{patient.gender.charAt(0).toUpperCase() + patient.gender.slice(1)}
</div>
<div>
<span style={{ fontWeight: 'bold' }}>DoB/Age</span>: {state.formatBirthdate} (
<span style={{ fontWeight: 'bold' }}>DoB/Age</span>: {state.formatBirthDate} (
{getAge(patient.birthDate)} years old)
</div>
</div>
Expand Down
12 changes: 2 additions & 10 deletions src/containers/Gateway/Gateway.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
import React, { memo, useState, useEffect } from 'react';
import { memo, useState } from 'react';
import FHIR from 'fhirclient';
import env from 'env-var';
import {
Button,
FormControl,
FormHelperText,
IconButton,
TextField,
Accordion,
AccordionDetails
} from '@mui/material';
import { Button, FormControl, TextField } from '@mui/material';
import Stack from '@mui/material/Stack';
import Autocomplete from '@mui/material/Autocomplete';
import useStyles from './styles';
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Gateway/styles.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { makeStyles } from '@mui/styles';
export default makeStyles(
theme => ({
() => ({
'@global': {
body: {
backgroundColor: '#fafafa'
Expand Down
5 changes: 2 additions & 3 deletions src/containers/Index.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React, { useState, useEffect } from 'react';
import { useState, useEffect } from 'react';
import FHIR from 'fhirclient';
import env from 'env-var';
import Home from '../components/RequestDashboard/Home';

const Index = props => {
const Index = () => {
const [client, setClient] = useState(null);

useEffect(() => {
Expand Down
3 changes: 1 addition & 2 deletions src/containers/Launch.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import env from 'env-var';
import queryString from 'querystring';
import FHIR from 'fhirclient';
import React, { memo, useEffect, useState } from 'react';
import { memo, useEffect, useState } from 'react';
import RegisterPage from './register/RegisterPage';

const Launch = props => {
Expand All @@ -25,7 +25,6 @@ const Launch = props => {
localStorage.setItem('clients', JSON.stringify(clients));
}
}
const urlSearchString = window.location.search;
const params = queryString.parse((window.location.hash || '').replace(/\/?#\/?launch\?/, ''));
const iss = params.iss;
console.log('iss: ' + iss);
Expand Down
2 changes: 1 addition & 1 deletion src/containers/PatientPortal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const PatientPortal = () => {
const [token, setToken] = useState(null);
const [client, setClient] = useState(null);
const [patientName, setPatientName] = useState(null);
const [state, dispatch] = React.useContext(SettingsContext);
const [, dispatch] = React.useContext(SettingsContext);

useEffect(() => {
if (token) {
Expand Down
Loading