feat(patvisits): add index method for paginated patient visits listing

This commit is contained in:
mahdahar 2026-02-12 07:24:17 +07:00
parent c19847a812
commit c38f9d2f91
3 changed files with 42 additions and 15 deletions

View File

@ -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: # list of languages for which language servers are started; choose from:
# al bash clojure cpp csharp # al bash clojure cpp csharp
# csharp_omnisharp dart elixir elm erlang # csharp_omnisharp dart elixir elm erlang
# fortran fsharp go groovy haskell # fortran fsharp go groovy haskell
# java julia kotlin lua markdown # java julia kotlin lua markdown
# matlab nix pascal perl php # matlab nix pascal perl php
# powershell python python_jedi r rego # php_phpactor powershell python python_jedi r
# ruby ruby_solargraph rust scala swift # rego ruby ruby_solargraph rust scala
# terraform toml typescript typescript_vts vue # swift terraform toml typescript typescript_vts
# yaml zig # vue yaml zig
# (This list may be outdated. For the current list, see values of Language enum here: # (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 # 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.) # For some languages, there are alternative language servers, e.g. csharp_omnisharp, ruby_solargraph.)
@ -16,8 +20,8 @@
# - For JavaScript, use typescript # - For JavaScript, use typescript
# - For Free Pascal/Lazarus, use pascal # - For Free Pascal/Lazarus, use pascal
# Special requirements: # Special requirements:
# - csharp: Requires the presence of a .sln file in the project folder. # Some languages require additional setup/installations.
# - pascal: Requires Free Pascal Compiler (fpc) and optionally Lazarus. # 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. # 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. # 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. # 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. # * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store.
excluded_tools: [] 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) # list of tools to include that would otherwise be disabled (particularly optional tools that are disabled by default)
included_optional_tools: [] 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 # 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. # 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. # 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). # This setting can, in turn, be overridden by CLI parameters (--mode).
default_modes: default_modes:
# fixed set of tools to use as the base tool set (if non-empty), replacing Serena's default set of tools. # initial prompt for the project. It will always be given to the LLM upon activating the project
# This cannot be combined with non-empty excluded_tools or included_optional_tools. # (contrary to the memories, which are loaded on demand).
fixed_tools: [] initial_prompt: ""

View File

@ -15,6 +15,20 @@ class PatVisitController extends BaseController {
$this->model = new PatVisitModel(); $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) { public function show($PVID = null) {
try { try {
$row = $this->model->show($PVID); $row = $this->model->show($PVID);

View File

@ -1391,10 +1391,21 @@ paths:
properties: properties:
status: status:
type: string type: string
message:
type: string
data: data:
type: array type: array
items: items:
$ref: '#/components/schemas/PatientVisit' $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: post:
tags: [Patient Visits] tags: [Patient Visits]