Skip to content

Commit

Permalink
Fixes #6684; Adds IP Days chip for admission encounters (#7735)
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed May 7, 2024
1 parent 3e2ebab commit 86fb1d4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Components/Patient/ManagePatients.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,16 @@ export const PatientManager = () => {
text="Readmission"
/>
)}
{patient.last_consultation?.suggestion === "A" &&
patient.last_consultation.facility === patient.facility &&
!patient.last_consultation.discharge_date && (
<Chip
size="small"
variant="primary"
startIcon="l-clock-three"
text={`IP Days: ${dayjs().diff(patient.last_consultation.encounter_date, "day")}`}
/>
)}
{patient.disease_status === "POSITIVE" && (
<Chip
size="small"
Expand Down
21 changes: 21 additions & 0 deletions src/Components/Patient/PatientInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,27 @@ export default function PatientInfoCard(props: {
className="col-span-2 flex w-full flex-col items-center justify-center gap-2 px-4 py-1 lg:col-span-1 2xl:flex-row"
id="consultation-buttons"
>
{consultation?.suggestion === "A" && (
<div className="flex flex-col items-center">
<div className="col-span-1 flex w-full justify-center bg-white px-4 lg:flex-row">
<div
className={
"flex h-7 w-7 items-center justify-center rounded-full border-2"
}
>
<span className="text-sm font-semibold">
{dayjs(consultation.discharge_date || undefined).diff(
consultation.encounter_date,
"day",
)}
</span>
</div>
</div>
<span className="mt-1 text-xs font-medium text-gray-700">
IP Days
</span>
</div>
)}
{consultation?.last_daily_round && (
<div className="col-span-1 flex w-full justify-center bg-white px-4 lg:flex-row">
<Mews dailyRound={consultation?.last_daily_round} />
Expand Down

0 comments on commit 86fb1d4

Please sign in to comment.