Not finished, but... I've fixed the bug so now the system optimizes with the unified optics. Furthermore, I've begun working on how to script all patients. The quickest way is to introduce a 'patient_index.txt' that tracks what patient path to use.
I added the indices for the patients. The index from patient_index.txt should match the line number of the desired path from the patient_paths.txt file.