Skip to content

O3-5674: add visit notes section to visit summary PDF#30

Open
BlessedAmrita wants to merge 1 commit into
openmrs:mainfrom
BlessedAmrita:feat/O3-5674-visit-notes-section
Open

O3-5674: add visit notes section to visit summary PDF#30
BlessedAmrita wants to merge 1 commit into
openmrs:mainfrom
BlessedAmrita:feat/O3-5674-visit-notes-section

Conversation

@BlessedAmrita

Copy link
Copy Markdown
Contributor

Summary

Adds a VisitNotesSection to the visit summary PDF, showing the free-text clinical notes recorded during the visit. Follows the TypedSection architecture from #16

What this does

  • Emits one block per note, oldest-first, each with an encounter-datetime + provider provenance line above the narrative (linefeed preserved).
  • Note concept configurable via report.visitSummary.visitNotes.concept (default CIEL:162169), resolved by mapping so a non-CIEL deployment can retarget without touching Java.
  • Provider resolution prefers the configured clinician role and falls back to the first provider on the encounter; "Unknown" only when the encounter has none — matching how the O3 notes page attributes authorship.
  • Failure handling: Unresolvable note concept -> section-error. Unresolvable clinician-role config -> section-notice, notes still render. Note obs with no text -> placeholder + warn, provenance kept. Genuine absence -> "None recorded".
    No path silently drops a note.

Scope decision

Visit-scoped: notes recorded under this visit's non-voided encounters, not the patient's note history — same encounter filter as Vitals/Diagnoses. Narrative only;

Testing

17 new integration tests (multi-note ordering, empty states, blank-value placeholder, missing/other-role provider, unresolvable-concept error, voided exclusion, XML structure); full suite green. Verified end-to-end by rendering sample XML through the production FOP config — which surfaced a missing section-notice hook in the stylesheet, now fixed.

Related

Ticket: https://openmrs.atlassian.net/browse/O3-5674

@sonarqubecloud

Copy link
Copy Markdown

@BlessedAmrita

Copy link
Copy Markdown
Contributor Author

cc: @wikumChamith @dkayiwa

@dkayiwa

dkayiwa commented Jul 17, 2026

Copy link
Copy Markdown
Member

@claude review

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