EWD.js and VistA: Let’s get started!

In my previous article I introduced the new installer for VistA and EWD.js that has been created by Chris Edwards from OSEHRA.  In this article I’m going to explain how to use the installer to get started with EWD.js and VistA on an Amazon EC2 virtual machine.

Chris’s OSEHRA installer was primarily designed to work with Vagrant and VirtualBox.  However, it isn’t limited to these technologies, and if, like me, you prefer to use EC2 machines within the Amazon Web Services (AWS) cloud, the installer works just as well.  If you’ve not tried out EC2, I’d recommend you do: it’s a great, fast and low-cost way of bringing up virtual machines to use either temporarily for testing and evaluation purposes, or even to run as your own permanent cloud machines.

The instructions that follow are primarily aimed at an EC2 user, but actually will equally apply to anyone with an existing Ubuntu Linux machine, either physical or virtual.  Just ignore the EC2-specific steps and/or adjust them appropriately for your machine.

Before we start, make sure the security group that you use with your EC2 machine allows access via the following TCP ports: 22, 8000, 8080 and 8081.  The easiest way to do this is by using the Amazon Web Services Management Console: I’d also recommend this console as the simplest and slickest way to start up and manage your EC2 machines.

So the first step is to launch a new EC2 instance.  Select Ubuntu 12.04 LTS  64 bit (ami-59a4a230) from the list of pre-built AMIs that you are offered.  The lowest-cost t1.micro AMI will be just fine for our purposes.  I normally accept the default configuration options throughout the rest of the launch process steps.  Once you’ve launched it and it has started, find its domain name by selecting it from the Management Console display of EC2 instances and SSH into it (eg using a terminal process or puTTY).  You’ll need to use your AWS EC2 key pair to log in.  The username for your EC2 machine is ubuntu.

Assuming you’ve managed to connect and log in to your EC2 machine, it’s now simply a matter of running the following four commands (just copy and paste them individually, exactly as shown below):

sudo apt-get install -y git
git clone https://github.com/OSEHRA/VistA.git
cd VistA/Scripts/Install/Ubuntu
sudo ./autoInstaller.sh -e

Now sit back, be patient, and wait for about half an hour while the installer does its work: that’s all there is to it!

Here’s what you should typically see in a successful install run:

login as: ubuntu
Authenticating with public key "imported-openssh-key"
Welcome to Ubuntu 12.04.4 LTS (GNU/Linux 3.2.0-58-virtual x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Sun Mar  2 09:47:33 UTC 2014

  System load:  0.24              Processes:           61
  Usage of /:   11.1% of 7.87GB   Users logged in:     1
  Memory usage: 10%               IP address for eth0: 10.11.147.39
  Swap usage:   0%

  Graph this data and manage this system at:
    https://landscape.canonical.com/

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

0 packages can be updated.
0 updates are security updates.

Last login: Sun Mar  2 09:46:42 2014 from xxxxxxxxxxxxxxxxxxx
ubuntu@ip-10-11-147-39:~$ sudo apt-get install -y git
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  git-man liberror-perl
Suggested packages:
  git-daemon-run git-daemon-sysvinit git-doc git-el git-arch git-cvs git-svn
  git-email git-gui gitk gitweb
The following NEW packages will be installed:
  git git-man liberror-perl
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,741 kB of archives.
After this operation, 15.2 MB of additional disk space will be used.
Get:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main liberror-perl all 0.17-1 [23.8 kB]
Get:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main git-man all 1:1.7.9.5-1 [630 kB]
Get:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main git amd64 1:1.7.9.5-1 [6,087 kB]
Fetched 6,741 kB in 0s (15.2 MB/s)
Selecting previously unselected package liberror-perl.
(Reading database ... 47501 files and directories currently installed.)
Unpacking liberror-perl (from .../liberror-perl_0.17-1_all.deb) ...
Selecting previously unselected package git-man.
Unpacking git-man (from .../git-man_1%3a1.7.9.5-1_all.deb) ...
Selecting previously unselected package git.
Unpacking git (from .../git_1%3a1.7.9.5-1_amd64.deb) ...
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.2.0-58-virtual
Processing triggers for man-db ...
Setting up liberror-perl (0.17-1) ...
Setting up git-man (1:1.7.9.5-1) ...
Setting up git (1:1.7.9.5-1) ...
ubuntu@ip-10-11-147-39:~$ git clone https://github.com/OSEHRA/VistA.git
Cloning into 'VistA'...
remote: Reusing existing pack: 11846, done.
remote: Total 11846 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (11846/11846), 27.05 MiB | 6.02 MiB/s, done.
Resolving deltas: 100% (4494/4494), done.
ubuntu@ip-10-11-147-39:~$
ubuntu@ip-10-11-147-39:~$ cd VistA/Scripts/Install/Ubuntu
ubuntu@ip-10-11-147-39:~/VistA/Scripts/Install/Ubuntu$ sudo ./autoInstaller.sh -e
Using https://github.com/OSEHRA/VistA-M.git for routines and globals
Create development directories: true
Installing an instance named: osehra
Installing EWD.js: true
Post install hook: false
Skip Testing: false
This script will add ubuntu to the VistA group
Updating operating system
Extracting templates from packages: 100%
Downloading gtminstall
######################################################################## 100.0%
Current shared memory maximum is less than 64MB
Current shmmax is:  33554432
Setting shared memory maximum to 64MB
kernel.shmmax = 67108864
Done installing GT.M
Creating osehra...
 Adding system startup for /etc/init.d/osehravista ...
   /etc/rc0.d/K20osehravista -> ../init.d/osehravista
   /etc/rc1.d/K20osehravista -> ../init.d/osehravista
   /etc/rc6.d/K20osehravista -> ../init.d/osehravista
   /etc/rc2.d/S20osehravista -> ../init.d/osehravista
   /etc/rc3.d/S20osehravista -> ../init.d/osehravista
   /etc/rc4.d/S20osehravista -> ../init.d/osehravista
   /etc/rc5.d/S20osehravista -> ../init.d/osehravista
Creating databases
Done Creating databases
VistA instance osehra created!
Adding user `ubuntu' to group `osehra' ...
Adding user ubuntu to group osehra
Done.
Cloning into 'VistA-M'...
remote: Counting objects: 37865, done.
remote: Compressing objects: 100% (31204/31204), done.
remote: Total 37865 (delta 6133), reused 37865 (delta 6133)
Receiving objects: 100% (37865/37865), 617.55 MiB | 8.21 MiB/s, done.
Resolving deltas: 100% (6133/6133), done.
Checking out files: 100% (30423/30423), done.
Dashboard script configuration:
  CTEST_SITE=[WAbySWsk.vagrant]
  CTEST_BUILD_NAME=[Ubuntu12.04-GTMV6.0-002_x86_64]
  CTEST_SOURCE_DIRECTORY=[/home/osehra/Dashboard/VistA]
  CTEST_BINARY_DIRECTORY=[/home/osehra/Dashboard/VistA-build]
  CTEST_CMAKE_GENERATOR=[Unix Makefiles]
  CTEST_BUILD_CONFIGURATION=[Debug]
  CTEST_GIT_COMMAND=[/usr/bin/git]
  CTEST_CHECKOUT_COMMAND=["/usr/bin/cmake" -P "/home/osehra/Dashboard/VistA-init.cmake"]
  CTEST_CONFIGURE_COMMAND=[]
  CTEST_SCRIPT_DIRECTORY=[/usr/local/src/VistA/Scripts/Install/Ubuntu]
  CTEST_USE_LAUNCHERS=[1]
  dashboard_M_dir=[/home/osehra/Dashboard/VistA-M]

Clearing build tree...
Run dashboard with model Experimental
   Source directory: /home/osehra/Dashboard/VistA
   Build directory: /home/osehra/Dashboard/VistA-build
   First perform the initial checkout: "/usr/bin/cmake" -P "/home/osehra/Dashboard/VistA-init.cmake"
   Perform checkout in directory: /home/osehra/Dashboard
   Reading ctest configuration file: /home/osehra/Dashboard/VistA/CTestConfig.cmake
   Site: WAbySWsk.vagrant
   Build name: Ubuntu12.04-GTMV6.0-002_x86_64
   Use Experimental tag: 20140302-0956
Starting fresh build...
   Updating the repository: /home/osehra/Dashboard/VistA-M
   Use GIT repository type
   Old revision of repository is: 24fa5f583c1938081e827e3aac227c1e82cd7b87
   New revision of repository is: 24fa5f583c1938081e827e3aac227c1e82cd7b87
   Gathering version information (one . per revision):

   Updating the repository: /home/osehra/Dashboard/VistA
   Use GIT repository type
   Old revision of repository is: cdc86c90093484693ada9441e4fa560ac74779ab
   New revision of repository is: cdc86c90093484693ada9441e4fa560ac74779ab
   Gathering version information (one . per revision):

Found 0 changed files
Configure project
   Each . represents 1024 bytes of output
    . Size of output: 0K
Build project
   Each symbol represents 1024 bytes of output.
    . Size of output: 1K
   0 Compiler errors
   0 Compiler warnings
Test project /home/osehra/Dashboard/VistA-build
      Start  1: PYTHON_GTMRoutinesParser
 1/10 Test  #1: PYTHON_GTMRoutinesParser .............   Passed    0.25 sec
      Start  2: PYTHON_PrefixParser
 2/10 Test  #2: PYTHON_PrefixParser ..................   Passed    0.07 sec
      Start  3: PyUnitTest_TestPatchOrderGenerator
 3/10 Test  #3: PyUnitTest_TestPatchOrderGenerator ...   Passed   31.96 sec
      Start  4: PyUnitTest_TestSSEP
 4/10 Test  #4: PyUnitTest_TestSSEP ..................***Failed  Error regular expression found in output. Regex=[FAILED] 29.95 sec
      Start  5: PyUnitTest_TestVistATestClient
 5/10 Test  #5: PyUnitTest_TestVistATestClient .......   Passed    1.11 sec
      Start  6: PYTHON_MenuTraversal
 6/10 Test  #6: PYTHON_MenuTraversal .................   Passed    4.79 sec
      Start  7: RASUnitTest_UTZTMGRSET
 7/10 Test  #7: RASUnitTest_UTZTMGRSET ...............   Passed    4.08 sec
      Start  8: RAS_SCMain01_test
 8/10 Test  #8: RAS_SCMain01_test ....................   Passed   61.32 sec
      Start  9: RAS_PLMain01_test
 9/10 Test  #9: RAS_PLMain01_test ....................   Passed  325.78 sec
      Start 10: RAS_REGMain01_test
10/10 Test #10: RAS_REGMain01_test ...................   Passed  107.31 sec

90% tests passed, 1 tests failed out of 10

Total Test time (real) = 566.64 sec

The following tests FAILED:
          4 - PyUnitTest_TestSSEP (Failed)
        Add file: /usr/local/src/VistA/Scripts/Install/Ubuntu/test.cmake
        Add file: /usr/local/src/VistA-Dashboard/vista_common.cmake
        Add file: /home/osehra/Dashboard/VistA-build/Testing/Temporary/UpdateMComponents.log
Submit files (using http)
   Using HTTP submit method
   Drop site:http://code.osehra.org/CDash/submit.php?project=Open+Source+EHR
   Uploaded: /home/osehra/Dashboard/VistA-build/Testing/20140302-0956/Build.xml
   Uploaded: /home/osehra/Dashboard/VistA-build/Testing/20140302-0956/Configure.xml
   Uploaded: /home/osehra/Dashboard/VistA-build/Testing/20140302-0956/Notes.xml
   Uploaded: /home/osehra/Dashboard/VistA-build/Testing/20140302-0956/Test.xml
   Uploaded: /home/osehra/Dashboard/VistA-build/Testing/20140302-0956/Update.xml
   Submission successful
Your build id is: WAbySWsk you will need this to identify your build on the VistA dashboard
%GTM-I-JNLCREATE, Journal file /home/osehra/j/osehra.mjl created for database file /home/osehra/g/osehra.dat with BEFORE_IMAGES
%GTM-I-JNLSTATE, Journaling state for database file /home/osehra/g/osehra.dat is now ON
xinetd stop/waiting
xinetd start/running, process 16163
Installing ewd.js
Downloading NVM installer
######################################################################## 100.0%
Done downloading NVM installer
Cloning into '/home/osehra/.nvm'...
remote: Reusing existing pack: 933, done.
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 937 (delta 0), reused 1 (delta 0)
Receiving objects: 100% (937/937), 183.01 KiB, done.
Resolving deltas: 100% (438/438), done.

=> Appending source string to /home/osehra/.profile
=> Close and reopen your terminal to start using NVM
######################################################################## 100.0%
Now using node v0.10.25
Now using node v0.10.25
Now using node v0.10.25
Now using node v0.10.25
Now using node v0.10.25
Now using node v0.10.25
 Adding system startup for /etc/init.d/osehravista-ewdjs ...
   /etc/rc0.d/K20osehravista-ewdjs -> ../init.d/osehravista-ewdjs
   /etc/rc1.d/K20osehravista-ewdjs -> ../init.d/osehravista-ewdjs
   /etc/rc6.d/K20osehravista-ewdjs -> ../init.d/osehravista-ewdjs
   /etc/rc2.d/S20osehravista-ewdjs -> ../init.d/osehravista-ewdjs
   /etc/rc3.d/S20osehravista-ewdjs -> ../init.d/osehravista-ewdjs
   /etc/rc4.d/S20osehravista-ewdjs -> ../init.d/osehravista-ewdjs
   /etc/rc5.d/S20osehravista-ewdjs -> ../init.d/osehravista-ewdjs
Done installing EWD.js
Starting EWD.js
Now using node v0.10.25
Starting EWD.js Rest Server
Now using node v0.10.25
ubuntu@ip-10-11-147-39:~/VistA/Scripts/Install/Ubuntu$

Don’t worry if it sits for up to 10 minutes at this stage in the process:

Configure project
   Each . represents 1024 bytes of output
    . Size of output: 0K
Build project
   Each symbol represents 1024 bytes of output.

and be patient while it runs its tests. Test 9 can take over 5 minutes and test 10 about 2 minutes.

Everything will now be installed, configured and running.  First, try out the EWD.js monitor application.  Bring up a browser and enter the following URL (adjust the domain name to match that of your EC2 server):

https://ec2-99-99-99-99.compute-1.amazonaws.com:8080/ewd/ewdMonitor/index.html

The first time you do this you’ll get a warning telling you that the site’s security certificate is not trusted.  Don’t worry: this is because self-signed certificates have been used.  You can replace them with proper ones in due course if required. Just tell it to proceed anyway.

You should see the login panel pop up.  Enter:

keepThisSecret!

The monitor should burst into life. EWD.js is clearly up and running! Explore the monitor options. It’s all explained in the EWD.js Reference Guide, from page 15.

Now let’s see it in action with VistA.  Enter the URL:

https://ec2-99-99-99-99.compute-1.amazonaws.com:8080/ewd/VistADemo/index.html

Once again, change the domain name to match that of your EC2 server.

You’ll be asked for an Access Code and Verify Code.  There are quite a few already set up but the one I always use is:

Access Code: fakedoc1
Verify Code: 1Doc!@#$

If you successfully log in, you’ll be asked to select a patient.  Start typing characters into the combo box: s is a good letter to enter, but just try whatever you want.  The names you see are being retrieved from the VistA system.  Select one and you’ll see his/her basic information.  Note that although you’ll then get a menu option to view the patient’s Vitals, nothing will be retrieved because, at present, there’s not much useful test data in the VistA system.  Hopefully OSEHRA will add useful data some in due course and I can extend the demonstration application.

In my next posting I’ll dig into this VistA Demonstration application and explain how it all works and how EWD.js has been integrated with VistA.  Subesquent postings will look at the REST interface that is also ready and working, and then we’ll install the JavaScript terminal.

For now, you can explore EWD.js on your server.  It’s all explained in the EWD.js Reference Guide.  I’d recommend going through the tutorial in Appendix 3 before trying to build any applications.

Enjoy your newly EWD.js-enabled VistA system!

 

 

 

Advertisements

6 comments

  1. Chris Casey · · Reply

    Just used these steps to set up a new EC2 server.
    Very simple and easy using your step by step guide.
    Thanks

  2. Thanks Rob for the wonderful work.
    I tried to set the EWD server on local machine.
    Looks like DUZ is not set for the credentials given above.
    Chris, did you also get this?

    1. Not sure what you mean.
      The demo works fine on my copy.
      UserDUZ is stored into the session data rather than DUZ

  3. when I replace the ec2 instance name (https://ec2-99-99-99-99.compute-1.amazonaws.com:8080/ewd/ewdMonitor/index.html) with a static ip address (https://xxx.xxx.xx.xxx/ewd/ewdMonitor/index.html and https://xxx.xxx.xx.xxx:8080/ewd/ewdMonitor/index.html) from google compute, it doesn’t work. Is it compatible and if so how do i configure it?

    1. impodream · · Reply

      I know this has been more than a year, but did you by any chance solved this prob, and make it working now?

      I am having the same question, while I somehow feels like that this ewd is supposed to be on the server side, therefore the to-be-replaced address should be the already configured aws address where our ewd.js is on.

      But I am not very sure, so I came here to see if there is any help 🙂

  4. Works great – Thanks to all who made this available and so easy to install.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: