Saturday, 31 January 2015

UMLS on Windows

List of steps required to install UMLS in a Windows machine:

Go to UMLS web site:

Click on Downloads

Click on the UMLS link:

Create a folder in your local machine e.g., C:\UMLS
Download all files (see image below), e.g., 2014AB.CHK, 2014... You will need to register an account


After download the files your directory should look like this:



Run mmsys

run.bat or run64.bat according to your environment

Run script and click on Install UMLS


Define the Destination folder, select the same folder "C:\UMLS"



Click on new configuration


Click accept


Select subset


Select MySQL


Save configuration


Click Done and select begin, you will see the progress on the following window:





Install MySQL Server

Download and intall mysql server from here:
Select mysql installer

leave the password empty.  This will simplify the UMLS installation on the following steps..

Open mysql command line



Create a mysql database.  This database will be used to hold the UMLS content :

mysql -u root -p

Create user umls_user and password umls

mysql -u root -p

CREATE DATABASE umls;
CREATE USER umls_user;
SET PASSWORD FOR umls_user = PASSWORD ('umls');
GRANT SELECT ON umls.* TO umls_user;

Change settings on MySQL server on my.ini file.  Check this post which explains how to find this file in your system http://blog.sqlauthority.com/2014/01/07/mysql-locate-the-configuration-file-my-ini-or-my-cnf-on-windows-platform/ 

In my machine the file is located on "C:\ProgramData\MySQL\MySQL Server 5.6\my.ini" 

Add the following settings

key_buffer = 600M
table_cache = 300
sort_buffer_size = 500M
read_buffer_size = 200M
query_cache_limit = 3M
query_cache_size = 100M
myisam_sort_buffer_size = 200M
bulk_insert_buffer_size = 100M
join_buffer_size = 100M


If you have defined a root password in the last step, you can remove it using the following command:

open mysql command line
SET PASSWORD FOR root@localhost=PASSWORD('');

Set environment variable MYSQL_HOME 


and add it to the path 



Go to C:\UMLS\2014AB\META and edit the script populate_mysql_db.bat
You will end with something like the following: (I have removed password and the full path of mysql, since it is available thanks to the environment variable)



::
:: For useful information on loading your Metathesaurus subset
:: into a MySQL database, please consult the on-line
:: documentation at:
::
:: http://www.nlm.nih.gov/research/umls/load_scripts.html
::

::
:: Database connection parameters
:: Please edit these variables to reflect your environment
::
::set MYSQL_HOME="C:\Program Files\MySQL\MySQL Server 5.6"
set user=root
set password=
set db_name=umls

del mysql.log
echo. > mysql.log
echo ---------------------------------------- >> mysql.log 2>&1
echo Starting ...  >> mysql.log 2>&1
date /T >> mysql.log 2>&1
time /T >> mysql.log 2>&1
echo ---------------------------------------- >> mysql.log 2>&1
echo MYSQL_HOME = %MYSQL_HOME% >> mysql.log 2>&1
echo user =       %user% >> mysql.log 2>&1
echo db_name =    %db_name% >> mysql.log 2>&1
set error=0
set mrcxt_flag=0

:: Create empty mrcxt if it doesn't exist, expected by mysql_tables.sql script
if not exist MRCXT.RRF set mrcxt_flag=1
if not exist MRCXT.RRF TYPE NUL > MRCXT.RRF

echo     Create and load tables >> mysql.log 2>&1
mysql -vvv -u %user% --local-infile=1 %db_name%  < mysql_tables.sql >> mysql.log 2>&1
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)

