Table of Contents
Common Questions
Chat with CodyMD
Cody's Chat with Patient
Cody's AI Summary
Top 3 AI Diagnosis List
Review by Dr Albert DiPiero
Dr. DiPiero Video Guide to this Case Study
Resource Center
Testimonials
Share this Case Study
Meet your host

Albert DiPiero, MD MPH FACP
I am a co-founder and the Chief Medical Officer at CodyMD and your host for this edition of Cody Grand Rounds. I have been a practicing physician and faculty member at medical schools for over 26 years.
About The AI Doctor Case Study
CodyMD is a partnership between Human Doctors and AI Doctors. Cody is an AI Doctor who helps thousands of people every day. At each Cody Grand Rounds, I select a real case and review it with Cody, the AI Doctor.
Each case is based on a real patient but has been modified to maintain privacy and to emphasize certain teaching points.
What causes insomnia?
How does sleep apnea affect sleep?
Can stress cause insomnia?
How much sleep is considered enough?
What are the symptoms of secondary insomnia due to depression?
How can AI help in diagnosing sleep disorders?
Are there treatments available for insomnia?
Click the button below to initiate a conversation with CodyMD, your AI Doctor.
Below is a conversation transcript between the patient and our AI Doctor CodyMd.
Cody, the AI Doctor
So, you're here to discuss your sleep issues, correct?
Patient
Yes, that's right.
Cody, the AI Doctor
Good to meet you! My goal is to provide you with an accurate assessment and plan. Let's talk about your concerns regarding sleep. How long have you been experiencing insomnia?
Patient
It’s been about three months now.
Cody, the AI Doctor
Thank you for sharing. Did this issue start suddenly or did it develop gradually over time?
Patient
It started gradually.
Cody, the AI Doctor
Understood. On a scale of 1 to 10, with 1 being no impact and 10 being severely disruptive, how would you rate the severity of your insomnia?
Patient
I would say it's a 6 out of 10.
Cody, the AI Doctor
That's quite significant. Do you have any history of chronic illnesses such as heart failure, asthma, or diabetes?
Patient
No, I don’t have any of those.
Cody, the AI Doctor
Do you take any medications regularly?
Patient
No, I'm not on any medications.
Cody, the AI Doctor
Do you smoke or consume alcohol?
Patient
No, I don’t smoke. I have a glass of wine socially, but it's quite rare.
Cody, the AI Doctor
Let's talk more about your sleep patterns. Do you have more trouble falling asleep initially or staying asleep through the night?
Patient
I can fall asleep initially, but I wake up in the middle of the night and can’t get back to sleep.
Cody, the AI Doctor
And roughly how many hours of sleep are you getting each night?
Patient
About 5 hours.
Cody, the AI Doctor
Sorry to hear that. That must be quite exhausting. Do you have any chest pain or shortness of breath?
Patient
No chest pain or shortness of breath.
Cody, the AI Doctor
Have you noticed any changes in your mood or energy levels recently?
Patient
I've been feeling more irritable and have less energy, but I think that’s because I'm so tired.
Cody, the AI Doctor
It sounds like your sleep is certainly affecting your overall well-being. Do you feel stressed or anxious lately?
Patient
Yes, I have been feeling more stressed with work and some personal issues.
Cody, the AI Doctor
Thank you for that information. It helps paint a fuller picture of what might be going on.
Based on the information and conversations with Cody, we have prepared a top 3 AI Diagnosis List.
1. Primary Insomnia( 50 % probability)
Likely due to behavioral and environmental factors like stress and personal issues. Primary insomnia is characterized by difficulty in maintaining sleep without a direct correlation to other medical or psychological conditions.
2. Sleep Apnea(30 % probability)
A condition where breathing involuntarily stops and starts during sleep. This can lead to poor quality sleep and waking up frequently at night.
3. Secondary Insomnia due to Depression(20 % probability)
Insomnia that occurs as a result of depression. The patient reports increased irritability and low energy, which could be indicative of an underlying mood disorder contributing to sleep issues.

Dr. Albert DiPiero
In reviewing the patient’s history and symptoms,
1. Primary Insomnia(50% probability)
This condition is often indirectly related to psychological factors such as stress and personal issues without other medical conditions being the primary cause. The patient reports significant stress and personal issues recently, aligning with this diagnosis.
2. Sleep Apnea(25% probability)
Characterized by repeated episodes of breathing pauses during sleep, leading to poor sleep quality. Though she does not report classic symptoms like loud snoring or observed apneas, it is a condition worth considering and ruling out.
3. Secondary Insomnia due to Depression(25% probability)
Depression-related insomnia involves difficulty staying asleep and is often associated with irritability and low energy. Increased irritability and low energy indicate a potential underlying mood disorder.
Next Steps for Evaluation
Polysomnography (Sleep Study): Helpful in identifying sleep apnea.
Psychological Assessment: Screening for depression and anxiety disorders could reveal underlying mental health issues contributing to insomnia.
Sleep Hygiene Assessment and Counseling: A thorough evaluation of sleep habits and environment.
Potential Treatment Modalities
Cognitive Behavioral Therapy for Insomnia (CBT-I): Highly effective for treating primary insomnia.
Medications: Sleep medications (such as benzodiazepine receptor agonists and orexin receptor antagonists) could be considered temporarily, under close medical supervision.
Lifestyle and Stress Management: Techniques like mindfulness, relaxation exercises, and addressing stressors in her life.
Conclusion: The patient’s insomnia is likely multifactorial, with primary insomnia the most probable diagnosis, closely followed by possibilities of sleep apnea and secondary insomnia due to depression. A multifaceted approach including further evaluation, along with behavioral and possible pharmacological interventions, will be essential in improving her sleep quality and overall well-being.
CodyMD is a very precise and accessible app. My consultation with CodymMD is commendable and I highly recommend it for others to try CodyMD especially for assessment and consultation purposes.
TrustPilot Review
Dr Cody spot on, better than most Human Drs. Also far more pleasant. Try him, he could better help you understand your issues. He will give you good info for your Drs visit as well.
TrustPilot Review
It gave me the best response possible and suggested simple self care treatment options which I'm in favor with. It has a to the point interface and brief answer for better understanding.
TrustPilot Review
Humans Served
Table of Contents
Common Questions
Chat with CodyMD
Cody's Chat with Patient
Cody's AI Summary
Top 3 AI Diagnosis List
Review by Dr Albert DiPiero
Dr. DiPiero Video Guide to this Case Study
Resource Center
Testimonials
Share this Case Study
Meet your host

Albert DiPiero, MD MPH FACP
I am a co-founder and the Chief Medical Officer at CodyMD and your host for this edition of Cody Grand Rounds. I have been a practicing physician and faculty member at medical schools for over 26 years.
About The AI Doctor Case Study
CodyMD is a partnership between Human Doctors and AI Doctors. Cody is an AI Doctor who helps thousands of people every day. At each Cody Grand Rounds, I select a real case and review it with Cody, the AI Doctor.
Each case is based on a real patient but has been modified to maintain privacy and to emphasize certain teaching points.
What causes insomnia?
How does sleep apnea affect sleep?
Can stress cause insomnia?
How much sleep is considered enough?
What are the symptoms of secondary insomnia due to depression?
How can AI help in diagnosing sleep disorders?
Are there treatments available for insomnia?
Click the button below to initiate a conversation with CodyMD, your AI Doctor.
Below is a conversation transcript between the patient and our AI Doctor CodyMd.
Cody, the AI Doctor
So, you're here to discuss your sleep issues, correct?
Patient
Yes, that's right.
Cody, the AI Doctor
Good to meet you! My goal is to provide you with an accurate assessment and plan. Let's talk about your concerns regarding sleep. How long have you been experiencing insomnia?
Patient
It’s been about three months now.
Cody, the AI Doctor
Thank you for sharing. Did this issue start suddenly or did it develop gradually over time?
Patient
It started gradually.
Cody, the AI Doctor
Understood. On a scale of 1 to 10, with 1 being no impact and 10 being severely disruptive, how would you rate the severity of your insomnia?
Patient
I would say it's a 6 out of 10.
Cody, the AI Doctor
That's quite significant. Do you have any history of chronic illnesses such as heart failure, asthma, or diabetes?
Patient
No, I don’t have any of those.
Cody, the AI Doctor
Do you take any medications regularly?
Patient
No, I'm not on any medications.
Cody, the AI Doctor
Do you smoke or consume alcohol?
Patient
No, I don’t smoke. I have a glass of wine socially, but it's quite rare.
Cody, the AI Doctor
Let's talk more about your sleep patterns. Do you have more trouble falling asleep initially or staying asleep through the night?
Patient
I can fall asleep initially, but I wake up in the middle of the night and can’t get back to sleep.
Cody, the AI Doctor
And roughly how many hours of sleep are you getting each night?
Patient
About 5 hours.
Cody, the AI Doctor
Sorry to hear that. That must be quite exhausting. Do you have any chest pain or shortness of breath?
Patient
No chest pain or shortness of breath.
Cody, the AI Doctor
Have you noticed any changes in your mood or energy levels recently?
Patient
I've been feeling more irritable and have less energy, but I think that’s because I'm so tired.
Cody, the AI Doctor
It sounds like your sleep is certainly affecting your overall well-being. Do you feel stressed or anxious lately?
Patient
Yes, I have been feeling more stressed with work and some personal issues.
Cody, the AI Doctor
Thank you for that information. It helps paint a fuller picture of what might be going on.
Based on the information and conversations with Cody, we have prepared a top 3 AI Diagnosis List.
1. Primary Insomnia( 50 % probability)
Likely due to behavioral and environmental factors like stress and personal issues. Primary insomnia is characterized by difficulty in maintaining sleep without a direct correlation to other medical or psychological conditions.
2. Sleep Apnea(30 % probability)
A condition where breathing involuntarily stops and starts during sleep. This can lead to poor quality sleep and waking up frequently at night.
3. Secondary Insomnia due to Depression(20 % probability)
Insomnia that occurs as a result of depression. The patient reports increased irritability and low energy, which could be indicative of an underlying mood disorder contributing to sleep issues.

Dr. Albert DiPiero
In reviewing the patient’s history and symptoms,
1. Primary Insomnia(50% probability)
This condition is often indirectly related to psychological factors such as stress and personal issues without other medical conditions being the primary cause. The patient reports significant stress and personal issues recently, aligning with this diagnosis.
2. Sleep Apnea(25% probability)
Characterized by repeated episodes of breathing pauses during sleep, leading to poor sleep quality. Though she does not report classic symptoms like loud snoring or observed apneas, it is a condition worth considering and ruling out.
3. Secondary Insomnia due to Depression(25% probability)
Depression-related insomnia involves difficulty staying asleep and is often associated with irritability and low energy. Increased irritability and low energy indicate a potential underlying mood disorder.
Next Steps for Evaluation
Polysomnography (Sleep Study): Helpful in identifying sleep apnea.
Psychological Assessment: Screening for depression and anxiety disorders could reveal underlying mental health issues contributing to insomnia.
Sleep Hygiene Assessment and Counseling: A thorough evaluation of sleep habits and environment.
Potential Treatment Modalities
Cognitive Behavioral Therapy for Insomnia (CBT-I): Highly effective for treating primary insomnia.
Medications: Sleep medications (such as benzodiazepine receptor agonists and orexin receptor antagonists) could be considered temporarily, under close medical supervision.
Lifestyle and Stress Management: Techniques like mindfulness, relaxation exercises, and addressing stressors in her life.
Conclusion: The patient’s insomnia is likely multifactorial, with primary insomnia the most probable diagnosis, closely followed by possibilities of sleep apnea and secondary insomnia due to depression. A multifaceted approach including further evaluation, along with behavioral and possible pharmacological interventions, will be essential in improving her sleep quality and overall well-being.
CodyMD is a very precise and accessible app. My consultation with CodymMD is commendable and I highly recommend it for others to try CodyMD especially for assessment and consultation purposes.
TrustPilot Review
Dr Cody spot on, better than most Human Drs. Also far more pleasant. Try him, he could better help you understand your issues. He will give you good info for your Drs visit as well.
TrustPilot Review
It gave me the best response possible and suggested simple self care treatment options which I'm in favor with. It has a to the point interface and brief answer for better understanding.
TrustPilot Review