+
Password
{
setPassword(event.target.value)
}}/>
+ { localStorage.getItem("profile") === "patient" ? <>> :
+ <>
+
+ profession
+ {
+ setProfession(event.target.value)
+ }}/>
+
+ >
+ }
diff --git a/src/components/Common/Navbar.js b/src/components/Common/Navbar.js
index 9cef0be..32a6bea 100644
--- a/src/components/Common/Navbar.js
+++ b/src/components/Common/Navbar.js
@@ -9,25 +9,41 @@ 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');
+ console.log(user);
+ console.log(prof);
+ 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 +59,26 @@ export default function MenuAppBar() {
{/*
About us
*/}
-
+ {
+ !auth &&
+
Login
-
+
+ }
+
+ {
+ auth && profile === "Patient" &&
+
+ Find Doctor
+
+ }
+
+ {
+ auth && profile !== "Patient" && userProfile.is_admin &&
+
+ Requests
+
+ }
{auth && (
diff --git a/src/components/Dashboard.js b/src/components/Dashboard.js
index e34821e..bf25080 100644
--- a/src/components/Dashboard.js
+++ b/src/components/Dashboard.js
@@ -3,27 +3,38 @@ 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';
+import UserProfile from './UserProfile';
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 (
-
);
}
\ 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}
- Approve
+ handleApprove(item)} className="btn btn-primary float-center">Approve
Reject
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/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 (
+
+
+ );
+}
+
+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.
+ {setSelectedHospital(event.target.value)}}
+ >
+ {hospital.map(ele => {
+ return ({ele.name} );
+ })}
+
+ {
+ hpr_profile.requested_hfr_id === "" ?
+ <>
+
+ Submit
+
+ > :
+ <>
+
+ Update
+
+ >
+ }
+
-
+ >
);
}
\ 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 (
+
{
+ handleClick(event, cellValues);
+ }}
+ sx={{ marginLeft: '25px' }}
+ >
+ View
+
+ );
+ }
+ },
+ ];
+
+ 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..991860f 100644
--- a/src/components/UserProfile.js
+++ b/src/components/UserProfile.js
@@ -4,104 +4,186 @@ 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";
+import { Navbar } from "@themesberg/react-bootstrap";
+
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");
+ let {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 (
+
+ Download document
+
+ );
+ }
+ },
+ ];
- {user}
-
- Profile: {profile}
+ 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);
+ 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
+
-
Address
+ Medical Details
-
-
-
-
- Cancel
- Update
+ 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. >)}
-
+
Let's Go