From 2a607da9381ca545873983a8b91041fb5626d645 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Mon, 28 Oct 2024 20:46:32 +0530 Subject: [PATCH 01/30] referral letter desktop --- src/components/Shifting/ShiftDetails.tsx | 317 ++++++++++------------- 1 file changed, 139 insertions(+), 178 deletions(-) diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index 6698b37beb9..598ff3065cb 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -5,6 +5,10 @@ import { SHIFTING_CHOICES_PEACETIME, SHIFTING_CHOICES_WARTIME, } from "@/common/constants"; +import PrintPreview from "@/CAREUI/misc/PrintPreview"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; + +import { Separator } from "@/components/ui/separator"; import { Link, navigate } from "raviger"; import { useState } from "react"; import ButtonV2 from "@/components/Common/components/ButtonV2"; @@ -12,7 +16,7 @@ import CommentSection from "./CommentsSection"; import ConfirmDialog from "@/components/Common/ConfirmDialog"; import { CopyToClipboard } from "react-copy-to-clipboard"; import Page from "@/components/Common/components/Page"; -import QRCode from "qrcode.react"; +import { QRCodeSVG } from "qrcode.react"; import RecordMeta from "../../CAREUI/display/RecordMeta"; import { formatDateTime, @@ -299,182 +303,126 @@ export default function ShiftDetails(props: { id: string }) { )?.text; return ( -
-
- {data.is_kasp && logo} -
-
-
- - {t("name_of_hospital")}:{" "} - - {data.is_kasp - ? t("district_program_management_supporting_unit") - : data.origin_facility_object?.name || "--"} - {/* Made static based on #757 */} -
-
- {t("referral_letter")} -
-
- - {" "} - {t("date_and_time")}{" "} - - {formatDateTime(data.created_date) || "--"} -
-
- - {" "} - {t("unique_id")} : - - {data.id} -
- -
-
- - {t("name")}:{" "} - - {patientData?.name} -
-
-
-
- - {t("age")}:{" "} - - {patientData ? formatPatientAge(patientData, true) : ""} -
-
- - {t("gender")}:{" "} - - {patientGender} -
-
- - {t("phone")}:{" "} - - {patientData?.phone_number || ""} -
-
-
- - {t("address")}:{" "} - -
-
- {patientData?.address || "-"} + + + + + {t("referral_letter")} + + + +
+
+ {data.is_kasp && ( + logo + )} +
- {patientData?.nationality === "India" && ( - <> -
- {patientData?.ward_object?.name}, - {patientData?.local_body_object?.name} -
-
{patientData?.district_object?.name || "-"}
-
{patientData?.state_object?.name}
- - )} -
-
-
-
- - {t("date_of_admission")}:{" "} - - {formatDateTime( - consultation.encounter_date || consultation.created_date, - ) || "-"} -
-
- - {t("patient_no")}:{" "} - - {consultation.patient_no || "-"} -
-
-
-
- - {t("date_of_positive_covid_19_swab")}:{" "} - - {(patientData?.date_of_test && - formatDateTime(patientData?.date_of_test)) || - "-"} -
-
- - {/*
-
- - {t("diagnosis")}:{" "} - - {consultation.diagnosis || "-"} -
-
*/} - -
-
- - {t("covid_19_cat_gov")}{" "} - - {consultation.category || "-"} -
-
- -
-
- - {t("referred_to")}:{" "} - - {data.assigned_facility_external || - data.assigned_facility_object?.name || - "--"} -
-
- -
-
- - {t("reason_for_referral")}:{" "} - - {data.reason || "--"} -
-
-
-
- - {t("treatment_summary")}:{" "} - - {consultation.treatment_plan || "-"} -
-
-
-
-
-
- + {/*
+{t("referral_letter")} +
*/} +
+ {t("name_of_hospital")}: + {data.is_kasp + ? t("district_program_management_supporting_unit") + : data.origin_facility_object?.name || "--"} +
+ +
+
+

+ Patient Information +

+

+ {t("name")}: {patientData?.name} +

+

+ {t("age")}: {formatPatientAge(patientData, true)} +

+

+ {t("gender")}: {patientGender || "-"} +

+

+ {t("phone")}: {patientData?.phone_number || "-"} +

+
+
+

+ {t("address")} +

+

+ {patientData?.address || "-"} +

+ {patientData?.nationality === "India" && ( + <> +

+ {patientData?.ward_object?.name},{" "} + {patientData?.local_body_object?.name} +

+

{patientData?.district_object?.name || "-"}

+

{patientData?.state_object?.name}

+ + )}
-
-
- + +
+
+

+ {t("date_of_admission")}:{" "} + {formatDateTime( + consultation.encounter_date || consultation.created_date, + ) || "-"} +

+

+ {t("unique_id")}: {data.id} +

+

+ {t("patient_no")}: {consultation.patient_no || "-"} +

+
+
+

+ {t("date_of_positive_covid_19_swab")}:{" "} + {(patientData?.date_of_test && + formatDateTime(patientData.date_of_test)) || + "-"} +

+

+ {t("covid_19_cat_gov")}: {consultation.category || "-"} +

+

+ {t("referred_to")}:{" "} + {data.assigned_facility_external || + data.assigned_facility_object?.name || + "--"} +

+

+ {t("reason_for_referral")}: {data.reason || "--"} +

+

+ {t("treatment_summary")}:{" "} + {consultation.treatment_plan || "-"} +

+
+
+ +
{t("approved_by_district_covid_control_room")} - +
+
+ {t("auto_generated_for_care")} +
-
-
- {t("auto_generated_for_care")} -
-
- {window.location.origin}/shifting/{data.id} -
-
-
+ + + ); }; @@ -482,15 +430,28 @@ export default function ShiftDetails(props: { id: string }) { return ; } + //
+ //
+ // {/* window.print()}> + // {" "} + // {t("print_referral_letter")} + // */} + // setIsPrintMode(false)} + // variant="secondary" + // > + // {" "} + // {t("close")} + // + //
+ // {printData(data)} + //
+ return (
{isPrintMode ? (
-
- window.print()}> - {" "} - {t("print_referral_letter")} - +
setIsPrintMode(false)} variant="secondary" @@ -506,7 +467,7 @@ export default function ShiftDetails(props: { id: string }) { title={t("shifting_details")} backUrl="/shifting/board" options={ -
+
Date: Mon, 28 Oct 2024 20:53:51 +0530 Subject: [PATCH 02/30] Shadcn components added --- src/components/ui/card.tsx | 83 +++++++++++++++++++++++++++++++++ src/components/ui/separator.tsx | 29 ++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 src/components/ui/card.tsx create mode 100644 src/components/ui/separator.tsx diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx new file mode 100644 index 00000000000..5bd1b4bfdf4 --- /dev/null +++ b/src/components/ui/card.tsx @@ -0,0 +1,83 @@ +import * as React from "react"; + +import { cn } from "@/lib/utils"; + +const Card = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)); +Card.displayName = "Card"; + +const CardHeader = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)); +CardHeader.displayName = "CardHeader"; + +const CardTitle = React.forwardRef< + HTMLParagraphElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +

+)); +CardTitle.displayName = "CardTitle"; + +const CardDescription = React.forwardRef< + HTMLParagraphElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +

+)); +CardDescription.displayName = "CardDescription"; + +const CardContent = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +

+)); +CardContent.displayName = "CardContent"; + +const CardFooter = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)); +CardFooter.displayName = "CardFooter"; + +export { + Card, + CardHeader, + CardFooter, + CardTitle, + CardDescription, + CardContent, +}; diff --git a/src/components/ui/separator.tsx b/src/components/ui/separator.tsx new file mode 100644 index 00000000000..ce13d0b7f75 --- /dev/null +++ b/src/components/ui/separator.tsx @@ -0,0 +1,29 @@ +import * as React from "react"; +import * as SeparatorPrimitive from "@radix-ui/react-separator"; + +import { cn } from "@/lib/utils"; + +const Separator = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>( + ( + { className, orientation = "horizontal", decorative = true, ...props }, + ref, + ) => ( + + ), +); +Separator.displayName = SeparatorPrimitive.Root.displayName; + +export { Separator }; From 30ab1319826e4599655b481186d49b058e92ca51 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Mon, 28 Oct 2024 21:03:50 +0530 Subject: [PATCH 03/30] separator commanded to resolve deploy issue --- src/components/Shifting/ShiftDetails.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index 598ff3065cb..4cbeeb7be7c 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -8,7 +8,7 @@ import { import PrintPreview from "@/CAREUI/misc/PrintPreview"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; -import { Separator } from "@/components/ui/separator"; +// import { Separator } from "@/components/ui/separator"; import { Link, navigate } from "raviger"; import { useState } from "react"; import ButtonV2 from "@/components/Common/components/ButtonV2"; From 942fa6eb274dbd3c9a7adc9221700b6a218ac759 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Mon, 28 Oct 2024 21:13:33 +0530 Subject: [PATCH 04/30] Separator import path changed --- src/components/Shifting/ShiftDetails.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index 4cbeeb7be7c..0886287ef50 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -9,6 +9,7 @@ import PrintPreview from "@/CAREUI/misc/PrintPreview"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; // import { Separator } from "@/components/ui/separator"; +import { Separator } from "../ui/separator"; import { Link, navigate } from "raviger"; import { useState } from "react"; import ButtonV2 from "@/components/Common/components/ButtonV2"; From c090150559d3990780a0c3b6a0fe8314a4a65586 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Mon, 28 Oct 2024 21:23:00 +0530 Subject: [PATCH 05/30] import @radix-ui/react-separator from /opt/build/repo/src/components/ui/separator.tsx. to resolve deploy issue --- src/components/Shifting/ShiftDetails.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index 0886287ef50..efc32a9c012 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -9,7 +9,7 @@ import PrintPreview from "@/CAREUI/misc/PrintPreview"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; // import { Separator } from "@/components/ui/separator"; -import { Separator } from "../ui/separator"; +import { Separator } from "@radix-ui/react-separator"; import { Link, navigate } from "raviger"; import { useState } from "react"; import ButtonV2 from "@/components/Common/components/ButtonV2"; From bc0dab27c4ecc4c91ad0fb4b6f20a8585c6f5fa3 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Mon, 28 Oct 2024 21:27:31 +0530 Subject: [PATCH 06/30] again shadcn component added --- src/components/Shifting/ShiftDetails.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index efc32a9c012..598ff3065cb 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -8,8 +8,7 @@ import { import PrintPreview from "@/CAREUI/misc/PrintPreview"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; -// import { Separator } from "@/components/ui/separator"; -import { Separator } from "@radix-ui/react-separator"; +import { Separator } from "@/components/ui/separator"; import { Link, navigate } from "raviger"; import { useState } from "react"; import ButtonV2 from "@/components/Common/components/ButtonV2"; From 32711fa9f52a1154e243f7bacb321eadd0a17ddd Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Tue, 29 Oct 2024 05:52:50 +0530 Subject: [PATCH 07/30] updated --- src/components/Shifting/ShiftDetails.tsx | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index 598ff3065cb..b7fce98381b 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -324,9 +324,6 @@ export default function ShiftDetails(props: { id: string }) { size={120} />
- {/*
-{t("referral_letter")} -
*/}
{t("name_of_hospital")}: {data.is_kasp @@ -430,23 +427,6 @@ export default function ShiftDetails(props: { id: string }) { return ; } - //
- //
- // {/* window.print()}> - // {" "} - // {t("print_referral_letter")} - // */} - // setIsPrintMode(false)} - // variant="secondary" - // > - // {" "} - // {t("close")} - // - //
- // {printData(data)} - //
- return (
{isPrintMode ? ( From 436b199caee2cc68ccccdfb8d6d378b9c4586567 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Tue, 29 Oct 2024 06:18:56 +0530 Subject: [PATCH 08/30] changed --- src/components/Shifting/ShiftDetails.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index b7fce98381b..0691754ebbc 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -8,7 +8,7 @@ import { import PrintPreview from "@/CAREUI/misc/PrintPreview"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; -import { Separator } from "@/components/ui/separator"; +import { Separator } from "../../components/ui/separator"; import { Link, navigate } from "raviger"; import { useState } from "react"; import ButtonV2 from "@/components/Common/components/ButtonV2"; From 8d2d0f475054dff7ded9bc792765119ea1e64d70 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Tue, 29 Oct 2024 06:25:01 +0530 Subject: [PATCH 09/30] separator --- src/components/Shifting/ShiftDetails.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index 0691754ebbc..8b18d9967fe 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -8,7 +8,6 @@ import { import PrintPreview from "@/CAREUI/misc/PrintPreview"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; -import { Separator } from "../../components/ui/separator"; import { Link, navigate } from "raviger"; import { useState } from "react"; import ButtonV2 from "@/components/Common/components/ButtonV2"; @@ -330,7 +329,7 @@ export default function ShiftDetails(props: { id: string }) { ? t("district_program_management_supporting_unit") : data.origin_facility_object?.name || "--"}
- + {/* */}

@@ -368,7 +367,7 @@ export default function ShiftDetails(props: { id: string }) { )}

- + {/* */}

@@ -409,7 +408,7 @@ export default function ShiftDetails(props: { id: string }) {

- + {/* */}
{t("approved_by_district_covid_control_room")}
From d2d8f9364b435de3dc5b3a69fadccaad1eaaf2d2 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Tue, 29 Oct 2024 06:31:06 +0530 Subject: [PATCH 10/30] removed separator --- src/components/ui/separator.tsx | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 src/components/ui/separator.tsx diff --git a/src/components/ui/separator.tsx b/src/components/ui/separator.tsx deleted file mode 100644 index ce13d0b7f75..00000000000 --- a/src/components/ui/separator.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import * as React from "react"; -import * as SeparatorPrimitive from "@radix-ui/react-separator"; - -import { cn } from "@/lib/utils"; - -const Separator = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->( - ( - { className, orientation = "horizontal", decorative = true, ...props }, - ref, - ) => ( - - ), -); -Separator.displayName = SeparatorPrimitive.Root.displayName; - -export { Separator }; From 83ad08b507480a2d4716ac27bfd89b05d49f9125 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Tue, 29 Oct 2024 06:43:50 +0530 Subject: [PATCH 11/30] new separator added --- src/components/Shifting/ShiftDetails.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index 8b18d9967fe..d74f6a62db0 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -329,6 +329,7 @@ export default function ShiftDetails(props: { id: string }) { ? t("district_program_management_supporting_unit") : data.origin_facility_object?.name || "--"}
+
{/* */}
@@ -367,6 +368,7 @@ export default function ShiftDetails(props: { id: string }) { )}
+
{/* */}
@@ -408,6 +410,7 @@ export default function ShiftDetails(props: { id: string }) {

+
{/* */}
{t("approved_by_district_covid_control_room")} From f575be87091ef62c0e26e23368afcae2b56c6bde Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Tue, 29 Oct 2024 19:22:44 +0530 Subject: [PATCH 12/30] Print preview updated --- src/CAREUI/misc/PrintPreview.tsx | 55 +++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/src/CAREUI/misc/PrintPreview.tsx b/src/CAREUI/misc/PrintPreview.tsx index 9efa11cc01b..8d9b83c4f6d 100644 --- a/src/CAREUI/misc/PrintPreview.tsx +++ b/src/CAREUI/misc/PrintPreview.tsx @@ -1,9 +1,8 @@ -import { ReactNode } from "react"; +import { ReactNode, useState, useEffect } from "react"; import ButtonV2 from "@/components/Common/components/ButtonV2"; import CareIcon from "../icons/CareIcon"; import { classNames } from "../../Utils/utils"; import Page from "@/components/Common/components/Page"; -import useBreakpoints from "@/common/hooks/useBreakpoints"; import { useTranslation } from "react-i18next"; import { ZoomControls, ZoomProvider, ZoomTransform } from "../interactive/Zoom"; @@ -14,31 +13,57 @@ type Props = { title: string; }; -export default function PrintPreview(props: Props) { - const normalScale = useBreakpoints({ default: 0.44, md: 1 }); +export default function PrintPreview({ + children, + disabled, + className, + title, +}: Props) { const { t } = useTranslation(); + const [scale, setScale] = useState(1); + + useEffect(() => { + const handleResize = () => { + if (window.innerWidth < 640) { + setScale(0.44); + } else if (window.innerWidth < 1024) { + setScale(0.7); + } else { + setScale(1); + } + }; + + handleResize(); + window.addEventListener("resize", handleResize); + + return () => { + window.removeEventListener("resize", handleResize); + }; + }, []); return ( - -
-
- - - {t("print")} + +
+
+ window.print()}> + + {t("print")}
- - + +
- {props.children} + {children}
- +
+ +
From 01507da94a225abc3ecfb58a360f322c32b7fe93 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Tue, 29 Oct 2024 19:23:17 +0530 Subject: [PATCH 13/30] Shift details updated --- src/components/Shifting/ShiftDetails.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index d74f6a62db0..433c0fd1aff 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -432,8 +432,8 @@ export default function ShiftDetails(props: { id: string }) { return (
{isPrintMode ? ( -
-
+
+
setIsPrintMode(false)} variant="secondary" From 609fdf748114b389480e13149643bf8bbfc16e7f Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Wed, 30 Oct 2024 18:06:01 +0530 Subject: [PATCH 14/30] removed phone size iisue --- src/CAREUI/misc/PrintPreview.tsx | 24 ++---------------------- src/components/Shifting/ShiftDetails.tsx | 3 --- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/CAREUI/misc/PrintPreview.tsx b/src/CAREUI/misc/PrintPreview.tsx index 8d9b83c4f6d..cc4ee1dec19 100644 --- a/src/CAREUI/misc/PrintPreview.tsx +++ b/src/CAREUI/misc/PrintPreview.tsx @@ -1,4 +1,4 @@ -import { ReactNode, useState, useEffect } from "react"; +import { ReactNode } from "react"; import ButtonV2 from "@/components/Common/components/ButtonV2"; import CareIcon from "../icons/CareIcon"; import { classNames } from "../../Utils/utils"; @@ -20,26 +20,6 @@ export default function PrintPreview({ title, }: Props) { const { t } = useTranslation(); - const [scale, setScale] = useState(1); - - useEffect(() => { - const handleResize = () => { - if (window.innerWidth < 640) { - setScale(0.44); - } else if (window.innerWidth < 1024) { - setScale(0.7); - } else { - setScale(1); - } - }; - - handleResize(); - window.addEventListener("resize", handleResize); - - return () => { - window.removeEventListener("resize", handleResize); - }; - }, []); return ( @@ -51,7 +31,7 @@ export default function PrintPreview({
- +
- {/* */}

@@ -369,7 +368,6 @@ export default function ShiftDetails(props: { id: string }) {

- {/* */}

@@ -411,7 +409,6 @@ export default function ShiftDetails(props: { id: string }) {

- {/* */}
{t("approved_by_district_covid_control_room")}
From 39a5f15b02409b66f40ac2e542c4b47df63ccdb6 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Wed, 30 Oct 2024 18:58:02 +0530 Subject: [PATCH 15/30] remove printPreview component changes --- src/CAREUI/misc/PrintPreview.tsx | 33 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/src/CAREUI/misc/PrintPreview.tsx b/src/CAREUI/misc/PrintPreview.tsx index cc4ee1dec19..9efa11cc01b 100644 --- a/src/CAREUI/misc/PrintPreview.tsx +++ b/src/CAREUI/misc/PrintPreview.tsx @@ -3,6 +3,7 @@ import ButtonV2 from "@/components/Common/components/ButtonV2"; import CareIcon from "../icons/CareIcon"; import { classNames } from "../../Utils/utils"; import Page from "@/components/Common/components/Page"; +import useBreakpoints from "@/common/hooks/useBreakpoints"; import { useTranslation } from "react-i18next"; import { ZoomControls, ZoomProvider, ZoomTransform } from "../interactive/Zoom"; @@ -13,37 +14,31 @@ type Props = { title: string; }; -export default function PrintPreview({ - children, - disabled, - className, - title, -}: Props) { +export default function PrintPreview(props: Props) { + const normalScale = useBreakpoints({ default: 0.44, md: 1 }); const { t } = useTranslation(); return ( - -
-
- window.print()}> - - {t("print")} + +
+
+ + + {t("print")}
- - + +
- {children} + {props.children}
-
- -
+
From a052237501f57a71a14c13d8595075498ccc1cfd Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Wed, 6 Nov 2024 23:28:22 +0530 Subject: [PATCH 16/30] bot issues resolved --- src/components/Shifting/ShiftDetails.tsx | 6 +++--- src/components/ui/card.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index 6169fb4dd5c..db092c586b2 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -15,7 +15,7 @@ import CommentSection from "./CommentsSection"; import ConfirmDialog from "@/components/Common/ConfirmDialog"; import { CopyToClipboard } from "react-copy-to-clipboard"; import Page from "@/components/Common/components/Page"; -import { QRCodeSVG } from "qrcode.react"; +import QRCode from "qrcode.react"; import RecordMeta from "../../CAREUI/display/RecordMeta"; import { formatDateTime, @@ -305,7 +305,7 @@ export default function ShiftDetails(props: { id: string }) { @@ -318,7 +318,7 @@ export default function ShiftDetails(props: { id: string }) { {data.is_kasp && ( logo )} - diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx index 5bd1b4bfdf4..893b9be60b7 100644 --- a/src/components/ui/card.tsx +++ b/src/components/ui/card.tsx @@ -30,7 +30,7 @@ const CardHeader = React.forwardRef< CardHeader.displayName = "CardHeader"; const CardTitle = React.forwardRef< - HTMLParagraphElement, + HTMLHeadingElement, React.HTMLAttributes >(({ className, ...props }, ref) => (

Date: Wed, 6 Nov 2024 23:44:59 +0530 Subject: [PATCH 17/30] QRCodeSVG added based on coderrabbitai --- src/components/Shifting/ShiftDetails.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index db092c586b2..aeb8034d21c 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -15,7 +15,7 @@ import CommentSection from "./CommentsSection"; import ConfirmDialog from "@/components/Common/ConfirmDialog"; import { CopyToClipboard } from "react-copy-to-clipboard"; import Page from "@/components/Common/components/Page"; -import QRCode from "qrcode.react"; +import { QRCodeSVG } from "qrcode.react"; import RecordMeta from "../../CAREUI/display/RecordMeta"; import { formatDateTime, @@ -318,7 +318,7 @@ export default function ShiftDetails(props: { id: string }) { {data.is_kasp && ( logo )} - From 758052c4184cea6efb9b8ed8cdca813ea2767d80 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sun, 24 Nov 2024 12:01:59 +0530 Subject: [PATCH 18/30] responsive button updated --- src/components/Shifting/ShiftDetails.tsx | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index aeb8034d21c..186053885df 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -302,7 +302,7 @@ export default function ShiftDetails(props: { id: string }) { )?.text; return ( - + {isPrintMode ? ( -
-
- setIsPrintMode(false)} - variant="secondary" - > - {" "} - {t("close")} - -
+
{printData(data)}
) : ( From c62a9df44335df65736b5bb254c2fb1ad350ecd2 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sun, 24 Nov 2024 12:04:08 +0530 Subject: [PATCH 19/30] PrintPreview component updated add colse button feature to access dynamic way --- src/CAREUI/misc/PrintPreview.tsx | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/CAREUI/misc/PrintPreview.tsx b/src/CAREUI/misc/PrintPreview.tsx index 9efa11cc01b..ca91bd2e810 100644 --- a/src/CAREUI/misc/PrintPreview.tsx +++ b/src/CAREUI/misc/PrintPreview.tsx @@ -12,6 +12,8 @@ type Props = { disabled?: boolean; className?: string; title: string; + onClose?: boolean; + closeFeature?: (value: boolean) => void; }; export default function PrintPreview(props: Props) { @@ -20,16 +22,25 @@ export default function PrintPreview(props: Props) { return ( -
-
+
+
{t("print")} + {props.onClose && ( + props.closeFeature && props.closeFeature(false)} + > + {" "} + {t("close")} + + )}
- +
- +
+ +
From 28f8bd813aafbe84b43cf35d034f0e60a84988f0 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sun, 24 Nov 2024 12:16:30 +0530 Subject: [PATCH 20/30] normalScale updated (Previous: it shows very small size) --- src/CAREUI/misc/PrintPreview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CAREUI/misc/PrintPreview.tsx b/src/CAREUI/misc/PrintPreview.tsx index ca91bd2e810..39823888657 100644 --- a/src/CAREUI/misc/PrintPreview.tsx +++ b/src/CAREUI/misc/PrintPreview.tsx @@ -17,7 +17,7 @@ type Props = { }; export default function PrintPreview(props: Props) { - const normalScale = useBreakpoints({ default: 0.44, md: 1 }); + const normalScale = useBreakpoints({ default: 1, md: 1 }); const { t } = useTranslation(); return ( From d4a2a1ecda66c14a29773f0ce8d9da020f14f107 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Mon, 25 Nov 2024 00:22:10 +0530 Subject: [PATCH 21/30] new seperator added --- src/components/ui/separator.tsx | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/components/ui/separator.tsx diff --git a/src/components/ui/separator.tsx b/src/components/ui/separator.tsx new file mode 100644 index 00000000000..75e3f7cf5f7 --- /dev/null +++ b/src/components/ui/separator.tsx @@ -0,0 +1,3 @@ +export default function Separator() { + return
; +} From 41fc423d28e275088a2b02eeff3bbaa6763ab421 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Wed, 27 Nov 2024 15:55:03 +0530 Subject: [PATCH 22/30] default scale corrected --- src/CAREUI/misc/PrintPreview.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/CAREUI/misc/PrintPreview.tsx b/src/CAREUI/misc/PrintPreview.tsx index 39823888657..e4c917ef022 100644 --- a/src/CAREUI/misc/PrintPreview.tsx +++ b/src/CAREUI/misc/PrintPreview.tsx @@ -17,7 +17,7 @@ type Props = { }; export default function PrintPreview(props: Props) { - const normalScale = useBreakpoints({ default: 1, md: 1 }); + const normalScale = useBreakpoints({ default: 0.44, md: 1 }); const { t } = useTranslation(); return ( @@ -49,9 +49,7 @@ export default function PrintPreview(props: Props) {
-
- -
+
From 5243b1fda8277eeb8f264e602742cbc3b57e7b89 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Thu, 28 Nov 2024 02:17:05 +0530 Subject: [PATCH 23/30] lint solved --- src/CAREUI/misc/PrintPreview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CAREUI/misc/PrintPreview.tsx b/src/CAREUI/misc/PrintPreview.tsx index a054dca2908..53eda1339ac 100644 --- a/src/CAREUI/misc/PrintPreview.tsx +++ b/src/CAREUI/misc/PrintPreview.tsx @@ -51,4 +51,4 @@ export default function PrintPreview(props: Props) {
); -} \ No newline at end of file +} From 82e1442fc2692d483320bea992a9b8d1b5010799 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Thu, 28 Nov 2024 11:39:43 +0530 Subject: [PATCH 24/30] Auto label conflict deploy issue --- src/components/Shifting/ShiftDetails.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index 36694a4b7ab..91c3a3d4ede 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -277,6 +277,7 @@ export default function ShiftDetails(props: { id: string }) { )?.text; return ( + // deploytest Date: Thu, 28 Nov 2024 15:06:07 +0530 Subject: [PATCH 25/30] removed custom seperator component --- src/components/Shifting/ShiftDetails.tsx | 1 - src/components/ui/separator.tsx | 3 --- 2 files changed, 4 deletions(-) delete mode 100644 src/components/ui/separator.tsx diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index 91c3a3d4ede..36694a4b7ab 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -277,7 +277,6 @@ export default function ShiftDetails(props: { id: string }) { )?.text; return ( - // deploytest
; -} From 8aa9dcdb89846bac2c6becf15a7b2897ab441440 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 30 Nov 2024 14:54:46 +0530 Subject: [PATCH 26/30] readable issue solved --- src/components/Shifting/ShiftDetails.tsx | 111 ++++++++++++++--------- 1 file changed, 70 insertions(+), 41 deletions(-) diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index 36694a4b7ab..f24deb560bd 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -304,7 +304,7 @@ export default function ShiftDetails(props: { id: string }) { />

-
+
{t("name_of_hospital")}: {data.is_kasp ? t("district_program_management_supporting_unit") @@ -313,40 +313,48 @@ export default function ShiftDetails(props: { id: string }) {
-
+
-

- {t("patient_information")} -

-

- {t("name")}: {patientData?.name} +

{t("Patient Information")}

+

+ + {t("name")}:{" "} + + {patientData?.name}

-

- {t("age")}: {formatPatientAge(patientData, true)} +

+ + {t("age")}:{" "} + + {formatPatientAge(patientData, true)}

-

- {t("gender")}: {patientGender || "-"} +

+ + {t("gender")}:{" "} + + {patientGender || "-"}

-

- {t("phone")}: {patientData?.phone_number || "-"} +

+ + {t("phone")}:{" "} + {" "} + {patientData?.phone_number || "-"}

-
-

{t("address")}

-

+

+

{t("address")}

+

{patientData?.address || "-"}

{patientData?.nationality === "India" && ( <> -

+

{patientData?.ward_object?.name},{" "} {patientData?.local_body_object?.name}

-

- {patientData?.district_object?.name || "-"} -

-

{patientData?.state_object?.name}

+

{patientData?.district_object?.name || "-"}

+

{patientData?.state_object?.name}

)}
@@ -354,42 +362,63 @@ export default function ShiftDetails(props: { id: string }) {
-
+
-

- {t("date_of_admission")}:{" "} +

+ + {t("date_of_admission")}:{" "} + {formatDateTime( consultation.encounter_date || consultation.created_date, ) || "-"}

-

- {t("unique_id")}: {data.id} +

+ + {t("unique_id")}:{" "} + {" "} + {data.id}

-

- {t("patient_no")}: {consultation.patient_no || "-"} +

+ + {t("patient_no")}:{" "} + {" "} + {consultation.patient_no || "-"}

-
-

- {t("date_of_positive_covid_19_swab")}:{" "} +

+

+ + {t("date_of_positive_covid_19_swab")}:{" "} + {(patientData?.date_of_test && formatDateTime(patientData.date_of_test)) || "-"}

-

- {t("covid_19_cat_gov")}: {consultation.category || "-"} +

+ + {t("covid_19_cat_gov")}:{" "} + {" "} + {consultation.category || "-"}

-

- {t("referred_to")}:{" "} +

+ + {t("referred_to")}:{" "} + {data.assigned_facility_external || data.assigned_facility_object?.name || "--"}

-

- {t("reason_for_referral")}: {data.reason || "--"} +

+ + {t("reason_for_referral")}:{" "} + {" "} + {data.reason || "--"}

-

- {t("treatment_summary")}: {consultation.treatment_plan || "-"} +

+ + {t("treatment_summary")}:{" "} + {" "} + {consultation.treatment_plan || "-"}

@@ -397,10 +426,10 @@ export default function ShiftDetails(props: { id: string }) {
-

+

{t("approved_by_district_covid_control_room")}

-

{t("auto_generated_for_care")}

+

{t("auto_generated_for_care")}

From 890161a0c9944b32ea05e5f032c8334e1716d02c Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 30 Nov 2024 15:18:34 +0530 Subject: [PATCH 27/30] Lint code base corrected --- src/components/Shifting/ShiftDetails.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index f24deb560bd..90cead822b7 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -315,7 +315,9 @@ export default function ShiftDetails(props: { id: string }) {
-

{t("Patient Information")}

+

+ {t("Patient Information")} +

{t("name")}:{" "} From f04a1e8478185abd7056e0730f29ba9a2cb5eda3 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Tue, 3 Dec 2024 18:29:08 +0530 Subject: [PATCH 28/30] old Card removed Shadcn Card added --- src/components/Shifting/ShiftDetails.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index 90cead822b7..53022d75c58 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -5,12 +5,11 @@ import { useState } from "react"; import { CopyToClipboard } from "react-copy-to-clipboard"; import { useTranslation } from "react-i18next"; -import Card from "@/CAREUI/display/Card"; import RecordMeta from "@/CAREUI/display/RecordMeta"; import CareIcon from "@/CAREUI/icons/CareIcon"; import PrintPreview from "@/CAREUI/misc/PrintPreview"; -import { CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import ButtonV2 from "@/components/Common/ButtonV2"; import Loading from "@/components/Common/Loading"; From 396389e6c0b72ce011fb67a2e1b49b32b5ce1105 Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Tue, 3 Dec 2024 20:58:58 +0530 Subject: [PATCH 29/30] print preview switch to shadcn button --- src/CAREUI/misc/PrintPreview.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/CAREUI/misc/PrintPreview.tsx b/src/CAREUI/misc/PrintPreview.tsx index 53eda1339ac..daf79ecbb34 100644 --- a/src/CAREUI/misc/PrintPreview.tsx +++ b/src/CAREUI/misc/PrintPreview.tsx @@ -8,7 +8,8 @@ import { ZoomTransform, } from "@/CAREUI/interactive/Zoom"; -import ButtonV2 from "@/components/Common/ButtonV2"; +import { Button } from "@/components/ui/button"; + import Page from "@/components/Common/Page"; import useBreakpoints from "@/hooks/useBreakpoints"; @@ -30,10 +31,10 @@ export default function PrintPreview(props: Props) {

- +
From c28d09db47193c534bc17750cc808cee47e5d120 Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Tue, 3 Dec 2024 20:59:13 +0530 Subject: [PATCH 30/30] remove border, shadow and other unnecessary classes --- src/components/Shifting/ShiftDetails.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index 5773a098362..4a6f6c855bb 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -277,10 +277,7 @@ export default function ShiftDetails(props: { id: string }) { return ( - + {t("referral_letter")}