Skip to content

Allow setting of Admin API page size from request #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
s1monj opened this issue Mar 28, 2025 · 1 comment
Closed

Allow setting of Admin API page size from request #46

s1monj opened this issue Mar 28, 2025 · 1 comment
Assignees
Labels
backend Python and SQL code enhancement New feature or request

Comments

@s1monj
Copy link
Collaborator

s1monj commented Mar 28, 2025

  • Backend only
  • The user should be able to select the page size from the front end dropdown (eg 20, 100, 500, 1000 per page)
  • I think this is achieved using custom paginator
  • This is only for Admin API not FHIR API
from rest_framework.pagination import PageNumberPagination

class PageSizePagination(PageNumberPagination):
    page_size = 20  # Default page size
    page_size_query_param = 'page_size'  # Allow users to specify page size
    max_page_size = 1000  # Optional: Set a maximum limit
settings.py

REST_FRAMEWORK = {
    'DEFAULT_PAGINATION_CLASS': 'path.to.CustomPagination',
    'PAGE_SIZE': 20,
}
GET /api/v1/observations?organizationId=20013&studyId=30001&page=2&pageSize=5
@s1monj s1monj added backend Python and SQL code enhancement New feature or request labels Mar 28, 2025
@travis-sauer-oltech
Copy link
Collaborator

@s1monj

PR: #50

@travis-sauer-oltech travis-sauer-oltech moved this from In Progress to Done in jupyterhealth-exchange Apr 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Python and SQL code enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

2 participants