private Grid GetPanelSetOrderCPTCodeGrid(XElement panelSetOrderCPTCode) { Grid result = new Grid(); result.Width = GridWidth; ColumnDefinition colQuantity = new ColumnDefinition(); colQuantity.Width = new GridLength(30); result.ColumnDefinitions.Add(colQuantity); string quantity = XMLHelper.GetString(panelSetOrderCPTCode, "Quantity"); TextBlock textBlockQuantity = XPSHelper.GetTextBlock(quantity, 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(75); 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); ColumnDefinition colBillableDescription = new ColumnDefinition(); colBillableDescription.Width = new GridLength(240); result.ColumnDefinitions.Add(colBillableDescription); string description = XMLHelper.GetString(panelSetOrderCPTCode, "CodeableDescription"); TextBlock textBlockDescription = XPSHelper.GetTextBlock(description, HorizontalAlignment.Left, VerticalAlignment.Top, new Thickness(MarginSize * 10, MarginSize, MarginSize * 3, MarginSize)); Grid.SetColumn(textBlockDescription, 3); Grid.SetRow(textBlockDescription, 0); result.Children.Add(textBlockDescription); ColumnDefinition colBillableType = new ColumnDefinition(); colBillableType.Width = new GridLength(240); result.ColumnDefinitions.Add(colBillableType); string type = XMLHelper.GetString(panelSetOrderCPTCode, "CodeableType"); TextBlock textBlockType = XPSHelper.GetTextBlock(type, HorizontalAlignment.Left, VerticalAlignment.Top, new Thickness(MarginSize * 3, MarginSize, MarginSize * 3, MarginSize)); Grid.SetColumn(textBlockType, 4); Grid.SetRow(textBlockType, 0); result.Children.Add(textBlockType); return(result); }
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)); 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); 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 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); 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); }