Example #1
0
        // 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;
        }
Example #2
0
        //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;
        }
Example #3
0
 public DatabaseEngine()
 {
     insertQueries = new Insertion(this.con);
     selectQueries = new Selection(this.con);
 }
Example #4
0
        //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;
        }
Example #5
0
 // 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;
 }
Example #6
0
        // 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;
        }
Example #7
0
        // 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;
        }
Example #8
0
        // 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;
        }
Example #9
0
        //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;
        }
Example #10
0
        // 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;
        }
Example #11
0
        // 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;
        }
Example #12
0
        // 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;
        }
Example #13
0
        // 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;
        }
Example #14
0
        // 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;
        }