Skip to content

Commit

Permalink
fix(consultation): added action and recommend discharge tags
Browse files Browse the repository at this point in the history
  • Loading branch information
aeswibon committed Apr 17, 2023
1 parent 838d265 commit 01ecfe5
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 24 deletions.
83 changes: 59 additions & 24 deletions src/Components/Patient/PatientInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
DISCHARGE_REASONS,
PATIENT_CATEGORIES,
RESPIRATORY_SUPPORT,
TELEMEDICINE_ACTIONS,
} from "../../Common/constants";
import moment from "moment";
import ButtonV2 from "../Common/components/ButtonV2";
Expand Down Expand Up @@ -159,11 +160,32 @@ export default function PatientInfoCard(props: {
Discharged from CARE
</p>
)}
<p className="text-sm sm:text-sm text-gray-900">
<span>{patient.age} years</span>
<span className="mx-2"></span>
<span>{patient.gender}</span>
</p>
<div className="flex flex-col sm:flex-row items-center gap-2 text-sm sm:text-sm text-gray-900">
<div>
{patient.action && patient.action != 10 && (
<div className="inline-flex items-center px-3 py-1 rounded-lg text-xs leading-4 font-semibold p-1 w-full justify-start border-gray-500 border bg-blue-700">
<span className="font-semibold text-white">
Action:{" "}
{
TELEMEDICINE_ACTIONS.find(
(i) => i.id === patient.action
)?.desc
}
</span>
</div>
)}
</div>
<div>
<div className="inline-flex items-center px-3 py-1 rounded-lg text-xs leading-4 font-semibold p-1 w-full justify-start border-gray-500 border bg-gray-200">
<b>Age:</b> {patient.age} years
</div>
</div>
<div>
<div className="inline-flex items-center px-3 py-1 rounded-lg text-xs leading-4 font-semibold p-1 w-full justify-start border-gray-500 border bg-gray-200">
<b>Gender</b>: {patient.gender}
</div>
</div>
</div>
<div className="text-sm flex flex-col sm:flex-row items-center gap-2 lg:mt-4">
{[
["Blood Group", patient.blood_group, patient.blood_group],
Expand Down Expand Up @@ -199,26 +221,39 @@ export default function PatientInfoCard(props: {
);
})}
</div>
<div className="flex gap-4 text-sm mt-3 px-3 py-1 font-medium bg-cyan-300">
<div>
{
CONSULTATION_SUGGESTION.find(
(suggestion) => suggestion.id === consultation?.suggestion
)?.text
}{" "}
on{" "}
{consultation?.suggestion === "A"
? moment(consultation?.admission_date).format("DD/MM/YYYY")
: consultation?.suggestion === "DD"
? moment(consultation?.death_datetime).format("DD/MM/YYYY")
: moment(consultation?.created_date).format("DD/MM/YYYY")}
<div className="flex flex-col lg:flex-row lg:gap-2">
<div className="flex gap-4 text-sm mt-3 px-3 py-1 font-medium bg-cyan-500 text-white">
<div>
{
CONSULTATION_SUGGESTION.find(
(suggestion) => suggestion.id === consultation?.suggestion
)?.text
}{" "}
on{" "}
{consultation?.suggestion === "A"
? moment(consultation?.admission_date).format("DD/MM/YYYY")
: consultation?.suggestion === "DD"
? moment(consultation?.death_datetime).format("DD/MM/YYYY")
: moment(consultation?.created_date).format("DD/MM/YYYY")}
</div>
{patient.is_active === false &&
consultation?.suggestion !== "OP" &&
consultation?.suggestion !== "DD" && (
<div>
Discharged on{" "}
{moment(consultation?.discharge_date).format(
"DD/MM/YYYY"
)}
</div>
)}
</div>
{patient.is_active === false &&
consultation?.suggestion !== "OP" &&
consultation?.suggestion !== "DD" && (
<div>
Discharged on{" "}
{moment(consultation?.discharge_date).format("DD/MM/YYYY")}
{patient.is_active &&
patient?.last_consultation?.last_daily_round
?.recommend_discharge && (
<div className="flex gap-4 text-sm mt-3 px-3 py-1 font-medium bg-green-500">
<span className="font-semibold text-white">
Discharge Recommended
</span>
</div>
)}
</div>
Expand Down
1 change: 1 addition & 0 deletions src/Components/Patient/models.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export interface AssignedToObjectModel {
export interface PatientModel {
test_id?: string;
id?: number;
action?: number;
name?: string;
age?: number;
allow_transfer?: boolean;
Expand Down

0 comments on commit 01ecfe5

Please sign in to comment.