File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
components/ExpandableContainer/components Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ const Discharge: FC<{
197197 </ CheckBoxWrapper >
198198 < Field
199199 name = "infection"
200- initialValue = { discharge ?. discharge_duration }
200+ initialValue = { discharge ?. infection }
201201 parse = { ( value ) => value }
202202 >
203203 { ( props ) => {
@@ -207,7 +207,7 @@ const Discharge: FC<{
207207 < TextField
208208 id = "infection"
209209 disabled
210- label = { 'Infection ' }
210+ label = { 'Post-operative complications ' }
211211 required = { canSubmit }
212212 styleType = "outlined"
213213 size = "md"
Original file line number Diff line number Diff line change @@ -24,18 +24,19 @@ export const dischargeFormValidation = (values: {
2424 errors . date = 'Discharge date cannot be set in the future.' ;
2525 }
2626
27+ // aware_of_mesh is actually the "Antibiotics given on discharge" field
2728 if ( ! values . aware_of_mesh && typeof values . aware_of_mesh !== 'object' ) {
2829 errors . aware_of_mesh = REQUIRED_FIELD_MSG ;
2930 } else {
30- console . log ( values )
31-
32- if ( ! values . discharge_duration && typeof values . discharge_duration !== 'object' ) {
33- errors . discharge_duration = REQUIRED_FIELD_MSG ;
31+ if ( values . aware_of_mesh . value === 0 ) {
32+ if ( ! values . discharge_duration && typeof values . discharge_duration !== 'object' ) {
33+ errors . discharge_duration = REQUIRED_FIELD_MSG ;
34+ }
3435 }
3536 }
3637
3738 if ( values . infection === undefined || values . infection ?. length == 0 ) {
38- const errorMessage = "Please record the post-operative complication above. if there wasn't any then select the option 'None'" ;
39+ const errorMessage = "Please record the post-operative complication above. If there wasn't any then select the option 'None'" ;
3940 errors . infection = errorMessage ;
4041 }
4142 return errors ;
You can’t perform that action at this time.
0 commit comments