Skip to content

PDF & Document Pipeline

Overview

Document handling is one of the core workflows. NHC requires employees and clients to complete, sign, and store numerous compliance documents.

Flow

1. Admin assigns a Form to a User (creates a JobForm record)
2. User opens the form in portals
   a. FILLABLE: SPA renders fields → user fills → submits JSON payload
   b. UPLOAD: user uploads a scanned/external PDF
3. django-api receives submission
   a. FILLABLE: WeasyPrint renders HTML template + data → PDF → upload to S3
   b. UPLOAD: file stored directly to S3
4. If signature required: pyHanko applies a digital signature to the PDF
5. ComplianceDocument record updated with S3 key + status
6. Admin can review, approve, or request resubmission

Storage

All files live on AWS S3. The S3 key pattern is:

organizations/{org_id}/users/{user_id}/{document_type}/{filename}

Presigned URLs are generated on-demand by the API for secure, time-limited access.

Key Libraries

LibraryPurpose
WeasyPrintHTML → PDF rendering
pyHankoDigital signatures (PAdES standard)
PyPDF2PDF merging / manipulation
django-storages + boto3S3 file backend

Adding a New Form Template

  1. Create an HTML template in novahomecareapi/templates/forms/.
  2. Register a Form instance via Django admin (set form_type=FILLABLE, link the template).
  3. Define the field schema (JSON) on the Form.
  4. Assign to users via the portals UI or directly via API.

Document Categories

Client Documents

Documents are split by admission type:

Admission TypeDocumentsNotes
HCC (Home Care Client)7 admission docsAll have validation rules
HHP (Home Health Patient)10 admission docs2 are admin-only manual uploads
Both6 docs added in v5.0.0
Compliance (v5.1.0)5 new typesDual-signature: client then Case Manager — see Compliance Documents

Additional slots: Other Documents (3), Miscellaneous (1), Client Admissions Files (single upload, up to 500 MB).

Employee Documents

CategoryApplies toNotes
Application DocumentsAll applicants (HC + HH)8 docs
Home Care OnboardingHC employees23 docs
HH Onboarding — Role-specificEach HH roleJob Description, Job Acceptance Statement, Provisional Hiring Agreement — one set per role (RN/LPN/CNA/HHA/PT/OT/SLP/MSW)
HH Onboarding — Policy docsAll HH roles6 shared policy documents
v5.0.0 additionsBoth HC + HH13 new employee docs
Competency ChecklistRN, LPN, CNA, HHARole-specific; PT/OT/SLP/MSW are N/A
Annual Competency ChecklistCNA, HHASimplified 25-item renewal
Drug TestCNA, HHA only
E-VerifyAll
Termination / ExitAll2 docs
Proof of Vehicle InsuranceAll
MiscellaneousAll

See Employee Documents & Onboarding for the full role matrix, template variables, and policy details.

Template Variables (Key Notes)

  • Job Acceptance Statement: {employee_name}, {employee_position}, {service_start_date}, {organization_name}, {salary}, {hourly_rate}, {effective_date}, {service_start_day}
  • Provisional Hiring Agreement: {employee_name}, {employee_positon} (typo in source template — "positon" not "position"), {service_start_date}

When building PDF merge logic, match variable names exactly as they appear in the templates.

Nova Home Care — Internal Developer Docs