Increased demands on healthcare make it more and more important to schedule the appointments of the patients' treatments and care optimally. The optimised patient scheduling may decrease the patients' waiting times, reduce the length of the treatments, and utilise healthcare resources more effectively. However, as the patient scheduling problems differ significantly, it raises the question of how a general patient scheduling problem can be formulated and solved independently from the application areas. This study suggests a general way to define and solve the patient scheduling problem. The proposed method utilises the standard elements of the Fast Healthcare Interoperability Resource standard to define the input elements of the patient scheduling problem, then automatically converts the task to a process optimisation problem and solves it using the P-graph methodology. The proposed method can be applied to solve any patient scheduling problem, and it does not require a specific mathematical description and formulation defined for each problem separately.