Skip to content

Commit

Permalink
Show "ICU Admission Date" only for Internal Transfer (ohcnetwork#6729)
Browse files Browse the repository at this point in the history
* Show "ICU Admission Date" only for Internal Transfer

* fix styling
  • Loading branch information
rithviknishad authored Nov 27, 2023
1 parent a6fd9f6 commit 13fd680
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions src/Components/Facility/ConsultationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,10 @@ export const ConsultationForm = (props: any) => {
: undefined,
consultation_notes: state.form.consultation_notes,
is_telemedicine: state.form.is_telemedicine,
icu_admission_date: state.form.icu_admission_date,
icu_admission_date:
state.form.route_to_facility === 30
? state.form.icu_admission_date
: undefined,
action: state.form.action,
review_interval: state.form.review_interval,
assigned_to:
Expand Down Expand Up @@ -1195,9 +1198,7 @@ export const ConsultationForm = (props: any) => {
<div
className={classNames(
"col-span-6",
state.form.route_to_facility &&
[20, 30].includes(state.form.route_to_facility) &&
"xl:col-span-3"
state.form.route_to_facility === 30 && "xl:col-span-3"
)}
ref={fieldRef["admission_date"]}
>
Expand All @@ -1218,29 +1219,28 @@ export const ConsultationForm = (props: any) => {
</div>
)}

{state.form.route_to_facility &&
[20, 30].includes(state.form.route_to_facility) && (
<div
className={classNames(
"col-span-6",
["A", "DC"].includes(state.form.suggestion) &&
"xl:col-span-3"
)}
ref={fieldRef["icu_admission_date"]}
>
<TextFormField
{...field("icu_admission_date")}
label="Date & Time of admission to the ICU"
type="datetime-local"
value={
state.form.icu_admission_date &&
dayjs(state.form.icu_admission_date).format(
"YYYY-MM-DDTHH:mm"
)
}
/>
</div>
)}
{state.form.route_to_facility === 30 && (
<div
className={classNames(
"col-span-6",
["A", "DC"].includes(state.form.suggestion) &&
"xl:col-span-3"
)}
ref={fieldRef["icu_admission_date"]}
>
<TextFormField
{...field("icu_admission_date")}
label="Date & Time of admission to the ICU"
type="datetime-local"
value={
state.form.icu_admission_date &&
dayjs(state.form.icu_admission_date).format(
"YYYY-MM-DDTHH:mm"
)
}
/>
</div>
)}

{["A", "DC"].includes(state.form.suggestion) && !isUpdate && (
<div className="col-span-6 mb-6" ref={fieldRef["bed"]}>
Expand Down

0 comments on commit 13fd680

Please sign in to comment.