Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All claims 23 mg #8705

Merged
merged 11 commits into from
Oct 10, 2018
36 changes: 33 additions & 3 deletions src/applications/disability-benefits/all-claims/config/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ import {
evidenceTypes,
claimExamsInfo,
homelessOrAtRisk,
newPTSDFollowUp,
} from '../pages';

import fullSchema from './schema';
import { PTSD } from '../constants';

const ptsdDisabilityIds = new Set([5420, 7290, 9010, 9011]);
import fullSchema from './schema';

const formConfig = {
urlPrefix: '/',
Expand Down Expand Up @@ -182,11 +183,40 @@ const formConfig = {
title: formData => getDisabilityName(formData.condition),
path: 'new-disabilities/follow-up/:index',
showPagePerItem: true,
itemFilter: item => !ptsdDisabilityIds.has(item.diagnosticCode),
itemFilter: item =>
item.condition
? !item.condition.toLowerCase().includes(PTSD)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively: itemFilter: item => item.condition && !item.condition.toLowerCase().includes(PTSD)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, good call

: false,
arrayPath: 'newDisabilities',
uiSchema: newDisabilityFollowUp.uiSchema,
schema: newDisabilityFollowUp.schema,
},
// Consecutive `showPagePerItem` pages that have the same arrayPath
// will force each item in the array to be evaluated by both pages
// before the next item is evaluated (e.g., if PTSD was entered first,
// it would still show first even though the first page was skipped).
// This break between the two `showPagePerItem`s ensures PTSD is sorted
// behind non-PTSD conditions in the form flow.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great comment!

// TODO: forms system PR to make showPagePerItem behavior configurable
followUpPageBreak: {
title: '',
depends: () => false,
path: 'new-disabilities/page-break',
uiSchema: {},
schema: { type: 'object', properties: {} },
},
newPTSDFollowUp: {
title: formData => getDisabilityName(formData.condition),
path: 'new-disabilities/follow-up/ptsd/:index',
showPagePerItem: true,
itemFilter: item =>
item.condition
? item.condition.toLowerCase().includes(PTSD)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively: itemFilter: item => item.condition && item.condition.toLowerCase().includes(PTSD)

: false,
arrayPath: 'newDisabilities',
uiSchema: newPTSDFollowUp.uiSchema,
schema: newPTSDFollowUp.schema,
},
},
},
supportingEvidence: {
Expand Down
25 changes: 20 additions & 5 deletions src/applications/disability-benefits/all-claims/config/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -734,18 +734,33 @@ const schema = {
},
cause: {
type: 'string',
enum: ['NEW', 'SECONDARY', 'VA'],
enum: ['NEW', 'SECONDARY', 'WORSENED', 'VA'],
},
disabilityStartDate: {
primaryDescription: {
type: 'string',
format: 'date',
},
primaryDisability: {
causedByDisability: {
type: 'string',
},
primaryDescription: {
causedByDisabilityDescription: {
type: 'string',
},
worsenedDescription: {
type: 'string',
},
worsenedEffects: {
type: 'string',
},
VAMistreatmentDescription: {
type: 'string',
},
VAMistreatmentLocation: {
type: 'string',
},
VAMistreatmentDate: {
type: 'string',
format: 'date',
},
},
},
},
Expand Down
2 changes: 2 additions & 0 deletions src/applications/disability-benefits/all-claims/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,5 @@ export const VA_FORM4142_URL =
'https://www.vba.va.gov/pubs/forms/VBA-21-4142-ARE.pdf';

export const FIFTY_MB = 52428800;

export const PTSD = 'ptsd';
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import React from 'react';
import Modal from '@department-of-veterans-affairs/formation/Modal';
import { getDisabilityName } from '../utils';

export class CauseTitle extends React.Component {
constructor(props) {
super(props);
this.state = { modalVisible: false };
}

openModal = () => this.setState({ modalVisible: true });

closeModal = () => this.setState({ modalVisible: false });

render() {
return (
<div>
What caused this{' '}
<button
type="button"
className="va-button-link"
onClick={this.openModal}
>
service-connected
</button>{' '}
disability?
<Modal
title="Service-connected disability"
onClose={this.closeModal}
visible={this.state.modalVisible}
id="service-connected-modal"
>
<p>
To be eligible for disability benefits, you’ll need to show that
your condition was caused by an illness or injury connected to your
military service. You’ll need to show your condition is linked to
your service by submitting evidence, such as medical reports or lay
statements, with your claim. We may ask you to have a claim exam if
you don’t submit evidence or if we need more information to decide
your claim.
</p>
</Modal>
</div>
);
}
}

export const disabilityNameTitle = ({ formData }) => (
<legend className="schemaform-block-title schemaform-title-underline">
{getDisabilityName(formData.condition)}
</legend>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';

export const newPTSDFollowUpDescription = (
<div>
<p>
If you’re filing a claim for PTSD, you’ll need to provide additional
documents and details about the traumatic (or “stressor”) event that
caused your PTSD. You may also need to provide treatment records and
contact information for any relevant supporting statements.
</p>
<p>
If you need more time to prepare your evidence for your PTSD claim, you
can save your application and return to it later when you have your
evidence ready to upload.
</p>
</div>
);
10 changes: 10 additions & 0 deletions src/applications/disability-benefits/all-claims/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ import {
schema as newDisabilityFollowUpSchema,
} from './newDisabilityFollowUp';

import {
uiSchema as newPTSDFollowUpUISchema,
schema as newPTSDFollowUpSchema,
} from './newPTSDFollowUp';

import {
uiSchema as vaMedicalRecordsUISchema,
schema as vaMedicalRecordsSchema,
Expand Down Expand Up @@ -148,6 +153,11 @@ export const newDisabilityFollowUp = {
schema: newDisabilityFollowUpSchema,
};

export const newPTSDFollowUp = {
uiSchema: newPTSDFollowUpUISchema,
schema: newPTSDFollowUpSchema,
};

export const vaMedicalRecords = {
uiSchema: vaMedicalRecordsUISchema,
schema: vaMedicalRecordsSchema,
Expand Down
Loading