public bool TryDelete(YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder, YellowstonePathology.Business.Interface.ICaseDocument caseDocument,
                              YellowstonePathology.Business.OrderIdParser orderIdParser)
        {
            bool result = true;

            YellowstonePathology.Business.Rules.MethodResult methodResult = caseDocument.DeleteCaseFiles(orderIdParser);

            if (methodResult.Success == false)
            {
                this.DelayPublishAndDistribution(15, "Not able to delete files prior to publishing.", panelSetOrder);

                this.m_ReportDistributionLogEntryCollection.AddEntry("ERROR", "Publish Next", null, panelSetOrder.ReportNo, panelSetOrder.MasterAccessionNo,
                                                                     null, null, "Not able to delete files prior to publishing.");

                System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage("*****@*****.**", "*****@*****.**", System.Windows.Forms.SystemInformation.UserName, "Not able to delete files prior to publishing: " + panelSetOrder.ReportNo);
                System.Net.Mail.SmtpClient  client  = new System.Net.Mail.SmtpClient("10.1.2.111");

                Uri uri = new Uri("http://tempuri.org/");
                System.Net.ICredentials      credentials = System.Net.CredentialCache.DefaultCredentials;
                System.Net.NetworkCredential credential  = credentials.GetCredential(uri, "Basic");

                client.Credentials = credential;
                client.Send(message);

                result = false;
            }

            return(result);
        }
Exemple #2
0
        private void HandleNotificationEmail(YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder)
        {
            YellowstonePathology.Business.Domain.Physician physician = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetPhysicianByMasterAccessionNo(panelSetOrder.MasterAccessionNo);
            if (physician.SendPublishNotifications == true)
            {
                if (panelSetOrder.Distribute == true)
                {
                    string subject = "You have a result ready for review: " + panelSetOrder.PanelSetName;
                    string body    = "You have a patient report ready. You can review the report by using YPI Connect.  If you don't have access to YPI Connect please call us at (406)238-6360.";

                    System.Net.Mail.MailAddress from = new System.Net.Mail.MailAddress("*****@*****.**");
                    System.Net.Mail.MailAddress to   = new System.Net.Mail.MailAddress(physician.PublishNotificationEmailAddress);
                    System.Net.Mail.MailAddress bcc  = new System.Net.Mail.MailAddress("*****@*****.**");

                    System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(from, to);
                    message.Subject = subject;
                    message.Body    = body;
                    message.Bcc.Add(bcc);

                    System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("10.1.2.111");

                    Uri uri = new Uri("http://tempuri.org/");
                    System.Net.ICredentials      credentials = System.Net.CredentialCache.DefaultCredentials;
                    System.Net.NetworkCredential credential  = credentials.GetCredential(uri, "Basic");

                    client.Credentials = credential;
                    client.Send(message);

                    panelSetOrder.TimeOfLastPublishNotification = DateTime.Now;
                    panelSetOrder.PublishNotificationSent       = true;
                }
            }
        }
Exemple #3
0
        private void ButtonSendNotificationToNeogenomics_Click(object sender, RoutedEventArgs e)
        {
            //[email protected];
            if (this.m_FlowUI.AccessionOrder != null)
            {
                string from    = "*****@*****.**";
                string to      = "*****@*****.**";
                string subject = "Report " + this.m_FlowUI.PanelSetOrderLeukemiaLymphoma.ReportNo + " is ready to be signed out.";
                string body    = "Report " + this.m_FlowUI.PanelSetOrderLeukemiaLymphoma.ReportNo + " is ready to be signed out. You can view this case at: https://www.YellowstonePathology.com/YPIConnect/ClientApplication/Version/2.0.0.0/Pathologist/YellowstonePathology.YpiConnect.Client.application . If you have recently agreed to read this YPI flow case, please reply to this email.";

                System.Net.Mail.MailMessage mailMessage = new System.Net.Mail.MailMessage(from, to, subject, body);
                mailMessage.CC.Add("*****@*****.**");
                mailMessage.CC.Add("*****@*****.**");
                mailMessage.CC.Add("*****@*****.**");

                Uri uri = new Uri("http://tempuri.org/");
                System.Net.ICredentials      credentials = System.Net.CredentialCache.DefaultCredentials;
                System.Net.NetworkCredential credential  = credentials.GetCredential(uri, "Basic");

                System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("10.1.2.111");
                client.Credentials = credential;
                client.Send(mailMessage);

                MessageBox.Show("A link to YPI Connect has been sent to Neogenomics regarding report " + this.m_FlowUI.PanelSetOrderLeukemiaLymphoma.ReportNo);
            }
        }
        private void ButtonClearLock_Click(object sender, RoutedEventArgs e)
        {
            if (this.ListViewLockedAccessionOrders.SelectedItem != null)
            {
                MessageBoxResult result = MessageBox.Show("Clearing a lock may cause data loss.  Are you sure you want to unlock this case?", "Possible data loss", MessageBoxButton.YesNo, MessageBoxImage.Exclamation);
                {
                    if (result == MessageBoxResult.Yes)
                    {
                        foreach (YellowstonePathology.Business.Test.AccessionLock accessionLock in this.ListViewLockedAccessionOrders.SelectedItems)
                        {
                            YellowstonePathology.Business.Test.AccessionOrder accessionOrder = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.PullAccessionOrder(accessionLock.MasterAccessionNo, this);
                            accessionOrder.AccessionLock.ReleaseLock();
                            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.Push(this);

                            System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage("*****@*****.**", "*****@*****.**", System.Windows.Forms.SystemInformation.UserName, "A lock was cleared on case: " + accessionOrder.MasterAccessionNo + " by " + YellowstonePathology.Business.User.SystemIdentity.Instance.User.DisplayName);
                            System.Net.Mail.SmtpClient  client  = new System.Net.Mail.SmtpClient("10.1.2.111");

                            Uri uri = new Uri("http://tempuri.org/");
                            System.Net.ICredentials      credentials = System.Net.CredentialCache.DefaultCredentials;
                            System.Net.NetworkCredential credential  = credentials.GetCredential(uri, "Basic");

                            client.Credentials = credential;
                            client.Send(message);
                        }
                        this.m_AccessionLockCollection.Refresh();
                        this.NotifyPropertyChanged(string.Empty);
                    }
                }
            }
        }
        private void HandleUnsetDistribution()
        {
            List <YellowstonePathology.Business.MasterAccessionNo> caseList = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetCasesWithUnsetDistributions();

            foreach (YellowstonePathology.Business.MasterAccessionNo masterAccessionNo in caseList)
            {
                YellowstonePathology.Business.Test.AccessionOrder accessionOrder = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.PullAccessionOrder(masterAccessionNo.Value, this);

                if (accessionOrder.AccessionLock.IsLockAquiredByMe == true)
                {
                    foreach (YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder in accessionOrder.PanelSetOrderCollection)
                    {
                        if (panelSetOrder.Final == true && panelSetOrder.Distribute == true)
                        {
                            if (panelSetOrder.TestOrderReportDistributionCollection.Count == 0)
                            {
                                YellowstonePathology.Business.Client.Model.PhysicianClientDistributionList physicianClientDistributionCollection = YellowstonePathology.Business.Gateway.ReportDistributionGateway.GetPhysicianClientDistributionCollection(accessionOrder.PhysicianId, accessionOrder.ClientId);
                                bool   canSetDistribution = false;
                                string reason             = "No Distribution Defined";
                                if (physicianClientDistributionCollection.Count != 0)
                                {
                                    YellowstonePathology.Business.Audit.Model.CanSetDistributionAudit canSetDistributionAudit = new Business.Audit.Model.CanSetDistributionAudit(accessionOrder, physicianClientDistributionCollection);
                                    canSetDistributionAudit.Run();
                                    if (canSetDistributionAudit.Status == YellowstonePathology.Business.Audit.Model.AuditStatusEnum.OK)
                                    {
                                        physicianClientDistributionCollection.SetDistribution(panelSetOrder, accessionOrder);
                                        this.m_ReportDistributionLogEntryCollection.AddEntry("INFO", "Handle Unset Distribution", null, panelSetOrder.ReportNo, panelSetOrder.MasterAccessionNo,
                                                                                             accessionOrder.PhysicianName, accessionOrder.ClientName, "Distribution Set");
                                        canSetDistribution = true;
                                    }
                                    else
                                    {
                                        reason = "Missing MRN and/or AccountNo.";
                                    }
                                }
                                if (canSetDistribution == false)
                                {
                                    this.m_ReportDistributionLogEntryCollection.AddEntry("ERROR", "Handle Unset Distribution", null, panelSetOrder.ReportNo, panelSetOrder.MasterAccessionNo,
                                                                                         accessionOrder.PhysicianName, accessionOrder.ClientName, reason);

                                    System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage("*****@*****.**", "*****@*****.**", System.Windows.Forms.SystemInformation.UserName, reason + ": " + panelSetOrder.ReportNo);
                                    System.Net.Mail.SmtpClient  client  = new System.Net.Mail.SmtpClient("10.1.2.111");

                                    Uri uri = new Uri("http://tempuri.org/");
                                    System.Net.ICredentials      credentials = System.Net.CredentialCache.DefaultCredentials;
                                    System.Net.NetworkCredential credential  = credentials.GetCredential(uri, "Basic");

                                    client.Credentials = credential;
                                    client.Send(message);
                                }
                            }
                        }
                    }
                }
            }

            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.Push(this);
        }
Exemple #6
0
        public static void HandleException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
        {
            System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage("*****@*****.**", "*****@*****.**", System.Windows.Forms.SystemInformation.UserName, e.Exception.ToString());
            System.Net.Mail.SmtpClient  client  = new System.Net.Mail.SmtpClient("10.1.2.111");

            Uri uri = new Uri("http://tempuri.org/");

            System.Net.ICredentials      credentials = System.Net.CredentialCache.DefaultCredentials;
            System.Net.NetworkCredential credential  = credentials.GetCredential(uri, "Basic");

            client.Credentials = credential;
            client.Send(message);
        }
Exemple #7
0
        public static void HandleException(string message)
        {
            System.Net.Mail.MailMessage mailMessage = new System.Net.Mail.MailMessage("*****@*****.**", "*****@*****.**", System.Windows.Forms.SystemInformation.UserName, message);
            System.Net.Mail.SmtpClient  client      = new System.Net.Mail.SmtpClient("10.1.2.111");

            Uri uri = new Uri("http://tempuri.org/");

            System.Net.ICredentials      credentials = System.Net.CredentialCache.DefaultCredentials;
            System.Net.NetworkCredential credential  = credentials.GetCredential(uri, "Basic");

            client.Credentials = credential;
            client.Send(mailMessage);
        }
Exemple #8
0
		public void SendNotification(YellowstonePathology.Business.User.SystemUser user)
		{
			string message = this.ToString();
			System.Net.Mail.MailMessage mailMessage = new System.Net.Mail.MailMessage("*****@*****.**", this.NotificationAddress, user.DisplayName + " - Event Notification", message);
			System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("10.1.2.111");

            Uri uri = new Uri("http://tempuri.org/");
            System.Net.ICredentials credentials = System.Net.CredentialCache.DefaultCredentials;
            System.Net.NetworkCredential credential = credentials.GetCredential(uri, "Basic");

            client.Credentials = credential;
			client.Send(mailMessage);
		}
Exemple #9
0
        public static void HandleException(Business.Test.PanelSetOrder panelSetOrder, string errorMessage)
        {
            string message = "ReportNo: " + panelSetOrder.ReportNo + ", Test: " + panelSetOrder.PanelSetName + Environment.NewLine + errorMessage;

            System.Net.Mail.MailMessage mailMessage = new System.Net.Mail.MailMessage("*****@*****.**", "*****@*****.**", System.Windows.Forms.SystemInformation.UserName, message);
            mailMessage.To.Add("*****@*****.**");
            System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("10.1.2.111");

            Uri uri = new Uri("http://tempuri.org/");

            System.Net.ICredentials      credentials = System.Net.CredentialCache.DefaultCredentials;
            System.Net.NetworkCredential credential  = credentials.GetCredential(uri, "Basic");

            client.Credentials = credential;
            client.Send(mailMessage);
        }
Exemple #10
0
        public static void SendMessage(string cptCode)
        {
            StringBuilder messageBody = new StringBuilder();

            messageBody.Append("We are unable to send a charge for CPT Code: " + cptCode + " because we do not have a CDM for it.");

            System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage("*****@*****.**", "*****@*****.**", System.Windows.Forms.SystemInformation.UserName, messageBody.ToString());
            message.To.Add("*****@*****.**");
            message.To.Add("*****@*****.**");
            System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("10.1.2.111");

            Uri uri = new Uri("http://tempuri.org/");

            System.Net.ICredentials      credentials = System.Net.CredentialCache.DefaultCredentials;
            System.Net.NetworkCredential credential  = credentials.GetCredential(uri, "Basic");

            client.Credentials = credential;
            client.Send(message);
        }
Exemple #11
0
        public static int SendMessage()
        {
            StringBuilder messageBody = new StringBuilder();
            int           rowCount    = Business.Gateway.AccessionOrderGateway.GetSVHClinicMessageBody(messageBody);

            System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage("*****@*****.**", "*****@*****.**", System.Windows.Forms.SystemInformation.UserName, messageBody.ToString());
            message.To.Add("*****@*****.**");
            message.To.Add("*****@*****.**");
            System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("10.1.2.111");

            Uri uri = new Uri("http://tempuri.org/");

            System.Net.ICredentials      credentials = System.Net.CredentialCache.DefaultCredentials;
            System.Net.NetworkCredential credential  = credentials.GetCredential(uri, "Basic");

            client.Credentials = credential;
            client.Send(message);
            return(rowCount);
        }
Exemple #12
0
        private void HyperLinkSendEmail_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(this.m_PanelSetOrder.AdditionalTestingEmailAddress) == false)
            {
                if (string.IsNullOrEmpty(this.m_PanelSetOrder.AdditionalTestingEmailMessage) == false)
                {
                    YellowstonePathology.Business.PanelSet.Model.PanelSetCollection panelSetCollection = YellowstonePathology.Business.PanelSet.Model.PanelSetCollection.GetAll();
                    YellowstonePathology.Business.PanelSet.Model.PanelSet           panelSet           = panelSetCollection.GetPanelSet(this.m_PanelSetOrder.PanelSetId);
                    string subject = "Additional Testing has been ordered: " + panelSet.PanelSetName;

                    System.Net.Mail.MailAddress from = new System.Net.Mail.MailAddress("*****@*****.**");
                    System.Net.Mail.MailAddress to   = new System.Net.Mail.MailAddress("*****@*****.**");

                    System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(from, to);
                    message.Subject = subject;
                    message.Body    = this.m_PanelSetOrder.AdditionalTestingEmailMessage;

                    this.m_PanelSetOrder.AdditionalTestingEmailSent     = true;
                    this.m_PanelSetOrder.TimeAdditionalTestingEmailSent = DateTime.Now;
                    this.m_PanelSetOrder.AdditionalTestingEmailSentBy   = YellowstonePathology.Business.User.SystemIdentity.Instance.User.UserName;

                    this.NotifyPropertyChanged(string.Empty);

                    System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("10.1.2.111");

                    Uri uri = new Uri("http://tempuri.org/");
                    System.Net.ICredentials      credentials = System.Net.CredentialCache.DefaultCredentials;
                    System.Net.NetworkCredential credential  = credentials.GetCredential(uri, "Basic");

                    client.Credentials = credential;
                    client.Send(message);
                }
                else
                {
                    MessageBox.Show("The Email may not be sent without a message.", "Missing Message", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                }
            }
            else
            {
                MessageBox.Show("The Email may not be sent without an address.", "Missing Address", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            }
        }
Exemple #13
0
        private void HyperlinkSendEmail_Click(object sender, RoutedEventArgs e)
        {
            if (this.m_MaterialTrackingBatch.ToFacilityId == "YPBZMN")
            {
                if (this.m_MaterialTrackingBatch.MaterialTrackingLogCollection.Count > 0)
                {
                    System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage("*****@*****.**", "*****@*****.**", System.Windows.Forms.SystemInformation.UserName, "There are slides that are being sent to you.");
                    message.To.Add("*****@*****.**");
                    System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("10.1.2.111");

                    Uri uri = new Uri("http://tempuri.org/");
                    System.Net.ICredentials      credentials = System.Net.CredentialCache.DefaultCredentials;
                    System.Net.NetworkCredential credential  = credentials.GetCredential(uri, "Basic");

                    client.Credentials = credential;
                    client.Send(message);
                }
            }
            else
            {
                MessageBox.Show("This function currently only works for Bozeman.");
            }
        }
        private void PublishNext()
        {
            List <YellowstonePathology.Business.Test.PanelSetOrderView> caseList = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetNextCasesToPublish();

            int maxProcessCount = 2;

            if (caseList.Count >= 10)
            {
                maxProcessCount = 10;
            }

            int processCount = 0;

            foreach (YellowstonePathology.Business.Test.PanelSetOrderView view in caseList)
            {
                YellowstonePathology.Business.Test.AccessionOrder accessionOrder = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.PullAccessionOrder(view.MasterAccessionNo, this);
                YellowstonePathology.Business.Test.PanelSetOrder  panelSetOrder  = accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(view.ReportNo);

                if (panelSetOrder.PanelSetId == 116)
                {
                    this.HandleWHP(accessionOrder, panelSetOrder);
                }

                YellowstonePathology.Business.PanelSet.Model.PanelSetCollection panelSetCollection = YellowstonePathology.Business.PanelSet.Model.PanelSetCollection.GetAll();
                YellowstonePathology.Business.PanelSet.Model.PanelSet           panelSet           = panelSetCollection.GetPanelSet(panelSetOrder.PanelSetId);

                YellowstonePathology.Business.Interface.ICaseDocument caseDocument  = YellowstonePathology.Business.Document.DocumentFactory.GetDocument(accessionOrder, panelSetOrder, Business.Document.ReportSaveModeEnum.Normal);
                YellowstonePathology.Business.OrderIdParser           orderIdParser = new YellowstonePathology.Business.OrderIdParser(panelSetOrder.ReportNo);

                if (panelSetOrder.HoldDistribution == false)
                {
                    if (this.TryDelete(panelSetOrder, caseDocument, orderIdParser) == true)
                    {
                        if (this.TryPublish(caseDocument, accessionOrder, panelSetOrder) == true)
                        {
                            if (panelSetOrder.Distribute == true)
                            {
                                foreach (YellowstonePathology.Business.ReportDistribution.Model.TestOrderReportDistribution testOrderReportDistribution in panelSetOrder.TestOrderReportDistributionCollection)
                                {
                                    if (testOrderReportDistribution.Distributed == false)
                                    {
                                        YellowstonePathology.Business.ReportDistribution.Model.DistributionResult distributionResult = this.Distribute(testOrderReportDistribution, accessionOrder, panelSetOrder);
                                        if (distributionResult.IsComplete == true)
                                        {
                                            testOrderReportDistribution.TimeOfLastDistribution    = DateTime.Now;
                                            testOrderReportDistribution.ScheduledDistributionTime = null;
                                            testOrderReportDistribution.Distributed = true;

                                            string testOrderReportDistributionLogId = Guid.NewGuid().ToString();
                                            string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();
                                            YellowstonePathology.Business.ReportDistribution.Model.TestOrderReportDistributionLog testOrderReportDistributionLog = new YellowstonePathology.Business.ReportDistribution.Model.TestOrderReportDistributionLog(testOrderReportDistributionLogId, objectId);
                                            testOrderReportDistributionLog.FromTestOrderReportDistribution(testOrderReportDistribution);
                                            testOrderReportDistributionLog.TimeDistributed = DateTime.Now;
                                            panelSetOrder.TestOrderReportDistributionLogCollection.Add(testOrderReportDistributionLog);

                                            this.m_ReportDistributionLogEntryCollection.AddEntry("INFO", "Publish Next", testOrderReportDistribution.DistributionType, panelSetOrder.ReportNo, panelSetOrder.MasterAccessionNo,
                                                                                                 testOrderReportDistribution.PhysicianName, testOrderReportDistribution.ClientName, "TestOrderReportDistribution Distributed");
                                        }
                                        else
                                        {
                                            testOrderReportDistribution.ScheduledDistributionTime = DateTime.Now.AddMinutes(30);
                                            testOrderReportDistribution.Rescheduled        = true;
                                            testOrderReportDistribution.RescheduledMessage = distributionResult.Message;

                                            this.m_ReportDistributionLogEntryCollection.AddEntry("ERROR", "Publish Next", testOrderReportDistribution.DistributionType, panelSetOrder.ReportNo, panelSetOrder.MasterAccessionNo,
                                                                                                 testOrderReportDistribution.PhysicianName, testOrderReportDistribution.ClientName, distributionResult.Message);

                                            System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage("*****@*****.**", "*****@*****.**", System.Windows.Forms.SystemInformation.UserName, distributionResult.Message);
                                            System.Net.Mail.SmtpClient  client  = new System.Net.Mail.SmtpClient("10.1.2.111");

                                            Uri uri = new Uri("http://tempuri.org/");
                                            System.Net.ICredentials      credentials = System.Net.CredentialCache.DefaultCredentials;
                                            System.Net.NetworkCredential credential  = credentials.GetCredential(uri, "Basic");

                                            client.Credentials = credential;
                                            client.Send(message);
                                        }
                                    }
                                }
                            }

                            panelSetOrder.Published            = true;
                            panelSetOrder.TimeLastPublished    = DateTime.Now;
                            panelSetOrder.ScheduledPublishTime = null;

                            Business.Persistence.DocumentGateway.Instance.Save();
                        }
                    }

                    processCount += 1;
                    if (processCount == maxProcessCount)
                    {
                        break;
                    }
                }
            }

            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.Push(this);
        }