Beispiel #1
0
 public static YellowstonePathology.Business.Rules.MethodResult IsOkToFinal(KRASStandardReflexResult krasStandardReflexResult)
 {
     YellowstonePathology.Business.Rules.MethodResult      result = new YellowstonePathology.Business.Rules.MethodResult();
     YellowstonePathology.Business.Facility.Model.Facility ypi    = YellowstonePathology.Business.Facility.Model.FacilityCollection.Instance.GetByFacilityId("YPIBLGS");
     if (krasStandardReflexResult.KRASStandardReflexTestOrder.Final == false)
     {
         if (krasStandardReflexResult.KRASStandardTestOrder.Final == false)
         {
             result.Success = false;
             result.Message = "This case cannot be finalized because the KRAS Standard Test Order is not final.";
         }
         else if (krasStandardReflexResult.BRAFV600EKTestOrder != null && krasStandardReflexResult.BRAFV600EKTestOrder.Final == false)
         {
             result.Success = false;
             result.Message = "This case cannot be finalized because it the BRAF V600E/K Test Order is not final.";
         }
         else if (krasStandardReflexResult.KRASStandardReflexTestOrder.TechnicalComponentBillingFacilityId == ypi.FacilityId)
         {
             if (string.IsNullOrEmpty(krasStandardReflexResult.KRASStandardReflexTestOrder.TumorNucleiPercentage) == true)
             {
                 result.Success = false;
                 result.Message = "This case cannot be finalized because the Tumor Nuclei Percent is not set.";
             }
         }
     }
     else
     {
         result.Success = false;
         result.Message = "This case cannot be finalized because it is already finalized.";
     }
     return(result);
 }
        public static KRASStandardReflexResult GetResult(string reportNo, YellowstonePathology.Business.Test.AccessionOrder accessionOrder)
        {
            KRASStandardReflexResult result = null;

            YellowstonePathology.Business.Test.KRASStandardReflex.KRASStandardReflexTestOrder krasStandardReflexTestOrder = (YellowstonePathology.Business.Test.KRASStandardReflex.KRASStandardReflexTestOrder)accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(reportNo);

            YellowstonePathology.Business.Test.KRASStandard.KRASStandardTest      krasStandardTest      = new KRASStandard.KRASStandardTest();
            YellowstonePathology.Business.Test.KRASStandard.KRASStandardTestOrder krasStandardTestOrder = (YellowstonePathology.Business.Test.KRASStandard.KRASStandardTestOrder)accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(krasStandardTest.PanelSetId, krasStandardReflexTestOrder.OrderedOnId, true);

            YellowstonePathology.Business.Test.BRAFV600EK.BRAFV600EKTest brafV600EKTest = new BRAFV600EK.BRAFV600EKTest();

            if (accessionOrder.PanelSetOrderCollection.Exists(brafV600EKTest.PanelSetId, krasStandardReflexTestOrder.OrderedOnId, true) == false)
            {
                result = new KRASStandardReflexKRASOnlyResult(reportNo, accessionOrder);
            }
            else
            {
                YellowstonePathology.Business.Test.BRAFV600EK.BRAFV600EKTestOrder             brafV600EKTestOrder           = (YellowstonePathology.Business.Test.BRAFV600EK.BRAFV600EKTestOrder)accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(brafV600EKTest.PanelSetId, krasStandardReflexTestOrder.OrderedOnId, true);
                YellowstonePathology.Business.Test.BRAFV600EK.BRAFV600EKNotDetectedResult     brafV600EKNotDetectedResult   = new BRAFV600EK.BRAFV600EKNotDetectedResult();
                YellowstonePathology.Business.Test.KRASStandard.KRASStandardNotDetectedResult krasStandardNotDetectedResult = new KRASStandard.KRASStandardNotDetectedResult();
                YellowstonePathology.Business.Test.BRAFV600EK.BRAFV600EKDetectedResult        brafV600EKDetectedResult      = new BRAFV600EK.BRAFV600EKDetectedResult();

                if (krasStandardTestOrder.ResultCode == krasStandardNotDetectedResult.ResultCode &&
                    brafV600EKTestOrder.ResultCode == brafV600EKNotDetectedResult.ResultCode)
                {
                    result = new KRASStandardReflexBothNotDetectedResult(reportNo, accessionOrder);
                }
                else if (krasStandardTestOrder.ResultCode == krasStandardNotDetectedResult.ResultCode &&
                         brafV600EKTestOrder.ResultCode == brafV600EKDetectedResult.ResultCode)
                {
                    result = new KRASStandardReflexKRASNotDetecedBRAFDetectedResult(reportNo, accessionOrder);
                }
                else
                {
                    result = new KRASStandardReflexKRASWithBRAFResult(reportNo, accessionOrder);
                }
            }
            return(result);
        }
