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

Getting "relation "icustay_detail" does not exist" when running "make build_curated_from_psql" #18

Open
manisci opened this issue Dec 30, 2019 · 12 comments

Comments

@manisci
Copy link

manisci commented Dec 30, 2019

Hi,

Thanks, for your detailed documentation. I've tried to follow the instructions as closely as possible, I've done "make concepts" from the original mimic repository and also successfully done "make build_concepts " from this repository. Looking at concepts in the directory of mimic data folder, I have this:

image

Also in curated folder of mimic extract folder, I only have "static_data.csv".
This is a snapshot of the error I'm getting.
image

Do you have any idea what might be the issue?

Thanks :)

@singhalrk
Copy link

You have to run build concepts before you run build_curated_from_psql.

@mmcdermott
Copy link
Collaborator

Apologies for the slow response. @singhalrk is correct; however, MIMIC also modified their code-base in the interim rendering our README instructions insufficient to build concepts. We've just pushed a new release, with new instructions, which we believe should have fixed this and all outstanding issues. Please re-open if you encounter any new issues.

@zhangyongheng78
Copy link

Hi @mmcdermott, I still have the same error.
I followed the https://github.com/MIT-LCP/mimic-code and as a result, icustay_detail is in the public schema instead of the mimiciii schema. Is this the reason why I encounter the same error?

I tried to change

schema_name='mimiciii'
to schema_name='public' but still does not work

@zhangyongheng78
Copy link

Hi @mmcdermott, I still have the same error.
I followed the https://github.com/MIT-LCP/mimic-code and as a result, icustay_detail is in the public schema instead of the mimiciii schema. Is this the reason why I encounter the same error?

I tried to change

schema_name='mimiciii'

to schema_name='public' but still does not work

The issue is resolved by calling public.icustay_detail

@mmcdermott
Copy link
Collaborator

HI @zhangyongheng78 -- thanks for reaching out. It seems like LCP has changed their instructions / code once again, and as of 10 months ago these concepts are indeed built in the public schema, not the mimiciii schema. You are correct that the indicated change is all that should be required. I'll re-open this issue for tracking. Thanks for catching this!

@mmcdermott mmcdermott reopened this Sep 17, 2021
@fahim-sikder
Copy link

Hi, as the LCP, creates the concepts in the public schema we have to both use the public and mimiciii schema. I changed line 28 on MIMIC_Extract/mimic_querier.py by this schema_name='public,mimiciii' also changed the line 737 on the MIMIC_Extract/mimic_direct_extract.py to ap.add_argument('--psql_schema_name', type=str, default='public,mimiciii', help='Postgres database name.')

Now, it is running!

@mmcdermott
Copy link
Collaborator

Thanks @fahim-sikder! I've not had time to in and incorporate any changes, but that comment is really helpful and will help others who run into the same issue.

@mz4987
Copy link

mz4987 commented Apr 14, 2022

Thanks @fahim-sikder! I've not had time to in and incorporate any changes, but that comment is really helpful and will help others who run into the same issue.

I have modified the file based on previous discussion. However, I still not able to read the public.icustay_detail table. I did not find this table in public schema.
image

I noticed that some tables were dropped when I created the database. Is this correct? I believe I have downloaded all the tables. Not sure if I have missed anything.
image

Thanks for helping!

@mit2400
Copy link
Contributor

mit2400 commented May 4, 2022

@mz4987
It's because some queries do not use --psql_schema_name.

such as, "mimiciii.ccs_dx" in SQL_Queries/codes.sql

So, I made a pull request (#66) which simply changes search path of queries.
I hope it fixes your problem!

@aspargo2
Copy link

aspargo2 commented Apr 14, 2023

It appears this is still an issue. I don't see that table in the mimiciii data, does anyone know where that is supposed to be coming from?

@c3-aspargo
Copy link

c3-aspargo commented Apr 14, 2023

The colloid_bolus.sql file doesn't appear to have "DATETIME" in it anywhere either which causes the sed command to return nothing :/

installing:

brew install gnu-sed
export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"

then changing sed to gsed fixed that

@c3-aspargo
Copy link

It appears this is still an issue. I don't see that table in the mimiciii data, does anyone know where that is supposed to be coming from?

I needed to run the functions to load the mimic concepts here:
https://github.com/MIT-LCP/mimic-code/tree/main/mimic-iii/concepts

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

9 participants