// 3) select all conditions public Tuple<LinkedList<int>, LinkedList<String>, LinkedList<String>> getAllConditions() { Selection sr = new Selection(con); Tuple<LinkedList<int>, LinkedList<String>, LinkedList<String>> conditions = sr.AllConditions(); return conditions; }
//Select methods // 1) select all patients (patientID and name) public Tuple<LinkedList<int>, LinkedList<String>, LinkedList<String>> getAllPatients() { dbOpen(); Tuple<LinkedList<int>, LinkedList<String>, LinkedList<String>> patients = null; Selection sr = new Selection(con); try { patients = sr.AllPatients(); } catch (Exception err) { System.Diagnostics.Debug.WriteLine("Error is occuring here"); } dbClose(); return patients; }
public DatabaseEngine() { insertQueries = new Insertion(this.con); selectQueries = new Selection(this.con); }
//select latest scan location timestamp public Tuple<int, String, double, double, DateTime> getLatestScanLoc() { Selection sr = new Selection(con); Tuple<LinkedList<int>, LinkedList<DateTime>> patients = getScanLocationTimestamps(); LinkedList<int> id = patients.Item1; LinkedList<DateTime> times = patients.Item2; int scanLoc = id.Last(); DateTime last = times.Last(); for (int i = 0; i < times.Count(); i++) { if (DateTime.Compare(times.First(), last) > 0) { scanLoc = id.First(); last = times.First(); id.RemoveFirst(); times.RemoveFirst(); } else { id.RemoveFirst(); times.RemoveFirst(); } } Tuple<int, String, double, double, DateTime> scan = sr.ScanLocationsCut(scanLoc, last); return scan; }
// 7b) select all timestamps and scan IDs for patient scans public Tuple<LinkedList<int>, LinkedList<DateTime>> timestampsForPatientScans(int patientID) { Selection sr = new Selection(con); Tuple<LinkedList<int>, LinkedList<DateTime>> timestamps = sr.timestampsForPatientScans(patientID); return timestamps; }
// 8) select patient scans (and value) public Tuple<LinkedList<int>, LinkedList<String>, LinkedList<DateTime>, LinkedList<double>> getScanResult(int ScanID) { Selection sr = new Selection(con); Tuple<LinkedList<int>, LinkedList<String>, LinkedList<DateTime>, LinkedList<double>> result = sr.scanValueForPatient(ScanID); return result; }
// 7) select all timestamps for patient scan type public Tuple<LinkedList<int>, LinkedList<DateTime>> getScanTimestamps(int scanTypeID) { Selection sr = new Selection(con); Tuple<LinkedList<int>, LinkedList<DateTime>> timestamps = sr.timestampsForPatient(scanTypeID); return timestamps; }
// 10) select patient point recognition scans (and location) public Tuple<LinkedList<String>, LinkedList<String>, LinkedList<String>, LinkedList<double>, LinkedList<double>, LinkedList<double>, LinkedList<DateTime>> getScanLocation(int scanLocID) { Selection sr = new Selection(con); Tuple<LinkedList<String>, LinkedList<String>, LinkedList<String>, LinkedList<double>, LinkedList<double>, LinkedList<double>, LinkedList<DateTime>> locations = sr.ScanLocations("patientID", scanLocID.ToString()); return locations; }
//select all patients that have scanLocation scans public Tuple<LinkedList<int>, LinkedList<DateTime>> getScanLocationTimestamps() { Tuple<LinkedList<int>, LinkedList<DateTime>> patients = null; Selection sr = new Selection(con); patients = sr.locTimestamps(); return patients; }
// 7a) gets scan IDs from patientScans table public Tuple<LinkedList<int>, LinkedList<int>> getScanIDs(int patientID) { Selection sr = new Selection(con); Tuple<LinkedList<int>, LinkedList<int>> scanIDs = sr.selectType3("PatientScans", "patientID", patientID.ToString()); return scanIDs; }
// 6) select all scan types for patient public Tuple<LinkedList<int>, LinkedList<String>> getPatientScanTypes(int patientID) { Selection sr = new Selection(con); Tuple<LinkedList<int>, LinkedList<String>> patientScanTypes = sr.scanTypesForPatient(patientID); return patientScanTypes; }
// 2) select patient information public Tuple<LinkedList<int>, LinkedList<String>, LinkedList<DateTime>, LinkedList<String>, LinkedList<String>, LinkedList<String>, LinkedList<String>> getPatientInformation(int patientID) { Selection sr = new Selection(con); Tuple<LinkedList<int>, LinkedList<String>, LinkedList<DateTime>, LinkedList<String>, LinkedList<String>, LinkedList<String>, LinkedList<String>> patientInfo = sr.PatientInformation("patientID", patientID.ToString()); return patientInfo; }
// 4) select patient condition (and information about it) public Tuple<LinkedList<int>, LinkedList<String>, LinkedList<String>> getPatientConditionInformation(int patientID) { Selection sr = new Selection(con); Tuple<LinkedList<int>, LinkedList<String>, LinkedList<String>> patientConditions = sr.patientConditions(patientID); return patientConditions; }
// 5) select limb coordinates public Tuple<LinkedList<int>, LinkedList<double[]>, LinkedList<double[]>, LinkedList<String[]>, LinkedList<String[]>> getLimbCoordinates(int scanID) { Selection sr = new Selection(con); /* Tuple<LinkedList<int>, LinkedList<double[]>, LinkedList<double[]>, LinkedList<double[]>, LinkedList<double[]>> limbCoords = sr.limbCoordinates(scanID); return limbCoords;*/ return null; }