Пример #1
0
        public LockRequestPage(Business.Test.AccessionOrder accessionOrder)
        {
            this.m_AccessionOrder = accessionOrder;
            this.m_DisplayMessage = "Ask " + accessionOrder.AccessionLock.Address + " for the lock on " + accessionOrder.MasterAccessionNo + ".";

            InitializeComponent();
            DataContext = this;
        }
Пример #2
0
 public LockRequestSentPage(Business.Test.AccessionOrder accessionOrder)
 {
     this.m_AccessionOrder = accessionOrder;
     this.m_Message = "A requesst for " + this.m_AccessionOrder.MasterAccessionNo + " was sent.";
     MessageQueues.Instance.ResponseReceived += MessageQueues_ResponseReceived;
     InitializeComponent();
     DataContext = this;
     this.StartCountDownTimer();
 }
Пример #3
0
        public EPICFT1ResultView(Business.Test.AccessionOrder accessionOrder, Business.Test.PanelSetOrderCPTCodeBill panelSetOrderCPTCodeBill, bool testing)
        {
            this.m_Testing = testing;
            this.m_AccessionOrder = accessionOrder;
            this.m_PanelSetOrderCPTCodeBill = panelSetOrderCPTCodeBill;

            this.m_CptCode = Business.Billing.Model.CptCodeCollection.Instance.GetCptCode(this.m_PanelSetOrderCPTCodeBill.CPTCode);
            this.m_OrderingPhysician = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetPhysicianByPhysicianId(this.m_AccessionOrder.PhysicianId);
        }
Пример #4
0
        public CaseReportV2(Business.Test.AccessionOrder accessionOrder, Business.Test.PanelSetOrder panelSetOrder, YellowstonePathology.Business.Document.ReportSaveModeEnum reportSaveMode)
        {
            this.m_AccessionOrder = accessionOrder;
            this.m_PanelSetOrder = panelSetOrder;
            this.m_ReportSaveMode = reportSaveMode;

            this.m_ReportXml = new XmlDocument();
            this.m_NativeDocumentFormat = NativeDocumentFormatEnum.Word;
            this.m_NameSpaceManager = new XmlNamespaceManager(m_ReportXml.NameTable);
            this.m_NameSpaceManager.AddNamespace("w", "http://schemas.microsoft.com/office/word/2003/wordml");
        }
        public AcidWashResultDialog(string masterAccessionNo, string reportNo)
        {
            this.m_AccessionOrder = Business.Persistence.DocumentGateway.Instance.PullAccessionOrder(masterAccessionNo, this);
            Business.Test.ThinPrepPap.ThinPrepPapAcidWashPanel thinPrepPapAcidWashPanel = new Business.Test.ThinPrepPap.ThinPrepPapAcidWashPanel();
            this.m_PanelOrderAcidWash = (Business.Test.ThinPrepPap.PanelOrderAcidWash)this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(reportNo).PanelOrderCollection.GetPanelByPanelId(thinPrepPapAcidWashPanel.PanelId);
            this.m_HeaderText = "Results for " + this.m_AccessionOrder.PatientDisplayName;

            InitializeComponent();

            DataContext = this;
            this.Closing += AcidWashResultDialog_Closing;
        }
Пример #6
0
        public BaseReport(Business.Test.AccessionOrder accessionOrder, Business.Test.PanelSetOrder panelSetOrder, YellowstonePathology.Business.Document.ReportSaveModeEnum reportSaveMode)
        {
            this.m_AccessionOrder = accessionOrder;
            this.m_PanelSetOrder = panelSetOrder;
            this.m_ReportSaveMode = reportSaveMode;

            this.m_SqlStatements = new ArrayList();
            this.m_TableNames = new ArrayList();
            this.m_Data = new YellowstonePathology.Business.Document.Old.DataClasses.BaseData();
            this.m_ReportXml = new XmlDocument();
            this.m_NameSpaceManager = new XmlNamespaceManager(m_ReportXml.NameTable);
            this.m_NameSpaceManager.AddNamespace("w", "http://schemas.microsoft.com/office/word/2003/wordml");
        }
Пример #7
0
        public ECWResultView(string reportNo, Business.Test.AccessionOrder accessionOrder, bool testing)
        {
            this.m_AccessionOrder = accessionOrder;
            this.m_PanelSetOrder  = this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(reportNo);
            this.m_Testing        = testing;

            this.m_PanelSetOrder = this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(reportNo);

            if (this.m_AccessionOrder.UniversalServiceId.ToUpper() != this.m_PanelSetOrder.UniversalServiceId.ToUpper())
            {
                this.m_SendUnsolicited = true;
            }

            this.m_OrderingPhysician = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetPhysicianByPhysicianId(this.m_AccessionOrder.PhysicianId);
        }
