Complying with medical prescriptions

Patients are not very good at adhering to their medical prescriptions. Here’s how a little cloud computing and mobile technology can help.

The medical community refers to Adherence as the degree to which a patient correctly follows medical advice, for example completing a prescription to treat an acute cough.   Not surprisingly, patients are not very good at adhering to their  prescriptions, there are many reasons why.

Figure 1: Medical prescription calendar entry

In some cases, information technologies can help improve adherence.  In this post, I use Microsoft Azure’s Logic Apps service   to automatically convert my family’s medical prescriptions into timely calendar  entries that popup as reminders on my iPhone. 

First, a brief summary for new visitors. A few years ago I started tracking key aspects of my family’s day-to-day well-being.  You can browse the full list of variables I am tracking here.  I use this data to conduct casual exploration and N-of-1 experimentation to address issues and opportunities affecting my family’s growth, health and happiness.

How did I do it? 

Self-tracking allows me to digitally record all medications prescribed to my family.  This information includes the medication’s name, its ATC code, administration route (e.g. transdermal),  as well as the dosage duration, interval and frequency (e.g. every 8 hours for three days.)   My goal was to turn a prescription’s dosage schedule into one or more calendar events – automatically.   This would provide timely notifications throughout the prescription period.

Microsoft’s Logic Apps Service, promises to automate workflows without requiring a single line of code.  I was also looking for a solution that was quick and easy to maintain and Logic Apps was pretty much exactly what I was looking for.

Figure 2: Microsoft Azure Logic App to convert medical prescriptions into mobile phone reminders

Logic App includes connectors for the underlying database where my self-tracking data is hosted, as well as the Google Calendar I use to manage daily events.   Logic Apps made it very easy to express the workflow required to turn a prescription’s dosage schedule into events in my Google Calendar.


Bouncing back from stress

Day-to-day demands and pressures sometimes get the best of us.  Whether reacting to new assignments, unplanned issues at work, or juggling after school activities for the kids, sometimes it feels these demands accumulate to a point that exceeds our ability to handle them.  If we begin to worry at this stage, stress sets in, making it more difficult to regain the focus to move forward in the best way possible.

In every waking hour we are being triggered by demands, in the form of people, events, and circumstances that have the potential to change us.[2] Sometimes the demands accumulate towards a tipping point, other times it takes just one to set the ‘worry’ chain in action.  Although we cannot control the influx of these demands in our lives, we can improve how to respond to them.

Over the past three years, I have been tracking occasional periods of stress in my life.  I am learning more and more about what triggers them and how best to cope.

My goal is to strengthen resilience and minimize or completely eliminate this occasional stress.   This n-of-1 experiment tests the effectiveness of my resilience-boosting activities in reaching this goal.

Figure 1: Days with stress 2016 – 2018

stress, resilience,  n-of-1, quantified-self

Pressure –  a “demand to perform.” The demand might be intense, but there is no stress inherent in it, and as we’ll see, the key to resilience is not to turn pressure into stress.[1]

Resilience – the ability to negotiate the rapids of life without becoming stressed.[1]

Reflection – the process of thinking over a problem to arrive at a solution.  What is missing from reflection is catastrophizing.[1]

Rumination – worry or the constant churning over what-ifs and if-onlys. Its what causes stress.[1]

Stress – pressure + rumination.[1]

How did I do it?
My self-tracking experiments are powered by ostlog – an open-source Personal Well-being Library. Since 2013, I have been using ostlog to track a broad set of variables covering spiritual, social, physical, emotional, intellectual, financial and environmental aspects of my family’s well-being. I use this data to conduct casual n-of-1 experiments such as this one.

The first step is to quantify just how much stress (see glossary) I was experiencing over the past couple of years. Figure 2 shows the number of days (per month since 2016) where I experienced stress. The chart confirms a downward trend I suspected, with peaks of six days in March and October 2016 and down to a total of three days during the first four months of 2018.

Figure 2: Stress days 2016 – 2018

The chart also confirms a general improvement in navigating the planned and unplanned demands of day-to-day life without becoming stressed by them.

