How get all uploaded documents from the database irrespective of patients or visit.

Hello There, I need to fetch all the uploaded files during the visits of patient for that I write method in attachment service called getAttachments() without any arguments because I want all the files without any filter please help to go further.

I saw Attachment service it has multiple get function but i am quite confused to write the new api end point to get all attachments. Thanks.

well having this means you are getting all the available attachments for all the patients,but if you need to get all uploaded files during visits of a patient i guess at least you will need patient as an argument

1 Like

Thanks @herbert24 for your response. I am thinking of select* from obs . If I am wrong please do correct me because I am not quite familiar with openmrs architecture, or you can suggest me the way where I can go through. Thank You

does this method openmrs-module-attachments/AttachmentsServiceImpl.java at 6970a7cc4792c5a323be936f2aa271893bc97e8c · openmrs/openmrs-module-attachments · GitHub satisfy you,you can simply alter the Boolean attributes by using false or true

or openmrs-module-attachments/AttachmentsServiceImpl.java at 6970a7cc4792c5a323be936f2aa271893bc97e8c · openmrs/openmrs-module-attachments · GitHub

Thanks Herbert actually I not getting how it handles the arguments actually what i need to do is i just want all the documents stored on server to be return by an existing or new api.

not specificallly for a given patient as you had said initially?

1 Like

this will mean you will need to add getObservations() method at the obs api in core which you will later call on at the attachment api in the attachment module

2 Likes

Ohh!! make sense Yes I got it.Thanks @herbert24 .

1 Like