From ab1271f9370ed0c8f451a7ef15195a64c5252deb Mon Sep 17 00:00:00 2001 From: Manan Jethwani Date: Mon, 21 Aug 2023 01:07:02 +0530 Subject: [PATCH 1/2] integrated max parts --- package-lock.json | 301 +++++++++---------- src/App.css | 13 +- src/App.js | 10 +- src/components/BasicDetails.js | 43 ++- src/components/Common/Navbar.js | 32 +- src/components/Dashboard.js | 36 ++- src/components/Decision.js | 30 +- src/components/Forms/AddMedicalRecordForm.js | 46 +++ src/components/Forms/LoginForm.js | 93 ++++++ src/components/Forms/MedicalRecordsForm.js | 21 +- src/components/Forms/UserRegistrationForm.js | 1 - src/components/HealthProffRegister.js | 2 +- src/components/Home.js | 2 +- src/components/HospitalsData.js | 208 +++++-------- src/components/Patient.js | 158 ++++++++++ src/components/Profile.js | 1 - src/components/UserProfile.js | 169 ++++++++--- src/components/Welcome.js | 18 +- 18 files changed, 782 insertions(+), 402 deletions(-) create mode 100644 src/components/Forms/AddMedicalRecordForm.js create mode 100644 src/components/Forms/LoginForm.js create mode 100644 src/components/Patient.js diff --git a/package-lock.json b/package-lock.json index 1d83a55..4baf6b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2490,6 +2490,21 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@eslint/eslintrc/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/@eslint/eslintrc/node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -2520,6 +2535,11 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "node_modules/@eslint/eslintrc/node_modules/type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", @@ -5481,13 +5501,13 @@ } }, "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dependencies": { "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", "uri-js": "^4.2.2" }, "funding": { @@ -5511,34 +5531,6 @@ } } }, - "node_modules/ajv-formats/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ajv-formats/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, - "node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "peerDependencies": { - "ajv": "^6.9.1" - } - }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -5997,6 +5989,34 @@ "webpack": ">=2" } }, + "node_modules/babel-loader/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/babel-loader/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/babel-loader/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "node_modules/babel-loader/node_modules/schema-utils": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", @@ -7003,21 +7023,6 @@ } } }, - "node_modules/css-minimizer-webpack-plugin/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/css-minimizer-webpack-plugin/node_modules/ajv-keywords": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", @@ -7029,11 +7034,6 @@ "ajv": "^8.8.2" } }, - "node_modules/css-minimizer-webpack-plugin/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, "node_modules/css-minimizer-webpack-plugin/node_modules/schema-utils": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", @@ -8347,21 +8347,6 @@ "webpack": "^5.0.0" } }, - "node_modules/eslint-webpack-plugin/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/eslint-webpack-plugin/node_modules/ajv-keywords": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", @@ -8394,11 +8379,6 @@ "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/eslint-webpack-plugin/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, "node_modules/eslint-webpack-plugin/node_modules/schema-utils": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", @@ -8431,6 +8411,21 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/eslint/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/eslint/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -8525,6 +8520,11 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/eslint/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "node_modules/eslint/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -9034,6 +9034,29 @@ } } }, + "node_modules/fork-ts-checker-webpack-plugin/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/fork-ts-checker-webpack-plugin/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, "node_modules/fork-ts-checker-webpack-plugin/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -9116,6 +9139,11 @@ "node": ">=8" } }, + "node_modules/fork-ts-checker-webpack-plugin/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "node_modules/fork-ts-checker-webpack-plugin/node_modules/schema-utils": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz", @@ -12584,9 +12612,9 @@ "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" }, "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -13019,21 +13047,6 @@ "webpack": "^5.0.0" } }, - "node_modules/mini-css-extract-plugin/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/mini-css-extract-plugin/node_modules/ajv-keywords": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", @@ -13045,11 +13058,6 @@ "ajv": "^8.8.2" } }, - "node_modules/mini-css-extract-plugin/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, "node_modules/mini-css-extract-plugin/node_modules/schema-utils": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", @@ -16259,6 +16267,34 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/schema-utils/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/schema-utils/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/schema-utils/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "node_modules/select-hose": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", @@ -17575,6 +17611,19 @@ "is-typedarray": "^1.0.0" } }, + "node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", @@ -17932,21 +17981,6 @@ "webpack": "^4.0.0 || ^5.0.0" } }, - "node_modules/webpack-dev-middleware/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/webpack-dev-middleware/node_modules/ajv-keywords": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", @@ -17958,11 +17992,6 @@ "ajv": "^8.8.2" } }, - "node_modules/webpack-dev-middleware/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, "node_modules/webpack-dev-middleware/node_modules/schema-utils": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", @@ -18039,21 +18068,6 @@ } } }, - "node_modules/webpack-dev-server/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/webpack-dev-server/node_modules/ajv-keywords": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", @@ -18065,11 +18079,6 @@ "ajv": "^8.8.2" } }, - "node_modules/webpack-dev-server/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, "node_modules/webpack-dev-server/node_modules/schema-utils": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", @@ -18368,21 +18377,6 @@ "node": ">=10.0.0" } }, - "node_modules/workbox-build/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/workbox-build/node_modules/fs-extra": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", @@ -18397,11 +18391,6 @@ "node": ">=10" } }, - "node_modules/workbox-build/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, "node_modules/workbox-build/node_modules/source-map": { "version": "0.8.0-beta.0", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", diff --git a/src/App.css b/src/App.css index da6df07..5811921 100644 --- a/src/App.css +++ b/src/App.css @@ -74,7 +74,7 @@ margin-left: 50px; margin-right: 40px; display: flex; - background-image: url('/Users/varisharashid/blockchain/src/assets/icons/bg.jpeg'); + background-image: url('/Users/mananjethwani/personal/Private-Blockchain-EHR-DAPP/PHR_Blockchain/src/assets/icons/bg.jpeg'); } .choose-box{ @@ -378,4 +378,15 @@ label { .mx-t3{ margin-top: -3rem; +} + +.login-box{ + height: 28rem; + box-shadow: 0px 0px 5px 1px #999; + margin-left: 200px; + width: 70%; + display: flex; + padding-top: 45px; + flex-direction: column; + align-items: center; } \ No newline at end of file diff --git a/src/App.js b/src/App.js index e288c5b..a4e52b8 100644 --- a/src/App.js +++ b/src/App.js @@ -17,16 +17,17 @@ import OrgRegister from './components/BasicDetails' import HealthProffRegister from './components/HealthProffRegister' import Hospitals from './components/HospitalsData' import Decision from './components/Decision'; +import Login from './components/Forms/LoginForm'; function App() { const user = localStorage.getItem('user'); - const [auth, setAuth] = React.useState(true); + let [auth, setAuth] = React.useState(true); React.useEffect(() => { if (user === null) { - setAuth = false; + setAuth(false); } }) @@ -52,7 +53,7 @@ function App() { } /> - } /> + } /> } /> @@ -81,6 +82,9 @@ function App() { } /> + + } /> + ); diff --git a/src/components/BasicDetails.js b/src/components/BasicDetails.js index 8a0a6d3..c38f508 100644 --- a/src/components/BasicDetails.js +++ b/src/components/BasicDetails.js @@ -1,6 +1,7 @@ import * as React from 'react'; import { useState, useEffect } from 'react' import { useNavigate } from 'react-router-dom'; +import axios from "axios"; export default function BasicDetails() { @@ -13,36 +14,48 @@ export default function BasicDetails() { const [state, setState] = useState('Jharkhand') const [password, setPassword] = useState('varru1029') const [phone, setPhone] = useState('9931230984') + const [profession, setProfession] = useState(''); useEffect(() => { if (localStorage.getItem('user') === null) { - setAuth = false; + setAuth(false); } }, []) const navigate = useNavigate(); - function handleSubmit(event) { + async function handleSubmit(event) { event.preventDefault(); console.log(event) let basicData = { - name: name, + patientName: name, email: email, - address: address, + location: address, dob: dob, gender: gender, state: state, password: password, phone: phone, - } - localStorage.setItem('basicDetails', JSON.stringify(basicData)) - let details = JSON.parse(localStorage.getItem('basicDetails')) - navigate('/medical') + if (localStorage.getItem("profile") === "patient") { + localStorage.setItem('basicDetails', JSON.stringify(basicData)) + navigate('/medical') + } else { + let { data } = await axios.post("http://localhost:3001/HPR", { + hpr_details: { + ...basicData, + profession, + adhar_number: localStorage.getItem('aadhar') + } + }); + localStorage.setItem('HPR_details', JSON.stringify(data)); + localStorage.setItem('user', JSON.stringify(data)); + navigate("/hospitals") + } } return ( @@ -312,18 +325,28 @@ export default function BasicDetails() { -
+
{ setPhone(event.target.value) }}/>
-
+
{ setPassword(event.target.value) }}/>
+ { localStorage.getItem("profile") === "patient" ? <> : + <> +
+ + { + setProfession(event.target.value) + }}/> +
+ + } diff --git a/src/components/Common/Navbar.js b/src/components/Common/Navbar.js index 9cef0be..b4d105a 100644 --- a/src/components/Common/Navbar.js +++ b/src/components/Common/Navbar.js @@ -9,25 +9,39 @@ import AccountCircle from '@mui/icons-material/AccountCircle'; import MenuItem from '@mui/material/MenuItem'; import Menu from '@mui/material/Menu'; import { Link } from '@mui/material'; +import Button from '@mui/material/Button'; +import { useNavigate } from 'react-router-dom'; export default function MenuAppBar() { const [auth, setAuth] = React.useState(true); const [anchorEl, setAnchorEl] = React.useState(null); + const [userProfile, setUserProfile] = React.useState({}); + const [profile, setProfile] = React.useState() + const navigate = useNavigate(); React.useEffect(() => { if (localStorage.getItem('user') === null) { - setAuth = false; + setAuth(false); } + if (localStorage.getItem('user') !== null) { + let user = JSON.parse(localStorage.getItem('user')); + let prof = localStorage.getItem('profile'); + setUserProfile(user); + setProfile(prof); + } }, []) const handleMenu = (event) => { setAnchorEl(event.currentTarget); }; - const handleClose = () => { + const handleClose = (event) => { setAnchorEl(null); + localStorage.clear(); + event.preventDefault(); + navigate("/"); }; return ( @@ -43,9 +57,19 @@ export default function MenuAppBar() { {/* About us */} - + { + !auth && + + } + + { + auth && profile !== "patient" && userProfile.is_admin && + + } {auth && ( diff --git a/src/components/Dashboard.js b/src/components/Dashboard.js index e34821e..a5544fc 100644 --- a/src/components/Dashboard.js +++ b/src/components/Dashboard.js @@ -3,27 +3,37 @@ import * as React from 'react'; import { Button, Typography } from "@mui/material"; import Navbar from './Common/Navbar'; import { Link } from 'react-router-dom'; +import {useEffect, useState} from 'react'; +import FindPatient from './Patient'; +import Hospitals from './HospitalsData'; export default function Dashboard() { + let [profile, setProfile] = useState(); + let [userDetails, setUserDetails] = useState(); + + useEffect(() => { + let prof = localStorage.getItem("profile"); + let user = JSON.parse(localStorage.getItem("user")); + console.log(user); + setUserDetails(user); + setProfile(prof); + }, []); + return (
- - Dashboard - - - - Find Doctor anywhere in the world - - - Medical History - - + { + profile === "patient" ? + <> + + : + <> + {userDetails && userDetails.HFR_id === "" ? : } + + }
-
- ); } \ No newline at end of file diff --git a/src/components/Decision.js b/src/components/Decision.js index d1ed351..8fef71b 100644 --- a/src/components/Decision.js +++ b/src/components/Decision.js @@ -1,13 +1,33 @@ - - import * as React from 'react'; import Navbar from './Common/Navbar'; import { Typography } from '@mui/material'; +import {useEffect, useState} from "react"; +import axios from "axios"; export default function Decision() { + let [data, setData] = useState([]); + + useEffect(() => { + let user = JSON.parse(localStorage.getItem("user")); + console.log(user); + console.log(`http://localhost:3001/link-request?HFR_id=${user.HFR_id}`); + axios.get(`http://localhost:3001/link-request?HFR_id=${user.HFR_id}`).then(({data}) => { + setData(data); + }) + }, []); + + async function handleApprove(item) { + console.log(item); + let {data} = await axios.post("http://localhost:3001/approve-link-request", { + request_details: { + id: item.id + } + }); + setData(data); + } - const data = [ + const dat = [ { "name": "Vikram", "adhar_number": "1234121313341", @@ -45,14 +65,14 @@ export default function Decision() { {data.map((item,ind) => (
- Name: {item.name} + Name: {item.patientName} {/*
*/} Profession: {item.profession} Phone: {item.phone} - +
diff --git a/src/components/Forms/AddMedicalRecordForm.js b/src/components/Forms/AddMedicalRecordForm.js new file mode 100644 index 0000000..12f4719 --- /dev/null +++ b/src/components/Forms/AddMedicalRecordForm.js @@ -0,0 +1,46 @@ +import { Typography } from '@mui/material'; +import * as React from 'react'; + +export default function AddMedicalRecordForm() { + + + function handleSubmit(data) { + console.log(data) + } + + return ( +
+
+ + + Add Medical Record + + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+
+
+ + ); +} \ No newline at end of file diff --git a/src/components/Forms/LoginForm.js b/src/components/Forms/LoginForm.js new file mode 100644 index 0000000..24bc581 --- /dev/null +++ b/src/components/Forms/LoginForm.js @@ -0,0 +1,93 @@ +import {useEffect, useState} from "react"; +import axios from "axios"; +import FormControl from '@mui/material/FormControl'; +import Select from '@mui/material/Select'; +import MenuItem from '@mui/material/MenuItem'; +import Button from '@mui/material/Button'; +import InputLabel from '@mui/material/InputLabel'; +import Radio from '@mui/material/Radio'; +import RadioGroup from '@mui/material/RadioGroup'; +import FormControlLabel from '@mui/material/FormControlLabel'; +import { Typography } from "@mui/material"; +import { useNavigate } from 'react-router-dom'; + + +let Login = () => { + const [password, setPassword] = useState('varru1029') + const [profile, setProfile] = useState('Patient') + const [aadhar, setAadhar] = useState('993123098489') + + const navigate = useNavigate(); + + async function handleSubmit(event) { + event.preventDefault() + localStorage.setItem("profile", profile) + if (profile === "Patient") { + let {data} = await axios.post("http://localhost:3001/login-patient", { + login_details: { + adhar_number: aadhar, + password: password + } + }); + localStorage.setItem("user", JSON.stringify(data)); + } else { + let {data} = await axios.post("http://localhost:3001/login/HPR", { + login: { + adhar_number: aadhar, + password: password + } + }); + localStorage.setItem("user", JSON.stringify(data)); + localStorage.setItem("HPR_details", JSON.stringify(data)); + } + navigate("/dashboard"); + } + return ( +
+ + Login + +
+
+
+
+ + { + setAadhar(event.target.value) + }} /> +
+ +
+ + { + setProfile(event.target.value) + }} + sx={{ marginLeft: '120px', marginTop: '15px' }} + > + } label="Patient" /> + } label="Health Professional" /> + +
+ +
+ + { + setPassword(event.target.value) + }} /> +
+
+ +
+
+
+
+
+ + ); +} + +export default Login; \ No newline at end of file diff --git a/src/components/Forms/MedicalRecordsForm.js b/src/components/Forms/MedicalRecordsForm.js index fbdc5e6..f839bf3 100644 --- a/src/components/Forms/MedicalRecordsForm.js +++ b/src/components/Forms/MedicalRecordsForm.js @@ -9,6 +9,7 @@ import ImageList from '@mui/material/ImageList'; import ImageListItem from '@mui/material/ImageListItem'; import yoga from '../../assets/icons/yoga.png'; import { useNavigate } from 'react-router-dom'; +import axios from 'axios'; export default function MedicalRecordsForm() { @@ -32,7 +33,7 @@ export default function MedicalRecordsForm() { const navigate = useNavigate(); - function handleSubmit(event) { + async function handleSubmit(event) { event.preventDefault(); @@ -46,13 +47,21 @@ export default function MedicalRecordsForm() { let basicDetails = JSON.parse(localStorage.getItem('basicDetails')) let finalDetails = { - basicDetails, - medicalData, - aadhar: localStorage.getItem('aadhar'), + ...basicDetails, + ...medicalData, + adhar_number: localStorage.getItem('aadhar'), }; - localStorage.setItem('userDetails', JSON.stringify(finalDetails)) - // navigate('/dashboard') + // allergies, blood group and illness not setting up + + let { data } = await axios.post("http://localhost:3001/patient", { + patient_details: { + ...finalDetails + } + }); + + localStorage.setItem('patientDetails', JSON.stringify(data)) + navigate('/dashboard') } const allergies = [ diff --git a/src/components/Forms/UserRegistrationForm.js b/src/components/Forms/UserRegistrationForm.js index b6945df..e66ebd5 100644 --- a/src/components/Forms/UserRegistrationForm.js +++ b/src/components/Forms/UserRegistrationForm.js @@ -13,7 +13,6 @@ export default function UserRegistrationForm() { useEffect(() => { localStorage.setItem('aadhar', aadhar) - },[aadhar]); diff --git a/src/components/HealthProffRegister.js b/src/components/HealthProffRegister.js index accabcd..8c3b15e 100644 --- a/src/components/HealthProffRegister.js +++ b/src/components/HealthProffRegister.js @@ -8,7 +8,7 @@ export default function OrgRegister() { React.useEffect(() => { if (localStorage.getItem('user') === null) { - setAuth = false; + setAuth(false); } }, []) diff --git a/src/components/Home.js b/src/components/Home.js index 10f6c81..18cb777 100644 --- a/src/components/Home.js +++ b/src/components/Home.js @@ -15,7 +15,7 @@ export default function Home() { React.useEffect(() => { if (localStorage.getItem('user') === null) { - setAuth = false; + setAuth(false); } }, []) diff --git a/src/components/HospitalsData.js b/src/components/HospitalsData.js index 9392da3..42b1453 100644 --- a/src/components/HospitalsData.js +++ b/src/components/HospitalsData.js @@ -1,152 +1,84 @@ import * as React from 'react'; -import Box from '@mui/material/Box'; -import { DataGrid } from '@mui/x-data-grid'; import { Typography } from '@mui/material'; +import { useEffect, useState } from 'react'; +import InputLabel from '@mui/material/InputLabel'; +import axios from "axios"; +import FormControl from '@mui/material/FormControl'; +import Select from '@mui/material/Select'; +import MenuItem from '@mui/material/MenuItem'; +import Button from '@mui/material/Button'; +import Navbar from './Common/Navbar'; -const columns = [ - { field: 'id', headerName: 'S.No', width: 100 }, - { - field: 'hospitalName', - headerName: 'Hospital Name', - width: 130, - editable: false, - }, - { - field: 'adminName', - headerName: 'Owner Name', - width: 150, - editable: false, - }, - { - field: 'address', - headerName: 'Address', - width: 200, - editable: false, - }, - { - field: 'state', - headerName: 'State', - width: 100, - editable: false, - }, - { - field: 'establishmentYear', - headerName: 'Establishment Year', - type: 'number', - width: 100, - editable: false, - } -]; - -const rows = [ - { - id: 1, - hospitalName: 'Apollo Hospital', - adminName: 'Dr. Rajesh Sharma', - address: '123 Main Street, New Delhi', - establishmentYear: 1990, - state: 'Jharkhand' - }, - { - id: 2, - hospitalName: 'Fortis Healthcare', - adminName: 'Dr. Nisha Patel', - address: '456 Park Avenue, Mumbai', - establishmentYear: 1985, - state: 'Jharkhand' - }, - { - id: 3, - hospitalName: 'AIIMS Hospital', - adminName: 'Dr. Manoj Verma', - address: '789 Central Road, Kolkata', - establishmentYear: 1956, - state: 'Jharkhand' - }, - { - id: 4, - hospitalName: 'Columbia Asia Hospital', - adminName: 'Dr. Sunita Reddy', - address: '234 South Street, Bangalore', - establishmentYear: 2000, - state: 'Jharkhand' - }, - { - id: 5, - hospitalName: 'Medanta - The Medicity', - adminName: 'Dr. Vikram Singh', - address: '567 North Avenue, Gurgaon', - establishmentYear: 2009, - state: 'Jharkhand' - }, - { - id: 6, - hospitalName: 'Manipal Hospital', - adminName: 'Dr. Deepa Shah', - address: '890 East Road, Pune', - establishmentYear: 1997, - state: 'Jharkhand' - }, - { - id: 7, - hospitalName: 'Max Healthcare', - adminName: 'Dr. Anand Kapoor', - address: '123 West Lane, Noida', - establishmentYear: 2001, - state: 'Jharkhand' - }, - { - id: 8, - hospitalName: 'Artemis Hospital', - adminName: 'Dr. Aparna Singh', - address: '456 Outer Circle, Gurgaon', - establishmentYear: 2007, - state: 'Jharkhand' - }, - { - id: 9, - hospitalName: 'Narayana Health', - adminName: 'Dr. Rahul Sharma', - address: '789 Inner Avenue, Bangalore', - establishmentYear: 2000, - state: 'Jharkhand' - }, - { - id: 10, - hospitalName: 'KIMS Hospital', - adminName: 'Dr. Shruti Das', - address: '234 Main Road, Hyderabad', - establishmentYear: 1988, - state: 'Jharkhand' - }, -]; +export default function Hospitals() { + let [hospital, setHospital] = useState([]); + let [selectedHosptial, setSelectedHospital] = useState(""); + let [hpr_profile, setHpr_profile] = useState({}); + async function handleSubmit(event) { + event.preventDefault(); + let {data} = await axios.post("http://localhost:3001/link-request", { + request_details: { + "HPR_id": hpr_profile.HPR_id, + "HFR_id": selectedHosptial + } + }) + setHpr_profile(data); + localStorage.setItem("HPR_details", JSON.stringify(data)); + localStorage.setItem("user", JSON.stringify(data)); + } + useEffect(() => { + let HPR_profile = JSON.parse(localStorage.getItem("HPR_details")); + console.log(HPR_profile); + setHpr_profile(HPR_profile); + if (HPR_profile.requested_hfr_id !== "") { + setSelectedHospital(HPR_profile.requested_hfr_id); + } + axios.get("http://localhost:3001/hospitals").then(({data}) => { + setHospital(data.hospitals); + }); + }, []) -export default function Hospitals() { return ( -
+ <> + +
- Find Hospitals + Choose Hospital
+
+ + {(hpr_profile.requested_hfr_id === "" ? <>Hey {hpr_profile.name}, kindly mention the health care organisation you want to be associated with. : <>Looks like you profile is under review, kindly wait or update the health care organisation to approve you request.)}
- - - + + Health Care Org. + + { + hpr_profile.requested_hfr_id === "" ? + <> + + : + <> + + + } +
- + ); } \ No newline at end of file diff --git a/src/components/Patient.js b/src/components/Patient.js new file mode 100644 index 0000000..81f1dee --- /dev/null +++ b/src/components/Patient.js @@ -0,0 +1,158 @@ +import React, { useState, useEffect } from 'react'; +import Navbar from './Common/Navbar'; +import { Typography } from '@mui/material'; +import Box from '@mui/material/Box'; +import { DataGrid } from '@mui/x-data-grid'; +import SearchIcon from '@mui/icons-material/Search'; +import TextField from '@mui/material/TextField'; +import Button from '@mui/material/Button'; +import axios from "axios"; +import { useNavigate } from 'react-router-dom'; + +export default function FindPatient() { + + const navigate = useNavigate(); + + const handleClick = (event, cellValues) => { + navigate(`/profile/${cellValues.row.aadhar}`) + }; + + function calculate_age(dob) { + var diff_ms = Date.now() - new Date(dob); + var age_dt = new Date(diff_ms); + + return Math.abs(age_dt.getUTCFullYear() - 1970); + } + + useEffect(() => { + axios.get("http://localhost:3001/patients").then(({data}) => { + console.log(data); + data = data.map((ele, idx) => { + ele.age = calculate_age(ele.dob); + ele.id = idx+1; + ele.aadhar = ele.adhar_number; + return ele; + }) + setRows(data); + }) + }, []) + + + const columns = [ + { field: 'id', headerName: 'S.No', width: 90 }, + { + field: 'aadhar', + headerName: 'Aadhar', + width: 130, + editable: false, + }, + { + field: 'patientName', + headerName: 'Patient Name', + width: 150, + editable: false, + }, + { + field: 'gender', + headerName: 'Gender', + width: 130, + editable: false, + }, + { + field: 'location', + headerName: 'Location', + width: 120, + editable: false, + }, + { + field: 'age', + headerName: 'Age', + type: 'number', + width: 70, + editable: false, + }, + { + field: "View profile", + width: 100, + renderCell: (cellValues) => { + return ( + + ); + } + }, + ]; + + const [rows, setRows] = useState([]) + + async function searchPatient(event) { + const inputAadharNumber = event.target.value.trim(); + console.log(inputAadharNumber); + if (inputAadharNumber === "") { + axios.get("http://localhost:3001/patients").then(({data}) => { + console.log(data); + data = data.map((ele, idx) => { + ele.age = calculate_age(ele.dob); + ele.id = idx+1; + ele.aadhar = ele.adhar_number; + return ele; + }) + setRows(data); + }) + return; + } + + let {data} = await axios.get(`http://localhost:3001/patient?adhar_number=${inputAadharNumber}`); + data = data.map((ele, idx) => { + ele.age = calculate_age(ele.dob); + ele.id = idx+1; + ele.aadhar = ele.adhar_number; + return ele; + }) + setRows(data || []); + + }; + + return ( +
+ + Search Patient by Aadhar Number + + + + + + +
+ + + +
+
+ ); +} \ No newline at end of file diff --git a/src/components/Profile.js b/src/components/Profile.js index b17d149..3598891 100644 --- a/src/components/Profile.js +++ b/src/components/Profile.js @@ -21,7 +21,6 @@ export default function Dashboard() { React.useEffect(() => { localStorage.setItem('profile', profile) - },[profile]); function handleSubmit(event){ diff --git a/src/components/UserProfile.js b/src/components/UserProfile.js index cf5a997..a2a66e8 100644 --- a/src/components/UserProfile.js +++ b/src/components/UserProfile.js @@ -4,104 +4,181 @@ import * as React from 'react'; import { styled } from '@mui/material/styles'; import Paper from '@mui/material/Paper'; import Box from '@mui/material/Box'; -import { Typography } from "@mui/material"; +import { Button, Typography } from "@mui/material"; +import {useState, useEffect} from 'react'; +import axios from "axios"; +import {useParams} from "react-router-dom"; +import { DataGrid } from "@mui/x-data-grid"; + export default function UserProfile() { - const Item = styled(Paper)(({ theme }) => ({ - backgroundColor: theme.palette.mode === 'dark' ? '#1A2027' : '#fff', - ...theme.typography.body2, - padding: theme.spacing(1), - textAlign: 'center', - color: theme.palette.text.secondary, - })); + let [medicalData, setMedicalData] = useState({}); + let [personalDetails, setPersonalDetails] = useState({}); + let [record, setRecord] = useState([]); + let [profile, setProfile] = useState("patient"); + const {id} = useParams(); - const user = localStorage.getItem('user'); - const profile = localStorage.getItem('profile'); + let handleClick = () => { - return ( -
+ } - - - + const columns = [ + { + field: 'doctor_name', + headerName: 'Doctor Name', + width: 130, + editable: false, + }, + { + field: 'illnes', + headerName: 'Illnes', + width: 150, + editable: false, + }, + { + field: 'organisation_name', + headerName: 'Organisation name', + width: 200, + editable: false, + }, + { + field: 'date_of_diagnose', + headerName: 'Date of Diagnose', + width: 140, + editable: false, + }, + { + field: "health record document", + width: 250, + renderCell: (cellValues) => { + return ( + + ); + } + }, + ]; - {user} - - Profile: {profile} + useEffect(() => { + let prof = localStorage.getItem("profile"); + setProfile(prof); + axios.get(`http://localhost:3001/patient/record?adhar_number=${id}`) + .then(({data}) => { + console.log(data); + let userDetails = data.patient_details; + setMedicalData({ + height: userDetails.height, + weight: userDetails.weight, + disease: userDetails.disease, + allergies: userDetails.allergies, + bloodGroup: userDetails.bloodGroup, + }) + setPersonalDetails({ + name: userDetails.patientName, + email: userDetails.email, + address: userDetails.location, + dob: userDetails.dob, + gender: userDetails.gender, + state: userDetails.state, + password: userDetails.password, + phone: userDetails.phone + }) + setRecord(data.record); + }) + }, []) + - + return ( + <> +
-
+
-
Personal Details
+ Personal Details +
- - + Name +

{personalDetails.name}

- - + Email +

{personalDetails.email}

- - + Phone +

{personalDetails.phone}

- - + Address +

{personalDetails.address}

-
Address
+ Medical Details
- - + Height +

{medicalData.height}

- - + Weight +

{medicalData.weight}

- - + Chronic Illness +

{medicalData.disease}

- - -
-
-
-
-
-
- - + Allergies +

{medicalData.allergies}

+
+
+ + +
+ ); } \ No newline at end of file diff --git a/src/components/Welcome.js b/src/components/Welcome.js index 2896143..f200c1f 100644 --- a/src/components/Welcome.js +++ b/src/components/Welcome.js @@ -7,7 +7,6 @@ import { Typography } from '@mui/material'; import ImageList from '@mui/material/ImageList'; import ImageListItem from '@mui/material/ImageListItem'; import Button from '@mui/material/Button'; -import { useNavigate } from 'react-router-dom'; export default function Welcome(props) { @@ -17,19 +16,6 @@ export default function Welcome(props) { title: 'Welcome', }, ] - - const navigate = useNavigate(); - - function handleSubmit(){ - // console.log(localStorage.getItem('profile')) - if (localStorage.getItem('profile') === 'patient'){ - navigate('/basicDetails') - } - else { - navigate('/hospitals') - } - } - return (
@@ -51,9 +37,9 @@ export default function Welcome(props) { Welcome

{props.name}

- We will need some more information of your health profile + {(localStorage.getItem("profile") === "patient" ? <>We will need some more information of your health profile : <>We will require some more details to get you registered to national health stack!

Don't worry your Healthcare professional Id is safe with us.

)}
- From 1c6f04d8a29d0356bfb6e900d7bd2e5930635559 Mon Sep 17 00:00:00 2001 From: Manan Jethwani Date: Mon, 21 Aug 2023 01:22:47 +0530 Subject: [PATCH 2/2] added profile to dashboard --- src/components/Common/Navbar.js | 11 +++- src/components/Dashboard.js | 5 +- src/components/DoctorRecords.js | 95 ++++----------------------------- src/components/UserProfile.js | 9 +++- 4 files changed, 31 insertions(+), 89 deletions(-) diff --git a/src/components/Common/Navbar.js b/src/components/Common/Navbar.js index b4d105a..32a6bea 100644 --- a/src/components/Common/Navbar.js +++ b/src/components/Common/Navbar.js @@ -28,6 +28,8 @@ export default function MenuAppBar() { if (localStorage.getItem('user') !== null) { let user = JSON.parse(localStorage.getItem('user')); let prof = localStorage.getItem('profile'); + console.log(user); + console.log(prof); setUserProfile(user); setProfile(prof); } @@ -65,7 +67,14 @@ export default function MenuAppBar() { } { - auth && profile !== "patient" && userProfile.is_admin && + auth && profile === "Patient" && + + } + + { + auth && profile !== "Patient" && userProfile.is_admin && diff --git a/src/components/Dashboard.js b/src/components/Dashboard.js index a5544fc..bf25080 100644 --- a/src/components/Dashboard.js +++ b/src/components/Dashboard.js @@ -6,6 +6,7 @@ import { Link } from 'react-router-dom'; import {useEffect, useState} from 'react'; import FindPatient from './Patient'; import Hospitals from './HospitalsData'; +import UserProfile from './UserProfile'; export default function Dashboard() { @@ -25,9 +26,9 @@ export default function Dashboard() {
{ - profile === "patient" ? + profile === "Patient" ? <> - + : <> {userDetails && userDetails.HFR_id === "" ? : } diff --git a/src/components/DoctorRecords.js b/src/components/DoctorRecords.js index e66693f..91dac41 100644 --- a/src/components/DoctorRecords.js +++ b/src/components/DoctorRecords.js @@ -47,97 +47,24 @@ const columns = [ const rows = [ { id: 1, - specialty: 'Cardiology', - doctorName: 'Dr. John Smith', - qualification: 'MD, Cardiologist', - location: 'New York', - age: 40, - experience: 15, + specialty: 'Oncologist', + doctorName: 'Vikram Shah', + qualification: 'MD, Oncology', + location: 'Jabalpur, India', + age: 55, + experience: 20, }, { id: 2, specialty: 'Dermatology', - doctorName: 'Dr. Emily Johnson', - qualification: 'MD, Dermatologist', - location: 'Los Angeles', - age: 35, + doctorName: 'Snehalatha Alapati', + qualification: 'MD, Dermatology', + location: 'Bengaluru, India', + age: 40, experience: 10, - }, - { - id: 3, - specialty: 'Orthopedics', - doctorName: 'Dr. Michael Brown', - qualification: 'MD, Orthopedic Surgeon', - location: 'Chicago', - age: 45, - experience: 20, - }, - { - id: 4, - specialty: 'Pediatrics', - doctorName: 'Dr. Sarah Davis', - qualification: 'MD, Pediatrician', - location: 'Houston', - age: 32, - experience: 7, - }, - { - id: 5, - specialty: 'Neurology', - doctorName: 'Dr. Robert Wilson', - qualification: 'MD, Neurologist', - location: 'San Francisco', - age: 50, - experience: 25, - }, - { - id: 6, - specialty: 'Gastroenterology', - doctorName: 'Dr. Lisa Anderson', - qualification: 'MD, Gastroenterologist', - location: 'Miami', - age: 38, - experience: 12, - }, - { - id: 7, - specialty: 'Ophthalmology', - doctorName: 'Dr. David Lee', - qualification: 'MD, Ophthalmologist', - location: 'Seattle', - age: 42, - experience: 18, - }, - { - id: 8, - specialty: 'Psychiatry', - doctorName: 'Dr. Jennifer Martinez', - qualification: 'MD, Psychiatrist', - location: 'Boston', - age: 39, - experience: 14, - }, - { - id: 9, - specialty: 'Obstetrics and Gynecology', - doctorName: 'Dr. Maria Rodriguez', - qualification: 'MD, OB/GYN', - location: 'Dallas', - age: 37, - experience: 11, - }, - { - id: 10, - specialty: 'Urology', - doctorName: 'Dr. James White', - qualification: 'MD, Urologist', - location: 'Phoenix', - age: 48, - experience: 22, - }, + } ]; - export default function DataGridDemo() { return (
diff --git a/src/components/UserProfile.js b/src/components/UserProfile.js index a2a66e8..991860f 100644 --- a/src/components/UserProfile.js +++ b/src/components/UserProfile.js @@ -9,6 +9,7 @@ import {useState, useEffect} from 'react'; import axios from "axios"; import {useParams} from "react-router-dom"; import { DataGrid } from "@mui/x-data-grid"; +import { Navbar } from "@themesberg/react-bootstrap"; export default function UserProfile() { @@ -16,7 +17,7 @@ export default function UserProfile() { let [personalDetails, setPersonalDetails] = useState({}); let [record, setRecord] = useState([]); let [profile, setProfile] = useState("patient"); - const {id} = useParams(); + let {id} = useParams(); let handleClick = () => { @@ -55,7 +56,7 @@ export default function UserProfile() { @@ -67,6 +68,10 @@ export default function UserProfile() { useEffect(() => { let prof = localStorage.getItem("profile"); setProfile(prof); + if (!id) { + let userDetails = JSON.parse(localStorage.getItem("user")); + id = userDetails.patient_details.adhar_number; + } axios.get(`http://localhost:3001/patient/record?adhar_number=${id}`) .then(({data}) => { console.log(data);