Ejemplo n.º 1
0
        public HPV1618ResultPage(YellowstonePathology.Business.Test.HPV1618.PanelSetOrderHPV1618 panelSetOrderHPV1618,
                                 YellowstonePathology.Business.Test.AccessionOrder accessionOrder,
                                 YellowstonePathology.Business.User.SystemIdentity systemIdentity,
                                 YellowstonePathology.UI.Navigation.PageNavigator pageNavigator) : base(panelSetOrderHPV1618, accessionOrder)
        {
            this.m_PanelSetOrder  = panelSetOrderHPV1618;
            this.m_AccessionOrder = accessionOrder;
            this.m_SystemIdentity = systemIdentity;
            this.m_PageNavigator  = pageNavigator;

            this.m_Genotype16ResultCollection = YellowstonePathology.Business.Test.HPV1618.HPV1618ResultCollection.GetGenotype16Results();
            this.m_Genotype18ResultCollection = YellowstonePathology.Business.Test.HPV1618.HPV1618ResultCollection.GetGenotype18Results();

            this.m_PageHeaderText = "HPV Genotypes 16 and 18 Results For: " + this.m_AccessionOrder.PatientDisplayName;

            InitializeComponent();

            DataContext = this;

            this.Loaded   += HPV1618ResultPage_Loaded;
            this.Unloaded += HPV1618ResultPage_Unloaded;

            this.m_ControlsNotDisabledOnFinal.Add(this.ButtonNext);
            this.m_ControlsNotDisabledOnFinal.Add(this.TextBlockShowDocument);
            this.m_ControlsNotDisabledOnFinal.Add(this.TextBlockUnfinalResults);
        }
Ejemplo n.º 2
0
 public virtual void AcceptResults(YellowstonePathology.Business.Test.HPV1618.PanelSetOrderHPV1618 panelSetOrder,
                                   YellowstonePathology.Business.User.SystemIdentity systemIdentity)
 {
     YellowstonePathology.Business.Test.PanelOrder panelOrder = panelSetOrder.PanelOrderCollection.GetUnacceptedPanelOrder();
     panelOrder.AcceptResults();
     panelSetOrder.Accept();
 }
Ejemplo n.º 3
0
        public HPV1618ResultPage(YellowstonePathology.Business.Test.HPV1618.PanelSetOrderHPV1618 panelSetOrderHPV1618,
			YellowstonePathology.Business.Test.AccessionOrder accessionOrder,
			YellowstonePathology.Business.User.SystemIdentity systemIdentity,
			YellowstonePathology.UI.Navigation.PageNavigator pageNavigator)
            : base(panelSetOrderHPV1618, accessionOrder)
        {
            this.m_PanelSetOrder = panelSetOrderHPV1618;
            this.m_AccessionOrder = accessionOrder;
            this.m_SystemIdentity = systemIdentity;
            this.m_PageNavigator = pageNavigator;

            this.m_Genotype16ResultCollection = YellowstonePathology.Business.Test.HPV1618.HPV1618ResultCollection.GetGenotype16Results();
            this.m_Genotype18ResultCollection = YellowstonePathology.Business.Test.HPV1618.HPV1618ResultCollection.GetGenotype18Results();

            this.m_PageHeaderText = "HPV Genotypes 16 and 18 Results For: " + this.m_AccessionOrder.PatientDisplayName;

            InitializeComponent();

            DataContext = this;

            this.Loaded += HPV1618ResultPage_Loaded;
            this.Unloaded += HPV1618ResultPage_Unloaded;

            this.m_ControlsNotDisabledOnFinal.Add(this.ButtonNext);
            this.m_ControlsNotDisabledOnFinal.Add(this.TextBlockShowDocument);
            this.m_ControlsNotDisabledOnFinal.Add(this.TextBlockUnfinalResults);
        }
Ejemplo n.º 4
0
 public HPV1618ResultPath(string reportNo,
     YellowstonePathology.Business.Test.AccessionOrder accessionOrder,
     YellowstonePathology.UI.Navigation.PageNavigator pageNavigator,
     System.Windows.Window window)
     : base(pageNavigator, window)
 {
     this.m_AccessionOrder = accessionOrder;
     this.m_PanelSetOrderHPV1618 = (YellowstonePathology.Business.Test.HPV1618.PanelSetOrderHPV1618)this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(reportNo);
 }
Ejemplo n.º 5
0
 public HPV1618ResultPath(string reportNo,
                          YellowstonePathology.Business.Test.AccessionOrder accessionOrder,
                          YellowstonePathology.UI.Navigation.PageNavigator pageNavigator,
                          System.Windows.Window window)
     : base(pageNavigator, window)
 {
     this.m_AccessionOrder       = accessionOrder;
     this.m_PanelSetOrderHPV1618 = (YellowstonePathology.Business.Test.HPV1618.PanelSetOrderHPV1618) this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(reportNo);
 }
Ejemplo n.º 6
0
        public override string ToResultString(YellowstonePathology.Business.Test.AccessionOrder accessionOrder)
        {
            StringBuilder result = new StringBuilder();

            YellowstonePathology.Business.Test.ThinPrepPap.ThinPrepPapTest panelSetThinPrepPap = new YellowstonePathology.Business.Test.ThinPrepPap.ThinPrepPapTest();
            YellowstonePathology.Business.Test.HPV.HPVTest                 panelSetHPV         = new YellowstonePathology.Business.Test.HPV.HPVTest();
            YellowstonePathology.Business.Test.HPV1618.HPV1618Test         panelSetHPV1618     = new YellowstonePathology.Business.Test.HPV1618.HPV1618Test();
            YellowstonePathology.Business.Test.NGCT.NGCTTest               panelSetNGCT        = new YellowstonePathology.Business.Test.NGCT.NGCTTest();
            YellowstonePathology.Business.Test.Trichomonas.TrichomonasTest panelSetTrichomonas = new YellowstonePathology.Business.Test.Trichomonas.TrichomonasTest();

            if (accessionOrder.PanelSetOrderCollection.Exists(panelSetThinPrepPap.PanelSetId) == true)
            {
                YellowstonePathology.Business.Test.ThinPrepPap.PanelSetOrderCytology panelSetOrderCytology = (YellowstonePathology.Business.Test.ThinPrepPap.PanelSetOrderCytology)accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetThinPrepPap.PanelSetId);
                result.AppendLine(panelSetOrderCytology.ToResultString(accessionOrder));
                result.AppendLine();
            }

            if (accessionOrder.PanelSetOrderCollection.Exists(panelSetHPV.PanelSetId) == true)
            {
                YellowstonePathology.Business.Test.HPV.HPVTestOrder hpvTestOrder = (YellowstonePathology.Business.Test.HPV.HPVTestOrder)accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetHPV.PanelSetId);
                result.AppendLine(hpvTestOrder.ToResultString(accessionOrder));
                result.AppendLine();
            }

            if (accessionOrder.PanelSetOrderCollection.Exists(panelSetHPV1618.PanelSetId) == true)
            {
                YellowstonePathology.Business.Test.HPV1618.PanelSetOrderHPV1618 panelSetOrderHPV1618 = (YellowstonePathology.Business.Test.HPV1618.PanelSetOrderHPV1618)accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetHPV1618.PanelSetId);
                result.AppendLine(panelSetOrderHPV1618.ToResultString(accessionOrder));
                result.AppendLine();
            }

            if (accessionOrder.PanelSetOrderCollection.Exists(panelSetNGCT.PanelSetId) == true)
            {
                YellowstonePathology.Business.Test.NGCT.NGCTTestOrder panelSetOrderNGCT = (YellowstonePathology.Business.Test.NGCT.NGCTTestOrder)accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetNGCT.PanelSetId);
                result.AppendLine(panelSetOrderNGCT.ToResultString(accessionOrder));
                result.AppendLine();
            }

            if (accessionOrder.PanelSetOrderCollection.Exists(panelSetTrichomonas.PanelSetId) == true)
            {
                YellowstonePathology.Business.Test.Trichomonas.TrichomonasTestOrder reportOrderTrichomonas = (YellowstonePathology.Business.Test.Trichomonas.TrichomonasTestOrder)accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetTrichomonas.PanelSetId);
                result.AppendLine(reportOrderTrichomonas.ToResultString(accessionOrder));
                result.AppendLine();
            }

            return(result.ToString());
        }