Пример #8
0
        public static void SerializePanelSetOrderCPTCodeBill(Business.Test.AccessionOrder ao, string reportNo, string fileName)
        {
            JsonSerializer serializer = new JsonSerializer();

            serializer.Converters.Add(new Newtonsoft.Json.Converters.JavaScriptDateTimeConverter());
            serializer.NullValueHandling  = NullValueHandling.Include;
            serializer.DateFormatHandling = DateFormatHandling.MicrosoftDateFormat;

            using (System.IO.StreamWriter sw = new System.IO.StreamWriter(fileName))
                using (JsonWriter writer = new JsonTextWriter(sw))
                {
                    Business.Test.PanelSetOrder pso = ao.PanelSetOrderCollection.GetPanelSetOrder(reportNo);
                    serializer.Serialize(writer, pso.PanelSetOrderCPTCodeBillCollection);
                }
        }
        public PreviousResultDialog(Business.Test.PanelSetOrder panelSetOrder, Business.Test.AccessionOrder accessionOrder)
        {
            this.m_PanelSetOrder  = panelSetOrder;
            this.m_AccessionOrder = accessionOrder;

            this.m_TableName = Business.Persistence.PersistenceHelper.GetTableName(panelSetOrder.GetType());

            Business.Gateway.PreviousResultGateway previousResultGateway = new Business.Gateway.PreviousResultGateway();
            this.m_PreviousResultCollection = previousResultGateway.GetPreviousResultsByTestFinal(this.m_PanelSetOrder.PanelSetId, DateTime.Today.AddDays(-90), DateTime.Today, this.m_TableName);

            InitializeComponent();
            DataContext = this;

            this.Left = (SystemParameters.PrimaryScreenWidth / 2);
            this.Top  = (SystemParameters.PrimaryScreenHeight / 2) - (this.Height / 2);
        }
Пример #10
0
        private void HyperLinkFindAccessionOrder_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(this.m_MasterAccessionNo) == false)
            {
                this.m_AccessionOrder = null;
                this.m_CaseDocuments  = null;

                this.m_AccessionOrder = Business.Persistence.DocumentGateway.Instance.PullAccessionOrder(this.m_MasterAccessionNo, this);
                Business.OrderIdParser orderIdParser = new Business.OrderIdParser(this.m_MasterAccessionNo);
                string casePath = YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser);
                this.m_CaseDocuments = System.IO.Directory.GetFiles(casePath).ToList <string>();

                this.NotifyPropertyChanged("AccessionOrder");
                this.NotifyPropertyChanged("CaseDocuments");
            }
        }
Пример #11
0
        private void ShowLockRequestSentPage(Business.Test.AccessionOrder accessionOrder)
        {
            LockRequestSentPage lockRequestSentPage = null;

            if (this.m_PageNavigatorWasPassedIn == true)
            {
                lockRequestSentPage = new LockRequestSentPage(accessionOrder.AccessionLock.Address, accessionOrder.MasterAccessionNo, System.Windows.Visibility.Collapsed, System.Windows.Visibility.Visible);
            }
            else
            {
                lockRequestSentPage = new LockRequestSentPage(accessionOrder.AccessionLock.Address, accessionOrder.MasterAccessionNo, System.Windows.Visibility.Visible, System.Windows.Visibility.Collapsed);
            }

            lockRequestSentPage.Nevermind += LockRequestSentPage_Nevermind;
            this.m_PageNavigator.Navigate(lockRequestSentPage);
        }
        private void MenuItemSendVentanaOrder_Click(object sender, RoutedEventArgs e)
        {
            MenuItem menuItem = (MenuItem)sender;
            XElement xElement = XElement.Parse(menuItem.Tag.ToString());

            string slideOrderId = xElement.Element("SlideOrderId").Value;

            Business.OrderIdParser orderIdParser = new Business.OrderIdParser(slideOrderId);

            Business.Test.AccessionOrder       ao         = Business.Persistence.DocumentGateway.Instance.GetAccessionOrderByMasterAccessionNo(orderIdParser.MasterAccessionNo);
            Business.Slide.Model.SlideOrder    slideOrder = ao.SpecimenOrderCollection.GetSlideOrder(slideOrderId);
            Business.HL7View.VentanaStainOrder vo         = new Business.HL7View.VentanaStainOrder();
            vo.HandleOrder(ao, slideOrder);

            MessageBox.Show("The order has been sent.");
        }
Пример #13
0
        public KRASStandardReflexResult(string reportNo, Business.Test.AccessionOrder accessionOrder)
        {
            this.m_AccessionOrder = accessionOrder;

            this.m_KRASStandardReflexTest      = new KRASStandardReflexTest();
            this.m_KRASStandardReflexTestOrder = (YellowstonePathology.Business.Test.KRASStandardReflex.KRASStandardReflexTestOrder) this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(reportNo);

            this.m_KRASStandardTest      = new KRASStandard.KRASStandardTest();
            this.m_KRASStandardTestOrder = (YellowstonePathology.Business.Test.KRASStandard.KRASStandardTestOrder) this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(this.m_KRASStandardTest.PanelSetId, this.m_KRASStandardReflexTestOrder.OrderedOnId, true);

            this.m_BRAFV600EKTest      = new BRAFV600EK.BRAFV600EKTest();
            this.m_BRAFV600EKTestOrder = (YellowstonePathology.Business.Test.BRAFV600EK.BRAFV600EKTestOrder) this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(this.m_BRAFV600EKTest.PanelSetId, this.m_KRASStandardReflexTestOrder.OrderedOn, true);

            this.m_References = "1. Amado RG, Wolf M, Peeters M, et al. Wild-type KRAS is required for panitumumab efficacy in patients with metastatic colorectal cancer. J Clin Oncol. 2008; 26(10): 1626-1634.  " +
                                "2. Benvenuti S, Sartore-Bianchi A, Di Nicolantonio F, et al. Oncogenic activation of the RAS/RAF signaling pathway impairs the response of metastatic colorectal cancers to anti-epidermal growth factor receptor antibody therapies. Cancer Res. 2007; 67(6): 2643-2648.";
        }
