Esempio n. 1
0
        public Business.Rules.MethodResult AddMissingColumns(MigrationStatus migrationStatus)
        {
            Business.Rules.MethodResult result = new Business.Rules.MethodResult();
            result.Message = "Errored on: ";
            Business.Rules.MethodResult missingColumnResult = this.CompareTable(migrationStatus);
            if(missingColumnResult.Success == false)
            {
                string columns = missingColumnResult.Message.Replace("Missing columns: ", string.Empty);
                string[] missingColumns = columns.Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries);
                foreach(string columnName in missingColumns)
                {
                    foreach(PropertyInfo property in migrationStatus.PersistentProperties)
                    {
                        if(property.Name == columnName)
                        {
                            string columnDefinition = this.GetDataColumnDefinition(migrationStatus.TableName, property);
                            string columnDataType = columnDefinition.Replace(columnName + " ", string.Empty);
                            columnDataType = columnDataType.Substring(0, columnDataType.Length - 2);
                            string command = this.GetAddColumnCommand(migrationStatus.TableName, columnName, columnDataType);
                            Business.Rules.MethodResult columnResult = this.RunCommand(command);
                            if(columnResult.Success == false)
                            {
                                result.Success = false;
                                result.Message += columnName + ", ";
                            }
                            break;
                        }
                    }
                }
            }

            migrationStatus.HasAllColumns = result.Success;
            return result;
        }
Esempio n. 2
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)
         {
             accessionOrder.PanelSetOrderCollection.Remove(panelSetOrder);
             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;
 }
Esempio n. 3
0
        public Business.Rules.MethodResult AddDBTS(string tableName)
        {
            Business.Rules.MethodResult methodResult = new Business.Rules.MethodResult();
            bool hasDBTS = Business.Mongo.Gateway.HasTransferDBTSAttribute(tableName);
            bool hasTSA = Business.Mongo.Gateway.HasTransferTransferStraightAcrossAttribute(tableName);

            if (hasDBTS == false) Business.Mongo.Gateway.AddTransferDBTSAttribute(tableName);
            if (hasTSA == false) Business.Mongo.Gateway.AddTransferStraightAcrossAttribute(tableName, false);
            return methodResult;
        }
