Skip to content

Commit

Permalink
Merge branch 'develop' into discharge-reason-integer
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 authored Dec 20, 2023
2 parents 77b8fd1 + b4a7fbd commit ac89007
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ let make = (~id, ~facilityId, ~patientId, ~consultationId, ~dailyRound) => {
<button
onClick={_ =>
Notifications.success({msg: "Critical care log updates are filed successfully"})}
className="btn btn-primary w-full mt-6">
className="btn btn-primary w-full mt-6"
disabled={Js.Array.length(state.updatedEditors) === 0}
>
{str("Complete")}
</button>
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ const DefaultLogUpdateCard = ({ round, ...props }: Props) => {
attributeValue={getName(round.last_edited_by)}
/>
)}
<LogUpdateCardAttribute
attributeKey={"Round Type" as any}
attributeValue={t(round.rounds_type)}
/>
<LogUpdateCardAttribute
attributeKey="patient_category"
attributeValue={round.patient_category}
Expand Down
9 changes: 5 additions & 4 deletions src/Components/Facility/Consultations/DailyRoundsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ export default function DailyRoundsList({ consultation }: Props) {
);
}

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

return (
<DefaultLogUpdateCard
Expand Down
20 changes: 13 additions & 7 deletions src/Components/Patient/DailyRounds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export const DailyRounds = (props: any) => {
const [isLoading, setIsLoading] = useState(false);
const [facilityName, setFacilityName] = useState("");
const [patientName, setPatientName] = useState("");
const [consultationSuggestion, setConsultationSuggestion] = useState<any>("");
const [prevReviewInterval, setPreviousReviewInterval] = useState(-1);
const [prevAction, setPreviousAction] = useState("NO_ACTION");
const [hasPreviousLog, setHasPreviousLog] = useState(false);
Expand Down Expand Up @@ -137,6 +138,7 @@ export const DailyRounds = (props: any) => {
if (res.data) {
setPatientName(res.data.name);
setFacilityName(res.data.facility_object.name);
setConsultationSuggestion(res.data.last_consultation?.suggestion);
setPreviousReviewInterval(
Number(res.data.last_consultation.review_interval)
);
Expand Down Expand Up @@ -250,7 +252,6 @@ export const DailyRounds = (props: any) => {
invalidForm = true;
}
return;

default:
return;
}
Expand Down Expand Up @@ -292,7 +293,7 @@ export const DailyRounds = (props: any) => {
action: prevAction,
review_interval: Number(prevReviewInterval),
};
if (state.form.rounds_type === "NORMAL") {
if (["NORMAL", "TELEMEDICINE"].includes(state.form.rounds_type)) {
data = {
...data,
bp:
Expand Down Expand Up @@ -334,7 +335,7 @@ export const DailyRounds = (props: any) => {
Notification.Success({
msg: "Consultation Updates details updated successfully",
});
if (state.form.rounds_type === "NORMAL") {
if (["NORMAL", "TELEMEDICINE"].includes(state.form.rounds_type)) {
navigate(
`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`
);
Expand All @@ -347,7 +348,7 @@ export const DailyRounds = (props: any) => {
Notification.Success({
msg: "Consultation Updates details created successfully",
});
if (state.form.rounds_type === "NORMAL") {
if (["NORMAL", "TELEMEDICINE"].includes(state.form.rounds_type)) {
if (data.clone_last) {
navigate(
`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/daily-rounds/${res.data.external_id}/update`
Expand Down Expand Up @@ -450,8 +451,13 @@ export const DailyRounds = (props: any) => {
className="w-full"
label="Round Type"
options={[
{ id: "NORMAL", text: "Normal" },
{ id: "VENTILATOR", text: "Critical Care" },
...[
{ id: "NORMAL", text: "Normal" },
{ id: "VENTILATOR", text: "Critical Care" },
],
...(consultationSuggestion == "DC"
? [{ id: "TELEMEDICINE", text: "Telemedicine" }]
: []),
]}
optionLabel={(option) => option.text}
optionValue={(option) => option.id}
Expand Down Expand Up @@ -529,7 +535,7 @@ export const DailyRounds = (props: any) => {
}}
/>

{state.form.rounds_type === "NORMAL" && (
{["NORMAL", "TELEMEDICINE"].includes(state.form.rounds_type) && (
<>
<h3 className="mb-6 md:col-span-2">Vitals</h3>

Expand Down
7 changes: 6 additions & 1 deletion src/Components/Patient/models.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,12 @@ export interface DailyRoundsOutput {
quantity: number;
}

export const DailyRoundTypes = ["NORMAL", "VENTILATOR", "AUTOMATED"] as const;
export const DailyRoundTypes = [
"NORMAL",
"VENTILATOR",
"AUTOMATED",
"TELEMEDICINE",
] as const;

export interface DailyRoundsModel {
ventilator_spo2?: number;
Expand Down
3 changes: 2 additions & 1 deletion src/Locale/en/Consultation.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
"generated_summary_caution": "This is a computer generated summary using the information captured in the CARE system.",
"NORMAL": "Normal",
"VENTILATOR": "Critical Care",
"AUTOMATED": "Automated"
"AUTOMATED": "Automated",
"TELEMEDICINE": "Telemedicine"
}

0 comments on commit ac89007

Please sign in to comment.