예제 #1
0
 public SaveDataInFile(DAQSettingsDTO daqDTO, ConcurrentQueue <RawData> saveDataQueue, FileManager fileManager, BPDataSequenceDTO bpDataSequenceDTO)
 {
     savelist           = new List <double>();
     _daqDTO            = daqDTO;
     _saveDataQueue     = saveDataQueue;
     _fileManager       = fileManager;
     _stopThread        = false;
     _sequenceNumber    = 1;
     _bpDataSequenceDTO = bpDataSequenceDTO;
 }
예제 #2
0
 public CtrlOPVitalsDAL(ref ConcurrentQueue <RawData> RawDataQueue, ref ConcurrentQueue <RawData> saveDataQueue, ref DAQSettingsDTO daqSettings)
 {
     _RawDataQueue      = RawDataQueue;
     _saveDataQueue     = saveDataQueue;
     _daqSettings       = daqSettings;
     fileManager        = new FileManager();
     employee           = new EmployeeDatabase();
     DaqAsync           = new AsyncDaq(_RawDataQueue, _saveDataQueue, _daqSettings);
     _bpDataSequenceDTO = new BPDataSequenceDTO();
     _saveDataInFile    = new SaveDataInFile(_daqSettings, _saveDataQueue, fileManager, _bpDataSequenceDTO);
     _clinicalDatabase  = new ClinicalDatabase(new ParameterBuilder());
     _transdusorDTO     = new TransdusorDTO();
     pathcomment        = "";
     pathoperation      = "";
 }
예제 #3
0
        public void SaveMeasurement_InsertEmployee_AddEmployeeWasCalled()
        {
            var               parameterBuilder = new MuckParameterBuilder();
            var               uut            = new ClinicalDatabase(parameterBuilder);
            EmployeeDTO       employee       = new EmployeeDTO();
            OperationDTO      operation      = new OperationDTO();
            PatientDTO        patient        = new PatientDTO();
            DAQSettingsDTO    daq            = new DAQSettingsDTO();
            BPDataSequenceDTO bpDataSequence = new BPDataSequenceDTO();
            TransdusorDTO     transdusor     = new TransdusorDTO();

            uut.SaveMeasurement(employee, operation, patient, daq, bpDataSequence, transdusor);

            Assert.That(parameterBuilder.WasAddEmployeeCalled, Is.EqualTo(true));
        }
예제 #4
0
 public void AddDataSequence(SqlCommand cmd, BPDataSequenceDTO dataSequence)
 {
     cmd.Parameters.AddWithValue("@NumberOfSequences", dataSequence.NumberOfSequences_);
     cmd.Parameters.AddWithValue("@SequenceDuration_sec", dataSequence.SequenceDuration_sec_);
 }
예제 #5
0
        public bool SaveMeasurement(EmployeeDTO employee, OperationDTO operation, PatientDTO patient, DAQSettingsDTO DAQ, BPDataSequenceDTO dataSequence, TransdusorDTO transdusor, string pathcomment, string pathoperation)
        {
            long   OperationID_;
            bool   saved = true;
            int    BPdataID_;
            string insertStringParamOperation = @"INSERT INTO Operation(OPNurseFirstName, OPNurseLastName, OPNurseIDNumber, NumberOFAlarms, Comments, DurationOperation_hour, DurationOperation_min, DurationOperation_sec, PatientCPR, Complikations)
                                        OUTPUT INSERTED.OperationID
                                        VALUES(@OPNurseFirstName, @OPNurseLastName, @OPNurseIDNumber, @NumberOFAlarms, @Comments, @DurationOperation_hour, @DurationOperation_min, @DurationOperation_sec, @PatientCPR, @Complikations)";

            using (SqlCommand cmd = new SqlCommand(insertStringParamOperation, OpenConnection))
            {
                parameterBuilder_.AddEmployee(cmd, employee);
                parameterBuilder_.AddOperation(cmd, operation);
                parameterBuilder_.AddComments(cmd, pathcomment);
                parameterBuilder_.AddPatient(cmd, patient);
                OperationID_ = (long)cmd.ExecuteScalar();
            }

            string insertStringParamBPDataSequence = @"INSERT INTO BPDataSequence( Raw_Data, Samplerate_hz, Interval_sec, NumberOfSequences, SequenceDuration_sec, Data_Format, Bin_or_Text, Measurement_Format_Type, ConversionConstant_mmhgprmV, ZeroPoint_mmHg, Transdusor_Identification, OperationID )
                                        OUTPUT INSERTED.BPdataID 
                                        VALUES(@Raw_Data,@Samplerate_hz, @Interval_sec, @NumberOfSequences, @SequenceDuration_sec, @Data_Format, @Bin_or_Text, @Measurement_Format_Type,@ConversionConstant_mmhgprmV,@ZeroPoint_mmHg,@Transdusor_Identification,@OperationID)";

            using (SqlCommand cmd = new SqlCommand(insertStringParamBPDataSequence, OpenConnection))
            {
                parameterBuilder_.AddRawData(cmd, Zipfolder(pathoperation));
                parameterBuilder_.AddDAQ(cmd, DAQ);
                parameterBuilder_.AddDataSequence(cmd, dataSequence);
                parameterBuilder_.AddTransdusor(cmd, transdusor);
                cmd.Parameters.AddWithValue("@OperationID", OperationID_);

                BPdataID_ = (int)cmd.ExecuteScalar();
            }
            return(saved);
        }
예제 #6
0
 public void AddDataSequence(SqlCommand cmd, BPDataSequenceDTO dataSequence)
 {
     WasAddDataSequenceCalled = true;
 }