To read this article, it is recommended to read this article first, which has an explanation of the relevant SQL basics.
MIMIC Data Extraction Tutorial - Extracts data from patients admitted to the ICU for the first time.
In general, we don't care about all the clinical indicators of the patient, so let's be more specific, such as: how to extract the first WBC and SPO2 values after the patient is admitted to the ICU.
WBC: White Blood Cell, corresponding to itemid 51300, 51301
SPO2: Oxygen saturation Pulse oximetry corresponds to itemid 646 and 220277
There are three ** involved:
1. ICUSTAY records the ID of all patients admitted to the ICU and the time of admission to the ICU and the time of leaving the ICU.
2. LabEvents recorded laboratory tests for all patients, including those who were not admitted to the ICU.
3. ChartEvents recorded the vital signs of all ICU patients.
The goal is:All livedicupatientsTherefore, based on the data recorded in the icustay table, the common value of the three ** is the subject ID (the unique number of each patient), so as to link the three tables.
As shown in the figure, corresponding to the same ICU record STAY ID (30000153), this patient has many WBC white blood cell records, here we have sorted them by time.
So let's add a column of serial numbers. Then let's just pick the first one.
That is, save the current result as a temporary table with and then filter it.
You can do the same for SPO2, just replace the labevents table with chartevents, and finally join the two tables.
Follow ***Scientific research includedSend"WBC and SPO2"Get the full **.
In n**icat, there will be an export result button after you retrieve the results.
ps: Some students said that the n**icat of ** is not easy to use, and the background replied"n**icat"Get the cracked version with an installation tutorial.
Support for exporting different formats.
In addition, many people will encounter such an error when exporting to Excel, in fact, it is because Excel only supports 65535 rows. When the new crown first came out, didn't there be a news that the British disease control department used excel to count the data of new crown patients, because the limit of more than 65,535 rows caused patients to miss the statistics?SoExport CSV or other formatsThere won't be that problem.