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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve investigations when consultation form is updated #5928

Merged
merged 2 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export default function InvestigationBuilder(
</div>
) : (
<div className="w-full">
<div className="mb-1">Time</div>
Time<span className="text-danger-500">{" *"}</span>
<input
type="datetime-local"
className="block w-[calc(100%-5px)] rounded border border-gray-400 bg-gray-100 px-4 py-2 text-sm hover:bg-gray-200 focus:border-primary-500 focus:bg-white focus:outline-none focus:ring-primary-500"
Expand Down
8 changes: 7 additions & 1 deletion src/Components/Facility/ConsultationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ export const ConsultationForm = (props: any) => {
cause_of_death: res.data?.discharge_notes || "",
death_datetime: res.data?.death_datetime || "",
death_confirmed_doctor: res.data?.death_confirmed_doctor || "",
InvestigationAdvice: res.data.investigation,
};
dispatch({ type: "set_form", form: formData });
setBed(formData.bed);
Expand Down Expand Up @@ -489,7 +490,12 @@ export const ConsultationForm = (props: any) => {
break;
}
if (i.repetitive && !i.frequency?.replace(/\s/g, "").length) {
errors[field] = "Frequency field can not be empty";
errors[field] = "Frequency field cannot be empty";
invalidForm = true;
break;
}
if (!i.repetitive && !i.time?.replace(/\s/g, "").length) {
errors[field] = "Time field cannot be empty";
invalidForm = true;
break;
}
Expand Down
Loading