“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

ANATOMY OF A MEDICAL APP: Part 1. MobileSleepDoc from Concept to V1.0

Let me begin by saying that as a doctor, I do not know programming code from a “code blue.” But after seeing hundreds of patients over the past 20 years with sleep problems, I decided to create a mobile medical app to help as many people as possible who have trouble sleeping. This was partly for selfish reasons, of course, since the number of people suffering from sleep problems is overwhelming– compared to the number of practicing sleep specialists, the ratio may be as high as 20,000 to 1. As more and more of my colleagues opt out of seeing patients, the present and looming doctor shortage becomes a very real threat and challenge for all of us. People, therefore, are not seeking or getting the help they need to get the best quality sleep—the most effective performance enhancing drug we can prescribe. Creating MobileSleepDoc and using current technology to educate, diagnose, and guide people to proper treatments seems to me just a practical necessity.

Our model of medical education is initially system-based, and then problem-based. For example, we spend the first part of medical school learning the normal functions of different organ systems—lungs, heart, kidneys, brain, etc.—and then the latter part learning about the diseases that affect each organ system—asthma, emphysema, coronary artery disease, kidney failure, stroke, etc. Traditional medical education introduces patient care in the latter part of medical school (note that this model of medical education has been altered more recently). After graduating from medical school, our real education begins. Patients and published research help us create—sometimes deliberately and sometimes not—treatment frameworks, or protocols, for the diseases we’ve studied. We ask ourselves, “Does this person fit into the expected pattern of signs and symptoms of the problem I am treating? If not, what other diagnoses should I consider? Are they responding as expected to treatment? If not, why?” And so on. Sleep Medicine is a newer member of the medical sub-specialties, and although there may be many “official” sleep diagnoses in the coding manuals, the vast majority of sleep patients present with one or both of the two most common diagnoses—insomnia and obstructive sleep apnea. Thus, when designing MobileSleepDoc, I decided to focus on these 2 disorders.

What is MobileSleepDoc?

The concept for MobileSleep Doc was years in the making, but the first build, or version, of the app began in the late spring of 2012. The path to V1.0 can be outlined as follows:

IDEA–>Budget–>Pitch to Developers–>Choose a Development Team–>BUILD

…with the last component of building the app feeding back to the original idea and budget, in an ongoing manner.

Interestingly, the acronym “IDEA” itself describes the key components of MobileSleepDoc:

1) It is an INTERACTIVE tool that helps identify 2 of the most common sleep disorders, insomnia and obstructive sleep apnea;

2) It is DESIGNED by a board certified sleep specialist, based on proven methods and >20 years’ experience taking care of sleep patients;

3) It EMPOWERS users to take charge of their sleep problems;

4) It ACTIVELY engages users in their own health, which will ultimately make them healthier.

How does MobileSleepDoc work?

The app asks users a series of questions about their sleep and, based on their answers, guides them to their possible diagnoses; specifically, the app lets them know whether they have signs and symptoms of insomnia or obstructive sleep apnea

In the case of insomnia, the app will lead the user to 2 common behavioral therapies prescribed in real-life office situations, such as Stimulus Control Therapy (SCT) and a mild version of Sleep Restriction Therapy (SRT), which I call “SRT-light.” SRT initially causes sleep deprivation, which aids the user by increasing the pressure to sleep at the desired time.


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

2) Get out of bed if not able to fall asleep in 15-20 minutes

3) No naps

4) Bed/bedroom for sleep only

5) Keep a regular wake up/get up time, no matter when you fall asleep


1) Pick desired wake-up time and stick to it

2) Get into bed 7 hours before this desired wake-up time

3) Follow SCT rules 2-5

4) Once user’s sleep efficiency improves and holds steady, the user can add time to their total sleep period by going to bed progressively earlier.

5) SRT is “completed” once the user attains a sleep efficiency >85% most nights, and feels generally refreshed during the day.

MobileSleepDoc monitors user data and gives feedback to encourage the user to continue keeping their sleep logs.

For BOTH SCT and SRT, keeping daily sleep logs is very helpful and a great way to chart the user’s progress. MobileSleepDoc provides an extensive library of reports that the user can email to themselves or their doctor, for review and guidance.

