Microbiology patient report — memo editor, indentation, spacing, antibiotic layout & configurable casing#22047
Conversation
… print view Align the investigation print name to the left (with an underline) instead of centering it, on the microbiology patient report print view.
Some memo results contain extra spaces between words for alignment, but HTML collapses consecutive spaces so they were lost in the printed output. Apply white-space: pre-wrap to the memo value blocks so the extra in-line spacing is preserved while long lines still wrap.
The microbiology memo result is entered through the Quill Text Editor, which collapses runs of ASCII spaces to a single space when it reloads the saved HTML, so extra spacing typed by the user was lost on the next edit. On save, convert the 2nd and each subsequent space of every run into a non-breaking space ( ), which Quill preserves on reload and which renders as an ordinary space in both the editor and the print view. Only rich-text (HTML) memo values are touched, so plain-textarea memos are left untouched, and the conversion is idempotent. Also force white-space: pre-wrap on the editor content so spaces show while typing.
Add a config option 'Microbiology Antibiotic Result Text Transform (uppercase/lowercase/capitalize/none)' (default uppercase) that controls the CSS text-transform applied to antibiotic sensitivity results on the microbiology report print view. The result value is lowercased before the transform is applied, so the 'capitalize' option renders a stored value such as 'SENSITIVE' as 'Sensitive' instead of leaving it fully upper-cased. The SENSITIVE bold-highlight still keys off the original stored value.
Change how antibiotics with results are laid out across the two columns on the microbiology report. Instead of the previous zig-zag (even index to column 1, odd index to column 2), sort the antibiotics alphabetically (A-Z, case-insensitive) by name, then fill the first column top-to-bottom with the first half (rounded up) and the rest into the second column, e.g. 11 -> 6 + 5, 12 -> 6 + 6.
… microbiology report Insert a centered ":" separator column between the antibiotic name and its result value, and adjust column widths (name 70%->61%, separator 2%->4%) so the layout stays aligned across all four report blocks.
…, script and align Add ordered/bullet list, indent (+/-), subscript/superscript and paragraph alignment controls to the microbiology memo Text Editor (Quill), and enable allowBlocks/allowStyles so the block-level formatting is retained on save.
…d print The memo Text Editor writes Quill ql-indent-* classes on indented blocks, but their padding is only defined by Quill's editor-scoped CSS and was further reset by the existing .micMemoValue paragraph reset, so indentation was lost in the preview/print. Add matching ql-indent-1..8 padding-left rules (3em per level) scoped to .micMemoValue.
WalkthroughMicrobiology report handling now preserves rich-text spacing and indentation, expands memo editing controls, sorts antibiotics alphabetically into balanced columns, and supports configurable antibiotic result casing and updated print layout. ChangesMicrobiology report updates
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant QuillEditor
participant PatientReportController
participant pirivFacade
participant MicrobiologyReport
QuillEditor->>PatientReportController: Submit formatted memo
PatientReportController->>PatientReportController: Preserve repeated spaces
PatientReportController->>pirivFacade: Save memo value
MicrobiologyReport->>MicrobiologyReport: Render whitespace and indentation
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.44.1)src/main/java/com/divudi/bean/lab/PatientInvestigationController.javaast-grep timed out on this file Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/main/webapp/lab/patient_report.xhtml`:
- Around line 592-596: Update the h:outputText rendering group.groupName to
remove escape="false" so the user-entered group name uses JSF’s default HTML
escaping; also rename its class attribute to styleClass while preserving the
existing h4 styling.
- Around line 504-512: Enable sanitization for the rich-text memo by changing
the secure setting on the txtMicMemoVal p:textEditor from false to true.
Preserve the existing editor behavior and value binding while ensuring raw HTML
cannot be stored through this input.
- Around line 504-544: Update the p:textEditor identified by id txtMicMemoVal to
use the styleClass attribute for its custom classes instead of class, preserving
the existing w-100, mt-1, and micMemoEditor class names so the wrapper receives
micMemoEditor and its white-space styling applies.
In `@src/main/webapp/resources/ezcomp/lab/microbiology_patient_report.xhtml`:
- Around line 105-107: Update the antibiotic result outputLabel rendering,
including the other antibiotic result cells, to use escaped output instead of
escape="false". Preserve the existing lowercase conversion, sensitivity styling,
and text-transform behavior while ensuring persisted free-text values cannot be
interpreted as HTML.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 67bbd779-7623-4c3d-bb7f-57f7ef323e86
📒 Files selected for processing (4)
src/main/java/com/divudi/bean/lab/PatientInvestigationController.javasrc/main/java/com/divudi/bean/lab/PatientReportController.javasrc/main/webapp/lab/patient_report.xhtmlsrc/main/webapp/resources/ezcomp/lab/microbiology_patient_report.xhtml
Microbiology patient report improvements
Target:
development.Closes #22045
Same set of changes shipped as a
coop-prodhotfix in #22046, ported todevelopmentso they are retained in future releases.What & why
A set of improvements to the Microbiology patient report (data entry, preview and print view): the rich-text memo editor, antibiotic result layout, spacing preservation, and configurable result casing.
Changes
1. Rich-text memo editor toolbar expanded
Added ordered/bullet list, indent (+/-), subscript/superscript and paragraph alignment controls to the microbiology memo Text Editor (Quill), and enabled
allowBlocks/allowStylesso block-level formatting is retained on save.2. Memo indentation preserved in preview & print
The editor writes Quill
ql-indent-*classes on indented blocks, but their padding was only defined by Quill's editor-scoped CSS and was reset by the existing.micMemoValueparagraph reset, so indentation was lost in preview/print. Added matchingql-indent-1..8padding-leftrules (3em per level) scoped to.micMemoValue.3. Preserve multiple spaces in the memo (editor + print)
Quill collapses runs of ASCII spaces on reload. On save, the 2nd and each subsequent space of every run is converted to
(idempotent, only for rich-text/HTML memos; plain-textarea memos untouched). Appliedwhite-space: pre-wrapon the editor content and the print memo blocks.4. Antibiotic result layout — colon separator + width tuning
Inserted a centered
:separator column between the antibiotic name and its result; adjusted widths (name 70% → 61%, separator 2% → 4%) to keep alignment across all four report blocks.5. Antibiotics sorted A–Z and split by half across columns
Replaced the zig-zag layout with an alphabetical (A–Z, case-insensitive) sort; the first column is filled top-to-bottom with the first half (rounded up), the rest into the second column (e.g. 11 → 6 + 5, 12 → 6 + 6).
6. Configurable antibiotic result text casing
Added config option
Microbiology Antibiotic Result Text Transform (uppercase/lowercase/capitalize/none)(defaultuppercase) controlling the CSStext-transformfor antibiotic sensitivity results on the print view. The value is lowercased before the transform socapitalizerendersSENSITIVEasSensitive; the SENSITIVE bold-highlight still keys off the original stored value.7. Print view — test name styling
Investigation print name left-aligned with an underline instead of centered.
Commits
style(lab): left-align and underline test name in microbiology report print viewfix(lab): preserve multiple spaces in microbiology report print viewfix(lab): preserve multiple spaces in microbiology memo Text Editorfeat(lab): make microbiology antibiotic result text casing configurablefeat(lab): sort microbiology antibiotics A-Z and split columns by halfstyle(lab): add colon separator between antibiotic name and result in microbiology reportfeat(lab): expand microbiology memo editor toolbar with lists, indent, script and alignfix(lab): preserve memo indentation in microbiology report preview and printFiles touched
src/main/java/com/divudi/bean/lab/PatientInvestigationController.javasrc/main/java/com/divudi/bean/lab/PatientReportController.javasrc/main/webapp/lab/patient_report.xhtmlpre-wrapsrc/main/webapp/resources/ezcomp/lab/microbiology_patient_report.xhtmlTesting notes
uppercase, preserving current behaviour).Related
Summary by CodeRabbit
New Features
Bug Fixes