示例#1
0
 ///<summary>Get json settings for both the filter and the graph it is linked to. Output will be json in the form of a serialized ODGraphJson object.</summary>
 private string GetFilterAndGraphSettings()
 {
     return(ODGraphJson.Serialize(new ODGraphJson()
     {
         FilterJson = SerializeToJson(),
         GraphJson = graph == null ? "" : graph.SerializeToJson(),
     }));
 }
示例#2
0
        ///<summary>Set json settings for both the filter and the graph it is linked to. Input json should be a serialized ODGraphJson object.</summary>
        private void SetFilterAndGraphSettings(string jsonSettings)
        {
            if (string.IsNullOrEmpty(jsonSettings))
            {
                return;
            }
            ODGraphJson graphJson = ODGraphJson.Deserialize(jsonSettings);

            if (graph != null)
            {
                graph.DeserializeFromJson(graphJson.GraphJson);
            }
            DeserializeFromJson(graphJson.FilterJson);
        }
示例#3
0
        ///<summary>Will add the pre-defined default practice tab.
        ///Only one default practice tab can exist at a time, but the user may rename it to add multiple.
        ///This method does NOT save the tab to the database. The user will still have to save changes and will have the option of discarding this tab.</summary>
        public void AddDefaultsTabPractice(bool hasPrompt)
        {
            if (!ValidateTabName("Practice Defaults"))
            {
                return;
            }
            //get current layouts
            List <DashboardLayout> layoutsCur;

            GetDashboardLayout(out layoutsCur);
            //create layout
            DashboardLayout layout = new DashboardLayout()
            {
                DashboardColumns   = 3,
                DashboardRows      = 2,
                DashboardGroupName = "Default",
                DashboardTabName   = "Practice Defaults",
                //assigned default layout to first tab.
                DashboardTabOrder = layoutsCur.Count,
                UserGroupNum      = 0,
                UserNum           = 0,
                IsNew             = true,
            };
            int i = 0;

            //define cell settings. anything not set here will be the defaults defined in GraphQuantityOverTimeFilter
            for (int row = 0; row < layout.DashboardRows; row++)
            {
                for (int col = 0; col < layout.DashboardColumns; col++)
                {
                    DashboardCell cell = new DashboardCell()
                    {
                        CellRow    = row,
                        CellColumn = col,
                    };
                    switch (i++)
                    {
                    case 0:
                        cell.CellType     = DashboardCellType.ProductionGraph;
                        cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson()
                        {
                            FilterJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTimeFilter.GraphQuantityOverTimeFilterSettings()
                            {
                                IncludeCompleteProcs = true,
                                IncludeAdjustements  = true,
                                IncludeWriteoffs     = true,
                            }),
                            GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings()
                            {
                                Title          = "Production - Last 12 Months",
                                QtyType        = OpenDentalGraph.Enumerations.QuantityType.money,
                                SeriesType     = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line,
                                GroupByType    = System.Windows.Forms.DataVisualization.Charting.IntervalType.Months,
                                LegendDock     = OpenDentalGraph.Enumerations.LegendDockType.None,
                                QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last12Months,
                                BreakdownPref  = OpenDentalGraph.Enumerations.BreakdownType.none,
                            })
                        });
                        break;

                    case 1:
                        cell.CellType     = DashboardCellType.IncomeGraph;
                        cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson()
                        {
                            FilterJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTimeFilter.GraphQuantityOverTimeFilterSettings()
                            {
                                IncludePaySplits       = true,
                                IncludeInsuranceClaims = true,
                            }),
                            GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings()
                            {
                                Title          = "Income - Last 12 Months",
                                QtyType        = OpenDentalGraph.Enumerations.QuantityType.money,
                                SeriesType     = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line,
                                GroupByType    = System.Windows.Forms.DataVisualization.Charting.IntervalType.Months,
                                LegendDock     = OpenDentalGraph.Enumerations.LegendDockType.None,
                                QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last12Months,
                                BreakdownPref  = OpenDentalGraph.Enumerations.BreakdownType.none,
                            })
                        });
                        break;

                    case 2:
                        cell.CellType     = DashboardCellType.BrokenApptGraph;
                        cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson()
                        {
                            FilterJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTimeFilter.GraphQuantityOverTimeFilterSettings()
                            {
                                CurRunFor = BrokenApptGraphOptionsCtrl.RunFor.appointment
                            }),
                            GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings()
                            {
                                Title          = "Broken Appointments - Last 12 Months",
                                QtyType        = OpenDentalGraph.Enumerations.QuantityType.count,
                                SeriesType     = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line,
                                GroupByType    = System.Windows.Forms.DataVisualization.Charting.IntervalType.Weeks,
                                LegendDock     = OpenDentalGraph.Enumerations.LegendDockType.None,
                                QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last12Months,
                                BreakdownPref  = OpenDentalGraph.Enumerations.BreakdownType.none,
                            })
                        });
                        break;

                    case 3:
                        cell.CellType     = DashboardCellType.AccountsReceivableGraph;
                        cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson()
                        {
                            FilterJson = "",
                            GraphJson  = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings()
                            {
                                Title          = "Accounts Receivable - Last 12 Months",
                                QtyType        = OpenDentalGraph.Enumerations.QuantityType.money,
                                SeriesType     = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line,
                                GroupByType    = System.Windows.Forms.DataVisualization.Charting.IntervalType.Months,
                                LegendDock     = OpenDentalGraph.Enumerations.LegendDockType.None,
                                QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last12Months,
                                BreakdownPref  = OpenDentalGraph.Enumerations.BreakdownType.none,
                            })
                        });
                        break;

                    case 4:
                        cell.CellType     = DashboardCellType.NewPatientsGraph;
                        cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson()
                        {
                            FilterJson = "",
                            GraphJson  = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings()
                            {
                                Title          = "New Patients - Last 12 Months",
                                QtyType        = OpenDentalGraph.Enumerations.QuantityType.count,
                                SeriesType     = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line,
                                GroupByType    = System.Windows.Forms.DataVisualization.Charting.IntervalType.Months,
                                LegendDock     = OpenDentalGraph.Enumerations.LegendDockType.None,
                                QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last12Months,
                                BreakdownPref  = OpenDentalGraph.Enumerations.BreakdownType.none,
                            })
                        });
                        break;

                    case 5:
                    default:
                        cell.CellType     = DashboardCellType.ProductionGraph;
                        cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson()
                        {
                            FilterJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTimeFilter.GraphQuantityOverTimeFilterSettings()
                            {
                                IncludeCompleteProcs = true,
                                IncludeAdjustements  = true,
                                IncludeWriteoffs     = true,
                            }),
                            GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings()
                            {
                                Title          = "Production - Last 30 Days",
                                QtyType        = OpenDentalGraph.Enumerations.QuantityType.money,
                                SeriesType     = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line,
                                GroupByType    = System.Windows.Forms.DataVisualization.Charting.IntervalType.Days,
                                LegendDock     = OpenDentalGraph.Enumerations.LegendDockType.None,
                                QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last30Days,
                                BreakdownPref  = OpenDentalGraph.Enumerations.BreakdownType.none,
                            })
                        });
                        break;
                    }
                    layout.Cells.Add(cell);
                }
            }
            layoutsCur.Add(layout);
            //set dashboard tab control layouts
            SetDashboardLayout(layoutsCur, false);
            _hasUnsavedChanges = _hasUnsavedChanges || hasPrompt;
        }
