public override void ToXml(XElement document) { HER2AnalysisSummaryTestOrder panelSetOrder = (HER2AnalysisSummaryTestOrder)this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(this.m_ReportNo); this.AddCompanyHeader(document); this.AddBlankNteElement(document); this.AddNextNteElement("HER2 Analysis Summary", document); this.AddNextNteElement("Master Accession #: " + panelSetOrder.MasterAccessionNo, document); this.AddNextNteElement("Report #: " + panelSetOrder.ReportNo, document); this.AddBlankNteElement(document); this.AddNextNteElement("Result", document); string result = panelSetOrder.Result; if (result == null) { result = string.Empty; } if (result.ToUpper() == "NEGATIVE") { result += " (see interpretation)"; } this.AddNextNteElement("HER2 Status: " + result, document); if (panelSetOrder.Her2Chr17Ratio.HasValue == true) { this.AddNextNteElement("HER2 by ISH", document); this.AddNextNteElement("HER2/Chr17 Ratio = " + panelSetOrder.AverageHer2Chr17Signal, document); } if (panelSetOrder.AverageHer2NeuSignal.HasValue == true) { this.AddNextNteElement("Average HER2 Copy Number = " + panelSetOrder.AverageHer2NeuSignal.Value.ToString(), document); } this.AddNextNteElement("Cells Counted:" + panelSetOrder.CellsCounted.ToString(), document); this.AddNextNteElement("HER2 Signals Counted:" + panelSetOrder.TotalHer2SignalsCounted.ToString(), document); this.AddNextNteElement("Chr17 Signals Counted:" + panelSetOrder.TotalChr17SignalsCounted.ToString(), document); this.AddBlankNteElement(document); this.AddNextNteElement("HER2 by IHC:" + panelSetOrder.IHCScore, document); this.AddBlankNteElement(document); if (panelSetOrder.RecountRequired == true) { this.AddNextNteElement("HER2 By ISH Recount", document); this.AddNextNteElement("Cells Counted: " + panelSetOrder.CellsRecount.ToString(), document); this.AddNextNteElement("HER2 Signals Counted: " + panelSetOrder.TotalHer2SignalsRecount.ToString(), document); this.AddNextNteElement("Chr17 Signals Counted: " + panelSetOrder.TotalChr17SignalsRecount.ToString(), document); this.AddBlankNteElement(document); } if (string.IsNullOrEmpty(panelSetOrder.ResultComment) == false) { this.HandleLongString("Comment: " + panelSetOrder.ResultComment, document); this.AddBlankNteElement(document); } this.AddNextNteElement("Pathologist: " + panelSetOrder.Signature, document); if (panelSetOrder.FinalDate.HasValue == true) { this.AddNextNteElement("E-signed " + panelSetOrder.FinalDate.Value.ToString("MM/dd/yyyy HH:mm"), document); } this.AddBlankNteElement(document); this.AddAmendments(document, panelSetOrder, this.m_AccessionOrder); this.AddBlankNteElement(document); this.AddNextNteElement("Result Data", document); this.AddNextNteElement("Number of invasive tumor cells counted: " + panelSetOrder.CellsCounted.ToString(), document); this.AddNextNteElement("Number of observers: " + panelSetOrder.NumberOfObservers, document); if (panelSetOrder.AverageHer2NeuSignal.HasValue == true) { this.AddNextNteElement("HER2 average copy number per nucleus: " + panelSetOrder.AverageHer2NeuSignal.Value.ToString(), document); } else { this.AddNextNteElement("HER2 average copy number per nucleus: Unable to calculate", document); } this.AddNextNteElement("Chr17 average copy number per nucleus: " + panelSetOrder.AverageChr17Signal, document); if (panelSetOrder.Her2Chr17Ratio.HasValue == true) { this.AddNextNteElement("Ratio of average HER2 / Chr17 signals: " + panelSetOrder.Her2Chr17Ratio.Value.ToString(), document); } else { this.AddNextNteElement("Ratio of average HER2 / Chr17 signals: Unable to calculate", document); } this.AddBlankNteElement(document); YellowstonePathology.Business.Specimen.Model.SpecimenOrder specimenOrder = this.m_AccessionOrder.SpecimenOrderCollection.GetSpecimenOrder(panelSetOrder.OrderedOn, panelSetOrder.OrderedOnId); YellowstonePathology.Business.Test.AliquotOrder aliquotOrder = this.m_AccessionOrder.SpecimenOrderCollection.GetAliquotOrder(panelSetOrder.OrderedOnId); string blockDescription = string.Empty; if (aliquotOrder != null) { blockDescription = " - Block " + aliquotOrder.Label; } string collectionDateTimeString = YellowstonePathology.Business.Helper.DateTimeExtensions.CombineDateAndTime(specimenOrder.CollectionDate, specimenOrder.CollectionTime); this.AddNextNteElement("Specimen Information", document); this.AddNextNteElement("Specimen site and type: " + specimenOrder.Description + blockDescription, document); this.AddNextNteElement("Specimen fixation type: " + specimenOrder.LabFixation, document); this.AddNextNteElement("Time to fixation: " + specimenOrder.TimeToFixationHourString, document); this.AddNextNteElement("Duration of fixation: " + specimenOrder.FixationDurationString, document); this.AddNextNteElement("Sample adequacy: " + panelSetOrder.SampleAdequacy, document); this.AddNextNteElement("Collection Date / Time: " + collectionDateTimeString, document); this.AddBlankNteElement(document); if (string.IsNullOrEmpty(specimenOrder.FixationComment) == false) { this.AddNextNteElement("Fixation Comment:", document); this.HandleLongString(specimenOrder.FixationComment, document); this.AddBlankNteElement(document); } if (panelSetOrder.InterpretiveComment != null) { this.AddNextNteElement("Interpretation:", document); this.HandleLongString(panelSetOrder.InterpretiveComment, document); this.AddBlankNteElement(document); } this.AddNextNteElement("Reference Ranges:", document); this.AddNextNteElement("Positive", document); this.AddNextNteElement("HER2/ Chr17 Ratio by ISH ≥2.0", document); this.AddNextNteElement("Average HER2 Copy Number Per Cell by ISH ≥4.0", document); this.AddNextNteElement("HER2 Result by IHC N/A", document); this.AddNextNteElement("or", document); this.AddNextNteElement("HER2/ Chr17 Ratio by ISH ≥2.0", document); this.AddNextNteElement("Average HER2 Copy Number Per Cell by ISH <4.0", document); this.AddNextNteElement("HER2 Result by IHC 3+", document); this.AddNextNteElement("or", document); this.AddNextNteElement("HER2/ Chr17 Ratio by ISH <2.0", document); this.AddNextNteElement("Average HER2 Copy Number Per Cell by ISH ≥4.0 but <6.0", document); this.AddNextNteElement("HER2 Result by IHC 3+", document); this.AddNextNteElement("or", document); this.AddNextNteElement("HER2/ Chr17 Ratio by ISH <2.0", document); this.AddNextNteElement("Average HER2 Copy Number Per Cell by ISH ≥6.0", document); this.AddNextNteElement("HER2 Result by IHC 2+ or 3+", document); this.AddNextNteElement("Negative", document); this.AddNextNteElement("HER2/ Chr17 Ratio by ISH <2.0", document); this.AddNextNteElement("Average HER2 Copy Number Per Cell by ISH <4.0", document); this.AddNextNteElement("HER2 Result by IHC N/A", document); this.AddNextNteElement("or", document); this.AddNextNteElement("HER2/ Chr17 Ratio by ISH ≥2.0", document); this.AddNextNteElement("Average HER2 Copy Number Per Cell by ISH <4.0", document); this.AddNextNteElement(" HER2 Result by IHC 0, 1+, or 2+", document); this.AddNextNteElement("or", document); this.AddNextNteElement("HER2/ Chr17 Ratio by ISH <2.0", document); this.AddNextNteElement("Average HER2 Copy Number Per Cell by ISH ≥4.0 but <6.0", document); this.AddNextNteElement("HER2 Result by IHC 0, 1+, or 2+", document); this.AddNextNteElement("or", document); this.AddNextNteElement("HER2/ Chr17 Ratio by ISH <2.0", document); this.AddNextNteElement("Average HER2 Copy Number Per Cell by ISH ≥6.0", document); this.AddNextNteElement("HER2 Result by IHC 0 or 1+", document); this.AddBlankNteElement(document); this.AddNextNteElement("References: ", document); this.HandleLongString(panelSetOrder.ReportReference, document); this.AddBlankNteElement(document); this.AddNextNteElement(panelSetOrder.ASRComment, document); this.AddBlankNteElement(document); string locationPerformed = panelSetOrder.GetLocationPerformedComment(); this.AddNextNteElement(locationPerformed, document); this.AddBlankNteElement(document); }
public override void Render() { HER2AnalysisSummaryTestOrder her2AmplificationSummaryTestOrder = (HER2AnalysisSummaryTestOrder)this.m_PanelSetOrder; if (her2AmplificationSummaryTestOrder.Indicator.ToUpper() == "BREAST") { if (this.m_AccessionOrder.AccessionDate >= DateTime.Parse("1/1/2014") == true) { this.m_TemplateName = @"\\CFileServer\Documents\ReportTemplates\XmlTemplates\Her2AmplificationSummary.Breast.xml"; } else { this.m_TemplateName = @"\\CFileServer\Documents\ReportTemplates\XmlTemplates\HER2AmplificationByISH.ASCOPre2014.1.xml"; } } else if (her2AmplificationSummaryTestOrder.Indicator.ToUpper() == "GASTRIC") { if (this.m_AccessionOrder.AccessionDate >= DateTime.Parse("1/1/2014") == true) { this.m_TemplateName = @"\\CFileServer\Documents\ReportTemplates\XmlTemplates\Her2AmplificationByISH.Gastric.2.xml"; } else { this.m_TemplateName = @"\\CFileServer\Documents\ReportTemplates\XmlTemplates\HER2AmplificationByISH.ASCOPre2014.1.xml"; } } base.OpenTemplate(); this.SetDemographicsV2(); this.SetReportDistribution(); this.SetCaseHistory(); if (this.m_AccessionOrder.OrderCancelled == false) { YellowstonePathology.Business.Amendment.Model.AmendmentCollection amendmentCollection = this.m_AccessionOrder.AmendmentCollection.GetAmendmentsForReport(m_PanelSetOrder.ReportNo); YellowstonePathology.Business.Document.AmendmentSection amendmentSection = new YellowstonePathology.Business.Document.AmendmentSection(); amendmentSection.SetAmendment(amendmentCollection, this.m_ReportXml, this.m_NameSpaceManager, true); YellowstonePathology.Business.Specimen.Model.SpecimenOrder specimenOrder = this.m_AccessionOrder.SpecimenOrderCollection.GetSpecimenOrder(this.m_PanelSetOrder.OrderedOn, this.m_PanelSetOrder.OrderedOnId); string collectionDateTimeString = YellowstonePathology.Business.Helper.DateTimeExtensions.CombineDateAndTime(specimenOrder.CollectionDate, specimenOrder.CollectionTime); this.SetXmlNodeData("date_time_collected", collectionDateTimeString); string result = her2AmplificationSummaryTestOrder.Result; if (result == null) { result = string.Empty; } if (result.ToUpper() == "NEGATIVE") { result += " (see interpretation)"; } this.SetXmlNodeData("test_result", result); this.SetXmlNodeData("ihc_score", her2AmplificationSummaryTestOrder.IHCScore); //removed per MSB by SEH //this.SetXmlNodeData("ish_cells_counted", her2AmplificationSummaryTestOrder.CellsCounted.ToString()); //this.SetXmlNodeData("ish_her2_counted", her2AmplificationSummaryTestOrder.TotalHer2SignalsCounted.ToString()); //this.SetXmlNodeData("ish_chr17_counted", her2AmplificationSummaryTestOrder.TotalChr17SignalsCounted.ToString()); if (her2AmplificationSummaryTestOrder.RecountRequired == true) { this.SetXmlNodeData("re_cells_counted", her2AmplificationSummaryTestOrder.CellsRecount.ToString()); this.SetXmlNodeData("re_her2_counted", her2AmplificationSummaryTestOrder.TotalHer2SignalsRecount.ToString()); this.SetXmlNodeData("re_chr17_counted", her2AmplificationSummaryTestOrder.TotalChr17SignalsRecount.ToString()); } else { this.DeleteRow("HER2 By ISH Recount"); this.DeleteRow("re_cells_counted"); this.DeleteRow("re_her2_counted"); this.DeleteRow("re_chr17_counted"); } if (her2AmplificationSummaryTestOrder.Her2Chr17Ratio.HasValue == true) { this.SetXmlNodeData("test_ratio", "HER2/Chr17 Ratio = " + her2AmplificationSummaryTestOrder.AverageHer2Chr17Signal); } else { this.DeleteRow("test_ratio"); } if (her2AmplificationSummaryTestOrder.AverageHer2NeuSignal.HasValue == true) { this.SetXmlNodeData("copy_number", "Average HER2 Copy Number = " + her2AmplificationSummaryTestOrder.AverageHer2NeuSignal.Value.ToString()); } else { this.DeleteRow("copy_number"); } this.SetXmlNodeData("cell_cnt", her2AmplificationSummaryTestOrder.CellsCounted.ToString()); if (her2AmplificationSummaryTestOrder.AverageHer2NeuSignal.HasValue == true) { this.SetXmlNodeData("avg_her", her2AmplificationSummaryTestOrder.AverageHer2NeuSignal.Value.ToString()); } else { this.SetXmlNodeData("avg_her", "Unable to calculate"); } this.SetXmlNodeData("avg_chr", her2AmplificationSummaryTestOrder.AverageChr17Signal); if (her2AmplificationSummaryTestOrder.Her2Chr17Ratio.HasValue == true) { this.SetXmlNodeData("tst_ratio", her2AmplificationSummaryTestOrder.Her2Chr17Ratio.Value.ToString()); } else { this.SetXmlNodeData("tst_ratio", "Unable to calculate"); } this.SetXmlNodeData("obs_cnt", her2AmplificationSummaryTestOrder.NumberOfObservers.ToString()); this.SetXmlNodeData("final_date", YellowstonePathology.Business.BaseData.GetShortDateString(this.m_PanelSetOrder.FinalDate)); if (string.IsNullOrEmpty(her2AmplificationSummaryTestOrder.ResultComment) == false) { this.SetXmlNodeData("result_comment", her2AmplificationSummaryTestOrder.ResultComment); this.SetXmlNodeData("comment_up", string.Empty); } else { this.DeleteRow("result_comment"); this.DeleteRow("comment_up"); } XmlNode tableNode = this.m_ReportXml.SelectSingleNode("descendant::w:tbl[w:tr/w:tc/w:p/w:r/w:t='report_interpretation']", this.m_NameSpaceManager); if (her2AmplificationSummaryTestOrder.InterpretiveComment != null) { this.SetXMLNodeParagraphDataNode(tableNode, "report_interpretation", her2AmplificationSummaryTestOrder.InterpretiveComment); } else { this.SetXMLNodeParagraphDataNode(tableNode, "report_interpretation", string.Empty); } YellowstonePathology.Business.Test.AliquotOrder aliquotOrder = this.m_AccessionOrder.SpecimenOrderCollection.GetAliquotOrder(this.m_PanelSetOrder.OrderedOnId); string blockDescription = string.Empty; if (aliquotOrder != null) { blockDescription = " - Block " + aliquotOrder.Label; } SetXmlNodeData("specimen_type", specimenOrder.Description + blockDescription); SetXmlNodeData("specimen_fixation", specimenOrder.LabFixation); SetXmlNodeData("time_to_fixation", specimenOrder.TimeToFixationHourString); this.SetXmlNodeData("report_reference", her2AmplificationSummaryTestOrder.ReportReference); SetXmlNodeData("duration_of_fixation", specimenOrder.FixationDurationString); if (string.IsNullOrEmpty(specimenOrder.FixationComment) == false) { this.SetXmlNodeData("fixation_comment", specimenOrder.FixationComment); } else { this.SetXmlNodeData("fixation_comment", string.Empty); } SetXmlNodeData("report_method", her2AmplificationSummaryTestOrder.Method); SetXmlNodeData("asr_comment", her2AmplificationSummaryTestOrder.ASRComment); SetXmlNodeData("sample_adequacy", her2AmplificationSummaryTestOrder.SampleAdequacy); SetXmlNodeData("date_time_collected", collectionDateTimeString); SetXmlNodeData("report_distribution", "No Distribution Selected"); this.SetXmlNodeData("pathologist_signature", this.m_PanelSetOrder.Signature); } else { this.SetXmlNodeData("result_comment", her2AmplificationSummaryTestOrder.ResultComment); this.SetXmlNodeData("final_date", YellowstonePathology.Business.BaseData.GetShortDateString(this.m_PanelSetOrder.FinalDate)); } this.SaveReport(); }