dcmjs 0.42.0 → 0.43.1

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/build/dcmjs.es.js CHANGED
@@ -7614,6 +7614,331 @@ var pako = {
7614
7614
  constants: constants_1
7615
7615
  };
7616
7616
 
7617
+ /**
7618
+ * This is a data view which is split across multiple pieces, and maintains
7619
+ * a running size, with nullable chunks.
7620
+ */
7621
+ var SplitDataView = /*#__PURE__*/function () {
7622
+ function SplitDataView() {
7623
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
7624
+ defaultSize: 256 * 1024
7625
+ };
7626
+ _classCallCheck(this, SplitDataView);
7627
+ _defineProperty(this, "buffers", []);
7628
+ _defineProperty(this, "views", []);
7629
+ _defineProperty(this, "offsets", []);
7630
+ _defineProperty(this, "size", 0);
7631
+ _defineProperty(this, "byteLength", 0);
7632
+ /** The default size is 256k */
7633
+ _defineProperty(this, "defaultSize", 256 * 1024);
7634
+ this.defaultSize = options.defaultSize || this.defaultSize;
7635
+ }
7636
+ _createClass(SplitDataView, [{
7637
+ key: "checkSize",
7638
+ value: function checkSize(end) {
7639
+ while (end > this.byteLength) {
7640
+ var buffer = new ArrayBuffer(this.defaultSize);
7641
+ this.buffers.push(buffer);
7642
+ this.views.push(new DataView(buffer));
7643
+ this.offsets.push(this.byteLength);
7644
+ this.byteLength += buffer.byteLength;
7645
+ }
7646
+ }
7647
+
7648
+ /**
7649
+ * Adds the buffer to the end of the current buffers list,
7650
+ * updating the size etc.
7651
+ *
7652
+ * @param {*} buffer
7653
+ * @param {*} options.start for the start of the new buffer to use
7654
+ * @param {*} options.end for the end of the buffer to use
7655
+ * @param {*} options.transfer to transfer the buffer to be owned
7656
+ */
7657
+ }, {
7658
+ key: "addBuffer",
7659
+ value: function addBuffer(buffer) {
7660
+ var _this$buffers;
7661
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
7662
+ buffer = buffer.buffer || buffer;
7663
+ var start = (options === null || options === void 0 ? void 0 : options.start) || 0;
7664
+ var end = (options === null || options === void 0 ? void 0 : options.end) || buffer.byteLength;
7665
+ var transfer = options === null || options === void 0 ? void 0 : options.transfer;
7666
+ if (start === end) {
7667
+ return;
7668
+ }
7669
+ var addBuffer = transfer ? buffer : buffer.slice(start, end);
7670
+ var lastOffset = this.offsets.length ? this.offsets[this.offsets.length - 1] : 0;
7671
+ var lastLength = this.buffers.length ? (_this$buffers = this.buffers[this.buffers.length - 1]) === null || _this$buffers === void 0 ? void 0 : _this$buffers.byteLength : 0;
7672
+ this.buffers.push(addBuffer);
7673
+ this.views.push(new DataView(addBuffer));
7674
+ this.offsets.push(lastOffset + lastLength);
7675
+ this.size += addBuffer.byteLength;
7676
+ this.byteLength += addBuffer.byteLength;
7677
+ }
7678
+
7679
+ /** Copies one view contents into this one as a mirror */
7680
+ }, {
7681
+ key: "from",
7682
+ value: function from(view, _options) {
7683
+ var _this$offsets, _this$buffers2, _this$views;
7684
+ this.size = view.size;
7685
+ this.byteLength = view.byteLength;
7686
+ (_this$offsets = this.offsets).push.apply(_this$offsets, _toConsumableArray(view.offsets));
7687
+ (_this$buffers2 = this.buffers).push.apply(_this$buffers2, _toConsumableArray(view.buffers));
7688
+ (_this$views = this.views).push.apply(_this$views, _toConsumableArray(view.views));
7689
+ // TODO - use the options to skip copying irrelevant data
7690
+ }
7691
+ }, {
7692
+ key: "slice",
7693
+ value: function slice() {
7694
+ var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
7695
+ var end = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.size;
7696
+ if (start === end) {
7697
+ return new Uint8Array(0).buffer;
7698
+ }
7699
+ var index = this.findStart(start);
7700
+ if (index === undefined) {
7701
+ throw new Error("Start ".concat(start, " out of range of 0...").concat(this.byteLength));
7702
+ }
7703
+ var buffer = this.buffers[index];
7704
+ if (!buffer) {
7705
+ console.error("Buffer should be defined here");
7706
+ return;
7707
+ }
7708
+ var offset = this.offsets[index];
7709
+ var length = buffer.byteLength;
7710
+ if (end < offset + length) {
7711
+ return buffer.slice(start - offset, end - offset);
7712
+ }
7713
+ var createBuffer = new Uint8Array(end - start);
7714
+ var offsetStart = 0;
7715
+ while (start + offsetStart < end && index < this.buffers.length) {
7716
+ buffer = this.buffers[index];
7717
+ length = buffer.byteLength;
7718
+ offset = this.offsets[index];
7719
+ var bufStart = start + offsetStart - offset;
7720
+ var addLength = Math.min(end - start - offsetStart, length - bufStart);
7721
+ createBuffer.set(new Uint8Array(buffer, bufStart, addLength), offsetStart);
7722
+ offsetStart += addLength;
7723
+ index++;
7724
+ }
7725
+ return createBuffer.buffer;
7726
+ }
7727
+ }, {
7728
+ key: "findStart",
7729
+ value: function findStart() {
7730
+ var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
7731
+ for (var index = 0; index < this.buffers.length; index++) {
7732
+ if (start >= this.offsets[index] && start < this.offsets[index] + this.buffers[index].byteLength) {
7733
+ return index;
7734
+ }
7735
+ }
7736
+ }
7737
+ }, {
7738
+ key: "findView",
7739
+ value: function findView(start) {
7740
+ var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
7741
+ var index = this.findStart(start);
7742
+ var buffer = this.buffers[index];
7743
+ var viewOffset = this.offsets[index];
7744
+ var viewLength = buffer.byteLength;
7745
+ if (start + length - viewOffset <= viewLength) {
7746
+ return {
7747
+ view: this.views[index],
7748
+ viewOffset: viewOffset,
7749
+ index: index
7750
+ };
7751
+ }
7752
+ var newBuffer = this.slice(start, start + length);
7753
+ return {
7754
+ view: new DataView(newBuffer),
7755
+ viewOffset: start,
7756
+ writeCommit: true
7757
+ };
7758
+ }
7759
+ }, {
7760
+ key: "writeCommit",
7761
+ value: function writeCommit(view, start) {
7762
+ this.writeBuffer(view.buffer, start);
7763
+ }
7764
+ }, {
7765
+ key: "writeBuffer",
7766
+ value: function writeBuffer(data, start) {
7767
+ var index = this.findStart(start);
7768
+ var offset = 0;
7769
+ while (offset < data.byteLength) {
7770
+ var buffer = this.buffers[index];
7771
+ if (!buffer) {
7772
+ throw new Error("Not enough space to write ".concat(data.byteLength));
7773
+ }
7774
+ var bufferOffset = this.offsets[index];
7775
+ var startWrite = start + offset - bufferOffset;
7776
+ var writeLen = Math.min(buffer.byteLength - startWrite, data.byteLength - offset);
7777
+ var byteBuffer = new Uint8Array(buffer, startWrite, writeLen);
7778
+ var setData = new Uint8Array(data.buffer || data, offset, writeLen);
7779
+ byteBuffer.set(setData);
7780
+ offset += writeLen;
7781
+ index++;
7782
+ }
7783
+ }
7784
+ }, {
7785
+ key: "getUint8",
7786
+ value: function getUint8(offset) {
7787
+ var _this$findView = this.findView(offset, 1),
7788
+ view = _this$findView.view,
7789
+ viewOffset = _this$findView.viewOffset;
7790
+ return view.getUint8(offset - viewOffset);
7791
+ }
7792
+ }, {
7793
+ key: "getUint16",
7794
+ value: function getUint16(offset, isLittleEndian) {
7795
+ var _this$findView2 = this.findView(offset, 2),
7796
+ view = _this$findView2.view,
7797
+ viewOffset = _this$findView2.viewOffset;
7798
+ return view.getUint16(offset - viewOffset, isLittleEndian);
7799
+ }
7800
+ }, {
7801
+ key: "getUint32",
7802
+ value: function getUint32(offset, isLittleEndian) {
7803
+ var _this$findView3 = this.findView(offset, 4),
7804
+ view = _this$findView3.view,
7805
+ viewOffset = _this$findView3.viewOffset;
7806
+ return view.getUint32(offset - viewOffset, isLittleEndian);
7807
+ }
7808
+ }, {
7809
+ key: "getFloat32",
7810
+ value: function getFloat32(offset, isLittleEndian) {
7811
+ var _this$findView4 = this.findView(offset, 4),
7812
+ view = _this$findView4.view,
7813
+ viewOffset = _this$findView4.viewOffset;
7814
+ return view.getFloat32(offset - viewOffset, isLittleEndian);
7815
+ }
7816
+ }, {
7817
+ key: "getFloat64",
7818
+ value: function getFloat64(offset, isLittleEndian) {
7819
+ var _this$findView5 = this.findView(offset, 8),
7820
+ view = _this$findView5.view,
7821
+ viewOffset = _this$findView5.viewOffset;
7822
+ return view.getFloat64(offset - viewOffset, isLittleEndian);
7823
+ }
7824
+ }, {
7825
+ key: "getInt8",
7826
+ value: function getInt8(offset) {
7827
+ var _this$findView6 = this.findView(offset, 1),
7828
+ view = _this$findView6.view,
7829
+ viewOffset = _this$findView6.viewOffset;
7830
+ return view.getInt8(offset - viewOffset);
7831
+ }
7832
+ }, {
7833
+ key: "getInt16",
7834
+ value: function getInt16(offset, isLittleEndian) {
7835
+ var _this$findView7 = this.findView(offset, 2),
7836
+ view = _this$findView7.view,
7837
+ viewOffset = _this$findView7.viewOffset;
7838
+ return view.getInt16(offset - viewOffset, isLittleEndian);
7839
+ }
7840
+ }, {
7841
+ key: "getInt32",
7842
+ value: function getInt32(offset, isLittleEndian) {
7843
+ var _this$findView8 = this.findView(offset, 4),
7844
+ view = _this$findView8.view,
7845
+ viewOffset = _this$findView8.viewOffset;
7846
+ return view.getInt32(offset - viewOffset, isLittleEndian);
7847
+ }
7848
+ }, {
7849
+ key: "setUint8",
7850
+ value: function setUint8(offset, value) {
7851
+ var _this$findView9 = this.findView(offset, 1),
7852
+ view = _this$findView9.view,
7853
+ viewOffset = _this$findView9.viewOffset;
7854
+ view.setUint8(offset - viewOffset, value);
7855
+ // Commit is unneeded since 1 byte will always be available
7856
+ }
7857
+ }, {
7858
+ key: "setUint16",
7859
+ value: function setUint16(offset, value, isLittleEndian) {
7860
+ var _this$findView0 = this.findView(offset, 2),
7861
+ view = _this$findView0.view,
7862
+ viewOffset = _this$findView0.viewOffset,
7863
+ writeCommit = _this$findView0.writeCommit;
7864
+ view.setUint16(offset - viewOffset, value, isLittleEndian);
7865
+ if (writeCommit) {
7866
+ this.writeCommit(view, offset);
7867
+ }
7868
+ }
7869
+ }, {
7870
+ key: "setUint32",
7871
+ value: function setUint32(offset, value, isLittleEndian) {
7872
+ var _this$findView1 = this.findView(offset, 4),
7873
+ view = _this$findView1.view,
7874
+ viewOffset = _this$findView1.viewOffset,
7875
+ writeCommit = _this$findView1.writeCommit;
7876
+ view.setUint32(offset - viewOffset, value, isLittleEndian);
7877
+ if (writeCommit) {
7878
+ this.writeCommit(view, offset);
7879
+ }
7880
+ }
7881
+ }, {
7882
+ key: "setFloat32",
7883
+ value: function setFloat32(offset, value, isLittleEndian) {
7884
+ var _this$findView10 = this.findView(offset, 4),
7885
+ view = _this$findView10.view,
7886
+ viewOffset = _this$findView10.viewOffset,
7887
+ writeCommit = _this$findView10.writeCommit;
7888
+ view.setFloat32(offset - viewOffset, value, isLittleEndian);
7889
+ if (writeCommit) {
7890
+ this.writeCommit(view, offset);
7891
+ }
7892
+ }
7893
+ }, {
7894
+ key: "setFloat64",
7895
+ value: function setFloat64(offset, value, isLittleEndian) {
7896
+ var _this$findView11 = this.findView(offset, 8),
7897
+ view = _this$findView11.view,
7898
+ viewOffset = _this$findView11.viewOffset,
7899
+ writeCommit = _this$findView11.writeCommit;
7900
+ view.setFloat64(offset - viewOffset, value, isLittleEndian);
7901
+ if (writeCommit) {
7902
+ this.writeCommit(view, offset);
7903
+ }
7904
+ }
7905
+ }, {
7906
+ key: "setInt8",
7907
+ value: function setInt8(offset, value) {
7908
+ var _this$findView12 = this.findView(offset, 1),
7909
+ view = _this$findView12.view,
7910
+ viewOffset = _this$findView12.viewOffset;
7911
+ view.setInt8(offset - viewOffset, value);
7912
+ // Commit is unneeded since 1 byte will always be available
7913
+ }
7914
+ }, {
7915
+ key: "setInt16",
7916
+ value: function setInt16(offset, value, isLittleEndian) {
7917
+ var _this$findView13 = this.findView(offset, 2),
7918
+ view = _this$findView13.view,
7919
+ viewOffset = _this$findView13.viewOffset,
7920
+ writeCommit = _this$findView13.writeCommit;
7921
+ view.setInt16(offset - viewOffset, value, isLittleEndian);
7922
+ if (writeCommit) {
7923
+ this.writeCommit(view, offset);
7924
+ }
7925
+ }
7926
+ }, {
7927
+ key: "setInt32",
7928
+ value: function setInt32(offset, value, isLittleEndian) {
7929
+ var _this$findView14 = this.findView(offset, 4),
7930
+ view = _this$findView14.view,
7931
+ viewOffset = _this$findView14.viewOffset,
7932
+ writeCommit = _this$findView14.writeCommit;
7933
+ view.setInt32(offset - viewOffset, value, isLittleEndian);
7934
+ if (writeCommit) {
7935
+ this.writeCommit(view, offset);
7936
+ }
7937
+ }
7938
+ }]);
7939
+ return SplitDataView;
7940
+ }();
7941
+
7617
7942
  function toInt(val) {
7618
7943
  if (isNaN(val)) {
7619
7944
  throw new Error("Not a number: " + val);
@@ -7627,23 +7952,52 @@ function toFloat(val) {
7627
7952
  } else return val;
7628
7953
  }
7629
7954
  var BufferStream = /*#__PURE__*/function () {
7630
- function BufferStream(sizeOrBuffer, littleEndian) {
7955
+ function BufferStream() {
7956
+ var _options$defaultSize;
7957
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
7631
7958
  _classCallCheck(this, BufferStream);
7632
- this.buffer = typeof sizeOrBuffer == "number" ? new ArrayBuffer(sizeOrBuffer) : sizeOrBuffer;
7633
- if (!this.buffer) {
7634
- this.buffer = new ArrayBuffer(0);
7635
- }
7636
- this.view = new DataView(this.buffer);
7637
- this.offset = 0;
7638
- this.isLittleEndian = littleEndian || false;
7639
- this.size = 0;
7640
- this.encoder = new TextEncoder("utf-8");
7959
+ _defineProperty(this, "offset", 0);
7960
+ _defineProperty(this, "startOffset", 0);
7961
+ _defineProperty(this, "isLittleEndian", false);
7962
+ _defineProperty(this, "size", 0);
7963
+ _defineProperty(this, "view", new SplitDataView());
7964
+ _defineProperty(this, "encoder", new TextEncoder("utf-8"));
7965
+ this.isLittleEndian = (options === null || options === void 0 ? void 0 : options.littleEndian) || this.isLittleEndian;
7966
+ this.view.defaultSize = (_options$defaultSize = options === null || options === void 0 ? void 0 : options.defaultSize) !== null && _options$defaultSize !== void 0 ? _options$defaultSize : this.view.defaultSize;
7641
7967
  }
7642
7968
  _createClass(BufferStream, [{
7643
7969
  key: "setEndian",
7644
7970
  value: function setEndian(isLittle) {
7645
7971
  this.isLittleEndian = isLittle;
7646
7972
  }
7973
+ }, {
7974
+ key: "slice",
7975
+ value: function slice() {
7976
+ var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.startOffset;
7977
+ var end = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.endOffset;
7978
+ return this.view.slice(start, end);
7979
+ }
7980
+ }, {
7981
+ key: "getBuffer",
7982
+ value: function getBuffer() {
7983
+ var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
7984
+ var end = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.size;
7985
+ if (this.noCopy) {
7986
+ return new Uint8Array(this.slice(start, end));
7987
+ }
7988
+ return this.slice(start, end);
7989
+ }
7990
+ }, {
7991
+ key: "buffer",
7992
+ get: function get() {
7993
+ // console.warn("Deprecated buffer get");
7994
+ return this.getBuffer();
7995
+ }
7996
+ }, {
7997
+ key: "available",
7998
+ get: function get() {
7999
+ return this.endOffset - this.offset;
8000
+ }
7647
8001
  }, {
7648
8002
  key: "writeUint8",
7649
8003
  value: function writeUint8(value) {
@@ -7725,7 +8079,7 @@ var BufferStream = /*#__PURE__*/function () {
7725
8079
  value: function writeUTF8String(value) {
7726
8080
  var encodedString = this.encoder.encode(value);
7727
8081
  this.checkSize(encodedString.byteLength);
7728
- new Uint8Array(this.buffer).set(encodedString, this.offset);
8082
+ this.view.writeBuffer(encodedString, this.offset);
7729
8083
  return this.increment(encodedString.byteLength);
7730
8084
  }
7731
8085
  }, {
@@ -7736,8 +8090,8 @@ var BufferStream = /*#__PURE__*/function () {
7736
8090
  this.checkSize(len);
7737
8091
  var startOffset = this.offset;
7738
8092
  for (var i = 0; i < len; i++) {
7739
- var charcode = value.charCodeAt(i);
7740
- this.view.setUint8(startOffset + i, charcode);
8093
+ var charCode = value.charCodeAt(i);
8094
+ this.view.setUint8(startOffset + i, charCode);
7741
8095
  }
7742
8096
  return this.increment(len);
7743
8097
  }
@@ -7770,7 +8124,7 @@ var BufferStream = /*#__PURE__*/function () {
7770
8124
  }, {
7771
8125
  key: "readUint8Array",
7772
8126
  value: function readUint8Array(length) {
7773
- var arr = new Uint8Array(this.buffer, this.offset, length);
8127
+ var arr = new Uint8Array(this.view.slice(this.offset, this.offset + length));
7774
8128
  this.increment(length);
7775
8129
  return arr;
7776
8130
  }
@@ -7786,6 +8140,13 @@ var BufferStream = /*#__PURE__*/function () {
7786
8140
  }
7787
8141
  return arr;
7788
8142
  }
8143
+ }, {
8144
+ key: "readInt8",
8145
+ value: function readInt8() {
8146
+ var val = this.view.getInt8(this.offset, this.isLittleEndian);
8147
+ this.increment(1);
8148
+ return val;
8149
+ }
7789
8150
  }, {
7790
8151
  key: "readInt16",
7791
8152
  value: function readInt16() {
@@ -7820,8 +8181,8 @@ var BufferStream = /*#__PURE__*/function () {
7820
8181
  var result = "";
7821
8182
  var start = this.offset;
7822
8183
  var end = this.offset + length;
7823
- if (end >= this.buffer.byteLength) {
7824
- end = this.buffer.byteLength;
8184
+ if (end >= this.view.byteLength) {
8185
+ end = this.view.byteLength;
7825
8186
  }
7826
8187
  for (var i = start; i < end; ++i) {
7827
8188
  result += String.fromCharCode(this.view.getUint8(i));
@@ -7839,10 +8200,10 @@ var BufferStream = /*#__PURE__*/function () {
7839
8200
  }, {
7840
8201
  key: "readEncodedString",
7841
8202
  value: function readEncodedString(length) {
7842
- if (this.offset + length >= this.buffer.byteLength) {
7843
- length = this.buffer.byteLength - this.offset;
8203
+ if (this.offset + length >= this.view.byteLength) {
8204
+ length = this.view.byteLength - this.offset;
7844
8205
  }
7845
- var view = new DataView(this.buffer, this.offset, length);
8206
+ var view = new DataView(this.slice(this.offset, this.offset + length));
7846
8207
  var result = this.decoder.decode(view);
7847
8208
  this.increment(length);
7848
8209
  return result;
@@ -7859,45 +8220,21 @@ var BufferStream = /*#__PURE__*/function () {
7859
8220
  }, {
7860
8221
  key: "checkSize",
7861
8222
  value: function checkSize(step) {
7862
- if (this.offset + step > this.buffer.byteLength) {
7863
- //throw new Error("Writing exceeded the size of buffer");
7864
- //
7865
- // Resize the buffer.
7866
- // The idea is that when it is necessary to increase the buffer size,
7867
- // there will likely be more bytes which need to be written to the
7868
- // buffer in the future. Buffer allocation is costly.
7869
- // So we increase the buffer size right now
7870
- // by a larger amount than necessary, to reserve space for later
7871
- // writes which then can be done much faster. The current size of
7872
- // the buffer is the best estimate of the scale by which the size
7873
- // should increase.
7874
- // So approximately doubling the size of the buffer
7875
- // (while ensuring it fits the new data) is a simple but effective strategy.
7876
- var dstSize = this.offset + step + this.buffer.byteLength;
7877
- var dst = new ArrayBuffer(dstSize);
7878
- new Uint8Array(dst).set(new Uint8Array(this.buffer));
7879
- this.buffer = dst;
7880
- this.view = new DataView(this.buffer);
7881
- }
8223
+ this.view.checkSize(this.offset + step);
7882
8224
  }
8225
+
8226
+ /**
8227
+ * Concatenates the stream, starting from the startOffset (to allow concat
8228
+ * on an existing output from the beginning)
8229
+ */
7883
8230
  }, {
7884
8231
  key: "concat",
7885
8232
  value: function concat(stream) {
7886
- var available = this.buffer.byteLength - this.offset;
7887
- if (stream.size > available) {
7888
- var newbuf = new ArrayBuffer(this.offset + stream.size);
7889
- var int8 = new Uint8Array(newbuf);
7890
- int8.set(new Uint8Array(this.getBuffer(0, this.offset)));
7891
- int8.set(new Uint8Array(stream.getBuffer(0, stream.size)), this.offset);
7892
- this.buffer = newbuf;
7893
- this.view = new DataView(this.buffer);
7894
- } else {
7895
- var _int = new Uint8Array(this.buffer);
7896
- _int.set(new Uint8Array(stream.getBuffer(0, stream.size)), this.offset);
7897
- }
8233
+ this.view.checkSize(this.size + stream.size - stream.startOffset);
8234
+ this.view.writeBuffer(new Uint8Array(stream.slice(stream.startOffset, stream.size)), this.offset);
7898
8235
  this.offset += stream.size;
7899
8236
  this.size = this.offset;
7900
- return this.buffer.byteLength;
8237
+ return this.view.availableSize;
7901
8238
  }
7902
8239
  }, {
7903
8240
  key: "increment",
@@ -7908,14 +8245,23 @@ var BufferStream = /*#__PURE__*/function () {
7908
8245
  }
7909
8246
  return step;
7910
8247
  }
8248
+
8249
+ /**
8250
+ * Adds the buffer to the end of the current buffers list,
8251
+ * updating the size etc.
8252
+ *
8253
+ * @param {*} buffer
8254
+ * @param {*} options.start for the start of the new buffer to use
8255
+ * @param {*} options.end for the end of the buffer to use
8256
+ * @param {*} options.transfer to transfer the buffer to be owned
8257
+ */
7911
8258
  }, {
7912
- key: "getBuffer",
7913
- value: function getBuffer(start, end) {
7914
- if (!start && !end) {
7915
- start = 0;
7916
- end = this.size;
7917
- }
7918
- return this.buffer.slice(start, end);
8259
+ key: "addBuffer",
8260
+ value: function addBuffer(buffer) {
8261
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
8262
+ this.view.addBuffer(buffer, options);
8263
+ this.size = this.view.size;
8264
+ return this.size;
7919
8265
  }
7920
8266
  }, {
7921
8267
  key: "more",
@@ -7923,10 +8269,14 @@ var BufferStream = /*#__PURE__*/function () {
7923
8269
  if (this.offset + length > this.endOffset) {
7924
8270
  throw new Error("Request more than currently allocated buffer");
7925
8271
  }
7926
- var newBuf = new ReadBufferStream(this.buffer, null, {
7927
- start: this.offset,
7928
- stop: this.offset + length
7929
- });
8272
+
8273
+ // Optimize the more implementation to choose between a slice and
8274
+ // a sub-string reference to the original set of views.
8275
+ // const newBuf = new ReadBufferStream(this.buffer, null, {
8276
+ // start: this.offset,
8277
+ // stop: this.offset + length
8278
+ // });
8279
+ var newBuf = new ReadBufferStream(this.slice(this.offset, this.offset + length));
7930
8280
  this.increment(length);
7931
8281
  return newBuf;
7932
8282
  }
@@ -7939,12 +8289,12 @@ var BufferStream = /*#__PURE__*/function () {
7939
8289
  }, {
7940
8290
  key: "end",
7941
8291
  value: function end() {
7942
- return this.offset >= this.buffer.byteLength;
8292
+ return this.offset >= this.view.byteLength;
7943
8293
  }
7944
8294
  }, {
7945
8295
  key: "toEnd",
7946
8296
  value: function toEnd() {
7947
- this.offset = this.buffer.byteLength;
8297
+ this.offset = this.view.byteLength;
7948
8298
  }
7949
8299
  }]);
7950
8300
  return BufferStream;
@@ -7952,6 +8302,7 @@ var BufferStream = /*#__PURE__*/function () {
7952
8302
  var ReadBufferStream = /*#__PURE__*/function (_BufferStream) {
7953
8303
  _inherits(ReadBufferStream, _BufferStream);
7954
8304
  function ReadBufferStream(buffer, littleEndian) {
8305
+ var _ref, _options$start;
7955
8306
  var _this;
7956
8307
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
7957
8308
  start: null,
@@ -7959,13 +8310,20 @@ var ReadBufferStream = /*#__PURE__*/function (_BufferStream) {
7959
8310
  noCopy: false
7960
8311
  };
7961
8312
  _classCallCheck(this, ReadBufferStream);
7962
- _this = _callSuper(this, ReadBufferStream, [buffer, littleEndian]);
7963
- _this.offset = options.start || 0;
7964
- _this.size = options.stop || _this.buffer.byteLength;
8313
+ _this = _callSuper(this, ReadBufferStream, [{
8314
+ littleEndian: littleEndian
8315
+ }]);
7965
8316
  _this.noCopy = options.noCopy;
8317
+ _this.decoder = new TextDecoder("latin1");
8318
+ if (buffer instanceof BufferStream) {
8319
+ _this.view.from(buffer.view, options);
8320
+ } else if (buffer) {
8321
+ _this.view.addBuffer(buffer);
8322
+ }
8323
+ _this.offset = (_ref = (_options$start = options.start) !== null && _options$start !== void 0 ? _options$start : buffer === null || buffer === void 0 ? void 0 : buffer.offset) !== null && _ref !== void 0 ? _ref : 0;
8324
+ _this.size = options.stop || (buffer === null || buffer === void 0 ? void 0 : buffer.size) || (buffer === null || buffer === void 0 ? void 0 : buffer.byteLength) || 0;
7966
8325
  _this.startOffset = _this.offset;
7967
8326
  _this.endOffset = _this.size;
7968
- _this.decoder = new TextDecoder("latin1");
7969
8327
  return _this;
7970
8328
  }
7971
8329
  _createClass(ReadBufferStream, [{
@@ -7973,18 +8331,6 @@ var ReadBufferStream = /*#__PURE__*/function (_BufferStream) {
7973
8331
  value: function setDecoder(decoder) {
7974
8332
  this.decoder = decoder;
7975
8333
  }
7976
- }, {
7977
- key: "getBuffer",
7978
- value: function getBuffer(start, end) {
7979
- if (this.noCopy) {
7980
- return new Uint8Array(this.buffer, start, end - start);
7981
- }
7982
- if (!start && !end) {
7983
- start = 0;
7984
- end = this.size;
7985
- }
7986
- return this.buffer.slice(start, end);
7987
- }
7988
8334
  }, {
7989
8335
  key: "reset",
7990
8336
  value: function reset() {
@@ -8085,10 +8431,13 @@ var DeflatedReadBufferStream = /*#__PURE__*/function (_ReadBufferStream) {
8085
8431
  }(ReadBufferStream);
8086
8432
  var WriteBufferStream = /*#__PURE__*/function (_BufferStream2) {
8087
8433
  _inherits(WriteBufferStream, _BufferStream2);
8088
- function WriteBufferStream(buffer, littleEndian) {
8434
+ function WriteBufferStream(defaultSize, littleEndian) {
8089
8435
  var _this2;
8090
8436
  _classCallCheck(this, WriteBufferStream);
8091
- _this2 = _callSuper(this, WriteBufferStream, [buffer, littleEndian]);
8437
+ _this2 = _callSuper(this, WriteBufferStream, [{
8438
+ defaultSize: defaultSize,
8439
+ littleEndian: littleEndian
8440
+ }]);
8092
8441
  _this2.size = 0;
8093
8442
  return _this2;
8094
8443
  }
@@ -9435,14 +9784,14 @@ var DateTime = /*#__PURE__*/function (_AsciiStringRepresent6) {
9435
9784
  var FloatingPointSingle = /*#__PURE__*/function (_ValueRepresentation5) {
9436
9785
  _inherits(FloatingPointSingle, _ValueRepresentation5);
9437
9786
  function FloatingPointSingle() {
9438
- var _this10;
9787
+ var _this0;
9439
9788
  _classCallCheck(this, FloatingPointSingle);
9440
- _this10 = _callSuper(this, FloatingPointSingle, ["FL"]);
9441
- _this10.maxLength = 4;
9442
- _this10.padByte = PADDING_NULL;
9443
- _this10.fixed = true;
9444
- _this10.defaultValue = 0.0;
9445
- return _this10;
9789
+ _this0 = _callSuper(this, FloatingPointSingle, ["FL"]);
9790
+ _this0.maxLength = 4;
9791
+ _this0.padByte = PADDING_NULL;
9792
+ _this0.fixed = true;
9793
+ _this0.defaultValue = 0.0;
9794
+ return _this0;
9446
9795
  }
9447
9796
  _createClass(FloatingPointSingle, [{
9448
9797
  key: "readBytes",
@@ -9465,14 +9814,14 @@ var FloatingPointSingle = /*#__PURE__*/function (_ValueRepresentation5) {
9465
9814
  var FloatingPointDouble = /*#__PURE__*/function (_ValueRepresentation6) {
9466
9815
  _inherits(FloatingPointDouble, _ValueRepresentation6);
9467
9816
  function FloatingPointDouble() {
9468
- var _this11;
9817
+ var _this1;
9469
9818
  _classCallCheck(this, FloatingPointDouble);
9470
- _this11 = _callSuper(this, FloatingPointDouble, ["FD"]);
9471
- _this11.maxLength = 8;
9472
- _this11.padByte = PADDING_NULL;
9473
- _this11.fixed = true;
9474
- _this11.defaultValue = 0.0;
9475
- return _this11;
9819
+ _this1 = _callSuper(this, FloatingPointDouble, ["FD"]);
9820
+ _this1.maxLength = 8;
9821
+ _this1.padByte = PADDING_NULL;
9822
+ _this1.fixed = true;
9823
+ _this1.defaultValue = 0.0;
9824
+ return _this1;
9476
9825
  }
9477
9826
  _createClass(FloatingPointDouble, [{
9478
9827
  key: "readBytes",
@@ -9495,12 +9844,12 @@ var FloatingPointDouble = /*#__PURE__*/function (_ValueRepresentation6) {
9495
9844
  var IntegerString = /*#__PURE__*/function (_NumericStringReprese2) {
9496
9845
  _inherits(IntegerString, _NumericStringReprese2);
9497
9846
  function IntegerString() {
9498
- var _this12;
9847
+ var _this10;
9499
9848
  _classCallCheck(this, IntegerString);
9500
- _this12 = _callSuper(this, IntegerString, ["IS"]);
9501
- _this12.maxLength = 12;
9502
- _this12.padByte = PADDING_SPACE;
9503
- return _this12;
9849
+ _this10 = _callSuper(this, IntegerString, ["IS"]);
9850
+ _this10.maxLength = 12;
9851
+ _this10.padByte = PADDING_SPACE;
9852
+ return _this10;
9504
9853
  }
9505
9854
  _createClass(IntegerString, [{
9506
9855
  key: "applyFormatting",
@@ -9523,9 +9872,9 @@ var IntegerString = /*#__PURE__*/function (_NumericStringReprese2) {
9523
9872
  }, {
9524
9873
  key: "writeBytes",
9525
9874
  value: function writeBytes(stream, value, writeOptions) {
9526
- var _this13 = this;
9875
+ var _this11 = this;
9527
9876
  var val = Array.isArray(value) ? value.map(function (is) {
9528
- return _this13.convertToString(is);
9877
+ return _this11.convertToString(is);
9529
9878
  }) : [this.convertToString(value)];
9530
9879
  return _get(_getPrototypeOf(IntegerString.prototype), "writeBytes", this).call(this, stream, val, writeOptions);
9531
9880
  }
@@ -9535,12 +9884,12 @@ var IntegerString = /*#__PURE__*/function (_NumericStringReprese2) {
9535
9884
  var LongString = /*#__PURE__*/function (_EncodedStringReprese) {
9536
9885
  _inherits(LongString, _EncodedStringReprese);
9537
9886
  function LongString() {
9538
- var _this14;
9887
+ var _this12;
9539
9888
  _classCallCheck(this, LongString);
9540
- _this14 = _callSuper(this, LongString, ["LO"]);
9541
- _this14.maxCharLength = 64;
9542
- _this14.padByte = PADDING_SPACE;
9543
- return _this14;
9889
+ _this12 = _callSuper(this, LongString, ["LO"]);
9890
+ _this12.maxCharLength = 64;
9891
+ _this12.padByte = PADDING_SPACE;
9892
+ return _this12;
9544
9893
  }
9545
9894
  _createClass(LongString, [{
9546
9895
  key: "readBytes",
@@ -9558,12 +9907,12 @@ var LongString = /*#__PURE__*/function (_EncodedStringReprese) {
9558
9907
  var LongText = /*#__PURE__*/function (_EncodedStringReprese2) {
9559
9908
  _inherits(LongText, _EncodedStringReprese2);
9560
9909
  function LongText() {
9561
- var _this15;
9910
+ var _this13;
9562
9911
  _classCallCheck(this, LongText);
9563
- _this15 = _callSuper(this, LongText, ["LT"]);
9564
- _this15.maxCharLength = 10240;
9565
- _this15.padByte = PADDING_SPACE;
9566
- return _this15;
9912
+ _this13 = _callSuper(this, LongText, ["LT"]);
9913
+ _this13.maxCharLength = 10240;
9914
+ _this13.padByte = PADDING_SPACE;
9915
+ return _this13;
9567
9916
  }
9568
9917
  _createClass(LongText, [{
9569
9918
  key: "readBytes",
@@ -9581,12 +9930,12 @@ var LongText = /*#__PURE__*/function (_EncodedStringReprese2) {
9581
9930
  var PersonName = /*#__PURE__*/function (_EncodedStringReprese3) {
9582
9931
  _inherits(PersonName, _EncodedStringReprese3);
9583
9932
  function PersonName() {
9584
- var _this16;
9933
+ var _this14;
9585
9934
  _classCallCheck(this, PersonName);
9586
- _this16 = _callSuper(this, PersonName, ["PN"]);
9587
- _this16.maxLength = null;
9588
- _this16.padByte = PADDING_SPACE;
9589
- return _this16;
9935
+ _this14 = _callSuper(this, PersonName, ["PN"]);
9936
+ _this14.maxLength = null;
9937
+ _this14.padByte = PADDING_SPACE;
9938
+ return _this14;
9590
9939
  }
9591
9940
  _createClass(PersonName, [{
9592
9941
  key: "addValueAccessors",
@@ -9696,12 +10045,12 @@ var PersonName = /*#__PURE__*/function (_EncodedStringReprese3) {
9696
10045
  var ShortString = /*#__PURE__*/function (_EncodedStringReprese4) {
9697
10046
  _inherits(ShortString, _EncodedStringReprese4);
9698
10047
  function ShortString() {
9699
- var _this17;
10048
+ var _this15;
9700
10049
  _classCallCheck(this, ShortString);
9701
- _this17 = _callSuper(this, ShortString, ["SH"]);
9702
- _this17.maxCharLength = 16;
9703
- _this17.padByte = PADDING_SPACE;
9704
- return _this17;
10050
+ _this15 = _callSuper(this, ShortString, ["SH"]);
10051
+ _this15.maxCharLength = 16;
10052
+ _this15.padByte = PADDING_SPACE;
10053
+ return _this15;
9705
10054
  }
9706
10055
  _createClass(ShortString, [{
9707
10056
  key: "readBytes",
@@ -9719,14 +10068,14 @@ var ShortString = /*#__PURE__*/function (_EncodedStringReprese4) {
9719
10068
  var SignedLong = /*#__PURE__*/function (_ValueRepresentation7) {
9720
10069
  _inherits(SignedLong, _ValueRepresentation7);
9721
10070
  function SignedLong() {
9722
- var _this18;
10071
+ var _this16;
9723
10072
  _classCallCheck(this, SignedLong);
9724
- _this18 = _callSuper(this, SignedLong, ["SL"]);
9725
- _this18.maxLength = 4;
9726
- _this18.padByte = PADDING_NULL;
9727
- _this18.fixed = true;
9728
- _this18.defaultValue = 0;
9729
- return _this18;
10073
+ _this16 = _callSuper(this, SignedLong, ["SL"]);
10074
+ _this16.maxLength = 4;
10075
+ _this16.padByte = PADDING_NULL;
10076
+ _this16.fixed = true;
10077
+ _this16.defaultValue = 0;
10078
+ return _this16;
9730
10079
  }
9731
10080
  _createClass(SignedLong, [{
9732
10081
  key: "readBytes",
@@ -9744,14 +10093,14 @@ var SignedLong = /*#__PURE__*/function (_ValueRepresentation7) {
9744
10093
  var SequenceOfItems = /*#__PURE__*/function (_ValueRepresentation8) {
9745
10094
  _inherits(SequenceOfItems, _ValueRepresentation8);
9746
10095
  function SequenceOfItems() {
9747
- var _this19;
10096
+ var _this17;
9748
10097
  _classCallCheck(this, SequenceOfItems);
9749
- _this19 = _callSuper(this, SequenceOfItems, ["SQ"]);
9750
- _this19.maxLength = null;
9751
- _this19.padByte = PADDING_NULL;
9752
- _this19.noMultiple = true;
9753
- _this19._storeRaw = false;
9754
- return _this19;
10098
+ _this17 = _callSuper(this, SequenceOfItems, ["SQ"]);
10099
+ _this17.maxLength = null;
10100
+ _this17.padByte = PADDING_NULL;
10101
+ _this17.noMultiple = true;
10102
+ _this17._storeRaw = false;
10103
+ return _this17;
9755
10104
  }
9756
10105
  _createClass(SequenceOfItems, [{
9757
10106
  key: "readBytes",
@@ -9762,8 +10111,6 @@ var SequenceOfItems = /*#__PURE__*/function (_ValueRepresentation8) {
9762
10111
  var undefLength = sqlength == 0xffffffff,
9763
10112
  elements = [],
9764
10113
  read = 0;
9765
-
9766
- /* eslint-disable-next-line no-constant-condition */
9767
10114
  while (true) {
9768
10115
  var tag = Tag$1.readTag(stream),
9769
10116
  length = null;
@@ -9872,15 +10219,15 @@ var SequenceOfItems = /*#__PURE__*/function (_ValueRepresentation8) {
9872
10219
  var SignedShort = /*#__PURE__*/function (_ValueRepresentation9) {
9873
10220
  _inherits(SignedShort, _ValueRepresentation9);
9874
10221
  function SignedShort() {
9875
- var _this20;
10222
+ var _this18;
9876
10223
  _classCallCheck(this, SignedShort);
9877
- _this20 = _callSuper(this, SignedShort, ["SS"]);
9878
- _this20.maxLength = 2;
9879
- _this20.valueLength = 2;
9880
- _this20.padByte = PADDING_NULL;
9881
- _this20.fixed = true;
9882
- _this20.defaultValue = 0;
9883
- return _this20;
10224
+ _this18 = _callSuper(this, SignedShort, ["SS"]);
10225
+ _this18.maxLength = 2;
10226
+ _this18.valueLength = 2;
10227
+ _this18.padByte = PADDING_NULL;
10228
+ _this18.fixed = true;
10229
+ _this18.defaultValue = 0;
10230
+ return _this18;
9884
10231
  }
9885
10232
  _createClass(SignedShort, [{
9886
10233
  key: "readBytes",
@@ -9898,12 +10245,12 @@ var SignedShort = /*#__PURE__*/function (_ValueRepresentation9) {
9898
10245
  var ShortText = /*#__PURE__*/function (_EncodedStringReprese5) {
9899
10246
  _inherits(ShortText, _EncodedStringReprese5);
9900
10247
  function ShortText() {
9901
- var _this21;
10248
+ var _this19;
9902
10249
  _classCallCheck(this, ShortText);
9903
- _this21 = _callSuper(this, ShortText, ["ST"]);
9904
- _this21.maxCharLength = 1024;
9905
- _this21.padByte = PADDING_SPACE;
9906
- return _this21;
10250
+ _this19 = _callSuper(this, ShortText, ["ST"]);
10251
+ _this19.maxCharLength = 1024;
10252
+ _this19.padByte = PADDING_SPACE;
10253
+ return _this19;
9907
10254
  }
9908
10255
  _createClass(ShortText, [{
9909
10256
  key: "readBytes",
@@ -9921,13 +10268,13 @@ var ShortText = /*#__PURE__*/function (_EncodedStringReprese5) {
9921
10268
  var TimeValue = /*#__PURE__*/function (_AsciiStringRepresent7) {
9922
10269
  _inherits(TimeValue, _AsciiStringRepresent7);
9923
10270
  function TimeValue() {
9924
- var _this22;
10271
+ var _this20;
9925
10272
  _classCallCheck(this, TimeValue);
9926
- _this22 = _callSuper(this, TimeValue, ["TM"]);
9927
- _this22.maxLength = 16;
9928
- _this22.rangeMatchingMaxLength = 28;
9929
- _this22.padByte = PADDING_SPACE;
9930
- return _this22;
10273
+ _this20 = _callSuper(this, TimeValue, ["TM"]);
10274
+ _this20.maxLength = 16;
10275
+ _this20.rangeMatchingMaxLength = 28;
10276
+ _this20.padByte = PADDING_SPACE;
10277
+ return _this20;
9931
10278
  }
9932
10279
  _createClass(TimeValue, [{
9933
10280
  key: "readBytes",
@@ -9954,13 +10301,13 @@ var TimeValue = /*#__PURE__*/function (_AsciiStringRepresent7) {
9954
10301
  var UnlimitedCharacters = /*#__PURE__*/function (_EncodedStringReprese6) {
9955
10302
  _inherits(UnlimitedCharacters, _EncodedStringReprese6);
9956
10303
  function UnlimitedCharacters() {
9957
- var _this23;
10304
+ var _this21;
9958
10305
  _classCallCheck(this, UnlimitedCharacters);
9959
- _this23 = _callSuper(this, UnlimitedCharacters, ["UC"]);
9960
- _this23.maxLength = null;
9961
- _this23.multi = true;
9962
- _this23.padByte = PADDING_SPACE;
9963
- return _this23;
10306
+ _this21 = _callSuper(this, UnlimitedCharacters, ["UC"]);
10307
+ _this21.maxLength = null;
10308
+ _this21.multi = true;
10309
+ _this21.padByte = PADDING_SPACE;
10310
+ return _this21;
9964
10311
  }
9965
10312
  _createClass(UnlimitedCharacters, [{
9966
10313
  key: "readBytes",
@@ -9978,12 +10325,12 @@ var UnlimitedCharacters = /*#__PURE__*/function (_EncodedStringReprese6) {
9978
10325
  var UnlimitedText = /*#__PURE__*/function (_EncodedStringReprese7) {
9979
10326
  _inherits(UnlimitedText, _EncodedStringReprese7);
9980
10327
  function UnlimitedText() {
9981
- var _this24;
10328
+ var _this22;
9982
10329
  _classCallCheck(this, UnlimitedText);
9983
- _this24 = _callSuper(this, UnlimitedText, ["UT"]);
9984
- _this24.maxLength = null;
9985
- _this24.padByte = PADDING_SPACE;
9986
- return _this24;
10330
+ _this22 = _callSuper(this, UnlimitedText, ["UT"]);
10331
+ _this22.maxLength = null;
10332
+ _this22.padByte = PADDING_SPACE;
10333
+ return _this22;
9987
10334
  }
9988
10335
  _createClass(UnlimitedText, [{
9989
10336
  key: "readBytes",
@@ -9998,17 +10345,17 @@ var UnlimitedText = /*#__PURE__*/function (_EncodedStringReprese7) {
9998
10345
  }]);
9999
10346
  return UnlimitedText;
10000
10347
  }(EncodedStringRepresentation);
10001
- var UnsignedShort = /*#__PURE__*/function (_ValueRepresentation10) {
10002
- _inherits(UnsignedShort, _ValueRepresentation10);
10348
+ var UnsignedShort = /*#__PURE__*/function (_ValueRepresentation0) {
10349
+ _inherits(UnsignedShort, _ValueRepresentation0);
10003
10350
  function UnsignedShort() {
10004
- var _this25;
10351
+ var _this23;
10005
10352
  _classCallCheck(this, UnsignedShort);
10006
- _this25 = _callSuper(this, UnsignedShort, ["US"]);
10007
- _this25.maxLength = 2;
10008
- _this25.padByte = PADDING_NULL;
10009
- _this25.fixed = true;
10010
- _this25.defaultValue = 0;
10011
- return _this25;
10353
+ _this23 = _callSuper(this, UnsignedShort, ["US"]);
10354
+ _this23.maxLength = 2;
10355
+ _this23.padByte = PADDING_NULL;
10356
+ _this23.fixed = true;
10357
+ _this23.defaultValue = 0;
10358
+ return _this23;
10012
10359
  }
10013
10360
  _createClass(UnsignedShort, [{
10014
10361
  key: "readBytes",
@@ -10023,17 +10370,17 @@ var UnsignedShort = /*#__PURE__*/function (_ValueRepresentation10) {
10023
10370
  }]);
10024
10371
  return UnsignedShort;
10025
10372
  }(ValueRepresentation);
10026
- var UnsignedLong = /*#__PURE__*/function (_ValueRepresentation11) {
10027
- _inherits(UnsignedLong, _ValueRepresentation11);
10373
+ var UnsignedLong = /*#__PURE__*/function (_ValueRepresentation1) {
10374
+ _inherits(UnsignedLong, _ValueRepresentation1);
10028
10375
  function UnsignedLong() {
10029
- var _this26;
10376
+ var _this24;
10030
10377
  _classCallCheck(this, UnsignedLong);
10031
- _this26 = _callSuper(this, UnsignedLong, ["UL"]);
10032
- _this26.maxLength = 4;
10033
- _this26.padByte = PADDING_NULL;
10034
- _this26.fixed = true;
10035
- _this26.defaultValue = 0;
10036
- return _this26;
10378
+ _this24 = _callSuper(this, UnsignedLong, ["UL"]);
10379
+ _this24.maxLength = 4;
10380
+ _this24.padByte = PADDING_NULL;
10381
+ _this24.fixed = true;
10382
+ _this24.defaultValue = 0;
10383
+ return _this24;
10037
10384
  }
10038
10385
  _createClass(UnsignedLong, [{
10039
10386
  key: "readBytes",
@@ -10051,12 +10398,12 @@ var UnsignedLong = /*#__PURE__*/function (_ValueRepresentation11) {
10051
10398
  var UniqueIdentifier = /*#__PURE__*/function (_AsciiStringRepresent8) {
10052
10399
  _inherits(UniqueIdentifier, _AsciiStringRepresent8);
10053
10400
  function UniqueIdentifier() {
10054
- var _this27;
10401
+ var _this25;
10055
10402
  _classCallCheck(this, UniqueIdentifier);
10056
- _this27 = _callSuper(this, UniqueIdentifier, ["UI"]);
10057
- _this27.maxLength = 64;
10058
- _this27.padByte = PADDING_NULL;
10059
- return _this27;
10403
+ _this25 = _callSuper(this, UniqueIdentifier, ["UI"]);
10404
+ _this25.maxLength = 64;
10405
+ _this25.padByte = PADDING_NULL;
10406
+ return _this25;
10060
10407
  }
10061
10408
  _createClass(UniqueIdentifier, [{
10062
10409
  key: "readBytes",
@@ -10095,12 +10442,12 @@ var UniqueIdentifier = /*#__PURE__*/function (_AsciiStringRepresent8) {
10095
10442
  var UniversalResource = /*#__PURE__*/function (_AsciiStringRepresent9) {
10096
10443
  _inherits(UniversalResource, _AsciiStringRepresent9);
10097
10444
  function UniversalResource() {
10098
- var _this28;
10445
+ var _this26;
10099
10446
  _classCallCheck(this, UniversalResource);
10100
- _this28 = _callSuper(this, UniversalResource, ["UR"]);
10101
- _this28.maxLength = null;
10102
- _this28.padByte = PADDING_SPACE;
10103
- return _this28;
10447
+ _this26 = _callSuper(this, UniversalResource, ["UR"]);
10448
+ _this26.maxLength = null;
10449
+ _this26.padByte = PADDING_SPACE;
10450
+ return _this26;
10104
10451
  }
10105
10452
  _createClass(UniversalResource, [{
10106
10453
  key: "readBytes",
@@ -10113,30 +10460,30 @@ var UniversalResource = /*#__PURE__*/function (_AsciiStringRepresent9) {
10113
10460
  var UnknownValue = /*#__PURE__*/function (_BinaryRepresentation) {
10114
10461
  _inherits(UnknownValue, _BinaryRepresentation);
10115
10462
  function UnknownValue() {
10116
- var _this29;
10463
+ var _this27;
10117
10464
  _classCallCheck(this, UnknownValue);
10118
- _this29 = _callSuper(this, UnknownValue, ["UN"]);
10119
- _this29.maxLength = null;
10120
- _this29.padByte = PADDING_NULL;
10121
- _this29.noMultiple = true;
10122
- return _this29;
10465
+ _this27 = _callSuper(this, UnknownValue, ["UN"]);
10466
+ _this27.maxLength = null;
10467
+ _this27.padByte = PADDING_NULL;
10468
+ _this27.noMultiple = true;
10469
+ return _this27;
10123
10470
  }
10124
10471
  return _createClass(UnknownValue);
10125
10472
  }(BinaryRepresentation);
10126
10473
  var ParsedUnknownValue = /*#__PURE__*/function (_BinaryRepresentation2) {
10127
10474
  _inherits(ParsedUnknownValue, _BinaryRepresentation2);
10128
10475
  function ParsedUnknownValue(vr) {
10129
- var _this30;
10476
+ var _this28;
10130
10477
  _classCallCheck(this, ParsedUnknownValue);
10131
- _this30 = _callSuper(this, ParsedUnknownValue, [vr]);
10132
- _this30.maxLength = null;
10133
- _this30.padByte = 0;
10134
- _this30.noMultiple = true;
10135
- _this30._isBinary = true;
10136
- _this30._allowMultiple = false;
10137
- _this30._isExplicit = true;
10138
- _this30._storeRaw = true;
10139
- return _this30;
10478
+ _this28 = _callSuper(this, ParsedUnknownValue, [vr]);
10479
+ _this28.maxLength = null;
10480
+ _this28.padByte = 0;
10481
+ _this28.noMultiple = true;
10482
+ _this28._isBinary = true;
10483
+ _this28._allowMultiple = false;
10484
+ _this28._isExplicit = true;
10485
+ _this28._storeRaw = true;
10486
+ return _this28;
10140
10487
  }
10141
10488
  _createClass(ParsedUnknownValue, [{
10142
10489
  key: "read",
@@ -10170,52 +10517,52 @@ var ParsedUnknownValue = /*#__PURE__*/function (_BinaryRepresentation2) {
10170
10517
  var OtherWordString = /*#__PURE__*/function (_BinaryRepresentation3) {
10171
10518
  _inherits(OtherWordString, _BinaryRepresentation3);
10172
10519
  function OtherWordString() {
10173
- var _this31;
10520
+ var _this29;
10174
10521
  _classCallCheck(this, OtherWordString);
10175
- _this31 = _callSuper(this, OtherWordString, ["OW"]);
10176
- _this31.maxLength = null;
10177
- _this31.padByte = PADDING_NULL;
10178
- _this31.noMultiple = true;
10179
- return _this31;
10522
+ _this29 = _callSuper(this, OtherWordString, ["OW"]);
10523
+ _this29.maxLength = null;
10524
+ _this29.padByte = PADDING_NULL;
10525
+ _this29.noMultiple = true;
10526
+ return _this29;
10180
10527
  }
10181
10528
  return _createClass(OtherWordString);
10182
10529
  }(BinaryRepresentation);
10183
10530
  var OtherByteString = /*#__PURE__*/function (_BinaryRepresentation4) {
10184
10531
  _inherits(OtherByteString, _BinaryRepresentation4);
10185
10532
  function OtherByteString() {
10186
- var _this32;
10533
+ var _this30;
10187
10534
  _classCallCheck(this, OtherByteString);
10188
- _this32 = _callSuper(this, OtherByteString, ["OB"]);
10189
- _this32.maxLength = null;
10190
- _this32.padByte = PADDING_NULL;
10191
- _this32.noMultiple = true;
10192
- return _this32;
10535
+ _this30 = _callSuper(this, OtherByteString, ["OB"]);
10536
+ _this30.maxLength = null;
10537
+ _this30.padByte = PADDING_NULL;
10538
+ _this30.noMultiple = true;
10539
+ return _this30;
10193
10540
  }
10194
10541
  return _createClass(OtherByteString);
10195
10542
  }(BinaryRepresentation);
10196
10543
  var OtherDoubleString = /*#__PURE__*/function (_BinaryRepresentation5) {
10197
10544
  _inherits(OtherDoubleString, _BinaryRepresentation5);
10198
10545
  function OtherDoubleString() {
10199
- var _this33;
10546
+ var _this31;
10200
10547
  _classCallCheck(this, OtherDoubleString);
10201
- _this33 = _callSuper(this, OtherDoubleString, ["OD"]);
10202
- _this33.maxLength = null;
10203
- _this33.padByte = PADDING_NULL;
10204
- _this33.noMultiple = true;
10205
- return _this33;
10548
+ _this31 = _callSuper(this, OtherDoubleString, ["OD"]);
10549
+ _this31.maxLength = null;
10550
+ _this31.padByte = PADDING_NULL;
10551
+ _this31.noMultiple = true;
10552
+ return _this31;
10206
10553
  }
10207
10554
  return _createClass(OtherDoubleString);
10208
10555
  }(BinaryRepresentation);
10209
10556
  var OtherFloatString = /*#__PURE__*/function (_BinaryRepresentation6) {
10210
10557
  _inherits(OtherFloatString, _BinaryRepresentation6);
10211
10558
  function OtherFloatString() {
10212
- var _this34;
10559
+ var _this32;
10213
10560
  _classCallCheck(this, OtherFloatString);
10214
- _this34 = _callSuper(this, OtherFloatString, ["OF"]);
10215
- _this34.maxLength = null;
10216
- _this34.padByte = PADDING_NULL;
10217
- _this34.noMultiple = true;
10218
- return _this34;
10561
+ _this32 = _callSuper(this, OtherFloatString, ["OF"]);
10562
+ _this32.maxLength = null;
10563
+ _this32.padByte = PADDING_NULL;
10564
+ _this32.noMultiple = true;
10565
+ return _this32;
10219
10566
  }
10220
10567
  return _createClass(OtherFloatString);
10221
10568
  }(BinaryRepresentation); // these VR instances are precreate and are reused for each requested vr/tag
@@ -11833,8 +12180,8 @@ var OPImageNormalizer = /*#__PURE__*/function (_Normalizer3) {
11833
12180
  }]);
11834
12181
  return OPImageNormalizer;
11835
12182
  }(Normalizer);
11836
- var OCTImageNormalizer = /*#__PURE__*/function (_ImageNormalizer10) {
11837
- _inherits(OCTImageNormalizer, _ImageNormalizer10);
12183
+ var OCTImageNormalizer = /*#__PURE__*/function (_ImageNormalizer0) {
12184
+ _inherits(OCTImageNormalizer, _ImageNormalizer0);
11838
12185
  function OCTImageNormalizer() {
11839
12186
  _classCallCheck(this, OCTImageNormalizer);
11840
12187
  return _callSuper(this, OCTImageNormalizer, arguments);
@@ -17084,7 +17431,7 @@ function generateToolState$1(imageIds, arrayBuffer, metadataProvider) {
17084
17431
  var SeriesInstanceUID = generalSeriesModule.seriesInstanceUID;
17085
17432
  var ImageOrientationPatient;
17086
17433
  var validOrientations;
17087
- var hasCoordinateSystem = ("FrameOfReferenceUID" in multiframe);
17434
+ var hasCoordinateSystem = "FrameOfReferenceUID" in multiframe;
17088
17435
  if (hasCoordinateSystem) {
17089
17436
  if (!imagePlaneModule) {
17090
17437
  console.warn("Insufficient metadata, imagePlaneModule missing.");
@@ -17287,7 +17634,7 @@ function checkSEGsOverlapping(pixelData, multiframe, imageIds, validOrientations
17287
17634
  var PerFrameFunctionalGroups = PerFrameFunctionalGroupsSequence[_frameSegment];
17288
17635
  var pixelDataI2D = ndarray$1(new Uint8Array(pixelData.buffer, _frameSegment * sliceLength, sliceLength), [Rows, Columns]);
17289
17636
  var alignedPixelDataI = void 0;
17290
- var hasCoordinateSystem = ("FrameOfReferenceUID" in multiframe);
17637
+ var hasCoordinateSystem = "FrameOfReferenceUID" in multiframe;
17291
17638
  if (hasCoordinateSystem) {
17292
17639
  var ImageOrientationPatientI = sharedImageOrientationPatient || PerFrameFunctionalGroups.PlaneOrientationSequence.ImageOrientationPatient;
17293
17640
  alignedPixelDataI = alignPixelDataWithSourceData(pixelDataI2D, ImageOrientationPatientI, validOrientations, tolerance);
@@ -17358,7 +17705,7 @@ function insertOverlappingPixelDataPlanar(segmentsOnFrame, segmentsOnFrameArray,
17358
17705
  }
17359
17706
  var pixelDataI2D = ndarray$1(new Uint8Array(pixelData.buffer, _i2 * sliceLength, sliceLength), [Rows, Columns]);
17360
17707
  var alignedPixelDataI;
17361
- var hasCoordinateSystem = ("FrameOfReferenceUID" in multiframe);
17708
+ var hasCoordinateSystem = "FrameOfReferenceUID" in multiframe;
17362
17709
  if (hasCoordinateSystem) {
17363
17710
  var ImageOrientationPatientI = sharedImageOrientationPatient || PerFrameFunctionalGroups.PlaneOrientationSequence.ImageOrientationPatient;
17364
17711
  alignedPixelDataI = alignPixelDataWithSourceData(pixelDataI2D, ImageOrientationPatientI, validOrientations, tolerance);
@@ -17448,7 +17795,7 @@ function insertPixelDataPlanar(segmentsOnFrame, segmentsOnFrameArray, labelmapBu
17448
17795
  var PerFrameFunctionalGroups = PerFrameFunctionalGroupsSequence[i];
17449
17796
  var pixelDataI2D = ndarray$1(new Uint8Array(pixelData.buffer, i * sliceLength, sliceLength), [Rows, Columns]);
17450
17797
  var alignedPixelDataI;
17451
- var hasCoordinateSystem = ("FrameOfReferenceUID" in multiframe);
17798
+ var hasCoordinateSystem = "FrameOfReferenceUID" in multiframe;
17452
17799
  if (hasCoordinateSystem) {
17453
17800
  var ImageOrientationPatientI = sharedImageOrientationPatient || PerFrameFunctionalGroups.PlaneOrientationSequence.ImageOrientationPatient;
17454
17801
  alignedPixelDataI = alignPixelDataWithSourceData(pixelDataI2D, ImageOrientationPatientI, validOrientations, tolerance);
@@ -21308,7 +21655,7 @@ var ContentSequence = /*#__PURE__*/function (_Array) {
21308
21655
  // filterBy(options) {
21309
21656
  // }
21310
21657
  return _createClass(ContentSequence);
21311
- }( /*#__PURE__*/_wrapNativeSuper(Array));
21658
+ }(/*#__PURE__*/_wrapNativeSuper(Array));
21312
21659
  var ContentItem = /*#__PURE__*/_createClass(function ContentItem(options) {
21313
21660
  _classCallCheck(this, ContentItem);
21314
21661
  if (options.name === undefined) {
@@ -21553,12 +21900,12 @@ var ContainerContentItem = /*#__PURE__*/function (_ContentItem9) {
21553
21900
  }
21554
21901
  return _createClass(ContainerContentItem);
21555
21902
  }(ContentItem);
21556
- var CompositeContentItem = /*#__PURE__*/function (_ContentItem10) {
21557
- _inherits(CompositeContentItem, _ContentItem10);
21903
+ var CompositeContentItem = /*#__PURE__*/function (_ContentItem0) {
21904
+ _inherits(CompositeContentItem, _ContentItem0);
21558
21905
  function CompositeContentItem(options) {
21559
- var _this10;
21906
+ var _this0;
21560
21907
  _classCallCheck(this, CompositeContentItem);
21561
- _this10 = _callSuper(this, CompositeContentItem, [{
21908
+ _this0 = _callSuper(this, CompositeContentItem, [{
21562
21909
  name: options.name,
21563
21910
  relationshipType: options.relationshipType,
21564
21911
  valueType: ValueTypes.COMPOSITE
@@ -21578,17 +21925,17 @@ var CompositeContentItem = /*#__PURE__*/function (_ContentItem10) {
21578
21925
  var item = {};
21579
21926
  item.ReferencedSOPClassUID = options.referencedSOPClassUID;
21580
21927
  item.ReferencedSOPInstanceUID = options.referencedSOPInstanceUID;
21581
- _this10.ReferenceSOPSequence = [item];
21582
- return _this10;
21928
+ _this0.ReferenceSOPSequence = [item];
21929
+ return _this0;
21583
21930
  }
21584
21931
  return _createClass(CompositeContentItem);
21585
21932
  }(ContentItem);
21586
- var ImageContentItem = /*#__PURE__*/function (_ContentItem11) {
21587
- _inherits(ImageContentItem, _ContentItem11);
21933
+ var ImageContentItem = /*#__PURE__*/function (_ContentItem1) {
21934
+ _inherits(ImageContentItem, _ContentItem1);
21588
21935
  function ImageContentItem(options) {
21589
- var _this11;
21936
+ var _this1;
21590
21937
  _classCallCheck(this, ImageContentItem);
21591
- _this11 = _callSuper(this, ImageContentItem, [{
21938
+ _this1 = _callSuper(this, ImageContentItem, [{
21592
21939
  name: options.name,
21593
21940
  relationshipType: options.relationshipType,
21594
21941
  valueType: ValueTypes.IMAGE
@@ -21622,17 +21969,17 @@ var ImageContentItem = /*#__PURE__*/function (_ContentItem11) {
21622
21969
  // FIXME: value multiplicity
21623
21970
  item.ReferencedSegmentNumber = options.referencedSegmentNumbers;
21624
21971
  }
21625
- _this11.ReferencedSOPSequence = [item];
21626
- return _this11;
21972
+ _this1.ReferencedSOPSequence = [item];
21973
+ return _this1;
21627
21974
  }
21628
21975
  return _createClass(ImageContentItem);
21629
21976
  }(ContentItem);
21630
- var ScoordContentItem = /*#__PURE__*/function (_ContentItem12) {
21631
- _inherits(ScoordContentItem, _ContentItem12);
21977
+ var ScoordContentItem = /*#__PURE__*/function (_ContentItem10) {
21978
+ _inherits(ScoordContentItem, _ContentItem10);
21632
21979
  function ScoordContentItem(options) {
21633
- var _this12;
21980
+ var _this10;
21634
21981
  _classCallCheck(this, ScoordContentItem);
21635
- _this12 = _callSuper(this, ScoordContentItem, [{
21982
+ _this10 = _callSuper(this, ScoordContentItem, [{
21636
21983
  name: options.name,
21637
21984
  relationshipType: options.relationshipType,
21638
21985
  valueType: ValueTypes.SCOORD
@@ -21655,7 +22002,7 @@ var ScoordContentItem = /*#__PURE__*/function (_ContentItem12) {
21655
22002
  if (options.graphicData[0] instanceof Array) {
21656
22003
  options.graphicData = [].concat.apply([], options.graphicData);
21657
22004
  }
21658
- _this12.GraphicData = options.graphicData;
22005
+ _this10.GraphicData = options.graphicData;
21659
22006
  options.pixelOriginInterpretation = options.pixelOriginInterpretation || PixelOriginInterpretations.VOLUME;
21660
22007
  if (!(typeof options.pixelOriginInterpretation === "string" || options.pixelOriginInterpretation instanceof String)) {
21661
22008
  throw new Error("Option 'pixelOriginInterpretation' must have type String.");
@@ -21667,18 +22014,18 @@ var ScoordContentItem = /*#__PURE__*/function (_ContentItem12) {
21667
22014
  if (!(typeof options.fiducialUID === "string" || options.fiducialUID instanceof String)) {
21668
22015
  throw new Error("Option 'fiducialUID' must have type String.");
21669
22016
  }
21670
- _this12.FiducialUID = options.fiducialUID;
22017
+ _this10.FiducialUID = options.fiducialUID;
21671
22018
  }
21672
- return _this12;
22019
+ return _this10;
21673
22020
  }
21674
22021
  return _createClass(ScoordContentItem);
21675
22022
  }(ContentItem);
21676
- var Scoord3DContentItem = /*#__PURE__*/function (_ContentItem13) {
21677
- _inherits(Scoord3DContentItem, _ContentItem13);
22023
+ var Scoord3DContentItem = /*#__PURE__*/function (_ContentItem11) {
22024
+ _inherits(Scoord3DContentItem, _ContentItem11);
21678
22025
  function Scoord3DContentItem(options) {
21679
- var _this13;
22026
+ var _this11;
21680
22027
  _classCallCheck(this, Scoord3DContentItem);
21681
- _this13 = _callSuper(this, Scoord3DContentItem, [{
22028
+ _this11 = _callSuper(this, Scoord3DContentItem, [{
21682
22029
  name: options.name,
21683
22030
  relationshipType: options.relationshipType,
21684
22031
  valueType: ValueTypes.SCOORD3D
@@ -21701,31 +22048,31 @@ var Scoord3DContentItem = /*#__PURE__*/function (_ContentItem13) {
21701
22048
  if (options.graphicData[0] instanceof Array) {
21702
22049
  options.graphicData = [].concat.apply([], options.graphicData);
21703
22050
  }
21704
- _this13.GraphicType = options.graphicType;
21705
- _this13.GraphicData = options.graphicData;
22051
+ _this11.GraphicType = options.graphicType;
22052
+ _this11.GraphicData = options.graphicData;
21706
22053
  if (options.frameOfReferenceUID === undefined) {
21707
22054
  throw new Error("Option 'frameOfReferenceUID' is required for Scoord3DContentItem.");
21708
22055
  }
21709
22056
  if (!(typeof options.frameOfReferenceUID === "string" || options.frameOfReferenceUID instanceof String)) {
21710
22057
  throw new Error("Option 'frameOfReferenceUID' must have type String.");
21711
22058
  }
21712
- _this13.ReferencedFrameOfReferenceUID = options.frameOfReferenceUID;
22059
+ _this11.ReferencedFrameOfReferenceUID = options.frameOfReferenceUID;
21713
22060
  if ("fiducialUID" in options) {
21714
22061
  if (!(typeof options.fiducialUID === "string" || options.fiducialUID instanceof String)) {
21715
22062
  throw new Error("Option 'fiducialUID' must have type String.");
21716
22063
  }
21717
- _this13.FiducialUID = options.fiducialUID;
22064
+ _this11.FiducialUID = options.fiducialUID;
21718
22065
  }
21719
- return _this13;
22066
+ return _this11;
21720
22067
  }
21721
22068
  return _createClass(Scoord3DContentItem);
21722
22069
  }(ContentItem);
21723
- var TcoordContentItem = /*#__PURE__*/function (_ContentItem14) {
21724
- _inherits(TcoordContentItem, _ContentItem14);
22070
+ var TcoordContentItem = /*#__PURE__*/function (_ContentItem12) {
22071
+ _inherits(TcoordContentItem, _ContentItem12);
21725
22072
  function TcoordContentItem(options) {
21726
- var _this14;
22073
+ var _this12;
21727
22074
  _classCallCheck(this, TcoordContentItem);
21728
- _this14 = _callSuper(this, TcoordContentItem, [{
22075
+ _this12 = _callSuper(this, TcoordContentItem, [{
21729
22076
  name: options.name,
21730
22077
  relationshipType: options.relationshipType,
21731
22078
  valueType: ValueTypes.TCOORD
@@ -21741,22 +22088,22 @@ var TcoordContentItem = /*#__PURE__*/function (_ContentItem14) {
21741
22088
  throw new Error("Option 'referencedSamplePositions' must have type Array.");
21742
22089
  }
21743
22090
  // TODO: ensure values are integers
21744
- _this14.ReferencedSamplePositions = options.referencedSamplePositions;
22091
+ _this12.ReferencedSamplePositions = options.referencedSamplePositions;
21745
22092
  } else if (options.referencedTimeOffsets === undefined) {
21746
22093
  if (!(_typeof(options.referencedTimeOffsets) === "object" || options.referencedTimeOffsets instanceof Array)) {
21747
22094
  throw new Error("Option 'referencedTimeOffsets' must have type Array.");
21748
22095
  }
21749
22096
  // TODO: ensure values are floats
21750
- _this14.ReferencedTimeOffsets = options.referencedTimeOffsets;
22097
+ _this12.ReferencedTimeOffsets = options.referencedTimeOffsets;
21751
22098
  } else if (options.referencedDateTime === undefined) {
21752
22099
  if (!(_typeof(options.referencedDateTime) === "object" || options.referencedDateTime instanceof Array)) {
21753
22100
  throw new Error("Option 'referencedDateTime' must have type Array.");
21754
22101
  }
21755
- _this14.ReferencedDateTime = options.referencedDateTime;
22102
+ _this12.ReferencedDateTime = options.referencedDateTime;
21756
22103
  } else {
21757
22104
  throw new Error("One of the following options is required for TcoordContentItem: " + "'referencedSamplePositions', 'referencedTimeOffsets', or " + "'referencedDateTime'.");
21758
22105
  }
21759
- return _this14;
22106
+ return _this12;
21760
22107
  }
21761
22108
  return _createClass(TcoordContentItem);
21762
22109
  }(ContentItem);
@@ -22445,11 +22792,11 @@ var ObservationContext = /*#__PURE__*/function (_Template5) {
22445
22792
  (_this9 = _this7).push.apply(_this9, _toConsumableArray(options.observerDeviceContext));
22446
22793
  }
22447
22794
  if (options.subjectContext !== undefined) {
22448
- var _this10;
22795
+ var _this0;
22449
22796
  if (options.subjectContext.constructor !== SubjectContext) {
22450
22797
  throw new Error("Option 'subjectContext' must have type SubjectContext");
22451
22798
  }
22452
- (_this10 = _this7).push.apply(_this10, _toConsumableArray(options.subjectContext));
22799
+ (_this0 = _this7).push.apply(_this0, _toConsumableArray(options.subjectContext));
22453
22800
  }
22454
22801
  return _this7;
22455
22802
  }
@@ -22458,10 +22805,10 @@ var ObservationContext = /*#__PURE__*/function (_Template5) {
22458
22805
  var ObserverContext = /*#__PURE__*/function (_Template6) {
22459
22806
  _inherits(ObserverContext, _Template6);
22460
22807
  function ObserverContext(options) {
22461
- var _this12;
22462
- var _this11;
22808
+ var _this10;
22809
+ var _this1;
22463
22810
  _classCallCheck(this, ObserverContext);
22464
- _this11 = _callSuper(this, ObserverContext);
22811
+ _this1 = _callSuper(this, ObserverContext);
22465
22812
  if (options.observerType === undefined) {
22466
22813
  throw new Error("Option 'observerType' is required for ObserverContext.");
22467
22814
  } else {
@@ -22478,7 +22825,7 @@ var ObserverContext = /*#__PURE__*/function (_Template6) {
22478
22825
  value: options.observerType,
22479
22826
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22480
22827
  });
22481
- _this11.push(observerTypeItem);
22828
+ _this1.push(observerTypeItem);
22482
22829
  if (options.observerIdentifyingAttributes === undefined) {
22483
22830
  throw new Error("Option 'observerIdentifyingAttributes' is required for ObserverContext.");
22484
22831
  }
@@ -22504,17 +22851,17 @@ var ObserverContext = /*#__PURE__*/function (_Template6) {
22504
22851
  } else {
22505
22852
  throw new Error("Option 'oberverType' must be either 'Person' or 'Device'.");
22506
22853
  }
22507
- (_this12 = _this11).push.apply(_this12, _toConsumableArray(options.observerIdentifyingAttributes));
22508
- return _this11;
22854
+ (_this10 = _this1).push.apply(_this10, _toConsumableArray(options.observerIdentifyingAttributes));
22855
+ return _this1;
22509
22856
  }
22510
22857
  return _createClass(ObserverContext);
22511
22858
  }(Template);
22512
22859
  var PersonObserverIdentifyingAttributes = /*#__PURE__*/function (_Template7) {
22513
22860
  _inherits(PersonObserverIdentifyingAttributes, _Template7);
22514
22861
  function PersonObserverIdentifyingAttributes(options) {
22515
- var _this13;
22862
+ var _this11;
22516
22863
  _classCallCheck(this, PersonObserverIdentifyingAttributes);
22517
- _this13 = _callSuper(this, PersonObserverIdentifyingAttributes);
22864
+ _this11 = _callSuper(this, PersonObserverIdentifyingAttributes);
22518
22865
  if (options.name === undefined) {
22519
22866
  throw new Error("Option 'name' is required for PersonObserverIdentifyingAttributes.");
22520
22867
  }
@@ -22527,7 +22874,7 @@ var PersonObserverIdentifyingAttributes = /*#__PURE__*/function (_Template7) {
22527
22874
  value: options.name,
22528
22875
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22529
22876
  });
22530
- _this13.push(nameItem);
22877
+ _this11.push(nameItem);
22531
22878
  if (options.loginName !== undefined) {
22532
22879
  var loginNameItem = new TextContentItem({
22533
22880
  name: new CodedConcept({
@@ -22538,7 +22885,7 @@ var PersonObserverIdentifyingAttributes = /*#__PURE__*/function (_Template7) {
22538
22885
  value: options.loginName,
22539
22886
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22540
22887
  });
22541
- _this13.push(loginNameItem);
22888
+ _this11.push(loginNameItem);
22542
22889
  }
22543
22890
  if (options.organizationName !== undefined) {
22544
22891
  var organizationNameItem = new TextContentItem({
@@ -22550,7 +22897,7 @@ var PersonObserverIdentifyingAttributes = /*#__PURE__*/function (_Template7) {
22550
22897
  value: options.organizationName,
22551
22898
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22552
22899
  });
22553
- _this13.push(organizationNameItem);
22900
+ _this11.push(organizationNameItem);
22554
22901
  }
22555
22902
  if (options.roleInOrganization !== undefined) {
22556
22903
  var roleInOrganizationItem = new CodeContentItem({
@@ -22562,7 +22909,7 @@ var PersonObserverIdentifyingAttributes = /*#__PURE__*/function (_Template7) {
22562
22909
  value: options.roleInOrganization,
22563
22910
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22564
22911
  });
22565
- _this13.push(roleInOrganizationItem);
22912
+ _this11.push(roleInOrganizationItem);
22566
22913
  }
22567
22914
  if (options.roleInProcedure !== undefined) {
22568
22915
  var roleInProcedureItem = new CodeContentItem({
@@ -22574,18 +22921,18 @@ var PersonObserverIdentifyingAttributes = /*#__PURE__*/function (_Template7) {
22574
22921
  value: options.roleInProcedure,
22575
22922
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22576
22923
  });
22577
- _this13.push(roleInProcedureItem);
22924
+ _this11.push(roleInProcedureItem);
22578
22925
  }
22579
- return _this13;
22926
+ return _this11;
22580
22927
  }
22581
22928
  return _createClass(PersonObserverIdentifyingAttributes);
22582
22929
  }(Template);
22583
22930
  var DeviceObserverIdentifyingAttributes = /*#__PURE__*/function (_Template8) {
22584
22931
  _inherits(DeviceObserverIdentifyingAttributes, _Template8);
22585
22932
  function DeviceObserverIdentifyingAttributes(options) {
22586
- var _this14;
22933
+ var _this12;
22587
22934
  _classCallCheck(this, DeviceObserverIdentifyingAttributes);
22588
- _this14 = _callSuper(this, DeviceObserverIdentifyingAttributes);
22935
+ _this12 = _callSuper(this, DeviceObserverIdentifyingAttributes);
22589
22936
  if (options.uid === undefined) {
22590
22937
  throw new Error("Option 'uid' is required for DeviceObserverIdentifyingAttributes.");
22591
22938
  }
@@ -22598,7 +22945,7 @@ var DeviceObserverIdentifyingAttributes = /*#__PURE__*/function (_Template8) {
22598
22945
  value: options.uid,
22599
22946
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22600
22947
  });
22601
- _this14.push(deviceObserverItem);
22948
+ _this12.push(deviceObserverItem);
22602
22949
  if (options.manufacturerName !== undefined) {
22603
22950
  var manufacturerNameItem = new TextContentItem({
22604
22951
  name: new CodedConcept({
@@ -22609,7 +22956,7 @@ var DeviceObserverIdentifyingAttributes = /*#__PURE__*/function (_Template8) {
22609
22956
  value: options.manufacturerName,
22610
22957
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22611
22958
  });
22612
- _this14.push(manufacturerNameItem);
22959
+ _this12.push(manufacturerNameItem);
22613
22960
  }
22614
22961
  if (options.modelName !== undefined) {
22615
22962
  var modelNameItem = new TextContentItem({
@@ -22621,7 +22968,7 @@ var DeviceObserverIdentifyingAttributes = /*#__PURE__*/function (_Template8) {
22621
22968
  value: options.modelName,
22622
22969
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22623
22970
  });
22624
- _this14.push(modelNameItem);
22971
+ _this12.push(modelNameItem);
22625
22972
  }
22626
22973
  if (options.serialNumber !== undefined) {
22627
22974
  var serialNumberItem = new TextContentItem({
@@ -22633,7 +22980,7 @@ var DeviceObserverIdentifyingAttributes = /*#__PURE__*/function (_Template8) {
22633
22980
  value: options.serialNumber,
22634
22981
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22635
22982
  });
22636
- _this14.push(serialNumberItem);
22983
+ _this12.push(serialNumberItem);
22637
22984
  }
22638
22985
  if (options.physicalLocation !== undefined) {
22639
22986
  var physicalLocationItem = new TextContentItem({
@@ -22645,7 +22992,7 @@ var DeviceObserverIdentifyingAttributes = /*#__PURE__*/function (_Template8) {
22645
22992
  value: options.physicalLocation,
22646
22993
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22647
22994
  });
22648
- _this14.push(physicalLocationItem);
22995
+ _this12.push(physicalLocationItem);
22649
22996
  }
22650
22997
  if (options.roleInProcedure !== undefined) {
22651
22998
  var roleInProcedureItem = new CodeContentItem({
@@ -22657,19 +23004,19 @@ var DeviceObserverIdentifyingAttributes = /*#__PURE__*/function (_Template8) {
22657
23004
  value: options.roleInProcedure,
22658
23005
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22659
23006
  });
22660
- _this14.push(roleInProcedureItem);
23007
+ _this12.push(roleInProcedureItem);
22661
23008
  }
22662
- return _this14;
23009
+ return _this12;
22663
23010
  }
22664
23011
  return _createClass(DeviceObserverIdentifyingAttributes);
22665
23012
  }(Template);
22666
23013
  var SubjectContext = /*#__PURE__*/function (_Template9) {
22667
23014
  _inherits(SubjectContext, _Template9);
22668
23015
  function SubjectContext(options) {
22669
- var _this16;
22670
- var _this15;
23016
+ var _this14;
23017
+ var _this13;
22671
23018
  _classCallCheck(this, SubjectContext);
22672
- _this15 = _callSuper(this, SubjectContext);
23019
+ _this13 = _callSuper(this, SubjectContext);
22673
23020
  if (options.subjectClass === undefined) {
22674
23021
  throw new Error("Option 'subjectClass' is required for SubjectContext.");
22675
23022
  }
@@ -22685,7 +23032,7 @@ var SubjectContext = /*#__PURE__*/function (_Template9) {
22685
23032
  value: options.subjectClass,
22686
23033
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22687
23034
  });
22688
- _this15.push(subjectClassItem);
23035
+ _this13.push(subjectClassItem);
22689
23036
  var fetus = new CodedConcept({
22690
23037
  value: "121026 ",
22691
23038
  schemeDesignator: "DCM",
@@ -22716,17 +23063,17 @@ var SubjectContext = /*#__PURE__*/function (_Template9) {
22716
23063
  } else {
22717
23064
  throw new Error("Option 'subjectClass' must be either 'Fetus', 'Specimen', or 'Device'.");
22718
23065
  }
22719
- (_this16 = _this15).push.apply(_this16, _toConsumableArray(options.subjectClassSpecificContext));
22720
- return _this15;
23066
+ (_this14 = _this13).push.apply(_this14, _toConsumableArray(options.subjectClassSpecificContext));
23067
+ return _this13;
22721
23068
  }
22722
23069
  return _createClass(SubjectContext);
22723
23070
  }(Template);
22724
- var SubjectContextFetus = /*#__PURE__*/function (_Template10) {
22725
- _inherits(SubjectContextFetus, _Template10);
23071
+ var SubjectContextFetus = /*#__PURE__*/function (_Template0) {
23072
+ _inherits(SubjectContextFetus, _Template0);
22726
23073
  function SubjectContextFetus(options) {
22727
- var _this17;
23074
+ var _this15;
22728
23075
  _classCallCheck(this, SubjectContextFetus);
22729
- _this17 = _callSuper(this, SubjectContextFetus);
23076
+ _this15 = _callSuper(this, SubjectContextFetus);
22730
23077
  if (options.subjectID === undefined) {
22731
23078
  throw new Error("Option 'subjectID' is required for SubjectContextFetus.");
22732
23079
  }
@@ -22739,17 +23086,17 @@ var SubjectContextFetus = /*#__PURE__*/function (_Template10) {
22739
23086
  value: options.subjectID,
22740
23087
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22741
23088
  });
22742
- _this17.push(subjectIdItem);
22743
- return _this17;
23089
+ _this15.push(subjectIdItem);
23090
+ return _this15;
22744
23091
  }
22745
23092
  return _createClass(SubjectContextFetus);
22746
23093
  }(Template);
22747
- var SubjectContextSpecimen = /*#__PURE__*/function (_Template11) {
22748
- _inherits(SubjectContextSpecimen, _Template11);
23094
+ var SubjectContextSpecimen = /*#__PURE__*/function (_Template1) {
23095
+ _inherits(SubjectContextSpecimen, _Template1);
22749
23096
  function SubjectContextSpecimen(options) {
22750
- var _this18;
23097
+ var _this16;
22751
23098
  _classCallCheck(this, SubjectContextSpecimen);
22752
- _this18 = _callSuper(this, SubjectContextSpecimen);
23099
+ _this16 = _callSuper(this, SubjectContextSpecimen);
22753
23100
  if (options.uid === undefined) {
22754
23101
  throw new Error("Option 'uid' is required for SubjectContextSpecimen.");
22755
23102
  }
@@ -22762,7 +23109,7 @@ var SubjectContextSpecimen = /*#__PURE__*/function (_Template11) {
22762
23109
  value: options.uid,
22763
23110
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22764
23111
  });
22765
- _this18.push(specimenUidItem);
23112
+ _this16.push(specimenUidItem);
22766
23113
  if (options.identifier !== undefined) {
22767
23114
  var specimenIdentifierItem = new TextContentItem({
22768
23115
  name: new CodedConcept({
@@ -22773,7 +23120,7 @@ var SubjectContextSpecimen = /*#__PURE__*/function (_Template11) {
22773
23120
  value: options.identifier,
22774
23121
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22775
23122
  });
22776
- _this18.push(specimenIdentifierItem);
23123
+ _this16.push(specimenIdentifierItem);
22777
23124
  }
22778
23125
  if (options.containerIdentifier !== undefined) {
22779
23126
  var containerIdentifierItem = new TextContentItem({
@@ -22785,7 +23132,7 @@ var SubjectContextSpecimen = /*#__PURE__*/function (_Template11) {
22785
23132
  value: options.containerIdentifier,
22786
23133
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22787
23134
  });
22788
- _this18.push(containerIdentifierItem);
23135
+ _this16.push(containerIdentifierItem);
22789
23136
  }
22790
23137
  if (options.specimenType !== undefined) {
22791
23138
  var specimenTypeItem = new CodeContentItem({
@@ -22797,18 +23144,18 @@ var SubjectContextSpecimen = /*#__PURE__*/function (_Template11) {
22797
23144
  value: options.specimenType,
22798
23145
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22799
23146
  });
22800
- _this18.push(specimenTypeItem);
23147
+ _this16.push(specimenTypeItem);
22801
23148
  }
22802
- return _this18;
23149
+ return _this16;
22803
23150
  }
22804
23151
  return _createClass(SubjectContextSpecimen);
22805
23152
  }(Template);
22806
- var SubjectContextDevice = /*#__PURE__*/function (_Template12) {
22807
- _inherits(SubjectContextDevice, _Template12);
23153
+ var SubjectContextDevice = /*#__PURE__*/function (_Template10) {
23154
+ _inherits(SubjectContextDevice, _Template10);
22808
23155
  function SubjectContextDevice(options) {
22809
- var _this19;
23156
+ var _this17;
22810
23157
  _classCallCheck(this, SubjectContextDevice);
22811
- _this19 = _callSuper(this, SubjectContextDevice, [options]);
23158
+ _this17 = _callSuper(this, SubjectContextDevice, [options]);
22812
23159
  if (options.name === undefined) {
22813
23160
  throw new Error("Option 'name' is required for SubjectContextDevice.");
22814
23161
  }
@@ -22821,7 +23168,7 @@ var SubjectContextDevice = /*#__PURE__*/function (_Template12) {
22821
23168
  value: options.name,
22822
23169
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22823
23170
  });
22824
- _this19.push(deviceNameItem);
23171
+ _this17.push(deviceNameItem);
22825
23172
  if (options.uid !== undefined) {
22826
23173
  var deviceUidItem = new UIDRefContentItem({
22827
23174
  name: new CodedConcept({
@@ -22832,7 +23179,7 @@ var SubjectContextDevice = /*#__PURE__*/function (_Template12) {
22832
23179
  value: options.uid,
22833
23180
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22834
23181
  });
22835
- _this19.push(deviceUidItem);
23182
+ _this17.push(deviceUidItem);
22836
23183
  }
22837
23184
  if (options.manufacturerName !== undefined) {
22838
23185
  var manufacturerNameItem = new TextContentItem({
@@ -22844,7 +23191,7 @@ var SubjectContextDevice = /*#__PURE__*/function (_Template12) {
22844
23191
  value: options.manufacturerName,
22845
23192
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22846
23193
  });
22847
- _this19.push(manufacturerNameItem);
23194
+ _this17.push(manufacturerNameItem);
22848
23195
  }
22849
23196
  if (options.modelName !== undefined) {
22850
23197
  var modelNameItem = new TextContentItem({
@@ -22856,7 +23203,7 @@ var SubjectContextDevice = /*#__PURE__*/function (_Template12) {
22856
23203
  value: options.modelName,
22857
23204
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22858
23205
  });
22859
- _this19.push(modelNameItem);
23206
+ _this17.push(modelNameItem);
22860
23207
  }
22861
23208
  if (options.serialNumber !== undefined) {
22862
23209
  var serialNumberItem = new TextContentItem({
@@ -22868,7 +23215,7 @@ var SubjectContextDevice = /*#__PURE__*/function (_Template12) {
22868
23215
  value: options.serialNumber,
22869
23216
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22870
23217
  });
22871
- _this19.push(serialNumberItem);
23218
+ _this17.push(serialNumberItem);
22872
23219
  }
22873
23220
  if (options.physicalLocation !== undefined) {
22874
23221
  var physicalLocationItem = new TextContentItem({
@@ -22880,18 +23227,18 @@ var SubjectContextDevice = /*#__PURE__*/function (_Template12) {
22880
23227
  value: options.physicalLocation,
22881
23228
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
22882
23229
  });
22883
- _this19.push(physicalLocationItem);
23230
+ _this17.push(physicalLocationItem);
22884
23231
  }
22885
- return _this19;
23232
+ return _this17;
22886
23233
  }
22887
23234
  return _createClass(SubjectContextDevice);
22888
23235
  }(Template);
22889
- var LanguageOfContentItemAndDescendants = /*#__PURE__*/function (_Template13) {
22890
- _inherits(LanguageOfContentItemAndDescendants, _Template13);
23236
+ var LanguageOfContentItemAndDescendants = /*#__PURE__*/function (_Template11) {
23237
+ _inherits(LanguageOfContentItemAndDescendants, _Template11);
22891
23238
  function LanguageOfContentItemAndDescendants(options) {
22892
- var _this20;
23239
+ var _this18;
22893
23240
  _classCallCheck(this, LanguageOfContentItemAndDescendants);
22894
- _this20 = _callSuper(this, LanguageOfContentItemAndDescendants);
23241
+ _this18 = _callSuper(this, LanguageOfContentItemAndDescendants);
22895
23242
  if (options.language === undefined) {
22896
23243
  options.language = new CodedConcept({
22897
23244
  value: "en-US",
@@ -22908,18 +23255,18 @@ var LanguageOfContentItemAndDescendants = /*#__PURE__*/function (_Template13) {
22908
23255
  value: options.language,
22909
23256
  relationshipType: RelationshipTypes.HAS_CONCEPT_MOD
22910
23257
  });
22911
- _this20.push(languageItem);
22912
- return _this20;
23258
+ _this18.push(languageItem);
23259
+ return _this18;
22913
23260
  }
22914
23261
  return _createClass(LanguageOfContentItemAndDescendants);
22915
23262
  }(Template);
22916
- var _MeasurementsAndQualitatitiveEvaluations = /*#__PURE__*/function (_Template14) {
22917
- _inherits(_MeasurementsAndQualitatitiveEvaluations, _Template14);
23263
+ var _MeasurementsAndQualitatitiveEvaluations = /*#__PURE__*/function (_Template12) {
23264
+ _inherits(_MeasurementsAndQualitatitiveEvaluations, _Template12);
22918
23265
  function _MeasurementsAndQualitatitiveEvaluations(options) {
22919
23266
  var _groupItem$ContentSeq;
22920
- var _this21;
23267
+ var _this19;
22921
23268
  _classCallCheck(this, _MeasurementsAndQualitatitiveEvaluations);
22922
- _this21 = _callSuper(this, _MeasurementsAndQualitatitiveEvaluations);
23269
+ _this19 = _callSuper(this, _MeasurementsAndQualitatitiveEvaluations);
22923
23270
  var groupItem = new ContainerContentItem({
22924
23271
  name: new CodedConcept({
22925
23272
  value: "125007",
@@ -22999,17 +23346,17 @@ var _MeasurementsAndQualitatitiveEvaluations = /*#__PURE__*/function (_Template1
22999
23346
  groupItem.ContentSequence.push(evaluation);
23000
23347
  });
23001
23348
  }
23002
- _this21.push(groupItem);
23003
- return _this21;
23349
+ _this19.push(groupItem);
23350
+ return _this19;
23004
23351
  }
23005
23352
  return _createClass(_MeasurementsAndQualitatitiveEvaluations);
23006
23353
  }(Template);
23007
23354
  var _ROIMeasurementsAndQualitativeEvaluations = /*#__PURE__*/function (_MeasurementsAndQuali) {
23008
23355
  _inherits(_ROIMeasurementsAndQualitativeEvaluations, _MeasurementsAndQuali);
23009
23356
  function _ROIMeasurementsAndQualitativeEvaluations(options) {
23010
- var _this22;
23357
+ var _this20;
23011
23358
  _classCallCheck(this, _ROIMeasurementsAndQualitativeEvaluations);
23012
- _this22 = _callSuper(this, _ROIMeasurementsAndQualitativeEvaluations, [{
23359
+ _this20 = _callSuper(this, _ROIMeasurementsAndQualitativeEvaluations, [{
23013
23360
  trackingIdentifier: options.trackingIdentifier,
23014
23361
  timePointContext: options.timePointContext,
23015
23362
  findingType: options.findingType,
@@ -23017,7 +23364,7 @@ var _ROIMeasurementsAndQualitativeEvaluations = /*#__PURE__*/function (_Measurem
23017
23364
  measurements: options.measurements,
23018
23365
  qualitativeEvaluations: options.qualitativeEvaluations
23019
23366
  }]);
23020
- var groupItem = _this22[0];
23367
+ var groupItem = _this20[0];
23021
23368
  var wereReferencesProvided = [options.referencedRegions !== undefined, options.referencedVolume !== undefined, options.referencedSegmentation !== undefined];
23022
23369
  var numReferences = wereReferencesProvided.reduce(function (a, b) {
23023
23370
  return a + b;
@@ -23051,8 +23398,8 @@ var _ROIMeasurementsAndQualitativeEvaluations = /*#__PURE__*/function (_Measurem
23051
23398
  }
23052
23399
  groupItem.ContentSequence.push(options.referencedSegmentation);
23053
23400
  }
23054
- _this22[0] = groupItem;
23055
- return _this22;
23401
+ _this20[0] = groupItem;
23402
+ return _this20;
23056
23403
  }
23057
23404
  return _createClass(_ROIMeasurementsAndQualitativeEvaluations);
23058
23405
  }(_MeasurementsAndQualitatitiveEvaluations);
@@ -23101,12 +23448,12 @@ var VolumetricROIMeasurementsAndQualitativeEvaluations = /*#__PURE__*/function (
23101
23448
  }
23102
23449
  return _createClass(VolumetricROIMeasurementsAndQualitativeEvaluations);
23103
23450
  }(_ROIMeasurementsAndQualitativeEvaluations);
23104
- var MeasurementsDerivedFromMultipleROIMeasurements = /*#__PURE__*/function (_Template15) {
23105
- _inherits(MeasurementsDerivedFromMultipleROIMeasurements, _Template15);
23451
+ var MeasurementsDerivedFromMultipleROIMeasurements = /*#__PURE__*/function (_Template13) {
23452
+ _inherits(MeasurementsDerivedFromMultipleROIMeasurements, _Template13);
23106
23453
  function MeasurementsDerivedFromMultipleROIMeasurements(options) {
23107
- var _this23;
23454
+ var _this21;
23108
23455
  _classCallCheck(this, MeasurementsDerivedFromMultipleROIMeasurements);
23109
- _this23 = _callSuper(this, MeasurementsDerivedFromMultipleROIMeasurements, [options]);
23456
+ _this21 = _callSuper(this, MeasurementsDerivedFromMultipleROIMeasurements, [options]);
23110
23457
  if (options.derivation === undefined) {
23111
23458
  throw new Error("Option 'derivation' is required for " + "MeasurementsDerivedFromMultipleROIMeasurements.");
23112
23459
  }
@@ -23136,8 +23483,8 @@ var MeasurementsDerivedFromMultipleROIMeasurements = /*#__PURE__*/function (_Tem
23136
23483
  }
23137
23484
  (_valueItem$ContentSeq5 = valueItem.ContentSequence).push.apply(_valueItem$ContentSeq5, _toConsumableArray(options.measurementProperties));
23138
23485
  }
23139
- _this23.push(valueItem);
23140
- return _this23;
23486
+ _this21.push(valueItem);
23487
+ return _this21;
23141
23488
  }
23142
23489
  return _createClass(MeasurementsDerivedFromMultipleROIMeasurements);
23143
23490
  }(Template);
@@ -23157,12 +23504,12 @@ var MeasurementAndQualitativeEvaluationGroup = /*#__PURE__*/function (_Measureme
23157
23504
  }
23158
23505
  return _createClass(MeasurementAndQualitativeEvaluationGroup);
23159
23506
  }(_MeasurementsAndQualitatitiveEvaluations);
23160
- var ROIMeasurements = /*#__PURE__*/function (_Template16) {
23161
- _inherits(ROIMeasurements, _Template16);
23507
+ var ROIMeasurements = /*#__PURE__*/function (_Template14) {
23508
+ _inherits(ROIMeasurements, _Template14);
23162
23509
  function ROIMeasurements(options) {
23163
- var _this24;
23510
+ var _this22;
23164
23511
  _classCallCheck(this, ROIMeasurements);
23165
- _this24 = _callSuper(this, ROIMeasurements);
23512
+ _this22 = _callSuper(this, ROIMeasurements);
23166
23513
  if (options.method !== undefined) {
23167
23514
  var methodItem = new CodeContentItem({
23168
23515
  name: new CodedConcept({
@@ -23173,7 +23520,7 @@ var ROIMeasurements = /*#__PURE__*/function (_Template16) {
23173
23520
  value: options.method,
23174
23521
  relationshipType: RelationshipTypes.HAS_CONCEPT_MOD
23175
23522
  });
23176
- _this24.push(methodItem);
23523
+ _this22.push(methodItem);
23177
23524
  }
23178
23525
  if (options.findingSites !== undefined) {
23179
23526
  if (!(_typeof(options.findingSites) === "object" || options.findingSites instanceof Array)) {
@@ -23183,7 +23530,7 @@ var ROIMeasurements = /*#__PURE__*/function (_Template16) {
23183
23530
  if (!site || site.constructor !== FindingSite) {
23184
23531
  throw new Error("Items of option 'findingSites' must have type FindingSite.");
23185
23532
  }
23186
- _this24.push(site);
23533
+ _this22.push(site);
23187
23534
  });
23188
23535
  }
23189
23536
  if (options.measurements === undefined) {
@@ -23199,19 +23546,19 @@ var ROIMeasurements = /*#__PURE__*/function (_Template16) {
23199
23546
  if (!measurement || measurement.constructor !== Measurement) {
23200
23547
  throw new Error("Items of option 'measurements' must have type Measurement.");
23201
23548
  }
23202
- _this24.push(measurement);
23549
+ _this22.push(measurement);
23203
23550
  });
23204
- return _this24;
23551
+ return _this22;
23205
23552
  }
23206
23553
  return _createClass(ROIMeasurements);
23207
23554
  }(Template);
23208
- var MeasurementReport = /*#__PURE__*/function (_Template17) {
23209
- _inherits(MeasurementReport, _Template17);
23555
+ var MeasurementReport = /*#__PURE__*/function (_Template15) {
23556
+ _inherits(MeasurementReport, _Template15);
23210
23557
  function MeasurementReport(options) {
23211
23558
  var _item$ContentSequence, _item$ContentSequence2, _item$ContentSequence3;
23212
- var _this25;
23559
+ var _this23;
23213
23560
  _classCallCheck(this, MeasurementReport);
23214
- _this25 = _callSuper(this, MeasurementReport);
23561
+ _this23 = _callSuper(this, MeasurementReport);
23215
23562
  if (options.observationContext === undefined) {
23216
23563
  throw new Error("Option 'observationContext' is required for MeasurementReport.");
23217
23564
  }
@@ -23296,17 +23643,17 @@ var MeasurementReport = /*#__PURE__*/function (_Template17) {
23296
23643
  _containerItem2.ContentSequence = _construct(ContentSequence, _toConsumableArray(options.qualitativeEvaluations));
23297
23644
  item.ContentSequence.push(_containerItem2);
23298
23645
  }
23299
- _this25.push(item);
23300
- return _this25;
23646
+ _this23.push(item);
23647
+ return _this23;
23301
23648
  }
23302
23649
  return _createClass(MeasurementReport);
23303
23650
  }(Template);
23304
- var TimePointContext = /*#__PURE__*/function (_Template18) {
23305
- _inherits(TimePointContext, _Template18);
23651
+ var TimePointContext = /*#__PURE__*/function (_Template16) {
23652
+ _inherits(TimePointContext, _Template16);
23306
23653
  function TimePointContext(options) {
23307
- var _this26;
23654
+ var _this24;
23308
23655
  _classCallCheck(this, TimePointContext);
23309
- _this26 = _callSuper(this, TimePointContext, [options]);
23656
+ _this24 = _callSuper(this, TimePointContext, [options]);
23310
23657
  if (options.timePoint === undefined) {
23311
23658
  throw new Error("Option 'timePoint' is required for TimePointContext.");
23312
23659
  }
@@ -23319,7 +23666,7 @@ var TimePointContext = /*#__PURE__*/function (_Template18) {
23319
23666
  value: options.timePoint,
23320
23667
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
23321
23668
  });
23322
- _this26.push(timePointItem);
23669
+ _this24.push(timePointItem);
23323
23670
  if (options.timePointType !== undefined) {
23324
23671
  var timePointTypeItem = new CodeContentItem({
23325
23672
  name: new CodedConcept({
@@ -23330,7 +23677,7 @@ var TimePointContext = /*#__PURE__*/function (_Template18) {
23330
23677
  value: options.timePointType,
23331
23678
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
23332
23679
  });
23333
- _this26.push(timePointTypeItem);
23680
+ _this24.push(timePointTypeItem);
23334
23681
  }
23335
23682
  if (options.timePointOrder !== undefined) {
23336
23683
  var timePointOrderItem = new NumContentItem({
@@ -23342,7 +23689,7 @@ var TimePointContext = /*#__PURE__*/function (_Template18) {
23342
23689
  value: options.timePointOrder,
23343
23690
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
23344
23691
  });
23345
- _this26.push(timePointOrderItem);
23692
+ _this24.push(timePointOrderItem);
23346
23693
  }
23347
23694
  if (options.subjectTimePointIdentifier !== undefined) {
23348
23695
  var subjectTimePointIdentifierItem = new NumContentItem({
@@ -23354,7 +23701,7 @@ var TimePointContext = /*#__PURE__*/function (_Template18) {
23354
23701
  value: options.subjectTimePointIdentifier,
23355
23702
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
23356
23703
  });
23357
- _this26.push(subjectTimePointIdentifierItem);
23704
+ _this24.push(subjectTimePointIdentifierItem);
23358
23705
  }
23359
23706
  if (options.protocolTimePointIdentifier !== undefined) {
23360
23707
  var protocolTimePointIdentifierItem = new NumContentItem({
@@ -23366,7 +23713,7 @@ var TimePointContext = /*#__PURE__*/function (_Template18) {
23366
23713
  value: options.protocolTimePointIdentifier,
23367
23714
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
23368
23715
  });
23369
- _this26.push(protocolTimePointIdentifierItem);
23716
+ _this24.push(protocolTimePointIdentifierItem);
23370
23717
  }
23371
23718
  if (options.temporalOffsetFromEvent !== undefined) {
23372
23719
  // TODO: Missing LongitudinalTemporalOffsetFromEventContentItem
@@ -23379,18 +23726,18 @@ var TimePointContext = /*#__PURE__*/function (_Template18) {
23379
23726
  // "LongitudinalTemporalOffsetFromEventContentItem."
23380
23727
  // );
23381
23728
  // }
23382
- _this26.push(options.temporalOffsetFromEvent);
23729
+ _this24.push(options.temporalOffsetFromEvent);
23383
23730
  }
23384
- return _this26;
23731
+ return _this24;
23385
23732
  }
23386
23733
  return _createClass(TimePointContext);
23387
23734
  }(Template);
23388
- var ImageLibrary = /*#__PURE__*/function (_Template19) {
23389
- _inherits(ImageLibrary, _Template19);
23735
+ var ImageLibrary = /*#__PURE__*/function (_Template17) {
23736
+ _inherits(ImageLibrary, _Template17);
23390
23737
  function ImageLibrary() {
23391
- var _this27;
23738
+ var _this25;
23392
23739
  _classCallCheck(this, ImageLibrary);
23393
- _this27 = _callSuper(this, ImageLibrary);
23740
+ _this25 = _callSuper(this, ImageLibrary);
23394
23741
  var libraryItem = new ContainerContentItem({
23395
23742
  name: new CodedConcept({
23396
23743
  value: "111028",
@@ -23399,17 +23746,17 @@ var ImageLibrary = /*#__PURE__*/function (_Template19) {
23399
23746
  }),
23400
23747
  relationshipType: RelationshipTypes.CONTAINS
23401
23748
  });
23402
- _this27.push(libraryItem);
23403
- return _this27;
23749
+ _this25.push(libraryItem);
23750
+ return _this25;
23404
23751
  }
23405
23752
  return _createClass(ImageLibrary);
23406
23753
  }(Template);
23407
- var AlgorithmIdentification = /*#__PURE__*/function (_Template20) {
23408
- _inherits(AlgorithmIdentification, _Template20);
23754
+ var AlgorithmIdentification = /*#__PURE__*/function (_Template18) {
23755
+ _inherits(AlgorithmIdentification, _Template18);
23409
23756
  function AlgorithmIdentification(options) {
23410
- var _this28;
23757
+ var _this26;
23411
23758
  _classCallCheck(this, AlgorithmIdentification);
23412
- _this28 = _callSuper(this, AlgorithmIdentification);
23759
+ _this26 = _callSuper(this, AlgorithmIdentification);
23413
23760
  if (options.name === undefined) {
23414
23761
  throw new Error("Option 'name' is required for AlgorithmIdentification.");
23415
23762
  }
@@ -23425,7 +23772,7 @@ var AlgorithmIdentification = /*#__PURE__*/function (_Template20) {
23425
23772
  value: options.name,
23426
23773
  relationshipType: RelationshipTypes.HAS_CONCEPT_MOD
23427
23774
  });
23428
- _this28.push(nameItem);
23775
+ _this26.push(nameItem);
23429
23776
  var versionItem = new TextContentItem({
23430
23777
  name: new CodedConcept({
23431
23778
  value: "111003",
@@ -23435,7 +23782,7 @@ var AlgorithmIdentification = /*#__PURE__*/function (_Template20) {
23435
23782
  value: options.version,
23436
23783
  relationshipType: RelationshipTypes.HAS_CONCEPT_MOD
23437
23784
  });
23438
- _this28.push(versionItem);
23785
+ _this26.push(versionItem);
23439
23786
  if (options.parameters !== undefined) {
23440
23787
  if (!(_typeof(options.parameters) === "object" || options.parameters instanceof Array)) {
23441
23788
  throw new Error("Option 'parameters' must have type Array.");
@@ -23450,19 +23797,19 @@ var AlgorithmIdentification = /*#__PURE__*/function (_Template20) {
23450
23797
  value: parameter,
23451
23798
  relationshipType: RelationshipTypes.HAS_CONCEPT_MOD
23452
23799
  });
23453
- _this28.push(parameterItem);
23800
+ _this26.push(parameterItem);
23454
23801
  });
23455
23802
  }
23456
- return _this28;
23803
+ return _this26;
23457
23804
  }
23458
23805
  return _createClass(AlgorithmIdentification);
23459
23806
  }(Template);
23460
- var TrackingIdentifier = /*#__PURE__*/function (_Template21) {
23461
- _inherits(TrackingIdentifier, _Template21);
23807
+ var TrackingIdentifier = /*#__PURE__*/function (_Template19) {
23808
+ _inherits(TrackingIdentifier, _Template19);
23462
23809
  function TrackingIdentifier(options) {
23463
- var _this29;
23810
+ var _this27;
23464
23811
  _classCallCheck(this, TrackingIdentifier);
23465
- _this29 = _callSuper(this, TrackingIdentifier, [options]);
23812
+ _this27 = _callSuper(this, TrackingIdentifier, [options]);
23466
23813
  if (options.uid === undefined) {
23467
23814
  throw new Error("Option 'uid' is required for TrackingIdentifier.");
23468
23815
  }
@@ -23476,7 +23823,7 @@ var TrackingIdentifier = /*#__PURE__*/function (_Template21) {
23476
23823
  value: options.identifier,
23477
23824
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
23478
23825
  });
23479
- _this29.push(trackingIdentifierItem);
23826
+ _this27.push(trackingIdentifierItem);
23480
23827
  }
23481
23828
  var trackingUIDItem = new UIDRefContentItem({
23482
23829
  name: new CodedConcept({
@@ -23487,8 +23834,8 @@ var TrackingIdentifier = /*#__PURE__*/function (_Template21) {
23487
23834
  value: options.uid,
23488
23835
  relationshipType: RelationshipTypes.HAS_OBS_CONTEXT
23489
23836
  });
23490
- _this29.push(trackingUIDItem);
23491
- return _this29;
23837
+ _this27.push(trackingUIDItem);
23838
+ return _this27;
23492
23839
  }
23493
23840
  return _createClass(TrackingIdentifier);
23494
23841
  }(Template);