Open
Description
🐛 Bug Report
Reproduction Steps
- Draw one or more ROIs in the Slim viewer (each gets a generated
roi.uid
). - Click on
Save ROI
in SlideViewer which callshandleReportGeneration()
- Observe console error:

Uncaught Error: Option 'trackingIdentifier' must include a human readable tracking identifier and a tracking unique identifier.
console.log(trackingIdentifier)
shows an array of three entries:[ { "uid": "…", "identifier": "ROI #1" }, ← raw options object { /* TextContentItem for identifier */ }, { /* UIDRefContentItem for uid */ } ]
What’s Happening
As you can see in the above image. In templates.js (in the dcmjs-sr-templates ), at line 904 the length of array TrackingIdentifier
is expected to be 2:
if (options.trackingIdentifier.length !== 2) {
throw new Error(
"Option 'trackingIdentifier' must include a human readable tracking " +
"identifier and a tracking unique identifier."
);
}
and the source of error lies in same templates.js (in the dcmjs-sr-templates ), at line 1556
1554 class TrackingIdentifier extends Template {
1555 constructor(options) {
1556 super(options); // <-- pushes the raw options object into `this`
1557 // …then pushes the two ContentItems…
}
Because Template
extends an array, super(options)
adds the plain {uid, identifier}
object as the first sequence item. Downstream code expects exactly two items (TEXT + UIDREF), so it throws.
Expected Behavior
-
TrackingIdentifier
should only produce:- A
TextContentItem
(ifoptions.identifier
is provided) - A
UIDRefContentItem
(foroptions.uid
)
- A
-
No extra plain-object entry should appear.
Proposed Fix
In templates.js, change:
- constructor(options) {
- super(options);
+ constructor(options) {
+ super();
after implementing this change, the issue was resolved.
Metadata
Metadata
Assignees
Labels
No labels