Justifying using multiple routine directories.

13 views
Skip to first unread message

Benjamin Irwin

unread,
Jan 28, 2026, 3:29:18 PM (11 hours ago) Jan 28
to Hardhats
I run and maintain a VistA instance site on the web at https://edu2.opensourcevista.net/vista/index.php.  This site is running on Debian using Yottadb, nodejs, pm2, and Apache.  It is normally updated with the VistA patches monthly.  It is currently up-to-date to September 2025.  When you access the links shown in the documentation page at the link above you are actually calling into this instance to get the information.

I have designed this site to make VistA available and easy for me  to update.  The design isn't for speed or efficiency.

I use multiple routine directories in order to keep the instance running smoothly and patch installation easy for me and keeping the routines safe and where they need to be.  The directories are partns, birtns, wvrtns, vartns, and gtm_dist.  For this discussion we can ignore the birtns (these are just my web routines).

GT.m (or Yottadb) runs the routines in the order that the directories are listed in the gtmroutines variable.  VistA loads the patch routines in the first directory listed.

In this instance the vartns directory is designed to keep all the routines exactly as they are in the IRIS version of VistA.  The exception to this is the compiled routines.

The wvrtns directory contains a few routines with the same names as vartns, but they have been modified to make VistA run on Linux with GT.m ( or Yottadb)  Because the wvrtns directory is listed before the vartns directory, these routines are used by this instance.  These routines must be protected from being overwritten by the patch process.

When VistA patches are installed they are placed in the partns directory by the patch process.  These routines are moved from the partns directory to the vartns directory by the shell script used to run VistA (shown below).

This keeps the vartns directory up-to-date with the patches without overwriting the proctected routines in the wvrtns directory.

The following is the shell scripting that accomplishes this process.
---------------------------------------------------------------------------------------------------------
#!/bin/bash

# ========================= VARIABLES =========================
export gtm_dist="/usr/local/lib/yottadb/r138"
export birtns="birtns/o(birtns)"
export partns="partns/o(partns)"
export vartns="vartns/o(vartns)"
export wvrtns="wvrtns/o(wvrtns)"
export PATH=$PATH:$gtm_dist
export gtmroutines="$partns $birtns $wvrtns $vartns $gtm_dist/libyottadbutil.so"
export gtmgbldir=g/mumps.gld
cd ~/vista

# ========================= APPLICATION =======================
export gtm_prompt='vista>'
mumps -direct

# ========================== CLEAN UP =========================
if [ "$(find "/home/$USER/vista/partns" -mindepth 1 -maxdepth 1 -type f | wc -l)" -gt 0 ]; then
    mv /home/$USER/vista/partns/*.m /home/$USER/vista/vartns
fi

if [ "$(find "/home/$USER/vista/partns/o" -mindepth 1 -maxdepth 1 -type f | wc -l)" -gt 0 ]; then
    mv /home/$USER/vista/partns/o/*.o /home/$USER/vista/vartns/o
fi

K.S. Bhaskar

unread,
Jan 28, 2026, 4:20:28 PM (10 hours ago) Jan 28
to Hardhats
Nice! You're taking advantage of the way $gtmroutines ($ydb_routines) works.

Regards
- Bhaskar

Nancy Anthracite

unread,
Jan 28, 2026, 4:34:49 PM (10 hours ago) Jan 28
to Hardhats, Benjamin Irwin

Thanks Ben. A nice explanation.  Did you notice that the patches the Zipped
for September-December have been upladed?  I am about to upload https://foia-vista.worldvista.org/DBA_VistA_FOIA_System_Files/DBA_VISTA_FOIA_2026/DBA_VISTA_FOIA_20260114.zip


--

Nancy Anthracite

Reply all
Reply to author
Forward
0 new messages