Esempio n. 4
0
        public static Business.Rules.MethodResult Remove(Business.Test.AccessionOrder accessionOrder, object writer)
        {
            YellowstonePathology.Business.Rules.MethodResult methodResult = new Business.Rules.MethodResult();
            accessionOrder.AccessionLock.ReleaseLock();

            YellowstonePathology.Business.ClientOrder.Model.ClientOrder clientOrder = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.PullClientOrder(accessionOrder.ClientOrderId, writer);
            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.DeleteDocument(clientOrder, writer);
            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.DeleteDocument(accessionOrder, writer);

            return methodResult;
        }
        public override YellowstonePathology.Business.Rules.MethodResult OrderTargetIsOk(YellowstonePathology.Business.Interface.IOrderTarget orderTarget)
        {
            YellowstonePathology.Business.Rules.MethodResult methodResult = new Business.Rules.MethodResult();
            methodResult.Success = true;

            if (orderTarget.GetType().Name != "AliquotOrder")
            {
                methodResult.Success = false;
                methodResult.Message = "Lynch Syndrome IHC must be ordered on an aliquot.";
            }

            return methodResult;
        }
 public YellowstonePathology.Business.Rules.MethodResult SubmitChanges(YellowstonePathology.YpiConnect.Contract.Flow.FlowAccessionSubmitter flowAccessionSubmitter)
 {
     Business.Rules.MethodResult methodResult = new Business.Rules.MethodResult();
     try
     {
         FlowAccessionGateway gateway = new FlowAccessionGateway();
         flowAccessionSubmitter.Submit(gateway);
         methodResult.Success = true;
         methodResult.Message = "Submit Changes completed successfully";
     }
     catch (Exception e)
     {
         methodResult.Success = false;
         methodResult.Message = e.Message;
     }
     return methodResult;
 }
        public OrderEntryPage(YellowstonePathology.Business.ClientOrder.Model.ClientOrder clientOrder)
        {
            this.m_ShowInactiveSpecimen = false;
            this.m_IsLoadingSpecimen = false;
            this.m_ClientOrder = clientOrder;

            this.m_ClientOrderDetailViewCollection = new ClientOrderDetailViewCollection(this.m_ClientOrder.ClientOrderDetailCollection, this.m_ShowInactiveSpecimen);

            YellowstonePathology.Business.Rules.MethodResult methodResult = new Business.Rules.MethodResult();
            this.m_HandleClientDateentryPropertyAccess = new Rules.HandleClientDataEntryPropertyAccess(executionStatus);
            this.m_HandleClientDateentryPropertyAccess.Execute(this.m_ClientOrder, methodResult);
            this.AreDemographicsEnabled = methodResult.Success;
            this.AreSpecimenEnabled = methodResult.Success;
            this.AreButtonsEnabled = methodResult.Success;

            InitializeComponent();

            this.DataContext = this;
            this.Loaded += new RoutedEventHandler(OrderEntryPage_Loaded);
        }
        private YellowstonePathology.Business.Rules.MethodResult CanDeleteProvider(YellowstonePathology.Business.Domain.Physician physician)
        {
            YellowstonePathology.Business.Rules.MethodResult result = new Business.Rules.MethodResult();
            int accessionCount = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetAccessionCountByPhysicianId(physician.PhysicianId);

            if (accessionCount > 0)
            {
                result.Success = false;
                result.Message = physician.DisplayName + " has accessions and can not be deleted.";
            }
            else
            {
                StringBuilder msg = new StringBuilder();
                msg.AppendLine(physician.DisplayName);
                YellowstonePathology.Business.Domain.PhysicianClientCollection physicianClientCollection = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetPhysicianClientCollectionByProviderId(physician.ObjectId);
                foreach (YellowstonePathology.Business.Domain.PhysicianClient physicianClient in physicianClientCollection)
                {
                    YellowstonePathology.Business.Client.Model.PhysicianClientDistributionCollection physicianClientDistributionCollection = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetPhysicianClientDistributionByPhysicianClientId(physicianClient.PhysicianClientId);
                    if (physicianClientDistributionCollection.Count > 0)
                    {
                        result.Success = false;
                        msg.AppendLine("- has existing distributions.  The distributions must be removed before the provider may be deleted.");
                        break;
                    }
                }

                if (physicianClientCollection.Count > 0)
                {
                    result.Success = false;
                    msg.Append("- is a member of " + physicianClientCollection.Count.ToString() + " client/s.  The membership must be removed before the provider may be deleted.");
                }
                result.Message = msg.ToString();
            }

            return(result);
        }
Esempio n. 9
0
 private void HyperLinkDeleteAccessionOrder_Click(object sender, RoutedEventArgs e)
 {
     if (this.m_AccessionOrder.AccessionLock.IsLockAquiredByMe == true)
     {
         MessageBoxResult result = MessageBox.Show("All open tabs will be closed and your work saved.  Are you sure you want to permanently delete Accession " + this.m_AccessionOrder.MasterAccessionNo + " for " + this.m_AccessionOrder.PatientDisplayName + "?", "Delete Accession", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No);
         if (result == MessageBoxResult.Yes)
         {
             bool tabsClosedResult = this.CloseTabs(this, EventArgs.Empty);
             Business.Rules.MethodResult methodResult = AORemover.Remove(this.m_AccessionOrder, this.m_Writer);
             if (methodResult.Success == false)
             {
                 MessageBox.Show(methodResult.Message);
             }
             else
             {
                 this.Back(this, new EventArgs());
             }
         }
     }
     else
     {
         System.Windows.MessageBox.Show("Unable to delete as the case is locked by " + this.m_AccessionOrder.AccessionLock.Address + ".", "Case is locked");
     }
 }
        private YellowstonePathology.Business.Rules.MethodResult CanDeleteClient(YellowstonePathology.Business.Client.Model.Client client)
        {
            YellowstonePathology.Business.Rules.MethodResult result = new Business.Rules.MethodResult();
            int accessionCount = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetAccessionCountByClientId(client.ClientId);

            if (accessionCount > 0)
            {
                result.Success = false;
                result.Message = client.ClientName + " has accessions and can not be deleted.";
            }
            else
            {
                StringBuilder msg = new StringBuilder();
                msg.AppendLine(client.ClientName);
                YellowstonePathology.Business.Domain.PhysicianClientCollection physicianClientCollection = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetPhysicianClientCollectionByClientId(client.ClientId);
                foreach (YellowstonePathology.Business.Domain.PhysicianClient physicianClient in physicianClientCollection)
                {
                    YellowstonePathology.Business.Client.Model.PhysicianClientDistributionCollection physicianClientDistributionCollection = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetPhysicianClientDistributionByPhysicianClientId(physicianClient.PhysicianClientId);
                    if (physicianClientDistributionCollection.Count > 0)
                    {
                        result.Success = false;
                        msg.AppendLine("- has distributions.  The distributions must be removed before the client can be deleted.");
                        break;
                    }
                }

                if (physicianClientCollection.Count > 0)
                {
                    result.Success = false;
                    msg.AppendLine("- has membereship.  The membership must be removed before the client can be deleted.");
                }
                result.Message = msg.ToString();
            }

            return(result);
        }
 private YellowstonePathology.Business.Rules.MethodResult OrderDetailTypeIsSelected()
 {
     YellowstonePathology.Business.Rules.MethodResult result = new Business.Rules.MethodResult();
     result.Success = true;
     if (this.ListBoxClientOrderDetailType.SelectedItem == null)
     {
         result.Success = false;
         result.Message = "Please select a specimen type.";
     }
     return result;
 }
        private YellowstonePathology.Business.Rules.MethodResult DoTypingFinalChecks()
        {
            YellowstonePathology.Business.Rules.MethodResult methodResult = new Business.Rules.MethodResult();
            methodResult.Success = true;

            if (this.m_TypingUI.AccessionOrder.ClientId == 558)
            {
                string message = string.Empty;
                if (string.IsNullOrEmpty(this.m_TypingUI.AccessionOrder.SvhAccount) == true)
                {
                    message += "The SVH Account is blank.";
                    methodResult.Success = false;
                }
                if (string.IsNullOrEmpty(this.m_TypingUI.AccessionOrder.SvhMedicalRecord) == true)
                {
                    message += "The SVH MRN is blank.";
                    methodResult.Success = false;
                }
                methodResult.Message = message;
            }

            YellowstonePathology.Business.Domain.Physician physician = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetPhysicianByPhysicianId(this.m_TypingUI.AccessionOrder.PhysicianId);
            if (string.IsNullOrEmpty(physician.Npi) == true)
            {
                methodResult.Message += "The provider NPI is blank.";
                methodResult.Success = false;
            }

            if (this.m_TypingUI.SurgicalTestOrder.AssignedToId == 0)
            {
                methodResult.Success = false;
                methodResult.Message = "Please assign a pathologist to this case.";
            }
            return methodResult;
        }
        private YellowstonePathology.Business.Rules.MethodResult IsOkToNavigate()
        {
            YellowstonePathology.Business.Rules.MethodResult result = new Business.Rules.MethodResult();
            result.Success = true;

            if (this.m_ClientOrderDetail.FixationStartTimeManuallyEntered == true && string.IsNullOrEmpty(this.m_ClientOrderDetail.FixationComment) == true)
            {
                result.Success = false;
                result.Message = "The Fixation Start Time has been manually set so you must provide a comment before continuing.";
            }

            if (string.IsNullOrEmpty(this.m_ClientOrderDetail.DescriptionToAccession) == false)
            {
                if (this.m_ClientOrderDetail.DescriptionToAccession.ToUpper().Contains("PROSTATE") == true)
                {
                    if (string.IsNullOrEmpty(this.m_ClientOrderDetail.SpecimenId) == true)
                    {
                        result.Success = false;
                        result.Message = "You must select the specimen id for prostate specimens.";
                    }
                }
                else if (this.m_ClientOrderDetail.DescriptionToAccession.ToUpper().Contains("APPENDIX, EXCISION") == true)
                {
                    if (string.IsNullOrEmpty(this.m_ClientOrderDetail.SpecimenId) == true)
                    {
                        result.Success = false;
                        result.Message = "You must select the specimen id for Appendix, excision specimens.";
                    }
                }
            }

            return result;
        }
