Organize OSEHRA-Automated-Testing CMake Options

Rename the CMake cache entries to have a consistent naming structure and
allow the variables to be grouped in the CMake GUI.  Repurpose some as
needed to simplify behavior:

 GREP_EXEC                       => GREP_EXECUTABLE
 CTerm                           => CTERM_EXECUTABLE
 ccontrol                        => CCONTROL_EXECUTABLE
 GTMPROFILE                      => GTM_DIST (Now the GT.M. directory)

 CPRS_SERVER                     => VISTA_TCP_HOST
 CPRS_PORT                       => VISTA_TCP_PORT
 INSTANCE                        => VISTA_CACHE_INSTANCE
 NAMESPACE                       => VISTA_CACHE_NAMESPACE
 USERNAME                        => VISTA_CACHE_USERNAME
 PASSWORD                        => VISTA_CACHE_PASSWORD

 AUTOMATED_UNIT_TESTING          => TEST_VISTA_MUNIT
 USE_COVERAGE                    => TEST_VISTA_COVERAGE
 RAS_SYSTEM_TESTING              => TEST_VISTA_FUNCTIONAL_RAS
 SIK_SYSTEM_TESTING              => TEST_VISTA_FUNCTIONAL_SIK
 ROUTINE_CALL_GRAPH              => TEST_VISTA_DOX_CALLERGRAPH
 USE_XINDEX_WARNINGS_AS_FAILURES => TEST_VISTA_XINDEX_WARNINGS_AS_FAILURES
 TEST_RESULTS_DIR                => TEST_VISTA_OUTPUT_DIR

 CLEAN_DATABASE                  => TEST_VISTA_FRESH
 OSEHRA_PATH                     => TEST_VISTA_FRESH_M_DIR
 PRISTINE_CACHE_DAT_PATH         => TEST_VISTA_FRESH_CACHE_DAT_EMPTY
                                    (Now a .dat file, not a directory.)
 VISTA_Path                      => TEST_VISTA_FRESH_CACHE_DAT_VISTA
                                    (Now a .dat file, not a directory.)
 VISTA_GLOBALS_DIR               => TEST_VISTA_FRESH_GTM_GLOBALS_DAT
                                    (Now a .dat file, not a directory.)
 VISTA_ROUTINE_DIR               => TEST_VISTA_FRESH_GTM_ROUTINE_DIR
 GLOBALS_IMPORT_TIMEOUT          => TEST_VISTA_FRESH_GLOBALS_IMPORT_TIMEOUT

 VISTA_SETUP_SITE                => TEST_VISTA_SETUP
 SYSTEM_TEMP_DIR                 => TEST_VISTA_SETUP_PRIMARY_HFS_DIRECTORY
 VISTA_SITE_NAME                 => TEST_VISTA_SETUP_SITE_NAME
 UCI_NAME                        => TEST_VISTA_SETUP_UCI_NAME
 VOLUME_SET                      => TEST_VISTA_SETUP_VOLUME_SET
 INSTALL_MUNIT                   => TEST_VISTA_SETUP_MUNIT
 MUNIT_KIDS_FILE                 => TEST_VISTA_SETUP_MUNIT_PATCH_FILE
 MUNIT_PACKAGE_INSTALL_NAME      => TEST_VISTA_SETUP_MUNIT_PATCH_NAME

Delete unused CMake options and variables:

 BUILD_REPORTS
 CHANGE_NAMESPACE
 EXPECT_EXEC
 GTMDIR
 USE_LOGIN (Now implied by non-empty VISTA_CACHE_USERNAME/PASSWORD)

Add new options:

 TEST_VISTA                 = Enable Testing directory
 TEST_VISTA_GTM_ROUTINE_DIR = Host dir for test routine import on GT.M

Structure CMake logic such that cache entries appear only after they
are first needed.
Remove DashboardScripts from OSEHRA-Automated-Testing

These scripts belong in a separate branch so they can be checked out
independently and used to drive dashboard builds.
Remove local Git setup scripts from OSEHRA-Automated-Testing

These will be superseded by other local Git scripts when this project is
merged with other OSEHRA infrastructure.
Remove README from OSEHRA-Automated-Testing

This will be superseded by another README.rst when this project is
merged with other OSEHRA infrastructure.
Merge OSEHRA-Automated-Testing repository history into VistA

Resolve conflicts in NOTICE, CMakeLists.txt, and .gitattributes by
combining content appropriately.
CMake: Allow Delphi and Testing components to build together

The CMake infrastructure merged in from OSERHA-Automated-Testing hacked
the values of CMAKE_MAKE_PROGRAM and MAKECOMMAND in order to allow
testing to run without a real make tool.  Generalize this approach and
use it only when a real make tool is not available.

When a real make tool is available, add custom targets to run the CMake
scripts like ImportRG during ctest_build.  Otherwise, collect a list of
such scripts and drive them under ctest_build using a MAKECOMMAND that
runs "cmake -P".

While at it, move the code to hide CMAKE_INSTALL_PREFIX up to the top
since we currently have no install rules.
Merge branch 'upstream-spreadsheets'
Packages.csv: Add new PPS-N package

Add new package "Pharmacy Product System - National" created by patch
"PREN*1*1".  It does not document the namespace prefix or add routines,
so guess "PREN" for now based on the name of the patch.
Merge branch 'master' into add-patches
Add VA VistA FOIA patches from Dec 2012 to Jan 2013

