Server-side Configuration

The Raxa-JSS EMR application is a loosely-coupled client-server application. The server needs to be able to provide REST resources that the client application can understand. The REST resources are an extension of the OpenMRS web services and builds upon it by providing additional REST resources.

Required modules:

The Raxa JSS EMR requires the following modules to be able to work with the client application:

  1. webservices.rest-1.1-SNAPSHOT.28231.omod
    1. add REST webservices URI prefix in OpenMRS webapp Administration=>module settings
  2. raxacore v0.1-SNAPSHOT (not released, under development)
  3. jsslab-omod-1.9.0-SNAPSHOT.omod
  4. webservices.rest19ext-1.0-SNAPSHOT.27594.omod

This page contains documentation about those REST resources

TODO: Add details of REST resources provided by Raxa modules

Configuration

The server needs to be configured to accept CORS requests. Following are steps to make server CORS enabled.

  1. You can download the cors-filter-1.3.1.jar from CORS Filter project. This will add CORS headers to all the web applications hosted on the tomcat instance.
  2. Place the jar file in tomcat/lib
  3. Edit the WEB-INF/web.xml by adding the following immediately after <!-- //End init parameters> (NOTE: some have also have success adding the filter to conf/web.xml immediately following the second <servlet>)
  <filter>
    <filter-name>CORS</filter-name>
    <filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
    <init-param>
     <param-name>cors.allowOrigin</param-name>
        <param-value>*</param-value>
    </init-param>
    <init-param>
     <param-name>cors.supportedMethods</param-name>
        <param-value>GET, POST, HEAD, PUT, DELETE, OPTIONS</param-value>
    </init-param>
    <init-param>
     <param-name>cors.supportedHeaders</param-name>
        <param-value>Origin, Authorization, Content-Type, Last-Modified, Accept, X-Requested-With</param-value>
    </init-param>
    <init-param>
        <param-name>cors.exposedHeaders</param-name>
        <param-value>Set-Cookie</param-value>
    </init-param>
    <init-param>
        <param-name>cors.supportsCredentials</param-name>
        <param-value>true</param-value>
    </init-param>
  </filter>

  <filter-mapping>
        <filter-name>CORS</filter-name>
        <url-pattern>/*</url-pattern>
  </filter-mapping>

Restart tomcat and the CORS filter should be applied to all the requests that are made to the tomcat instance

If you are running Tomcat 7, you should add the following line at the end of catalina.properties in the conf folder:

org.apache.el.parser.SKIP_IDENTIFIER_CHECK=true