Esempio n. 14
0
        public YellowstonePathology.Business.Rules.MethodResult IsOkToSetResults()
        {
            YellowstonePathology.Business.Rules.MethodResult result = new Business.Rules.MethodResult();
            if (this.m_Accepted == true)
            {
                result.Success = false;
                result.Message = "Results may not be set because the results already have been accepted.";
            }
            else if (string.IsNullOrEmpty(this.TypeIIGranulocytes) == true ||
                string.IsNullOrEmpty(this.TypeIIIGranulocytes) == true ||
                string.IsNullOrEmpty(this.TypeIIMonocytes) == true ||
                string.IsNullOrEmpty(this.TypeIIIMonocytes) == true ||
                string.IsNullOrEmpty(this.TypeIRedBloodCells) == true ||
                string.IsNullOrEmpty(this.TypeIIRedBloodCells) == true ||
                string.IsNullOrEmpty(this.TypeIIIRedBloodCells) == true)
            {
                result.Success = false;
                result.Message = "All cell counts must be set before the results can be set.";
            }

            return result;
        }
Esempio n. 15
0
        public Business.Rules.MethodResult AddTransferColumn(string tableName)
        {
            Business.Rules.MethodResult methodResult = new Business.Rules.MethodResult();
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "alter table " + tableName + " add Transferred bit NULL";
            cmd.CommandType = CommandType.Text;

            using (SqlConnection cn = new SqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString))
            {
                try
                {
                    cn.Open();
                    cmd.Connection = cn;
                    cmd.ExecuteNonQuery();
                }
                catch (Exception e)
                {
                    string s = e.Message;
                    methodResult.Message = cmd.CommandText;
                    methodResult.Success = false;
                }
            }

            return methodResult;
        }
 private void HyperLinkSendHL7Result_Click(object sender, RoutedEventArgs e)
 {
     YellowstonePathology.Business.HL7View.IResultView resultView   = YellowstonePathology.Business.HL7View.ResultViewFactory.GetResultView(this.m_PanelSetOrder.ReportNo, this.m_AccessionOrder, this.m_AccessionOrder.ClientId, false);
     YellowstonePathology.Business.Rules.MethodResult  methodResult = new Business.Rules.MethodResult();
     resultView.Send(methodResult);
 }
Esempio n. 17
0
 public Business.Rules.MethodResult SynchronizeData(MigrationStatus migrationStatus)
 {
     Business.Rules.MethodResult overallResult = new Business.Rules.MethodResult();
     if (this.TablesAreOkToUse(migrationStatus) == true)
     {
         if (migrationStatus.OutOfSyncCount > 0)
         {
             List<string> updateCommands = new List<string>();
             List<string> keys = this.GetSyncDataKeyList(migrationStatus);
             Business.Rules.MethodResult result = this.CompareData(migrationStatus, keys, updateCommands);
             if (result.Success == false)
             {
                 overallResult.Success = false;
                 overallResult.Message += result.Message;
             }
             if (updateCommands.Count > 0)
             {
                 result = this.Synchronize(updateCommands);
                 overallResult.Message += result.Message;
                 if (result.Success == false)
                 {
                     overallResult.Success = false;
                 }
             }
             List<string> checkCommands = new List<string>();
             Business.Rules.MethodResult checkResult = this.CompareData(migrationStatus, keys, checkCommands);
             if (checkCommands.Count > 0)
             {
                 overallResult.Success = false;
                 overallResult.Message += "Update failed on " + checkCommands.Count.ToString();
             }
             YellowstonePathology.Business.Mongo.Gateway.SetTransferDBTS(migrationStatus.TableName);
         }
     }
     return overallResult;
 }
Esempio n. 18
0
        public Business.Rules.MethodResult DailySync(MigrationStatus migrationStatus)
        {
            Business.Rules.MethodResult overallResult = new Business.Rules.MethodResult();
            if (this.TablesAreOkToUse(migrationStatus) == true)
            {
                overallResult = this.SynchronizeData(migrationStatus);

                Business.Rules.MethodResult loadresult = this.DailyLoadData(migrationStatus);
                overallResult.Message += loadresult.Message;
                if(loadresult.Success == false)
                {
                    overallResult.Success = false;
                }
            }
            else
            {
                overallResult.Success = false;
                overallResult.Message += "Table or column issue with " + migrationStatus.TableName;
            }
            return overallResult;
        }
