From 5add485a0b892a62755422ac771bca0573240b06 Mon Sep 17 00:00:00 2001 From: vipeeshpavithran Date: Tue, 5 Sep 2023 12:29:08 +0530 Subject: [PATCH 01/14] Added View Patient details screen --- src/App.tsx | 4 +- src/Components/ImageMarker/EntryForm.tsx | 4 +- .../ImageMarker/PatientImageMarker.css | 19 +- .../ImageMarker/PatientImageMarker.tsx | 5 +- src/Components/ImageMarker/Rating.tsx | 6 +- .../ImageMarker/ViewPatientImageMarker.tsx | 30 ++ .../PatientDetails/FamilyFormSection2.tsx | 185 ++++++++++ .../PatientDetails/MedicalHistorySection3.tsx | 165 +++++++++ .../PatientDetails/OtherDetails8.tsx | 113 ++++++ .../PatientDetails/PainAnalysisSection4.tsx | 219 ++++++++++++ .../PatientDetails/PastTreatment5.tsx | 170 +++++++++ .../PatientDetails/PatientDetails.tsx | 333 ++++++++++++++++++ .../PatientDetails/PersonalSection1.tsx | 170 +++++++++ .../RecreationalHobbiesSection7.tsx | 243 +++++++++++++ .../PatientDetails/SyestemReviewSection6.tsx | 237 +++++++++++++ 15 files changed, 1896 insertions(+), 7 deletions(-) create mode 100644 src/Components/ImageMarker/ViewPatientImageMarker.tsx create mode 100644 src/Components/PatientDetails/FamilyFormSection2.tsx create mode 100644 src/Components/PatientDetails/MedicalHistorySection3.tsx create mode 100644 src/Components/PatientDetails/OtherDetails8.tsx create mode 100644 src/Components/PatientDetails/PainAnalysisSection4.tsx create mode 100644 src/Components/PatientDetails/PastTreatment5.tsx create mode 100644 src/Components/PatientDetails/PatientDetails.tsx create mode 100644 src/Components/PatientDetails/PersonalSection1.tsx create mode 100644 src/Components/PatientDetails/RecreationalHobbiesSection7.tsx create mode 100644 src/Components/PatientDetails/SyestemReviewSection6.tsx diff --git a/src/App.tsx b/src/App.tsx index b36c56b..6bc59a8 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,6 +3,7 @@ import './App.css'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { BrowserRouter, Route, Routes } from 'react-router-dom'; import PatientForm from './Components/PatientForm/PatientForm'; +import PatientDetails from './Components/PatientDetails/PatientDetails'; function App() { const queryClient = new QueryClient(); @@ -11,7 +12,8 @@ function App() {
- }/> + } /> + }/>
diff --git a/src/Components/ImageMarker/EntryForm.tsx b/src/Components/ImageMarker/EntryForm.tsx index a793ce5..06e92c8 100644 --- a/src/Components/ImageMarker/EntryForm.tsx +++ b/src/Components/ImageMarker/EntryForm.tsx @@ -24,14 +24,14 @@ const EntryForm = ({ entries, onUpdate, onDelete, onSave }: Props) => { onDelete={onDelete} /> ))} - {/* { + { entries && entries.length > 0 &&
- } */} + } ); }; diff --git a/src/Components/ImageMarker/PatientImageMarker.css b/src/Components/ImageMarker/PatientImageMarker.css index dc4906a..3abf761 100644 --- a/src/Components/ImageMarker/PatientImageMarker.css +++ b/src/Components/ImageMarker/PatientImageMarker.css @@ -39,6 +39,19 @@ width: 80%; } +.image-marker-div .entry-div .sub-header { + font-weight: 500; + font-size: 16px; +} + +.ratingResult { + display: flex; + align-items: center; + gap: 5px; + margin-top: 2%; + margin-bottom: 3%; +} + @media only screen and (max-width: 1200px) { .image-marker-div { flex-direction: column; @@ -60,7 +73,11 @@ @media only screen and (min-width: 1400px) { .image-marker-div .rating-div { - width: 60%; + width: 70%; + } + + .ratingResult .rating-div { + width: 80%; } } diff --git a/src/Components/ImageMarker/PatientImageMarker.tsx b/src/Components/ImageMarker/PatientImageMarker.tsx index be39ddb..1ac39be 100644 --- a/src/Components/ImageMarker/PatientImageMarker.tsx +++ b/src/Components/ImageMarker/PatientImageMarker.tsx @@ -34,7 +34,10 @@ const PatientImageMarker = (props: Props) => { }; const onSave = () => { - + localStorage.setItem( + 'entry', + JSON.stringify({ markers: markers, entries: entries }) + ); } useEffect(() => { diff --git a/src/Components/ImageMarker/Rating.tsx b/src/Components/ImageMarker/Rating.tsx index cb8906a..92089d6 100644 --- a/src/Components/ImageMarker/Rating.tsx +++ b/src/Components/ImageMarker/Rating.tsx @@ -5,9 +5,10 @@ type Props = { index: number; defaultValue: number; onUpdate: (data: any) => void; + disabled?: boolean; }; -const Rating = ({index, defaultValue, onUpdate} : Props) => { +const Rating = ({index, defaultValue, onUpdate, disabled} : Props) => { return (
{[...Array(10)].map((star, ind) => { @@ -16,7 +17,8 @@ const Rating = ({index, defaultValue, onUpdate} : Props) => { diff --git a/src/Components/ImageMarker/ViewPatientImageMarker.tsx b/src/Components/ImageMarker/ViewPatientImageMarker.tsx new file mode 100644 index 0000000..6564ca4 --- /dev/null +++ b/src/Components/ImageMarker/ViewPatientImageMarker.tsx @@ -0,0 +1,30 @@ +import React, { useEffect, useState } from 'react' +import ImageMarker, { Marker } from 'react-image-marker'; + +import humanImage from '../../Assets/human_body_3d.jpg'; +import './PatientImageMarker.css' +import Rating from './Rating'; + +type Props = {} + +const ViewPatientImageMarker = (props: Props) => { + const saved = JSON.parse(localStorage.getItem('entry') || '{}'); + return ( +
+
+ How much pain? + {saved.entries?.map((entry: any, index: number) => ( +
+ {entry.index} + {}} disabled/> +
+ ))} +
+
+ +
+
+ ) +} + +export default ViewPatientImageMarker; \ No newline at end of file diff --git a/src/Components/PatientDetails/FamilyFormSection2.tsx b/src/Components/PatientDetails/FamilyFormSection2.tsx new file mode 100644 index 0000000..4f6a7f8 --- /dev/null +++ b/src/Components/PatientDetails/FamilyFormSection2.tsx @@ -0,0 +1,185 @@ +import { Button, Checkbox, FormControl, FormControlLabel, FormGroup, FormLabel, Grid, Paper, Radio, RadioGroup, TextField } from '@mui/material'; +import { useFormik } from "formik"; +import * as yup from "yup"; +import { LocalizationProvider, DatePicker } from '@mui/x-date-pickers'; + +interface FormValues { + maritalStatus: string; + numberOfChildren: string; + ages: string; + occupation: string; + hoursPerWeek: number | string; + employer: string; + businessPhone: string; + spouseName: string; + spouseEmployer: string; + spouseBusinessPhone: string; + emergencyContact: string; + relationship: string; + spousePhone: string; +} + +interface Props { + familyDetails: FormValues; +} + +export default function FamilyFormSection({familyDetails}:Props){ + return( + <> + + + + Marital Status + + } label="Married" /> + } label="Single" /> + } label="Widowed" /> + } label="Seperated" /> + } label="Divorced" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + Spouse's Information: + + + + + + + + + + + + + + Emergency: + + + + + + + + + + + + + + + ) +}; diff --git a/src/Components/PatientDetails/MedicalHistorySection3.tsx b/src/Components/PatientDetails/MedicalHistorySection3.tsx new file mode 100644 index 0000000..fdd49b2 --- /dev/null +++ b/src/Components/PatientDetails/MedicalHistorySection3.tsx @@ -0,0 +1,165 @@ +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; +} + +interface Props { + medicalHistory: FormValues; +} + +export default function MedicalHistoryForm({medicalHistory}:Props){ + return( + <> + + Physician Hisory Information: + + + + + + + + + + + + + + + + + + + + + Chiropractor Information: + + + + + Previous Chiropractic Care: + + } label="Yes" /> + } label="No" /> + + + + + + + + + + + + + + + + Have you had an X-ray/CT Scan within the last 12 months? If yes, did you bring the CD of images for the doctor to review? + + } label="Yes" /> + } label="No" /> + + + + + + + Who can we thank for referring you to our office: + + } label="Friend" /> + } label="Relative" /> + } label="Physician" /> + } label="Instagram" /> + } label="Google" /> + } label="Others" /> + + + + + + + How do you prefer to be reminded of your appointments? + + } label="Email" /> + } label="Text" /> + + + + + )} + \ No newline at end of file diff --git a/src/Components/PatientDetails/OtherDetails8.tsx b/src/Components/PatientDetails/OtherDetails8.tsx new file mode 100644 index 0000000..18513d0 --- /dev/null +++ b/src/Components/PatientDetails/OtherDetails8.tsx @@ -0,0 +1,113 @@ +import { Grid, FormLabel, TextField, FormControl, RadioGroup, FormControlLabel, Radio } from "@mui/material"; +import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs"; +import React from "react"; +import { LocalizationProvider, DatePicker } from '@mui/x-date-pickers'; +import dayjs from "dayjs"; + +interface FormValues { + familyHistory: string; + sleep: string; + pillow:string; + orthotics:string; + brestExam: any; + pregnancy:string; + menstralCycle: any; + } + +export default function OtherDetails8(){ + + return( + <> + + + Family history and health status:

+ +
+ + + + How do you sleep? + + } label="Back" /> + } label="Side" /> + } label="Stomach" /> + + + + + + + Do you use a pillow? + + } label="Yes" /> + } label="No" /> + + + + + + + Do you wear orthotics or arch support? + + } label="Yes" /> + } label="No" /> + + + + + + Date of last gynecological and brest exam?

+ + + +
+ + {/* + For X-Ray purposes: + */} + + + + Possible pregnancy? + + } label="Yes" /> + } label="No" /> + + + + + + Date of last menstrual cycle?

