Skip to content

Microbiology patient report — memo editor, indentation, spacing, antibiotic layout & configurable casing#22047

Merged
damithdeshan98 merged 8 commits into
developmentfrom
microbiology-report-improvements
Jul 12, 2026
Merged

Microbiology patient report — memo editor, indentation, spacing, antibiotic layout & configurable casing#22047
damithdeshan98 merged 8 commits into
developmentfrom
microbiology-report-improvements

Conversation

@damithdeshan98

@damithdeshan98 damithdeshan98 commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Microbiology patient report improvements

Target: development.

Closes #22045

Same set of changes shipped as a coop-prod hotfix in #22046, ported to development so 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/allowStyles so 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 .micMemoValue paragraph reset, so indentation was lost in preview/print. Added matching ql-indent-1..8 padding-left rules (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). Applied white-space: pre-wrap on 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) (default uppercase) controlling the CSS text-transform for antibiotic sensitivity results on the print view. The value is lowercased before the transform so capitalize renders SENSITIVE as Sensitive; 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 view
  • fix(lab): preserve multiple spaces in microbiology report print view
  • fix(lab): preserve multiple spaces in microbiology memo Text Editor
  • feat(lab): make microbiology antibiotic result text casing configurable
  • feat(lab): sort microbiology antibiotics A-Z and split columns by half
  • style(lab): add colon separator between antibiotic name and result in microbiology report
  • feat(lab): expand microbiology memo editor toolbar with lists, indent, script and align
  • fix(lab): preserve memo indentation in microbiology report preview and print

Files touched

File Change
src/main/java/com/divudi/bean/lab/PatientInvestigationController.java Antibiotic A–Z sort + half-split column fill
src/main/java/com/divudi/bean/lab/PatientReportController.java Preserve multiple spaces in rich-text memo on save
src/main/webapp/lab/patient_report.xhtml Editor toolbar expansion + pre-wrap
src/main/webapp/resources/ezcomp/lab/microbiology_patient_report.xhtml Indent CSS, colon separator, casing config, spacing, name styling

Testing notes

  • Mostly JSF/XHTML changes plus two small controller-level Java changes; no schema changes.
  • The casing behaviour is driven by an application config option (default uppercase, preserving current behaviour).

Related

Summary by CodeRabbit

  • New Features

    • Microbiology antibiotic results are now sorted alphabetically and distributed evenly across two columns.
    • Antibiotic result text supports configurable capitalization styles.
    • Microbiology memo fields provide expanded formatting options.
  • Bug Fixes

    • Preserved consecutive spaces and indentation in microbiology memos when editing, saving, and viewing reports.
    • Improved spacing and separator formatting in antibiotic result displays.

… 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.
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Microbiology 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.

Changes

Microbiology report updates

Layer / File(s) Summary
Rich-text memo formatting and editing
src/main/java/com/divudi/bean/lab/PatientReportController.java, src/main/webapp/lab/patient_report.xhtml, src/main/webapp/resources/ezcomp/lab/microbiology_patient_report.xhtml
Rich-text memo values preserve repeated spaces during save, while editor and report styles preserve whitespace and indentation. The microbiology editor toolbar and grouped antibiotic inputs are updated.
Antibiotic ordering and report presentation
src/main/java/com/divudi/bean/lab/PatientInvestigationController.java, src/main/webapp/resources/ezcomp/lab/microbiology_patient_report.xhtml
Antibiotics are sorted case-insensitively and split into first-half and second-half columns. Report rows add colon separators, configurable text casing, and revised investigation-name styling.

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
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main microbiology report changes: memo editor, spacing, antibiotic layout, and casing.
Linked Issues check ✅ Passed The changes cover the requested memo formatting, spacing, indentation, antibiotic layout, sorting, casing, and print styling.
Out of Scope Changes check ✅ Passed The touched files and edits all support the microbiology patient report hotfix scope, with no clear unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch microbiology-report-improvements

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.java

ast-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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between c538935 and a3340b3.

📒 Files selected for processing (4)
  • src/main/java/com/divudi/bean/lab/PatientInvestigationController.java
  • src/main/java/com/divudi/bean/lab/PatientReportController.java
  • src/main/webapp/lab/patient_report.xhtml
  • src/main/webapp/resources/ezcomp/lab/microbiology_patient_report.xhtml

Comment thread src/main/webapp/lab/patient_report.xhtml
Comment thread src/main/webapp/lab/patient_report.xhtml
Comment thread src/main/webapp/lab/patient_report.xhtml
@damithdeshan98 damithdeshan98 merged commit 4018c80 into development Jul 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Lab Microbiology Microbiology Reports

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Microbiology patient report: memo rich-text editor, indentation, spacing, antibiotic layout & configurable casing

1 participant