Ejemplo n.º 7
0
        public override void ToXml(XElement document)
        {
            YellowstonePathology.Business.Test.HPV1618.PanelSetOrderHPV1618 panelSetOrder = (YellowstonePathology.Business.Test.HPV1618.PanelSetOrderHPV1618) this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(this.m_ReportNo);

            this.AddCompanyHeader(document);
            this.AddBlankNteElement(document);

            this.AddNextNteElement("HPV-16/18 Genotyping", document);
            this.AddNextNteElement("Master Accession #: " + panelSetOrder.MasterAccessionNo, document);
            this.AddNextNteElement("Report #: " + panelSetOrder.ReportNo, document);
            this.AddBlankNteElement(document);

            string hpv16ResultText = "HPV-16 Result: " + panelSetOrder.HPV16Result;

            this.AddNextNteElement(hpv16ResultText, document);
            this.AddNextNteElement("HPV-16 Reference: Negative", document);
            this.AddBlankNteElement(document);

            string hpv18ResultText = "HPV-18 Result: " + panelSetOrder.HPV18Result;

            this.AddNextNteElement(hpv18ResultText, document);
            this.AddNextNteElement("HPV-18 Reference: Negative", document);
            this.AddBlankNteElement(document);

            YellowstonePathology.Business.Interface.IOrderTarget orderTarget = this.m_AccessionOrder.SpecimenOrderCollection.GetOrderTarget(panelSetOrder.OrderedOnId);
            this.AddNextNteElement("Specimen: " + orderTarget.GetDescription(), document);
            this.AddBlankNteElement(document);

            this.AddNextNteElement("Method:", document);
            this.HandleLongString(panelSetOrder.Method, document);
            this.AddBlankNteElement(document);

            this.AddNextNteElement("References:", document);
            this.HandleLongString(panelSetOrder.References, document);
            this.AddBlankNteElement(document);

            this.AddNextNteElement("This test was developed and its performance characteristics determined by Yellowstone Pathology Institute, Inc.  It has not been cleared or approved by the U.S. Food and Drug Administration. The FDA has determined that such clearance or approval is not necessary.  This test is used for clinical purposes.  It should not be regarded as investigational or for research.  This laboratory is certified under the Clinical Laboratory Improvement Amendments of 1988 (CLIA-88) as qualified to perform high complexity clinical laboratory testing.", document);

            string locationPerformed = panelSetOrder.GetLocationPerformedComment();

            this.AddNextNteElement(locationPerformed, document);
            this.AddBlankNteElement(document);
        }
Ejemplo n.º 8
0
        public override void Render()
        {
            YellowstonePathology.Business.Test.HPV1618.PanelSetOrderHPV1618 panelSetOrderHPV1618 = (YellowstonePathology.Business.Test.HPV1618.PanelSetOrderHPV1618) this.m_PanelSetOrder;

            this.m_TemplateName = @"\\CFileServer\Documents\ReportTemplates\XmlTemplates\HPV1618Genotyping.1.xml";
            base.OpenTemplate();

            base.SetDemographicsV2();

            YellowstonePathology.Business.Specimen.Model.SpecimenOrder specimenOrder = this.m_AccessionOrder.SpecimenOrderCollection.GetSpecimenOrder(this.m_PanelSetOrder.OrderedOn, this.m_PanelSetOrder.OrderedOnId);
            base.ReplaceText("specimen_description", specimenOrder.Description);

            string collectionDateTimeString = YellowstonePathology.Business.Helper.DateTimeExtensions.CombineDateAndTime(specimenOrder.CollectionDate, specimenOrder.CollectionTime);

            this.SetXmlNodeData("date_time_collected", collectionDateTimeString);

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

            base.ReplaceText("hpv16_result", panelSetOrderHPV1618.HPV16Result);
            base.ReplaceText("hpv18_result", panelSetOrderHPV1618.HPV18Result);

            if (string.IsNullOrEmpty(panelSetOrderHPV1618.Comment) == false)
            {
                base.ReplaceText("report_comment", panelSetOrderHPV1618.Comment);
            }
            else
            {
                base.DeleteRow("report_comment");
            }

            base.ReplaceText("report_method", panelSetOrderHPV1618.Method);
            base.ReplaceText("report_references", panelSetOrderHPV1618.ReportReferences);

            this.SetReportDistribution();
            this.SetCaseHistory();

            this.SaveReport();
        }
Ejemplo n.º 9
0
        public HPV1618ResultPage(YellowstonePathology.Business.Test.HPV1618.PanelSetOrderHPV1618 panelSetOrderHPV1618,
                                 YellowstonePathology.Business.Test.AccessionOrder accessionOrder,
                                 YellowstonePathology.Business.User.SystemIdentity systemIdentity,
                                 YellowstonePathology.UI.Navigation.PageNavigator pageNavigator)
        {
            this.m_PanelSetOrder  = panelSetOrderHPV1618;
            this.m_AccessionOrder = accessionOrder;
            this.m_SystemIdentity = systemIdentity;
            this.m_PageNavigator  = pageNavigator;

            this.m_Genotype16ResultCollection = YellowstonePathology.Business.Test.HPV1618.HPV1618ResultCollection.GetGenotype16Results();
            this.m_Genotype18ResultCollection = YellowstonePathology.Business.Test.HPV1618.HPV1618ResultCollection.GetGenotype18Results();

            this.m_PageHeaderText = "HPV Genotypes 16 and 18 Results For: " + this.m_AccessionOrder.PatientDisplayName;

            InitializeComponent();

            DataContext = this;

            this.Loaded   += HPV1618ResultPage_Loaded;
            this.Unloaded += HPV1618ResultPage_Unloaded;
        }