+ + + +
+ + +
+ + ) +} \ No newline at end of file diff --git a/src/Components/PatientDetails/PainAnalysisSection4.tsx b/src/Components/PatientDetails/PainAnalysisSection4.tsx new file mode 100644 index 0000000..0ecfca1 --- /dev/null +++ b/src/Components/PatientDetails/PainAnalysisSection4.tsx @@ -0,0 +1,219 @@ +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 { + chiefComplaint:string; + painQuality: string[]; + painDuration: string; + currentTreatment: string; + treatmentResults: string; + treatmentGoal: string; +} +interface Props { + painAnalysis: FormValues; + } + +export default function PainAnalysisSection4({painAnalysis}:Props){ + return( + <> + + Issue Details: + + + + + + + + + What makes your pain worse? + + } + label="Bending" + /> + } + label="Standing" + /> + } + label="Sitting" + /> + } + label="Walking" + /> + } + label="Others" + /> + + + + + + + What makes your pain better? + + } + label="laying down" + /> + } + label="Standing" + /> + } + label="Sitting" + /> + } + label="Walking" + /> + } + label="Others" + /> + + + + + + + What is the quality of your pain? + + } + label="Sharp" + /> + } + label="Dull/Ache" + /> + } + label="Throbbing" + /> + } + label="Tingling/Numbness/Burning" + /> + } + label="Others" + /> + + + + + + + What is the worst time for your pain? + + } + label="Morning" + /> + } + label="During day" + /> + } + label="Evening" + /> + } + label="Lying in bed" + /> + } + label="Others" + /> + + + + + + + How much of the day do you experience your chief complaint? + + } label="0-25%" /> + } label="25-50%" /> + } label="50-75%" /> + } label="75-100%" /> + + + + + + + Has your current complaint caused any of the following? + + } + label="Muscle weakness" + /> + } + label="Bowel/Bladder problem" + /> + } + label="Digestion" + /> + } + label="Cardiac/Respiratory" + /> + + + + + + + + Have you tried any self treatment (ex-ice, heat, excercise) or taken any medication(over the counter or prescription)? + + } label="Yes" /> + } label="No" /> + + + + + + Expected Treatment Result: + + + + + + + + + )} + \ No newline at end of file diff --git a/src/Components/PatientDetails/PastTreatment5.tsx b/src/Components/PatientDetails/PastTreatment5.tsx new file mode 100644 index 0000000..c863f6e --- /dev/null +++ b/src/Components/PatientDetails/PastTreatment5.tsx @@ -0,0 +1,170 @@ +import { TextField, FormControlLabel,Grid,Checkbox, FormControl, FormLabel, Radio, RadioGroup } from '@mui/material'; +import * as React from 'react'; +import Table from '../Helper/AddNewTable'; + +interface FormValues { + generalHealth: string; + presentProblemBefore: string; + ifYespresentProblemBefore:string; + ifYestreatmentProvided: string; + ifYesOutcome: string; + strokeBloodclotting: string; + ifYesstrokeBloodclotting: string; + dizzinessFetigue: string; + ifyesdizzinessFetigue: string; + antiColligent: string; + injuriesHospitalization: string; + supplementsOrDrugs: string; +} + +interface Props { + pastTreatement: FormValues +} + + +export default function PastTreatment5({pastTreatement}: Props){ + return( + <> +
+ + + + + Overall your General Healgth is: + + } label="Excellent" /> + } label="Very Good" /> + } label="Good" /> + } label="Fair" /> + } label="Poor" /> + + + + + + + Have you experienced your present problem before? + + } label="Yes" /> + } label="No" /> + + + + + + + + + + + + + + + + + + + Have you ever had a stroke or issues with blood clotting? + + } label="Yes" /> + } label="No" /> + + + + + + + + + + + Have you recently experienced dizziness, unexplained fatigue, weight loss or blood loss? + + } label="Yes" /> + } label="No" /> + + + + + + + + + + + Are you currently taking anti-coagulant or blood thinning medication? + + } label="Yes" /> + } label="No" /> + + + + + + + Have you ever had any major illness, injuries, hospitalization or surgeries? + + } label="Yes" /> + } label="No" /> + + + + + + + + + + Please list current supplements or drugs you may be taking: + + + + + + + ) +} \ No newline at end of file diff --git a/src/Components/PatientDetails/PatientDetails.tsx b/src/Components/PatientDetails/PatientDetails.tsx new file mode 100644 index 0000000..5b1d95c --- /dev/null +++ b/src/Components/PatientDetails/PatientDetails.tsx @@ -0,0 +1,333 @@ +import * as React from 'react'; +import Typography from '@mui/material/Typography'; +import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; +import Footer from "../Footer"; +import Header from "../Header"; +import {Button, Checkbox, FormControlLabel, FormGroup, FormLabel, Grid, Paper, Radio, RadioGroup, TextField } from '@mui/material'; +import PersonalSection from './PersonalSection1'; +import { styled } from '@mui/material/styles'; +import ArrowForwardIosSharpIcon from '@mui/icons-material/ArrowForwardIosSharp'; +import MuiAccordion, { AccordionProps } from '@mui/material/Accordion'; +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 PatientImageMarker from '../ImageMarker/PatientImageMarker'; +import ViewPatientImageMarker from '../ImageMarker/ViewPatientImageMarker'; + +interface Patient { + fullName: string; + homePhone: string; + cellPhone: string; + email: string; + age: number; + dateOfBirth: string; + socialSecurityNumber: string; + mailingAddress: string; + city: string; + state: string; + zipCode: string; + gender: string; + maritalStatus: string; + } + + const personalData : Patient = { + fullName: "Vipeesh", + homePhone: "7259910917", + cellPhone: "7259910917", + email: "vipeesh191@gmail.com", + age: 33, + dateOfBirth: "27-4-1990", + socialSecurityNumber: "", + mailingAddress: "", + city: "Kannur", + state: "Kerala", + zipCode: "670643", + gender: "male", + maritalStatus: "", + } + + const familyData = { + maritalStatus:'', + numberOfChildren:'', + ages:'', + occupation:'', + hoursPerWeek:'', + employer:'', + businessPhone:'', + spouseName:'', + spouseEmployer:'', + spouseBusinessPhone:'', + emergencyContact:'', + relationship:'', + spousePhone:'' +} + +const medicalHstory = { + physicianname: '', + physiciancity: '', + physicianstate: '', + physicianphone: '', + chiropractorName: '', + chiropractorState: '', + xray: false, + ctScan: false, + cdImages: false, + visitDetails: '', + cellPhoneProvider: '', +} + +const painAnalysis = { + chiefComplaint:'', + painQuality:[], + painDuration:'', + currentTreatment:'', + treatmentResults:'', + treatmentGoal:'', +} + +const pastTreatement = { + generalHealth: '', + presentProblemBefore: '', + ifYespresentProblemBefore:'', + ifYestreatmentProvided:'', + ifYesOutcome:'', + strokeBloodclotting: '', + ifYesstrokeBloodclotting: '', + dizzinessFetigue: '', + ifyesdizzinessFetigue:'', + antiColligent: '', + injuriesHospitalization: '', + supplementsOrDrugs:'' + } + + const Accordion = styled((props: AccordionProps) => ( + + ))(({ theme }) => ({ + border: `1px solid ${theme.palette.divider}`, + '&:not(:last-child)': { + borderBottom: 0, + }, + '&:before': { + display: 'none', + }, + })); + + const AccordionSummary = styled((props: AccordionSummaryProps) => ( + } + {...props} + /> + ))(({ theme }) => ({ + backgroundColor: + theme.palette.mode === 'dark' + ? 'rgba(255, 255, 255, .05)' + : 'rgba(0, 0, 0, .03)', + flexDirection: 'row-reverse', + '& .MuiAccordionSummary-expandIconWrapper.Mui-expanded': { + transform: 'rotate(90deg)', + }, + '& .MuiAccordionSummary-content': { + marginLeft: theme.spacing(1), + }, + })); + + const AccordionDetails = styled(MuiAccordionDetails)(({ theme }) => ({ + padding: theme.spacing(2), + borderTop: '1px solid rgba(0, 0, 0, .125)', + })); + +export default function PatientDetails(){ + const [expanded, setExpanded] = React.useState('panel1'); + const [isChecked, setIsChecked] = React.useState(false); + const [signature,setSignature]=React.useState(''); + + const [patient, setPatient] = React.useState({ + fullName: "", + homePhone: "", + cellPhone: "", + email: "", + age: 0, + dateOfBirth: "", + socialSecurityNumber: "", + mailingAddress: "", + city: "", + state: "", + zipCode: "", + gender: "", + maritalStatus: "", + }); + + const handleSubmit = (event: React.FormEvent) => { + event.preventDefault(); + }; + + const handleExpandChange = + (panel: string) => (event: React.SyntheticEvent, newExpanded: boolean) => { + setExpanded(newExpanded ? panel : false); + }; + + const handleCheckboxChange = (event:any) => { + setIsChecked(event.target.checked); + }; + + + return( + <> + +
+ +
+ + Confidential Patient Information + + + + + } + aria-controls="panel1a-content" + id="panel1a-header" + > + Patient's Personal Information + + + + + + + + + + + Patient's Family Information + + + + + + + + + + Patient's Medical History Information + + + + + + + + + + Patient's Injury Image + + + + + + + + + + + Patient's Injury Details + + + + + + + + + + Patient's Past Treatment Details + + + + + + + + + + System Review Questions + + + + + + + + + + Recreational Activities/Hobbies Details + + + + + + + + + + Other Details + + + + + + + + + + + + } + label="I hereby state that all the information I have provided is complete and truthful and that I have fully disclosed my health history." + /> + + + + + { + setSignature(event.target.value) + }} + /> + + + + + + + + +
+
+ + + ) +} \ No newline at end of file diff --git a/src/Components/PatientDetails/PersonalSection1.tsx b/src/Components/PatientDetails/PersonalSection1.tsx new file mode 100644 index 0000000..fb39d9d --- /dev/null +++ b/src/Components/PatientDetails/PersonalSection1.tsx @@ -0,0 +1,170 @@ +import * as React from 'react'; +import { Button, FormControl, FormControlLabel, FormLabel, Grid, Paper, Radio, RadioGroup, TextField } from '@mui/material'; +import { useFormik } from "formik"; +import * as yup from "yup"; +import { LocalizationProvider, DatePicker } from '@mui/x-date-pickers'; +import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; +import PatientDetails from './PatientDetails'; + +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; + maritalStatus: string; +} + +interface Props { + personalData: Patient; +} + +export default function PersonalSection({personalData} : Props){ + return( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gender + + } label="Male" checked={personalData.gender === 'male'} /> + } label="Female" checked={personalData.gender === 'female'} /> + + + + + + ) +} \ No newline at end of file diff --git a/src/Components/PatientDetails/RecreationalHobbiesSection7.tsx b/src/Components/PatientDetails/RecreationalHobbiesSection7.tsx new file mode 100644 index 0000000..b757b11 --- /dev/null +++ b/src/Components/PatientDetails/RecreationalHobbiesSection7.tsx @@ -0,0 +1,243 @@ +import { FormControl, FormControlLabel, FormLabel, Grid, Radio, RadioGroup, TextField } from "@mui/material"; +import React from "react"; + +interface FormValues { + 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 default function RecreationalHobbiesSection7(){ + return( + <> + + + + Recreational Activities/Hobbies:

+ +
+ + + + Your education level: + + } label="High School" /> + } label="Some college" /> + } label="College Graduate" /> + } label="Post college" /> + } label="Other" /> + + + + + + + Do you excercise? + + } label="Yes" /> + } label="No" /> + + + + + + + + + + + Use tobacco? + + } label="Yes" /> + } label="No" /> + + + + + + + + + + + Consume alcohol? + + } label="Yes" /> + } label="No" /> + + + + + + + + + + + Have a healthy diet? + + } label="Yes" /> + } label="No" /> + + + + + + + + + + + Get adequate sleep? + + } label="Yes" /> + } label="No" /> + + + + + + + + + + + Is Work/School stressful to you? + + } label="Yes" /> + } label="No" /> + + + + + + + + + + + Family life stressful to you? + + } label="Yes" /> + } label="No" /> + + + + + + + + + + + Use recreational drugs? + + } label="Yes" /> + } label="No" /> + + + + + + + +
+ + ) +} \ No newline at end of file diff --git a/src/Components/PatientDetails/SyestemReviewSection6.tsx b/src/Components/PatientDetails/SyestemReviewSection6.tsx new file mode 100644 index 0000000..39077d3 --- /dev/null +++ b/src/Components/PatientDetails/SyestemReviewSection6.tsx @@ -0,0 +1,237 @@ +import { FormControl, FormControlLabel, FormLabel, Grid, Radio, RadioGroup, TextField } from "@mui/material"; +import React from "react"; + +interface FormValues { + 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 default function SystemReviewSection6(){ + return( + <> + + Please choose body areas or systems where you may have problems: + + + + + Eyes + + } label="Yes" /> + } label="No" /> + + + + + + Intestines/Bowls + + } label="Yes" /> + } label="No" /> + + + + + + Joints/Bones + + } label="Yes" /> + } label="No" /> + + + + + + Allergies + + } label="Yes" /> + } label="No" /> + + + + + + Ears, Nose, Mouth, Throat + + } label="Yes" /> + } label="No" /> + + + + + + Urinary + + } label="Yes" /> + } label="No" /> + + + + + + Skin + + } label="Yes" /> + } label="No" /> + + + + + + Psychological/Emotional + + } label="Yes" /> + } label="No" /> + + + + + + Heart + + } label="Yes" /> + } label="No" /> + + + + + + Muscles + + } label="Yes" /> + } label="No" /> + + + + + + Internal Organs + + } label="Yes" /> + } label="No" /> + + + + + + Gynecological menstrual/Brest + + } label="Yes" /> + } label="No" /> + + + + + + + Lungs/Breathing + + } label="Yes" /> + } label="No" /> + + + + + + Nerves + + } label="Yes" /> + } label="No" /> + + + + + + Blood + + } label="Yes" /> + } label="No" /> + + + + + + Prostate/Testicular/Penile + + } label="Yes" /> + } label="No" /> + + + + + Please explain your check marks:

