diff --git a/package-lock.json b/package-lock.json index 6c28420..b671088 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8157,162 +8157,6 @@ "win32" ] }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.13.0.tgz", - "integrity": "sha512-5ZYPOuaAqEH/W3gYsRkxQATBW3Ii1MfaT4EQstTnLKViLi2gLSQmlmtTpGucNP3sXEpOiI5tdGhjdE111ekyEg==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.13.0.tgz", - "integrity": "sha512-BSbaCmn8ZadK3UAQdlauSvtaJjhlDEjS5hEVVIN3A4bbl3X+otyf/kOJV08bYiRxfejP3DXFzO2jz3G20107+Q==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.13.0.tgz", - "integrity": "sha512-Ovf2evVaP6sW5Ut0GHyUSOqA6tVKfrTHddtmxGQc1CTQa1Cw3/KMCDEEICZBbyppcwnhMwcDce9ZRxdWRpVd6g==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.13.0.tgz", - "integrity": "sha512-U+Jcxm89UTK592vZ2J9st9ajRv/hrwHdnvyuJpa5A2ngGSVHypigidkQJP+YiGL6JODiUeMzkqQzbCG3At81Gg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.13.0.tgz", - "integrity": "sha512-8wZidaUJUTIR5T4vRS22VkSMOVooG0F4N+JSwQXWSRiC6yfEsFMLTYRFHvby5mFFuExHa/yAp9juSphQQJAijQ==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.13.0.tgz", - "integrity": "sha512-Iu0Kno1vrD7zHQDxOmvweqLkAzjxEVqNhUIXBsZ8hu8Oak7/5VTPrxOEZXYC1nmrBVJp0ZcL2E7lSuuOVaE3+w==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.13.0.tgz", - "integrity": "sha512-C31QrW47llgVyrRjIwiOwsHFcaIwmkKi3PCroQY5aVq4H0A5v/vVVAtFsI1nfBngtoRpeREvZOkIhmRwUKkAdw==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.13.0.tgz", - "integrity": "sha512-Oq90dtMHvthFOPMl7pt7KmxzX7E71AfyIhh+cPhLY9oko97Zf2C9tt/XJD4RgxhaGeAraAXDtqxvKE1y/j35lA==", - "cpu": [ - "riscv64" - ], - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.13.0.tgz", - "integrity": "sha512-yUD/8wMffnTKuiIsl6xU+4IA8UNhQ/f1sAnQebmE/lyQ8abjsVyDkyRkWop0kdMhKMprpNIhPmYlCxgHrPoXoA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.13.0.tgz", - "integrity": "sha512-9RyNqoFNdF0vu/qqX63fKotBh43fJQeYC98hCaf89DYQpv+xu0D8QFSOS0biA7cGuqJFOc1bJ+m2rhhsKcw1hw==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.13.0.tgz", - "integrity": "sha512-46ue8ymtm/5PUU6pCvjlic0z82qWkxv54GTJZgHrQUuZnVH+tvvSP0LsozIDsCBFO4VjJ13N68wqrKSeScUKdA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.13.0.tgz", - "integrity": "sha512-P5/MqLdLSlqxbeuJ3YDeX37srC8mCflSyTrUsgbU1c/U9j6l2g2GiIdYaGD9QjdMQPMSgYm7hgg0551wHyIluw==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.13.0.tgz", - "integrity": "sha512-UKXUQNbO3DOhzLRwHSpa0HnhhCgNODvfoPWv2FCXme8N/ANFfhIPMGuOT+QuKd16+B5yxZ0HdpNlqPvTMS1qfw==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ] - }, "node_modules/@segment/loosely-validate-event": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@segment/loosely-validate-event/-/loosely-validate-event-2.0.0.tgz", diff --git a/src/components/RequestBox/RequestBox.jsx b/src/components/RequestBox/RequestBox.jsx index c0f1f70..14931fa 100644 --- a/src/components/RequestBox/RequestBox.jsx +++ b/src/components/RequestBox/RequestBox.jsx @@ -4,7 +4,7 @@ import { useEffect, useState } from 'react'; import buildNewRxRequest from '../../util/buildScript.2017071.js'; import MuiAlert from '@mui/material/Alert'; import Snackbar from '@mui/material/Snackbar'; -import { shortNameMap, ORDER_SIGN, ORDER_SELECT, PATIENT_VIEW } from '../../util/data.js'; +import { shortNameMap, ORDER_SIGN, PATIENT_VIEW } from '../../util/data.js'; import { getAge, createMedicationDispenseFromMedicationRequest } from '../../util/fhir.js'; import { retrieveLaunchContext, prepPrefetch } from '../../util/util.js'; import './request.css'; @@ -13,8 +13,7 @@ const RequestBox = props => { const [state, setState] = useState({ gatherCount: 0, response: {}, - submittedRx: false, - prefetchCompleted: false + submittedRx: false }); const { @@ -30,8 +29,7 @@ const RequestBox = props => { smartAppUrl, client, pimsUrl, - prefetchCompleted, - getRemsAdminUrl + prefetchCompleted } = props; const emptyField = empty; @@ -39,12 +37,6 @@ const RequestBox = props => { submitInfo(prepPrefetch(prefetchedResources), null, patient, PATIENT_VIEW); }; - const _submitOrderSelect = () => { - if (!_.isEmpty(request)) { - submitInfo(prepPrefetch(prefetchedResources), request, patient, ORDER_SELECT); - } - }; - const submitOrderSign = request => { if (!_.isEmpty(request)) { submitInfo(prepPrefetch(prefetchedResources), request, patient, ORDER_SIGN); @@ -53,13 +45,13 @@ const RequestBox = props => { useEffect(() => { // if prefetch completed - if (props.prefetchCompleted) { + if (prefetchCompleted) { // if the prefetch contains a medicationRequests bundle if (prefetchedResources.medicationRequests) { submitPatientView(); } } - }, [props.prefetchCompleted]); + }, [prefetchCompleted]); const renderPatientInfo = () => { if (Object.keys(patient).length === 0) { @@ -264,7 +256,6 @@ const RequestBox = props => { const disableSendToCRD = isOrderNotSelected() || loading; const disableSendRx = isOrderNotSelected() || loading; const disableLaunchSmartOnFhir = isPatientNotSelected(); - const orderSignRemsAdmin = getRemsAdminUrl(request, ORDER_SIGN); return ( <> diff --git a/src/containers/RequestBuilder.jsx b/src/containers/RequestBuilder.jsx index 223b04d..fcf101b 100644 --- a/src/containers/RequestBuilder.jsx +++ b/src/containers/RequestBuilder.jsx @@ -141,8 +141,6 @@ const RequestBuilder = props => { remsAdminUrl = getMedicationSpecificRemsAdminUrl(request, globalState, hook); sendHook(prefetch, request, patient, hook, remsAdminUrl); } else { - // grab all of the REMS admins for the medications for this patient - // get all MedicationRequests for the patient, then continue getMedicationRequests(patient.id); } @@ -204,8 +202,9 @@ const RequestBuilder = props => { if (response?.url?.includes(PATIENT_VIEW)) { // copy the cards from the old response into the new setState(prevState => ({ - ...prevState, response: { cards: [...(prevState.response.cards || []), ...fhirResponse.cards] } - })); + ...prevState, + response: { cards: [...(prevState.response.cards || []), ...fhirResponse.cards] } + })); } else { setState(prevState => ({ ...prevState, response: fhirResponse })); } @@ -344,9 +343,6 @@ const RequestBuilder = props => { loading={state.loading} patientFhirQuery={globalState.patientFhirQuery} prefetchCompleted={state.prefetchCompleted} - getRemsAdminUrl={(request, hook) => - getMedicationSpecificRemsAdminUrl(request, globalState, hook) - } /> )} diff --git a/src/util/util.js b/src/util/util.js index d6c182d..1373afa 100644 --- a/src/util/util.js +++ b/src/util/util.js @@ -110,6 +110,7 @@ const getMedicationSpecificRemsAdminUrl = (request, globalState, hook) => { return undefined; } + // This function never gets called with the PATIENT_VIEW hook, however. if (!(hook === PATIENT_VIEW || hook === ORDER_SIGN || hook === ORDER_SELECT || hook === ENCOUNTER_START)) { console.log(`ERROR: unknown hook type: ${hook}`); return undefined;