Skip to content

Commit

Permalink
Add StartIndex to getObservation api
Browse files Browse the repository at this point in the history
  • Loading branch information
ODORA0 committed Dec 6, 2024
1 parent 1bf5bea commit 6bcaeda
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,14 @@ public ModelAndView handleRequest(HttpServletRequest request, HttpServletRespons

if (Context.hasPrivilege(PrivilegeConstants.GET_OBS)) {
Integer limit = getLimitParameter(request, as, "dashboard.observations.maximumNumberToShow");
Integer startIndex = getStartIndexParameter(request);

Person person = (Person) p;
List<Person> persons = Collections.singletonList(person);

// Get most recent observations using limit parameter
List<Obs> paginatedObs = Context.getObsService().getObservations(persons, null, null, null, null,
null, Collections.singletonList("obsDatetime desc"), limit, null, null, null, false);
List<Obs> paginatedObs = Context.getObsService().getObservations(persons, null, null, null, null, null,
Collections.singletonList("obsDatetime desc"), limit, startIndex, null, null, false);

model.put("limit", limit);
model.put("patientObs", paginatedObs);
Expand Down

0 comments on commit 6bcaeda

Please sign in to comment.