Skip to content

Commit

Permalink
Modify non-admin users access to the patient consultation record ohcn…
Browse files Browse the repository at this point in the history
  • Loading branch information
Sulochan-khadka committed Oct 6, 2024
1 parent 8e6a2f2 commit 0bdec11
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Components/Facility/ConsultationCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { useState } from "react";
import DialogModal from "../Common/Dialog.js";
import Beds from "./Consultations/Beds";
import careConfig from "@careConfig";
import useAuthUser from "../../Common/hooks/useAuthUser";

interface ConsultationProps {
itemData: ConsultationModel;
Expand All @@ -20,6 +21,8 @@ interface ConsultationProps {
export const ConsultationCard = (props: ConsultationProps) => {
const { itemData, isLastConsultation, refetch } = props;
const [open, setOpen] = useState(false);
const { user_type } = useAuthUser();
const authuser = user_type == "Nurse";
const bedDialogTitle = itemData.discharge_date
? "Bed History"
: !itemData.current_bed
Expand Down Expand Up @@ -165,6 +168,7 @@ export const ConsultationCard = (props: ConsultationProps) => {
</div>
</div>
<div className="mt-4 flex w-full flex-col justify-between gap-1 md:flex-row">
{/* {user_type == "Nurse" && ( */}
<ButtonV2
id="view_consulation_updates"
className="h-auto whitespace-pre-wrap border border-secondary-500 bg-white text-black hover:bg-secondary-300"
Expand All @@ -173,16 +177,19 @@ export const ConsultationCard = (props: ConsultationProps) => {
`/facility/${itemData.facility}/patient/${itemData.patient}/consultation/${itemData.id}`,
)
}
disabled={!!authuser}
>
View Consultation / Consultation Updates
</ButtonV2>
{/* )} */}
<ButtonV2
className="h-auto whitespace-pre-wrap border border-secondary-500 bg-white text-black hover:bg-secondary-300"
onClick={() =>
navigate(
`/facility/${itemData.facility}/patient/${itemData.patient}/consultation/${itemData.id}/files/`,
)
}
disabled={!!authuser}
>
View / Upload Consultation Files
</ButtonV2>
Expand Down

0 comments on commit 0bdec11

Please sign in to comment.