public bool CanBuild(Business.Test.AccessionOrder accessionOrder, string testOrderId, string slideOrderId) { bool result = false; Business.Test.PanelOrder panelOrder = accessionOrder.PanelSetOrderCollection.GetPanelOrderByTestOrderId(testOrderId); Business.User.SystemUser orderedBy = Business.User.SystemUserCollectionInstance.Instance.SystemUserCollection.GetSystemUserById(panelOrder.OrderedById); Business.Test.AliquotOrder aliquotOrder = accessionOrder.SpecimenOrderCollection.GetAliquotOrderByTestOrderId(testOrderId); Business.Test.Model.TestOrder testOrder = panelOrder.TestOrderCollection.Get(testOrderId); Business.Slide.Model.SlideOrder slideOrder = aliquotOrder.SlideOrderCollection.GetSlideOrderByTestOrderId(testOrderId); Business.Specimen.Model.SpecimenOrder specimenOrder = accessionOrder.SpecimenOrderCollection.GetSpecimenOrderByAliquotOrderId(aliquotOrder.AliquotOrderId); Business.Stain.Model.Stain stain = Business.Stain.Model.StainCollection.Instance.GetStainByTestId(testOrder.TestId); if (stain != null) { result = true; if (slideOrder.UseWetProtocol == true) { result = false; if (stain.HasWetProtocol == true || stain.UseWetProtocol == true) { result = true; } } } return(result); }
public void PrintLabels(Business.Test.AccessionOrder accessionOrder, Business.Test.AliquotOrder aliquotOrder) { Business.Test.Model.Test kappa = YellowstonePathology.Business.Test.Model.TestCollectionInstance.GetClone("360"); // KappaByISH(); Business.Test.Model.Test lambda = YellowstonePathology.Business.Test.Model.TestCollectionInstance.GetClone("361"); // LambdaByISH(); Business.Test.Model.Test u6 = YellowstonePathology.Business.Test.Model.TestCollectionInstance.GetClone("383"); // U6(); //add test order that need to be ordered automatically if (accessionOrder.PanelSetOrderCollection.DoesStainOrderExist(kappa.TestId) == true && accessionOrder.PanelSetOrderCollection.DoesStainOrderExist(lambda.TestId) == true) { if (accessionOrder.PanelSetOrderCollection.DoesStainOrderExist(u6.TestId) == false) { Business.Test.PanelSetOrder panelSetOrder = accessionOrder.PanelSetOrderCollection.GetPanelSetOrderByTestId(kappa.TestId); YellowstonePathology.Business.Visitor.OrderTestVisitor orderTestVisitor = new Business.Visitor.OrderTestVisitor(panelSetOrder.ReportNo, u6, null, null, false, aliquotOrder, false, false, accessionOrder.TaskOrderCollection); accessionOrder.TakeATrip(orderTestVisitor); this.Add(new TestOrderPanelSetOrderView(panelSetOrder, orderTestVisitor.TestOrder)); } } //add slides and print. foreach (TestOrderPanelSetOrderView item in this) { Business.Test.Model.TestOrder testOrder = accessionOrder.PanelSetOrderCollection.GetTestOrderByTestOrderId(item.TestOrderId); if (testOrder.SlideOrderCollection.Count == 0) { YellowstonePathology.Business.Visitor.AddSlideOrderVisitor addSlideOrderVisitor = new Business.Visitor.AddSlideOrderVisitor(aliquotOrder, testOrder); accessionOrder.TakeATrip(addSlideOrderVisitor); Business.HL7View.VentanaStainOrder ventanaStainOrder = new Business.HL7View.VentanaStainOrder(); ventanaStainOrder.HandleOrder(accessionOrder, addSlideOrderVisitor.NewSlideOrder); } } }
public TestOrderPanelSetOrderView(YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder, YellowstonePathology.Business.Test.Model.TestOrder testOrder) { this.m_PanelSetOrder = panelSetOrder; this.m_TestOrder = testOrder; this.m_ReportNo = panelSetOrder.ReportNo; this.m_PanelSetName = panelSetOrder.PanelSetName; this.m_TestAbbreviation = testOrder.TestAbbreviation; this.m_TestOrderId = testOrder.TestOrderId; this.m_OrderedAsDual = testOrder.OrderedAsDual; this.Update(); }
public string Build(Business.Test.AccessionOrder accessionOrder, string testOrderId, string slideOrderId) { //protoc -I d:/protogen --csharp_out d:/protogen/result d:/protogen/ventana.proto --grpc_out d:/protogen/result --plugin=protoc-gen-grpc=grpc_csharp_plugin.exe Channel channel = new Channel("10.1.2.70:30051", ChannelCredentials.Insecure); //Channel channel = new Channel("10.1.1.54:50051", ChannelCredentials.Insecure); Ventana.VentanaService.VentanaServiceClient ventanaServiceClient = new Ventana.VentanaService.VentanaServiceClient(channel); Ventana.OrderRequest orderRequest = new Ventana.OrderRequest(); Business.Test.PanelOrder panelOrder = accessionOrder.PanelSetOrderCollection.GetPanelOrderByTestOrderId(testOrderId); Business.User.SystemUser orderedBy = Business.User.SystemUserCollectionInstance.Instance.SystemUserCollection.GetSystemUserById(panelOrder.OrderedById); Business.Test.AliquotOrder aliquotOrder = accessionOrder.SpecimenOrderCollection.GetAliquotOrderByTestOrderId(testOrderId); Business.Test.Model.TestOrder testOrder = panelOrder.TestOrderCollection.Get(testOrderId); Business.Slide.Model.SlideOrder slideOrder = aliquotOrder.SlideOrderCollection.Get(slideOrderId); Business.Specimen.Model.SpecimenOrder specimenOrder = accessionOrder.SpecimenOrderCollection.GetSpecimenOrderByAliquotOrderId(aliquotOrder.AliquotOrderId); Business.Stain.Model.Stain stain = Business.Stain.Model.StainCollection.Instance.GetStainByTestId(testOrder.TestId); string ventanaBarcode = stain.VentanaBenchMarkId.ToString(); string ventanaProtocolName = stain.VentanaBenchMarkProtocolName; if (slideOrder.UseWetProtocol == true) { if (stain.HasWetProtocol == true) { ventanaBarcode = stain.VentanaBenchMarkWetId.ToString(); ventanaProtocolName = stain.VentanaBenchMarkWetProtocolName; } } orderRequest.Msh = new Ventana.msh(); orderRequest.Msh.SendingApplication = "YPILIS"; orderRequest.Msh.SendingFacility = "YPI"; orderRequest.Msh.ReceivingApplication = "Ventana"; orderRequest.Msh.ReceivingFacility = "YPI"; orderRequest.Msh.DateTimeOfMessage = DateTime.Now.ToString("yyyyMMddHHmmss"); orderRequest.Msh.MessageType = "OML^O21"; orderRequest.Msh.MessageControlId = MongoDB.Bson.ObjectId.GenerateNewId().ToString(); orderRequest.Pid = new Ventana.pid(); orderRequest.Pid.FirstName = accessionOrder.PFirstName; orderRequest.Pid.LastName = accessionOrder.PLastName; orderRequest.Pid.MiddleInitial = string.IsNullOrEmpty(accessionOrder.PMiddleInitial) ? string.Empty : accessionOrder.PMiddleInitial; orderRequest.Pid.Birthdate = accessionOrder.PBirthdate.Value.ToString("yyyyMMdd"); orderRequest.Pid.Sex = accessionOrder.PSex; orderRequest.Pv1 = new Ventana.pv1(); orderRequest.Pv1.RequestingPhysicianFirstname = orderedBy.FirstName; orderRequest.Pv1.RequestingPhysicianLastname = orderedBy.LastName; orderRequest.Pv1.RequestingPhysicianNpi = string.IsNullOrEmpty(orderedBy.NationalProviderId) ? "NOTAPPLICABLE" : orderedBy.NationalProviderId; orderRequest.Sac = new Ventana.sac(); orderRequest.Sac.RegistrationDateTime = accessionOrder.AccessionTime.Value.ToString("yyyyMMddHHmm"); Ventana.stain_order stainOrder = new Ventana.stain_order(); Ventana.orc orc = new Ventana.orc(); orc.OrderControl = "NW"; orc.PlacerOrderNumber = accessionOrder.MasterAccessionNo; orc.SiteName = "YPI"; orc.SiteDescription = "Yellowstone Pathology"; orc.FacilityCode = "YPI"; orc.FacilityName = "Yellowstone Pathology"; stainOrder.Orc = orc; Ventana.obr obr = new Ventana.obr(); obr.OrderSequenceId = "1"; obr.PlacerOrderNumber = accessionOrder.MasterAccessionNo; obr.ProtocolNumber = ventanaBarcode; obr.ProtocolName = ventanaProtocolName; obr.OrderType = "STAIN"; obr.ObservationDateTime = DateTime.Now.ToString("yyyyMMddHHmm"); if (string.IsNullOrEmpty(specimenOrder.SpecimenId) == false) { obr.SpecimenName = specimenOrder.SpecimenId; } else { obr.SpecimenName = "NONE"; } obr.SpecimenDescription = specimenOrder.Description; obr.SurgicalProcedureName = "Surgical Pathology"; obr.PathologistNpi = string.IsNullOrEmpty(orderedBy.NationalProviderId) ? "NOTAPPLICABLE" : orderedBy.NationalProviderId; obr.PathologistLastname = orderedBy.LastName; obr.PathologistFirstname = orderedBy.FirstName; obr.SlideId = "HSLD" + slideOrder.SlideOrderId; obr.SlideSequence = Business.Specimen.Model.Slide.GetSlideNumber(slideOrder.Label); obr.Blockid = aliquotOrder.AliquotOrderId; obr.BlockSequence = Business.Specimen.Model.Block.GetBlockLetter(aliquotOrder.Label); obr.SpecimenId = specimenOrder.SpecimenOrderId; obr.SpecimenSequence = specimenOrder.SpecimenNumber.ToString(); stainOrder.Obr = obr; orderRequest.StainOrders.Add(stainOrder); Ventana.OrderReply orderReply = ventanaServiceClient.buildOrder(orderRequest); return(orderReply.Message); }