Skip to content

Commit

Permalink
Merge pull request #7677 from coronasafe/develop
Browse files Browse the repository at this point in the history
Merge develop to staging v24.16.0
  • Loading branch information
khavinshankar authored Apr 21, 2024
2 parents 639caaa + 83f64d6 commit b1dee94
Show file tree
Hide file tree
Showing 8 changed files with 166 additions and 144 deletions.
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

0 comments on commit b1dee94

Please sign in to comment.