Example #1
0
        public void FillControls()
        {
            if (loadingCircle1.InvokeRequired)
            {
                fillControlsCallback fcc = new fillControlsCallback(FillControls);
                this.Invoke(fcc, null);
            }
            else
            {
                loadingCircle1.Active = false;
                loadingCircle1.Visible = false;

                relativeHeader1.setRelative(selectedRelative);

                flowLayoutPanel1.Controls.Clear();

                flowLayoutPanel1.Controls.Add(new PMHRowHeader());

                foreach (ClincalObservation co in pmh.Observations)
                {
                    PMHRow pmhRow = new PMHRow(co, this);
                    pmhRow.disease.Text = co.disease;
                    flowLayoutPanel1.Controls.Add(pmhRow);
                    //Application.DoEvents();
                }

                setupDiseases();

                if (pmh.Observations.Count == 0)
                    noLabel.Visible = true;
                else
                    noLabel.Visible = false;
            }
        }
Example #2
0
        /**************************************************************************************************/
        private void ClinicalObservationListChanged(HraListChangedEventArgs e)
        {
            if (e.hraOperand != null && selectedRelative != null)
            {
                ClincalObservation co = (ClincalObservation)e.hraOperand;

                switch (e.hraListChangeType)
                {
                case HraListChangedEventArgs.HraListChangeType.ADD:
                    PMHRow pmhRow = new PMHRow(co, this);
                    pmhRow.disease.Text = co.disease;
                    flowLayoutPanel1.Controls.Add(pmhRow);
                    pmhRow.disease.Focus();     // drive focus to the first input control jdg 11/16/12

                    //setup grouping
                    int    selectedGroupID = 1;
                    String groupName       = diseaseGroupComboBox.Text;
                    if (!String.IsNullOrEmpty(groupName))
                    {
                        selectedGroupID = this.diseases
                                          .Where(t => ((DiseaseObject)t).groupingName.Equals(groupName))
                                          .Select(t => ((DiseaseObject)t).groupingID)
                                          .Distinct()
                                          .SingleOrDefault();
                    }
                    pmhRow.setGroupID(selectedGroupID);
                    break;

                case HraListChangedEventArgs.HraListChangeType.DELETE:

                    Control doomed = null;

                    foreach (Control c in flowLayoutPanel1.Controls.OfType <PMHRow>())
                    {
                        PMHRow targetRow = (PMHRow)c;
                        if (targetRow.GetCO() == co)
                        {
                            doomed = c;
                        }
                    }
                    if (doomed != null)
                    {
                        flowLayoutPanel1.Controls.Remove(doomed);
                    }

                    if (pmh.Observations.Count == 0)
                    {
                        noLabel.Visible = true;
                    }

                    break;
                }
            }
        }
Example #3
0
        public void FillControls()
        {
            if (loadingCircle1.InvokeRequired)
            {
                fillControlsCallback fcc = new fillControlsCallback(FillControls);
                this.Invoke(fcc, null);
            }
            else
            {
                loadingCircle1.Active  = false;
                loadingCircle1.Visible = false;

                relativeHeader1.setRelative(selectedRelative);

                flowLayoutPanel1.Controls.Clear();

                flowLayoutPanel1.Controls.Add(new PMHRowHeader());

                foreach (ClincalObservation co in pmh.Observations)
                {
                    PMHRow pmhRow = new PMHRow(co, this);
                    pmhRow.disease.Text = co.disease;
                    flowLayoutPanel1.Controls.Add(pmhRow);
                    //Application.DoEvents();
                }

                setupDiseases();

                if (pmh.Observations.Count == 0)
                {
                    noLabel.Visible = true;
                }
                else
                {
                    noLabel.Visible = false;
                }
            }
        }
Example #4
0
        /**************************************************************************************************/
        private void ClinicalObservationChanged(object sender, HraModelChangedEventArgs e)
        {
            int senderId = ((ClincalObservation)sender).instanceID;

            PMHRow rowToUpdate = this.flowLayoutPanel1.Controls
                                 .OfType <PMHRow>()
                                 //.SingleOrDefault(row => row.GetCO().instanceID == senderId);
                                 .SingleOrDefault(row => row.GetCO() == sender);

            if (e.Delete)
            {
                this.flowLayoutPanel1.Controls.Remove(rowToUpdate);
            }
            else
            {
                if (e.sendingView != this)
                {
                    foreach (object o in e.updatedMembers)
                    {
                        System.Reflection.FieldInfo field = (System.Reflection.FieldInfo)o;
                        if (field.Name == "disease")
                        {
                            rowToUpdate.disease.Text = rowToUpdate.GetCO().disease;
                        }
                        if (field.Name == "age")
                        {
                            rowToUpdate.ageDiagnosis.Text = rowToUpdate.GetCO().ageDiagnosis;
                        }
                        if (field.Name == "comments")
                        {
                            rowToUpdate.comments.Text = rowToUpdate.GetCO().comments;
                        }
                    }
                }
            }

            //FillControls();
        }
Example #5
0
        /**************************************************************************************************/
        private void ClinicalObservationListChanged(HraListChangedEventArgs e)
        {
            if (e.hraOperand != null && selectedRelative != null)
            {
                ClincalObservation co = (ClincalObservation)e.hraOperand;

                switch (e.hraListChangeType)
                {
                    case HraListChangedEventArgs.HraListChangeType.ADD:
                        PMHRow pmhRow = new PMHRow(co, this);
                        pmhRow.disease.Text = co.disease;
                        flowLayoutPanel1.Controls.Add(pmhRow);
                        pmhRow.disease.Focus(); // drive focus to the first input control jdg 11/16/12

                        //setup grouping
                        int selectedGroupID = 1;
                        String groupName = diseaseGroupComboBox.Text;
                        if (!String.IsNullOrEmpty(groupName))
                        {
                            selectedGroupID = this.diseases
                                .Where(t => ((DiseaseObject)t).groupingName.Equals(groupName))
                                .Select(t => ((DiseaseObject)t).groupingID)
                                .Distinct()
                                .SingleOrDefault();
                        }
                        pmhRow.setGroupID(selectedGroupID);
                        break;
                    case HraListChangedEventArgs.HraListChangeType.DELETE:

                        Control doomed = null;

                        foreach (Control c in flowLayoutPanel1.Controls.OfType<PMHRow>())
                        {
                            PMHRow targetRow = (PMHRow)c;
                            if (targetRow.GetCO() == co)
                                doomed = c;
                        }
                        if (doomed != null)
                            flowLayoutPanel1.Controls.Remove(doomed);

                        if (pmh.Observations.Count == 0)
                            noLabel.Visible = true;

                        break;
                }
            }
        }