(function () { var e; (e = { result: 0, cr: 0, age: 0, race: 0, gender: 0, stage: 0, validate: function () { var e; return ( (e = !1), $("#egfr_calc .error_explanation").removeClass("pulse"), (this.cr = $("#egfr_calc #creatinine").val()), this.cr != null && this.cr.length > 0 ? $("#egfr_calc #creatinine-g").removeClass("error") : ($("#egfr_calc #creatinine-g").addClass("error"), (e = !0)), (this.age = $("#egfr_calc #age").val()), this.age != null && this.age.length > 0 && !(this.age < 18 || this.age > 70) ? $("#egfr_calc #age-g").removeClass("error") : ((e = !0), $("#egfr_calc #age-g").addClass("error")), (this.race = $("#egfr_calc input[name=race]:checked").val()), this.race != null ? $("#egfr_calc #race-g").removeClass("error") : ($("#egfr_calc #race-g").addClass("error"), (e = !0)), (this.gender = $("#egfr_calc input[name=gender]:checked").val()), this.gender != null ? $("#egfr_calc #gender-g").removeClass("error") : ($("#egfr_calc #gender-g").addClass("error"), (e = !0)), e ? $("#egfr_calc .error-explanation").addClass("animated pulse").removeClass("hide") : $("#egfr_calc .error-explanation").addClass("hide"), !e ); }, calcResult: function () { var e, t, n, r, i; (t = 175), (e = Math.round(this.cr * 100) / 100), e < 0.01 && (e = 0.01), (this.result = Math.round(t * Math.pow(e, -1.154) * Math.pow(this.age, -0.203) * this.race * this.gender)); if (this.result >= 90) return (this.stage = 1); if (60 <= (n = this.result) && n < 90) return (this.stage = 2); if (30 <= (r = this.result) && r < 60) return (this.stage = 3); if (15 <= (i = this.result) && i < 30) return (this.stage = 4); if (this.result < 15) return (this.stage = 5); }, displayResult: function () { var e; return ( (e = '
eGFR value: ' + this.result + " mL/min/1.73 m2
"), this.result >= 60 ? (e += "This result is an estimate. eGFR is most accurate when kidney disease is advanced. More tests are needed to get an accurate result when the eGFR level is greater than 60.
") : (e += "This result suggests stage " + this.stage + " CKD.
"), $("#egfr_calc .calculator_results .vcenter").html(e) ); }, calcGFR: function (t) { t.preventDefault(); if (e.validate()) return e.calcResult(), e.displayResult(), ekidney.calc.showResult("#egfr_calc"); }, init: function () { return ( $("#egfr_calc .calculate_btn").click(e.calcGFR), $("#egfr_calc form").on("submit", e.calcGFR), $("#egfr_calc .calculate_again").click(function () { return ekidney.calc.reset("#egfr_calc"); }) ); }, }), (window.ekidney.egfr = e), $(function () { return window.ekidney.egfr.init(); }); }.call(this));