public void DetermineFileType407()
 {
     File_Type i;
     MedicalDevice s0 = new MedicalDevice();
     s0.Id = 0;
     s0.Name = (string)null;
     i = this.DetermineFileType("\0", s0);
     Assert.AreEqual<File_Type>(File_Type.Unknown, i);
 }
 public void DetermineFileType275()
 {
     File_Type i;
     MedicalDevice s0 = new MedicalDevice();
     s0.Id = 0;
     s0.Name = "Zephyr";
     i = this.DetermineFileType("m\0Summary", s0);
     Assert.AreEqual<File_Type>(File_Type.Summary, i);
 }
 public void DetermineFileType386()
 {
     File_Type i;
     MedicalDevice s0 = new MedicalDevice();
     s0.Id = 0;
     s0.Name = "Zephyr";
     i = this.DetermineFileType("ppECG", s0);
     Assert.AreEqual<File_Type>(File_Type.ECG, i);
 }
 public void DetermineDeviceType770()
 {
     List<MedicalDevice> list;
     MedicalDevice medicalDevice;
     MedicalDevice[] medicalDevices = new MedicalDevice[1];
     list = new List<MedicalDevice>((IEnumerable<MedicalDevice>)medicalDevices);
     medicalDevice = this.DetermineDeviceType(list, (string)null);
     Assert.IsNull((object)medicalDevice);
 }
 public void DetermineFileType134()
 {
     File_Type i;
     MedicalDevice s0 = new MedicalDevice();
     s0.Id = 0;
     s0.Name = "BasisPeak";
     i = this.DetermineFileType("B", s0);
     Assert.AreEqual<File_Type>(File_Type.Summary, i);
 }
 public void DetermineDeviceType106()
 {
     List<MedicalDevice> list;
     MedicalDevice medicalDevice;
     MedicalDevice[] medicalDevices = new MedicalDevice[2];
     list = new List<MedicalDevice>((IEnumerable<MedicalDevice>)medicalDevices);
     medicalDevice = this.DetermineDeviceType(list, "\0");
     Assert.IsNull((object)medicalDevice);
 }
 public void DetermineDeviceType200()
 {
     List<MedicalDevice> list;
     MedicalDevice medicalDevice;
     MedicalDevice[] medicalDevices = new MedicalDevice[1];
     MedicalDevice s0 = new MedicalDevice();
     s0.Id = 0;
     s0.Name = (string)null;
     medicalDevices[0] = s0;
     list = new List<MedicalDevice>((IEnumerable<MedicalDevice>)medicalDevices);
     medicalDevice = this.DetermineDeviceType(list, "\0");
     Assert.IsNull((object)medicalDevice);
 }
 /// <summary>
 /// Add a new medical device to the database
 /// </summary>
 /// <param name="medicalDevice">MedicalDevice object to add to the database</param>
 public void CreateMedicalDevice(MedicalDevice medicalDevice)
 {
     if(medicalDevice != null) {
         _repository.Add(medicalDevice);
     }
 }
 public void DetermineFileType954()
 {
     File_Type i;
     MedicalDevice s0 = new MedicalDevice();
     s0.Id = 0;
     s0.Name = "Zephyr";
     i = this.DetermineFileType("Event", s0);
     Assert.AreEqual<File_Type>(File_Type.EventData, i);
 }
 public void DetermineFileType766()
 {
     File_Type i;
     MedicalDevice s0 = new MedicalDevice();
     s0.Id = 0;
     s0.Name = "Zephyr";
     i = this.DetermineFileType("Accel", s0);
     Assert.AreEqual<File_Type>(File_Type.Accelerometer, i);
 }
 public void DetermineFileType67()
 {
     File_Type i;
     MedicalDevice s0 = new MedicalDevice();
     s0.Id = 0;
     s0.Name = "Zephyr";
     i = this.DetermineFileType("Breathing", s0);
     Assert.AreEqual<File_Type>(File_Type.Breathing, i);
 }
 public void DetermineFileType569()
 {
     File_Type i;
     MedicalDevice s0 = new MedicalDevice();
     s0.Id = 0;
     s0.Name = "Zephyr";
     i = this.DetermineFileType("Zephy", s0);
     Assert.AreEqual<File_Type>(File_Type.Unknown, i);
 }
 public void DetermineFileType529()
 {
     File_Type i;
     MedicalDevice s0 = new MedicalDevice();
     s0.Id = 0;
     s0.Name = "Microsoft Band";
     i = this.DetermineFileType("M", s0);
     Assert.AreEqual<File_Type>(File_Type.Unknown, i);
 }
Exemple #14
0
 public File_Type DetermineFileType(string fileName, MedicalDevice medicalDevice)
 {
     File_Type result = PatientLogic.DetermineFileType(fileName, medicalDevice);
     return result;
     // TODO: add assertions to method PatientLogicTest.DetermineFileType(String, MedicalDevice)
 }
Exemple #15
0
        /// <summary>
        /// Determine the type of data that is contained inside the file being processed.
        /// </summary>
        /// <param name="fileName">Name of the file being processed.</param>
        /// <param name="deviceType">The device type the file belongs to.</param>
        /// <returns></returns>
        //TODO: This function needs to be made more dynamic.  Risk of file name change from standard format for the device.
        public static File_Type DetermineFileType(string fileName, MedicalDevice medicalDevice)
        {
            File_Type fileType = File_Type.Unknown;

            if (!string.IsNullOrEmpty(fileName) && medicalDevice != null && !string.IsNullOrEmpty(medicalDevice.Name)) {
                switch (medicalDevice.Name) {
                    case "BasisPeak":
                        fileType = File_Type.Summary;
                        break;
                    case "Zephyr":
                        if (fileName.Contains("Accel")) {
                            fileType = File_Type.Accelerometer;
                        }
                        else if (fileName.Contains("General")) {
                            fileType = File_Type.General;
                        }
                        else if (fileName.Contains("BR_RR")) {
                            fileType = File_Type.BR_RR;
                        }
                        else if (fileName.Contains("Breathing")) {
                            fileType = File_Type.Breathing;
                        }
                        else if (fileName.Contains("ECG")) {
                            fileType = File_Type.ECG;
                        }
                        else if (fileName.Contains("Event")) {
                            fileType = File_Type.EventData;
                        }
                        else if (fileName.Contains("Summary")) {
                            fileType = File_Type.Summary;
                        }
                        else {
                            fileType = File_Type.Unknown;
                        }
                        break;
                    case "Microsoft Band":
                        if (fileName.Contains("Accel")) {
                            fileType = File_Type.Accelerometer;
                        }
                        else if (fileName.Contains("Calories")) {
                            fileType = File_Type.Calorie;
                        }
                        else if (fileName.Contains("Distance")) {
                            fileType = File_Type.Distance;
                        }
                        else if (fileName.Contains("Gyroscope")) {
                            fileType = File_Type.Gyroscope;
                        }
                        else if (fileName.Contains("HeartRate")) {
                            fileType = File_Type.HeartRate;
                        }
                        else if (fileName.Contains("Pedometer")) {
                            fileType = File_Type.Pedometer;
                        }
                        else if (fileName.Contains("UV")) {
                            fileType = File_Type.UV;
                        }
                        else if (fileName.Contains("Temperature")) {
                            fileType = File_Type.Temperature;
                        }
                        else {
                            fileType = File_Type.Unknown;
                        }
                        break;
                    default:
                        break;
                }
            }

            return fileType;
        }