private void HandlePanelSetOrder() { ClientOrder.Model.ExternalOrderIdsCollection externalOrderIdsCollection = ClientOrder.Model.ExternalOrderIdsCollection.FromFormattedValue(this.m_AccessionOrder.ExternalOrderId); string externalOrderId = externalOrderIdsCollection.GetExternalOrderId(this.m_PanelSet.PanelSetId); string universalServiceId = externalOrderIdsCollection.GetUniversalServiceId(this.m_PanelSet.PanelSetId); this.m_ReportNo = this.m_AccessionOrder.GetNextReportNo(this.m_PanelSet); string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString(); bool distribute = true; if (this.m_TestOrderInfo.Distribute.HasValue == true) { distribute = this.m_TestOrderInfo.Distribute.Value; } else if (this.m_PanelSet.NeverDistribute == true) { distribute = false; } this.m_PanelSetOrder = null; if (this.m_PanelSet.HasNoOrderTarget == true) { this.m_PanelSetOrder = YellowstonePathology.Business.Test.PanelSetOrderFactory.CreatePanelSetOrder(this.m_AccessionOrder.MasterAccessionNo, this.m_ReportNo, objectId, this.m_PanelSet, distribute); } else { if (this.m_OrderTargetIsKnow == false) { this.m_OrderTarget = this.m_AccessionOrder.SpecimenOrderCollection.GetOrderTarget(this.m_PanelSet.OrderTargetTypeCollectionRestrictions); } this.m_PanelSetOrder = YellowstonePathology.Business.Test.PanelSetOrderFactory.CreatePanelSetOrder(this.m_AccessionOrder.MasterAccessionNo, this.m_ReportNo, objectId, this.m_PanelSet, this.m_OrderTarget, distribute); } this.m_PanelSetOrder.ExternalOrderId = externalOrderId; if (string.IsNullOrEmpty(universalServiceId) == false) { this.m_PanelSetOrder.UniversalServiceId = universalServiceId; } this.m_AccessionOrder.PanelSetOrderCollection.Add(this.m_PanelSetOrder); this.m_AccessionOrder.PanelSetOrderCollection.UpdateWHPExpectedFinalTimeOnOrder(this.m_PanelSetOrder); this.m_AccessionOrder.UpdateCaseAssignment(this.m_PanelSetOrder); this.m_TestOrderInfo.PanelSetOrder = this.m_PanelSetOrder; }
private void HandlePanelSetOrder() { this.m_ReportNo = this.m_AccessionOrder.GetNextReportNo(this.m_PanelSet); string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString(); bool distribute = this.m_TestOrderInfo.Distribute; if (this.m_PanelSet.NeverDistribute == true) { distribute = false; } this.m_PanelSetOrder = null; if (this.m_PanelSet.HasNoOrderTarget == true) { this.m_PanelSetOrder = YellowstonePathology.Business.Test.PanelSetOrderFactory.CreatePanelSetOrder(this.m_AccessionOrder.MasterAccessionNo, this.m_ReportNo, objectId, this.m_PanelSet, distribute); } else { if (this.m_OrderTargetIsKnow == false) { this.m_OrderTarget = this.m_AccessionOrder.SpecimenOrderCollection.GetOrderTarget(this.m_PanelSet.OrderTargetTypeCollectionRestrictions); } this.m_PanelSetOrder = YellowstonePathology.Business.Test.PanelSetOrderFactory.CreatePanelSetOrder(this.m_AccessionOrder.MasterAccessionNo, this.m_ReportNo, objectId, this.m_PanelSet, this.m_OrderTarget, distribute); } this.m_AccessionOrder.PanelSetOrderCollection.Add(this.m_PanelSetOrder); this.m_AccessionOrder.UpdateCaseAssignment(this.m_PanelSetOrder); this.m_TestOrderInfo.PanelSetOrder = this.m_PanelSetOrder; }