dicom-curate 0.40.7 → 0.41.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.
@@ -86048,7 +86048,7 @@ function getCsvMapping(columnMappings, mapping, mappingKey, value) {
86048
86048
  // src/getParser.ts
86049
86049
  var FILEBASENAME = Symbol("fileBasename");
86050
86050
  var FILENAME = Symbol("filename");
86051
- function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOptions, columnMappings, additionalData) {
86051
+ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOptions, columnMappings, additionalData, naturalMetaData) {
86052
86052
  function protectUid2(uid) {
86053
86053
  let protectedUid = uid;
86054
86054
  if (dicomPS315EOptions !== "Off") {
@@ -86094,6 +86094,15 @@ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOpti
86094
86094
  };
86095
86095
  })()
86096
86096
  );
86097
+ function getMetaDicom(attrName) {
86098
+ if (!naturalMetaData)
86099
+ return void 0;
86100
+ if (attrName in data.DicomMetaDictionary.dictionary) {
86101
+ attrName = data.DicomMetaDictionary.dictionary[attrName].name;
86102
+ }
86103
+ const value = (0, import_lodash2.get)(naturalMetaData, attrName);
86104
+ return typeof value === "string" ? value : void 0;
86105
+ }
86097
86106
  function missingDicom(attrName) {
86098
86107
  const value = getDicom(attrName);
86099
86108
  return typeof value === "undefined" || value === "";
@@ -86103,6 +86112,7 @@ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOpti
86103
86112
  getFilePathComp,
86104
86113
  getMapping,
86105
86114
  getDicom,
86115
+ getMetaDicom,
86106
86116
  missingDicom,
86107
86117
  protectUid: protectUid2,
86108
86118
  // TODO: Phase this out in favor of ISO8601 duration handling.
@@ -86151,6 +86161,7 @@ function collectMappings(inputFilePath, dicomData, mappingOptions) {
86151
86161
  const naturalData = data.DicomMetaDictionary.naturalizeDataset(
86152
86162
  dicomData.dict
86153
86163
  );
86164
+ const naturalMetaData = dicomData.meta ? data.DicomMetaDictionary.naturalizeDataset(dicomData.meta) : void 0;
86154
86165
  mapResults.sourceInstanceUID = naturalData.SOPInstanceUID;
86155
86166
  const finalSpec = composeSpecs(mappingOptions.curationSpec());
86156
86167
  const parser = getParser(
@@ -86159,12 +86170,18 @@ function collectMappings(inputFilePath, dicomData, mappingOptions) {
86159
86170
  naturalData,
86160
86171
  finalSpec.dicomPS315EOptions,
86161
86172
  mappingOptions.columnMappings,
86162
- finalSpec.additionalData
86173
+ finalSpec.additionalData,
86174
+ naturalMetaData
86163
86175
  );
86164
86176
  let preExcludeError;
86165
86177
  try {
86166
86178
  if (finalSpec.preExclude?.(parser)) {
86167
86179
  mapResults.excluded = "pre";
86180
+ if (!mappingOptions.skipWrite) {
86181
+ mapResults.anomalies.push(
86182
+ `Skipped pre-excluded file: ${parser.getFilePathComp(parser.FILENAME)}`
86183
+ );
86184
+ }
86168
86185
  return [naturalData, mapResults];
86169
86186
  }
86170
86187
  } catch (e4) {
@@ -86233,6 +86250,11 @@ function collectMappings(inputFilePath, dicomData, mappingOptions) {
86233
86250
  outputFilePath: mapResults.outputFilePath
86234
86251
  })) {
86235
86252
  mapResults.excluded = "post";
86253
+ if (!mappingOptions.skipWrite) {
86254
+ mapResults.anomalies.push(
86255
+ `Skipped post-excluded file: ${parser.getFilePathComp(parser.FILENAME)}`
86256
+ );
86257
+ }
86236
86258
  return [naturalData, mapResults];
86237
86259
  }
86238
86260
  } catch (e4) {
@@ -34112,7 +34112,7 @@ function getCsvMapping(columnMappings, mapping, mappingKey, value) {
34112
34112
  // src/getParser.ts
34113
34113
  var FILEBASENAME = Symbol("fileBasename");
34114
34114
  var FILENAME = Symbol("filename");
34115
- function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOptions, columnMappings, additionalData) {
34115
+ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOptions, columnMappings, additionalData, naturalMetaData) {
34116
34116
  function protectUid2(uid) {
34117
34117
  let protectedUid = uid;
34118
34118
  if (dicomPS315EOptions !== "Off") {
@@ -34158,6 +34158,15 @@ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOpti
34158
34158
  };
34159
34159
  })()
34160
34160
  );
34161
+ function getMetaDicom(attrName) {
34162
+ if (!naturalMetaData)
34163
+ return void 0;
34164
+ if (attrName in data.DicomMetaDictionary.dictionary) {
34165
+ attrName = data.DicomMetaDictionary.dictionary[attrName].name;
34166
+ }
34167
+ const value = (0, import_lodash2.get)(naturalMetaData, attrName);
34168
+ return typeof value === "string" ? value : void 0;
34169
+ }
34161
34170
  function missingDicom(attrName) {
34162
34171
  const value = getDicom(attrName);
34163
34172
  return typeof value === "undefined" || value === "";
@@ -34167,6 +34176,7 @@ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOpti
34167
34176
  getFilePathComp,
34168
34177
  getMapping,
34169
34178
  getDicom,
34179
+ getMetaDicom,
34170
34180
  missingDicom,
34171
34181
  protectUid: protectUid2,
34172
34182
  // TODO: Phase this out in favor of ISO8601 duration handling.
@@ -34215,6 +34225,7 @@ function collectMappings(inputFilePath, dicomData, mappingOptions) {
34215
34225
  const naturalData = data.DicomMetaDictionary.naturalizeDataset(
34216
34226
  dicomData.dict
34217
34227
  );
34228
+ const naturalMetaData = dicomData.meta ? data.DicomMetaDictionary.naturalizeDataset(dicomData.meta) : void 0;
34218
34229
  mapResults.sourceInstanceUID = naturalData.SOPInstanceUID;
34219
34230
  const finalSpec = composeSpecs(mappingOptions.curationSpec());
34220
34231
  const parser = getParser(
@@ -34223,12 +34234,18 @@ function collectMappings(inputFilePath, dicomData, mappingOptions) {
34223
34234
  naturalData,
34224
34235
  finalSpec.dicomPS315EOptions,
34225
34236
  mappingOptions.columnMappings,
34226
- finalSpec.additionalData
34237
+ finalSpec.additionalData,
34238
+ naturalMetaData
34227
34239
  );
34228
34240
  let preExcludeError;
34229
34241
  try {
34230
34242
  if (finalSpec.preExclude?.(parser)) {
34231
34243
  mapResults.excluded = "pre";
34244
+ if (!mappingOptions.skipWrite) {
34245
+ mapResults.anomalies.push(
34246
+ `Skipped pre-excluded file: ${parser.getFilePathComp(parser.FILENAME)}`
34247
+ );
34248
+ }
34232
34249
  return [naturalData, mapResults];
34233
34250
  }
34234
34251
  } catch (e) {
@@ -34297,6 +34314,11 @@ function collectMappings(inputFilePath, dicomData, mappingOptions) {
34297
34314
  outputFilePath: mapResults.outputFilePath
34298
34315
  })) {
34299
34316
  mapResults.excluded = "post";
34317
+ if (!mappingOptions.skipWrite) {
34318
+ mapResults.anomalies.push(
34319
+ `Skipped post-excluded file: ${parser.getFilePathComp(parser.FILENAME)}`
34320
+ );
34321
+ }
34300
34322
  return [naturalData, mapResults];
34301
34323
  }
34302
34324
  } catch (e) {
@@ -34129,7 +34129,7 @@ function getCsvMapping(columnMappings, mapping, mappingKey, value) {
34129
34129
  // src/getParser.ts
34130
34130
  var FILEBASENAME = Symbol("fileBasename");
34131
34131
  var FILENAME = Symbol("filename");
34132
- function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOptions, columnMappings, additionalData) {
34132
+ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOptions, columnMappings, additionalData, naturalMetaData) {
34133
34133
  function protectUid2(uid) {
34134
34134
  let protectedUid = uid;
34135
34135
  if (dicomPS315EOptions !== "Off") {
@@ -34175,6 +34175,15 @@ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOpti
34175
34175
  };
34176
34176
  })()
34177
34177
  );
34178
+ function getMetaDicom(attrName) {
34179
+ if (!naturalMetaData)
34180
+ return void 0;
34181
+ if (attrName in data.DicomMetaDictionary.dictionary) {
34182
+ attrName = data.DicomMetaDictionary.dictionary[attrName].name;
34183
+ }
34184
+ const value = (0, import_lodash2.get)(naturalMetaData, attrName);
34185
+ return typeof value === "string" ? value : void 0;
34186
+ }
34178
34187
  function missingDicom(attrName) {
34179
34188
  const value = getDicom(attrName);
34180
34189
  return typeof value === "undefined" || value === "";
@@ -34184,6 +34193,7 @@ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOpti
34184
34193
  getFilePathComp,
34185
34194
  getMapping,
34186
34195
  getDicom,
34196
+ getMetaDicom,
34187
34197
  missingDicom,
34188
34198
  protectUid: protectUid2,
34189
34199
  // TODO: Phase this out in favor of ISO8601 duration handling.
@@ -34232,6 +34242,7 @@ function collectMappings(inputFilePath, dicomData, mappingOptions) {
34232
34242
  const naturalData = data.DicomMetaDictionary.naturalizeDataset(
34233
34243
  dicomData.dict
34234
34244
  );
34245
+ const naturalMetaData = dicomData.meta ? data.DicomMetaDictionary.naturalizeDataset(dicomData.meta) : void 0;
34235
34246
  mapResults.sourceInstanceUID = naturalData.SOPInstanceUID;
34236
34247
  const finalSpec = composeSpecs(mappingOptions.curationSpec());
34237
34248
  const parser = getParser(
@@ -34240,12 +34251,18 @@ function collectMappings(inputFilePath, dicomData, mappingOptions) {
34240
34251
  naturalData,
34241
34252
  finalSpec.dicomPS315EOptions,
34242
34253
  mappingOptions.columnMappings,
34243
- finalSpec.additionalData
34254
+ finalSpec.additionalData,
34255
+ naturalMetaData
34244
34256
  );
34245
34257
  let preExcludeError;
34246
34258
  try {
34247
34259
  if (finalSpec.preExclude?.(parser)) {
34248
34260
  mapResults.excluded = "pre";
34261
+ if (!mappingOptions.skipWrite) {
34262
+ mapResults.anomalies.push(
34263
+ `Skipped pre-excluded file: ${parser.getFilePathComp(parser.FILENAME)}`
34264
+ );
34265
+ }
34249
34266
  return [naturalData, mapResults];
34250
34267
  }
34251
34268
  } catch (e) {
@@ -34314,6 +34331,11 @@ function collectMappings(inputFilePath, dicomData, mappingOptions) {
34314
34331
  outputFilePath: mapResults.outputFilePath
34315
34332
  })) {
34316
34333
  mapResults.excluded = "post";
34334
+ if (!mappingOptions.skipWrite) {
34335
+ mapResults.anomalies.push(
34336
+ `Skipped post-excluded file: ${parser.getFilePathComp(parser.FILENAME)}`
34337
+ );
34338
+ }
34317
34339
  return [naturalData, mapResults];
34318
34340
  }
34319
34341
  } catch (e) {
@@ -79757,7 +79757,7 @@ function getCsvMapping(columnMappings, mapping, mappingKey, value) {
79757
79757
  // src/getParser.ts
79758
79758
  var FILEBASENAME = Symbol("fileBasename");
79759
79759
  var FILENAME = Symbol("filename");
79760
- function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOptions, columnMappings, additionalData) {
79760
+ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOptions, columnMappings, additionalData, naturalMetaData) {
79761
79761
  function protectUid2(uid) {
79762
79762
  let protectedUid = uid;
79763
79763
  if (dicomPS315EOptions !== "Off") {
@@ -79803,6 +79803,15 @@ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOpti
79803
79803
  };
79804
79804
  })()
79805
79805
  );
79806
+ function getMetaDicom(attrName) {
79807
+ if (!naturalMetaData)
79808
+ return void 0;
79809
+ if (attrName in data.DicomMetaDictionary.dictionary) {
79810
+ attrName = data.DicomMetaDictionary.dictionary[attrName].name;
79811
+ }
79812
+ const value = (0, import_lodash2.get)(naturalMetaData, attrName);
79813
+ return typeof value === "string" ? value : void 0;
79814
+ }
79806
79815
  function missingDicom(attrName) {
79807
79816
  const value = getDicom(attrName);
79808
79817
  return typeof value === "undefined" || value === "";
@@ -79812,6 +79821,7 @@ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOpti
79812
79821
  getFilePathComp,
79813
79822
  getMapping,
79814
79823
  getDicom,
79824
+ getMetaDicom,
79815
79825
  missingDicom,
79816
79826
  protectUid: protectUid2,
79817
79827
  // TODO: Phase this out in favor of ISO8601 duration handling.
@@ -79860,6 +79870,7 @@ function collectMappings(inputFilePath, dicomData, mappingOptions) {
79860
79870
  const naturalData = data.DicomMetaDictionary.naturalizeDataset(
79861
79871
  dicomData.dict
79862
79872
  );
79873
+ const naturalMetaData = dicomData.meta ? data.DicomMetaDictionary.naturalizeDataset(dicomData.meta) : void 0;
79863
79874
  mapResults.sourceInstanceUID = naturalData.SOPInstanceUID;
79864
79875
  const finalSpec = composeSpecs(mappingOptions.curationSpec());
79865
79876
  const parser = getParser(
@@ -79868,12 +79879,18 @@ function collectMappings(inputFilePath, dicomData, mappingOptions) {
79868
79879
  naturalData,
79869
79880
  finalSpec.dicomPS315EOptions,
79870
79881
  mappingOptions.columnMappings,
79871
- finalSpec.additionalData
79882
+ finalSpec.additionalData,
79883
+ naturalMetaData
79872
79884
  );
79873
79885
  let preExcludeError;
79874
79886
  try {
79875
79887
  if (finalSpec.preExclude?.(parser)) {
79876
79888
  mapResults.excluded = "pre";
79889
+ if (!mappingOptions.skipWrite) {
79890
+ mapResults.anomalies.push(
79891
+ `Skipped pre-excluded file: ${parser.getFilePathComp(parser.FILENAME)}`
79892
+ );
79893
+ }
79877
79894
  return [naturalData, mapResults];
79878
79895
  }
79879
79896
  } catch (e4) {
@@ -79942,6 +79959,11 @@ function collectMappings(inputFilePath, dicomData, mappingOptions) {
79942
79959
  outputFilePath: mapResults.outputFilePath
79943
79960
  })) {
79944
79961
  mapResults.excluded = "post";
79962
+ if (!mappingOptions.skipWrite) {
79963
+ mapResults.anomalies.push(
79964
+ `Skipped post-excluded file: ${parser.getFilePathComp(parser.FILENAME)}`
79965
+ );
79966
+ }
79945
79967
  return [naturalData, mapResults];
79946
79968
  }
79947
79969
  } catch (e4) {
@@ -32763,7 +32763,7 @@ var ps315EElements2 = ps315EElements.map((elm) => {
32763
32763
  // src/getParser.ts
32764
32764
  var FILEBASENAME = Symbol("fileBasename");
32765
32765
  var FILENAME = Symbol("filename");
32766
- function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOptions, columnMappings, additionalData) {
32766
+ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOptions, columnMappings, additionalData, naturalMetaData) {
32767
32767
  function protectUid2(uid) {
32768
32768
  let protectedUid = uid;
32769
32769
  if (dicomPS315EOptions !== "Off") {
@@ -32809,6 +32809,15 @@ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOpti
32809
32809
  };
32810
32810
  })()
32811
32811
  );
32812
+ function getMetaDicom(attrName) {
32813
+ if (!naturalMetaData)
32814
+ return void 0;
32815
+ if (attrName in data.DicomMetaDictionary.dictionary) {
32816
+ attrName = data.DicomMetaDictionary.dictionary[attrName].name;
32817
+ }
32818
+ const value = (0, import_lodash2.get)(naturalMetaData, attrName);
32819
+ return typeof value === "string" ? value : void 0;
32820
+ }
32812
32821
  function missingDicom(attrName) {
32813
32822
  const value = getDicom(attrName);
32814
32823
  return typeof value === "undefined" || value === "";
@@ -32818,6 +32827,7 @@ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOpti
32818
32827
  getFilePathComp,
32819
32828
  getMapping,
32820
32829
  getDicom,
32830
+ getMetaDicom,
32821
32831
  missingDicom,
32822
32832
  protectUid: protectUid2,
32823
32833
  // TODO: Phase this out in favor of ISO8601 duration handling.
package/dist/esm/index.js CHANGED
@@ -87611,7 +87611,7 @@ var import_lodash3 = __toESM(require_lodash(), 1);
87611
87611
  var import_lodash2 = __toESM(require_lodash(), 1);
87612
87612
  var FILEBASENAME = Symbol("fileBasename");
87613
87613
  var FILENAME = Symbol("filename");
87614
- function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOptions, columnMappings, additionalData) {
87614
+ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOptions, columnMappings, additionalData, naturalMetaData) {
87615
87615
  function protectUid2(uid) {
87616
87616
  let protectedUid = uid;
87617
87617
  if (dicomPS315EOptions !== "Off") {
@@ -87657,6 +87657,15 @@ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOpti
87657
87657
  };
87658
87658
  })()
87659
87659
  );
87660
+ function getMetaDicom(attrName) {
87661
+ if (!naturalMetaData)
87662
+ return void 0;
87663
+ if (attrName in data.DicomMetaDictionary.dictionary) {
87664
+ attrName = data.DicomMetaDictionary.dictionary[attrName].name;
87665
+ }
87666
+ const value = (0, import_lodash2.get)(naturalMetaData, attrName);
87667
+ return typeof value === "string" ? value : void 0;
87668
+ }
87660
87669
  function missingDicom(attrName) {
87661
87670
  const value = getDicom(attrName);
87662
87671
  return typeof value === "undefined" || value === "";
@@ -87666,6 +87675,7 @@ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOpti
87666
87675
  getFilePathComp,
87667
87676
  getMapping,
87668
87677
  getDicom,
87678
+ getMetaDicom,
87669
87679
  missingDicom,
87670
87680
  protectUid: protectUid2,
87671
87681
  // TODO: Phase this out in favor of ISO8601 duration handling.
@@ -87714,6 +87724,7 @@ function collectMappings(inputFilePath, dicomData, mappingOptions) {
87714
87724
  const naturalData = data.DicomMetaDictionary.naturalizeDataset(
87715
87725
  dicomData.dict
87716
87726
  );
87727
+ const naturalMetaData = dicomData.meta ? data.DicomMetaDictionary.naturalizeDataset(dicomData.meta) : void 0;
87717
87728
  mapResults.sourceInstanceUID = naturalData.SOPInstanceUID;
87718
87729
  const finalSpec = composeSpecs(mappingOptions.curationSpec());
87719
87730
  const parser = getParser(
@@ -87722,12 +87733,18 @@ function collectMappings(inputFilePath, dicomData, mappingOptions) {
87722
87733
  naturalData,
87723
87734
  finalSpec.dicomPS315EOptions,
87724
87735
  mappingOptions.columnMappings,
87725
- finalSpec.additionalData
87736
+ finalSpec.additionalData,
87737
+ naturalMetaData
87726
87738
  );
87727
87739
  let preExcludeError;
87728
87740
  try {
87729
87741
  if (finalSpec.preExclude?.(parser)) {
87730
87742
  mapResults.excluded = "pre";
87743
+ if (!mappingOptions.skipWrite) {
87744
+ mapResults.anomalies.push(
87745
+ `Skipped pre-excluded file: ${parser.getFilePathComp(parser.FILENAME)}`
87746
+ );
87747
+ }
87731
87748
  return [naturalData, mapResults];
87732
87749
  }
87733
87750
  } catch (e4) {
@@ -87796,6 +87813,11 @@ function collectMappings(inputFilePath, dicomData, mappingOptions) {
87796
87813
  outputFilePath: mapResults.outputFilePath
87797
87814
  })) {
87798
87815
  mapResults.excluded = "post";
87816
+ if (!mappingOptions.skipWrite) {
87817
+ mapResults.anomalies.push(
87818
+ `Skipped post-excluded file: ${parser.getFilePathComp(parser.FILENAME)}`
87819
+ );
87820
+ }
87799
87821
  return [naturalData, mapResults];
87800
87822
  }
87801
87823
  } catch (e4) {
@@ -86048,7 +86048,7 @@ function getCsvMapping(columnMappings, mapping, mappingKey, value) {
86048
86048
  // src/getParser.ts
86049
86049
  var FILEBASENAME = Symbol("fileBasename");
86050
86050
  var FILENAME = Symbol("filename");
86051
- function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOptions, columnMappings, additionalData) {
86051
+ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOptions, columnMappings, additionalData, naturalMetaData) {
86052
86052
  function protectUid2(uid) {
86053
86053
  let protectedUid = uid;
86054
86054
  if (dicomPS315EOptions !== "Off") {
@@ -86094,6 +86094,15 @@ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOpti
86094
86094
  };
86095
86095
  })()
86096
86096
  );
86097
+ function getMetaDicom(attrName) {
86098
+ if (!naturalMetaData)
86099
+ return void 0;
86100
+ if (attrName in data.DicomMetaDictionary.dictionary) {
86101
+ attrName = data.DicomMetaDictionary.dictionary[attrName].name;
86102
+ }
86103
+ const value = (0, import_lodash2.get)(naturalMetaData, attrName);
86104
+ return typeof value === "string" ? value : void 0;
86105
+ }
86097
86106
  function missingDicom(attrName) {
86098
86107
  const value = getDicom(attrName);
86099
86108
  return typeof value === "undefined" || value === "";
@@ -86103,6 +86112,7 @@ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOpti
86103
86112
  getFilePathComp,
86104
86113
  getMapping,
86105
86114
  getDicom,
86115
+ getMetaDicom,
86106
86116
  missingDicom,
86107
86117
  protectUid: protectUid2,
86108
86118
  // TODO: Phase this out in favor of ISO8601 duration handling.
@@ -86151,6 +86161,7 @@ function collectMappings(inputFilePath, dicomData, mappingOptions) {
86151
86161
  const naturalData = data.DicomMetaDictionary.naturalizeDataset(
86152
86162
  dicomData.dict
86153
86163
  );
86164
+ const naturalMetaData = dicomData.meta ? data.DicomMetaDictionary.naturalizeDataset(dicomData.meta) : void 0;
86154
86165
  mapResults.sourceInstanceUID = naturalData.SOPInstanceUID;
86155
86166
  const finalSpec = composeSpecs(mappingOptions.curationSpec());
86156
86167
  const parser = getParser(
@@ -86159,12 +86170,18 @@ function collectMappings(inputFilePath, dicomData, mappingOptions) {
86159
86170
  naturalData,
86160
86171
  finalSpec.dicomPS315EOptions,
86161
86172
  mappingOptions.columnMappings,
86162
- finalSpec.additionalData
86173
+ finalSpec.additionalData,
86174
+ naturalMetaData
86163
86175
  );
86164
86176
  let preExcludeError;
86165
86177
  try {
86166
86178
  if (finalSpec.preExclude?.(parser)) {
86167
86179
  mapResults.excluded = "pre";
86180
+ if (!mappingOptions.skipWrite) {
86181
+ mapResults.anomalies.push(
86182
+ `Skipped pre-excluded file: ${parser.getFilePathComp(parser.FILENAME)}`
86183
+ );
86184
+ }
86168
86185
  return [naturalData, mapResults];
86169
86186
  }
86170
86187
  } catch (e4) {
@@ -86233,6 +86250,11 @@ function collectMappings(inputFilePath, dicomData, mappingOptions) {
86233
86250
  outputFilePath: mapResults.outputFilePath
86234
86251
  })) {
86235
86252
  mapResults.excluded = "post";
86253
+ if (!mappingOptions.skipWrite) {
86254
+ mapResults.anomalies.push(
86255
+ `Skipped post-excluded file: ${parser.getFilePathComp(parser.FILENAME)}`
86256
+ );
86257
+ }
86236
86258
  return [naturalData, mapResults];
86237
86259
  }
86238
86260
  } catch (e4) {
@@ -37136,6 +37136,16 @@ var DEFAULT_EXCLUDED_FILETYPES = [
37136
37136
  "thumbs.db",
37137
37137
  ".ds_store"
37138
37138
  ];
37139
+ function isS3KeyExcludedByName(key, extraExcludedFiletypes, includeDefaults) {
37140
+ const objectName = key.slice(key.lastIndexOf("/") + 1);
37141
+ const allExcludedFiletypes = [
37142
+ ...includeDefaults ? DEFAULT_EXCLUDED_FILETYPES : [],
37143
+ ...extraExcludedFiletypes
37144
+ ];
37145
+ return allExcludedFiletypes.some(
37146
+ (excluded) => objectName.toLowerCase() === excluded.toLowerCase()
37147
+ );
37148
+ }
37139
37149
  function safeReadErrorMessage(error2) {
37140
37150
  let detail = "unknown error";
37141
37151
  if (error2 && typeof error2 === "object") {
@@ -37226,9 +37236,7 @@ async function shouldProcessFileItem(s3Item, fileAnomalies) {
37226
37236
  if (excludedPathRegexes.some((regex) => regex.test(s3Item.Key))) {
37227
37237
  return false;
37228
37238
  }
37229
- if (excludedFiletypes.some(
37230
- (excluded) => s3Item.Key.toLowerCase() === excluded.toLowerCase()
37231
- )) {
37239
+ if (isS3KeyExcludedByName(s3Item.Key, excludedFiletypes, !noDefaultExclusions)) {
37232
37240
  fileAnomalies.push(`Skipped excluded file: ${s3Item.Key}`);
37233
37241
  return false;
37234
37242
  }
@@ -37682,3 +37690,6 @@ async function scanDirectoryNode(dirPath) {
37682
37690
  globalThis.close();
37683
37691
  }
37684
37692
  }
37693
+ export {
37694
+ isS3KeyExcludedByName
37695
+ };
@@ -3,4 +3,4 @@ import { type TColumnMappings } from './csvMapping.js';
3
3
  import type { TCurationSpecification, TParser } from './types.js';
4
4
  export declare const FILEBASENAME: symbol;
5
5
  export declare const FILENAME: symbol;
6
- export default function getParser(inputPathPattern: string, inputFilePath: string, naturalData: TNaturalData, dicomPS315EOptions: TCurationSpecification['dicomPS315EOptions'], columnMappings?: TColumnMappings, additionalData?: TCurationSpecification['additionalData']): TParser;
6
+ export default function getParser(inputPathPattern: string, inputFilePath: string, naturalData: TNaturalData, dicomPS315EOptions: TCurationSpecification['dicomPS315EOptions'], columnMappings?: TColumnMappings, additionalData?: TCurationSpecification['additionalData'], naturalMetaData?: TNaturalData): TParser;
@@ -1,4 +1,14 @@
1
1
  import type { TFileInfo, TFileInfoIndex, TS3BucketOptions } from './types.js';
2
+ /**
3
+ * Name-based exclusion decision for an S3 object key.
4
+ *
5
+ * Exported for testing: the S3 listing path needs a live bucket, and the worker
6
+ * runs in its own process where the S3 client cannot be mocked.
7
+ *
8
+ * Unlike the filesystem paths, an S3 key carries its whole prefix while the
9
+ * exclusion list holds bare filenames — and the defaults apply here too.
10
+ */
11
+ export declare function isS3KeyExcludedByName(key: string, extraExcludedFiletypes: string[], includeDefaults: boolean): boolean;
2
12
  export type FileScanMsg = {
3
13
  response: 'file';
4
14
  fileInfo: TFileInfo;
@@ -227,6 +227,7 @@ export type TParser = {
227
227
  getFilePathComp: (component: string | number | symbol) => string;
228
228
  getMapping: ((value: string) => string | number) | undefined;
229
229
  getDicom: (attrName: string) => any;
230
+ getMetaDicom: (attrName: string) => string | undefined;
230
231
  missingDicom: (attrName: string) => boolean;
231
232
  protectUid: (uid: string) => string;
232
233
  addDays: (dicomDateString: string, offsetDays: number) => string;