Corrected QT Interval (QTc)

Corrects the QT interval for abnormally high heart rates

Description
Corrects the QT interval for abnormally high heart rates
Academic References
Fridericia LS. The duration of systole in an electrocardiogram in normal humans and in patients with heart disease. 1920. Ann Noninvasive Electrocardiol. 2003;8(4):343-351. doi:10.1046/j.1542-474x.2003.08413.x
See: https://www.ncbi.nlm.nih.gov/pubmed/14516292
Hodges MS, Salerno D, Erlinen D. Bazett's QT correction reviewed: evidence that a linear QT correction for heart rate is better. J Am Coll Cardiol. 1983;1:694.
See: https://www.jacc.org/doi/epdf/10.1016/S0735-1097%2883%2980095-3
Sagie A, Larson MG, Goldberg RJ, Bengtson JR, Levy D. An improved method for adjusting the QT interval for heart rate (the Framingham Heart Study). Am J Cardiol. 1992;70(7):797-801. doi:10.1016/0002-9149(92)90562-d
See: https://www.ncbi.nlm.nih.gov/pubmed/1519533
Bazett HC. An analysis of the time-relations of ecltrocardiograms. Heart 1920
See: https://onlinelibrary.wiley.com/doi/abs/10.1111/j.1542-474X.1997.tb00325.x
Rautaharju PM, Mason JW, Akiyama T. New age- and sex-specific criteria for QT prolongation based on rate correction formulas that minimize bias at the upper normal limits [published correction appears in Int J Cardiol. 2015 Jan 15;178:299]. Int J Cardiol. 2014;174(3):535-540. doi:10.1016/j.ijcard.2014.04.133
See: https://www.ncbi.nlm.nih.gov/pubmed/24825030
Code Version Id
9fcc184c-0c93-492f-b5b1-e54bc9aab047
// Copyright (C) 2023 Calcarta
module Calcarta.Calculation.``Corrected_qt_interval_(qtc)``.Code
open Calcarta.CodeResource.Standard

type Formula =
    | Bazett = 0
    | Fridericia = 1
    | Framingham = 2
    | Hodges = 3
    | Rautaharju = 4

type Patient = {
    [<Description("See details section for references to original papers")>]
    Formula : Formula

    [<Name("QT Interval")>]
    [<Description("Time from start of Q wave to the end of the T wave")>]
    [<Unit("ms")>]
    QtInterval : float

    [<Name("Heart Rate")>]
    [<Unit("Beats per minute")>]
    HeartRate : float
}

[<Name("Corrected QT Interval (QTc)", AppliesTo = Argument.Output)>]
[<Unit("ms", AppliesTo = Argument.Output)>]
let ``corrected_qt_interval_(qtc)`` (patient : Patient) = 
    let rrInterval = 60.0 / patient.HeartRate
    match patient.Formula with
    | Formula.Bazett -> patient.QtInterval / (rrInterval ** 0.5)
    | Formula.Fridericia -> patient.QtInterval / (rrInterval ** (1.0/3.0))
    | Formula.Framingham -> patient.QtInterval + 154.0 * (1.0 - rrInterval)
    | Formula.Hodges -> patient.QtInterval + 1.75 * ((60.0 / rrInterval) - 60.0)
    | Formula.Rautaharju -> patient.QtInterval * (120.0 + patient.HeartRate) / 180.0