Skip to content

Commit

Permalink
All claims 23 mg (#8705)
Browse files Browse the repository at this point in the history
Adds 2.3 to All Claims 526 form - follow-up questions for disabilities.
  • Loading branch information
markgreenburg authored Oct 10, 2018
1 parent 3b7fed1 commit 1671b0e
Show file tree
Hide file tree
Showing 12 changed files with 434 additions and 64 deletions.
39 changes: 36 additions & 3 deletions src/applications/disability-benefits/all-claims/config/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import {
contactInformation,
addDisabilities,
newDisabilityFollowUp,
newPTSDFollowUp,
summaryOfDisabilities,
vaMedicalRecords,
additionalDocuments,
privateMedicalRecords,
Expand All @@ -40,9 +42,9 @@ import {
summaryOfEvidence,
} 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 @@ -183,11 +185,42 @@ 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),
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.
// 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),
arrayPath: 'newDisabilities',
uiSchema: newPTSDFollowUp.uiSchema,
schema: newPTSDFollowUp.schema,
},
summaryOfDisabilities: {
title: 'Summary of disabilities',
path: 'disabilities/summary',
uiSchema: summaryOfDisabilities.uiSchema,
schema: summaryOfDisabilities.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>
);
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const disabilityOption = ({ name, ratingPercentage }) => {
export const disabilitiesClarification = (
<p>
<strong>Please note:</strong> This list only includes disabilities that
we've already rated. It doesn't include any disabilities from claims that
weve already rated. It doesnt include any disabilities from claims that
are in progress.
</p>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import { getDisabilityName } from '../utils';

export const summaryOfDisabilitiesDescription = ({ formData }) => {
const { ratedDisabilities, newDisabilities } = formData;
const ratedDisabilityNames = ratedDisabilities
? ratedDisabilities.map(disability => getDisabilityName(disability.name))
: [];
const newDisabilityNames = newDisabilities
? newDisabilities.map(disability => getDisabilityName(disability.condition))
: [];
const selectedDisabilitiesList = ratedDisabilityNames
.concat(newDisabilityNames)
.map((name, i) => <li key={`"${name}-${i}"`}>{name}</li>);
return (
<div>
<p>
Below is the list of disabilities you’re claiming in this application.
If a disability is missing from the list, please go back one screen and
add it.
</p>
<ul>{selectedDisabilitiesList}</ul>
</div>
);
};
20 changes: 20 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,16 @@ import {
schema as newDisabilityFollowUpSchema,
} from './newDisabilityFollowUp';

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

import {
uiSchema as summaryOfDisabilitiesUISchema,
schema as summaryOfDisabilitiesSchema,
} from './summaryOfDisabilities';

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

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

export const summaryOfDisabilities = {
uiSchema: summaryOfDisabilitiesUISchema,
schema: summaryOfDisabilitiesSchema,
};

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

0 comments on commit 1671b0e

Please sign in to comment.