Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPORT-862:create an HttpReportProcessor #241

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Seremba
Copy link

@Seremba Seremba commented Mar 23, 2023

An HTTP report processor to send reports to a URL via HTTP POST
https://issues.openmrs.org/browse/REPORT-862

@Seremba
Copy link
Author

Seremba commented Mar 23, 2023

Screenshot from 2023-03-23 15-30-03
How it works on a running emr

}

} catch(IOException e) {
e.getStackTrace();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the use of the above line?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is meant to handle the exception and print the error. Just realized printStackTrace() is a better code. Let me rectify that!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you get a chance to look at our openmrs java conventions?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Let me try again following them. I have checked the docs for them.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dkayiwa, I have instead thrown a RuntimeException with a message. Let me know what you think. Thank you.

@dkayiwa
Copy link
Member

dkayiwa commented Mar 23, 2023

@Seremba did you test this and confirm it is working as expected?

@Seremba
Copy link
Author

Seremba commented Mar 23, 2023

Yes, I manually tested it on openMRS and it worked.

@dkayiwa
Copy link
Member

dkayiwa commented Mar 23, 2023

Do you mind sharing details of how you did the testing?

@Seremba
Copy link
Author

Seremba commented Mar 23, 2023

I started openMRS, logged in as administrator, went to 'manage modules' deleted the reporting module, and uploaded the omod file on my machine. Looked for report processors, selected HttpReportProcessor from the options, and entered configurations like 'subject', 'connection url', and 'report' information. Then clicked add report processor and it was added.

@dkayiwa
Copy link
Member

dkayiwa commented Mar 24, 2023

@Seremba did your processor send real data via an HTTP POST as per the ticket description?

@Seremba
Copy link
Author

Seremba commented Mar 24, 2023

Hi @dkayiwa I have made a video recording to demonstrate how the processor potentially works. I hope that can be helpful.
Screencast from 24-03-23 16:03:17.webm

@dkayiwa
Copy link
Member

dkayiwa commented Mar 24, 2023

@Seremba in your video, you simply configured the processor. You did not go ahead to show that your processor actually works by sending HTTP POST data.

@Seremba
Copy link
Author

Seremba commented Mar 24, 2023

I am kinda stuck, how do I show that the processor works?

@Seremba
Copy link
Author

Seremba commented Mar 28, 2023

Hi @dkayiwa, sorry for the delay on this! I had to learn more about reporting in OpenMRS before answering. Does the screenshot partly or fully answer the question you have been asking?
Screenshot from 2023-03-28 16-27-52
.

@dkayiwa
Copy link
Member

dkayiwa commented Mar 28, 2023

Which webservice or http endpoint did you send the report to?

@Seremba
Copy link
Author

Seremba commented Mar 30, 2023

Hi @dkayiwa, I am facing this error https://pastebin.com/BZ8Dmphc when I try to run an HTTP POST request.

@dkayiwa
Copy link
Member

dkayiwa commented Apr 3, 2023

@Seremba that error means that you need to first provide the authentication credentials before making the request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants