Skip to content

Commit

Permalink
Merge pull request #1 from Srayash/Srayash-patch-1
Browse files Browse the repository at this point in the history
Completely remove Add Consultation from Patient details.
  • Loading branch information
Srayash authored Nov 13, 2024
2 parents 974ff65 + 255e55b commit 831ed9c
Showing 1 changed file with 8 additions and 46 deletions.
54 changes: 8 additions & 46 deletions src/components/Patient/PatientHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,15 @@ export const PatientHome = (props: any) => {
!(patientData?.last_consultation?.facility === facilityId)
);
};
// Commented out as this is no longer used should I completely remove this?

const isPatientEligibleForNewConsultation = (patientData: PatientModel) => {
return patientData.is_active ? true : false;
};
// const isPatientEligibleForNewConsultation = (patientData: PatientModel) => {
// return patientData.is_active &&
// (!patientData?.last_consultation ||
// patientData?.last_consultation?.discharge_date)
// ? true
// : false;
// };

return (
<Page
Expand Down Expand Up @@ -1057,49 +1062,6 @@ export const PatientHome = (props: any) => {
<section className="mt-4 space-y-2 md:flex">
<div className="hidden lg:block">
<div className="mt-4 grid grid-cols-6 gap-5 xl:grid-cols-7">
<div
className={classNames(
"w-full rounded-lg border",
isPatientEligibleForNewConsultation(patientData)
? "cursor-pointer border-green-700 hover:bg-primary-400"
: "hidden border-secondary-700 text-secondary-700 hover:cursor-not-allowed",
)}
onClick={() =>
isPatientEligibleForNewConsultation(patientData) &&
navigate(
`/facility/${patientData?.facility}/patient/${id}/consultation`,
)
}
>
<div
className={classNames(
"h-full space-y-2 rounded-lg bg-white p-4 shadow",
isPatientEligibleForNewConsultation(patientData) &&
"hover:bg-secondary-200",
)}
>
<div
className={classNames(
"text-center",
isPatientEligibleForNewConsultation(patientData) &&
"text-green-700",
)}
>
<span>
<CareIcon
icon="l-chat-bubble-user"
className="text-5xl"
/>
</span>
</div>

<div>
<p className="text-center text-sm font-medium">
Add Consultation
</p>
</div>
</div>
</div>
<div
className="w-full"
onClick={() => navigate(`/patient/${id}/investigation_reports`)}
Expand Down

0 comments on commit 831ed9c

Please sign in to comment.