For various neurological or psychiatric conditions, treatments and rehabilitation procedures have been developed that try to stimulate affected functionalities, e.g. music therapy or chess play for dementia.
I am wondering whether there are any such examples where active coding by the patients is used as a diagnostic, therapeutic or rehabilitation measure.
This question is not about patients who have written software that was then used in their diagnostics, therapy or rehabilitation (I know that this happens too). Instead, it is about the act of coding as a measure to help reveal or treat or otherwise improve a patient's condition.