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")))); } }