public ActionResult GetTestTitles() { var testResponseModel = new TestResponseModel(); var testTitles = testsService.GetTestTitles().ToList(); List <TestTitleDto> testTitlesDtos = new List <TestTitleDto>(); testTitles.ForEach(testTitle => testTitlesDtos.Add((new TestTitleDto()).GetTestTitleDto(testTitle))); testResponseModel.TestTitles = testTitlesDtos; testResponseModel.Groups = GetTestGroupTypeDtos(testsService.GetTestGroups().ToList()); if (testTitlesDtos != null) { return(Ok(GetResponse(ResponseType.OBJECT, ResponseStatusCode.SUCCESS, testResponseModel))); } else { return(Ok(GetResponse(ResponseType.FAIL, ResponseStatusCode.FAIL, GetError(ErrorCodes.dataNotFound, "No test title found", "Please add a test title")))); } }
public ActionResult GetPatients() { var responseModel = new PatientResponseModel(); responseModel.PatientDetails = GetPatientDtos(); responseModel.TestGroups = testService.GetTestGroups().ToList(); responseModel.TestTitles = testService.GetTestTitles().ToList(); responseModel.Initials = otherService.GetInitials().ToList(); responseModel.Genders = otherService.GetGenders().ToList(); responseModel.RegistrationTypes = otherService.GetReferredByTypes().ToList(); responseModel.HdlRegistrations = dhlRegistrationService.GetDhlRegistrations().HdlRegistrations; responseModel.FieldOptions = maintenanceService.GetFieldOptions().FieldOptions; if (responseModel != null) { return(Ok(GetResponse(ResponseType.OBJECT, ResponseStatusCode.SUCCESS, responseModel))); } else { return(Ok(GetResponse(ResponseType.FAIL, ResponseStatusCode.FAIL, GetError(ErrorCodes.dataNotFound, "No patients found", "Please register a patient")))); } }