MIT-LCP / MIT-LCP/mimic-code

the number of patients is far different from two search ways

Open
#807 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

mimic-iii
Dominant language
Jupyter Notebook
Stars
3.4k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

Prerequisites
Description

Description of the issue, including:

  • what you have tried
  • references to similar issues
  • queries demonstrating your question (if applicable)

I tried to count the number of patients who used furosemide,and the result is made in two ways totally different.
1.the code is
SELECT DISTINCT icustay_id FROM "mimiciii"."prescriptions" WHERE "drug" ILIKE '%furose%'AND "route" ILIKE '%iv%'
and the number is 20056
2.the code is
SELECT * FROM "mimiciii"."d_items" WHERE "label" ILIKE '%furo%' OR "label" ILIKE '%lasix%'
the items are 4219,3439,4888,6120,7780,30123,228340,221794,90023
then
WITH t1 AS (
SELECT mv.icustay_id,
min(mv.starttime) AS charttime
FROM mimiciii.inputevents_mv mv
WHERE ((mv.itemid = ANY (ARRAY[228340, 221794])) AND (mv.amount > (0)::double precision))
GROUP BY mv.icustay_id
), t2 AS (
SELECT cv.icustay_id,
min(cv.charttime) AS charttime
FROM mimiciii.inputevents_cv cv
WHERE ((cv.itemid = 30123) AND (cv.amount > (0)::double precision))
GROUP BY cv.icustay_id
), t3 AS (
SELECT ce.icustay_id,
min(ce.charttime) AS charttime
FROM mimiciii.chartevents ce
WHERE ((ce.itemid = ANY (ARRAY[4219, 3439, 4888, 6120, 7780, 30123])) AND (ce.valuenum > (0)::double precision))
GROUP BY ce.icustay_id
)
SELECT t1.icustay_id
FROM t1
UNION
SELECT t2.icustay_id
FROM t2
UNION
SELECT t3.icustay_id
FROM t3
and the result is 8704
I don't know why? Could you help me?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the prescriptions query with the item IDs used in inputevents_mv, inputevents_cv, and chartevents, including their route, amount, valuenum, and timing filters. Start by checking the relevant MIMIC-III table and item definitions; done means explaining why the two patient counts differ and identifying which query matches the intended definition of furosemide use.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.