Skip to content

Commit

Permalink
fix(daily_round): added recommend_discharge as action
Browse files Browse the repository at this point in the history
  • Loading branch information
aeswibon committed Apr 18, 2023
1 parent f7b6cec commit b31a104
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 23 deletions.
1 change: 1 addition & 0 deletions src/Common/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ export const TELEMEDICINE_ACTIONS = [
{ id: 60, text: "COMPLETE", desc: "Complete" },
{ id: 70, text: "REVIEW", desc: "Review" },
{ id: 80, text: "NOT_REACHABLE", desc: "Not Reachable" },
{ id: 90, text: "DISCHARGE_RECOMMENDED", desc: "Discharge Recommended" },
];

export const FRONTLINE_WORKER = [
Expand Down
18 changes: 0 additions & 18 deletions src/Components/Patient/DailyRounds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
import { statusType, useAbortableEffect } from "../../Common/utils";
import {
LegacyNativeSelectField,
LegacyCheckboxField,
LegacySelectField,
LegacyErrorHelperText,
LegacyDateTimeFiled,
Expand Down Expand Up @@ -51,7 +50,6 @@ const initForm: any = {
other_details: "",
patient_category: "Comfort",
current_health: 0,
recommend_discharge: false,
actions: null,
review_interval: 0,
admitted_to: "",
Expand Down Expand Up @@ -274,7 +272,6 @@ export const DailyRounds = (props: any) => {
physical_examination_info: state.form.physical_examination_info,
other_details: state.form.other_details,
consultation: consultationId,
recommend_discharge: JSON.parse(state.form.recommend_discharge),
action: state.form.action,
review_interval: Number(
state.form.review_interval || prevReviewInterval
Expand Down Expand Up @@ -406,13 +403,6 @@ export const DailyRounds = (props: any) => {
dispatch({ type: "set_form", form });
};

const handleCheckboxFieldChange = (e: any) => {
const form = { ...state.form };
const { checked, name } = e.target;
form[name] = checked;
dispatch({ type: "set_form", form });
};

const generateOptions = (start: any, end: any, step: any, decimals: any) => {
const len = Math.floor((end - start) / step) + 1;
return Array(len)
Expand Down Expand Up @@ -677,14 +667,6 @@ export const DailyRounds = (props: any) => {
{getExpectedReviewTime()}
</div>
</div>
<div>
<LegacyCheckboxField
checked={state.form.recommend_discharge}
onChange={handleCheckboxFieldChange}
name="recommend_discharge"
label="Recommend Discharge"
/>
</div>
</div>

{state.form.rounds_type === "NORMAL" && (
Expand Down
32 changes: 27 additions & 5 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">
{" "}
{
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
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 b31a104

Please sign in to comment.