Skip to content

Commit

Permalink
show on all bed types
Browse files Browse the repository at this point in the history
  • Loading branch information
shivankacker committed Jul 3, 2024
1 parent d6a87bc commit 52f3a69
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 23 deletions.
5 changes: 0 additions & 5 deletions src/Components/Facility/ConsultationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1295,11 +1295,6 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => {
</p>
)
}
hideDescription={
(Array.isArray(bed)
? bed[0].bed_type
: bed?.bed_type) !== "ICU"
}
required
label="Category"
{...field("category")}
Expand Down
6 changes: 0 additions & 6 deletions src/Components/Patient/DailyRounds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ export const DailyRounds = (props: any) => {
const [isLoading, setIsLoading] = useState(false);
const [facilityName, setFacilityName] = useState("");
const [patientName, setPatientName] = useState("");
const [bedType, setBedType] = useState<string>("");
const [consultationSuggestion, setConsultationSuggestion] = useState<any>("");
const [prevReviewInterval, setPreviousReviewInterval] = useState(-1);
const [prevAction, setPreviousAction] = useState("NO_ACTION");
Expand Down Expand Up @@ -181,9 +180,6 @@ export const DailyRounds = (props: any) => {
if (data) {
setPatientName(data.name!);
setFacilityName(data.facility_object!.name);
setBedType(
data.last_consultation?.current_bed?.bed_object?.bed_type || "",
);
setConsultationSuggestion(data.last_consultation?.suggestion);
setDiagnoses(
data.last_consultation?.diagnoses?.sort(
Expand All @@ -210,7 +206,6 @@ export const DailyRounds = (props: any) => {
};
}
} else {
setBedType("");
setPatientName("");
setFacilityName("");
}
Expand Down Expand Up @@ -522,7 +517,6 @@ export const DailyRounds = (props: any) => {
<div className="w-full md:w-1/3">
<PatientCategorySelect
{...field("patient_category")}
hideDescription={bedType !== "ICU"}
required
label="Category"
/>
Expand Down
6 changes: 2 additions & 4 deletions src/Components/Patient/PatientCategorySelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { FormFieldBaseProps } from "../Form/FormFields/Utils";
* field.
*/
export default function PatientCategorySelect(
props: FormFieldBaseProps<PatientCategoryID> & { hideDescription?: boolean },
props: FormFieldBaseProps<PatientCategoryID>,
) {
return (
<SelectFormField
Expand All @@ -17,9 +17,7 @@ export default function PatientCategorySelect(
options={PATIENT_CATEGORIES}
optionValue={(option) => option.id}
optionLabel={(option) => option.text}
optionDescription={
props.hideDescription ? undefined : (option) => option.description
}
optionDescription={(option) => option.description}
optionSelectedLabel={(option) => (
<span className="flex items-center gap-3">
<div
Expand Down
5 changes: 0 additions & 5 deletions src/Components/Patient/ShiftCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export const ShiftCreate = (props: patientShiftProps) => {
const { facilityId, patientId } = props;
const [isLoading, setIsLoading] = useState(false);
const [patientCategory, setPatientCategory] = useState<any>();
const [bedType, setBedType] = useState("");
const { t } = useTranslation();
const { wartime_shifting } = useConfig();

Expand Down Expand Up @@ -121,9 +120,6 @@ export const ShiftCreate = (props: patientShiftProps) => {
setPatientCategory(
PATIENT_CATEGORIES.find((c) => c.text === patient_category)?.id,
);
setBedType(
data.last_consultation?.current_bed?.bed_object.bed_type || "",
);
}
},
});
Expand Down Expand Up @@ -335,7 +331,6 @@ export const ShiftCreate = (props: patientShiftProps) => {
<PatientCategorySelect
required={true}
{...field("patient_category")}
hideDescription={bedType !== "ICU"}
value={patientCategory}
onChange={(e) => setPatientCategory(e.value)}
label="Patient Category"
Expand Down
3 changes: 0 additions & 3 deletions src/Components/Shifting/ShiftDetailsUpdate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,6 @@ export const ShiftDetailsUpdate = (props: patientShiftProps) => {
required={true}
name="patient_category"
value={state.form.patient_category}
hideDescription={
consultationData.current_bed?.bed_object.bed_type !== "ICU"
}
onChange={handleFormFieldChange}
label="Patient Category"
className="md:col-span-2"
Expand Down

0 comments on commit 52f3a69

Please sign in to comment.