GSOC 2019 : Attachments Module Enhancements

Great.

Build an run the module like every other openmrs module.

Clone using git clone https://github.com/openmrs/openmrs-module-attachments.git

and build using cd openmrs-module-attachments && mvn clean install

This will generate a .omod file located in openmrs-module-attachments/omod/target to upload the omod see Administering Modules - Documentation - OpenMRS Wiki

Thanks. One more thing. I runned the reference app 2.9 with run-on-Unix.sh and uploaded omod file like in your instructions but at attachment section on patient page I can only upload notes, and there isn t any documents section. What Iā€™m doing wrong?

The note is there anyway so the module doesnā€™t work or i should first upload something? But there is not button or anything. Here is a link to a screenshot of what is see when i press on attachments link

@andu033 let me give this a try and get back to you.

1 Like

@ivange94 i think i figured out. I should start a visit first and then the attachment upload button will be there. Thanks.:slight_smile:

@ivange94 I have some questions. How i install the react in this module? What is the dependency manager for that ? (yarn, npm). And how i should build after that?

Have you looked at the owa generator?

1 Like

You will not be installing react in the existing module. You will be creating an OWA that is based on react. See https://www.npmjs.com/package/@openmrs/generator-openmrs-owa

1 Like

I,m looking at it right now. I will try to make some experiments and see how it is doing and will come back if need help. Thanks.

1 Like

Hi @ivange94 and @mksd . Iā€™m the gsoc student for this project. I already started to study for the project and tried to deploy a owa (I did it with help from @ivange94). When can we talk on irc with one of you. I want to explore a little more and I want to do a list o questions and topics to discuss about the project. One hour and a half will be enough I think. I wait for your response. Thank you. Best regards.

@andu033 I have a doctors appointment today but I should be able to squeeze 1-2 hours for you today. You can find me from now till the next 3 hours on IRC after which Iā€™ll be leaving for the hospital.

1 Like

I was sleeping at that hour. Donā€™t hurry. Anytime this week when you can tell me. I want to know what apis I need, how to install them and how to solve some problems that stop me from testing my owa. I get an error when I try to redeploy. I want to know all of these because I want to work a lot in this weekend. Mostly experimenting with the apis and react to figure out how things work.

@andu033 and @ivange94, I just created that Doodle in the hope that we can find 30 min this week. Thanks for setting your availabilities.

1 Like

Where is the doodle link?

@ivange94, @mksd I have a weird bug and maybe you know how to solve it. I tried to use window.open() to open a new tab with the pdf of a thumbnail . I saw that the previous implementation create a blob then a URL object and then use window.open. I did the same thing but when the tab is opened it is closed in no time. I tried to use window.open on a site and it is working, also tried to console log ca link for the bulb and acces that directly and it is working. I didnā€™t find any good solution on the internet. Maybe it s a problem with my browser. Any ideas to try? Thank you :slight_smile:

Update: I tried to upload a pdf and a doc on openmrs web demo from windows and chrome as browser (i used firefox for my app) and i get the same problem.

Hi @andu033, I just uploaded one here on QA Ref App: https://qa-refapp.openmrs.org/openmrs/attachments/attachments.page?patient=d8835256-a1b2-47b8-85f8-b07c57958f23&patientId=507&visit=cf881a93-be8e-4a7f-acfb-862604cb605c&returnUrl=%2Fopenmrs%2Fcoreapps%2Fpatientdashboard%2FpatientDashboard.page%3FpatientId%3D507%26%26visitId%3D2383

Can you try it out and let me know?

I have no issue with viewing it in Chrome:

Google Chrome 75.0.3770.80 (Official Build) (64-bit)
Revision 9a9aa15057b6b2cc0909bdcf638c0b65ecd516f2-refs/branch-heads/3770@{#948}

Firefox linux - it is working, Chrome windows- doesnā€™t work

So. The ad block was the problem :slight_smile:

Ok i paused it on linux/firefox and it is also working in my app. I created a function that return the MIME type of a file and will update the thumbnail to show the correct icon and do the correct action but iā€™m stuck in mocking a service to pass the file to the thumbnail. Can you help me with that? I just need to read a file from computer and i will pass to the child to simulate a service.