Ejemplo n.º 10
0
        public HPV1618ResultPage(YellowstonePathology.Business.Test.HPV1618.PanelSetOrderHPV1618 panelSetOrderHPV1618,
			YellowstonePathology.Business.Test.AccessionOrder accessionOrder,
			YellowstonePathology.Business.User.SystemIdentity systemIdentity,
			YellowstonePathology.UI.Navigation.PageNavigator pageNavigator)
        {
            this.m_PanelSetOrder = panelSetOrderHPV1618;
            this.m_AccessionOrder = accessionOrder;
            this.m_SystemIdentity = systemIdentity;
            this.m_PageNavigator = pageNavigator;

            this.m_Genotype16ResultCollection = YellowstonePathology.Business.Test.HPV1618.HPV1618ResultCollection.GetGenotype16Results();
            this.m_Genotype18ResultCollection = YellowstonePathology.Business.Test.HPV1618.HPV1618ResultCollection.GetGenotype18Results();

            this.m_PageHeaderText = "HPV Genotypes 16 and 18 Results For: " + this.m_AccessionOrder.PatientDisplayName;

            InitializeComponent();

            DataContext = this;

            this.Loaded += HPV1618ResultPage_Loaded;
            this.Unloaded += HPV1618ResultPage_Unloaded;
        }
