department-of-veterans-affairs / va.gov-team

Public resources for building on and in support of VA.gov. Visit complete Knowledge Hub:
https://depo-platform-documentation.scrollhelp.site/index.html
284 stars 206 forks source link

[0781 PS] (2) JSON to PDF transform service #97064

Open SamStuckey opened 3 weeks ago

SamStuckey commented 3 weeks ago

SOFT BLOCKED

We can start building this, but it won't really be testable / deployable until we complete our JSON schema work

Testability: foundational

Description

Form data stored in the InProgressForm table will need to be converted to PDF for final form submission. There are examples of how we do this in the resources section of this ticket

Resources

Acceptance Criteria

Expected Deployments

See the Planning Doc for more info

freeheeling commented 1 day ago

Changes in commit

Output: 21-0781v2_3.pdf

Input:

{
  'form0781v2' => {
    'vaFileNumber' => '796104437',
    'veteranSocialSecurityNumber' => '796104437',
    'veteranFullName' => { 'first' => 'Mark', 'middle' => 'Anthony', 'last' => 'Webb' },
    'veteranDateOfBirth' => '1950-10-04',
    'email' => 'example.longemailaddresswithmorethanjustaname1234@domainwithaverylonganddetailedpart.com',
    'veteranServiceNumber' => '1234567890',
    'veteranPhone' => '1234567890',
    'veteranIntPhone' => '+1234567890123456789',
    'eventTypes' => {
      'combat' => true,
      'mst' => false,
      'nonMst' => true,
      'other' => false
    },
    'eventDetails' => [
      {
        'details' => 'Corpsman on medical ship in Da Nang harbor, Vietnam',
        'location' => 'Stationed on U.S.S. XYZ',
        'timing' => 'Summer of \'70'
      },
      {
        'details' => 'Mugged',
        'location' => 'Back alley in Big Town, USA',
        'timing' => 'June 2007'
      },
      {
        'details' => 'A devastating earthquake struck the city.',
        'location' => 'Greenwich Township, N Jersey, USA, located in Cumberland County',
        'timing' => 'February 14, 2020, marked a turning point in the journey of personal growth'
      },
      {
        'details' => 'A deadly wildfire ravaged the community, destroying homes, and taking lives.',
        'location' => 'Springfield, Hampden County, Massachusetts, USA',
        'timing' => 'Autumn of 1995.'
      },
      {
        'details' => 'Combat medic during the Tet Offensive, working in field hospitals near Saigon',
        'location' => 'Assigned to U.S. Army unit, Vietnam',
        'timing' => 'Winter of \'68'
      },
      {
        'details' => 'Navy corpsman aboard a destroyer off the coast of North Vietnam, providing aid',
        'location' => 'Onboard U.S.S. Intrepid, South China Sea',
        'timing' => 'Spring of \'72'
      }
    ],
    'reports' => {
      'yes' => false,
      'no' => true,
      'restricted' => true,
      'unrestricted' => false,
      'neither' => false,
      'police' => true,
      'other' => true
    },
    'reportsDetails' => {
      'police' => {
        'agency' => 'SVI',
        'city' => 'Dallas',
        'state' => 'Texas',
        'township' => '',
        'country' => 'USA'
      },
      'other' => 'incident report'
    },
    'behaviors' => {
      'reassignment' => true,
      'absences' => false,
      'performance' => true,
      'consultations' => false,
      'episodes' => true,
      'medications' => false,
      'selfMedication' => true,
      'substances' => false,
      'appetite' => true,
      'pregnancy' => false,
      'screenings' => true,
      'socialEconomic' => false,
      'relationships' => true,
      'misconduct' => false,
      'otherBehavior' => 'withdrawal'
    },
    'behaviorsDetails' => {
      'reassignment' => 'requested duty assignment',
      'performance' => 'poor evaluations',
      'episodes' => 'severe depression',
      'selfMedication' => 'stopped treating headaches',
      'appetite' => 'skipping meals',
      'screenings' => 'positive tests',
      'relationships' => 'separation',
      'otherBehavior' => "After the traumatic event, I began withdrawing from everyone, avoiding any social interaction. I felt uncomfortable in crowds, and trusting people became nearly impossible. My once calm and patient nature shifted into irritability and frequent anger, snapping at those around me over small things. I struggled to sleep, haunted by vivid nightmares and flashbacks that left me exhausted. At work, I could not focus, often forgetting tasks and taking more time off. This started to affect my relationships, leaving me feeling isolated, guilty, and ashamed. I could not shake the overwhelming sense of alienation, like I was no longer the person I used to be."
    },
    'evidence' => {
      'crisisCenter' => true,
      'counseling' => true,
      'family' => true,
      'faculty' => true,
      'police' => true,
      'medical' => true,
      'clergy' => true,
      'peers' => true,
      'journal' => true,
      'none' => true,
      'other' => true,
      'otherDetails' => 'photographic evidence'
    },
    'traumaTreatment' => false,
    'treatmentProviders' => {
      'privateCare' => true,
      'vetCenter' => false,
      'communityCare' => false,
      'vamc' => true,
      'cboc' => false,
      'mtf' => true,
      'none' => false
    },
    'treatmentProvidersDetails' => [
      {
        'facilityInfo' => 'Walter Reed, Bethesda, MD',
        'treatmentMonth' => '02',
        'treatmentYear' => '2014'
      },
      {
        'facilityInfo' => 'Cedarwood Behavioral Health Center, 4321 Oak Ridge Rd, Maplewood, MN',
        'treatmentYear' => '2024'
      },
      {
        'facilityInfo' => 'Silver Oak Recovery Center, 745 Greenfield Avenue, Clearwater, FL',
        'noDates' => true
      },
    ],
    'optionIndicator' => {
      'yes' => false,
      'no' => false,
      'revoke' => false,
      'notEnrolled' => true
    },
    'additionalInformation' => "The traumatic event I experienced during my service has had a profound and lasting impact on my mental health. Since the incident, I have struggled with symptoms of Post-Traumatic Stress Disorder (PTSD), depression, and anxiety, which have significantly affected my daily life and well-being.\n\n    After the event, I began to notice intense feelings of fear and helplessness whenever I was reminded of the experience. These flashbacks were frequent and uncontrollable, often triggered by loud noises, crowded places, or even certain smells. The emotional distress caused by these flashbacks would leave me feeling overwhelmed, panicked, and unable to function. At times, it felt as though I was reliving the traumatic experience, and I had difficulty distinguishing the past from the present.\n    \n    I also developed chronic insomnia. I found it difficult to fall asleep, and when I did manage to sleep, I was frequently awakened by nightmares of the traumatic event. These disturbed nights left me feeling exhausted and unable to perform basic tasks during the day. The lack of rest contributed to a decline in my physical health, as I struggled with fatigue, headaches, and an overall sense of lethargy.\n    \n    Socially, I became increasingly withdrawn. I avoided interactions with friends, family, and even fellow service members, as I felt disconnected and unable to trust anyone. My relationships suffered as I became irritable, short-tempered, and emotionally distant. I found it hard to experience joy or satisfaction in anything, including activities I once enjoyed, such as hobbies and socializing.\n    \n    I also began to experience intrusive thoughts and feelings of guilt and shame. The trauma left me questioning my actions and decisions, even though I had no control over the situation. This self-blame made it difficult to move forward and contributed to my deepening depression."
  }
}
lisacapaccioli commented 1 day ago

@freeheeling I don't see a requirement on here for the new name of the PDF. I am not sure if you need it or not, but there should a new name while the old one is still in production.

Previous name: “VA Form 21-0781 - Statement in Support of Claim for PTSD” New name: “VA Form 21-0781, Statement in Support of Claimed Mental Health Disorder(s) Due to an In-Service Traumatic Event(s)”

Message from David Reis

freeheeling commented 1 day ago

@lisacapaccioli – I brought the matter of the new name to the team's attention (here) while you were away. It won't impact generation of the PDF, but will need to be addressed when uploading the PDF.