private bool OKToIncludePanelSetOnReport(YPIConnect.Xps.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataReport clientBillingDetailReportDataReport)
        {
            bool result = false;

            if (this.HasChargeableClientPostDateInRange(clientBillingDetailReportDataReport) == true)
            {
                if (this.HasNonZeroQuantity(clientBillingDetailReportDataReport.PanelSetOrderCPTCodeBills) == true)
                {
                    result = true;
                }
            }
            return(result);
        }
        private Grid GetSecondLineGrid(YPIConnect.Xps.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataAccessionOrder clientBillingDetailReportDataAccessionOrder,
                                       YPIConnect.Xps.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataReport clientBillingDetailReportDataReport)
        {
            Grid result = new Grid();

            result.Width = GridWidth;

            ColumnDefinition colPhysicianClientDisplay = new ColumnDefinition();

            colPhysicianClientDisplay.Width = GridLength.Auto;
            result.ColumnDefinitions.Add(colPhysicianClientDisplay);

            string physicianClientDisplay = clientBillingDetailReportDataAccessionOrder.PhysicianName + " - " + clientBillingDetailReportDataAccessionOrder.ClientName;

            TextBlock textBlockPhysicianClient = XPSHelper.GetTextBlock(physicianClientDisplay, HorizontalAlignment.Left, VerticalAlignment.Top, new Thickness(MarginSize * 3, MarginSize, MarginSize * 3, MarginSize));

            Grid.SetColumn(textBlockPhysicianClient, 0);
            Grid.SetRow(textBlockPhysicianClient, 0);
            result.Children.Add(textBlockPhysicianClient);

            StringBuilder patientTypeString = new StringBuilder();

            if (clientBillingDetailReportDataAccessionOrder.PatientType != "Not Selected")
            {
                patientTypeString.Append(clientBillingDetailReportDataAccessionOrder.PatientType);
            }
            if (clientBillingDetailReportDataAccessionOrder.PrimaryInsurance != "Not Selected")
            {
                if (patientTypeString.Length != 0)
                {
                    patientTypeString.Append(" ");
                }
                patientTypeString.Append(clientBillingDetailReportDataAccessionOrder.PrimaryInsurance);
            }

            ColumnDefinition colPatientType = new ColumnDefinition();

            colPhysicianClientDisplay.Width = GridLength.Auto;
            result.ColumnDefinitions.Add(colPatientType);

            TextBlock textBlockPatientType = XPSHelper.GetTextBlock(patientTypeString.ToString(), HorizontalAlignment.Right, VerticalAlignment.Top, new Thickness(MarginSize * 3, MarginSize, MarginSize * 3, MarginSize));

            Grid.SetColumn(textBlockPatientType, 2);
            Grid.SetRow(textBlockPatientType, 0);
            result.Children.Add(textBlockPatientType);

            return(result);
        }
        private bool HasChargeableClientPostDateInRange(YPIConnect.Xps.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataReport clientBillingDetailReportDataReport)
        {
            bool result = false;

            if (clientBillingDetailReportDataReport.NoCharge == false)
            {
                foreach (YPIConnect.Billing.PanelSetOrderCPTCodeBill panelSetOrderCPTCodeBill in clientBillingDetailReportDataReport.PanelSetOrderCPTCodeBills)
                {
                    if (panelSetOrderCPTCodeBill.PostDate.HasValue)
                    {
                        if (IsDateElementInRange(panelSetOrderCPTCodeBill.PostDate.Value, this.m_PostDateStart, this.m_PostDateEnd) == true)
                        {
                            if (panelSetOrderCPTCodeBill.BillTo == "Client")
                            {
                                result = true;
                                break;
                            }
                        }
                    }
                }
            }
            return(result);
        }
        private Grid GetFirstLineGrid(YPIConnect.Xps.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataAccessionOrder clientBillingDetailReportDataAccessionOrder,
                                      YPIConnect.Xps.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataReport clientBillingDetailReportDataReport)
        {
            Grid result = new Grid();

            result.Width = GridWidth;

            ColumnDefinition colDateOfSerice = new ColumnDefinition();

            colDateOfSerice.Width = GridLength.Auto;
            result.ColumnDefinitions.Add(colDateOfSerice);

            string dateOfServiceString = string.Empty;

            if (clientBillingDetailReportDataAccessionOrder.DateOfService.HasValue == true)
            {
                dateOfServiceString = clientBillingDetailReportDataAccessionOrder.DateOfService.Value.ToString("MM/dd/yyyy");
            }

            TextBlock textBlockDateOfService = XPSHelper.GetTextBlock(dateOfServiceString, HorizontalAlignment.Left, VerticalAlignment.Top, new Thickness(MarginSize * 3, MarginSize, MarginSize * 3, MarginSize));

            textBlockDateOfService.FontWeight = FontWeight.FromOpenTypeWeight(700);
            Grid.SetColumn(textBlockDateOfService, 0);
            Grid.SetRow(textBlockDateOfService, 0);
            result.Children.Add(textBlockDateOfService);

            ColumnDefinition colPatientDisplayString = new ColumnDefinition();

            colPatientDisplayString.Width = new GridLength(20, GridUnitType.Star);
            result.ColumnDefinitions.Add(colPatientDisplayString);

            StringBuilder patientDisplayString = new StringBuilder();

            patientDisplayString.Append(YPIConnect.PatientName.GetLastFirstDOBDisplayName(clientBillingDetailReportDataAccessionOrder.PFirstName, clientBillingDetailReportDataAccessionOrder.PLastName, clientBillingDetailReportDataAccessionOrder.PBirthdate));

            if (string.IsNullOrEmpty(clientBillingDetailReportDataAccessionOrder.SvhAccount) == false)
            {
                patientDisplayString.Append("  (" + clientBillingDetailReportDataAccessionOrder.SvhAccount);
                if (string.IsNullOrEmpty(clientBillingDetailReportDataAccessionOrder.SvhMedicalRecord) == false)
                {
                    patientDisplayString.Append("/");
                }
                else
                {
                    patientDisplayString.Append(")");
                }
            }

            if (string.IsNullOrEmpty(clientBillingDetailReportDataAccessionOrder.SvhMedicalRecord) == false)
            {
                patientDisplayString.Append(clientBillingDetailReportDataAccessionOrder.SvhMedicalRecord + ")");
            }

            TextBlock textBlockPatientDisplayString = XPSHelper.GetTextBlock(patientDisplayString.ToString(), HorizontalAlignment.Left, VerticalAlignment.Top, new Thickness(MarginSize * 3, MarginSize, MarginSize * 3, MarginSize));

            textBlockPatientDisplayString.FontWeight = FontWeight.FromOpenTypeWeight(700);
            Grid.SetColumn(textBlockPatientDisplayString, 1);
            Grid.SetRow(textBlockPatientDisplayString, 0);
            result.Children.Add(textBlockPatientDisplayString);

            ColumnDefinition colReportNo = new ColumnDefinition();

            colReportNo.Width = GridLength.Auto;
            result.ColumnDefinitions.Add(colReportNo);

            TextBlock textBlockReportNo = XPSHelper.GetTextBlock(clientBillingDetailReportDataReport.ReportNo, HorizontalAlignment.Right, VerticalAlignment.Top, new Thickness(MarginSize * 3, MarginSize, MarginSize * 3, MarginSize));

            Grid.SetColumn(textBlockReportNo, 2);
            Grid.SetRow(textBlockReportNo, 0);
            result.Children.Add(textBlockReportNo);

            return(result);
        }