Ejemplo n.º 11
0
 public virtual void UnFinalizeResults(YellowstonePathology.Business.Test.HPV1618.PanelSetOrderHPV1618 panelSetOrder)
 {
     panelSetOrder.Unfinalize();
 }
        public override void ToXml(XElement document)
        {
            WomensHealthProfileTestOrder womensHealthProfileTestOrder = (WomensHealthProfileTestOrder)this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(this.m_ReportNo);
            WomensHealthProfileResult    womensHealthProfileResult    = new WomensHealthProfileResult(this.m_AccessionOrder);

            ThinPrepPap.ThinPrepPapTest thinPrepPapTest = new ThinPrepPap.ThinPrepPapTest();
            bool hasPap = this.m_AccessionOrder.PanelSetOrderCollection.Exists(thinPrepPapTest.PanelSetId);

            this.AddCompanyHeader(document);
            this.AddBlankNteElement(document);

            this.AddNextNteElement("Women's Health Profile", document);
            this.AddNextNteElement("Report #: " + womensHealthProfileTestOrder.ReportNo, document);
            this.AddBlankNteElement(document);

            if (hasPap == true)
            {
                this.AddNextNteElement("PAP TEST RESULT: ", document);

                YellowstonePathology.Business.Test.ThinPrepPap.PanelSetOrderCytology panelSetOrderCytology = (YellowstonePathology.Business.Test.ThinPrepPap.PanelSetOrderCytology) this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(15);
                if (string.IsNullOrEmpty(panelSetOrderCytology.ScreeningImpression) == false)
                {
                    this.AddNextNteElement("Epithelial Cell Description: ", document);
                    this.AddNextNteElement(panelSetOrderCytology.ScreeningImpression, document);
                    this.AddBlankNteElement(document);
                }

                this.AddNextNteElement("Specimen Adequacy:", document);
                this.AddNextNteElement(panelSetOrderCytology.SpecimenAdequacy, document);
                this.AddBlankNteElement(document);

                if (string.IsNullOrEmpty(panelSetOrderCytology.OtherConditions) == false)
                {
                    this.AddNextNteElement("Other Conditions:", document);
                    this.AddNextNteElement(panelSetOrderCytology.OtherConditions, document);
                    this.AddBlankNteElement(document);
                }

                if (string.IsNullOrEmpty(panelSetOrderCytology.ReportComment) == false)
                {
                    this.AddNextNteElement("Comment:", document);
                    this.AddNextNteElement(panelSetOrderCytology.ReportComment, document);
                    this.AddBlankNteElement(document);
                }

                YellowstonePathology.Business.Test.ThinPrepPap.PanelOrderCytology screeningPanelOrder = null;
                YellowstonePathology.Business.Test.ThinPrepPap.PanelOrderCytology reviewPanelOrder    = null;

                foreach (YellowstonePathology.Business.Interface.IPanelOrder panelOrder in panelSetOrderCytology.PanelOrders)
                {
                    Type objectType = panelOrder.GetType();
                    if (typeof(YellowstonePathology.Business.Test.ThinPrepPap.PanelOrderCytology).IsAssignableFrom(objectType) == true)
                    {
                        YellowstonePathology.Business.Test.ThinPrepPap.PanelOrderCytology cytologyPanelOrder = (YellowstonePathology.Business.Test.ThinPrepPap.PanelOrderCytology)panelOrder;
                        if (cytologyPanelOrder.PanelId == 38)
                        {
                            if (cytologyPanelOrder.ScreeningType == "Primary Screening")
                            {
                                screeningPanelOrder = cytologyPanelOrder;
                            }
                            else if (cytologyPanelOrder.ScreeningType == "Pathologist Review")
                            {
                                reviewPanelOrder = cytologyPanelOrder;
                            }
                            else if (cytologyPanelOrder.ScreeningType == "Cytotech Review")
                            {
                                if (reviewPanelOrder == null || reviewPanelOrder.ScreeningType != "Pathologist Review")
                                {
                                    reviewPanelOrder = cytologyPanelOrder;
                                }
                            }
                        }
                    }
                }

                YellowstonePathology.Business.User.SystemUser systemUser = YellowstonePathology.Business.User.SystemUserCollectionInstance.Instance.SystemUserCollection.GetSystemUserById(screeningPanelOrder.ScreenedById);
                if (string.IsNullOrEmpty(systemUser.Signature) == false)
                {
                    this.AddNextNteElement("Screened By: " + systemUser.Signature, document);
                }

                string cytoTechFinal = YellowstonePathology.Business.Helper.DateTimeExtensions.DateAndTimeStringFromNullable(screeningPanelOrder.AcceptedTime);
                this.AddNextNteElement("*** E-Signed " + cytoTechFinal + " ***", document);
                this.AddBlankNteElement(document);

                if (reviewPanelOrder != null)
                {
                    string reviewedBy      = YellowstonePathology.Business.User.SystemUserCollectionInstance.Instance.SystemUserCollection.GetSystemUserById(reviewPanelOrder.ScreenedById).Signature;
                    string reviewedByFinal = YellowstonePathology.Business.Helper.DateTimeExtensions.DateStringFromNullable(reviewPanelOrder.AcceptedDate);

                    if (reviewedBy.IndexOf("MD") >= 0)
                    {
                        this.AddNextNteElement("Interpreted By: " + reviewedBy + " " + reviewedByFinal, document);
                    }
                    else
                    {
                        this.AddNextNteElement("Reviewed By: " + reviewedBy + " " + reviewedByFinal, document);
                    }
                    this.AddBlankNteElement(document);
                }
            }

            this.AddAmendments(document, womensHealthProfileTestOrder, this.m_AccessionOrder);

            this.AddNextNteElement("CURRENT MOLECULAR TEST SUMMARY", document);

            YellowstonePathology.Business.Test.HPV.HPVTest                 panelSetHPV         = new YellowstonePathology.Business.Test.HPV.HPVTest();
            YellowstonePathology.Business.Test.HPV1618.HPV1618Test         panelSetHPV1618     = new YellowstonePathology.Business.Test.HPV1618.HPV1618Test();
            YellowstonePathology.Business.Test.NGCT.NGCTTest               panelSetNGCT        = new YellowstonePathology.Business.Test.NGCT.NGCTTest();
            YellowstonePathology.Business.Test.Trichomonas.TrichomonasTest panelSetTrichomonas = new YellowstonePathology.Business.Test.Trichomonas.TrichomonasTest();

            if (this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetHPV.PanelSetId) == false &&
                this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetHPV1618.PanelSetId) == false &&
                this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetNGCT.PanelSetId) == false &&
                this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetTrichomonas.PanelSetId) == false)
            {
                this.AddNextNteElement("No tests performed ", document);
                this.AddBlankNteElement(document);
            }
            else
            {
                if (this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetHPV.PanelSetId) == true)
                {
                    YellowstonePathology.Business.Test.HPV.HPVTestOrder hpvTestOrder = (YellowstonePathology.Business.Test.HPV.HPVTestOrder) this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetHPV.PanelSetId);
                    this.AddNextNteElement("High Risk HPV: " + hpvTestOrder.Result, document);
                    this.AddNextNteElement("Reference: Negative", document);
                    string hpvFinal = YellowstonePathology.Business.Helper.DateTimeExtensions.DateAndTimeStringFromNullable(hpvTestOrder.FinalTime);
                    this.AddNextNteElement("Date Finalized: " + hpvFinal, document);
                    this.AddBlankNteElement(document);
                }

                if (this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetHPV1618.PanelSetId) == true)
                {
                    YellowstonePathology.Business.Test.HPV1618.PanelSetOrderHPV1618 panelSetOrderHPV1618 = (YellowstonePathology.Business.Test.HPV1618.PanelSetOrderHPV1618) this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetHPV1618.PanelSetId);
                    this.AddNextNteElement("HPV type 16: " + panelSetOrderHPV1618.HPV16Result, document);
                    this.AddNextNteElement("Reference: Negative", document);

                    this.AddNextNteElement("HPV type 18: " + panelSetOrderHPV1618.HPV18Result, document);
                    this.AddNextNteElement("Reference: Negative", document);
                    string hpvFinal = YellowstonePathology.Business.Helper.DateTimeExtensions.DateAndTimeStringFromNullable(panelSetOrderHPV1618.FinalTime);
                    this.AddNextNteElement("Date Finalized: " + hpvFinal, document);
                    this.AddBlankNteElement(document);
                }

                if (this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetNGCT.PanelSetId) == true)
                {
                    this.AddNextNteElement("Chlamydia Gonorrhea Screening ", document);
                    YellowstonePathology.Business.Test.NGCT.NGCTTestOrder panelSetOrderNGCT = (YellowstonePathology.Business.Test.NGCT.NGCTTestOrder) this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetNGCT.PanelSetId);
                    this.AddNextNteElement("Chlamydia trachomatis: " + panelSetOrderNGCT.ChlamydiaTrachomatisResult, document);
                    this.AddNextNteElement("Reference: Negative", document);

                    this.AddNextNteElement("Neisseria gonorrhoeae: " + panelSetOrderNGCT.NeisseriaGonorrhoeaeResult, document);
                    this.AddNextNteElement("Reference: Negative", document);
                    string hpvFinal = YellowstonePathology.Business.Helper.DateTimeExtensions.DateAndTimeStringFromNullable(panelSetOrderNGCT.FinalTime);
                    this.AddNextNteElement("Date Finalized: " + hpvFinal, document);
                    this.AddBlankNteElement(document);
                }

                if (this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetTrichomonas.PanelSetId) == true)
                {
                    this.AddNextNteElement("Trichomonas Screening ", document);
                    YellowstonePathology.Business.Test.Trichomonas.TrichomonasTestOrder reportOrderTrichomonas = (YellowstonePathology.Business.Test.Trichomonas.TrichomonasTestOrder) this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetTrichomonas.PanelSetId);
                    this.AddNextNteElement("Trichomonas vaginalis: " + reportOrderTrichomonas.Result, document);
                    this.AddNextNteElement("Reference: Negative", document);
                    string hpvFinal = YellowstonePathology.Business.Helper.DateTimeExtensions.DateAndTimeStringFromNullable(reportOrderTrichomonas.FinalTime);
                    this.AddNextNteElement("Date Finalized: " + hpvFinal, document);
                    this.AddBlankNteElement(document);
                }
            }

            this.AddNextNteElement("Specimen Description: Thin Prep Fluid", document);
            this.AddNextNteElement("Specimen Source: " + this.m_AccessionOrder.SpecimenOrderCollection[0].SpecimenSource, document);
            string collectionDateTimeString = this.m_AccessionOrder.SpecimenOrderCollection[0].GetCollectionDateTimeString();

            this.AddNextNteElement("Collection Date/Time: " + collectionDateTimeString, document);
            this.AddBlankNteElement(document);

            this.AddNextNteElement("Clinical History: ", document);
            this.HandleLongString(this.m_AccessionOrder.ClinicalHistory, document);
            this.AddBlankNteElement(document);

            this.AddNextNteElement("Method: ", document);
            this.HandleLongString(womensHealthProfileResult.Method, document);
            this.AddBlankNteElement(document);

            this.AddNextNteElement("References: ", document);
            this.HandleLongString(womensHealthProfileResult.References, document);
            this.AddBlankNteElement(document);

            string locationPerformed = womensHealthProfileTestOrder.GetLocationPerformedComment();

            this.HandleLongString(locationPerformed, document);
            this.AddNextNteElement(string.Empty, document);

            this.AddNextNteElement("PRIOR PAP AND GYN MOLECULAR TESTS", document);
            YellowstonePathology.Business.Test.ThinPrepPap.ThinPrepPapTest panelSetThinPrepPap = new YellowstonePathology.Business.Test.ThinPrepPap.ThinPrepPapTest();
            DateTime cutoffDate = this.m_AccessionOrder.AccessionDate.Value.AddYears(-5);

            YellowstonePathology.Business.Domain.PatientHistory patientHistory         = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetPatientHistory(this.m_AccessionOrder.PatientId);
            YellowstonePathology.Business.Domain.PatientHistory priorPapRelatedHistory = patientHistory.GetPriorPapRelatedHistory(this.m_AccessionOrder.MasterAccessionNo, cutoffDate);

            if (priorPapRelatedHistory.Count == 0)
            {
                this.AddNextNteElement("No prior tests performed ", document);
                this.AddBlankNteElement(document);
            }
            else
            {
                foreach (YellowstonePathology.Business.Domain.PatientHistoryResult patientHistoryResult in priorPapRelatedHistory)
                {
                    YellowstonePathology.Business.Test.AccessionOrder patientHistoryAccessionOrder = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.GetAccessionOrderByMasterAccessionNo(patientHistoryResult.MasterAccessionNo);
                    foreach (YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder in patientHistoryAccessionOrder.PanelSetOrderCollection)
                    {
                        string reportNo = null;
                        string result   = null;

                        if (panelSetOrder.PanelSetId == panelSetThinPrepPap.PanelSetId ||
                            panelSetOrder.PanelSetId == panelSetHPV.PanelSetId ||
                            panelSetOrder.PanelSetId == panelSetHPV1618.PanelSetId ||
                            panelSetOrder.PanelSetId == panelSetNGCT.PanelSetId ||
                            panelSetOrder.PanelSetId == panelSetTrichomonas.PanelSetId)
                        {
                            reportNo = panelSetOrder.ReportNo;
                            string finaldate = YellowstonePathology.Business.Helper.DateTimeExtensions.DateStringFromNullable(panelSetOrder.FinalDate);
                            result = panelSetOrder.GetResultWithTestName();
                            this.AddNextNteElement("Test: " + panelSetOrder.PanelSetName + " Report No: " + reportNo + " Result: " + result + " Final Date: " + finaldate, document);
                            this.AddBlankNteElement(document);
                        }
                    }
                }
            }
            this.AddBlankNteElement(document);

            string disclaimer = "This Pap test is only a screening test. A negative result does not definitively rule out the presence of disease. Women should, therefore, in consultation with their physician, have this test performed at mutually agreed intervals.";

            this.AddNextNteElement(disclaimer, document);
            this.AddBlankNteElement(document);
        }
        public override void ToXml(XElement document)
        {
            WomensHealthProfileTestOrder womensHealthProfileTestOrder = (WomensHealthProfileTestOrder)this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(this.m_ReportNo);
            WomensHealthProfileResult    womensHealthProfileResult    = new WomensHealthProfileResult(this.m_AccessionOrder);

            YellowstonePathology.Business.Amendment.Model.AmendmentCollection amendmentCollection = this.m_AccessionOrder.AmendmentCollection.GetAmendmentsForReport(this.m_ReportNo);

            ThinPrepPap.ThinPrepPapTest thinPrepPapTest = new ThinPrepPap.ThinPrepPapTest();
            bool hasPap = this.m_AccessionOrder.PanelSetOrderCollection.Exists(thinPrepPapTest.PanelSetId);

            this.AddNextObxElementBeaker("Report No: ", this.m_ReportNo, document, "F");

            if (hasPap == true)
            {
                StringBuilder papTest = new StringBuilder();

                YellowstonePathology.Business.Test.ThinPrepPap.PanelSetOrderCytology panelSetOrderCytology = (YellowstonePathology.Business.Test.ThinPrepPap.PanelSetOrderCytology) this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(15);
                if (string.IsNullOrEmpty(panelSetOrderCytology.ScreeningImpression) == false)
                {
                    papTest.AppendLine("Epithelial Cell Description: " + panelSetOrderCytology.ScreeningImpression);
                }

                papTest.AppendLine("Specimen Adequacy: " + panelSetOrderCytology.SpecimenAdequacy);

                if (string.IsNullOrEmpty(panelSetOrderCytology.OtherConditions) == false)
                {
                    papTest.AppendLine("Other Conditions: " + panelSetOrderCytology.OtherConditions);
                }

                if (string.IsNullOrEmpty(panelSetOrderCytology.ReportComment) == false)
                {
                    papTest.AppendLine("Comment: " + panelSetOrderCytology.ReportComment);
                }

                YellowstonePathology.Business.Test.ThinPrepPap.PanelOrderCytology screeningPanelOrder = null;
                YellowstonePathology.Business.Test.ThinPrepPap.PanelOrderCytology reviewPanelOrder    = null;

                foreach (YellowstonePathology.Business.Interface.IPanelOrder panelOrder in panelSetOrderCytology.PanelOrders)
                {
                    Type objectType = panelOrder.GetType();
                    if (typeof(YellowstonePathology.Business.Test.ThinPrepPap.PanelOrderCytology).IsAssignableFrom(objectType) == true)
                    {
                        YellowstonePathology.Business.Test.ThinPrepPap.PanelOrderCytology cytologyPanelOrder = (YellowstonePathology.Business.Test.ThinPrepPap.PanelOrderCytology)panelOrder;
                        if (cytologyPanelOrder.PanelId == 38)
                        {
                            if (cytologyPanelOrder.ScreeningType == "Primary Screening")
                            {
                                screeningPanelOrder = cytologyPanelOrder;
                            }
                            else if (cytologyPanelOrder.ScreeningType == "Pathologist Review")
                            {
                                reviewPanelOrder = cytologyPanelOrder;
                            }
                            else if (cytologyPanelOrder.ScreeningType == "Cytotech Review")
                            {
                                if (reviewPanelOrder == null || reviewPanelOrder.ScreeningType != "Pathologist Review")
                                {
                                    reviewPanelOrder = cytologyPanelOrder;
                                }
                            }
                        }
                    }
                }

                YellowstonePathology.Business.User.SystemUser systemUser = YellowstonePathology.Business.User.SystemUserCollectionInstance.Instance.SystemUserCollection.GetSystemUserById(screeningPanelOrder.ScreenedById);
                if (string.IsNullOrEmpty(systemUser.Signature) == false)
                {
                    papTest.AppendLine("Screened By: " + systemUser.Signature);
                }

                string cytoTechFinal = YellowstonePathology.Business.Helper.DateTimeExtensions.DateStringFromNullable(screeningPanelOrder.AcceptedDate);
                papTest.AppendLine("E-Signed " + cytoTechFinal);

                if (reviewPanelOrder != null)
                {
                    string reviewedBy      = YellowstonePathology.Business.User.SystemUserCollectionInstance.Instance.SystemUserCollection.GetSystemUserById(reviewPanelOrder.ScreenedById).Signature;
                    string reviewedByFinal = YellowstonePathology.Business.Helper.DateTimeExtensions.DateStringFromNullable(reviewPanelOrder.AcceptedDate);

                    if (reviewedBy.IndexOf("MD") >= 0)
                    {
                        papTest.AppendLine("Interpreted By: " + reviewedBy + " " + reviewedByFinal);
                    }
                    else
                    {
                        papTest.AppendLine("Reviewed By: " + reviewedBy + " " + reviewedByFinal);
                    }
                }
                this.AddNextObxElementBeaker("PAP TEST RESULT: ", papTest.ToString(), document, "F");
            }

            if (amendmentCollection.Count != 0)
            {
                StringBuilder amendments = new StringBuilder();
                foreach (YellowstonePathology.Business.Amendment.Model.Amendment amendment in amendmentCollection)
                {
                    if (amendment.Final == true)
                    {
                        amendments.AppendLine(amendment.AmendmentType + ": " + amendment.AmendmentDate.Value.ToString("MM/dd/yyyy"));
                        amendments.AppendLine(amendment.Text);
                        if (amendment.RequirePathologistSignature == true)
                        {
                            amendments.AppendLine("Signature: " + amendment.PathologistSignature);
                            amendments.AppendLine("E-signed " + amendment.FinalTime.Value.ToString("MM/dd/yyyy HH:mm"));
                        }
                    }
                }
                amendments.AppendLine();
                this.AddNextObxElementBeaker("Amendments", amendments.ToString(), document, "F");
            }

            StringBuilder testsPerformed = new StringBuilder();

            YellowstonePathology.Business.Test.HPV.HPVTest                 panelSetHPV         = new YellowstonePathology.Business.Test.HPV.HPVTest();
            YellowstonePathology.Business.Test.HPV1618.HPV1618Test         panelSetHPV1618     = new YellowstonePathology.Business.Test.HPV1618.HPV1618Test();
            YellowstonePathology.Business.Test.NGCT.NGCTTest               panelSetNGCT        = new YellowstonePathology.Business.Test.NGCT.NGCTTest();
            YellowstonePathology.Business.Test.Trichomonas.TrichomonasTest panelSetTrichomonas = new YellowstonePathology.Business.Test.Trichomonas.TrichomonasTest();

            if (this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetHPV.PanelSetId) == false &&
                this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetHPV1618.PanelSetId) == false &&
                this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetNGCT.PanelSetId) == false &&
                this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetTrichomonas.PanelSetId) == false)
            {
                testsPerformed.AppendLine("No tests performed");
            }
            else
            {
                if (this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetHPV.PanelSetId) == true)
                {
                    YellowstonePathology.Business.Test.HPV.HPVTestOrder hpvTestOrder = (YellowstonePathology.Business.Test.HPV.HPVTestOrder) this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetHPV.PanelSetId);
                    testsPerformed.AppendLine("High Risk HPV: " + hpvTestOrder.Result);
                    testsPerformed.AppendLine("Reference: Negative");
                    string hpvFinal = YellowstonePathology.Business.Helper.DateTimeExtensions.DateStringFromNullable(hpvTestOrder.FinalDate);
                    testsPerformed.AppendLine("Date Finalized: " + hpvFinal);
                }

                if (this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetHPV1618.PanelSetId) == true)
                {
                    YellowstonePathology.Business.Test.HPV1618.PanelSetOrderHPV1618 panelSetOrderHPV1618 = (YellowstonePathology.Business.Test.HPV1618.PanelSetOrderHPV1618) this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetHPV1618.PanelSetId);
                    testsPerformed.AppendLine("HPV type 16: " + panelSetOrderHPV1618.HPV16Result);
                    testsPerformed.AppendLine("Reference: Negative");

                    testsPerformed.AppendLine("HPV type 18: " + panelSetOrderHPV1618.HPV18Result);
                    testsPerformed.AppendLine("Reference: Negative");
                    string hpvFinal = YellowstonePathology.Business.Helper.DateTimeExtensions.DateStringFromNullable(panelSetOrderHPV1618.FinalDate);
                    testsPerformed.AppendLine("Date Finalized: " + hpvFinal);
                }

                if (this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetNGCT.PanelSetId) == true)
                {
                    //testsPerformed.AppendLine("Chlamydia Gonorrhea Screening");
                    YellowstonePathology.Business.Test.NGCT.NGCTTestOrder panelSetOrderNGCT = (YellowstonePathology.Business.Test.NGCT.NGCTTestOrder) this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetNGCT.PanelSetId);
                    testsPerformed.AppendLine("Chlamydia trachomatis: " + panelSetOrderNGCT.ChlamydiaTrachomatisResult);
                    testsPerformed.AppendLine("Reference: Negative");

                    testsPerformed.AppendLine("Neisseria gonorrhoeae: " + panelSetOrderNGCT.NeisseriaGonorrhoeaeResult);
                    testsPerformed.AppendLine("Reference: Negative");
                    string hpvFinal = YellowstonePathology.Business.Helper.DateTimeExtensions.DateStringFromNullable(panelSetOrderNGCT.FinalDate);
                    testsPerformed.AppendLine("Date Finalized: " + hpvFinal);
                }

                if (this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetTrichomonas.PanelSetId) == true)
                {
                    //testsPerformed.AppendLine("Trichomonas Screening");
                    YellowstonePathology.Business.Test.Trichomonas.TrichomonasTestOrder reportOrderTrichomonas = (YellowstonePathology.Business.Test.Trichomonas.TrichomonasTestOrder) this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetTrichomonas.PanelSetId);
                    testsPerformed.AppendLine("Trichomonas vaginalis: " + reportOrderTrichomonas.Result);
                    testsPerformed.AppendLine("Reference: Negative");
                    string hpvFinal = YellowstonePathology.Business.Helper.DateTimeExtensions.DateStringFromNullable(reportOrderTrichomonas.FinalDate);
                    testsPerformed.AppendLine("Date Finalized: " + hpvFinal);
                }
            }
            this.AddNextObxElementBeaker("CURRENT MOLECULAR TEST SUMMARY", testsPerformed.ToString(), document, "F");

            this.AddNextObxElementBeaker("Specimen Description: ", "Thin Prep Fluid", document, "F");
            this.AddNextObxElementBeaker("Specimen Source: ", this.m_AccessionOrder.SpecimenOrderCollection[0].SpecimenSource, document, "F");
            string collectionDateTimeString = this.m_AccessionOrder.SpecimenOrderCollection[0].GetCollectionDateTimeString();

            this.AddNextObxElementBeaker("Collection Date/Time: ", collectionDateTimeString, document, "F");

            this.AddNextObxElementBeaker("Clinical History: ", this.m_AccessionOrder.ClinicalHistory, document, "F");

            this.AddNextObxElementBeaker("Method: ", womensHealthProfileResult.Method, document, "F");

            this.AddNextObxElementBeaker("References: ", womensHealthProfileResult.References, document, "F");

            string locationPerformed = womensHealthProfileTestOrder.GetLocationPerformedComment();

            this.AddNextObxElementBeaker("Location Performed: ", locationPerformed, document, "F");

            StringBuilder priorTests = new StringBuilder();

            YellowstonePathology.Business.Test.ThinPrepPap.ThinPrepPapTest panelSetThinPrepPap = new YellowstonePathology.Business.Test.ThinPrepPap.ThinPrepPapTest();
            DateTime cutoffDate = this.m_AccessionOrder.AccessionDate.Value.AddYears(-5);

            YellowstonePathology.Business.Domain.PatientHistory patientHistory         = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetPatientHistory(this.m_AccessionOrder.PatientId);
            YellowstonePathology.Business.Domain.PatientHistory priorPapRelatedHistory = patientHistory.GetPriorPapRelatedHistory(this.m_AccessionOrder.MasterAccessionNo, cutoffDate);

            if (priorPapRelatedHistory.Count == 0)
            {
                priorTests.AppendLine("No prior tests performed");
            }
            else
            {
                foreach (YellowstonePathology.Business.Domain.PatientHistoryResult patientHistoryResult in priorPapRelatedHistory)
                {
                    YellowstonePathology.Business.Test.AccessionOrder accessionOrder = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.GetAccessionOrderByMasterAccessionNo(patientHistoryResult.MasterAccessionNo);
                    foreach (YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder in accessionOrder.PanelSetOrderCollection)
                    {
                        string reportNo = null;
                        string result   = null;

                        if (panelSetOrder.PanelSetId == panelSetThinPrepPap.PanelSetId ||
                            panelSetOrder.PanelSetId == panelSetHPV.PanelSetId ||
                            panelSetOrder.PanelSetId == panelSetHPV1618.PanelSetId ||
                            panelSetOrder.PanelSetId == panelSetNGCT.PanelSetId ||
                            panelSetOrder.PanelSetId == panelSetTrichomonas.PanelSetId)
                        {
                            reportNo = panelSetOrder.ReportNo;
                            string finaldate = YellowstonePathology.Business.Helper.DateTimeExtensions.DateStringFromNullable(panelSetOrder.FinalDate);
                            result = panelSetOrder.GetResultWithTestName();
                            priorTests.AppendLine("Test: " + panelSetOrder.PanelSetName + " Report No: " + reportNo + " Result: " + result + " Final Date: " + finaldate);
                        }
                    }
                }
            }
            this.AddNextObxElementBeaker("PRIOR PAP AND GYN MOLECULAR TESTS", priorTests.ToString(), document, "F");
        }
