Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed May 6, 2024
1 parent 2d6acb8 commit 75ec496
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/Components/Patient/DailyRounds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import request from "../../Utils/request/request";
import routes from "../../Redux/api";
import { Scribe } from "../Scribe/Scribe";
import { DAILY_ROUND_FORM_SCRIBE_DATA } from "../Scribe/formDetails";
import { DailyRoundsModel } from "./models";
const Loading = lazy(() => import("../Common/Loading"));

const initForm: any = {
Expand Down Expand Up @@ -230,14 +231,42 @@ export const DailyRounds = (props: any) => {
const validForm = validateForm();
if (validForm) {
setIsLoading(true);
const data = {
let data: DailyRoundsModel = {
rounds_type: state.form.rounds_type,
patient_category: state.form.patient_category,
taken_at: state.form.taken_at
? state.form.taken_at
: new Date().toISOString(),

additional_symptoms: state.form.additional_symptoms,
other_symptoms: state.form.additional_symptoms?.includes(9)
? state.form.other_symptoms
: undefined,
admitted_to:
(state.form.admitted === "Select"
? undefined
: state.form.admitted_to) || undefined,
physical_examination_info: state.form.physical_examination_info,
other_details: state.form.other_details,
consultation: consultationId,
action: prevAction,
review_interval: Number(prevReviewInterval),
};

if (["NORMAL", "TELEMEDICINE"].includes(state.form.rounds_type)) {
data = {
...data,
bp: state.form.bp ?? {},
pulse: state.form.pulse ?? null,
resp: state.form.resp ?? null,
temperature: state.form.temperature ?? null,
rhythm: state.form.rhythm || 0,
rhythm_detail: state.form.rhythm_detail,
ventilator_spo2: state.form.ventilator_spo2 ?? null,
consciousness_level: state.form.consciousness_level,
};
}

if (id) {
const { data: obj } = await request(routes.updateDailyReport, {
body: data,
Expand Down
2 changes: 2 additions & 0 deletions src/Components/Patient/models.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ export interface DailyRoundsModel {
additional_symptoms?: Array<number>;
medication_given?: Array<any>;
additional_symptoms_text?: string;
action?: string;
review_interval?: number;
current_health?: string;
id?: string;
other_symptoms?: string;
Expand Down

0 comments on commit 75ec496

Please sign in to comment.