Skip to content

Install Instructions

Charles Chigoriwa edited this page May 14, 2014 · 34 revisions

Table of Contents

OpenInfoMan Install

There are the install instruction for the development versions of the OpenInfoMan.

BaseX

Current version is 7.8.2 at the time of this writing.

If you wish to make use of stored updating xquery expressions you will need at least version 8.0. You will need the snapshot version if you want updating functions.

Stable Version 7.8.2

cd ~/
wget http://files.basex.org/releases/7.8.2/BaseX782.zip
unzip BaseX782.zip

Snapshot Verison 8.0

Download the snapshot from http://basex.org/products/download/all-downloads/ and unzip as above

Download OpenInfoMan Source

cd ~/
git clone https://github.com/openhie/openinfoman
git clone https://github.com/openhie/openinfoman-pr #optional CRUD operations for provider directory

Link OpenInfoMan Libraries To BaseX Repository

cd ~/basex/repo
ln -sf ~/openinfoman/repo/* .
ln -sf ~/openinfoman-pr/repo/* .  #optional CRUD operations for provider directory

Note: We should figure out how to better package these files as modules!

Creating The XML Database

The default xml database name is 'provider_directory' and can be created by:

cd ~/basex/bin
./basex -Vc "CREATE DATABASE provider_directory"
The name of this database can be set in the file openinfoman/repo/csd_webapp_config.xqm

Make OpenInfoMan Administrative Interface Available

Warning: this has no user authorization at the moment and not is intended for production purposes.

cd ~/basex/webapp
ln -sf ~/openinfoman/webapp/*xqm .
cd ~/basex/webapp/static
ln -sf ~/openinfoman/webapp/static/* .

Following Symbolic Links

By default, recent versions of Jetty do not allow following of symbolic links under the webapp/static directory. See here for more information. To change this, edit the file basex/webapp/WEB-INF/web.xml and add

 <init-param>
  <param-name>aliases</param-name>
  <param-value>true</param-value>
 </init-param>
under:
<servlet>
  <servlet-name>default</servlet-name>

Starting The BaseX Service

cd ~/basex/bin
nohup ./basexhttp &

Adding in Resources

Sample Data and Stored Queries

There are resources such as stored queries, shared values sets, sample service directories and test queries that can be loaded.

mkdir -p ~/basex/resources/stored_query_definitions
cd ~/basex/resources/stored_query_definitions
ln -sf ~/openinfoman/resources/stored_query_definitions/* .
ln -sf ~/openinfoman-pr/resources/stored_query_definitions/* .  #optional
mkdir -p ~/basex/resources/shared_value_sets
cd ~/basex/resources/shared_value_sets
ln -sf ~/openinfoman/resources/shared_value_sets/* .
mkdir -p ~/basex/resources/service_directories
cd ~/basex/resources/service_directories
ln -sf ~/openinfoman/resources/service_directories/* .
mkdir -p ~/basex/resources/test_docs #likely to be deprecated
cd ~/basex/resources/test_docs #likely to be deprecated
ln -sf ~/openinfoman/resources/test_docs/* .

Note: We should figure out how to better package these files as modules!

Updating Stored Queries

If you want to enable the stored queries with updating functions (e.g. for the CRUD operations for the provider directory) you can do so with:

mkdir -p ~/basex/resources/stored_updating_query_definitions
cd ~/basex/resources/stored_updating_query_definitions
ln -sf ~/openinfoman-pr/resources/stored_updating_query_definitions/* .

Schemas and Stylesheets

There are few other resources such as the CSD.xsd, SVS.xsd and an XSL to automatically produce API documentation for the stored queries:

cd ~/basex/resources/
ln -sf ~/openinfoman/resources/SVS.xsd 
ln -sf ~/openinfoman/resources/CSD.xsd 
ln -sf ~/openinfoman/resources/doc_careServiceFunctions.xsl 

Accessing The OpenInfoMan Administrative Interface

Simply browse to http://localhost:8984/CSD

Behind A Proxy?

Edit the file openinfoman/repo/csd_webapp_config.xqm and set the value of $csd_webconf:baseurl to be the explict url used by a remote client to access the CSD web interface

Registering Care Service Documents

Care service documents can be registered for querying. There are three categories of registered documents:

  • Sample Directories from an xml file in the resources/service_directories directory
  • A cache of a remote Services Directory
  • The merged result of the caches of the remote Service Directories

Initializing A Sample Services Directory From Disk

  • Click on the "CSD Endpoints" Tab
  • Click on "Load and Register Sample Service Directories"
  • Click "Initialize" under the sample directory that you wish to load and register
Note: It will automatically register a loaded sample directory for querying against. You can de-register it if desired.

Initializing A Remote Service Directory

  • Click on the "CSD Endpoints" Tab
  • Click on "Register and Poll Remote Service Directories"
  • Enter in the access details for the remote directory or select one of the existing default ones.
Note: The default set of remote service directories is defined under openinfoman/repo/csd_webapp_config.xqm in the $csd_webconf:remote_services variable.

Initializing A Merge of Cached Service Directory

  • Click on the "CSD Endpoints" Tab
  • Click on "Register and Poll Remote Service Directories"
  • Click on "Merge Registered Documents". At this point the merge document is registered, but empty.
  • To perform the merge, you will then need to click on "Merge services"

Loading Stored Queries

By default the stored queries on disk are not made available to execute against registered documents. To make them available:

  • Click "CSD Enpoints" Tab
  • Click "Manage Stored Queries"
  • Click "Reload stored functions from disk"
Warning: Changes to a stored query on disk are not automatically reloaded

Sharing Value Sets

The OpenInfoManager also can server a Sharing Value Sets repository. The OpenHIE Health Worker Registry Management Application makes use of this functionality. You will want to click on the SVS tab and initialize each of the value sets.

OpenHIE HWR Management Application

The OpenHIE HWR Management Application provides a web-interface to manage the data in a InfoMan actor that implements the HWR CRUD library above.

Supporting Software

This is application based on the I2CE/iHRIS Framework. You should first install the supporting software for iHRIS. You should also install the following supporting software:

sudo apt-get install php5-xsl xsltproc php5-curl

I2CE/iHRIS Library

Download the the I2CE/iHRIS Framework as follows:

mkdir -p ~/iHRIS
bzr branch lp:~intrahealth+informatics/i2ce/4.2-dev I2CE
bzr branch lp:~intrahealth+informatics/ihris-common/4.2-dev ihris-common
bzr branch lp:~intrahealth+informatics/openhie-pr 

Create MySQL Database

In mysql:

CREATE DATABASE csd_hwr;
GRANT ALL PRIVILEGES ON csd_hwr.* TO ihris@localhost identified by 'manage';
SET GLOBAL log_bin_trust_function_creators = 1;
Set username, password and database per your choice, but you will need to modify the DSN below.

Create and Edit Local Config File

Copy the existing config value to one that is not in version control:

mkdir -p ~/iHRIS/openhie-pr/sites/basex/pages/local
cp ~/iHRIS/openhie-pr/sites/basex/pages/config.values.php ~/iHRIS/openhie-pr/sites/basex/pages/local
Now edit the file ~/iHRIS/openhie-pr/sites/basex/pages/local/config.values.php and set the following values:
$i2ce_site_i2ce_path = "/home/ubuntu/iHRIS/I2CE";
$i2ce_site_dsn = 'mysql://ihris:[email protected]/csd_hwr' ;
$i2ce_site_module_config = "/home/ubuntu/iHRIS/openhie-pr/sites/basex/CSD-ProviderRegistry.xml";
adjusting the path prefix /home/ubuntu and the mysql database DSN as needed.

Make Available Under Apache

cd /var/www
sudo ln -sf ~/iHRIS/openhie-pr/sites/basex/pages openhie-hwr
Now you site should be available at
 http://localhost/openhie-hwr

The administrator username is 'i2ce_admin' and the password is same as in the MysSQL DSN

Configuring InfoManager

Click "Actions" -> "Configure Remote Directories" to point the OpenHIE HWR Management Application to InfoManagers that implement the HWR CRUD Library. By default it will look at localhost (relative to the server running the OpenHIE HWR UI) and use the connect-a-thon sample service directories.

National Health Worker Registry of Nigeria (Notes)

Management Interface

  • Site is at lp:~ihris-nigeria/openhie-hwr-nigeria/trunk/
  • Configure pages/local/config.values.php as usual
  • Make sure you configure the remote services directories to point to Nigeria Data

Stored Query Library

git clone https://github.com/openhie/openinfoman-hwr-nigeria
cd ~/basex/repo
ln -sf ~/openinfoman-hwr-nigeria/repo/csd_national_health_worker_registry_nigiera.xqm
cd ~/basex/resources/stored_query_definitions
ln -sf ~/openinfoman-hwr-nigeria/resources/stored_query_definitions/* .
cd ~/basex/resources/stored_updating_query_definitions/
ln -sf ~/openinfoman-hwr-nigeria/resources/stored_updating_query_definitions/* .
cd ~/basex/resources/shared_value_sets/
ln -sf ~/openinfoman-hwr-nigeria/resources/shared_value_sets/* .

Images

sudo apt-get install 
Also edit php.ini and set max upload size to something bigger than 2M and restart apache.
Clone this wiki locally