Example #1
0
        public static YellowstonePathology.Business.Rules.MethodResult AddDailyTaskOrderPOCReport(int weeks)
        {
            YellowstonePathology.Business.Rules.MethodResult       result = new Rules.MethodResult();
            YellowstonePathology.Business.Task.Model.TaskPOCReport task   = new TaskPOCReport();
            DateTime actionDate = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetNewestWeeklyTaskOrderTaskDate(task.TaskId);

            YellowstonePathology.Business.Task.Model.TaskOrderCollection taskOrderCollection = new YellowstonePathology.Business.Task.Model.TaskOrderCollection();
            YellowstonePathology.Business.User.SystemIdentity            systemIdentity      = Business.User.SystemIdentity.Instance;

            DateTime finalDate = actionDate.AddDays(weeks * 7);

            while (actionDate < finalDate)
            {
                string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();

                YellowstonePathology.Business.Task.Model.TaskOrderPOCReport taskOrder = new YellowstonePathology.Business.Task.Model.TaskOrderPOCReport(objectId, actionDate, objectId, systemIdentity);
                taskOrderCollection.Add(taskOrder);

                actionDate = actionDate.AddDays(7);
            }

            actionDate     = actionDate.AddDays(-7);
            result.Message = "Daily Task Order POC Report have been added through " + actionDate.ToString("MM/dd/yyyy");
            return(result);
        }
Example #2
0
        public static YellowstonePathology.Business.Rules.MethodResult AddDailyTaskOrderCytologySlideDisposal(int days)
        {
            YellowstonePathology.Business.Rules.MethodResult result = new Rules.MethodResult();
            YellowstonePathology.Business.Task.Model.TaskCytologySlideDisposal task = new TaskCytologySlideDisposal();
            DateTime actionDate = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetNewestDailyTaskOrderTaskDate(task.TaskId);

            YellowstonePathology.Business.Task.Model.TaskOrderCollection taskOrderCollection = new YellowstonePathology.Business.Task.Model.TaskOrderCollection();
            YellowstonePathology.Business.User.SystemIdentity            systemIdentity      = Business.User.SystemIdentity.Instance;

            DateTime finalDate = actionDate.AddDays(days);

            while (actionDate < finalDate)
            {
                string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();

                YellowstonePathology.Business.Task.Model.TaskOrderCytologySlideDisposal taskOrder = new YellowstonePathology.Business.Task.Model.TaskOrderCytologySlideDisposal(objectId, actionDate, objectId, systemIdentity);
                taskOrderCollection.Add(taskOrder);
                actionDate = actionDate.AddDays(1);
            }

            //YellowstonePathology.Business.Persistence.DocumentGateway.Instance.SubmitChanges(taskOrderCollection, false);

            actionDate     = actionDate.AddDays(-1);
            result.Message = "Daily Task Order Cytology Slide Disposal have been added through " + actionDate.ToString("MM/dd/yyyy");
            return(result);
        }
Example #3
0
        public void GetTasksNotAcknowledged()
        {
            string assignedTo = YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.AcknowledgeTasksFor;

            this.m_TaskOrderCollection = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetTasksNotAcknowledged(assignedTo, YellowstonePathology.Business.Task.Model.TaskAcknowledgementType.Immediate);
            this.NotifyPropertyChanged("TaskOrderCollection");
        }
Example #4
0
        public TaskOrderListPage(YellowstonePathology.Business.Test.AccessionOrder accessionOrder,
                                 string reportNo,
                                 PageNavigationModeEnum pageNavigationMode)
        {
            this.m_AccessionOrder      = accessionOrder;
            this.m_ReportNo            = reportNo;
            this.m_PageNavigationMode  = pageNavigationMode;
            this.m_TaskOrderCollection = accessionOrder.TaskOrderCollection;

            InitializeComponent();

            this.SetButtonVisibility();
            DataContext = this;
        }
        public TaskOrderListPage(YellowstonePathology.Business.Test.AccessionOrder accessionOrder,
			string reportNo,
			PageNavigationModeEnum pageNavigationMode)
        {
            this.m_AccessionOrder = accessionOrder;
            this.m_ReportNo = reportNo;
            this.m_PageNavigationMode = pageNavigationMode;
            this.m_TaskOrderCollection = accessionOrder.TaskOrderCollection;

            InitializeComponent();

            this.SetButtonVisibility();
            DataContext = this;
        }
Example #6
0
        public OrderTestVisitor(string reportNo, YellowstonePathology.Business.Test.Model.Test test, string testOrderComment, string panelOrderComment, bool orderedAsDual,
			YellowstonePathology.Business.Test.AliquotOrder aliquotOrder, bool acknowledgeOnOrder, bool orderAsSlide,
            YellowstonePathology.Business.Task.Model.TaskOrderCollection taskOrderCollection)
            : base(true, true)
        {
            this.m_ReportNo = reportNo;
            this.m_Test = test;
            this.m_OrderedAsDual = orderedAsDual;
            this.m_TestOrderComment = testOrderComment;
            this.m_PanelOrderComment = panelOrderComment;
            this.m_AliquotOrder = aliquotOrder;
            this.m_SystemIdentity = YellowstonePathology.Business.User.SystemIdentity.Instance;
            this.m_AcknowledgeOnOrder = acknowledgeOnOrder;
            this.m_OrderAsSlide = orderAsSlide;
            this.m_TaskOrderCollection = taskOrderCollection;
        }
Example #7
0
 public OrderTestVisitor(string reportNo, YellowstonePathology.Business.Test.Model.Test test, string testOrderComment, string panelOrderComment, bool orderedAsDual,
                         YellowstonePathology.Business.Test.AliquotOrder aliquotOrder, bool acknowledgeOnOrder, bool orderAsSlide,
                         YellowstonePathology.Business.Task.Model.TaskOrderCollection taskOrderCollection)
     : base(true, true)
 {
     this.m_ReportNo            = reportNo;
     this.m_Test                = test;
     this.m_OrderedAsDual       = orderedAsDual;
     this.m_TestOrderComment    = testOrderComment;
     this.m_PanelOrderComment   = panelOrderComment;
     this.m_AliquotOrder        = aliquotOrder;
     this.m_SystemIdentity      = YellowstonePathology.Business.User.SystemIdentity.Instance;
     this.m_AcknowledgeOnOrder  = acknowledgeOnOrder;
     this.m_OrderAsSlide        = orderAsSlide;
     this.m_TaskOrderCollection = taskOrderCollection;
 }
Example #8
0
        private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            string assignedTo = YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.AcknowledgeTasksFor;

            YellowstonePathology.Business.Task.Model.TaskOrderCollection taskOrderCollection = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetTasksNotAcknowledged(assignedTo, YellowstonePathology.Business.Task.Model.TaskAcknowledgementType.Immediate);
            if (taskOrderCollection.Count != 0)
            {
                this.m_WavPlayer.Play();
                this.m_Timer.Interval = ShortIntervalTicks;
                if (this.Alert != null)
                {
                    this.Alert(this, new CustomEventArgs.TaskOrderCollectionReturnEventArgs(taskOrderCollection));
                }
            }
            else
            {
                this.m_Timer.Interval = LongIntervalTicks;
            }
        }
        /*public static YellowstonePathology.Business.Task.Model.TaskOrder BuildTaskOrder(XElement taskOrderElement)
        {
            YellowstonePathology.Business.Task.Model.TaskOrder taskOrder = new YellowstonePathology.Business.Task.Model.TaskOrder();
            YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new YellowstonePathology.Business.Persistence.XmlPropertyWriter(taskOrderElement, taskOrder);
            xmlPropertyWriter.Write();
            List<XElement> taskOrderDetailElements = (from item in taskOrderElement.Elements("TaskOrderDetailCollection") select item).ToList<XElement>();
            foreach (XElement taskOrderDetailElement in taskOrderDetailElements.Elements("TaskOrderDetail"))
            {
                YellowstonePathology.Business.Task.Model.TaskOrderDetail taskOrderDetail = BuildTaskOrderDetail(taskOrderDetailElement);
                taskOrder.TaskOrderDetailCollection.Add(taskOrderDetail);
            }
            return taskOrder;
        }

        public static YellowstonePathology.Business.Task.Model.TaskOrderDetail BuildTaskOrderDetail(XElement taskOrderDetailElement)
        {
            YellowstonePathology.Business.Task.Model.TaskOrderDetail taskOrderDetail = new YellowstonePathology.Business.Task.Model.TaskOrderDetail();
            YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new YellowstonePathology.Business.Persistence.XmlPropertyWriter(taskOrderDetailElement, taskOrderDetail);
            xmlPropertyWriter.Write();
            return taskOrderDetail;
        }*/
        private static Task.Model.TaskOrderCollection BuildTaskOrderCollection(SqlCommand cmd)
        {
            YellowstonePathology.Business.Task.Model.TaskOrderCollection result = new YellowstonePathology.Business.Task.Model.TaskOrderCollection();
            using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.ProductionConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        Task.Model.TaskOrder taskOrder = new Task.Model.TaskOrder();
                        Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(taskOrder, dr);
                        sqlDataReaderPropertyWriter.WriteProperties();
                        result.Add(taskOrder);
                    }
                    dr.NextResult();
                    while (dr.Read())
                    {
                        Task.Model.TaskOrderDetail taskOrderDetail = new Task.Model.TaskOrderDetail();
                        Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(taskOrderDetail, dr);
                        sqlDataReaderPropertyWriter.WriteProperties();
                        foreach (Task.Model.TaskOrder taskOrder in result)
                        {
                            if (taskOrderDetail.TaskOrderId == taskOrder.TaskOrderId)
                            {
                                taskOrder.TaskOrderDetailCollection.Add(taskOrderDetail);
                                break;
                            }
                        }
                    }
                }
            }
            return result;
        }
Example #10
0
 public void GetDailyTaskOrderHistoryCollection()
 {
     this.m_DailyTaskOrderCollection = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetDailyTaskOrderHistoryCollection(30);
     this.NotifyPropertyChanged("DailyTaskOrderCollection");
 }
 public AcknowledgeDailyTaskOrderPath(YellowstonePathology.Business.Task.Model.TaskOrderCollection taskOrderCollection)
 {
     this.m_TaskOrderCollection = taskOrderCollection;
 }
Example #12
0
 public void GetTaskOrderCollection()
 {
     this.m_TaskOrderCollection = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetTaskOrderCollection(YellowstonePathology.Business.Task.Model.TaskAcknowledgementType.Immediate);
     this.NotifyPropertyChanged("TaskOrderCollection");
 }
Example #13
0
 public TaskOrderCollectionReturnEventArgs(YellowstonePathology.Business.Task.Model.TaskOrderCollection taskOrderCollection)
 {
     this.m_TaskOrderCollection = taskOrderCollection;
 }
Example #14
0
 private void Notifier_Alert(object sender, CustomEventArgs.TaskOrderCollectionReturnEventArgs e)
 {
     this.m_TaskOrderCollection = e.TaskOrderCollection;
     this.NotifyPropertyChanged("TaskOrderCollection");
     YellowstonePathology.UI.TaskNotifier.Instance.Notifier.Alert -= Notifier_Alert;
 }
Example #15
0
 public void GetTasksNotAcknowledged()
 {
     string assignedTo = YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.AcknowledgeTasksFor;
     this.m_TaskOrderCollection = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetTasksNotAcknowledged(assignedTo, YellowstonePathology.Business.Task.Model.TaskAcknowledgementType.Immediate);
     this.NotifyPropertyChanged("TaskOrderCollection");
 }
        public static YellowstonePathology.Business.Task.Model.TaskOrderCollection GetTasksNotAcknowledged(string assignedTo, string acknowledgementType)
        {
            YellowstonePathology.Business.Task.Model.TaskOrderCollection result = new YellowstonePathology.Business.Task.Model.TaskOrderCollection();
            XElement collectionElement = new XElement("Document");
            SqlCommand cmd = new SqlCommand("select tsk.*,  " +
                "(select tskd.* " +
                "from tblTaskOrderDetail tskd " +
                "where tskd.TaskOrderId = tsk.TaskOrderId " +
                "for xml Path('TaskOrderDetail'), type) [TaskOrderDetailCollection] " +
                "from tblTaskOrder tsk where AcknowledgementType = @AcknowledgementType and TaskOrderId in " +
                "(Select TaskOrderId from tblTaskOrderDetail where Acknowledged = 0 and AssignedTo = @AssignedTo) order by tsk.OrderDate desc " +
                "for xml Path('TaskOrder'), type, root('TaskOrderCollection')");
            cmd.CommandType = CommandType.Text;
            cmd.Parameters.Add("@AssignedTo", SqlDbType.VarChar).Value = assignedTo;
            cmd.Parameters.Add("@AcknowledgementType", SqlDbType.VarChar).Value = acknowledgementType;

            using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.ProductionConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (XmlReader xmlReader = cmd.ExecuteXmlReader())
                {
                    if (xmlReader.Read() == true)
                    {
                        collectionElement = XElement.Load(xmlReader);
                    }
                }
            }
            foreach (XElement taskOrderElement in collectionElement.Elements("TaskOrder"))
            {
                YellowstonePathology.Business.Task.Model.TaskOrder taskOrder = BuildTaskOrder(taskOrderElement);
                result.Add(taskOrder);
            }

            return result;
        }
Example #17
0
 public void GetDailyTaskOrderCollection()
 {
     this.m_DailyTaskOrderCollection = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetDailyTaskOrderCollection();
     this.NotifyPropertyChanged("DailyTaskOrderCollection");
 }
Example #18
0
 public AccessionOrder()
 {
     this.m_SpecimenOrderCollection = new YellowstonePathology.Business.Specimen.Model.SpecimenOrderCollection();
     this.m_PanelSetOrderCollection = new YellowstonePathology.Business.Test.PanelSetOrderCollection();
     this.m_SpecimenOrderDataTemplate = YellowstonePathology.Business.DataTemplateSpecimenOrderEnum.DataTemplateAccessionTreeView;
     this.m_ICD9BillingCodeCollection = new Billing.ICD9BillingCodeCollection();
     this.m_TaskOrderCollection = new YellowstonePathology.Business.Task.Model.TaskOrderCollection();
 }
 public AcknowledgeDailyTaskOrderPath(YellowstonePathology.Business.Task.Model.TaskOrderCollection taskOrderCollection)
 {
     this.m_TaskOrderCollection = taskOrderCollection;
 }
Example #20
0
 public AccessionOrder(string masterAccessionNo, string objectId)
 {
     this.m_MasterAccessionNo = masterAccessionNo;
     this.m_ObjectId = objectId;
     this.m_AccessionDate = DateTime.Today;
     this.m_AccessionTime = DateTime.Now;
     this.m_AccessioningFacilityId = YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.FacilityId;
     this.m_SpecimenOrderCollection = new YellowstonePathology.Business.Specimen.Model.SpecimenOrderCollection();
     this.m_PanelSetOrderCollection = new YellowstonePathology.Business.Test.PanelSetOrderCollection();
     this.m_SpecimenOrderDataTemplate = YellowstonePathology.Business.DataTemplateSpecimenOrderEnum.DataTemplateAccessionTreeView;
     this.m_ICD9BillingCodeCollection = new Billing.ICD9BillingCodeCollection();
     this.m_TaskOrderCollection = new YellowstonePathology.Business.Task.Model.TaskOrderCollection();
 }
Example #21
0
 public void GetTaskOrderCollection()
 {
     this.m_TaskOrderCollection = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetTaskOrderCollection(YellowstonePathology.Business.Task.Model.TaskAcknowledgementType.Immediate);
     this.NotifyPropertyChanged("TaskOrderCollection");
 }
Example #22
0
 private void Notifier_Alert(object sender, CustomEventArgs.TaskOrderCollectionReturnEventArgs e)
 {
     this.m_TaskOrderCollection = e.TaskOrderCollection;
     this.NotifyPropertyChanged("TaskOrderCollection");
     YellowstonePathology.UI.TaskNotifier.Instance.Notifier.Alert -= Notifier_Alert;
 }
        public static YellowstonePathology.Business.Task.Model.TaskOrderCollection GetDailyTaskOrderCollection()
        {
            YellowstonePathology.Business.Task.Model.TaskOrderCollection result = new YellowstonePathology.Business.Task.Model.TaskOrderCollection();
            string sql = "Select * from tblTaskOrder where AcknowledgementType = 'Daily' " +
                "and Acknowledged = 0 " +
                "and TaskDate <= GetDate() order by TaskDate desc";
            SqlCommand cmd = new SqlCommand(sql);
            cmd.CommandType = CommandType.Text;
            cmd.Parameters.Add("@AcknowledgementType", SqlDbType.VarChar).Value = Task.Model.TaskAcknowledgementType.Daily;

            using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.ProductionConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read() == true)
                    {
                        YellowstonePathology.Business.Task.Model.TaskOrder taskOrder = new Task.Model.TaskOrder();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(taskOrder, dr);
                        sqlDataReaderPropertyWriter.WriteProperties();
                        result.Add(taskOrder);
                    }
                }
            }

            return result;
        }
        public static YellowstonePathology.Business.Task.Model.TaskOrderCollection GetDailyTaskOrderHistoryCollection(int daysBack)
        {
            YellowstonePathology.Business.Task.Model.TaskOrderCollection result = new YellowstonePathology.Business.Task.Model.TaskOrderCollection();
            XElement collectionElement = new XElement("Document");
            string sql = "Select * from tblTaskOrder where AcknowledgementType = 'Daily' " +
                "and TaskDate between @StartDate and @EndDate order by TaskDate desc";
            SqlCommand cmd = new SqlCommand(sql);
            cmd.CommandType = CommandType.Text;
            cmd.Parameters.Add("@StartDate", SqlDbType.DateTime).Value = DateTime.Today.AddDays(-daysBack);
            cmd.Parameters.Add("@EndDate", SqlDbType.DateTime).Value = DateTime.Today;

            using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.ProductionConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read() == true)
                    {
                        YellowstonePathology.Business.Task.Model.TaskOrder taskOrder = new Task.Model.TaskOrder();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(taskOrder, dr);
                        sqlDataReaderPropertyWriter.WriteProperties();
                        result.Add(taskOrder);
                    }
                }
            }

            return result;
        }
 public TaskOrderCollectionReturnEventArgs(YellowstonePathology.Business.Task.Model.TaskOrderCollection taskOrderCollection)
 {
     this.m_TaskOrderCollection = taskOrderCollection;
 }
        public static YellowstonePathology.Business.Task.Model.TaskOrderCollection GetTaskOrderCollection()
        {
            YellowstonePathology.Business.Task.Model.TaskOrderCollection result = new YellowstonePathology.Business.Task.Model.TaskOrderCollection();
            XElement collectionElement = new XElement("Document");
            SqlCommand cmd = new SqlCommand(" select tsk.*,  ( select tskd.* from tblTaskOrderDetail tskd where tskd.TaskOrderId = tsk.TaskOrderId " +
                "for xml Path('TaskOrderDetail'), type) [TaskOrderDetailCollection] " +
                "from tblTaskOrder tsk where tsk.OrderDate between dateadd(dd, -30, GetDate()) and GetDate() order by tsk.OrderDate desc for xml Path('TaskOrder'), type, root('TaskOrderCollection')");
            cmd.CommandType = CommandType.Text;

            using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.ProductionConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (XmlReader xmlReader = cmd.ExecuteXmlReader())
                {
                    if (xmlReader.Read() == true)
                    {
                        collectionElement = XElement.Load(xmlReader);
                    }
                }
            }

            foreach (XElement taskOrderElement in collectionElement.Elements("TaskOrder"))
            {
                YellowstonePathology.Business.Task.Model.TaskOrder taskOrder = BuildTaskOrder(taskOrderElement);
                result.Add(taskOrder);
            }

            return result;
        }