0

Try this code:

SELECT ie.subject_id, ie.hadm_id, ie.icustay_id,
    ie.intime, ie.outtime,
    ROUND((cast(ie.intime as date) - cast(pat.dob as date))/365.242, 2) AS age
FROM mimiciii.icustays ie
INNER JOIN mimiciii.patients pat
ON ie.subject_id = pat.subject_id
WHERE
ie.DBSOURCE = 'metavision'

all adults... why ? did I do mistake ?

  • This results in one record? What if you try something like WHERE ie.DBSOURCE like '%metavis%'? – user4293 Jul 31 '17 at 15:39
  • Is pat.dob always filled? What happens if it is not? – user4293 Jul 31 '17 at 15:40
  • Good thought about like but the code still returns more than 15000 patients without the age condition applied - so doubt it is this. – suprvisr Jul 31 '17 at 15:42
  • It results in one record if you add age less than 16 condition – suprvisr Jul 31 '17 at 15:42
1

To the best of my knowledge, MIMIC-III only contains data pertaining to adults (or adolescents treated medically as adults). There are a few records of neonates from childbirths, but it is not the main focus of the database.

If you run this:

SELECT * from 
(
    SELECT ie.subject_id, ie.hadm_id, ie.icustay_id,
    ie.intime, ie.outtime,
    ROUND((cast(ie.intime as date) - cast(pat.dob as date))/365.242, 2) AS age
    FROM mimiciii.icustays ie
    INNER JOIN mimiciii.patients pat
    ON ie.subject_id = pat.subject_id
    WHERE ie.DBSOURCE = 'metavision'
) as A
WHERE age < 16

you will get 3 results, such as

subject_id hadm_id icustay_id intime              outtime             age
32035      113114  269627     2159-02-15 21:01:05 2159-02-16 19:16:36 15.05

These are ALL the subjects under 16 years of age whose data was collected using the Metavision system. If you include the CareVue system, you will get 9 results in total.

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.