Skip to content

Commit

Permalink
[DBEX] add mental health intro & events content
Browse files Browse the repository at this point in the history
  • Loading branch information
freeheeling authored Jan 6, 2025
1 parent 1fe81d3 commit 2bd5e99
Show file tree
Hide file tree
Showing 11 changed files with 366 additions and 23 deletions.
117 changes: 117 additions & 0 deletions src/applications/disability-benefits/all-claims/content/form0781.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from 'react';
import { formTitleTag, formTitle } from '../utils';

export const form0781HeadingTag = 'VA FORM 21-0781';
export const additionalFormsTitle = 'Additional Forms';

export const form0781WorkflowChoices = {
Expand Down Expand Up @@ -73,3 +75,118 @@ export const traumaticEventsExamples = (
</va-accordion-item>
</va-accordion>
);

export const mentalHealthSupportResources = (
<>
<strong>
Veterans Crisis Line responders are available 24 hours a day. You can
connect with a responder in any of these ways:
</strong>
<ul>
<li>
Dial <va-telephone contact="988" /> then select 1.
</li>
<li>
<va-link
external
href="https://www.veteranscrisisline.net/get-help-now/chat/"
text="Start a confidential chat."
/>
</li>
<li>
Text <va-telephone contact="838255" />.
</li>
<li>
If you have hearing loss, call TTY: <va-telephone contact="711" />, then{' '}
<va-telephone contact="988" />.
</li>
</ul>
<strong>You can also get support in any of these ways:</strong>
<ul>
<li>
<va-link
external
href="https://www.va.gov/get-help-from-accredited-representative/"
text="Connect with a Veterans Service Officer (VSO) to assist you with your
application."
/>
</li>
<li>
Call <va-telephone contact="911" />.
</li>
<li>Go to the nearest emergency room.</li>
<li>
Go directly to your nearest VA medical center. It doesn’t matter what
your discharge status is or if you’re enrolled in VA health care.
<va-link
external
href="https://www.va.gov/find-locations/?facilityType=health"
text="Find your nearest VA medical center"
/>
</li>
</ul>
<strong>
If your claim is related to MST (military sexual trauma), you can also get
support in these ways:
</strong>
<ul>
<li>
<va-link
external
href="https://www.mentalhealth.va.gov/msthome/vha-mst-coordinators.asp"
text="Connect with a MST Outreach Coordinator."
/>
</li>
<li>
<va-link
external
href="https://www.va.gov/health-care/health-needs-conditions/military-sexual-trauma/"
text="Learn more about our MST-related services."
/>
</li>
</ul>
</>
);

export const mentalHealthSupportAlert = () => {
return (
<va-alert-expandable
status="info"
trigger="How do I get mental health support right now?"
>
<p>
We understand that some of the questions may be difficult to answer. If
you need to take a break and come back to your application, your
information will be saved.
</p>
<br />
<p>
If you’re a Veteran in crisis or concerned about one, connect with our
caring, qualified Veterans Crisis Line responders for confidential help.
Many of them are Veterans themselves. This service is private, free, and
available 24/7.
</p>
<br />
{mentalHealthSupportResources}
</va-alert-expandable>
);
};

/**
* Create a title and headingTag for a page which will be passed into ui:title so that
* they are grouped in the same legend
* @param {string} title - the title for the page, which displays below the stepper
* @param {string} headingTag - the headingTag for the page, which displays above the title
* @returns {JSX.Element} markup with title and headingTag. example below.
*
* <h3 class="...">VA FORM 21-0781</h3>
* <h3 class="...">Mental health support</h3>
*/
export function titleWithTag(title, headingTag) {
return (
<>
{formTitleTag(headingTag)}
{formTitle(title)}
</>
);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
// TODO: additional content will be added in ticket #97079
import React from 'react';
import { mentalHealthSupportResources } from './form0781';

/* ---------- content ----------*/
export const mentalHealthSupportPageTitle = 'Mental health support';

export const mentalHealthSupportDescription = () => {
return (
<>
<p>
On the next screen, we’ll ask you about your mental health conditions.
<br />
<br />
First, we want you to know that you can get support for your mental
health any time, day or night.
</p>
<h4>Resources that may be helpful</h4>
<br />
{mentalHealthSupportResources}
</>
);
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// TODO: additional content will be added in ticket #97079

/* ---------- content ----------*/
export const eventTypesPageTitle = 'Types of traumatic events';
export const eventTypesDescription =
'We may send your claim to a specific type of claim processor who specializes in reviewing claims related to the traumatic events you went through.';
export const eventTypesQuestion =
'Which of these did you experience during your military service? Select all that you experienced.';
export const eventTypesHint =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,42 @@
// TODO: additional content will be added in ticket #97079
import React from 'react';

/* ---------- content ----------*/
export const eventsPageTitle = 'Traumatic events';

export const eventsIntroDescription = () => {
return (
<>
<p>
We want to know about any traumatic events during your military service.
<br />
<br />
Any information you provide will help us understand your situation and
identify evidence to support your claim. All the questions are optional.
You can provide only details that you’re comfortable sharing.
</p>
<h4>Information we’ll ask you for</h4>
<p>
We’ll ask you for this information:
<ul>
<li>
Whether your event was related to combat, personal interactions,
military sexual trauma (MST), something else, or any combination of
these
</li>
<li>
A brief description, location, and approximate time frame of your
event
</li>
<li>
Details about any official reports that were filed, if applicable
</li>
</ul>
</p>
<h4>You can take a break at any time</h4>
<p>
We understand that some of the questions may be difficult to answer. You
can take a break at any time and come back to continue your application
later. We’ll save the information you’ve entered so far.
</p>
</>
);
};
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// TODO: this is a placeholder; structure will be added in ticket #97079
import { mentalHealthSupportPageTitle } from '../../content/mentalHealthSupport';

import { formTitle } from '../../utils';
import {
mentalHealthSupportPageTitle,
mentalHealthSupportDescription,
} from '../../content/mentalHealthSupport';
import { titleWithTag, form0781HeadingTag } from '../../content/form0781';

export const uiSchema = {
'ui:title': formTitle(mentalHealthSupportPageTitle),
'ui:title': titleWithTag(mentalHealthSupportPageTitle, form0781HeadingTag),
'ui:description': mentalHealthSupportDescription,
};

export const schema = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@ import {
} from 'platform/forms-system/src/js/web-component-patterns';
import {
eventTypesPageTitle,
eventTypesDescription,
eventTypesQuestion,
eventTypesHint,
} from '../../content/traumaticEventTypes';
import { formTitle } from '../../utils';
import {
titleWithTag,
form0781HeadingTag,
traumaticEventsExamples,
mentalHealthSupportAlert,
} from '../../content/form0781';
import { TRAUMATIC_EVENT_TYPES } from '../../constants';
import { traumaticEventsExamples } from '../../content/form0781';

export const uiSchema = {
'ui:title': formTitle(eventTypesPageTitle),
'ui:title': titleWithTag(eventTypesPageTitle, form0781HeadingTag),
'ui:description': eventTypesDescription,
mentalHealth: {
eventTypes: checkboxGroupUI({
title: eventTypesQuestion,
Expand All @@ -24,6 +30,9 @@ export const uiSchema = {
'view:traumaticEventsInfo': {
'ui:description': traumaticEventsExamples,
},
'view:mentalHealthSupportAlert': {
'ui:description': mentalHealthSupportAlert,
},
};

export const schema = {
Expand All @@ -39,5 +48,9 @@ export const schema = {
type: 'object',
properties: {},
},
'view:mentalHealthSupportAlert': {
type: 'object',
properties: {},
},
},
};
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
// TODO: this is a placeholder; structure will be added in ticket #97079
import { eventsPageTitle } from '../../content/traumaticEventsIntro';

import { formTitle } from '../../utils';
import {
eventsPageTitle,
eventsIntroDescription,
} from '../../content/traumaticEventsIntro';
import {
titleWithTag,
form0781HeadingTag,
mentalHealthSupportAlert,
} from '../../content/form0781';

export const uiSchema = {
'ui:title': formTitle(eventsPageTitle),
'ui:title': titleWithTag(eventsPageTitle, form0781HeadingTag),
'ui:description': eventsIntroDescription,
'view:mentalHealthSupportAlert': {
'ui:description': mentalHealthSupportAlert,
},
};

export const schema = {
type: 'object',
properties: {},
properties: {
'view:mentalHealthSupportAlert': {
type: 'object',
properties: {},
},
},
};
Original file line number Diff line number Diff line change
@@ -1,12 +1,55 @@
import React from 'react';
import { render } from '@testing-library/react';
import { expect } from 'chai';
import * as mentalHealthSupport from '../../../pages/form0781/mentalHealthSupport';
import {
mentalHealthSupportPageTitle,
mentalHealthSupportDescription,
} from '../../../content/mentalHealthSupport';
import { titleWithTag, form0781HeadingTag } from '../../../content/form0781';

describe('Mental health support', () => {
describe('Mental health support page', () => {
it('should define a uiSchema object', () => {
expect(mentalHealthSupport.uiSchema).to.be.an('object');
});

it('should define a schema object', () => {
expect(mentalHealthSupport.schema).to.be.an('object');
});

it('should have the correct title in uiSchema', () => {
const { container: uiTitleContainer } = render(
<div>{mentalHealthSupport.uiSchema['ui:title']}</div>,
);
const renderedUITitleText = uiTitleContainer.textContent.trim();

const { container: titleWithTagContainer } = render(
<div>
{titleWithTag(mentalHealthSupportPageTitle, form0781HeadingTag)}
</div>,
);
const expectedTitleText = titleWithTagContainer.textContent.trim();

expect(renderedUITitleText).to.equal(expectedTitleText);
});

it('should have the correct description in uiSchema', () => {
expect(mentalHealthSupport.uiSchema['ui:description']).to.equal(
mentalHealthSupportDescription,
);
});

it('should have correct schema structure', () => {
expect(mentalHealthSupport.schema)
.to.have.property('type')
.that.equals('object');
expect(mentalHealthSupport.schema)
.to.have.property('properties')
.that.is.an('object');
});

it('should not have additional properties in schema', () => {
const properties = Object.keys(mentalHealthSupport.schema.properties);
expect(properties).to.have.lengthOf(0);
});
});
Loading

0 comments on commit 2bd5e99

Please sign in to comment.