From 5dc96104a8b4daa70832a5ec65d6d979f4b5771d Mon Sep 17 00:00:00 2001 From: sonika <> Date: Fri, 15 Sep 2023 08:57:49 +0530 Subject: [PATCH] renaming of folders, files, functions, variables --- src/Components/Helper/AddNewTable.tsx | 4 +- ...tion2.tsx => FamilyInformationSection.tsx} | 8 +- ...Section3.tsx => MedicalHistorySection.tsx} | 6 +- ...erDetails8.tsx => OtherDetailsSection.tsx} | 8 +- ...isSection4.tsx => PainAnalysisSection.tsx} | 8 +- .../{PastTreatment5.tsx => PastTreatment.tsx} | 10 +- src/Components/PatientForm/PatientForm.tsx | 130 +++++++++--------- ...on1.tsx => PersonalInformationSection.tsx} | 8 +- ...on7.tsx => RecreationalHobbiesSection.tsx} | 6 +- ...wSection6.tsx => SyestemReviewSection.tsx} | 8 +- 10 files changed, 98 insertions(+), 98 deletions(-) rename src/Components/PatientForm/{FamilyFormSection2.tsx => FamilyInformationSection.tsx} (98%) rename src/Components/PatientForm/{MedicalHistorySection3.tsx => MedicalHistorySection.tsx} (98%) rename src/Components/PatientForm/{OtherDetails8.tsx => OtherDetailsSection.tsx} (98%) rename src/Components/PatientForm/{PainAnalysisSection4.tsx => PainAnalysisSection.tsx} (99%) rename src/Components/PatientForm/{PastTreatment5.tsx => PastTreatment.tsx} (98%) rename src/Components/PatientForm/{PersonalSection1.tsx => PersonalInformationSection.tsx} (98%) rename src/Components/PatientForm/{RecreationalHobbiesSection7.tsx => RecreationalHobbiesSection.tsx} (98%) rename src/Components/PatientForm/{SyestemReviewSection6.tsx => SyestemReviewSection.tsx} (99%) diff --git a/src/Components/Helper/AddNewTable.tsx b/src/Components/Helper/AddNewTable.tsx index 4602360..b1dd1bc 100644 --- a/src/Components/Helper/AddNewTable.tsx +++ b/src/Components/Helper/AddNewTable.tsx @@ -27,7 +27,7 @@ interface DataTableProps { } type Props = { - handleFormSection5Data: ( + handlePastTreatmentFormData: ( generalHealth: string | undefined, presentProblemBefore: string | undefined, ifYespresentProblemBefore: string | undefined, @@ -45,7 +45,7 @@ type Props = { type: string; }; -function DataTable({ handleFormSection5Data, patientDataDiplay, type }: Props) { +function DataTable({ handlePastTreatmentFormData, patientDataDiplay, type }: Props) { const [illnessFromData, setIllnessFromData] = React.useState({ id: 0, date: '', diff --git a/src/Components/PatientForm/FamilyFormSection2.tsx b/src/Components/PatientForm/FamilyInformationSection.tsx similarity index 98% rename from src/Components/PatientForm/FamilyFormSection2.tsx rename to src/Components/PatientForm/FamilyInformationSection.tsx index 8192372..9fcc665 100644 --- a/src/Components/PatientForm/FamilyFormSection2.tsx +++ b/src/Components/PatientForm/FamilyInformationSection.tsx @@ -32,7 +32,7 @@ interface Patient { } type Props = { - handleFormSection2Data: ( + handleFamilyInformationFormData: ( maritalStatus: string | undefined, numberOfChildren: string | undefined, occupation: string | undefined, @@ -50,8 +50,8 @@ type Props = { type: string; }; -export default function FamilyFormSection({ - handleFormSection2Data, +export default function FamilyInformationForm({ + handleFamilyInformationFormData, patientDataDiplay, type, }: Props) { @@ -71,7 +71,7 @@ export default function FamilyFormSection({ }); useEffect(() => { - handleFormSection2Data( + handleFamilyInformationFormData( patient.maritalStatus, patient.numberOfChildren, patient.occupation, diff --git a/src/Components/PatientForm/MedicalHistorySection3.tsx b/src/Components/PatientForm/MedicalHistorySection.tsx similarity index 98% rename from src/Components/PatientForm/MedicalHistorySection3.tsx rename to src/Components/PatientForm/MedicalHistorySection.tsx index a86c4d1..0c58104 100644 --- a/src/Components/PatientForm/MedicalHistorySection3.tsx +++ b/src/Components/PatientForm/MedicalHistorySection.tsx @@ -19,7 +19,7 @@ interface Patient { } type Props = { - handleFormSection3Data:( + handleMedicalHistoryFormData:( physicianname?: string |undefined, physiciancity?: string |undefined, physicianstate?: string |undefined, @@ -36,7 +36,7 @@ type Props = { type:string; } -export default function MedicalHistoryForm({handleFormSection3Data,patientDataDiplay,type}:Props){ +export default function MedicalHistoryForm({handleMedicalHistoryFormData,patientDataDiplay,type}:Props){ const [patient, setPatient] = React.useState({ physicianname: '', @@ -53,7 +53,7 @@ export default function MedicalHistoryForm({handleFormSection3Data,patientDataDi }); useEffect(()=>{ - handleFormSection3Data( + handleMedicalHistoryFormData( patient.physicianname, patient.physiciancity, patient.physicianstate, diff --git a/src/Components/PatientForm/OtherDetails8.tsx b/src/Components/PatientForm/OtherDetailsSection.tsx similarity index 98% rename from src/Components/PatientForm/OtherDetails8.tsx rename to src/Components/PatientForm/OtherDetailsSection.tsx index 5cf6538..2566523 100644 --- a/src/Components/PatientForm/OtherDetails8.tsx +++ b/src/Components/PatientForm/OtherDetailsSection.tsx @@ -23,7 +23,7 @@ interface Patient { } type Props = { - handleFormSection8Data: ( + handleOtherDetailsFormData: ( familyHistory: string | undefined, sleep: string | undefined, pillow: string | undefined, @@ -36,8 +36,8 @@ type Props = { type: string; }; -export default function OtherDetails8({ - handleFormSection8Data, +export default function OtherDetailsForm({ + handleOtherDetailsFormData, patientDataDiplay, type, }: Props) { @@ -52,7 +52,7 @@ export default function OtherDetails8({ }); useEffect(() => { - handleFormSection8Data( + handleOtherDetailsFormData( patient.familyHistory, patient.sleep, patient.pillow, diff --git a/src/Components/PatientForm/PainAnalysisSection4.tsx b/src/Components/PatientForm/PainAnalysisSection.tsx similarity index 99% rename from src/Components/PatientForm/PainAnalysisSection4.tsx rename to src/Components/PatientForm/PainAnalysisSection.tsx index b813ff2..2cbf1e9 100644 --- a/src/Components/PatientForm/PainAnalysisSection4.tsx +++ b/src/Components/PatientForm/PainAnalysisSection.tsx @@ -29,7 +29,7 @@ interface Patient { } type Props = { - handleFormSection4Data: ( + handleInjuryDetailsFormData: ( chiefComplaint: string | undefined, painWorse: any, painBetter: any, @@ -45,8 +45,8 @@ type Props = { type: string; }; -export default function PainAnalysisSection4({ - handleFormSection4Data, +export default function PainAnalysisForm({ + handleInjuryDetailsFormData, patientDataDiplay, type, }: Props) { @@ -64,7 +64,7 @@ export default function PainAnalysisSection4({ }); useEffect(() => { - handleFormSection4Data( + handleInjuryDetailsFormData( patient.chiefComplaint, patient.painWorse, patient.painBetter, diff --git a/src/Components/PatientForm/PastTreatment5.tsx b/src/Components/PatientForm/PastTreatment.tsx similarity index 98% rename from src/Components/PatientForm/PastTreatment5.tsx rename to src/Components/PatientForm/PastTreatment.tsx index cb5b9fc..046724a 100644 --- a/src/Components/PatientForm/PastTreatment5.tsx +++ b/src/Components/PatientForm/PastTreatment.tsx @@ -28,7 +28,7 @@ interface Patient { } type Props = { - handleFormSection5Data: ( + handlePastTreatmentFormData: ( generalHealth: string | undefined, presentProblemBefore: string | undefined, ifYespresentProblemBefore: string | undefined, @@ -46,8 +46,8 @@ type Props = { type: string; }; -export default function PastTreatment5({ - handleFormSection5Data, +export default function PastTreatmentForm({ + handlePastTreatmentFormData, patientDataDiplay, type, }: Props) { @@ -67,7 +67,7 @@ export default function PastTreatment5({ }); useEffect(() => { - handleFormSection5Data( + handlePastTreatmentFormData( patient.generalHealth, patient.presentProblemBefore, patient.ifYespresentProblemBefore, @@ -494,7 +494,7 @@ export default function PastTreatment5({ diff --git a/src/Components/PatientForm/PatientForm.tsx b/src/Components/PatientForm/PatientForm.tsx index 355e1df..13ecc2f 100644 --- a/src/Components/PatientForm/PatientForm.tsx +++ b/src/Components/PatientForm/PatientForm.tsx @@ -16,7 +16,7 @@ import { RadioGroup, TextField, } from '@mui/material'; -import PersonalSection from './PersonalSection1'; +import PersonalInformationForm from './PersonalInformationSection'; import { styled } from '@mui/material/styles'; import ArrowForwardIosSharpIcon from '@mui/icons-material/ArrowForwardIosSharp'; import MuiAccordion, { AccordionProps } from '@mui/material/Accordion'; @@ -24,13 +24,13 @@ import MuiAccordionSummary, { AccordionSummaryProps, } from '@mui/material/AccordionSummary'; import MuiAccordionDetails from '@mui/material/AccordionDetails'; -import MedicalHistory from './MedicalHistorySection3'; -import FamilyFormSection from './FamilyFormSection2'; -import PainAnalysisSection4 from './PainAnalysisSection4'; -import PastTreatment5 from './PastTreatment5'; -import SystemReviewSection6 from './SyestemReviewSection6'; -import RecreationalHobbiesSection7 from './RecreationalHobbiesSection7'; -import OtherDetails8 from './OtherDetails8'; +import MedicalHistory from './MedicalHistorySection'; +import FamilyInformationForm from './FamilyInformationSection'; +import PainAnalysisForm from './PainAnalysisSection'; +import PastTreatmentForm from './PastTreatment'; +import SystemReviewForm from './SyestemReviewSection'; +import RecreationalHobbiesForm from './RecreationalHobbiesSection'; +import OtherDetailsForm from './OtherDetailsSection'; import PatientImageMarker from '../ImageMarker/PatientImageMarker'; import ViewPatientImageMarker from '../ImageMarker/ViewPatientImageMarker'; import AlertDialog from '../Helper/AlertDialogBox'; @@ -83,23 +83,23 @@ export default function PatientForm({ type }: Props) { const [expanded, setExpanded] = React.useState('panel1'); const [isChecked, setIsChecked] = React.useState(false); const [signature, setSignature] = React.useState(); - const [section1Data, setSection1Data] = React.useState({}); - const [section2Data, setSection2Data] = React.useState({}); - const [section3Data, setSection3Data] = React.useState({}); - const [section4Data, setSection4Data] = React.useState({}); - const [section5Data, setSection5Data] = React.useState({}); - const [section6Data, setSection6Data] = React.useState({}); - const [section7Data, setSection7Data] = React.useState({}); - const [section8Data, setSection8Data] = React.useState({}); + const [personalInformation, setPersonalInformation] = React.useState({}); + const [familyInformation, setFamilyInformation] = React.useState({}); + const [medicalHistory, setMedicalHistory] = React.useState({}); + const [injuryDetails, setInjuryDetails] = React.useState({}); + const [pastTreatment, setPastTreatment] = React.useState({}); + const [systemReviewQuestions, setSystemReviewQuestions] = React.useState({}); + const [recreationalActivities, setRecreationalActivities] = React.useState({}); + const [otherDetails, setOtherDetails] = React.useState({}); const [allPatientData, setAllPatientData] = React.useState([]); const [patientDetailsButtonFlag, setPatientDetailsButtonFlag] = React.useState(false); - const handleFormSection1Data = (patient: Patient) => { - setSection1Data(patient); + const handlePersonalInformationFormData = (patient: Patient) => { + setPersonalInformation(patient); }; - const handleFormSection2Data = ( + const handleFamilyInformationFormData = ( maritalStatus: string | undefined, numberOfChildren: string | undefined, occupation: string | undefined, @@ -113,7 +113,7 @@ export default function PatientForm({ type }: Props) { relationship: string | undefined, spousePhone: string | undefined ) => { - setSection2Data({ + setFamilyInformation({ maritalStatus, numberOfChildren, occupation, @@ -129,7 +129,7 @@ export default function PatientForm({ type }: Props) { }); }; - const handleFormSection3Data = ( + const handleMedicalHistoryFormData = ( physicianname: string | undefined, physiciancity: string | undefined, physicianstate: string | undefined, @@ -142,7 +142,7 @@ export default function PatientForm({ type }: Props) { visitDetails: string | undefined, cellPhoneProvider: string | undefined ) => { - setSection3Data({ + setMedicalHistory({ physicianname, physiciancity, physicianstate, @@ -157,7 +157,7 @@ export default function PatientForm({ type }: Props) { }); }; - const handleFormSection4Data = ( + const handleInjuryDetailsFormData = ( chiefComplaint: string | undefined, painWorse: any, painBetter: any, @@ -169,7 +169,7 @@ export default function PatientForm({ type }: Props) { treatmentGoal: string | undefined, selfTreatment: string | undefined ) => { - setSection4Data({ + setInjuryDetails({ chiefComplaint, painWorse, painBetter, @@ -183,7 +183,7 @@ export default function PatientForm({ type }: Props) { }); }; - const handleFormSection5Data = ( + const handlePastTreatmentFormData = ( generalHealth: string | undefined, presentProblemBefore: string | undefined, ifYespresentProblemBefore: string | undefined, @@ -197,7 +197,7 @@ export default function PatientForm({ type }: Props) { injuriesHospitalization: string | undefined, supplementsOrDrugs: string | undefined ) => { - setSection5Data({ + setPastTreatment({ generalHealth, presentProblemBefore, ifYespresentProblemBefore, @@ -213,7 +213,7 @@ export default function PatientForm({ type }: Props) { }); }; - const handleFormSection6Data = ( + const handleSystemReviewFormData = ( eyes: string | undefined, IntestinesBowls: string | undefined, jointsBones: string | undefined, @@ -232,7 +232,7 @@ export default function PatientForm({ type }: Props) { prostate: string | undefined, explanation: string | undefined ) => { - setSection6Data({ + setSystemReviewQuestions({ eyes, IntestinesBowls, jointsBones, @@ -253,7 +253,7 @@ export default function PatientForm({ type }: Props) { }); }; - const handleFormSection7Data = ( + const handleRecreationalActivitiesFormData = ( hobbies: string | undefined, educationLevel: string | undefined, excercise: string | undefined, @@ -273,7 +273,7 @@ export default function PatientForm({ type }: Props) { drugs: string | undefined, drugsExplanation: string | undefined ) => { - setSection7Data({ + setRecreationalActivities({ hobbies, educationLevel, excercise, @@ -295,7 +295,7 @@ export default function PatientForm({ type }: Props) { }); }; - const handleFormSection8Data = ( + const handleOtherDetailsFormData = ( familyHistory: string | undefined, sleep: string | undefined, pillow: string | undefined, @@ -304,7 +304,7 @@ export default function PatientForm({ type }: Props) { pregnancy: string | undefined, menstralCycle: any ) => { - setSection8Data({ + setOtherDetails({ familyHistory, sleep, pillow, @@ -318,14 +318,14 @@ export default function PatientForm({ type }: Props) { const handleSubmit = () => { const saved = JSON.parse(localStorage.getItem('entry') || '{}'); const newPatientData = { - personalInformation: section1Data, - familyInformation: section2Data, - medicalHistory: section3Data, - injuryDetails: section4Data, - pastTreatment: section5Data, - systemReviewQuestions: section6Data, - recreationalActivities: section7Data, - otherDetails: section8Data, + personalInformation: personalInformation, + familyInformation: familyInformation, + medicalHistory: medicalHistory, + injuryDetails: injuryDetails, + pastTreatment: pastTreatment, + systemReviewQuestions: systemReviewQuestions, + recreationalActivities: recreationalActivities, + otherDetails: otherDetails, injuryPainDetails: saved.entries, signature: signature, }; @@ -339,16 +339,16 @@ export default function PatientForm({ type }: Props) { localStorage.setItem('patientData', JSON.stringify(newPatientData)); if ( - section1Data.fullName !== '' && - section1Data.cellPhone && - /^\d{10}$/.test(section1Data.cellPhone) && - section1Data.email && - /^\S+@\S+\.\S+$/.test(section1Data.email) && - section1Data.age && - section1Data.age !== '' && - Number(section1Data.age) >= 0 && - section1Data.mailingAddress && - section1Data.mailingAddress !== '' + personalInformation.fullName !== '' && + personalInformation.cellPhone && + /^\d{10}$/.test(personalInformation.cellPhone) && + personalInformation.email && + /^\S+@\S+\.\S+$/.test(personalInformation.email) && + personalInformation.age && + personalInformation.age !== '' && + Number(personalInformation.age) >= 0 && + personalInformation.mailingAddress && + personalInformation.mailingAddress !== '' ) { TextFile(); setPatientDetailsButtonFlag(true); @@ -432,8 +432,8 @@ export default function PatientForm({ type }: Props) { - @@ -454,8 +454,8 @@ export default function PatientForm({ type }: Props) { - @@ -477,7 +477,7 @@ export default function PatientForm({ type }: Props) { @@ -520,8 +520,8 @@ export default function PatientForm({ type }: Props) { - @@ -542,8 +542,8 @@ export default function PatientForm({ type }: Props) { - @@ -564,8 +564,8 @@ export default function PatientForm({ type }: Props) { - @@ -586,8 +586,8 @@ export default function PatientForm({ type }: Props) { - @@ -606,8 +606,8 @@ export default function PatientForm({ type }: Props) { - diff --git a/src/Components/PatientForm/PersonalSection1.tsx b/src/Components/PatientForm/PersonalInformationSection.tsx similarity index 98% rename from src/Components/PatientForm/PersonalSection1.tsx rename to src/Components/PatientForm/PersonalInformationSection.tsx index d76f27f..75eb7cd 100644 --- a/src/Components/PatientForm/PersonalSection1.tsx +++ b/src/Components/PatientForm/PersonalInformationSection.tsx @@ -16,13 +16,13 @@ import { useEffect } from 'react'; import { Patient } from '../Interface/Patient'; type Props = { - handleFormSection1Data: (patient: Patient) => void; + handlePersonalInformationFormData: (patient: Patient) => void; patientDataDiplay: any; type: string; }; -export default function PersonalSection({ - handleFormSection1Data, +export default function PersonalInformationForm({ + handlePersonalInformationFormData, patientDataDiplay, type, }: Props) { @@ -51,7 +51,7 @@ export default function PersonalSection({ }); useEffect(() => { - handleFormSection1Data(patient); + handlePersonalInformationFormData(patient); }, [patient]); return ( diff --git a/src/Components/PatientForm/RecreationalHobbiesSection7.tsx b/src/Components/PatientForm/RecreationalHobbiesSection.tsx similarity index 98% rename from src/Components/PatientForm/RecreationalHobbiesSection7.tsx rename to src/Components/PatientForm/RecreationalHobbiesSection.tsx index 6078b78..d1d2153 100644 --- a/src/Components/PatientForm/RecreationalHobbiesSection7.tsx +++ b/src/Components/PatientForm/RecreationalHobbiesSection.tsx @@ -23,7 +23,7 @@ interface Patient { } type Props = { - handleFormSection7Data:( + handleRecreationalActivitiesFormData:( hobbies: string|undefined, educationLevel: string|undefined, excercise: string|undefined, @@ -47,7 +47,7 @@ interface Patient { type:string; } -export default function RecreationalHobbiesSection7({handleFormSection7Data,patientDataDiplay,type}:Props){ +export default function RecreationalHobbiesForm({handleRecreationalActivitiesFormData,patientDataDiplay,type}:Props){ const [patient, setPatient] = React.useState({ hobbies: '', educationLevel: '', @@ -71,7 +71,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data,pati useEffect(()=>{ - handleFormSection7Data( + handleRecreationalActivitiesFormData( patient.hobbies, patient.educationLevel, patient.excercise, diff --git a/src/Components/PatientForm/SyestemReviewSection6.tsx b/src/Components/PatientForm/SyestemReviewSection.tsx similarity index 99% rename from src/Components/PatientForm/SyestemReviewSection6.tsx rename to src/Components/PatientForm/SyestemReviewSection.tsx index d6bcf4f..8e6e73d 100644 --- a/src/Components/PatientForm/SyestemReviewSection6.tsx +++ b/src/Components/PatientForm/SyestemReviewSection.tsx @@ -30,7 +30,7 @@ interface Patient { } type Props = { - handleFormSection6Data: ( + handleSystemReviewFormData: ( eyes: string | undefined, IntestinesBowls: string | undefined, jointsBones: string | undefined, @@ -53,8 +53,8 @@ type Props = { type: string; }; -export default function SystemReviewSection6({ - handleFormSection6Data, +export default function SystemReviewForm({ + handleSystemReviewFormData, patientDataDiplay, type, }: Props) { @@ -79,7 +79,7 @@ export default function SystemReviewSection6({ }); useEffect(() => { - handleFormSection6Data( + handleSystemReviewFormData( patient.eyes, patient.IntestinesBowls, patient.jointsBones,