Example #1
0
        private bool HasChargeableClientPostDateInRange(XElement panelSetOrderElement)
        {
            bool            result = false;
            List <XElement> panelSetOrderCPTCodeBillElements = XMLHelper.GetElementList(panelSetOrderElement, "PanelSetOrderCPTCodeBillCollection", "PanelSetOrderCPTCodeBill");

            foreach (XElement panelSetOrderCPTCodeBillElement in panelSetOrderCPTCodeBillElements)
            {
                string postDateString = XMLHelper.GetString(panelSetOrderCPTCodeBillElement, "PostDate");
                if (string.IsNullOrEmpty(postDateString) == false)
                {
                    DateTime postDate = DateTime.Parse(postDateString);
                    if (YellowstonePathology.Document.XMLHelper.IsDateElementInRange(postDate, this.m_PostDateStart, this.m_PostDateEnd) == true)
                    {
                        string billTo = XMLHelper.GetString(panelSetOrderCPTCodeBillElement, "BillTo");
                        if (billTo == "Client")
                        {
                            string noCharge = YellowstonePathology.Document.XMLHelper.GetString(panelSetOrderElement, "NoCharge");
                            if (noCharge == "0")
                            {
                                result = true;
                                break;
                            }
                        }
                    }
                }
            }
            return(result);
        }
Example #2
0
        private Grid GetSecondLineGrid(XElement accessionOrderElement, XElement panelSetElement)
        {
            Grid result = new Grid();

            result.Width = GridWidth;

            ColumnDefinition colPhysicianClientDisplay = new ColumnDefinition();

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

            string physicianName          = XMLHelper.GetString(accessionOrderElement, "PhysicianName");
            string clientName             = XMLHelper.GetString(accessionOrderElement, "ClientName");
            string physicianClientDisplay = physicianName + " - " + 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);

            string patientType      = XMLHelper.GetString(accessionOrderElement, "PatientType");
            string primaryInsurance = XMLHelper.GetString(accessionOrderElement, "PrimaryInsurance");

            StringBuilder patientTypeString = new StringBuilder();

            if (patientType != "Not Selected")
            {
                patientTypeString.Append(patientType);
            }
            if (primaryInsurance != "Not Selected")
            {
                if (patientTypeString.Length != 0)
                {
                    patientTypeString.Append(" ");
                }
                patientTypeString.Append(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);
        }
Example #3
0
        private void WriteDocument()
        {
            foreach (XElement accessionElement in this.m_ReportData.Elements("AccessionOrder"))
            {
                List <XElement> panelSetOrderElements = XMLHelper.GetElementList(accessionElement, "PanelSetOrderCollection", "PanelSetOrder");
                foreach (XElement panelSetOrderElement in panelSetOrderElements)
                {
                    if (this.OKToIncludePanelSetOnReport(panelSetOrderElement) == true)
                    {
                        Grid accessionGrid = this.GetFirstLineGrid(accessionElement, panelSetOrderElement);
                        this.m_MultiPageDocument.WriteRowContent(accessionGrid);

                        Grid panelSetGrid = this.GetSecondLineGrid(accessionElement, panelSetOrderElement);
                        this.m_MultiPageDocument.WriteRowContent(panelSetGrid);

                        List <XElement> panelSetOrderCPTCodeElements = XMLHelper.GetElementList(panelSetOrderElement, "PanelSetOrderCPTCodeCollection", "PanelSetOrderCPTCode");

                        foreach (XElement panelSetOrderCPTCodeElement in panelSetOrderCPTCodeElements)
                        {
                            Grid panelSetOrderCPTCodeGrid = this.GetPanelSetOrderCPTCodeGrid(panelSetOrderCPTCodeElement);
                            this.m_MultiPageDocument.WriteRowContent(panelSetOrderCPTCodeGrid);
                        }

                        List <XElement> PanelSetOrderCPTCodeBillElements = XMLHelper.GetElementList(panelSetOrderElement, "PanelSetOrderCPTCodeBillCollection", "PanelSetOrderCPTCodeBill");
                        if (PanelSetOrderCPTCodeBillElements.Count > 0)
                        {
                            Grid cptSummaryHeaderGrid = this.GetCodeSectionHeader("CPT Summary");
                            this.m_MultiPageDocument.WriteRowContent(cptSummaryHeaderGrid);
                        }

                        foreach (XElement panelSetOrderCPTCodeBillElement in PanelSetOrderCPTCodeBillElements)
                        {
                            string billTo = XMLHelper.GetString(panelSetOrderCPTCodeBillElement, "BillTo");
                            if (billTo == "Client")
                            {
                                DateTime postDate = DateTime.Parse(panelSetOrderCPTCodeBillElement.Element("PostDate").Value);
                                if (YellowstonePathology.Document.XMLHelper.IsDateElementInRange(postDate, this.m_PostDateStart, this.m_PostDateEnd) == true)
                                {
                                    Grid nonClientPanelSetOrderCPTCodeBillGrid = this.GetPanelSetOrderCPTCodeBillGrid(panelSetOrderCPTCodeBillElement);
                                    this.m_MultiPageDocument.WriteRowContent(nonClientPanelSetOrderCPTCodeBillGrid);
                                }
                            }
                        }

                        Grid blankGrid = new Grid();
                        blankGrid.Height = 30;
                        this.m_MultiPageDocument.WriteRowContent(blankGrid);
                    }
                }
            }
        }
