Skip to content

Commit

Permalink
Fix investigation builder crash (#6755)
Browse files Browse the repository at this point in the history
* Fix investigation advice assignment in
ConsultationForm

* allow category selection if null
  • Loading branch information
Ashesh3 authored Dec 13, 2023
1 parent bd1f144 commit 70127e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Components/Facility/ConsultationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,9 @@ 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,
InvestigationAdvice: Array.isArray(res.data.investigation)
? res.data.investigation
: [],
diagnoses: res.data.diagnoses.sort(
(a: ConsultationDiagnosis, b: ConsultationDiagnosis) =>
ConditionVerificationStatuses.indexOf(a.verification_status) -
Expand All @@ -410,7 +412,7 @@ export const ConsultationForm = (props: any) => {
dispatch({ type: "set_form", form: { ...state.form, ...formData } });
setBed(formData.bed);

if (res.data.last_daily_round) {
if (res.data.last_daily_round && state.form.category) {
setDisabledFields((fields) => [...fields, "category"]);
}
} else {
Expand Down

0 comments on commit 70127e0

Please sign in to comment.