Пример #14
0
        private void ContextMenuDeleteReview_Click(object sender, RoutedEventArgs e)
        {
            if (this.ListViewReviews.SelectedItems.Count != 0)
            {
                foreach (UI.RetrospectiveReviewListItem item in this.ListViewReviews.SelectedItems)
                {
                    Business.Test.AccessionOrder ao  = Business.Persistence.DocumentGateway.Instance.PullAccessionOrder(item.MasterAccessionNo, this);
                    Business.Test.PanelSetOrder  pso = ao.PanelSetOrderCollection.GetPanelSetOrder(item.ReportNo);
                    ao.PanelSetOrderCollection.Remove(pso);
                    Business.Persistence.DocumentGateway.Instance.Push(this);
                }

                this.m_RetrospectiveReviewList = YellowstonePathology.Business.Gateway.ReportSearchGateway.GetRetrospectiveReviews(this.m_WorkDate);
                this.NotifyPropertyChanged("RetrospectiveReviewList");
            }
        }
Пример #15
0
 public void SetLockIsAquiredByMe(Business.Test.AccessionOrder accessionOrder)
 {
     foreach (ReportSearchItem item in this)
     {
         if (item.MasterAccessionNo == accessionOrder.MasterAccessionNo)
         {
             item.LockAquired       = accessionOrder.LockAquired;
             item.IsLockAquiredByMe = accessionOrder.IsLockAquiredByMe;
         }
         else
         {
             item.IsLockAquiredByMe = false;
             item.LockAquired       = false;
         }
     }
 }
Пример #16
0
        private void ButtonMatch_Click(object sender, RoutedEventArgs e)
        {
            if (this.ListViewAccession.SelectedItem != null)
            {
                if (this.ListViewADT.SelectedItem != null)
                {
                    Business.Billing.Model.AccessionListItem aoItem = (Business.Billing.Model.AccessionListItem) this.ListViewAccession.SelectedItem;
                    Business.Test.AccessionOrder             ao     = Business.Persistence.DocumentGateway.Instance.PullAccessionOrder(aoItem.MasterAccessionNo, this);
                    Business.Test.PanelSetOrder pso = ao.PanelSetOrderCollection.GetPanelSetOrder(aoItem.ReportNo);

                    Business.Billing.Model.ADTListItem adtItem = (Business.Billing.Model.ADTListItem) this.ListViewADT.SelectedItem;
                    if (adtItem.MedicalRecord.StartsWith("V") == true)
                    {
                        foreach (Business.Test.PanelSetOrderCPTCodeBill psocb in pso.PanelSetOrderCPTCodeBillCollection)
                        {
                            if (psocb.BillTo == "Client")
                            {
                                psocb.MedicalRecord = adtItem.MedicalRecord;
                                psocb.Account       = adtItem.Account;
                            }

                            if (psocb.PostDate.HasValue == false)
                            {
                                psocb.PostDate = this.m_PostDate;
                            }
                        }

                        Business.Persistence.DocumentGateway.Instance.Push(ao, this);
                        this.m_AccessionList = Business.Gateway.AccessionOrderGateway.GetSVHNotPosted();
                        this.m_ADTList       = new List <Business.Billing.Model.ADTListItem>();
                        this.NotifyPropertyChanged(string.Empty);
                    }
                    else
                    {
                        MessageBox.Show("The MRN does not start with a V.");
                    }
                }
                else
                {
                    MessageBox.Show("You must first select an ADT item to Match.");
                }
            }
            else
            {
                MessageBox.Show("You must first select and Accession Order to Match.");
            }
        }
        public override bool IsRequired(Business.Test.AccessionOrder accessionOrder)
        {
            bool result = false;

            YellowstonePathology.Business.Test.HPV.HPVTest         panelSetHPV     = new YellowstonePathology.Business.Test.HPV.HPVTest();
            YellowstonePathology.Business.Test.HPV1618.HPV1618Test panelSetHPV1618 = new YellowstonePathology.Business.Test.HPV1618.HPV1618Test();

            if (accessionOrder.PanelSetOrderCollection.Exists(panelSetHPV.PanelSetId) == true)
            {
                YellowstonePathology.Business.Test.HPV.HPVTestOrder hpvTestOrder = (YellowstonePathology.Business.Test.HPV.HPVTestOrder)accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetHPV.PanelSetId);
                if (hpvTestOrder.ResultCode == YellowstonePathology.Business.Test.HPV.HPVResult.OveralResultCodePositive)
                {
                    result = true;
                }
            }
            return(result);
        }
