示例#1
0
 ///<summary>Refreshes _dictOrthoCharts with the ortho charts found in _listOrthoChartsInitial.</summary>
 private void FillDictionary()
 {
     //Fill the dictionary.  Key will be date, value will be list of ortho charts for that date.
     foreach (OrthoChart chart in _listOrthoChartsInitial)
     {
         if (!_dictOrthoCharts.ContainsKey(chart.DateService))
         {
             _dictOrthoCharts.Add(chart.DateService, new List <OrthoChart>()
             {
                 chart
             });
         }
         else
         {
             _dictOrthoCharts[chart.DateService].Add(chart);
         }
     }
     if (!_dictOrthoCharts.ContainsKey(DateTime.Today))
     {
         _dictOrthoCharts.Add(DateTime.Today, new List <OrthoChart>());
     }
     _listOrthDisplayFields = DisplayFields.GetForCategory(DisplayFieldCategory.OrthoChart);          //List of display fields and the order they should be displayed in.
     _listDisplayFieldNames = new List <string>();
     for (int i = 0; i < _listOrthDisplayFields.Count; i++)
     {
         if (_listOrthDisplayFields[i].InternalName == "Signature")
         {
             _sigTableOrthoColIdx = i;
         }
         _listDisplayFieldNames.Add(_listOrthDisplayFields[i].Description);
     }
 }
示例#2
0
        /*
         * ///<summary></summary>
         * public static void Update(DisplayField field) {
         *      string command="UPDATE displayfield SET "
         +"DisplayFieldName = '"+POut.PString(DisplayField.DisplayFieldName)+"', "
         +"ControlsToInc = '"+POut.PString(DisplayField.ControlsToInc)+"' "
         +"WHERE DisplayFieldNum = '"+POut.PInt(DisplayField.DisplayFieldNum)+"'";
         *      General.NonQ(command);
         * }
         */

        ///<Summary>There's only one category for now.  So this doesn't really do much.</Summary>
        public static List <DisplayField> GetForCategory()
        {
            if (DisplayFields.Listt.Count == 0)           //default
            {
                return(DisplayFields.GetDefaultList());
            }
            return(DisplayFields.Listt);           //later, filter by category
        }
示例#3
0
        private void FormRefAttachEdit_Load(object sender, EventArgs e)
        {
            if (Plugins.HookMethod(this, "FormRefAttachEdit.Load", RefAttachCur, IsNew))
            {
                return;
            }
            if (IsNew)
            {
                Text = Lan.g(this, "Add Referral Attachment");
            }
            else
            {
                _refAttachOld = RefAttachCur.Copy();
                Text          = Lan.g(this, "Edit Referral Attachment");
            }
            string referralDescript = DisplayFields.GetForCategory(DisplayFieldCategory.PatientInformation)
                                      .FirstOrDefault(x => x.InternalName == "Referrals")?.Description;

            if (string.IsNullOrWhiteSpace(referralDescript))             //either not displaying the Referral field or no description entered, default to 'Referral (other)'
            {
                referralDescript = Lan.g(this, "Referral (other)");
            }
            listRefType.Items.AddRange(new[] { Lan.g(this, "To"), Lan.g(this, "From"), referralDescript });
            FillData();
            FillSheets();
            _provNumSelected = RefAttachCur.ProvNum;
            comboProvNum.Items.Clear();
            _listProviders = Providers.GetDeepCopy(true);
            for (int i = 0; i < _listProviders.Count; i++)
            {
                comboProvNum.Items.Add(_listProviders[i].GetLongDesc());                //Only visible provs added to combobox.
                if (_listProviders[i].ProvNum == RefAttachCur.ProvNum)
                {
                    comboProvNum.SelectedIndex = i;                  //Sets combo text too.
                }
            }
            if (comboProvNum.SelectedIndex == -1)                            //The provider exists but is hidden
            {
                comboProvNum.Text = Providers.GetLongDesc(_provNumSelected); //Appends "(hidden)" to the end of the long description.
            }
            if (RefAttachCur.RefType == ReferralType.RefFrom)
            {
                butNoneProv.Visible  = false;
                butPickProv.Visible  = false;
                comboProvNum.Visible = false;
                labelProv.Visible    = false;
            }
            else
            {
                butNoneProv.Visible  = true;
                butPickProv.Visible  = true;
                comboProvNum.Visible = true;
                labelProv.Visible    = true;
            }
        }
示例#4
0
 private void butOK_Click(object sender, EventArgs e)
 {
     if (!changed)
     {
         DialogResult = DialogResult.OK;
         return;
     }
     DisplayFields.SaveListForCategory(ListShowing);
     DataValid.SetInvalid(InvalidTypes.InsCats);
     DialogResult = DialogResult.OK;
 }
示例#5
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();
 }
示例#6
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();
 }
示例#7
0
 private void butOK_Click(object sender, EventArgs e)
 {
     if (!changed)
     {
         DialogResult = DialogResult.OK;
         return;
     }
     if (category == DisplayFieldCategory.OrthoChart)
     {
         DisplayFields.SaveListForOrthoChart(ListShowing);
     }
     else
     {
         DisplayFields.SaveListForCategory(ListShowing, category);
     }
     DataValid.SetInvalid(InvalidType.DisplayFields);
     DialogResult = DialogResult.OK;
 }
示例#8
0
        private void FillGrids()
        {
            AvailList = DisplayFields.GetAllAvailableList(Category);          //This one needs to be called repeatedly.
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col;

            col = new GridColumn(Lan.g("FormDisplayFields", "FieldName"), 110);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("FormDisplayFields", "New Descript"), 110);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("FormDisplayFields", "Width"), 60);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            GridRow row;

            for (int i = 0; i < ListShowing.Count; i++)
            {
                row = new GridRow();
                row.Cells.Add(ListShowing[i].InternalName);
                row.Cells.Add(ListShowing[i].Description);
                row.Cells.Add(ListShowing[i].ColumnWidth.ToString());
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
            //Remove items from AvailList that are in the ListShowing.
            for (int i = 0; i < ListShowing.Count; i++)
            {
                for (int j = 0; j < AvailList.Count; j++)
                {
                    //Only removing one item from AvailList per iteration of i, so RemoveAt() is safe without going backwards.
                    if (ListShowing[i].InternalName == AvailList[j].InternalName)
                    {
                        AvailList.RemoveAt(j);
                        break;
                    }
                }
            }
            listAvailable.Items.Clear();
            for (int i = 0; i < AvailList.Count; i++)
            {
                listAvailable.Items.Add(AvailList[i]);
            }
        }
示例#9
0
        private void FillGrids()
        {
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("FormDisplayFields", "FieldName"), 110);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("FormDisplayFields", "New Descript"), 110);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("FormDisplayFields", "Width"), 60);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < ListShowing.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(ListShowing[i].InternalName);
                row.Cells.Add(ListShowing[i].Description);
                row.Cells.Add(ListShowing[i].ColumnWidth.ToString());
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
            List <DisplayField> availList = DisplayFields.GetAllAvailableList();

            for (int i = 0; i < ListShowing.Count; i++)
            {
                for (int j = 0; j < availList.Count; j++)
                {
                    if (ListShowing[i].InternalName == availList[j].InternalName)
                    {
                        availList.RemoveAt(j);
                        break;
                    }
                }
            }
            listAvailable.Items.Clear();
            for (int i = 0; i < availList.Count; i++)
            {
                listAvailable.Items.Add(availList[i]);
            }
        }
