From 064dd5e9865929bc2cc4578299a9e631546b2694 Mon Sep 17 00:00:00 2001 From: Shivank Kacker Date: Wed, 19 Jun 2024 19:45:43 +0530 Subject: [PATCH] Fixed Log Update Details Page Crashing --- .../Others/DailyRound__General.res | 29 ++++++++++++------- .../types/CriticalCare__Others.res | 14 ++++----- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/src/Components/CriticalCareRecording/Others/DailyRound__General.res b/src/Components/CriticalCareRecording/Others/DailyRound__General.res index 18caeb0e597..22c5051083e 100644 --- a/src/Components/CriticalCareRecording/Others/DailyRound__General.res +++ b/src/Components/CriticalCareRecording/Others/DailyRound__General.res @@ -30,19 +30,28 @@ let symptoms = [ "CONSTIPATION", "HEAD ACHE", "BLEEDING", - "DIZZINESS" -]; + "DIZZINESS", +] @react.component let make = (~others, ~renderOptionalDescription, ~title) => { -
{title("Symptoms")}
{Js.Array.map(id => { -
- {str(symptoms[id - 1])} -
- }, Others.additional_symptoms( - others, - ))->React.array}
{renderOptionalDescription( + let additionalSymptoms = Others.additional_symptoms(others) +
+ {title("Symptoms")} +
+ {switch additionalSymptoms { + | Some(symptomsArray) => Js.Array.map(id => { +
+ {str(symptoms[id - 1])} +
+ }, symptomsArray)->React.array + | None => React.null + }} +
+ {renderOptionalDescription( "Physical Examination Info", Others.physical_examination_info(others), - )} {renderOptionalDescription("Other Details", Others.other_details(others))}
+ )} + {renderOptionalDescription("Other Details", Others.other_details(others))} +
} diff --git a/src/Components/CriticalCareRecording/types/CriticalCare__Others.res b/src/Components/CriticalCareRecording/types/CriticalCare__Others.res index 93cf8508872..21b9513eb8d 100644 --- a/src/Components/CriticalCareRecording/types/CriticalCare__Others.res +++ b/src/Components/CriticalCareRecording/types/CriticalCare__Others.res @@ -2,7 +2,7 @@ type t = { bilateral_air_entry: option, etco2: option, physical_examination_info: option, - additional_symptoms: array, + additional_symptoms: option>, other_details: option, other_symptoms: option, } @@ -21,12 +21,12 @@ let make = ( ~other_symptoms, ~other_details, ) => { - bilateral_air_entry: bilateral_air_entry, - etco2: etco2, - physical_examination_info: physical_examination_info, - other_details: other_details, - additional_symptoms: additional_symptoms, - other_symptoms: other_symptoms, + bilateral_air_entry, + etco2, + physical_examination_info, + other_details, + additional_symptoms, + other_symptoms, } let makeFromJs = dailyRound => {