示例#4
0
        ///<summary>Will add the pre-defined default clinics tab.
        ///Only one default clinics tab can exist at a time, but the user may rename it to add multiple.
        ///This method does NOT save the tab to the database. The user will still have to save changes and will have the option of discarding this tab.</summary>
        public void AddDefaultsTabByGrouping(bool hasPrompt, GroupingOptionsCtrl.Grouping grouping)
        {
            string strGrouping = char.ToUpper(grouping.ToString()[0]) + grouping.ToString().Substring(1);

            if (!ValidateTabName(strGrouping + " Defaults"))
            {
                return;
            }
            //get current layouts
            List <DashboardLayout> layoutsCur;

            GetDashboardLayout(out layoutsCur);
            //create layout
            DashboardLayout layout = new DashboardLayout()
            {
                DashboardColumns   = 3,
                DashboardRows      = 2,
                DashboardGroupName = "Default",
                DashboardTabName   = strGrouping + " Defaults",
                //assigned default layout to first tab.
                DashboardTabOrder = layoutsCur.Count,
                UserGroupNum      = 0,
                UserNum           = 0,
                IsNew             = true,
            };
            int i = 0;

            for (int row = 0; row < layout.DashboardRows; row++)
            {
                for (int col = 0; col < layout.DashboardColumns; col++)
                {
                    DashboardCell cell = new DashboardCell()
                    {
                        CellRow    = row,
                        CellColumn = col,
                    };
                    switch (i++)
                    {
                    default:
                    case 0:
                        cell.CellType     = DashboardCellType.ProductionGraph;
                        cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson()
                        {
                            FilterJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTimeFilter.GraphQuantityOverTimeFilterSettings()
                            {
                                CurGrouping          = grouping,
                                IncludeCompleteProcs = true,
                                IncludeAdjustements  = true,
                                IncludeWriteoffs     = true,
                            }),
                            GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings()
                            {
                                Title          = "Production - Last 12 Months",
                                QtyType        = OpenDentalGraph.Enumerations.QuantityType.money,
                                SeriesType     = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StackedColumn,
                                GroupByType    = System.Windows.Forms.DataVisualization.Charting.IntervalType.Months,
                                LegendDock     = OpenDentalGraph.Enumerations.LegendDockType.Bottom,
                                QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last12Months,
                                BreakdownPref  = OpenDentalGraph.Enumerations.BreakdownType.items,
                                BreakdownVal   = 10,
                            })
                        });
                        break;

                    case 1:
                        cell.CellType     = DashboardCellType.IncomeGraph;
                        cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson()
                        {
                            FilterJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTimeFilter.GraphQuantityOverTimeFilterSettings()
                            {
                                CurGrouping            = grouping,
                                IncludePaySplits       = true,
                                IncludeInsuranceClaims = true,
                            }),
                            GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings()
                            {
                                Title          = "Income - Last 12 Months",
                                QtyType        = OpenDentalGraph.Enumerations.QuantityType.money,
                                SeriesType     = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StackedColumn,
                                GroupByType    = System.Windows.Forms.DataVisualization.Charting.IntervalType.Months,
                                LegendDock     = OpenDentalGraph.Enumerations.LegendDockType.Bottom,
                                QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last12Months,
                                BreakdownPref  = OpenDentalGraph.Enumerations.BreakdownType.items,
                                BreakdownVal   = 10,
                            })
                        });
                        break;

                    case 2:
                        cell.CellType     = DashboardCellType.BrokenApptGraph;
                        cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson()
                        {
                            FilterJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTimeFilter.GraphQuantityOverTimeFilterSettings()
                            {
                                CurGrouping = grouping,
                                CurRunFor   = BrokenApptGraphOptionsCtrl.RunFor.appointment,
                            }),
                            GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings()
                            {
                                Title          = "Broken Appointments - Last 12 Months",
                                QtyType        = OpenDentalGraph.Enumerations.QuantityType.count,
                                SeriesType     = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StackedColumn,
                                GroupByType    = System.Windows.Forms.DataVisualization.Charting.IntervalType.Months,
                                LegendDock     = OpenDentalGraph.Enumerations.LegendDockType.Bottom,
                                QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last12Months,
                                BreakdownPref  = OpenDentalGraph.Enumerations.BreakdownType.items,
                                BreakdownVal   = 10,
                            })
                        });
                        break;

                    case 3:
                        cell.CellType     = DashboardCellType.ProductionGraph;
                        cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson()
                        {
                            FilterJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTimeFilter.GraphQuantityOverTimeFilterSettings()
                            {
                                CurGrouping          = grouping,
                                IncludeCompleteProcs = true,
                                IncludeAdjustements  = true,
                                IncludeWriteoffs     = true,
                            }),
                            GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings()
                            {
                                Title          = "Production - Last 30 Days",
                                QtyType        = OpenDentalGraph.Enumerations.QuantityType.money,
                                SeriesType     = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StackedColumn,
                                GroupByType    = System.Windows.Forms.DataVisualization.Charting.IntervalType.Days,
                                LegendDock     = OpenDentalGraph.Enumerations.LegendDockType.Bottom,
                                QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last30Days,
                                BreakdownPref  = OpenDentalGraph.Enumerations.BreakdownType.items,
                                BreakdownVal   = 10,
                            })
                        });
                        break;

                    case 4:
                        cell.CellType     = DashboardCellType.IncomeGraph;
                        cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson()
                        {
                            FilterJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTimeFilter.GraphQuantityOverTimeFilterSettings()
                            {
                                CurGrouping            = grouping,
                                IncludePaySplits       = true,
                                IncludeInsuranceClaims = true,
                            }),
                            GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings()
                            {
                                Title          = "Income - Last 30 Days",
                                QtyType        = OpenDentalGraph.Enumerations.QuantityType.money,
                                SeriesType     = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StackedColumn,
                                GroupByType    = System.Windows.Forms.DataVisualization.Charting.IntervalType.Days,
                                LegendDock     = OpenDentalGraph.Enumerations.LegendDockType.Bottom,
                                QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last30Days,
                                BreakdownPref  = OpenDentalGraph.Enumerations.BreakdownType.items,
                                BreakdownVal   = 10,
                            })
                        });
                        break;

                    case 5:
                        cell.CellType     = DashboardCellType.NewPatientsGraph;
                        cell.CellSettings = ODGraphJson.Serialize(new ODGraphJson()
                        {
                            FilterJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTimeFilter.GraphQuantityOverTimeFilterSettings()
                            {
                                CurGrouping = grouping
                            }),
                            GraphJson = ODGraphSettingsBase.Serialize(new GraphQuantityOverTime.QuantityOverTimeGraphSettings()
                            {
                                Title          = "New Patients - Last 12 Months",
                                QtyType        = OpenDentalGraph.Enumerations.QuantityType.count,
                                SeriesType     = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StackedColumn,
                                GroupByType    = System.Windows.Forms.DataVisualization.Charting.IntervalType.Months,
                                LegendDock     = OpenDentalGraph.Enumerations.LegendDockType.Bottom,
                                QuickRangePref = OpenDentalGraph.Enumerations.QuickRange.last12Months,
                                BreakdownPref  = OpenDentalGraph.Enumerations.BreakdownType.items,
                                BreakdownVal   = 10,
                            })
                        });
                        break;
                    }
                    layout.Cells.Add(cell);
                }
            }
            layoutsCur.Add(layout);
            //set dashboard tab control layouts
            SetDashboardLayout(layoutsCur, true);
            _hasUnsavedChanges = _hasUnsavedChanges || hasPrompt;
        }
示例#5
0
 public static string Serialize(ODGraphJson obj)
 {
     return(JsonConvert.SerializeObject(obj));
 }