Beispiel #3
0
        public override void ToXml(XElement document)
        {
            KRASStandardReflexResult krasStandardReflexResult = KRASStandardReflexResultFactory.GetResult(this.m_ReportNo, this.m_AccessionOrder);

            this.AddHeader(document, krasStandardReflexResult.KRASStandardReflexTestOrder, "KRAS with BRAF reflex");
            this.AddNextObxElement("", document, "F");


            string krasResultString = "KRAS Result: " + krasStandardReflexResult.KRASStandardResult;

            if (krasStandardReflexResult.KRASStandardTestOrder.Result == "Detected")
            {
                krasResultString += " " + krasStandardReflexResult.KRASStandardTestOrder.MutationDetected;
            }
            this.AddNextObxElement(krasResultString, document, "F");

            this.AddNextObxElement("BRAF Result: " + krasStandardReflexResult.BRAFV600EKResult, document, "F");
            this.AddNextObxElement(string.Empty, document, "F");

            this.AddNextObxElement("Pathologist: " + krasStandardReflexResult.KRASStandardReflexTestOrder.Signature, document, "F");
            if (krasStandardReflexResult.KRASStandardReflexTestOrder.FinalTime.HasValue == true)
            {
                this.AddNextObxElement("E-signed " + krasStandardReflexResult.KRASStandardReflexTestOrder.FinalTime.Value.ToString("MM/dd/yyyy HH:mm"), document, "F");
            }
            this.AddNextObxElement("", document, "F");
            this.AddAmendments(document);

            this.AddNextObxElement("Specimen Description:", document, "F");
            YellowstonePathology.Business.Specimen.Model.SpecimenOrder specimenOrder = this.m_AccessionOrder.SpecimenOrderCollection.GetSpecimenOrder(krasStandardReflexResult.KRASStandardReflexTestOrder.OrderedOn, krasStandardReflexResult.KRASStandardReflexTestOrder.OrderedOnId);
            this.AddNextObxElement(specimenOrder.Description, document, "F");
            this.AddNextObxElement(string.Empty, document, "F");

            this.HandleLongString("Comment: " + krasStandardReflexResult.KRASStandardReflexTestOrder.Comment, document, "F");
            this.AddNextObxElement("", document, "F");

            this.AddNextObxElement("Indication: " + krasStandardReflexResult.KRASStandardReflexTestOrder.Indication, document, "F");
            this.AddNextObxElement("", document, "F");

            this.AddNextObxElement("Interpretation: ", document, "F");
            this.HandleLongString(krasStandardReflexResult.KRASStandardReflexTestOrder.Interpretation, document, "F");
            this.AddNextObxElement("", document, "F");

            if (krasStandardReflexResult.KRASStandardReflexTestOrder.TumorNucleiPercentage != null)
            {
                this.AddNextObxElement("Tumor Nuclei Percent: ", document, "F");
                this.HandleLongString(krasStandardReflexResult.KRASStandardReflexTestOrder.TumorNucleiPercentage, document, "F");
                this.AddNextObxElement("", document, "F");
            }

            this.AddNextObxElement("Method: ", document, "F");
            this.HandleLongString(krasStandardReflexResult.KRASStandardReflexTestOrder.Method, document, "F");
            this.AddNextObxElement("", document, "F");

            this.AddNextObxElement("References: ", document, "F");
            this.HandleLongString(krasStandardReflexResult.KRASStandardReflexTestOrder.ReportReferences, document, "F");
            this.AddNextObxElement("", document, "F");

            string asr = "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.";

            this.HandleLongString(asr, document, "F");

            string locationPerformed = krasStandardReflexResult.KRASStandardReflexTestOrder.GetLocationPerformedComment();

            this.HandleLongString(locationPerformed, document, "F");
            this.AddNextObxElement(string.Empty, document, "F");
        }
Beispiel #4
0
 public static YellowstonePathology.Business.Rules.MethodResult IsOkToOrderBRAF(KRASStandardReflexResult krasStandardReflexResult)
 {
     YellowstonePathology.Business.Rules.MethodResult result = new Business.Rules.MethodResult();
     if (krasStandardReflexResult.DoesBRAFV600EKExist() == true)
     {
         result.Success = false;
         result.Message = "A BRAF V600E/K cannot be ordered because one already exists.";
     }
     else if (string.IsNullOrEmpty(krasStandardReflexResult.KRASStandardResult) == true)
     {
         result.Success = false;
         result.Message = "A BRAF V600E/K cannot be ordered because the KRAS result is not set.";
     }
     else
     {
         YellowstonePathology.Business.Test.KRASStandard.KRASStandardResultCollection resultCollection = YellowstonePathology.Business.Test.KRASStandard.KRASStandardResultCollection.GetAll();
         YellowstonePathology.Business.Test.KRASStandard.KRASStandardResult           standardResult   = resultCollection.GetResult(krasStandardReflexResult.KRASStandardTestOrder.ResultCode);
         if (standardResult is YellowstonePathology.Business.Test.KRASStandard.KRASStandardDetectedResult)
         {
             result.Success = false;
             result.Message = "A BRAF V600E/K cannot be ordered because the KRAS result shows a mutation has been detected.";
         }
     }
     return(result);
 }
Beispiel #5
0
 public static YellowstonePathology.Business.Rules.MethodResult IsOkToUnFinalize(KRASStandardReflexResult krasStandardReflexResult)
 {
     YellowstonePathology.Business.Rules.MethodResult result = new Business.Rules.MethodResult();
     if (krasStandardReflexResult.KRASStandardTestOrder.Final == false)
     {
         result.Success = false;
         result.Message = "This case cannot be unfinalized because it is not final.";
     }
     return(result);
 }