Esempio n. 19
0
        public Business.Rules.MethodResult DailyLoadData(MigrationStatus migrationStatus)
        {
            Business.Rules.MethodResult methodResult = new Business.Rules.MethodResult();
            if (this.TablesAreOkToUse(migrationStatus) == true)
            {
                if (migrationStatus.UnLoadedDataCount > 0)
                {
                    List<string> keys = this.GetDailyLoadDataKeys(migrationStatus);
                    string keyString = this.KeyStringFromList(migrationStatus, keys);
                    methodResult = this.LoadData(migrationStatus, keyString);
                    YellowstonePathology.Business.Mongo.Gateway.SetTransferDBTS(migrationStatus.TableName);

                    List<string> checkCommands = new List<string>();
                    Business.Rules.MethodResult checkResult = this.CompareData(migrationStatus, keys, checkCommands);
                    if (checkCommands.Count > 0)
                    {
                        methodResult.Success = false;
                        methodResult.Message += "Update failed on " + checkCommands.Count.ToString();
                    }
                }
            }
            return methodResult;
        }
Esempio n. 20
0
        public Business.Rules.MethodResult CompareTables(MigrationStatus migrationStatus)
        {
            Business.Rules.MethodResult overallResult = new Business.Rules.MethodResult();
            if (this.TablesAreOkToUse(migrationStatus) == true)
            {
                List<string> keys = this.GetCompareDataKeyList(migrationStatus);
                List<string> updateCommands = new List<string>();
                overallResult = this.CompareData(migrationStatus, keys, updateCommands);
                if (updateCommands.Count > 0)
                {
                    Business.Rules.MethodResult result = this.Synchronize(updateCommands);
                    overallResult.Message += result.Message;
                    if(result.Success == false)
                    {
                        overallResult.Success = false;
                    }

                    List<string> checkCommands = new List<string>();
                    Business.Rules.MethodResult checkResult = this.CompareData(migrationStatus, keys, checkCommands);
                    if (checkCommands.Count > 0)
                    {
                        overallResult.Success = false;
                        overallResult.Message += "Update failed on " + checkCommands.Count.ToString();
                    }
                }
            }
            else
            {
                overallResult.Success = false;
                overallResult.Message += "Table or column issue with " + migrationStatus.TableName;
            }
            return overallResult;
        }
Esempio n. 21
0
 private YellowstonePathology.Business.Rules.MethodResult CanRemoveMember(YellowstonePathology.Business.Domain.PhysicianClient physicianClient)
 {
     YellowstonePathology.Business.Rules.MethodResult result = new Business.Rules.MethodResult();
     YellowstonePathology.Business.Client.Model.PhysicianClientDistributionCollection physicianClientDistributionCollection = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetPhysicianClientDistributionByPhysicianClientId(physicianClient.PhysicianClientId);
     if (physicianClientDistributionCollection.Count > 0)
     {
         result.Success = false;
         result.Message = "This provider has distributions for this client.  These distributions must be removed before the provider can be removed from the client membership.";
     }
     return result;
 }
        public YellowstonePathology.Business.Rules.MethodResult IsOkToSetResults()
        {
            YellowstonePathology.Business.Rules.MethodResult result = new Business.Rules.MethodResult();
            if (this.m_Accepted == true)
            {
                result.Success = false;
                result.Message = "Results may not be set because the results already have been accepted.";
            }
            else if (string.IsNullOrEmpty(this.m_BCellFrameWork1) == true ||
                string.IsNullOrEmpty(this.m_BCellFrameWork2) == true ||
                string.IsNullOrEmpty(this.m_BCellFrameWork3) == true)
            {
                result.Success = false;
                result.Message = "All B-Cell results must be set before the results can be set.";
            }

            return result;
        }