Follow the instructions in 'Scripts/HowtoDownloadPatches.rst' to
download patches from the VA FOIA site.  Use the following shell code to
produce the URL list and pipe it to wget:

 {
 # All patches in desired date range.
 for f in \
  "2012/DECEMBER 2012" \
  "2013/January 2013" \
 ; do
   echo "https://downloads.va.gov/files/FOIA/Software/Patches by Year and Month Released/$f/"
 done
 }
Prepare to organize Dec 2012 and Jan 2013 FOIA patch files

Update Scripts/KIDSAssociatedFilesMapping.py to associate LEX_2_51.GBL
with its patch.  Remove patch files from DECEMBER 2012 added previously:

 DGBT-1_SEQ-21_PAT-23.TXT
 EC-2_SEQ-109_PAT-116.TXT
 VPS-1_SEQ-1_PAT-1.KID
 VPS-1_SEQ-1_PAT-1.TXT
 XT-7P3_SEQ-108_PAT-133.KID
 XT-7P3_SEQ-108_PAT-133.TXT

Manually place file

 Pharmacy Product System-National (PREN) Release.txt

in its patch directory and rename it to

 PREN Release.txt

to avoid parens in the path.
Move patches from FOIA/ to populate Packages/

Follow the instructions in 'Scripts/HowtoPopulatePackages.rst' to move
VA patches out of 'FOIA/' and organize them in the 'Packages/' directory
structure.  Add .gitignore files to prevent content-linked large patch
files from being added later.
Add VA VistA FOIA patches from most of Feb 2013

Follow the instructions in 'Scripts/HowtoDownloadPatches.rst' to
download patches from the VA FOIA site.  Use the following shell code to
produce the URL list and pipe it to wget:

 {
 # All patches in desired date range.
 for f in \
  "2013/February 2013" \
 ; do
   echo "https://downloads.va.gov/files/FOIA/Software/Patches by Year and Month Released/$f/"
 done
 }

Retrieve all files posted as of 2013-02-25 16:00:00 EST.
Prepare to organize Feb 2013 FOIA patch files

Update Scripts/KIDSAssociatedFilesMapping.py to associate LEX_2_89.GBLs
with its patch.
Move patches from FOIA/ to populate Packages/

Follow the instructions in 'Scripts/HowtoPopulatePackages.rst' to move
VA patches out of 'FOIA/' and organize them in the 'Packages/' directory
structure.  Add .gitignore files to prevent content-linked large patch
files from being added later.
Add Patches/<package>/README.rst files

Add a README.rst to each package directory to document its purpose and
reference the top-level README.rst file.  This will aid users that
arrive in a repository browser through a link pointing directly at a
package directory.

Use the following shell code to create the files from Packages.csv:

tail -n +2 Packages.csv |
egrep '^[^,]+' |
while IFS=, read pkg dir _; do
  mkdir -p "Packages/$dir" &&
  hdr="VistA: $pkg"
  line="$(echo "$hdr"|sed 's/./=/g')" &&
  echo >"Packages/$dir/README.rst" \
"$line
$hdr
$line"'

This directory facilitates development and distribution of a VistA package.

See `<../../README.rst>`__ for more information.

-------
Patches
-------

The `<Patches>`__ directory contains patch host files for the package
organized into subdirectories named for each patch.'
done
Add Patches/<package>/Patches/README.rst files

Add a README.rst to each package Patches directory to document its
purpose and reference the package README.rst file.  This will aid users
that arrive in a repository browser through a link pointing directly at
a package Patches directory.

Use the following shell code to create the files from Packages.csv:

tail -n +2 Packages.csv |
egrep '^[^,]+' |
while IFS=, read pkg dir _; do
  mkdir -p "Packages/$dir/Patches" &&
  hdr="VistA Patches: $pkg"
  line="$(echo "$hdr"|sed 's/./=/g')" &&
  echo >"Packages/$dir/Patches/README.rst" \
"$line
$hdr
$line"'

This directory contains patch host files for a VistA package.
The files are organized into subdirectories named for each patch.

See `<../README.rst>`__ for package details.'
done
Packages.csv: Add column for VistA Document Library App Id

The VistA Document Library at http://www.va.gov/vdl identifies packages
with an integer "appid" and publishes documentation at URLs of the form

 http://www.va.gov/vdl/application.asp?appid=$appid

Add a column to Packages.csv called "VDL ID" to hold the appid for each
package.
Packages.csv: Fill in VDL ID column for known packages

Add the VDL appid for each package whose VDL page is known.
Add VDL links to Patches/<package>/README.rst files

Add a Documentation section to every package README.rst file to link to
its VistA Document Library page.

Use the following shell code:

tail -n +2 Packages.csv |
egrep '^[^,]+' |
while IFS=, read pkg dir _ _ _ _ vdl; do
  if test -n "$vdl"; then
    sed -i '/^---*$/ {h;d} # hold section header lines for next cycle
/^Patches$/ {# If this was preceded by a header line, prepend our section.
x;/^---*$/i\
-------------\
Documentation\
-------------\
\
Documentation for this package is available in the `VistA Document Library`_.\
\
.. _`VistA Document Library`: http://www.va.gov/vdl/application.asp?appid='"$vdl"'\

;x}
{x;/./{p;s/.*//};x} # dump any held lines
' "Packages/$dir/README.rst"
  fi
done