Remotely retreiving and posting information from OpenMRS

0 views
Skip to first unread message

Rakshit Wadhwa

unread,
May 26, 2014, 12:50:26 PM5/26/14
to d...@openmrs.org
Greetings!

I developed a basic module that creates a table which takes patientId, obsId, and similar information, and added a custom field of mine.
Now, I want to push and pull data from the table we created, and other information related to patient etc, remotely through a separate android application.
I realize that for this I need something like Rest Module (https://wiki.openmrs.org/display/docs/REST+Module).
Can someone please elaborate over where I can find documentation on usage of this module, or if there is something else we should be relying upon.

Also, if you can share some source code which do something on parallel lines, and may or may not use Rest module.

Any help in this regard is highly appreciated.


PS: We are trying to develop a prototype which allows results of medical devices interfaced with android, to be directly pushed to OpenMRS.

Thanks and regards
Rakshit



Harsha Kumara

unread,
May 26, 2014, 1:01:43 PM5/26/14
to d...@openmrs.org
Hi Rakshit,

Please find the API details in [1]. The page you specified is the main documentation for the rest services module. In that page there are many resources which points to usage of this module. Have a look at them also. 


Thanks,
Harsha


--
OpenMRS Developers: http://go.openmrs.org/dev
Post: d...@openmrs.org | Unsubscribe: dev+uns...@openmrs.org
Manage your OpenMRS subscriptions at https://id.openmrs.org/

To unsubscribe from this group and stop receiving emails from it, send an email to dev+uns...@openmrs.org.



--
Harsha Kumara
Software Engineer
WSO2 Inc.
Sri Lanka.

Rakshit Wadhwa

unread,
May 27, 2014, 6:18:08 AM5/27/14
to d...@openmrs.org
Thanks Harsha

I went through the links, however, I am still not able to get started on the code.
I was unable to find any piece of code that uses these APIs.
Any example source code that uses rest module API will come extremely handy to initiate our implementation.

Thanks and regards
Rakshit

Harsha Kumara

unread,
May 27, 2014, 6:27:47 AM5/27/14
to d...@openmrs.org
Web services module is expose a REST API. So you can write a rest client for access the API. 

For example curl -u admin:test -i 'http://localhost:8080/openmrs/ws/rest/v1/concept?limit=2'This curl command will return two concepts as a json array which you needs to handle from your client side. This is just a example of curl rest client. The url will be same for other clients. Also look at [1]. In you application,the data access from OpenMRS REST API needs to handle by a REST client.Hope this helps.Also look at [2] and [3].

Lluis Martinez

unread,
May 27, 2014, 7:46:06 AM5/27/14
to d...@openmrs.org
Check unit tests in REST module ...

Rakshit Wadhwa

unread,
May 28, 2014, 2:27:48 PM5/28/14
to d...@openmrs.org
I am unable to generate .omod file for rest module.
I am using the source code as https://github.com/openmrs/openmrs-module-webservices.rest
Also the download link ( http://modules.openmrs.org/modules/view.jsp?module=webservices.rest) doesn't seem to be working.
Also in the source code there are following directories:
omod  omod-1.10  omod-1.8  omod-1.9  omod-common
Which one shall I build?

Thanks and regards
Rakshit

Darius Jazayeri

unread,
May 28, 2014, 2:40:48 PM5/28/14
to dev
Hi Rakshit,

The correct download link is: https://modules.openmrs.org/#/show/153/webservices-rest

@Elliot, @Downey, I think that the redirect we recently put it place fails for module ids that have a dot in them. (Or, modulus expects a different url.)

-Darius

Rakshit Wadhwa

unread,
May 28, 2014, 4:53:52 PM5/28/14
to d...@openmrs.org
Thanks Darius

I am getting http error:500 due to
java.lang.NoSuchMethodError: org.openmrs.api.OrderService.getOrderType(Ljava/lang/Integer;)Lorg/openmrs/OrderType;

The complete trace is as follows:

http://pastebin.com/bGNBq7Xn

Thanks and regards
Rakshit

Darius Jazayeri

unread,
May 28, 2014, 5:33:34 PM5/28/14
to dev
Hi Rakshit,

What version of openmrs-core are you running? You should be running the latest released version, which is 1.9.7.

The latest released version of openmrs-core, plus the latest released version of the webservices.rest module, should work fine together.

-Darius

Rakshit Wadhwa

unread,
May 28, 2014, 6:09:09 PM5/28/14
to d...@openmrs.org
Thanks Darius

That solved the problem.
Looking forward to use rest module in my application.

Thanks and regards
Rakshit
Reply all
Reply to author
Forward
0 new messages