echo     Create indexes >> mysql.log 2>&1
mysql -vvv -u %user% --local-infile=1 %db_name% < mysql_indexes.sql >> mysql.log 2>&1
IF %ERRORLEVEL% NEQ 0 (set error=1

IF %mrcxt_flag% EQU 1 (
del MRCXT.RRF
echo DROP TABLE IF EXISTS MRCXT; >> drop_mrcxt.sql
mysql -vvv -u %user% --local-infile=1 %db_name% < drop_mrcxt.sql >> mysql.log 2>&1
IF %ERRORLEVEL% NEQ 0 (set error=1
del drop_mrcxt.sql
)

:trailer
echo ---------------------------------------- >> mysql.log 2>&1
IF %error% NEQ 0 (
echo There were one or more errors.  Please reference the mysql.log file for details. >> mysql.log 2>&1
set retval=-1
) else (



echo Completed without errors. >> mysql.log 2>&1
set retval=0
)
echo Finished ...  >> mysql.log 2>&1
date /T >> mysql.log 2>&1
time /T >> mysql.log 2>&1
echo ---------------------------------------- >> mysql.log 2>&1
exit %retval%



Run the script, this will take some time.  After the script has finished you can verify if there were some errors during the process on mysql.log file



References
Evernote helps you remember everything and get organized effortlessly. Download Evernote.

Sunday, 12 October 2014

OpenCDS SandBox (Tolven and OpenCDS service)


I have created a sandbox environment to test the interaction between the OpenCDS service and an Electronic Health Record (EHR) system.  This environment contains the following:
  1. The Tolven EHR system (an open source EHR system http://home.tolven.org/
  2. The OpenCDS service (running in a Tomcat server) http://www.opencds.org/ 
  3. Guvnor (rules editor http://guvnor.jboss.org/)
  4. Eclipse with a workspace containing a Tolven plugin code that enables the connection between the EHR system and the CDS service. 
The installation process is described in the following video:


The iso image file can be downloaded from here:
https://mega.nz/#!fMoBXZab!LEQFRQWql3YvMkcZek8uIJW5bxokG4tniYceH_7kD5Q
 
You can clone the code of Tolven plugin from here:
 $git clone https://bitbucket.org/Salvador_Rdz/tolven-opencds-plugin.git  

Another approach for installing this image is using the .ova file (Open Virtualization Format).  This file is available in the following link: (description key !UELDz_Toe8UnRNyBmmTkwSk1ysd3KAdYXIUhQkx14kU )
https://mega.nz/#!vARWRLYJ  

To import the Virtual Machine into Oracle VirtualVox Manager, click on File -> Import Appliance and
select the ova file.
Using the ova file is quicker than using the iso file, since you don’t have to wait for the clonezilla installation.    However, you can use the iso file to install the environment directly into the hardware without using a visualization environment.

Monday, 4 August 2014

OpenCDS - Test your service using SoapUI


I found SoapUI very useful for testing my OpenCDS services. One of the advantages is that SoapUI allows you to create Groovy scripts to customize your test cases.  Additionally, you can use LoadUI for advanced service load testing.  In this post I describe how I am using SoapUI to test my OpenCDS services, if you have a better approach please let me know :)

Tools used:

-SoapUI - you can downloaded from here
-Example SoapUI project, available here
-Example input vMR available here

Steps:

1.- Create a folder in you machine (e.g., "/home/MyVmrContent" in Linux or C:\MyVmrConten in Windows)

2.- Create two XML files in the new folder, something like this:

OpenCDSInput.xml - This contains the decoded vMR that we want to send the the service.  You can download an example vMR here 

OpenCDSOuput.xml - This will contain the vMR that we get from the OpenCDS service, for now just leave it empty.

3.- Open SoapUI and import the example SoapUI project.  File-> Import Project.  Then open the evaluateAtSpecifiedTime test step


and change the Endpoint of the service, in this example my OpenCDS service is located in http://10.42.0.62:18080/opencds-decision-support-service/evaluate 




4.-Open the Groovy script "Changebase64EncodePaylod".  This script encode the content of the OpenCDSInput.xml and put it inside the SOAP message request.




Change the path of the input file "OpenCDSInput.xml" to your folder






5.- Now you can run the test by opening the  "Show test editor"



 and just click in the green arrow to test your service.


6.- Thats it!. The decoded OpenCDS response will be available in the file OpenCDSOutput.xml.  The advantage of this approach is that you can work directly with your XML editor without having to manually decode the vMR into base64.  Additionally, you can create more Groovy scripts and make more complex test scenarios, such as sending different requests based on the content of a SOAP message response, etc. 


Notes

This example is based on the Oxygen demo available here:
http://develop.opencds.org/OpenCDSDemo/latest/OxygenDemo.wssc