示例#10
0
        private void FillGrids()
        {
            _listPatClones = Patients.GetAllPatients();           //change this to get a list of all patients WITH possible clones
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn          col;
            List <DisplayField> fields = DisplayFields.GetForCategory(DisplayFieldCategory.PatientInformation);

            col = new GridColumn("First Name", 115);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Last Name", 115);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Middle", 65);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Gender", 65);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Birthdate", 75);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("PriProv", 135);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("SecProv", 135);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            GridRow row;

            for (int i = 0; i < _listPatClones.Count; i++)
            {
                row = new GridRow();
                row.Cells.Add(_listPatClones[i].FName.ToString());
                row.Cells.Add(_listPatClones[i].LName.ToString());
                row.Cells.Add(_listPatClones[i].MiddleI.ToString());
                row.Cells.Add(_listPatClones[i].Gender.ToString());
                row.Cells.Add(_listPatClones[i].Birthdate.ToShortDateString());
                row.Cells.Add(Providers.GetLongDesc(Patients.GetProvNum(_listPatClones[i])));
                row.Cells.Add(Providers.GetLongDesc(_listPatClones[i].SecProv));
                row.Tag = _listPatClones[i];
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }
        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);
            }
        }
示例#12
0
        private void butOK_Click(object sender, EventArgs e)
        {
            OrthoChartTabFields orphanedTab = _listTabDisplayFields.Find(x => x.OrthoChartTab == null);

            //No need to do anything if nothing changed and there are no 'orphaned' display fields to delete.
            if (!changed && (orphanedTab != null && orphanedTab.ListDisplayFields.All(x => x.DisplayFieldNum == 0)))
            {
                DialogResult = DialogResult.OK;
                return;
            }
            //Get all fields associated to a tab in order to sync with the database later.
            List <DisplayField> listAllFields = GetAllFields(false);

            if (listAllFields.Count(x => x.InternalName == "Signature") > 1)
            {
                MessageBox.Show(Lan.g(this, "Only one display field can be a signature field.  Fields that have the signature field checkbox checked:") + " "
                                + string.Join(", ", listAllFields.FindAll(x => x.InternalName == "Signature").Select(x => x.Description)));
                return;
            }
            //Ensure all new displayfields have a primary key so that tab links can be created below.  Update existing displayfields.
            foreach (DisplayField df in listAllFields)
            {
                if (df.DisplayFieldNum == 0)               //New displayfield
                {
                    DisplayFields.Insert(df);
                }
                else                  //Existing displayfield.
                {
                    DisplayFields.Update(df);
                }
            }
            DataValid.SetInvalid(InvalidType.DisplayFields);
            //Remove tab links which no longer exist.  Update tab link item order for tab links which still belong to the same tab.
            List <OrthoChartTabLink> listOrthoChartTabLinks = OrthoChartTabLinks.GetDeepCopy();

            for (int i = listOrthoChartTabLinks.Count - 1; i >= 0; i--)
            {
                OrthoChartTabLink   orthoChartTabLink   = listOrthoChartTabLinks[i];
                OrthoChartTabFields orthoChartTabFields = _listTabDisplayFields.FirstOrDefault(
                    x => x.OrthoChartTab != null && x.OrthoChartTab.OrthoChartTabNum == orthoChartTabLink.OrthoChartTabNum);
                if (orthoChartTabFields == null)
                {
                    continue;                    //The tab was hidden and we are going to leave the tab links alone.
                }
                DisplayField df = orthoChartTabFields.ListDisplayFields.FirstOrDefault(x => x.DisplayFieldNum == orthoChartTabLink.DisplayFieldNum);
                if (df == null)               //The tab link no longer exists (was removed).
                {
                    listOrthoChartTabLinks.RemoveAt(i);
                }
                else                  //The tab link still exists.  Update the link with any changes.
                {
                    orthoChartTabLink.ItemOrder = orthoChartTabFields.ListDisplayFields.IndexOf(df);
                }
            }
            //Add new tab links which were just created.
            foreach (OrthoChartTabFields orthoChartTabFields in _listTabDisplayFields)
            {
                //Skip "orphaned" fields that just show in the available fields list.
                if (orthoChartTabFields.OrthoChartTab == null)
                {
                    continue;
                }
                foreach (DisplayField df in orthoChartTabFields.ListDisplayFields)
                {
                    OrthoChartTabLink orthoChartTabLink = listOrthoChartTabLinks.FirstOrDefault(
                        x => x.OrthoChartTabNum == orthoChartTabFields.OrthoChartTab.OrthoChartTabNum && x.DisplayFieldNum == df.DisplayFieldNum);
                    if (orthoChartTabLink != null)
                    {
                        continue;
                    }
                    orthoChartTabLink                  = new OrthoChartTabLink();
                    orthoChartTabLink.ItemOrder        = orthoChartTabFields.ListDisplayFields.IndexOf(df);
                    orthoChartTabLink.OrthoChartTabNum = orthoChartTabFields.OrthoChartTab.OrthoChartTabNum;
                    orthoChartTabLink.DisplayFieldNum  = df.DisplayFieldNum;
                    listOrthoChartTabLinks.Add(orthoChartTabLink);
                }
            }
            //Delete any display fields that have a valid PK and are in the "orphaned" list.
            //This is fine to do because the field will show back up in the available list of display fields if a patient is still using the field.
            //This is because we link the ortho chart display fields by their name instead of by their PK.
            if (orphanedTab != null)           //An orphaned list actually exists.
            //Look for any display fields that have a valid PK (this means the user removed this field from every tab and we need to delete it).
            {
                List <DisplayField> listFieldsToDelete = orphanedTab.ListDisplayFields.FindAll(x => x.DisplayFieldNum != 0);
                listFieldsToDelete.ForEach(x => DisplayFields.Delete(x.DisplayFieldNum));
            }
            OrthoChartTabLinks.Sync(listOrthoChartTabLinks, OrthoChartTabLinks.GetDeepCopy());
            DataValid.SetInvalid(InvalidType.OrthoChartTabs);
            DialogResult = DialogResult.OK;
        }
        private void FillGrid()
        {
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            List <DisplayField> fieldsForGrid = DisplayFields.GetForCategory(DisplayFieldCategory.AccountModule);

            if (!PrefC.HasClinicsEnabled)
            {
                //remove clinics from displayfields if clinics are disabled
                fieldsForGrid.RemoveAll(x => x.InternalName.ToLower().Contains("clinic"));
            }
            fieldsForGrid.RemoveAll(x => x.InternalName.In("Abbr", "Balance", "Signed"));
            HorizontalAlignment align;
            GridSortingStrategy sort;

            for (int i = 0; i < fieldsForGrid.Count; i++)
            {
                align = HorizontalAlignment.Left;
                sort  = GridSortingStrategy.StringCompare;
                if (fieldsForGrid[i].InternalName.In("Charges", "Credits"))
                {
                    align = HorizontalAlignment.Right;
                    sort  = GridSortingStrategy.AmountParse;
                }
                if (fieldsForGrid[i].InternalName == "Tth")
                {
                    sort = GridSortingStrategy.ToothNumberParse;
                }
                if (fieldsForGrid[i].InternalName == "Date")
                {
                    sort = GridSortingStrategy.DateParse;
                }
                gridMain.ListGridColumns.Add(new GridColumn(fieldsForGrid[i].Description == ""?fieldsForGrid[i].InternalName:fieldsForGrid[i].Description,
                                                            fieldsForGrid[i].ColumnWidth, align, sort));
            }
            if (gridMain.ListGridColumns.Sum(x => x.ColWidth) > gridMain.Width)
            {
                gridMain.HScrollVisible = true;
            }
            gridMain.ListGridRows.Clear();
            GridRow row;

            for (int i = 0; i < _listLimitedRows.Count; i++)
            {
                LimitedRow limitedRow = _listLimitedRows[i];
                if (!limitedRow.Type.In(listBoxTransTypes.GetListSelected <AccountEntryType>()))
                {
                    continue;
                }
                DateTime date = limitedRow.DateTime.Date;
                if (date.Date < odDatePickerFrom.GetDateTime().Date || date.Date > odDatePickerTo.GetDateTime().Date)
                {
                    continue;                    //do not add to grid if it is outside the filtered date range.
                }
                row = new GridRow();
                for (int f = 0; f < fieldsForGrid.Count; f++)
                {
                    switch (fieldsForGrid[f].InternalName)
                    {
                    case "Date":
                        row.Cells.Add(date.ToShortDateString());
                        break;

                    case "Patient":
                        row.Cells.Add(limitedRow.PatientName);
                        break;

                    case "Prov":
                        row.Cells.Add(limitedRow.ProvName);
                        break;

                    case "Clinic":
                        row.Cells.Add(Clinics.GetAbbr(limitedRow.ClinicNum));
                        break;

                    case "ClinicDesc":
                        row.Cells.Add(Clinics.GetDesc(limitedRow.ClinicNum));
                        break;

                    case "Code":
                        row.Cells.Add(limitedRow.ProcCode);
                        break;

                    case "Tth":
                        row.Cells.Add(limitedRow.Tooth);
                        break;

                    case "Description":
                        row.Cells.Add(limitedRow.Description);
                        break;

                    case "Charges":
                        row.Cells.Add(limitedRow.Charges);
                        break;

                    case "Credits":
                        row.Cells.Add(limitedRow.Credits);
                        break;

                    default:
                        row.Cells.Add("");
                        break;
                    }
                }
                row.ColorText = limitedRow.ColorText;
                if (i == _listLimitedRows.Count - 1 || limitedRow.DateTime.Date != _listLimitedRows[i + 1].DateTime.Date)
                {
                    row.ColorLborder = Color.Black;
                }
                row.Tag = limitedRow;
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
            for (int i = 0; i < gridMain.ListGridRows.Count; i++)
            {
                LimitedRow lRow = gridMain.ListGridRows[i].Tag as LimitedRow;
                gridMain.SetSelected(i, _dictSelectedRows.TryGetValue(lRow.Type, out List <long> listPriKeys) && listPriKeys.Contains(lRow.PrimaryKey));
            }
            //this will refresh _dictSelectedRows and add any associated trans to the previously selected rows
            SelectAssociatedTrans();
        }
示例#14
0
        private void FormOrthoChart_Load(object sender, EventArgs e)
        {
            //define the table----------------------------------------------------------------------------------------------------------
            table = new DataTable("OrthoChartForPatient");
            //define columns----------------------------------------------------------------------------------------------------------
            table.Columns.Add("Date", typeof(DateTime));
            listOrthDisplayFields = DisplayFields.GetForCategory(DisplayFieldCategory.OrthoChart);
            for (int i = 0; i < listOrthDisplayFields.Count; i++)
            {
                table.Columns.Add((i + 1).ToString());              //named by number, but probably refer to by index
            }
            //define rows------------------------------------------------------------------------------------------------------------
            listOrthoCharts = OrthoCharts.GetAllForPatient(PatCur.PatNum);
            List <DateTime> datesShowing          = new List <DateTime>();
            List <string>   listDisplayFieldNames = new List <string>();

            for (int i = 0; i < listOrthDisplayFields.Count; i++)       //fill listDisplayFieldNames to be used in comparison
            {
                listDisplayFieldNames.Add(listOrthDisplayFields[i].Description);
            }
            //start adding dates starting with today's date
            datesShowing.Add(DateTime.Today);
            for (int i = 0; i < listOrthoCharts.Count; i++)
            {
                if (!listDisplayFieldNames.Contains(listOrthoCharts[i].FieldName))                 //skip rows not in display fields
                {
                    continue;
                }
                if (!datesShowing.Contains(listOrthoCharts[i].DateService))                 //add dates not already in date list
                {
                    datesShowing.Add(listOrthoCharts[i].DateService);
                }
            }
            datesShowing.Sort();
            //We now have a list of dates.
            //add all blank cells to each row except for the date.
            DataRow row;

            //create and add row for each date in date showing
            for (int i = 0; i < datesShowing.Count; i++)
            {
                row         = table.NewRow();
                row["Date"] = datesShowing[i];
                for (int j = 0; j < listOrthDisplayFields.Count; j++)
                {
                    row[j + 1] = "";                //j+1 because first row is date field.
                }
                table.Rows.Add(row);
            }
            //We now have a table with all empty strings in cells except dates.
            //Fill with data as necessary.
            for (int i = 0; i < listOrthoCharts.Count; i++)       //loop
            {
                if (!datesShowing.Contains(listOrthoCharts[i].DateService))
                {
                    continue;
                }
                if (!listDisplayFieldNames.Contains(listOrthoCharts[i].FieldName))
                {
                    continue;
                }
                for (int j = 0; j < table.Rows.Count; j++)
                {
                    if (listOrthoCharts[i].DateService == (DateTime)table.Rows[j]["Date"])
                    {
                        table.Rows[j][listDisplayFieldNames.IndexOf(listOrthoCharts[i].FieldName) + 1] = listOrthoCharts[i].FieldValue;
                    }
                }
            }
            FillGrid();
            FillGridPat();
        }
        private void FillGrid()
        {
            RefAttachList = RefAttaches.RefreshFiltered(PatNum, true, 0);
            string referralDescript = DisplayFields.GetForCategory(DisplayFieldCategory.PatientInformation)
                                      .FirstOrDefault(x => x.InternalName == "Referrals")?.Description;

            if (string.IsNullOrWhiteSpace(referralDescript))             //either not displaying the Referral field or no description entered, default to 'Referral (other)'
            {
                referralDescript = Lan.g(this, "Referral (other)");
            }
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableRefList", "Referral Type"), 85));
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableRefList", "Name"), 120));
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableRefList", "Date"), 65));
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableRefList", "Status"), 70));
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableRefList", "Proc"), 120));
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableRefList", "Note"), 170));
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableRefList", "Email"), 190));
            gridMain.ListGridRows.Clear();
            bool          hasInvalidRef = false;
            GridRow       row;
            List <string> listRefTypeNames = new List <string>()
            {
                Lan.g(this, "To"), Lan.g(this, "From"), referralDescript
            };

            for (int i = 0; i < RefAttachList.Count; i++)
            {
                RefAttach refAttachCur = RefAttachList[i];
                if (ProcNum != 0 && !checkShowAll.Checked &&
                    ProcNum != refAttachCur.ProcNum)
                {
                    continue;
                }
                row = new GridRow();
                row.Cells.Add(listRefTypeNames[(int)refAttachCur.RefType]);
                row.Cells.Add(Referrals.GetNameFL(refAttachCur.ReferralNum));
                if (refAttachCur.RefDate.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(refAttachCur.RefDate.ToShortDateString());
                }
                row.Cells.Add(Lan.g("enumReferralToStatus", refAttachCur.RefToStatus.ToString()));
                if (refAttachCur.ProcNum == 0)
                {
                    row.Cells.Add("");
                }
                else
                {
                    Procedure proc = Procedures.GetOneProc(refAttachCur.ProcNum, false);
                    string    str  = Procedures.GetDescription(proc);
                    row.Cells.Add(str);
                }
                row.Cells.Add(refAttachCur.Note);
                Referral referral = ReferralL.GetReferral(refAttachCur.ReferralNum, false);
                if (referral == null)
                {
                    hasInvalidRef = true;
                    continue;
                }
                row.Cells.Add(referral.EMail);
                row.Tag = refAttachCur;
                gridMain.ListGridRows.Add(row);
            }
            if (hasInvalidRef)
            {
                ReferralL.ShowReferralErrorMsg();
            }
            gridMain.EndUpdate();
            for (int i = 0; i < RefAttachList.Count; i++)
            {
                if (RefAttachList[i].RefAttachNum == DefaultRefAttachNum)
                {
                    gridMain.SetSelected(i, true);
                    break;
                }
            }
        }
示例#16
0
 private void FormDisplayFields_Load(object sender, EventArgs e)
 {
     DisplayFields.Refresh();
     ListShowing = DisplayFields.GetForCategory();
     FillGrids();
 }
示例#17
0
 private void butDefault_Click(object sender, EventArgs e)
 {
     ListShowing = DisplayFields.GetDefaultList(category);          //empty for ortho
     FillGrids();
     changed = true;
 }
示例#18
0
 private void butDefault_Click(object sender, EventArgs e)
 {
     ListShowing = DisplayFields.GetDefaultList();
     FillGrids();
     changed = true;
 }