What did I learn?
A few years ago I read Marshal Goldsmith‘s “Triggers: Sparking Positive Change and Making it Last”.[2] The book gave me a better understanding of positive change, motivation and difference between active and passive improvement practices.

Throughout my adult life, i’ve known and preached the mind and body benefits of regular exercise. With the arrival of our first daughter in 2010/2011, my exercise routine went dormant until the following year (see figure 3.) This general pattern repeated itself in the subsequent years, as we welcomed new additions and responsibilities in the growing family.

Figure 3: Yearly exercises

I exercise in order to stay balanced, healthy and strong.  These benefits are hard to come by when when inconsistency creeps into my exercise routine. As Goldsmith points out, “inconsistency is fatal for change.” In my case, my exercising remained pretty inconsistent until mid 2017.

The same can be said for learning opportunities.  Here I am referring to reading and writing I do during leisure time (see figure 4.)   Whether reading a great book or writing a blog post like this one,  learning provides some benefits similar to those associated with consistent exercise.   Curiously, figure 4 shows an increase in learning opportunities that is similar to my exercises during the same time period.

Figure 4: Yearly learning opportunities

In their book, “Work Without Stress: Building a Resilient Mindset”,  Derek Roger and Nick Petrie emphasize the concept of resilience, and its role in helping individuals avoid stress.   Resilience, they say, is a skill that can be acquired by training and practice.[1]

In my case, I believe consistent learning and exercise are two ways that build and strengthen my resilience.  This experiment is really about using data to prove this.

Just to recap what I have shown thus far.  Figure 1 and 2 show a decrease in stress since 2016.   Figure 3 and 4 instead show an increase in exercise and learning during the same period.   Are the two linked?  Can the combination of consistent learning and exercise make me more resilient to stress? Will more of both help me reach my goal?

So now I need data to support the belief that exercise and learning help me become more resilient.  The data in figure 5 shows a correlation between stress (y axis) and resilience building activities (i.e. exercise + learning) aggregated monthly during the period of interest.    The results are not conclusive (p-value was quite large), and more data points are needed to definitively prove this.  I am also not accounting for the many other other factors, including nutrition, family time, sleep quality, social activities and more, that help strengthen our resilience and avoid stress.

Figure 5: Correlating stress (y-axis) with resilience building activities (exercise and learning on x-axis)

Check back for future updates as I collect more data points to test whether exercise + learning strengthen my resilience enough to help minimize or eliminate occasional stress.

[1] Work Without Stress: Building a Resilient Mindset (link)
[2] Triggers: Sparking Positive Change and Making it Last (link)

DIY Growth Charts

Today I’ll discuss do-it-yourself charts I use to track growth for my daughters.

First, a brief summary for new visitors. A few years ago I started tracking key aspects of my family’s day-to-day well-being.[1] You can browse the full list of variables I am tracking here.  I use this data to conduct casual exploration and N-of-1 experimentation to address issues and opportunities affecting my family’s growth, health and happiness.

I use Microsoft’s excellent PowerBI data visualization tool to mine through the data and create visualizations that make sense to me and my family.

For example, see these growth charts comparing height and weight for my three daughters to CDC growth standards (see figure 1 and 2.)

figure 1: comparing daughter’s weight to CDC Growth Chart averages

Visual Design

I’ve added a few elements to make these charts easier to understand. First, I needed to plot the CDC Growth Chart averages as a reference point. These datasets contain the percentile averages for height, weight and other growth variables, for each month of growth, across a diverse sample of the population. In his data visualization book, Now You See It, Stephen Few talks about the role of pre-attentive attributes in preparing the user’s focus during the visualization. For these growth charts, I used color and shape (dotted lines) to highlight the range of percentile groupings and gently ‘push’ them to the background. In plotting the actual values for my daughters’ height and weight, I emphasized this line (solid red), allowing it to ‘call’ for our attention while also comparing values to the CDC averages. PowerBI supports the features to configure pre-attentive attributes this way. In addition, it allows me to easily create, publish and access these charts from the web, on my mobile phone and in a secure way.

figure 2: comparing daughters height to CDC Growth Chart averages

And this is quite helpful when providing context in general discussions with our pediatrician.

[1] My self-tracking projects are powered by ostlog – an open-source Personal Well-being Library

