“I don’t sleep well and I’m exhausted” were her main complaints that day in the office. I then asked her, “What does an average 24-hour day look like for you?” She proceeded to describe her work as a janitor from 6 PM until 12:30 AM, sleeping from 1 AM until 6 AM, getting up to take her children to school, and then going to a second part-time job from 7 AM until 12 PM. After returning home from her second job, she does home errands and cooks, then picks up her children from school. She feeds them dinner before heading to her main job.  After getting a peek into a typical day of my patient’s life, and looking at her sleep study, it was clear that she had more than one sleep problem. Yes, she snored and had a crowded airway and indeed was found to have mild obstructive sleep apnea. Yes, she was under constant stress and sometimes had trouble falling asleep. But her biggest sleep disorder was the one that was eclipsing them all—insufficient sleep.

We now know that nutrition, exercise, and sleep are the three key components, or pillars, to living a healthy life and reducing the risk of poor performance and disease. 15 years ago the consequences of chronic insufficient sleep were not well-established, whereas today physicians and the general public are much more attuned to the potential consequences of sleep deprivation.  In the latest issue of SLEEP (Watson, NF et al., Recommended amount of sleep for a healthy adult: a joint consensus statement of the American Academy of Sleep Medicine and Sleep Research Society. SLEEP 2015; 38(6):843–844), experts in Sleep Medicine published their consensus statement on the desired sleep duration for adults ages 18-60. After reviewing 5314 scientific articles on the association between sleep duration and health, they came to the following conclusions:

  • “Sleeping less than 7 hours per night on a regular basis is associated with adverse health outcomes, including weight gain and obesity, diabetes, hypertension, heart disease and stroke, depression, and increased risk of death. Sleeping less than 7 hours per night is also associated with impaired immune function, increased pain, impaired performance, increased errors, and greater risk of accidents.
  • Sleeping more than 9 hours per night on a regular basis may be appropriate for young adults, individuals recovering from sleep debt, and individuals with illnesses. For others, it is uncertain whether sleeping more than 9 hours per night is associated with health risk.
  • People concerned they are sleeping too little or too much should consult their healthcare provider.”

Although wanting eight hours of sleep at night is a laudable goal, eight hours is not what everyone needs, and even 7 hours, as recommended above, may be hard to attain due to employment, home responsibilities, and other factors beyond our control. One of the treatment challenges of improving sleep duration is that by putting pressure on ourselves to sleep enough, we may inadvertently trigger anxiety about sleep and therefore push sleep further away.  In an achievement-oriented world, we easily fall into the trap of treating sleep as another “achievement,” rather than as something we let happen. We humans have the unique ability to push sleep away.  In the case of my patient described above, we’ve taken a pragmatic approach to her sleep problem–our biggest accomplishment so far has been working together to carve out a precious hour in her day….to take a nap.

Melissa Lim, MD

Sleep Specialist

Redwood City, CA

BRAIN TOILETING: Flushing Out the Purpose of Sleep

When new healthcare students look at me quizzically, as I recommend “pulmonary toilet measures” in the care of a patient, I am sure their look also connotes a tinge of, “What is this dinosaur of a doctor saying?” When we speak of old fashioned ‘pulmonary toileting’, we refer to the various ways in which a patient, often with the assistance of a respiratory therapist, cleans out their lungs, whether it be with increased physical activity, medications and bedside tools to break up mucus, or tipping a patient head down and beating them gently on the back. After some combination of these methods, the lungs are better cleared and cleaned of thick mucus and cellular debris. These methods have been known for decades as tools for assisting patients in the natural function of their lungs, especially when the lungs are compromised by respiratory infections.

