{'fraction_non_alphanumeric': 0.02817467763986811, 'fraction_numerical': 0.011098303085542717, 'mean_word_length': 5.272742559273583, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Applications of artificial intelligence to improve patient flow on mental health inpatient units - Narrative literature review

Background Despite a growing body of research into both Artificial intelligence and mental health inpatient flow issues, few studies adequately combine the two. This review summarises findings in the fields of AI in psychiatry and patient flow from the past 5 years, finds links and identifies gaps for future research. Methods The OVID database was used to access Embase and Medline. Top journals such as JAMA, Nature and The Lancet were screened for other relevant studies. Selection bias was limited by strict inclusion and exclusion criteria. Research 3,675 papers were identified in March 2020, of which a limited number focused on AI for mental health unit patient flow. After initial screening, 323 were selected and 83 were subsequently analysed. The literature review revealed a wide range of applications with three main themes: diagnosis (33%), prognosis (39%) and treatment (28%). The main themes that emerged from AI in patient flow studies were: readmissions (41%), resource allocation (44%) and limitations (91%). The review extrapolates those solutions and suggests how they could potentially improve patient flow on mental health units, along with challenges and limitations they could face. Conclusion Research widely addresses potential uses of AI in mental health, with some focused on its applicability in psychiatric inpatients units, however research rarely discusses improvements in patient flow. Studies investigated various uses of AI to improve patient flow across specialities. This review highlights a gap in research and the unique research opportunity it presents.


Introduction
Healthcare services face a number of challenges to improve the quality and efficiency of care delivery, despite rising costs and demand. Internal inefficiencies, such as poor patient flow, affect patient safety, patient/staff satisfaction, and the overall quality of care and outcomes [1,2]. Mental health is, by its nature, a particularly complex sector. The growing demand for healthcare coupled with limited resources has created opportunities for digital and technological solutions such as artificial intelligence (AI) to help solve some of the challenges. AI can be used for improvements in clinical outcomes and patient safety, as well as cost reductions, population measurements, and advancements in research [3]. Patient flow can be defined as 'the ability of healthcare systems to manage patients effectively and with minimal delays as they move through stages of care' [2] with quality and patient satisfaction maintained throughout the process. As such, the concept of using patient flow to improve care has received increasing interest, 'especially in relation to reductions in patient waiting times for emergency and elective care' [4]. So far, a significant amount of work and attention has been given to implementing AI in the patient-facing environment, however, potential for improvement remains in "back-end" operations and service provision. Although research has been done on possible applications of AI in mental health as well as in patient flow, not many studies identify the specific opportunities of improving patient flow in inpatient mental health units using AI. A bibliometric analysis conducted by Tran, McIntyre & Latkin et al. [5] found an increasing number of papers over the last few years discussing and evaluating the applications of AI in various aspects of depression and other psychiatric fields including: "clinical predictive analytics, neuropsychiatric diseases' treatment and healthcare, and biomedical applications". However, their keyword and abstract analysis uncovered an absence of literature content addressing the privacy and confidentiality aspects of using AI with patient data, which is an essential limitation of AI to address in the current era of big data. This review will be a useful addition to current AI literature due to the abundance of information, its rapidly evolving nature, and lack of consensus on best practices. This paper aims to explore the prospect of AI to improve patient flow in mental health inpatient units, further discussing the technical, regulatory and logistical hurdles AI poses, by reviewing the literature from the past 5 years and identifying gaps for future research.

Methodology
A narrative literature review was conducted to bridge the gap between AI in mental health and AI in patient flow (Figures 1 and 2). A content analysis method was adopted in this review as a way to identify, analyse and report patterns uncovered in the literature in the form of themes. The OVID database was used to further access Embase and Medline databases. Top journals (JAMA, Nature, The Lancet) were screened for the most relevant studies. Selection bias was limited by strict inclusion and exclusion criteria (Appendix Table 1 & 2). 3,675 papers were identified in March 2020 based on the search strings (Appendix Table 3). 323 were selected after initial screening and 83 were ultimately analysed in this review (Appendix Table 4 & 5). The papers were then split into 2 topics: AI in inpatient mental health units (49 papers) and AI in patient flow (34 papers). The number of papers specifically targeting the use of AI for improving patient flow in mental health units was limited.

AI in inpatient mental health
Three main themes emerged from the literature for AI in inpatient mental health units: diagnosis, prognosis and treatment.

Diagnosis
Diagnosis of mental health disease still lacks objective measures [6], often relying on subjective self-reported questionnaires leading to commonplace misdiagnosis and underdiagnosis [7]. Problems with diagnosis lead to poor outcomes and resource inefficiencies. Applications of AI in diagnosis can happen at all three stages: prediagnosis, peridiagnosis and postdiagnosis.

Prediagnosis
In the prediagnosis stage, AI could provide assistance in triaging patients and diverting patients who do not need interventions [8]. Brodey et al. [9] used Machine Learning (ML) to validate an early psychosis screener and achieved an area under the curve (AUC) of 0.899 (a AUC range of 0.8-0.9 is considered excellent as a discriminator) when differentiating individuals with low risk from high risk. Similarly, Singh et al. [10] developed a triage system for psychiatric cases with an overall classification accuracy of 77%. Although promising, these studies have limited generalisability and require validations on large and carefully chosen samples.

Peridiagnosis
In the peridiagnosis stage, AI can help diagnose patients accurately and enable new objective methods of diagnosis. AI could also enhance the our understanding of diseases. A recent study used clustering to identify five psychosis subgroups that had 'distinctive clinical signatures and illness courses' [11]. Drysdale et al. [12] defined four novel subtypes of depression using clustering analysis of functional MRI (magnetic resonance imaging) scans, their neuroimaging biomarkers achieved high sensitivity and specificity (82-93%) in multisite and out-of-sample replication. Treatments could be personalised based on the different subtypes.
Many studies were based on neuroimaging data. ML has been used to enhance our understanding of the brain, identifying ill patients from controls and recently constructing predictive models [13]. Koutsouleris et al. [14] used MRI-based multivariate pattern classification to distinguish schizophrenia from major depressive disorder (72%-80% accuracy). Similarly, Lu et al. [15] used 'support vector machines' (SVM) to analyse MRIs and discriminate schizophrenia patients from controls (88.4% accuracy). Although those studies showed that ML can be beneficial for neuroanatomical diagnosis in uncertain scenarios, it's important to highlight that studies based on imaging data often lack consistency in the techniques and datasets used [16].
Apart from neuroimaging, other types of data, such as blood inflammatory markers [17] and blood DNA methylation data [18], are being analysed to improve diagnostic accuracy. Liang et al. [19] used ML to develop an objective blood biomarker for hazardous alcohol consumption based on DNA methylation which had higher accuracy of diagnosis than traditional self-reporting (73.9% vs 57.5%). Additionally, research has been done to successfully screen and diagnose patients based on 'natural language processing' (NLP) analysis of self-reports [20] and clinical notes [21].

Postdiagnosis
In the postdiagnosis stage, AI could be used for reviews, detection of errors and quality improvement, and monitoring patients' progress. Research focused on therapy and prognosis will be discussed further on in the review.

Prognosis
Predictive models are crucial in evidence-based medicine, as they guide healthcare professionals' decisions on investigations and treatments [22]. Currently, the predictions are made by classifying a patient to a certain group and referring to that group's averages [23]. Given the multimodality of mental health disorders, the current predictions are rarely specific to an individual. ML can enhance understanding of complex relationships between risk factors and outcomes [8]. 19 out of 49 reviewed studies had prognosis as their major theme and the main subthemes identified were: depression, psychosis and suicide.
Several papers focused on the use of AI to predict risk [24] or severity of depression [25,26]. Kautzky et al. [27] used 47 clinical and sociodemographic factors to predict treatment resistant depression using Random Forests (RF) and 10-fold cross-validation (75% accuracy).
Numerous paths were taken for psychosis related predictions. For example, analysis of psychopathological data with SVM predicted transition to psychosis with 64.6% accuracy in high risk patients [28]. To improve clinical uses of the model, more types of data should be analysed. Fond et al. [29] found that physical aggressiveness and anger were the best predictors of psychosis relapse using ML analysis of neurophysiological, biological and socio-demographics factors (71% sensitivity), while other studies used neuroanatomical data [30]. A novel approach used NLP analysis of unstructured text and speech [16]. Bedi et al. [31] discovered speech features that predicted psychosis development with 100% accuracy. However, further validation will be needed due to its small sample size.
Inpatient suicide can be difficult to predict and prevent. The current gold standard for suicide screening is an inpatient psychiatric assessment, which has a high level of variability. A number of AI studies aimed to predict the progression from various mental health conditions to suicide [32]. Common methods include analysis of electronic health records (EHR), national registries [33] and self-reported questionnaires. Melhem et al. [34] conducted a longitudinal study in which they developed a risk scale through statistical analysis of self-reports from children whose parents had mood disorders. A risk score of three and above proved to be 87% sensitive and 63% specific for predicting suicide attempts. However, the reliability of self-reporting of symptoms is limited due to the patient's motivation, capacity and self-awareness. Desjardins et. al [35]. constructed a suicide risk assessment tool using a neural network model, with 94% accuracy compared to expert psychiatric assessments. This tool also suggests an appropriate intervention based on the risk score, which can be particularly useful in busy wards to help triage high risk patients. Moreover, it increases efficiency by allowing nurses to conduct the screening regularly without the need of experts in the initial stages. Further research comparing the rates of suicide with or without the tool would be a useful addition to the literature.
Researchers often utilise EHR data to predict outcomes. Miotto et al. [36] analysed EHR using unsupervised learning of more than 76,000 patients encompassing 78 diseases, including schizophrenia, to predict 1 year health outcomes. As any analysis of EHR is often highly reliant on the quality of primary data, researchers admit that pre-processing of the EHR was helpful in achieving high accuracy (above 80%). In another study, Menger et al. [37] developed a model to assess inpatient violence risk using ML analysis of EHR validated at two different sites (AUC from 0.643 to 0.797). Similar research was done by Suchting et al. [38] who identified the strongest predictors of aggressive events on psychiatric units: homelessness, having been convicted of assault, and having witnessed abuse. Walsh et al. [39] predicted future suicide attempts based on EHR (AUC ¼ 0.84). Some models are already being used in practice, for example the US Veterans' Administration system [40] McCoy et al. [41] used NLP to extract additional information from hospital discharge notes on psychiatric units, specifically, signs of sentiment and its correlation with readmission and mortality risks. Greater positive sentiment was associated with decreased risk of readmission and mortality. A valuable addition to the literature would be a similar longitudinal study that also follows up the patients. Recent predictive models have been built based on passive (EHR, ECG, online) or active (self-reports) data [42] and although promising, they are often subject to data quality issues.

Treatment
Pharmaceutical and psychotherapeutic treatments are only effective for 30-50% of mental health patients and currently there is no objective gold standard for a combination of psychotherapy and pharmacological treatments [23]. Treatments tailored to patients based on a thorough understanding of the disease and predictions about its development could maximise the likelihood of recovery and optimise resource use. Recent AI research in this field focused on predictions of a patient's response to the treatment and decision support for the most promising intervention for a given patient.
A large part of the literature focuses on neuroimaging. For example, researchers used brain MRI scans to accurately predict response to antidepressants [43,44] cognitive behavioural therapy [45,46] and neurostimulation therapy [47]. Although these are promising studies with high accuracy, more research using external validation and larger (ideally prospective) data sets needs to be performed. It's unclear if the accuracy would be the same with different scanners and on different populations.
Other studies focused on individualised medications. Research has been particularly successful in predicting responses to drugs. Checkroud et al. [48] used unsupervised ML to measure responsiveness of symptom clusters to certain medications and found significant differences between the groups. Large sets of data and a robust study design ensured high significance and generalisability of the results which were used in a commercial decision support platform for primary care providers (SpringHealth) [23]. However, researchers used patient reported outcomes to describe the severity of depression (25-item questionnaire), which has some degree of subjectivity so the quality of the results depended on the design of those self-reporting questionnaires.
Although depression seems to be researched most frequently, some studies predicted treatment outcomes for patients with substance use disorders [49], schizophrenia [50] and psychosis. For example, Koutsouleris et al. [14] used pre-treatment patient data to predict psychosis outcomes after 12 and 52 weeks with 75% and 73.8% accuracy respectively. Researchers were able to predict risk of non-adherence to treatment and other outcomes using factors such as unemployment, poor education, functional deficits, and more. The high quality of the study was ensured by conducting leave-site-out validation across 44 European sites. Although replication is needed before implementation into clinical practice, the study was a successful attempt to show the usefulness of ML in predicting treatment outcomes.
Some studies focused on genetic biomarkers. Genetics variants have been to be linked with therapy outcomes such as in lithium therapy for bipolar disorder [51]. Those results still need to be confirmed (possibly with the use of more modern, robust ML approaches), however they are a promising step towards finding accurate genetic markers.
Monitoring is an important part of effective therapy. Nurses are required to take regular observations, which range from hourly to close proximity supervision at all times [52]. However, these have also been shown to disturb the patient, particularly at night, lowering their chances of a faster recovery, which can then lead to longer length of stay [53]. Barrera et al. [53] used AI to introduce digitally assisted nursing observations which improved both patient and staff experiences. The tool allowed nurses to take observations remotely via a sensor utilising computer vision, signal processing and AI to observe micromovements that allow for pulse and breathing rate calculation. As the study so far only collected preliminary qualitative data, more research is needed to validate the intervention (eg. accuracy and health outcome measurement). Digital observations can potentially have a broad application as they don't require any patient cooperation, compared with standard methods or wearable technology.
Future work could focus on the discovery of both objective biomarkers for development of targeted treatments and objective ways to measure therapy's effectiveness [53]. Studies on AI in therapy aim to enhance decisions and personalise interventions to improve recovery and allocate resources efficiently. Most widely researched conditions include depression, psychosis, bipolar disorders, schizophrenia and substance misuse disorders.

AI in patient flow
Clinical patient data has been widely used to predict outcomes such as length of stay and costs [36,54,55,56]. Recommendations and guidelines were made based on accurate predictions of such measures [57,58,59].
Factors such as biomarkers, sociodemographic, lifestyle and comorbidities are used to estimate prognosis, costs, length of stay and risk of readmission [36,54,55,56,60,61]. Those important clinical predictions can then be used as quality indicators and act to improve resource allocation such as better bed occupancy, more accurate local funding and personalised post-discharge care packages [62,63,64].
Three main themes emerged in the literature for AI in patient flow: bed occupancy, use of EHR and risk of readmission.

Bed occupancy
Bed occupancy has been used as a measure of quality of care in the NHS, and The Royal College of Psychiatrists [65] has a recommended maximum occupancy level of 85%. AI solutions can be used to enhance efficient bed allocations as they could help in 'preventing avoidable admissions, reducing variation in LOS (length of stay) and improving discharge of patients' [66].

Use of EHRs
EHRs are an important source of data for AI models that aim to improve patient flow. For example, Wolff et al. [67] were able to analyse EHR data, applying statistical models to discover hidden trends and predict length of stay. Kovalchuk et al. [68] used 'a combination of data, text, process mining techniques, and ML approaches for the analysis of EHRs with discrete-event simulation and queueing theory' to build a framework for different patient pathways. This simulation of patient flow was implemented in the clinical setting to predict outcomes of each pathway, and in turn reducing length of stay.

Risk of readmission
Many AI models have been able to predict LOS and evaluate the risk of readmission at the time of discharge [56,69,70]. Purushotham et al. [71] used linear regression to benchmark four clinical predictions: risk of mortality, LOS, physiological decline and phenotype classification. The model was designed to overcome the barrier of single-prediction-at-a-time by formulating 'a heterogeneous multitask' algorithm that predicts all four factors simultaneously. In a recent study, Alaeddini et al. [72] challenged the approach and suggested that risk predictions of LOS are dynamic and nonlinear. Researchers argued that post-discharge monitoring is vital and risk prediction should be made on an individual basis. They investigated the timing of discharge to optimise the discharge process, reducing the likelihood of adverse events post-discharge [72].
Donz e et al. [69] used the HOSPITAL score to predict avoidable readmissions. The scoring system was used to categorise patients into different risk clusters based on their biochemistry results and hospital care history. This "nip-it-in-the-bud" approach has the potential to reduce the burden of emergency admissions on hospitals by predicting and deploying interventions before admission. Some patients may have a shorter LOS, but they require more treatment and care, whereas others may stay for longer, but need less intensive monitoring. The key is to ensure that all services of the hospital are utilised without exceeding its limits [73].
Even with the advancement in digital technologies and data analysis, clinical predictions can still be problematic and can differ from hospital to hospital [67]. A 2019 report suggested that more accurate and complex prediction models need to be applied to healthcare; the "untapped potential" in patient data cannot be unlocked without a joint effort from both the clinicians as well as the technicians. Most healthcare professionals lack the skills and tools, and the highly fragmented analytical community also limits the opportunity of making such high-quality complex analytical models [74].

Discussion
This literature review shows that the research investigating the use of AI to improve mental health diagnostics, prognostics and treatment, rarely took patient flow into account as one of the potential measures of improvements or even acknowledged it as a problem to be solved. However, knowing the stages of patient flow, one could argue that innovations in those areas can have an indirect positive effect on patient flow. The inpatient journey begins at admission and thus ML-enhanced triage system could improve the efficiency of the flow and reduce workload by channeling patients to the right services and potentially replacing triage interviews with self-report screening.
Development of objective, quick to administer, accurate, AI-enhanced diagnostic tools could also ultimately improve patient flow by speeding up the processes and time-to-treatment. Research suggests that such tools could be developed based on a combination of patient data such as neuroimaging, biomarkers, and self-reports. Husain, Yu & Tran et al. determined functional near-infrared spectroscopy (fNIRS) to be costeffective compared to the traditional fMRIs used in psychiatry discussed above. fNIRS also adds additional benefits to the patients as they do not require the use of ionising radiation, restraints or loud noise [75]. While fMRIs show notable changes in the brain of depressed patients, they are significantly more expensive than fNRIS and, due to the lack of mobility, pose the issue of accessibility. A systematic review conducted by Ho, Lim & Lim et al. [76] suggested the increased uptake of fNIRS in psychiatry as a diagnostic and predictive tool of major depressive disorders due to the consistent patterns it uncovered in the brains of depressed patients. Adopting ML to read these fNIRS could lead to quicker diagnosis in patients and thus earlier administration of accurate treatment eliminating the current trial and error approach and the problem of misdiagnosis. Prognostic solutions could also have an impact on the patient flow. As discussed, predictive tools have a wide range of applications and could aid with earlier intervention and prevention as well as planning and delivering services.
Applying AI in treating mental health could also have an impact on patient flow. Studies show that, with the use of AI, it may be possible to offer appropriate treatment options to those who are most likely to benefit from them, which could ultimately improve recovery and thus reduce readmission and length of stay, consequently improving patient flow.
The studies that focused on patient flow were rarely conducted in the context of mental health units, however they reveal that AI could be a useful tool to enhance the flow of patients. The same indicators -LOS, risk of readmission -could be used on inpatient mental health units to improve resource allocation which could lead to better outcomes in bed occupancy, more accurate local funding, and personalised post-discharge care packages.
These projections are theoretical and more research needs to be done to investigate the use of AI in mental health inpatient units to improve patient flow. Prediction of LOS is incredibly complex and multidimensional [77]. Moreover, mental health inpatient patient flow is complex and difficult to measure with a single variable. In this literature review, we have outlined numerous applications of AI in mental health and patient flow and discussed how those could potentially be combined to improve outcomes on mental health inpatient units, however further research is needed. It is imperative that a congruent, dynamic and multifactorial model is designed which encompasses the entire patient journey including all of a patient's personal factors.

Technical hurdles
A useful model needs to be accurate, externally validated in a large, heterogeneous population and demonstrate improvements in clinical outcomes [8]. Liu et al. [8] evaluated studies that used AI in medical imaging and concluded that less than 1% of the papers had good enough design to be included in the meta analysis [78]. Initiatives that improve reporting, transparency and quality of prediction models such as TRIPOD [79] or CONSORT [80] and their specific extensions for AI (TRIPOD-ML, CONSORT-AI) should be widely implemented to decrease risks of bias and ensure clinical usefulness. Sultan et al. [81] outlined two main barriers around external validation -the heterogeneity of datasets and the methodological challenges. Data sharing initiatives and "big data" need to be put in place in the future to ensure that algorithms are trained on large and varied datasets [82]. The choice of the architecture of the model needs to be appropriate for the setting and more modern ML techniques are preferable [8]. With the fast pace of technological development and new AI approaches, timely updates of models is crucial [83].

Regulatory & ethical hurdles
A lack of clear regulations and guidelines complicates development of AI models for healthcare [84] and can lead to ethical issues [83]. The advancement of AI diagnosis, treatment and prognosis predictions may result in an inequality of care, as hospitals may treat the less severe with better outcome predictions [64]. Poorly representative training data sets (eg. based solely on white British men) can lead to biased algorithms [85]. Appropriate measures need to be put in place to minimise the risk of bias, for example the US FDA (Food & Drug Administration) "excellence criteria" for assessing medical software [86]. Medical data handling is also controversial. Mental health data is particularly sensitive, any data disclosure could have significant consequences. He et al. [87] highlighted concerns around the use of AI in clinical settings such as data sharing, transparency of decision-making, and patient safety. The European GDPR (General Data Protection Regulation) sets up consent form and data processing requirements and standards to address data-sharing challenges in legislation [85]. The issue of transparency relates to "black-box" algorithms that are not fully interpretable, meaning developers cannot understand how the algorithm derived specific outputs from the given inputs. This raises questions regarding clinical decisions supported by black-box AI and concerns regarding doctors becoming over-reliant on AI. Finally, there are issues regarding liability -who is responsible for medical errors that occur when AI is used in clinical contexts [88]. New regulatory bodies such as institutional review boards, ethics review committees, and health technology assessment organisations will play a significant role in AI regulation [85].

Logistic hurdles
Implementation of a new technology may come at a great monetary cost and time disruption for health providers [88]. The complexity of the hospital environments can mean significant difficulties with any potential changes. Often, new solutions require training and the transition period may be disruptive. For example, when introducing EHR, some hospitals required double documentation to prevent data loss in the initial stages which increased administrative workload for HCPs (Healthcare Professionals). Cresswell et al. [89] categorised factors that contribute to the slow implementation of information technology in hospitals into: strategic, organisational, social and technical. Oftentimes, benefits are difficult to measure or appear over a longer period of time, which can be discouraging. Studies tried to determine factors that contribute to a successful implementation such as perceived ease-of-use and perceived usefulness [90]. Technological solutions may have poor usability, functionality and performance which can lead to frustration and even threaten patient safety [89]. Sheikh et al. [91] found that some technological solutions decreased face-to-face contact amongst HCPs and between HCPs and patients. On the other hand, Harvey et al. [92] showed that when a site receives appropriate support from a national agency when implementing technology, the receptiveness is high.
In order for the solution to be adopted, it needs to be perceived as clinically useful and time-efficient rather than disrupting HCPs. Collaboration between medical professionals, academia, and technical experts is required to ensure the right solutions are being implemented with the right support for the hospital staff.

Patient experience
Although research on AI applications in healthcare is accelerating, we are still lacking an understanding of the impacts of such solutions on patients' experiences, however experts have been speculating about potential benefits as well as risks.
The ML-enhanced triaging systems could aid in directing patients straight to the healthcare services that are most suitable for their needs. This will reduce the number of times patients move between services before reaching the right care service. This could lead to shorter waiting times, better clinical outcomes, and higher satisfaction. Moreover, predictive and diagnostic tools could also improve clinical outcomes and thus could potentially improve patients' experiences. Predictive AI tools offering earlier interventions and preventions can forecast patients most at risk of adverse psychiatric events, allowing for earlier contact and intervention-based care, reducing the detrimental consequences of the conditions if treated later on. A potential benefit of AI is the personalisation of care and the elimination of a "one-size fits all" approach to treatment. By taking into account all patients' personal factors and tailoring management plans to them, there's a potential for greater patient engagement, reduction of non-compliance, and improved long-term outcomes. Finally, some administrative jobs could be automated with AI granting healthcare professionals more time to spend with their patients, probably the most important factor for patient experience and satisfaction. These additional patient contact hours foster better doctor-patient relationships resulting in better therapeutic outcomes in psychiatric care [93], raising staff morale and retention.
With all this being said, there's also a risk that AI could adversely affect the relationships between the patients and healthcare practitioners. If AI is not adequately implemented, it could potentially create more work for doctors as they would need to divert time from their patients to solve the potential problem or spend time on additional administrative tasks. Ineffective implementation of technology can result in less patient contact as concluded by Sheikh et al [91]. The impact these logistical hurdles could have on HCPs and consequently their patients might be detrimental, and the benefits of AI need to be thoroughly outweighed by the risks.
Patient trust in healthcare AI and their relationship with a doctor has to be considered as a two way street: one can affect the other. This doctor patient relationship has been described as the "heart and art of medicine" [94] with trust at its core [95]. There are three key routes to doctor-patient trust: the licensure and regulation of doctors as having an expert knowledge in the field, the values placed on a doctor due to their position in society, and repeated experience of a doctor's abilities [96]. AI has the potential to disrupt all three in both positive and negative ways, for example through patients' willingness to disclose more socially negative information to AI than humans [97], by raising questions around the regulation of AI, and whether AI can hold these same social values.
The way in which AI would be integrated into doctor-patient conversations must also be considered as this constant dialogue and information transfer is at the epicentre of the patient experience in healthcare. As patients become more aware of AI and the increasing use of AI in healthcare, concerns around AI remain prevalent, with 43% of Europeans polling that AI was mostly harmful compared to 38% polling mostly helpful [98]. Lack of trust and human touch have been identified as drivers of negative perceptions [99], which could lead to patients becoming less open and thus impacting on clinicians' ability to effectively treat them. With healthcare data breach and misuse frequency, magnitude, and resulting financial losses on the rise, largely due to increased incidents of hacking [100], a study unsurprisingly found that only 10.2% of patients would be willing to share their anonymous data with "a tech company, for the purposes of improving health care" [101].
Given the potential benefits of the technology, those risks need to be addressed when technologies are being developed and evaluated. Regulatory and legal frameworks are needed to ensure safe development and implementation of AI technologies, and alternatives need to be continually offered whilst AI assisted healthcare becomes the norm. One has to be aware that patient trust and attitudes towards their doctors, the whole of the NHS, and other healthcare providers could on the one hand be enhanced by positive patient experiences and attitudes towards the AI used, but marred by the opposite.

Conclusions
The literature review of AI in mental health revealed that AI could be used for improving diagnostic accuracy, personalisation of treatment and predicting clinical outcomes to ensure timely delivery of interventions; the main objective often being the improvement of the quality of patient care. The literature review on using AI in patient flow explored predicting avoidable readmissions, improving care efficiency, optimising resource allocation, reducing length of stay, and validating existing algorithms for more generalised purposes. In both areas, studies vary in their accuracy and generalisability. There's a need for further research that will focus specifically on patient flow in mental health units. Although this review focused on solutions in the hospital setting, it is important to highlight that the future of healthcare will include high integration between services, thus any community interventions will have a significant indirect impact on the inpatient patient flow.
These potential AI implementations can affect patients' experience either positively or negatively. Further studies should look at the patient perspective on the integration of AI in healthcare as patient experience is a key consideration in healthcare, especially in a patient centred approach. Addressing patient concerns is crucial to wider scale implementation of AI in order to maintain patient autonomy around their sensitive data, particularly in the field of psychiatry.
The use of AI in psychiatric healthcare remains largely unexplored. Important aspects such as the patient's experience, clinical significance and ethical considerations require further studies and evaluation.

Author contribution statement
All authors listed have significantly contributed to the development and the writing of this article.

Funding statement
This research did not receive any specific grant from funding agencies in the public, commercial, or not-for-profit sectors.

Data availability statement
No data was used for the research described in the article.

Declaration of interests statement
The authors declare no conflict of interest.

Additional information
Supplementary content related to this article has been published online at https://doi.org/10.1016/j.heliyon.2021.e06626.