section 5 display
This commit is contained in:
parent
25befed37c
commit
44cb8ce9ff
@ -33,10 +33,12 @@ type Props = {
|
|||||||
injuriesHospitalization: string|undefined,
|
injuriesHospitalization: string|undefined,
|
||||||
supplementsOrDrugs: string|undefined,
|
supplementsOrDrugs: string|undefined,
|
||||||
)=> void
|
)=> void
|
||||||
|
patientDataDiplay:any;
|
||||||
|
type:string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export default function PastTreatment5({handleFormSection5Data}:Props){
|
export default function PastTreatment5({handleFormSection5Data,patientDataDiplay,type}:Props){
|
||||||
|
|
||||||
const [patient, setPatient] = React.useState<Patient>({
|
const [patient, setPatient] = React.useState<Patient>({
|
||||||
generalHealth: '',
|
generalHealth: '',
|
||||||
@ -80,6 +82,7 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
|||||||
<FormLabel>Overall your General Healgth is:</FormLabel>
|
<FormLabel>Overall your General Healgth is:</FormLabel>
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
name="painDuration"
|
name="painDuration"
|
||||||
|
defaultValue={type=='display'?patientDataDiplay.generalHealth:patient.generalHealth}
|
||||||
sx={{display:'flex', flexDirection:'row'}}
|
sx={{display:'flex', flexDirection:'row'}}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
setPatient((prevValues) => ({
|
setPatient((prevValues) => ({
|
||||||
@ -88,11 +91,11 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
|||||||
}));
|
}));
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<FormControlLabel value="Excellent" control={<Radio />} label="Excellent" />
|
<FormControlLabel disabled={type=='display'} value="Excellent" control={<Radio />} label="Excellent" />
|
||||||
<FormControlLabel value="Very Good" control={<Radio />} label="Very Good" />
|
<FormControlLabel disabled={type=='display'} value="Very Good" control={<Radio />} label="Very Good" />
|
||||||
<FormControlLabel value="Good" control={<Radio />} label="Good" />
|
<FormControlLabel disabled={type=='display'} value="Good" control={<Radio />} label="Good" />
|
||||||
<FormControlLabel value="Fair" control={<Radio />} label="Fair" />
|
<FormControlLabel disabled={type=='display'} value="Fair" control={<Radio />} label="Fair" />
|
||||||
<FormControlLabel value="Poor" control={<Radio />} label="Poor" />
|
<FormControlLabel disabled={type=='display'} value="Poor" control={<Radio />} label="Poor" />
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
@ -102,6 +105,7 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
|||||||
<FormLabel>Have you experienced your present problem before?</FormLabel>
|
<FormLabel>Have you experienced your present problem before?</FormLabel>
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
name="painDuration"
|
name="painDuration"
|
||||||
|
defaultValue={type=='display'?patientDataDiplay.presentProblemBefore:patient.presentProblemBefore}
|
||||||
sx={{display:'flex', flexDirection:'row'}}
|
sx={{display:'flex', flexDirection:'row'}}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
setPatient((prevValues) => ({
|
setPatient((prevValues) => ({
|
||||||
@ -110,8 +114,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
|||||||
}));
|
}));
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<FormControlLabel value="Yes" control={<Radio />} label="Yes" />
|
<FormControlLabel disabled={type=='display'} value="Yes" control={<Radio />} label="Yes" />
|
||||||
<FormControlLabel value="No" control={<Radio />} label="No" />
|
<FormControlLabel disabled={type=='display'} value="No" control={<Radio />} label="No" />
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
@ -122,7 +126,7 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
|||||||
variant="outlined"
|
variant="outlined"
|
||||||
label="If yes, when?"
|
label="If yes, when?"
|
||||||
name='treatmentGoal'
|
name='treatmentGoal'
|
||||||
disabled={patient.presentProblemBefore!=='Yes'}
|
disabled={patient.presentProblemBefore!=='Yes'||type=='display'}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
setPatient((prevValues) => ({
|
setPatient((prevValues) => ({
|
||||||
...prevValues,
|
...prevValues,
|
||||||
@ -136,7 +140,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
|||||||
variant="outlined"
|
variant="outlined"
|
||||||
label="Was treatment provided?If yes, by whom?"
|
label="Was treatment provided?If yes, by whom?"
|
||||||
name='treatmentGoal'
|
name='treatmentGoal'
|
||||||
disabled={patient.presentProblemBefore!=='Yes'}
|
disabled={patient.presentProblemBefore!=='Yes'||type=='display'}
|
||||||
|
value={type=='display'?patientDataDiplay.ifYestreatmentProvided:patient.ifYestreatmentProvided}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
setPatient((prevValues) => ({
|
setPatient((prevValues) => ({
|
||||||
...prevValues,
|
...prevValues,
|
||||||
@ -150,7 +155,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
|||||||
variant="outlined"
|
variant="outlined"
|
||||||
label="Outcome?"
|
label="Outcome?"
|
||||||
name='treatmentGoal'
|
name='treatmentGoal'
|
||||||
disabled={patient.presentProblemBefore!=='Yes'}
|
disabled={patient.presentProblemBefore!=='Yes'||type=='display'}
|
||||||
|
value={type=='display'?patientDataDiplay.ifYesOutcome:patient.ifYesOutcome}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
setPatient((prevValues) => ({
|
setPatient((prevValues) => ({
|
||||||
...prevValues,
|
...prevValues,
|
||||||
@ -166,6 +172,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
|||||||
<FormLabel>Have you ever had a stroke or issues with blood clotting?</FormLabel>
|
<FormLabel>Have you ever had a stroke or issues with blood clotting?</FormLabel>
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
name="painDuration"
|
name="painDuration"
|
||||||
|
defaultValue={type=='display'?patientDataDiplay.strokeBloodclotting:patient.strokeBloodclotting}
|
||||||
|
value={type=='display'?patientDataDiplay.strokeBloodclotting:patient.strokeBloodclotting}
|
||||||
sx={{display:'flex', flexDirection:'row'}}
|
sx={{display:'flex', flexDirection:'row'}}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
setPatient((prevValues) => ({
|
setPatient((prevValues) => ({
|
||||||
@ -174,8 +182,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
|||||||
}));
|
}));
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<FormControlLabel value="Yes" control={<Radio />} label="Yes" />
|
<FormControlLabel disabled={type=='display'} value="Yes" control={<Radio />} label="Yes" />
|
||||||
<FormControlLabel value="No" control={<Radio />} label="No" />
|
<FormControlLabel disabled={type=='display'} value="No" control={<Radio />} label="No" />
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
@ -185,7 +193,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
|||||||
variant="outlined"
|
variant="outlined"
|
||||||
label="If yes, when?"
|
label="If yes, when?"
|
||||||
name='treatmentGoal'
|
name='treatmentGoal'
|
||||||
disabled={patient.strokeBloodclotting!=='Yes'}
|
value={type=='display'?patientDataDiplay.ifYesstrokeBloodclotting:patient.ifYesstrokeBloodclotting}
|
||||||
|
disabled={patient.strokeBloodclotting!=='Yes'||type=='display'}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
setPatient((prevValues) => ({
|
setPatient((prevValues) => ({
|
||||||
...prevValues,
|
...prevValues,
|
||||||
@ -201,6 +210,7 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
|||||||
<RadioGroup
|
<RadioGroup
|
||||||
name="painDuration"
|
name="painDuration"
|
||||||
sx={{display:'flex', flexDirection:'row'}}
|
sx={{display:'flex', flexDirection:'row'}}
|
||||||
|
defaultValue={type=='display'?patientDataDiplay.dizzinessFetigue:patient.dizzinessFetigue}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
setPatient((prevValues) => ({
|
setPatient((prevValues) => ({
|
||||||
...prevValues,
|
...prevValues,
|
||||||
@ -208,8 +218,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
|||||||
}));
|
}));
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<FormControlLabel value="Yes" control={<Radio />} label="Yes" />
|
<FormControlLabel disabled={type=='display'} value="Yes" control={<Radio />} label="Yes" />
|
||||||
<FormControlLabel value="No" control={<Radio />} label="No" />
|
<FormControlLabel disabled={type=='display'} value="No" control={<Radio />} label="No" />
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
@ -220,6 +230,7 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
|||||||
label="If yes, when?"
|
label="If yes, when?"
|
||||||
name='treatmentGoal'
|
name='treatmentGoal'
|
||||||
disabled={patient.dizzinessFetigue!=='Yes'}
|
disabled={patient.dizzinessFetigue!=='Yes'}
|
||||||
|
value={type=='display'?patientDataDiplay.ifyesdizzinessFetigue:patient.ifyesdizzinessFetigue}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
setPatient((prevValues) => ({
|
setPatient((prevValues) => ({
|
||||||
...prevValues,
|
...prevValues,
|
||||||
@ -235,6 +246,7 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
|||||||
<RadioGroup
|
<RadioGroup
|
||||||
name="painDuration"
|
name="painDuration"
|
||||||
sx={{display:'flex', flexDirection:'row'}}
|
sx={{display:'flex', flexDirection:'row'}}
|
||||||
|
defaultValue={type=='display'?patientDataDiplay.antiColligent:patient.antiColligent}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
setPatient((prevValues) => ({
|
setPatient((prevValues) => ({
|
||||||
...prevValues,
|
...prevValues,
|
||||||
@ -242,8 +254,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
|||||||
}));
|
}));
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<FormControlLabel value="Yes" control={<Radio />} label="Yes" />
|
<FormControlLabel disabled={type=='display'} value="Yes" control={<Radio />} label="Yes" />
|
||||||
<FormControlLabel value="No" control={<Radio />} label="No" />
|
<FormControlLabel disabled={type=='display'} value="No" control={<Radio />} label="No" />
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
@ -253,6 +265,7 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
|||||||
<FormLabel>Have you ever had any major illness, injuries, hospitalization or surgeries?</FormLabel>
|
<FormLabel>Have you ever had any major illness, injuries, hospitalization or surgeries?</FormLabel>
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
name="painDuration"
|
name="painDuration"
|
||||||
|
defaultValue={type=='display'?patientDataDiplay.injuriesHospitalization:patient.injuriesHospitalization}
|
||||||
sx={{display:'flex', flexDirection:'row'}}
|
sx={{display:'flex', flexDirection:'row'}}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
setPatient((prevValues) => ({
|
setPatient((prevValues) => ({
|
||||||
@ -261,8 +274,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
|||||||
}));
|
}));
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<FormControlLabel value="Yes" control={<Radio />} label="Yes" />
|
<FormControlLabel disabled={type=='display'} value="Yes" control={<Radio />} label="Yes" />
|
||||||
<FormControlLabel value="No" control={<Radio />} label="No" />
|
<FormControlLabel disabled={type=='display'} value="No" control={<Radio />} label="No" />
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
@ -278,6 +291,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
|||||||
variant="outlined"
|
variant="outlined"
|
||||||
label=""
|
label=""
|
||||||
name='treatmentGoal'
|
name='treatmentGoal'
|
||||||
|
defaultValue={type=='display'?patientDataDiplay.supplementsOrDrugs:patient.supplementsOrDrugs}
|
||||||
|
disabled={type=='display'}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
setPatient((prevValues) => ({
|
setPatient((prevValues) => ({
|
||||||
...prevValues,
|
...prevValues,
|
||||||
|
|||||||
@ -457,7 +457,10 @@ export default function PatientForm({type}:Props){
|
|||||||
</AccordionSummary>
|
</AccordionSummary>
|
||||||
|
|
||||||
<AccordionDetails>
|
<AccordionDetails>
|
||||||
<PastTreatment5 handleFormSection5Data={handleFormSection5Data}/>
|
<PastTreatment5
|
||||||
|
patientDataDiplay={patientData.pastTreatment}
|
||||||
|
type={type}
|
||||||
|
handleFormSection5Data={handleFormSection5Data}/>
|
||||||
</AccordionDetails>
|
</AccordionDetails>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user