예제 #1
0
 private void FormDisplayFields_Load(object sender, EventArgs e)
 {
     labelCategory.Text = Category.ToString();
     DisplayFields.RefreshCache();
     ListShowing = DisplayFields.GetForCategory(Category);
     if (Category == DisplayFieldCategory.ChartPatientInformation &&
         !PrefC.GetBool(PrefName.ShowFeatureEhr) &&
         ListShowing.Any(x => x.InternalName == "Tobacco Use"))
     {
         //user may have enable EHR features, added the tobacco use display field, and then disabled EHR features, remove the tobacco use display field
         ListShowing.RemoveAll(x => x.InternalName == "Tobacco Use");
         changed = true;
     }
     FillGrids();
 }
예제 #2
0
 private void FormDisplayFields_Load(object sender, EventArgs e)
 {
     labelCategory.Text       = category.ToString();
     textCustomField.Visible  = false;
     labelCustomField.Visible = false;
     listAvailable.Height     = 412;
     DisplayFields.RefreshCache();
     ListShowing = DisplayFields.GetForCategory(category);
     if (category == DisplayFieldCategory.OrthoChart)
     {
         textCustomField.Visible  = true;
         labelCustomField.Visible = true;
         listAvailable.Height     = 227;          //227px for short, 412px for tall
         labelAvailable.Text      = Lan.g(this, "Previously Used Fields");
     }
     FillGrids();
 }
        private void LoadDisplayFields()
        {
            OrthoChartTabs.RefreshCache();
            OrthoChartTabLinks.RefreshCache();
            DisplayFields.RefreshCache();
            _listAllDisplayFields = DisplayFields.GetAllAvailableList(DisplayFieldCategory.OrthoChart);
            _listTabDisplayFields = new List <OrthoChartTabFields>();
            //Add all fields that are actively associated to a tab to our class wide list of tabs and fields.
            for (int i = 0; i < _listOrthoChartTabs.Count; i++)
            {
                OrthoChartTabFields orthoChartTabFields = new OrthoChartTabFields();
                orthoChartTabFields.OrthoChartTab     = _listOrthoChartTabs[i];
                orthoChartTabFields.ListDisplayFields = new List <DisplayField>();
                List <OrthoChartTabLink> listOrthoChartTabLinks = _listOrthoChartTabLinks.FindAll(
                    x => x.OrthoChartTabNum == _listOrthoChartTabs[i].OrthoChartTabNum
                    );
                listOrthoChartTabLinks.OrderBy(x => x.ItemOrder);
                foreach (OrthoChartTabLink orthoChartTabLink in listOrthoChartTabLinks)
                {
                    orthoChartTabFields.ListDisplayFields.AddRange(_listAllDisplayFields.FindAll(x => x.DisplayFieldNum == orthoChartTabLink.DisplayFieldNum));
                }
                _listTabDisplayFields.Add(orthoChartTabFields);
            }
            //Add a dummy OrthoChartTabFields object to the list that represents available fields that are not part of any tab.
            //These "display fields" were previously used at least once. A patient has info for this field, then the office removed the field from all tabs.
            List <DisplayField> listOrphanedFields = _listAllDisplayFields.FindAll(x => x.DisplayFieldNum == 0 ||
                                                                                   !OrthoChartTabLinks.GetExists(y => y.DisplayFieldNum == x.DisplayFieldNum));

            if (listOrphanedFields != null && listOrphanedFields.Count > 0)
            {
                OrthoChartTabFields orphanedFields = new OrthoChartTabFields();
                orphanedFields.OrthoChartTab     = null;          //These are fields not associated to any tab.  Purposefully use null.
                orphanedFields.ListDisplayFields = new List <DisplayField>();
                orphanedFields.ListDisplayFields.AddRange(listOrphanedFields);
                _listTabDisplayFields.Add(orphanedFields);
            }
        }