AutoLayout Headaches

The new larger iPhones and iOS 8 are here. Xcode 6, upgraded to deal with these new beasts, is also ready for download. Anyone who has written apps designed for the iPhone has to make sure their apps run on these new devices and the new iOS. Previous iPhones had two different heights (3.5 and 4 inches) but were the same width. The new iPhones are not only longer, but are wider. With the previous devices, it was relatively easy to design for the slightly different heights. Now the developer has to deal with layouts that work with many different aspect ratios. If your app is a universal app (i.e. runs on iPhone and iPad) there are even more sizes that you must deal with.

Anticipating this, Apple, a few versions back, introduced AutoLayout to take the place of their older layout system using springs and struts. With AutoLayout, you place your widgets where you want and, automagically, they retain their relationship with different screen sizes or when rotating the screen. Or so it’s supposed to work in theory.

As it turns out, AutoLayout introduces its own set of headaches which rank up there with your worst migraines. Let’s begin.

Intrinsic AutoLayout

If you have AutoLayout turned on (which is the default now), any prior layouts you have, whether you used springs and struts or absolute layouts, will be converted to the AutoLayout system. Any new layouts will use the AutoLayout system automatically. When placing widgets, the dotted blue guidelines will have more meaning than they did before. For example, if you center a widget using the blue lines, that widget will appear centered with different device sizes or with rotation. This is called intrinsic AutoLayout, and the effect is added at run-time. That means, somewhat surprisingly, that when you change device size using Interface Builder (IB), the layout won’t look right.

 

Layout appears off center on 5.5" iPhone 6 Plus
Layout appears off center on 5.5″ iPhone 6 Plus (click to enlarge)

But if you run the simulator, the layout will look fine.

Same layout appears nicely centered when running on iPhone 6 Plus simulator
Same layout appears nicely centered when running on iPhone 6 Plus simulator (click to enlarge)

Hopefully that will be true when running on the new hardware itself, but since I don’t have an iPhone 6 I can’t test this. The moral of this story is don’t start fiddling with your layout because it looks weird on IB. Run your app on the simulator at each size (and on hardware if you have it). Most of your layouts will look OK on the larger iPhones due to intrinsic AutoLayout.

Explicit AutoLayout

If you need to alter what is produced by intrinsic AutoLayout, you have to manually add constraints. Constraints are a rigorous description of a relation between two views. Examples include centering a widget in a superview, fixing a widget’s height, but allowing width to change, and setting a fixed distance between two widgets. Constraints are actually pretty cool in theory and can be added in code. But using IB, once you start adding constraints all hell breaks loose.

Suppose everything about your view looks good, but you want the bottom of your widget to be pinned to the bottom of the view it is contained in. So you add that one constraint. With that one action you have blown away the intrinsic AutoLayout system and IB will inform you that you have all sorts of ambiguous heights and widths. So if you add any constraints in IB, you have to add constraints to all the widgets. There is a menu item to do this, and suddently there are about 50 constraints added to your view. And here you hit your first surprise. Even though you are targeting your app for iOS 7, Xcode adds constraints that are incompatible with iOS 7!

Constraints incompatible with iOS 7 are automatically added by Xcode 6!
Constraints incompatible with iOS 7 are automatically added by Xcode 6! (click to enlarge)

Constraints can’t be relative to the superview margin in iOS 7 but IB blithely adds them anyway. So you go through the constraints, one by one, edit the ones that have “relative to margin” checked, which ends up changing the appearance of your view. It is then that you discover that changing a constraint tends to mess up your view or mess up the other constraints. You often get a message saying that the view at runtime will not appear the same as it appears on IB. I found that pressing Option-Command+= fixes that. It is easy to get frustrated when editing constraints in IB. The “Clear Constraints” menu item is your friend here, so you can start all over.

AutoLayout and ScrollViews

It gets worse. If you have any ScrollViews in your app, with AutoLayout they appear to work on the simulator, but they don’t work on actual hardware! Turning off AutoLayout fixes this, but DON’T DO THIS! You cannot turn off AutoLayout for a single view. It goes off for your whole storyboard. And your carefully laid out and tweaked constraints disappear. Version control is your friend here. Using AutoLayout and ScrollViews is complicated, as you can see from this. After reading this and playing around, I was able to get my views to scroll by pinning the ScrollView to the superview on all four sides. Interestingly, when setting up a ScrollView with AutoLayout, you no longer have to add any code about the ScrollView as was necessary before (you would have to add the content size of the ScrollView for it to work). But again, this is a real trap, especially as if you do it wrong, it looks like it is working on the simulator but won’t work on an actual device.

And so…

