Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solving build error by updating schema - "relation xxx does not exist" #66

Merged
merged 4 commits into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions SQL_Queries/codes.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
SET SEARCH_PATH TO public,mimiciii;
SELECT
i.icustay_id, d.subject_id, d.hadm_id,
array_agg(d.icd9_code ORDER BY seq_num ASC) AS icd9_codes
FROM mimiciii.diagnoses_icd d
LEFT OUTER JOIN (SELECT ccs_matched_id, icd9_code from mimiciii.ccs_dx) c
FROM diagnoses_icd d
LEFT OUTER JOIN (SELECT ccs_matched_id, icd9_code from ccs_dx) c
ON c.icd9_code = d.icd9_code
INNER JOIN icustays i
ON i.hadm_id = d.hadm_id AND i.subject_id = d.subject_id
Expand Down
2 changes: 1 addition & 1 deletion SQL_Queries/debug_statics.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
\echo "This file is just for debugging"
SET search_path TO mimiciii;
SET search_path TO public,mimiciii;
select distinct
i.subject_id,
i.hadm_id,
Expand Down
2 changes: 1 addition & 1 deletion mimic_direct_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ def plot_variable_histograms(col_names, df):
help='Postgres host. Try "/var/run/postgresql/" for Unix domain socket errors.')
ap.add_argument('--psql_dbname', type=str, default='mimic',
help='Postgres database name.')
ap.add_argument('--psql_schema_name', type=str, default='mimiciii',
ap.add_argument('--psql_schema_name', type=str, default='public,mimiciii',
help='Postgres database name.')
ap.add_argument('--psql_user', type=str, default=None,
help='Postgres user.')
Expand Down
2 changes: 1 addition & 1 deletion mimic_querier.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(
self,
exclusion_criteria_template_vars={},
query_args={}, # passed wholesale to psycopg2.connect
schema_name='mimiciii'
schema_name='public,mimiciii'
):
""" A class to facilitate repeated Queries to a MIMIC psql database """
self.exclusion_criteria_template_vars = {}
Expand Down
2 changes: 1 addition & 1 deletion utils/niv-durations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-- events can then be used for various purposes: calculating the total duration
-- of mechanical ventilation, cross-checking values (e.g. PaO2:FiO2 on vent), etc

SET SEARCH_PATH TO 'mimiciii';
SET SEARCH_PATH TO public,mimiciii;

-- The query's logic is roughly:
-- 1) The presence of a mechanical ventilation setting starts a new ventilation event
Expand Down
2 changes: 1 addition & 1 deletion utils/setup_user_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mkdir -p $MIMIC_EXTRACT_OUTPUT_DIR

export DBUSER=bnestor
export DBNAME=mimic
export SCHEMA=mimiciii
export SCHEMA=public,mimiciii
export HOST=mimic
export DBSTRING="dbname=$DBNAME options=--search_path=$SCHEMA"
alias psql="psql -h $HOST -U $DBUSER "
Expand Down