Installing HealthViews for Microsoft SQL Server

Topics:

To install HealthView for Microsoft SQL Server, expand the HealthViews .zip file on the machine that will be running the HealthViews batch process. It is recommended to set up a HealthViews directory, and within that directory create subdirectories for each environment to be supported (DEV, PROD, QA, and so on).

Setting Up the HealthViews Database

In a Microsoft SQL Server environment, HealthViews run on their own database called healthviews. Use SQL Server Management Studio to create the database. Once it is created, the collation for the database should be set to match the collation of the omnihealthdata database. To check the collation of omnihealthdata using SQL Server Management Studio, right-click the database and select Properties.

The Database Properties dialog box displays. The collation is in the General tab, as shown in the following image.

To change the collation of healthviews to match omnihealthdata, use the following commands:

Use Master;
GO
ALTER DATABASE healthviews
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE;
GO
Alter database healthviews
Collate SQL_Latin1_General_CP1_CS_AS;
GO
ALTER DATABASE healthviews
SET MULTI_USER;
GO

Installing the Stored Procedures

Topics:

Once the healthviews database has been created, four functions need to be installed:

  • hash64
  • split_part
  • p_hvtabstatcollector
  • p_count_ohd_table_rows

Scripts for all the stored procedures can be found in the \stored_procs folder in the HealthViews.zip file.

Installing the hash64 Function

HealthViews uses the hash64 function to create unique hashed values for ID fields. Using hashed values for ID fields allows for faster joins.

The hash64.sql script is provided for installing the hash64 function. Execute the script in the healthviews database. After running, dbo.hash64 should be listed as a scalar-valued function for the healthviews database.

Installing the split_part Function

The split_part.sql script is provided for installing the split_part function. The split_part function is used to divide data fields into smaller blocks and only use part of that block. Execute the script in the healthviews database. After running, dbo.split_part should be listed as a scalar-valued function in the healthviews database.

Installing the p_hvtabstatscollector Function

The fn_hvtabstatscollector function is used to compile statistics on the HealthViews data. It tracks the amount of records in each HealthViews table and also the number of records added since the last time the table was updated.

The p_hvtabstatscollector.sql script is provided for installing the p_tabstatscollector function. Execute the script in the healthviews database. After running, dbo.p_tabstatscollector should be listed as a stored procedure in the healthviews database.

Installing the p_count_ohd_table_rows Function

The p_count_ohd_table_rows function is used to determine the number of rows in each table in the omnihealthdata database, which can be useful for comparing to HealthViews.

The p_count_ohd_table_rows.sql script is provided for installing the p_count_ohd_table_rows function. Execute the script in the omnihealthdata database. After running, dbo. p_count_ohd_table_rows should be listed as a stored procedure in the omnihealthdata database.

Omnihealthdata Indexes

HealthViews uses indexes on certain Omni-HealthData tables to improve performance. The 001_create_omni_indexes.sql script, located in the \Setup_scripts directory of the HealthViews.zip file, is provided to create the indexes. This script should be run prior to the initial running of HealthViews to create the indexes and re-run if the omnihealthdata database is recreated.