cityEHR – Installation GuidecityEHR – Installation GuideOpen Health InformaticsJohn Chelsom27/09/17Table of Contents1.Introduction. 32.Basic Installation of cityEHR. 42.1.Apache Tomcat . 42.2.cityEHR Application. 62.2.1.Standalone installation.62.2.2.Installation on a Server .62.2.3.cityEHR Source Code.73.Standalone Installation of eXist Database.83.1.Installation. 83.1.1.Base eXist Installation.83.1.2.Running eXist as a Service.93.1.3.Configuring cityEHR.103.2.Database Backup.103.3.Database Recovery. 113.4.Installing Pre-packaged Databases.113.5.Running eXist Under Tomcat.124.Integration Engine. 134.1.Mirth Connect. 135.Other Applications Used in Workshop Exercises.165.1.Open Office. 165.2.Firefox Web Browser. 165.3.Protégé 4.1. 165.4.Notepad . 175.5.Komodo Editor. 186.Configuring the Applications.196.1. Mirth Integration Engine.197.Starting and Stopping Tomcat.21 2017 John ChelsomPage 1 of 21

cityEHR – Installation GuideRevision HistoryDateVersionChangesOwner15/01/151.0First Version, derived from Workshop Installation GuideJC15/05/151.1Includes details of standalone database installationJC25/10/151.2Includes details of running database under TomcatJC26/06/171.3Updated for cityEHR 1.5, including new configuration forstandalone eXist databaseJC27/09/171.4Updated for cityEHR 1.6JC 2017 John ChelsomPage 2 of 21

