5

How can I select data only for the first ICU stay of each patient? In the MIMIC-II, there was a column with the sequence of ICU stay (first, second) and another column with the icustay_id. In the MIMIC-III, icustay_id does not appear to be a good identifier. For example in the prescription table, there are many rows with subject_id but no icustay_id.

5

Patients may move between various care units over a single hospital admission. MIMIC-III provides significantly more detail than MIMIC-II about these movements thanks to the addition of the transfers table.

As noted in the MIMIC documentation, icustay_id is an identifier that has been generated using the transfers table for convenience of analysis. The hospital and ICU databases are not intrinsically linked and they do not share the concept of an ICU encounter.

"In the MIMIC-III, icustay_id does not appear to be a good identifier. For example in the prescriptions table, there are many rows with subject_id but no icustay_id."

Many of the entries in the prescriptions table do not have an icustay_id because the order times are not easily associated with a single ICU stay. For example, many prescriptions do not occur while the patient was in the ICU. In these cases it could be misleading to associate the order with any one particular ICU stay, so the icustay_id field is null.

"How can I select data only for the first ICU stay of each patient?"

Code has been shared in the MIMIC Code Repository for creating an icustay_detail table. The table includes an icustay_seq column which would allow you to select only the first ICU stay for each patient:

SELECT distinct(icustay_id)
FROM icustay_detail
WHERE icustay_seq = 1;

To ensure that relevant data is included from sources like the prescriptions table, you could select data for these icustay_id using the subject_id along with restrictions on the intime and outtime. Whether or not you would like to include data in your analysis that occurs beyond the time of the ICU stays is a question that you might also want to consider.

  • 1
    Thanks @alexandreliborio. Please could you upvote and/or accept replies if they answer your question? Let us know if not and we'll try to give more detail. – tomp Dec 27 '15 at 15:26

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.