ECG Report Generator (Potable) Graphic Interface


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

ECG Report Generator (Potable) Graphic Interface

  1. 1. An ECG Database and Report Generator - A Graphic Interface OSEI KUFFUOR MS Thesis Defense Advisor: Dr Patrick O Bobbie
  2. 2. In this Issue: <ul><li>Fundamental Concept of ECG </li></ul><ul><li>ECG Theory </li></ul><ul><li>The Heart </li></ul><ul><li>Overview of ECG Report Generator </li></ul><ul><li>Design and Implementation </li></ul><ul><li>ECG Database </li></ul><ul><li>The Application </li></ul><ul><li>ECG Report Analyzer </li></ul><ul><li>Generate FinalReport </li></ul><ul><li>Automatic Email Sender </li></ul><ul><li>Conclusion </li></ul><ul><li>References </li></ul>
  3. 3. Introduction <ul><li>Cardiovascular disease (CVD), principally heart disease and stroke. </li></ul><ul><li>Nation’s leading killer for both men and women </li></ul><ul><li>This disease kills all racial and ethnic groups </li></ul><ul><li>About 1 million American die of CVD each year </li></ul>
  4. 4. Introduction cont’ <ul><li>According to American Heart Association, one person dies every 30 seconds which is over 2,600 deaths in every single day. </li></ul><ul><li>Victims between 35-64 years of age </li></ul><ul><li>About 62 million Americans have some form of cardiovascular disease </li></ul>
  5. 5. ECG Measurement <ul><li>Signals from two leads are connected between two point of the body </li></ul><ul><li>Electrical voltage observed between the electrodes is given by the dot product of the two vectors </li></ul><ul><li>Modern standard ECG – uses more electrode connection points </li></ul>
  6. 6. Heart Rate <ul><li>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 </li></ul><ul><li>In this diagnosis, I calibrated Normal Heart Rate = 100 and more than that results in some form of Cardiovascular heart disease </li></ul>
  7. 7. 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.Net App SQL Server Database
  8. 8. The Application(VB.Net)
  9. 9. Major Functions in the Application <ul><li>CreateDatabase() </li></ul><ul><li>Create Table() </li></ul><ul><li>CreateProcedure() </li></ul><ul><li>CreateView() </li></ul><ul><li>PopulateTable() </li></ul><ul><li>DisplayData() </li></ul>
  10. 10. CreateDatabase() <ul><li>Using SQL statements you can create database objects programmatically </li></ul><ul><li>Private Sub bntCreateDatabase_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntCreateDatabase.Click </li></ul><ul><li>If bntCreateTable.Enabled Then </li></ul><ul><li>Dim dr As DialogResult = MessageBox.Show </li></ul><ul><li>If dr = DialogResult.Yes Then </li></ul><ul><li>ResetUI() </li></ul><ul><li>CreateTable() </li></ul><ul><li>End If </li></ul><ul><li>Else </li></ul><ul><li>CreateTable() </li></ul><ul><li>End If </li></ul><ul><li>End Sub </li></ul><ul><li>This function creates a database in the form of a table. </li></ul>
  11. 11. Function CreateTable ( ) <ul><li>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. </li></ul>
  12. 12. CreateTable Cont’ <ul><li>Private Sub bntCreateTable_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntCreateTable.Click </li></ul><ul><li>Dim strSQL As String = _ </li></ul><ul><li>&quot;USE Ecg&quot; & vbCrLf & _ </li></ul><ul><li>&quot;IF EXISTS (&quot; & _ </li></ul><ul><li>&quot;SELECT * &quot; & _ </li></ul><ul><li>&quot;FROM Ecg.dbo.sysobjects &quot; & _ </li></ul><ul><li>&quot;WHERE Name = 'NW_Diagnostic' &quot; & _ </li></ul><ul><li>&quot;AND TYPE = 'u')&quot; & vbCrLf & _ </li></ul><ul><li>&quot;BEGIN&quot; & vbCrLf & _ </li></ul><ul><li>&quot;DROP TABLE Ecg.dbo.NW_Diagnostic&quot; & vbCrLf & _ </li></ul><ul><li>&quot;END&quot; & vbCrLf & _ </li></ul><ul><li>&quot;CREATE TABLE NW_Diagnostic (&quot; & _ </li></ul><ul><li>&quot;DiagnosisID Int NOT NULL,&quot; & _ </li></ul><ul><li>&quot;Temperature NVarChar(10) NOT NULL,&quot; & _ </li></ul><ul><li>&quot;Humi NVarChar(10) NOT NULL,&quot; & _ </li></ul><ul><li>&quot;SignalVoltage NVarChar(10) NOT NULL,&quot; & _ </li></ul><ul><li>&quot;Enviro NVarChar (10) NOT NULL, &quot; & _ </li></ul><ul><li>&quot;BatteryVoltage NVarChar (10) NOT NULL, &quot; & _ </li></ul><ul><li>&quot;Name NVarChar(10) NOT NULL, &quot; & _ </li></ul><ul><li>&quot;CONSTRAINT [PK_DiagnosisID] PRIMARY KEY CLUSTERED&quot; & _ </li></ul><ul><li>&quot;(DiagnosisID))&quot; </li></ul>
  13. 13. CreateProcedure( ) <ul><li>Stored procedures are important aspect in all database programs </li></ul><ul><li>VB.NET applications are no exceptions to this rule. </li></ul><ul><li>Stored procedures enable users change the business logic without actually tinkering with the application. </li></ul>
  14. 14. CreateProcedure() cont’ <ul><li>First ,you have to DROP Procedure if it exists </li></ul><ul><li>Dim strSQL As String = _ </li></ul><ul><li>&quot;USE Ecg&quot; & vbCrLf & _ </li></ul><ul><li>&quot;IF EXISTS (&quot; & _ </li></ul><ul><li>&quot;SELECT * &quot; & _ </li></ul><ul><li>&quot;FROM Ecg.dbo.sysobjects &quot; & _ </li></ul><ul><li>&quot;WHERE Name = 'AddDiagnostic' &quot; & _ </li></ul><ul><li>&quot;AND TYPE = 'p')&quot; & vbCrLf & _ </li></ul><ul><li>&quot;BEGIN&quot; & vbCrLf & _ </li></ul><ul><li>&quot;DROP PROCEDURE AddDiagnostic&quot; & vbCrLf & _ </li></ul><ul><li>&quot;END&quot; </li></ul>
  15. 15. CreateProcedure( ) cont ’ <ul><li>Once the Procedure is DROPPED, then re-create Procedure </li></ul><ul><li>cmd.CommandText = _ </li></ul><ul><li>&quot;CREATE PROCEDURE AddDiagnostic AS&quot; & vbCrLf & _ </li></ul><ul><li>&quot;INSERT INTO NW_Diagnostic&quot; & vbCrLf & _ </li></ul><ul><li>&quot;(DiagnosisID,Temperature,Humi,SignalVoltage,Enviro,BatteryVoltage,Name) “ </li></ul><ul><li>&quot;SELECT DiagnosisID,Temperature,Humi,SignalVoltage,Enviro,BatteryVoltage,Name &quot; & &quot;FROM Northwind.dbo.Diagnosis &quot; </li></ul><ul><li>cmd.ExecuteNonQuery() </li></ul><ul><li>northwindConnection.Close() </li></ul><ul><li>bntCreateView.Enabled = True </li></ul>
  16. 16. Function CreateView () <ul><li>A view is a structured list of items from the entities or semantic objects defined in the data model </li></ul><ul><li>A view instance is a view that is populated with data for one entity or semantic object </li></ul><ul><li>To create a view instance, the application must first obtain the new data values and relationships </li></ul><ul><li>This is most likely done via a data entry form, but applications also receive data from other program and in other ways </li></ul>
  17. 17. Function CreateView () cont’ <ul><li>DROP View if it exists </li></ul><ul><li>Private Sub bntCreateView_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntCreateView.Click </li></ul><ul><li>Dim northwindConnection As New SqlConnection(connectionString) </li></ul><ul><li>Dim strSQL As String = _ </li></ul><ul><li>&quot;USE Ecg&quot; & vbCrLf & _ </li></ul><ul><li>&quot;IF EXISTS (&quot; & _ </li></ul><ul><li>&quot;SELECT * &quot; & _ </li></ul><ul><li>&quot;FROM Ecg.dbo.sysobjects &quot; & _ </li></ul><ul><li>&quot;WHERE Name = 'GetDiagnostic' &quot; & _ </li></ul><ul><li>&quot;AND TYPE = 'v')&quot; & vbCrLf & _ </li></ul><ul><li>&quot;BEGIN&quot; & vbCrLf & _ </li></ul><ul><li>&quot;DROP VIEW GetDiagnostic&quot; & vbCrLf & _ </li></ul><ul><li>&quot;END&quot; </li></ul>
  18. 18. CreateView cont’ <ul><li>Re-create View </li></ul><ul><li>Try </li></ul><ul><li>cmd.CommandText = _ </li></ul><ul><li>&quot;CREATE VIEW GetDiagnostic AS &quot; & _ </li></ul><ul><li>&quot;SELECT * &quot; & _ </li></ul><ul><li>&quot;FROM NW_Diagnostic&quot; </li></ul><ul><li>cmd.ExecuteNonQuery() </li></ul><ul><li>northwindConnection.Close() </li></ul><ul><li>bntPopulateTable.Enabled = True </li></ul>
  19. 19. PopulateData() <ul><li>The PopulateData statement inserts rows into a table, nickname , or view, or the underlying tables </li></ul><ul><li>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. </li></ul>
  20. 20. PopulateData cont’ <ul><li>Private Sub bntPopulateTable_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntPopulateTable.Click </li></ul><ul><li>Dim strSQL As String = &quot;EXECUTE Ecg.dbo.AddDiagnostic&quot; </li></ul><ul><li>Try </li></ul><ul><li>Dim cmd As New SqlCommand(strSQL, northwindConnection) </li></ul><ul><li>northwindConnection.Open() </li></ul><ul><li>cmd.ExecuteNonQuery() </li></ul><ul><li>northwindConnection.Close() </li></ul><ul><li>bntDisplayData.Enabled = True </li></ul><ul><li>End Try </li></ul><ul><li>End Sub </li></ul>
  21. 21. Function Display Data () <ul><li>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. </li></ul>
  22. 22. DisplayData() cont’ <ul><li>Private Sub bntDisplayData_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntDisplayData.Click </li></ul><ul><li>If IsNothing(dgDiagnosis.DataSource) Then </li></ul><ul><li>Dim strSQL As String = _ </li></ul><ul><li>&quot;USE Ecg&quot; & vbCrLf & _ </li></ul><ul><li>&quot;SELECT * &quot; & _ </li></ul><ul><li>&quot;FROM GetDiagnostic&quot; </li></ul><ul><li>Try </li></ul><ul><li>Dim northwindConnection As New SqlConnection(connectionString) </li></ul><ul><li>Dim cmd As New SqlCommand(strSQL, northwindConnection) </li></ul><ul><li>Dim da As New SqlDataAdapter(cmd) </li></ul><ul><li>Dim dsDiagnostic As New DataSet </li></ul><ul><li>da.Fill(dsDiagnostic, &quot;Diagnostic&quot;) </li></ul><ul><li>End Try </li></ul><ul><li>End If </li></ul><ul><li>End Sub </li></ul>
  23. 23. ECG Report Analyzer
  24. 24. ECG Diagnostic Analyzer <ul><li>Diagnostic Analyzer uses algorithm to diagnose the patient’s condition. For example: </li></ul><ul><li>SignalVoltage as string, Temperature as Integer, HeartRate as Integer, Systolic as Integer, Diastolic as Integer, Smoke as Boolean; </li></ul><ul><li>if ( heartRate > 100) then </li></ul><ul><li>disease =” Highblood pressure ” </li></ul><ul><li>else if </li></ul><ul><li>(systolic >130) </li></ul><ul><li>disease= “ Cardiovascular ” </li></ul><ul><li>else if </li></ul><ul><li>(diastolic > 80) </li></ul><ul><li>disease = “ Coronary artery disease ” </li></ul><ul><li>else </li></ul><ul><li>disease = “ Normal sinus ” </li></ul><ul><li>End if </li></ul><ul><li>End </li></ul>
  25. 25. Generate FinalReport <ul><li>Final reports is comprehensive for the following reasons: </li></ul><ul><li>Reliability </li></ul><ul><li>Correctness </li></ul><ul><li>Help doctors to know the big picture: </li></ul><ul><li>Best-Case Performance </li></ul><ul><li>Average-Case Performance </li></ul><ul><li>Worst-Case Performance </li></ul>
  26. 26. Generate FinalReport cont’ <ul><li>The final report is mostly queries generated during the diagnosis phase. Example of the final report’s retrieval using Subquery: </li></ul><ul><li>SELECT Diagnosis.Name </li></ul><ul><li>FROM Diagnosis </li></ul><ul><li>WHERE Diagnosis.DiagnosisID IN </li></ul><ul><li>( SELECT History.Heredity </li></ul><ul><li>FROM History.Medication IN </li></ul><ul><li>( SELECT * FROM DiseaseOne)); </li></ul>
  27. 27. Function EmailSender() <ul><li>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 </li></ul><ul><li>SMTP defines the message format and the message transfer agent (MTA), which stores and forward the mail </li></ul><ul><li>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. </li></ul>
  28. 28. SendEmail() -Format <ul><li>Date: 9 Aug 2006 04:10:34 </li></ul><ul><li>From: [email_address] </li></ul><ul><li>To: [email_address] </li></ul><ul><li>Subject: James Doe Heart-Diagnostic Report </li></ul><ul><li>Message: Name- James Doe </li></ul><ul><li>Date of Birth: 10/10/2000 </li></ul><ul><li>SSN: xxx-xxx-2437 (format for security purpose) </li></ul><ul><li>Heart Rate > 100 </li></ul><ul><li>Systolic > 130 </li></ul><ul><li>Gender: Female and smokes </li></ul><ul><li>Medication: Ampicillian 500mg </li></ul><ul><li>Possible Diagnosis Results: Cardiovascular heart disease </li></ul><ul><li>Medication Center: 1234 Great Street, Marietta GA, 30060(phone) 770-456-1234 Heredity: </li></ul><ul><li>Father was a cardiovascular candidate </li></ul><ul><li>Mother never had any kind of heart disease </li></ul><ul><li>End of message </li></ul>
  29. 29. Conclusion and Future Considerations <ul><li>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. </li></ul><ul><li>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. </li></ul>
  30. 30. References <ul><li>[1] Craig S. Mullins, “Database Administration”; The Complete Guide to Practice and procedures, 2002 </li></ul><ul><li>[2] David Gefen & Chitibabu Govindarajulu, “Advanced Visual Basic.Net”, 2004 </li></ul><ul><li>[3] Gary J. Bronson & David Rosenthal, “Introduction to Programming with Visual Basic.Net”, 2005 </li></ul><ul><li>[4] Keith Franklin, “VB.Net Developers”, 2002 </li></ul><ul><li>[5] Daniel Marr, “ECG Application Featuring Data Transmission by Bluetooth”, PhD Thesis, University of Queensland, Australia, Oct 2002 </li></ul><ul><li>[6] William Brims, “Wireless ECG Volume I”, Master Thesis, University of Queensland, Australia, Oct 2002 </li></ul><ul><li>[7] National Center for Health Statistic and National Center for Chronic Disease Prevention and Health Promotion, Centers for Disease Control and prevention, 1995. </li></ul><ul><li>[8] h ttp:// </li></ul>
  31. 32. Questions?