ICD-9 is the disease classification system used in MIMIC-III. Here, we are going to review its main structure, and we are going to see how the ICD codes can help us extract summary statistic from MIMIC-III database with relation, for example, to the number and distribution of patients across age which are diagnosed with a specific disease. We're going to also see how we're going to be able to put together queries to extract data with relation to the most common ICD codes in the MIMIC database and how these codes are distributed across ICU units. Here, we see the main structure of the ICD-9 coding system. We see that it consists from three digits that reflect a category and two digits that reflect the cause or the location. As we're going to see late, the category reflect epidemic diseases, can be constitutional or general diseases, can be local diseases arranged by the system. For example, circulatory system or respiratory system, can be developmentally diseases or injuries. The World Health Organization requires a minimum of three-character categories level for international reporting and comparison. Therefore, these three digit needs always to be provided with the corresponding number. Whereas the fourth digit is filled with X when there is no further information about the sub-division. Here, we see a more detailed overview of the ICD-9 categories. In the first column, we see the codes related to the three first digits of the ICD-9 code. On the right column, we see the description of each of these categories. We started here with epidemic diseases and then we see diseases like neoplasm, endocrine, nutritional, and metabolic diseases and immunity disorders. We see here diseases of the blood and blood forming organs, mental disorders, and then we see also a number of diseases related with specific systems, such as the nervous system and sense organs, the circulatory system, the respiratory system, the digestive system, the genitourinary system, and so on. Subsequently, we see developmental diseases, for example, congenital abnormalities. We also see injury and poisoning category. Finally, we see here that the last two categories, the first digit can be a letter. Both of this category offer a supplemental classification. Here, we're going to see how we can extract those codes from MIMIC-III. ICD codes in MIMIC-III are under the table of Diagnoses_icd. This table can be linked to Patients table and Admission table, but based on the subject_id. Here, we would like to extract the patients who were diagnosed with hypertensions and are at least 30 years old. Hypertension normally is associated with older age. As we've seen in previous queries, we need to join the Admissions table and the Patients table in order to be able to find the age of the patients based on date of birth and their admission. Subsequently, we filter for age, and then we find the particular patients which have assigned a code of ICD-9 related to hypertension. For generality, we're going to also consider the case that we don't filter the patients with relation to a specific age, but instead, we only filter the patient with relation to the specific ICD code here, for example, for hypertension. We extract also the age because we are interested of making a histogram of the people with hypertension across different ages. Here we visualize our results with a histogram of age, with relation to the number of patients with hypertension. As we expected, we see that for 60 years old to about eight years old, a number of patients that have hypertension gets its maximum value. Here we see another example of a query to extract the distribution of ICD-9 codes across intensive care units in the mimic three database. First, we need to sort the ICD-9 codes with relation to their prevalence, and then we will select the top five ICD-9 codes. We are only interested in patients that are older than 60 years old, and they have been admitted in one of the intensive care unit. Firstly, we combine the patient table and the admission tables in order to extract the time of admission and the age of the patients. The ICU stay's table help us to fill the patients that they have not admitted in any ICU unit. On the other hand, we also join the diagnosis ICT table with the dictionary ICD diagnosis table in order to be able to also extract the description related to the specific code. In the diagnosis ICT table, we also pay attention to the priority of each ICD-9 code because we are interested for the primary diagnosis. Here we should highlight that a hospital admission can be assigned with several ICD-9 codes. This reflects the fact that the patient at the same time can suffer from several diseases when he admitted in the hospital. Taking all this together, the information we extract from the patients is their age, their primary diagnosis, a description of their ICD-9 code, as well as the identifier of the hospital admission. Subsequently, we can use this to filter patients which are older than 16, and also to filter ICT codes with relation to whether they are primary or not. Here, we visualize those results across all the intensive care units. We see the distribution of ICD codes in the coronary intensive care unit. We see also in the cardiac surgery recovery unit. We see in the medical ICU, we see in the surgical ICU, and as well as the trauma surgery ICU. The color-coding reflects the type category of the ICD code. As we expected in the coronary care unit, in the cardiac surgery recovery unit, that diseases related to the circulatory system are the most prevalent. But in the medical intensive care unit, we see both diseases of circulatory system as well as pulmonary diseases. In the trauma surgery intensive care unit is expected to see diseases related to trauma. On the other hand, on the surgical intensive care unit and in the medical intensive care unit, we see a more diverse profile of the ICD codes. Summarizing, we discussed the main structure of ICD-9 codes in the chapters it consists of. To familiarize with ICD-9 codes in Mimic 3, we see a number of queries of how to extract the distribution of ICD-9 codes across age, as well as how to extract ICD-9 codes across intensive care units.