Пример #18
0
        public void MatchAccessionOrdersToADT(object sender, System.ComponentModel.DoWorkEventArgs e)
        {
            this.m_BackgroundWorker.ReportProgress(1, "Starting matching SVH ADT: " + DateTime.Now.ToLongTimeString());
            List <Business.Billing.Model.AccessionListItem> accessionList = Business.Gateway.AccessionOrderGateway.GetSVHNotPosted();

            foreach (Business.Billing.Model.AccessionListItem accessionListItem in accessionList)
            {
                this.m_BackgroundWorker.ReportProgress(1, "Looking for a match for: " + accessionListItem.MasterAccessionNo);

                Business.ClientOrder.Model.ClientOrderCollection clientOrdersNeedingRegistration = Business.Gateway.ClientOrderGateway.GetClientOrdersByMasterAccessionNo(accessionListItem.MasterAccessionNo);
                Business.ClientOrder.Model.ClientOrder           clientOrderNeedingRegistration  = clientOrdersNeedingRegistration[0];

                Business.ClientOrder.Model.ClientOrderCollection possibleNewClientOrders = Business.Gateway.ClientOrderGateway.GetClientOrdersByPatientName(accessionListItem.PFirstName, accessionListItem.PLastName);
                foreach (Business.ClientOrder.Model.ClientOrder clientOrder in possibleNewClientOrders)
                {
                    if (clientOrder.OrderDate > clientOrderNeedingRegistration.OrderDate &&
                        clientOrder.PBirthdate == clientOrderNeedingRegistration.PBirthdate &&
                        clientOrder.ProviderName == "ANGELA DURDEN" &&
                        clientOrder.SvhMedicalRecord.StartsWith("V"))
                    {
                        Business.Test.AccessionOrder ao  = Business.Persistence.DocumentGateway.Instance.PullAccessionOrder(accessionListItem.MasterAccessionNo, this);
                        Business.Test.PanelSetOrder  pso = ao.PanelSetOrderCollection.GetPanelSetOrder(accessionListItem.ReportNo);

                        foreach (Business.Test.PanelSetOrderCPTCodeBill psocb in pso.PanelSetOrderCPTCodeBillCollection)
                        {
                            this.m_BackgroundWorker.ReportProgress(1, "Found a match for: " + accessionListItem.MasterAccessionNo);
                            if (psocb.BillTo == "Client")
                            {
                                psocb.MedicalRecord = clientOrder.SvhMedicalRecord;
                                psocb.Account       = clientOrder.SvhAccountNo;
                            }

                            if (psocb.PostDate.HasValue == false)
                            {
                                psocb.PostDate = this.m_PostDate;
                            }
                        }

                        Business.Persistence.DocumentGateway.Instance.Push(ao, this);
                        break;
                    }
                }
            }
            this.m_BackgroundWorker.ReportProgress(1, "Completed SVH ADT Matching: " + DateTime.Now.ToLongTimeString());
            Business.Gateway.BillingGateway.UpdateBillingEODProcess(this.m_PostDate, "ADTMatch");
        }
        public LockRequestReceivedPage(Business.Test.AccessionOrder accessionOrder, AccessionLockMessage message)
        {
            this.m_CurrentCountDown    = 7;
            this.m_AccessionOrder      = accessionOrder;
            this.m_Message             = message;
            this.m_DisplayMessage      = this.m_Message.From + " is asking for the lock on " + this.m_Message.MasterAccessionNo + ".";
            this.m_StopTimerOnNextTick = false;

            System.Windows.Threading.DispatcherTimer dispatchTimer = new System.Windows.Threading.DispatcherTimer();
            dispatchTimer.Interval = new TimeSpan(0, 0, 1);
            dispatchTimer.Tick    += DispatchTimer_Tick;
            dispatchTimer.Start();

            InitializeComponent();

            DataContext = this;
        }
Пример #20
0
        private void AddRandomTest(DateTime workDate)
        {
            List <int> exclusionList = new List <int>();

            exclusionList.Add(262);
            exclusionList.Add(197);

            Business.Search.ReportSearchList list = YellowstonePathology.Business.Gateway.ReportSearchGateway.GetPossibleRetrospectiveReviews(workDate);
            if (list.Count != 0)
            {
                int count = list.Count;

                double tenPercentOfCount = Math.Round((count * .1), 0);

                Random rnd = new Random();
                int    i   = 0;
                while (true)
                {
                    int    nextRnd = rnd.Next(0, count - 1);
                    string nextMasterAccessionNo = list[nextRnd].MasterAccessionNo;

                    Business.Test.AccessionOrder ao = Business.Persistence.DocumentGateway.Instance.PullAccessionOrder(nextMasterAccessionNo, this);

                    if (ao.PanelSetOrderCollection.HasPanelSetBeenOrdered(exclusionList) == false)
                    {
                        YellowstonePathology.Business.Test.RetrospectiveReview.RetrospectiveReviewTest retrospectiveReviewTest = new YellowstonePathology.Business.Test.RetrospectiveReview.RetrospectiveReviewTest();
                        YellowstonePathology.Business.Test.TestOrderInfo            testOrderInfo         = new Business.Test.TestOrderInfo(retrospectiveReviewTest, null, false);
                        YellowstonePathology.Business.Visitor.OrderTestOrderVisitor orderTestOrderVisitor = new Business.Visitor.OrderTestOrderVisitor(testOrderInfo);
                        ao.TakeATrip(orderTestOrderVisitor);
                        Business.Test.PanelSetOrder pso = ao.PanelSetOrderCollection.GetPanelSetOrder(262);
                        pso.AssignedToId = 0;
                    }

                    i += 1;
                    if (i == tenPercentOfCount)
                    {
                        Business.Persistence.DocumentGateway.Instance.Push(this);
                        break;
                    }
                }
            }
            else
            {
                MessageBox.Show("There are no cases to choose from for this day.");
            }
        }
Пример #21
0
        public override bool IsRequired(Business.Test.AccessionOrder accessionOrder)
        {
            bool result = false;

            YellowstonePathology.Business.Test.ThinPrepPap.ThinPrepPapTest panelSetThinPrep = new YellowstonePathology.Business.Test.ThinPrepPap.ThinPrepPapTest();
            if (accessionOrder.PanelSetOrderCollection.Exists(panelSetThinPrep.PanelSetId) == true)
            {
                YellowstonePathology.Business.Test.ThinPrepPap.PanelSetOrderCytology panelSetOrderCytology = (YellowstonePathology.Business.Test.ThinPrepPap.PanelSetOrderCytology)accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetThinPrep.PanelSetId);
                if (panelSetOrderCytology.Final == true)
                {
                    if (YellowstonePathology.Business.Cytology.Model.CytologyResultCode.IsDiagnosisASCUS(panelSetOrderCytology.ResultCode) == true)
                    {
                        result = true;
                    }
                }
            }
            return(result);
        }
