ecg-dicom-web-viewer
This library allows viewing an ECG file in DICOM format in web view.
Installation
This module is distributed via [npm][npm-url] which is bundled with [node][node] and
should be installed as one of your project's dependencies
:
npm install --save ecg-dicom-web-viewer
Example
- Once installed import the project.
import {
ReadECGData,
DrawGraphs,
Constants,
DicomECGViewer,
} from "ecg-dicom-web-viewer";
- Instantiate the new class with the necessary data and create the view.
let viewer = new DicomECGViewer(
byteArray,
divView,
viewportIndex
);
viewer.loadECG();
Result
Documentation
Currently it works:
- Sop12LeadECGWaveformStorage: '1.2.840.10008.5.1.4.1.1.9.1.1', --> YES
- GeneralECGWaveformStorage: '1.2.840.10008.5.1.4.1.1.9.1.2', --> YES
- AmbulatoryECGWaveformStorage: '1.2.840.10008.5.1.4.1.1.9.1.3', --> NO SUPPORT
- HemodynamicWaveformStorage: '1.2.840.10008.5.1.4.1.1.9.2.1', --> YES
The next available classes are as follows:
Class ReadECGData
- readData(dataSet)
Receives a dataSet data structure and returns a readable array.
- getDataSet(dataDICOMarrayBuffer)
Read the arraydicombuffer and return dataSet.
Class DrawGraphs
- drawData()
Allows you to draw the ECG graph.
- noCompatible()
If the ECG is not compatible it will draw an incompatibility view.
- drawLoader() & removeLoader()
Draw or erase a spinner while loading data.
- addDOMChart()
Draws the data structure in the DOM.
- drawLine()
Draw the lines of the ECG.
- bindChart(chartId, channelData, yAxis)
Create and generate the line with the c3 library.
Static Constants
SOP UID of ECG types and graph measurements.
Class DicomECGViewer
- constructor(dataDICOMarrayBuffer, canvas, patientData, nameView)
dataDICOMarrayBuffer DICOM DCM ECG Array Buffer.
canvas Draw ID View.
patientData Patient Data, default null: patientData = { NAME, PATIENT_ID, BIRTH, SEX, DATE, DESCRIPTION }
nameView Identifier of the view you want to put, in case you have several views, default 0.
- createView()
Generates the DOM structure.
- loadECG()
Load the data of the graph and draw the content, it is the main method.
Features
- Generate the graph instead of using the c3 library (since it takes time to load), generate a canvas with the most personalized graph and actions such as scrolling or others.
Calibrate Sop12LeadECGWaveformStorage and GeneralECGWaveformStorage to make it look good.