Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

608 remove send rx button and capability from rems-smart-on-fhir #73

Merged
merged 6 commits into from
Feb 19, 2024
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
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ REACT_APP_PHARMACY_STATUS_ENABLED = true
REACT_APP_REMS_ADMIN_SERVER_BASE = http://localhost:8090
REACT_APP_REMS_HOOKS_PATH = /cds-services/rems-
REACT_APP_SEND_FHIR_AUTH_ENABLED = false
REACT_APP_SEND_RX_ENABLED = true
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Following are a list of modifiable paths:
| REACT_APP_REMS_ADMIN_SERVER_BASE | `http://localhost:8090` |
| REACT_APP_REMS_HOOKS_PATH | `/cds-services/rems-` |
| REACT_APP_SEND_FHIR_AUTH_ENABLED | `false` |
| REACT_APP_SEND_RX_ENABLED | `true` |

_Note that .env values can only be accessed by the React app starting with `REACT_APP_`\_

Expand Down
39 changes: 1 addition & 38 deletions src/views/Patient/MedReqDropDown/MedReqDropDown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@ import RefreshIcon from '@mui/icons-material/Refresh';
import Box from '@mui/material/Box';
import ListIcon from '@mui/icons-material/List';
import LocalPharmacyIcon from '@mui/icons-material/LocalPharmacy';
import {
BundleEntry,
Patient,
MedicationRequest,
Practitioner,
Resource,
MedicationDispense
} from 'fhir/r4';
import { BundleEntry, Patient, MedicationRequest, Resource, MedicationDispense } from 'fhir/r4';
import Client from 'fhirclient/lib/Client';
import { ReactElement, useEffect, useState } from 'react';
import example from '../../../cds-hooks/prefetch/exampleHookService.json'; // TODO: Replace with request to CDS service
Expand All @@ -43,7 +36,6 @@ import EtasuStatus from './etasuStatus/EtasuStatus';

// Adding in Pharmacy
import PharmacyStatus from './pharmacyStatus/PharmacyStatus';
import sendRx from './rxSend/rxSend';
import axios from 'axios';
import MetRequirements from './etasuStatus/MetRequirements';
import RemsMetEtasuResponse from './etasuStatus/RemsMetEtasuResponse';
Expand All @@ -54,7 +46,6 @@ interface MedReqDropDownProps {
hooksCards: HooksCard[];
medication: MedicationBundle | null;
patient: Patient | null;
practitioner: Practitioner | null;
setHooksCards: React.Dispatch<React.SetStateAction<HooksCard[]>>;
tabCallback: (n: ReactElement, m: string, o: string) => void;
user: string | null;
Expand All @@ -66,7 +57,6 @@ function MedReqDropDown({
hooksCards,
medication,
patient,
practitioner,
setHooksCards,
tabCallback,
user
Expand All @@ -91,7 +81,6 @@ function MedReqDropDown({
null
);
const [checkedPharmacyTime, setCheckedPharmacyTime] = useState(0);
const [sendRxEnabled, setSendRxEnabled] = useState<boolean>(false);

useEffect(() => {
if (cdsHook) {
Expand All @@ -115,13 +104,6 @@ function MedReqDropDown({
setShowPharmacy(false);
};

const handleSendRx = () => {
const med = selectedMedicationCardBundle?.resource;
if (med && patient && practitioner) {
sendRx(patient, practitioner, med);
}
};

const [selectedMedicationCardBundle, setSelectedMedicationCardBundle] =
useState<BundleEntry<MedicationRequest>>();

Expand Down Expand Up @@ -173,18 +155,6 @@ function MedReqDropDown({
}
}, [selectedMedicationCardBundle]);

useEffect(() => {
if (
patient &&
practitioner &&
selectedMedicationCardBundle &&
env.get('REACT_APP_SEND_RX_ENABLED').asBool() === true
) {
setSendRxEnabled(true);
} else {
setSendRxEnabled(false);
}
}, [patient, practitioner, selectedMedicationCardBundle]);
useEffect(() => {
refreshEtasuBundle();
refreshPharmacyBundle();
Expand Down Expand Up @@ -450,13 +420,6 @@ function MedReqDropDown({
{renderTimestamp(checkedPharmacyTime)}
</Grid>
)}
{sendRxEnabled && (
<Grid item>
<Button variant="contained" onClick={handleSendRx}>
Send RX to PIMS
</Button>
</Grid>
)}
</Grid>
</>
)}
Expand Down
Loading
Loading