feature/view-patient-data #3
@ -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<Patient>({
|
||||
generalHealth: '',
|
||||
@ -80,6 +82,7 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
||||
<FormLabel>Overall your General Healgth is:</FormLabel>
|
||||
<RadioGroup
|
||||
name="painDuration"
|
||||
defaultValue={type=='display'?patientDataDiplay.generalHealth:patient.generalHealth}
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
onChange={(event) => {
|
||||
setPatient((prevValues) => ({
|
||||
@ -88,11 +91,11 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
||||
}));
|
||||
}}
|
||||
>
|
||||
<FormControlLabel value="Excellent" control={<Radio />} label="Excellent" />
|
||||
<FormControlLabel value="Very Good" control={<Radio />} label="Very Good" />
|
||||
<FormControlLabel value="Good" control={<Radio />} label="Good" />
|
||||
<FormControlLabel value="Fair" control={<Radio />} label="Fair" />
|
||||
<FormControlLabel value="Poor" control={<Radio />} label="Poor" />
|
||||
<FormControlLabel disabled={type=='display'} value="Excellent" control={<Radio />} label="Excellent" />
|
||||
<FormControlLabel disabled={type=='display'} value="Very Good" control={<Radio />} label="Very Good" />
|
||||
<FormControlLabel disabled={type=='display'} value="Good" control={<Radio />} label="Good" />
|
||||
<FormControlLabel disabled={type=='display'} value="Fair" control={<Radio />} label="Fair" />
|
||||
<FormControlLabel disabled={type=='display'} value="Poor" control={<Radio />} label="Poor" />
|
||||
</RadioGroup>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
@ -102,6 +105,7 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
||||
<FormLabel>Have you experienced your present problem before?</FormLabel>
|
||||
<RadioGroup
|
||||
name="painDuration"
|
||||
defaultValue={type=='display'?patientDataDiplay.presentProblemBefore:patient.presentProblemBefore}
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
onChange={(event) => {
|
||||
setPatient((prevValues) => ({
|
||||
@ -110,8 +114,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
||||
}));
|
||||
}}
|
||||
>
|
||||
<FormControlLabel value="Yes" control={<Radio />} label="Yes" />
|
||||
<FormControlLabel value="No" control={<Radio />} label="No" />
|
||||
<FormControlLabel disabled={type=='display'} value="Yes" control={<Radio />} label="Yes" />
|
||||
<FormControlLabel disabled={type=='display'} value="No" control={<Radio />} label="No" />
|
||||
</RadioGroup>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
@ -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){
|
||||
<FormLabel>Have you ever had a stroke or issues with blood clotting?</FormLabel>
|
||||
<RadioGroup
|
||||
name="painDuration"
|
||||
defaultValue={type=='display'?patientDataDiplay.strokeBloodclotting:patient.strokeBloodclotting}
|
||||
value={type=='display'?patientDataDiplay.strokeBloodclotting:patient.strokeBloodclotting}
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
onChange={(event) => {
|
||||
setPatient((prevValues) => ({
|
||||
@ -174,8 +182,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
||||
}));
|
||||
}}
|
||||
>
|
||||
<FormControlLabel value="Yes" control={<Radio />} label="Yes" />
|
||||
<FormControlLabel value="No" control={<Radio />} label="No" />
|
||||
<FormControlLabel disabled={type=='display'} value="Yes" control={<Radio />} label="Yes" />
|
||||
<FormControlLabel disabled={type=='display'} value="No" control={<Radio />} label="No" />
|
||||
</RadioGroup>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
@ -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){
|
||||
<RadioGroup
|
||||
name="painDuration"
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
defaultValue={type=='display'?patientDataDiplay.dizzinessFetigue:patient.dizzinessFetigue}
|
||||
onChange={(event) => {
|
||||
setPatient((prevValues) => ({
|
||||
...prevValues,
|
||||
@ -208,8 +218,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
||||
}));
|
||||
}}
|
||||
>
|
||||
<FormControlLabel value="Yes" control={<Radio />} label="Yes" />
|
||||
<FormControlLabel value="No" control={<Radio />} label="No" />
|
||||
<FormControlLabel disabled={type=='display'} value="Yes" control={<Radio />} label="Yes" />
|
||||
<FormControlLabel disabled={type=='display'} value="No" control={<Radio />} label="No" />
|
||||
</RadioGroup>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
@ -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){
|
||||
<RadioGroup
|
||||
name="painDuration"
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
defaultValue={type=='display'?patientDataDiplay.antiColligent:patient.antiColligent}
|
||||
onChange={(event) => {
|
||||
setPatient((prevValues) => ({
|
||||
...prevValues,
|
||||
@ -242,8 +254,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
||||
}));
|
||||
}}
|
||||
>
|
||||
<FormControlLabel value="Yes" control={<Radio />} label="Yes" />
|
||||
<FormControlLabel value="No" control={<Radio />} label="No" />
|
||||
<FormControlLabel disabled={type=='display'} value="Yes" control={<Radio />} label="Yes" />
|
||||
<FormControlLabel disabled={type=='display'} value="No" control={<Radio />} label="No" />
|
||||
</RadioGroup>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
@ -253,6 +265,7 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
||||
<FormLabel>Have you ever had any major illness, injuries, hospitalization or surgeries?</FormLabel>
|
||||
<RadioGroup
|
||||
name="painDuration"
|
||||
defaultValue={type=='display'?patientDataDiplay.injuriesHospitalization:patient.injuriesHospitalization}
|
||||
sx={{display:'flex', flexDirection:'row'}}
|
||||
onChange={(event) => {
|
||||
setPatient((prevValues) => ({
|
||||
@ -261,8 +274,8 @@ export default function PastTreatment5({handleFormSection5Data}:Props){
|
||||
}));
|
||||
}}
|
||||
>
|
||||
<FormControlLabel value="Yes" control={<Radio />} label="Yes" />
|
||||
<FormControlLabel value="No" control={<Radio />} label="No" />
|
||||
<FormControlLabel disabled={type=='display'} value="Yes" control={<Radio />} label="Yes" />
|
||||
<FormControlLabel disabled={type=='display'} value="No" control={<Radio />} label="No" />
|
||||
</RadioGroup>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
@ -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,
|
||||
|
||||
@ -457,7 +457,10 @@ export default function PatientForm({type}:Props){
|
||||
</AccordionSummary>
|
||||
|
||||
<AccordionDetails>
|
||||
<PastTreatment5 handleFormSection5Data={handleFormSection5Data}/>
|
||||
<PastTreatment5
|
||||
patientDataDiplay={patientData.pastTreatment}
|
||||
type={type}
|
||||
handleFormSection5Data={handleFormSection5Data}/>
|
||||
</AccordionDetails>
|
||||
</Accordion>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user