+ +
+ +
+ + ) +} \ No newline at end of file -- 2.47.2 From 2fd461222a03048d982470eb117339c050ebbf90 Mon Sep 17 00:00:00 2001 From: vipeeshpavithran Date: Tue, 5 Sep 2023 15:10:29 +0530 Subject: [PATCH 02/14] json download and localstorage --- src/Components/PatientDetails/PatientDetails.tsx | 8 +++++--- src/Components/PatientForm/PatientForm.tsx | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/Components/PatientDetails/PatientDetails.tsx b/src/Components/PatientDetails/PatientDetails.tsx index 5b1d95c..437f195 100644 --- a/src/Components/PatientDetails/PatientDetails.tsx +++ b/src/Components/PatientDetails/PatientDetails.tsx @@ -177,7 +177,9 @@ export default function PatientDetails(){ const handleCheckboxChange = (event:any) => { setIsChecked(event.target.checked); }; - + + //@ts-ignore + const patientData = localStorage.getItem('patientData') ? JSON.parse(localStorage.getItem('patientData')) : []; return( <> @@ -200,7 +202,7 @@ export default function PatientDetails(){ - + @@ -211,7 +213,7 @@ export default function PatientDetails(){ - + diff --git a/src/Components/PatientForm/PatientForm.tsx b/src/Components/PatientForm/PatientForm.tsx index 9648897..90c6192 100644 --- a/src/Components/PatientForm/PatientForm.tsx +++ b/src/Components/PatientForm/PatientForm.tsx @@ -338,9 +338,22 @@ export default function PatientForm(){ // Update the state with the new array setAllPatientData(updatedAllPatientData); + + localStorage.setItem('patientData', JSON.stringify(newPatientData)); console.log("UpdatedallPatientData:", updatedAllPatientData); - }; + TextFile(); + }; + + const TextFile = () => { + const element = document.createElement("a"); + //@ts-ignore + const textFile = new Blob([localStorage.getItem('patientData')], {type: 'text/json'}); + element.href = URL.createObjectURL(textFile); + element.download = "patientData.json"; + document.body.appendChild(element); + element.click(); + } const handleExpandChange = -- 2.47.2 From a72be1748feaad27e26bd9caba2bb6569130c571 Mon Sep 17 00:00:00 2001 From: sonika <> Date: Tue, 5 Sep 2023 18:14:41 +0530 Subject: [PATCH 03/14] data display changes for section1 --- package-lock.json | 10 ++ src/App.tsx | 4 +- src/Components/PatientForm/PatientForm.tsx | 35 ++++--- .../PatientForm/PersonalSection1.tsx | 98 +++++++------------ 4 files changed, 70 insertions(+), 77 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3e3f5c8..7f1ffd9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,6 +37,7 @@ "react-dom": "^18.2.0", "react-gauge-chart": "^0.4.1", "react-icons": "^4.9.0", + "react-image-marker": "^1.2.0", "react-leaflet": "^4.2.1", "react-router-dom": "^6.14.2", "react-scripts": "5.0.1", @@ -15795,6 +15796,15 @@ "react": "*" } }, + "node_modules/react-image-marker": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/react-image-marker/-/react-image-marker-1.2.0.tgz", + "integrity": "sha512-HFrzKVnX/hgZqHlxwV7XQNiyMRowD1IAnbsf4dZCEuSzGlGHxAv+sCv/AU1VHHVxFxoHubNL/xYNpGQfgtX67A==", + "peerDependencies": { + "react": ">= 16.8.0", + "react-dom": ">= 16.8.0" + } + }, "node_modules/react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", diff --git a/src/App.tsx b/src/App.tsx index 6bc59a8..8739db9 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -12,8 +12,8 @@ function App() {
- } /> - }/> + } /> + }/>
diff --git a/src/Components/PatientForm/PatientForm.tsx b/src/Components/PatientForm/PatientForm.tsx index 90c6192..b090e45 100644 --- a/src/Components/PatientForm/PatientForm.tsx +++ b/src/Components/PatientForm/PatientForm.tsx @@ -57,9 +57,11 @@ import PatientImageMarker from '../ImageMarker/PatientImageMarker'; borderTop: '1px solid rgba(0, 0, 0, .125)', })); +type Props={ + type:any; +} - -export default function PatientForm(){ +export default function PatientForm({type}:Props){ const [expanded, setExpanded] = React.useState('panel1'); const [isChecked, setIsChecked] = React.useState(false); const [signature,setSignature]=React.useState(''); @@ -71,7 +73,6 @@ export default function PatientForm(){ const [section6Data, setSection6Data] = React.useState({}); const [section7Data, setSection7Data] = React.useState({}); const [section8Data, setSection8Data] = React.useState({}); - const [restructuredCurrentPatientData, setRestructuredCurrentPatientData] = React.useState({}); const [allPatientData, setAllPatientData] = React.useState([]); const handleFormSection1Data = ( @@ -323,14 +324,14 @@ export default function PatientForm(){ const handleSubmit = () => { const newPatientData = { - section1: section1Data, - section2: section2Data, - section3: section3Data, - section4: section4Data, - section5: section5Data, - section6: section6Data, - section7: section7Data, - section8: section8Data, + personalInformation: section1Data, + familyInformation: section2Data, + medicalHistory: section3Data, + injuryDetails: section4Data, + pastTreatment: section5Data, + systemReviewQuestions: section6Data, + recreationalActivities: section7Data, + otherDetails: section8Data, }; // Create a copy of the existing data array and push the new patient data @@ -340,8 +341,6 @@ export default function PatientForm(){ setAllPatientData(updatedAllPatientData); localStorage.setItem('patientData', JSON.stringify(newPatientData)); - - console.log("UpdatedallPatientData:", updatedAllPatientData); TextFile(); }; @@ -365,7 +364,8 @@ export default function PatientForm(){ setIsChecked(event.target.checked); }; - + //@ts-ignore + const patientData = localStorage.getItem('patientData') ? JSON.parse(localStorage.getItem('patientData')) : []; return( <> @@ -388,7 +388,12 @@ export default function PatientForm(){ - + diff --git a/src/Components/PatientForm/PersonalSection1.tsx b/src/Components/PatientForm/PersonalSection1.tsx index 6ba3eb9..abea995 100644 --- a/src/Components/PatientForm/PersonalSection1.tsx +++ b/src/Components/PatientForm/PersonalSection1.tsx @@ -1,7 +1,5 @@ import * as React from 'react'; import { Button, FormControl, FormControlLabel, FormLabel, Grid, Paper, Radio, RadioGroup, TextField } from '@mui/material'; -import { useFormik } from "formik"; -import * as yup from "yup"; import { LocalizationProvider, DatePicker } from '@mui/x-date-pickers'; import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; import { useEffect } from 'react'; @@ -21,20 +19,6 @@ interface Patient { gender: string; } - const validationSchema = yup.object({ - fullName: yup.string().required("Full name is required"), - homePhone: yup.string().matches(/^\d{10}$/, "Home phone must be 10 digits"), - cellPhone: yup.string().required("Phone number is required").matches(/^\d{10}$/, "Cell phone must be 10 digits"), - email: yup.string().required("Email is required"), - age: yup.number().positive().integer("Age must be a positive integer").required("Age is required"), - dateOfBirth: yup.date().required("Date of birth is required"), - socialSecurityNumber: yup.string(), - mailingAddress: yup.string().required("Mailing address is required"), - city: yup.string().required("City is required"), - state: yup.string().required("State is required"), - zipCode: yup.string().matches(/^\d{6}$/, "Zip code must be 6 digits").required("Zip code is required") - }); - type Props = { handleFormSection1Data:( fullName?: string|undefined, @@ -50,19 +34,21 @@ interface Patient { zipCode?: string|undefined, gender?: string|undefined, )=> void + patientDataDiplay:any; + type:string; } -export default function PersonalSection({handleFormSection1Data}:Props){ +export default function PersonalSection({handleFormSection1Data,patientDataDiplay,type}:Props){ - const [startDateValue, setStartDateValue] = React.useState(); + const [birthDateValue, setBirthDateValue] = React.useState(); const [patient, setPatient] = React.useState({ fullName: "", homePhone: "", cellPhone: "", email: "", age: 0, - dateOfBirth: startDateValue, + dateOfBirth: birthDateValue, socialSecurityNumber: "", mailingAddress:"", city: "", @@ -79,7 +65,7 @@ export default function PersonalSection({handleFormSection1Data}:Props){ patient.cellPhone, patient.email, patient.age, - startDateValue, + birthDateValue, patient.socialSecurityNumber, patient.mailingAddress, patient.city, @@ -87,29 +73,9 @@ export default function PersonalSection({handleFormSection1Data}:Props){ patient.zipCode, patient.gender, ) - },[patient]) + },[patient]) - // const formik = useFormik({ - // initialValues: { - // fullName: "", - // homePhone: "", - // cellPhone: "", - // email: "", - // age: "", - // dateOfBirth: "", - // socialSecurityNumber: "", - // mailingAddress: "", - // city: "", - // state: "", - // zipCode: "", - // gender: "male", - // }, - // validationSchema, - // onSubmit: (values) => { - // // Do something with the patient data - // console.log(values,"sdfdsfsd34"); - // }, - // }); + console.log(type,"sfsdfsdfsd") return( <> @@ -120,16 +86,14 @@ export default function PersonalSection({handleFormSection1Data}:Props){ label="Patient's Full Name" name="fullName" placeholder='Please enter your name' - value={patient.fullName} + value={type=='display'?patientDataDiplay.fullName:patient.fullName} + disabled={type=='display'} onChange={(e)=>{ setPatient((prevValues) => ({ ...prevValues, fullName: e.target.value, })); }} - // onBlur={formik.handleBlur} - // error={formik.touched.fullName && Boolean(formik.errors.fullName)} - // helperText={formik.touched.fullName && formik.errors.fullName} required /> @@ -141,7 +105,8 @@ export default function PersonalSection({handleFormSection1Data}:Props){ label="Phone Number" name="cellPhone" placeholder='Please enter your cell Phone number' - value={patient.cellPhone} + value={type=='display'?patientDataDiplay.cellPhone:patient.cellPhone} + disabled={type=='display'} onChange={(e)=>{ setPatient((prevValues) => ({ ...prevValues, @@ -160,7 +125,8 @@ export default function PersonalSection({handleFormSection1Data}:Props){ label="Home Phone Number" name="homePhone" placeholder='Please enter your home phone' - value={patient.homePhone} + value={type=='display'?patientDataDiplay.homePhone:patient.homePhone} + disabled={type=='display'} onChange={(e)=>{ setPatient((prevValues) => ({ ...prevValues, @@ -179,7 +145,8 @@ export default function PersonalSection({handleFormSection1Data}:Props){ label="Email" name="email" placeholder='Please enter your email' - value={patient.email} + value={type=='display'?patientDataDiplay.email:patient.email} + disabled={type=='display'} onChange={(e)=>{ setPatient((prevValues) => ({ ...prevValues, @@ -199,7 +166,8 @@ export default function PersonalSection({handleFormSection1Data}:Props){ name="age" type="number" placeholder='Please enter your age' - value={patient.age} + value={type=='display'?patientDataDiplay.age:patient.age} + disabled={type=='display'} onChange={(e)=>{ setPatient((prevValues) => ({ ...prevValues, @@ -217,9 +185,10 @@ export default function PersonalSection({handleFormSection1Data}:Props){ { - setStartDateValue(newValue); + setBirthDateValue(newValue); }} renderInput={(params) => } /> @@ -232,7 +201,8 @@ export default function PersonalSection({handleFormSection1Data}:Props){ variant="outlined" label="Social Security Number" name="socialSecurityNumber" - value={patient.socialSecurityNumber} + value={type=='display'?patientDataDiplay.socialSecurityNumber:patient.socialSecurityNumber} + disabled={type=='display'} onChange={(e)=>{ setPatient((prevValues) => ({ ...prevValues, @@ -251,7 +221,8 @@ export default function PersonalSection({handleFormSection1Data}:Props){ variant="outlined" label="Mailing Address" name="mailingAddress" - value={patient.mailingAddress} + value={type=='display'?patientDataDiplay.mailingAddress:patient.mailingAddress} + disabled={type=='display'} onChange={(e)=>{ setPatient((prevValues) => ({ ...prevValues, @@ -269,7 +240,8 @@ export default function PersonalSection({handleFormSection1Data}:Props){ variant="outlined" label="State" name="state" - value={patient.state} + value={type=='display'?patientDataDiplay.state:patient.state} + disabled={type=='display'} onChange={(e)=>{ setPatient((prevValues) => ({ ...prevValues, @@ -288,7 +260,8 @@ export default function PersonalSection({handleFormSection1Data}:Props){ variant="outlined" label="City" name="city" - value={patient.city} + value={type=='display'?patientDataDiplay.city:patient.city} + disabled={type=='display'} onChange={(e)=>{ setPatient((prevValues) => ({ ...prevValues, @@ -306,7 +279,8 @@ export default function PersonalSection({handleFormSection1Data}:Props){ variant="outlined" label="Zip Code" name="zipCode" - value={patient.zipCode} + value={type=='display'?patientDataDiplay.zipCode:patient.zipCode} + disabled={type=='display'} onChange={(e)=>{ setPatient((prevValues) => ({ ...prevValues, @@ -324,7 +298,7 @@ export default function PersonalSection({handleFormSection1Data}:Props){ Gender { setPatient((prevValues) => ({ @@ -334,8 +308,12 @@ export default function PersonalSection({handleFormSection1Data}:Props){ }} sx={{display:'flex', flexDirection:'row'}} > - } label="Male" /> - } label="Female" /> + } label="Male" /> + } label="Female" /> -- 2.47.2 From c410fbbd953307e9a9f3f20d48bf14f392a589ca Mon Sep 17 00:00:00 2001 From: sonika <> Date: Tue, 5 Sep 2023 18:24:52 +0530 Subject: [PATCH 04/14] section 2 display changes --- .../PatientForm/FamilyFormSection2.tsx | 84 ++++++++----------- src/Components/PatientForm/PatientForm.tsx | 6 +- .../PatientForm/PersonalSection1.tsx | 2 +- 3 files changed, 39 insertions(+), 53 deletions(-) diff --git a/src/Components/PatientForm/FamilyFormSection2.tsx b/src/Components/PatientForm/FamilyFormSection2.tsx index 4af0152..4216d62 100644 --- a/src/Components/PatientForm/FamilyFormSection2.tsx +++ b/src/Components/PatientForm/FamilyFormSection2.tsx @@ -19,21 +19,6 @@ interface Patient { spousePhone: string | undefined, } -const validationSchema = yup.object({ - maritalStatus:yup.string().required("Marital Status is required"), - numberOfChildren:yup.string().required("Full name is required"), - occupation:yup.string().required("Occupation is required"), -// hoursPerWeek: yup.number().required('Required'), -// employer:yup.string().required("Full name is required"), -// businessPhone:yup.string().required("Full name is required"), - spouseName:yup.string().required("Spouse name is required"), -// spouseEmployer:yup.string().required("Full name is required"), -// 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"), - spousePhone:yup.string().matches(/^\d{10}$/, "Cell phone must be 10 digits"), -}); - type Props = { handleFormSection2Data:( maritalStatus: string | undefined, @@ -49,10 +34,12 @@ type Props = { relationship: string | undefined, spousePhone: string | undefined, )=> void + patientDataDiplay:any; + type:string; } -export default function FamilyFormSection({handleFormSection2Data}:Props){ +export default function FamilyFormSection({handleFormSection2Data,patientDataDiplay,type}:Props){ const [patient, setPatient] = React.useState({ maritalStatus:'', numberOfChildren:'', @@ -85,6 +72,8 @@ export default function FamilyFormSection({handleFormSection2Data}:Props){ ) },[patient]) + console.log(type,"sfsdfsdfsd") + return( <> @@ -93,9 +82,8 @@ export default function FamilyFormSection({handleFormSection2Data}:Props){ Marital Status { setPatient((prevValues:any) => ({ @@ -103,14 +91,12 @@ export default function FamilyFormSection({handleFormSection2Data}:Props){ maritalStatus: e.target.value, })); }} - // error={formik.touched.numberOfChildren && Boolean(formik.errors.maritalStatus)} - // helperText={formik.touched.numberOfChildren && formik.errors.maritalStatus} > - } label="Married" /> - } label="Single" /> - } label="Widowed" /> - } label="Seperated" /> - } label="Divorced" /> + } label="Married" disabled={type=='display'}/> + } label="Single" disabled={type=='display'}/> + } label="Widowed" disabled={type=='display'}/> + } label="Seperated" disabled={type=='display'}/> + } label="Divorced" disabled={type=='display'}/> @@ -131,10 +117,8 @@ export default function FamilyFormSection({handleFormSection2Data}:Props){ numberOfChildren: e.target.value, })); }} - value={patient.numberOfChildren} - // onBlur={formik.handleBlur} - // error={formik.touched.numberOfChildren && Boolean(formik.errors.numberOfChildren)} - // helperText={formik.touched.numberOfChildren && formik.errors.numberOfChildren} + value={type=='display'?patientDataDiplay.numberOfChildren:patient.numberOfChildren} + disabled={type=='display'} /> @@ -150,10 +134,8 @@ export default function FamilyFormSection({handleFormSection2Data}:Props){ occupation: e.target.value, })); }} - value={patient.occupation} - // onBlur={formik.handleBlur} - // error={formik.touched.occupation && Boolean(formik.errors.occupation)} - // helperText={formik.touched.occupation && formik.errors.occupation} + value={type=='display'?patientDataDiplay.occupation:patient.occupation} + disabled={type=='display'} /> @@ -170,8 +152,8 @@ export default function FamilyFormSection({handleFormSection2Data}:Props){ hoursPerWeek: e.target.value, })); }} - value={patient.hoursPerWeek} - // onBlur={formik.handleBlur} + value={type=='display'?patientDataDiplay.hoursPerWeek:patient.hoursPerWeek} + disabled={type=='display'} /> @@ -187,8 +169,8 @@ export default function FamilyFormSection({handleFormSection2Data}:Props){ employer: e.target.value, })); }} - value={patient.employer} - // onBlur={formik.handleBlur} + value={type=='display'?patientDataDiplay.employer:patient.employer} + disabled={type=='display'} /> @@ -204,8 +186,8 @@ export default function FamilyFormSection({handleFormSection2Data}:Props){ businessPhone: e.target.value, })); }} - value={patient.businessPhone} - // onBlur={formik.handleBlur} + value={type=='display'?patientDataDiplay.businessPhone:patient.businessPhone} + disabled={type=='display'} /> @@ -227,8 +209,8 @@ export default function FamilyFormSection({handleFormSection2Data}:Props){ spouseName: e.target.value, })); }} - value={patient.spouseName} - // onBlur={formik.handleBlur} + value={type=='display'?patientDataDiplay.spouseName:patient.spouseName} + disabled={type=='display'} /> @@ -243,8 +225,8 @@ export default function FamilyFormSection({handleFormSection2Data}:Props){ spouseEmployer: e.target.value, })); }} - value={patient.spouseEmployer} - // onBlur={formik.handleBlur} + value={type=='display'?patientDataDiplay.spouseEmployer:patient.spouseEmployer} + disabled={type=='display'} /> @@ -260,8 +242,8 @@ export default function FamilyFormSection({handleFormSection2Data}:Props){ spouseBusinessPhone: e.target.value, })); }} - value={patient.spouseBusinessPhone} - // onBlur={formik.handleBlur} + value={type=='display'?patientDataDiplay.spouseBusinessPhone:patient.spouseBusinessPhone} + disabled={type=='display'} /> @@ -282,8 +264,8 @@ export default function FamilyFormSection({handleFormSection2Data}:Props){ emergencyContact: e.target.value, })); }} - value={patient.emergencyContact} - // onBlur={formik.handleBlur} + value={type=='display'?patientDataDiplay.emergencyContact:patient.emergencyContact} + disabled={type=='display'} /> @@ -298,8 +280,8 @@ export default function FamilyFormSection({handleFormSection2Data}:Props){ relationship: e.target.value, })); }} - value={patient.relationship} - // onBlur={formik.handleBlur} + value={type=='display'?patientDataDiplay.relationship:patient.relationship} + disabled={type=='display'} /> @@ -315,8 +297,8 @@ export default function FamilyFormSection({handleFormSection2Data}:Props){ spousePhone: e.target.value, })); }} - value={patient.spousePhone} - // onBlur={formik.handleBlur} + value={type=='display'?patientDataDiplay.spousePhone:patient.spousePhone} + disabled={type=='display'} /> diff --git a/src/Components/PatientForm/PatientForm.tsx b/src/Components/PatientForm/PatientForm.tsx index b090e45..329811a 100644 --- a/src/Components/PatientForm/PatientForm.tsx +++ b/src/Components/PatientForm/PatientForm.tsx @@ -404,7 +404,11 @@ export default function PatientForm({type}:Props){ - + diff --git a/src/Components/PatientForm/PersonalSection1.tsx b/src/Components/PatientForm/PersonalSection1.tsx index abea995..624622a 100644 --- a/src/Components/PatientForm/PersonalSection1.tsx +++ b/src/Components/PatientForm/PersonalSection1.tsx @@ -75,7 +75,7 @@ export default function PersonalSection({handleFormSection1Data,patientDataDipla ) },[patient]) - console.log(type,"sfsdfsdfsd") + return( <> -- 2.47.2 From 160f98edfb9312b2a6fdc84ae1e892b1e2ad7869 Mon Sep 17 00:00:00 2001 From: sonika <> Date: Tue, 5 Sep 2023 18:38:53 +0530 Subject: [PATCH 05/14] section 3 display --- .../PatientForm/FamilyFormSection2.tsx | 2 - .../PatientForm/MedicalHistorySection3.tsx | 76 ++++++++----------- src/Components/PatientForm/PatientForm.tsx | 5 +- 3 files changed, 37 insertions(+), 46 deletions(-) diff --git a/src/Components/PatientForm/FamilyFormSection2.tsx b/src/Components/PatientForm/FamilyFormSection2.tsx index 4216d62..f1ad09c 100644 --- a/src/Components/PatientForm/FamilyFormSection2.tsx +++ b/src/Components/PatientForm/FamilyFormSection2.tsx @@ -72,8 +72,6 @@ export default function FamilyFormSection({handleFormSection2Data,patientDataDip ) },[patient]) - console.log(type,"sfsdfsdfsd") - return( <> diff --git a/src/Components/PatientForm/MedicalHistorySection3.tsx b/src/Components/PatientForm/MedicalHistorySection3.tsx index c6897bb..3f7211d 100644 --- a/src/Components/PatientForm/MedicalHistorySection3.tsx +++ b/src/Components/PatientForm/MedicalHistorySection3.tsx @@ -18,19 +18,6 @@ interface Patient { cellPhoneProvider: string |undefined; } -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'), - haveChiropractor: Yup.boolean().required('Required'), - reference: Yup.boolean().required('Required'), - visitDetails: Yup.string().required('Required'), - cellPhoneProvider: Yup.string().required('Required'), -}); - type Props = { handleFormSection3Data:( physicianname?: string |undefined, @@ -45,9 +32,11 @@ type Props = { visitDetails?: string |undefined, cellPhoneProvider?: string |undefined, )=> void + patientDataDiplay:any; + type:string; } -export default function MedicalHistoryForm({handleFormSection3Data}:Props){ +export default function MedicalHistoryForm({handleFormSection3Data,patientDataDiplay,type}:Props){ const [patient, setPatient] = React.useState({ physicianname: '', @@ -78,6 +67,8 @@ export default function MedicalHistoryForm({handleFormSection3Data}:Props){ patient.cellPhoneProvider, ) },[patient]) + + console.log("patientDataDiplay",patientDataDiplay) return( <> @@ -96,8 +87,8 @@ export default function MedicalHistoryForm({handleFormSection3Data}:Props){ physicianname: e.target.value, })); }} - value={patient.physicianname} - // onBlur={formik.handleBlur} + value={type=='display'?patientDataDiplay.physicianname:patient.physicianname} + disabled={type=='display'} /> @@ -111,8 +102,8 @@ export default function MedicalHistoryForm({handleFormSection3Data}:Props){ physiciancity: e.target.value, })); }} - value={patient.physiciancity} - // onBlur={formik.handleBlur} + value={type=='display'?patientDataDiplay.physiciancity:patient.physiciancity} + disabled={type=='display'} /> @@ -126,8 +117,8 @@ export default function MedicalHistoryForm({handleFormSection3Data}:Props){ physicianstate: e.target.value, })); }} - value={patient.physicianstate} - // onBlur={formik.handleBlur} + value={type=='display'?patientDataDiplay.physicianstate:patient.physicianstate} + disabled={type=='display'} /> @@ -142,8 +133,8 @@ export default function MedicalHistoryForm({handleFormSection3Data}:Props){ physicianphone: e.target.value, })); }} - value={patient.physicianphone} - // onBlur={formik.handleBlur} + value={type=='display'?patientDataDiplay.physicianphone:patient.physicianphone} + disabled={type=='display'} /> @@ -158,9 +149,8 @@ export default function MedicalHistoryForm({handleFormSection3Data}:Props){ Previous Chiropractic Care: { setPatient((prevValues) => ({ @@ -170,8 +160,8 @@ export default function MedicalHistoryForm({handleFormSection3Data}:Props){ }} sx={{display:'flex', flexDirection:'row'}} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -187,8 +177,8 @@ export default function MedicalHistoryForm({handleFormSection3Data}:Props){ chiropractorName: e.target.value, })); }} - value={patient.chiropractorName} - // onBlur={formik.handleBlur} + value={type=='display'?patientDataDiplay.chiropractorName:patient.chiropractorName} + disabled={type=='display'} /> @@ -203,8 +193,8 @@ export default function MedicalHistoryForm({handleFormSection3Data}:Props){ chiropractorState: e.target.value, })); }} - value={patient.chiropractorState} - // onBlur={formik.handleBlur} + value={type=='display'?patientDataDiplay.chiropractorState:patient.chiropractorState} + disabled={type=='display'} /> @@ -215,7 +205,7 @@ export default function MedicalHistoryForm({handleFormSection3Data}:Props){ { setPatient((prevValues) => ({ @@ -225,8 +215,8 @@ export default function MedicalHistoryForm({handleFormSection3Data}:Props){ }} sx={{display:'flex', flexDirection:'row'}} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -237,7 +227,7 @@ export default function MedicalHistoryForm({handleFormSection3Data}:Props){ { setPatient((prevValues) => ({ @@ -247,12 +237,12 @@ export default function MedicalHistoryForm({handleFormSection3Data}:Props){ }} sx={{display:'flex', flexDirection:'row'}} > - } label="Friend" /> - } label="Relative" /> - } label="Physician" /> - } label="Instagram" /> - } label="Google" /> - } label="Others" /> + } label="Friend" /> + } label="Relative" /> + } label="Physician" /> + } label="Instagram" /> + } label="Google" /> + } label="Others" /> @@ -263,7 +253,7 @@ export default function MedicalHistoryForm({handleFormSection3Data}:Props){ { setPatient((prevValues) => ({ @@ -273,8 +263,8 @@ export default function MedicalHistoryForm({handleFormSection3Data}:Props){ }} sx={{display:'flex', flexDirection:'row'}} > - } label="Email" /> - } label="Text" /> + } label="Email" /> + } label="Text" /> diff --git a/src/Components/PatientForm/PatientForm.tsx b/src/Components/PatientForm/PatientForm.tsx index 329811a..20abffc 100644 --- a/src/Components/PatientForm/PatientForm.tsx +++ b/src/Components/PatientForm/PatientForm.tsx @@ -418,7 +418,10 @@ export default function PatientForm({type}:Props){ - + -- 2.47.2 From 25befed37c5164e79b362f1cef5c118b70107cb4 Mon Sep 17 00:00:00 2001 From: sonika <> Date: Tue, 5 Sep 2023 18:46:41 +0530 Subject: [PATCH 06/14] section 4 display --- .../PatientForm/PainAnalysisSection4.tsx | 50 +++++++++++++++---- src/Components/PatientForm/PatientForm.tsx | 9 +++- 2 files changed, 46 insertions(+), 13 deletions(-) diff --git a/src/Components/PatientForm/PainAnalysisSection4.tsx b/src/Components/PatientForm/PainAnalysisSection4.tsx index 395006e..9c909a9 100644 --- a/src/Components/PatientForm/PainAnalysisSection4.tsx +++ b/src/Components/PatientForm/PainAnalysisSection4.tsx @@ -31,10 +31,12 @@ interface Patient { treatmentGoal: string|undefined, selfTreatment:string|undefined, )=> void + patientDataDiplay:any; + type:string; } -export default function PainAnalysisSection4({handleFormSection4Data}:Props){ +export default function PainAnalysisSection4({handleFormSection4Data,patientDataDiplay,type}:Props){ const [patient, setPatient] = React.useState({ chiefComplaint:'', painWorse:[], @@ -130,7 +132,8 @@ export default function PainAnalysisSection4({handleFormSection4Data}:Props){ chiefComplaint: e.target.value, })); }} - value={patient.chiefComplaint} + value={type=='display'?patientDataDiplay.chiefComplaint:patient.chiefComplaint} + disabled={type=='display'} /> @@ -141,22 +144,27 @@ export default function PainAnalysisSection4({handleFormSection4Data}:Props){ } label="Bending" + disabled={type=='display'} /> } label="Standing" + disabled={type=='display'} /> } label="Sitting" + disabled={type=='display'} /> } label="Walking" + disabled={type=='display'} /> } label="Others" + disabled={type=='display'} /> @@ -170,22 +178,27 @@ export default function PainAnalysisSection4({handleFormSection4Data}:Props){ } label="laying down" + disabled={type=='display'} /> } label="Standing" + disabled={type=='display'} /> } label="Sitting" + disabled={type=='display'} /> } label="Walking" + disabled={type=='display'} /> } label="Others" + disabled={type=='display'} /> @@ -198,22 +211,27 @@ export default function PainAnalysisSection4({handleFormSection4Data}:Props){ } label="Sharp" + disabled={type=='display'} /> } label="Dull/Ache" + disabled={type=='display'} /> } label="Throbbing" + disabled={type=='display'} /> } label="Tingling/Numbness/Burning" + disabled={type=='display'} /> } label="Others" + disabled={type=='display'} /> @@ -226,22 +244,27 @@ export default function PainAnalysisSection4({handleFormSection4Data}:Props){ } label="Morning" + disabled={type=='display'} /> } label="During day" + disabled={type=='display'} /> } label="Evening" + disabled={type=='display'} /> } label="Lying in bed" + disabled={type=='display'} /> } label="Others" + disabled={type=='display'} /> @@ -258,13 +281,13 @@ export default function PainAnalysisSection4({handleFormSection4Data}:Props){ painDuration: e.target.value, })); }} - value={patient.painDuration} + value={type=='display'?patientDataDiplay.painDuration:patient.painDuration} sx={{display:'flex', flexDirection:'row'}} > - } label="0-25%" /> - } label="25-50%" /> - } label="50-75%" /> - } label="75-100%" /> + } label="0-25%" /> + } label="25-50%" /> + } label="50-75%" /> + } label="75-100%" /> @@ -276,18 +299,22 @@ export default function PainAnalysisSection4({handleFormSection4Data}:Props){ } label="Muscle weakness" + disabled={type=='display'} /> } label="Bowel/Bladder problem" + disabled={type=='display'} /> } label="Digestion" + disabled={type=='display'} /> } label="Cardiac/Respiratory" + disabled={type=='display'} /> @@ -305,11 +332,11 @@ export default function PainAnalysisSection4({handleFormSection4Data}:Props){ selfTreatment: e.target.value, })); }} - value={patient.selfTreatment} + value={type=='display'?patientDataDiplay.selfTreatment:patient.selfTreatment} sx={{display:'flex', flexDirection:'row'}} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -329,7 +356,8 @@ export default function PainAnalysisSection4({handleFormSection4Data}:Props){ treatmentGoal: e.target.value, })); }} - value={patient.treatmentGoal} + value={type=='display'?patientDataDiplay.treatmentGoal:patient.treatmentGoal} + disabled={type=='display'} /> diff --git a/src/Components/PatientForm/PatientForm.tsx b/src/Components/PatientForm/PatientForm.tsx index 20abffc..36f2133 100644 --- a/src/Components/PatientForm/PatientForm.tsx +++ b/src/Components/PatientForm/PatientForm.tsx @@ -419,9 +419,10 @@ export default function PatientForm({type}:Props){ + /> @@ -442,7 +443,11 @@ export default function PatientForm({type}:Props){ - + -- 2.47.2 From 44cb8ce9ff47ff48eaf2fcb26d9363a62fe6b241 Mon Sep 17 00:00:00 2001 From: sonika <> Date: Tue, 5 Sep 2023 18:59:21 +0530 Subject: [PATCH 07/14] section 5 display --- src/Components/PatientForm/PastTreatment5.tsx | 55 ++++++++++++------- src/Components/PatientForm/PatientForm.tsx | 5 +- 2 files changed, 39 insertions(+), 21 deletions(-) diff --git a/src/Components/PatientForm/PastTreatment5.tsx b/src/Components/PatientForm/PastTreatment5.tsx index b8388c1..539c3d9 100644 --- a/src/Components/PatientForm/PastTreatment5.tsx +++ b/src/Components/PatientForm/PastTreatment5.tsx @@ -33,10 +33,12 @@ type Props = { injuriesHospitalization: string|undefined, supplementsOrDrugs: string|undefined, )=> void + patientDataDiplay:any; + type:string; } -export default function PastTreatment5({handleFormSection5Data}:Props){ +export default function PastTreatment5({handleFormSection5Data,patientDataDiplay,type}:Props){ const [patient, setPatient] = React.useState({ generalHealth: '', @@ -80,6 +82,7 @@ export default function PastTreatment5({handleFormSection5Data}:Props){ Overall your General Healgth is: { setPatient((prevValues) => ({ @@ -88,11 +91,11 @@ export default function PastTreatment5({handleFormSection5Data}:Props){ })); }} > - } label="Excellent" /> - } label="Very Good" /> - } label="Good" /> - } label="Fair" /> - } label="Poor" /> + } label="Excellent" /> + } label="Very Good" /> + } label="Good" /> + } label="Fair" /> + } label="Poor" /> @@ -102,6 +105,7 @@ export default function PastTreatment5({handleFormSection5Data}:Props){ Have you experienced your present problem before? { setPatient((prevValues) => ({ @@ -110,8 +114,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -122,7 +126,7 @@ export default function PastTreatment5({handleFormSection5Data}:Props){ variant="outlined" label="If yes, when?" name='treatmentGoal' - disabled={patient.presentProblemBefore!=='Yes'} + disabled={patient.presentProblemBefore!=='Yes'||type=='display'} onChange={(event) => { setPatient((prevValues) => ({ ...prevValues, @@ -136,7 +140,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){ variant="outlined" label="Was treatment provided?If yes, by whom?" name='treatmentGoal' - disabled={patient.presentProblemBefore!=='Yes'} + disabled={patient.presentProblemBefore!=='Yes'||type=='display'} + value={type=='display'?patientDataDiplay.ifYestreatmentProvided:patient.ifYestreatmentProvided} onChange={(event) => { setPatient((prevValues) => ({ ...prevValues, @@ -150,7 +155,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){ variant="outlined" label="Outcome?" name='treatmentGoal' - disabled={patient.presentProblemBefore!=='Yes'} + disabled={patient.presentProblemBefore!=='Yes'||type=='display'} + value={type=='display'?patientDataDiplay.ifYesOutcome:patient.ifYesOutcome} onChange={(event) => { setPatient((prevValues) => ({ ...prevValues, @@ -166,6 +172,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){ Have you ever had a stroke or issues with blood clotting? { setPatient((prevValues) => ({ @@ -174,8 +182,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -185,7 +193,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){ variant="outlined" label="If yes, when?" name='treatmentGoal' - disabled={patient.strokeBloodclotting!=='Yes'} + value={type=='display'?patientDataDiplay.ifYesstrokeBloodclotting:patient.ifYesstrokeBloodclotting} + disabled={patient.strokeBloodclotting!=='Yes'||type=='display'} onChange={(event) => { setPatient((prevValues) => ({ ...prevValues, @@ -201,6 +210,7 @@ export default function PastTreatment5({handleFormSection5Data}:Props){ { setPatient((prevValues) => ({ ...prevValues, @@ -208,8 +218,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -220,6 +230,7 @@ export default function PastTreatment5({handleFormSection5Data}:Props){ label="If yes, when?" name='treatmentGoal' disabled={patient.dizzinessFetigue!=='Yes'} + value={type=='display'?patientDataDiplay.ifyesdizzinessFetigue:patient.ifyesdizzinessFetigue} onChange={(event) => { setPatient((prevValues) => ({ ...prevValues, @@ -235,6 +246,7 @@ export default function PastTreatment5({handleFormSection5Data}:Props){ { setPatient((prevValues) => ({ ...prevValues, @@ -242,8 +254,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -253,6 +265,7 @@ export default function PastTreatment5({handleFormSection5Data}:Props){ Have you ever had any major illness, injuries, hospitalization or surgeries? { setPatient((prevValues) => ({ @@ -261,8 +274,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -278,6 +291,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){ variant="outlined" label="" name='treatmentGoal' + defaultValue={type=='display'?patientDataDiplay.supplementsOrDrugs:patient.supplementsOrDrugs} + disabled={type=='display'} onChange={(event) => { setPatient((prevValues) => ({ ...prevValues, diff --git a/src/Components/PatientForm/PatientForm.tsx b/src/Components/PatientForm/PatientForm.tsx index 36f2133..39ff87b 100644 --- a/src/Components/PatientForm/PatientForm.tsx +++ b/src/Components/PatientForm/PatientForm.tsx @@ -457,7 +457,10 @@ export default function PatientForm({type}:Props){ - + -- 2.47.2 From 3fc6f628bb571756dfb5d0e407df81778cf0ffbb Mon Sep 17 00:00:00 2001 From: sonika <> Date: Tue, 5 Sep 2023 19:08:53 +0530 Subject: [PATCH 08/14] section 6 display --- src/Components/PatientForm/PatientForm.tsx | 10 ++- .../PatientForm/SyestemReviewSection6.tsx | 87 +++++++++++-------- 2 files changed, 60 insertions(+), 37 deletions(-) diff --git a/src/Components/PatientForm/PatientForm.tsx b/src/Components/PatientForm/PatientForm.tsx index 39ff87b..bc7e620 100644 --- a/src/Components/PatientForm/PatientForm.tsx +++ b/src/Components/PatientForm/PatientForm.tsx @@ -458,9 +458,9 @@ export default function PatientForm({type}:Props){ + type={type}/> @@ -470,7 +470,11 @@ export default function PatientForm({type}:Props){ - + diff --git a/src/Components/PatientForm/SyestemReviewSection6.tsx b/src/Components/PatientForm/SyestemReviewSection6.tsx index ca187e8..aa46419 100644 --- a/src/Components/PatientForm/SyestemReviewSection6.tsx +++ b/src/Components/PatientForm/SyestemReviewSection6.tsx @@ -41,9 +41,11 @@ interface Patient { prostate: string|undefined, explanation:string|undefined, )=> void + patientDataDiplay:any; + type:string; } -export default function SystemReviewSection6({handleFormSection6Data}:Props){ +export default function SystemReviewSection6({handleFormSection6Data,patientDataDiplay,type}:Props){ const [patient, setPatients] = React.useState({ eyes: '', IntestinesBowls: '', @@ -96,6 +98,7 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ Eyes { setPatients((prevValues) => ({ @@ -104,8 +107,8 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -114,6 +117,7 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ Intestines/Bowls { setPatients((prevValues) => ({ @@ -122,8 +126,8 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -132,6 +136,7 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ Joints/Bones { setPatients((prevValues) => ({ @@ -140,8 +145,8 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -150,6 +155,7 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ Allergies { setPatients((prevValues) => ({ @@ -158,8 +164,8 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -168,6 +174,7 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ Ears, Nose, Mouth, Throat { setPatients((prevValues) => ({ @@ -176,8 +183,8 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -186,6 +193,7 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ Urinary { setPatients((prevValues) => ({ @@ -194,8 +202,8 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -204,6 +212,7 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ Skin { setPatients((prevValues) => ({ @@ -212,8 +221,8 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -222,6 +231,7 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ Psychological/Emotional { setPatients((prevValues) => ({ @@ -230,8 +240,8 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -240,6 +250,7 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ Heart { setPatients((prevValues) => ({ @@ -248,8 +259,8 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -258,6 +269,7 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ Muscles { setPatients((prevValues) => ({ @@ -266,8 +278,8 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -276,6 +288,7 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ Internal Organs { setPatients((prevValues) => ({ @@ -284,8 +297,8 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -294,6 +307,7 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ Gynecological menstrual/Brest { setPatients((prevValues) => ({ @@ -302,8 +316,8 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -313,6 +327,7 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ Lungs/Breathing { setPatients((prevValues) => ({ @@ -321,8 +336,8 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -331,6 +346,7 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ Nerves { setPatients((prevValues) => ({ @@ -339,8 +355,8 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -349,6 +365,7 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ Blood { setPatients((prevValues) => ({ @@ -357,8 +374,8 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -367,6 +384,7 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ Prostate/Testicular/Penile { setPatients((prevValues) => ({ @@ -375,8 +393,8 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -387,7 +405,8 @@ export default function SystemReviewSection6({handleFormSection6Data}:Props){ variant="outlined" label="" name='explanation' - value={patient.explanation} + value={type=='display'?patientDataDiplay.explanation:patient.explanation} + disabled={type=='display'} onChange={(event:any) => { setPatients((prevValues) => ({ ...prevValues, -- 2.47.2 From 10724d86fb465e7d9669f1da0e32ce3eaf52f27a Mon Sep 17 00:00:00 2001 From: sonika <> Date: Tue, 5 Sep 2023 19:21:41 +0530 Subject: [PATCH 09/14] section 7 display --- src/Components/PatientForm/PatientForm.tsx | 5 +- .../RecreationalHobbiesSection7.tsx | 84 ++++++++++++------- 2 files changed, 56 insertions(+), 33 deletions(-) diff --git a/src/Components/PatientForm/PatientForm.tsx b/src/Components/PatientForm/PatientForm.tsx index bc7e620..184fcd5 100644 --- a/src/Components/PatientForm/PatientForm.tsx +++ b/src/Components/PatientForm/PatientForm.tsx @@ -484,7 +484,10 @@ export default function PatientForm({type}:Props){ - + diff --git a/src/Components/PatientForm/RecreationalHobbiesSection7.tsx b/src/Components/PatientForm/RecreationalHobbiesSection7.tsx index 2304bbe..976471b 100644 --- a/src/Components/PatientForm/RecreationalHobbiesSection7.tsx +++ b/src/Components/PatientForm/RecreationalHobbiesSection7.tsx @@ -43,9 +43,11 @@ interface Patient { drugs: string|undefined, drugsExplanation:string|undefined, )=> void + patientDataDiplay:any; + type:string; } -export default function RecreationalHobbiesSection7({handleFormSection7Data}:Props){ +export default function RecreationalHobbiesSection7({handleFormSection7Data,patientDataDiplay,type}:Props){ const [patient, setPatient] = React.useState({ hobbies: '', educationLevel: '', @@ -101,7 +103,8 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data}:Pro multiline variant="outlined" label="" - name='explanation' + value={type=='display'?patientDataDiplay.hobbies:patient.hobbies} + disabled={type=='display'} onChange={(event:any) => { setPatient((prevValues) => ({ ...prevValues, @@ -116,6 +119,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data}:Pro Your education level: { setPatient((prevValues) => ({ ...prevValues, @@ -123,11 +127,11 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data}:Pro })); }} > - } label="High School" /> - } label="Some college" /> - } label="College Graduate" /> - } label="Post college" /> - } label="Other" /> + } label="High School" /> + } label="Some college" /> + } label="College Graduate" /> + } label="Post college" /> + } label="Other" /> @@ -138,6 +142,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data}:Pro { setPatient((prevValues) => ({ ...prevValues, @@ -145,18 +150,19 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data}:Pro })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> { setPatient((prevValues) => ({ ...prevValues, @@ -172,6 +178,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data}:Pro { setPatient((prevValues) => ({ ...prevValues, @@ -179,22 +186,23 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data}:Pro })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> { setPatient((prevValues) => ({ ...prevValues, - excerciseExplanation: event.target.value, + tobaccoExplanation: event.target.value, })); }} /> @@ -206,6 +214,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data}:Pro { setPatient((prevValues) => ({ ...prevValues, @@ -213,15 +222,16 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data}:Pro })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> { setPatient((prevValues) => ({ ...prevValues, @@ -247,15 +258,16 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data}:Pro })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> { setPatient((prevValues) => ({ ...prevValues, @@ -281,15 +294,16 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data}:Pro })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> { setPatient((prevValues) => ({ ...prevValues, @@ -315,15 +330,16 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data}:Pro })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> { setPatient((prevValues) => ({ ...prevValues, @@ -349,15 +366,16 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data}:Pro })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> { setPatient((prevValues) => ({ ...prevValues, @@ -383,15 +402,16 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data}:Pro })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> Date: Tue, 5 Sep 2023 19:26:54 +0530 Subject: [PATCH 10/14] section 8 data display --- src/Components/PatientForm/OtherDetails8.tsx | 35 ++++++++++++-------- src/Components/PatientForm/PatientForm.tsx | 7 ++-- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/src/Components/PatientForm/OtherDetails8.tsx b/src/Components/PatientForm/OtherDetails8.tsx index 3ad757c..fa5feda 100644 --- a/src/Components/PatientForm/OtherDetails8.tsx +++ b/src/Components/PatientForm/OtherDetails8.tsx @@ -24,9 +24,11 @@ interface Patient { pregnancy:string|undefined, menstralCycle: any, )=> void + patientDataDiplay:any; + type:string; } -export default function OtherDetails8({handleFormSection8Data}:Props){ +export default function OtherDetails8({handleFormSection8Data,patientDataDiplay,type}:Props){ const [patient, setPatient] = React.useState({ familyHistory: '', @@ -71,7 +73,8 @@ export default function OtherDetails8({handleFormSection8Data}:Props){ multiline variant="outlined" label="" - name='explanation' + value={type=='display'?patientDataDiplay.familyHistory:patient.familyHistory} + disabled={type=='display'} onChange={(event:any) => { setPatient((prevValues) => ({ ...prevValues, @@ -86,6 +89,7 @@ export default function OtherDetails8({handleFormSection8Data}:Props){ How do you sleep? { setPatient((prevValues) => ({ ...prevValues, @@ -93,9 +97,9 @@ export default function OtherDetails8({handleFormSection8Data}:Props){ })); }} > - } label="Back" /> - } label="Side" /> - } label="Stomach" /> + } label="Back" /> + } label="Side" /> + } label="Stomach" /> @@ -105,6 +109,7 @@ export default function OtherDetails8({handleFormSection8Data}:Props){ Do you use a pillow? { setPatient((prevValues) => ({ ...prevValues, @@ -112,8 +117,8 @@ export default function OtherDetails8({handleFormSection8Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -123,6 +128,7 @@ export default function OtherDetails8({handleFormSection8Data}:Props){ Do you wear orthotics or arch support? { setPatient((prevValues) => ({ ...prevValues, @@ -130,8 +136,8 @@ export default function OtherDetails8({handleFormSection8Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -141,7 +147,8 @@ export default function OtherDetails8({handleFormSection8Data}:Props){ { const formattedDate = formatDate(event) setPatient((prevValues) => ({ @@ -164,6 +171,7 @@ export default function OtherDetails8({handleFormSection8Data}:Props){ Possible pregnancy? { setPatient((prevValues) => ({ ...prevValues, @@ -171,8 +179,8 @@ export default function OtherDetails8({handleFormSection8Data}:Props){ })); }} > - } label="Yes" /> - } label="No" /> + } label="Yes" /> + } label="No" /> @@ -182,7 +190,8 @@ export default function OtherDetails8({handleFormSection8Data}:Props){ { const formattedDate = formatDate(event) setPatient((prevValues) => ({ diff --git a/src/Components/PatientForm/PatientForm.tsx b/src/Components/PatientForm/PatientForm.tsx index 184fcd5..c960bd5 100644 --- a/src/Components/PatientForm/PatientForm.tsx +++ b/src/Components/PatientForm/PatientForm.tsx @@ -486,7 +486,7 @@ export default function PatientForm({type}:Props){ @@ -497,7 +497,10 @@ export default function PatientForm({type}:Props){ - + -- 2.47.2 From 617728b771a7a46f2b8102ef3902b007838ef3be Mon Sep 17 00:00:00 2001 From: sonika <> Date: Tue, 5 Sep 2023 19:50:23 +0530 Subject: [PATCH 11/14] submit button disable --- src/Components/PatientForm/PatientForm.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Components/PatientForm/PatientForm.tsx b/src/Components/PatientForm/PatientForm.tsx index c960bd5..df0628b 100644 --- a/src/Components/PatientForm/PatientForm.tsx +++ b/src/Components/PatientForm/PatientForm.tsx @@ -504,8 +504,7 @@ export default function PatientForm({type}:Props){ - - + Submit -- 2.47.2 From 28ba71720111844ee6e2411df69c55040f71e028 Mon Sep 17 00:00:00 2001 From: vipeeshpavithran Date: Wed, 6 Sep 2023 10:29:41 +0530 Subject: [PATCH 12/14] Display or Fill image marker accorsing to type --- src/Components/PatientForm/PatientForm.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Components/PatientForm/PatientForm.tsx b/src/Components/PatientForm/PatientForm.tsx index df0628b..4baaf46 100644 --- a/src/Components/PatientForm/PatientForm.tsx +++ b/src/Components/PatientForm/PatientForm.tsx @@ -20,6 +20,7 @@ import SystemReviewSection6 from './SyestemReviewSection6'; import RecreationalHobbiesSection7 from './RecreationalHobbiesSection7'; import OtherDetails8 from './OtherDetails8'; import PatientImageMarker from '../ImageMarker/PatientImageMarker'; +import ViewPatientImageMarker from '../ImageMarker/ViewPatientImageMarker'; const Accordion = styled((props: AccordionProps) => ( @@ -431,8 +432,14 @@ export default function PatientForm({type}:Props){ Patient's Injury Image - - + + { + type === 'fill' ? + + : + + } + -- 2.47.2 From 48a959bfd69d753f8198a4b82a0ceb16301db2c5 Mon Sep 17 00:00:00 2001 From: sonika <> Date: Wed, 6 Sep 2023 12:43:46 +0530 Subject: [PATCH 13/14] section 1 validation --- src/App.tsx | 1 - .../PatientDetails/FamilyFormSection2.tsx | 185 ---------- .../PatientDetails/MedicalHistorySection3.tsx | 165 --------- .../PatientDetails/OtherDetails8.tsx | 113 ------ .../PatientDetails/PainAnalysisSection4.tsx | 219 ------------ .../PatientDetails/PastTreatment5.tsx | 170 --------- .../PatientDetails/PatientDetails.tsx | 335 ------------------ .../PatientDetails/PersonalSection1.tsx | 170 --------- .../RecreationalHobbiesSection7.tsx | 243 ------------- .../PatientDetails/SyestemReviewSection6.tsx | 237 ------------- .../PatientForm/PersonalSection1.tsx | 46 ++- 11 files changed, 20 insertions(+), 1864 deletions(-) delete mode 100644 src/Components/PatientDetails/FamilyFormSection2.tsx delete mode 100644 src/Components/PatientDetails/MedicalHistorySection3.tsx delete mode 100644 src/Components/PatientDetails/OtherDetails8.tsx delete mode 100644 src/Components/PatientDetails/PainAnalysisSection4.tsx delete mode 100644 src/Components/PatientDetails/PastTreatment5.tsx delete mode 100644 src/Components/PatientDetails/PatientDetails.tsx delete mode 100644 src/Components/PatientDetails/PersonalSection1.tsx delete mode 100644 src/Components/PatientDetails/RecreationalHobbiesSection7.tsx delete mode 100644 src/Components/PatientDetails/SyestemReviewSection6.tsx diff --git a/src/App.tsx b/src/App.tsx index 8739db9..9b16e11 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,7 +3,6 @@ import './App.css'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { BrowserRouter, Route, Routes } from 'react-router-dom'; import PatientForm from './Components/PatientForm/PatientForm'; -import PatientDetails from './Components/PatientDetails/PatientDetails'; function App() { const queryClient = new QueryClient(); diff --git a/src/Components/PatientDetails/FamilyFormSection2.tsx b/src/Components/PatientDetails/FamilyFormSection2.tsx deleted file mode 100644 index 4f6a7f8..0000000 --- a/src/Components/PatientDetails/FamilyFormSection2.tsx +++ /dev/null @@ -1,185 +0,0 @@ -import { Button, Checkbox, FormControl, FormControlLabel, FormGroup, FormLabel, Grid, Paper, Radio, RadioGroup, TextField } from '@mui/material'; -import { useFormik } from "formik"; -import * as yup from "yup"; -import { LocalizationProvider, DatePicker } from '@mui/x-date-pickers'; - -interface FormValues { - maritalStatus: string; - numberOfChildren: string; - ages: string; - occupation: string; - hoursPerWeek: number | string; - employer: string; - businessPhone: string; - spouseName: string; - spouseEmployer: string; - spouseBusinessPhone: string; - emergencyContact: string; - relationship: string; - spousePhone: string; -} - -interface Props { - familyDetails: FormValues; -} - -export default function FamilyFormSection({familyDetails}:Props){ - return( - <> - - - - Marital Status - - } label="Married" /> - } label="Single" /> - } label="Widowed" /> - } label="Seperated" /> - } label="Divorced" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - Spouse's Information: - - - - - - - - - - - - - - Emergency: - - - - - - - - - - - - - - - ) -}; diff --git a/src/Components/PatientDetails/MedicalHistorySection3.tsx b/src/Components/PatientDetails/MedicalHistorySection3.tsx deleted file mode 100644 index fdd49b2..0000000 --- a/src/Components/PatientDetails/MedicalHistorySection3.tsx +++ /dev/null @@ -1,165 +0,0 @@ -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; -} - -interface Props { - medicalHistory: FormValues; -} - -export default function MedicalHistoryForm({medicalHistory}:Props){ - return( - <> - - Physician Hisory Information: - - - - - - - - - - - - - - - - - - - - - Chiropractor Information: - - - - - Previous Chiropractic Care: - - } label="Yes" /> - } label="No" /> - - - - - - - - - - - - - - - - Have you had an X-ray/CT Scan within the last 12 months? If yes, did you bring the CD of images for the doctor to review? - - } label="Yes" /> - } label="No" /> - - - - - - - Who can we thank for referring you to our office: - - } label="Friend" /> - } label="Relative" /> - } label="Physician" /> - } label="Instagram" /> - } label="Google" /> - } label="Others" /> - - - - - - - How do you prefer to be reminded of your appointments? - - } label="Email" /> - } label="Text" /> - - - - - )} - \ No newline at end of file diff --git a/src/Components/PatientDetails/OtherDetails8.tsx b/src/Components/PatientDetails/OtherDetails8.tsx deleted file mode 100644 index 18513d0..0000000 --- a/src/Components/PatientDetails/OtherDetails8.tsx +++ /dev/null @@ -1,113 +0,0 @@ -import { Grid, FormLabel, TextField, FormControl, RadioGroup, FormControlLabel, Radio } from "@mui/material"; -import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs"; -import React from "react"; -import { LocalizationProvider, DatePicker } from '@mui/x-date-pickers'; -import dayjs from "dayjs"; - -interface FormValues { - familyHistory: string; - sleep: string; - pillow:string; - orthotics:string; - brestExam: any; - pregnancy:string; - menstralCycle: any; - } - -export default function OtherDetails8(){ - - return( - <> - - - Family history and health status:

- -
- - - - How do you sleep? - - } label="Back" /> - } label="Side" /> - } label="Stomach" /> - - - - - - - Do you use a pillow? - - } label="Yes" /> - } label="No" /> - - - - - - - Do you wear orthotics or arch support? - - } label="Yes" /> - } label="No" /> - - - - - - Date of last gynecological and brest exam?

