From 81fb560898dd83aeffdd456211de5fc402312095 Mon Sep 17 00:00:00 2001 From: vipeeshpavithran Date: Thu, 7 Sep 2023 14:31:45 +0530 Subject: [PATCH 1/5] Screen responsive changes --- .../PatientForm/PersonalSection1.tsx | 884 ++++++++++-------- 1 file changed, 515 insertions(+), 369 deletions(-) diff --git a/src/Components/PatientForm/PersonalSection1.tsx b/src/Components/PatientForm/PersonalSection1.tsx index bd55434..4681b2d 100644 --- a/src/Components/PatientForm/PersonalSection1.tsx +++ b/src/Components/PatientForm/PersonalSection1.tsx @@ -1,389 +1,535 @@ import * as React from 'react'; -import { Button, FormControl, FormControlLabel, FormLabel, Grid, Paper, Radio, RadioGroup, TextField } from '@mui/material'; +import { + Button, + FormControl, + FormControlLabel, + FormLabel, + Grid, + Paper, + Radio, + RadioGroup, + TextField, +} from '@mui/material'; import { LocalizationProvider, DatePicker } from '@mui/x-date-pickers'; import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; import { useEffect } from 'react'; interface Patient { - fullName: string; - homePhone: string; - cellPhone: string; - email: string; - age: number | string; - dateOfBirth: string; - socialSecurityNumber: string; - mailingAddress: string; - city: string; - state: string; - zipCode: string; - gender: string; - } + fullName: string; + homePhone: string; + cellPhone: string; + email: string; + age: number | string; + dateOfBirth: string; + socialSecurityNumber: string; + mailingAddress: string; + city: string; + state: string; + zipCode: string; + gender: string; +} - type Props = { - handleFormSection1Data:( - fullName?: string|undefined, - homePhone?: string|undefined, - cellPhone?: string|undefined, - email?: string|undefined, - age?: number|undefined|string, - dateOfBirth?: string|undefined, - socialSecurityNumber?: string|undefined, - mailingAddress?: string|undefined, - city?: string|undefined, - state?: string|undefined, - zipCode?: string|undefined, - gender?: string|undefined, - )=> void - patientDataDiplay:any; - type:string; - } - +type Props = { + handleFormSection1Data: ( + fullName?: string | undefined, + homePhone?: string | undefined, + cellPhone?: string | undefined, + email?: string | undefined, + age?: number | undefined | string, + dateOfBirth?: string | undefined, + socialSecurityNumber?: string | undefined, + mailingAddress?: string | undefined, + city?: string | undefined, + state?: string | undefined, + zipCode?: string | undefined, + gender?: string | undefined + ) => void; + patientDataDiplay: any; + type: string; +}; -export default function PersonalSection({handleFormSection1Data,patientDataDiplay,type}:Props){ +export default function PersonalSection({ + handleFormSection1Data, + patientDataDiplay, + type, +}: Props) { + const [birthDateValue, setBirthDateValue] = React.useState(); + const [patient, setPatient] = React.useState({ + fullName: '', + fullNameError: false, + homePhone: '', + cellPhone: '', + cellPhoneError: false, + email: '', + emailError: false, + age: '', + ageError: false, + dateOfBirth: birthDateValue, + socialSecurityNumber: '', + mailingAddress: '', + mailingAddressFalse: false, + city: '', + state: '', + zipCode: '', + gender: 'male', + }); - const [birthDateValue, setBirthDateValue] = React.useState(); - const [patient, setPatient] = React.useState({ - fullName: "", - fullNameError:false, - homePhone: "", - cellPhone: "", - cellPhoneError: false, - email: "", - emailError: false, - age: "", - ageError: false, - dateOfBirth: birthDateValue, - socialSecurityNumber: "", - mailingAddress:"", - mailingAddressFalse:false, - city: "", - state: "", - zipCode: "", - gender: "male", - }); + useEffect(() => { + handleFormSection1Data( + patient.fullName, + patient.homePhone, + patient.cellPhone, + patient.email, + patient.age, + birthDateValue, + patient.socialSecurityNumber, + patient.mailingAddress, + patient.city, + patient.state, + patient.zipCode, + patient.gender + ); + }, [patient]); + return ( + <> + + + { + setPatient((prevValues: any) => ({ + ...prevValues, + fullName: e.target.value, + })); + }} + onBlur={(e) => { + if (e.target.value === '') { + setPatient((prevValues: any) => ({ + ...prevValues, + fullNameError: true, + })); + } else { + setPatient((prevValues: any) => ({ + ...prevValues, + fullNameError: false, + })); + } + }} + required + error={patient.fullNameError} + helperText={patient.fullNameError ? 'Please enter your name' : ''} + /> + - useEffect(()=>{ - handleFormSection1Data( - patient.fullName, - patient.homePhone, - patient.cellPhone, - patient.email, - patient.age, - birthDateValue, - patient.socialSecurityNumber, - patient.mailingAddress, - patient.city, - patient.state, - patient.zipCode, - patient.gender, - ) - },[patient]) + + { + setPatient((prevValues: any) => ({ + ...prevValues, + cellPhone: e.target.value, + })); + }} + onBlur={(e) => { + if (!/^\d{10}$/.test(e.target.value)) { + setPatient((prevValues: any) => ({ + ...prevValues, + cellPhoneError: true, + })); + } else { + setPatient((prevValues: any) => ({ + ...prevValues, + cellPhoneError: false, + })); + } + }} + error={patient.cellPhoneError} + helperText={ + patient.cellPhoneError + ? 'Please enter a valid 10-digit phone number' + : '' + } + /> + - - - return( - <> - - - { - setPatient((prevValues:any) => ({ - ...prevValues, - fullName: e.target.value, - })); - }} - onBlur={(e) => { - if (e.target.value === "") { - setPatient((prevValues:any) => ({ - ...prevValues, - fullNameError: true, - })); - } else { - setPatient((prevValues:any) => ({ - ...prevValues, - fullNameError: false, - })); - } - }} - required - error={patient.fullNameError} - helperText={patient.fullNameError ? "Please enter your name" : ""} - /> - + + { + setPatient((prevValues: any) => ({ + ...prevValues, + homePhone: e.target.value, + })); + }} + // error={!(/^\d{10}$/.test(patient.homePhone))} + // helperText={!(/^\d{10}$/.test(patient.homePhone)) ? "Please enter a valid 10-digit phone number" : ""} + /> + - - - { - setPatient((prevValues:any) => ({ - ...prevValues, - cellPhone: e.target.value, - })); - }} - onBlur={(e) => { - if (!(/^\d{10}$/.test(e.target.value))) { - setPatient((prevValues:any) => ({ - ...prevValues, - cellPhoneError: true, - })); - } else { - setPatient((prevValues:any) => ({ - ...prevValues, - cellPhoneError: false, - })); - } - }} - error={patient.cellPhoneError} - helperText={patient.cellPhoneError? "Please enter a valid 10-digit phone number" : ""} - /> - + + { + setPatient((prevValues: any) => ({ + ...prevValues, + email: e.target.value, + })); + }} + onBlur={(e) => { + if (!/^\S+@\S+\.\S+$/.test(e.target.value)) { + setPatient((prevValues: any) => ({ + ...prevValues, + emailError: true, + })); + } else { + setPatient((prevValues: any) => ({ + ...prevValues, + emailError: false, + })); + } + }} + error={patient.emailError} + helperText={ + patient.emailError ? 'Please enter a valid email address' : '' + } + /> + + + { + setPatient((prevValues: any) => ({ + ...prevValues, + age: e.target.value, + })); + }} + onBlur={(e) => { + if (e.target.value === '') { + setPatient((prevValues: any) => ({ + ...prevValues, + ageError: true, + })); + } else { + setPatient((prevValues: any) => ({ + ...prevValues, + ageError: false, + })); + } + }} + error={patient.ageError} + helperText={patient.ageError ? 'Please enter your age' : ''} + /> + - - { - setPatient((prevValues:any) => ({ - ...prevValues, - homePhone: e.target.value, - })); - }} - // error={!(/^\d{10}$/.test(patient.homePhone))} - // helperText={!(/^\d{10}$/.test(patient.homePhone)) ? "Please enter a valid 10-digit phone number" : ""} - /> - + + + + { + setBirthDateValue(newValue); + }} + renderInput={(params) => ( + + )} + /> + + + - - { - setPatient((prevValues:any) => ({ - ...prevValues, - email: e.target.value, - })); - }} - onBlur={(e) => { - if (!(/^\S+@\S+\.\S+$/.test(e.target.value))) { - setPatient((prevValues:any) => ({ - ...prevValues, - emailError: true, - })); - } else { - setPatient((prevValues:any) => ({ - ...prevValues, - emailError: false, - })); - } - }} - error={patient.emailError} - helperText={patient.emailError? "Please enter a valid email address" : ""} - /> - - - { - setPatient((prevValues:any) => ({ - ...prevValues, - age: e.target.value, - })); - }} - onBlur={(e) => { - if (e.target.value === "") { - setPatient((prevValues:any) => ({ - ...prevValues, - ageError: true, - })); - } else { - setPatient((prevValues:any) => ({ - ...prevValues, - ageError: false, - })); - } - }} - error={patient.ageError} - helperText={patient.ageError ? "Please enter your age" : ""} - - /> - + + { + setPatient((prevValues: any) => ({ + ...prevValues, + socialSecurityNumber: e.target.value, + })); + }} + // onBlur={formik.handleBlur} + // error={formik.touched.socialSecurityNumber && Boolean(formik.errors.socialSecurityNumber)} + // helperText={formik.touched.socialSecurityNumber && formik.errors.socialSecurityNumber} + /> + - - - - { - setBirthDateValue(newValue); - }} - renderInput={(params) => } - /> - - - - + + { + setPatient((prevValues: any) => ({ + ...prevValues, + mailingAddress: e.target.value, + })); + }} + onBlur={(e) => { + if (e.target.value === '') { + setPatient((prevValues: any) => ({ + ...prevValues, + mailingAddressError: true, + })); + } else { + setPatient((prevValues: any) => ({ + ...prevValues, + mailingAddressError: false, + })); + } + }} + error={patient.mailingAddressError} + helperText={ + patient.mailingAddressError + ? 'Please enter your mailing address' + : '' + } + /> + - - { - setPatient((prevValues:any) => ({ - ...prevValues, - socialSecurityNumber: e.target.value, - })); - }} - // onBlur={formik.handleBlur} - // error={formik.touched.socialSecurityNumber && Boolean(formik.errors.socialSecurityNumber)} - // helperText={formik.touched.socialSecurityNumber && formik.errors.socialSecurityNumber} - /> - + + { + setPatient((prevValues: any) => ({ + ...prevValues, + state: e.target.value, + })); + }} + /> + - - { - setPatient((prevValues:any) => ({ - ...prevValues, - mailingAddress: e.target.value, - })); - }} - onBlur={(e) => { - if (e.target.value === "") { - setPatient((prevValues:any) => ({ - ...prevValues, - mailingAddressError: true, - })); - } else { - setPatient((prevValues:any) => ({ - ...prevValues, - mailingAddressError: false, - })); - } - }} - error={patient.mailingAddressError} - helperText={patient.mailingAddressError? "Please enter your mailing address" : ""} - /> - - - - { - setPatient((prevValues:any) => ({ - ...prevValues, - state: e.target.value, - })); - }} - /> - + + { + setPatient((prevValues: any) => ({ + ...prevValues, + city: e.target.value, + })); + }} + /> + - - { - setPatient((prevValues:any) => ({ - ...prevValues, - city: e.target.value, - })); - }} - /> - - - - { - setPatient((prevValues:any) => ({ - ...prevValues, - zipCode: e.target.value, - })); - }} - // onBlur={formik.handleBlur} - // error={formik.touched.zipCode && Boolean(formik.errors.zipCode)} - // helperText={formik.touched.zipCode && formik.errors.zipCode} - /> - + + { + setPatient((prevValues: any) => ({ + ...prevValues, + zipCode: e.target.value, + })); + }} + // onBlur={formik.handleBlur} + // error={formik.touched.zipCode && Boolean(formik.errors.zipCode)} + // helperText={formik.touched.zipCode && formik.errors.zipCode} + /> + - - - Gender - { - setPatient((prevValues:any) => ({ - ...prevValues, - gender: e.target.value, - })); - }} - sx={{display:'flex', flexDirection:'row'}} - > - } label="Male" /> - } label="Female" /> - - - - - - ) -} \ No newline at end of file + + + Gender + { + setPatient((prevValues: any) => ({ + ...prevValues, + gender: e.target.value, + })); + }} + sx={{ display: 'flex', flexDirection: 'row' }} + > + } + label='Male' + /> + } + label='Female' + /> + + + + + + ); +} From f27ef0e113a59bf3e4af945e91311a5fa78b658b Mon Sep 17 00:00:00 2001 From: sonika <> Date: Thu, 7 Sep 2023 17:08:28 +0530 Subject: [PATCH 2/5] responsive all sections --- .../PatientForm/FamilyFormSection2.tsx | 94 +++++++++++++++--- .../PatientForm/MedicalHistorySection3.tsx | 70 ++++++++++++-- src/Components/PatientForm/PastTreatment5.tsx | 27 +++++- .../RecreationalHobbiesSection7.tsx | 96 +++++++++++++++---- .../PatientForm/SyestemReviewSection6.tsx | 96 +++++++++++++++---- 5 files changed, 326 insertions(+), 57 deletions(-) diff --git a/src/Components/PatientForm/FamilyFormSection2.tsx b/src/Components/PatientForm/FamilyFormSection2.tsx index f1ad09c..b73a92d 100644 --- a/src/Components/PatientForm/FamilyFormSection2.tsx +++ b/src/Components/PatientForm/FamilyFormSection2.tsx @@ -101,7 +101,13 @@ export default function FamilyFormSection({handleFormSection2Data,patientDataDip - + - + - + - + - + - + Spouse's Information: - + - + - + - + - + - + - + - + - + - + - - + + Chiropractor Information: - + Previous Chiropractic Care: - + - + - + - + - + - + Please list current supplements or drugs you may be taking: - + Do you excercise? - + - + Use tobacco? - + - + Consume alcohol? - + - + Have a healthy diet? - + - + Get adequate sleep? - + - + Is Work/School stressful to you? - + - + Family life stressful to you? - + - + Use recreational drugs? - + Please choose body areas or systems where you may have problems: - + Eyes - + Intestines/Bowls - + Joints/Bones - + Allergies - + Ears, Nose, Mouth, Throat - + Urinary - + Skin - + Psychological/Emotional - + Heart - + Muscles - + Internal Organs - + Gynecological menstrual/Brest - + Lungs/Breathing - + Nerves - + Blood - + Prostate/Testicular/Penile Date: Thu, 7 Sep 2023 17:15:57 +0530 Subject: [PATCH 3/5] responsive fix all section --- .../PatientForm/FamilyFormSection2.tsx | 24 +++++++------- .../PatientForm/MedicalHistorySection3.tsx | 18 +++++------ src/Components/PatientForm/PastTreatment5.tsx | 8 ++--- .../PatientForm/PersonalSection1.tsx | 24 +++++++------- .../RecreationalHobbiesSection7.tsx | 32 +++++++++---------- .../PatientForm/SyestemReviewSection6.tsx | 32 +++++++++---------- 6 files changed, 69 insertions(+), 69 deletions(-) diff --git a/src/Components/PatientForm/FamilyFormSection2.tsx b/src/Components/PatientForm/FamilyFormSection2.tsx index b73a92d..aad2239 100644 --- a/src/Components/PatientForm/FamilyFormSection2.tsx +++ b/src/Components/PatientForm/FamilyFormSection2.tsx @@ -102,7 +102,7 @@ export default function FamilyFormSection({handleFormSection2Data,patientDataDip - - - - - - - - - - - - - - - - - Please choose body areas or systems where you may have problems: - - - - - - - - - - - - - - - - Date: Thu, 7 Sep 2023 17:28:05 +0530 Subject: [PATCH 4/5] Title change --- src/Components/PatientForm/PatientForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/PatientForm/PatientForm.tsx b/src/Components/PatientForm/PatientForm.tsx index d043916..2725462 100644 --- a/src/Components/PatientForm/PatientForm.tsx +++ b/src/Components/PatientForm/PatientForm.tsx @@ -507,7 +507,7 @@ export default function PatientForm({ type }: Props) { id='panel9d-header' > - Patient's Injury Image + Patient's Pain Zone From f52b8ed7f497d2a307401d8e1920edae30bbd517 Mon Sep 17 00:00:00 2001 From: sonika <> Date: Thu, 7 Sep 2023 17:44:07 +0530 Subject: [PATCH 5/5] phone number validation issue fix --- .../PatientForm/PersonalSection1.tsx | 79 ++++++++++--------- 1 file changed, 42 insertions(+), 37 deletions(-) diff --git a/src/Components/PatientForm/PersonalSection1.tsx b/src/Components/PatientForm/PersonalSection1.tsx index c4c4f28..52c393d 100644 --- a/src/Components/PatientForm/PersonalSection1.tsx +++ b/src/Components/PatientForm/PersonalSection1.tsx @@ -147,44 +147,49 @@ export default function PersonalSection({ className='collapsable-form-style' > { - setPatient((prevValues: any) => ({ - ...prevValues, - cellPhone: e.target.value, - })); - }} - onBlur={(e) => { - if (!/^\d{10}$/.test(e.target.value)) { - setPatient((prevValues: any) => ({ - ...prevValues, - cellPhoneError: true, - })); - } else { - setPatient((prevValues: any) => ({ - ...prevValues, - cellPhoneError: false, - })); + required + variant='outlined' + label='Phone Number' + name='cellPhone' + type='number' + placeholder='Please enter your cell Phone number' + value={ + type == 'display' + ? patientDataDiplay.cellPhone + : patient.cellPhone } - }} - error={patient.cellPhoneError} - helperText={ - patient.cellPhoneError - ? 'Please enter a valid 10-digit phone number' - : '' - } - /> + disabled={type == 'display'} + onChange={(e) => { + let value = e.target.value; + if (value[0] === '0') { + value = value.slice(1); + } + setPatient((prevValues: any) => ({ + ...prevValues, + cellPhone: value, + })); + }} + onBlur={(e) => { + if (!/^\d{10}$/.test(e.target.value)) { + setPatient((prevValues: any) => ({ + ...prevValues, + cellPhoneError: true, + })); + } else { + setPatient((prevValues: any) => ({ + ...prevValues, + cellPhoneError: false, + })); + } + }} + error={patient.cellPhoneError} + helperText={ + patient.cellPhoneError + ? 'Please enter a valid 10-digit phone number' + : '' + } + /> +