Hi
I want to fetch last viewed patients from the server, like when we go to Find Patient Record in the demo server web client here:
https://demo.openmrs.org/openmrs/coreapps/findpatient/findPatient.page?app=coreapps.findPatient
REST documentation is not mentioning this but the project I am working with uses this:
https://demo.openmrs.org/openmrs/ws/rest/v1/patient?lastviewed
However, it just returns an empty list. Is there another query parameter other than lastviewed
?
EDIT: I’ve submitted a ticket for this:
https://issues.openmrs.org/browse/EA-172
Here is the logic which was used to query the last viewed patients in the coreapps,
openmrs-module-emrapi/GeneralUtils.java at df9979bb44293738a1ce4fb08f1426edee7fb0cf · openmrs/openmrs-module-emrapi · GitHub . Went through the Rest Module I can’t see the same logic to query the last viewed.
If it’s not implemented and there is no alternative we could have it as one of patient’s query parameters.
CC: @dkayiwa Please advise
Regards ,
1 Like
dkayiwa
(Daniel Kayiwa)
August 14, 2022, 4:40pm
4
@abertnamanya you are correct. We do not have a REST API for the last viewed patients.
1 Like
So, in the core app, last viewed patients are retrieved from a user object, do we save these patients locally as there is no API for this ? If you can refer me to User class I’d appreciate it
It’s a yes and No, newly interacted patients go to user_property table, this enables one to easily view the recent patient he/she has registered into the system even before search through the database.
Best solution is to get heads up for the creation of the ticket to handle this in the patient rest-end point
1 Like
Got it. Thanks @abertnamanya
dkayiwa
(Daniel Kayiwa)
August 15, 2022, 7:14pm
8
@dkayiwa Yes, but with UUIDs of patients because Android Client has its own ids for patients, and only uses UUIDs for communicating with the server.