- - - -
- - {/* - For X-Ray purposes: - */} - - - - Possible pregnancy? - - } label="Yes" /> - } label="No" /> - - - - - - Date of last menstrual cycle?

- - - -
- - -
- - ) -} \ No newline at end of file diff --git a/src/Components/PatientDetails/PainAnalysisSection4.tsx b/src/Components/PatientDetails/PainAnalysisSection4.tsx deleted file mode 100644 index 0ecfca1..0000000 --- a/src/Components/PatientDetails/PainAnalysisSection4.tsx +++ /dev/null @@ -1,219 +0,0 @@ -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 { - chiefComplaint:string; - painQuality: string[]; - painDuration: string; - currentTreatment: string; - treatmentResults: string; - treatmentGoal: string; -} -interface Props { - painAnalysis: FormValues; - } - -export default function PainAnalysisSection4({painAnalysis}:Props){ - return( - <> - - Issue Details: - - - - - - - - - What makes your pain worse? - - } - label="Bending" - /> - } - label="Standing" - /> - } - label="Sitting" - /> - } - label="Walking" - /> - } - label="Others" - /> - - - - - - - What makes your pain better? - - } - label="laying down" - /> - } - label="Standing" - /> - } - label="Sitting" - /> - } - label="Walking" - /> - } - label="Others" - /> - - - - - - - What is the quality of your pain? - - } - label="Sharp" - /> - } - label="Dull/Ache" - /> - } - label="Throbbing" - /> - } - label="Tingling/Numbness/Burning" - /> - } - label="Others" - /> - - - - - - - What is the worst time for your pain? - - } - label="Morning" - /> - } - label="During day" - /> - } - label="Evening" - /> - } - label="Lying in bed" - /> - } - label="Others" - /> - - - - - - - How much of the day do you experience your chief complaint? - - } label="0-25%" /> - } label="25-50%" /> - } label="50-75%" /> - } label="75-100%" /> - - - - - - - Has your current complaint caused any of the following? - - } - label="Muscle weakness" - /> - } - label="Bowel/Bladder problem" - /> - } - label="Digestion" - /> - } - label="Cardiac/Respiratory" - /> - - - - - - - - Have you tried any self treatment (ex-ice, heat, excercise) or taken any medication(over the counter or prescription)? - - } label="Yes" /> - } label="No" /> - - - - - - Expected Treatment Result: - - - - - - - - - )} - \ No newline at end of file diff --git a/src/Components/PatientDetails/PastTreatment5.tsx b/src/Components/PatientDetails/PastTreatment5.tsx deleted file mode 100644 index c863f6e..0000000 --- a/src/Components/PatientDetails/PastTreatment5.tsx +++ /dev/null @@ -1,170 +0,0 @@ -import { TextField, FormControlLabel,Grid,Checkbox, FormControl, FormLabel, Radio, RadioGroup } from '@mui/material'; -import * as React from 'react'; -import Table from '../Helper/AddNewTable'; - -interface FormValues { - generalHealth: string; - presentProblemBefore: string; - ifYespresentProblemBefore:string; - ifYestreatmentProvided: string; - ifYesOutcome: string; - strokeBloodclotting: string; - ifYesstrokeBloodclotting: string; - dizzinessFetigue: string; - ifyesdizzinessFetigue: string; - antiColligent: string; - injuriesHospitalization: string; - supplementsOrDrugs: string; -} - -interface Props { - pastTreatement: FormValues -} - - -export default function PastTreatment5({pastTreatement}: Props){ - return( - <> -
- - - - - Overall your General Healgth is: - - } label="Excellent" /> - } label="Very Good" /> - } label="Good" /> - } label="Fair" /> - } label="Poor" /> - - - - - - - Have you experienced your present problem before? - - } label="Yes" /> - } label="No" /> - - - - - - - - - - - - - - - - - - - Have you ever had a stroke or issues with blood clotting? - - } label="Yes" /> - } label="No" /> - - - - - - - - - - - Have you recently experienced dizziness, unexplained fatigue, weight loss or blood loss? - - } label="Yes" /> - } label="No" /> - - - - - - - - - - - Are you currently taking anti-coagulant or blood thinning medication? - - } label="Yes" /> - } label="No" /> - - - - - - - Have you ever had any major illness, injuries, hospitalization or surgeries? - - } label="Yes" /> - } label="No" /> - - - - - -
- - - - Please list current supplements or drugs you may be taking: - - - - - - - ) -} \ No newline at end of file diff --git a/src/Components/PatientDetails/PatientDetails.tsx b/src/Components/PatientDetails/PatientDetails.tsx deleted file mode 100644 index 437f195..0000000 --- a/src/Components/PatientDetails/PatientDetails.tsx +++ /dev/null @@ -1,335 +0,0 @@ -import * as React from 'react'; -import Typography from '@mui/material/Typography'; -import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; -import Footer from "../Footer"; -import Header from "../Header"; -import {Button, Checkbox, FormControlLabel, FormGroup, FormLabel, Grid, Paper, Radio, RadioGroup, TextField } from '@mui/material'; -import PersonalSection from './PersonalSection1'; -import { styled } from '@mui/material/styles'; -import ArrowForwardIosSharpIcon from '@mui/icons-material/ArrowForwardIosSharp'; -import MuiAccordion, { AccordionProps } from '@mui/material/Accordion'; -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 PatientImageMarker from '../ImageMarker/PatientImageMarker'; -import ViewPatientImageMarker from '../ImageMarker/ViewPatientImageMarker'; - -interface Patient { - fullName: string; - homePhone: string; - cellPhone: string; - email: string; - age: number; - dateOfBirth: string; - socialSecurityNumber: string; - mailingAddress: string; - city: string; - state: string; - zipCode: string; - gender: string; - maritalStatus: string; - } - - const personalData : Patient = { - fullName: "Vipeesh", - homePhone: "7259910917", - cellPhone: "7259910917", - email: "vipeesh191@gmail.com", - age: 33, - dateOfBirth: "27-4-1990", - socialSecurityNumber: "", - mailingAddress: "", - city: "Kannur", - state: "Kerala", - zipCode: "670643", - gender: "male", - maritalStatus: "", - } - - const familyData = { - maritalStatus:'', - numberOfChildren:'', - ages:'', - occupation:'', - hoursPerWeek:'', - employer:'', - businessPhone:'', - spouseName:'', - spouseEmployer:'', - spouseBusinessPhone:'', - emergencyContact:'', - relationship:'', - spousePhone:'' -} - -const medicalHstory = { - physicianname: '', - physiciancity: '', - physicianstate: '', - physicianphone: '', - chiropractorName: '', - chiropractorState: '', - xray: false, - ctScan: false, - cdImages: false, - visitDetails: '', - cellPhoneProvider: '', -} - -const painAnalysis = { - chiefComplaint:'', - painQuality:[], - painDuration:'', - currentTreatment:'', - treatmentResults:'', - treatmentGoal:'', -} - -const pastTreatement = { - generalHealth: '', - presentProblemBefore: '', - ifYespresentProblemBefore:'', - ifYestreatmentProvided:'', - ifYesOutcome:'', - strokeBloodclotting: '', - ifYesstrokeBloodclotting: '', - dizzinessFetigue: '', - ifyesdizzinessFetigue:'', - antiColligent: '', - injuriesHospitalization: '', - supplementsOrDrugs:'' - } - - const Accordion = styled((props: AccordionProps) => ( - - ))(({ theme }) => ({ - border: `1px solid ${theme.palette.divider}`, - '&:not(:last-child)': { - borderBottom: 0, - }, - '&:before': { - display: 'none', - }, - })); - - const AccordionSummary = styled((props: AccordionSummaryProps) => ( - } - {...props} - /> - ))(({ theme }) => ({ - backgroundColor: - theme.palette.mode === 'dark' - ? 'rgba(255, 255, 255, .05)' - : 'rgba(0, 0, 0, .03)', - flexDirection: 'row-reverse', - '& .MuiAccordionSummary-expandIconWrapper.Mui-expanded': { - transform: 'rotate(90deg)', - }, - '& .MuiAccordionSummary-content': { - marginLeft: theme.spacing(1), - }, - })); - - const AccordionDetails = styled(MuiAccordionDetails)(({ theme }) => ({ - padding: theme.spacing(2), - borderTop: '1px solid rgba(0, 0, 0, .125)', - })); - -export default function PatientDetails(){ - const [expanded, setExpanded] = React.useState('panel1'); - const [isChecked, setIsChecked] = React.useState(false); - const [signature,setSignature]=React.useState(''); - - const [patient, setPatient] = React.useState({ - fullName: "", - homePhone: "", - cellPhone: "", - email: "", - age: 0, - dateOfBirth: "", - socialSecurityNumber: "", - mailingAddress: "", - city: "", - state: "", - zipCode: "", - gender: "", - maritalStatus: "", - }); - - const handleSubmit = (event: React.FormEvent) => { - event.preventDefault(); - }; - - const handleExpandChange = - (panel: string) => (event: React.SyntheticEvent, newExpanded: boolean) => { - setExpanded(newExpanded ? panel : false); - }; - - const handleCheckboxChange = (event:any) => { - setIsChecked(event.target.checked); - }; - - //@ts-ignore - const patientData = localStorage.getItem('patientData') ? JSON.parse(localStorage.getItem('patientData')) : []; - - return( - <> - -
- -
- - Confidential Patient Information - - - - - } - aria-controls="panel1a-content" - id="panel1a-header" - > - Patient's Personal Information - - - - - - - - - - - Patient's Family Information - - - - - - - - - - Patient's Medical History Information - - - - - - - - - - Patient's Injury Image - - - - - - - - - - - Patient's Injury Details - - - - - - - - - - Patient's Past Treatment Details - - - - - - - - - - System Review Questions - - - - - - - - - - Recreational Activities/Hobbies Details - - - - - - - - - - Other Details - - - - - - - - - - - - } - label="I hereby state that all the information I have provided is complete and truthful and that I have fully disclosed my health history." - /> - - - - - { - setSignature(event.target.value) - }} - /> - - - - - - - - -
-
- - - ) -} \ No newline at end of file diff --git a/src/Components/PatientDetails/PersonalSection1.tsx b/src/Components/PatientDetails/PersonalSection1.tsx deleted file mode 100644 index fb39d9d..0000000 --- a/src/Components/PatientDetails/PersonalSection1.tsx +++ /dev/null @@ -1,170 +0,0 @@ -import * as React from 'react'; -import { Button, FormControl, FormControlLabel, FormLabel, Grid, Paper, Radio, RadioGroup, TextField } from '@mui/material'; -import { useFormik } from "formik"; -import * as yup from "yup"; -import { LocalizationProvider, DatePicker } from '@mui/x-date-pickers'; -import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; -import PatientDetails from './PatientDetails'; - -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; - maritalStatus: string; -} - -interface Props { - personalData: Patient; -} - -export default function PersonalSection({personalData} : Props){ - return( - <> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gender - - } label="Male" checked={personalData.gender === 'male'} /> - } label="Female" checked={personalData.gender === 'female'} /> - - - - - - ) -} \ No newline at end of file diff --git a/src/Components/PatientDetails/RecreationalHobbiesSection7.tsx b/src/Components/PatientDetails/RecreationalHobbiesSection7.tsx deleted file mode 100644 index b757b11..0000000 --- a/src/Components/PatientDetails/RecreationalHobbiesSection7.tsx +++ /dev/null @@ -1,243 +0,0 @@ -import { FormControl, FormControlLabel, FormLabel, Grid, Radio, RadioGroup, TextField } from "@mui/material"; -import React from "react"; - -interface FormValues { - 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 default function RecreationalHobbiesSection7(){ - return( - <> - - - - Recreational Activities/Hobbies:

- -
- - - - Your education level: - - } label="High School" /> - } label="Some college" /> - } label="College Graduate" /> - } label="Post college" /> - } label="Other" /> - - - - - - - Do you excercise? - - } label="Yes" /> - } label="No" /> - - - - - - - - - - - Use tobacco? - - } label="Yes" /> - } label="No" /> - - - - - - - - - - - Consume alcohol? - - } label="Yes" /> - } label="No" /> - - - - - - - - - - - Have a healthy diet? - - } label="Yes" /> - } label="No" /> - - - - - - - - - - - Get adequate sleep? - - } label="Yes" /> - } label="No" /> - - - - - - - - - - - Is Work/School stressful to you? - - } label="Yes" /> - } label="No" /> - - - - - - - - - - - Family life stressful to you? - - } label="Yes" /> - } label="No" /> - - - - - - - - - - - Use recreational drugs? - - } label="Yes" /> - } label="No" /> - - - - - - - -
- - ) -} \ No newline at end of file diff --git a/src/Components/PatientDetails/SyestemReviewSection6.tsx b/src/Components/PatientDetails/SyestemReviewSection6.tsx deleted file mode 100644 index 39077d3..0000000 --- a/src/Components/PatientDetails/SyestemReviewSection6.tsx +++ /dev/null @@ -1,237 +0,0 @@ -import { FormControl, FormControlLabel, FormLabel, Grid, Radio, RadioGroup, TextField } from "@mui/material"; -import React from "react"; - -interface FormValues { - 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 default function SystemReviewSection6(){ - return( - <> - - Please choose body areas or systems where you may have problems: - - - - - Eyes - - } label="Yes" /> - } label="No" /> - - - - - - Intestines/Bowls - - } label="Yes" /> - } label="No" /> - - - - - - Joints/Bones - - } label="Yes" /> - } label="No" /> - - - - - - Allergies - - } label="Yes" /> - } label="No" /> - - - - - - Ears, Nose, Mouth, Throat - - } label="Yes" /> - } label="No" /> - - - - - - Urinary - - } label="Yes" /> - } label="No" /> - - - - - - Skin - - } label="Yes" /> - } label="No" /> - - - - - - Psychological/Emotional - - } label="Yes" /> - } label="No" /> - - - - - - Heart - - } label="Yes" /> - } label="No" /> - - - - - - Muscles - - } label="Yes" /> - } label="No" /> - - - - - - Internal Organs - - } label="Yes" /> - } label="No" /> - - - - - - Gynecological menstrual/Brest - - } label="Yes" /> - } label="No" /> - - - - - - - Lungs/Breathing - - } label="Yes" /> - } label="No" /> - - - - - - Nerves - - } label="Yes" /> - } label="No" /> - - - - - - Blood - - } label="Yes" /> - } label="No" /> - - - - - - Prostate/Testicular/Penile - - } label="Yes" /> - } label="No" /> - - - - - Please explain your check marks:

