Watch Tool
Overview
Watch keeps a live table of HL7 paths for the message you have selected, and optionally shows a Liquid HTML preview of that message in a side panel (WebView).
Watch list — Path, Value, and Description update as you change or navigate messages.
WebView — Compact clinical-style HTML (message header, patient, observations) rendered from an HTML Liquid template pack.
Three lists — Switch among Watch 1, Watch 2, and Watch 3 for different path sets.
At a glance
Open from Tools → Watch, or use Ctrl+W / Ctrl+Shift+W / Watch Field
Left: watch-list grid · Right: Liquid HTML WebView (when WebView is on)
Templates on the Watch toolbar manages HTML packs used by the preview
Built-in HTML is read-only — Edit or Clone creates a writable copy
Not the same as Watch Folder (auto-load files from a folder) or the full Templates tool
Opening Watch
Open an HL7 v2 message tab and select a message.
Show Watch from the Tools menu (Show/Hide Tools), or:
Ctrl+W (with the message editor active) — show Watch
Ctrl+Shift+W — show Watch and add the currently selected field
Ribbon Watch Field — add the selected field and show Watch
Watch docks like other tools. HL7Spy remembers your WebView on/off preference and which HTML pack you last used.
Layout
Area | What it shows |
|---|---|
Watch list (left) | Editable list of HL7 paths with live Value and Description |
WebView (right) | Liquid → HTML preview of the selected message (not of the watch-list rows) |
Use the WebView toolbar toggle to show or hide the preview panel. When hidden, the watch list uses the full width.
Tip
The HTML preview follows the message selected in your current HL7 message tab. Changing which paths you watch does not change the HTML layout unless you customize the template pack.
Watch lists
Columns
Column | Purpose |
|---|---|
Path | HL7 path to watch (for example |
Value | Current value for that path in the selected message (read-only in the grid) |
Description | Description of the path |
You can type a new path in the empty row at the bottom of the grid. Selecting a row syncs the path with the message editor when possible. Press Delete to remove selected rows.
Adding paths
Method | Result |
|---|---|
Add on the Watch toolbar | Adds the field currently selected in the HL7 editor |
Watch Field / Ctrl+Shift+W | Adds the selection and shows Watch |
Editor context menu | Add Segment Fields / Components to Watch List when a segment is selected |
Type in the new-item row | Enter a path directly |
Watch 1 / 2 / 3
Three independent lists. Switching lists loads that set of paths. Watch 1 is seeded with MSH-9 and PID-5 by default for new users.
Decode and Highlight
Toggle | What it does |
|---|---|
Decode | Formats values such as dates/times into a more readable form in the Value column |
Highlight | Highlights watched paths in the HL7 message editor |
Save, undo, import, export
Action | What it does |
|---|---|
Save (Ctrl+S in Watch) | Persist the current watch list |
Undo | Restore the last saved list |
File → Import Watch List | Load a |
File → Export Watch List | Save the current list as |
File → Clear Watch List | Clear all rows in the active list |
Drag-and-drop a | Import that list |
Toolbar reference
Control | What it does |
|---|---|
File | Save, Undo, Import/Export Watch List, Clear |
Save | Save the current Watch List settings |
Add | Add the currently selected field from the HL7 editor |
Undo | Undo the previous operation |
Up / Down | Reorder the selected watch item |
Decode | Decode HL7 values (for example date/time) in the Value column |
Highlight | Highlight Watch List fields in the HL7 editor |
Watch 1 / 2 / 3 | Switch among three watch lists |
Export | Generate a Watch List report to Excel across messages |
Report | Generate a Watch List report to various formats |
WebView | Show or hide the Liquid HTML preview panel |
Templates | Manage HTML Liquid template packs used by Watch |
Help | This page |
HTML preview (WebView)
When WebView is on, Watch renders the selected message with an HTML Liquid template pack (default: Built-in HTML) and displays the result in a WebView2 panel.
How the preview updates
You select a message (or the selection changes).
Watch activates the current HTML pack (
HtmlPackId, falling back to Built-in HTML).The pack picks a root template: first matching enabled rule, otherwise
_default.Liquid renders HTML; Watch navigates the WebView to that HTML.
Zoom tracks the message editor font size; colors follow the application dark/light theme.
Note
Watch shows only the rendered WebView. Unlike the Templates tool, there is no separate Html source tab in Watch.
Built-in HTML layout
The built-in pack is meant for a quick scan of the selected message. Sample rules vary the preview by message type:
Condition | Preview |
|---|---|
ADT^A18 | Surviving patient (PID / PV1) plus prior / merged patient fields from MRG |
ADT^A08 | Same patient sections with an alternate “Patient update” stylesheet |
Anything else | Default compact clinical layout |
Message
Type, Time, Control ID, From, To, Version (from MSH)
Patient (when PID / PV1 are present)
MRN, Name, Sex, DOB, Age (from PID)
Admit (when present), Class, Location, Attending / Referring (when present), Visit # (from PV1)
Observations (when order groups are present)
One block per order group: accession / order fields from OBR, then a table of OBX results (#, ID, Value, Units, Status)
OBX Value uses
format_obx_valueso most types show the full OBX-5 text; ED shows a short summary plus a truncated data preview; leading empty CE components (for example comment-style^text…) omit the leading^
Requirements
Microsoft WebView2 runtime must be available on the machine.
If WebView2 fails to initialize, HL7Spy shows a warning, turns WebView off, and saves that preference.
Managing HTML templates
Click Templates on the Watch toolbar to open Manage Templates. Watch lists HTML packs only (the same store as the Templates tool; FHIR packs are not shown here).
Action | What it does |
|---|---|
Open | Activate the selected pack for Watch’s HTML preview |
Edit | Open the template editor. Built-in HTML opens a writable local copy (for example |
Clone | Create an editable copy of the selected pack under a new name |
Import | Import a pack from |
Export | Export the selected pack as |
Delete | Delete a writable pack (cannot delete Built-in HTML) |
Double-click a pack (or press Enter) to Open it.
Built-in packs are read-only
You cannot save changes into Built-in HTML. Use Edit (local user copy) or Clone, then customize Liquid files and rules.
How a template is chosen
Rules are evaluated top to bottom.
The first enabled rule whose Condition matches the current message wins (for example
MSH-9.1 = 'ADT' AND MSH-9.2 = 'A18').If nothing matches,
_defaultis used.
Other files under templates/ (for example msh, pid, pv1, order-group, styles) are includes — they are never chosen as the root by themselves.
When the editor opens, the pack README.md (if present) is shown first as a Markdown overview.
Customize the Watch HTML preview
In Watch, click Templates.
Select Built-in HTML → Edit or Clone.
Read the pack README in the editor.
Adjust
_default, add conditioned Rules, or edit includes (msh,pid,pv1,order-group, and so on).Save. Watch reloads the pack and refreshes the WebView for the selected message.
Share a pack
Templates → Export and save the
.nupkg.On another machine: Templates → Import and select the file, then Open it in Watch.
Liquid helpers for HTML preview
HTML packs use ordinary Liquid plus HL7Spy filters. Common path filters:
Filter | What it returns | Example |
|---|---|---|
| Raw field value |
|
| Name components joined with commas |
|
| Readable date (optional .NET format) |
|
| Whole years from a DOB path |
|
| Schema description for a coded value |
|
| Result of an HL7Spy expression |
|
| OBX-5 display text from an OBX segment (full value; ED summary + optional truncated data preview). Pass a max length for the ED data preview (default 100). |
|
Message structure example (order groups):
{%- for group in hl7v2Data.OrderGroups -%}
{%- for obr in group.OBRs -%}
{{ obr.4.Value }}
{%- endfor -%}
{%- for obx in group.OBXs -%}
{{ obx.3.Value }} = {{ obx | format_obx_value: 100 }}
{%- endfor -%}
{%- endfor -%}Host functions can also be called with {% fn … %} or | fn: (for example {% fn format_name "PID-5" %}). See the Built-in HTML pack README in the template editor for the full filter and function list.
Reports
Button | What it does |
|---|---|
Report | Build a multi-format report of the fields in the current Watch List across messages |
Export | Generate a Watch List report to Excel |
These use the watch-list paths, not the HTML WebView layout.
Shortcuts
Shortcut | Action |
|---|---|
Ctrl+W | Show Watch (when the message editor is active) |
Ctrl+Shift+W | Show Watch and add the currently selected field |
Ctrl+S | Save the current watch list (when Watch is active) |
Delete | Remove selected watch-list rows |
Ctrl+F / Ctrl+G | Search / Goto (same pattern as other tools) |
Alt+Left / Alt+Right | Previous / next message |
Troubleshooting
Symptom | What to try |
|---|---|
WebView panel missing | Turn WebView on in the Watch toolbar. |
WebView turned itself off / warning on open | WebView2 failed to initialize. Install or repair the WebView2 runtime, restart HL7Spy, then turn WebView back on. |
Blank or unexpected HTML | Confirm a message is selected. Check which pack is active under Templates → Open. For Built-in HTML, try ADT^A08 / ADT^A18 samples vs a default ORU. |
Cannot edit Built-in HTML |