RHEA SHR Adapter module Installation guide
This document is a detailed guide on how to install the RHEA SHR Adapter module
Requirements
The SHR Adapter module requires the following,
OpenMRS 1.8.3 or above
Note: Preferably, OpenMRS should be installed on the following,
- A MySQL database
- If using Apache Tomcat, ensure that you use version 6.029 and not version 7.*
- Preferred jdk is 1.6
Please note that not using the above specifications may result in OpenMRS core related issues.
Install OpenMRS via the installation instructions given on
https://wiki.openmrs.org/display/docs/Installing+OpenMRS
If installing OpenMRS on an Amazon E2 server, see here –
https://wiki.openmrs.org/display/docs/Installing+OpenMRS+on+Amazon+EC2
Installing dependencies
The SHR module depends on the OpenMRS webservices.rest module. The webservices.rest module adds restful functionality, other dependencies and configurations to the SHR module. It is importaint to the proper behavior of the SHR module.
Currently, the SHR module uses the latest stable release of the webservices.rest module, which is 1.0
Therefore, you need to ensure that this module is also installed into the SHR database.
For more detailed documentation on the webservices.rest module, see here.
The latest releases of the module can be found here.
The SHR Adapter module
The SHR Adapter module can be installed directly into OpenMRS.
The latest version of the module is available online. You may use the latest release (omod file) or alternatively, check out the code and build it on your local machine.
The source code is available at: https://jembiprojects.jira.com/svn/RHEAPILOT/RHEA_SHR_Adapter
Build it using the command mvn clean install
Copy the built omod file, and install it into OpenMRS via the OpenMRS manage modules page.
Congratulations, the Adapter module is now ready for use!
Configuring the SHR module
After installing the module, you need to assign a value to the 'Sending Facility' global property which it adds to the global properties page. This property does not have a default value, so its importaint to set it immidiately after you install it.
The value you set should represent the SHR installation. It will also be included in the MSH.4 segment of an hl7 message returned by a GET request on the SHR server.
Making calls to access the REST Web Services
You can test the module by making trial GET and POST requests using either Soap UI or curl tools.
A sample GET request is as follows:
/openmrs/ws/rest/RHEA/patient/encounters?patientId=1234&idType=ECID& encounterUniqueId=634644364644&dateStart=2-1-2011&dateEnd=3-1-2011
Here, the number 1234 is the patientId representing each patient. It is a mandatory variable.
‘dateStart’, ‘dateEnd’ and ‘encounterUniqueId’ are optional variables we may use to restrict results.
A sample POST request is as follows:
/openmrs/ws/rest/RHEA/patient/encounters?patientId=1234&idType=ECID
Once again, 1234 represents the patientId value. Both it and ‘idType’ are mandatory fields. The POST request should also contain the hl7 message in its request body. This hl7 message will be encoded in XML format.