diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index 3477f3203cb..c14457d529d 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -26,9 +26,8 @@ import BloodPressureFormField, { } from "../Common/BloodPressureFormField"; import { SymptomsSelect } from "../Common/SymptomsSelect"; import TemperatureFormField from "../Common/TemperatureFormField"; -import { Cancel, Submit } from "../Common/components/ButtonV2"; +import ButtonV2, { Cancel, Submit } from "../Common/components/ButtonV2"; import Page from "../Common/components/Page"; -import CheckBoxFormField from "../Form/FormFields/CheckBoxFormField"; import RangeAutocompleteFormField from "../Form/FormFields/RangeAutocompleteFormField"; import { SelectFormField } from "../Form/FormFields/SelectFormField"; import TextAreaFormField from "../Form/FormFields/TextAreaFormField"; @@ -49,7 +48,7 @@ const initForm: any = { admitted_to: "", taken_at: null, rounds_type: "NORMAL", - clone_last: null, + clone_last: false, systolic: null, diastolic: null, pulse: null, @@ -192,7 +191,7 @@ export const DailyRounds = (props: any) => { RHYTHM_CHOICES.find((i) => i.text === res.data.rhythm)?.id) || "0", temperature: parseFloat(res.data.temperature), - clone_last: res.data.count > 0 ? true : false, + clone_last: false, }, }); } @@ -451,17 +450,25 @@ export const DailyRounds = (props: any) => { {!id && hasPreviousLog && ( - + { + e.preventDefault(); + dispatch({ + type: "set_form", + form: { ...state.form, clone_last: true }, + }); + }} + > + Copy values from previous log + )} - {state.form.clone_last === true && ( + {state.form.clone_last && (

Field values will be copied from previous log update

)} - {(state.form.clone_last === false || id) && ( + {!state.form.clone_last && (