32
An ECG Database and Report Generator - A Gra phic Interface OSEI KUFFUOR MS Thesis Defense Adv isor: Dr Patrick O Bobbie

ECG Report Generator Portable

Embed Size (px)

Citation preview

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 1/32

An ECG Database and Report

Generator - A Graphic Interface

OSEI KUFFUORMS Thesis Defense

Advisor: Dr Patrick O Bobbie

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 2/32

In this Issue:

Fundamental Concept of ECGECG Theory

The Heart

Overview of ECG Report Generator 

Design and ImplementationECG Database

The Application

ECG Report Analyzer 

Generate FinalReportAutomatic Email Sender 

Conclusion

References

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 3/32

Introduction

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

Nation¶s leading killer for both menand women

This disease kills all racial and ethnicgroups

About 1 million American die of CVDeach year 

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 4/32

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

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 5/32

ECG Measurement

Signals from two leads are

connected between two point of the

body

Electrical voltage observed betweenthe electrodes is given by the dot

product of the two vectors

Modern standard ECG ± uses moreelectrode connection points

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 6/32

Heart R ate

In normal sinus rhythm, aresting heart rate of below 60

bpm is called bradycardia and a

rate of above 90 bpm is called

tachycardia

In this diagnosis, I calibratedNormal Heart Rate = 100 and

more than that results in some

form of Cardiovascular heart

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 7/32

Over viewof 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.Net

 App SQLSer ver 

Database

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 8/32

The Application(VB.Net)

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 9/32

Major Functions in the Application

CreateDatabase()

Create Table()

CreateProcedure()

CreateView()

PopulateTable()DisplayData()

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 10/32

CreateDatabase() Using SQL statements you can cr eate database o bjects progr ammatically

Pr ivate Sub bntCreateDatabase_Click(ByVal sender AsSystem.Object, ByVal e As System.EventAr gs) HandlesbntCreateDatabase.Click

If bntCreateTable.Enabled Then

Dim dr As DialogResult = MessageBox.ShowIf dr = DialogResult.Yes Then

ResetUI()

CreateTable()

End If 

Else

CreateTable()

End If 

End Sub

This function cr eates a database in the for m of a table.

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 11/32

Function Cr eateTable ( )

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.

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 12/32

Cr eateTable Cont¶

Private Sub bntCreateTable_Click(ByVal sender As System.Object, ByVal e AsSystem.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))"

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 13/32

CreateProcedure( )

Stored procedures are important aspectin 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.

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 14/32

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"

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 15/32

CreateProcedure( ) cont¶

Once the Procedur e is DR OPPED, then r e-cr eate Procedur e cmd.CommandText = _

"CREATE PROCEDURE AddDiagnostic AS" & vbCrLf & _

"INSERT INTO NW_Diagnostic" & vbCrLf & _

"(DiagnosisID,Temperature,Humi,SignalVoltage,Enviro,BatteryVoltage,Name) ³

"SELECTDiagnosisID,Temperature,Humi,SignalVoltage,Enviro,BatteryVoltage,Name " & "FROM

Northwind.dbo.Diagnosis "cmd.ExecuteNonQuery()

northwindConnection.Close()

bntCreateView.Enabled = True

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 16/32

Function CreateView ()

A view is a structured list of items from theentities or semantic objects defined in the datamodel

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

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

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

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 17/32

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"

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 18/32

Cr eateView cont¶

Re-create View

Try

cmd.CommandText = _

"CREATE VIEW GetDiagnostic AS " & _

"SELECT * " & _

"FROM NW_Diagnostic"

cmd.ExecuteNonQuery()

northwindConnection.Close()

bntPopulateTable.Enabled = True

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 19/32

PopulateData()

The PopulateData statement inserts rows into a 

table, nickname, or view, or the under lying tables 

Inserting a row into a nickname inserts the row into the data source o bject to which the nickname 

r ef er s. 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 oper ation on this view. 

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 20/32

PopulateData cont¶

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

Dim strSQL As String = "EXECUTEEcg.dbo.AddDiagnostic"

Try

Dim cmd As New SqlCommand(strSQL,northwindConnection)

northwindConnection.Open()cmd.ExecuteNonQuery()

northwindConnection.Close()

bntDisplayData.Enabled = True

End Try

End Sub

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 21/32

Function Dis play Data ()

The function Dis playData is the end r esult

of the above functions. User s want to see 

data  being dis play as well as progr ammer s. This function will dis play all data 

de pending on which for mat is  being used. 

In this a pplication, t

he  bntDi

s playData will dis play data in the DataGrid.

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 22/32

DisplayData() cont¶

Private Sub bntDisplayData_Click(ByVal sender As System.Object, ByVal eAs 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 TryEnd If 

End Sub

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 23/32

ECG

Report Analyzer 

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 24/32

ECG Diagnostic Analyzer 

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

SignalVoltage as string, Temperature as Integer, HeartRate asInteger, Systolic as Integer, Diastolic as Integer, Smoke asBoolean;

if ( heartRate > 100) thendisease =´ Highblood pressure´ 

else if 

(systolic >130)

disease= ³ Cardiovascular ́  

else if 

(diastolic > 80)

disease = ³ Coronary artery disease´ 

else

disease = ³ Normal sinus´ 

End if 

End 

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 25/32

Gener ate FinalR e port

Final reports is comprehensive for the following reasons:

Reliability

CorrectnessHelp doctors to know the big picture:

Best-Case Performance

Average-Case Performance Worst-Case Performance

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 26/32

Generate FinalReport cont¶

The final report is mostly queries generatedduring the diagnosis phase. Example of thefinal report¶s retrieval using Subquery:

SELECT Diagnosis.NameFROM Diagnosis

WHERE Diagnosis.DiagnosisID IN

(SELECT History.Heredity

FROM History.Medication IN

(SELECT * FROM DiseaseOne));

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 27/32

Function EmailSender()

According to definition by [2], SMTP

(Simple Mail Transfer Protocol): Thestandard e-mail protocol on the Internetand part of the TCP/IP protocol suite

SMTP defines the message format and themessage transfer agent (MTA), whichstores and forward the mail

SMTP was originally designed for onlyplain text (ASCII text), but MIME and other encoding methods enable executable

programs and multimedia files to beattached to and transported with the emailmessage.

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 28/32

SendEmail() -Format

Date: 9 Aug 2006 04:10:34

From: [email protected]

To: [email protected]

Subject: James Doe Heart-Diagnostic Report

Message: Name- J ames 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-1234Heredity:

Father was a cardiovascular candidateMother never had any kind of heart disease

End of message

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 29/32

Conclusion and Future Considerations

I have learnt a lot from this project and this willhelp me to go deep into database programming.After finishing this project, I highly recommendthat the code for streaming signal voltage fromthe ECG to the database should have the sameplatform as the ECG Database and ReportGenerator. This will help to automate thestreaming of data with alongside with theDatabase Report Generator.

The future continuation development of thisproject should include internet baseprogramming and a function that can beconnected to a phone device in other to sendphone message to the doctor.

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 30/32

References

[1] Craig S. Mullins, ³Database Administration´; The Complete Guide toPractice 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 Featur ing Data Transmission byBluetooth´, PhD Thesis, University of Queensland, Australia, Oct 2002

[6] William Br ims, ³Wireless ECG Volume I´, Master Thesis, Universityof Queensland, Australia, Oct 2002

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

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

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 31/32

THE 

END 

8/8/2019 ECG Report Generator Portable

http://slidepdf.com/reader/full/ecg-report-generator-portable 32/32

Questions?