Skip to content

Add HL7 message comparison (field-level diff) - #1

Merged
klauseduard merged 3 commits into
mainfrom
feature/message-compare
Feb 25, 2026
Merged

Add HL7 message comparison (field-level diff)#1
klauseduard merged 3 commits into
mainfrom
feature/message-compare

Conversation

@klauseduard

Copy link
Copy Markdown
Owner

Summary

  • Field-level diff across all interfaces: web viewer Compare tab, CLI --diff flag, and MCP hl7_diff tool
  • Character-level highlighting on modified fields — pinpoints the exact changed characters (e.g. a single digit in a timestamp), with smart truncation that keeps the diff region visible in long values
  • Core diff engine in hl7view/diff.py with 21 new tests (63 total, all passing)

What's included

Interface Usage
Web viewer Parse message A, switch to Compare tab, paste/open message B, click Compare
CLI hl7view file1.hl7 file2.hl7 --diff (add -e to include identical fields)
MCP hl7_diff(message_a, message_b) returns structured JSON diff

Test plan

  • venv/bin/pytest tests/ -v — 63 tests pass
  • CLI diff output verified with sample messages
  • Web viewer Compare tab tested via Playwright: summary bar, diff table, detail panel with component breakdown, character-level highlighting, Reset button
  • Manual browser testing for UX validation before merge

🤖 Generated with Claude Code

Klaus-Eduard Runnel and others added 3 commits February 26, 2026 01:14
Compare two HL7 messages field-by-field with named addresses and status
indicators (modified/A-only/B-only). Implemented across all interfaces:
core diff module with 21 tests, CLI --diff flag, MCP hl7_diff tool,
and web viewer Compare tab with summary bar, filter toggle, and
side-by-side component breakdown in the detail panel.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The collapsed input area after comparing was only clearable via the
small toolbar indicator. Now there's a visible Reset button in the
summary bar to clear the comparison and return to the input area.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Highlight the exact changed characters within modified field values
using smart truncation that keeps the diff region visible even in
long values. Applied in the web diff table, detail panel (raw +
component breakdown), and CLI terminal output (ANSI inverse).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@klauseduard
klauseduard merged commit 01907f6 into main Feb 25, 2026
1 check passed
@klauseduard
klauseduard deleted the feature/message-compare branch February 25, 2026 23:44
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.

1 participant