From cb3f18d50e1bcff98be508581620b560c8fdc0f4 Mon Sep 17 00:00:00 2001 From: Sanchari singh Date: Sat, 30 Nov 2024 19:46:01 +0530 Subject: [PATCH 01/13] Adds support for review missed logic #8607 --- package-lock.json | 164 +++++++++------------- package.json | 2 +- src/components/Patient/ManagePatients.tsx | 21 ++- 3 files changed, 84 insertions(+), 103 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5c703af8fe1..e6044467332 100644 --- a/package-lock.json +++ b/package-lock.json @@ -57,7 +57,7 @@ "tailwind-merge": "^2.5.4", "tailwindcss-animate": "^1.0.7", "use-keyboard-shortcut": "^1.1.6", - "xlsx": "^0.18.5" + "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz" }, "devDependencies": { "@julr/vite-plugin-validate-env": "^1.1.1", @@ -538,9 +538,9 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.7.tgz", - "integrity": "sha512-eaPZai0PiqCi09pPs3pAFfl/zYgGaE6IdXtYvmf0qlcDTd3WCtO7JWCcRd64e0EQrcYgiHibEZnOGsSY4QSgaw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz", + "integrity": "sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==", "dev": true, "license": "MIT", "engines": { @@ -5436,6 +5436,59 @@ "@types/estree": "*" } }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.6.8", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz", + "integrity": "sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "@babel/types": "^7.20.7" + } + }, "node_modules/@types/concat-stream": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-2.0.3.tgz", @@ -6250,15 +6303,6 @@ "node": ">=0.4.0" } }, - "node_modules/adler-32": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.3.1.tgz", - "integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==", - "license": "Apache-2.0", - "engines": { - "node": ">=0.8" - } - }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -7121,19 +7165,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/cfb": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/cfb/-/cfb-1.2.2.tgz", - "integrity": "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==", - "license": "Apache-2.0", - "dependencies": { - "adler-32": "~1.3.0", - "crc-32": "~1.2.0" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -7392,15 +7423,6 @@ "node": ">=6" } }, - "node_modules/codepage": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/codepage/-/codepage-1.15.0.tgz", - "integrity": "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA==", - "license": "Apache-2.0", - "engines": { - "node": ">=0.8" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -7580,18 +7602,6 @@ } } }, - "node_modules/crc-32": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", - "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", - "license": "Apache-2.0", - "bin": { - "crc32": "bin/crc32.njs" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/cross-env": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", @@ -7620,9 +7630,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -9750,15 +9760,6 @@ "node": ">= 6" } }, - "node_modules/frac": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz", - "integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==", - "license": "Apache-2.0", - "engines": { - "node": ">=0.8" - } - }, "node_modules/fraction.js": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", @@ -17160,18 +17161,6 @@ "dev": true, "license": "BSD-3-Clause" }, - "node_modules/ssf": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/ssf/-/ssf-0.11.2.tgz", - "integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==", - "license": "Apache-2.0", - "dependencies": { - "frac": "~1.1.2" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/sshpk": { "version": "1.18.0", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", @@ -20142,24 +20131,6 @@ "string-width": "^1.0.2 || 2 || 3 || 4" } }, - "node_modules/wmf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz", - "integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw==", - "license": "Apache-2.0", - "engines": { - "node": ">=0.8" - } - }, - "node_modules/word": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/word/-/word-0.3.0.tgz", - "integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==", - "license": "Apache-2.0", - "engines": { - "node": ">=0.8" - } - }, "node_modules/word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", @@ -20736,19 +20707,10 @@ } }, "node_modules/xlsx": { - "version": "0.18.5", - "resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.18.5.tgz", - "integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==", + "version": "0.20.3", + "resolved": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz", + "integrity": "sha512-oLDq3jw7AcLqKWH2AhCpVTZl8mf6X2YReP+Neh0SJUzV/BdZYjth94tG5toiMB1PPrYtxOCfaoUCkvtuH+3AJA==", "license": "Apache-2.0", - "dependencies": { - "adler-32": "~1.3.0", - "cfb": "~1.2.1", - "codepage": "~1.15.0", - "crc-32": "~1.2.1", - "ssf": "~0.11.2", - "wmf": "~1.0.1", - "word": "~0.3.0" - }, "bin": { "xlsx": "bin/xlsx.njs" }, diff --git a/package.json b/package.json index 020d73f5e65..e813696b30a 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "tailwind-merge": "^2.5.4", "tailwindcss-animate": "^1.0.7", "use-keyboard-shortcut": "^1.1.6", - "xlsx": "^0.18.5" + "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz" }, "devDependencies": { "@julr/vite-plugin-validate-env": "^1.1.1", diff --git a/src/components/Patient/ManagePatients.tsx b/src/components/Patient/ManagePatients.tsx index 0664532b0a1..d429bfc7ab8 100644 --- a/src/components/Patient/ManagePatients.tsx +++ b/src/components/Patient/ManagePatients.tsx @@ -628,7 +628,7 @@ export const PatientManager = () => { )} )} - {patient.review_time && + {/* {patient.review_time && !patient.last_consultation?.discharge_date && Number(patient.last_consultation?.review_interval) > 0 && dayjs().isAfter(patient.review_time) && ( @@ -638,7 +638,26 @@ export const PatientManager = () => { startIcon="l-clock" text="Review Missed" /> + )} */} + {patient.review_time && + !patient.last_consultation?.discharge_date && + Number(patient.last_consultation?.review_interval) > 0 && ( + )} + {patient.last_consultation?.is_readmission && ( Date: Tue, 3 Dec 2024 16:59:43 +0530 Subject: [PATCH 02/13] Update package.json From 7bc58ae8841c395d06048d3dc75ef6834c5ed201 Mon Sep 17 00:00:00 2001 From: SANCHARI SINGH <123357539+Sancharisingh@users.noreply.github.com> Date: Tue, 3 Dec 2024 17:01:33 +0530 Subject: [PATCH 03/13] Update ManagePatients.tsx --- src/components/Patient/ManagePatients.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Patient/ManagePatients.tsx b/src/components/Patient/ManagePatients.tsx index daa36a6e070..175d58b8372 100644 --- a/src/components/Patient/ManagePatients.tsx +++ b/src/components/Patient/ManagePatients.tsx @@ -652,8 +652,8 @@ export const PatientManager = () => { startIcon="l-clock" text={ dayjs().isAfter(patient.review_time) - ? `Review Missed (${Math.abs(dayjs().diff(dayjs(patient.review_time), "days"))} days ago)` - : `Review Due in (${Math.abs(dayjs(patient.review_time).diff(dayjs(), "days"))} days)` + ? `Review Missed ${Math.abs(dayjs().diff(dayjs(patient.review_time), "days"))} days ago` + : `Review Due in ${Math.abs(dayjs(patient.review_time).diff(dayjs(), "days"))} days` } /> )} From b0d6b44d8c654fab05cc63134661a7fe22455a2a Mon Sep 17 00:00:00 2001 From: SANCHARI SINGH <123357539+Sancharisingh@users.noreply.github.com> Date: Tue, 3 Dec 2024 17:11:37 +0530 Subject: [PATCH 04/13] Update package-lock.json From 47b4c4a035b05323842459fa122247b2691490ed Mon Sep 17 00:00:00 2001 From: SANCHARI SINGH <123357539+Sancharisingh@users.noreply.github.com> Date: Tue, 3 Dec 2024 19:21:24 +0530 Subject: [PATCH 05/13] Update package.json Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5ffb9ac168a..447de7b373c 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "tailwind-merge": "^2.5.4", "tailwindcss-animate": "^1.0.7", "use-keyboard-shortcut": "^1.1.6", - "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz" + "xlsx": "^0.20.3" }, "devDependencies": { "@julr/vite-plugin-validate-env": "^1.1.1", From 3e10890b8aae3854f15e514b46644fd70d9a0663 Mon Sep 17 00:00:00 2001 From: SANCHARI SINGH <123357539+Sancharisingh@users.noreply.github.com> Date: Tue, 3 Dec 2024 19:25:32 +0530 Subject: [PATCH 06/13] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 447de7b373c..798c910ea91 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "tailwind-merge": "^2.5.4", "tailwindcss-animate": "^1.0.7", "use-keyboard-shortcut": "^1.1.6", - "xlsx": "^0.20.3" + "xlsx": "^0.18.5" }, "devDependencies": { "@julr/vite-plugin-validate-env": "^1.1.1", From fb0039ddafe5954974d5679177d8718bfebdfbed Mon Sep 17 00:00:00 2001 From: SANCHARI SINGH <123357539+Sancharisingh@users.noreply.github.com> Date: Tue, 3 Dec 2024 19:30:24 +0530 Subject: [PATCH 07/13] Update package-lock.json --- package-lock.json | 164 ++++++++++++++++++++++++++++------------------ 1 file changed, 101 insertions(+), 63 deletions(-) diff --git a/package-lock.json b/package-lock.json index 958ee9afe3d..97073c88ecb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -57,7 +57,7 @@ "tailwind-merge": "^2.5.4", "tailwindcss-animate": "^1.0.7", "use-keyboard-shortcut": "^1.1.6", - "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz" + "xlsx": "^0.18.5" }, "devDependencies": { "@julr/vite-plugin-validate-env": "^1.1.1", @@ -538,9 +538,9 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz", - "integrity": "sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.7.tgz", + "integrity": "sha512-eaPZai0PiqCi09pPs3pAFfl/zYgGaE6IdXtYvmf0qlcDTd3WCtO7JWCcRd64e0EQrcYgiHibEZnOGsSY4QSgaw==", "dev": true, "license": "MIT", "engines": { @@ -5436,59 +5436,6 @@ "@types/estree": "*" } }, - "node_modules/@types/babel__core": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", - "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" - } - }, - "node_modules/@types/babel__generator": { - "version": "7.6.8", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", - "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__template": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", - "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__traverse": { - "version": "7.20.6", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz", - "integrity": "sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "@babel/types": "^7.20.7" - } - }, "node_modules/@types/concat-stream": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-2.0.3.tgz", @@ -6303,6 +6250,15 @@ "node": ">=0.4.0" } }, + "node_modules/adler-32": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.3.1.tgz", + "integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8" + } + }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -7165,6 +7121,19 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/cfb": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cfb/-/cfb-1.2.2.tgz", + "integrity": "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==", + "license": "Apache-2.0", + "dependencies": { + "adler-32": "~1.3.0", + "crc-32": "~1.2.0" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -7423,6 +7392,15 @@ "node": ">=6" } }, + "node_modules/codepage": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/codepage/-/codepage-1.15.0.tgz", + "integrity": "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -7602,6 +7580,18 @@ } } }, + "node_modules/crc-32": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "license": "Apache-2.0", + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/cross-env": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", @@ -7630,9 +7620,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -9760,6 +9750,15 @@ "node": ">= 6" } }, + "node_modules/frac": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz", + "integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8" + } + }, "node_modules/fraction.js": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", @@ -17161,6 +17160,18 @@ "dev": true, "license": "BSD-3-Clause" }, + "node_modules/ssf": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/ssf/-/ssf-0.11.2.tgz", + "integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==", + "license": "Apache-2.0", + "dependencies": { + "frac": "~1.1.2" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/sshpk": { "version": "1.18.0", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", @@ -20131,6 +20142,24 @@ "string-width": "^1.0.2 || 2 || 3 || 4" } }, + "node_modules/wmf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz", + "integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/word": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/word/-/word-0.3.0.tgz", + "integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8" + } + }, "node_modules/word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", @@ -20707,10 +20736,19 @@ } }, "node_modules/xlsx": { - "version": "0.20.3", - "resolved": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz", - "integrity": "sha512-oLDq3jw7AcLqKWH2AhCpVTZl8mf6X2YReP+Neh0SJUzV/BdZYjth94tG5toiMB1PPrYtxOCfaoUCkvtuH+3AJA==", + "version": "0.18.5", + "resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.18.5.tgz", + "integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==", "license": "Apache-2.0", + "dependencies": { + "adler-32": "~1.3.0", + "cfb": "~1.2.1", + "codepage": "~1.15.0", + "crc-32": "~1.2.1", + "ssf": "~0.11.2", + "wmf": "~1.0.1", + "word": "~0.3.0" + }, "bin": { "xlsx": "bin/xlsx.njs" }, From fd158a9dad85b240dd107bfe5fd5ef5f8c22d98f Mon Sep 17 00:00:00 2001 From: SANCHARI SINGH <123357539+Sancharisingh@users.noreply.github.com> Date: Thu, 5 Dec 2024 21:35:00 +0530 Subject: [PATCH 08/13] Remove old comment code. --- src/components/Patient/ManagePatients.tsx | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/components/Patient/ManagePatients.tsx b/src/components/Patient/ManagePatients.tsx index 175d58b8372..79c356c1227 100644 --- a/src/components/Patient/ManagePatients.tsx +++ b/src/components/Patient/ManagePatients.tsx @@ -628,17 +628,6 @@ export const PatientManager = () => { )} )} - {/* {patient.review_time && - !patient.last_consultation?.discharge_date && - Number(patient.last_consultation?.review_interval) > 0 && - dayjs().isAfter(patient.review_time) && ( - - )} */} {patient.review_time && !patient.last_consultation?.discharge_date && Number(patient.last_consultation?.review_interval) > 0 && ( From 0a450f255c75b0dd4bbc03fc9a6e72a15d332d48 Mon Sep 17 00:00:00 2001 From: SANCHARI SINGH <123357539+Sancharisingh@users.noreply.github.com> Date: Sat, 7 Dec 2024 23:07:42 +0530 Subject: [PATCH 09/13] Remove comment code and add shadcn/ui badge. --- src/components/Patient/ManagePatients.tsx | 256 ++++++++++++---------- 1 file changed, 138 insertions(+), 118 deletions(-) diff --git a/src/components/Patient/ManagePatients.tsx b/src/components/Patient/ManagePatients.tsx index a67a411d71a..db9a12c916b 100644 --- a/src/components/Patient/ManagePatients.tsx +++ b/src/components/Patient/ManagePatients.tsx @@ -1,16 +1,40 @@ import dayjs from "dayjs"; import { Link, navigate } from "raviger"; -import { ReactNode, useCallback, useEffect, useState } from "react"; +import { ReactNode, useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; +import Chip from "@/CAREUI/display/Chip"; +import CountBlock from "@/CAREUI/display/Count"; +import FilterBadge from "@/CAREUI/display/FilterBadge"; +import RecordMeta from "@/CAREUI/display/RecordMeta"; +import CareIcon from "@/CAREUI/icons/CareIcon"; +import { AdvancedFilterButton } from "@/CAREUI/interactive/FiltersSlideover"; + +import { Badge } from "@/components/ui/badge"; + import { Avatar } from "@/components/Common/Avatar"; import ButtonV2 from "@/components/Common/ButtonV2"; import { ExportMenu } from "@/components/Common/Export"; import Loading from "@/components/Common/Loading"; import Page from "@/components/Common/Page"; -import SearchByMultipleFields from "@/components/Common/SearchByMultipleFields"; import SortDropdownMenu from "@/components/Common/SortDropdown"; import Tabs from "@/components/Common/Tabs"; +import { ICD11DiagnosisModel } from "@/components/Diagnosis/types"; +import { getDiagnosesByIds } from "@/components/Diagnosis/utils"; +import FacilitiesSelectDialogue from "@/components/ExternalResult/FacilitiesSelectDialogue"; +import DoctorVideoSlideover from "@/components/Facility/DoctorVideoSlideover"; +import { FacilityModel, PatientCategory } from "@/components/Facility/models"; +import { PhoneNumberValidator } from "@/components/Form/FieldValidators"; +import PhoneNumberFormField from "@/components/Form/FormFields/PhoneNumberFormField"; +import { FieldChangeEvent } from "@/components/Form/FormFields/Utils"; +import SearchInput from "@/components/Form/SearchInput"; +import { + DIAGNOSES_FILTER_LABELS, + DiagnosesFilterKey, + FILTER_BY_DIAGNOSES_KEYS, +} from "@/components/Patient/DiagnosesFilter"; +import PatientFilter from "@/components/Patient/PatientFilter"; +import { isPatientMandatoryDataFilled } from "@/components/Patient/Utils"; import useAuthUser from "@/hooks/useAuthUser"; import useFilters from "@/hooks/useFilters"; @@ -27,36 +51,17 @@ import { } from "@/common/constants"; import { parseOptionId } from "@/common/utils"; +import { triggerGoal } from "@/Integrations/Plausible"; +import * as Notification from "@/Utils/Notifications"; import routes from "@/Utils/request/api"; - -import Chip from "../../CAREUI/display/Chip"; -import CountBlock from "../../CAREUI/display/Count"; -import FilterBadge from "../../CAREUI/display/FilterBadge"; -import RecordMeta from "../../CAREUI/display/RecordMeta"; -import CareIcon from "../../CAREUI/icons/CareIcon"; -import { AdvancedFilterButton } from "../../CAREUI/interactive/FiltersSlideover"; -import { triggerGoal } from "../../Integrations/Plausible"; -import * as Notification from "../../Utils/Notifications"; -import request from "../../Utils/request/request"; -import useQuery from "../../Utils/request/useQuery"; +import request from "@/Utils/request/request"; +import useQuery from "@/Utils/request/useQuery"; import { formatPatientAge, humanizeStrings, isAntenatal, parsePhoneNumber, -} from "../../Utils/utils"; -import { ICD11DiagnosisModel } from "../Diagnosis/types"; -import { getDiagnosesByIds } from "../Diagnosis/utils"; -import FacilitiesSelectDialogue from "../ExternalResult/FacilitiesSelectDialogue"; -import DoctorVideoSlideover from "../Facility/DoctorVideoSlideover"; -import { FacilityModel, PatientCategory } from "../Facility/models"; -import { - DIAGNOSES_FILTER_LABELS, - DiagnosesFilterKey, - FILTER_BY_DIAGNOSES_KEYS, -} from "./DiagnosesFilter"; -import PatientFilter from "./PatientFilter"; -import { isPatientMandatoryDataFilled } from "./Utils"; +} from "@/Utils/utils"; interface TabPanelProps { children?: ReactNode; @@ -90,7 +95,6 @@ export const PatientManager = () => { Pagination, FilterBadges, resultsPerPage, - clearSearch, } = useFilters({ limit: 12, cacheBlacklist: [ @@ -107,6 +111,30 @@ export const PatientManager = () => { const [diagnoses, setDiagnoses] = useState([]); const [showDialog, setShowDialog] = useState<"create" | "list-discharged">(); const [showDoctors, setShowDoctors] = useState(false); + const [phoneNumber, _setPhoneNumber] = useState(""); + const [emergencyPhoneNumber, _setEmergencyPhoneNumber] = useState(""); + + const setPhoneNumber = (value: string) => { + _setPhoneNumber(value); + const error = PhoneNumberValidator()(value); + if (!error) { + updateQuery({ phone_number: value }); + } + if ((value === "+91" || value === "") && qParams.phone_number) { + updateQuery({ phone_number: null }); + } + }; + + const setEmergencyPhoneNumber = (value: string) => { + _setEmergencyPhoneNumber(value); + const error = PhoneNumberValidator()(value); + if (!error) { + updateQuery({ emergency_phone_number: value }); + } + if ((value === "+91" || value === "") && qParams.emergency_phone_number) { + updateQuery({ emergency_phone_number: null }); + } + }; const tabValue = qParams.last_consultation__new_discharge_reason || @@ -293,6 +321,14 @@ export const PatientManager = () => { const { loading: isLoading, data } = useQuery(routes.patientList, { query: params, + onResponse: () => { + if (!params.phone_number) { + _setPhoneNumber("+91"); + } + if (!params.emergency_phone_number) { + _setEmergencyPhoneNumber("+91"); + } + }, }); const getTheCategoryFromId = () => { @@ -597,20 +633,23 @@ export const PatientManager = () => { {patient.review_time && !patient.last_consultation?.discharge_date && Number(patient.last_consultation?.review_interval) > 0 && ( - + className="flex items-center gap-1" + > + + {dayjs().isAfter(patient.review_time) + ? `Review Missed ${Math.abs( + dayjs().diff(dayjs(patient.review_time), "days"), + )} days ago` + : `Review Due in ${Math.abs( + dayjs(patient.review_time).diff(dayjs(), "days"), + )} days`} + )} {patient.last_consultation?.is_readmission && ( @@ -753,74 +792,22 @@ export const PatientManager = () => { ); } + const queryField = (name: string, defaultValue?: T) => { + return { + name, + value: qParams[name] || defaultValue, + onChange: (e: FieldChangeEvent) => updateQuery({ [e.name]: e.value }), + }; + }; + const onlyAccessibleFacility = permittedFacilities?.count === 1 ? permittedFacilities.results[0] : null; - const searchOptions = [ - { - key: "phone_number", - label: "Phone Number", - type: "phone" as const, - placeholder: "Search_by_phone_number", - value: qParams.phone_number || "", - shortcutKey: "p", - }, - { - key: "name", - label: "Name", - type: "text" as const, - placeholder: "search_by_patient_name", - value: qParams.name || "", - shortcutKey: "n", - }, - { - key: "patient_no", - label: "IP/OP No", - type: "text" as const, - placeholder: "search_by_patient_no", - value: qParams.patient_no || "", - shortcutKey: "u", - }, - { - key: "emergency_contact_number", - label: "Emergency Contact Phone Number", - type: "phone" as const, - placeholder: "search_by_emergency_phone_number", - value: qParams.emergency_phone_number || "", - shortcutKey: "e", - }, - ]; - - const handleSearch = useCallback( - (key: string, value: string) => { - const updatedQuery = { - phone_number: - key === "phone_number" - ? value.length >= 13 || value === "" - ? value - : undefined - : undefined, - name: key === "name" ? value : undefined, - patient_no: key === "patient_no" ? value : undefined, - emergency_phone_number: - key === "emergency_contact_number" - ? value.length >= 13 || value === "" - ? value - : undefined - : undefined, - }; - - updateQuery(updatedQuery); - }, - [updateQuery], - ); - return (
@@ -999,23 +986,59 @@ export const PatientManager = () => { }} /> -
-
- +
+
+
+ +
+
+
+
+
+ + +
+
+ setPhoneNumber(e.value)} + types={["mobile", "landline"]} + className="w-full grow" + error={((phoneNumber || "+91") === "+91" && "") || undefined} + /> + setEmergencyPhoneNumber(e.value)} + types={["mobile", "landline"]} + className="w-full" + error={ + ((emergencyPhoneNumber || "+91") === "+91" && "") || undefined + } + /> +
+
- -
{ />
- +
{managePatients}
From ad568f9eb5d067ed7b88e38e0f7c288035e8761f Mon Sep 17 00:00:00 2001 From: SANCHARI SINGH <123357539+Sancharisingh@users.noreply.github.com> Date: Sun, 8 Dec 2024 00:04:33 +0530 Subject: [PATCH 10/13] Add files via upload --- src/components/ui/badge.tsx | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/components/ui/badge.tsx diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx new file mode 100644 index 00000000000..d22ad14147f --- /dev/null +++ b/src/components/ui/badge.tsx @@ -0,0 +1,38 @@ +import { type VariantProps, cva } from "class-variance-authority"; +import * as React from "react"; + +import { cn } from "@/lib/utils"; + +const badgeVariants = cva( + "inline-flex items-center rounded-md border border-gray-200 px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-gray-950 focus:ring-offset-2 dark:border-gray-800 dark:focus:ring-gray-300", + { + variants: { + variant: { + default: + "border-transparent bg-gray-900 text-gray-50 shadow hover:bg-gray-900/80 dark:bg-gray-50 dark:text-gray-900 dark:hover:bg-gray-50/80", + secondary: + "border-transparent bg-gray-100 text-gray-900 hover:bg-gray-100/80 dark:bg-gray-800 dark:text-gray-50 dark:hover:bg-gray-800/80", + destructive: + "border-transparent bg-red-500 text-gray-50 shadow hover:bg-red-500/80 dark:bg-red-900 dark:text-gray-50 dark:hover:bg-red-900/80", + outline: "text-gray-950 dark:text-gray-50", + purple: + "border-transparent bg-purple-200 text-purple-800 shadow hover:bg-purple-300 dark:bg-purple-900 dark:text-purple-200 dark:hover:bg-purple-800", + }, + }, + defaultVariants: { + variant: "default", + }, + }, +); + +export interface BadgeProps + extends React.HTMLAttributes, + VariantProps {} + +function Badge({ className, variant, ...props }: BadgeProps) { + return ( +
+ ); +} + +export { Badge, badgeVariants }; From e4bb04be63069bc0d567d2a38beb0f063f94e094 Mon Sep 17 00:00:00 2001 From: SANCHARI SINGH <123357539+Sancharisingh@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:22:09 +0530 Subject: [PATCH 11/13] Added a success variant and updated the purple variant as suggested. --- src/components/ui/badge.tsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx index d22ad14147f..b2c0ae20ff8 100644 --- a/src/components/ui/badge.tsx +++ b/src/components/ui/badge.tsx @@ -3,6 +3,12 @@ import * as React from "react"; import { cn } from "@/lib/utils"; +/** + * Badge component for displaying status indicators. + * @param variant - The visual style variant of the badge + * @param className - Additional CSS classes to apply + */ + const badgeVariants = cva( "inline-flex items-center rounded-md border border-gray-200 px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-gray-950 focus:ring-offset-2 dark:border-gray-800 dark:focus:ring-gray-300", { @@ -16,7 +22,9 @@ const badgeVariants = cva( "border-transparent bg-red-500 text-gray-50 shadow hover:bg-red-500/80 dark:bg-red-900 dark:text-gray-50 dark:hover:bg-red-900/80", outline: "text-gray-950 dark:text-gray-50", purple: - "border-transparent bg-purple-200 text-purple-800 shadow hover:bg-purple-300 dark:bg-purple-900 dark:text-purple-200 dark:hover:bg-purple-800", + "border-transparent bg-purple-200 text-purple-800 shadow hover:bg-purple-300 dark:bg-purple-900 dark:text-purple-100 dark:hover:bg-purple-900", + success: + "border-transparent bg-green-500 text-gray-50 shadow hover:bg-green-500/80 dark:bg-green-900 dark:text-gray-50 dark:hover:bg-green-900/80", }, }, defaultVariants: { @@ -31,8 +39,14 @@ export interface BadgeProps function Badge({ className, variant, ...props }: BadgeProps) { return ( -
+
); } export { Badge, badgeVariants }; + From b77f1238fdb0cbb76783bffb53d0be150abfdb48 Mon Sep 17 00:00:00 2001 From: SANCHARI SINGH <123357539+Sancharisingh@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:24:23 +0530 Subject: [PATCH 12/13] Added purple and success as suggested, remove destructive. --- src/components/Patient/ManagePatients.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Patient/ManagePatients.tsx b/src/components/Patient/ManagePatients.tsx index db9a12c916b..f16a427c922 100644 --- a/src/components/Patient/ManagePatients.tsx +++ b/src/components/Patient/ManagePatients.tsx @@ -637,7 +637,7 @@ export const PatientManager = () => { variant={ dayjs().isAfter(patient.review_time) ? "purple" - : "destructive" + : "success" } className="flex items-center gap-1" > From c6e8d7547ec9a8f76349222b51c20bd2a52b91a9 Mon Sep 17 00:00:00 2001 From: SANCHARI SINGH <123357539+Sancharisingh@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:40:59 +0530 Subject: [PATCH 13/13] Usage for review status --- src/components/ui/badge.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx index b2c0ae20ff8..f2188660576 100644 --- a/src/components/ui/badge.tsx +++ b/src/components/ui/badge.tsx @@ -7,8 +7,12 @@ import { cn } from "@/lib/utils"; * Badge component for displaying status indicators. * @param variant - The visual style variant of the badge * @param className - Additional CSS classes to apply + * // Usage for review status + * Review Missed + * Review Due in 2 days */ + const badgeVariants = cva( "inline-flex items-center rounded-md border border-gray-200 px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-gray-950 focus:ring-offset-2 dark:border-gray-800 dark:focus:ring-gray-300", {