Skip to content

Commit

Permalink
Refactor DailyRoundsList and DailyRounds to handle TELEMEDICINE round…
Browse files Browse the repository at this point in the history
…s type
  • Loading branch information
Ashesh3 committed Dec 13, 2023
1 parent dbbe0a6 commit 4897874
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
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
8 changes: 4 additions & 4 deletions src/Components/Patient/DailyRounds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export const DailyRounds = (props: any) => {
case "resp":
if (
state.form.resp === null &&
state.form.rounds_type === "NORMAL" &&
["NORMAL", "TELEMEDICINE"].includes(state.form.rounds_type) &&
state.form.clone_last !== true
) {
errors[field] = "Please enter a respiratory rate";
Expand Down Expand Up @@ -278,7 +278,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 @@ -320,7 +320,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 @@ -333,7 +333,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

0 comments on commit 4897874

Please sign in to comment.