From 0b3279fc9812afde4a2d552b0d5db733b633e9e2 Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Tue, 4 Feb 2025 23:45:38 +0530 Subject: [PATCH 1/9] Filter allergies by encounter if encounter is marked as completed --- src/components/Patient/allergy/list.tsx | 12 ++++++++++-- src/pages/Encounters/tabs/EncounterUpdatesTab.tsx | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/Patient/allergy/list.tsx b/src/components/Patient/allergy/list.tsx index a4a91bae6a1..61d4afbbfb2 100644 --- a/src/components/Patient/allergy/list.tsx +++ b/src/components/Patient/allergy/list.tsx @@ -22,24 +22,32 @@ import { Avatar } from "@/components/Common/Avatar"; import query from "@/Utils/request/query"; import { AllergyIntolerance } from "@/types/emr/allergyIntolerance/allergyIntolerance"; import allergyIntoleranceApi from "@/types/emr/allergyIntolerance/allergyIntoleranceApi"; +import { Encounter, completedEncounterStatus } from "@/types/emr/encounter"; interface AllergyListProps { facilityId?: string; patientId: string; encounterId?: string; + encounterStatus: Encounter["status"]; } export function AllergyList({ facilityId, patientId, encounterId, + encounterStatus, }: AllergyListProps) { const [showEnteredInError, setShowEnteredInError] = useState(false); const { data: allergies, isLoading } = useQuery({ - queryKey: ["allergies", patientId, encounterId], + queryKey: ["allergies", patientId, encounterId, encounterStatus], queryFn: query(allergyIntoleranceApi.getAllergy, { pathParams: { patientId }, + queryParams: { + encounter: completedEncounterStatus.includes(encounterStatus as string) + ? encounterId + : undefined, + }, }), }); @@ -233,7 +241,7 @@ const AllergyListLayout = ({ {t("allergies")} - {facilityId && encounterId && ( + {facilityId && ( From b816e20ad6c70565e6d49873db937e73460b4663 Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Tue, 4 Feb 2025 23:52:30 +0530 Subject: [PATCH 2/9] fix type --- src/components/Patient/allergy/list.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Patient/allergy/list.tsx b/src/components/Patient/allergy/list.tsx index 61d4afbbfb2..3eed3b32e40 100644 --- a/src/components/Patient/allergy/list.tsx +++ b/src/components/Patient/allergy/list.tsx @@ -28,7 +28,7 @@ interface AllergyListProps { facilityId?: string; patientId: string; encounterId?: string; - encounterStatus: Encounter["status"]; + encounterStatus?: Encounter["status"]; } export function AllergyList({ From c242c96ff7896981b2a0272bf00ad1312f1576c7 Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Wed, 5 Feb 2025 00:00:17 +0530 Subject: [PATCH 3/9] show edit button only if encounter id is present --- src/components/Patient/allergy/list.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Patient/allergy/list.tsx b/src/components/Patient/allergy/list.tsx index 3eed3b32e40..623aaf416d8 100644 --- a/src/components/Patient/allergy/list.tsx +++ b/src/components/Patient/allergy/list.tsx @@ -241,7 +241,7 @@ const AllergyListLayout = ({ {t("allergies")} - {facilityId && ( + {facilityId && encounterId && ( Date: Thu, 6 Feb 2025 12:13:43 +0530 Subject: [PATCH 4/9] Tweaked print preview (#10410) --- src/CAREUI/misc/PrintPreview.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CAREUI/misc/PrintPreview.tsx b/src/CAREUI/misc/PrintPreview.tsx index 3479b6a0347..356826e90d0 100644 --- a/src/CAREUI/misc/PrintPreview.tsx +++ b/src/CAREUI/misc/PrintPreview.tsx @@ -24,12 +24,12 @@ type Props = { }; export default function PrintPreview(props: Props) { - const normalScale = useBreakpoints({ default: 0.44, md: 1 }); + const normalScale = useBreakpoints({ default: 1 }); const { t } = useTranslation(); return ( -
+
-
+
+
- {t("schedule_information")} + + {t("schedule_information")} + +
e.stopPropagation()}> - fileUpload.setFileName(e.target.value, index) - } + onChange={(e) => { + fileUpload.setFileName(e.target.value); + fileUpload.setError(null); + }} + className="ml-0.5 mb-1" /> - {index === 0 && fileUpload.error && ( -

+ {fileUpload.error && ( +

{fileUpload.error}

)}
-
- ))} + + ) : ( + fileUpload.files.map((file, index) => ( +
+
+ + + + {file.name.length > 40 + ? `${file.name.substring(0, 30)}...` + : file.name} + + + +
+
+ + + { + fileUpload.setFileName(e.target.value, index); + fileUpload.setError(null); + }} + className="ml-0.5 mb-0.5" + /> + {index === 0 && fileUpload.error && ( +

+ {fileUpload.error} +

+ )} +
+
+ )) + )}
+ {fileUpload.files.length > 1 && ( +
+ setIsPdf(checked)} + disabled={fileUpload.uploading} + className="cursor-pointer" + /> + +
+ )} +