ecg report generator (potable) graphic interface

32
An ECG Database and Report Generator - A Graphic Interface OSEI KUFFUOR MS Thesis Defense Advisor: Dr Patrick O Bobbie

Upload: databaseguys

Post on 06-May-2015

781 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: ECG Report Generator (Potable) Graphic Interface

An ECG Database and Report Generator - A Graphic Interface

OSEI KUFFUORMS Thesis Defense

Advisor: Dr Patrick O Bobbie

Page 2: ECG Report Generator (Potable) Graphic Interface

In this Issue: Fundamental Concept of ECG ECG Theory The Heart Overview of ECG Report Generator Design and Implementation ECG Database The Application ECG Report Analyzer Generate FinalReport Automatic Email Sender Conclusion References

Page 3: ECG Report Generator (Potable) Graphic Interface

Introduction

Cardiovascular disease (CVD), principally heart disease and stroke.

Nation’s leading killer for both men and women

This disease kills all racial and ethnic groups

About 1 million American die of CVD each year

Page 4: ECG Report Generator (Potable) Graphic Interface

Introduction cont’

According to American Heart Association, one person dies every 30 seconds which is over 2,600 deaths in every single day.

Victims between 35-64 years of ageAbout 62 million Americans have

some form of cardiovascular disease

Page 5: ECG Report Generator (Potable) Graphic Interface

ECG MeasurementSignals from two leads are

connected between two point of the body

Electrical voltage observed between the electrodes is given by the dot product of the two vectors

Modern standard ECG – uses more electrode connection points

Page 6: ECG Report Generator (Potable) Graphic Interface

Heart Rate

In normal sinus rhythm, a resting heart rate of below 60 bpm is called bradycardia and a rate of above 90 bpm is called tachycardia

In this diagnosis, I calibrated Normal Heart Rate = 100 and more than that results in some form of Cardiovascular heart disease

Page 7: ECG Report Generator (Potable) Graphic Interface

Overview of ECG Report Generator

Signal from ECG

Signal stored at Workstation

Generate Final Report

Convert Signal into actual data

ECG Report Analyzer

Send Email To Doctor

VB.NetApp SQL

ServerDatabase

Page 8: ECG Report Generator (Potable) Graphic Interface

The Application(VB.Net)

Page 9: ECG Report Generator (Potable) Graphic Interface

Major Functions in the Application

CreateDatabase() Create Table()

CreateProcedure()

CreateView()

PopulateTable()

DisplayData()

Page 10: ECG Report Generator (Potable) Graphic Interface

CreateDatabase() Using SQL statements you can create database objects programmatically Private Sub bntCreateDatabase_Click(ByVal sender As

System.Object, ByVal e As System.EventArgs) Handles bntCreateDatabase.Click

If bntCreateTable.Enabled Then Dim dr As DialogResult = MessageBox.Show If dr = DialogResult.Yes Then ResetUI() CreateTable() End If Else CreateTable() End If End Sub This function creates a database in the form of a table.

Page 11: ECG Report Generator (Potable) Graphic Interface

Function CreateTable ( )

The CREATE TABLE statement defines a table. The definition must include its name and all the attributes of its columns. The definition can include other attributes of the table, such as its primary key or check constraints.

Page 12: ECG Report Generator (Potable) Graphic Interface

CreateTable Cont’ Private Sub bntCreateTable_Click(ByVal sender As System.Object, ByVal e As

System.EventArgs) Handles bntCreateTable.Click Dim strSQL As String = _ "USE Ecg" & vbCrLf & _ "IF EXISTS (" & _ "SELECT * " & _ "FROM Ecg.dbo.sysobjects " & _ "WHERE Name = 'NW_Diagnostic' " & _ "AND TYPE = 'u')" & vbCrLf & _ "BEGIN" & vbCrLf & _ "DROP TABLE Ecg.dbo.NW_Diagnostic" & vbCrLf & _ "END" & vbCrLf & _ "CREATE TABLE NW_Diagnostic (" & _ "DiagnosisID Int NOT NULL," & _ "Temperature NVarChar(10) NOT NULL," & _ "Humi NVarChar(10) NOT NULL," & _ "SignalVoltage NVarChar(10) NOT NULL," & _ "Enviro NVarChar (10) NOT NULL, " & _ "BatteryVoltage NVarChar (10) NOT NULL, " & _ "Name NVarChar(10) NOT NULL, " & _ "CONSTRAINT [PK_DiagnosisID] PRIMARY KEY CLUSTERED" & _ "(DiagnosisID))"

Page 13: ECG Report Generator (Potable) Graphic Interface

CreateProcedure( )Stored procedures are important aspect

in all database programs VB.NET applications are no exceptions to

this rule. Stored procedures enable users change

