2

I need to verify the number of adults I found in MIMICIII v1.3.

Based on the fact that age is defined by this formula:

((extract(DAY from admittime - dob) 
 + extract(HOUR from admittime - dob) / 24
 + extract(MINUTE from admittime - dob) / 24 / 60
  ) / 365.242)

and that adults are patients who are aged above 15 at the time their first admission, there are 38,645 adults in the database among a total of 46,520 patients.

Could you please confirm or reject this number by giving the exact number of adults? Thanks

2

The following query confirms that there are 46,520 distinct patients in MIMIC-III v1.3:

SELECT count(distinct subject_id)
FROM admissions;
-- returns 46520.

The following query confirms that the there are 38,645 distinct adult patients in MIMIC-III v1.3, based on the definition of 'adult' provided in the question:

WITH ages AS
(
    SELECT ad.subject_id, ad.hadm_id, ad.admittime, 
           RANK() OVER (PARTITION BY ad.subject_id ORDER BY ad.admittime), 
               (extract(DAY FROM ad.admittime - p.dob) 
                + extract(HOUR FROM ad.admittime - p.dob) / 24
                + extract(MINUTE FROM ad.admittime - p.dob) / 24 / 60
                ) / 365.242 AS age
    FROM admissions ad
    INNER JOIN patients p
    ON ad.subject_id = p.subject_id 
)
SELECT count(distinct subject_id)
FROM ages
WHERE age > 15;
-- returns 38645

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.