## 2 Methods
### Data Pre-Processing  
To use GSP to mine the disease sequential patterns (disease patterns) and the drug-taken sequential patterns (drug patterns), we had to convert the format of the diagnosis and prescription medication data according to Tables 2 and 3, respectively. Table 2 presents the list of disease categories. It is based on the International Classification of Diseases, Ninth Revision, Clinical Modification (ICD-9-CM) codes [42]. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & \multicolumn{2}{c}{**SJS Patients**} & \multicolumn{2}{c}{**Population of Taiwan**} \\ \hline
**Gender** & & & & \\ Male & 266 & 48.81\% & 11,626,351 & 50.47\% \\ Female & 279 & 51.19\% & 11,410,680 & 49.53\% \\
**Age** & & & & \\
0–14 & 176 & 32.29\% & 3,905,203 & 16.95\% \\
15–64 & 194 & 35.60\% & 16,729,608 & 72.62\% \\ \(\geq\)65 & 175 & 32.11\% & 2,402,220 & 10.43\% \\  & 545 & 100.00\% & 23,037,031 & 100.00\% \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Characteristics of the study and population of Taiwan. \begin{table}
\begin{tabular}{c c} \hline \hline
**Disease Category Code** & **Disease Category Name** \\ \hline
1 & Infectious and parasitic diseases \\
2 & Neoplasms \\
3 & Endocrine, nutritional and metabolic diseases and immunity disorders \\
4 & Diseases of the blood and blood-forming organs \\
5 & Mental disorders \\
6 & Diseases of the nervous system and sense organs \\
7 & Diseases of the circulatory system \\
8 & Diseases of the respiratory system \\
9 & Diseases of the digestive system \\
10 & Diseases of the genitourinary system \\
11 & Complications of pregnancy, childbirth, and the Puerperium \\
12 & Diseases of the skin and subcutaneous tissue \\
13 & Diseases of the musculoskeletal system and connective tissue \\
14 & Congenital anomalies \\
15 & Certain conditions originating in the perinatal period \\
16 & Symptoms, signs, and ill-defined conditions \\
17 & Injury and poisoning \\
18 & Supplementary classification of external causes of injury and poisoning \\
19 & Supplementary classification of factors influencing health status and contact \\  & with health services \\ \hline \hline \end{tabular}
\end{table} 
Table 2: List of disease categories. (Based on ICD-9-CM). According to past research, more than 100 medications of various classes have been associated with SJS [12; 13]. This study focused on the frequently-implicated medications, based on a previous study [29]. Table 3 lists the drug category codes and names. The original data of the patients, which were retrieved from each patient's medical record for the 2 months preceding hospitalization, included information such as the patient's ID, dates of hospitalization, dates of outpatient visits, disease codes, and drug details. After preprocessing the diagnosis and prescription data, we obtained the following format. The patients' outpatient records could be considered as shown in Table 4.  
Then the patients' outpatient sequences could be considered as shown in Table 5. For example, the third outpatient visit of P1 is presented as \"8, 10, 12\" in Table 4 and as \"(8 10 12)\" in Table 5.  
After pre-processing the out-patient medication records for SJS patients (\(D\)), we classified them according to the number of outpatient visits before SJS hospitalization. Therefore, \(D=\{D_{i}\}\), \(D_{i}\) is the group of SJS patients with \(i\) times of outpatient visits before hospitalization. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Patient ID** & **Number of Outpatient Visits** & **Disease Category Codes** & **Medication Category Codes** \\ \hline  & 1 & 8 & K \\ P1 & 2 & 3,7,16 & M,T \\  & 3 & 8,10,12 & E \\  & 4 & 8,16,17 & C,T \\ \hline P2 & 1 & 8,17 & M,T \\  & 2 & 8 & T \\ \hline P3 & 1 & 6,8,15 & H,T \\  & 2 & 12 & G \\ \hline  & 1 & 8,12 & D,T \\ P4 & 2 & 3,8 & H \\  & 3 & 6,7,9 & T,U \\  & 4 & 8,12 & T \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Examples of patients’ outpatient records.