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);
        }
Esempio n. 2
0
        public static YPIConnect.Xps.Result.ClientBillingDetailReportResult.ClientBillingDetailReportData GetClientBillingDetailReport(DateTime postDateStart, DateTime postDateEnd, int clientGroupId)
        {
            JObject   message      = APIRequestHelper.GetClientBillingDetailReportMessage(postDateStart, postDateEnd, 1);
            APIResult apiResult    = APIRequestHelper.SubmitAPIRequestMessage(message);
            JArray    billingItems = (JArray)apiResult.JSONResult["result"]["results"][0];

            YPIConnect.Xps.Result.ClientBillingDetailReportResult.ClientBillingDetailReportData result = new Xps.Result.ClientBillingDetailReportResult.ClientBillingDetailReportData();
            foreach (JObject itemHead in billingItems)
            {
                YPIConnect.Xps.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataAccessionOrder clientBillingDetailReportDataAccessionOrder = new YPIConnect.Xps.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataAccessionOrder();
                clientBillingDetailReportDataAccessionOrder.FromJson(typeof(YPIConnect.Xps.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataAccessionOrder), itemHead);
                result.Add(clientBillingDetailReportDataAccessionOrder);
            }

            JArray billingItems2 = (JArray)apiResult.JSONResult["result"]["results"][1];

            foreach (JObject item2 in billingItems2)
            {
                Xps.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataReport clientBillingDetailReportDataReport = new Xps.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataReport();
                clientBillingDetailReportDataReport.FromJson(typeof(YPIConnect.Xps.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataReport), item2);
                foreach (Xps.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataAccessionOrder clientBillingDetailReportDataAccessionOrder in result)
                {
                    if (clientBillingDetailReportDataReport.MasterAccessionNo == clientBillingDetailReportDataAccessionOrder.MasterAccessionNo)
                    {
                        clientBillingDetailReportDataAccessionOrder.ClientBillingDetailReportDataReports.Add(clientBillingDetailReportDataReport);
                        break;
                    }
                }
            }

            JArray billingItems3 = (JArray)apiResult.JSONResult["result"]["results"][2];

            foreach (JObject item3 in billingItems3)
            {
                Billing.PanelSetOrderCPTCode panelSetOrderCPTCode = new Billing.PanelSetOrderCPTCode();
                panelSetOrderCPTCode.FromJson(typeof(Billing.PanelSetOrderCPTCode), item3);
                foreach (Xps.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataAccessionOrder clientBillingDetailReportDataAccessionOrder in result)
                {
                    bool added = false;
                    foreach (Xps.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataReport clientBillingDetailReportDataReport in clientBillingDetailReportDataAccessionOrder.ClientBillingDetailReportDataReports)
                    {
                        if (panelSetOrderCPTCode.ReportNo == clientBillingDetailReportDataReport.ReportNo)
                        {
                            clientBillingDetailReportDataReport.PanelSetOrderCPTCodes.Add(panelSetOrderCPTCode);
                            added = true;
                            break;
                        }
                    }
                    if (added)
                    {
                        break;
                    }
                }
            }

            JArray billingItems4 = (JArray)apiResult.JSONResult["result"]["results"][3];

            foreach (JObject item4 in billingItems4)
            {
                Billing.PanelSetOrderCPTCodeBill panelSetOrderCPTCodeBill = new Billing.PanelSetOrderCPTCodeBill();
                panelSetOrderCPTCodeBill.FromJson(typeof(Billing.PanelSetOrderCPTCodeBill), item4);
                foreach (Xps.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataAccessionOrder clientBillingDetailReportDataAccessionOrder in result)
                {
                    bool added = false;
                    foreach (Xps.Result.ClientBillingDetailReportResult.ClientBillingDetailReportDataReport clientBillingDetailReportDataReport in clientBillingDetailReportDataAccessionOrder.ClientBillingDetailReportDataReports)
                    {
                        if (panelSetOrderCPTCodeBill.ReportNo == clientBillingDetailReportDataReport.ReportNo)
                        {
                            clientBillingDetailReportDataReport.PanelSetOrderCPTCodeBills.Add(panelSetOrderCPTCodeBill);
                            added = true;
                            break;
                        }
                    }
                    if (added)
                    {
                        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);
        }