From b31a1046f1a0e017eed6eb942a4155a3f1482ebd Mon Sep 17 00:00:00 2001 From: cp-Coder Date: Tue, 18 Apr 2023 16:57:25 +0530 Subject: [PATCH] fix(daily_round): added recommend_discharge as action --- src/Common/constants.tsx | 1 + src/Components/Patient/DailyRounds.tsx | 18 ------------ src/Components/Patient/PatientInfoCard.tsx | 32 ++++++++++++++++++---- src/Components/Patient/models.tsx | 1 + 4 files changed, 29 insertions(+), 23 deletions(-) diff --git a/src/Common/constants.tsx b/src/Common/constants.tsx index d004f562023..20d915808ff 100644 --- a/src/Common/constants.tsx +++ b/src/Common/constants.tsx @@ -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 = [ diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index ad786186b25..60af0080187 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -20,7 +20,6 @@ import { import { statusType, useAbortableEffect } from "../../Common/utils"; import { LegacyNativeSelectField, - LegacyCheckboxField, LegacySelectField, LegacyErrorHelperText, LegacyDateTimeFiled, @@ -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: "", @@ -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 @@ -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) @@ -677,14 +667,6 @@ export const DailyRounds = (props: any) => { {getExpectedReviewTime()} -
- -
{state.form.rounds_type === "NORMAL" && ( diff --git a/src/Components/Patient/PatientInfoCard.tsx b/src/Components/Patient/PatientInfoCard.tsx index f1e5b95a114..803846913de 100644 --- a/src/Components/Patient/PatientInfoCard.tsx +++ b/src/Components/Patient/PatientInfoCard.tsx @@ -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"; @@ -159,11 +160,32 @@ export default function PatientInfoCard(props: { Discharged from CARE

)} -

- {patient.age} years - - {patient.gender} -

+
+
+ {patient.action && patient.action != 10 && ( +
+ + {" "} + { + TELEMEDICINE_ACTIONS.find( + (i) => i.id === patient.action + )?.desc + } + +
+ )} +
+
+
+ Age: {patient.age} years +
+
+
+
+ Gender: {patient.gender} +
+
+
{[ ["Blood Group", patient.blood_group, patient.blood_group], diff --git a/src/Components/Patient/models.tsx b/src/Components/Patient/models.tsx index 3da59b9ba4a..c32e5780678 100644 --- a/src/Components/Patient/models.tsx +++ b/src/Components/Patient/models.tsx @@ -26,6 +26,7 @@ export interface AssignedToObjectModel { export interface PatientModel { test_id?: string; id?: number; + action?: number; name?: string; age?: number; allow_transfer?: boolean;