the business logic without actually tinkering with the application.

Page 14: ECG Report Generator (Potable) Graphic Interface

CreateProcedure() cont’ First ,you have to DROP Procedure if it existsDim strSQL As String = _ "USE Ecg" & vbCrLf & _ "IF EXISTS (" & _ "SELECT * " & _ "FROM Ecg.dbo.sysobjects " & _ "WHERE Name = 'AddDiagnostic' " & _ "AND TYPE = 'p')" & vbCrLf & _ "BEGIN" & vbCrLf & _ "DROP PROCEDURE AddDiagnostic" & vbCrLf

& _ "END"

Page 15: ECG Report Generator (Potable) Graphic Interface

CreateProcedure( ) cont’ Once the Procedure is DROPPED, then re-create Procedure cmd.CommandText = _ "CREATE PROCEDURE AddDiagnostic AS" & vbCrLf

& _ "INSERT INTO NW_Diagnostic" & vbCrLf & _"(DiagnosisID,Temperature,Humi,SignalVoltage,Enviro,Ba

tteryVoltage,Name) “ "SELECT

DiagnosisID,Temperature,Humi,SignalVoltage,Enviro,BatteryVoltage,Name " & "FROM Northwind.dbo.Diagnosis "

cmd.ExecuteNonQuery() northwindConnection.Close() bntCreateView.Enabled = True

Page 16: ECG Report Generator (Potable) Graphic Interface

Function CreateView ()

A view is a structured list of items from the entities or semantic objects defined in the data model

A view instance is a view that is populated with data for one entity or semantic object

To create a view instance, the application must first obtain the new data values and relationships

This is most likely done via a data entry form, but applications also receive data from other program and in other ways

Page 17: ECG Report Generator (Potable) Graphic Interface

Function CreateView () cont’

DROP View if it exists

Private Sub bntCreateView_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntCreateView.Click

Dim northwindConnection As New SqlConnection(connectionString) Dim strSQL As String = _ "USE Ecg" & vbCrLf & _ "IF EXISTS (" & _ "SELECT * " & _ "FROM Ecg.dbo.sysobjects " & _ "WHERE Name = 'GetDiagnostic' " & _ "AND TYPE = 'v')" & vbCrLf & _ "BEGIN" & vbCrLf & _ "DROP VIEW GetDiagnostic" & vbCrLf & _ "END"

Page 18: ECG Report Generator (Potable) Graphic Interface

CreateView cont’

Re-create ViewTry cmd.CommandText = _ "CREATE VIEW GetDiagnostic AS " & _ "SELECT * " & _ "FROM NW_Diagnostic" cmd.ExecuteNonQuery() northwindConnection.Close() bntPopulateTable.Enabled = True

Page 19: ECG Report Generator (Potable) Graphic Interface

PopulateData()

The PopulateData statement inserts rows into a table, nickname, or view, or the underlying tables

Inserting a row into a nickname inserts the row into the data source object to which the nickname refers. Inserting a row into a view also inserts the row into the table on which the view is based, if no INSTEAD OF TRIGGER is defined for the insert operation on this view.

Page 20: ECG Report Generator (Potable) Graphic Interface

PopulateData cont’

Private Sub bntPopulateTable_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntPopulateTable.Click

Dim strSQL As String = "EXECUTE Ecg.dbo.AddDiagnostic" Try Dim cmd As New SqlCommand(strSQL,

northwindConnection) northwindConnection.Open() cmd.ExecuteNonQuery() northwindConnection.Close() bntDisplayData.Enabled = TrueEnd Try End Sub

Page 21: ECG Report Generator (Potable) Graphic Interface

Function Display Data ()

The function DisplayData is the end result of the above functions. Users want to see data being display as well as programmers. This function will display all data depending on which format is being used. In this application, the bntDisplayData will display data in the DataGrid.

Page 22: ECG Report Generator (Potable) Graphic Interface

DisplayData() cont’ Private Sub bntDisplayData_Click(ByVal sender As System.Object, ByVal e

As System.EventArgs) Handles bntDisplayData.Click If IsNothing(dgDiagnosis.DataSource) Then Dim strSQL As String = _ "USE Ecg" & vbCrLf & _ "SELECT * " & _ "FROM GetDiagnostic" Try Dim northwindConnection As New SqlConnection(connectionString) Dim cmd As New SqlCommand(strSQL, northwindConnection) Dim da As New SqlDataAdapter(cmd) Dim dsDiagnostic As New DataSet da.Fill(dsDiagnostic, "Diagnostic") End Try End IfEnd Sub

Page 23: ECG Report Generator (Potable) Graphic Interface

ECG Report Analyzer

ECG wave form

Is heart rate

>100

Is systolic >130?

Is diastolic >80?

Cardiovascular

disease

