Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge develop to staging v24.16.0 #7677

Merged
merged 8 commits into from
Apr 21, 2024
8 changes: 4 additions & 4 deletions src/Components/Facility/DischargeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ const DischargeModal = ({
}
};

const handleFacilitySelect = (selected: FacilityModel) => {
const handleFacilitySelect = (selected?: FacilityModel) => {
setFacility(selected);
setPreDischargeForm((prev) => ({
...prev,
referred_to: selected.id ?? null,
referred_to_external: !selected.id ? selected.name : null,
referred_to: selected?.id ?? null,
referred_to_external: !selected?.id ? selected?.name : null,
}));
};

Expand Down Expand Up @@ -215,7 +215,7 @@ const DischargeModal = ({
<FacilitySelect
name="referred_to"
setSelected={(selected) =>
handleFacilitySelect(selected as FacilityModel)
handleFacilitySelect(selected as FacilityModel | undefined)
}
selected={facility ?? null}
showAll
Expand Down
41 changes: 21 additions & 20 deletions src/Components/Medicine/CreatePrescriptionForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,27 @@ export default function CreatePrescriptionForm(props: {
{...field("medicine_object", RequiredFieldValidator())}
required
/>
{props.prescription.dosage_type !== "PRN" && (
<CheckBoxFormField
label={t("titrate_dosage")}
name="Titrate Dosage"
value={field("dosage_type").value === "TITRATED"}
onChange={(e) => {
if (e.value) {
field("dosage_type").onChange({
name: "dosage_type",
value: "TITRATED",
});
} else {
field("dosage_type").onChange({
name: "dosage_type",
value: "REGULAR",
});
}
}}
/>
)}
{props.prescription.dosage_type !== "PRN" &&
props.prescription.prescription_type !== "DISCHARGE" && (
<CheckBoxFormField
label={t("titrate_dosage")}
name="Titrate Dosage"
value={field("dosage_type").value === "TITRATED"}
onChange={(e) => {
if (e.value) {
field("dosage_type").onChange({
name: "dosage_type",
value: "TITRATED",
});
} else {
field("dosage_type").onChange({
name: "dosage_type",
value: "REGULAR",
});
}
}}
/>
)}
<div className="flex flex-wrap items-center gap-x-4">
<SelectFormField
className="flex-1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ interface Props {
interval: { start: Date; end: Date };
prescription: Prescription;
refetch: () => void;
readonly?: boolean;
}

export default function AdministrationEventCell({
administrations,
interval: { start, end },
prescription,
refetch,
readonly,
}: Props) {
const [showTimeline, setShowTimeline] = useState(false);
// Check if cell belongs to an administered prescription (including start and excluding end)
Expand Down Expand Up @@ -56,6 +58,7 @@ export default function AdministrationEventCell({
prescription={prescription}
showPrescriptionDetails
onRefetch={refetch}
readonly={readonly}
/>
</DialogModal>
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ interface Props {
prescriptions: Prescription[];
pagination: ReturnType<typeof useRangePagination>;
onRefetch: () => void;
readonly: boolean;
}

export default function MedicineAdministrationTable({
readonly,
pagination,
prescriptions,
onRefetch,
Expand Down Expand Up @@ -101,6 +103,7 @@ export default function MedicineAdministrationTable({
prescription={obj}
intervals={pagination.slots!}
refetch={onRefetch}
readonly={readonly}
/>
))}
</tbody>
Expand Down
Loading
Loading