## 2 Materials and Methods  
The initial step in this process involved creating a universal and unified metadata model that allows for the collection of key characteristics of data, including numerical, textual, and qualitative information, for selected laboratory tests. The resulting universal data model was developed using the Oracle relational database engine. Dedicated external data parsers were implemented to migrate selected data concerning a specific type of research from a specific period of time to a previously developed universal data aggregation database model. The key steps in implementing these tasks were to ensure the following:  
* Data synchronization between laboratories--the decentralized database system resulted in data inconsistency in the context of handling single-patient data in different analytical laboratories. This issue had to be handled while still considering data anonymization. * The anonymization of data processed in the system--in order to avoid processing the sensitive personal data of patients, the process of data integration had to be anonymized. This was achieved by storing only the patient's date of birth and gender in the universal, integrated data model. The remaining personal data are anonymized and masked with an appropriate hash function to a unique key, making it impossible to read the patient's sensitive personal data. * Consistency of data between laboratories--in order to store data in a universal model, it was necessary to normalize the data features and characteristic parameters, which describe the diagnostic process, test results, and qualitative and quantitative parameters. The values initially used were significantly different in various laboratories and diagnostic analyzers. * Conducting a multi-day data import and integration process while maintaining full availability of source systems in which the diagnostic process was carried out in real time, resulting in the appearance of new data and updating the source databases of research results. The data aggregated as part of the research are stored on a central server. The server is implemented on an HPC server with a Supermicro H11 SSL motherboard (Super Micro Computer, Inc., San Jose, CA, USA) and an AMD EPYC 7401P processor (Advanced Micro Devices, Inc., AMD, Santa Clara, CA, USA). It has 128 GB of RAM memory and SSD drives with a total capacity of 12 TB. The operating system used is Windows Server 2019, and the database engine is Oracle. As part of the research, Figure 1 presents a schematic representation of the four basic stages of the work conducted in the group of machine learning tasks. 1. The analysis of anonymized data from the blood test results of patients, the segmentation of sequence results for each patient, and the creation of patient profiles based on these results. To achieve this, we employed methods for segmenting sequential data, including unsupervised learning methods such as Kohonen networks (self-organizing maps, SOMs), which enable correlational learning to search for objects similar to each other in terms of sequence characteristics. Sequence analysis tools, including PrefixSpan 2.4.0 and RNN (LSTM) (from Keras framework), were used for modeling. The models were trained on datasets of measurement sequences for patients. The test set comprised 49,200 records. After filtering out only patients who underwent tests at least five times, the dataset size was reduced to approximately 4100 series. Validation was conducted on a set consisting of 1906 series with lengths ranging from 5 to 10 measurements. 2. The obtained patient profiles were utilized to personalize the prediction models (sub-models) for the number of test orders. By understanding the characteristics of patient groups, we can determine the likelihood of whether patients from a particular group will repeat tests (those under treatment) or have completed therapy. Predicting orders from a group that does not repeat tests (first tests) requires a different type of modeling because we lack knowledge about previous results.