vitamin D deficiency is not an uncommon feature for those admitted to psychiatric hospitals (see here and see here).
This time around I present the results published by Dipen Patel & Manjunath Minajagi  who reported that: "49% (N = 51) of participants were vitamin D deficient (serum 25(OH)D <30 nmol/L), and a further 42% (N = 44) were vitamin D insufficient (<50 nmol/L); 8.7% (N = 9) of participants were vitamin D sufficient (>50 nmol/L)."
'Participants' mentioned by Patel & Minajagi, referred to 104 adults (average age of 40) admitted to a psychiatric hospital who provided written consent to participate in their study and were diagnosed with a range of psychiatric disorders including "depressive episode", "bipolar affective disorder", "schizophrenia" and/or "personality disorder". We are told that: "Vitamin D levels were requested alongside standard admission blood tests on serum samples collected by venepuncture." Sounds like a good call by all accounts.
Alongside noting those quite important numbers/percentages of vitamin D deficiency and insufficiency (see here for more information about the distinction), authors also reported that: "There were no statistically significant differences noted in mean serum 25(OH)D associated with gender, age or primary diagnosis." They did however mention that: "Mean serum 25(OH)D was higher in participants of White British ethnicity compared with those of other ethnic backgrounds" indicating that skin colour probably plays a role in vitamin D production/levels. A shocker indeed .
"At the current time, there is insufficient evidence to draw any firm conclusions regarding an association between vitamin D deficiency and non-musculoskeletal health outcomes, including mental illness. More research in the form of larger epidemiological and intervention studies are needed to investigate the association between vitamin D and mental health outcomes; indeed, randomised controlled trials are planned that will hopefully shed more light on this intriguing area in the future." Sorry about the large text grab noted in that last sentence, but the authors said it better than I ever could in terms of (a) being cautious about making any specific connections between vitamin D deficiency/insufficiency and 'mental illness' and (b) the value of supplementation (see here and see here) outside of just restoring vitamin D levels to where they should be.
That being said, there is a further scheme of work to look at drawing on data from other labels (see here for example). Remembering also that, minus too many sweeping generalisations, some of the other health issues that seem to follow a psychiatric label *might* also show some involvement with vitamin D  too...
 Patel D. & Minajagi M. Prevalence of vitamin D deficiency in adult patients admitted to a psychiatric hospital. BJPsych Bull. 2018 May 2:1-4.
 Bonilla C. et al. Skin pigmentation, sun exposure and vitamin D levels in children of the Avon Longitudinal Study of Parents and Children. BMC Public Health. 2014;14:597.
 Lu L. et al. Association of vitamin D with risk of type 2 diabetes: A Mendelian randomisation study in European and Chinese adults. PLoS Med. 2018 May 2;15(5):e1002566.