ecg-dicom-web-viewer
This library allows viewing an ECG file in DICOM format in web view.
Thanks to the author https://github.com/jap1968 in his project https://github.com/jap1968/dcm-waveform since it is an adaptation of what has been done.
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 { DicomECGViewer } from 'ecg-dicom-web-viewer';
- Instantiate the new class with the necessary data and create the view.
let userData = {
NAME: name,
SEX: sex,
DATE: date,
PATIENT_ID: patientID,
DESCRIPTION: desciption,
BIRTH: birth,
};
let viewer = new DicomECGViewer(
byteArray,
divView,
userData,
viewportIndex
);
viewer.createView();
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.
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()
Creates the ECG view from the data passed to it in the constructor.This is the main method to use in your project.
- loadInstance()
Load the view according to the SOP UID.
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.