Beispiel #6
0
        public override void Render()
        {
            KRASStandardReflexResult krasStandardReflexResult = KRASStandardReflexResultFactory.GetResult(this.m_PanelSetOrder.ReportNo, this.m_AccessionOrder);

            this.m_TemplateName = @"\\CFileServer\Documents\ReportTemplates\XmlTemplates\KRASStandardReflex.3.xml";

            base.OpenTemplate();

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


            this.SetXmlNodeData("kras_result", krasStandardReflexResult.KRASStandardResult);
            this.SetXmlNodeData("braf_result", krasStandardReflexResult.BRAFV600EKResult);
            this.SetXmlNodeData("final_date", YellowstonePathology.Business.BaseData.GetShortDateString(this.m_PanelSetOrder.FinalDate));

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

            if (amendmentCollection.Count == 0)
            {
                this.SetXmlNodeData("test_result_header", "Test Result");
            }
            else             // If an amendment exists show as corrected
            {
                this.SetXmlNodeData("test_result_header", "Corrected Test Result");
            }

            //delete the kras_result_detail line if not used
            YellowstonePathology.Business.Test.KRASStandard.KRASStandardNotDetectedResult krasStandardNotDetectedResult = new YellowstonePathology.Business.Test.KRASStandard.KRASStandardNotDetectedResult();
            if (krasStandardReflexResult.KRASStandardResult == krasStandardNotDetectedResult.ResultCode)
            {
                this.DeleteRow("kras_result_detail");
            }

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

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

            this.SetXmlNodeData("date_time_collected", collectionDateTimeString);

            if (string.IsNullOrEmpty(krasStandardReflexResult.KRASStandardReflexTestOrder.Comment) == false)
            {
                this.SetXMLNodeParagraphData("result_comment", krasStandardReflexResult.KRASStandardReflexTestOrder.Comment);
            }
            else
            {
                this.DeleteRow("result_comment");
            }

            this.SetXMLNodeParagraphData("tumor_nuclei_percent", krasStandardReflexResult.KRASStandardReflexTestOrder.TumorNucleiPercentage);
            this.SetXMLNodeParagraphData("report_indication_comment", krasStandardReflexResult.KRASStandardReflexTestOrder.IndicationComment);
            this.SetXMLNodeParagraphData("report_interpretation", krasStandardReflexResult.KRASStandardReflexTestOrder.Interpretation);
            this.SetXMLNodeParagraphData("report_references", krasStandardReflexResult.KRASStandardReflexTestOrder.ReportReferences);
            this.SetXMLNodeParagraphData("report_method", krasStandardReflexResult.KRASStandardReflexTestOrder.Method);
            this.SetXMLNodeParagraphData("report_disclaimer", krasStandardReflexResult.KRASStandardReflexTestOrder.GetLocationPerformedComment());

            this.ReplaceText("report_date", YellowstonePathology.Business.BaseData.GetShortDateString(this.m_PanelSetOrder.FinalDate));
            this.SetXmlNodeData("pathologist_signature", m_PanelSetOrder.Signature);
            this.SaveReport();
        }
 public static YellowstonePathology.Business.Rules.MethodResult IsOkToFinal(KRASStandardReflexResult krasStandardReflexResult)
 {
     YellowstonePathology.Business.Rules.MethodResult result = new YellowstonePathology.Business.Rules.MethodResult();
     YellowstonePathology.Business.Facility.Model.YellowstonePathologyInstituteBillings ypi = new YellowstonePathology.Business.Facility.Model.YellowstonePathologyInstituteBillings();
     if (krasStandardReflexResult.KRASStandardReflexTestOrder.Final == false)
     {
         if (krasStandardReflexResult.KRASStandardTestOrder.Final == false)
         {
                 result.Success = false;
                 result.Message = "This case cannot be finalized because the KRAS Standard Test Order is not final.";
         }
         else if (krasStandardReflexResult.BRAFV600EKTestOrder != null && krasStandardReflexResult.BRAFV600EKTestOrder.Final == false)
         {
             result.Success = false;
             result.Message = "This case cannot be finalized because it the BRAF V600E/K Test Order is not final.";
         }
         else if (krasStandardReflexResult.KRASStandardReflexTestOrder.TechnicalComponentBillingFacilityId == ypi.FacilityId)
         {
             if (string.IsNullOrEmpty(krasStandardReflexResult.KRASStandardReflexTestOrder.TumorNucleiPercentage) == true)
             {
                 result.Success = false;
                 result.Message = "This case cannot be finalized because the Tumor Nuclei Percent is not set.";
             }
         }
     }
     else
     {
         result.Success = false;
         result.Message = "This case cannot be finalized because it is already finalized.";
     }
     return result;
 }
 public static YellowstonePathology.Business.Rules.MethodResult IsOkToUnFinalize(KRASStandardReflexResult krasStandardReflexResult)
 {
     YellowstonePathology.Business.Rules.MethodResult result = new Business.Rules.MethodResult();
     if (krasStandardReflexResult.KRASStandardTestOrder.Final == false)
     {
         result.Success = false;
         result.Message = "This case cannot be unfinalized because it is not final.";
     }
     return result;
 }
 public static YellowstonePathology.Business.Rules.MethodResult IsOkToOrderBRAF(KRASStandardReflexResult krasStandardReflexResult)
 {
     YellowstonePathology.Business.Rules.MethodResult result = new Business.Rules.MethodResult();
     if (krasStandardReflexResult.DoesBRAFV600EKExist() == true)
     {
         result.Success = false;
         result.Message = "A BRAF V600E/K cannot be ordered because one already exists.";
     }
     else if (string.IsNullOrEmpty(krasStandardReflexResult.KRASStandardResult) == true)
     {
         result.Success = false;
         result.Message = "A BRAF V600E/K cannot be ordered because the KRAS result is not set.";
     }
     else
     {
         YellowstonePathology.Business.Test.KRASStandard.KRASStandardResultCollection resultCollection = YellowstonePathology.Business.Test.KRASStandard.KRASStandardResultCollection.GetAll();
         YellowstonePathology.Business.Test.KRASStandard.KRASStandardResult standardResult = resultCollection.GetResult(krasStandardReflexResult.KRASStandardTestOrder.ResultCode);
         if (standardResult is YellowstonePathology.Business.Test.KRASStandard.KRASStandardDetectedResult)
         {
             result.Success = false;
             result.Message = "A BRAF V600E/K cannot be ordered because the KRAS result shows a mutation has been detected.";
         }
     }
     return result;
 }