UNPKG

modified-dicom-pacs

Version:

A modified version of DICOM PACS implementation

2 lines 9.08 kB
(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{1092:function(t,e,n){},1111:function(t,e,n){"use strict";n.r(e);var r=n(0),o=n.n(r),a=n(1),i=n.n(a),c=n(16),u=n(63),p=n(33),f={any:function(t,e,n){var r=t[e];if(!(r instanceof Float64Array||r instanceof Float32Array||r instanceof Int32Array||r instanceof Int16Array||r instanceof Int8Array||r instanceof Uint32Array||r instanceof Uint16Array||r instanceof Uint8Array||r instanceof Uint8ClampedArray))return new Error("Invalid prop `"+e+"` supplied to `"+n+"`. Expected a typed array.")},float64:function(t,e,n){if(!(t[e]instanceof Float64Array))return new Error("Invalid prop `"+e+"` supplied to `"+n+"`. Expected a Float64Array.")},float32:function(t,e,n){if(!(t[e]instanceof Float32Array))return new Error("Invalid prop `"+e+"` supplied to `"+n+"`. Expected a Float32Array.")},float:function(t,e,n){if(!(t[e]instanceof Float64Array||t[e]instanceof Float32Array))return new Error("Invalid prop `"+e+"` supplied to `"+n+"`. Expected a Float32Array or Float64Array.")},int32:function(t,e,n){if(!(t[e]instanceof Int32Array))return new Error("Invalid prop `"+e+"` supplied to `"+n+"`. Expected an Int32Array.")},int16:function(t,e,n){if(!(t[e]instanceof Int16Array))return new Error("Invalid prop `"+e+"` supplied to `"+n+"`. Expected an In16Array.")},int8:function(t,e,n){if(!(t[e]instanceof Int8Array))return new Error("Invalid prop `"+e+"` supplied to `"+n+"`. Expected an Int8Array.")},int:function(t,e,n){if(!(t[e]instanceof Int32Array||t[e]instanceof Int16Array||t[e]instanceof Int8Array))return new Error("Invalid prop `"+e+"` supplied to `"+n+"`. Expected an Int32Array, In16Array, or Int8Array.")},uint32:function(t,e,n){if(!(t[e]instanceof Uint32Array))return new Error("Invalid prop `"+e+"` supplied to `"+n+"`. Expected a Uint32Array.")},uint16:function(t,e,n){if(!(t[e]instanceof Uint16Array))return new Error("Invalid prop `"+e+"` supplied to `"+n+"`. Expected a Uint16Array.")},uint8:function(t,e,n){if(!(t[e]instanceof Uint8Array))return new Error("Invalid prop `"+e+"` supplied to `"+n+"`. Expected a Uint8Array.")},uint8clamped:function(t,e,n){if(!(t[e]instanceof Uint8ClampedArray))return new Error("Invalid prop `"+e+"` supplied to `"+n+"`. Expected a Uint8ClampedArray.")},uint:function(t,e,n){if(!(t[e]instanceof Uint32Array||t[e]instanceof Uint16Array||t[e]instanceof Uint8Array||t[e]instanceof Uint8ClampedArray))return new Error("Invalid prop `"+e+"` supplied to `"+n+"`. Expected a Uint32Array, Uint16Array, Uint8Array, or Uint8ClampedArray.")}};n(1092);function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function y(t){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function d(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function v(t,e){return(v=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function m(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var b=p.b.data,w=b.DicomMetaDictionary,A=b.DicomMessage;function h(t,e){return o.a.createElement("div",{key:t},o.a.createElement("b",null,t),": ",e)}var E=function(t){function e(){var t,n,r,o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];return r=this,o=(t=y(e)).call.apply(t,[this].concat(i)),n=!o||"object"!==l(o)&&"function"!=typeof o?d(r):o,m(d(n),"state",{content:null,error:null}),m(d(n),"setViewportActiveHandler",(function(){var t=n.props,e=t.setViewportActive,r=t.viewportIndex;r!==t.activeViewportIndex&&e(r)})),n}var n,r,a;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&v(t,e)}(e,t),n=e,(r=[{key:"componentDidMount",value:function(){this.setContentFromByteArray(this.props.byteArray)}},{key:"setContentFromByteArray",value:function(t){var e=t.buffer,n=A.readFile(e),r=w.naturalizeDataset(n.dict);r._meta=w.namifyDataset(n.meta),r._meta=w.naturalizeDataset(r._meta);var a=function(t){var e=[],n="".concat(t.PatientName," (").concat(t.PatientSex,", #").concat(t.PatientID,")");e.push(h("Patient",n));var r=t.StudyDescription;e.push(h("Study",r));var a="".concat(t.SeriesDescription," (#").concat(t.SeriesNumber,")");e.push(h("Series",a));var i="".concat(t.Manufacturer," (").concat(t.ManufacturerModelName,", #").concat(t.DeviceSerialNumber,")");e.push(h("Manufacturer",i));var c={CompletionFlag:"Completion flag",VerificationFlag:"Verification flag"};Object.keys(c).forEach((function(n){if(t[n]){var r=h(c[n],t[n]);e.push(r)}}));var u="".concat(t.ContentDate," ").concat(t.ContentTime);return e.push(h("Content Date/Time",u)),e.push(),o.a.createElement("div",null,e)}(r),i=function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(e.ConceptNameCodeSequence){var a=e.ConceptNameCodeSequence,i=a.CodeMeaning,c=a.CodeValue,u=a.CodingSchemeDesignator;n="".concat(i," (").concat(c," - ").concat(u,")")}var p=[];if(n){var f="h".concat(Math.min(r,6));p.push(o.a.createElement(f,{key:n},n))}return Object.keys(e).forEach((function(n){var a,i=e[n];"_meta"===n&&(p.push(o.a.createElement("hr",{key:p.length})),p.push(o.a.createElement("h3",{key:"Metadata"},"DICOM File Meta Information"))),a=i instanceof Object?t(i,r+1):o.a.createElement("div",{key:n},n," - ",e[n]),p.push(a)})),o.a.createElement("div",null,p)}(r),c=o.a.createElement(o.a.Fragment,null,a,i);this.setState({content:c})}},{key:"render",value:function(){var t=this.state,e=t.content,n=t.error;return o.a.createElement("div",{"data-cy":"dicom-html-viewport",className:"DicomHtmlViewport",onClick:this.setViewportActiveHandler,onScroll:this.setViewportActiveHandler},e,n&&o.a.createElement("h2",null,JSON.stringify(n)))}}])&&s(n.prototype,r),a&&s(n,a),e}(r.Component);m(E,"propTypes",{byteArray:f.uint8,setViewportActive:i.a.func.isRequired,viewportIndex:i.a.number.isRequired,activeViewportIndex:i.a.number.isRequired});var I=E,S=c.a.redux.actions.setViewportActive,x=Object(u.b)((function(t,e){var n=e.viewportIndex,r=e.byteArray;return{viewportIndex:n,activeViewportIndex:t.viewports.activeViewportIndex,byteArray:r}}),(function(t,e){var n=e.viewportIndex;return{setViewportActive:function(){t(S(n))}}}))(I);function O(t){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function g(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function C(t){return(C=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function j(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function D(t,e){return(D=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function U(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var _=c.a.utils.DicomLoaderService,F=function(t){function e(){var t,n,r,o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];return r=this,n=!(o=(t=C(e)).call.apply(t,[this].concat(i)))||"object"!==O(o)&&"function"!=typeof o?j(r):o,U(j(n),"state",{byteArray:null,error:null}),n}var n,r,a;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&D(t,e)}(e,t),n=e,(r=[{key:"componentDidMount",value:function(){var t=this,e=this.props.viewportData,n=e.displaySet,r=e.studies;_.findDicomDataPromise(n,r).then((function(e){var n=new Uint8Array(e);t.setState({byteArray:n})}),(function(e){throw t.setState({error:e}),new Error(e)}))}},{key:"render",value:function(){return o.a.createElement(o.a.Fragment,null,this.state.byteArray&&o.a.createElement(x,{byteArray:this.state.byteArray,viewportIndex:this.props.viewportIndex}),this.state.error&&o.a.createElement("h2",null,JSON.stringify(this.state.error)))}}])&&g(n.prototype,r),a&&g(n,a),e}(r.Component);U(F,"propTypes",{studies:i.a.object,displaySet:i.a.object,viewportIndex:i.a.number,viewportData:i.a.object});e.default=F}}]); //# sourceMappingURL=16.bundle.babdcb2e152e955c8af5.js.map