undefined display state handeling

This commit is contained in:
sonika 2023-09-08 15:55:04 +05:30
parent e53df5c7ce
commit 24a9a71c04
10 changed files with 94 additions and 96 deletions

View File

@ -16,7 +16,6 @@ const SignatureComponent = ({signature,setSignature}:Props) => {
// setSignature(sigCanvas.current.toDataURL());
const save = () => {
console.log("ajsdjby",sigCanvas.current.toDataURL())
setSignature(sigCanvas.current.toDataURL());
};

View File

@ -98,7 +98,7 @@ export default function FamilyFormSection({
name='maritalStatus'
defaultValue={
type == 'display'
? patientDataDiplay.maritalStatus
? patientDataDiplay && patientDataDiplay.maritalStatus
: patient.maritalStatus
}
sx={{ display: 'flex', flexDirection: 'row' }}
@ -167,7 +167,7 @@ export default function FamilyFormSection({
}}
value={
type == 'display'
? patientDataDiplay.numberOfChildren
? patientDataDiplay && patientDataDiplay.numberOfChildren
: patient.numberOfChildren
}
disabled={type == 'display'}
@ -196,7 +196,7 @@ export default function FamilyFormSection({
}}
value={
type == 'display'
? patientDataDiplay.occupation
? patientDataDiplay && patientDataDiplay.occupation
: patient.occupation
}
disabled={type == 'display'}
@ -225,7 +225,7 @@ export default function FamilyFormSection({
}}
value={
type == 'display'
? patientDataDiplay.hoursPerWeek
? patientDataDiplay && patientDataDiplay.hoursPerWeek
: patient.hoursPerWeek
}
disabled={type == 'display'}
@ -251,7 +251,7 @@ export default function FamilyFormSection({
}));
}}
value={
type == 'display' ? patientDataDiplay.employer : patient.employer
type == 'display' ? patientDataDiplay && patientDataDiplay.employer : patient.employer
}
disabled={type == 'display'}
/>
@ -279,7 +279,7 @@ export default function FamilyFormSection({
}}
value={
type == 'display'
? patientDataDiplay.businessPhone
? patientDataDiplay && patientDataDiplay.businessPhone
: patient.businessPhone
}
disabled={type == 'display'}
@ -322,7 +322,7 @@ export default function FamilyFormSection({
}}
value={
type == 'display'
? patientDataDiplay.spouseName
? patientDataDiplay && patientDataDiplay.spouseName
: patient.spouseName
}
disabled={type == 'display'}
@ -350,7 +350,7 @@ export default function FamilyFormSection({
}}
value={
type == 'display'
? patientDataDiplay.spouseEmployer
? patientDataDiplay && patientDataDiplay.spouseEmployer
: patient.spouseEmployer
}
disabled={type == 'display'}
@ -379,7 +379,7 @@ export default function FamilyFormSection({
}}
value={
type == 'display'
? patientDataDiplay.spouseBusinessPhone
? patientDataDiplay && patientDataDiplay.spouseBusinessPhone
: patient.spouseBusinessPhone
}
disabled={type == 'display'}
@ -412,7 +412,7 @@ export default function FamilyFormSection({
}}
value={
type == 'display'
? patientDataDiplay.emergencyContact
? patientDataDiplay && patientDataDiplay.emergencyContact
: patient.emergencyContact
}
disabled={type == 'display'}
@ -440,7 +440,7 @@ export default function FamilyFormSection({
}}
value={
type == 'display'
? patientDataDiplay.relationship
? patientDataDiplay && patientDataDiplay.relationship
: patient.relationship
}
disabled={type == 'display'}
@ -469,7 +469,7 @@ export default function FamilyFormSection({
}}
value={
type == 'display'
? patientDataDiplay.spousePhone
? patientDataDiplay && patientDataDiplay.spousePhone
: patient.spousePhone
}
disabled={type == 'display'}

View File