Пример #22
0
        public override bool IsRequired(Business.Test.AccessionOrder accessionOrder)
        {
            bool result = false;
            HPV1618ReflexOrderHPVPositive hpv1618ReflexOrderHPVPositive = new HPV1618ReflexOrderHPVPositive();

            if (hpv1618ReflexOrderHPVPositive.IsRequired(accessionOrder) == true)
            {
                result = true;
            }

            HPV1618ReflexOrderPAPNormalHPVPositive hpv1618ReflexOrderPAPNormalHPVPositive = new HPV1618ReflexOrderPAPNormalHPVPositive();

            if (hpv1618ReflexOrderPAPNormalHPVPositive.IsRequired(accessionOrder) == true)
            {
                result = true;
            }
            return(result);
        }
Пример #23
0
        public override bool IsRequired(Business.Test.AccessionOrder accessionOrder)
        {
            bool result = false;
            HPVReflexOrderRule1 hpvReflexOrderRule1 = new HPVReflexOrderRule1();

            if (hpvReflexOrderRule1.IsRequired(accessionOrder) == true)
            {
                result = true;
            }

            HPVReflexOrderRule10 hpvReflexOrderRule10 = new HPVReflexOrderRule10();

            if (hpvReflexOrderRule10.IsRequired(accessionOrder) == true)
            {
                result = true;
            }
            return(result);
        }
Пример #24
0
        public void HandleMessageReceived(AccessionLockMessage message, Business.Test.AccessionOrder accessionOrder)
        {
            switch (message.MessageId)
            {
            case UI.AppMessaging.AccessionLockMessageIdEnum.ASK:
                HandleASKRecieved(accessionOrder, message);
                break;

            case UI.AppMessaging.AccessionLockMessageIdEnum.HOLD:
                ShowResponseReceivedPage(message);
                break;

            case UI.AppMessaging.AccessionLockMessageIdEnum.GIVE:
                ShowResponseReceivedPage(message);
                RunLockAquiredActionList();
                break;
            }
        }
        public override bool IsRequired(Business.Test.AccessionOrder accessionOrder)
        {
            bool result = false;
            HPVReflexOrderRule5 hpvReflexOrderRule5 = new HPVReflexOrderRule5();

            if (hpvReflexOrderRule5.IsRequired(accessionOrder) == true)
            {
                result = true;
            }

            HPVReflexOrderRule13 hpvReflexOrderRule13 = new HPVReflexOrderRule13();

            if (hpvReflexOrderRule13.IsRequired(accessionOrder) == true)
            {
                result = true;
            }
            return(result);
        }
Пример #26
0
        public WPHResultView(string reportNo, Business.Test.AccessionOrder accessionOrder, bool testing)
        {
            this.m_Testing        = testing;
            this.m_AccessionOrder = accessionOrder;
            this.m_PanelSetOrder  = this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(reportNo);
            YellowstonePathology.Business.ClientOrder.Model.ClientOrderCollection clientOrders = Business.Gateway.ClientOrderGateway.GetClientOrdersByExternalOrderId(this.m_AccessionOrder.ExternalOrderId);
            if (clientOrders.Count > 0)
            {
                this.m_ClientOrder = clientOrders[0];
            }

            if (string.IsNullOrEmpty(this.m_AccessionOrder.IncomingHL7) == true)
            {
                this.m_SendUnsolicited = true;
            }

            this.m_OrderingPhysician  = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetPhysicianByPhysicianId(this.m_AccessionOrder.PhysicianId);
            this.m_SigningPathologist = YellowstonePathology.Business.User.SystemUserCollectionInstance.Instance.SystemUserCollection.GetSystemUserById(this.m_PanelSetOrder.FinaledById);
        }
        private bool DoWordsExist(Business.Test.AccessionOrder ao)
        {
            bool result = false;

            foreach (Business.Specimen.Model.SpecimenOrder specimenOrder in ao.SpecimenOrderCollection)
            {
                foreach (string word in this.m_WordList)
                {
                    if (string.IsNullOrEmpty(specimenOrder.Description) == false)
                    {
                        if (specimenOrder.Description.ToLower().Contains(word.ToLower()))
                        {
                            return(true);
                        }
                    }
                }
            }
            return(result);
        }
Пример #28
0
        public XpsAdditionalTesting(Business.Test.AccessionOrder accessionOrder, Business.Test.PanelSetOrder panelSetOrder)
        {
            this.m_AccessionOrder = accessionOrder;
            this.m_PanelSetOrder  = panelSetOrder;
            Business.OrderIdParser orderIdParser = new OrderIdParser(panelSetOrder.ReportNo);
            this.m_DestinationPath = Business.Document.CaseDocument.GetNotificationDocumentFilePath(orderIdParser);

            this.m_PlaceHolders = new Dictionary <string, string>();
            this.m_PlaceHolders.Add(@"1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,./\-_", string.Empty);
            this.m_PlaceHolders.Add(@"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,-", string.Empty);
            this.m_PlaceHolders.Add("physician_name", this.m_AccessionOrder.PhysicianName);
            this.m_PlaceHolders.Add("client_name", this.m_AccessionOrder.ClientName);
            this.m_PlaceHolders.Add("report_number", this.m_PanelSetOrder.ReportNo);
            this.m_PlaceHolders.Add("accession_date", this.m_AccessionOrder.AccessionDate.ToString());
            this.m_PlaceHolders.Add("collection_date", this.m_AccessionOrder.CollectionDate.ToString());
            this.m_PlaceHolders.Add("patient_name", this.m_AccessionOrder.PatientDisplayName);
            this.m_PlaceHolders.Add("patient_birthdate", this.m_AccessionOrder.PBirthdate.ToString());
            this.m_PlaceHolders.Add("additional_testing", this.m_PanelSetOrder.PanelSetName);
        }
