dcmjs 0.24.10 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/build/dcmjs.es.js +24 -8
- package/build/dcmjs.es.js.map +1 -1
- package/build/dcmjs.js +24 -8
- package/build/dcmjs.js.map +1 -1
- package/package.json +1 -1
- package/test/anonymizer.test.js +80 -1
package/README.md
CHANGED
|
@@ -68,7 +68,7 @@ npm run build
|
|
|
68
68
|
npm test
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
## For Maintainers
|
|
71
|
+
## For Maintainers and Contributors
|
|
72
72
|
|
|
73
73
|
Publish new version automatically from commit:
|
|
74
74
|
|
|
@@ -79,6 +79,9 @@ Use the following "Commit Message Format" when drafting commit messages. If you'
|
|
|
79
79
|
Note: Be wary of `BREAKING_CHANGE` in commit message descriptions, as this can force a major version bump.
|
|
80
80
|
|
|
81
81
|
Be sure to use lower case for the first letter of your semantic commit message, so use `fix` not `Fix` or `feat` not `Feat`.
|
|
82
|
+
|
|
83
|
+
### Optional Tooling
|
|
84
|
+
|
|
82
85
|
It is advised to use the git-cz, i.e.:
|
|
83
86
|
|
|
84
87
|
- install git-cz
|
package/build/dcmjs.es.js
CHANGED
|
@@ -17557,6 +17557,10 @@ var NumContentItem = /*#__PURE__*/function (_ContentItem8) {
|
|
|
17557
17557
|
throw new Error("Option 'unit' is required for NumContentItem with 'value'.");
|
|
17558
17558
|
}
|
|
17559
17559
|
|
|
17560
|
+
if (options.unit.constructor !== CodedConcept) {
|
|
17561
|
+
throw new Error("Option 'unit' must have type CodedConcept.");
|
|
17562
|
+
}
|
|
17563
|
+
|
|
17560
17564
|
var item = {};
|
|
17561
17565
|
item.NumericValue = options.value;
|
|
17562
17566
|
|
|
@@ -17564,7 +17568,7 @@ var NumContentItem = /*#__PURE__*/function (_ContentItem8) {
|
|
|
17564
17568
|
item.FloatingPointValue = options.value;
|
|
17565
17569
|
}
|
|
17566
17570
|
|
|
17567
|
-
item.MeasurementUnitsCodeSequence = options.unit;
|
|
17571
|
+
item.MeasurementUnitsCodeSequence = [options.unit];
|
|
17568
17572
|
_this8.MeasuredValueSequence = [item];
|
|
17569
17573
|
} else if (options.qualifier !== undefined) {
|
|
17570
17574
|
if (!(options.qualifier || options.qualifier.constructor === CodedConcept)) {
|
|
@@ -20405,8 +20409,22 @@ var tagNamesToEmpty = [// please override these in specificReplaceDefaults to ha
|
|
|
20405
20409
|
"AcquisitionDate", "OverlayDate", "CurveDate", "AcquisitionDatetime", "SeriesTime", "AcquisitionTime", "OverlayTime", "CurveTime", "InstitutionName", "InstitutionAddress", "ReferringPhysicianAddress", "ReferringPhysicianPhoneNumbers", "ReferringPhysiciansIDSeq", "TimezoneOffsetFromUTC", "StationName", "StudyDescription", "InstitutionalDepartmentName", "PhysicianOfRecord", "PhysicianOfRecordIdSeq", "PerformingPhysicianName", "PerformingPhysicianIdSeq", "NameOfPhysicianReadingStudy", "PhysicianReadingStudyIdSeq", "OperatorName", "OperatorsIdentificationSeq", "AdmittingDiagnosisDescription", "AdmittingDiagnosisCodeSeq", "RefStudySeq", "RefPPSSeq", "RefPatientSeq", "RefImageSeq", "DerivationDescription", "SourceImageSeq", "IdentifyingComments", "IssuerOfPatientID", "PatientBirthTime", "PatientInsurancePlanCodeSeq", "PatientPrimaryLanguageCodeSeq", "PatientPrimaryLanguageModifierCodeSeq", "OtherPatientIDs", "OtherPatientNames", "OtherPatientIDsSeq", "PatientBirthName", "PatientAge", "PatientSize", "PatientWeight", "PatientAddress", "InsurancePlanIdentification", "PatientMotherBirthName", "MilitaryRank", "BranchOfService", "MedicalRecordLocator", "MedicalAlerts", "ContrastAllergies", "CountryOfResidence", "RegionOfResidence", "PatientPhoneNumbers", "EthnicGroup", "Occupation", "SmokingStatus", "AdditionalPatientHistory", "PregnancyStatus", "LastMenstrualDate", "PatientReligiousPreference", "PatientSexNeutered", "ResponsiblePerson", "ResponsibleOrganization", "PatientComments", "DeviceSerialNumber", "PlateID", "GeneratorID", "CassetteID", "GantryID", // we keep - should be SoftwareVersions anyway
|
|
20406
20410
|
// "SoftwareVersion",
|
|
20407
20411
|
"ProtocolName", "AcquisitionDeviceProcessingDescription", "AcquisitionComments", "DetectorID", "AcquisitionProtocolDescription", "ContributionDescription", "ModifyingDeviceID", "ModifyingDeviceManufacturer", "ModifiedImageDescription", "ImageComments", "ImagePresentationComments", "StudyIDIssuer", "ScheduledStudyLocation", "ScheduledStudyLocationAET", "ReasonforStudy", "RequestingPhysician", "RequestingService", "RequestedProcedureDescription", "RequestedContrastAgent", "StudyComments", "AdmissionID", "IssuerOfAdmissionID", "ScheduledPatientInstitutionResidence", "AdmittingDate", "AdmittingTime", "DischargeDiagnosisDescription", "SpecialNeeds", "ServiceEpisodeID", "IssuerOfServiceEpisodeId", "ServiceEpisodeDescription", "CurrentPatientLocation", "PatientInstitutionResidence", "PatientState", "ReferencedPatientAliasSeq", "VisitComments", "ScheduledStationAET", "ScheduledPerformingPhysicianName", "SPSDescription", "ScheduledStationName", "SPSLocation", "PreMedication", "PerformedStationAET", "PerformedStationName", "PerformedLocation", "PerformedStationNameCodeSeq", "PPSID", "PPSDescription", "RequestAttributesSeq", "PPSComments", "AcquisitionContextSeq", "PatientTransportArrangements", "RequestedProcedureLocation", "NamesOfIntendedRecipientsOfResults", "IntendedRecipientsOfResultsIDSequence", "PersonAddress", "PersonTelephoneNumbers", "RequestedProcedureComments", "ReasonForTheImagingServiceRequest", "OrderEnteredBy", "OrderEntererLocation", "OrderCallbackPhoneNumber", "ImagingServiceRequestComments", "ConfidentialityPatientData", "ScheduledStationNameCodeSeq", "ScheduledStationGeographicLocCodeSeq", "PerformedStationGeoLocCodeSeq", "ScheduledHumanPerformersSeq", "ActualHumanPerformersSequence", "HumanPerformersOrganization", "HumanPerformersName", "VerifyingOrganization", "VerifyingObserverName", "AuthorObserverSequence", "ParticipantSequence", "CustodialOrganizationSeq", "VerifyingObserverIdentificationCodeSeq", "PersonName", "ContentSeq", "OverlayData", "OverlayComments", "IconImageSequence", "TopicSubject", "TopicAuthor", "TopicKeyWords", "TextString", "Arbitrary", "TextComments", "ResultsIDIssuer", "InterpretationRecorder", "InterpretationTranscriber", "InterpretationText", "InterpretationAuthor", "InterpretationApproverSequence", "PhysicianApprovingInterpretation", "InterpretationDiagnosisDescription", "ResultsDistributionListSeq", "DistributionName", "DistributionAddress", "InterpretationIdIssuer", "Impressions", "ResultComments", "DigitalSignaturesSeq", "DataSetTrailingPadding"];
|
|
20412
|
+
function getTagsNameToEmpty() {
|
|
20413
|
+
return [].concat(tagNamesToEmpty);
|
|
20414
|
+
}
|
|
20408
20415
|
function cleanTags(dict) {
|
|
20409
|
-
|
|
20416
|
+
var tagNamesToReplace = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
20417
|
+
var customTagNamesToEmpty = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
20418
|
+
|
|
20419
|
+
if (tagNamesToReplace == undefined) {
|
|
20420
|
+
tagNamesToReplace = {
|
|
20421
|
+
"00100010": "ANON^PATIENT",
|
|
20422
|
+
"00100020": "ANON^ID"
|
|
20423
|
+
};
|
|
20424
|
+
}
|
|
20425
|
+
|
|
20426
|
+
var tags = customTagNamesToEmpty != undefined ? customTagNamesToEmpty : tagNamesToEmpty;
|
|
20427
|
+
tags.forEach(function (tag) {
|
|
20410
20428
|
var tagInfo = DicomMetaDictionary.nameMap[tag];
|
|
20411
20429
|
|
|
20412
20430
|
if (tagInfo && tagInfo.version != "PrivateTag") {
|
|
@@ -20414,13 +20432,10 @@ function cleanTags(dict) {
|
|
|
20414
20432
|
tagString = Tag.fromPString(tagNumber).toCleanString();
|
|
20415
20433
|
|
|
20416
20434
|
if (dict[tagString]) {
|
|
20417
|
-
log.log("empty tag " + tag);
|
|
20418
20435
|
var newValue;
|
|
20419
20436
|
|
|
20420
|
-
if (tagString
|
|
20421
|
-
newValue = [
|
|
20422
|
-
} else if (tagString == "00100020") {
|
|
20423
|
-
newValue = ["ANONID"];
|
|
20437
|
+
if (tagString in tagNamesToReplace) {
|
|
20438
|
+
newValue = [tagNamesToReplace[tagString]];
|
|
20424
20439
|
} else {
|
|
20425
20440
|
newValue = [];
|
|
20426
20441
|
}
|
|
@@ -20466,7 +20481,8 @@ var normalizers = {
|
|
|
20466
20481
|
DSRNormalizer: DSRNormalizer
|
|
20467
20482
|
};
|
|
20468
20483
|
var anonymizer = {
|
|
20469
|
-
cleanTags: cleanTags
|
|
20484
|
+
cleanTags: cleanTags,
|
|
20485
|
+
getTagsNameToEmpty: getTagsNameToEmpty
|
|
20470
20486
|
};
|
|
20471
20487
|
var dcmjs = {
|
|
20472
20488
|
DICOMWEB: DICOMWEB,
|