Ejemplo n.º 14
0
        private void SetCurrentMolecularResults()
        {
            XmlNode mainTableNode  = this.m_ReportXml.SelectSingleNode("descendant::w:tbl[w:tr/w:tc/w:p/w:r/w:t='molecular_test']", this.m_NameSpaceManager);
            XmlNode rowTestNode    = mainTableNode.SelectSingleNode("descendant::w:tr[w:tc/w:p/w:r/w:t='molecular_test']", this.m_NameSpaceManager);
            XmlNode rowResultNode  = mainTableNode.SelectSingleNode("descendant::w:tr[w:tc/w:p/w:r/w:t='test_result']", this.m_NameSpaceManager);
            XmlNode rowBlankRow    = mainTableNode.SelectSingleNode("descendant::w:tr[w:tc/w:p/w:r/w:t='blank_row']", this.m_NameSpaceManager);
            XmlNode insertAfterRow = rowBlankRow;

            string headerText = "High Risk HPV Testing";

            YellowstonePathology.Business.Test.HPV.HPVTest panelSetHPV = new YellowstonePathology.Business.Test.HPV.HPVTest();
            if (this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetHPV.PanelSetId) == true)
            {
                YellowstonePathology.Business.Test.HPV.HPVTestOrder hpvTestOrder = (YellowstonePathology.Business.Test.HPV.HPVTestOrder) this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetHPV.PanelSetId);
                XmlNode rowTestNodeClone = rowTestNode.Clone();
                rowTestNodeClone.SelectSingleNode("descendant::w:r[w:t='molecular_test']/w:t", this.m_NameSpaceManager).InnerText = headerText;
                mainTableNode.InsertAfter(rowTestNodeClone, insertAfterRow);
                insertAfterRow = rowTestNodeClone;

                XmlNode rowResultNodeClone = rowResultNode.Clone();
                rowResultNodeClone.SelectSingleNode("descendant::w:r[w:t='test_name']/w:t", this.m_NameSpaceManager).InnerText      = "High Risk HPV";
                rowResultNodeClone.SelectSingleNode("descendant::w:r[w:t='test_result']/w:t", this.m_NameSpaceManager).InnerText    = hpvTestOrder.Result;
                rowResultNodeClone.SelectSingleNode("descendant::w:r[w:t='test_reference']/w:t", this.m_NameSpaceManager).InnerText = "Negative";
                string testFinaldate = YellowstonePathology.Business.Helper.DateTimeExtensions.DateStringFromNullable(hpvTestOrder.FinalDate);
                rowResultNodeClone.SelectSingleNode("descendant::w:r[w:t='test_final_date']/w:t", this.m_NameSpaceManager).InnerText = testFinaldate;
                mainTableNode.InsertAfter(rowResultNodeClone, insertAfterRow);
                insertAfterRow = rowResultNodeClone;

                XmlNode rowBlankRowClone = rowBlankRow.Clone();
                rowBlankRowClone.SelectSingleNode("descendant::w:r[w:t='blank_row']/w:t", this.m_NameSpaceManager).InnerText = string.Empty;
                mainTableNode.InsertAfter(rowBlankRowClone, insertAfterRow);
                insertAfterRow = rowBlankRowClone;
            }

            headerText = "HPV Genotyping";
            YellowstonePathology.Business.Test.HPV1618.HPV1618Test panelSetHPV1618 = new YellowstonePathology.Business.Test.HPV1618.HPV1618Test();
            if (this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetHPV1618.PanelSetId) == true)
            {
                YellowstonePathology.Business.Test.HPV1618.PanelSetOrderHPV1618 panelSetOrderHPV1618 = (YellowstonePathology.Business.Test.HPV1618.PanelSetOrderHPV1618) this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetHPV1618.PanelSetId);
                XmlNode rowTestNodeClone = rowTestNode.Clone();
                rowTestNodeClone.SelectSingleNode("descendant::w:r[w:t='molecular_test']/w:t", this.m_NameSpaceManager).InnerText = headerText;
                mainTableNode.InsertAfter(rowTestNodeClone, insertAfterRow);
                insertAfterRow = rowTestNodeClone;

                XmlNode rowResultNode16Clone = rowResultNode.Clone();
                rowResultNode16Clone.SelectSingleNode("descendant::w:r[w:t='test_name']/w:t", this.m_NameSpaceManager).InnerText      = "HPV type 16";
                rowResultNode16Clone.SelectSingleNode("descendant::w:r[w:t='test_result']/w:t", this.m_NameSpaceManager).InnerText    = panelSetOrderHPV1618.HPV16Result;
                rowResultNode16Clone.SelectSingleNode("descendant::w:r[w:t='test_reference']/w:t", this.m_NameSpaceManager).InnerText = "Negative";
                string testFinaldate = YellowstonePathology.Business.Helper.DateTimeExtensions.DateStringFromNullable(panelSetOrderHPV1618.FinalDate);
                rowResultNode16Clone.SelectSingleNode("descendant::w:r[w:t='test_final_date']/w:t", this.m_NameSpaceManager).InnerText = testFinaldate;
                mainTableNode.InsertAfter(rowResultNode16Clone, insertAfterRow);
                insertAfterRow = rowResultNode16Clone;

                XmlNode rowResultNode18Clone = rowResultNode.Clone();
                rowResultNode18Clone.SelectSingleNode("descendant::w:r[w:t='test_name']/w:t", this.m_NameSpaceManager).InnerText       = "HPV type 18";
                rowResultNode18Clone.SelectSingleNode("descendant::w:r[w:t='test_result']/w:t", this.m_NameSpaceManager).InnerText     = panelSetOrderHPV1618.HPV18Result;
                rowResultNode18Clone.SelectSingleNode("descendant::w:r[w:t='test_reference']/w:t", this.m_NameSpaceManager).InnerText  = "Negative";
                rowResultNode18Clone.SelectSingleNode("descendant::w:r[w:t='test_final_date']/w:t", this.m_NameSpaceManager).InnerText = string.Empty;
                mainTableNode.InsertAfter(rowResultNode18Clone, insertAfterRow);
                insertAfterRow = rowResultNode18Clone;

                XmlNode rowBlankRowClone = rowBlankRow.Clone();
                rowBlankRowClone.SelectSingleNode("descendant::w:r[w:t='blank_row']/w:t", this.m_NameSpaceManager).InnerText = string.Empty;
                mainTableNode.InsertAfter(rowBlankRowClone, insertAfterRow);
                insertAfterRow = rowBlankRowClone;
            }

            headerText = "Chlamydia Gonorrhea Screening";
            YellowstonePathology.Business.Test.NGCT.NGCTTest panelSetNGCT = new YellowstonePathology.Business.Test.NGCT.NGCTTest();
            if (this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetNGCT.PanelSetId) == true)
            {
                YellowstonePathology.Business.Test.NGCT.NGCTTestOrder panelSetOrderNGCT = (YellowstonePathology.Business.Test.NGCT.NGCTTestOrder) this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetNGCT.PanelSetId);
                this.SetXmlNodeData("chlamydia_gonorrhea_screening", string.Empty);
                this.SetXmlNodeData("ct_result", panelSetOrderNGCT.ChlamydiaTrachomatisResult);
                this.SetXmlNodeData("ng_result", panelSetOrderNGCT.NeisseriaGonorrhoeaeResult);
                string hpvFinaldate = YellowstonePathology.Business.Helper.DateTimeExtensions.DateStringFromNullable(panelSetOrderNGCT.FinalDate);
                this.SetXmlNodeData("ngct_final_date", hpvFinaldate);


                XmlNode rowTestNodeClone = rowTestNode.Clone();
                rowTestNodeClone.SelectSingleNode("descendant::w:r[w:t='molecular_test']/w:t", this.m_NameSpaceManager).InnerText = headerText;
                mainTableNode.InsertAfter(rowTestNodeClone, insertAfterRow);
                insertAfterRow = rowTestNodeClone;

                XmlNode rowResultNodeCtClone = rowResultNode.Clone();
                rowResultNodeCtClone.SelectSingleNode("descendant::w:r[w:t='test_name']/w:t", this.m_NameSpaceManager).InnerText      = "Chlamydia trachomatis";
                rowResultNodeCtClone.SelectSingleNode("descendant::w:r[w:t='test_result']/w:t", this.m_NameSpaceManager).InnerText    = panelSetOrderNGCT.ChlamydiaTrachomatisResult;
                rowResultNodeCtClone.SelectSingleNode("descendant::w:r[w:t='test_reference']/w:t", this.m_NameSpaceManager).InnerText = "Negative";
                string testFinaldate = YellowstonePathology.Business.Helper.DateTimeExtensions.DateStringFromNullable(panelSetOrderNGCT.FinalDate);
                rowResultNodeCtClone.SelectSingleNode("descendant::w:r[w:t='test_final_date']/w:t", this.m_NameSpaceManager).InnerText = testFinaldate;
                mainTableNode.InsertAfter(rowResultNodeCtClone, insertAfterRow);
                insertAfterRow = rowResultNodeCtClone;

                XmlNode rowResultNodeNgClone = rowResultNode.Clone();
                rowResultNodeNgClone.SelectSingleNode("descendant::w:r[w:t='test_name']/w:t", this.m_NameSpaceManager).InnerText       = "Neisseria gonorrhoeae";
                rowResultNodeNgClone.SelectSingleNode("descendant::w:r[w:t='test_result']/w:t", this.m_NameSpaceManager).InnerText     = panelSetOrderNGCT.NeisseriaGonorrhoeaeResult;
                rowResultNodeNgClone.SelectSingleNode("descendant::w:r[w:t='test_reference']/w:t", this.m_NameSpaceManager).InnerText  = "Negative";
                rowResultNodeNgClone.SelectSingleNode("descendant::w:r[w:t='test_final_date']/w:t", this.m_NameSpaceManager).InnerText = string.Empty;
                mainTableNode.InsertAfter(rowResultNodeNgClone, insertAfterRow);
                insertAfterRow = rowResultNodeNgClone;

                XmlNode rowBlankRowClone = rowBlankRow.Clone();
                rowBlankRowClone.SelectSingleNode("descendant::w:r[w:t='blank_row']/w:t", this.m_NameSpaceManager).InnerText = string.Empty;
                mainTableNode.InsertAfter(rowBlankRowClone, insertAfterRow);
                insertAfterRow = rowBlankRowClone;
            }

            headerText = "Trichomonas Screening";
            YellowstonePathology.Business.Test.Trichomonas.TrichomonasTest panelSetTrichomonas = new YellowstonePathology.Business.Test.Trichomonas.TrichomonasTest();
            if (this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetTrichomonas.PanelSetId) == true)
            {
                YellowstonePathology.Business.Test.Trichomonas.TrichomonasTestOrder reportOrderTrichomonas = (YellowstonePathology.Business.Test.Trichomonas.TrichomonasTestOrder) this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetTrichomonas.PanelSetId);
                XmlNode rowTestNodeClone = rowTestNode.Clone();
                rowTestNodeClone.SelectSingleNode("descendant::w:r[w:t='molecular_test']/w:t", this.m_NameSpaceManager).InnerText = headerText;
                mainTableNode.InsertAfter(rowTestNodeClone, insertAfterRow);
                insertAfterRow = rowTestNodeClone;

                XmlNode rowResultNodeClone = rowResultNode.Clone();
                rowResultNodeClone.SelectSingleNode("descendant::w:r[w:t='test_name']/w:t", this.m_NameSpaceManager).InnerText      = "Trichomonas vaginalis";
                rowResultNodeClone.SelectSingleNode("descendant::w:r[w:t='test_result']/w:t", this.m_NameSpaceManager).InnerText    = reportOrderTrichomonas.Result;
                rowResultNodeClone.SelectSingleNode("descendant::w:r[w:t='test_reference']/w:t", this.m_NameSpaceManager).InnerText = "Negative";
                string testFinaldate = YellowstonePathology.Business.Helper.DateTimeExtensions.DateStringFromNullable(reportOrderTrichomonas.FinalDate);
                rowResultNodeClone.SelectSingleNode("descendant::w:r[w:t='test_final_date']/w:t", this.m_NameSpaceManager).InnerText = testFinaldate;
                mainTableNode.InsertAfter(rowResultNodeClone, insertAfterRow);
                insertAfterRow = rowResultNodeClone;
            }

            if (this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetHPV.PanelSetId) == false &&
                this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetHPV1618.PanelSetId) == false &&
                this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetNGCT.PanelSetId) == false &&
                this.m_AccessionOrder.PanelSetOrderCollection.Exists(panelSetTrichomonas.PanelSetId) == false)
            {
                rowResultNode.SelectSingleNode("descendant::w:r[w:t='test_name']/w:t", this.m_NameSpaceManager).InnerText       = "No tests performed";
                rowResultNode.SelectSingleNode("descendant::w:r[w:t='test_reference']/w:t", this.m_NameSpaceManager).InnerText  = string.Empty;
                rowResultNode.SelectSingleNode("descendant::w:r[w:t='test_result']/w:t", this.m_NameSpaceManager).InnerText     = string.Empty;
                rowResultNode.SelectSingleNode("descendant::w:r[w:t='test_final_date']/w:t", this.m_NameSpaceManager).InnerText = string.Empty;
            }
            else
            {
                this.DeleteRow("test_result");
            }

            this.DeleteRow("molecular_test");
            this.DeleteRow("blank_row");
        }