Get Started

Overview

Epsos-Web is developed in java and with Wicket Framework. All pages use a service facade (NcpServiceFacade) to get patient summaries, prescriptions, TRC etc... The portal comes with two implementations of the service facade. One mocked for development and one which use the web-services (ClientConnectorService.wsdl) to communicate with a live NCP.

Build

Make sure your machine has java and maven installed. Download source from google code epSOS-Web and execute mvn install in the directory cloned to. You will find  epsos-web.war in the target directory. The built war file will be for a live system, i.e. not mocked.'

Run

The epsos-web can run in any web container, Tomcat6 is currently used. Or with a easy to develop container bundled in called jetty. To test that epSOS-Web works you can easly do that with the mocked web. Here is a fast example on how to do that. Remember this is mocked. Run this command.

mvn -DserviceFacadeClass=se.sb.epsos.web.service.mock.NcpServiceFacadeMock jetty:run

epSOS-Web will now be located under http://localhost:8080 You can check it out and get the feeling of how it is to use epSOS-Web now. You can try to get ePrescription from the patient 192405038569 from Sweden. That person is mocked and should work. If you want to test to go against a real openNCP you need to have the openNCP started somewhere. Intallation guide for openNCP can be found here OpenNCP Installation Manual (deprecated, since 2015-10-29) . Then you need to set the the properties "client-connector-wsdl-url" to the path that your openNCP is listening to. And you also need to define some other properties located in "Prepare your application server". When that is done you can test to access it with the following command if you want.

mvn jetty:run

Prepare your application server

Make sure to start the application server with these java system properties(change the paths to reflect your machine):

-Depsos-internationalsearch-config-path=/opt/spirit/tomcat6-epsosweb/resources

     Note: Path to the InternationalSearch xml files.

-Doverride-config.xml=/opt/spirit/tomcat6-epsosweb/conf/epsos-web-config-overrides.xml

    Note: Not mandatory but can be set if you need to override any configuration.

-Dwicket.configuration=deployment

-Djavax.net.ssl.trustStorePassword=<password>

-Djavax.net.ssl.keyStore=<path to jks>

-Djavax.net.ssl.keyStorePassword=<password>

    Note: The ssl configuration properties are only needed if your NCP is set to use SSL when communicating with the web instance.

-Dclient-connector-wsdl-url=http://localhost:8092/epsos-client-connector/services/ClientConnectorService?wsdl


If you choose not to configure the SSL settings then It is necessary to create or edit the epsos.properties that is in the tomcat/bin directory to prevent a "MISSING STATE" error. In later versions of openNCP this is done in a mysql database. So then you need to configure that to make it work. Here is an example (Beware this config has been changed in later releases of openNCP):

secman.sts.url=http\://usbeta13\:8090/TRC-STS/SecurityTokenService
audit.repository.port=6514
audit.time.to.try=60000
audit.repository.url=localhost
auditrep.forcewrite=TRUE


Note the configuration for the audit repository.  In non-mock mode you must use an SSH tunnel to connect to the audit repository on the external test environment.

ssh -N <din user>@usbeta13 -L 6514/localhost/6514

Windows users create the tunnel in Putty.

-Dsun.net.client.defaultConnectTimeout=120000 -Dsun.net.client.defaultReadTimeout=120000

Add these parameters to set timeout settings for connection and read operations. This prevents epsos-web from hanging if no response is received from country B on patient or document search requests. See EPW-54 - Getting issue details... STATUS for further discussion on the matter.

Deploy

Deploy the war file in the application server. The portal will be accessed at http://<ip>:<port>/epsos-web/

The first page you will see is the login page requesting username and password. Right now the users are read from the file src/main/resources/users.xml. Use doktor/1234 to get the doctor role and apotek/1234 to get the pharmaceut role.

Develop

Here we describe how to run a mocked portal on your local machine. Commands are executed from where you downloaded the epSOS-Web.

* Create the file src/main/config/<user>-application.properties with the following content:

    serviceFacadeClass=se.sb.epsos.web.service.mock.NcpServiceFacadeMock

    Note: Here you can easily switch which service facade you will inject to epsos-web. Replace <user> with the user of your local machine.

* Execute mvn jetty:run
* Or do this with setting the property directly mvn -DserviceFacadeClass=se.sb.epsos.web.service.mock.NcpServiceFacadeMock jetty:run
* Enter your mocked portal at http://127.0.0.1:8080/

Tips and tricks

* Localize your portal by creating your own EpsosWebApplication_locale.properties file in src/main/java/se/sb/epsos/web/ . Configure which language to use by setting <locale> in src/main/resources/config/application-config.xml.
* Some functionality is enabled by setting feature flags. These can be found in src/main/resources/config/feature-flags.xml . To get them programmatically, use FeatureFlagsManager.check(feature);.
* There exists a number of automated selenium tests. To run them execute

    mvn -Pintegration,local verify or mvn -DserviceFacadeClass=se.sb.epsos.web.service.mock.NcpServiceFacadeMock -Plocal,integration verify    (to be sure that you use the mocked version)

If run on a Windows machine they will use IE, otherwise Firefox. They are written to verify english texts, so for them to be successful you need to configure <locale>en_GB</locale>.. This should be set when you download the code.

* Mocking of persons is done in PersonCatalog.java and mocking of documents(EP and PS) is done in DocumentCatalog.java

* Overriding config is done by setting the param -Doverride-config.xml to a local path to a xml file that follows the same structure as the config you like to override, e.g setting a different url to the NCP and changing locale to en is done with like this:

Startup param:
-Doverride-config.xml=/home/andreas/dev/epsos/epsos-web/src/main/resrouces/config/andreas-config-overrides.xml

andreas-config-overrides.xml:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<Configuration>
 <NcpServiceConfigManager>
  <service>
   <Url>https://localhost:8443</Url>
  </service>
 </NcpServiceConfigManager>
       <ApplicationConfigManager>
               <locale>en</locale>
       </ApplicationConfigManager>
</Configuration>


An elegant way to set the java options is to create a file setenv.bat/setenv.sh in your tomcat/bin directory.  The tomcat catalina.bat file will check if this file exists and then use it to load environment variables.  Example setenv.bat:

set JAVA_OPTS=%JAVA_OPTS% 
-Depsos-internationalsearch-config-path=C:\_WORKSPACE\EPSOS_National\epsos\epsos-web\src\main\resources\config