hellfire 0.27.11 → 0.27.12

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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [0.27.12](http://10.16.100.57/diffusion/115/paladin/compare/v0.27.11...v0.27.12) (2024-04-26)
6
+
7
+
8
+
5
9
  ## [0.27.11](http://10.16.100.57/diffusion/115/paladin/compare/v0.27.10...v0.27.11) (2024-04-24)
6
10
 
7
11
 
package/README.md CHANGED
@@ -151,6 +151,12 @@ disableUpDownKeyAction: boolean
151
151
 
152
152
  上下热键事件是否禁用
153
153
 
154
+ <b>`anonymous`</b>
155
+ ```
156
+ anonymous: boolean
157
+ ```
158
+ 病人信息匿名
159
+
154
160
  ### DicomView提供给父组件调用的方法:
155
161
 
156
162
  <b>`addStudy(data)`</b>
package/dist/index.js CHANGED
@@ -6187,12 +6187,48 @@ var formatToString = function formatToString(value) {
6187
6187
  }
6188
6188
  };
6189
6189
 
6190
- var DicomInfo = function DicomInfo(datasets, pixelData) {
6190
+ var DicomInfo = function DicomInfo(datasets, pixelData, isAnonymous) {
6191
6191
  classCallCheck(this, DicomInfo);
6192
6192
 
6193
6193
  return new Proxy(this, {
6194
6194
  get: function get(dicomTarget, dicomProp, dicomReceiver) {
6195
6195
  switch (true) {
6196
+ case dicomProp === 'PatientName':
6197
+ {
6198
+ if (isAnonymous) {
6199
+ return '***';
6200
+ } else {
6201
+ return new DicomElementAggregator(datasets, dicomProp);
6202
+ }
6203
+ }
6204
+
6205
+ case dicomProp === 'PatientSex':
6206
+ {
6207
+ if (isAnonymous) {
6208
+ return '*';
6209
+ } else {
6210
+ return new DicomElementAggregator(datasets, dicomProp);
6211
+ }
6212
+ }
6213
+
6214
+ case dicomProp === 'PatientAge':
6215
+ {
6216
+ if (isAnonymous) {
6217
+ return '**';
6218
+ } else {
6219
+ return new DicomElementAggregator(datasets, dicomProp);
6220
+ }
6221
+ }
6222
+
6223
+ case dicomProp === 'PatientID' || dicomProp === 'InstitutionName':
6224
+ {
6225
+ if (isAnonymous) {
6226
+ return '****';
6227
+ } else {
6228
+ return new DicomElementAggregator(datasets, dicomProp);
6229
+ }
6230
+ }
6231
+
6196
6232
  case dicomProp === 'datasets':
6197
6233
  {
6198
6234
  return datasets;
@@ -10329,6 +10365,7 @@ function resetTaskPool() {
10329
10365
  }
10330
10366
 
10331
10367
  var dicomCache = {};
10368
+ var isAnonymous = false;
10332
10369
 
10333
10370
  var loadAndCacheDicom = function loadAndCacheDicom(imageId) {
10334
10371
  return new Promise(function (resolve, reject) {
@@ -10339,7 +10376,7 @@ var loadAndCacheDicom = function loadAndCacheDicom(imageId) {
10339
10376
 
10340
10377
  var imagePromise = loadAndCacheImagePlus(imageId);
10341
10378
  imagePromise.then(function (image) {
10342
- var dicom = new DicomInfo(image.data, image.getPixelData());
10379
+ var dicom = new DicomInfo(image.data, image.getPixelData(), isAnonymous);
10343
10380
  dicomCache[imageId] = dicom;
10344
10381
  resolve(dicom);
10345
10382
  }, function (e) {
@@ -10352,6 +10389,18 @@ var purgeDicomCache = function purgeDicomCache() {
10352
10389
  dicomCache = {};
10353
10390
  };
10354
10391
 
10392
+ var setInfoAnonymous = function setInfoAnonymous() {
10393
+ isAnonymous = true;
10394
+ };
10395
+
10396
+ var setNotAnonymous = function setNotAnonymous() {
10397
+ isAnonymous = false;
10398
+ };
10399
+
10400
+ var getAnonymousState = function getAnonymousState() {
10401
+ return isAnonymous;
10402
+ };
10403
+
10355
10404
  function _createSuper$c(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$c(); return function _createSuperInternal() { var Super = getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn(this, result); }; }
10356
10405
 
10357
10406
  function _isNativeReflectConstruct$c() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
@@ -32590,6 +32639,7 @@ var ButtonGroup = /*#__PURE__*/function (_Component) {
32590
32639
 
32591
32640
  defineProperty(ButtonGroup, "propTypes", {});
32592
32641
 
32642
+ var anonymousKeys = ['InstitutionName', 'InstitutionAddress', 'PatientID', 'IssuerOfPatientID', 'TypeOfPatientID', 'IssuerOfPatientIDQualifiersSequence', 'PatientName', 'PatientSex', 'PatientAge', 'PatientBirthDate', 'PatientBirthTime', 'PatientBirthName', 'PatientSize', 'PatientWeight', 'PatientAddress', 'PatientMotherBirthName', 'PatientTelephoneNumbers', 'PatientComments'];
32593
32643
  /**
32594
32644
  *
32595
32645
  * Get tag js object from our custom dicom object
@@ -32619,6 +32669,7 @@ var formatDicom = function formatDicom(dicom) {
32619
32669
  ]
32620
32670
  };
32621
32671
  var formatedDicomInfos = [];
32672
+ var isAnonymous = getAnonymousState();
32622
32673
  lodash$1.forEach(dicom, function (item) {
32623
32674
  var tagID = item.tag.toUpperCase();
32624
32675
  var value;
@@ -32628,7 +32679,13 @@ var formatDicom = function formatDicom(dicom) {
32628
32679
  if (options.maxLength && item.element.length > options.maxLength) {
32629
32680
  value = "Length(".concat(item.element.length, ")");
32630
32681
  } else {
32631
- value = item.toString();
32682
+ value = item.toString(); // 匿名
32683
+
32684
+ if (isAnonymous) {
32685
+ if (item.keyword && lodash$1.includes(anonymousKeys, item.keyword)) {
32686
+ value = "**";
32687
+ }
32688
+ }
32632
32689
  }
32633
32690
 
32634
32691
  if (item.vr === 'SQ') {
@@ -32761,72 +32818,100 @@ var DicomInfoModal = /*#__PURE__*/function (_Component) {
32761
32818
 
32762
32819
  _this = _super.call(this, props);
32763
32820
 
32764
- defineProperty(assertThisInitialized(_this), "getAndFormatOriginData", function (imageId) {
32765
- var imagePromise = loadAndCacheImagePlus(imageId);
32766
- imagePromise.then(function (image) {
32767
- var dicom = new DicomInfo(image.data);
32768
- var dicomInfo = getTagInfo(dicom); // id第一位是奇数 处理成收纳的形式
32769
-
32770
- var originDataWithIdOdd = []; // id第一位是偶数
32771
- // let originDataWithIdEven = [];
32772
-
32773
- var dataSource = [];
32774
- lodash$1.forEach(dicomInfo, function (item) {
32775
- var id;
32776
- var idStart;
32777
- xregexp.replace(item.tagID, xregexp('\\((?<a>.{4}),(?<b>.{4})\\)'), function (match) {
32778
- id = match && lodash$1.toString(match.a) + lodash$1.toString(match.b) || null;
32779
- idStart = match && match.a || null;
32780
- });
32781
- var tagNameOrigin = dicomDataDictionary$1.standardDataElements[id] ? dicomDataDictionary$1.standardDataElements[id].name : null;
32821
+ defineProperty(assertThisInitialized(_this), "getAndFormatOriginData", /*#__PURE__*/function () {
32822
+ var _ref = asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(imageId) {
32823
+ var dicom, dicomInfo, originDataWithIdOdd, dataSource, dataSourceScan;
32824
+ return regenerator.wrap(function _callee$(_context) {
32825
+ while (1) {
32826
+ switch (_context.prev = _context.next) {
32827
+ case 0:
32828
+ _context.next = 2;
32829
+ return loadAndCacheDicom(imageId);
32782
32830
 
32783
- var data = _objectSpread$l(_objectSpread$l({}, item), {}, {
32784
- tagIDOrigin: id,
32785
- idStart: idStart,
32786
- tagNameOrigin: tagNameOrigin
32787
- });
32831
+ case 2:
32832
+ dicom = _context.sent;
32788
32833
 
32789
- if (idStart && idStart.substring(idStart.length - 1) % 2 === 1) {
32790
- originDataWithIdOdd.push(data);
32791
- } else {
32792
- dataSource.push(data);
32793
- }
32794
- });
32834
+ if (dicom) {
32835
+ _context.next = 5;
32836
+ break;
32837
+ }
32795
32838
 
32796
- if (originDataWithIdOdd && originDataWithIdOdd.length > 0) {
32797
- originDataWithIdOdd = lodash$1.groupBy(originDataWithIdOdd, 'idStart');
32798
- lodash$1.forEach(originDataWithIdOdd, function (item) {
32799
- if (item.length === 1) {
32800
- dataSource = lodash$1.concat(dataSource, item);
32801
- } else {
32802
- // 收纳
32803
- var firstItem = item[0];
32839
+ return _context.abrupt("return");
32804
32840
 
32805
- var _item = item.splice(1);
32841
+ case 5:
32842
+ dicomInfo = getTagInfo(dicom); // id第一位是奇数 处理成收纳的形式
32843
+
32844
+ originDataWithIdOdd = []; // id第一位是偶数
32845
+ // let originDataWithIdEven = [];
32846
+
32847
+ dataSource = [];
32848
+ lodash$1.forEach(dicomInfo, function (item) {
32849
+ var id;
32850
+ var idStart;
32851
+ xregexp.replace(item.tagID, xregexp('\\((?<a>.{4}),(?<b>.{4})\\)'), function (match) {
32852
+ id = match && lodash$1.toString(match.a) + lodash$1.toString(match.b) || null;
32853
+ idStart = match && match.a || null;
32854
+ });
32855
+ var tagNameOrigin = dicomDataDictionary$1.standardDataElements[id] ? dicomDataDictionary$1.standardDataElements[id].name : null;
32806
32856
 
32807
- dataSource.push(_objectSpread$l(_objectSpread$l({}, firstItem), {}, {
32808
- items: [_item]
32809
- }));
32810
- }
32811
- });
32812
- }
32857
+ var data = _objectSpread$l(_objectSpread$l({}, item), {}, {
32858
+ tagIDOrigin: id,
32859
+ idStart: idStart,
32860
+ tagNameOrigin: tagNameOrigin
32861
+ });
32813
32862
 
32814
- dataSource = lodash$1.sortBy(dataSource, 'tagIDOrigin');
32815
- var dataSourceScan = lodash$1.map(dicomTagsKeysScan, function (key) {
32816
- return lodash$1.find(dataSource, {
32817
- 'tagIDOrigin': key
32818
- }) || {
32819
- tagIDOrigin: key,
32820
- tagNameOrigin: dicomDataDictionary$1.standardDataElements[key] && dicomDataDictionary$1.standardDataElements[key].name || ''
32821
- };
32822
- });
32863
+ if (idStart && idStart.substring(idStart.length - 1) % 2 === 1) {
32864
+ originDataWithIdOdd.push(data);
32865
+ } else {
32866
+ dataSource.push(data);
32867
+ }
32868
+ });
32823
32869
 
32824
- _this.setState({
32825
- dataSource: dataSource,
32826
- dataSourceScan: dataSourceScan
32827
- });
32828
- });
32829
- });
32870
+ if (originDataWithIdOdd && originDataWithIdOdd.length > 0) {
32871
+ originDataWithIdOdd = lodash$1.groupBy(originDataWithIdOdd, 'idStart');
32872
+ lodash$1.forEach(originDataWithIdOdd, function (item) {
32873
+ if (item.length === 1) {
32874
+ dataSource = lodash$1.concat(dataSource, item);
32875
+ } else {
32876
+ // 收纳
32877
+ var firstItem = item[0];
32878
+
32879
+ var _item = item.splice(1);
32880
+
32881
+ dataSource.push(_objectSpread$l(_objectSpread$l({}, firstItem), {}, {
32882
+ items: [_item]
32883
+ }));
32884
+ }
32885
+ });
32886
+ }
32887
+
32888
+ dataSource = lodash$1.sortBy(dataSource, 'tagIDOrigin');
32889
+ dataSourceScan = lodash$1.map(dicomTagsKeysScan, function (key) {
32890
+ return lodash$1.find(dataSource, {
32891
+ 'tagIDOrigin': key
32892
+ }) || {
32893
+ tagIDOrigin: key,
32894
+ tagNameOrigin: dicomDataDictionary$1.standardDataElements[key] && dicomDataDictionary$1.standardDataElements[key].name || ''
32895
+ };
32896
+ });
32897
+
32898
+ _this.setState({
32899
+ dataSource: dataSource,
32900
+ dataSourceScan: dataSourceScan
32901
+ });
32902
+
32903
+ case 13:
32904
+ case "end":
32905
+ return _context.stop();
32906
+ }
32907
+ }
32908
+ }, _callee);
32909
+ }));
32910
+
32911
+ return function (_x) {
32912
+ return _ref.apply(this, arguments);
32913
+ };
32914
+ }());
32830
32915
 
32831
32916
  defineProperty(assertThisInitialized(_this), "setDicomModalTag", function (dicomModalTag) {
32832
32917
  _this.setState({
@@ -55071,6 +55156,7 @@ var mergeProps$t = function mergeProps(propsFromState, propsFromDispatch, ownPro
55071
55156
  case 0:
55072
55157
  /**
55073
55158
  * 初始化study
55159
+ * - 是否是匿名显示
55074
55160
  * - 初始化 cornerstoneWADOImageLoader token
55075
55161
  * - 初始化 global toolState (study中存在serverToolState的情况)
55076
55162
  * - 初始化 手术路径规划的缓存数据 (study中是否存在centesisPath)
@@ -55086,6 +55172,13 @@ var mergeProps$t = function mergeProps(propsFromState, propsFromDispatch, ownPro
55086
55172
  * 检查io是否为true是的话打开同屏开关
55087
55173
  */
55088
55174
  console.log('[paladin] - init series');
55175
+
55176
+ if (ownProps.anonymous && ownProps.anonymous === true) {
55177
+ setInfoAnonymous();
55178
+ } else {
55179
+ setNotAnonymous();
55180
+ }
55181
+
55089
55182
  cornerstoneWADOImageLoader.configure({
55090
55183
  beforeSend: function beforeSend(xhr) {
55091
55184
  xhr.setRequestHeader('Authorization', "bearer ".concat(ownProps.token));
@@ -55161,32 +55254,32 @@ var mergeProps$t = function mergeProps(propsFromState, propsFromDispatch, ownPro
55161
55254
  });
55162
55255
 
55163
55256
  if (!needCheckMultiFrame) {
55164
- _context.next = 44;
55257
+ _context.next = 45;
55165
55258
  break;
55166
55259
  }
55167
55260
 
55168
55261
  i = 0;
55169
55262
 
55170
- case 28:
55263
+ case 29:
55171
55264
  if (!(i < series.length)) {
55172
- _context.next = 44;
55265
+ _context.next = 45;
55173
55266
  break;
55174
55267
  }
55175
55268
 
55176
55269
  item = series[i];
55177
55270
 
55178
55271
  if (!(item.numberOfSeriesRelatedInstances && item.numberOfSeriesRelatedInstances === 1)) {
55179
- _context.next = 41;
55272
+ _context.next = 42;
55180
55273
  break;
55181
55274
  }
55182
55275
 
55183
55276
  wado = lodash$1.cloneDeep(item.imageIds[0].split(':'));
55184
55277
  wado.shift();
55185
55278
  url = wado.join(':');
55186
- _context.next = 36;
55279
+ _context.next = 37;
55187
55280
  return cornerstoneWADOImageLoader.wadouri.dataSetCacheManager.load(url, cornerstoneWADOImageLoader.internal.xhrRequest);
55188
55281
 
55189
- case 36:
55282
+ case 37:
55190
55283
  dataSet = _context.sent;
55191
55284
  // 这边如果加载了的话 进度条也需要匹配上
55192
55285
  propsFromDispatch.setSeriesLoaded(item.seriesInstanceUID);
@@ -55210,12 +55303,12 @@ var mergeProps$t = function mergeProps(propsFromState, propsFromDispatch, ownPro
55210
55303
 
55211
55304
  cornerstoneWADOImageLoader.wadouri.dataSetCacheManager.purge();
55212
55305
 
55213
- case 41:
55306
+ case 42:
55214
55307
  i++;
55215
- _context.next = 28;
55308
+ _context.next = 29;
55216
55309
  break;
55217
55310
 
55218
- case 44:
55311
+ case 45:
55219
55312
  // 初始化seriesCurrentIndex
55220
55313
  seriesCurrentIndex = Array.apply(null, Array(series.length)).map(function () {
55221
55314
  return 0;
@@ -55271,10 +55364,10 @@ var mergeProps$t = function mergeProps(propsFromState, propsFromDispatch, ownPro
55271
55364
  })]
55272
55365
  }); // 如果有frameTime的话设置fps
55273
55366
 
55274
- _context.next = 59;
55367
+ _context.next = 60;
55275
55368
  return loadAndCacheDicom(series[0].imageIds[0]);
55276
55369
 
55277
- case 59:
55370
+ case 60:
55278
55371
  dicom = _context.sent;
55279
55372
 
55280
55373
  if (dicom && dicom.FrameTime && dicom.FrameTime.value) {
@@ -55308,7 +55401,7 @@ var mergeProps$t = function mergeProps(propsFromState, propsFromDispatch, ownPro
55308
55401
  propsFromDispatch.setMeasure(false);
55309
55402
  }
55310
55403
 
55311
- case 65:
55404
+ case 66:
55312
55405
  case "end":
55313
55406
  return _context.stop();
55314
55407
  }