Пример #29
0
        public void HandleOrder(Business.Test.AccessionOrder accessionOrder, YellowstonePathology.Business.Slide.Model.SlideOrder slideOrder)
        {
            if (slideOrder.LabelType == YellowstonePathology.Business.Slide.Model.SlideLabelTypeEnum.PaperLabel.ToString())
            {
                Business.Stain.Model.Stain stain = Business.Stain.Model.StainCollection.Instance.GetStainByTestId(slideOrder.TestId);
                if (slideOrder.PerformedByHand == false || stain.PerformedByHand == false)
                {
                    if (slideOrder.OrderSentToVentana == false)
                    {
                        if (this.CanBuild(accessionOrder, slideOrder.TestOrderId, slideOrder.SlideOrderId) == true)
                        {
                            string result = this.Build(accessionOrder, slideOrder.TestOrderId, slideOrder.SlideOrderId);
                            slideOrder.OrderSentToVentana = true;

                            YellowstonePathology.Business.Test.Model.TestOrder testOrder = accessionOrder.PanelSetOrderCollection.GetTestOrderByTestOrderId(slideOrder.TestOrderId);
                            testOrder.TestStatus           = "CUTTING";
                            testOrder.TestStatusUpdateTime = DateTime.Now;

                            string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();
                            System.IO.File.WriteAllText(@"\\10.1.2.31\ChannelData\Outgoing\Ventana\" + objectId + ".hl7", result);
                        }
                    }
                }
                else
                {
                    YellowstonePathology.Business.Test.Model.TestOrder testOrder = accessionOrder.PanelSetOrderCollection.GetTestOrderByTestOrderId(slideOrder.TestOrderId);
                    testOrder.TestStatus           = "PERFORMEDBYHAND";
                    testOrder.TestStatusUpdateTime = DateTime.Now;
                }

                Business.Label.Model.ZPLPrinterUSB zplPrinterUSB = new Business.Label.Model.ZPLPrinterUSB();
                Business.Label.Model.HistologySlidePaperZPLLabelV1 zplCommand = new Label.Model.HistologySlidePaperZPLLabelV1(slideOrder.SlideOrderId, slideOrder.ReportNo, slideOrder.PatientFirstName, slideOrder.PatientLastName, slideOrder.TestAbbreviation, slideOrder.Label, slideOrder.AccessioningFacility, slideOrder.UseWetProtocol, slideOrder.PerformedByHand);
                zplPrinterUSB.Print(zplCommand);

                slideOrder.Printed       = true;
                slideOrder.PrintedBy     = Business.User.SystemIdentity.Instance.User.UserName;
                slideOrder.PrintedById   = Business.User.SystemIdentity.Instance.User.UserId;
                slideOrder.Status        = "Validated";
                slideOrder.Validated     = true;
                slideOrder.ValidatedBy   = Business.User.SystemIdentity.Instance.User.UserName;
                slideOrder.ValidatedById = Business.User.SystemIdentity.Instance.User.UserId;
            }
        }
        public RetrospectiveReviewReport(DateTime actionDate)
        {
            this.m_ReportNoCollection = new List <string>();
            this.m_WordList           = this.GetWordList();

            DateTime finalDate = actionDate.AddDays(-1);

            if (actionDate.DayOfWeek == DayOfWeek.Monday)
            {
                finalDate = finalDate.AddDays(-3);
            }

            Business.ReportNoCollection finalCases = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetSurgicalFinal(finalDate);
            int    count             = finalCases.Count;
            double tenPercentOfCount = Math.Round((count * .1), 0);

            Random rnd = new Random();
            int    i   = 0;

            while (true)
            {
                int    nextRnd = rnd.Next(0, count - 1);
                string nextMasterAccessionNo = finalCases[nextRnd].MasterAccessionNo;

                Business.Persistence.AODocumentBuilder documentBuilder = new Persistence.AODocumentBuilder(nextMasterAccessionNo, false);
                Business.Test.AccessionOrder           ao = (Business.Test.AccessionOrder)documentBuilder.BuildNew();
                if (DoWordsExist(ao) == true)
                {
                    this.m_ReportNoCollection.Add(finalCases[nextRnd].Value);
                }

                i += 1;
                if (i == 10)
                {
                    break;
                }
            }

            InitializeComponent();
            this.DataContext = this;
        }
Пример #31
0
        public static Business.Rules.MethodResult RemovePanelSet(string reportNo, Business.Test.AccessionOrder accessionOrder, object writer)
        {
            YellowstonePathology.Business.Rules.MethodResult methodResult = new Business.Rules.MethodResult();
            if (accessionOrder.PanelSetOrderCollection.Count > 1)
            {
                Business.Test.PanelSetOrder panelSetOrder = accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(reportNo);

                if ((accessionOrder.PLastName.ToUpper() == "MOUSE" && accessionOrder.PFirstName.ToUpper() == "MICKEY") ||
                    panelSetOrder.Final == false)
                {
                    if (panelSetOrder.PanelSetId == 15)
                    {
                        //delete the thinprep slide;
                        if (accessionOrder.SpecimenOrderCollection.HasThinPrepFluidSpecimen() == true)
                        {
                            Business.Specimen.Model.SpecimenOrder specimenOrder = accessionOrder.SpecimenOrderCollection.GetThinPrep();
                            if (specimenOrder.AliquotOrderCollection.HasThinPrepSlide() == true)
                            {
                                Business.Test.AliquotOrder aliquotOrder = specimenOrder.AliquotOrderCollection.GetThinPrepSlide();
                                specimenOrder.AliquotOrderCollection.Remove(aliquotOrder);
                            }
                        }
                    }

                    accessionOrder.PanelSetOrderCollection.Remove(panelSetOrder);
                    accessionOrder.TaskOrderCollection.RemoveTaskOrdersForDeletedTestOrder(reportNo);
                    YellowstonePathology.Business.Persistence.DocumentGateway.Instance.Push(accessionOrder, writer);
                }
                else
                {
                    methodResult.Success = false;
                    methodResult.Message = "Unable to remove a Panel Set that has been finaled.";
                }
            }
            else
            {
                methodResult.Success = false;
                methodResult.Message = "Unable to remove the only Panel Set for the Accession.";
            }
            return(methodResult);
        }
        private void AOTransferWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            YellowstonePathology.Business.Mongo.Server server = new Business.Mongo.TestServer(YellowstonePathology.Business.Mongo.MongoTestServer.LISDatabaseName);
            MongoCollection mongoCollection = server.Database.GetCollection <BsonDocument>("AccessionOrderCollection");

            DateTime lastTransferredDate = YellowstonePathology.Business.Gateway.AccessionOrderGatewayMongo.GetLastDateTransferred();
            DateTime currentTransferDate = lastTransferredDate.AddDays(1);

            while (true)
            {
                List <Business.MasterAccessionNo> masterAccessionNos = Business.Gateway.AccessionOrderGateway.GetMasterAccessionNoList(currentTransferDate);
                foreach (Business.MasterAccessionNo masterAccessionNo in masterAccessionNos)
                {
                    Business.Test.AccessionOrder ao = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.PullAccessionOrder(masterAccessionNo.Value, Window.GetWindow(this));

                    System.Text.StringBuilder sb = new System.Text.StringBuilder();
                    System.IO.StringWriter    sw = new System.IO.StringWriter(sb);

                    YellowstonePathology.Business.Persistence.JSONObjectStreamWriter.Write(sw, ao);
                    sw.Flush();
                    sw.Close();

                    BsonDocument bsonDocument = BsonDocument.Parse(sb.ToString());
                    mongoCollection.Update(Query.EQ("MasterAccessionNo", ao.MasterAccessionNo), Update.Replace(bsonDocument), UpdateFlags.Upsert);

                    this.m_AOTransferWorker.ReportProgress(0, currentTransferDate.ToShortDateString() + " - " + masterAccessionNo.Value);
                }

                YellowstonePathology.Business.Gateway.AccessionOrderGatewayMongo.InsertLastDateTransferrred(currentTransferDate);
                currentTransferDate = currentTransferDate.AddDays(1);

                if (this.m_AOTransferWorker.CancellationPending == true)
                {
                    break;
                }
                if (currentTransferDate > DateTime.Today)
                {
                    break;
                }
            }
        }
