Despite tremendous development in wireless sensor networks, the abilities are by far yet fully leveraged in the case of online analysis of medical sensor data. We investigate how a data stream management system can be used to query and analyze streaming data from different medical sensors in real-time. By using the open source data stream management system Esper, we have implemented queries, based upon earlier work by Elle et al., that can be used for real-time recognition of myocardial ischemia by combining a 3-axis accelerometer on the left ventricle of the heart, with an ECG sensor used for QRS detection. In the queries we use a new type of sliding window; a variable length triggered tumbling window. The window is used for aggregate operations that targets only sensor readings originating from single heartbeats. We show how algorithms that are used for medical analysis can be implemented as custom aggregation functions, thus incorporated into the declarative query language that is more suitable for medical personnel without programming experience. Results from experiments run on data recorded from surgical procedures on pig models show that the queries produce correct results, and can be run in real-time on fairly simple computers, e.g. laptops.