Skip to content

fix(paperwork-pdf): use friendly patient ID on Paperwork PDF#8003

Open
alexwillingham wants to merge 1 commit into
developfrom
claude/magical-fermat-bgduzz
Open

fix(paperwork-pdf): use friendly patient ID on Paperwork PDF#8003
alexwillingham wants to merge 1 commit into
developfrom
claude/magical-fermat-bgduzz

Conversation

@alexwillingham

Copy link
Copy Markdown
Contributor

Summary

PR #7795 moved most of our PDFs onto the friendly patient identifier (getPatientFriendlyId()) instead of the raw FHIR Patient.id UUID. The Paperwork PDF was missed in that change — it was still rendering the raw UUID in its PID: field.

This PR fixes that gap so the Paperwork PDF is consistent with the discharge summary, visit note, and progress note PDFs.

Change

In packages/zambdas/src/ehr/paperwork-to-pdf/document.ts, the patient info id is now sourced from getPatientFriendlyId(patient) rather than patient.id ?? ''. The draw.ts renderer already prints this value as PID: <id>, so no rendering changes were needed.

       name: patient.name?.[0].family + ', ' + patient.name?.[0].given,
-      id: patient.id ?? '',
+      id: getPatientFriendlyId(patient),

This mirrors the exact pattern used in PR #7795 for sections/patientInfo.ts and sections/discharge-summary/patientInfo.ts (an unconditional swap of the existing, always-shown ID field).

Testing

  • No existing tests cover the Paperwork PDF's PID field, so none required updating.
  • getPatientFriendlyId is already exported from utils and imported the same way by the sibling PDF section files.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SsAo3ZztQLx47iBKXFA8t5


Generated by Claude Code

The Paperwork PDF was still rendering the raw FHIR Patient UUID in its
"PID:" field instead of the friendly patient identifier. PR #7795 moved
the other PDFs (discharge summary, visit note, progress note) onto the
friendly ID via getPatientFriendlyId(), but the Paperwork PDF was missed.

Swap patient.id for getPatientFriendlyId(patient) so it matches the rest
of the PDFs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants