feature/patientSubmitData #2
@ -82,6 +82,7 @@ export default function PatientForm(){
|
||||
const [section3Data, setSection3Data] = React.useState<any>({});
|
||||
const [section4Data, setSection4Data] = React.useState<any>({});
|
||||
const [section5Data, setSection5Data] = React.useState<any>({});
|
||||
const [section6Data, setSection6Data] = React.useState<any>({});
|
||||
|
||||
const handleFormSection1Data = (
|
||||
fullName?: string|undefined,
|
||||
@ -226,6 +227,46 @@ export default function PatientForm(){
|
||||
supplementsOrDrugs,
|
||||
})
|
||||
}
|
||||
|
||||
const handleFormSection6Data = (
|
||||
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,
|
||||
) =>{
|
||||
setSection6Data({
|
||||
eyes,
|
||||
IntestinesBowls,
|
||||
jointsBones,
|
||||
allergies,
|
||||
earsNoseMouth,
|
||||
urinary,
|
||||
skin,
|
||||
psychological,
|
||||
heart,
|
||||
muscles,
|
||||
internalOrgans,
|
||||
gynecological,
|
||||
lungsBreathing,
|
||||
nerves,
|
||||
blood,
|
||||
prostate,
|
||||
explanation,
|
||||
})
|
||||
}
|
||||
|
||||
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
|
||||
event.preventDefault();
|
||||
@ -240,7 +281,7 @@ export default function PatientForm(){
|
||||
setIsChecked(event.target.checked);
|
||||
};
|
||||
|
||||
console.log("wyeytweevfde",section4Data)
|
||||
console.log("wyeytweevfde",section6Data)
|
||||
|
||||
|
||||
return(
|
||||
@ -315,7 +356,7 @@ export default function PatientForm(){
|
||||
</AccordionSummary>
|
||||
|
||||
<AccordionDetails>
|
||||
<SystemReviewSection6/>
|
||||
<SystemReviewSection6 handleFormSection6Data={handleFormSection6Data}/>
|
||||
</AccordionDetails>
|
||||
</Accordion>
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { FormControl, FormControlLabel, FormLabel, Grid, Radio, RadioGroup, TextField } from "@mui/material";
|
||||
import React from "react";
|
||||
import React, { useEffect } from "react";
|
||||
|
||||
interface FormValues {
|
||||
interface Patient {
|
||||
eyes: string;
|
||||
IntestinesBowls: string;
|
||||
jointsBones:string;
|
||||
@ -21,8 +21,30 @@ interface FormValues {
|
||||
explanation:string;
|
||||
}
|
||||
|
||||
export default function SystemReviewSection6(){
|
||||
const [values, setValues] = React.useState<FormValues>({
|
||||
type Props = {
|
||||
handleFormSection6Data:(
|
||||
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
|
||||
}
|
||||
|
||||
export default function SystemReviewSection6({handleFormSection6Data}:Props){
|
||||
const [patient, setPatients] = React.useState<Patient>({
|
||||
eyes: '',
|
||||
IntestinesBowls: '',
|
||||
jointsBones:'',
|
||||
@ -41,6 +63,28 @@ export default function SystemReviewSection6(){
|
||||
prostate: '',
|
||||
explanation:'',
|
||||
});
|
||||
|
||||
useEffect(()=>{
|
||||
handleFormSection6Data(
|
||||
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])
|
||||
return(
|
||||
<>
|
||||
<Grid item xs={12} className='collapsable-form-style '>
|
||||
@ -54,7 +98,7 @@ export default function SystemReviewSection6(){
|
||||
name="painDuration"
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
onChange={(event) => {
|
||||
setValues((prevValues) => ({
|
||||
setPatients((prevValues) => ({
|
||||
...prevValues,
|
||||
eyes: event.target.value,
|
||||
}));
|
||||
@ -72,9 +116,9 @@ export default function SystemReviewSection6(){
|
||||
name="painDuration"
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
onChange={(event) => {
|
||||
setValues((prevValues) => ({
|
||||
setPatients((prevValues) => ({
|
||||
...prevValues,
|
||||
presentProblemBefore: event.target.value,
|
||||
IntestinesBowls: event.target.value,
|
||||
}));
|
||||
}}
|
||||
>
|
||||
@ -90,7 +134,7 @@ export default function SystemReviewSection6(){
|
||||
name="painDuration"
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
onChange={(event) => {
|
||||
setValues((prevValues) => ({
|
||||
setPatients((prevValues) => ({
|
||||
...prevValues,
|
||||
jointsBones: event.target.value,
|
||||
}));
|
||||
@ -108,7 +152,7 @@ export default function SystemReviewSection6(){
|
||||
name="painDuration"
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
onChange={(event) => {
|
||||
setValues((prevValues) => ({
|
||||
setPatients((prevValues) => ({
|
||||
...prevValues,
|
||||
allergies: event.target.value,
|
||||
}));
|
||||
@ -126,7 +170,7 @@ export default function SystemReviewSection6(){
|
||||
name="painDuration"
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
onChange={(event) => {
|
||||
setValues((prevValues) => ({
|
||||
setPatients((prevValues) => ({
|
||||
...prevValues,
|
||||
earsNoseMouth: event.target.value,
|
||||
}));
|
||||
@ -144,7 +188,7 @@ export default function SystemReviewSection6(){
|
||||
name="painDuration"
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
onChange={(event) => {
|
||||
setValues((prevValues) => ({
|
||||
setPatients((prevValues) => ({
|
||||
...prevValues,
|
||||
urinary: event.target.value,
|
||||
}));
|
||||
@ -162,7 +206,7 @@ export default function SystemReviewSection6(){
|
||||
name="painDuration"
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
onChange={(event) => {
|
||||
setValues((prevValues) => ({
|
||||
setPatients((prevValues) => ({
|
||||
...prevValues,
|
||||
skin: event.target.value,
|
||||
}));
|
||||
@ -180,7 +224,7 @@ export default function SystemReviewSection6(){
|
||||
name="painDuration"
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
onChange={(event) => {
|
||||
setValues((prevValues) => ({
|
||||
setPatients((prevValues) => ({
|
||||
...prevValues,
|
||||
psychological: event.target.value,
|
||||
}));
|
||||
@ -198,7 +242,7 @@ export default function SystemReviewSection6(){
|
||||
name="painDuration"
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
onChange={(event) => {
|
||||
setValues((prevValues) => ({
|
||||
setPatients((prevValues) => ({
|
||||
...prevValues,
|
||||
heart: event.target.value,
|
||||
}));
|
||||
@ -216,7 +260,7 @@ export default function SystemReviewSection6(){
|
||||
name="painDuration"
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
onChange={(event) => {
|
||||
setValues((prevValues) => ({
|
||||
setPatients((prevValues) => ({
|
||||
...prevValues,
|
||||
muscles: event.target.value,
|
||||
}));
|
||||
@ -234,7 +278,7 @@ export default function SystemReviewSection6(){
|
||||
name="painDuration"
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
onChange={(event) => {
|
||||
setValues((prevValues) => ({
|
||||
setPatients((prevValues) => ({
|
||||
...prevValues,
|
||||
internalOrgans: event.target.value,
|
||||
}));
|
||||
@ -252,7 +296,7 @@ export default function SystemReviewSection6(){
|
||||
name="painDuration"
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
onChange={(event) => {
|
||||
setValues((prevValues) => ({
|
||||
setPatients((prevValues) => ({
|
||||
...prevValues,
|
||||
gynecological: event.target.value,
|
||||
}));
|
||||
@ -271,7 +315,7 @@ export default function SystemReviewSection6(){
|
||||
name="painDuration"
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
onChange={(event) => {
|
||||
setValues((prevValues) => ({
|
||||
setPatients((prevValues) => ({
|
||||
...prevValues,
|
||||
lungsBreathing: event.target.value,
|
||||
}));
|
||||
@ -289,7 +333,7 @@ export default function SystemReviewSection6(){
|
||||
name="painDuration"
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
onChange={(event) => {
|
||||
setValues((prevValues) => ({
|
||||
setPatients((prevValues) => ({
|
||||
...prevValues,
|
||||
nerves: event.target.value,
|
||||
}));
|
||||
@ -307,7 +351,7 @@ export default function SystemReviewSection6(){
|
||||
name="painDuration"
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
onChange={(event) => {
|
||||
setValues((prevValues) => ({
|
||||
setPatients((prevValues) => ({
|
||||
...prevValues,
|
||||
blood: event.target.value,
|
||||
}));
|
||||
@ -325,7 +369,7 @@ export default function SystemReviewSection6(){
|
||||
name="painDuration"
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
onChange={(event) => {
|
||||
setValues((prevValues) => ({
|
||||
setPatients((prevValues) => ({
|
||||
...prevValues,
|
||||
prostate: event.target.value,
|
||||
}));
|
||||
@ -343,8 +387,9 @@ export default function SystemReviewSection6(){
|
||||
variant="outlined"
|
||||
label=""
|
||||
name='explanation'
|
||||
value={patient.explanation}
|
||||
onChange={(event:any) => {
|
||||
setValues((prevValues) => ({
|
||||
setPatients((prevValues) => ({
|
||||
...prevValues,
|
||||
explanation: event.target.value,
|
||||
}));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user