Topics: |
HealthViews is implemented using a batch of SQL scripts that retrieve data from the omnihealthdata database and denormalize the data. The running of the scripts is automated through a command file, build_all.cmd.
All HealthViews scripts, as well as build_all.cmd, should be installed in the same directory. It is recommended to use a separate directory for each database instance to be supported (DEV, PROD, QA, and so on).
The first part of the build_all.cmd file sets environmental variables that are used by the HealthViews scripts. The settings are as follows:
set target_server=name of the server hosting the database set user=user name to execute the scripts set password=password for that user set target_db=target database, usually healthviews set source_db=source database, usually omnihealthdata set check_source=whether or not to check if the script needs to be run set debug_query=turns debugging of source check on and off
The build_all.cmd file gets a directory of every .sql script in the current directory and runs them in order, using the configuration information defined above. Scripts are run singly, no scripts run concurrently.
To execute the scripts, open a command prompt in the directory containing the scripts and the build_all.cmd file. At the prompt type:
build_all.cmd > [logfile_name].log
It is recommended to pipe the output of build_all.cmd to a log file so that any errors can be noted and debugged.
The Windows Task Scheduler can be used to automate the running of the HealthViews process. Through the Task Scheduler, you can configure HealthViews to run at a specific time on specific days of the week, as shown in the following image.
Output from build_all.cmd can be directed to a log file, indicating the date as part of the file name, as shown in the following image.