Personal vs. Household Analytics

A few years ago I started tracking key aspects of my family’s day-to-day well-being. You can browse the full list of variables I am tracking here.  I use this data to conduct casual exploration and N-of-1 experimentation to address issues and opportunities affecting my family’s growth, health and happiness.

The variables I collect represent the individual members of my family. For example, how many workouts did I do to the past month, or what is the average sleep duration for my daughter during Winter months. When reporting through dashboards and indicators, the variables are aggregated in time and space but the unit of reporting remains the individual.

% of weeks in 2018 where family attended Sunday Mass

Recently I began experimenting with household-level reporting — the family as a single unit of reporting. For example, how many times did family attend Sunday Mass in the current year, or how many sick days did we experience last winter.

Aggregating by family this way made me realize a few things. First, there is a whole world of household well-being indicators waiting to be explored. Here I am not only referring to household well-being as an aggregation of the individual level. Rather, well-being indicators that only make sense at the household level. Second, reporting on well-being this way raises interesting new questions regarding the role of family in helping improve the well-being of its members.

Tracking sleep and meal duration

It’s been a while since my last post.  Here are some new things I’ve been doing and reading during this time.  There’s a lot to talk about!

On the data collection and analysis side of things, I started tracking new variables including mood, energy levels, sleep/meal duration and quality, continuous-learning activities, ongoing projects, and Church attendance.[1] This data joins twenty-three other aspects of my family’s well-being that I’ve been tracking since 2013.  Together the data is giving me a holistic view of our growth, health and happiness across the six dimensions of well-being I care about — Spiritual, Social, Intellectual, Physical, Financial and Environment.

For example, I now have indicators tracking my family’s sleep duration goals over the course of the year (see figure 1.)

figure 1 – tracking percentage of sleep lasting 7 hours for adults and 9 hours for kids over the course of the year

A separate indicator allows me to track time we spend at the dinner table.  The indicator was inspired by OECD and their chart showing the time spent eating & drinking each day across countries (see figure 2.) It also supports my belief in quality time together at the dinner table.

figure 2 – OECD Time spent eating and drinking

The indicator tracks the percentage of dinners lasting at least 40 minutes, with a goal of at least 80% each  year.

figure 3 – Percentage of family dinners lasting at least 40 minutes

These are just a few examples.   I am tracking fifteen more indicators and dozens of time-series charts across the six dimensions of well-being I mentioned earlier.  I am also working on a new experiment in the area of stress, anxiety and resilience. I hope to cover this and other aspects of family-tracking in the coming months – stay tuned!

Regarding general news and trends in the area of personal health tracking, digital well-being, personal informatics or, more generally the quantified self, it definitely feels that we are in the midst of a bubble of great promise and hype.  Three general observations I have during this period are:

  • The digital divide is real.  The market for digital well-being / personal health tracking will continue to be constrained by inadequate data skills in citizen scientists.
  • Collection fatigue is also real.  This applies to the commercial wearables industry.  In my opinion, these companies are only stressing out their customers; weighing them down with low-value data collection tasks.  Without a clear path to transform raw data into truly useful and actionable insights, customers will continue to be underwhelmed and dissapointed.
  • This creates a big opportunity to provide users with actionable well-being insights without overburdening them with data collection, or the need to acquire sophisticated data science skills to make sense of the data.

[1] My self-tracking projects are powered by ostlog – an open-source Personal Well-being Library.

“Alexa, how much do we pay the…”

A few months ago I wrote about the possibilities of integrating my family’s self-tracking data with smart home assistants, like the Amazon Alexa powered Echo Dot. One of my near-term self-tracking goals is to give members of my family the possibility of also deriving value from this data, and the Echo Dot represents one way to achieve this.


First, a brief overview for those of you new to this blog. A few years ago I started tracking key aspects of my family’s day-to-day well-being including symptoms, medicines taken, doctor’s visits, activity, vitals, finances and more. I use this data to conduct casual exploration and N-of-1 experimentation to address issues and opportunities affecting my family’s well-being—a process I refer to as Family Data Science.

