diff --git a/.env b/.env
index fe4de04..39c1fd4 100644
--- a/.env
+++ b/.env
@@ -15,7 +15,7 @@ VITE_GH_PAGES=false
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_PIMS_SERVER = http://localhost:5051/ncpdp/script
VITE_PUBLIC_KEYS = http://localhost:3000/request-generator/.well-known/jwks.json
VITE_REALM = ClientFhirServer
VITE_RESPONSE_EXPIRATION_DAYS = 30
diff --git a/README.md b/README.md
index a8e0e52..4c7dd50 100644
--- a/README.md
+++ b/README.md
@@ -125,7 +125,7 @@ Following are a list of modifiable paths:
| VITE_LAUNCH_URL | `http://localhost:4040/launch` | The launch URL of the SMART app the request generator should use for standalone launches. Note that this URL is only used outside of the context of the CDS Hooks workflow. Normally, the SMART app launch URL will come from a link inside a card that is returned by the REMS Admin. |
| VITE_PASSWORD | `alice` | The default password for logging in as the default user, defined by VITE_USER. This should be changed if using a different default user. |
| VITE_PATIENT_FHIR_QUERY | `Patient?_sort=identifier&_count=12` | The FHIR query the app makes when searching for patients in the EHR. This should be modified if a different behavior is desired by the apps patient selection popup. This can also be modified directly in the app's settings. |
-| VITE_PIMS_SERVER | `http://localhost:5051/doctorOrders/api/addRx` | The Pharmacy System endpoint for submitting medications. This should be changed depending on which pharmacy system you want to connect with. |
+| VITE_PIMS_SERVER | `http://localhost:5051/ncpdp/script` | The Pharmacy System endpoint for submitting medications. This should be changed depending on which pharmacy system you want to connect with. |
| VITE_PUBLIC_KEYS | `http://localhost:3000/request-generator/.well-known/jwks.json` | The endpoint which contains the public keys for authentication with the REMS admin. Should be changed if the keys are moved elsewhere. |
| VITE_REALM | `ClientFhirServer` | The Keycloak realm to use. Only relevant is using Keycloak as an authentication server. This only affects direct logins like through the Patient Portal, not SMART launches like opening the app normally. |
| VITE_RESPONSE_EXPIRATION_DAYS | `30` | The number of days old a Questionnaire Response can be before it is ignored and filtered out. This ensures the patient search excludes outdated or obsolete prior sessions from creating clutter. |
diff --git a/src/components/Dashboard/ListSelections/NotificationsSection.jsx b/src/components/Dashboard/ListSelections/NotificationsSection.jsx
index e1a3cf5..65db123 100644
--- a/src/components/Dashboard/ListSelections/NotificationsSection.jsx
+++ b/src/components/Dashboard/ListSelections/NotificationsSection.jsx
@@ -7,7 +7,7 @@ import { createMedicationFromMedicationRequest } from '../../../util/fhir';
import { standardsBasedGetEtasu, getMedicationSpecificEtasuUrl } from '../../../util/util';
const NotificationsSection = () => {
- const [globalState, _] = useContext(SettingsContext);
+ const [globalState] = useContext(SettingsContext);
const classes = useStyles();
const [etasu, setEtasu] = useState([]);
const [medications, setMedications] = useState([]);
diff --git a/src/components/EtasuStatus/EtasuStatus.jsx b/src/components/EtasuStatus/EtasuStatus.jsx
index a9277e5..e49a6cd 100644
--- a/src/components/EtasuStatus/EtasuStatus.jsx
+++ b/src/components/EtasuStatus/EtasuStatus.jsx
@@ -7,7 +7,7 @@ import { createMedicationFromMedicationRequest } from '../../util/fhir.js';
// converts code into etasu for the component to render
// simplifies usage for applications that only know the code, not the case they want to display
export const EtasuStatus = props => {
- const [globalState, _] = useContext(SettingsContext);
+ const [globalState] = useContext(SettingsContext);
const { code, request } = props;
const [remsAdminResponse, setRemsAdminResponse] = useState({});
diff --git a/src/components/EtasuStatus/EtasuStatusComponent.jsx b/src/components/EtasuStatus/EtasuStatusComponent.jsx
index 7bc0792..74bb1dd 100644
--- a/src/components/EtasuStatus/EtasuStatusComponent.jsx
+++ b/src/components/EtasuStatus/EtasuStatusComponent.jsx
@@ -6,7 +6,7 @@ import { SettingsContext } from '../../containers/ContextProvider/SettingsProvid
import { standardsBasedGetEtasu, getMedicationSpecificEtasuUrl } from '../../util/util.js';
export const EtasuStatusComponent = props => {
- const [globalState, _] = useContext(SettingsContext);
+ const [globalState] = useContext(SettingsContext);
const { remsAdminResponseInit, data, display, medication } = props;
diff --git a/src/components/RequestBox/PatientSearchBar/PatientSearchBar.jsx b/src/components/RequestBox/PatientSearchBar/PatientSearchBar.jsx
index 37a1d88..54e2362 100644
--- a/src/components/RequestBox/PatientSearchBar/PatientSearchBar.jsx
+++ b/src/components/RequestBox/PatientSearchBar/PatientSearchBar.jsx
@@ -5,6 +5,7 @@ import { defaultValues } from '../../../util/data';
import PatientBox from '../../SMARTBox/PatientBox';
import './PatientSearchBarStyle.css';
+import { getPatientFirstAndLastName } from '../../../util/util';
const PatientSearchBar = props => {
const [options] = useState(defaultValues);
@@ -14,18 +15,11 @@ const PatientSearchBar = props => {
useEffect(() => {
const newList = props.searchablePatients.map(patient => ({
id: patient.id,
- name: getName(patient)
+ name: getPatientFirstAndLastName(patient)
}));
setListOfPatients([newList]);
}, [props.searchablePatients]);
- function getName(patient) {
- if (patient.name) {
- return patient.name[0].given[0] + ' ' + patient.name[0].family;
- }
- return '';
- }
-
function getFilteredLength(searchString, listOfPatients) {
const filteredListOfPatients = listOfPatients[0].filter(element => {
if (searchString === '') {
diff --git a/src/components/RequestBox/RequestBox.jsx b/src/components/RequestBox/RequestBox.jsx
index 6365398..6416a26 100644
--- a/src/components/RequestBox/RequestBox.jsx
+++ b/src/components/RequestBox/RequestBox.jsx
@@ -15,7 +15,8 @@ import {
import {
retrieveLaunchContext,
prepPrefetch,
- getMedicationSpecificEtasuUrl
+ getMedicationSpecificEtasuUrl,
+ getPatientFirstAndLastName
} from '../../util/util.js';
import './request.css';
import axios from 'axios';
@@ -71,7 +72,7 @@ const RequestBox = props => {
}
let name;
if (patient.name) {
- name = {`${patient.name[0].given[0]} ${patient.name[0].family}`} ;
+ name = {getPatientFirstAndLastName(patient)};
} else {
name = emptyField;
}
diff --git a/src/components/RequestDashboard/SettingsSection.jsx b/src/components/RequestDashboard/SettingsSection.jsx
index 2f59da0..c368a28 100644
--- a/src/components/RequestDashboard/SettingsSection.jsx
+++ b/src/components/RequestDashboard/SettingsSection.jsx
@@ -25,8 +25,15 @@ import AddIcon from '@mui/icons-material/Add';
import env from 'env-var';
import FHIR from 'fhirclient';
-import { headerDefinitions, medicationRequestToRemsAdmins, ORDER_SIGN, ORDER_SELECT, PATIENT_VIEW, ENCOUNTER_START, REMS_ETASU } from '../../util/data';
-import { actionTypes, initialState } from '../../containers/ContextProvider/reducer';
+import {
+ headerDefinitions,
+ ORDER_SIGN,
+ ORDER_SELECT,
+ PATIENT_VIEW,
+ ENCOUNTER_START,
+ REMS_ETASU
+} from '../../util/data';
+import { actionTypes } from '../../containers/ContextProvider/reducer';
import { SettingsContext } from '../../containers/ContextProvider/SettingsProvider';
const ENDPOINT = [ORDER_SIGN, ORDER_SELECT, PATIENT_VIEW, ENCOUNTER_START, REMS_ETASU];
@@ -255,30 +262,30 @@ const SettingsSection = props => {
case 'dropdown':
return (
-
-
- Hook to send when selecting a patient
-
-
-
-
+
+
+
+ Hook to send when selecting a patient
+
+
+
+
-
- )
+ );
default:
return (