Beispiel #1
0
        private void PatientLoader_Loaded(object Sender, RoutedEventArgs e)
        {
            //open database
            db.dbOpen();

            //hide existing patient labels
            this.patientIDExisting.Visibility          = Visibility.Collapsed;
            this.patientNameExisting.Visibility        = Visibility.Collapsed;
            this.patientNhsNoExisting.Visibility       = Visibility.Collapsed;
            this.patientweightExisting.Visibility      = Visibility.Collapsed;
            this.patientDOBExisting.Visibility         = Visibility.Collapsed;
            this.patientNationalityExisting.Visibility = Visibility.Collapsed;
            this.patientAddressExisting.Visibility     = Visibility.Collapsed;

            //hide irrelevant tabs
            this.recordedscans.Visibility   = Visibility.Collapsed;
            this.conditiondetail.Visibility = Visibility.Collapsed;

            //enable/disable appropriate controls
            this.patientIDText.IsEnabled = false;

            if (db.getAllPatients().Item1.Count != 0)
            {
                this.activeID                  = db.getAllPatients().Item1.Last();
                this.patientIDText.Text        = (activeID + 1).ToString();
                this.patientIDExisting.Content = this.patientIDText.Text;
            }
            else
            {
                this.activeID           = 0;
                this.patientIDText.Text = (activeID + 1).ToString();
            }

            this.nameLabel.ToString();
        }
Beispiel #2
0
        void MetaLoader_Loaded(object sender, RoutedEventArgs e)
        {
            /// <summary>
            /// Calls patient information records from the database
            /// </summary>

            db.dbOpen();

            //access all patients from database.
            Tuple <LinkedList <int>, LinkedList <String>, LinkedList <string> > patientsList = db.getAllPatients();

            nodeID    = patientsList.Item1.First;
            nodeName  = patientsList.Item2.First;
            nodeNHSNo = patientsList.Item3.First;

            //populate datagrid

            while (nodeID != null)
            {
                var nextID    = nodeID.Next;
                var nextName  = nodeName.Next;
                var nextNHSNo = nodeNHSNo.Next;

                patientsList.Item1.Remove(nodeID);
                patientsList.Item2.Remove(nodeName);
                patientsList.Item3.Remove(nodeNHSNo);

                //null check when at end of list
                if (nodeID != null)
                {
                    var nodes = new { Id = nodeID.Value, Patientname = nodeName.Value, Patientnhsno = nodeNHSNo.Value };
                    listBox1.Items.Add(nodes);
                }

                nodeID    = nextID;
                nodeName  = nextName;
                nodeNHSNo = nextNHSNo;
            }
        }
Beispiel #3
0
        /// <summary>
        /// window_loaded
        /// </summary>
        /// <param name="sender">originator of event</param>
        /// <param name="e">event identifier</param>

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //define debug window
            windowDebug       = new DebugLoader();
            windowDebug.Owner = this;

            //output to debug window
            windowDebug.sendMessageToOutput("Status", "Welcome to the PARSE Toolkit");
            windowDebug.sendMessageToOutput("Status", "Initializing Kinect Device");

            //check kinect sensors
            if (KinectSensor.KinectSensors.Count > 0)
            {
                windowDebug.sendMessageToOutput("Status", "Kinect found and online - " + KinectSensor.KinectSensors[0].DeviceConnectionId);
                this.newscan.IsEnabled    = true;
                this.kinectmenu.IsEnabled = true;
            }
            else
            {
                windowDebug.sendMessageToOutput("Warning", "No Kinect Found");
                //Check for kinect connection periodically
                kinectCheck = new System.Threading.Timer(checkKinectConnection, null, TimeSpan.Zero, TimeSpan.FromSeconds(10));
            }

            //get version number
            Assembly        assembly = Assembly.GetExecutingAssembly();
            FileVersionInfo fvi      = FileVersionInfo.GetVersionInfo(assembly.Location);
            string          version  = fvi.FileVersion;

            verno.Content = "Version no: " + version;

            //populate recent patients area if there are any
            Tuple <LinkedList <int>, LinkedList <String>, LinkedList <String> > recentPatients = db.getAllPatients();

            //use string list for representing more sensibly
            List <String> patientInfo = new List <String>();

            LinkedListNode <int>    nodeID   = recentPatients.Item1.First;
            LinkedListNode <String> nodeName = recentPatients.Item2.First;

            //populate datagrid

            while (nodeID != null)
            {
                var nextID   = nodeID.Next;
                var nextName = nodeName.Next;

                recentPatients.Item1.Remove(nodeID);
                recentPatients.Item2.Remove(nodeName);

                //null check when at end of list
                if (nodeID != null)
                {
                    patientInfo.Add(nodeID.Value + " - " + nodeName.Value);
                }

                nodeID   = nextID;
                nodeName = nextName;
            }

            //add up to 5 recent patients
            if (patientInfo.Count != 0)
            {
                foreach (String p in patientInfo)
                {
                    System.Windows.Controls.Label linklabel = new System.Windows.Controls.Label();
                    Run       linktext = new Run(p);
                    Hyperlink link     = new Hyperlink(linktext);

                    link.Click       += new RoutedEventHandler(recentpatientlink_Click);
                    linklabel.Content = link;

                    sp1.Children.Add(linklabel);
                }

                recentpatients.Visibility = Visibility.Collapsed;
            }
            else
            {
                recentpatients.Visibility = Visibility.Visible;
            }
        }