Skip to content

Commit 46b4077

Browse files
committed
Fixed bugs with follow ups for tabs
1 parent 3b2316e commit 46b4077

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

src/components/FollowUpDoctorSelect.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export default class FollowUpDoctorSelect extends Component {
66
return (
77
<Select
88
{...this.props.formValue}
9+
value={this.props.formValue.value || ''}
910
label={this.props.label}
1011
options={[
1112
{key: 'M. Back', value: 'M. Back'},

src/components/FollowUpFollowUp.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ export class FollowUpFollowUp extends Component {
190190
<div className={styles['fufu-tlc-two']}>
191191
<Select
192192
{...hormones}
193+
value={hormones.value || ''}
193194
label='Current hormones'
194195
options={[
195196
{key: 'No', value: 'No'},
@@ -200,6 +201,7 @@ export class FollowUpFollowUp extends Component {
200201
/>
201202
<Select
202203
{...systemicTherapy}
204+
value={systemicTherapy.value || ''}
203205
label='Current Systemic Therapy'
204206
options={[
205207
{key: 'Nil', value: 'Nil'},
@@ -210,9 +212,9 @@ export class FollowUpFollowUp extends Component {
210212
]}
211213
/>
212214
<InlineWidgetGroup>
213-
214215
<Select
215216
{...alphaBlocker}
217+
value={alphaBlocker.value || ''}
216218
label='Alpha Blocker / Anticholinergic'
217219
labelClassName={styles['fufu-alpha-blocker-label']}
218220
options={[
@@ -229,6 +231,7 @@ export class FollowUpFollowUp extends Component {
229231
<div className={styles['fufu-sub-panel-one']}>
230232
<Select
231233
{...currentFU}
234+
value={currentFU.value || ''}
232235
label='Current Follow-Up'
233236
options={[
234237
{key: 'Phone', value: 'Phone'},
@@ -241,6 +244,7 @@ export class FollowUpFollowUp extends Component {
241244
/>
242245
<Select
243246
{...nocturia}
247+
value={nocturia.value || ''}
244248
label='Nocturia'
245249
options={[
246250
{key: '0', value: '0'},
@@ -258,6 +262,7 @@ export class FollowUpFollowUp extends Component {
258262
<div className={styles['fufu-sub-panel-two']}>
259263
<Select
260264
{...biochemicalFailure}
265+
value={biochemicalFailure.value || ''}
261266
label='Biochemical Failure'
262267
options={[
263268
{key: 'Yes', value: 'Yes'},
@@ -278,6 +283,7 @@ export class FollowUpFollowUp extends Component {
278283
<h3 className={styles['fufu-sub-heading-top']}>Quality of Life</h3>
279284
<Select
280285
{...epicCompleted}
286+
value={epicCompleted.value || ''}
281287
label='EPIC Completed'
282288
options={[
283289
{key: 'Yes', value: 'Yes'},
@@ -355,6 +361,7 @@ export class FollowUpFollowUp extends Component {
355361
<TextArea
356362
label='Comments'
357363
{...comments}
364+
value={comments.value || ''}
358365
/>
359366
</div>
360367
<div className={styles['fufu-second-cancer-container']}>

src/components/FollowUpTabs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default class FollowUpTabs extends Component {
1616
key={fu.id}
1717
className={className}
1818
onClick={() => {
19-
this.props.handleFollowUpOnClick(fu.id, fu.date);
19+
this.props.handleFollowUpOnClick(fu.id);
2020
}}
2121
>
2222
<FormattedDate

src/redux/modules/patient.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,9 @@ export const backgroundHistoryChangeAllergicTo = createAction(
274274

275275
export const followUpFetch = createAction(
276276
FOLLOW_UP_FETCH,
277-
(followUpId, followUpDate) => {
277+
(followUpId) => {
278278
return {
279279
id: followUpId,
280-
date: followUpDate,
281280
};
282281
}
283282
);
@@ -588,22 +587,21 @@ export default handleActions({
588587
};
589588
},
590589
[FOLLOW_UP_FETCH]: (state, action) => {
590+
const followUps = state.activePatient.followUps;
591+
const elementPos = followUps.map((x) => { return x.id; }).indexOf(action.payload.id);
591592
return {
592593
...state,
593594
activePatient: {
594595
...state.activePatient,
595-
activeFollowUp: {
596-
id: action.payload.id,
597-
date: action.payload.date,
598-
}
596+
activeFollowUp: followUps[elementPos]
599597
}
600598
};
601599
},
602600
[FOLLOW_UP_CREATE_NEW]: (state, action) => {
603601
const now = new Date();
604602
let followUps = [{
605603
id: state.activePatient.followUps.length + 1,
606-
date: now.toISOString()
604+
date: moment(now.toISOString())
607605
}];
608606
followUps = followUps.concat(state.activePatient.followUps);
609607

0 commit comments

Comments
 (0)