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

Fixed Log Update Details Page Crashing #8056

Merged
merged 9 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -30,19 +30,28 @@ let symptoms = [
"CONSTIPATION",
"HEAD ACHE",
"BLEEDING",
"DIZZINESS"
];
"DIZZINESS",
]

@react.component
let make = (~others, ~renderOptionalDescription, ~title) => {
<div> {title("Symptoms")} <div className=" flex flex-wrap max-w-full"> {Js.Array.map(id => {
<div className="rounded-full px-4 py-2 bg-gray-400 m-1 text-sm">
{str(symptoms[id - 1])}
</div>
}, Others.additional_symptoms(
others,
))->React.array} </div> {renderOptionalDescription(
let additionalSymptoms = Others.additional_symptoms(others)
<div>
{title("Symptoms")}
<div className="flex flex-wrap max-w-full">
{switch additionalSymptoms {
| Some(symptomsArray) => Js.Array.map(id => {
<div className="rounded-full px-4 py-2 bg-gray-400 m-1 text-sm">
{str(symptoms[id - 1])}
</div>
}, symptomsArray)->React.array
| None => React.null
}}
</div>
{renderOptionalDescription(
"Physical Examination Info",
Others.physical_examination_info(others),
)} {renderOptionalDescription("Other Details", Others.other_details(others))} </div>
)}
{renderOptionalDescription("Other Details", Others.other_details(others))}
</div>
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ type t = {
bilateral_air_entry: option<bool>,
etco2: option<int>,
physical_examination_info: option<string>,
additional_symptoms: array<int>,
additional_symptoms: option<array<int>>,
other_details: option<string>,
other_symptoms: option<string>,
}
Expand All @@ -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 => {
Expand Down
8 changes: 5 additions & 3 deletions src/Components/Facility/Consultations/DailyRoundsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ export default function DailyRoundsList({ consultation }: Props) {
);
}

const itemUrl = ["NORMAL", "TELEMEDICINE"].includes(
item.rounds_type as string,
)
const itemUrl = [
"NORMAL",
"TELEMEDICINE",
"DOCTORS_LOG",
].includes(item.rounds_type as string)
? `${consultationUrl}/daily-rounds/${item.id}`
: `${consultationUrl}/daily_rounds/${item.id}`;

Expand Down
6 changes: 5 additions & 1 deletion src/Components/Patient/DailyRounds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,11 @@ export const DailyRounds = (props: any) => {
Notification.Success({
msg: `${obj.rounds_type === "VENTILATOR" ? "Critical Care" : capitalize(obj.rounds_type)} log update details updated successfully`,
});
if (["NORMAL", "TELEMEDICINE"].includes(state.form.rounds_type)) {
if (
["NORMAL", "TELEMEDICINE", "DOCTORS_LOG"].includes(
state.form.rounds_type,
)
) {
navigate(
`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`,
);
Expand Down
Loading