diff --git a/src/components/RequestDashboard/PatientSection.jsx b/src/components/RequestDashboard/PatientSection.jsx
index d407de2b..21512725 100644
--- a/src/components/RequestDashboard/PatientSection.jsx
+++ b/src/components/RequestDashboard/PatientSection.jsx
@@ -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 (
{state.startup ? (
diff --git a/src/components/RequestDashboard/TasksSection.jsx b/src/components/RequestDashboard/TasksSection.jsx
index 8df63d86..317a4375 100644
--- a/src/components/RequestDashboard/TasksSection.jsx
+++ b/src/components/RequestDashboard/TasksSection.jsx
@@ -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('');
@@ -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');
@@ -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 (
diff --git a/src/components/RequestDashboard/styles.jsx b/src/components/RequestDashboard/styles.jsx
index 00c52a63..4a85cf57 100644
--- a/src/components/RequestDashboard/styles.jsx
+++ b/src/components/RequestDashboard/styles.jsx
@@ -1,6 +1,6 @@
import { makeStyles } from '@mui/styles';
export default makeStyles(
- theme => ({
+ () => ({
disappear: {
display: 'none'
},
diff --git a/src/components/SMARTBox/EHRLaunchBox.jsx b/src/components/SMARTBox/EHRLaunchBox.jsx
index c23751f3..7f22b8d2 100644
--- a/src/components/SMARTBox/EHRLaunchBox.jsx
+++ b/src/components/SMARTBox/EHRLaunchBox.jsx
@@ -1,4 +1,3 @@
-import React from 'react';
import './smart.css';
import env from 'env-var';
diff --git a/src/components/SMARTBox/PatientBox.jsx b/src/components/SMARTBox/PatientBox.jsx
index fea2e08c..d2007355 100644
--- a/src/components/SMARTBox/PatientBox.jsx
+++ b/src/components/SMARTBox/PatientBox.jsx
@@ -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';
@@ -30,7 +30,7 @@ const PatientBox = props => {
numInProgressForms: 0,
name: 'N/A',
fullName: 'N/A',
- formatBirthdate: '',
+ formatBirthDate: '',
options: [],
responseOptions: []
});
@@ -495,12 +495,12 @@ const PatientBox = props => {
);
};
- const makeQuestionnaireTable = (columns, options, type, patient) => {
+ const makeQuestionnaireTable = (columns, options, type, _patient) => {
return (
@@ -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()
}));
}
};
@@ -568,7 +568,7 @@ const PatientBox = props => {
{patient.gender.charAt(0).toUpperCase() + patient.gender.slice(1)}
- DoB/Age: {state.formatBirthdate} (
+ DoB/Age: {state.formatBirthDate} (
{getAge(patient.birthDate)} years old)
diff --git a/src/containers/Gateway/Gateway.jsx b/src/containers/Gateway/Gateway.jsx
index b09da650..53a6e967 100644
--- a/src/containers/Gateway/Gateway.jsx
+++ b/src/containers/Gateway/Gateway.jsx
@@ -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';
diff --git a/src/containers/Gateway/styles.jsx b/src/containers/Gateway/styles.jsx
index ae2b96db..22453bf8 100644
--- a/src/containers/Gateway/styles.jsx
+++ b/src/containers/Gateway/styles.jsx
@@ -1,6 +1,6 @@
import { makeStyles } from '@mui/styles';
export default makeStyles(
- theme => ({
+ () => ({
'@global': {
body: {
backgroundColor: '#fafafa'
diff --git a/src/containers/Index.jsx b/src/containers/Index.jsx
index 0bf71379..a94b327f 100644
--- a/src/containers/Index.jsx
+++ b/src/containers/Index.jsx
@@ -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(() => {
diff --git a/src/containers/Launch.jsx b/src/containers/Launch.jsx
index 1de90a7e..5e8db748 100644
--- a/src/containers/Launch.jsx
+++ b/src/containers/Launch.jsx
@@ -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 => {
@@ -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);
diff --git a/src/containers/PatientPortal.jsx b/src/containers/PatientPortal.jsx
index 131ba6e1..e940d56e 100644
--- a/src/containers/PatientPortal.jsx
+++ b/src/containers/PatientPortal.jsx
@@ -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) {
diff --git a/src/containers/RequestBuilder.jsx b/src/containers/RequestBuilder.jsx
index 1d41e01e..60bdb5a8 100644
--- a/src/containers/RequestBuilder.jsx
+++ b/src/containers/RequestBuilder.jsx
@@ -1,4 +1,4 @@
-import React, { useState, useEffect } from 'react';
+import { useContext, useState, useEffect } from 'react';
import { Button, Box, Grid, IconButton } from '@mui/material';
import PersonIcon from '@mui/icons-material/Person';
import RefreshIcon from '@mui/icons-material/Refresh';
@@ -24,7 +24,7 @@ import { SettingsContext } from './ContextProvider/SettingsProvider.jsx';
const RequestBuilder = props => {
const { client } = props;
- const [globalState, dispatch] = React.useContext(SettingsContext);
+ const [globalState, dispatch] = useContext(SettingsContext);
const [state, setState] = useState({
loading: false,
patient: {},
@@ -40,7 +40,7 @@ const RequestBuilder = props => {
token: null,
client: client,
medicationDispense: null,
- lastCheckedMedicationTime: null,
+ lastCheckedMedicationTime: null
});
const displayRequestBox = !!globalState.patient?.id;
@@ -48,7 +48,6 @@ const RequestBuilder = props => {
return Object.keys(state.request).length === 0;
};
-
const disableGetMedicationStatus = isOrderNotSelected() || state.loading;
const disableGetEtasu = isOrderNotSelected() || state.loading;
const getMedicationStatus = () => {
@@ -71,8 +70,6 @@ const RequestBuilder = props => {
);
};
-
-
useEffect(() => {
if (state.client) {
// Call patients on load of page
@@ -304,10 +301,7 @@ const RequestBuilder = props => {
{!disableGetEtasu && (
-
+
)}
{!disableGetMedicationStatus && (
diff --git a/src/containers/register/RegisterPage.jsx b/src/containers/register/RegisterPage.jsx
index a38d4327..95d7469e 100644
--- a/src/containers/register/RegisterPage.jsx
+++ b/src/containers/register/RegisterPage.jsx
@@ -10,7 +10,7 @@ import {
TextField,
Typography
} from '@mui/material';
-import React, { useState } from 'react';
+import { useState } from 'react';
import './RegisterPageStyle.css';
export default function RegisterPage(props) {
diff --git a/src/containers/styles/theme.jsx b/src/containers/styles/theme.jsx
index 00c1c359..0c82b2fd 100644
--- a/src/containers/styles/theme.jsx
+++ b/src/containers/styles/theme.jsx
@@ -23,8 +23,8 @@ const colors = {
green: '#2fa874',
maroon: '#a83048',
purple: '#8b72d6',
- turqoise: '#37c0ae',
- turqoiseLight: '#e6f7f5'
+ turquoise: '#37c0ae',
+ turquoiseLight: '#e6f7f5'
};
const paletteBase = {
diff --git a/src/index.css b/src/index.css
index 5c0b331e..caf53ce6 100644
--- a/src/index.css
+++ b/src/index.css
@@ -148,12 +148,10 @@ input:not(:focus):not([value='']):valid ~ .floating-label {
margin-left: 5px;
}
.onOff {
- /* border-color: #E34531; */
border-color: #c5c5c5;
}
.onOffActive {
- /* border-color: #5CB85C; */
border-color: #222222;
}
@@ -177,7 +175,6 @@ input:not(:focus):not([value='']):valid ~ .floating-label {
opacity: 1;
}
.invisible {
- /* display:none; */
opacity: 0;
}
.spinner {
diff --git a/src/index.jsx b/src/index.jsx
index 2eea30c3..491a9220 100644
--- a/src/index.jsx
+++ b/src/index.jsx
@@ -1,4 +1,3 @@
-import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './components/App';
diff --git a/src/util/auth.js b/src/util/auth.js
index 7ba6007b..6c2df049 100644
--- a/src/util/auth.js
+++ b/src/util/auth.js
@@ -1,5 +1,5 @@
import privKey from '../keys/crdPrivateKey.js';
-import KJUR, { KEYUTIL } from 'jsrsasign';
+import KJUR from 'jsrsasign';
import { v4 as uuidv4 } from 'uuid';
import env from 'env-var';
diff --git a/src/util/fhir.js b/src/util/fhir.js
index 3fdcb31d..7c4a1c37 100644
--- a/src/util/fhir.js
+++ b/src/util/fhir.js
@@ -1,21 +1,3 @@
-function fhir(resource, ehrUrl, patient, auth) {
- const headers = {
- 'Content-Type': 'application/json'
- };
- if (patient) {
- fetch(`${ehrUrl}${resource}?subject=Patient/${patient}`, {
- method: 'GET',
- headers: headers
- })
- .then(response => {
- return response.json();
- })
- .then(json => {
- console.log(json);
- });
- }
-}
-
function getAge(dateString) {
var today = new Date();
var birthDate = new Date(dateString);
@@ -91,7 +73,6 @@ function createMedicationFromMedicationRequest(medicationRequest) {
}
export {
- fhir,
getAge,
getDrugCodeableConceptFromMedicationRequest,
getDrugCodeFromMedicationRequest,