forked from HealthRex/CDSS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LocalEnv.py.template
55 lines (48 loc) · 2.67 KB
/
LocalEnv.py.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/python
# This file serves as documentation to help users understand LocalEnv.py.
#
# LocalEnv.py can be created dynamically by setup.sh, but if you don't need
# to do any of the other steps in setup.sh (e.g. installing libraries,
# initializing DB) it may be easier to just make a copy of this file
# and name it LocalEnv.py before editing the actual values.
#
# medinfo/db/Env.py imports these DB variables, so all DB connections will
# fail if these two environment variables are not defined.
#
# Other variables which are likely to vary between dev environments should
# be added to this template file, then be given default values via setup.sh.
import os
BOX_CLIENT_ID = "BOX_API_CLIENT_ID"
BOX_CLIENT_SECRET = "BOX_API_CLIENT_SECRET"
BOX_ACCESS_TOKEN = "BOX_API_ACCESS_TOKEN"
BOX_STRIDE_FOLDER_ID = "BOX_STRIDE_FOLDER_ID"
# Database connection type
DATASET_SOURCE_NAME = 'STRIDE'
DATABASE_CONNECTOR_NAME = "psycopg2"
SQL_PLACEHOLDER = "%s"
# Connection parameters to primary working database of interest
LOCAL_PROD_DB_PARAM = {}
LOCAL_PROD_DB_PARAM["HOST"] = 'localhost' # Database host. Localhost if running on your local computer. For AWS RDS instances, look for the "Endpoint" hostname, e.g. YourDatabaseIdentifier.cwyfvxgvic6c.us-east-1.rds.amazonaws.com
LOCAL_PROD_DB_PARAM["DSN"] = 'databaseName' # Specific database name hosted by the database server (e.g., stride_inpatient_2008_2017)
LOCAL_PROD_DB_PARAM["UID"] = 'databaseUserId'
LOCAL_PROD_DB_PARAM["PWD"] = 'databaseUserPassword'
# Connection parameters for a test database to create and manipulate during unit tests
# The DSN (database name) MUST NOT BE the same as any real working database.
# Many of the Python application unit tests' first and last steps
# will be to delete any database identified by these test identifiers.
# The database user (UID) and password (PWD) will need to be a valid
# database user with permissions to create and delete such databases.
LOCAL_TEST_DB_PARAM = {}
LOCAL_TEST_DB_PARAM["HOST"] = 'localhost'
LOCAL_TEST_DB_PARAM["DSN"] = 'unittest_db'
LOCAL_TEST_DB_PARAM["UID"] = 'testuid'
LOCAL_TEST_DB_PARAM["PWD"] = 'testpwd'
PATH_TO_CDSS = "/foo/bar/CDSS"; # Directory where this file is contained in
# Look for this environment variable on authenticating to Google cloud server
# If env var not already there, then manually set here.
# See https://github.com/HealthRex/CDSS/wiki/Google-BigQuery-Access for more info
if "GOOGLE_APPLICATION_CREDENTIALS" not in os.environ:
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = "/foo/bar/google-cloud-platform-token.json";
if "GOOGLE_CLOUD_PROJECT" not in os.environ:
os.environ["GOOGLE_CLOUD_PROJECT"] = "mining-clinical-decisions";
TEST_RUNNER_VERBOSITY = 2