Esempio n. 23
0
 private void OwnershipPage_Return(object sender, YellowstonePathology.YpiConnect.Client.PageNavigationReturnEventArgs e)
 {
     ApplicationNavigator.ApplicationContentFrame.NavigationService.Navigate(this);
     YellowstonePathology.Business.Rules.ExecutionStatus executionStatus = new Business.Rules.ExecutionStatus();
     YellowstonePathology.Business.Rules.MethodResult methodResult = new Business.Rules.MethodResult();
     this.m_HandleClientDateentryPropertyAccess = new Rules.HandleClientDataEntryPropertyAccess(executionStatus);
     this.m_HandleClientDateentryPropertyAccess.Execute(this.m_ClientOrder, methodResult);
     this.AreDemographicsEnabled = methodResult.Success;
     this.AreSpecimenEnabled = methodResult.Success;
     this.AreButtonsEnabled = methodResult.Success;
 }
        private YellowstonePathology.Business.Rules.MethodResult CanDeleteClient(YellowstonePathology.Business.Client.Model.Client client)
        {
            YellowstonePathology.Business.Rules.MethodResult result = new Business.Rules.MethodResult();
            int accessionCount = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetAccessionCountByClientId(client.ClientId);
            if (accessionCount > 0)
            {
                result.Success = false;
                result.Message = client.ClientName + " has accessions and can not be deleted.";
            }
            else
            {
                StringBuilder msg = new StringBuilder();
                msg.AppendLine(client.ClientName);
                YellowstonePathology.Business.Domain.PhysicianClientCollection physicianClientCollection = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetPhysicianClientCollectionByClientId(client.ClientId);
                foreach (YellowstonePathology.Business.Domain.PhysicianClient physicianClient in physicianClientCollection)
                {
                    YellowstonePathology.Business.Client.Model.PhysicianClientDistributionCollection physicianClientDistributionCollection = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetPhysicianClientDistributionByPhysicianClientId(physicianClient.PhysicianClientId);
                    if(physicianClientDistributionCollection.Count > 0)
                    {
                        result.Success = false;
                        msg.AppendLine("- has distributions.  The distributions must be removed before the client can be deleted.");
                        break;
                    }
                }

                if (physicianClientCollection.Count > 0)
                {
                    result.Success = false;
                    msg.AppendLine("- has membereship.  The membership must be removed before the client can be deleted.");
                }
                result.Message = msg.ToString();
            }

            return result;
        }
Esempio n. 25
0
 private void SendFT1ForPanelSet()
 {
     foreach( Business.Test.PanelSetOrderCPTCodeBill panelSetOrderCPTCodeBill in this.m_PanelSetOrder.PanelSetOrderCPTCodeBillCollection)
     {
         Business.HL7View.EPIC.EPICFT1ResultView epicFT1ResultView = new Business.HL7View.EPIC.EPICFT1ResultView(this.m_AccessionOrder, panelSetOrderCPTCodeBill, true);
         Business.Rules.MethodResult methodResult = new Business.Rules.MethodResult();
         epicFT1ResultView.CanSend(methodResult);
         if (methodResult.Success == true)
         {
             Business.Billing.Model.CptCode cptCode = Business.Billing.Model.CptCodeCollection.Instance.GetCptCode(panelSetOrderCPTCodeBill.CPTCode);
             Business.Rules.MethodResult sendResult = new Business.Rules.MethodResult();
             epicFT1ResultView.Send(sendResult);
         }
     }
 }
        private YellowstonePathology.Business.Rules.MethodResult CanDeleteProvider(YellowstonePathology.Business.Domain.Physician physician)
        {
            YellowstonePathology.Business.Rules.MethodResult result = new Business.Rules.MethodResult();
            int accessionCount = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetAccessionCountByPhysicianId(physician.PhysicianId);
            if (accessionCount > 0)
            {
                result.Success = false;
                result.Message = physician.DisplayName + " has accessions and can not be deleted.";
            }
            else
            {
                StringBuilder msg = new StringBuilder();
                msg.AppendLine(physician.DisplayName);
                YellowstonePathology.Business.Domain.PhysicianClientCollection physicianClientCollection = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetPhysicianClientCollectionByProviderId(physician.ObjectId);
                foreach (YellowstonePathology.Business.Domain.PhysicianClient physicianClient in physicianClientCollection)
                {
                    YellowstonePathology.Business.Client.Model.PhysicianClientDistributionCollection physicianClientDistributionCollection = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetPhysicianClientDistributionByPhysicianClientId(physicianClient.PhysicianClientId);
                    if (physicianClientDistributionCollection.Count > 0)
                    {
                        result.Success = false;
                        msg.AppendLine("- has existing distributions.  The distributions must be removed before the provider may be deleted.");
                        break;
                    }
                }

                if (physicianClientCollection.Count > 0)
                {
                    result.Success = false;
                    msg.Append("- is a member of " + physicianClientCollection.Count.ToString() + " client/s.  The membership must be removed before the provider may be deleted.");
                }
                result.Message = msg.ToString();
            }

            return result;
        }
        private void ButtonRunMethod_Click(object sender, RoutedEventArgs e)
        {
            Business.ReportNoCollection reportNos = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetReportNumbers();
            foreach(Business.ReportNo reportNo in reportNos)
            {
                string masterAccessionNo = Business.Gateway.AccessionOrderGateway.GetMasterAccessionNoFromReportNo(reportNo.Value);
                Business.Test.AccessionOrder ao = Business.Persistence.DocumentGateway.Instance.GetAccessionOrderByMasterAccessionNo(masterAccessionNo);
                Business.HL7View.IResultView resultView = YellowstonePathology.Business.HL7View.ResultViewFactory.GetResultView(reportNo.Value, ao, ao.ClientId, false);
                YellowstonePathology.Business.Rules.MethodResult methodResult = new Business.Rules.MethodResult();
                resultView.Send(methodResult);
            }

            //Business.Label.Model.ZPLPrinter printer = new Business.Label.Model.ZPLPrinter("10.1.1.21");
            //YellowstonePathology.Business.BarcodeScanning.BarcodeVersion1 barcode = new Business.BarcodeScanning.BarcodeVersion1("HBLK16-25894.1A");
            //YellowstonePathology.Business.BarcodeScanning.HistologyBlock histologyBlock = Business.BarcodeScanning.HistologyBlock.Parse(barcode);
            //string commands = Business.Label.Model.HistologyBlockPaperZPLLabel.GetCommands(histologyBlock, "MM", "1A", "16-25894");

            //string commands = YellowstonePathology.Business.Label.Model.HistologySlidePaperZPLLabel.GetCommands("16-12345.1A1", "16-12345.F2", "ABCDEFGHIJ", "ABCDEFGHIJKLMNOP", "3A3", "YPI Cody, Wy");
            //printer.Print(commands);
        }
 public static YellowstonePathology.Business.Rules.MethodResult IsOkToOrderBRAF(KRASStandardReflexResult krasStandardReflexResult)
 {
     YellowstonePathology.Business.Rules.MethodResult result = new Business.Rules.MethodResult();
     if (krasStandardReflexResult.DoesBRAFV600EKExist() == true)
     {
         result.Success = false;
         result.Message = "A BRAF V600E/K cannot be ordered because one already exists.";
     }
     else if (string.IsNullOrEmpty(krasStandardReflexResult.KRASStandardResult) == true)
     {
         result.Success = false;
         result.Message = "A BRAF V600E/K cannot be ordered because the KRAS result is not set.";
     }
     else
     {
         YellowstonePathology.Business.Test.KRASStandard.KRASStandardResultCollection resultCollection = YellowstonePathology.Business.Test.KRASStandard.KRASStandardResultCollection.GetAll();
         YellowstonePathology.Business.Test.KRASStandard.KRASStandardResult standardResult = resultCollection.GetResult(krasStandardReflexResult.KRASStandardTestOrder.ResultCode);
         if (standardResult is YellowstonePathology.Business.Test.KRASStandard.KRASStandardDetectedResult)
         {
             result.Success = false;
             result.Message = "A BRAF V600E/K cannot be ordered because the KRAS result shows a mutation has been detected.";
         }
     }
     return result;
 }
        private YellowstonePathology.Business.Rules.MethodResult IsSpecimenSourceSelected()
        {
            YellowstonePathology.Business.Rules.MethodResult result = new Business.Rules.MethodResult();
            result.Success = true;

            if (this.ListBoxSpecimenSource.SelectedItem == null)
            {
                result.Message = "Please select a specimen source.";
                result.Success = false;
            }
            return result;
        }
 public static YellowstonePathology.Business.Rules.MethodResult IsOkToUnFinalize(KRASStandardReflexResult krasStandardReflexResult)
 {
     YellowstonePathology.Business.Rules.MethodResult result = new Business.Rules.MethodResult();
     if (krasStandardReflexResult.KRASStandardTestOrder.Final == false)
     {
         result.Success = false;
         result.Message = "This case cannot be unfinalized because it is not final.";
     }
     return result;
 }
 private void ButtonAcidWashQNS_Click(object sender, RoutedEventArgs e)
 {
     YellowstonePathology.Business.Test.ThinPrepPap.PanelOrderAcidWash panelOrderAcidWash = (Business.Test.ThinPrepPap.PanelOrderAcidWash) this.ListBoxResults.SelectedItem;
     Business.Rules.MethodResult methodResult = panelOrderAcidWash.IsOkToAccept();
     panelOrderAcidWash.Comment = "QNS";
 }
        private YellowstonePathology.Business.Rules.MethodResult IsIcd9CodeNotBlank()
        {
            YellowstonePathology.Business.Rules.MethodResult result = new Business.Rules.MethodResult();
            result.Success = true;

            if (string.IsNullOrEmpty(this.TextBoxIcd9Code.Text) == true)
            {
                result.Message = "Please enter an ICD9 Code.";
                result.Success = false;
            }

            return result;
        }
