Introspective is an iOS app that is focused on both mental and physical health. It is a new way to explore your health data. It allows you to write custom (easy-to-understand) queries against your data and create custom graphs that can show the relationship between different pieces of your health data. Self-tracking, as it is sometimes called, has a lot of potential value to offer. This tool helps you harness that value. It is available to download for free on the App Store at https://apps.apple.com/us/app/introspective/id1521706312
My goal is to change the way medicine is practiced by adapting experimental design to the individual. The problem with many studies is the shallowness of their analysis, which is necessitated in real world population statistics because of the lack of controllability and the chaotic complexity of the human body. The lack of controllability is born out of the fact that it is very difficult to get patients to be consistent with each other and thus to accurately determine the exact causes of symptoms, which side effects of a medication are real, etc. in a given population. The failure of this type of analysis is that it tries to apply too broadly and generalize too much. This type of analysis indeed has tremendous value and has been used to a large degree of success for many things in at least the past century. However, we cannot possibly control for everything in the real world across patients. Everybody’s life is different and nobody is going to have the same requirements and it could be unethical to force somebody to only receive one treatment for something at a time, depending on their situation. It is, however, easy to get a patient to be consistent with themself, thus simultaneously addressing this problem of controllability and, to a lesser extent, the issue of the chaotic complexity of the human body. This partially solves for the complexity of the human body only because it removes a number of variables that vary more when comparing across individuals. There is, however, still the issue of changes within an individual (their metabolism, etc.) over time to be dealt with and since we don’t compare to other people, we have to replace the control group (e.g. what would have happened if the variable wasn’t changed) with something else. This is where there is an opportunity to borrow from economics. The idea of a proxy (similar to a heuristic in AI) can be used to do pseudo-controlled experiments with an individual patient. By focusing on a single individual, we eliminate the burden of medical knowledge to always generalize to other people’s situations. The most important part (and a vital piece) about this method, though, is education of people on how to properly use it. It also allows the use of data to quantify on an individual level less conventional methods that may be less expensive. Further benefit can be derived in the form of preventative measures. For example, monitoring mood journals for suicidal ideation or bipolar disorder. For psychiatry in particular, this could also allow the doctor to spend more time with each patient by providing them with a sort of dashboard for checkup appointments based on a patient’s diagnoses instead of them having to spend 5-10 mins asking each ongoing patient every time how they’ve been feeling over the past x months, etc (Importantly, this data would never have to leave the user’s mobile device as they can just bring it with them to show the doctor instead of transmitting the data, eliminating almost all privacy concerns from a technical level as far as compliance with HIPAA). This data can also allow be used for “augmented” introspection for an individual with lower than average emotional intelligence (perhaps one with ASD like myself) by automatically looking for trends in their mood across activities / days of the week, etc. and prompting them with questions of why they think the found correlations might be, as well as other appropriate questions. This would prep the patient to be thinking about things in between appointments. Not only would this be a better patient outcome, allowing them to have more independence and be better able to communicate their needs, but it would also reduce the amount of financial burden on insurance companies and the time burden on medical staff by increasing the efficiency of time spent by a therapist / counselor, allowing for both a reduction in the amount of time they need to spend with the patient and faster outcomes. The value of these and other preventative measures based on the tracked data is compounded even more when you consider the current shortage of doctors in the US and other countries.
There are many things to consider when choosing a recording method. For most people, your phone is going to be your new best friend. For those of you wanting to use a more analog approach, this section won’t be useful. If you’re still reading, you’ll want to find an app for recording (even if it’s just a spreadsheet in Numbers / Excel). The priorities I’ve fleshed out for choosing an app, their order and justifications for them are listed below.
Explore your data in a unique way by querying for exactly the records in which you're interested. Specify complex conditions on any attribute for any supported data type by combining them using "and", "or", and condition groups (full boolean algebra support with grouping). Even better, you can limit your query further by looking at other data types within the query. For example, you can find all moods that were recorded within a half hour of socializing.
Use custom queries to specify exactly which data points you want to graph. The following graphs are available:
Use queries to find trends between two different types of data (i.e. how your heart rate affects your mood). Show multiple values (i.e. avg mood, min mood) over time in the same graph. Specify how to group data into a single value for each point (i.e. avg mood per hour).
Introspection integrates with a number of data types from the Apple Health app, allowing you to query against them. For a full list of supported data types, see the list below.
The following data types are supported (with more to come, guaranteed):
? = optional field
ln -s ../../scripts/pre-commit .
There are 5 main build targets in this project:
There are 3 different types of tests in this project:
Any time you need to run a FunctionalTest class that requires Health App integration on a new simulator, you will first need to:
All FunctionalTest classes should now run properly on the target simulator.
This project uses SwiftyMocky for mocking. This is why you will sometimes find
//sourcery: AutoMockable on some protocols. As part of the build process,
rake mock is ran in a Run Script Build Phase. Running
rake mock in the root project directory will search for and regenerate any mockable protocols (marked with the previously mentioned comment) and any custom mocks that are in the CustomMocks directory as defined by the Rakefile and the SwiftyMocky config generation script.
Currently, this project uses a public Trello board, though this may be migrated to something else in the future. Feel free to take a look.
From the very beginning of this project, I decided that privacy and security were the number one priorities. As such, any and all of your data NEVER leaves your phone (unless you export it). Don't believe me? Look at the source code yourself.