A method of diagnosis. The method can include the steps of sampling the breathing of a patient and from the sampling, obtaining a waveform corresponding to a pattern of the breathing of the patient in which the waveform is a repetitive waveform that is indicative of a carbon dioxide concentration in air expired by the patient. The method can also include the steps of processing the waveform to obtain a set of data that reflects the carbon dioxide concentration in the expired air and based on the processing of the waveform, detecting a potential adverse respiratory event in the patient.