@ -68,7 +68,6 @@ export default function MedicalHistoryForm({handleFormSection3Data,patientDataDi
)
},[patient])
console.log("patientDataDiplay",patientDataDiplay)
return(
<>
<Grid item xs={12} className='collapsable-form-style '>
@ -93,7 +92,7 @@ export default function MedicalHistoryForm({handleFormSection3Data,patientDataDi
physicianname: e.target.value,
}));
}}
value={type=='display'?patientDataDiplay.physicianname:patient.physicianname}
value={type=='display'? patientDataDiplay && patientDataDiplay.physicianname:patient.physicianname}
disabled={type=='display'}
/>
</Grid>
@ -114,7 +113,7 @@ export default function MedicalHistoryForm({handleFormSection3Data,patientDataDi
physiciancity: e.target.value,
}));
}}
value={type=='display'?patientDataDiplay.physiciancity:patient.physiciancity}
value={type=='display'? patientDataDiplay && patientDataDiplay.physiciancity:patient.physiciancity}
disabled={type=='display'}
/>
</Grid>
@ -135,7 +134,7 @@ export default function MedicalHistoryForm({handleFormSection3Data,patientDataDi
physicianstate: e.target.value,
}));
}}
value={type=='display'?patientDataDiplay.physicianstate:patient.physicianstate}
value={type=='display'? patientDataDiplay && patientDataDiplay.physicianstate:patient.physicianstate}
disabled={type=='display'}
/>
</Grid>
@ -157,7 +156,7 @@ export default function MedicalHistoryForm({handleFormSection3Data,patientDataDi
physicianphone: e.target.value,
}));
}}
value={type=='display'?patientDataDiplay.physicianphone:patient.physicianphone}
value={type=='display'? patientDataDiplay && patientDataDiplay.physicianphone:patient.physicianphone}
disabled={type=='display'}
/>
</Grid>
@ -190,7 +189,7 @@ export default function MedicalHistoryForm({handleFormSection3Data,patientDataDi
<FormLabel>Previous Chiropractic Care:</FormLabel>
<RadioGroup
aria-labelledby="demo-radio-buttons-group-label"
defaultValue={type=='display'?patientDataDiplay.haveChiropractor:patient.haveChiropractor}
defaultValue={type=='display'? patientDataDiplay && patientDataDiplay.haveChiropractor:patient.haveChiropractor}
name="radio-buttons-group"
onChange={(e)=>{
setPatient((prevValues) => ({
@ -223,7 +222,7 @@ export default function MedicalHistoryForm({handleFormSection3Data,patientDataDi
chiropractorName: e.target.value,
}));
}}
value={type=='display'?patientDataDiplay.chiropractorName:patient.chiropractorName}
value={type=='display'? patientDataDiplay && patientDataDiplay.chiropractorName:patient.chiropractorName}
disabled={type=='display'}
/>
</Grid>
@ -245,7 +244,7 @@ export default function MedicalHistoryForm({handleFormSection3Data,patientDataDi
chiropractorState: e.target.value,
}));
}}
value={type=='display'?patientDataDiplay.chiropractorState:patient.chiropractorState}
value={type=='display'? patientDataDiplay && patientDataDiplay.chiropractorState:patient.chiropractorState}
disabled={type=='display'}
/>
</Grid>
@ -257,7 +256,7 @@ export default function MedicalHistoryForm({handleFormSection3Data,patientDataDi
<RadioGroup
// value={patient.gender}
aria-labelledby="demo-radio-buttons-group-label"
defaultValue={type=='display'?patientDataDiplay.xray:patient.xray}
defaultValue={type=='display'? patientDataDiplay && patientDataDiplay.xray:patient.xray}
name="radio-buttons-group"
onChange={(e)=>{
setPatient((prevValues) => ({
@ -279,7 +278,7 @@ export default function MedicalHistoryForm({handleFormSection3Data,patientDataDi
<RadioGroup
// value={patient.gender}
aria-labelledby="demo-radio-buttons-group-label"
defaultValue={type=='display'?patientDataDiplay.reference:patient.reference}
defaultValue={type=='display'? patientDataDiplay && patientDataDiplay.reference:patient.reference}
name="radio-buttons-group"
onChange={(e)=>{
setPatient((prevValues) => ({
@ -305,7 +304,7 @@ export default function MedicalHistoryForm({handleFormSection3Data,patientDataDi
<RadioGroup
// value={patient.gender}
aria-labelledby="demo-radio-buttons-group-label"
defaultValue={type=='display'?patientDataDiplay.cellPhoneProvider:patient.cellPhoneProvider}
defaultValue={type=='display'? patientDataDiplay && patientDataDiplay.cellPhoneProvider:patient.cellPhoneProvider}
name="radio-buttons-group"
onChange={(e)=>{
setPatient((prevValues) => ({

View File

@ -92,7 +92,7 @@ export default function OtherDetails8({
label=''
value={
type == 'display'
? patientDataDiplay.familyHistory
? patientDataDiplay && patientDataDiplay.familyHistory
: patient.familyHistory
}
disabled={type == 'display'}
@ -111,7 +111,7 @@ export default function OtherDetails8({
<RadioGroup
sx={{ display: 'flex', flexDirection: 'row' }}
defaultValue={
type == 'display' ? patientDataDiplay.sleep : patient.sleep
type == 'display' ? patientDataDiplay && patientDataDiplay.sleep : patient.sleep
}
onChange={(event) => {
setPatient((prevValues) => ({
@ -148,7 +148,7 @@ export default function OtherDetails8({
<RadioGroup
sx={{ display: 'flex', flexDirection: 'row' }}
defaultValue={
type == 'display' ? patientDataDiplay.pillow : patient.pillow
type == 'display' ? patientDataDiplay && patientDataDiplay.pillow : patient.pillow
}
onChange={(event) => {
setPatient((prevValues) => ({
@ -180,7 +180,7 @@ export default function OtherDetails8({
sx={{ display: 'flex', flexDirection: 'row' }}
defaultValue={
type == 'display'
? patientDataDiplay.orthotics
? patientDataDiplay && patientDataDiplay.orthotics
: patient.orthotics
}
onChange={(event) => {
@ -222,7 +222,7 @@ export default function OtherDetails8({
<DatePicker
value={
type == 'display'
? patientDataDiplay.brestExam
? patientDataDiplay && patientDataDiplay.brestExam
: patient.brestExam
}
disabled={type == 'display'}
@ -252,7 +252,7 @@ export default function OtherDetails8({
sx={{ display: 'flex', flexDirection: 'row' }}
defaultValue={
type == 'display'
? patientDataDiplay.pregnancy
? patientDataDiplay && patientDataDiplay.pregnancy
: patient.pregnancy
}
onChange={(event) => {
@ -294,7 +294,7 @@ export default function OtherDetails8({
<DatePicker
value={
type == 'display'
? patientDataDiplay.menstralCycle
? patientDataDiplay && patientDataDiplay.menstralCycle
: patient.menstralCycle
}
disabled={type == 'display'}

View File

@ -165,7 +165,7 @@ export default function PainAnalysisSection4({
}}
value={
type == 'display'
? patientDataDiplay.chiefComplaint
? patientDataDiplay && patientDataDiplay.chiefComplaint
: patient.chiefComplaint
}
disabled={type == 'display'}
@ -406,7 +406,7 @@ export default function PainAnalysisSection4({
}}
value={
type == 'display'
? patientDataDiplay.painDuration
? patientDataDiplay && patientDataDiplay.painDuration
: patient.painDuration
}
sx={{ display: 'flex', flexDirection: 'row' }}
@ -513,7 +513,7 @@ export default function PainAnalysisSection4({
}}
value={
type == 'display'
? patientDataDiplay.selfTreatment
? patientDataDiplay && patientDataDiplay.selfTreatment
: patient.selfTreatment
}
sx={{ display: 'flex', flexDirection: 'row' }}
@ -566,7 +566,7 @@ export default function PainAnalysisSection4({
}}
value={
type == 'display'
? patientDataDiplay.treatmentGoal
? patientDataDiplay && patientDataDiplay.treatmentGoal
: patient.treatmentGoal
}
disabled={type == 'display'}

View File

@ -98,7 +98,7 @@ export default function PastTreatment5({
name='painDuration'
defaultValue={
type == 'display'
? patientDataDiplay.generalHealth
? patientDataDiplay && patientDataDiplay.generalHealth
: patient.generalHealth
}
sx={{ display: 'flex', flexDirection: 'row' }}
@ -156,7 +156,7 @@ export default function PastTreatment5({
name='painDuration'
defaultValue={
type == 'display'
? patientDataDiplay.presentProblemBefore
? patientDataDiplay && patientDataDiplay.presentProblemBefore
: patient.presentProblemBefore
}
sx={{ display: 'flex', flexDirection: 'row' }}
@ -225,7 +225,7 @@ export default function PastTreatment5({
}
value={
type == 'display'
? patientDataDiplay.ifYestreatmentProvided
? patientDataDiplay && patientDataDiplay.ifYestreatmentProvided
: patient.ifYestreatmentProvided
}
onChange={(event) => {
@ -254,7 +254,7 @@ export default function PastTreatment5({
}
value={
type == 'display'
? patientDataDiplay.ifYesOutcome
? patientDataDiplay && patientDataDiplay.ifYesOutcome
: patient.ifYesOutcome
}
onChange={(event) => {
@ -279,12 +279,12 @@ export default function PastTreatment5({
name='painDuration'
defaultValue={
type == 'display'
? patientDataDiplay.strokeBloodclotting
? patientDataDiplay && patientDataDiplay.strokeBloodclotting
: patient.strokeBloodclotting
}
value={
type == 'display'
? patientDataDiplay.strokeBloodclotting
? patientDataDiplay && patientDataDiplay.strokeBloodclotting
: patient.strokeBloodclotting
}
sx={{ display: 'flex', flexDirection: 'row' }}
@ -326,7 +326,7 @@ export default function PastTreatment5({
name='treatmentGoal'
value={
type == 'display'
? patientDataDiplay.ifYesstrokeBloodclotting
? patientDataDiplay && patientDataDiplay.ifYesstrokeBloodclotting
: patient.ifYesstrokeBloodclotting
}
disabled={
@ -356,7 +356,7 @@ export default function PastTreatment5({
sx={{ display: 'flex', flexDirection: 'row' }}
defaultValue={
type == 'display'
? patientDataDiplay.dizzinessFetigue
? patientDataDiplay && patientDataDiplay.dizzinessFetigue
: patient.dizzinessFetigue
}
onChange={(event) => {
@ -398,7 +398,7 @@ export default function PastTreatment5({
disabled={patient.dizzinessFetigue !== 'Yes'}
value={
type == 'display'
? patientDataDiplay.ifyesdizzinessFetigue
? patientDataDiplay && patientDataDiplay.ifyesdizzinessFetigue
: patient.ifyesdizzinessFetigue
}
onChange={(event) => {
@ -425,7 +425,7 @@ export default function PastTreatment5({
sx={{ display: 'flex', flexDirection: 'row' }}
defaultValue={
type == 'display'
? patientDataDiplay.antiColligent
? patientDataDiplay && patientDataDiplay.antiColligent
: patient.antiColligent
}
onChange={(event) => {
@ -465,7 +465,7 @@ export default function PastTreatment5({
name='painDuration'
defaultValue={
type == 'display'
? patientDataDiplay.injuriesHospitalization
? patientDataDiplay && patientDataDiplay.injuriesHospitalization
: patient.injuriesHospitalization
}
sx={{ display: 'flex', flexDirection: 'row' }}
@ -519,7 +519,7 @@ export default function PastTreatment5({
name='treatmentGoal'
defaultValue={
type == 'display'
? patientDataDiplay.supplementsOrDrugs
? patientDataDiplay && patientDataDiplay.supplementsOrDrugs
: patient.supplementsOrDrugs
}
disabled={type == 'display'}

View File

@ -413,7 +413,6 @@ export default function PatientForm({ type }: Props) {
JSON.parse(localStorage.getItem('patientData'))
: [];
return (
<>
{alertProps && alertProps.open && (
@ -653,8 +652,9 @@ export default function PatientForm({ type }: Props) {
<Grid container spacing={2} flexDirection={'row'}>
{type!=='display'?
<>
<Grid item className='collapsable-form-style'>
<FormLabel>Signature:</FormLabel>
<FormLabel sx={{marginLeft:'10px'}}> Signature:</FormLabel>
<SignatureComponent signature={signature} setSignature={setSignature} />
</Grid>

View File

@ -109,7 +109,7 @@ export default function PersonalSection({
name='fullName'
placeholder='Please enter your name'
value={
type == 'display' ? patientDataDiplay.fullName : patient.fullName
type == 'display' ? patientDataDiplay && patientDataDiplay.fullName : patient.fullName
}
disabled={type == 'display'}
onChange={(e) => {
@ -155,7 +155,7 @@ export default function PersonalSection({
placeholder='Please enter your cell Phone number'
value={
type == 'display'
? patientDataDiplay.cellPhone
? patientDataDiplay && patientDataDiplay.cellPhone
: patient.cellPhone
}
disabled={type == 'display'}
@ -208,7 +208,7 @@ export default function PersonalSection({
placeholder='Please enter your home phone'
value={
type == 'display'
? patientDataDiplay.homePhone
? patientDataDiplay && patientDataDiplay.homePhone
: patient.homePhone
}
disabled={type == 'display'}
@ -238,7 +238,7 @@ export default function PersonalSection({
label='Email'
name='email'
placeholder='Please enter your email'
value={type == 'display' ? patientDataDiplay.email : patient.email}
value={type == 'display' ? patientDataDiplay && patientDataDiplay.email : patient.email}
disabled={type == 'display'}
onChange={(e) => {
setPatient((prevValues: any) => ({
@ -281,7 +281,7 @@ export default function PersonalSection({
name='age'
type='number'
placeholder='Please enter your age'
value={type == 'display' ? patientDataDiplay.age : patient.age}
value={type == 'display' ? patientDataDiplay && patientDataDiplay.age : patient.age}
disabled={type == 'display'}
onChange={(e) => {
setPatient((prevValues: any) => ({
@ -322,7 +322,7 @@ export default function PersonalSection({
label='Date of Birth'
value={
type == 'display'
? patientDataDiplay.dateOfBirth
? patientDataDiplay && patientDataDiplay.dateOfBirth
: birthDateValue
}
disabled={type == 'display'}
@ -352,7 +352,7 @@ export default function PersonalSection({
name='socialSecurityNumber'
value={
type == 'display'
? patientDataDiplay.socialSecurityNumber
? patientDataDiplay && patientDataDiplay.socialSecurityNumber
: patient.socialSecurityNumber
}
disabled={type == 'display'}
@ -384,7 +384,7 @@ export default function PersonalSection({
name='mailingAddress'
value={
type == 'display'
? patientDataDiplay.mailingAddress
? patientDataDiplay && patientDataDiplay.mailingAddress
: patient.mailingAddress
}
disabled={type == 'display'}
@ -429,7 +429,7 @@ export default function PersonalSection({
variant='outlined'
label='State'
name='state'
value={type == 'display' ? patientDataDiplay.state : patient.state}
value={type == 'display' ? patientDataDiplay && patientDataDiplay.state : patient.state}
disabled={type == 'display'}
onChange={(e) => {
setPatient((prevValues: any) => ({
@ -453,7 +453,7 @@ export default function PersonalSection({
variant='outlined'
label='City'
name='city'
value={type == 'display' ? patientDataDiplay.city : patient.city}
value={type == 'display' ? patientDataDiplay && patientDataDiplay.city : patient.city}
disabled={type == 'display'}
onChange={(e) => {
setPatient((prevValues: any) => ({
@ -478,7 +478,7 @@ export default function PersonalSection({
label='Zip Code'
name='zipCode'
value={
type == 'display' ? patientDataDiplay.zipCode : patient.zipCode
type == 'display' ? patientDataDiplay && patientDataDiplay.zipCode : patient.zipCode
}
disabled={type == 'display'}
onChange={(e) => {
@ -507,7 +507,7 @@ export default function PersonalSection({
<RadioGroup
aria-labelledby='demo-radio-buttons-group-label'
defaultValue={
type == 'display' ? patientDataDiplay.gender : patient.gender
type == 'display' ? patientDataDiplay && patientDataDiplay.gender : patient.gender
}
name='radio-buttons-group'
onChange={(e) => {

View File

@ -103,7 +103,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data,pati
multiline
variant="outlined"
label=""
value={type=='display'?patientDataDiplay.hobbies:patient.hobbies}
value={type=='display'?patientDataDiplay && patientDataDiplay.hobbies:patient.hobbies}
disabled={type=='display'}
onChange={(event:any) => {
setPatient((prevValues) => ({
@ -119,7 +119,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data,pati
<FormLabel>Your education level:</FormLabel>
<RadioGroup
sx={{display:'flex', flexDirection:'row'}}
defaultValue={type=='display'?patientDataDiplay.educationLevel:patient.educationLevel}
defaultValue={type=='display'?patientDataDiplay && patientDataDiplay.educationLevel:patient.educationLevel}
onChange={(event) => {
setPatient((prevValues) => ({
...prevValues,
@ -146,7 +146,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data,pati
<RadioGroup
name="painDuration"
sx={{display:'flex', flexDirection:'row'}}
defaultValue={type=='display'?patientDataDiplay.excercise:patient.excercise}
defaultValue={type=='display'?patientDataDiplay && patientDataDiplay.excercise:patient.excercise}
onChange={(event) => {
setPatient((prevValues) => ({
...prevValues,
@ -170,7 +170,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data,pati
variant="outlined"
label="Times per week?"
name='treatmentGoal'
value={type=='display'?patientDataDiplay.excerciseExplanation:patient.excerciseExplanation}
value={type=='display'?patientDataDiplay && patientDataDiplay.excerciseExplanation:patient.excerciseExplanation}
onChange={(event) => {
setPatient((prevValues) => ({
...prevValues,
@ -190,7 +190,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data,pati
<RadioGroup
name="painDuration"
sx={{display:'flex', flexDirection:'row'}}
defaultValue={type=='display'?patientDataDiplay.tobacco:patient.tobacco}
defaultValue={type=='display'?patientDataDiplay && patientDataDiplay.tobacco:patient.tobacco}
onChange={(event) => {
setPatient((prevValues) => ({
...prevValues,
@ -211,7 +211,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data,pati
sm={12} className='collapsable-form-style-form7'>
<TextField
disabled={patient.tobacco!=='Yes'||type=='display'}
value={type=='display'?patientDataDiplay.tobaccoExplanation:patient.tobaccoExplanation}
value={type=='display'?patientDataDiplay && patientDataDiplay.tobaccoExplanation:patient.tobaccoExplanation}
variant="outlined"
label="Packs/Cans per day(If you have quit, when did you quit?)"
name='treatmentGoal'
@ -234,7 +234,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data,pati
<RadioGroup
name="painDuration"
sx={{display:'flex', flexDirection:'row'}}
defaultValue={type=='display'?patientDataDiplay.alcohol:patient.alcohol}
defaultValue={type=='display'?patientDataDiplay && patientDataDiplay.alcohol:patient.alcohol}
onChange={(event) => {
setPatient((prevValues) => ({
...prevValues,
@ -255,7 +255,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data,pati
sm={12} className='collapsable-form-style-form7'>
<TextField
disabled={patient.alcohol!=='Yes'||type=='display'}
value={type=='display'?patientDataDiplay.alcoholExplanation:patient.alcoholExplanation}
value={type=='display'?patientDataDiplay && patientDataDiplay.alcoholExplanation:patient.alcoholExplanation}
variant="outlined"
label="How many drinks per week?"
name='treatmentGoal'
@ -278,7 +278,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data,pati
<RadioGroup
name="painDuration"
sx={{display:'flex', flexDirection:'row'}}
defaultValue={type=='display'?patientDataDiplay.healthyDiet:patient.healthyDiet}
defaultValue={type=='display'?patientDataDiplay && patientDataDiplay.healthyDiet:patient.healthyDiet}
onChange={(event) => {
setPatient((prevValues) => ({
...prevValues,
@ -299,7 +299,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data,pati
sm={12} className='collapsable-form-style-form7'>
<TextField
disabled={patient.healthyDiet!=='No'||type=='display'}
value={type=='display'?patientDataDiplay.healthyDietExplanation:patient.healthyDietExplanation}
value={type=='display'?patientDataDiplay && patientDataDiplay.healthyDietExplanation:patient.healthyDietExplanation}
variant="outlined"
label="If no, explain"
name='treatmentGoal'
@ -322,7 +322,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data,pati
<RadioGroup
name="painDuration"
sx={{display:'flex', flexDirection:'row'}}
defaultValue={type=='display'?patientDataDiplay.sleep:patient.sleep}
defaultValue={type=='display'?patientDataDiplay && patientDataDiplay.sleep:patient.sleep}
onChange={(event) => {
setPatient((prevValues) => ({
...prevValues,
@ -343,7 +343,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data,pati
sm={12} className='collapsable-form-style-form7'>
<TextField
disabled={patient.sleep!=='No'||type=='display'}
value={type=='display'?patientDataDiplay.sleepExplanation:patient.sleepExplanation}
value={type=='display'?patientDataDiplay && patientDataDiplay.sleepExplanation:patient.sleepExplanation}
variant="outlined"
label="If no, explain"
name='treatmentGoal'
@ -366,7 +366,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data,pati
<RadioGroup
name="painDuration"
sx={{display:'flex', flexDirection:'row'}}
defaultValue={type=='display'?patientDataDiplay.workSchool:patient.workSchool}
defaultValue={type=='display'?patientDataDiplay && patientDataDiplay.workSchool:patient.workSchool}
onChange={(event) => {
setPatient((prevValues) => ({
...prevValues,
@ -387,7 +387,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data,pati
sm={12} className='collapsable-form-style-form7'>
<TextField
disabled={patient.workSchool!=='Yes'||type=='display'}
value={type=='display'?patientDataDiplay.workSchool:patient.workSchool}
value={type=='display'?patientDataDiplay && patientDataDiplay.workSchool:patient.workSchool}
variant="outlined"
label="If yes, explain"
name='treatmentGoal'
@ -410,7 +410,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data,pati
<RadioGroup
name="painDuration"
sx={{display:'flex', flexDirection:'row'}}
defaultValue={type=='display'?patientDataDiplay.familyLife:patient.familyLife}
defaultValue={type=='display'?patientDataDiplay && patientDataDiplay.familyLife:patient.familyLife}
onChange={(event) => {
setPatient((prevValues) => ({
...prevValues,
@ -431,7 +431,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data,pati
sm={12} className='collapsable-form-style-form7'>
<TextField
disabled={patient.familyLife!=='Yes'||type=='display'}
value={type=='display'?patientDataDiplay.familyLifeExplanation:patient.familyLifeExplanation}
value={type=='display'?patientDataDiplay && patientDataDiplay.familyLifeExplanation:patient.familyLifeExplanation}
variant="outlined"
label="If yes, explain"
name='treatmentGoal'
@ -454,7 +454,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data,pati
<RadioGroup
name="painDuration"
sx={{display:'flex', flexDirection:'row'}}
defaultValue={type=='display'?patientDataDiplay.drugs:patient.drugs}
defaultValue={type=='display'?patientDataDiplay && patientDataDiplay.drugs:patient.drugs}
onChange={(event) => {
setPatient((prevValues) => ({
...prevValues,
@ -475,7 +475,7 @@ export default function RecreationalHobbiesSection7({handleFormSection7Data,pati
sm={12} className='collapsable-form-style-form7'>
<TextField
disabled={patient.drugs!=='Yes'||type=='display'}
value={type=='display'?patientDataDiplay.drugsExplanation:patient.drugsExplanation}
value={type=='display'?patientDataDiplay && patientDataDiplay.drugsExplanation:patient.drugsExplanation}
variant="outlined"
label="If yes, explain"
name='treatmentGoal'

View File

@ -121,7 +121,7 @@ export default function SystemReviewSection6({
<RadioGroup
name='painDuration'
defaultValue={
type == 'display' ? patientDataDiplay.eyes : patient.eyes
type == 'display' ? patientDataDiplay && patientDataDiplay.eyes : patient.eyes
}
sx={{ display: 'flex', flexDirection: 'row' }}
onChange={(event) => {
@ -161,7 +161,7 @@ export default function SystemReviewSection6({
name='painDuration'
defaultValue={
type == 'display'
? patientDataDiplay.IntestinesBowls
? patientDataDiplay && patientDataDiplay.IntestinesBowls
: patient.IntestinesBowls
}
sx={{ display: 'flex', flexDirection: 'row' }}
@ -202,7 +202,7 @@ export default function SystemReviewSection6({
name='painDuration'
defaultValue={
type == 'display'
? patientDataDiplay.jointsBones
? patientDataDiplay && patientDataDiplay.jointsBones
: patient.jointsBones
}
sx={{ display: 'flex', flexDirection: 'row' }}
@ -243,7 +243,7 @@ export default function SystemReviewSection6({
name='painDuration'
defaultValue={
type == 'display'
? patientDataDiplay.allergies
? patientDataDiplay && patientDataDiplay.allergies
: patient.allergies
}
sx={{ display: 'flex', flexDirection: 'row' }}
@ -284,7 +284,7 @@ export default function SystemReviewSection6({
name='painDuration'
defaultValue={
type == 'display'
? patientDataDiplay.earsNoseMouth
? patientDataDiplay && patientDataDiplay.earsNoseMouth
: patient.earsNoseMouth
}
sx={{ display: 'flex', flexDirection: 'row' }}
@ -324,7 +324,7 @@ export default function SystemReviewSection6({
<RadioGroup
name='painDuration'
defaultValue={
type == 'display' ? patientDataDiplay.urinary : patient.urinary
type == 'display' ? patientDataDiplay && patientDataDiplay.urinary : patient.urinary
}
sx={{ display: 'flex', flexDirection: 'row' }}
onChange={(event) => {
@ -363,7 +363,7 @@ export default function SystemReviewSection6({
<RadioGroup
name='painDuration'
defaultValue={
type == 'display' ? patientDataDiplay.skin : patient.skin
type == 'display' ? patientDataDiplay && patientDataDiplay.skin : patient.skin
}
sx={{ display: 'flex', flexDirection: 'row' }}
onChange={(event) => {
@ -403,7 +403,7 @@ export default function SystemReviewSection6({
name='painDuration'
defaultValue={
type == 'display'
? patientDataDiplay.psychological
? patientDataDiplay && patientDataDiplay.psychological
: patient.psychological
}
sx={{ display: 'flex', flexDirection: 'row' }}
@ -443,7 +443,7 @@ export default function SystemReviewSection6({
<RadioGroup
name='painDuration'
defaultValue={
type == 'display' ? patientDataDiplay.heart : patient.heart
type == 'display' ? patientDataDiplay && patientDataDiplay.heart : patient.heart
}
sx={{ display: 'flex', flexDirection: 'row' }}
onChange={(event) => {
@ -482,7 +482,7 @@ export default function SystemReviewSection6({
<RadioGroup
name='painDuration'
defaultValue={
type == 'display' ? patientDataDiplay.muscles : patient.muscles
type == 'display' ? patientDataDiplay && patientDataDiplay.muscles : patient.muscles
}
sx={{ display: 'flex', flexDirection: 'row' }}
onChange={(event) => {
@ -522,7 +522,7 @@ export default function SystemReviewSection6({
name='painDuration'
defaultValue={
type == 'display'
? patientDataDiplay.internalOrgans
? patientDataDiplay && patientDataDiplay.internalOrgans
: patient.internalOrgans
}
sx={{ display: 'flex', flexDirection: 'row' }}
@ -563,7 +563,7 @@ export default function SystemReviewSection6({
name='painDuration'
defaultValue={
type == 'display'
? patientDataDiplay.gynecological
? patientDataDiplay && patientDataDiplay.gynecological
: patient.gynecological
}
sx={{ display: 'flex', flexDirection: 'row' }}
@ -605,7 +605,7 @@ export default function SystemReviewSection6({
name='painDuration'
defaultValue={
type == 'display'
? patientDataDiplay.lungsBreathing
? patientDataDiplay && patientDataDiplay.lungsBreathing
: patient.lungsBreathing
}
sx={{ display: 'flex', flexDirection: 'row' }}
@ -645,7 +645,7 @@ export default function SystemReviewSection6({
<RadioGroup
name='painDuration'
defaultValue={
type == 'display' ? patientDataDiplay.nerves : patient.nerves
type == 'display' ? patientDataDiplay && patientDataDiplay.nerves : patient.nerves
}
sx={{ display: 'flex', flexDirection: 'row' }}
onChange={(event) => {
@ -684,7 +684,7 @@ export default function SystemReviewSection6({
<RadioGroup
name='painDuration'
defaultValue={
type == 'display' ? patientDataDiplay.blood : patient.blood
type == 'display' ? patientDataDiplay && patientDataDiplay.blood : patient.blood
}
sx={{ display: 'flex', flexDirection: 'row' }}
onChange={(event) => {
@ -724,7 +724,7 @@ export default function SystemReviewSection6({
name='painDuration'
defaultValue={
type == 'display'
? patientDataDiplay.prostate
? patientDataDiplay && patientDataDiplay.prostate
: patient.prostate
}
sx={{ display: 'flex', flexDirection: 'row' }}
@ -768,7 +768,7 @@ export default function SystemReviewSection6({
name='explanation'
value={
type == 'display'
? patientDataDiplay.explanation
? patientDataDiplay && patientDataDiplay.explanation
: patient.explanation
}
disabled={type == 'display'}