- -
- -
- - ) -} \ No newline at end of file diff --git a/src/Components/PatientForm/PersonalSection1.tsx b/src/Components/PatientForm/PersonalSection1.tsx index 624622a..44f9888 100644 --- a/src/Components/PatientForm/PersonalSection1.tsx +++ b/src/Components/PatientForm/PersonalSection1.tsx @@ -47,7 +47,7 @@ export default function PersonalSection({handleFormSection1Data,patientDataDipla homePhone: "", cellPhone: "", email: "", - age: 0, + age: "", dateOfBirth: birthDateValue, socialSecurityNumber: "", mailingAddress:"", @@ -80,8 +80,8 @@ export default function PersonalSection({handleFormSection1Data,patientDataDipla return( <> - - + @@ -104,6 +106,7 @@ export default function PersonalSection({handleFormSection1Data,patientDataDipla variant="outlined" label="Phone Number" name="cellPhone" + type="number" placeholder='Please enter your cell Phone number' value={type=='display'?patientDataDiplay.cellPhone:patient.cellPhone} disabled={type=='display'} @@ -113,9 +116,8 @@ export default function PersonalSection({handleFormSection1Data,patientDataDipla cellPhone: e.target.value, })); }} - // onBlur={formik.handleBlur} - // error={formik.touched.cellPhone && Boolean(formik.errors.cellPhone)} - // helperText={formik.touched.cellPhone && formik.errors.cellPhone} + error={!(/^\d{10}$/.test(patient.cellPhone))} + helperText={!(/^\d{10}$/.test(patient.cellPhone)) ? "Please enter a valid 10-digit phone number" : ""} /> @@ -124,6 +126,7 @@ export default function PersonalSection({handleFormSection1Data,patientDataDipla variant="outlined" label="Home Phone Number" name="homePhone" + type='number' placeholder='Please enter your home phone' value={type=='display'?patientDataDiplay.homePhone:patient.homePhone} disabled={type=='display'} @@ -133,9 +136,8 @@ export default function PersonalSection({handleFormSection1Data,patientDataDipla homePhone: e.target.value, })); }} - // onBlur={formik.handleBlur} - // error={formik.touched.homePhone && Boolean(formik.errors.homePhone)} - // helperText={formik.touched.homePhone && formik.errors.homePhone} + error={!(/^\d{10}$/.test(patient.homePhone))} + helperText={!(/^\d{10}$/.test(patient.homePhone)) ? "Please enter a valid 10-digit phone number" : ""} /> @@ -153,9 +155,8 @@ export default function PersonalSection({handleFormSection1Data,patientDataDipla email: e.target.value, })); }} - // onBlur={formik.handleBlur} - // error={formik.touched.email && Boolean(formik.errors.email)} - // helperText={formik.touched.email && formik.errors.email} + error={!(/^\S+@\S+\.\S+$/.test(patient.email))} + helperText={!(/^\S+@\S+\.\S+$/.test(patient.email)) ? "Please enter a valid email address" : ""} /> @@ -174,14 +175,14 @@ export default function PersonalSection({handleFormSection1Data,patientDataDipla age: e.target.value, })); }} - // onBlur={formik.handleBlur} - // error={formik.touched.age && Boolean(formik.errors.age)} - // helperText={formik.touched.age && formik.errors.age} + error={patient.age === ""} + helperText={patient.age === "" ? "Please enter your age" : ""} + /> + - + @@ -248,15 +249,11 @@ export default function PersonalSection({handleFormSection1Data,patientDataDipla state: e.target.value, })); }} - // onBlur={formik.handleBlur} - // error={formik.touched.state && Boolean(formik.errors.state)} - // helperText={formik.touched.state && formik.errors.state} /> -- 2.47.2 From 9c7ff223fec9d27b74e01e55f96a3ebc84e12c49 Mon Sep 17 00:00:00 2001 From: sonika <> Date: Wed, 6 Sep 2023 15:51:30 +0530 Subject: [PATCH 14/14] validation and alrert dialog --- src/Components/Helper/AlertDialogBox.tsx | 35 +++++++++++++ src/Components/PatientForm/PatientForm.tsx | 50 +++++++++++++++---- .../PatientForm/PersonalSection1.tsx | 5 +- 3 files changed, 78 insertions(+), 12 deletions(-) create mode 100644 src/Components/Helper/AlertDialogBox.tsx diff --git a/src/Components/Helper/AlertDialogBox.tsx b/src/Components/Helper/AlertDialogBox.tsx new file mode 100644 index 0000000..ad52ec1 --- /dev/null +++ b/src/Components/Helper/AlertDialogBox.tsx @@ -0,0 +1,35 @@ +import { Alert, AlertColor, Snackbar, Stack } from '@mui/material'; + +type Props = { + open: boolean; + message: string; + severity: AlertColor; + duration: number; + handleAlertClose: () => void; +}; + +function AlertDialog({ + open, + message, + severity, + duration, + handleAlertClose, +}: Props) { + return ( + + + + {message} + + + + ); +} + +export default AlertDialog; diff --git a/src/Components/PatientForm/PatientForm.tsx b/src/Components/PatientForm/PatientForm.tsx index 4baaf46..dd6e745 100644 --- a/src/Components/PatientForm/PatientForm.tsx +++ b/src/Components/PatientForm/PatientForm.tsx @@ -21,6 +21,7 @@ import RecreationalHobbiesSection7 from './RecreationalHobbiesSection7'; import OtherDetails8 from './OtherDetails8'; import PatientImageMarker from '../ImageMarker/PatientImageMarker'; import ViewPatientImageMarker from '../ImageMarker/ViewPatientImageMarker'; +import AlertDialog from '../Helper/AlertDialogBox'; const Accordion = styled((props: AccordionProps) => ( @@ -63,6 +64,7 @@ type Props={ } export default function PatientForm({type}:Props){ + const [alertProps, setAlertProps] = React.useState({}); const [expanded, setExpanded] = React.useState('panel1'); const [isChecked, setIsChecked] = React.useState(false); const [signature,setSignature]=React.useState(''); @@ -342,7 +344,22 @@ export default function PatientForm({type}:Props){ setAllPatientData(updatedAllPatientData); localStorage.setItem('patientData', JSON.stringify(newPatientData)); - TextFile(); + + 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 !== "" ){ + TextFile(); + }else{ + setAlertProps({ + open: true, + severity: 'error', + message: 'Please fill all the mandatory fields with valid data!', + duration: 4000, + }); + } }; const TextFile = () => { @@ -356,20 +373,33 @@ export default function PatientForm({type}:Props){ } - const handleExpandChange = - (panel: string) => (event: React.SyntheticEvent, newExpanded: boolean) => { - setExpanded(newExpanded ? panel : false); - }; + const handleExpandChange = + (panel: string) => (event: React.SyntheticEvent, newExpanded: boolean) => { + setExpanded(newExpanded ? panel : false); + }; - const handleCheckboxChange = (event:any) => { - setIsChecked(event.target.checked); - }; + const handleCheckboxChange = (event:any) => { + setIsChecked(event.target.checked); + }; - //@ts-ignore - const patientData = localStorage.getItem('patientData') ? JSON.parse(localStorage.getItem('patientData')) : []; + const handleAlertClose = () => { + setAlertProps({}); + }; + //@ts-ignore + const patientData = localStorage.getItem('patientData') ? JSON.parse(localStorage.getItem('patientData')) : []; + return( <> + {alertProps && alertProps.open && ( + + )}
diff --git a/src/Components/PatientForm/PersonalSection1.tsx b/src/Components/PatientForm/PersonalSection1.tsx index 44f9888..c7f0755 100644 --- a/src/Components/PatientForm/PersonalSection1.tsx +++ b/src/Components/PatientForm/PersonalSection1.tsx @@ -136,13 +136,14 @@ export default function PersonalSection({handleFormSection1Data,patientDataDipla homePhone: e.target.value, })); }} - error={!(/^\d{10}$/.test(patient.homePhone))} - helperText={!(/^\d{10}$/.test(patient.homePhone)) ? "Please enter a valid 10-digit phone number" : ""} + // error={!(/^\d{10}$/.test(patient.homePhone))} + // helperText={!(/^\d{10}$/.test(patient.homePhone)) ? "Please enter a valid 10-digit phone number" : ""} />