Preparing Your Database on Postgres

This section describes how to prepare your database on Postgres for Omni-HealthData.

  1. Create the required databases and schemas.

    While it is the prerogative of the database administrator to define the names of the associated databases, it is recommended that the following databases and associated schemas be created and ready for use:

    • omnihealthdata. Contains all tables used by the data acquisition and consumption layers of omnihealthdata, distributed across the following required schemas:
      • public. Contains all System tables, all On-Ramp (*_r), Source (*_s), Instance, and Master (*_m) model tables, as well as Remediation tables.
      • cohort. Contains all tables and views required for the Cohort Builder.
      • healthviews. Contains all tables and views required for HealthViews.
    • omnirepo. Contains all tables required for implementing Data Quality (DQ) rules.

    The creation of the database is generally the responsibility of a database administrator. The user ID that is used to create and update the database must be available during the installation.

  2. Ensure that the database server is configured to allow TCP connections and that the TCP ports are active.
  3. Verify the pgcrypto installation.

    Omni-HealthData requires the Postgres pgcrypto functions to be available.

    Pgcrypto is included in most Postgres 8.4 and higher distributions, and is enabled for use by the following command:

    CREATE EXTENSION pgcrypto;
    To see if pgcrypto is available, issue the following command:
    select * from pg_available_extensions
    For earlier versions of Postgres, or its derivatives, the appropriate pgcrypto package needs to be installed. Where CREATE EXTENSION is not supported, the function definitions will need to be installed manually.
    For example:
    psql -d databasename -f $PGHOME/share/postgresql/contrib/pgcrypto.sql