Ejemplo n.º 1
0
        private void PrintForAccession(LabOrderSheetDataReport labOrderSheetDataReport, string seq, DateTime acknowledgeDate, DateTime acknowledgeTime)
        {
            this.m_ReportTemplate     = @"\\CFileServer\documents\Reports\Templates\LabOrders.xml";
            this.m_ReportSaveFileName = @"\\CFileServer\documents\Reports\Lab\LabOrders" + seq + ".xml";

            this.m_ReportXml = new XmlDocument();
            this.m_ReportXml.Load(this.m_ReportTemplate);

            this.m_NameSpaceManager = new XmlNamespaceManager(this.m_ReportXml.NameTable);
            this.m_NameSpaceManager.AddNamespace("w", "http://schemas.microsoft.com/office/word/2003/wordml");
            this.m_NameSpaceManager.AddNamespace("wx", "http://schemas.microsoft.com/office/word/2003/auxHint");

            this.ReportBaseXml = new XmlDocument();
            this.ReportBaseXml.Load(ReportBaseFileName);

            this.NameSpaceManagerBase = new XmlNamespaceManager(ReportBaseXml.NameTable);
            this.NameSpaceManagerBase.AddNamespace("w", "http://schemas.microsoft.com/office/word/2003/wordml");
            this.NameSpaceManagerBase.AddNamespace("wx", "http://schemas.microsoft.com/office/word/2003/auxHint");

            string reportTitle = "Yellowstone Pathology Institute, Inc. - Lab Order Sheet";

            XmlNode nodeHeaderTable  = this.FindXmlTableInDetail("report_header");
            XmlNode nodeReportHeader = this.FindXmlTableRowInDetail("report_header", nodeHeaderTable);

            this.ReplaceTextInRowNode(nodeReportHeader, "report_header", reportTitle);

            XmlNode nodeTable      = this.FindXmlTableInDetail("accession");
            XmlNode nodeTemplateR1 = this.FindXmlTableRowInDetail("accession", nodeTable);

            bool firstElement = true;

            foreach (LabOrderSheetDataPanelOrder labOrderSheetDataPanelOrder in labOrderSheetDataReport.LabOrderSheetDataPanelOrders)
            {
                string reportNo    = string.Empty;
                string pathologist = string.Empty;
                string comment     = string.Empty;
                string stain       = string.Empty;
                string block       = string.Empty;
                string ackTime     = string.Empty;
                string ackDate     = string.Empty;

                if (firstElement)
                {
                    reportNo     = labOrderSheetDataReport.ReportNo;
                    pathologist  = labOrderSheetDataPanelOrder.Initials;
                    firstElement = false;
                    comment      = labOrderSheetDataPanelOrder.Comment;

                    XmlNode nodeNewR1 = nodeTemplateR1.Clone();
                    this.SetNodeText(nodeNewR1, reportNo, pathologist, comment, block, ackTime, ackDate);
                    nodeTable.AppendChild(nodeNewR1);
                    reportNo    = string.Empty;
                    pathologist = string.Empty;
                }
                else
                {
                    if (string.IsNullOrEmpty(labOrderSheetDataPanelOrder.Comment) == false)
                    {
                        comment = labOrderSheetDataPanelOrder.Comment;
                        XmlNode nodeCommentR1 = nodeTemplateR1.Clone();
                        this.SetNodeText(nodeCommentR1, reportNo, pathologist, comment, block, ackTime, ackDate);
                        nodeTable.AppendChild(nodeCommentR1);
                    }
                }

                ackTime = acknowledgeTime.ToShortTimeString();
                ackDate = acknowledgeDate.ToShortDateString();

                if (labOrderSheetDataPanelOrder.LabOrderSheetDataTestOrders.Count > 0)
                {
                    foreach (LabOrderSheetDataTestOrder labOrderSheetDataTestOrder in labOrderSheetDataPanelOrder.LabOrderSheetDataTestOrders)
                    {
                        stain = labOrderSheetDataTestOrder.TestName;
                        if (string.IsNullOrEmpty(labOrderSheetDataTestOrder.Comment) == false)
                        {
                            stain += " - " + labOrderSheetDataTestOrder.Comment.Trim();
                        }

                        block = labOrderSheetDataTestOrder.Description;

                        XmlNode nodeTestR1 = nodeTemplateR1.Clone();
                        this.SetNodeText(nodeTestR1, reportNo, pathologist, stain, block, ackTime, ackDate);
                        nodeTable.AppendChild(nodeTestR1);
                    }
                }
            }

            nodeTable.RemoveChild(nodeTemplateR1);
            this.SetReportBody(nodeTable);
            this.m_ReportXml.Save(m_ReportSaveFileName);
            this.PrintReport(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.SpecialStainAcknowledgementPrinter);
        }
