Patient description: The patient is a 47-year-old Asian woman complaining of persistent feelings of sadness. She lost interest in activities she used to enjoy. She states that her mood is mostly depressed for the past 3 weeks. She also lost her appetite , which led to about 5kg weight loss. She complains of loss of energy and feelings of worthlessness nearly every day. She is not using any drugs and she does not smoke. She doesn't drink alcohol. She used to exercise every day for at least 30 min. But she doesn't have enough energy to do so for the past 3 weeks. She also has some digestive issues recently. She is married and has 4 children. She is menopausal. Her husband was recently diagnosed with colon cancer and he is starting his chemotherapy. There is nothing remarkable in her past medical history and her drug history is only positive for Vit D3 1000 units daily. Her family history is negative for any psychologic problems. Her HAM-D score is 20.

Clinical trial eligibility criteria: eligible ages (years): 18.0-65.0,  Major Depressive Disorder Bipolar I Disorder Bipolar II Disorder Bipolar Depression Suicidal Ideation Provision of written informed consent 2. [MDD stream only] Diagnosis of major depressive disorder, currently depressed as determined by DSM-IV diagnostic (confirmed using the MINI) 3. [BD stream only] Diagnosis of bipolar disorder, type I or type II, currently depressed as determined by DSM-IV diagnostic (confirmed using the MINI) 4. Both females and males, aged 18 to 65 years 5. Inpatient status 6. Female patients of childbearing potential must have a negative urine human chorionic gonadotropin (hCG) test at enrolment and must be taking or willing to take some acceptable form of birth control during the course of the study if they are or plan to be sexually active 7. The ability to understand and comply with the requirements of the study and capable of providing informed consent 8. Suffering from suicidal ideation/attempts as evidenced by a score of >0 on either of the SSI or CSSRS or both  Current or past psychotic symptoms 2. Substance or alcohol dependence at enrollment (except dependence in full remission, and except for caffeine or nicotine dependence), as defined by DSM-IV 3. Opiates, amphetamine, barbiturate, cocaine, cannabis, or hallucinogen abuse by DSM-IV within 4 weeks prior to enrollment 4. Any pervasive developmental disorder (according to DSM-IV criteria) 5. Diagnosis of dementia (according to DSM-IV criteria) 6. Known intolerance or hypersensitivity to ketamine or midazolam as judged by the investigator 7. Significant medical condition that would contraindicate the use of ketamine, midazolam or that is untreated and would need urgent attention (as determined by treating physician) 8. Medical conditions that would significantly affect absorption, distribution, metabolism, or excretion of ketamine or midazolam 9. Unstable or inadequately treated medical illness (e.g. congestive heart failure, angina pectoris, hypertension) as judged by the investigator 10. Any clinically significant deviation from the reference range in clinical laboratory test results as judged by the investigator 11. Pregnancy (or female of child-bearing age not using adequate contraception) or lactation 12. A positive β-hCG test at enrollment 13. Involvement in the planning and conduct of the study 14. Previous enrollment or randomisation of treatment in the present study 15. Participation in another drug trial within 4 weeks prior enrollment into this study or longer in accordance with local requirements