From f3fa5136ec6226c6afbe55e87c04f72b1c35d1ed Mon Sep 17 00:00:00 2001 From: sonika <> Date: Sun, 20 Aug 2023 20:39:44 +0530 Subject: [PATCH] Medical history section --- ...ormSection2.tsx => FamilyFormSection2.tsx} | 17 +-- .../PatientForm/MedicalHistorySection3.tsx | 144 ++++++++++++++++++ src/Components/PatientForm/PatientForm.tsx | 32 +++- ...{FormSection1.tsx => PersonalSection1.tsx} | 4 +- 4 files changed, 178 insertions(+), 19 deletions(-) rename src/Components/PatientForm/{FormSection2.tsx => FamilyFormSection2.tsx} (96%) create mode 100644 src/Components/PatientForm/MedicalHistorySection3.tsx rename src/Components/PatientForm/{FormSection1.tsx => PersonalSection1.tsx} (99%) diff --git a/src/Components/PatientForm/FormSection2.tsx b/src/Components/PatientForm/FamilyFormSection2.tsx similarity index 96% rename from src/Components/PatientForm/FormSection2.tsx rename to src/Components/PatientForm/FamilyFormSection2.tsx index b7069f3..8d1ab00 100644 --- a/src/Components/PatientForm/FormSection2.tsx +++ b/src/Components/PatientForm/FamilyFormSection2.tsx @@ -16,7 +16,7 @@ interface FormValues { spouseBusinessPhone: string; emergencyContact: string; relationship: string; - phone: string; + spousePhone: string; } const validationSchema = yup.object({ @@ -32,10 +32,10 @@ const validationSchema = yup.object({ // spouseBusinessPhone:yup.string().required("Full name is required"), emergencyContact:yup.string().matches(/^\d{10}$/, "Cell phone must be 10 digits"), relationship:yup.string().required("Relationship is required"), - phone:yup.string().matches(/^\d{10}$/, "Cell phone must be 10 digits"), + spousePhone:yup.string().matches(/^\d{10}$/, "Cell phone must be 10 digits"), }); -const Form: React.FC = () => { +export default function FamilyFormSection(){ const formik = useFormik({ initialValues:{ maritalStatus:'', @@ -50,7 +50,7 @@ const Form: React.FC = () => { spouseBusinessPhone:'', emergencyContact:'', relationship:'', - phone:'' + spousePhone:'' }, validationSchema, onSubmit:(values)=>{ @@ -87,6 +87,7 @@ const Form: React.FC = () => { { { - ) }; - -export default Form; \ No newline at end of file diff --git a/src/Components/PatientForm/MedicalHistorySection3.tsx b/src/Components/PatientForm/MedicalHistorySection3.tsx new file mode 100644 index 0000000..7cf12b5 --- /dev/null +++ b/src/Components/PatientForm/MedicalHistorySection3.tsx @@ -0,0 +1,144 @@ +import * as React from 'react'; +import { Checkbox, FormControlLabel, TextField, FormGroup, Grid, FormControl, FormLabel, Radio, RadioGroup } from '@mui/material'; +import { useFormik } from 'formik'; +import * as Yup from 'yup'; + +interface FormValues { + physicianname: string; + physiciancity: string; + physicianstate: string; + physicianphone: string; + chiropractorName: string; + chiropractorState: string; + xray: boolean; + ctScan: boolean; + cdImages: boolean; + visitDetails: string; + cellPhoneProvider: string; +} + +const validationSchema = Yup.object({ + familyphysician: Yup.string().required('Required'), + city: Yup.string().required('Required'), + state: Yup.string().required('Required'), + phone: Yup.string().required('Required'), + chiropractorName: Yup.string().required('Required'), + xray: Yup.boolean().required('Required'), + ctScan: Yup.boolean().required('Required'), + cdImages: Yup.boolean().required('Required'), + visitDetails: Yup.string().required('Required'), + cellPhoneProvider: Yup.string().required('Required'), +}); + +export default function MedicalHistoryForm(){ + const formik = useFormik({ + initialValues:{ + physicianname: '', + physiciancity: '', + physicianstate: '', + physicianphone: '', + chiropractorName: '', + chiropractorState: '', + xray: false, + ctScan: false, + cdImages: false, + visitDetails: '', + cellPhoneProvider: '', + }, + validationSchema, + onSubmit:(values)=>{ + console.log(values); + } + }) + return( + <> +
+ + + + + + + + + + + + + + + + + + + + Previous Chiropractic Care + + } label="Yes" /> + } label="No" /> + + + + + + + + + + + + +
+ + )} + \ No newline at end of file diff --git a/src/Components/PatientForm/PatientForm.tsx b/src/Components/PatientForm/PatientForm.tsx index 3d65d97..4dd2fb9 100644 --- a/src/Components/PatientForm/PatientForm.tsx +++ b/src/Components/PatientForm/PatientForm.tsx @@ -4,7 +4,7 @@ import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import Footer from "../Footer"; import Header from "../Header"; import {Button, Grid, Paper, Radio, RadioGroup, TextField } from '@mui/material'; -import FormSection1 from './FormSection1'; +import PersonalSection from './PersonalSection1'; import { styled } from '@mui/material/styles'; import ArrowForwardIosSharpIcon from '@mui/icons-material/ArrowForwardIosSharp'; import MuiAccordion, { AccordionProps } from '@mui/material/Accordion'; @@ -12,7 +12,9 @@ import MuiAccordionSummary, { AccordionSummaryProps, } from '@mui/material/AccordionSummary'; import MuiAccordionDetails from '@mui/material/AccordionDetails'; -import FormSection2 from './FormSection2'; +import FormSection2 from './FamilyFormSection2'; +import MedicalHistory from './MedicalHistorySection3'; +import FamilyFormSection from './FamilyFormSection2'; interface Patient { fullName: string; @@ -100,34 +102,47 @@ export default function PatientForm(){
+
Confidential Patient Information - + } aria-controls="panel1a-content" id="panel1a-header" > - Basic Patient Information (Part 1) + Patient's Personal Information - + - + - Basic Patient Information (Part 2) + Patient's Family Information + - + + + + + Patient's Medical History Information + + + + + + +