Skip to main content
Version: v0.0.3

Function: makeUidRemapper()

makeUidRemapper(root?, cache?): UidRemapper

Build a UidRemapper rooted at root, optionally seeded with (and writing through to) a caller-owned cache for cross-call sharing.

Parameters

root?

string = DEFAULT_UID_ROOT

Dotted-decimal UID root (default DEFAULT_UID_ROOT).

cache?

Map<string, string> = ...

Source→replacement map to fill (default a fresh Map).

Returns

UidRemapper

Throws

when root is not a valid dotted-decimal OID prefix or leaves no room for a value component within the 64-char UID limit.

Example

import { makeUidRemapper } from "@cosyte/dicom";
const remap = makeUidRemapper();
remap.map("1.2.840.113619.2.55.3") === remap.map("1.2.840.113619.2.55.3"); // true