Handling resizing and rotation is one thing that is a lot easier when developing for Android than for Apple iOS. AutoLayout has a steep learning curve, and others have had these same problems (search for AutoLayout on StackOverflow, or see this. I hope that Apple can improve this experience. I like the concept of AutoLayout, but the devil is in the details.

Don’t Turn Your Back on Your Patient

One of the most important “tricks of the trade” that I learned in Medical School was what some might have considered a little “throw-away” bit of advice. During my psychiatry clinical rotation the preceptor advised that, when applying the stethoscope to the patient’s back, one should rest the other hand gently on his or her shoulder. Human touch was important. It would relax the patient and convey subconsciously a sense of compassion, a feeling that “we’re in this together.” I decided to take that advice and throughout my career always touched my patient’s shoulder with my left hand while I was listening to his or her lungs. I don’t know whether this technique “worked.”  Not one patient ever commented on it. But there must be some reason I had such a good rapport with the majority of my patients. Of course this may have been unrelated to the shoulder touch. Maybe it had more to do with looking patients in the eye when talking to them, paying attention to what they said, showing I paid attention by asking appropriate questions, expressing concern and compassion, always shaking their hand when I entered their room, or perhaps some other unconscious body language that put them at ease.

When I was Professor of Medicine at the University of Colorado I told students that Medicine is both a Science and a Humanity. This is what is emblemized by the phrase “the Art of Medicine.” In recent years there have been great advances in the Science of Medicine, and one could be forgiven for believing that science is all there is to it. Medicine as a Humanity is less well studied, less well understood. Changing age-old practices that affect the doctor-patient relationship may have unforseen consequences. Changes like more rushed, shorter patient visits;  doctors turning away and seemingly ignoring their patients while furiously entering text into an electronic health record (EHR) on a computer; or telemedicine with doctors miles away in front of a television camera. Changes like doctors who don’t relate to patients on a personal level, who don’t have long-standing relationships with patients, who aren’t in touch with their patients.

Long ago, when there were only a few legitimate drugs, and many bogus ones — maybe 50 years ago, certainly 100 years ago or even take it back to Greek and Roman times — there were still doctors. They didn’t have much to work with scientifically. They didn’t get results the way doctors today do. But I wouldn’t discount the possibility that they got some results, in fact sometimes good results. The science of the mind is not well understood. Placebo effects are small, but real effects. Calling in the wise-looking, well-dressed gentleman with the black bag full of mysterious pills and injections, with the comforting voice, with the laying on of hands, the careful physical exam — I’m sure all this had a beneficial effect, regardless of the lack of treatments backed by randomized clinical trials . I’m not for going back to those times — we are far better off with good science backing our therapies! But aren’t we losing an important tool in our armamentarium? Patients need our firm handshakes, the touch of the stethoscope, our thoughtful advice.

When our healthcare practice purchased an EHR I resisted the urge to use the computer in the exam room, even though it was slower for me to do my notes in the privacy of my office. I didn’t want to turn my back to my patients. The people who want to increase constantly the amount of electronic documentation we need to enter into the computer don’t understand this. We need to increase the time with the patient and decrease the time with the computer. We need to be in close communication with our patients as one human being to another. We need to relate on a human level, not electronically.

We should never turn our backs to our patients.

What Motivates Doctors?

As a recently retired physician, I still maintain an interest in medical research, though I have to ask myself: Why? Surely not just from the point of view of a potential future patient. But not from the point of view of a practicing physician either. Perhaps I keep up just from a lifetime of habit?  Or is there something I miss about my old job?

These thoughts came to mind as I was reading some of the reports from the European Society of Cardiology meeting in Barcelona, Spain last week, in particular the results of the PARADIGM-HF trial in which a new, so far not brand-named drug, LCZ696, out-performed traditional ACE inhibition in patients with heart failure, and, in my own field of electrophysiology, the results of the STAR AF 2 study  which imply that a more limited is better than a more aggressive approach in ablation of persistent atrial fibrillation. I read these reports with a combination of excitement, my usual dose of skepticism, and perhaps a tinge of regret that, while the science of medicine advances inexorably, my own participation in this process ended as of Jan 31st, 2013, the day when I performed my last catheter ablation procedure for atrial fibrillation. Yes it seems odd that I was performing procedures one day and then retiring on the next, but that’s the way it was. At least I wasn’t on call my last night. And although I have written that doctors shouldn’t hesitate to retire when they are ready, sometimes I do look at my still-practicing colleagues with a bit of envy, feeling I am missing out on some of the fun of being a doctor.

Doctors just starting their medical careers, residents, fellows or newly appointed attendings, can easily get discouraged reading many of the online posts and comments from older doctors — including my own. There is a lot of negativity in these posts. We read about increasing work loads, decreasing salaries, competition from associated professionals, unmanageable electronic health record systems, terrible on-call nights, malpractice suits, loss of respect for the profession, Obamacare — the list goes on. It is probably tougher to be a doctor today than it ever has been. As my own career progressed, I had more and more of a feeling that I was swimming upstream against an opposing current of non-medical administrative, regulatory sewage. I found it easier to retire at a relatively early age (62) rather than continue the struggle. It wasn’t a brave decision, nor is it a practical decision for younger physicians, in particular those new physicians just out of medical school saddled with enormous debt. To those physicians, I would like to sound a note of optimism (which unfortunately might be drowned out in the comments section to this post).

Everyone who goes into medicine knows it is going to be hard. This was as true back when I started my internship as it is now. But there are rewards in medicine, and they still exist. I’m not talking about the traditional rewards of past years: financial success, stature in the community, pride in taking part in an old and honorable profession. Unfortunately much of this has evaporated in recent years. Nor am I talking about the occasional uplifting story whereby a patient heeds your exhortations to stop smoking and comes back years later to thank you for changing his life — as wonderful as such stories can be. No, I am talking about another aspect that is not frequently mentioned: the challenge of medicine.  Medicine is a battle against disease.  We doctors are on the front lines of this battle, and we are winning.

The challenge was there in every patient with atrial fibrillation, in every patient with ventricular tachycardia, in every patient with supraventricular tachycardia. These diagnoses were relevant to my field, but I’m sure that similar challenges exist in each specialty of medicine, and in general internal medicine as well. To me each diagnosis was a challenge, and the battle was fought using the weapons I had at hand: the ablation catheter, the pacemaker or implantable defibrillator, antiarrhythmic drugs, or simply persuasion, attempting to alter self-destructive life styles. It was immensely satisfying to ablate a pathway and control a life-threatening arrhythmia. But just as in the Wide Wide World of Sports, there was both the thrill of victory and the agony of defeat. Failures, especially complications, which, if you do enough procedures, statistically have to occur, always disproportionately tempered the successes, even though the latter were thankfully much more the norm. Such is human nature. But I think that which motivated me the most during my medical career was the wonderful adrenaline surge that came from ablating a tough atrial tachycardia or other arrhythmia. This is the sort of thing that motivates doctors despite all the other nonsense that we face. This is what keeps us going, or it least it was in my case.

And I sort of miss it.

Doctors Concerned About Possible Brain Injury From the Ice Bucket Challenge

Ice-Bucket-2Well, not really.  But it does seem ironic to me that the ALS Foundation has embraced what is essentially a blow to the head with ice cubes and water as a fund-raising activity, in order to treat a disease which may in part be related to head trauma.  A large number of football players have developed Chronic Traumatic Encephalopathy (CTE), and, although the science is debatable, there may be a link between CTE and ALS.  Regardless, any form of head trauma can cause brain injury, and there is no specific magnitude of impact force to the head that is required to cause a concussion.  Ice cubes are solid and some of these challenges have been done from a balcony, such as this one with New Jersey Senator Cory Booker.cory-booker-ice-bucket-challenge

I won’t pretend to be a physicist, but let’s do some calculations.  A single ice cube weighs approximately 0.01875 kg.  Assuming a fall height of 5 meters (which looks about right for this picture), and a skull deformation of maybe 2 mm on impact (assuming the skull is pretty rigid), the calculated impact force is  459.37 Newtons per ice cube.  An average ice cube tray has 24 ice cubes, but an ice bucket might contain many more cubes.  Assuming 50 ice cubes (and assuming the ice has not melted), the overall force (not counting the weight of the water) is 22968.5 Newtons.  The average estimated force of two helmeted football player heads colliding has been calculated at 1450 to 1600 pounds.  Converting pounds to Newtons, that’s at best 7117 Newtons.  So the Ice Bucket wins.  All of which convinces me that I don’t know squat about physics, and I’m sure these calculations are wrong.  But in any case, maybe the ALS foundation should have picked something else for their campaign rather than a potential cause of brain injury.  The Pillow Fight Challenge perhaps?

A New Treatment for Chronic Health Syndrome

The XYZ Drug Company

Internal Memo
August 29, 2014
CONFIDENTIAL
For internal use only

AntiRobustium™ Marketing Strategy

Introduction

With the anticipated FDA approval of AntiRobustium™ (arsenic trioxide), the first and so far only treatment for CHS (Chronic Health Syndrome) will soon be available to the general public (prescription only). As with the introduction of drugs for other newly branded syndromes (e.g. Restless Leg Syndrome, Short Eyelash Syndrome, and Low-T), it is imperative that the public as well as medical professionals not only be made aware of the serious nature of the target syndrome (CHS), but also appreciate the unique nature and high success rate of the marketed treatment (AntiRobustium™), while at the same time minimizing the emotional impact of potential adverse effects of treatment. CHS poses greater than average challenges in this regard, as the public generally doesn’t consider “health” to be a medical problem. It is important to sell to the consumer the notion that CHS is insidious, debilitating, and, up until this point, difficult to treat. Fortunately though, relief is on its way.

The Hidden Epidemic of CHS

CHS is a relatively rare syndrome in the American population, and epidemiologically has the unusual and counterintuitive property of having decreasing prevalence with age. Although periods of Acute Health can occur fairly frequently in people with chronic illnesses, the long periods of unmitigated Health that are seen in victims of Chronic Health Syndrome are very unusual. These long periods (remarkably lasting up to years in some rare cases) are the striking feature of CHS. Probably due to the low prevalence of this condition, it has not been well-described or studied in the past. Particularly discouraging for us in the pharmaceutical industry, for a long time it was assumed that there was no feasible drug treatment for CHS. Of course all this has changed now with the development of AntiRobustium™!

The Heartbreak of CHS

Sufferers of CHS rarely spontaneously seek medical therapy. They may occasionally come up with weak reasons for seeking medical help, such as “getting a physical” or “having routine screening,” but in general doctor visits are few and far between. Because of this reluctance to seek help for their condition, many doctors are unfamiliar with diagnosing and treating these patients. One telltale sign of the CHS patient is a short or absent list of medications. While the average person seeing a physician will have a medication list of 5-15 drugs, patients with CHS may be taking no medications, or may be taking ineffective medications, such as vitamins, often used as a form of self-medication out of guilt that taking absolutely no medications is odd or even bizarre. This guilt about being healthy in an unhealthy world results in significant psychological stress, with sufferers often feeling like outcasts at social gatherings, unable to compare notes with their friends regarding their Low-T, chronic back pain, or restless legs. Other characteristics of patients with CHS include lower than average weight, excessive exercise (often more than 5 hours a week), extreme diets low in fat and sugar, abnormally elevated state of well-being, and a pink or rosy skin tone. Paradoxically, despite these unusual signs and symptoms, lab testing is often completely normal. In fact, no specific test has been developed that can definitively diagnose CHS, though a diagnostic score has been developed and shows promise. For physician education, XYZ drug reps are encouraged to inform physicians that for all practical purposes a likely diagnosis of CHS can be made if a patient is taking fewer than 3 prescription medications and any one of the signs or symptoms mentioned above is present.

Breakthough! A New Use for an Old Drug

AntiRobustium™ (arsenic trioxide) is not new to the pharmaceutical world. Originally developed as insecticides and then later used to treat syphillis, arsenic compounds have not found much medicinal use in modern times. Until now! AntiRobustium™is the solution to the dilemma the pharmaceutical industry has had in finding an agent useful in the treatment of CHS, in order to monetize this small, but significant segment of the population. The problem that the industry has had in finding a drug for these underserved patients is that most drugs developed up to this point have had both healthful and healthful effects. Due to this dual action, most drugs will cause some (even if only minor) improvement in Health and this will not work in a patient with CHS, as these patients are already healthy by definition. AntiRobustium™ is the first drug to come to market with absolutely no healthful effects, while still having multiple side-effects. Randomized Controlled Trials (RCTs) show that over 99% of CHS patients taking AntiRobustium™ within a 4 week period develop skin pallor, generalized malaise, gastrointestinal complaints, abdominal pain, cardiac problems, and, rarely, death. In the landmark UNHEALTH Study (roUtiNe use of antirobustium™ in HEALTHy compared to unhealthy patients Study) regular usage of AntiRobustium™ at a 5 mg BID dose resulted in no significant difference in morbidity and mortality compared with a control population of patients with end-stage renal disease, terminal cancer, and hepatic failure. These results are impressive because the comparison group was particularly unhealthy and yet the results were similar to the results of the earlier MAKEMESICK Study (Multicenter Antirobustium™ Keeps Everyone Mostly Equal in SICKness Study) which was criticized in some corners because of the relative health of the comparison group (patients with Restless Leg Syndrome, Chronic Fatigue Syndrome, or Low-T). A meta-analysis of these 2 studies, the earlier RCTs, and 5 studies using 30 lab rats each did result in P values < 10-18 for a dystherapeutic effect that was convincing enough to get the drug through the FDA committee, with approval imminent.

Marketing

As usual direct marketing to physicians will take a high priority, mostly concentrating on bagel breakfasts, burrito and Chinese food lunches, with occasional big dinner presentations. Selected physicians will serve as members of our Speaker Panel, generally the same physicians who have served on all our other Speaker Panels. Slide sets will be provided of course. XYZ reps will distribute reprints of the major studies (UNHEALTH, MAKEMESICK, etc.) along with iPads preloaded with our Poor Healthy Joe multimedia educational presentation. As always NO DISTRIBUTION OF COMPANY LOGO PENS WILL BE PERMITTED!! SUCH DISTRIBUTION WILL BE CONSIDERED GROUNDS FOR DISMISSAL!!

A major push will be aimed at the consumer. Not many people have heard of CHS. We need to change that. A good parallel is that with the Low-T compaign. A few years ago no one would have known what was meant by Low-T. Now someone can be considered stupid if they don’t know what it is. We need to create the same situation with CHS. Our TV marketing department is already working on ads featuring Poor Healthy Joe. An example: Poor Healthy Joe is at a cocktail party, standing in the corner, while a group of beautiful young women (professional models) are discussing their diabetes, cancer diagnoses, and other chronic conditions, when Joe’s rival, call him Ill Fred (another professional model) comes over and starts telling them about the low back pain he got from his old football injury. As the women fawn over Fred, Joe decides to do something about his Chronic Health Syndrome. He starts AntiRobustium™. A month later he is back at the same cocktail party with the same professional models, where he is now the center of attention, the women remarking on how pale and sick he looks. While the viewer is distracted by the curvaceous models, the narrator in super fast-foward mode rattles off the list of side-effects of the drug, and the commercial ends with Joe smiling due to his attaining the ill-health that had eluded him in the past. Audience testing of this commercial has been very positive, with less than 1% of the audience able to list any of the side-effects of the drug after seeing the commercial. Other high production value commercials featuring Joe and his chronically healthy friends (Jogging Judy, Vegan Valerie, and others) are in the works.

Last Words

We anticipate a healthy market for AntiRobustium™ (no pun intended)! Once we get formal FDA approval (it should be within the month) the above campaign will be launched at full throttle. And finally remember to use our new slogan: “Too healthy?  Fight back with AntiRobustium™!

Using Social Media in Moderation

True love. Image by © Zero Creatives/cultura/Corbis
True love…
Image by © Zero Creatives/cultura/Corbis

I’ve been backing off from social media recently. For someone who writes a blog as well as publishing medical apps this may appear to be a risky tactic. In truth this retreat has not been completely voluntary. Something known as “real life” has been seeking my attention and gotten in the way of my online life interactions.

My fascination with social media has always fallen into the “love-hate” category. Maybe “addiction” is a more apropos word than fascination.  Social media addiction has supplanted the previous generation of technological addiction, television. Probably a similar fascination or addiction existed when radio was the dominant medium, but I don’t go back that far. The first reaction to television was amazement: “wow, there are moving pictures on the screen.” It didn’t matter that there were only 3 channels in black and white (later expanded slightly by adding fuzzy, low-budget local programs on UHF).  Nightly TV viewing became a dominant part of American life in the 50s and 60s. With cable, the number of channels rose, but the signal to noise ratio decreased. TV viewing, passive and mindless to begin with, only got more passive and more mindless. Yet the TV addiction, once begun, could not be shaken, at least not until a stronger drug/soporific became available. I’m afraid that stronger drug is social media on the Internet.

Just as voices decried the huge number of hours that the average American sat in front of the TV set in the past, so too some voices have expressed concern over the tightening grip of social media. There is a lot of good that social media does. It brings together geographically separated folks of similar interests. It is much more active than watching television: people text, message, tweet, post, and blog. But by the same token it is much more seductive — and more readily available, now that everyone carries a smart-phone. Despite social media’s mostly bland and not terribly informative content, withdrawal is difficult. There is anxiety about missing interesting tweets or Facebook posts. By nature of  the sheer volume of social media output, the occasional stuff that you might be interested in gets buried in the background noise of cat and baby pictures. So you end up either checking your Twitter or Facebook feed several times a day or living in fear.

Yet somehow the world went on before this torrent of social media posts, and we were none the poorer for its absence or at least living in blissful ignorance of what we were missing. It depresses me to see people walking down the street with their faces buried in their phones, or seemingly talking to the thin air, ignoring what is going on around them; or two people at lunch, staring down at their phones, not talking to each other. How social is social media if it actually decreases our sociability with each other in real life? I am not a Luddite and I don’t want social media to go away completely. Maybe just sometimes. Let’s not lose the delight of person to person conversations over dinner or lunch.  Taking a break from social media, whether due to life events, being out in the middle of the ocean somewhere away from WiFi, or just voluntarily chosen, can be a refreshing, mind-clearing act.  And the real world has a higher pixel density than your iPhone screen.  Take a look!

Is a Mobile Electronic Health Record Possible?

Looking for missing meaningful use button clicks.
Looking for missing meaningful use button clicks.

It’s been a while since my last rant about Electronic Health Records (EHRs), so let’s remedy that right now. EHRs in their current iteration are — how to put this delicately? — an unmitigated disaster. Nevertheless, much of the criticism of EHRs, including mine, has been in the destructive category. What about some constructive criticism? How could EHR software be made better?

I am not familiar with every EHR system out there. In fact my experience is pretty much limited to one system, which shall remain nameless, though I will give some clues as to which EHR I mean: its name contains four letters, two consonants and two vowels; the name has no pure rhyme in the English language, though it does have some near rhymes, such as the word septic; and the software is under the delusion that it is running in hyperspace, which may indicate that the programmers possess a sense of humor. There, I hope I have been obscure enough so I don’t get into trouble like I did before.

Current EHRs were developed before the mobile revolution, and it shows. Sure there are some mobile clients available, such as the puzzlingly Japanese named mobile app for the above-not-mentioned EHR system, but these mobile apps don’t match the functionality of the parent application, and, at least in my experience, have been virtually useless. It was possible though not practical to run the full EHR application in a virtual machine on a tablet.  Being a Windows based program, it was necessary to have various awkward, non-intuitive gestures in order use it, for example, in order to right-click. This was not a natural interface for an Android or iOS tablet though possibly a Windows-based tablet, such as the Microsoft Surface, might work better. I don’t have experience with the Surface, so I just don’t know how much it would help.

Having your EHR running at full functionality on a mobile device is very important for a number a reasons. First, every doctor already has a mobile device of some sort. Second, the alternatives to mobile devices are immobile devices, i.e. desktops, which take up a lot of space, are expensive, are constantly breaking down, and are apt to have security issues, such as the doctor forgetting to log off, thus exposing sensitive patient information to the next person who sits down at the computer. Remarkably, the desktop route seems to be the norm for hospital EHRs, with doctors queued up during busy rounding times waiting to get on a computer. Third, doctors are inherently mobile. In the hospital they go from room to room when they round. It is much more efficient to carry one’s EHR with him or her and just go from room to room than it is to go to a room, return to the nurses station to type into a desktop computer, then go to the next room and repeat the process. Having a truly mobile EHR would avoid the constant trips to the nurses station.  So why can’t an EHR fit into a mobile device?

One reason is that present EHRs try to be all things to everyone.  They are not just for record retrieval and note taking. No, they contain everything and the kitchen sink. The same EHR used by the doctors is used by the admissions office to check in a patient.  You may have no reason to enter anesthesia notes or insurance information but your EHR seems to want to do all that and more. Rather than breaking down EHR functions into different tools for different user roles, all functionality is combined together into one megalithic beast. Such a beast simply can’t fit into the mobile form factor. So we are left with the antiquated desktop computers, taking up precious space in the nurses stations, with quaint, 1990s style user interfaces that would rouse feelings of nostalgia if they weren’t so frustrating to use. And don’t get me started on the do-nothing “click-me” buttons that are required for “meaningful use.”

We used to have mobile record-keeping systems in medicine. They were called “charts.” Sure they were bulky and unwieldy, and often all the information that we wanted was not in them (most egregiously missing were X-rays). Nevertheless they were relatively portable, could be stacked on a mobile rack, and a doctor could go from patient room to room without having to return to the nurses station (other than to get a cup of coffee). Data input was via a pen, which is actually a very quick, if sometimes illegible, way to enter data. For all the deficiencies of such a primitive record keeping system, it was fast, productive, and allowed more face time with patients — qualities that current EHR systems don’t possess.

So, a well-designed EHR system — something that I don’t believe exists today — would take that old-fashioned model and make it work on a mobile device, such as a tablet. The doctor could go room to room, pull up the patient data, and then record, either by writing, dictating, or typing, a note. The key to making data input work on a tablet is brevity. Get rid of all the garbage that is automatically sucked into a progress note by today’s EHR systems: lab reports, X-ray reports, 12 point reviews of systems, accumulated cruft from old notes. If you look at the notes generated by these EHRs, the amount the doctor actually enters is typically very small. It is contained in the history section which often simply says something like this: “no change” and in the plan, which may be “s/p PTCA, discharge tomorrow.” All the other debris in the note is added merely to satisfy the coders and billing personnel, who will freak out if there the note isn’t long enough (low complexity of patient care, missing review of systems, etc.). They don’t really care if it is all just cut and pasted from the admission history and physical, as long as all the components are there for them to check off. As I have argued elsewhere, the close coupling of billing and documentation has to change in order to alleviate the current EHR disaster.

A useful EHR system is possible. For it to happen the current desktop-based model has to be thrown out.  We need to start over and develop a truly mobile EHR. One suggestion: get the input of doctors when designing an EHR. Now there’s a novel idea!

Mr. Toad’s Wild Ambulance Ride

Another Mr. Toad.  Picture in public domain.
Another Mr. Toad. Picture in public domain.

(Another American health care fable)

The ambulance siren wailed loudly and the madly rushing vehicle careered through the narrow streets. Time was of the essence, as is always the case when a life is in danger.

The occupant, the center of attention of the concerned paramedics, grasped the side-bars of the stretcher. The violent gyrations of the speeding ambulance weren’t helping the pain in his chest or the rapid pounding of his heart.

Just a few minutes before, he, Joseph Toad, a 60ish wealth manager, aiming for retirement in a couple of years, had been at a Starbucks near his office downtown, drinking coffee and waiting to meet a client. Little did he know that events out of his control were about to coalesce into a “perfect storm” of platelet adhesiveness, inflammation, and hypercoagulability. It was Monday. It was morning. He was male. He was 60ish. He had a Type A personality. His father had died when 60ish of a sudden heart attack. He had a big, stressful appointment with an important client coming up. All risk factors for coronary thrombosis. And so it happened.

The ambulance arrived soon after the Starbucks baristas made the 911 call. Electrodes were applied, IVs were started, nitroglycerin was given. The pain in his chest was still sitting there, like the proverbial elephant. It was imperative that he be brought to a hospital in short order.

Despite his chest discomfort, the seemingly reckless ambulance ride was taking even more of a toll on his nerves. “Slow down!” he suddenly shouted.

One of the uniformed paramedics turned to him. “Don’t worry,” he said, glancing up at the rapidly beeping cardiac monitor. The hint of fear in the tone of his voice did little to allay Mr. Toad’s concerns. “We should be at the hospital soon,” he added, trying to be reassuring.

“I’d like to get there in one piece,” Mr. Toad said in a mildly reproachful, joking manner. To take his mind off both the wild ride and his chest pain, he sought to continue the conversation with the paramedic. “Why is it taking so long to get there? We surely must have passed some hospitals by now.”

“Well…no,” replied the paramedic, whose name Mr. Toad could not make out on his name tag. “I think if you’ve lived in this town for any length of time you’d know that all four hospitals are located in the East End of town, within a quarter mile of each other.”

“I hadn’t given it much thought,” stated Mr. Toad. He himself lived in the East End. It was the wealthy part of town. Of the competing hospital systems in town, all had wanted to locate their hospitals closest to those clients who had the best insurance, and the greatest ability to co-pay. Being a wealth manager by profession, this strategy certainly made sense from the economic, if not humanitarian point of view. Mr. Toad briefly cursed the bad luck that had led him to have his heart attack while downtown and not at home, close to a hospital.

“Wait!” he exclaimed, struck by an idea. “What about the University Hospital? It’s downtown. It’s closer.”

Both the paramedics next to him snickered a little at this suggestion. The one who hadn’t spoken yet said, “I’m sure you wouldn’t want to go there. You are nicely dressed and trust me you wouldn’t fit in with the clientele at the University Hospital. Patients there are over 90% Medicaid, Medicare, or indigent. You wouldn’t fit in at all.”

“Besides,” the other paramedic chimed in, “our ambulance service has a contract with several of the Big Players in Healthcare in this town. We’re better off going to one of their hospitals.”

“Better for whom? Me or you? I’m the one with the heart attack!” shouted Mr. Toad. This wasn’t good for his blood pressure, which was rising.

“Whoa, sir. Calm down. My partner here is going to give you a little shot of morphine. That should help relax you and help you with that pain. Your condition looks pretty stable at this point. You will be better off taking a little longer ride, since the East End hospitals have state-of-the art heart cath labs, state-of-the-art equipment and state-of-the-art doctors. Door-to-balloon times are as short as anyplace in the country. At the University Hospital you would be treated by docs just out of medical school, or still in medical school. They probably wouldn’t take you to the cath lab at all. Maybe they’d just give you a thrombolytic, you know, a clot-buster. But that usually doesn’t work. And then you’d be in some ward with four other people, homeless types. And no TV.”  While he was talking the other paramedic prepared the injection and then gave the morphine through the IV.

Mr. Toad calmed down somewhat, though whether it was from the medication or the paramedic’s attempts at reassurance he couldn’t be sure. It still bothered him that by going to a more distant hospital there might be more of a risk of his dying during the ambulance ride. But he supposed they had all the equipment to revive him here in the ambulance if needed. Being a wealthy man he did admit to himself that he would prefer a private room to being in an open ward, and he knew that in the long run he would get better care if he got it in one of the fancy East End hospitals.

For a while he was silent, lost in his thoughts. The pain was not gone, but was down to a 3 out of 10, to use the pain scale the paramedics had taught him. The ambulance sped onward…

One of the paramedics was talking into a microphone. “What’s going on?” Mr. Toad asked.

“We’re radioing ahead to the EDs, you know, the emergency departments,” the other answered. “Sometimes one hospital cath lab is occupied, or there is a bed crunch and the hospital is on divert. Since we have a choice of four different hospitals, and they are all within a block of each other, we have a lot of options.”

“And I suppose you are letting them know my condition.”

“Well, they know you’re having a STEMI — that’s a serious heart attack — and, believe me, they know what they have to do.”

Again Mr. Toad felt reassured. They had to be close to the hospital now, and relief from his pain was probably not far away. Now that it was almost over, the long ambulance ride probably had been the right thing to do after all.

“Problem?” one of the paramedics asked the one at the radio.

“Yeah. Sts. Elizabeth and Bartholomew has closed off one of their cardiac units. They’re upgrading their TVs to 60 inch screens. They’re full and begging us not to stop there.”

“Too bad, probably shortest door-to-balloon time there, but check with Latter-Day-Saints, Haussmann Plaza, and HumanCare.”

Mr. Toad wasn’t really medically savvy, but realized the door-to-balloon time had something to do with how quickly his heart attack could be relieved. He knew that somehow the doctors used a catheter to put a balloon in the blocked artery and blew up the balloon to open the blockage. They then would place a metal stent to keep it open. He had watched something about this on the Discovery Channel, never realizing the information would apply to him.

There was no cause for alarm, but he found the morphine was wearing off, and his pain level was now a five.

“Damn!” the radio-operating paramedic exclaimed. “HumanCare is on divert too. Apparently they’ve been overloaded because of the shut down unit at Saints E and B.” The other paramedic also cursed under his breath, and quickly moved up to the little window at the front of the cab, where he communicated this information to the driver. In response, the vehicle braked suddenly and changed course.

“Heading around the block. Still have a couple more choices,” he informed his patient.

There wasn’t enough time to radio ahead, as they had already arrived at the Haussmann Plaza Hospital ED. The doors at the back of the cab flew open and the paramedics prepared to slide Mr. Toad’s stretcher outside. Looking out the open doors, Mr. Toad could not help but be impressed by the view — despite his mounting chest discomfort. Was it a 7? An 8? He began to wonder what difference it made. Still the view grabbed him and distracted him from his pain somewhat.

Haussmann’s was a glittering glass spire, the newest and most modern hospital in town. He remembered reading about it in the paper. It had the works. All private rooms of course. Amazing views out the huge windows. A huge ornate chandelier of Venetian glass adorned the spacious lobby. World famous chefs manned the wonderful kitchen where gourmet meals were the routine. Huge wall-mounted flat screen TV sets, with hundreds of channels, first run movies, and interactive video games. Free wifi Internet service. And, in addition to state-of-the-art traditional medicine, Haussmann’s also provided access to popular forms of alternative, or, as they termed it, complementary medicine. This included non-traditional remedies such as St. John’s Wort, Ginseng, ground up shark fins, and many herbs and spices, as well as treatments using acupuncture, chiropractic, homeopathy, naturopathy, and basically any -opathy the patients wanted. Holistic healing was the name of the game at Haussmann’s. Mr. Toad, thinking of the amenities, was happy he had ended up here.

“Whoa! Whoa, whoa, whoa, whoa!” someone shouted.

“What?” shouted back one of the paramedics.

“Didn’t you guys call ahead? Didn’t you hear?”

“Hear what?”

“Man, the Food Network’s here today. They’re filming an episode of Cupcake Wars right here in the hospital kitchen. They’re got the hospital Chief Chef on as one of the three judges!”

“Yeah, so?”

“So the place is shut down until tonight. In other words, we’re on divert big time right now. In fact, one of the show’s producers is taking some outside shots and wants your ambulance out of the picture, pronto.”

“Listen, we’re got an acute STEMI in here and he’s not thriving, if you know what I mean!” shouted the paramedic.

“Listen yourself. There’s a bunch of other hospitals within walking distance. Now shove off. Bobby Flay’s around here somewhere and he’s not going to be happy to see you.”

In a matter of seconds the paramedics had jumped back into the cab and the doors were shut. The ambulance took off with a screech of its tires.

“Hotchelds,” the two paramedics said, almost simulataneously.

“What?” muttered Joseph Toad. He was feeling a little dizzy, like maybe he was slipping into shock. He didn’t know what was going on, because he wasn’t a doctor, but he didn’t feel good.

“Hospital of the Church of the Latter Day Saints,” one them said. “It better not be on divert.”

“You going to call ahead?” one asked the other.

“Nah, what difference would it make. We don’t have any other options. And here we are already anyway.”

Once again the doors flew open and this time Mr. Toad was out of the ambulance before anyone could object. In moments he was inside the Emergency Department. The two paramedics were rapidly talking to a triage nurse. The nurse took down a few notes and then came over to Mr. Toad.

“Hello I’m Nurse Kelly, the triage nurse. I hope you’re having a good day. Tell me what hurts.”

“It’s my chest, nurse. It’s been hurting for more than an hour now. It’s taken a long time to get here because the other hospitals were on divert, and I’m worried my door-to-balloon time is going to be too long.”

The nurse smiled. “Oh, I wouldn’t worry about that. The door-to-balloon time only started when you went through our door, which just happened. It’s supposed to be under 90 minutes, so we still have plenty of time.” She brought up her clipboard and a pen. “There is some paperwork we need to complete, some documents and consents you need to read and sign, and we need to make you fully aware of this hospital’s compliance with the HIPAA law.”

“Please, nurse, get me a doctor right away,” Mr. Toad begged. “I think I am dying.”

The nurse looked serious. “Of course that is very serious. I always get worried when a patient says they think they are dying, because, nine times out of ten, they do. It’s like some kind of self-fulfilling prophecy. Look, we’ll skip the unimportant paperwork until later. I just need one crucial bit of information from you.”

Mr. Toad did not look good, even to a lay person. His skin was gray and clammy. His heart rate which had been fast was suddenly slowing down markedly. His pain felt like something trying to burst out of his chest, like the monster in the movie Alien. Weakly he responded to the nurse. “Anything, anything you want. But quickly please.”

“Of course, sir. Do you have your insurance card with you?”

Mr. Toad groaned, but somehow was not surprised by the question. He managed to pull his wallet out and get the card out. He handed it to the nurse.

“Oh,” she said. “Oh, oh, oh. This isn’t looking good.”

Mr. Toad thought she was referring to his condition, but she wasn’t.

“I’m sorry sir. You should have informed the ambulance personnel what insurance you have. We pulled our contract with National Happiness Insurance a month ago. They wouldn’t come to our terms in the contract negotiations. It’s a tragedy really. I had a lot of very nice patients with that insurance.”

Mr. Toad was speechless.

“But, good news. There are 3 other hospitals within a quarter mile of here that take National Happiness. According to federal law, in this situation our duty in the Emergency Department is to stabilize the patient so that he or she can be transferred to a facility that can provide longer term care.” The triage nurse took a quick gander at Mr. Toad, who at this point was beginning to lose consciousness.

“Good Lord, we don’t want an arrest on our hands.” She waved to the paramedics who were still there, having a cup of the awful ED coffee as was their usual practice after dropping off a patient.

“You there. We don’t take this man’s insurance. He can’t stay here.”

The two paramedics rushed over, grabbed the stretcher, and in a moment Mr. Toad was back in the ambulance. The third paramedic, who was the ambulance driver, started the engine and turned the flashing lights and siren back on. One of the other paramedics moved up to the little window that connected the cab of the ambulance with the driver’s compartment.

“University?” asked the driver.

“University.”

Lanark — A Life in Four Books

Lanark by Alasdair Gray
Lanark by Alasdair Gray

Sometimes a statement that is ridiculed still bears a kernel of truth. The Internet really is a “series of tubes” — tubes that I tend to journey through frequently without a clear destination, much like the “mystery tours” my wife and I will sometimes take in our car. Sure, these wild expeditions may be considered by some to be a waste of time (or gas). Nevertheless, sometimes Brownian motion can lead you to unexpected discoveries.

One such Internet tube which is often the starting point for my random walks is the tube known as YouTube. Hidden among the various Trololo songs and Hitler Downfall parodies in YouTube are some real gems. Things like Christopher Hitchens in debate, Juya Wang concerts in high definition, Cab Calloway performing at his peak, episodes of The Thunderbirds (F.A.B!),  Gigliola Cinquetti singing Dio, Come Ti Amo, Marc-André Hamelin, Helene Fischer, Shirley Bassey, Renée Fleming, — the list of stuff to watch and listen to is virtually infinite. I have discovered a lot by surfing through YouTube.

And so it was that I looked up a favorite author of mine, Iain M. Banks. Unfortunately Banks died last year, of gall bladder cancer. He was a Scottish author, living on the shores of the Firth of Forth. He wrote both main stream fiction and science fiction. Most of his science fiction features a future galactic society known as “the Culture,” a near-utopia where there is no longer any want due to advances in technology. However humans, despite living the good life, are not their own masters, as artificial intelligence in the form of super-smart “Minds” has far outstripped human intelligence. The science fiction stories and novels of Banks are rife with clever plots and a wry sense of humor.

On YouTube there is the terminal interview with Banks, done at his home by a BBC reporter. The interview was done just a couple weeks before he died. Much like Christopher Hitchens, a fellow atheist, Banks shows little overt concern about his coming demise and indeed jokes about it. It is remarkable to see such sanguinity in the face of imminent death. But this post isn’t really about Banks (but go read his stuff anyway).

No, this is where the tangential nature of the Internet shows its face. In the midst of the interview with Banks, there is discussion of the novel Lanark, by Alasdair Gray. From the discussion it was clear that Banks admired Gray and this novel in particular. A little further reading on Wikipedia, and I found that Lanark is considered by many as the best novel written by a Scotsman in modern times. Being half a Scotsman myself, I was intrigued.

I am not a particularly fast reader, but I do read continuously and I am getting on in years, so I have read a lot. Much of what I have read may be considered by literary high-brows as trash: pulp fiction from the 1930s like Doc Savage or The Spider, however to counter this I have also read and enjoyed a lot of books that no one would consider trash: everything by Thomas Hardy from Desperate Remedies to Jude the Obscure, for example, or the works of all 3 of the Bronte sisters (yes, even Anne Bronte’s 2 novels) to William Makepeace Thackeray. I am somewhat of an omnivore when it comes to books, able to appreciate both Edgar Rice and William S. Burroughs. So, realizing that there was a great novel out there that I hadn’t read, by a Scotsman to boot, I went ahead and downloaded Lanark to my e-reader (which is just my phone at this point, my Nexus 7 tablet having kicked the bucket).

Lanark is a strange work. It contains the stories of two characters, seemingly unrelated, but possibly the same person. The character Lanark lives in a nightmare world, the city of Unthank, possibly in our future, but a future that is frankly psychotic. The characters are grotesque, à la Dickens or Mervyn Peake. Nevertheless the world of Lanark is certainly allegorical, with components paralleling our own governments, technology, and corporations. The satire is biting and scathing. Gray lists his own influences in the book (referring to these influences as “plagiarisms”), but the net result is certainly unique. There is a mixture of horror, humor, and pathos. Poor Lanark is unlucky in love and not appreciated, to say the least!

The other character is Duncan Thaw, who, as Gray himself admits, is largely autobiographical. Thaw’s story takes place in post-war Glasgow, and there are no fantastic elements to it. It is a story of an awkward adolescent, artistic to be sure, but also unlucky in love, unappreciated, and doomed by his own obsessions. It is touching, painful at times to read, and sad. But goodness, so well-written!

What is the connection between Lanark and Thaw? It’s not clear, though there are hints they are the same character (e.g. the sea-shells in Lanark’s pocket; Thaw’s last scene occurs on a beach). Gray plays with the structure of the novel which is in 4 sections. Books 3 and 4, the parts dealing with Lanark, wrap around Books 1 and 2, the parts centered on Thaw. Yes the order of the books is really 3, 1, 2, and 4. In addition there are similarly displaced Prologue and Epilogue, neither coming in the usual spot. At one point Lanark actually meets the book’s author, which is one of the funniest and strangest parts of the book. Following this there are footnotes referencing past and future chapters and characterizing the various “plagiarisms” supposedly present. Don’t skip those footnotes referencing future chapters because you are concerned about spoilers. Some of the oddest and funniest footnotes refer to chapters that don’t even exist in the book.

So what to make of this large (590 pages) book, first published in 1981? Like most great books, it is sui generis, a tour de force that is not repeatable. It was Gray’s first novel, taking 22 years to write, and none of his following works have been as popular. Inspired by Kafka, Goethe, Melville , H.G. Wells, William Blake, Dante, Vonnegut, as well as a slew of other authors that Gray lays out in a postscript, it nevertheless bears little resemblance to any other book I have read.  Despite the surrealism of the Unthank chapters, it is the very human and sad life of Thaw in the dreary city of Glasgow that is the most touching and memorable portion of the novel.

So I thank Iain Banks, not only for his wonderful novels, but also for leading me in his last days to Alasdair Gray and the marvelously bizarre Lanark.

Dark Clouds for the Sunshine Act

I finally decided to review my Sunshine Act data.  We are in the period of time when the data can be reviewed by physicians and disputed if necessary.  On September 30 the data will be released to the general public.  The data in question is a list of payments (whether food and drink, honoraria, travel expenses or whatever) submitted by drug and device companies for the previous year.  Theoretically the cost of every bagel or donut is counted and will be displayed on the web.  I don’t consider myself a major consumer of such resources, but it only seemed prudent to check out what was listed under my name before everyone else sees it.

Just getting to the data is not easy.  There is a 2 step registration process outlined here.  The instructions are contained on a 42 slide powerpoint presentation.  Undaunted, I plunged ahead.  During part of the process, I was asked questions like “where did my last bank loan come from” and other private information that I had no idea CMS would have in their files.  In another part of the process, there was a 15 minute time limit to answer the questions correctly.  Knowing your NPI number and your practice specialty code (this could easily have been a drop down list — I ended up googling the code) is necessary.  As we shall see below, all this caution to make sure that the person registering was actually me was a waste of time.

So, with the weary but satisfied feeling a hacker must get when finally breaking into a bank’s web site, I was finally in and the main screen confronted me.  Problem was it wasn’t clear what to do next.  After clicking around and getting cryptic error messages such as this one:

What the...?
What the…?

I finally got to where I needed to be.  But the spreadsheet I encountered was full of payments from drug companies I never dealt with.  After tediously viewing the details of each entry, I discovered that my data had been freely mixed with another doctor with my name who practices in Florida.  This despite having different addresses, different middle names, and, importantly, different NPI numbers!  Because of confidentiality concerns I won’t include the screenshots.  I ended up going through each and every entry and had to dispute at least half of the entries as being for the wrong physician.

A whole page of erroneous data
A whole page of erroneous data

Given my experience, I encourage everyone to check their own data.  I doubt I am the only one who has mistaken data.  All this could prove a huge embarrassment to physicians when the data is posted to the public on September 30th.  In reality it should be considered an embarrassment to CMS that they could make such a fundamental error.  It’s bad enough that we have to have this data posted (wouldn’t you like to see a similar database for congressmen?).  Since it’s now likely that it isn’t accurate only makes it worse.