In terms of obstructive sleep apnea, MobileSleepDoc uses well-established questions to help screen for signs and symptoms of this disorder. If sleep apnea is suspected based on the user’s responses, then the user is given links to further resources, and a map of the closest sleep centers.

How much did it cost to create a MobileSleepDoc?

I do not recommend developing an app of any sort with the primary intent of making money. I created MobileSleepDoc because the idea was stubbornly implanted in my brain. My primary intent was to create a beautiful and useful tool that had the potential to help many people with a real world problem. Building an app costs a lot of time and money—probably your time and money, and more of both than you think. A different person in a different situation might be able to get someone else to pay for their bright idea, but as a female person of color over the age of 50 with no background in programming or technology, investing in myself seemed like the most pragmatic option.

The other core decisions to consider were:

  1. How much could I afford to spend on this idea? Or as my father would say, “Never gamble more than you can afford to lose.” I had some rough idea of my target investment but later found out that the more complicated the app, the more expensive it was to create. Also, I learned that the complexity was not always clear to the developers or even myself, especially in the beginning. I presented my ideas and budget to 2 different development teams, filled out detailed questionnaires about the project, and interviewed both companies. Luckily, I found out that my initial budget was in the right ballpark for both companies, and picked the team whose approach I liked best.
  2. Expect to go over budget and have a buffer of 50%. See above.
  3. How much time did I have to be the real project manager? The main objective of the developers is to help you realize your vision, so having a vision is advised. Although I worked with talented project managers throughout this process, I discovered I was the actual project manager. I needed to be an integral part of the process from day 0. MobileSleepDoc V1.0 took 9 months to launch and 460 hours of my time. I educated myself as quickly as possible to be able to ask questions and make decisions (a LOT of them—from the logo, font, and colors to the logic, wording, and price). I was the ultimate authority over all decisions, so I quickly learned not to be afraid to make them.

It was in my best interest to fail as fast and often as possible in order to avoid wasting precious time and resources.

We launched MobileSleepDoc V1.0 in December 2012. We made several important upgrades and added an Android version to iOS, ultimately launching V1.4 of both in March 2013.


MSD splash screen logo

 MobileSleepDoc Version 1.0 Logo

Coming next—Anatomy of a Medical App: Part 2. MobileSleepDoc V1.0 to V2.0, A Doctor’s View of Wearable Tech

Melissa Lim, MD

Pulmonary, Critical Care, Sleep Specialist

Redwood City, CA


I don’t remember the name of the book, but I remember the inscription my sister Marie wrote on the inside cover. She loved giving me books and this one was about a new female doctor navigating the treacherous path of her internship, circa 1972. I was 10 years old at the time, and my sister wrote to me, in her then perfect handwriting, “Never give up on you aspirations, you are going to be a great doctor someday.” These days my sister can no longer write her own signature, let alone inscriptions in books. She was diagnosed with early onset Alzheimer’s disease a few years ago, when her forgetfulness seemed to leap into not being able to buy vegetables at the grocery store. She had always been the artist with her “head in the clouds, “ but things suddenly became very different.

Alzheimer’s disease, still mysterious in its cause, and devastating with its terrible prognosis, causes a sort of death in life. It seems strange to say “my sister was a great artist,” when she is very much alive living a simple, but happy life with her husband. Instead of the disease causing her to become irritable and aggressive, as it does for many, she has become childlike with a pureness of heart, always smiling and ready to share her big, generous laugh. But I miss my sister, the other one who loved to read Winnie the Pooh to me when I was small, who became an accomplished and well-known local artist for her intricate Plexiglas and linoleum prints inspired by African folklore, the one would wanted to explore her creativity in the most elemental ways. She went from knitting, to working a loom, to spinning and dyeing her own yarn. I did not expect her to stop before raising her own sheep. That sister is gone. It seems strange to me not to have said goodbye before she was kidnapped by her disease, but it all happened so fast.

