From c38f9d2f914aa58a65dd6faf90b98f448cf4347d Mon Sep 17 00:00:00 2001 From: mahdahar <89adham@gmail.com> Date: Thu, 12 Feb 2026 07:24:17 +0700 Subject: [PATCH] feat(patvisits): add index method for paginated patient visits listing --- .serena/project.yml | 32 ++++++++++++++------------ app/Controllers/PatVisitController.php | 14 +++++++++++ public/api-docs.yaml | 11 +++++++++ 3 files changed, 42 insertions(+), 15 deletions(-) diff --git a/.serena/project.yml b/.serena/project.yml index 02bc3e8..25a9e29 100644 --- a/.serena/project.yml +++ b/.serena/project.yml @@ -1,13 +1,17 @@ +# the name by which the project can be referenced within Serena +project_name: "clqms01-be" + + # list of languages for which language servers are started; choose from: # al bash clojure cpp csharp # csharp_omnisharp dart elixir elm erlang # fortran fsharp go groovy haskell # java julia kotlin lua markdown # matlab nix pascal perl php -# powershell python python_jedi r rego -# ruby ruby_solargraph rust scala swift -# terraform toml typescript typescript_vts vue -# yaml zig +# php_phpactor powershell python python_jedi r +# rego ruby ruby_solargraph rust scala +# swift terraform toml typescript typescript_vts +# vue yaml zig # (This list may be outdated. For the current list, see values of Language enum here: # https://github.com/oraios/serena/blob/main/src/solidlsp/ls_config.py # For some languages, there are alternative language servers, e.g. csharp_omnisharp, ruby_solargraph.) @@ -16,8 +20,8 @@ # - For JavaScript, use typescript # - For Free Pascal/Lazarus, use pascal # Special requirements: -# - csharp: Requires the presence of a .sln file in the project folder. -# - pascal: Requires Free Pascal Compiler (fpc) and optionally Lazarus. +# Some languages require additional setup/installations. +# See here for details: https://oraios.github.io/serena/01-about/020_programming-languages.html#language-servers # When using multiple languages, the first language server that supports a given file will be used for that file. # The first language is the default language and the respective language server will be used as a fallback. # Note that when using the JetBrains backend, language servers are not used and this list is correspondingly ignored. @@ -81,15 +85,13 @@ read_only: false # * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store. excluded_tools: [] -# initial prompt for the project. It will always be given to the LLM upon activating the project -# (contrary to the memories, which are loaded on demand). -initial_prompt: "" -# the name by which the project can be referenced within Serena -project_name: "clqms01" - # list of tools to include that would otherwise be disabled (particularly optional tools that are disabled by default) included_optional_tools: [] +# fixed set of tools to use as the base tool set (if non-empty), replacing Serena's default set of tools. +# This cannot be combined with non-empty excluded_tools or included_optional_tools. +fixed_tools: [] + # list of mode names to that are always to be included in the set of active modes # The full set of modes to be activated is base_modes + default_modes. # If the setting is undefined, the base_modes from the global configuration (serena_config.yml) apply. @@ -105,6 +107,6 @@ base_modes: # This setting can, in turn, be overridden by CLI parameters (--mode). default_modes: -# fixed set of tools to use as the base tool set (if non-empty), replacing Serena's default set of tools. -# This cannot be combined with non-empty excluded_tools or included_optional_tools. -fixed_tools: [] +# initial prompt for the project. It will always be given to the LLM upon activating the project +# (contrary to the memories, which are loaded on demand). +initial_prompt: "" diff --git a/app/Controllers/PatVisitController.php b/app/Controllers/PatVisitController.php index bea238f..2e605a8 100644 --- a/app/Controllers/PatVisitController.php +++ b/app/Controllers/PatVisitController.php @@ -15,6 +15,20 @@ class PatVisitController extends BaseController { $this->model = new PatVisitModel(); } + public function index() { + try { + $page = $this->request->getVar('page') ?? 1; + $perPage = $this->request->getVar('per_page') ?? 50; + $rows = $this->model->paginate($perPage, 'default', $page); + $total = $this->model->countAllResults(false); + if($rows == []) { $message = "data not found"; } + else { $message = "data found"; } + return $this->respond(['status' => 'success', 'message'=> $message, 'data' => $rows, 'total' => $total, 'page' => $page, 'per_page' => $perPage ], 200); + } catch (\Exception $e) { + return $this->failServerError('Something went wrong '.$e->getMessage()); + } + } + public function show($PVID = null) { try { $row = $this->model->show($PVID); diff --git a/public/api-docs.yaml b/public/api-docs.yaml index 025d4af..144bbf3 100644 --- a/public/api-docs.yaml +++ b/public/api-docs.yaml @@ -1391,10 +1391,21 @@ paths: properties: status: type: string + message: + type: string data: type: array items: $ref: '#/components/schemas/PatientVisit' + total: + type: integer + description: Total number of records + page: + type: integer + description: Current page number + per_page: + type: integer + description: Number of records per page post: tags: [Patient Visits]