Ejemplo n.º 2
0
        private void PrintForAccession(LabOrderSheetDataReport labOrderSheetDataReport, string seq, DateTime acknowledgeDate, DateTime acknowledgeTime)
        {
            this.m_ReportTemplate = @"\\CFileServer\documents\Reports\Templates\LabOrders.xml";
            this.m_ReportSaveFileName = @"\\CFileServer\documents\Reports\Lab\LabOrders" + seq + ".xml";

            this.m_ReportXml = new XmlDocument();
            this.m_ReportXml.Load(this.m_ReportTemplate);

            this.m_NameSpaceManager = new XmlNamespaceManager(this.m_ReportXml.NameTable);
            this.m_NameSpaceManager.AddNamespace("w", "http://schemas.microsoft.com/office/word/2003/wordml");
            this.m_NameSpaceManager.AddNamespace("wx", "http://schemas.microsoft.com/office/word/2003/auxHint");

            this.ReportBaseXml = new XmlDocument();
            this.ReportBaseXml.Load(ReportBaseFileName);

            this.NameSpaceManagerBase = new XmlNamespaceManager(ReportBaseXml.NameTable);
            this.NameSpaceManagerBase.AddNamespace("w", "http://schemas.microsoft.com/office/word/2003/wordml");
            this.NameSpaceManagerBase.AddNamespace("wx", "http://schemas.microsoft.com/office/word/2003/auxHint");

            string reportTitle = "Yellowstone Pathology Institute, Inc. - Lab Order Sheet";

            XmlNode nodeHeaderTable = this.FindXmlTableInDetail("report_header");
            XmlNode nodeReportHeader = this.FindXmlTableRowInDetail("report_header", nodeHeaderTable);
            this.ReplaceTextInRowNode(nodeReportHeader, "report_header", reportTitle);

            XmlNode nodeTable = this.FindXmlTableInDetail("accession");
            XmlNode nodeTemplateR1 = this.FindXmlTableRowInDetail("accession", nodeTable);

            bool firstElement = true;
            foreach (LabOrderSheetDataPanelOrder labOrderSheetDataPanelOrder in labOrderSheetDataReport.LabOrderSheetDataPanelOrders)
            {
                string reportNo = string.Empty;
                string pathologist = string.Empty;
                string comment = string.Empty;
                string stain = string.Empty;
                string block = string.Empty;
                string ackTime = string.Empty;
                string ackDate = string.Empty;

                if (firstElement)
                {
                    reportNo = labOrderSheetDataReport.ReportNo;
                    pathologist = labOrderSheetDataPanelOrder.Initials;
                    firstElement = false;
                    comment = labOrderSheetDataPanelOrder.Comment;

                    XmlNode nodeNewR1 = nodeTemplateR1.Clone();
                    this.SetNodeText(nodeNewR1, reportNo, pathologist, comment, block, ackTime, ackDate);
                    nodeTable.AppendChild(nodeNewR1);
                    reportNo = string.Empty;
                    pathologist = string.Empty;
                }
                else
                {
                    if (string.IsNullOrEmpty(labOrderSheetDataPanelOrder.Comment) == false)
                    {
                        comment = labOrderSheetDataPanelOrder.Comment;
                        XmlNode nodeCommentR1 = nodeTemplateR1.Clone();
                        this.SetNodeText(nodeCommentR1, reportNo, pathologist, comment, block, ackTime, ackDate);
                        nodeTable.AppendChild(nodeCommentR1);
                    }
                }

                ackTime = acknowledgeTime.ToShortTimeString();
                ackDate = acknowledgeDate.ToShortDateString();

                if (labOrderSheetDataPanelOrder.LabOrderSheetDataTestOrders.Count > 0)
                {
                    foreach (LabOrderSheetDataTestOrder labOrderSheetDataTestOrder in labOrderSheetDataPanelOrder.LabOrderSheetDataTestOrders)
                    {
                        stain = labOrderSheetDataTestOrder.TestName;
                        if (string.IsNullOrEmpty(labOrderSheetDataTestOrder.Comment) == false)
                        {
                            stain += " - " + labOrderSheetDataTestOrder.Comment.Trim();
                        }

                        block = labOrderSheetDataTestOrder.Description;

                        XmlNode nodeTestR1 = nodeTemplateR1.Clone();
                        this.SetNodeText(nodeTestR1, reportNo, pathologist, stain, block, ackTime, ackDate);
                        nodeTable.AppendChild(nodeTestR1);
                    }
                }
            }

            nodeTable.RemoveChild(nodeTemplateR1);
            this.SetReportBody(nodeTable);
            this.m_ReportXml.Save(m_ReportSaveFileName);
            this.PrintReport(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.SpecialStainAcknowledgementPrinter);
        }