From 10724d86fb465e7d9669f1da0e32ce3eaf52f27a Mon Sep 17 00:00:00 2001
From: sonika <>
Date: Tue, 5 Sep 2023 19:21:41 +0530
Subject: [PATCH] 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" />