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
17 changes: 6 additions & 11 deletions src/components/RequestBox/RequestBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
};
Expand Down Expand Up @@ -326,8 +325,7 @@ const RequestBox = props => {
selectedProduct?.medicationRequestId ||
productConfig?.medicationRequestId ||
buildMedicationRequestIdFromTemplate(
selectedProduct?.medicationRequestIdTemplate ||
productConfig?.medicationRequestIdTemplate
selectedProduct?.medicationRequestIdTemplate || productConfig?.medicationRequestIdTemplate
)
);
};
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -611,10 +609,7 @@ const RequestBox = props => {
<Button onClick={checkAvailability} disabled={disableCheckAvailability}>
{ppaState.checking ? 'Checking Availability' : 'Check Availability'}
</Button>
<Button
onClick={submitOrderSign}
disabled={disableSendToCRD}
>
<Button onClick={submitOrderSign} disabled={disableSendToCRD}>
Sign Order
</Button>
</ButtonGroup>
Expand Down
27 changes: 12 additions & 15 deletions src/components/RequestDashboard/SettingsSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) =>
Expand Down Expand Up @@ -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 => {
Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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)`);

Expand Down Expand Up @@ -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);
}
Expand Down
3 changes: 2 additions & 1 deletion src/util/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/util/fhir.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Loading