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

Issues/8607/review missed #9259

Closed
Closed
Changes from 9 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
21 changes: 20 additions & 1 deletion src/components/Patient/ManagePatients.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ export const PatientManager = () => {
)}
</>
)}
{patient.review_time &&
{/* {patient.review_time &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the commented out/old code.

!patient.last_consultation?.discharge_date &&
Number(patient.last_consultation?.review_interval) > 0 &&
dayjs().isAfter(patient.review_time) && (
Expand All @@ -638,7 +638,26 @@ export const PatientManager = () => {
startIcon="l-clock"
text="Review Missed"
/>
)} */}
{patient.review_time &&
!patient.last_consultation?.discharge_date &&
Number(patient.last_consultation?.review_interval) > 0 && (
<Chip
Copy link
Contributor

@Jacobjeevan Jacobjeevan Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's switch to using Shadcn's Badge here. You can port over the styles from Chip.

Edit: https://github.com/ohcnetwork/care_fe/pull/9138/files#diff-6d99361c2e374eb2dd472d6136d9d5929c8f32128cbb0b6ab8bdafea6beca6ae adds the badge; copy that over and add/adjust variant as necessary.

Copy link
Author

@Sancharisingh Sancharisingh Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok 👍

size="small"
variant={
dayjs().isAfter(patient.review_time)
? "danger"
: "alert"
}
startIcon="l-clock"
text={
dayjs().isAfter(patient.review_time)
? `Review Missed ${Math.abs(dayjs().diff(dayjs(patient.review_time), "days"))} days ago`
: `Review Due in ${Math.abs(dayjs(patient.review_time).diff(dayjs(), "days"))} days`
}
/>
)}

{patient.last_consultation?.is_readmission && (
<Chip
size="small"
Expand Down