In the area of sleep medicine, we have yet to answer the fundamental question as to the purpose of sleep. We know that animals universally undertake this activity, despite sleep’s inherent dangers in the dog-eat-dog animal kingdom. It’s no surprise that giraffes evolved to sleep 30 minutes a day (and do not lie down for more than 5 minutes!), whereas tigers sleep for 18 hours a day. Given its universality, then, sleep must be important. Some theories include the energy conservation theory, which is supported by a decreased caloric consumption that occurs during sleep. A second theory is that sleep serves a restorative function. For example, nocturnal growth hormone secretion may facilitate cell regeneration and muscle growth. More recently, researchers have described the metabolic clearance of toxic waste that occurs during sleep, or a form of “brain toileting,” to be concise. In animal models of sleep, there is a demonstrable increase in the volume of the fluid outside of and in between brain cells (Xie et al, Science, 2013 October; 342 (6156): 373-7), and in the clearance of beta-amyloid, one of the proteins found in abundance in brains of patients with Alzheimer’s disease. Dr. Maiken Nedergaard of the University of Rochester refers to a “glymphatic system,” much like the body’s lymphatic system, whereby the brain’s glial cells drive the exit of brain’s cellular byproducts into the cerebrospinal fluid for removal, and discovered that this system is the most active during sleep (see “Goodnight. Sleep Clean.” by M. Konnikova, NY Times, Jan. 10, 2014). Conversely, in sleep deprived animals, the clearance of brain toxins is significantly reduced. Although the corollary research in humans remains pending, the implications are many. As a whole, we sleep fewer hours per night than we did generations before, and sleep deprivation is steadily increasing. For instance in 2013, 40% of Gallup respondents said they slept 6 hours or less per night, whereas only 11% responded the same in 1942 ( Insomnia and insufficient sleep, from myriad causes, are prevalent in modern society, potentially increasing our risk of, or accelerating, neurocognitive decline.

Whether knowledge of the health risks of sleep deprivation and the health benefits of a good night’s sleep on a regular basis is enough to spur us to change our or our patients’ behavior is questionable. The inevitable alternative is that we will develop medications that enhance the glymphatic system despite sleep loss, or optimize its function during its quiescent state, i.e. while we are awake. At the very least, honing in on the purpose of sleep will help us educate our patients and provide additional ammunition to encourage lifestyle changes that enhance the opportunity to sleep. Until we learn to turn our lights off and take our brains to the loo, that may be the best we can do.

Melissa S. Lim, MD

Sleep specialist, Redwood City, CA

Anatomy of a Medical App Part 2: MobileSleepDoc V2.0–Can a Mobile App Deliver Personalized Medicine?

No one expects an app to take the place of an actual doctor’s visit, but could we design one that asked some of the same questions a doctor would, and then guide a user down a diagnostic and treatment path? There are already many websites that provide similar services to the casual web surfer, so a mobile app that interacts with a user not just to give kudos and badges, but to lead to potential diagnoses, provide current educational information, and suggest possible treatments would not seem far-fetched. MobileSleepDoc V1.0 was problem-centric, as is the case with most medical apps my colleagues and I use on a daily basis. MobileSleepDoc V2.0, on the other hand, is user-centric, whereby the user’s personal sleep profile and sleep reports are presented to the user when they log into the app.

Working on the MobileSleepDoc mobile app for the past 2 years, I have become acquainted with a brand new jargon. Words and phrases like “pivot” and “user friction” are old concepts with a fresh twist. I especially like the concept of pivoting, which amounts to making rapid changes in response to and/or anticipation of a change in business model. After releasing version 1.0 of the app, we had no idea how many pivots we would be making between versions 1.0 and 2.0. The changes were all precipitated by key events. I share these so that others may benefit from what we’ve learned in a whirlwind year.

Shortly after releasing version 1.0, I spoke in-depth with an app marketing company, and was advised to run a focus group–and this would be Event #1–Run a Focus Group. The 12-person group was assembled, and the users played with the app for a few weeks and answered many questions. The end result, 2 months later, was an extremely useful, comprehensive report that would change the course of the app and our business for good. The key question at the end of the group, “Would you recommend this app to a friend?” gave us some “maybe’s” that we would have to learn how to turn into “yes’s.”

Event #2—Create a Business Model. Some people advise creating a business plan before starting a business, but I’m not sure I knew I was creating a business when we developed MobileSleepDoc V1.0. My goal simply was to help as many people with sleep problems as possible for the lowest possible cost, but after that, things were fuzzy. After advice from a few friends, I hired a consultant, an MBA-type, to come pick my brain and point out to me things I didn’t know I knew. After several meetings, the result was a comprehensive report describing our business model and projected financials. These documents serve as a dynamic, working framework of the app and where it may lead.

Event #3—Hire a New Development Team. After 12 months and many late nights working together, the original app developers and I established a productive working relationship. I became very fond of them as individuals and co-collaborators. But what I learned from our focus group was that we needed a strong DESIGN team that understood how to optimize the user’s experience. We then realized we needed to let the old development team go and replace it with a new one whose main strength was in the areas where the previous team fell short. This was an expensive and difficult decision, and it meant losing momentum to teach a brand new team the logic of the app. In the end, we successfully revamped MobileSleepDoc Pro in version 2.0, and launched it in the Apple app store in October 2014.
MobileSleepDoc V2.0 Logo

The major changes include:
1. The new app is User-centric instead of Problem-centric, and centers around the user’s “My Sleep Profile” page.
2. A brand new logo and modern graphics throughout, including extensive sleep reports.
3. A Rewards Program to game-i-fy the most important (and HARDEST) aspect to getting a good night’s sleep—changing the user’s behavior.
4. Animal Dream Totems to place on the user’s Virtual Night Stand. The totems borrow from the Native American tradition of animal spirits carrying potential messages to the user.
5. Brand new soundscapes recorded exclusively for MobileSleepDoc.
6. The User may log sleep manually or sync with their Fitbit!

Sleep LogSleep Log ViewSleep efficiencyTotems

Commentary: A Doctor’s View of Wearable Tech
Actiwatch photo
(ActiwatchTM by Phillips Respironics, 2004, $2000)
Fitbit photo
(Fitbit FlexTM , 2014, $99)

For many years, doctors have been recommending collecting data from patients at home, whether for monitoring blood sugars, blood pressure, peak flows (rate of respiratory volume exhaled), or heart rhythms. In sleep medicine, we often ask patients to keep sleep logs, which is a simple and informative way to graph sleep/wake behavior. Sleep logs are especially useful in patients with insomnia and sleep schedule irregularity (e.g. circadian rhythm disorders). Sleep log data are further supported (or disputed) by the passive monitoring of user behavior through the use of wrist actigraphy, a tiny computer worn on the wrist over several days (photo above, top). Wrist actigraphy is a well-established research tool but not commonly done in the office setting, perhaps because it is not reimbursed by most insurance companies. It is a test I have found to be universally useful in my practice. After wearing the wrist actigraph for 5-7 days, the patient brings it back to the office and we download the data, which shows quite sensitively, their pattern of activity versus stillness, the latter correlating with time asleep. From the data we can tell whether or not they go to bed around the same time each night, keep a regular wake-up time, how long they slept, and how many (and how long) awakenings (active periods at night) they experienced each night.

With the advent of fitness and sleep trackers like the FitbitTM (photo above, bottom), I now find myself analyzing the same data and reports on a patient’s smartphone through associated apps. In fact, I often recommend the use of fitness trackers to my patients to encourage regular physical activity AND to monitor their sleep routines, since both of these “interventions” improve sleep quality. These ubiquitous, electronic “flies on the wall” of a patient’s real life are not prescribed as medical devices, but rather are lifestyle-biofeedback-awareness tools at an affordable price. But can they provide clinical benefit to a person? Absolutely. The biggest challenge, however, may be helping the user make sense of the data they are collecting. That’s where working with a provider may be truly enlightening and beneficial to someone’s health. One additional benefit? I am no longer in charge of keeping the patient/user data, but the individual is, and that is one of the biggest advantages of getting tracking devices into the hands of more people. Getting people involved in their health makes them healthier.

Melissa S. Lim, MD
Pulmonary, Critical Care, Sleep specialist
Redwood City, CA

INSOMNIA: Begin at the beginning

Begin at the beginning and don’t leave anything out’ states Ghosh, the brilliant internist turned reluctant surgeon in Abraham Verghese’ novel Cutting for Stone (2009, Knopf, 2010 Random House). Ghosh asks this of each patient he examines, listens carefully to every word, knowing that the key to the patient’s diagnosis lies in the story they are about to tell.

The day to day practice of modern medicine may not require the diagnostic acumen and sharp listening skills needed in Ghosh’s Ethiopia, but the importance of the patient’s story remains true. But how much time does a patient need to spend with their doctor to live longer? We don’t really know. Maybe a 30 minute visit would not make a difference in your survival compared to a 15 minute visit, but you would probably rate your experience higher and trust that your doctor heard you, with a longer visit. And chances are, your doctor’s satisfaction with your visit would be higher as well.

The treatment of insomnia patients presents a particular challenge in the setting of a typical doctor’s office visit. Most patients with insomnia see their family doctor first with complaints of poor sleep. In fact, insomnia is the most common sleep diagnosis, with 50 million adults in the US having insomnia at some point in their life, and 15 million experiencing long term, or chronic, problems falling and/or staying asleep. The 15-minute office visit may be totally fine for evaluating a patient with cold symptoms, but will not scratch the surface of evaluating someone with insomnia. Short visits with the doctor increase the chances of a patient getting a prescription for a medication instead of a therapy session. Although that may be easier for both the patient and doctor, the long term safety of taking sleeping pills on a regular basis needs to be viewed with caution.

As a pulmonologist first, and sleep specialist second, I needed to find my own framework for treating patients with insomnia. Doctors in our specialty are generally more comfortable treating obstructive sleep apnea, since we inherently understand the physiology of collapsible tubes (i.e. the upper airway that becomes blocked during sleep in people that suffer from obstructive sleep apnea). But when we dare to treat the broader range of people with sleep problems, we will come up against the beast of insomnia. The common concomitant psychiatric diseases such as depression and anxiety seem too daunting. Plus, getting people to change the way they think and behave around their sleep-wake schedule seems impossible to achieve. But do we just “punt” our insomnia patients to the nearest insomnia support group and wait for those consultations to return to our inbox?

That may be the best decision, depending on the doctor’s ability to accommodate insomnia patients into their practice, but I personally did not want turn away my patients with insomnia. I turned instead to Canadian psychologist and researcher Charles Morin, Ph.D. I attended a lecture of his on Insomnia back in 2003, and came away with many practical tools I use today to treat my insomnia patients.

For years I have been working with my office staff to create a program for insomnia patients that now looks something like this:

  • Initial visits are 1.5 hours, and I ask patients
    to ‘begin at the beginning and don’t leave anything out’. I need to know about family structure and upbringing, violence experienced and witnessed, sleep patterns over their life span, when did the insomnia begin and what were the precipitating factors? Are there signs and symptoms of depression or anxiety? Do they have a type A personality (this is the person who thinks something should have been done yesterday). What medications, both over the counter and prescribed, have they tried and what were the reactions? Are there signs or symptoms of other sleep disorders like obstructive sleep apnea or periodic limb movements? At this first visit I explain the behavioral approaches to treating insomnia, since these are safer, more effective, and longer lasting than medications.
  • The next follow-up visit is scheduled for 2-3 weeks to review sleep logs, and then monthly for 6 additional visits. We usually schedule these follow-ups at the time of the first visit, since the waiting time for an appointment can be 2-3 months otherwise. A note here: if frequent follow-ups are not arranged then the likelihood of changing behavior decreases significantly.
  • My goal by the end of the first visit is to determine the patient’s ideal wakeup time, and we SET THIS TIME with an alarm clock. If they follow stimulus control principles alone and get out of bed when the alarm goes off, sometimes that is enough to work out of their insomnia pattern.


1) Go to bed when you feel sleepy, not when you think you should go to bed.