My self-tracking projects are powered by ostlog – an open-source Personal Well-being Library.  ostlog works great for my needs, but not so much for my wife, who prefers simpler access to the information.  Today I rely on Microsoft PowerBI, generic SQL tools and other software for collecting and managing this data.   The Amazon Echo Dot opens the possibility of providing  natural language interface to query the same data.

We  own a single Echo Dot that sits on our piano in the living room. The kids use it to ask Alexa to play their favorite songs from their favorite films (e.g. “Alexa, play Trolls on Spotify”.). My wife uses it to stream her favorite radio station from Argentina (i.e. “Alexa, play radio maria”.)   As for me, the first step was to create a custom Alexa skill that responds to requests for well-being insights, queried directly from my self-tracking database.

Thanks to Amazon and Microsoft’s cloud serverless services (i.e. Lambda, Azure Functions), accomplishing this turned out to be a piece of cake.  This was the first Alexa request implemented:

Alexa, start ostlog

Alexa, how much do we need to pay the baby sitter this week?

With this new Alexa skill, my wife now has a hands-free way to access the self-tracking data, no special software required.   And with this personal finances related request, we no longer have to fumble through devices and software applications in order to retrieve this data (while the sitter waits patiently at the end of a long day and week!)

Imagining the Possibilities

Imagine starting your morning with your smart home assistant gently informing you to take it a little easier over the coming days. It suggests this because it detected an emerging acute cough and reminds you that during this same period of seasonal change over the past five years, you have tended towards multiple days with coughing and or bronchitis. Imagine how in the busyness of everyday, this small nugget of timely information helps you adjust and avert a more serious bronchitis, for example.

Looking ahead a few years, imagine smart sensors spread throughout the home, maybe embedded in the walls. These sensors casually record observations regarding your family’s growth, health and happpiness. They observe coughs and colds, stress or excitement, and other aspects you control. You do this because the data collected by these sensors feeds analytical processes to deliver highly personalized and timely well-being insights.

Recent advances in cloud computing, machine learning and the emerging discipline of Data Science are enabling these unprecedented opportunities, and allowing us to rethink how we nurture, encourage and care for the members of our family.  

Rethinking Seasonal Allergies

A few years ago I started tracking key aspects of my family’s day-to-day well-being including symptoms, medicines taken, doctor’s visits, activity, vitals and more.  I use this data to conduct casual exploration and N-of-1 experimentation to address issues and opportunities affecting my family’s well-being—a process I refer to as Family Data Science.

I was curious what this data would reveal about my ongoing struggles with seasonal allergies.  Since my early twenties, I suffered mild to severe chronic seasonal allergies. Symptoms typically begin in February in the form of mild itchiness and continue through March, April and May in the form of nasal congestion, fatigue, sleepiness, sinus pressure, dry mouth, sore throat, loose stools and more. I manage to hang on in good years, waiting for Spring to fully blossom and symptoms to slowly subside. In bad years, I require visits to the doctor’s office for sinus infection or similar respiratory ailments. Equally frustrating is the feeling of having wasted Spring’s most beautiful months battling seasonal allergies.

My aim with this project was to uncover insights that will help me adjust and better cope with seasonal allergies in the years ahead.

How did I do it?
My self-tracking projects are powered by ostlog – an open-source Personal Well-being Library.   For this project, I used ostlog to record daily symptoms and medicines to a single integrated database as illustrated in Figure 1 below.


Figure 1: Self-tracking with ostlog

The first step was to quantify the impact seasonal allergies were having on my health and well-being.   A quick analysis of my 2016 data revealed a distinct spike in allergy-related symptoms [1] during the month of April (see Figure 2).

Note that for this project I excluded seasonal allergies resulting from the onset of Autumn (i.e. October and November).


Figure 2: Monthly allergy symptoms 2016

The data confirmed what I have known for a long time—Spring allergies were at their worst during peak pollen months such as April.  What I didn’t realize however, was the exact nature of this impact.  Which of the various types of allergy symptoms was I suffering from the most?

To my surprise, digestive symptoms occurred almost as much as  respiratory symptoms in April 2016 (see Figure 3.) Before starting this project, I never directly associated digestive symptoms with seasonal allergies.

Figure 3: 2016 monthly allergy symptoms and anti-histamine usage

