Function: deidentify()
deidentify(
ds,options?):DeidentifyResult<Dataset>
De-identify a Dataset per PS3.15 Annex E - the Basic Application Level
Confidentiality Profile, plus any Retain/Clean Options passed in retain.
Pure: ds is never mutated. Returns a fresh dataset and a
DeidentifyReport of tags, keywords, action codes, warnings and the UID
map. Everything in it is composed from static tables except uidMap, whose
keys are the source UIDs the file carried: treat that field as PHI.
Parameters
ds
options?
DeidentifyOptions = {}
Returns
Throws
DeidentifyError (INVALID_OPTIONS) for an unknown Retain option
or a malformed uidRoot.
Example
import { parseDicom, deidentify, serializeDicom } from "@cosyte/dicom";
const { dataset, report } = deidentify(parseDicom(buf));
const clean = serializeDicom(dataset); // safe to share
console.log(report.attributes.length, "attributes acted on");