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

Add Telemedicine as a rounds type option #6831

Merged
merged 5 commits into from
Dec 20, 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 @@ -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"
}
Loading