2) Get out of bed if not sleeping for more than 15-20 minutes.

3) Eliminate naps.

4) Use the bed and bedroom for sleep only.

5) Maintain a regular wakeup time, and get out of bed close to the time you wake up.

  • At the second visit we review their sleep logs and see what patterns emerge. I do NOT have patients keep sleep diaries since that is more information than I need to see (but can be optional and serve as a sleep “calorie counter” for the patient). By keeping sleep logs, patients graph their own data.

Sleep log instructions and example:

____________12 MN_________________6AM_____________


-Each morning, draw an arrow down when you got into bed and an arrow up when you got out of bed.

-Color in the times you think you were sleeping.

-If you miss a day, just skip it and move on to the next.

  • The follow-up visits can be lengthy as well for insomnia patients, since the issues—both medical and psychological– that keep the pattern of insomnia going, often need to be reviewed. If Stimulus Control Therapy alone is not enough, we move on to Sleep Restriction Therapy (SRT), which is a program of controlled sleep deprivation. We start with the patient’s wake up time, set it in stone as much as possible, then subtract 7 hours from the wake-up time to determine the patient’s first intended bed time. Note here that the many published studies validating SRT as an effective treatment restrict patients more severely, to 5 hours per night, initially. However, even mentioning this time restriction to a patient may cause anxiety and panic—“What do I do for that much time? How can I handle being that exhausted?” And since I am treating people in the context of a medical practice, not a support group setting or therapist meeting, I usually start with “SRT Light” –6 or 7 hours–instead of 5 hours.

My written prescription for SRT looks like this:

1) Set a regular wake-up/get-up time: __________.

2) Do not attempt to get into bed until _______hours before this time, so for eample, if you pick a wake up time of 7 AM, and a sleep restriction program of 7 hours, you would not get into bed until 12 midnight.

3) Keep sleep logs and track your sleep efficiency.

4) Once your sleep efficiency is >=85% for about 2 consecutive weeks, add 15 minutes to your bedtime. In the above example, this would mean going to bed at 11:45 PM.

5) Continue adding 15 minutes to your sleep time about every 2 weeks, until you feel refreshed during the day and have achieved ~85% sleep efficiency.

(*Sleep Efficiency=Time asleep/Time in bed x 100)

Note that this is a prescription, even if no medications are prescribed, and I sign and date it.

  • Why emphasize “Sleep Efficiency”? Although we would all like a “magic sleeping pill,” something that will “knock us out” for 7-8 hours per night, give us the right amount of all the stages of sleep, and come with no side effects, such a miracle drug has not been invented. We do not have a way to directly improve sleep quality, so instead we focus on sleep behavior—what we can control is when we get in and out of bed. We cannot control when we fall asleep. Our brains are way more powerful than the average sleeping pill out there—prescribed or not–so even if we take a pill before bed, we sometimes lie awake wondering if we will ever fall asleep, disappointed time again in the medications. It turns out that keeping a regular schedule and focusing on our sleep efficiency is the best path towards improving sleep quality.

  • SRT shrinks the window of opportunity to sleep, increases the pressure to sleep, thus utilizing sleep deprivation as a tool to improve sleep efficiency. Once our brain knows when our wake up time is, it can deliver the stages of sleep to us in the proper proportion at the right time. We go through all the stages of sleep, non-REM (rapid eye movement) and REM, multiple times in a given night. Deep stage sleep (Stage 3 Non-REM sleep) predominates in the first 3rd of the night, and REM sleep concentrates in the last 3rd, and gets longer with each round. We feel the most refreshed, like we really had a good night’s sleep, when we wake up after that last long REM period in the morning.
  • Under SRT, once sleep efficiency improves to 85% for 2 weeks, then sleep time is added to the bedtime little by little (i.e., by going to bed earlier).
  • Do we all need 8 hours of sleep per night? No. Forget the 8-hour myth! Most adults need somewhere between 7-9 hours per night as their ideal, but the normal range may be as wide as 6-10. How much sleep a person needs is an individual determination, based on how much sleep it takes to feel generally refreshed and alert during the day. There are short sleepers and long sleepers, although the “super short” and “super long” ones appear to have more health problems.

So, in my journey to becoming a non-psychiatrist doctor that treats insomnia patients, I have learned many things. Pardon me in advance for these generalizations, but these are just some observations collected over the years:

  • It is possible to treat insomnia in a medical practice, and focus on behavioral treatment, which is safer and longer lasting than medications.
  • Behavioral therapy takes time. (My staff follow the “2 insomnia patients per day” rule.)
  • Changing behavior is hard to do (anyone try to lose weight, stop smoking, or cut down on alcohol lately?).
  • Insomnia patients tend to be slightly (or more than slightly) anxious, self-critical, high achievers, and you often need to be there simply as their biggest cheerleader.
  • If they are already on medications for their insomnia, leave the medications alone–at least at the beginning. Don’t give them something else to worry about.
  • If the patient has depression or anxiety, co-management with a psychiatrist is a must. Do not worry which came first–the sleep disorder or the mood disorder. Treating both gets both better faster, and better sleep helps keeps the mood disorder in check.
  • If they have struggled with insomnia for some time before going to a doctor, they are already using some coping mechanism. Introducing behavioral therapy disrupts this coping mechanism and may make them feel worse before it makes them feel better. This needs to be reviewed and warned at the outset.

And a parting (but not final) note about my insomnia patients: They are people sensitive to their internal and external environments, and may be quick to mingle their emotions with their intellectual and daily life. Frequently, they are artists, writers, musicians, and other creative souls. I thank them for their sensitivity, for what they create makes my life richer. Our job is not to change who people are, but to help them live with who they are.

Melissa Lim, MD

Pulmonary, Sleep, Critical Care Specialist

Redwood City, CA

Founder, MobileSleepDoc, LLC

Taking advantage of today’s technology, we developed MobileSleepDoc Pro, an interactive, affordable mobile app that leads users to–and through–their sleep diagnoses and treatments, especially users with insomnia and obstructive sleep apnea.

How it works (brief version, more to follow in future blogs!):

Users begin with the Sleep Questionnaires and, based on their answers, are led to their possible diagnoses. If user has Insomnia, they may follow 2 separate behavioral treatment program, starting with Stimulus Control Therapy and, if needed, followed by Sleep Restriction Therapy. Alternatively, users may access SCT and SRT directly from the Home Screen. The app contains a sleep log meter so our users do not have to carry around notebooks and graph paper.

More information about MobileSleepDoc may be found at

Follow us: