type cleanup

This commit is contained in:
sonika 2023-09-15 09:29:06 +05:30
parent 5dc96104a8
commit bdbe3002ed
11 changed files with 163 additions and 542 deletions

View File

@ -13,6 +13,7 @@ import {
FormControl, FormControl,
} from '@mui/material'; } from '@mui/material';
import * as React from 'react'; import * as React from 'react';
import { PastTreatmentInterface } from '../Interface/Patient';
interface RowData { interface RowData {
date: string; date: string;
@ -27,20 +28,7 @@ interface DataTableProps {
} }
type Props = { type Props = {
handlePastTreatmentFormData: ( handlePastTreatmentFormData: (patient:PastTreatmentInterface) => void;
generalHealth: string | undefined,
presentProblemBefore: string | undefined,
ifYespresentProblemBefore: string | undefined,
ifYestreatmentProvided: string | undefined,
ifYesOutcome: string | undefined,
strokeBloodclotting: string | undefined,
ifYesstrokeBloodclotting: string | undefined,
dizzinessFetigue: string | undefined,
ifyesdizzinessFetigue: string | undefined,
antiColligent: string | undefined,
injuriesHospitalization: string | undefined,
supplementsOrDrugs: string | undefined
) => void;
patientDataDiplay: any; patientDataDiplay: any;
type: string; type: string;
}; };

View File

@ -1,4 +1,4 @@
export interface Patient { export interface PersonalInformationInterface {
fullName: string; fullName: string;
homePhone: string; homePhone: string;
cellPhone: string; cellPhone: string;
@ -12,3 +12,111 @@ export interface Patient {
zipCode: string; zipCode: string;
gender: string; gender: string;
} }
export interface FamilyInformationInterface {
maritalStatus: string | undefined;
numberOfChildren: string | undefined;
occupation: string | undefined;
hoursPerWeek: number | string | undefined;
employer: string | undefined;
businessPhone: string | undefined;
spouseName: string | undefined;
spouseEmployer: string | undefined;
spouseBusinessPhone: string | undefined;
emergencyContact: string | undefined;
relationship: string | undefined;
spousePhone: string | undefined;
}
export interface MedicalHistoryInterface {
physicianname: string |undefined;
physiciancity: string |undefined;
physicianstate: string |undefined;
physicianphone: string |undefined;
chiropractorName: string |undefined;
chiropractorState: string |undefined;
xray: string|undefined;
haveChiropractor: string|undefined;
reference: string|undefined;
visitDetails: string |undefined;
cellPhoneProvider: string |undefined;
}
export interface InjuryDetailsInterface {
chiefComplaint: string;
painWorse: string[];
painBetter: string[];
painQuality: string[];
painWorstTime: string[];
currentComplaintIssues: string[];
painDuration: string;
currentTreatment: string;
treatmentGoal: string;
selfTreatment: string;
}
export interface PastTreatmentInterface {
generalHealth: string;
presentProblemBefore: string;
ifYespresentProblemBefore: string;
ifYestreatmentProvided: string;
ifYesOutcome: string;
strokeBloodclotting: string;
ifYesstrokeBloodclotting: string;
dizzinessFetigue: string;
ifyesdizzinessFetigue: string;
antiColligent: string;
injuriesHospitalization: string;
supplementsOrDrugs: string;
}
export interface SystemReviewInterface {
eyes: string;
IntestinesBowls: string;
jointsBones: string;
allergies: string;
earsNoseMouth: string;
urinary: string;
skin: string;
psychological: string;
heart: string;
muscles: string;
internalOrgans: string;
gynecological: string;
lungsBreathing: string;
nerves: string;
blood: string;
prostate: string;
explanation: string;
}
export interface RecreationalHobbieInterface {
hobbies: string;
educationLevel: string;
excercise: string;
excerciseExplanation: string;
tobacco: string;
tobaccoExplanation: string;
alcohol: string;
alcoholExplanation: string;
healthyDiet: string;
healthyDietExplanation: string;
sleep: string;
sleepExplanation: string;
workSchool: string;
workSchoolExplanation: string;
familyLife: string;
familyLifeExplanation: string;
drugs: string;
drugsExplanation:string;
}
export interface OtherDetailsInterface {
familyHistory: string;
sleep: string;
pillow: string;
orthotics: string;
brestExam: any;
pregnancy: string;
menstralCycle: any;
}

View File

@ -15,37 +15,10 @@ import { useFormik } from 'formik';
import * as yup from 'yup'; import * as yup from 'yup';
import { LocalizationProvider, DatePicker } from '@mui/x-date-pickers'; import { LocalizationProvider, DatePicker } from '@mui/x-date-pickers';
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
import { FamilyInformationInterface } from '../Interface/Patient';
interface Patient {
maritalStatus: string | undefined;
numberOfChildren: string | undefined;
occupation: string | undefined;
hoursPerWeek: number | string | undefined;
employer: string | undefined;
businessPhone: string | undefined;
spouseName: string | undefined;
spouseEmployer: string | undefined;
spouseBusinessPhone: string | undefined;
emergencyContact: string | undefined;
relationship: string | undefined;
spousePhone: string | undefined;
}
type Props = { type Props = {
handleFamilyInformationFormData: ( handleFamilyInformationFormData: (patient:FamilyInformationInterface ) => void;
maritalStatus: string | undefined,
numberOfChildren: string | undefined,
occupation: string | undefined,
hoursPerWeek: number | string | undefined,
employer: string | undefined,
businessPhone: string | undefined,
spouseName: string | undefined,
spouseEmployer: string | undefined,
spouseBusinessPhone: string | undefined,
emergencyContact: string | undefined,
relationship: string | undefined,
spousePhone: string | undefined
) => void;
patientDataDiplay: any; patientDataDiplay: any;
type: string; type: string;
}; };
@ -55,7 +28,7 @@ export default function FamilyInformationForm({
patientDataDiplay, patientDataDiplay,
type, type,
}: Props) { }: Props) {
const [patient, setPatient] = React.useState<Patient>({ const [patient, setPatient] = React.useState<FamilyInformationInterface>({
maritalStatus: '', maritalStatus: '',
numberOfChildren: '', numberOfChildren: '',
occupation: '', occupation: '',
@ -71,20 +44,7 @@ export default function FamilyInformationForm({
}); });
useEffect(() => { useEffect(() => {
handleFamilyInformationFormData( handleFamilyInformationFormData(patient);
patient.maritalStatus,
patient.numberOfChildren,
patient.occupation,
patient.hoursPerWeek,
patient.employer,
patient.businessPhone,
patient.spouseName,
patient.spouseEmployer,
patient.spouseBusinessPhone,
patient.emergencyContact,
patient.relationship,
patient.spousePhone
);
}, [patient]); }, [patient]);
return ( return (

View File

@ -3,42 +3,17 @@ import { Checkbox, FormControlLabel, TextField, FormGroup, Grid, FormControl, Fo
import { useFormik } from 'formik'; import { useFormik } from 'formik';
import * as Yup from 'yup'; import * as Yup from 'yup';
import { useEffect } from 'react'; import { useEffect } from 'react';
import { MedicalHistoryInterface } from '../Interface/Patient';
interface Patient {
physicianname: string |undefined;
physiciancity: string |undefined;
physicianstate: string |undefined;
physicianphone: string |undefined;
chiropractorName: string |undefined;
chiropractorState: string |undefined;
xray: string|undefined;
haveChiropractor: string|undefined;
reference: string|undefined;
visitDetails: string |undefined;
cellPhoneProvider: string |undefined;
}
type Props = { type Props = {
handleMedicalHistoryFormData:( handleMedicalHistoryFormData:(patient:MedicalHistoryInterface)=> void
physicianname?: string |undefined,
physiciancity?: string |undefined,
physicianstate?: string |undefined,
physicianphone?: string |undefined,
chiropractorName?: string |undefined,
chiropractorState?: string |undefined,
xray?: string|undefined,
haveChiropractor?: string|undefined,
reference?: string|undefined,
visitDetails?: string |undefined,
cellPhoneProvider?: string |undefined,
)=> void
patientDataDiplay:any; patientDataDiplay:any;
type:string; type:string;
} }
export default function MedicalHistoryForm({handleMedicalHistoryFormData,patientDataDiplay,type}:Props){ export default function MedicalHistoryForm({handleMedicalHistoryFormData,patientDataDiplay,type}:Props){
const [patient, setPatient] = React.useState<Patient>({ const [patient, setPatient] = React.useState<MedicalHistoryInterface>({
physicianname: '', physicianname: '',
physiciancity: '', physiciancity: '',
physicianstate: '', physicianstate: '',
@ -53,19 +28,7 @@ export default function MedicalHistoryForm({handleMedicalHistoryFormData,patient
}); });
useEffect(()=>{ useEffect(()=>{
handleMedicalHistoryFormData( handleMedicalHistoryFormData(patient)
patient.physicianname,
patient.physiciancity,
patient.physicianstate,
patient.physicianphone,
patient.chiropractorName,
patient.chiropractorState,
patient.xray,
patient.haveChiropractor,
patient.reference,
patient.visitDetails,
patient.cellPhoneProvider,
)
},[patient]) },[patient])
return( return(

View File

@ -11,27 +11,10 @@ import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
import { LocalizationProvider, DatePicker } from '@mui/x-date-pickers'; import { LocalizationProvider, DatePicker } from '@mui/x-date-pickers';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { OtherDetailsInterface } from '../Interface/Patient';
interface Patient {
familyHistory: string;
sleep: string;
pillow: string;
orthotics: string;
brestExam: any;
pregnancy: string;
menstralCycle: any;
}
type Props = { type Props = {
handleOtherDetailsFormData: ( handleOtherDetailsFormData: (patient:OtherDetailsInterface) => void;
familyHistory: string | undefined,
sleep: string | undefined,
pillow: string | undefined,
orthotics: string | undefined,
brestExam: any,
pregnancy: string | undefined,
menstralCycle: any
) => void;
patientDataDiplay: any; patientDataDiplay: any;
type: string; type: string;
}; };
@ -41,7 +24,7 @@ export default function OtherDetailsForm({
patientDataDiplay, patientDataDiplay,
type, type,
}: Props) { }: Props) {
const [patient, setPatient] = React.useState<Patient>({ const [patient, setPatient] = React.useState<OtherDetailsInterface>({
familyHistory: '', familyHistory: '',
sleep: '', sleep: '',
pillow: '', pillow: '',
@ -52,15 +35,7 @@ export default function OtherDetailsForm({
}); });
useEffect(() => { useEffect(() => {
handleOtherDetailsFormData( handleOtherDetailsFormData(patient);
patient.familyHistory,
patient.sleep,
patient.pillow,
patient.orthotics,
(patient.brestExam = dayjs(patient.brestExam)),
patient.pregnancy,
(patient.menstralCycle = dayjs(patient.menstralCycle))
);
}, [patient]); }, [patient]);
const formatDate = (inputDate: any) => { const formatDate = (inputDate: any) => {
@ -230,7 +205,7 @@ export default function OtherDetailsForm({
const formattedDate = formatDate(event); const formattedDate = formatDate(event);
setPatient((prevValues) => ({ setPatient((prevValues) => ({
...prevValues, ...prevValues,
brestExam: formattedDate, brestExam: dayjs(formattedDate),
})); }));
}} }}
renderInput={(params) => ( renderInput={(params) => (
@ -302,7 +277,7 @@ export default function OtherDetailsForm({
const formattedDate = formatDate(event); const formattedDate = formatDate(event);
setPatient((prevValues) => ({ setPatient((prevValues) => ({
...prevValues, ...prevValues,
menstralCycle: formattedDate, menstralCycle: dayjs(formattedDate),
})); }));
}} }}
renderInput={(params) => ( renderInput={(params) => (

View File

@ -14,43 +14,20 @@ import { useFormik } from 'formik';
import * as Yup from 'yup'; import * as Yup from 'yup';
import path from 'path'; import path from 'path';
import { useEffect } from 'react'; import { useEffect } from 'react';
import { InjuryDetailsInterface } from '../Interface/Patient';
interface Patient {
chiefComplaint: string;
painWorse: string[];
painBetter: string[];
painQuality: string[];
painWorstTime: string[];
currentComplaintIssues: string[];
painDuration: string;
currentTreatment: string;
treatmentGoal: string;
selfTreatment: string;
}
type Props = { type Props = {
handleInjuryDetailsFormData: ( handleInjuryDetailsFormData: (patient:InjuryDetailsInterface) => void;
chiefComplaint: string | undefined,
painWorse: any,
painBetter: any,
painQuality: any,
painWorstTime: any,
currentComplaintIssues: any,
painDuration: string | undefined,
currentTreatment: string | undefined,
treatmentGoal: string | undefined,
selfTreatment: string | undefined
) => void;
patientDataDiplay: any; patientDataDiplay: any;
type: string; type: string;
}; };
export default function PainAnalysisForm({ export default function InjuryDetailsForm({
handleInjuryDetailsFormData, handleInjuryDetailsFormData,
patientDataDiplay, patientDataDiplay,
type, type,
}: Props) { }: Props) {
const [patient, setPatient] = React.useState<Patient>({ const [patient, setPatient] = React.useState<InjuryDetailsInterface>({
chiefComplaint: '', chiefComplaint: '',
painWorse: [], painWorse: [],
painBetter: [], painBetter: [],
@ -64,18 +41,7 @@ export default function PainAnalysisForm({
}); });
useEffect(() => { useEffect(() => {
handleInjuryDetailsFormData( handleInjuryDetailsFormData(patient);
patient.chiefComplaint,
patient.painWorse,
patient.painBetter,
patient.painQuality,
patient.painWorstTime,
patient.currentComplaintIssues,
patient.painDuration,
patient.currentTreatment,
patient.treatmentGoal,
patient.selfTreatment
);
}, [patient]); }, [patient]);
const handlePainWorseChange = ( const handlePainWorseChange = (

View File

@ -11,37 +11,10 @@ import {
import * as React from 'react'; import * as React from 'react';
import Table from '../Helper/AddNewTable'; import Table from '../Helper/AddNewTable';
import { useEffect } from 'react'; import { useEffect } from 'react';
import { PastTreatmentInterface } from '../Interface/Patient';
interface Patient {
generalHealth: string;
presentProblemBefore: string;
ifYespresentProblemBefore: string;
ifYestreatmentProvided: string;
ifYesOutcome: string;
strokeBloodclotting: string;
ifYesstrokeBloodclotting: string;
dizzinessFetigue: string;
ifyesdizzinessFetigue: string;
antiColligent: string;
injuriesHospitalization: string;
supplementsOrDrugs: string;
}
type Props = { type Props = {
handlePastTreatmentFormData: ( handlePastTreatmentFormData: (patient:PastTreatmentInterface) => void;
generalHealth: string | undefined,
presentProblemBefore: string | undefined,
ifYespresentProblemBefore: string | undefined,
ifYestreatmentProvided: string | undefined,
ifYesOutcome: string | undefined,
strokeBloodclotting: string | undefined,
ifYesstrokeBloodclotting: string | undefined,
dizzinessFetigue: string | undefined,
ifyesdizzinessFetigue: string | undefined,
antiColligent: string | undefined,
injuriesHospitalization: string | undefined,
supplementsOrDrugs: string | undefined
) => void;
patientDataDiplay: any; patientDataDiplay: any;
type: string; type: string;
}; };
@ -51,7 +24,7 @@ export default function PastTreatmentForm({
patientDataDiplay, patientDataDiplay,
type, type,
}: Props) { }: Props) {
const [patient, setPatient] = React.useState<Patient>({ const [patient, setPatient] = React.useState<PastTreatmentInterface>({
generalHealth: '', generalHealth: '',
presentProblemBefore: '', presentProblemBefore: '',
ifYespresentProblemBefore: '', ifYespresentProblemBefore: '',
@ -67,20 +40,7 @@ export default function PastTreatmentForm({
}); });
useEffect(() => { useEffect(() => {
handlePastTreatmentFormData( handlePastTreatmentFormData(patient);
patient.generalHealth,
patient.presentProblemBefore,
patient.ifYespresentProblemBefore,
patient.ifYestreatmentProvided,
patient.ifYesOutcome,
patient.strokeBloodclotting,
patient.ifYesstrokeBloodclotting,
patient.dizzinessFetigue,
patient.ifyesdizzinessFetigue,
patient.antiColligent,
patient.injuriesHospitalization,
patient.supplementsOrDrugs
);
}, [patient]); }, [patient]);
return ( return (

View File

@ -26,7 +26,7 @@ import MuiAccordionSummary, {
import MuiAccordionDetails from '@mui/material/AccordionDetails'; import MuiAccordionDetails from '@mui/material/AccordionDetails';
import MedicalHistory from './MedicalHistorySection'; import MedicalHistory from './MedicalHistorySection';
import FamilyInformationForm from './FamilyInformationSection'; import FamilyInformationForm from './FamilyInformationSection';
import PainAnalysisForm from './PainAnalysisSection'; import InjuryDetailsForm from './PainAnalysisSection';
import PastTreatmentForm from './PastTreatment'; import PastTreatmentForm from './PastTreatment';
import SystemReviewForm from './SyestemReviewSection'; import SystemReviewForm from './SyestemReviewSection';
import RecreationalHobbiesForm from './RecreationalHobbiesSection'; import RecreationalHobbiesForm from './RecreationalHobbiesSection';
@ -36,7 +36,7 @@ import ViewPatientImageMarker from '../ImageMarker/ViewPatientImageMarker';
import AlertDialog from '../Helper/AlertDialogBox'; import AlertDialog from '../Helper/AlertDialogBox';
import SignatureComponent from '../Helper/SignatureComponent'; import SignatureComponent from '../Helper/SignatureComponent';
import { Link, useLocation } from 'react-router-dom'; import { Link, useLocation } from 'react-router-dom';
import { Patient } from '../Interface/Patient'; import { FamilyInformationInterface, InjuryDetailsInterface, MedicalHistoryInterface, OtherDetailsInterface, PastTreatmentInterface, PersonalInformationInterface, RecreationalHobbieInterface, SystemReviewInterface } from '../Interface/Patient';
const Accordion = styled((props: AccordionProps) => ( const Accordion = styled((props: AccordionProps) => (
<MuiAccordion disableGutters elevation={0} square {...props} /> <MuiAccordion disableGutters elevation={0} square {...props} />
@ -95,224 +95,38 @@ export default function PatientForm({ type }: Props) {
const [patientDetailsButtonFlag, setPatientDetailsButtonFlag] = const [patientDetailsButtonFlag, setPatientDetailsButtonFlag] =
React.useState<boolean>(false); React.useState<boolean>(false);
const handlePersonalInformationFormData = (patient: Patient) => { const handlePersonalInformationFormData = (patient: PersonalInformationInterface) => {
setPersonalInformation(patient); setPersonalInformation(patient);
}; };
const handleFamilyInformationFormData = ( const handleFamilyInformationFormData = (
maritalStatus: string | undefined, patient:FamilyInformationInterface
numberOfChildren: string | undefined,
occupation: string | undefined,
hoursPerWeek: number | string | undefined,
employer: string | undefined,
businessPhone: string | undefined,
spouseName: string | undefined,
spouseEmployer: string | undefined,
spouseBusinessPhone: string | undefined,
emergencyContact: string | undefined,
relationship: string | undefined,
spousePhone: string | undefined
) => { ) => {
setFamilyInformation({ setFamilyInformation(patient);
maritalStatus,
numberOfChildren,
occupation,
hoursPerWeek,
employer,
businessPhone,
spouseName,
spouseEmployer,
spouseBusinessPhone,
emergencyContact,
relationship,
spousePhone,
});
}; };
const handleMedicalHistoryFormData = ( const handleMedicalHistoryFormData = (patient:MedicalHistoryInterface) => {
physicianname: string | undefined, setMedicalHistory(patient);
physiciancity: string | undefined,
physicianstate: string | undefined,
physicianphone: string | undefined,
chiropractorName: string | undefined,
chiropractorState: string | undefined,
xray: string | undefined,
haveChiropractor: string | undefined,
reference: string | undefined,
visitDetails: string | undefined,
cellPhoneProvider: string | undefined
) => {
setMedicalHistory({
physicianname,
physiciancity,
physicianstate,
physicianphone,
chiropractorName,
chiropractorState,
xray,
haveChiropractor,
reference,
visitDetails,
cellPhoneProvider,
});
}; };
const handleInjuryDetailsFormData = ( const handleInjuryDetailsFormData = (patient:InjuryDetailsInterface) => {
chiefComplaint: string | undefined, setInjuryDetails(patient);
painWorse: any,
painBetter: any,
painQuality: any,
painWorstTime: any,
currentComplaintIssues: any,
painDuration: string | undefined,
currentTreatment: string | undefined,
treatmentGoal: string | undefined,
selfTreatment: string | undefined
) => {
setInjuryDetails({
chiefComplaint,
painWorse,
painBetter,
painQuality,
painWorstTime,
currentComplaintIssues,
painDuration,
currentTreatment,
treatmentGoal,
selfTreatment,
});
}; };
const handlePastTreatmentFormData = ( const handlePastTreatmentFormData = (patient:PastTreatmentInterface) => {
generalHealth: string | undefined, setPastTreatment(patient);
presentProblemBefore: string | undefined,
ifYespresentProblemBefore: string | undefined,
ifYestreatmentProvided: string | undefined,
ifYesOutcome: string | undefined,
strokeBloodclotting: string | undefined,
ifYesstrokeBloodclotting: string | undefined,
dizzinessFetigue: string | undefined,
ifyesdizzinessFetigue: string | undefined,
antiColligent: string | undefined,
injuriesHospitalization: string | undefined,
supplementsOrDrugs: string | undefined
) => {
setPastTreatment({
generalHealth,
presentProblemBefore,
ifYespresentProblemBefore,
ifYestreatmentProvided,
ifYesOutcome,
strokeBloodclotting,
ifYesstrokeBloodclotting,
dizzinessFetigue,
ifyesdizzinessFetigue,
antiColligent,
injuriesHospitalization,
supplementsOrDrugs,
});
}; };
const handleSystemReviewFormData = ( const handleSystemReviewFormData = (patient:SystemReviewInterface) => {
eyes: string | undefined, setSystemReviewQuestions(patient);
IntestinesBowls: string | undefined,
jointsBones: string | undefined,
allergies: string | undefined,
earsNoseMouth: string | undefined,
urinary: string | undefined,
skin: string | undefined,
psychological: string | undefined,
heart: string | undefined,
muscles: string | undefined,
internalOrgans: string | undefined,
gynecological: string | undefined,
lungsBreathing: string | undefined,
nerves: string | undefined,
blood: string | undefined,
prostate: string | undefined,
explanation: string | undefined
) => {
setSystemReviewQuestions({
eyes,
IntestinesBowls,
jointsBones,
allergies,
earsNoseMouth,
urinary,
skin,
psychological,
heart,
muscles,
internalOrgans,
gynecological,
lungsBreathing,
nerves,
blood,
prostate,
explanation,
});
}; };
const handleRecreationalActivitiesFormData = ( const handleRecreationalActivitiesFormData = (patient:RecreationalHobbieInterface) => {
hobbies: string | undefined, setRecreationalActivities(patient);
educationLevel: string | undefined,
excercise: string | undefined,
excerciseExplanation: string | undefined,
tobacco: string | undefined,
tobaccoExplanation: string | undefined,
alcohol: string | undefined,
alcoholExplanation: string | undefined,
healthyDiet: string | undefined,
healthyDietExplanation: string | undefined,
sleep: string | undefined,
sleepExplanation: string | undefined,
workSchool: string | undefined,
workSchoolExplanation: string | undefined,
familyLife: string | undefined,
familyLifeExplanation: string | undefined,
drugs: string | undefined,
drugsExplanation: string | undefined
) => {
setRecreationalActivities({
hobbies,
educationLevel,
excercise,
excerciseExplanation,
tobacco,
tobaccoExplanation,
alcohol,
alcoholExplanation,
healthyDiet,
healthyDietExplanation,
sleep,
sleepExplanation,
workSchool,
workSchoolExplanation,
familyLife,
familyLifeExplanation,
drugs,
drugsExplanation,
});
}; };
const handleOtherDetailsFormData = ( const handleOtherDetailsFormData = (patient:OtherDetailsInterface) => {
familyHistory: string | undefined, setOtherDetails(patient);
sleep: string | undefined,
pillow: string | undefined,
orthotics: string | undefined,
brestExam: any,
pregnancy: string | undefined,
menstralCycle: any
) => {
setOtherDetails({
familyHistory,
sleep,
pillow,
orthotics,
brestExam,
pregnancy,
menstralCycle,
});
}; };
const handleSubmit = () => { const handleSubmit = () => {
@ -520,7 +334,7 @@ export default function PatientForm({ type }: Props) {
</AccordionSummary> </AccordionSummary>
<AccordionDetails> <AccordionDetails>
<PainAnalysisForm <InjuryDetailsForm
handleInjuryDetailsFormData={handleInjuryDetailsFormData} handleInjuryDetailsFormData={handleInjuryDetailsFormData}
patientDataDiplay={patientData.injuryDetails} patientDataDiplay={patientData.injuryDetails}
type={type} type={type}

View File

@ -13,10 +13,10 @@ import {
import { LocalizationProvider, DatePicker } from '@mui/x-date-pickers'; import { LocalizationProvider, DatePicker } from '@mui/x-date-pickers';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { useEffect } from 'react'; import { useEffect } from 'react';
import { Patient } from '../Interface/Patient'; import { PersonalInformationInterface } from '../Interface/Patient';
type Props = { type Props = {
handlePersonalInformationFormData: (patient: Patient) => void; handlePersonalInformationFormData: (patient: PersonalInformationInterface) => void;
patientDataDiplay: any; patientDataDiplay: any;
type: string; type: string;
}; };
@ -27,7 +27,7 @@ export default function PersonalInformationForm({
type, type,
}: Props) { }: Props) {
const [birthDateValue, setBirthDateValue] = React.useState<any>(); const [birthDateValue, setBirthDateValue] = React.useState<any>();
const [patient, setPatient] = React.useState<Patient>({ const [patient, setPatient] = React.useState<PersonalInformationInterface>({
fullName: '', fullName: '',
homePhone: '', homePhone: '',
cellPhone: '', cellPhone: '',

View File

@ -1,54 +1,15 @@
import { FormControl, FormControlLabel, FormLabel, Grid, Radio, RadioGroup, TextField } from "@mui/material"; import { FormControl, FormControlLabel, FormLabel, Grid, Radio, RadioGroup, TextField } from "@mui/material";
import React, { useEffect } from "react"; import React, { useEffect } from "react";
import { RecreationalHobbieInterface } from "../Interface/Patient";
interface Patient {
hobbies: string;
educationLevel: string;
excercise: string;
excerciseExplanation: string;
tobacco: string;
tobaccoExplanation: string;
alcohol: string;
alcoholExplanation: string;
healthyDiet: string;
healthyDietExplanation: string;
sleep: string;
sleepExplanation: string;
workSchool: string;
workSchoolExplanation: string;
familyLife: string;
familyLifeExplanation: string;
drugs: string;
drugsExplanation:string;
}
type Props = { type Props = {
handleRecreationalActivitiesFormData:( handleRecreationalActivitiesFormData:(patient:RecreationalHobbieInterface)=> void
hobbies: string|undefined,
educationLevel: string|undefined,
excercise: string|undefined,
excerciseExplanation: string|undefined,
tobacco: string|undefined,
tobaccoExplanation: string|undefined,
alcohol: string|undefined,
alcoholExplanation: string|undefined,
healthyDiet: string|undefined,
healthyDietExplanation: string|undefined,
sleep: string|undefined,
sleepExplanation: string|undefined,
workSchool: string|undefined,
workSchoolExplanation: string|undefined,
familyLife: string|undefined,
familyLifeExplanation: string|undefined,
drugs: string|undefined,
drugsExplanation:string|undefined,
)=> void
patientDataDiplay:any; patientDataDiplay:any;
type:string; type:string;
} }
export default function RecreationalHobbiesForm({handleRecreationalActivitiesFormData,patientDataDiplay,type}:Props){ export default function RecreationalHobbiesForm({handleRecreationalActivitiesFormData,patientDataDiplay,type}:Props){
const [patient, setPatient] = React.useState<Patient>({ const [patient, setPatient] = React.useState<RecreationalHobbieInterface>({
hobbies: '', hobbies: '',
educationLevel: '', educationLevel: '',
excercise:'', excercise:'',
@ -71,26 +32,7 @@ export default function RecreationalHobbiesForm({handleRecreationalActivitiesFor
useEffect(()=>{ useEffect(()=>{
handleRecreationalActivitiesFormData( handleRecreationalActivitiesFormData(patient)
patient.hobbies,
patient.educationLevel,
patient.excercise,
patient.excerciseExplanation,
patient.tobacco,
patient.tobaccoExplanation,
patient.alcohol,
patient.alcoholExplanation,
patient.healthyDiet,
patient.healthyDietExplanation,
patient.sleep,
patient.sleepExplanation,
patient.workSchool,
patient.workSchoolExplanation,
patient.familyLife,
patient.familyLifeExplanation,
patient.drugs,
patient.drugsExplanation
)
},[patient]) },[patient])
return( return(

View File

@ -8,47 +8,10 @@ import {
TextField, TextField,
} from '@mui/material'; } from '@mui/material';
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
import { SystemReviewInterface } from '../Interface/Patient';
interface Patient {
eyes: string;
IntestinesBowls: string;
jointsBones: string;
allergies: string;
earsNoseMouth: string;
urinary: string;
skin: string;
psychological: string;
heart: string;
muscles: string;
internalOrgans: string;
gynecological: string;
lungsBreathing: string;
nerves: string;
blood: string;
prostate: string;
explanation: string;
}
type Props = { type Props = {
handleSystemReviewFormData: ( handleSystemReviewFormData: (patient:SystemReviewInterface) => void;
eyes: string | undefined,
IntestinesBowls: string | undefined,
jointsBones: string | undefined,
allergies: string | undefined,
earsNoseMouth: string | undefined,
urinary: string | undefined,
skin: string | undefined,
psychological: string | undefined,
heart: string | undefined,
muscles: string | undefined,
internalOrgans: string | undefined,
gynecological: string | undefined,
lungsBreathing: string | undefined,
nerves: string | undefined,
blood: string | undefined,
prostate: string | undefined,
explanation: string | undefined
) => void;
patientDataDiplay: any; patientDataDiplay: any;
type: string; type: string;
}; };
@ -58,7 +21,7 @@ export default function SystemReviewForm({
patientDataDiplay, patientDataDiplay,
type, type,
}: Props) { }: Props) {
const [patient, setPatients] = React.useState<Patient>({ const [patient, setPatients] = React.useState<SystemReviewInterface>({
eyes: '', eyes: '',
IntestinesBowls: '', IntestinesBowls: '',
jointsBones: '', jointsBones: '',
@ -79,25 +42,7 @@ export default function SystemReviewForm({
}); });
useEffect(() => { useEffect(() => {
handleSystemReviewFormData( handleSystemReviewFormData(patient);
patient.eyes,
patient.IntestinesBowls,
patient.jointsBones,
patient.allergies,
patient.earsNoseMouth,
patient.urinary,
patient.skin,
patient.psychological,
patient.heart,
patient.muscles,
patient.internalOrgans,
patient.gynecological,
patient.lungsBreathing,
patient.nerves,
patient.blood,
patient.prostate,
patient.explanation
);
}, [patient]); }, [patient]);
return ( return (
<> <>