Пример #33
0
        public override bool IsRequired(Business.Test.AccessionOrder accessionOrder)
        {
            bool result = false;

            YellowstonePathology.Business.Test.ThinPrepPap.ThinPrepPapTest panelSetThinPrep = new YellowstonePathology.Business.Test.ThinPrepPap.ThinPrepPapTest();
            if (accessionOrder.PanelSetOrderCollection.Exists(panelSetThinPrep.PanelSetId) == true)
            {
                YellowstonePathology.Business.Test.ThinPrepPap.PanelSetOrderCytology panelSetOrderCytology = (YellowstonePathology.Business.Test.ThinPrepPap.PanelSetOrderCytology)accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetThinPrep.PanelSetId);
                if (panelSetOrderCytology.Final == true)
                {
                    if (accessionOrder.PBirthdate >= DateTime.Today.AddYears(-29) && accessionOrder.PBirthdate <= DateTime.Today.AddYears(-21))
                    {
                        if (YellowstonePathology.Business.Cytology.Model.CytologyResultCode.IsDiagnosisGreaterThanThree(panelSetOrderCytology.ResultCode) == true)
                        {
                            result = true;
                        }
                    }
                }
            }
            return(result);
        }
Пример #34
0
        public void SubscribeToChannel(Business.Test.AccessionOrder accessionOrder)
        {
            Store.RedisServerProd1.Instance.Subscriber.Subscribe(accessionOrder.MasterAccessionNo, (channel, message) =>
            {
                System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Input, new System.Threading.ThreadStart(delegate()
                {
                    UI.AppMessaging.AccessionLockMessage accessionLockMessage = JsonConvert.DeserializeObject <UI.AppMessaging.AccessionLockMessage>(message);

                    if (accessionLockMessage.ToMachineName == System.Environment.MachineName)
                    {
                        if (accessionLockMessage.MessageId == UI.AppMessaging.AccessionLockMessageIdEnum.GIVE)
                        {
                            accessionOrder.AccessionLock.RefreshLock();
                            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.RefreshAccessionOrder(accessionLockMessage.MasterAccessionNo);
                        }
                        UI.AppMessaging.MessagingPath.Instance.HandleMessageReceived(accessionLockMessage, accessionOrder);
                    }
                }
                                                                                                                                                         ));
            });
        }
