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

aline notebook throws error #1706

Open
1 task
suriyan3 opened this issue Feb 8, 2024 · 4 comments
Open
1 task

aline notebook throws error #1706

suriyan3 opened this issue Feb 8, 2024 · 4 comments

Comments

@suriyan3
Copy link

suriyan3 commented Feb 8, 2024

Prerequisites

Description

I am running my postgres db in docker. I have loaded the data which i have downloaded from https://physionet.org/content/mimiciii-demo/1.4/.
When I am trying to run this python notebook D:\mimic-code\mimic-iii\notebooks\aline especially this query
queries = [
'sepsis/angus.sql',
'durations/weight-durations.sql',
'demographics/heightweight.sql',
'aline_vaso_flag.sql'
]

for query_file in queries:
# load in the text of the query
f = os.path.join(concepts_path, query_file)
with open(f) as fp:
query = ''.join(fp.readlines())
query = query.replace('`', '"')

# Execute the query
print('Generating materialized view using {} ...'.format(f),end=' ')
execute_query_safely(query_schema + query, con)
print('done.')

It throws below error 
relation "physionet-data.mimiciii_clinical.diagnoses_icd" does not exist

LINE 32: from "physionet-data.mimiciii_clinical.diagnoses_icd"

when i checked in mimic database I have this table diagnoses_icd. How to fix this issue.

@alistairewj
Copy link
Member

Ah the aline notebook looks out of date. We converted the original script it is calling to BigQuery syntax. If you change the path from "concepts" to "concepts_postgres" it should work.

@suriyan3
Copy link
Author

suriyan3 commented Feb 8, 2024

Hi @alistairewj ,

Thanks for the quick response. I have changed those values. It is throwing error when executing this line

inner join echo_data ec

relation "echo_data" does not exist and I have also checked in the list of tables it is not there.

@alistairewj
Copy link
Member

alistairewj commented Feb 8, 2024

Odd, maybe the echo data script isn't called by the postgres build script, or more likely there was an error in building the table. It's here though so you can build it yourself and maybe fix any errors that come up: https://github.com/MIT-LCP/mimic-code/blob/main/mimic-iii%2Fconcepts_postgres%2Fecho_data.sql

@suriyan3
Copy link
Author

suriyan3 commented Feb 9, 2024

Hi @alistairewj ,

Ok I will load that sql file. I have made the initial setup by loading postgres_create_tables.sql and postgres_load_data.sql from location D:\mimic-code\mimic-iii\buildmimic\postgres. So just want to know am I missing anything in the setup or do i have to run any other script which will do all the setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants