diff --git a/src/components/RequestBox/RequestBox.jsx b/src/components/RequestBox/RequestBox.jsx index 87329c84..35a6223e 100644 --- a/src/components/RequestBox/RequestBox.jsx +++ b/src/components/RequestBox/RequestBox.jsx @@ -296,8 +296,7 @@ const RequestBox = props => { const getAvailabilityResultLabel = result => { const requested = result.requestedProduct?.display || 'Requested product'; const selected = result.selectedProduct?.display; - const product = - selected && selected !== requested ? `${requested} -> ${selected}` : requested; + const product = selected && selected !== requested ? `${requested} -> ${selected}` : requested; return `${result.pharmacy?.name}: ${product} - ${result.reasonCode}`; }; @@ -326,8 +325,7 @@ const RequestBox = props => { selectedProduct?.medicationRequestId || productConfig?.medicationRequestId || buildMedicationRequestIdFromTemplate( - selectedProduct?.medicationRequestIdTemplate || - productConfig?.medicationRequestIdTemplate + selectedProduct?.medicationRequestIdTemplate || productConfig?.medicationRequestIdTemplate ) ); }; @@ -486,10 +484,10 @@ const RequestBox = props => { */ const sendRx = async () => { // Use intermediary or direct based on toggle - const ncpdpEndpoint = globalState.usePharmacyIntermediary - ? globalState.pharmacyIntermediaryUrl + const ncpdpEndpoint = globalState.usePharmacyIntermediary + ? globalState.pharmacyIntermediaryUrl : getSelectedPharmacyScriptEndpoint(); - + console.log('Sending NewRx to: ' + ncpdpEndpoint); console.log('Getting case number'); const requestForDispense = await getRequestForSelectedProduct(); @@ -611,10 +609,7 @@ const RequestBox = props => { - diff --git a/src/components/RequestDashboard/SettingsSection.jsx b/src/components/RequestDashboard/SettingsSection.jsx index a20b28ed..b4c9b545 100644 --- a/src/components/RequestDashboard/SettingsSection.jsx +++ b/src/components/RequestDashboard/SettingsSection.jsx @@ -164,12 +164,10 @@ const SettingsSection = props => { } }; - const clearResource = - (_settings, type) => - async () => { - // Delete all resources of type type - return await clearResourceWithParams(type, ''); - }; + const clearResource = (_settings, type) => async () => { + // Delete all resources of type type + return await clearResourceWithParams(type, ''); + }; const clearPatient = ({ patientOfInterest }) => @@ -261,12 +259,10 @@ const SettingsSection = props => { // add a communication notifying the practitioner that the resources were created const communication = createCommunication(patientId, userId, message); - client - .create(communication) - .catch(e => { - console.log('Failed to add Communication to EHR'); - console.log(e); - }); + client.create(communication).catch(e => { + console.log('Failed to add Communication to EHR'); + console.log(e); + }); }; const parsePacioToc = async pacioToc => { @@ -381,7 +377,9 @@ const SettingsSection = props => { try { const medicationRequestResult = await client.create(medicationRequest); - console.log(` Added new MedicationRequest for ${medName} (ID: ${medicationRequestResult.id})`); + console.log( + ` Added new MedicationRequest for ${medName} (ID: ${medicationRequestResult.id})` + ); addCommunication( patientId, `Added new MedicationRequest for ${medName} from transfer of care` @@ -419,7 +417,7 @@ const SettingsSection = props => { const searchBundle = await pacioFhirClient.request(query); // ignore the first message, don't save old bundles - if (lastPacioTimestamp.current) { + if (lastPacioTimestamp.current) { if (searchBundle?.entry && searchBundle.entry.length > 0) { console.log(` Found ${searchBundle.entry.length} discharge notification(s)`); @@ -471,7 +469,6 @@ const SettingsSection = props => { console.log(` Server timestamp: ${serverTimestamp}`); lastPacioTimestamp.current = serverTimestamp; } - } catch (e) { console.log('Failed to poll PACIO notifications:', e); } diff --git a/src/util/data.js b/src/util/data.js index 96bbeda5..b0c470f4 100644 --- a/src/util/data.js +++ b/src/util/data.js @@ -50,7 +50,8 @@ const headerDefinitions = { pharmacyIntermediaryUrl: { type: 'input', display: 'Pharmacy Intermediary URL (NCPDP Endpoint)', - default: env.get('VITE_PHARMACY_INTERMEDIARY').asString() || 'http://localhost:3003/ncpdp/script' + default: + env.get('VITE_PHARMACY_INTERMEDIARY').asString() || 'http://localhost:3003/ncpdp/script' }, alternativeTherapy: { display: 'Alternative Therapy Cards Allowed', diff --git a/src/util/fhir.js b/src/util/fhir.js index 06e1c8af..22f9bb3e 100644 --- a/src/util/fhir.js +++ b/src/util/fhir.js @@ -70,7 +70,7 @@ function createMedicationDispenseFromMedicationRequest(medicationRequest) { medicationDispense.authorizingPrescription = [ { reference: 'MedicationRequest/' + medicationRequest.id } ]; - medicationDispense.note = [ { text: 'Medication sent to pharmacy' } ]; + medicationDispense.note = [{ text: 'Medication sent to pharmacy' }]; return medicationDispense; }