cityEHR – Installation Guide1. IntroductionThis document describes the installation of the open source applications required to run thecityEHR health records system, including tools used for creating and maintaining informationmodels.cityEHR is a server-side web application which can be run through the Mozilla Firefox web browseron any machine that has network access to the server.Note that cityEHR should be run using the Firefox web browser on client machines.cityEHR can be run using its built-in database which is suitable for demonstration and evaluationpurposes. For operational use with real live patient data it is recommended to use the stand-alonedatabase configuration which is more robust and is more suited to performing daily backup.The steps for a quick installation using the built-in database are:1. Check/install the Java Runtime Environment (JRE 7 or 8)2. Install Tomcat application server as a service on (for example) port 80803. Deploy the cityEHR application as cityehr.warTo install and configure a stand-alone database for running with live patient data, the additionalsteps are:4. Install the eXist XML database5. Configure eXist to run as a service on (for example) port 80226. Drop in the pre-packaged cityEHR database, or import the default information model7. Configure cityEHR to use the stand-alone databaseThe most usual installation is on virtual servers, running Windows. For this the followingspecification of virtual server is recommended (two servers, one for Tomcat, one for eXist):Quad core processor, 8Gb RAM, 200Gb disk, Windows Server 2008 R2 (or later)To run cityEHR as an integrated system. Using HL7 v2 messaging you also need to install: Mirth Connect integration/messaging engine (only required for integration services)To create information models that can be loaded to cityEHR you will also need: Open Office or Libre OfficeThe following applications are required only to complete the exercises in the cityEHR hands-onworkshops - they are not required to run the cityEHR application Protégé ontology environment Komodo Edit (programmer's file editor - any other equivalent editor can be used) Notepad (alternative to Komodo, on Windows only)These applications are available for installation on any platform (Windows, Mac, Linux) asdescribed in this installation document below.In addition, some other materials may be required for participants of cityEHR workshops; these areusually provided on a memory stick at the workshop and are also available for download - please check with your workshop co-ordinator for thelatest version. 2017 John ChelsomPage 3 of 21

cityEHR – Installation Guide2. Basic Installation of cityEHR2.1. Apache TomcatcityEHR is an enterprise Java application which must be deployed in a Java Application Server.Such as Apache Tomcat. If you already have Tomcat installed then you can add the cityEHRapplication as described in the next section – you don't need a fresh installation. If you have adifferent Java Application Server running (e.g. JBoss, Jetty, etc) then cityEHR should runsuccessfully using that. The instructions below are for Tomcat 8, but you can use earlier versions(5.5, 6 or 7) if you already have them installed on your machine. The installation can be made onyour local machine (which is assumed as the default below) or on a server.You need to have the Java Runtime Environment set up on your machine before installing Tomcat.Generally this will be set up by default on Apple Mac and Linux distributions, but its not alwaysthere on Windows. To test whether the JRE is installed, open a command window and type: Java-version If installed you should get a response similar to:Java version "1.5.0 20"Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0 20-b02-315)Java HotSpot(TM) Client VM (build 1.5.0 20-141, mixed mode, sharing)If you need to install the JRE then you can download a version for your operating system at Windows, follow the instructions at manual download.xmlOn a Mac, follow the instructions at install.xmlTomcat can be downloaded from http://tomcat.apache.orgIf you are running Windows you should use the 32-bit/64-bit Windows Service Installer which is awizard that will guide you through the installation of Tomcat as a Windows service.To avoid grief on Windows its best to install outside the c:\Program Files path, unless youare sure you have your Admin permissions set up correctly.On other platforms you should select the core .zip file, download it and unzip the contents to asuitable directory you have created for it (e.g. called tomcat-7). We will refer to this directory asCATALINA HOME.Assuming you are installing from the .zip, then after unzipping you should now see a directorystructure similar to the one below in CATALINA HOME (screen shot is for Tomcat 7 on a Mac). 2017 John ChelsomPage 4 of 21

cityEHR – Installation GuideOn Mac or Linux systems you may need to change the permissions on the files so that all usershave read, write and execute permission - run chmod -R 777 from the CATALINA HOME directory.By default, Tomcat runs on port 8080 on localhost, so you may want to change the default settingsin Tomcat (CATALINA HOME/conf/server.xml) if you want to run it alongside existing servers.You should now be able to start up Tomcat using the startup script provided with the installation inCATALINA HOME/bin (startup.bat on Windows systems, on Mac/Linux/Unix systems).To do this you will need to open up a command window, change to the bin directory and type thecommand. For more details on starting and stopping Tomcat see Section 7.To check that Tomcat is running, open your web browser go to http://localhost:8080 and you shouldsee a page similar to the one shown below. If you have trouble, see the additional instructions inCATALINA HOME/RUNNING.txt for how to resolve some common issues.If you have installed Tomcat on a server (not your local machine) then you can access it from aweb browser on a remote machine through http://ipaddress:8080 where ipaddress is the IPaddress of the server (e.g. you have problems running cityEHR with the message that there is not enough Java heap spacethen you can increase it by adding the following to the JAVA OPTS line in /bin/ or catalina.bat (Windows).-XX:MaxPermSize 128m -Xmx512mGood values for -Xmx are 1024, 2048, etc depending on the amount of memory available.Alternatively, if you have Tomcat installed as a service in Windows, the CATALINA HOME bindirectory should have a small windows application tomcat7w.exe (or equivalent for your version ofTomcat) that was created when tomcat was installed as a windows service. When you start thisapplication it has a tab 'Java' where you can set the JVM parameters.For most efficient operation you should set both memory pool options to the same value (e.g.1024/1024, 2048/2048, 4096/4096, etc - depending on the amount of memory available).To prevent Tomcat sessions from timing out, edit the web.xml file in CATALINA HOME confdirectory (the default is 30 – i.e. times out after 30 minutes). session-config session-timeout -1 /session-timeout /session-config 2017 John ChelsomPage 5 of 21

cityEHR – Installation Guide2.2. cityEHR Application2.2.1. Standalone installationThe latest version of cityEHR can be downloaded from complete cityEHR is in the war file cityehr.war.Stop the Tomcat service and copy the cityehr.war to CATALINA HOME/webapps. Restart Tomcatand cityEHR will be deployed automatically (you may need to wait a minute this to happen)The cityEHR distribution is configured by default to run on a standalone machine, using its built-indatabase which is pre-loaded with a demonstration EHR system.So if you are running cityEHR on your local machine you should now be able to open your webbrowser and go to http://localhost:8080/cityEHR to see the log on screen of cityEHR similar to theone shown below. You can log on using the default user credentials, admin / password2.2.2. Installation on a ServerThe procedure nstallation on a server is exactly the same as the standalone installation.After following the installation on a server with IP address (for example), andassuming that Tomcat is running there on port 8080, you should be able to access the cityEHRhomepage in a browser on any network machine using the URL http:// the homepage is not available then try to ping the server from the client machine to make surethe server is visible on the network. If the server is accessible but the homepage still does notdisplay then check the firewall on the server is configured to allow traffic on port 8080.Tomcat can be configured to run using SSL (encrypted) using the https protocol. For instructionson how to set this up, please refer to the separate guide - cityEHR on Tomcat With SSL. 2017 John ChelsomPage 6 of 21

cityEHR – Installation Guide2.2.3. cityEHR Source CodecityEHR is written using various XML languages, which are plain text (i.e. non-complied) code. Thesystem can be described as an XRX application (XForms, REST, XQuery) although its code alsoincludes a lot of XSLT and XHTML.The XRX of cityEHR runs within an XForms application framework called Orbeon, which is anEnterprise Java application, running under Tomcat.The cityehr.war which is deployed in Tomcat contains the Java code of Orbeon (which itselfincludes jar files for various XML processors, Apache FOP and the built-in eXist database). It alsocontains the XRX code of cityEHR itself.Orbeon and eXist are open source, released un