Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Add paging and sorting functionality to find all/search functionality #1969

Closed
jackcmeyer opened this issue Apr 5, 2020 · 4 comments · Fixed by #2026
Closed

Add paging and sorting functionality to find all/search functionality #1969

jackcmeyer opened this issue Apr 5, 2020 · 4 comments · Fixed by #2026
Assignees
Labels
core-team indicates that the issue will be completed by a core team member 🚀enhancement an issue/pull request that adds a feature to the application labs issue/pull request that interacts with labs module patients issue/pull request that interacts with patients module scheduling issue/pull request that interacts with scheduling module
Milestone

Comments

@jackcmeyer
Copy link
Member

🚀 Feature Proposal

Add paging and sorting functionality to the search/find all functions for patients, appointments, lab.

Motivation

  • Patient Search/List, Appointment List, Lab List
@jackcmeyer jackcmeyer self-assigned this Apr 5, 2020
@jackcmeyer jackcmeyer transferred this issue from HospitalRun/hospitalrun Apr 5, 2020
@jackcmeyer jackcmeyer added labs issue/pull request that interacts with labs module patients issue/pull request that interacts with patients module scheduling issue/pull request that interacts with scheduling module 🚀enhancement an issue/pull request that adds a feature to the application core-team indicates that the issue will be completed by a core team member labels Apr 5, 2020
@jackcmeyer jackcmeyer added this to the v2.0 milestone Apr 5, 2020
@akshay-ap
Copy link
Contributor

Can I take this one?

@jackcmeyer
Copy link
Member Author

Sounds good @akshay-ap.

i've already done sorting for the findAll, however, we need to implement it for search yet.

For this, I'm hoping we can end up with:

search(searchCriteria: SearchCriteria, sort?: SortRequest, page?: PageRequest)

and

findAll(sort?: SortRequest, page?: PageRequest)

if a page request is provided, it should return a Page<T> of whatever. Page should look like:

class Page {
	T[] content;
	size: number; // the size of the page
	number: number; // the page number of the returned page
    totalElements: number; // the total elements that would be returned by query
    totalPages: number; // total number of pages that would be for this query
	getNextPage(): Page<T>
    getPreviousPage(): Page<T>
    hasNextPage: boolean
    hasPreviousPage: boolean
}

Page request should look like:

interface PageRequest {
  number: number; // requested page number
  size: number; // requested size of the pages
}

sort and page should always be optional and if they are not provided then we should default to Unsorted and Unpaged.

paging and sorting should always be done at the PouchDB level

we should be able to support getting a specific page and getting the next and previous page.

@jackcmeyer jackcmeyer assigned akshay-ap and jackcmeyer and unassigned jackcmeyer Apr 23, 2020
@akshay-ap
Copy link
Contributor

@jackcmeyer Thanks for the pointers!

@jackcmeyer
Copy link
Member Author

@akshay-ap No worries, please let me know if you have any questions. I've done a little bit of research into this.

akshay-ap added a commit to akshay-ap/hospitalrun-frontend that referenced this issue Apr 27, 2020
akshay-ap added a commit to akshay-ap/hospitalrun-frontend that referenced this issue Apr 27, 2020
akshay-ap added a commit to akshay-ap/hospitalrun-frontend that referenced this issue Apr 28, 2020
akshay-ap added a commit to akshay-ap/hospitalrun-frontend that referenced this issue Apr 28, 2020
akshay-ap added a commit to akshay-ap/hospitalrun-frontend that referenced this issue Apr 28, 2020
matteovivona added a commit to akshay-ap/hospitalrun-frontend that referenced this issue Apr 29, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue Apr 29, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue Apr 30, 2020
akshay-ap added a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 1, 2020
Change Page interface, Fix failing tests

fix HospitalRun#1969
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 2, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 19, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 19, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 19, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 20, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 20, 2020
akshay-ap added a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 20, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 23, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 23, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 23, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 23, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 23, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 23, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 23, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 23, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 24, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 26, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 26, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 28, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 30, 2020
akshay-ap added a commit to akshay-ap/hospitalrun-frontend that referenced this issue May 31, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue Jun 2, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue Jun 2, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue Jun 3, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue Jun 4, 2020
matteovivona added a commit to akshay-ap/hospitalrun-frontend that referenced this issue Jun 5, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue Jun 7, 2020
ghost pushed a commit to akshay-ap/hospitalrun-frontend that referenced this issue Jun 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
core-team indicates that the issue will be completed by a core team member 🚀enhancement an issue/pull request that adds a feature to the application labs issue/pull request that interacts with labs module patients issue/pull request that interacts with patients module scheduling issue/pull request that interacts with scheduling module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants