internal List <TestModel> GetTestsBySpecificLabBranches(FilterBranchLabModel branchObj) { List <TestModel> response = new List <TestModel>(); try { response = checkUpContext.Tests.Where(w => w.branchId == branchObj.labBranchFireBaseId && branchObj.Status.Contains(w.status) ).OrderByDescending(o => o.dateRequestFormat).Select(s => new TestModel() { id = s.Id, dateRequest = s.dateRequest, userId = s.userId, userIdDB = s.userIdDB, description = s.description, isFromHome = s.isFromHome, timeRequest = s.timeRequest, dateForTakingSample = s.dateForTakingSample, timeForTakingSample = s.timeForTakingSample, dateResult = s.dateResult, timeResult = s.timeResult, branchId = s.branchId, branchIdDB = s.branchIdDB, labId = s.labId, labIdDB = s.labIdDB, addressId = s.addressId, hba1c = s.hba1c, status = s.status, isNotified = s.isNotified, totalCost = s.totalCost, precautions = s.precautions, employeeId = s.employeeId, radioReason = s.radioReason, generatedCode = s.generatedCode, timeStampRequest = s.timeStampRequest, testName = s.TestNames.Select(a => a.Name).ToList(), resultFilespaths = s.ResultFilespaths.Select(a => a.Name).ToList(), roushettaPaths = s.RoushettaPaths.Select(a => a.Name).ToList(), refuseReason = s.refuseReason, dateRequestFormat = s.dateRequestFormat }).OrderByDescending(o => o.dateRequestFormat).ToList(); } catch (Exception) { response = null; } return(response); }
public List <TestModel> GetTestsBySpecificLabBranches([FromBody] FilterBranchLabModel branchObj) { return(analysisManager.GetTestsBySpecificLabBranches(branchObj)); }