From 0293126f77668beeea9680fc3a5fafe7ec858b8b Mon Sep 17 00:00:00 2001 From: sonika <> Date: Tue, 5 Sep 2023 13:16:32 +0530 Subject: [PATCH] allpatient data --- src/Components/PatientForm/PatientForm.tsx | 55 ++++++++++++---------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/src/Components/PatientForm/PatientForm.tsx b/src/Components/PatientForm/PatientForm.tsx index b9f5c10..3c0dda8 100644 --- a/src/Components/PatientForm/PatientForm.tsx +++ b/src/Components/PatientForm/PatientForm.tsx @@ -20,21 +20,6 @@ import SystemReviewSection6 from './SyestemReviewSection6'; import RecreationalHobbiesSection7 from './RecreationalHobbiesSection7'; import OtherDetails8 from './OtherDetails8'; -interface Patient { - fullName: string; - homePhone: string; - cellPhone: string; - email: string; - age: number; - dateOfBirth: string; - socialSecurityNumber: string; - mailingAddress: string; - city: string; - state: string; - zipCode: string; - gender: string; - } - const Accordion = styled((props: AccordionProps) => ( ))(({ theme }) => ({ @@ -85,6 +70,8 @@ export default function PatientForm(){ const [section6Data, setSection6Data] = React.useState({}); const [section7Data, setSection7Data] = React.useState({}); const [section8Data, setSection8Data] = React.useState({}); + const [restructuredCurrentPatientData, setRestructuredCurrentPatientData] = React.useState({}); + const [allPatientData, setAllPatientData] = React.useState([]); const handleFormSection1Data = ( fullName?: string|undefined, @@ -316,10 +303,10 @@ export default function PatientForm(){ const handleFormSection8Data = ( familyHistory: string|undefined, sleep: string|undefined, - pillow:string|undefined, - orthotics:string|undefined, + pillow: string|undefined, + orthotics: string|undefined, brestExam: any, - pregnancy:string|undefined, + pregnancy: string|undefined, menstralCycle: any, ) =>{ setSection8Data({ @@ -331,11 +318,29 @@ export default function PatientForm(){ pregnancy, menstralCycle, }) - } + } - const handleSubmit = (event: React.FormEvent) => { - event.preventDefault(); + const handleSubmit = () => { + const newPatientData = { + section1: section1Data, + section2: section2Data, + section3: section3Data, + section4: section4Data, + section5: section5Data, + section6: section6Data, + section7: section7Data, + section8: section8Data, }; + + // Create a copy of the existing data array and push the new patient data + const updatedAllPatientData = [...allPatientData, newPatientData]; + + // Update the state with the new array + setAllPatientData(updatedAllPatientData); + + console.log("UpdatedallPatientData:", updatedAllPatientData); + }; + const handleExpandChange = (panel: string) => (event: React.SyntheticEvent, newExpanded: boolean) => { @@ -346,7 +351,6 @@ export default function PatientForm(){ setIsChecked(event.target.checked); }; - console.log("wyeytweevfde",section8Data) return( @@ -354,7 +358,7 @@ export default function PatientForm(){
-
+ {/* */} Confidential Patient Information @@ -472,17 +476,18 @@ export default function PatientForm(){ -
+ {/* */}