I visit my new sister from time to time, though the 3000 mile distance makes it difficult. She lives in the present, unable to form and hold onto memories, and rapidly losing even older ones. We accept these visits for what they are, a change in scenery for her and a respite for my devoted brother-in-law. I try my best to appreciate the elemental nature of her new self, much like she used to explore in her artwork. But mostly I am left with a renewed empathy—and a profound sympathy–for my patients and their families who are going through the same thing.

Melissa Lim, MD
Redwood City, CA


“Don’t be attached to the outcome” (Why is that one so hard to remember?) When my son turned a year old, my spouse and I eagerly attended a local talk by Myla and Jon Kabat-Zinn on the topic of mindful parenting. Their book, Everyday Blessings: The Inner Work of Mindful Parenting (Hyperion, New York, 1997) had just been published and, as enthusiastic young parents, we wanted to learn as much as possible from these parenting gurus. I was determined to come away with as many pearls of wisdom as possible, which the authors made very easy, since Jon ended his talk with, “Here are the 4 main things to remember about mindful parenting” I have repeated his words over and over to myself ever since, since mindfulness informs not only an approach to parenting, but also an approach to work and life in general.

  1. Show up
  2. Pay attention
  3. Be honest
  4. Don’t be attached to the outcome

Needless to say, the last principle seems to be the hardest one to remember. In fact, my spouse has yet to remember it even after 18 years of child-rearing (“What was the last thing Kabat-Zinn said again?”).

As a doctor, I try my best to follow the same guidelines. Even if rushed, or having lingering concerns about the patient who visited earlier in the day, when I go into an exam room (Show Up) I try to focus on the person in front of me (Pay Attention) as soon as I close the door. Being truthful about what is known and what is not known about the diseases we are treating, and the medications and procedures we recommend (Be Honest), is a top priority in “mindful doctoring,” but the most valuable principle is again the last one. Even when we’ve done our best we can still be wrong, and events may not turn out as we initially expected (Don’t Be Attached To The Outcome).

During my residency in Boston, one of my favorite attending physicians was a gastrointestinal specialist from Ireland. He taught us to consider all the major diagnostic possibilities when interviewing and examining a patient, and then to commit in writing to what we thought was the correct diagnosis, before looking at any labs, x-rays, or any other tests. And then, after considering all the data, we were to reassess our diagnosis. The benefit of the long hours we kept during residency training back then (and there were many disadvantages as well—but we’ve talked about the effects of sleep deprivation already!) was seeing patients on a daily/nightly basis to the end of their hospitalizations. Our hypotheses were tested, rejected, and honed. But the most important lesson some of us learned, was the importance of ignoring the ever present and pushy ego, questioning our assumptions, and following the patient’s agenda, not our own.

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

Physician Heal Thyself: Practicing What We Preach

Rushing–as usual–into the hospital on my way to work, I darted past the elevators where one of the hospital operators was kindly holding the doors open. I waived him on with a friendly “Good morning” and headed instead to the stairwell.  When I passed him, I heard him mutter, “Doctors, they always take the stairs.” Little did he know that climbing a few flights of stairs might amount to my only exercise for the rest of the day (that, and walking my dog for his “morning constitutional.”).

I began thinking about the self-care routines of my colleagues and myself. How healthy were we as a group? What healthy behaviors do we follow, and which ones do we not? Are we setting a good example for our patients?

Like the rest of the population, we too are getting heavier, but at a somewhat slower pace–a little over half of primary care doctors are considered overweight or obese, as opposed to 2/3 of the rest of the population (N. Shute, NPR report, June 5, 2013). On a more positive note, we are pretty good at not smoking. Smoking rates dropped dramatically among physicians from the 1970’s to the 1990’s, down to 3.3% by 1991 (Nelson et al., JAMA. 1994;271(16):1273-1275), compared to 25% in the general population around the same time.

The bigger concern appears to be our mental health and the health of our relationships. Doctors have extraordinarily high divorce rates, by some estimates, 10-20% higher than in the general population. We also show high rates of depression, prescription drug abuse, alcoholism, and suicide (female physician suicide rates are 4X that of other women). Medical researchers are doing their best to clarify these trends and explore possible causes. In their stark and startling article “The Painful Truth: Physicians Are Not Invincible (Southern Medical Journal, 2000, 93(10): 966-973),” Miller and McGowen describe the “culture of medicine,” beginning with and extending beyond our sleep-deprived medical training, where we ultimately learn to shut ourselves off from our feelings in order to cope with the daily tragedies and despair suffered by our patients.

