After Life

Jonathan closed his eyes, died, and immediately woke up in a place that was, he assumed, Heaven. He could hardly contain his astonishment. A lifelong rationalist (a physicist to boot!), he was fully prepared for the eventuality that death was the end. But here he was — moments before occupied with the mechanics of dying (it wasn’t as bad as I expected, he thought) — and now in what he hoped might be “a better place.”

As a place it leaned more towards his idea of heaven than hell, though in truth it did not fit his conception of either well. He stood in a grassy field with rolling hills which he realized oddly resembled the default wallpaper of Microsoft Windows XP. His rational mind tried to convince him that this was some sort of dying-related-asphyxia-induced hallucination, or that he had not even died at all, despite all evidence to the contrary. Perhaps the life that he had up until this moment presumed he had actually lived was the illusion, and this bland yet cheery landscape the reality. Certainly the green grass rippling in the mild breeze and the fluffy white clouds in the blue sky seemed real enough. But his life before death had seemed equally real as well. It was all truly puzzling.

Engrossed as he was in these philosophical musings, he did not notice until the last minute that someone was approaching him from over the top of one of the rolling hills. The fellow was almost on top of him when he noticed him, and indeed was close enough by then to determine that he was not a “he” after all, but rather a woman. And a rather comely woman at that.

Being a physicist, Jonathan lacked the poetic vocabulary that really would have been helpful to describe this woman adequately. That she was of an indefinitely young age, was about 5 feet 8 inches tall, had light brown hair and dark brown eyes, was slender of build and so forth really failed to do justice to her. Given the context, he might have used the term “angel” to describe her, though only in an earthly sense, as she appeared to lack a set of wings.

The woman stopped in front of him and looked him up and down. He greeted her with a cheery “Hello,” and paused as one normally would to allow her time to respond. As no response was forthcoming, he continued.

“What is this place?” he asked. He felt this question was a little less silly than starting with “Where am I?”

The woman appeared puzzled. She spoke.

“K’aire. Onoma soi ti estin. Podapos ei?”

Jonathan had assumed that she would speak English, though come to think of it he wasn’t sure why. He didn’t recognize her language at all. It wouldn’t have mattered much if he had, as he didn’t speak any languages other than English.

He attempted to indicate to the woman that he was friendly and had no weapons, using hand signs. It was at this point belatedly that he became aware that his clothes had not made the transition to the afterlife, which put him in an awkward situation to say the least.

The woman (who, if you are curious to know, was clothed in a flowing white robe) turned and with a hand gesture beckoned him to follow her.

So they set off over the rolling grassy knolls, Jonathan rather desperately looking for something with which he could cover his nakedness and the woman in white leading the way in silence. As there wasn’t much else to do on this journey, Jonathan’s mind again became preoccupied with theories of what this place was that he had found himself in, post-mortem.

If it was some kind of biblical afterlife, it was somewhat disappointing: certainly nice scenery — and a beautiful woman! — but somehow he had expected more. Also, his naked condition could not hide the fact that he had been resurrected not in some idealized youthful Statue of David-like body, but in the same 50ish, flawed, somewhat pot-bellied body that he had departed the mortal plane in. Oh well.

The two topped a grassy rise. A small valley lay beneath, split by a sparkling blue stream. A white marble columnated structure rested adjacent to the stream. The design was that of a small temple of the sort found in ancient Greece. The woman (whose garment he now recognized to be what one would find on a Greek goddess) led the way down the side of the hill towards the small temple.

Jonathan smiled. It appeared the Greeks had gotten it right after all. There were probably hundreds or even thousands of afterlife stories among the world’s religions.  They couldn’t all be true.  Frankly he was surprised that any of them were true.  Of course nobody believed in Zeus or Athena or Apollo or any of those old Greek gods anymore. Nevertheless all evidence at this point indicated that they were real, as was their afterlife. He was a little cloudy on his Greek mythology though. He remembered something about Elysium Fields, but also some awful Underworld with a dark lord named Hades and a ferry piloted by Charon who steered the dead across the river Styx.  Well maybe he was jumping to conclusions. He needed more data, more information before setting up his hypothesis, he said to himself in good scientific fashion.

By this time they had reached the white temple. Inside was a statue of a goddess seated on a throne. The woman in white bore an uncanny resemblance to the marble goddess. At the base of the statue were some words carved into the marble — words which were unmistakably written in the Greek alphabet.

Well that nails it, Jonathan thought. I’ve died and gone to heaven, though clearly this is a more pragmatic and concrete heaven than the biblical one. I am clearly in the presence of a goddess. I’m a little hungry and am beginning to get the urge to use the bathroom, but all told, this is much better than I had any right to expect.

He wished he could communicate with his goddess/companion, for he had many questions, not the least of which was where he could get some clothes. She seemed oblivious to his nakedness, which was somewhat reassuring, but he couldn’t envision spending eternity in this state.

The goddess (he wished he could read the Greek script to ascertain which one she was — Athena? Hera?) laid her hand on the corner of the base of the statue and suddenly a secret door swung open. Jonathan could see a set of marble stairs leading down into darkness.

A secret door activated by a secret button would not be surprising in a bad B movie, but such things are indeed rare in real life, he thought. Of course this isn’t real life, but still…

The goddess (if that was what she was) motioned for him to descend and reluctantly he did so. She did not follow him. Instead she activated whatever secret switch closed the secret door. Now Jonathan found himself walking down stairs in pitch blackness. This was disconcerting to say the least. The word “underworld” popped back into his head.

I’m not sure what I will find at the bottom of these stairs, but I think it won’t be nice, he thought.

The stairs went on for longer than he expected. He had to place his feet carefully to avoid slipping and falling down into the darkness. Such a fall would be fatal in the world of the living. He was not sure what the consequences would be if he was already dead.

Might be an interesting experiment, if circumstances were different, he told himself, again using that scientific mind that had gotten him so far in life. He continued to focus on the task at hand, namely getting to the bottom of the endless subterranean stairs.

After a couple of hours (he judged) the stairs began to get more uneven, the atmosphere became dank and humid, and the temperature had dropped several degrees. In his clothesless state, he began to shiver. But he seemed to have no other option other than to go on.

Eventually he reached the last step and almost fell when his feet tried to descend another. He was in a tunnel with damp stone walls. Far at the end there appeared to be a faint glow of light.

The light was farther away than he realized. But, as with all journeys, he finally reached the end of the long corridor and passed into a dimly lit cavern. The lighting came from phosphorescent material on the walls which glowed a ghoulish pale violet. The cavern was enormous, stretching into the distance, its nether wall lost in mists. A continuous moaning sound came to his ear, faint, but becoming louder and more pitiful as he walked to the small boat moored on the shore of the underground river, where the monstrous ferryman waited.

Reading About Steve Jobs

The iconic Jobs and Wozniak Apple II photo
Wozniak, Jobs, and the Apple II

I am interested in the history of computer technology and over the last couple months have read a lot about Steve Jobs. To be specific I read Walter Isaacson’s Steve Jobs, Brent Schlender’s Becoming Steve Jobs, and a book published back in 2001, Alan Deutschman’s The Second Coming of Steve Jobs. To get the point of view of the other “Steve” I read Steve Wozniak’s autobiography, iWoz, How I Invented the Personal Computer, Co-Founded Apple, and Had Fun Doing It.  I watched the two biographical movies, Pirates of Silicon Valley from 1999 and the one from 2013 with Ashton Kutcher, Jobs. The first movie is a lot of fun, exploring the initial rivalry between Jobs and Bill Gates.  The second has been criticized but I like it also, and Kutcher’s resemblance to Jobs is uncanny.  I am looking forward to seeing Aaron Sorkin’s version when it comes out. I also read Fire in the Valley by Michael Swaine and Paul Freiberger, which is a free-ranging and entertaining history of the PC era and on which the first movie mentioned above was based.  Finally there are a number of documentaries on YouTube that address the early personal computer era.  One of the best is the 3-part Triumph of the Nerds.  There are numerous videos on YouTube of Jobs in action, from the earliest days of Apple until shortly before his death.

Reading and watching this stuff makes me nostalgic. I bought an Apple II+ in 1981 shortly after moving to Houston, Texas and starting my fellowship in electrophysiology. It was my reintroduction to computers after my brief fling back in my college days in the early 1970s. As underwhelming as its capacities were judged by today’s standards (base configuration had 48 KB RAM, 40 column all caps text display, 128 KB floppy drives and a MOS Technology 6502 CPU running at 1 MHz), I loved that little machine and was amazed by it. Using its 8 open expansions slots (something Woz insisted on and surprisingly prevailed in getting over Jobs’s objections) I had that thing decked out with an 80 column lowercase text display card, a 1 MB RAM-disk, memory expansion to 64 KB, and a CP/M card — all at considerable cost on a fellow’s salary.  For software I had WordStar for word processing, Turbo Pascal for programming, VisiCalc (the first spreadsheet program), dBase II (a database program) and lots of games, including the very first version of Flight Simulator. It worked well and was fun to use but over the years it was replaced by more powerful systems and eventually I threw it all out. Now I kind of wish I had kept it (or at least sold it on eBay). I kept all my old Byte magazines though, and paging through them is a trip down memory lane.  It’s fun to revisit those days when Microsoft with its software that could run on anything (as long as it was compatible with an IBM PC) appeared to be heading towards  victory over poor  Apple, despite the coolness of their Macintosh computers. As we all know, a lot has happened between then and now.

Isaacson’s book is very well written and, being the authorized biography, has a lot of material that the other books don’t. Nevertheless, the one period that Isaacson skimps a bit on, the time when Jobs was at NeXT and starting Pixar, is well fleshed out in the other two biographies, particularly Schlendler’s. His thesis is that the struggles at NeXT and Pixar were crucial for Jobs to become a better manager and thus be in a position to return to Apple and turn it around starting in 1997. Schlender also seems a bit more sympathetic to Jobs, though it is hard to paper over some of his worst characteristics.  For example, Jobs denied he was the father of his daughter Lisa, and he abandoned her when she was young. Later he acknowledged being her father and reconciled with her. This behavior seems particularly reprehensible given that Jobs himself was “abandoned” by his biological parents and was raised by foster parents. He eventually met his biological mother and his biological sister, the writer Mona Simpson. He discovered his biological father (who was a Syrian graduate student when Jobs was born) and actually had met him once by chance at a restaurant which his biological father owned, but neither realized the father-son relationship at the time. Jobs chose never to meet with his father again.

Jobs is a complex figure. He was self-centered and lacked empathy towards others. He could turn on the charm, but often in a calculating manner. His biographers point out his black and white approach to everything. To Jobs, other people and even things like food or computers or software programs were either perfect or they sucked. There was no middle ground. He may have mellowed somewhat as he grew older, but not much. Jobs’s genius appears to be that he was able to utilize both his strengths and his flaws together to inspire others to do their best (or get out of his way) and thus design and bring to market products that have certainly changed our world. In the process Apple became the wealthiest company on the planet.  But Jobs’s driving force was not wealth.  He aimed for perfection.

No Greek tragic hero is without his blind spot, and Jobs had his: his quirky views on health and diet. A child of the 60s growing up in California, he maintained a distrust of “western medicine” so that when diagnosed with a potentially surgically curable pancreatic cancer found incidentally on a routine CAT scan (he had a history of kidney stones, thus the CAT scan), he delayed surgery for 9 months. He tried various diets, alternative medicines, and acupuncture first. When he finally yielded to the surgery liver metastases were found, and after that, despite a liver transplant and aggressive chemotherapy it was only a matter of time before he succumbed.

Jobs’s genius was that he foresaw what most others didn’t: apart from the computer geeks like Steve Wozniak and the members of the Homebrew Computing Club back in the 1970s, most people don’t care about computer technology per se. They want to use these devices to listen to music, to read books and articles, to look up stuff, to keep in touch with friends, to watch movies, and to get their work done. For most, computer technology is just a means to an end. Steve Jobs realized this better than anyone else in the industry and had the overwhelming personality to find the best people and motivate them to do perform at levels they didn’t realize they were capable of.

One wonders what symphonies a 60 year old Mozart would have written. What songs were denied to the world when George Gershwin died of a brain tumor at age 38? What would Emily Brontë have written beyond Wuthering Heights if she had not died at age 30?  What other “insanely great” products were denied to the world when Jobs died at age 56?  Life at Apple goes on without Jobs. The hand-picked people he surrounded himself with continue without him. But his will be a tough legacy to uphold.

Index Verborum Prohibitorum

Index_Clemente_VIII_1596The Catholic Church for centuries maintained a list of banned books, the Index Librorum Prohibitorum,  only abolishing it in 1966.  Governments, particularly fascist ones, also have had a pronounced tendency to ban books for moral, religious, or political reasons.   Such censorship is a repugnant form of thought control.  It is no surprise that the fascist dystopias of George Orwell’s 1984 and Ray Bradbury’s Fahrenheit 451 center around the destruction or mutilation of the printed word.

While banning books may no longer be in vogue, it appears that banning individual words is fashionable if not de rigueur on today’s college campuses.  The justification is that some words are too hurtful to use.  Some words carry so much historical and racial baggage that their use is always off-limits.  Certain racial epithets can’t be used in any context, not even in a discussion of how bad it is to use racial epithets, because the very act of speaking these epithets is an act of violence.  Thus words are imbued with almost magical powers, and some words are so evil that they can never be spoken out loud.  The “N-word” is akin to “He-Who-Shall-Not-Be-Named” in the Harry Potter books.  People generally will avoid these forbidden words (as I will do here) partly out of a genuine desire to avoid hurting others’ feelings, but also, to be honest, out of fear — the fear of backlash, much like the fear of the media to publish cartoons of the Prophet Mohammed, though this is less a fear of outright violence than a fear of being ostracized and called racist.

This is what happened to the writer Wendy Kaminer when she used one of the proscribed words at a forum on free speech at Smith College in reference to teaching Huckleberry Finn, which, if anyone nowadays is allowed to read an unedited version, has a major character whose name contains that proscribed word.  Read her article in the Washington Post.  It is amazing that in this context (a free speech forum, in a discussion about a classic book that contains that word) she has been deemed a racist merely for using the actual word instead of its baby-talk equivalent.  This reminds me of the scene in Mel Brooks’ film, High Anxiety, when, at a convention of psychiatrists, the word “woo-woo” is used instead of “vagina” because one of the psychiatrists brought his young children with him.  Political correctness is childish.  Political correctness and freedom of speech don’t mix.  The United States Bill of Rights makes a big deal out of freedom of speech.  It does not mention politically correct speech.

I have been living in Paris, France the past 6 months.  Despite being the home of Voltaire and Charlie Hebdo, freedom of speech is more limited here than in the United States.   For example, shortly after the Charlie Hebdo massacre, comedian Dieudonne M’bala M’bala was arrested in Paris for anti-semitism and hate-speech.   Broadly defined hate-speech and holocaust-denial are crimes here in France and in Germany.  As reprehensible as this kind of speech is, it is not a crime in America.  In America we put up with the Westboro Baptist Church and their God Hates Fags signs at military funerals.  We allowed the American Nazi Party to march in Skokie, Illinois (though ultimately their march took place in Chicago).   We allow hate-speech because we allow all speech short of yelling “Fire” in a crowded theater.  We don’t want the government to decide what we are allowed to say, write, read, or hear.

It is unfortunate that in the name of political correctness some people think nothing of placing limits on such a wonderful and powerful freedom — the one freedom that really sets us apart from the rest of the world.  Americans seem all too willing to trade our hard-won freedoms for short-term comfort.  The Patriot Act is a case in point, with which we gave the government carte-blanche to spy on us in exchange for — what?  Is it so comforting that Big Brother is watching us all the time?  Personally I would rather apply the word “patriot” to Edward Snowden than to the act.

It is disappointing that after the Charlie Hebdo murders, despite the wide-spread Je suis Charlie signs, there was a tendency among some in the media to blame the cartoonists and writers, though stopping short of saying that they deserved to die for their “hate speech” (see here, for example).  And college campuses predictably went back to business as usual, promoting suppression rather than freedom of speech, denying (or attempting to deny) commencement speeches to figures such as Bill Maher, Ayaan Hirsi Ali, and Condoleezza Rice.   The Ivory Tower has never been so heavily defended against the onslaught of reality.

Words are powerful.   Words allow humans to download the contents of their brains in a format suitable for upload to other brains.  Words express ideas that can be disruptive and disconcerting to the status quo.  It is no wonder that others want to control our words.  The best weapon against bad ideas is unfettered freedom of expression.  Bad ideas need to be exposed to the light of day.  In the marketplace of ideas, good ideas will drive out the bad.  It is not necessary and indeed counterproductive to ban bad ideas, bad words, or bad books.  The most effective way to destroy the Westboro Baptist Church is not to ban their demonstrations, but rather to allow them to display their hateful ignorance in public.  In their own way, the Westboro Baptist Church has probably done more to advance the cause of the LGBT community than most pro-LGBT activist groups.

I find it sad that left-wing groups on college campuses, who in past years were at the forefront of freedom of expression are now the ones who are most willing to shut it down in the name of political correctness.


Introducing EP Calipers

epcalipersicon-180x180Ever since the 1990s, when computer-based electrophysiology (EP) systems were introduced, HV intervals and ventricular tachycardia cycle lengths have been measured in the EP lab by electronic calipers — simple but accurate measurements accomplished on-screen using a track ball or a mouse. Despite this, physicians still often carry a physical pair of calipers, perhaps preserved from the pre-Sunshine Act days when they were provided for free by drug companies. They use these calipers to measure heart rates and QT intervals on printed electrocardiograms (ECGs). But more and more, ECGs are viewed electronically. All physicians now use smart phones and frequently send and receive photos of ECGs or rhythm strips for analysis. For example, when I was on-call there would often be a patient who went into atrial fibrillation in the middle of the night, or a patient who would be due a dose of dofetilide (a potentially dangerous QT interval prolonging drug). The nurse would have a rhythm strip or ECG that needed analyzing and the easiest way to do that in the post-fax machine era was for them to take a photo with a smart phone and text or email it to me for analysis. Measuring heart rates or corrected QT intervals requires the use of calipers, but physical calipers don’t work well with smart phones — maybe even scratching the glass screen! Electronic calipers akin to those used in the EP lab would be useful to make accurate measurements on ECG and rhythm strip images.

I did not realize that there weren’t any apps (as far as I can tell) providing electronic calipers until this was pointed out to me by one of my Twitter buddies, Dr. Michael Katz. So I wrote an app, EP Calipers, that provides these calipers.

Making EP measurements on an iPad
Making EP measurements on an iPad
Measuring RR interval, iPhone 6 Plus
Measuring RR interval, iPhone 6 Plus
Amplitude measurement
Amplitude measurement
QT measurement with QTc calculation
QT measurement with QTc calculation
Multiple calipers, showing heart rate
Multiple calipers, showing heart rate

As the screen shots show, these calipers look just like those provided by EP recording systems, such as the GE (formerly Prucka) Cardiolab system. Multiple calipers can be used at the same time. Both time and amplitude calipers are available.  Unlike real calipers, it is possible to zoom images and make much more accurate measurements. Also unlike real calipers, it is easy to measure mean heart rates and calculate QTc intervals automatically.  The app makes the necessary calculations.

I am hoping these electronic calipers will be easy to use and helpful to anyone who has to deal with ECG recordings. This is the first iteration of the app and I am open to suggestions to improve it. Right now the app is available for Apple iOS (version 8.1 or higher required), but the Android version will be available Real Soon Now. Have fun measuring intervals electronically to your heart’s content!

EP Mobile Update Version 3.6 for Apple Devices

The reviewers at the Apple iTunes App Store have approved the revised version of the EP Mobile app.  For information on why the app needed to be revised, see my earlier posts on the subject.  I removed the drug dose calculators (note though that the Warfarin Clinic module was not removed), but added detailed drug dosing information and a creatinine clearance calculator that can be used while viewing the dosing information.  Other improvements to the app have been made as well.  The changelog is as follows:

Changes from version 3.5
* Removed drug dose calculators as requested by Apple (see developers guide section 22.9)
* Added new drug reference section with creatinine clearance toolbar
* Added creatinine clearance calculator
* Added right ventricular hypertrophy criteria
* Added D'Avila WPW accessory pathway location algorithm

I will release the new version in 2 days (March 22).  If for some reason you can’t live without the drug dose calculators, then don’t update the app.  Turn autoupdate off if it is on to prevent inadvertently updating the app.  Regardless of the lack of drug dose calculators, I encourage most people to update the app, because I think that using the new drug reference information in the app is a better way to determine drug dosages, and because I will continue to add new features to the app, which will not be available to those who do not update.

Note that Android users of EP Mobile still have access to the drug dose calculators, as well as the new features noted above.

I hope that at some point Apple changes its policy and adds physicians to the groups permitted to write apps that calculate drug doses.  After all, it’s what we do.

Countdown to version 3.6 release — Done! Released Mar 22, 2015!


Update on EP Mobile and Apple #2

As some of you are aware, the Apple App Store rejected an update to the EP Mobile app based on the presence of drug dose calculators in the app. The App Store guidelines state:

22.9 - Apps that calculate medicinal dosages must be submitted by the manufacturer of those medications or recognized institutions such as hospitals, insurance companies, and universities

For those who want more background on this issue, see these two previous posts (here and here).

I have decided to go ahead and remove the drug calculators from the app. All the drug calculator code remains in the app and, should Apple ever change their mind(s) on this policy, it will only require changing this single line of code to get them back.

// Sigh!

I toyed with putting a backdoor into the app to activate the drug calculators, but I realize if I do something like that it would be my last Apple app. I have modified the app to make up for the loss of the drug calculators, and I think that with these changes you will continue to be satisfied by the app.

Here are the changes.

The creatinine clearance calculator had been embedded in the drug calculators, so it has been promoted to its own discrete module (which is something I should have done anyway a long time ago.

EP Mobile Main Menu Drug calculators gone, creatinine clearance calculator added
EP Mobile Main Menu
drug calculators gone, creatinine clearance calculator added

Instead of the drug calculators, there is a drug reference section. Each of the drugs that formerly had calculators now has detailed dosing information, as well as other useful information, akin to what you find in the Medscape app. (An aside: I think drug dosage information as opposed to drug dose calculators is acceptable to Apple, as it is present in Medscape and other medical apps. Medscape does not meet the Apple criteria mentioned above any more than EP Studios does: it is not “the manufacturer of those medications or [a] recognized institution […] such as hospitals, insurance companies, and universities.”).

Two new modules: Right Ventricular Hypertrophy and Drug Reference
Two new modules: Right Ventricular Hypertrophy and Drug Reference

What makes the drug reference section more useful than the similar information in Medscape is that there is a toolbar at the bottom of the screen that allows you to calculate a creatinine clearance on the fly, and then retains that information while you are trying to figure out the appropriate drug dose. Thus the only calculation done is the creatinine clearance; the physician and not the app decides of the dose. In many ways this is superior than having a drug dose calculator, because more information is presented that may be useful to help decide on the proper dose.  The drug reference section can also be expanded in the future to include information on other EP related drugs that don’t necessary require any calculations to dose, such as amiodarone or ibutilide.

A portion of the drug reference for dofetilide. Note the detailed dosing information and the Creatinine Clearance toolbar at the bottom showing the last calculated CrCl.


Finally the D’Avila WPW algorithm has been added, as well as a module on diagnosing right ventricular hypertrophy. I have left in the Warfarin Clinic module too. This module was not called out by Apple on the last review, so we shall leave it alone for now.

I will submit the update to Apple in the next 24 hours. Their review process usually takes about a week. If the approve it, I will not release the update right away, but will give some advance notice on Twitter. If you really can’t live without the drug calculators, then you should turn off auto-update and not update the app. I think though that the drug reference section with the built-in creatinine clearance calculator more than makes up for the loss of the drug calculators, and I encourage you to update the app when it is available.

If you happen to be best buds with Tim Cook, let him know that rule 22.9 is stupid and should be sacked.

How to Build a Better Electronic Health Record Part 27 — Modularity

Editors note: This 27th entry in our web series on EHR design is excerpted from Electronic Health Record Software: Principles and Practices, 3rd Edition, by Paul Lockhart and Janet Twombley-Chu, published by Addison Wesley, June 2089. 3378 pages. ISBN: 103-978-1-4919-0498-5. Reprinted by permission. Amazon listing [1].

Chapter 7
EHR Modularity

7.1 A History Lesson

In the brief overview of software design presented in the first chapter (Section 1.1.5 [2]), you learned that modularity is one of the fundamentals of good software design.  Given this, you might be surprised to learn that modularity was actually avoided in the design of early EHR systems. “But,” you might say, “a monolithic Electronic Healthcare Record system would be unwieldy, unusable, even unbearable to use. Doctors would refuse to use it, or if they did, patient care and physician efficiency would suffer. Certainly in a free market no one would buy such an EHR and the vendors of such a system would soon be out of business. Who in their right mind would design such a system?!”

Who indeed?

A little history lesson. Back in the beginning of the 21th Century, before the Great Revolt (see Section 2.3.14 History of EHR Design, Early 21st Century Failures [2]), monolithic medical software was the established norm. As anyone who has studied this period knows, EHR usability was not a high priority at that time.  Medical software design was actually dictated by politicians, whose lack of programming ability continues to this day. The political system of the time consumed (= wasted) vast amounts of money that required continual donations from large corporate sponsors.  This system of contributions to political campaigns (nowadays we would use the term “bribes”) ensured that a few medical software corporations remained dominant and profitable, while at the same time it eliminated competition from smaller companies.  Quid pro quo gamed the system so that that only a few EHR products could meet the so-called “meaningful use” criteria required by the bureaucrats. The need for data-sharing and interoperability inherent in systems designed for health care was anathema to these few powerful companies (less than 10 companies controlled this market in that era).  In a sense the clients for this software were not the physicians and other health care workers who used it on a daily basis, but the politicians who kept the EHR corporations in a dominant market position. The EHR software business was very lucrative, with applications (including various more or less useless support packages) selling for hundreds of millions of dollars. That’s not a typographical error. Even accounting for inflation, that was a huge amount of money in those days. These companies could sell software code to hospitals and physician practices for hundreds of millions of dollars at a time when far more complex software with tuned user interfaces often was given away for free or at a nominal charge (examples include Linux or the Mac operating systems). Naturally this was an inherently unstable if not absurd situation which was one factor leading up to the Great Revolt, but this is something the curious can look up themselves (a good account is given in [3]).

7.2 Rationale for Modular Design

Enough history! Why should EHR systems be designed to be modular? The answer has to do with the basic fundamentals of software design. To review, here are some of these principles of good software design:

  1. Minimize complexity. Computer systems use layers of abstraction to hide the complexity going on underneath the surface. When we press button on a screen, we don’t want to know what the ones and zeros are doing behind the scenes. All software programming uses abstraction to minimize complexity, but this principal does not stop with the software programmer. The user interface designer also has to adhere to this fundamental design principle and not present to the user anything more than the user needs to deal with.
  2. The Small Tools Principle, aka the Unix philosophy [4]. In brief, linking “small, sharp tools” together in a chain was the underlying design principle of the original Unix operating system, the ancestor of most modern operating systems.  Each software tool can be optimized for its own particular task, and tools can be combined to create larger systems.  This philosophy is modular design in a nutshell.
  3. DRY Principle (Don’t Repeat Yourself)[5] Duplication is evil, resulting in multiple copies of the same data, or coding errors when changes are made in one place and not another — there is a whole litany of disasters that can occur when this principle is ignored. An example of violation of the DRY principle would be having the same ultrasound report repeated in multiple places in the EHR, e.g. in the reports section, and copied and pasted into several doctors’ progress notes.  Inevitably this results in data becoming unsynchronized and increasing storage needs.  Hyperlinks, which refer to a single source of data, are a way to handle multiple references to the same data without violating the DRY principle.
  4. Open Software Principle.[6] In health care as in other data-centric programming endeavors it is important to design an open data standard and open APIs.[7] Application Programming Interfaces (APIs) should be universal and data should be shareable.  These are the bedrock on which EHR applications can be built.  While open standards may not be perfect, they are at least open, and can evolve over time. Witness the Internet Protocol (IP). Designed to transmit data at a time when people used dial-up modems, it was robust enough to handle unanticipated new uses such as streaming video, and could evolve as needed: for example when address space ran out with IPv4, the IPv6 standard was introduced[8].
  5. User Interface Independence.  While the backbone to an EHR (the data format and APIs) should be universal, open, and relatively fixed over time, the overlying UI can be independent and can evolve rapidly.  UI apps can be novel and competition among vendors is healthy. The UI is the top layer of the software stack and it is the sole layer that the user interacts with.  It is the layer most open to creativity (not all users want the same UI).

A modular EHR design fulfills all of the above principles. The UI is a separate module from the EHR database backbone, communicating with it using well-defined APIs.  The UI design is based on the role of the user, the situation of the user and the preferences of the user. For example, the appointment clerk wants to interact with a calendar and a list of open appointments. The nurse wants to be notified of doctor’s orders and moment to moment patient status changes. The doctor wants to review old medical records or to write a progress note. The same EHR UI cannot serve all these roles simultaneously. Likewise the work environment plays a role in UI design.  The doctor at his or her desk may want to interface with his or her laptop or workstation using a keyboard. When out making rounds in the hospital he or she might want to use a smart phone to record notes via speech-to-text software. Thus the EHR user interface used will be different depending on these situations, and should be optimized for each of these situations.  EHR systems designed using modules allow this optimization, whereas monolithic, “one size fits all” designs are doomed to failure, as history shows.

In the next few chapters we will delve into the practicalities of modular EHR design.

7.3 Exercises

Exercise 7-1. Using the EHR design toolkit[9], design a UI for entry of vital signs. For writing a doctor’s progress note. Design these for data entry on both a laptop and mobile phone. Try to use the same interface on both devices and then try customizing the interface based on type of device. Which was easier to design? Which was easier to use? Why?

Exercise 7-2. You are back in the early 21th century and have been employed by the Acme software company to design a secret proprietary database format for their EHR. You decide to argue with your manager about the need for a shareable as opposed to secret data format. What arguments would you make? How would your manager likely respond?

Exercise 7-3. Using the toolkit design a billing module. How do you feel the billing request should be generated? Should the amount billed be based on patient complexity or on the specific task performed? Which type of bill is easier to generate? Which would be harder to justify if challenged?  Which more open to abuse? Which type of billing software would you prefer if you were a health care provider and why?

Exercise 7-4. You have been tasked to write a UI system for an EHR. Your clients argue that the ability to cut and paste is crucial, as they operate in an environment that is “paid by the word.” They want for example to copy X-ray reports and paste them into their notes to make them appear more thorough. What arguments can you make against this practice (hint DRY principle)?

Exercise 7-5. Which is better: an annotation in the EHR that the medical review of systems (ROS) was negative or a template that automatically inserts a full 12 point ROS with all systems checked as negative? Give the pros and cons of each system (e.g. Pro: a full template reminds the doctor what points he asked the patient; Con: the full template takes up more space and is not a guarantee that every point checked as negative was actually addressed). How would the billing system referred to in exercise 7-4 bill for these two types of documentation?  Could repeating the same ROS in every different consulting doctor’s note for a patient be considered a violation of the DRY principle?  Justify your response.


[Editor again: The post above was inspired not only by the stodgy but somehow comforting style of computer textbooks, such as those published by Addison Wesley, but also by a recent conversation I had with an app designer from Chile whose company designs modular mobile software (the Teamscope app) that interfaces with medical data (clinical research data, but the same principles apply to interfacing with EHR data).  I don’t usually write software reviews (well, one exception comes to mind, my game review of the EPIC EHR), but I think these developers are on the right track.]


[1] This is a listing in a future version of Amazon, hence it is not available yet.
[2] Only available to purchasers of the full version of this text.
[3] This citation refers to a work that has not been written yet.
[4] See Eric Raymond’s The Art of Unix Programming
[6] This citation also refers to a work of the future that doesn’t exist yet.
[7] Ibid.
[8] Yes Wikipedia is still essential in the future.
[9] The EHR toolkit will be available when the book is published, 74 years from now.

All the President’s Tapes

The Nixon Defense
The Nixon Defense

Richard Nixon’s downfall, a.k.a Watergate — a word whose suffix has become a part of the English language, has always fascinated me. In the summer of 1973, poised between graduation from college and the start of medical school, I spent an inordinate amount of time in front of the television watching the Senate Watergate hearings. In those days before 24 hour cable news and CSPAN it was almost unprecedented for the networks to “interrupt our regular programming” and carry such an event live. I remember John Dean’s relating his March 21, 1973 conversation with Nixon, telling him there was a “cancer on the presidency,” a warning that Nixon ignored, instead reassuring Dean regarding the estimated million dollars of hush money that the Watergate burglars wanted that “we can get that … I know where it can be gotten.” I remember Nixon’s top men, Mitchell, Ehrlichman and Haldeman, stonewalling it, denying the president had any knowledge of the cover-up. At the time it looked like it would boil down to Dean’s word against the president’s, with no evidence against the president other than hearsay. Then, on July 13, 1973 a relatively minor character, Alexander Butterfield, an assistant to the president, was called before the Senate committee in closed session. Apparently one of the lawyers on the committee (a Republican) had become suspicious by the amount of detail available relating to notes about a certain White House conversation, and asked Butterfield directly if there was a recording system in the White House. Butterfield, one of only a very few who knew of the existence of the system (Nixon’s top aides, other than Haldeman, did not know about it) had planned not to reveal the system, but faced with a direct question and the threat of perjury, had to answer honestly. So in public session on July 16th, Butterfield was asked the question by Fred Thompson (yes that Fred Thompson, who was a minority counsel for the committee) before all the TV cameras, and to the astonishment of everyone (including me who saw it live) revealed that every conversation and phone call in the Oval Office and in the president’s Executive Office Building was recorded automatically on tape.

The tapes of course are what destroyed Nixon’s presidency, a self-inflicted wound worthy of the most profound Greek tragedy. It is difficult to fathom the hubris of the man who wanted his every presidential conversation preserved for posterity and then went on to discuss with his aides an ever-evolving and increasingly complex cover-up scheme while his secret taping system was recording every word. Nixon eventually had to give up the tapes after the Supreme Court unanimously forced him to do so, and certain of the tapes, like the June 23rd 1972 “smoking gun” tape, in which Nixon has the FBI limit its investigation of the Watergate burglary for “national security” reasons, led immediately to his resignation. Beyond these several infamous tapes, there are hundreds of hours of tapes relating to Watergate that up until this point had never been transcribed or documented. In John Dean’s book The Nixon Defense: What He Knew and When He Knew It these recorded conversations are described and from the book there emerges a more complete picture of Nixon and what happened that led to his downfall.

The June 17th, 1972 Watergate break-in and bugging of the Democratic National Convention headquarters seem to have occurred due to the over-exuberance of certain of Nixon’s cronies who worked in the Committee to Reelect the President (which actually had the acronym CREEP) including former attorney general John Mitchell, born-again post-conviction Chuck Colson, and possibly Nixon’s top aids John Ehrlichman and H.R. “Bob” Haldeman. They had hired Gordon Liddy, a loose cannon if ever there was one, to find out what the Democrats were up to. Nixon, who it is pretty clear did not know of the Watergate activities beforehand, nevertheless set a tone in his administration that dirty politics was the norm and his associates, only too eager to please him, ended up going beyond the bounds of legality to do so. After the Watergate burglars were arrested, from the very start Nixon tried to limit the political damage to himself. After all, he was running for reelection. He also felt he had to prevent his political allies from going to jail. He had a very difficult time in actually firing Haldeman and Ehrlichman, his two top aides, when it became clear he had to do so. In the Nixon-Frost interviews one can almost feel sorry for Nixon when he talks about this. Yet for the most part the recorded conversations reveal a cold, calculating, ruthless character with whom it is difficult to sympathize.

Nixon based his defense around the March 21, 1973 conversation with John Dean, the “cancer on the presidency” meeting. Reading this in the book (or listening to it; the important conversations are on YouTube), it is clear that Dean, though involved in the cover-up initially, was trying to warn the president (he was after all the president’s counsel) that he risked becoming entangled in the Watergate cover-up. Dean revealed the blackmail demands of the indicted Watergate burglars and clearly seemed surprised that Nixon was willing to raise money to pay them off. Later Nixon and Haldeman would claim that Nixon said on that day that “we could raise a million dollars … but it would be wrong,” but that was a bold-faced lie (here is what he really said). Nixon later blamed the cover-up on Dean and said that he (Nixon) started his own personal investigation into Watergate after the March 21 meeting with Dean.  This “investigation” was yet another cover-up created by Haldeman and Nixon.  It is ironic that in the recorded conversations when this March 21 meeting was discussed, Nixon is constantly worried that John Dean had somehow carried a tape recorder on his person during that meeting and had recorded evidence that would show Nixon was lying. Strangely, Nixon seems to have given little thought to the fact that he himself had made a recording, and that this recording would eventually become public, indeed proving that he had lied. Only occasionally did Nixon give any thought to the automatic recording system. At one point he briefly considered destroying the tapes before their existence was discovered, but Haldeman talked him out of it, because of the potential loss to history. Ah, hubris!

The book may not be as fascinating to those who did not live through the era as it was to me.  It is a long book, and for those interested in Watergate in less detail, Woodward and Bernstein’s All the President’s Men or John Dean’s earlier Blind Ambition are good. Nevertheless all Americans should be familiar with Watergate and how the government narrowly avoided a constitutional crisis.  Compared with the governmental dysfunction today, this was an era when the process of government actually worked.  Though Nixon had his defenders amongst the Republicans, as the evidence piled up against him, both parties united in the impeachment process. The Justice Department, the Supreme Court, and the Congress did what they needed to do. Despite the abuse of power in the executive branch, the other branches of government functioned properly and the balance of power built into the Constitution by the founding fathers saved the day. One wonders though what the outcome would have been if Nixon had not recorded himself, or had destroyed the tapes early on.

The Nixon Defense is probably the definitive Watergate book. Nixon was right about his tapes. They are of great historical interest, but not in the way he intended. They reveal a picture of the downfall of one of the most interesting political characters of the 20th century, a presidential reality show that, like most reality shows, can be banal and riveting at the same time.

Update on EP Mobile and Apple

This is an update on my previous post which dealt with Apple’s rejection of an update to the EP Mobile app because it contained drug dose calculators. According to a clause buried in the App Store Review Guidelines (section 22.9, to be precise),

22.9 apps that calculate medicinal dosages must be submitted by the manufacturer of those medications or recognized institutions such as hospitals, insurance companies, and universities.

EP Mobile has included such dosage calculators from its very first version, but for some reason the current update (which just added the D’Avila algorithm [PACE 1995;8:1615-1627] for determining accessory pathway location) triggered the discovery that the app was in violation of this rule. I was unaware of this rule, and I don’t think the rule was extant when I submitted the first iOS version of the app in 2012.

I submitted an appeal to Apple stating that as physicians have to calculate drug doses every day there does not seem to be any reason a physician-programmer should not be permitted to write an app to calculate drug doses. A drug company could only produce an app for their specific drug, so they could not duplicate the functionality of having multiple drugs from different companies in one app. I don’t see any incentive for a hospital, insurance company, or university to develop this kind of app, though I suppose it is possible they could. As a physician I developed the app because it was useful in my daily work. It makes figuring out drug doses for certain anti-arrhythmic drugs or anticoagulants much easier. As far as I know that specific functionality is not duplicated in the App Store.

Apixaban Dose Calculator
Apixaban Dose Calculator

Apple stuck to their guns and maintained the app update could not be approved. On Twitter a colleague tweeted this article from iMedicalApps of June 2013 which discusses the problems that Apple has with drug dosage apps. Apple is probably concerned about the FDA’s potential scrutiny of medical apps and possible legal liability for drug dose calculators that could give erroneous information. In any case this article points out that the Medscape app also provides drug dosing information (though only as written information, not as a calculator — I’m not certain, but it appears that the App Store Review Guidelines may have changed from banning dosing information altogether to just banning dose calculators). Medscape is owned by a private company (WebMD) and is neither drug company, hospital, insurance company nor university.

Medscape iPhone app provides drug dose information
Medscape iPhone app provides drug dose information

If the Medscape model for presenting drug dose information is legitimate in Apple’s eyes (as opposed to a violation that just hasn’t been noticed yet), it would be possible to retool my app to provide a creatinine clearance calculator followed by the specific dosing information for each drug. This is not as slick as having the answer just pop up in a dialog box, but on the other hand does show exactly what the dosing criteria are and removes the computer from the decision making process. However if I go that route there is no way to save one of my favorite parts of the app, the warfarin dose calculator. It is an implementation of an algorithm from this paper and provides suggested dosing changes for patients on chronic warfarin based on their INR, INR target, weekly total dose, and tablet size. It suggests how many pills the patient should take each day of the week. Whoever makes generic warfarin is not likely to develop a warfarin dose calculator like this, nor is anyone else.

iOS Simulator Screen Shot Feb 20, 2015, 7.50.40 PMiOS Simulator Screen Shot Feb 20, 2015, 7.50.23 PM

At this point I have requested further information from Apple. Apple has rejected the update to EP Mobile, but they have not requested I withdraw the current version of the program (which still has all the drug calculators in it). Certainly they might do so. In the hopes that their position will change, I have decided to withdraw the update and leave the app as is, unless Apple tells me otherwise. This is not a good long term strategy as I like to update the app frequently to keep it up to date with what is going on in electrophysiology, and I am now blocked from making any updates that don’t remove the drug calculator functionality. If I do release an update that does not contain the drug calculators, I will announce it well ahead of time on Twitter and on this site to give users the option not to update the app. I should also point out that the Android version of the app has not been challenged (Android is very hands off compared with Apple).

I am hoping that Apple will consider this further, based on this section of their App Store Review Guidelines:

This is a living document, and new Apps presenting new questions may result in new rules at any time. Perhaps your App will trigger this.

Who Can Write a Drug Dosage Calculator?

Several years ago I had an idea for a smartphone app that could be used to calculate doses for drugs that are prescribed frequently to patients with heart rhythm problems. These drugs include antiarrhythmics such as dofetilide and sotalol, and the new oral anticoagulants such as dabigatran and rivaroxaban. These drugs are handled by the kidneys, and dosage is dependent on kidney function. The package inserts for these drugs advise the correct drug doses based on the calculated creatinine clearance, a formula that involves the patient’s weight, age, sex and serum creatinine. Once the creatinine clearance is calculated, a lookup table is used to determine the dose. For example, here is the rivaroxaban dosing information:


Medical calculator apps are common and invariably include a creatinine clearance calculator. The problem I had was trying to remember all the different creatinine clearance cutoffs for each dose of each drug. This seemed like perfect job for an app. Just fill in the information needed to calculate the creatinine clearance and have the app figure out the creatinine clearance and look up the dose. Thus my app EP Mobile was born. Over the years I have added many more modules to the app, including everything from algorithms localizing accessory pathways to entrainment mapping, but the original concept was to provide the drug dose calculators which remain a key part of the app.

Or maybe not. I routinely update the app, and submitted an update a week ago to Apple (not related to the drug dose calculators). For the first time ever I received a rejection from Apple. They quoted this from their App Store Submission Guidelines:

22.9 Apps that calculate medicinal dosages must be submitted by the manufacturer of those medications or recognized institutions such as hospitals, insurance companies, and universities

Attached were screenshots of the offending calculators:

A drug dose calculator
A drug dose calculator

I am a physician. Part of my job is to calculate medicinal dosages, as the legalese above terms it. This is not the job of hospitals, insurance companies, or universities. Ultimately I as a physician am legally responsible for calculating correct dosages. Yet somehow physicians are left off the list of those qualified to submit apps that calculate drug dosages. The development of an app that simply does what the drug package insert instructs the physician to do in order to calculate a drug dosage, but in an easier manner, should not be restricted to drug companies, hospitals, insurance companies (insurance companies?) or universities. The few of us physicians who are also app developers are certainly in as good a position as any of these other parties to develop apps like this. The algorithms to calculate these doses are extremely simple.  As my app is open-source, the source code is freely available for anyone to inspect to make sure the calculations are coded properly.

I appealed this decision to Apple and I hope they reconsider. I doubt they will. I see the handiwork of Apple’s legal department here. Don’t trust physicians to figure out what tools are useful on their own. Far better to let them go back to carrying around a bunch of drug company propaganda plastic rulers and let them do those creatinine clearance calculations by hand, using long division. Just like back in the good old days.