/// <see cref="Lab_Orders_have_Lab_TestsDAL.UpdateLab_Orders_have_Lab_Tests(Lab_Orders_have_Lab_Tests)"/> public bool EnterTestResults(Lab_Orders_have_Lab_Tests[] relations) { if (relations == null) { throw new ArgumentNullException("relations cannot be nulled"); } foreach (Lab_Orders_have_Lab_Tests relation in relations) { if (relation == null) { throw new ArgumentNullException("relation inside relations cannot be null"); } } using (TransactionScope scope = new TransactionScope()) { foreach (Lab_Orders_have_Lab_Tests relation in relations) { Lab_Orders_have_Lab_TestsDAL.UpdateLab_Orders_have_Lab_Tests(relation); } scope.Complete(); } return(true); }
/// <summary> /// Orders a new set of labs tests for a Visit /// </summary> /// <param name="order">The Lab_Order itself</param> /// <param name="relation">The relation of Lab_Orders_have_Lab_Tests</param> /// <returns>Whether or not the insertions succeeded</returns> public bool OrderLabs(Lab_Order order, Lab_Test[] tests) { if (order == null || tests == null) { throw new ArgumentNullException("order and tests cannot be null"); } if (order.VisitID == null) { throw new ArgumentNullException("order's visitID cannot be null"); } foreach (Lab_Test test in tests) { if (test.Code == null) { throw new ArgumentNullException("tests' Codes cannot be null"); } } using (TransactionScope scope = new TransactionScope()) { int?labOrderID = Lab_OrderDAL.InsertLab_Order(order); if (labOrderID == null) { throw new Exception("Invalid Lab Order"); } foreach (Lab_Test test in tests) { Lab_Orders_have_Lab_TestsDAL.InsertLab_Orders_have_Lab_Tests(new Lab_Orders_have_Lab_Tests(labOrderID, test.Code, null, null, null)); } scope.Complete(); } return(true); }
public List <LabOrderTestDTO> GetVisitTests(int visitId) { return(Lab_Orders_have_Lab_TestsDAL.GetVisitTests(visitId)); }
/// <see cref="Lab_Orders_have_Lab_TestsDAL.GetLab_Orders_have_Lab_Tests"/> public List <Lab_Orders_have_Lab_Tests> GetLab_Orders_have_Lab_Tests() { return(Lab_Orders_have_Lab_TestsDAL.GetLab_Orders_have_Lab_Tests()); }