As a critical care specialist for the past 25 years, I have continued living the life of a resident, spending way too many nights in the hospital. I see firsthand and have even participated in the macabre humor borne from the pain we witness, fueled by exhaustion. I recall during residency when I once told the emergency room attending physician trying to admit the umpteenth patient to me in the middle of the night that I simply refused to admit anyone else to the hospital…unless it was GOD–to which she replied, “The patient is as old as GOD.”

Beginning to fray from my evolving burn-out, I was advised this year by my very wise spouse to read Trauma Stewardship (Berrett-Koehler Publishers, Inc., San Francisco, CA; 2009) by Laura van Dernoot Lipsky. In it she describes the 16 warning signs of the “trauma exposure response,” or ‘vicarious traumatization’ that can develop in those repeatedly caring for others who have experienced trauma. I devoured chapter four of her book with highlighter and annotations as a former medical student would. Maybe you won’t see all 16 of the signs in yourself, but maybe there will be enough of them to finally hear that wake-up call–to take better care of yourself while taking care of others.  I know I did. As a result, I changed my schedule to include “walk the earth” days on a regular basis, even (especially?) playing hooky on a weekday. I leave my computer at home and place my cell phone on silence. And I walk out my door. And take the stairs.


Melissa Lim, MD

Pulmonary, Critical Care, Sleep specialist

Redwood City, CA

INFORMED CONSENT AND THE PROCEDURAL PAUSE: Three questions the midwife taught me

“We should break your water to move your labor along,” directed the labor and delivery nurse during the birth of my daughter. In my laborious stupor I recall her holding what appeared to me at the time was a 2-foot spear with a hook on the end, a sort of uber-crochet hook pointed at my–let’s put this politely—birth canal. Declining this unwanted intrusion, and after our friend escorted that nurse out of our hospital room in place of another, more “natural birth-oriented” one, we realized that part of the delay was due to improper positioning of our daughter. Instead of preparing to arrive face down, to exit the birth canal like a breast stroke swimmer coming up for air, our daughter decided that back stroke was her plan—not the ideal position for exiting the womb. The preferred face-down, or “occiput anterior” position (OA, where the back of the baby’s head—occiput—is facing the front—anterior—of mother) engages the baby’s head into the mother’s pelvis like a hat with a perfect fit. The “occiput posterior” position (OP, where the back of the baby’s head is facing the back of the mother) is an ill-fitting crown, prolonging labor and causing increased back pain for the mother. OP babies are a frequent cause of the all-too-common indication for cesarean section (C-section)—“failure to progress.” This was clearly in my future as we approached the 20th hour of labor. Then, as if the birthing instructor herself was in the room, we noticed while I was on my back that the shape of my belly was pointed, our daughter’s knees were pointing towards the ceiling—she was an OP baby. Having gone the way of natural childbirth, ignoring an old friend who summed up her advice for delivery in 3 words, “Get The Epidural,” I remembered the cat-cow stretches we practiced in our birthing class that could pop the baby out of the pelvis for repositioning. I jumped off the bed, got on all fours, and did several of these, as my partner turned our daughter’s knees in the right position, and lo and behold, our daughter turned upside down like a proper OA baby! Labor proceeded rapidly afterwards, and all was well, my only dismay being the lack of full disclosure from my long-postpartum friends–many of whom had memories dulled by anesthetics–that labor approximates the feeling of one’s rear end being engulfed in flames.

Childbirth was the most exhilarating experience of my life, the crescendo of this other-worldly pain disappearing in an instant. Much of what I cherish about childbirth stretched beyond the magic of that day, however, but also includes learning the importance of preparing for that day. In medical school, we rotate through different medical specialties, including obstetrics (“O.B.”).  ‘O.B’ among medical students and residents is described as “hours of boredom followed by seconds of terror,” meaning that there is always an element of the unknown when bringing a baby safely into this world—and one’s preparation for all that could go wrong makes the difference between a happy and a tragic outcome.