Esempio n. 33
0
 public virtual YellowstonePathology.Business.Rules.MethodResult OrderTargetIsOk(YellowstonePathology.Business.Interface.IOrderTarget orderTarget)
 {
     YellowstonePathology.Business.Rules.MethodResult methodResult = new Business.Rules.MethodResult();
     methodResult.Success = true;
     return(methodResult);
 }
Esempio n. 34
0
        public Business.Rules.MethodResult Compare(DataTableReader sqlServerDataTableReader, DataTableReader mySqlDataTableReader)
        {
            this.m_SqlServerDataTableReader = sqlServerDataTableReader;
            this.m_MySqlDataTableReader = mySqlDataTableReader;
            this.m_MethodResult = new Business.Rules.MethodResult();
            this.m_StatementStart = "Update " + this.m_MigrationStatus.TableName + " set ";
            this.m_StatementEnd = " where " + this.m_MigrationStatus.KeyFieldName + " = KEYCOLUMNVALUE;";
            this.m_Fields = string.Empty;
            this.GetKeyValue();

            foreach (PropertyInfo property in this.m_MigrationStatus.PersistentProperties)
            {
                Type dataType = property.PropertyType;
                if (dataType == typeof(string))
                {
                    this.CompareString(property);
                }
                else if (dataType == typeof(int))
                {
                    this.CompareInt(property);
                }
                else if (dataType == typeof(double))
                {
                    this.CompareDouble(property);
                }
                else if (dataType == typeof(Nullable<int>))
                {
                    this.CompareNullableInt(property);
                }
                else if (dataType == typeof(Nullable<float>))
                {
                    this.CompareNullableDouble(property);
                }
                else if (dataType == typeof(Nullable<double>))
                {
                    this.CompareNullableDouble(property);
                }
                else if (dataType == typeof(DateTime))
                {
                    this.CompareDateTime(property);
                }
                else if (dataType == typeof(bool))
                {
                    this.CompareBoolean(property);
                }
                else if (dataType == typeof(Nullable<bool>))
                {
                    this.CompareNullableBoolean(property);
                }
                else if (dataType == typeof(Nullable<DateTime>))
                {
                    this.CompareNullableDateTime(property);
                }
                else
                {
                    throw new Exception("This Data Type is Not Implemented: " + dataType.Name);
                }
            }
            if(this.m_MethodResult.Success == false)
            {
                this.SetErrorMessage();
            }
            return this.m_MethodResult;
        }
        private YellowstonePathology.Business.Rules.MethodResult SetCloneResults(YellowstonePathology.Business.Test.LynchSyndrome.PanelSetOrderLynchSyndromeEvaluation clone)
        {
            YellowstonePathology.Business.Rules.MethodResult result = new Business.Rules.MethodResult();

            if (clone.Final == false)
            {
                YellowstonePathology.Business.Test.LynchSyndrome.LSEResult cloneLSEResult = this.SetCloneLSEResults(clone);
                cloneLSEResult.SetResults(this.m_AccessionOrder, clone);
            }
            else
            {
                result.Success = false;
                result.Message = "Results cannot be set because the case is final.";
            }
            return result;
        }
Esempio n. 36
0
        public Business.Rules.MethodResult CompareTable(MigrationStatus migrationStatus)
        {
            Business.Rules.MethodResult result = new Business.Rules.MethodResult();
            result.Message = "Missing columns: ";
            List<string> columnNames = this.RunTableQuery(migrationStatus.TableName);
            foreach(PropertyInfo property in migrationStatus.PersistentProperties)
            {
                bool found = false;
                foreach(string columnName in columnNames)
                {
                    if(columnName == property.Name)
                    {
                        found = true;
                        break;
                    }
                }

                if(found == false)
                {
                    result.Success = false;
                    result.Message += property.Name + ", ";
                }
            }
            return result;
        }