# org.openelisglobal.common.exception.LIMSRuntimeException: Error in Patient getPageOfPatients()

**URL:** <https://talk.openelis-global.org/t/org-openelisglobal-common-exception-limsruntimeexception-error-in-patient-getpageofpatients/821>\
**Category:** Ask OpenELIS\
**Created:** [July 19, 2024, 5:48am UTC](https://talk.openelis-global.org/t/org-openelisglobal-common-exception-limsruntimeexception-error-in-patient-getpageofpatients/821 "2024-07-19T05:48:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Agaba\_Derrick\_Junior](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/agaba_derrick_junior/32/503_2.png) [@Agaba\_Derrick\_Junior](https://talk.openelis-global.org/u/Agaba_Derrick_Junior)\
**Post date:** [July 19, 2024, 5:48am UTC](https://talk.openelis-global.org/t/org-openelisglobal-common-exception-limsruntimeexception-error-in-patient-getpageofpatients/821/1 "2024-07-19T05:48:48Z")

</div>

hello community anyone who has an Idea on a blocker I’m facing  
I’m trying to [test a method getPageOfPatients](https://pastebin.com/AfudZqYP)  
when i run it i run into an Exception error of

org.openelisglobal.common.exception.LIMSRuntimeException: Error in Patient getPageOfPatients()  
@mherman22 @Moses_Mutesasira @rahul6603

---

<div class="post-metadata">

**Author:** ![mherman22](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/mherman22/32/92_2.png) [@mherman22](https://talk.openelis-global.org/u/mherman22)\
**Post date:** [July 19, 2024, 6:20am UTC](https://talk.openelis-global.org/t/org-openelisglobal-common-exception-limsruntimeexception-error-in-patient-getpageofpatients/821/2 "2024-07-19T06:20:17Z")

</div>

An entire error would really help. Kindly share it

---

<div class="post-metadata">

**Author:** ![Agaba\_Derrick\_Junior](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/agaba_derrick_junior/32/503_2.png) [@Agaba\_Derrick\_Junior](https://talk.openelis-global.org/u/Agaba_Derrick_Junior)\
**Post date:** [July 19, 2024, 7:03am UTC](https://talk.openelis-global.org/t/org-openelisglobal-common-exception-limsruntimeexception-error-in-patient-getpageofpatients/821/3 "2024-07-19T07:03:28Z")

</div>

@mherman22[Log files](https://pastebin.com/8SVTnP43)

---

<div class="post-metadata">

**Author:** ![mherman22](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/mherman22/32/92_2.png) [@mherman22](https://talk.openelis-global.org/u/mherman22)\
**Post date:** [July 19, 2024, 7:52am UTC](https://talk.openelis-global.org/t/org-openelisglobal-common-exception-limsruntimeexception-error-in-patient-getpageofpatients/821/4 "2024-07-19T07:52:38Z")

</div>

why is your startingRecNo = 0? and because you set it to zero, this line → [OpenELIS-Global-2/src/main/java/org/openelisglobal/patient/daoimpl/PatientDAOImpl.java at 2b80571a21b95e7b1c561b9b0a5bfc37131ccabd · I-TECH-UW/OpenELIS-Global-2 · GitHub](https://github.com/I-TECH-UW/OpenELIS-Global-2/blob/2b80571a21b95e7b1c561b9b0a5bfc37131ccabd/src/main/java/org/openelisglobal/patient/daoimpl/PatientDAOImpl.java#L130) wil be -1 which is not ideal according to me.

EVen the error logs have this line `Caused by: java.lang.IllegalArgumentException: first-result value cannot be negative : -1`

---

<div class="post-metadata">

**Author:** ![mherman22](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/mherman22/32/92_2.png) [@mherman22](https://talk.openelis-global.org/u/mherman22)\
**Post date:** [July 19, 2024, 7:57am UTC](https://talk.openelis-global.org/t/org-openelisglobal-common-exception-limsruntimeexception-error-in-patient-getpageofpatients/821/5 "2024-07-19T07:57:41Z")

</div>

use `1` instead of `0` on this line `List<Patient> patientsPage = patientService.getPageOfPatients(1);`
