# GSoC 2018 Attachments Module Enhancements

**URL:** <https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732>\
**Category:** GSoC\
**Tags:** community, attachments\
**Created:** [March 11, 2018, 3:48am UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732 "2018-03-11T03:48:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![madushan](https://talk.openmrs.org/user_avatar/talk.openmrs.org/madushan/32/6965_2.png) [@madushan](https://talk.openmrs.org/u/madushan)\
**Post date:** [March 11, 2018, 3:48am UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732/1 "2018-03-11T03:48:48Z")

</div>

Hi all, members interested in this project are welcome for this thread 🙂

---

<div class="post-metadata">

**Author:** ![madushan](https://talk.openmrs.org/user_avatar/talk.openmrs.org/madushan/32/6965_2.png) [@madushan](https://talk.openmrs.org/u/madushan)\
**Post date:** [March 11, 2018, 4:19am UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732/2 "2018-03-11T04:19:48Z")

</div>

@mksd I would like to know the project objectives in detail and the skills required for completion for this project in detail. Are skills related to AngularJs and React required?

---

<div class="post-metadata">

**Author:** ![ivange94](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ivange94/32/12590_2.png) [@ivange94](https://talk.openmrs.org/u/ivange94)\
**Post date:** [March 11, 2018, 7:13am UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732/3 "2018-03-11T07:13:59Z")

</div>

@madushan did you see this page [https://wiki.openmrs.org/display/projects/Attachments+Module+Enhancements](https://wiki.openmrs.org/display/projects/Attachments+Module+Enhancements)?

---

<div class="post-metadata">

**Author:** ![madushan](https://talk.openmrs.org/user_avatar/talk.openmrs.org/madushan/32/6965_2.png) [@madushan](https://talk.openmrs.org/u/madushan)\
**Post date:** [March 11, 2018, 7:19am UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732/4 "2018-03-11T07:19:30Z")

</div>

@ivange94 Thanks, I read it. It says some of the objectives are not yet confirmed. I would like to know more about the objectives and more about the tasks related to AngularJs and React.

---

<div class="post-metadata">

**Author:** ![ivange94](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ivange94/32/12590_2.png) [@ivange94](https://talk.openmrs.org/u/ivange94)\
**Post date:** [March 11, 2018, 7:22am UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732/5 "2018-03-11T07:22:51Z")

</div>

TBH I think you have enough information on that wiki to get started.

```
The Attachments module brings to the OpenMRS Reference Application a central place to view & manage file attachments. 
Additionally it encompasses files uploaded elsewhere within OpenMRS as long as they are saved as complex obs.

The aim of this project is to get v2.0 of the module ready for release. This will consist of working on a subset of tickets for the v2.0 release.

```

That paragraph says it all. There are bunch of open issues that need to be tackled to get this module ready for 2.0 so your gsoc project will be these issues. Also this adds a lot of information

```
Objectives
(plus) To be confirmed - the objectives for this project will be to complete a subset of tickets for the v2.0 release.
Attachments to become 100% RESTful.
Attachments UI to be
Segregated to an Open Web App.
Converted from Angular to React.

```

> [@madushan](#):
>
> Are skills related to AngularJs and React required?

Are you saying the wiki does not answer this question?

---

<div class="post-metadata">

**Author:** ![ivange94](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ivange94/32/12590_2.png) [@ivange94](https://talk.openmrs.org/u/ivange94)\
**Post date:** [March 11, 2018, 7:24am UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732/6 "2018-03-11T07:24:34Z")

</div>

First thing you should be doing is download and install the attachment module. Find the documentation of this module and play with the module a bit. Then look at open issues for this module and start tackling them to understand the codebase.

---

<div class="post-metadata">

**Author:** ![madushan](https://talk.openmrs.org/user_avatar/talk.openmrs.org/madushan/32/6965_2.png) [@madushan](https://talk.openmrs.org/u/madushan)\
**Post date:** [March 11, 2018, 7:26am UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732/7 "2018-03-11T07:26:26Z")

</div>

Thank you very much for the guidance. I would try them to get started

---

<div class="post-metadata">

**Author:** ![madushan](https://talk.openmrs.org/user_avatar/talk.openmrs.org/madushan/32/6965_2.png) [@madushan](https://talk.openmrs.org/u/madushan)\
**Post date:** [March 11, 2018, 7:33am UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732/8 "2018-03-11T07:33:09Z")

</div>

@ivange94 I am not an expert in angularJs. I just needed to know the skill level required. Sorry for the inconvenience.

---

<div class="post-metadata">

**Author:** ![mksd](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksd/32/11729_2.png) [@mksd](https://talk.openmrs.org/u/mksd)\
**Post date:** [March 11, 2018, 9:48am UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732/9 "2018-03-11T09:48:05Z")

</div>

Hi @madushan,

Glad to see that you’d be interested to jump in and work on Attachments.

The current open tickets might not reflect this properly, but what should really be done with Attachments is to **repackage its UI as an OWA**. And while doing so redo it in React, if possible.

However currently the UI side is written in Angular, and it might also stay that way depending on time and resources.

As @ivange94 said the best and first thing to do would be to play around with the module. See and understand what it does, where it brings changes to the Ref App UI (as in: see where its UI components are hooked in… etc).

---

<div class="post-metadata">

**Author:** ![mksd](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksd/32/11729_2.png) [@mksd](https://talk.openmrs.org/u/mksd)\
**Post date:** [March 11, 2018, 9:50am UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732/10 "2018-03-11T09:50:51Z")

</div>

Having said all this, there’s a bunch of possible backend tasks on it. If you’re more comfortable with Java programming than with UI-related technologies there’s stuff to do there too.

---

<div class="post-metadata">

**Author:** ![madushan](https://talk.openmrs.org/user_avatar/talk.openmrs.org/madushan/32/6965_2.png) [@madushan](https://talk.openmrs.org/u/madushan)\
**Post date:** [March 11, 2018, 9:55am UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732/11 "2018-03-11T09:55:04Z")

</div>

@mksd Yes I am more comfortable with Java Programming than UI-related technologies. Thank you very much for your kind advices.I will follow them to get started.

---

<div class="post-metadata">

**Author:** ![madushan](https://talk.openmrs.org/user_avatar/talk.openmrs.org/madushan/32/6965_2.png) [@madushan](https://talk.openmrs.org/u/madushan)\
**Post date:** [March 12, 2018, 8:50am UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732/12 "2018-03-12T08:50:51Z")

</div>

@mksd I checked out the code of the module from github and added the .omod into my reference application. But I could not find out a link to use the attachment module . Are there anyway that I can try the module.

---

<div class="post-metadata">

**Author:** ![mksd](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksd/32/11729_2.png) [@mksd](https://talk.openmrs.org/u/mksd)\
**Post date:** [March 12, 2018, 9:08am UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732/13 "2018-03-12T09:08:44Z")

</div>

The README file hints at the fact that a new dashboard widget comes up:

![image](https://talk.openmrs.org/uploads/default/original/2X/6/6e7ccc9d873a1f0de473c1efb1d827930ea9b8a2.png)

The above image dates from when this module was named ‘Visit Documents’, you should see an ‘Attachments’ widget now. Anyway, click on the curved arrow.

By default **you will need a patient with an active visit**.

---

<div class="post-metadata">

**Author:** ![madushan](https://talk.openmrs.org/user_avatar/talk.openmrs.org/madushan/32/6965_2.png) [@madushan](https://talk.openmrs.org/u/madushan)\
**Post date:** [March 12, 2018, 9:29am UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732/14 "2018-03-12T09:29:23Z")

</div>

@mksd Thank you very much for help. I found the interface and tried to upload a image and it was successful. I guess the following code takes care of uploading the file.

 ![Screenshot from 2018-03-12 15-07-23](https://talk.openmrs.org/uploads/default/original/2X/9/9a8489906c5f2ca9cb1f9f29943df1bcfe8fa36c.png)

---

<div class="post-metadata">

**Author:** ![mksd](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksd/32/11729_2.png) [@mksd](https://talk.openmrs.org/u/mksd)\
**Post date:** [March 12, 2018, 11:35am UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732/15 "2018-03-12T11:35:42Z")

</div>

Creating a new attachment happens through the [upload](https://github.com/openmrs/openmrs-module-attachments/blob/3a8830a9f4b905e3fa69a811b27cef24b343fd14/omod-1.10/src/main/java/org/openmrs/module/attachments/rest/AttachmentResource1_10.java#L83) method.

The save method that you pointed to can only be used to _update_ attachments. And by the way while doing so, you can update everything except the underlying file.

@zouchine what do you think of this?

---

<div class="post-metadata">

**Author:** ![madushan](https://talk.openmrs.org/user_avatar/talk.openmrs.org/madushan/32/6965_2.png) [@madushan](https://talk.openmrs.org/u/madushan)\
**Post date:** [March 12, 2018, 11:42am UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732/16 "2018-03-12T11:42:19Z")

</div>

@mksd Thank you very much. I have worked in other modules and most of them had only 1 omod version. But this module consists of few omod versions and they contains different code bases. ![Screenshot from 2018-03-12 17-10-53](https://talk.openmrs.org/uploads/default/original/2X/5/5d57cfc632ac151d34df8e5a3a6f0a9899d217e7.png)What could be the reason for this ?

---

<div class="post-metadata">

**Author:** ![mksd](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksd/32/11729_2.png) [@mksd](https://talk.openmrs.org/u/mksd)\
**Post date:** [March 12, 2018, 11:57am UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732/17 "2018-03-12T11:57:06Z")

</div>

Wait until you see that one: [https://github.com/openmrs/openmrs-module-webservices.rest](https://github.com/openmrs/openmrs-module-webservices.rest)

🙂

You should first read this one in details: ‘[Supporting different OpenMRS versions](https://wiki.openmrs.org/x/K46UAw)’. Then feel free to ask further questions.

---

<div class="post-metadata">

**Author:** ![madushan](https://talk.openmrs.org/user_avatar/talk.openmrs.org/madushan/32/6965_2.png) [@madushan](https://talk.openmrs.org/u/madushan)\
**Post date:** [March 12, 2018, 12:35pm UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732/18 "2018-03-12T12:35:58Z")

</div>

@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).

---

<div class="post-metadata">

**Author:** ![madushan](https://talk.openmrs.org/user_avatar/talk.openmrs.org/madushan/32/6965_2.png) [@madushan](https://talk.openmrs.org/u/madushan)\
**Post date:** [March 12, 2018, 12:38pm UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732/19 "2018-03-12T12:38:07Z")

</div>

@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](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?

---

<div class="post-metadata">

**Author:** ![mksd](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksd/32/11729_2.png) [@mksd](https://talk.openmrs.org/u/mksd)\
**Post date:** [March 12, 2018, 1:12pm UTC](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732/20 "2018-03-12T13:12:57Z")

</div>

The GET side is only partially supported via REST. @zouchine is currently working on [ATT-4](https://issues.openmrs.org/browse/ATT-4) addressing this.

In the meantime you can use the non-REST controller, see [here](https://github.com/openmrs/openmrs-module-attachments/blob/3a8830a9f4b905e3fa69a811b27cef24b343fd14/omod/src/main/java/org/openmrs/module/attachments/web/controller/AttachmentsController.java#L100-L101).

[Next page](https://talk.openmrs.org/t/gsoc-2018-attachments-module-enhancements/16732.md?page=2)
