Beispiel #1
0
        private void HistologyBlockScanReceived(YellowstonePathology.Business.BarcodeScanning.Barcode barcode)
        {
            this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Input, new System.Threading.ThreadStart(delegate()
            {
                if (this.m_SpecimenOrder.AliquotOrderCollection.Exists(barcode.ID))
                {
                    YellowstonePathology.Business.Facility.Model.Facility thisFacility = Business.Facility.Model.FacilityCollection.Instance.GetByFacilityId(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.FacilityId);
                    string thisLocation = YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.HostName;

                    YellowstonePathology.Business.Test.AliquotOrder aliquotOrder = this.m_SpecimenOrder.AliquotOrderCollection.GetByAliquotOrderId(barcode.ID);
                    string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();
                    YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLog materialTrackingLog = new Business.MaterialTracking.Model.MaterialTrackingLog(objectId, barcode.ID, null, thisFacility.FacilityId, thisFacility.FacilityName,
                                                                                                                                                                           thisLocation, "Block Scanned", "Block Scanned At Gross", "Aliquot", this.m_AccessionOrder.MasterAccessionNo, aliquotOrder.Label, aliquotOrder.ClientAccessioned, this.m_AccessionOrder.ClientAccessionNo);
                    YellowstonePathology.Business.Persistence.DocumentGateway.Instance.InsertDocument(materialTrackingLog, Window.GetWindow(this));

                    aliquotOrder.GrossVerify(this.m_SystemIdentity.User);
                    aliquotOrder.SetLocation(thisFacility, thisLocation);

                    this.GrossBlockManagementView = new Business.View.GrossBlockManagementView(this.m_AccessionOrder, this.m_CaseNotesDocument, this.m_SpecimenOrder);
                    this.SetupSpecimenView();

                    if (this.m_SpecimenOrder.AliquotOrderCollection.HasUnverifiedBlocks() == false)
                    {
                        CustomEventArgs.SpecimenOrderReturnEventArgs specimenOrderReturnEventArgs = new CustomEventArgs.SpecimenOrderReturnEventArgs(this.m_SpecimenOrder);
                        this.Next(this, specimenOrderReturnEventArgs);
                    }
                }
                else
                {
                    MessageBox.Show("The block scanned is not from this specimen.", "Scanned Block Mismatch", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                }
            }
                                                                                                                       ));
        }
Beispiel #2
0
        private void UpdateLocation()
        {
            YellowstonePathology.Business.Facility.Model.Facility facility = YellowstonePathology.Business.Facility.Model.FacilityCollection.Instance.GetByFacilityId(this.m_MaterialTrackingBatch.ToFacilityId);
            string location = this.m_MaterialTrackingBatch.ToLocation;

            foreach (YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLog materialTrackingLog in this.m_MaterialTrackingBatch.MaterialTrackingLogCollection)
            {
                switch (materialTrackingLog.MaterialType)
                {
                case "PSLD":
                case "NGYNSLD":
                case "FNASLD":
                case "Aliquot":
                case "Block":
                case "FrozenBlock":
                    YellowstonePathology.Business.Test.AliquotOrder aliquotOrder = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.PullAliquotOrder(materialTrackingLog.MaterialId, this);
                    aliquotOrder.SetLocation(facility, location);
                    YellowstonePathology.Business.Persistence.DocumentGateway.Instance.Push(this);
                    break;

                case "Slide":
                    YellowstonePathology.Business.Slide.Model.SlideOrder slideOrder = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.PullSlideOrder(materialTrackingLog.MaterialId, this);
                    slideOrder.SetLocation(facility, location);
                    YellowstonePathology.Business.Persistence.DocumentGateway.Instance.Push(this);
                    break;

                default:
                    break;
                }
            }
        }
Beispiel #3
0
 public void UpdateAliquotLocation(string aliquotOrderId)
 {
     if (this.m_AccessionOrder.AccessionLock.IsLockAquiredByMe == true)
     {
         YellowstonePathology.Business.Test.AliquotOrder aliiquotOrder = this.m_AccessionOrder.SpecimenOrderCollection.GetAliquotOrder(aliquotOrderId);
         if (aliiquotOrder != null)
         {
             aliiquotOrder.SetLocation(this.m_Facility, this.m_Location);
         }
     }
 }
        private void Bgw_DoWork(object sender, DoWorkEventArgs e)
        {
            YellowstonePathology.Business.Surgical.ProcessorRunCollection processorRunCollection = Business.Surgical.ProcessorRunCollection.GetAll();

            foreach (YellowstonePathology.Business.BarcodeScanning.EmbeddingScan embeddingScan in this.ListViewEmbeddingScans.Items)
            {
                this.m_BackgroundWorker.ReportProgress(0, embeddingScan.AliquotOrderId);

                if (embeddingScan.Updated == false)
                {
                    bool aliquotExists = YellowstonePathology.Business.Gateway.AccessionOrderGateway.DoesAliquotExist(embeddingScan.AliquotOrderId);
                    if (aliquotExists == true)
                    {
                        YellowstonePathology.Business.Test.AliquotOrder aliquotOrder = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.PullAliquotOrder(embeddingScan.AliquotOrderId, this);
                        aliquotOrder.EmbeddingVerify(YellowstonePathology.Business.User.SystemIdentity.Instance.User);

                        YellowstonePathology.Business.Facility.Model.Facility thisFacility = Business.Facility.Model.FacilityCollection.Instance.GetByFacilityId(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.FacilityId);
                        string thisLocation = YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.HostName;

                        this.AddMaterialTrackingLog(aliquotOrder, thisFacility, thisLocation);
                        aliquotOrder.SetLocation(thisFacility, thisLocation);

                        Business.ParseSpecimenOrderIdResult parseSpecimenOrderIdResult = aliquotOrder.ParseSpecimenOrderIdFromBlock();
                        if (parseSpecimenOrderIdResult.ParsedSuccessfully == true)
                        {
                            YellowstonePathology.Business.Specimen.Model.SpecimenOrder specimenOrder = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.PullSpecimenOrder(parseSpecimenOrderIdResult.SpecimenOrderId, this);
                            if (specimenOrder.OkToSetProcessorTimes(embeddingScan.ProcessorStartTime) == true)
                            {
                                specimenOrder.ProcessorStartTime    = embeddingScan.ProcessorStartTime;
                                specimenOrder.ProcessorFixationTime = Convert.ToInt32(embeddingScan.ProcessorFixationDuration.Value.TotalMinutes);
                                specimenOrder.SetFixationEndTime();
                                specimenOrder.SetFixationDuration();
                            }
                        }
                        else
                        {
                            MessageBox.Show("Unable to parse the Block Id. Please tell Sid.");
                        }

                        YellowstonePathology.Business.Persistence.DocumentGateway.Instance.Save();
                        this.m_AliquotOrderHoldCollection = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetAliquotOrderHoldCollection();
                        embeddingScan.Updated             = true;
                        this.m_EmbeddingScanCollection.UpdateStatus(embeddingScan);
                    }
                    else
                    {
                        this.m_AliquotsNotFoundList.Add(embeddingScan.AliquotOrderId);
                    }
                }
            }

            if (this.m_AliquotsNotFoundList.Count > 0)
            {
                StringBuilder msg = new StringBuilder();
                foreach (string id in this.m_AliquotsNotFoundList)
                {
                    msg.AppendLine(id);
                }
                MessageBox.Show("The following Blocks were not found." + Environment.NewLine + msg.ToString());
                this.m_AliquotsNotFoundList.Clear();
            }
        }