Based on these findings, I structured this project around the following three questions:

  1. What if any link existed between seasonal allergies and digestive symptoms?
  2. How could I reduce allergy-related respiratory symptoms?
  3. How could I improve antihistamines usage through Spring? (i.e. minimize use and their side-effects but maximizing temporary relief)

What Did I Learn?

I did some research on the link between seasonal allergies and digestion and found this interesting article by the Capital Research Vitality Center:

An estimated 80 percent of the immune system resides in the gut, and when digestive problems set in, immune problems are sure to follow. A chronically inflamed gut—which causes indigestion, heartburn, bloating, pain, diarrhea, constipation, irritable bowel disorders, and more—sends the immune system into overdrive.

As a result, the body becomes hypersensitive and overreacts to stuff it shouldn’t, including pollen, grass, and other triggers associated with spring.

Because allergy symptoms frequently start with poor digestive function, the gut is a great place to start for relief.

I saw this approach in addressing gut health as a potential natural remedy for my chronic seasonal allergy symptoms.

So I started 2017 by eating significantly more anti-inflammatory foods including clementines, broccoli, and spinach.  I also eliminated the occasional glass of wine or beer to avoid the irritative effects of alcohol on the intestinal lining.

The next step was to find new ways to reduce respiratory symptoms. Here my research revealed a potential negative impact caused by excess mucus on the both respiratory and digestive systems.  During the worse months of allergy seasons, I tend to get congested, with mucus buildup making it difficult to breathe freely.  To reduce the mucus buildup, I adopted a very simple idea.  My wife and I regularly utilized saline nasal sprays on our daughters to help keep their respiratory pathways mucus free during winter cold and flu season.   I wondered if these same nasal sprays would help limit mucus buildup during allergy season. So as part of this project, I also performed two saline rinses a day through March/April/May 2017.

Regarding antihistamine usage (see Figure 3), the curious fact is how I refrained from taking any during the peak pollen month in April 2016.   In general I wanted to minimize or avoid their use when possible (especially their side-effects), but I also wanted to be more selective for those days when I really needed  the additional relief.    I changed my approach through the Spring 2017 by limiting doses to just one pill at the first sign of worsening allergy symptoms, or on those days when I knew I would spend the better part of the day outdoors.

To summarize, based on my research I tested the following hypotheses:

  1. By improving gut health, I would have a more effective method and natural remedy to reduce the effects of seasonal allergies.
  2. By keeping my respiratory pathways mucus free with the use of saline nasal rinses, I could improve respiration throughout Spring allergy season with possible benefits to digestive system too.
  3. By relying less on antihistamines as a primary remedy, but better timing their use when additional relief was absolutely necessary, I could further reduce the effects of seasonal allergies while minimizing the drug’s side-effects.

The Results

The results have been pleasantly surprising.   With the exception of a stomach virus suffered in March (most likely unrelated to seasonal allergies but accounted for in Figure 4), I’ve gone through the peak pollen months of Spring 2017 with a noticeable improvement in my ability to cope with allergies. (see Figure 4 and 5).

Figure 4: Comparing seasonal allergy symptoms in 2016/2017

Regarding the saline nasal rinses, of the three types of allergy-related symptoms that affect me the most (i.e. skin irritations, respiratory, digestive) the biggest improvement (see Figure 6) was the reduction in respiratory symptoms, which I assume is a direct result of these nasal rinses.  Bottom line, I was finally able to take in and smell the Spring air more days than not in 2017!

Regarding antihistamine usage, I took single doses at the first sign of worsening symptoms. Limiting their use also implied limiting their side-effects, which can be as frustrating as the allergy symptoms themselves.

Figure 5: 2017 Allergy symptoms and antihistamine usage
Respiratory symptoms 2016/2017

The results are positive yet more tests are needed in the coming years to confirm the effectiveness of this approach.  In general I feel very hopeful to have found what amounts to an effective natural remedy to better cope with Spring allergies.

[1] Symptoms are recorded and specially marked the first day they are observed.  Subsequent observations of the original symptom are not counted twice provided the original continues to persist at least once in any 7-day period starting from the date of the first observation, otherwise the symptom is recorded as a new occurrence.