Пример #35
0
        private void MatchAccessionOrdersToADT(DateTime postDate)
        {
            List <Business.Billing.Model.AccessionListItem> accessionList = Business.Gateway.AccessionOrderGateway.GetSVHNotPosted();

            foreach (Business.Billing.Model.AccessionListItem accessionListItem in accessionList)
            {
                List <Business.Billing.Model.ADTListItem> adtList = Business.Gateway.AccessionOrderGateway.GetADTList(accessionListItem.PFirstName, accessionListItem.PLastName, accessionListItem.PBirthdate.Value);

                foreach (Business.Billing.Model.ADTListItem adtItem in adtList)
                {
                    DateTime received = DateTime.Parse(adtItem.DateReceived.ToShortDateString());
                    int      daysDiff = (int)(postDate - received).TotalDays;
                    if (daysDiff <= 3)
                    {
                        if (adtItem.MedicalRecord.StartsWith("V") == true)
                        {
                            Business.Test.AccessionOrder ao  = Business.Persistence.DocumentGateway.Instance.PullAccessionOrder(accessionListItem.MasterAccessionNo, this);
                            Business.Test.PanelSetOrder  pso = ao.PanelSetOrderCollection.GetPanelSetOrder(accessionListItem.ReportNo);

                            foreach (Business.Test.PanelSetOrderCPTCodeBill psocb in pso.PanelSetOrderCPTCodeBillCollection)
                            {
                                if (psocb.BillTo == "Client")
                                {
                                    psocb.MedicalRecord = adtItem.MedicalRecord;
                                    psocb.Account       = adtItem.Account;
                                }

                                if (psocb.PostDate.HasValue == false)
                                {
                                    psocb.PostDate = this.m_PostDate;
                                }
                            }

                            Business.Persistence.DocumentGateway.Instance.Push(ao, this);
                            break;
                        }
                    }
                }
            }
        }
Пример #36
0
        public override bool IsRequired(Business.Test.AccessionOrder accessionOrder)
        {
            bool result = false;

            YellowstonePathology.Business.Test.ThinPrepPap.ThinPrepPapTest panelSetThinPrep = new YellowstonePathology.Business.Test.ThinPrepPap.ThinPrepPapTest();
            if (accessionOrder.PanelSetOrderCollection.Exists(panelSetThinPrep.PanelSetId) == true)
            {
                YellowstonePathology.Business.Test.ThinPrepPap.PanelSetOrderCytology panelSetOrderCytology = (YellowstonePathology.Business.Test.ThinPrepPap.PanelSetOrderCytology)accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetThinPrep.PanelSetId);
                if (panelSetOrderCytology.Final == true)
                {
                    if (YellowstonePathology.Business.Cytology.Model.CytologyResultCode.IsResultCodeNormal(panelSetOrderCytology.ResultCode) == true ||
                        YellowstonePathology.Business.Cytology.Model.CytologyResultCode.IsResultCodeReactive(panelSetOrderCytology.ResultCode) == true)
                    {
                        if (YellowstonePathology.Business.Cytology.Model.CytologyResultCode.IsResultCodeTZoneAbsent(panelSetOrderCytology.ResultCode) == true)
                        {
                            if (accessionOrder.PBirthdate < DateTime.Today.AddYears(-30))
                            {
                                YellowstonePathology.Business.Domain.PatientHistory patientHistory = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetPatientHistory(accessionOrder.PatientId);
                                Nullable <DateTime> dateOfLastHPV = patientHistory.GetDateOfPreviousHpv(accessionOrder.AccessionDate.Value);

                                if (dateOfLastHPV.HasValue == true)
                                {
                                    if (dateOfLastHPV < DateTime.Today.AddDays(-330))
                                    {
                                        result = true;
                                    }
                                }
                                else
                                {
                                    result = true;
                                }
                            }
                        }
                    }
                }
            }

            return(result);
        }
Пример #37
0
        public LockRequestPage(Business.Test.AccessionOrder accessionOrder)
        {
            this.m_AccessionOrder = accessionOrder;
            this.m_MasterAccessionNo = accessionOrder.MasterAccessionNo;
            this.m_LockAquiredByUserName = accessionOrder.LockAquiredByUserName;
            this.m_LockAquiredByHostName = accessionOrder.LockAquiredByHostName;
            this.m_TimeLockAquired = accessionOrder.TimeLockAquired;

            InitializeComponent();
            DataContext = this;

            if (this.m_AccessionOrder.IsLockAquiredByMe == false)
            {
                this.ButtonRequest.Visibility = Visibility.Visible;
            }
            else
            {
                this.ButtonTakeIt.Visibility = Visibility.Visible;
                this.ButtonHoldYourHorses.Visibility = Visibility.Visible;
            }

            AppMessaging.MessageQueues.Instance.ResponseReceived += Instance_ResponseReceived;
        }
 public AOAccessionLockMessageReturnEventArgs(Business.Test.AccessionOrder accessionOrder, UI.AppMessaging.AccessionLockMessage message)
 {
     this.m_AccessionOrder = accessionOrder;
     this.m_Message = message;
 }
Пример #39
0
 public LockRequestPage(Business.Test.AccessionOrder accessionOrder)
 {
     this.m_AccessionOrder = accessionOrder;
     InitializeComponent();
     DataContext = this;
 }