Example #4
0
        private Grid GetPanelSetOrderCPTCodeBillGrid(XElement panelSetOrderCPTCode)
        {
            Grid result = new Grid();

            result.Width = GridWidth;

            ColumnDefinition colCPTQuantity = new ColumnDefinition();

            colCPTQuantity.Width = new GridLength(30);
            result.ColumnDefinitions.Add(colCPTQuantity);

            string    cptCodeQuantity   = XMLHelper.GetString(panelSetOrderCPTCode, "Quantity");
            TextBlock textBlockQuantity = XPSHelper.GetTextBlock(cptCodeQuantity, HorizontalAlignment.Left, VerticalAlignment.Top, new Thickness(MarginSize * 3, MarginSize, MarginSize * 3, MarginSize));

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

            ColumnDefinition colCPTCode = new ColumnDefinition();

            colCPTCode.Width = new GridLength(75);
            result.ColumnDefinitions.Add(colCPTCode);

            string    cptCode          = XMLHelper.GetString(panelSetOrderCPTCode, "CPTCode");
            TextBlock textBlockCPTCode = XPSHelper.GetTextBlock(cptCode, HorizontalAlignment.Left, VerticalAlignment.Top, new Thickness(MarginSize * 3, MarginSize, MarginSize * 3, MarginSize));

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

            ColumnDefinition colCPTModifier = new ColumnDefinition();

            colCPTModifier.Width = new GridLength(100);
            result.ColumnDefinitions.Add(colCPTModifier);

            string    modifier          = XMLHelper.GetString(panelSetOrderCPTCode, "Modifier");
            TextBlock textBlockModifier = XPSHelper.GetTextBlock(modifier, HorizontalAlignment.Left, VerticalAlignment.Top, new Thickness(MarginSize * 3, MarginSize, MarginSize * 3, MarginSize));

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

            return(result);
        }
Example #5
0
        private Grid GetFirstLineGrid(XElement accessionOrderElement, XElement panelSetOrderElement)
        {
            Grid result = new Grid();

            result.Width = GridWidth;

            ColumnDefinition colDateOfSerice = new ColumnDefinition();

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

            Nullable <DateTime> dateOfService = XMLHelper.GetNullableDateTime(accessionOrderElement, "DateOfService");
            string dateOfServiceString        = string.Empty;

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

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

            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);

            string firstName           = XMLHelper.GetString(accessionOrderElement, "PFirstName");
            string lastName            = XMLHelper.GetString(accessionOrderElement, "PLastName");
            string accountNumber       = XMLHelper.GetString(accessionOrderElement, "SvhAccount");
            string medicalRecordNumber = XMLHelper.GetString(accessionOrderElement, "SvhMedicalRecord");

            StringBuilder patientDisplayString = new StringBuilder();

            patientDisplayString.Append(YellowstonePathology.Business.Patient.Model.Patient.GetLastFirstDisplayName(firstName, lastName));

            if (string.IsNullOrEmpty(accountNumber) == false)
            {
                patientDisplayString.Append("(" + accountNumber);
                if (string.IsNullOrEmpty(medicalRecordNumber) == false)
                {
                    patientDisplayString.Append("/");
                }
                else
                {
                    patientDisplayString.Append(")");
                }
            }

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

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

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

            ColumnDefinition colReportNo = new ColumnDefinition();

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

            string    reportNo          = XMLHelper.GetString(panelSetOrderElement, "ReportNo");
            TextBlock textBlockReportNo = XPSHelper.GetTextBlock(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);
        }