Middelhoek.com

ThyroidLab

ThyroidLab is a medical application developed for the analysis and treatment of patients with a thyroid imbalance. Its development was spawned by the Thyroid SPOT project. Unfortunately, the project fell through, but I decided to finish the App anyway as a testbed and showcase. From then on, this project, together with its server-client companions LabServer and ThyroidAnalyzer, followed all the latest trends in Swift development. Recently, the code base made the transition from UIKit to 100% SwiftUI.

Since ThyroidLab is a medical application, which comes with great responsibility, I decided against releasing it to the general public. However, ThyroidLab was accepted by the App Store for the iPhone and is available for evaluation in TestFlight.

The text below is an excerpt from the original product page. Just in case an endocrinologist stumbles on this page...

The most common diseased condition is known as hypothyroidism where the thyroid is only partly functioning, or even not at all. When the diagnosis of hypothyroidism has been established, the common treatment is performed with the use of hormone replacement therapy by means of synthetic thyroid hormone, also known as Levothyroxine or L-T4, available in tablet or liquid form with small tablet doses varying from 25 micro gram (µg) to 300 µg per tablet. Because L-T4 has a very narrow and very individual specified therapeutic effect, the dosages of L-T4 have to be fine-tuned (titrated) to the specific individual's needs. During the process of hypothyroidism treatment, the user can follow the dose effects by means of thyroid function tests (TFT), where a blood sample is taken which is sent to a lab to be analyzed for the level of the free thyroid-hormone FT4 together with the level of the thyroid stimulating hormone TSH. About every 4 to 6 weeks such a function test will be performed during a period of 6 months. This means that the user will have about 5 to 6 TFT results. These results are presented in the form of concentrations [TSH] with the unit mU/L together with the concentration of free thyroxine [FT4] in pmol/L. These values can be entered in ThyroidLab. ThyroidLab will then display the trend of the hormone levels as they change during thyroid function testing.

When at least 4 TFT values are available, with at least one [TSH] > 5 mU/L, ThyroidLab can calculate the belonging characteristic curve of the relationship [FT4]-[TSH]. On that characteristic, ThyroidLab will calculate the point of maximum curvature that represents the target value for the L-T4 user. We have to keep in mind that every hypothyroid person reacts completely differently on a dosage of L-T4. That is where ThyroidLab provides an unparalleled value pointing to the final individual target level of the L-T4 user. At that level, the user will experience the maximum effects of a normal quality of life with this dosage optimization.

ThyroidLab is build for the iPhone.

ThyroidLab lab data screen
ThyroidLab Lab data editor screen
ThyroidLab setpoint screen
ThyroidLab trend screen

Interpretation of the results

Since the lab measurements are very susceptible to the specific condition of the patient at the moment the blood is sampled (preferably between 7.00 and 9.00 h in the morning without having taken thyroid medicine), a certain fraction of the TFT values tends to be incorrect. These values have to be removed from the dataset before reliable target levels can be determined. For this purpose the ThyroidLab App contains a full version of ParX.

The reliability of the calculated target levels grows with the number of TFT results that become available. Before any data is available, or when insufficient reliable data is present, the target levels are set to a generic value: halfway the normal range for adults. When more data becomes available, ThyroidLab will try to determine the target levels from the data. In the early stages of treatment, these initial TFT results may be too close together, or even incorrect, so no reliable answer is possible. This lack of reliability is indicated by either the graying-out of the result, or by showing a low percentage in the Reliability-field. An additional measure of the accuracy of the result is the "±" numbers of the target levels themselves.

There is some confusion in this field over what the units of measurement are for the thyroid hormone levels. ThyroidLab is firmly in the SI camp, so the free T4 level is measured in pmol/L and the TSH level in mU/L. For other unit-systems conversion factors must be used.

Disclaimer

ThyroidLab is targeted at patients who want to monitor their treatment and discuss treatment options with their clinician. It is not intended for use in self-medication, as the indicated target levels are sometimes challenging to interpret correctly, especially in the early phases of treatment, when only a few data points are available. The thyroid hormone target levels that are indicated by ThyroidLab are based solely on the provided lab data and the algorithm employed. Their reliability and diagnostic value is therefore limited by the reliability of the supplied lab data and the applicability of the algorithm. They are only intended to provide guidance to a trained clinician with a thorough understanding of the field of endocrinology. All other uses or interpretations of the results are hereby explicitly discouraged and excluded. We do not accept liability for any loss or damage that may occur from the use of this information.

References

The scientific rationale for the development of ThyroidLab has been published in a series of articles, where the Hypothalamus-Pituitary-Thyroid (HPT) system has been analyzed and the set point theory has been developed. The following publications will provide the mathematical foundations and model validation of the underlying concept of ThyroidLab:

Goede SL, Leow, MK (2013). General error analysis in the relationship between free thyroxine and thyrotropin and its clinical relevance. Compute. Math Methods Med. DOI

Goede SL, Leow MK, Smit JWA, Dietrich JW (2014). A novel minimal mathematical model of the hypothalamus–pituitary–thyroid axis validated for individualized clinical applications. Mathematical Biosciences 249 (2014) 1-7. DOI

Goede SL, Leow MK, Smit JWA, Klein HH, Dietrich JW (2014). Hypothalamus-Pituitary-Thyroid Feedback Control: Implications of Mathematical Modeling and Consequences for Thyrotropin (TSH) and Free Thyroxine (FT4) Reference Ranges. Bulletin of Mathematical Biology. DOI

Leow MK, Goede SL (2014). The homeostatic set point of the hypothalamus-pituitary-thyroid axis - maximum curvature theory for personalized euthyroid targets. Theoretical Biology and Medical modelling 11:3. DOI

Goede SL, Leow MK (2016). Letter to the Editor: The Ultimate Proof of the Log-linear Nature of TSH-Free T4 Relationship by Intraindividual Analysis of a Large Population. DOI

Goede SL, Latham KR, Leow MK, Jonklaas J (2017). High resolution free triiodothyronine thyrotropin (FT3 - TSH) responses to a single dose of liothyronine in humans: evidence of distinct inter-individual differences unraveled using an electrical network model. Journal of Biological Systems, Vol. 25, No. 1 (2017) 119–143. DOI

Goede SL, de Galan BE, Leow MK (2017). Personalized glucose-insulin model based on signal analysis. Journal of Theoretical Biology 419 (2017) 333-342. DOI