REST Module
What this module does
The module exposes the OpenMRS API as REST web services. If an OpenMRS instance is running the Webservices.REST module, other programs (and languages) can connect to retrieve and post certain information to an OpenMRS database.
Downloads
Source at: https://github.com/openmrs/openmrs-module-webservices.rest
Download at: https://addons.openmrs.org/#/show/org.openmrs.module.webservices-rest
User Documentation
Visit https://rest.openmrs.org/#openmrs-rest-api for an overview of our Rest Documentation.
Required OpenMRS Version
The REST Web Services module requires at least OpenMRS 1.9.0 or 1.8.1 to run.
Basic Configuration Options
Configuration key | Description |
|---|---|
webservices.rest.maxResultsDefault | This setting determines the maximum number of resources that can be accessed on any webservice call. The default is 50. |
webservices.rest.maxResultsAbsolute | This setting determines the absolute maximum number of resources that can be accessed on any web service call. If the client requests more than this limit, then receives an error. The default is 1000. |
webservices.rest.uriPrefix | This should point at the root of your exposed web application. This is typically http://localhost:8080/openmrs during testing, but after being deployed will be something like http://192.168.1.100/openmrs or http://yourdomainname.org/openmrs. If this is empty or not filled in, the user will see NEEDSTOBECONFIGURED/ws/rest/ as the "self" urls on all objects. |
webservices.rest.allowedips | By default this is an empty string: "", which means anyone can access the rest URLs. If you put any IP addresses into this list, only calls from those are allowed. IPs should be separated by a whitespace or a comma. IPs can be declared with bit masks to denote whole subdomains e.g. 10.0.0.0/30 matches 10.0.0.0 - 10.0.0.3 and 10.0.0.0/24 matches 10.0.0.0 - 10.0.0.255. Non matching IP addresses will receive a 403 HTTP error. Both IPv4 and IPv6 addresses are supported. |
Technical Documentation
The module exposes the OpenMRS API through light-weight resource objects off of the core OpenMRS objects. The structure is very similar, but not guaranteed to match up exactly.
This module uses Spring 3 annotations to expose URLs. Primary transport language is currently JSON and XML (beta in 2.1).
For Creators of Web Service Core/Module Methods
Adding a Web Service Step by Step Guide for Core Developers
Adding a Web Service Step by Step Guide for Module Developers
For Web Service Client Developers
See REST Web Services API For Clients
Development History
Initial project page: Enhanced Web Services (Design Page)
Development sprint 1: 2011-05-16 Development Sprint
Followup sprint: 2011-05-30 Development Sprint
Development sprint 2: 2011-07-05 Development Sprint
Development sprint 3: 2013-02-07 Integration of RESTWS
Example Client code
Quick java swing client that displays patients and encounters: http://svn.openmrs.org/openmrs-contrib/examples/webservices/hackyswingexample/
In the following link you can download a client (API) java that allows add - edit a person (any resource) and make a query to Webservice.Rest https://project-development-software-victor-aravena.googlecode.com/svn/trunk/ClientOpenMRSRest/
Release Notes
Version | Documentation | Release Date |
|---|---|---|
2.30 | UNRELEASED | UNRELEASED |
2.29 | UNRELEASED | UNRELEASED |
2.28 | 2020-03-11 | |
2.27 | 2020-02-18 | |
2.26 | 2019-08-27 | |
2.25 | 2019-06-17 | |
2.24 | 2019-01-10 | |
2.23 | 2018-12-12 | |
2.22 | 2018-02-06 | |
2.21 | 2017-10-24 |
Version | Documentation | Release Date |
|---|---|---|
2.20.0 | 2017-07-28 | |
2.19.0 | 2017-04-14 | |
2.18.0 | 2017-03-16 | |
2.17 | 2017-02-02 | |
2.16 | 2016-09-12 | |
2.15 | 2016-07-27 | |
2.14 | 2016-04-13 | |
2.13 | 2016-01-16 | |
2.12 | 2015-09-17 | |
2.11 | 2015-03-26 |