My birthing class was taught by a former labor and delivery nurse turned mid-wife. As my classmates and I approached our respective due dates, our instructor thoroughly informed us of the potential procedures that may be offered or recommended throughout the course of pregnancy and delivery. I have referred to her wise words many times over the past 16 years with my own patients, and encourage my patients to ask these 3 questions, whenever any medical provider, including myself, proposes an invasive test or procedure:

1) What happens if I do it?

2) What happens if I don’t do it? and

3) What happens if I wait?

In medicine we have many tests and procedures at our disposal, and when we advise our patients, we look to different sources to guide us—from published “standards of care” by professional organizations, to “expert opinion,” to one’s own experience guided to the best of our ability by research and common practice. Physicians frequently balance what they can do versus what they should do in the treatment of any individual patient, with the patient always being the vulnerable variable in the equation.

So whether it’s a crochet hook, an x-ray, or an operation, please ask your doctor to answer the 3 questions my midwife taught me. It’s a great way to inform—and protect–yourself.


Melissa Lim, MD

Pulmonary, Critical Care, Sleep specialist

Redwood City, CA

ADVANCED DIRECTIVE: If you have to feed me, shoot me

“If you have to feed me, shoot me” was the core of my mother’s advanced directive. She said this to me when I was fourteen years old and we went to the hospital to visit a classmate seriously injured in a sledding accident. As we passed one frail, elderly patient after the next along the hospital corridor, some being spoon fed by nurses, my mother’s mood became increasingly irritable. That’s when she stopped me outside my friend’s hospital room, peered into my eyes, and gave me her one sentence instruction on the way I was to handle the end of her life. Like many people, it was not death that frightened my mother, it was disability. My sisters and I did not have to review any legal paperwork to make the decision to remove my mother from the mechanical respirator twenty-four years later, after she suffered a massive intracranial hemorrhage. She was extremely proud and vivacious, up until the last year of her life when chronic kidney disease sapped her strength, and she suffered innumerable blows to her self-esteem and dignity, her sense of wholeness as a person, in the unfamiliar role of patient.

As a physician, especially a pulmonary and critical care specialist, I have cared for many people facing the end of life. My patients often die of illnesses like emphysema, where the lungs can no longer perform either, or both, of their primary functions–transferring oxygen from the air into the bloodstream, or eliminating carbon dioxide from our bloodstream back into the air. I make it a point to talk to my patients about their views of life and death, especially when they are well enough to have a conversation about such things, but ill enough to know that their lungs may “give out” in the relatively near future. I explain to them that the discussion is meant to give them decision-making power, that as their doctor, if they are unexpectedly too ill to speak for themselves, I need to help my colleagues treat them in a way they would want to be treated. This is an opportunity for me to explain terms like “CPR,” “defibrillation,” and “mechanical ventilation,” and to understand where they lie on the spectrum of wishes about “resuscitation.” People fall somewhere on this continuum, from wanting everything done indefinitely, to not wanting anything done except to be made comfortable. Most of my patients fall somewhere in between, where medical interventions are performed maximally, but only up until a point. And that point is usually where there is a decision among physicians and family members that the chance of a full recovery is unlikely. These decisions are not lines drawn and then stepped over, but rather are formed by massaging the clay of our uncertainty. Family meetings are essential, where doctors explain the challenges of treating all the medical problems that exist. In the office, patients are usually relieved to discuss their wishes and to speak out loud with family present. In the intensive care unit, patients often cannot speak for themselves, so loved ones must speak on their behalf. This is where previous discussions—when the person was well enough to discuss their plans for death—become so important.

People do not understand how generous it is to make their desires known, to remove the burden of this decision from family, who may have so many feelings of their own to contend with. Yes, we hear about legal paperwork, “advanced directives,” and powers of attorney for health and financial decisions, all of which are extremely valuable, but since most people still die without a will, we should admit we really are not very good at paperwork.  At least we can do better to talk more to each other and to our patients, since in the end what matters most is someone knowing who you are.

Melissa Lim, MD

Pulmonary, Critical Care, Sleep specialist

Redwood City, California

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: