Validation

Value Representation (VR) errors

Flag tag values that violate their Value Representation rules.

Problem

DICOM tags must conform to their declared Value Representation (VR) — a LO string can’t exceed 64 characters, a DA date must be 8 digits (YYYYMMDD), an IS integer can’t contain decimals, a DS decimal string can’t contain letters, and a UI UID can only contain digits and dots. When editing tags in the UI, VR format violations must be caught before saving to prevent writing invalid DICOM.

VR Validation Rules (All Tested)

VR TypeExample TagValidInvalid (Rejected)Error Message
LO (Long String)Patient ID (0010,0020)“ABC123”65-char stringVR validation error
PN (Person Name)Patient Name (0010,0010)“SMITH^JOHN”65-char stringVR validation error
DS (Decimal String)Slice Thickness (0018,0050)“3.5""three_point_five”VR validation error
IS (Integer String)Series Number (0020,0011)“45""10.5”, “SeriesOne""Must be a whole number (no decimals)” / “Must be a number”
DA (Date)Study Date (0008,0020)“20260607""2026/06/07”, “INVALID_DATE""Must be exactly 8 digits: YYYYMMDD”
TM (Time)Study Time (0008,0030)“231800""12 o-clock”VR validation error
UI (UID)SOP Class UID (0008,0016)“1.2.840.10008.5.1.4.1.1.2""1.2.840.10008.abc.1""UID: digits and dots only (max 64)“

Steps

  1. Open a file (⌘O) and switch to Edit mode (⌘3).

  2. Filter for the tag you want to test, double-click to open the edit modal.

  3. Enter an invalid value according to the table above.

  4. Verify the save button is disabled and a red validation error message appears.

  5. Cancel the modal to leave the original value intact.

Expected Result

  • All VR validation errors are caught client-side before saving.
  • The save button is disabled when validation fails.
  • A red error message (v-line bad) explains the expected format.
  • The original tag value is preserved after canceling.