department-of-veterans-affairs / abd-vro

To get Veterans benefits in minutes, VRO software uses health evidence data to help fast track disability claims.
Other
19 stars 6 forks source link

Research who/what generates each form PDF + overflow page #3590

Open mackhowell-nava opened 6 days ago

mackhowell-nava commented 6 days ago

Based on our inventory of form PDFs and overflow pages here: https://app.mural.co/t/departmentofveteransaffairs9999/m/departmentofveteransaffairs9999/1726591426989/547c59766d621518292bfe86530a1b5608419234?sender=uf3d2a9320ea286a502077710

Priorities of PDFs

We want to understand:

nanotone commented 19 hours ago

Third-party Ruby libraries

PdfForms is an open source Ruby interface to PDFtk, a popular PDF toolkit. This pairing provides generic PDF operations -- filling out fields, splitting or combining documents, etc. PdfForms / PDFtk is best for working with existing documents along the lines of what you'd do with Acrobat Reader or OSX Preview.

Making modifications to the capabilities of either is most likely out of the question.

Prawn is a pure Ruby library that creates PDFs from scratch, using basic drawing and text-writing operations. Prawn is best for authoring new documents, along the lines of a presentation slideshow editor. Prawn-markup is an add-on library that enables some HTML-to-PDF conversion (even though Prawn discourages this).

Note: on the RRD project, ARSD's were created by Prawn / Prawn-markup.

Making modifications to Prawn / Prawn-markup is not exactly a breeze, but there is precedent on our very own team and the maintainer has been pretty receptive.

Shared Ruby code in vets-api

PdfFill is the primary utility used by the various parts of VA.gov for PDF generation. It:

PdfFill has two sibling utilities organized under PdfUtilities:

Forms that use vets-api PdfFill

The vast majority of forms generated by VA.gov use PdfFill, including 527 (pensions), 686c (dependents), and 21-22 (POA). Importantly, 526 does not use PdfFill; see the next section below.

Non-Ruby PDF code outside of vets-api

526 PDFs are generated by an LHDI app, unsurprisingly named Form 526EZ PDF Generator, which is maintained by Lighthouse's #team-firefly. It is called by the LH Benefits Claims API but is not itself a publicly-available LH API. The app is written in Java and uses the Java-based Apache PDFBox library for actually working with PDF files. We are unlikely to contribute any code to this, but the LH team will probably be open to requests.

Takeaways

Nearly all VA.gov-generated forms are generated by a vets-api library called PdfFill, which handles filling out fields into existing blank PDFs, as well as creating overflow pages. There are some minor inconsistencies (but likely not visual) in how each team calls PdfFill.

I expect that modifications to PdfFill to support our desired visual changes would need approval both from the platform team, since PdfFill code is shared by so many VFS teams, as well as from teams that maintain any affected forms. We can likely work with the platform team to engineer a slow-release of visual changes to affect one form at a time, but on the plus side, if they're successful it should be easy to roll improvements out to additional forms.

Any modifications to the 526 PDF will have to go through the LH team that maintains the 526 PDF generator service, which doesn't share any code with the others.