GSoC 2018 Attachments Module Enhancements

@mksd What I understood from the resources was that It is done to deal with different versions of Openmrs version.(Please correct me If I am wrong).

@mksd I viewed the previously uploaded image and the I that fetched me the image is http://localhost:8081/openmrs-standalone/coreapps/clinicianfacing/patient.page?patientId=107

I guess this GET request is not served by the attachment module but by any other module?

The GET side is only partially supported via REST. @zouchine is currently working on ATT-4 addressing this.

In the meantime you can use the non-REST controller, see here.

Thank you very much for clarification.

@mksd So one of the proect tasks is to modify controllers (such as the one you mentioned )to behave RESTfully?

This is ATT-4 but this ticket is already being worked on, and will be completed soon.

Looking at the pending issues, quite a few of them are rather UI-related.

However in term of REST support there would be two things to do that have not been framed by actual tickets:

  1. Enable the ‘generic file upload’ feature. See my response on this thread here.
  2. Enable AttachmentResource to return lists of attachments based on a query parameter.

I would rather have you start with the latter for now. Is that something you’d be interested to spike at?

1 Like

@mksd ofcourse I would love to work in that area, I was trying to design the extension of HTML Form Entry to behave RESTfully. So I suppose this task is not a lot different.

@madushan there is an easier task and more complex one (that I just created), look at those two:

  • ATT-22 - AttachmentResource to check upload file size based on global property
  • ATT-24 - REST end point to query for lists of attachments
1 Like

@mksd Thanks I will try them and get started.

I would suggest to start with ATT-22 as it’s easier.

1 Like

@mksd I made a PR on ATT-22. I will soon begin work on ATT-24. Thank you very much for the guidance.

@mksd I am working on drafting a proposal, and found out the following rest end points needed to be implemented.

  1. add attachent (POST)
  2. update attachment (PUT)
  3. Search for attachments ( GET)

What could be the other REST endpoints needed ?

  1. add attachent (POST) - That’s ATT-4, so this covers the bytes content part of the GET too.
  2. update attachment (PUT) - That’s also possibly part of ATT-4. I think the bottom line here was that if the user wanted to bring in a different file, then she would just create a new attachment, this is what this has been overlooked.
  3. Search for attachments (GET) - That’s ATT-24.

Is that something that is required by GSoC? I’m asking because all the above is pretty much already framed by JIRA tickets (except the specifics about 2).

Since @zouchine and I were IM-ing about 2 yesterday, I’m pinging him here so that he knows as well.

1 Like

thanks @mksd for pinging me , Yes as you said, ATT-4 already covers add attachment and get attachment

@madushan FYI something else that should be streamlined while making Attachments RESTful is the definition and use of appropriate privileges.

There is already a ticket covering the topic to a certain extent, see ATT-9.

Hi @mksd and mentors ,

I would like to work on this project in GSOC 2108. I read the all information included in this talk thread. So I am still understanding code base of the attachment module. And I am willing to contribute some issues related this module.

Thanks , Ridmal.

While I tried to debug the attachment module using remote debugging , new attachment upload is going through the non-rest controller. not through the AttachmentResource1_10.upload method.Any idea about the reason ? (I am run the module with openmrs-sdk 2.1.2 )

@mksd Yes GSoC needs a proposal to be submitted relevant to the project. These days I have been working on that too. So I will include the descriptions of the tickets and way to tackle them. Thank you very much for all these valuable information.

@mksd @zouchine I am starting to work on ATT-24. The ticket describes about implementing search of attachments. How should I start the work, should I create a new controller or use an existing one ? It would be great if you could me with some tips.

@mksd I would like to know more details about the packaging of OWA. Are we hoping to use Angular1 or Angular 2 ?