The absence of standardized protocols for integrating end-stage renal disease patient data into AI models has constrained the potential of AI in enhancing patient care. Here, we present a protocol for processing electronic medical records from 1,336 peritoneal dialysis patients with more than 10,000 follow-up records. We describe steps for environment setup and transforming records into analyzable formats. We then detail procedures for developing a directly usable dataset for training AI models to predict one-year all-cause mortality risk. For complete details on the use and execution of this protocol, please refer to Ma et al.