An ECG Database and Report Generator - PowerPoint PPT Presentation

1 / 32
About This Presentation
Title:

An ECG Database and Report Generator

Description:

An ECG Database and Report Generator - A Graphic Interface. OSEI KUFFUOR. MS Thesis Defense ... inserts rows into a table, nickname, or view, or the underlying ... – PowerPoint PPT presentation

Number of Views:157
Avg rating:3.0/5.0
Slides: 33
Provided by: CSE118
Category:

less

Transcript and Presenter's Notes

Title: An ECG Database and Report Generator


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

2
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

3
Introduction
  • Cardiovascular disease (CVD), principally heart
    disease and stroke.
  • Nations leading killer for both men and women
  • This disease kills all racial and ethnic groups
  • About 1 million American die of CVD each year

4
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 age
  • About 62 million Americans have some form of
    cardiovascular disease

5
ECG Measurement
  • Signals 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

6
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

7
Overview of ECG Report Generator
Signal from ECG
Convert Signal into actual data
Database
VB.Net App
Signal stored at Workstation
SQL Server
ECG Report Analyzer
Generate Final Report
Send Email To Doctor
8
The Application(VB.Net)
9
Major Functions in the Application
  • CreateDatabase()
  • Create Table()
  • CreateProcedure()
  • CreateView()
  • PopulateTable()
  • DisplayData()

10
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.

11
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.

12
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, " _

13
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.

14
CreateProcedure() cont
  • First ,you have to DROP Procedure if it exists
  • Dim 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"

15
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,Envir
    o,BatteryVoltage,Name)
  • "SELECT DiagnosisID,Temperature,Humi,SignalVoltage
    ,Enviro,BatteryVoltage,Name " "FROM
    Northwind.dbo.Diagnosis "
  • cmd.ExecuteNonQuery()
  • northwindConnection.Close()
  • bntCreateView.Enabled True

16
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

17
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(conne
    ctionString)
  • 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"

18
CreateView cont
  • Re-create View
  • Try
  • cmd.CommandText _
  • "CREATE VIEW GetDiagnostic AS " _
  • "SELECT " _
  • "FROM NW_Diagnostic"
  • cmd.ExecuteNonQuery()
  • northwindConnection.Close()
  • bntPopulateTable.Enabled True

19
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.

20
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 True
  • End Try
  • End Sub

21
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.

22
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 If
  • End Sub

23
ECG Report Analyzer
24
ECG Diagnostic Analyzer
  • Diagnostic Analyzer uses algorithm to diagnose
    the patients condition. For example
  • SignalVoltage as string, Temperature as Integer,
    HeartRate as Integer, Systolic as Integer,
    Diastolic as Integer, Smoke as Boolean
  • if ( heartRate gt 100) then
  • disease Highblood pressure
  • else if
  • (systolic gt130)
  • disease Cardiovascular
  • else if
  • (diastolic gt 80)
  • disease Coronary artery disease
  • else
  • disease Normal sinus
  • End if
  • End

25
Generate FinalReport
  • Final reports is comprehensive for the following
    reasons
  • Reliability
  • Correctness
  • Help doctors to know the big picture
  • Best-Case Performance
  • Average-Case Performance
  • Worst-Case Performance

26
Generate FinalReport cont
  • The final report is mostly queries generated
    during the diagnosis phase. Example of the final
    reports retrieval using Subquery
  • SELECT Diagnosis.Name
  • FROM Diagnosis
  • WHERE Diagnosis.DiagnosisID IN
  • (SELECT History.Heredity
  • FROM History.Medication IN
  • (SELECT FROM DiseaseOne))

27
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.

28
SendEmail() -Format
  • Date 9 Aug 2006 041034
  • From spsu_at_spsu.edu
  • To doctor_at_ga.org
  • Subject James Doe Heart-Diagnostic Report
  • Message Name- James Doe
  • Date of Birth 10/10/2000
  • SSN xxx-xxx-2437 (format for security
    purpose)
  • Heart Rate gt 100
  • Systolic gt 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
    disease
  • End of message

29
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.

30
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/c
    ardiovascular/cardiovascular.html

31
(No Transcript)
32
Questions?
Write a Comment
User Comments (0)
About PowerShow.com