raspearsy / bme590hrm

MIT License
2 stars 1 forks source link

bme590hrm

Integration: Build Status

Group Members: Ryan Spears Garren Angacian Nisarg Shah Josh Khani

Collaborators: Mark Palmeri Suyash Kumar Arjun Desai

Guidelines: (1) frequent commits (with issue references) (2) work on separate branches to then merge in (3) Use github milestones, issues, & labels (4) write unit tests prior to associated code (5) associate a software license with project (6) write a README.md that describes how to run the program (7) use PyCharm (8) use if name == "main" conditionals for main file (9) use py.test formatting for unit tests (10) functions are accessible from a module (11) no hard-coded vlaues within functions...use default values (12) follow PEP8 (13) use try/except exception handling (14) gracefully terminate when input file ends

Goals: (1) read in .csv file named ecg_data.csv containing ECG data (header, time [s], voltage [mV] (2) estimate instantaneous HR (3) estimate average HR over user-specified timespan (in min) (4) indicate when bradycradia occured (5) indicate when tachycardia occured (6) output (2-5) as a .txt file (7) create an annotated tag titled v1.0rc1 when assignment completed and ready for grading

Desciription: UPDATED VERSION Link for virtual server: http://vcm-1844.vm.duke.edu:5000

/api/requests is a GET endpoint that provides the number of requests

/api/summary is a POST endpoint that provides a summary of the heart rate data It needs a time interval and corresponding voltages for each time in that time interval. It returns the times, instantaneous heart rates, tachycardia annotations, and bradycardia annotations

/api/average is a POST endpoint that provides average heart rate data It needs an averaging period, a time interval, and corresponding voltages for each time in that time interval. It returns the averaging period, the time interval, average heart rates, tachycardia annotations, and bradycardia annotations.

Run ecgmeasure.py which uses the ecginput.py module to read a CSV file and convert it into a DataFrame. This DataFrame is then used in the hrdetector, bradydector, and tachydector functions in HR_Measure.py.

The hrdetector function uses threshold detection to specify a heart beat and estimate both instantaneous heart rate and heart rate over a user-specified number of minutes.

The bradydetector function then takes the heart rate data and indicates whether bradycardia is present based on an input threshold value. This is displayed with an additional column titled B/T representing the disease that is present or if the patient is healthy. The tachydetector function then takes this new DataFrame and also indicates whether tachycardia is present based on an input threshold value. This is also displayed in the B/T column.

Finally, the ecgoutput.py module is called to convert this last DataFrame into a text file that gives a summary of the ECG analysis.