Skip to content

Commit

Permalink
New information is displayed, PR Interval, QRS Duration, QT/QTC...
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturRod committed Jun 21, 2023
1 parent 6e9738d commit 161571d
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 22 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.0.6](https:/ArturRod/ecg-dicom-web-viewer) (2023-06-20)
## [2.0.7](https:/ArturRod/ecg-dicom-web-viewer) (2023-06-21)

**Note:** New information is displayed, PR Interval, QRS Duration, QT/QTC...

## [2.0.6](https:/ArturRod/ecg-dicom-web-viewer) (2023-06-21)

**Note:** Resolve fix: https:/ArturRod/ecg-dicom-web-viewer/issues/8#issue-1765695154, remove white spaces and special characters: u\0000, \x00..., and update packages.

Expand Down
2 changes: 1 addition & 1 deletion example/index.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ecg-dicom-web-viewer",
"version": "2.0.6",
"version": "2.0.7",
"author": "Arturo Rodrigo (https:/ArturRod)",
"license": "MIT",
"description": "Together with the cornerstone library, this project allows reading and drawing ECGs from a dcm in web version.",
Expand Down
108 changes: 89 additions & 19 deletions src/viewer/DicomECGViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,12 @@ class DicomECGViewer {
if(readECG != null){
let waveform = readECG.getWaveform();
let waveinformation = readECG.getInfo();

//Load canvas structure:
if(waveform != null && waveinformation != null){
//Duration:
let duration = waveinformation.find(o => o.key === 'Duration');
let durationText = '';
if(duration != undefined){
durationText = duration.value + duration.unit;
}
//BPM:
let bpm = waveinformation.find(o => o.key === 'VRate');
let bpmText = '';
if(bpm != undefined){
bpmText = bpm.value;
}

//Load information:
//Read wave information disponibility:
let informationWave = this.ReadInformationWave(waveinformation);
let information = {
//Study Information:
Name: readECG.elements.PatientName,
Sex: readECG.elements.Sex,
Size: readECG.elements.PatientSize,
Expand All @@ -69,11 +57,18 @@ class DicomECGViewer {
Weight: readECG.elements.PatientWeight,
Date: readECG.elements.StudyDate,
Birth: readECG.elements.PatientBirthDate,
Duration: durationText,
BPM: bpmText
//Wave Information:
Duration: informationWave.Duration,
VRate: informationWave.VRate,
PR: informationWave.PR,
QR: informationWave.QR,
QTQTC: informationWave.QTQTC,
prtAxis: informationWave.prtAxis,
frequency: informationWave.frequency,
annotations: informationWave.annotations
}
//Load information:
this.loadCanvasDOM(information);

//Draw ECG:
let ecgCanvas = new DrawECGCanvas(this.idView + this.nameView, waveform);
//SOP CLASS UID COMPATIBLE:
Expand All @@ -92,6 +87,76 @@ class DicomECGViewer {
}


//Read Waveforminformation to html:
private ReadInformationWave(waveinformation){
//Duration:
let duration = waveinformation.find(o => o.key === 'Duration');
let durationText = 'undefined';
if(duration != undefined){
durationText = duration.value + ' ' + duration.unit;
}
//VRate BPM:
let vRate = waveinformation.find(o => o.key === 'VRate');
let vRateText = 'undefined';
if(vRate != undefined){
vRateText = vRate.value + ' ' + vRate.unit;
}
//PR Intrerval:
let prInterval = waveinformation.find(o => o.key === 'PR Interval');
let prIntervalText = 'undefined';
if(prInterval != undefined){
prIntervalText = prInterval.value + ' ' + prInterval.unit;
}
//QR Duration:
let qrDuration = waveinformation.find(o => o.key === 'QRS Duration');
let qrDurationText = 'undefined';
if(qrDuration != undefined){
qrDurationText = qrDuration.value + ' ' + qrDuration.unit;
}
//QT/QTc:
let qt = waveinformation.find(o => o.key === 'QT Interval');
let qtc = waveinformation.find(o => o.key === 'QTc Interval');
let qtqtcText = 'undefined';
if(qt != undefined && qtc != undefined){
qtqtcText = qt.value + "/" + qtc.value + ' ' + qtc.unit;
}
//P R T Axis
let p = waveinformation.find(o => o.key === 'P Axis');
let r = waveinformation.find(o => o.key === 'QRS Axis');
let t = waveinformation.find(o => o.key === 'T Axis');
let prtAxisText = 'undefined';
if(p != undefined && r != undefined && t != undefined){
prtAxisText = p.value + ' ' + r.value + ' ' + t.value;
}
//Sampling Frequency:
let frequency = waveinformation.find(o => o.key === 'Sampling Frequency');
let frequencyText = 'undefined';
if(frequency != undefined){
frequencyText = frequency.value + ' ' + frequency.unit;
}
//Annotations:
let annotations = waveinformation.find(o => o.key === 'Annotation');
let annotationsArray = []; //Array
if(annotations != undefined){
annotationsArray = annotations.value; //Array
}

let information = {
Duration: durationText,
VRate: vRateText,
PR: prIntervalText,
QR: qrDurationText,
QTQTC: qtqtcText,
prtAxis: prtAxisText,
frequency: frequencyText,
annotations: annotationsArray
}

//Return information:
return information;
}


/**
* Create struct of view.
*/
Expand All @@ -105,17 +170,22 @@ class DicomECGViewer {
'<div class="divTableCell">NAME: <i>' + information.Name + "</i></div>" +
'<div class="divTableCell">SEX: <i>' + information.Sex + "</i></div>" +
'<div class="divTableCell">PATIENT SIZE: <i>' + information.Size + "</i></div>" +
'<div class="divTableCell">BPM: <i>' + information.BPM + "</i></div>" +
'<div class="divTableCell">VENT RATE: <i>' + information.VRate + "</i></div>" +
'<div class="divTableCell">QT/QTC: <i>' + information.QTQTC + "</i></div>" +
"</div>" +
'<div class="divTableRow">' +
'<div class="divTableCell">PATIENT ID: <i>' + information.Id + "</i></div>" +
'<div class="divTableCell">PATIENT AGE: <i>' + information.Age + "</i></div>" +
'<div class="divTableCell">PATIENT WEIGHT: <i>' + information.Weight + "</i></div>" +
'<div class="divTableCell">PR INTERVAL: <i>' + information.PR + "</i></div>" +
'<div class="divTableCell">P-R-T AXES: <i>' + information.prtAxis + "</i></div>" +
"</div>" +
'<div class="divTableRow">' +
'<div class="divTableCell">DATE: <i>' + information.Date + "</i></div>" +
'<div class="divTableCell">BIRTH: <i>' + information.Birth + "</i></div>" +
'<div class="divTableCell">DURATION: <i>' + information.Duration + "</i></div>" +
'<div class="divTableCell">QRS DURATION: <i>' + information.QR + "</i></div>" +
'<div class="divTableCell">FREQUENCY: <i>' + information.frequency + "</i></div>" +
"</div>" +
"</div>" +
'<div id="toolsECG">' +
Expand Down

0 comments on commit 161571d

Please sign in to comment.