private void HandleAddAliquotOnOrder()
        {
            if (this.m_PanelSet.AddAliquotOnOrder == true)
            {
                YellowstonePathology.Business.Specimen.Model.SpecimenOrder specimenOrder = null;
                if (this.m_TestOrderInfo.OrderTarget is Business.Specimen.Model.SpecimenOrder)
                {
                    specimenOrder = (YellowstonePathology.Business.Specimen.Model.SpecimenOrder) this.m_OrderTarget;
                }
                else
                {
                    YellowstonePathology.Business.Test.AliquotOrder aliquotOrderOrderedOn = (YellowstonePathology.Business.Test.AliquotOrder) this.m_TestOrderInfo.OrderTarget;
                    specimenOrder = this.m_AccessionOrder.SpecimenOrderCollection.GetSpecimenOrderByAliquotOrderId(aliquotOrderOrderedOn.AliquotOrderId);
                }

                YellowstonePathology.Business.Test.AliquotOrder aliquotOrder = null;

                if (specimenOrder.AliquotOrderCollection.Exists(this.m_PanelSet.AliquotToAddOnOrder) == false)
                {
                    aliquotOrder = specimenOrder.AliquotOrderCollection.AddAliquot(this.m_PanelSet.AliquotToAddOnOrder, specimenOrder, DateTime.Now);
                    this.m_TestOrderInfo.OrderTarget = aliquotOrder;
                }
                else
                {
                    aliquotOrder = specimenOrder.AliquotOrderCollection.Get(this.m_PanelSet.AliquotToAddOnOrder);
                    this.m_TestOrderInfo.OrderTarget = aliquotOrder;
                }
            }
        }
        public OrderTestAuditVisitor(YellowstonePathology.Business.Test.Model.TestOrder testOrder, YellowstonePathology.Business.Test.AliquotOrder aliquotOrder)
            : base(true, true)
        {
            this.m_TestOrder = testOrder;
            this.m_AliquotOrder = aliquotOrder;

            this.m_TestOrderHasBeenAddedToRightSide = false;
            this.m_TestOrderHasBeenAddedToLeftSide = false;
            this.m_TestOrderIsInUnacknowledgedPanelOrder = false;
            this.m_StainResultHasBeenAdded = false;
            this.m_ICHasBeenAdded = false;

            this.HandleItemsWhereVisitingIsNotNecessary();
        }
        public OrderTestAuditVisitor(YellowstonePathology.Business.Test.Model.TestOrder testOrder, YellowstonePathology.Business.Test.AliquotOrder aliquotOrder)
            : base(true, true)
        {
            this.m_TestOrder    = testOrder;
            this.m_AliquotOrder = aliquotOrder;

            this.m_TestOrderHasBeenAddedToRightSide      = false;
            this.m_TestOrderHasBeenAddedToLeftSide       = false;
            this.m_TestOrderIsInUnacknowledgedPanelOrder = false;
            this.m_StainResultHasBeenAdded = false;
            this.m_ICHasBeenAdded          = false;

            this.HandleItemsWhereVisitingIsNotNecessary();
        }
        private void HandlePantherOrder()
        {
            if (this.m_PanelSet.SendOrderToPanther == true)
            {
                YellowstonePathology.Business.Test.AliquotOrder            aliquotOrder  = (YellowstonePathology.Business.Test.AliquotOrder) this.m_TestOrderInfo.OrderTarget;
                YellowstonePathology.Business.Specimen.Model.SpecimenOrder specimenOrder = this.m_AccessionOrder.SpecimenOrderCollection.GetSpecimenOrderByAliquotOrderId(aliquotOrder.AliquotOrderId);

                YellowstonePathology.Business.HL7View.Panther.PantherAssay pantherAssay = null;
                switch (this.m_PanelSetOrder.PanelSetId)
                {
                case 14:
                    pantherAssay = new Business.HL7View.Panther.PantherAssayHPV();
                    break;

                case 3:
                    pantherAssay = new Business.HL7View.Panther.PantherAssayNGCT();
                    break;

                case 62:
                case 269:
                    pantherAssay = new Business.HL7View.Panther.PantherAssayHPV1618();
                    break;

                case 61:
                    pantherAssay = new Business.HL7View.Panther.PantherAssayTrich();
                    break;

                default:
                    throw new Exception(this.m_PanelSetOrder.PanelSetName + " is mot implemented yet.");
                }

                this.m_PanelSetOrder.OrderedOnId         = aliquotOrder.AliquotOrderId;
                this.m_PanelSetOrder.OrderedOn           = YellowstonePathology.Business.Specimen.Model.OrderedOn.Aliquot;
                this.m_PanelSetOrder.InstrumentOrderDate = DateTime.Now;

                YellowstonePathology.Business.HL7View.Panther.PantherOrder pantherOrder = new Business.HL7View.Panther.PantherOrder(pantherAssay, specimenOrder, aliquotOrder, this.m_AccessionOrder, this.m_PanelSetOrder, YellowstonePathology.Business.HL7View.Panther.PantherActionCode.NewSample);
                pantherOrder.Send();
            }
        }
        public virtual void HandleTestOrders(YellowstonePathology.Business.Panel.Model.Panel panel, YellowstonePathology.Business.Test.PanelOrder panelOrder)
        {
            if (this.m_OrderTarget is YellowstonePathology.Business.Test.AliquotOrder)
            {
                YellowstonePathology.Business.Test.AliquotOrder aliquotOrder = (YellowstonePathology.Business.Test.AliquotOrder) this.m_OrderTarget;
                foreach (YellowstonePathology.Business.Test.Model.Test test in panel.TestCollection)
                {
                    string testOrderObjectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();
                    YellowstonePathology.Business.Test.Model.TestOrder testOrder = panelOrder.TestOrderCollection.Add(panelOrder.PanelOrderId, testOrderObjectId, aliquotOrder.AliquotOrderId, test, test.OrderComment);

                    aliquotOrder.TestOrderCollection.Add(testOrder);
                    aliquotOrder.SetLabelPrefix(testOrder, true);
                }
            }
            else
            {
                foreach (YellowstonePathology.Business.Test.Model.Test test in panel.TestCollection)
                {
                    string testOrderObjectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();
                    YellowstonePathology.Business.Test.Model.TestOrder testOrder = panelOrder.TestOrderCollection.Add(panelOrder.PanelOrderId, testOrderObjectId, null, test, test.OrderComment);
                }
            }
        }