Cardiovasculardisease

.High blood Pressure.Valvular heart disease

.rheumatic fever.rheumatic heart disease.Coronary artery disease

.

Coronary artery

disease

Normal Sinus

Is smoke,obeeseOr

High blood cholesterol level

Is sex female >40?

Discomfort inthe back,neck

jaw or stomach

Is age >65?

Is chest discomfort or

Difficult breathing?

Heart Attack warning sign

RISK FACTORSSex hormones

Birth Control pill candidateHeavy Alcoholic

High Blood Pressure

Vavular heart disease

Rheumatic feverReheumatic heart

disease

.Heart blood

Pressure.Coronary disease

Yes

ENDNo

No

NoNo

No

y e s Y e s

Y e s

No

Y e s

y e s

Y e s

No

Page 24: ECG Report Generator (Potable) Graphic Interface

ECG Diagnostic Analyzer Diagnostic Analyzer uses algorithm to diagnose the patient’s condition. For example:

SignalVoltage as string, Temperature as Integer, HeartRate as Integer, Systolic as Integer, Diastolic as Integer, Smoke as Boolean;

if ( heartRate > 100) then disease =”Highblood pressure”else if (systolic >130)disease= “Cardiovascular”else if (diastolic > 80)disease = “Coronary artery disease”elsedisease = “Normal sinus”End ifEnd

Page 25: ECG Report Generator (Potable) Graphic Interface

Generate FinalReportFinal reports is comprehensive for

the following reasons:ReliabilityCorrectnessHelp doctors to know the big picture:• Best-Case Performance• Average-Case Performance• Worst-Case Performance

Page 26: ECG Report Generator (Potable) Graphic Interface

Generate FinalReport cont’

The final report is mostly queries generated during the diagnosis phase. Example of the final report’s retrieval using Subquery:

SELECT Diagnosis.Name FROM Diagnosis WHERE Diagnosis.DiagnosisID IN (SELECT History.Heredity FROM History.Medication IN (SELECT * FROM DiseaseOne));

Page 27: ECG Report Generator (Potable) Graphic Interface

Function EmailSender()

According to definition by [2], SMTP (Simple Mail Transfer Protocol): The standard e-mail protocol on the Internet and part of the TCP/IP protocol suite

SMTP defines the message format and the message transfer agent (MTA), which stores and forward the mail

SMTP was originally designed for only plain text (ASCII text), but MIME and other encoding methods enable executable programs and multimedia files to be attached to and transported with the email message.

Page 28: ECG Report Generator (Potable) Graphic Interface

SendEmail() -Format Date: 9 Aug 2006 04:10:34From: [email protected]: [email protected]: James Doe Heart-Diagnostic ReportMessage: Name- James Doe Date of Birth: 10/10/2000 SSN: xxx-xxx-2437 (format for security purpose) Heart Rate > 100 Systolic > 130 Gender: Female and smokes Medication: Ampicillian 500mg Possible Diagnosis Results: Cardiovascular heart disease Medication Center: 1234 Great Street, Marietta GA, 30060(phone) 770-456-1234

Heredity: Father was a cardiovascular candidate Mother never had any kind of heart diseaseEnd of message

Page 29: ECG Report Generator (Potable) Graphic Interface

Conclusion and Future Considerations

I have learnt a lot from this project and this will help me to go deep into database programming. After finishing this project, I highly recommend that the code for streaming signal voltage from the ECG to the database should have the same platform as the ECG Database and Report Generator. This will help to automate the streaming of data with alongside with the Database Report Generator.

The future continuation development of this project should include internet base programming and a function that can be connected to a phone device in other to send phone message to the doctor.

Page 30: ECG Report Generator (Potable) Graphic Interface

References [1] Craig S. Mullins, “Database Administration”; The Complete Guide to

Practice and procedures, 2002 [2] David Gefen & Chitibabu Govindarajulu, “Advanced Visual Basic.Net”,

2004 [3] Gary J. Bronson & David Rosenthal, “Introduction to Programming

with Visual Basic.Net”, 2005 [4] Keith Franklin, “VB.Net Developers”, 2002

[5] Daniel Marr, “ECG Application Featuring Data Transmission by Bluetooth”, PhD Thesis, University of Queensland, Australia, Oct 2002

[6] William Brims, “Wireless ECG Volume I”, Master Thesis, University of Queensland, Australia, Oct 2002

[7] National Center for Health Statistic and National Center for Chronic Disease Prevention and Health Promotion, Centers for Disease Control and prevention, 1995.

[8] http://www.healingwithnutrition.com/cdisease/cardiovascular/cardiovascular.html

Page 31: ECG Report Generator (Potable) Graphic Interface

THEEND

Page 32: ECG Report Generator (Potable) Graphic Interface

Questions?