Logic Web Service User Guide
This page represents work by ?Kevin Peters for ?Summer Of Code 2008 and may have been replaced by work elsewhere.
- 1 Overview
- 2 Installation
- 3 Limiting Access by IP Address
- 3.1 How to Modify
- 3.1.1 Example
- 3.1 How to Modify
- 4 API Functions
- 4.1 getFilters
- 4.2 getTokenTags
- 4.3 getTokens
- 4.4 getData
- 5 Troubleshooting
- 6 Developers
Overview
The Logic Web Service is a module for OpenMRS that allows web access to Logic Service functions.
info|The Logic Web Service uses HTTP BASIC authentication, and is thus only recommended for use on servers that use SSL. Use of non-SSL servers would broadcast HTTP authentication insecurely.
Installation
Access the Logic Web Service Module in the Module Repository and download the latest file (a .omod file). Install this module in OpenMRS (Administration -> Manage Modules -> Add Module).
Limiting Access by IP Address
Access can be limited by IP address via a global property. By default, only the computer on which the Logic Web Service module is installed can access it.
How to Modify
Create the property logicws.allowed_ip_list in your OpenMRS runtime properties file, and fill it in with a whitespace-separated list of remote IP addresses allowed to access the Logic Web Service API. Each entry should be four numbers (0-255) separated with periods, using "*" for wildcards.
Example
logicws.allowed_ip_list=192.168.1.* 192.168.2.50
Allows all clients with IP addresses beginning with 192.168.1 plus the IP address 192.168.2.50.
API Functions
getFilters
http://demo.openmrs.org/openmrs/moduleServlet/logicws/api/getFilters
: <?xml version="1.0" encoding="utf-8"?>
: <filterList>
: <filter name="FILTER_1" id="1" />
: <filter name="FILTER_2" id="2" />
: <filter name="FILTER_N" id="42" />
: </filterList>
getTokenTags
http://demo.openmrs.org/openmrs/moduleServlet/logicws/api/getTokenTags
getTokens
http://demo.openmrs.org/openmrs/moduleServlet/logicws/api/getTokens?tag=TAG
getData
http://demo.openmrs.org/openmrs/moduleServlet/logicws/api/getData?query=SELECT AGGREGATE X {TOKEN_1} OPERATOR OPERAND:SPLIT_1:SPLIT_2|AGGREGATE X {TOKEN_2} OPERATOR OPERAND:SPLIT_1:SPLIT_2 FROM COHORT&datastyle=DATASTYLE
The "splits" are those attributes that allow the user to get back more data regarding the token besides the token value (observation date, observation location, etc.). The data style is one of three data style choices: mostrecent, stacked, and flat.
Troubleshooting
It doesn't work right!
If you find anything wrong with this, please notify the developers of this, by posting in the forums, sending an email to the Implementer's list, or sending a direct e-mail to Rudd Zwolinski or Kevin Peters. Make sure to note what went wrong, what you were doing when it happened, and any error messages if there are any.
Developers
To get involved in working on the Logic Web Service, see the Reporting Framework Integration Project.