var PWRiolData = ["N/A",35,34,33,32,31,30,29.5,29,28.5,28,27.5,27,26.5,26,25.5,25,24.5,24,23.5,23,22.5,22,21.5,21,20.5,20,19.5,19,18.5,18,17.5,17,16.5,16,15.5,15,14.5,14,13.5,13,12.5,12,11.5,11,10.5,10,9.5,9,8.5,8,7.5,7,6.5,6,5.5,5,4.5,4,3.5,3,2.5,2,1.5,1,0.5,0,-1,-2,-3,-4,-5,-6,-7,-8,-9,-10]; var CYLiolData = ["N/A",1,1.5,2.25,3,3.75,4.5,5.25,6,6.75,7.5,8.25,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]; var questions = [ "Is it a glaukoma patient?", "Is it a wet AMD?", "Is the posterior chamber IOL positioned in the sulcus of the eye? ", "Was a keratoplasty performed before?", "Is the pseudophakic anterior chamber depth < 3.0 mm?"]; var warnings = { check_anam:["At least one question was confirmed.
An online AddOn calculation is not recommended. Please get in touch with 1stQ directly.

If you nevertheless want to proceed with the calculation please click 'OK'.", "", ""], check_value:["Please enter values between {0} and {1}!", "", ""], check_sph2:["Data were entered that are out of standard range ({0} - {1} D).
An online AddOn calculation is not recommended. Please get in touch with 1stQ directly.

If you nevertheless want to proceed with the calculation please click 'OK'.", "-20.0", "20.0"], check_cyl_plus:["Please consider to enter the cylindervalue in minus- or plusnotation respectively. ", "20.0", "0.0"], check_cyl_minus:["Please consider to enter the cylindervalue in minus- or plusnotation respectively. ", "0", "-20"], check_cyl:["Data were entered that are out of standard range ({0} - {1} D).
An online AddOn calculation is not recommended. Please get in touch with 1stQ directly.

If you nevertheless want to proceed with the calculation please click 'OK'.", "-20.0", "20.0"], check_altb:["Axial length is out of tolerance range ({0} - {1} mm).
An online AddOn calculation is not recommended. Please get in touch with 1stQ directly.

If you nevertheless want to proceed with the calculation please click 'OK.'", "15.0", "40.0"], check_acdtb:["Anterior chamber depth is out of tolerance range ({0} - {1} mm).
An online AddOn calculation is not recommended. Please get in touch with 1stQ directly.

If you nevertheless want to proceed with the calculation please click 'OK.'", "1.5", "8.0"], check_kxmm:["The corneal radius {2} is outside of tolerance ({0} - {1} mm).
An online AddOn calculation is not recommended. Please get in touch with 1stQ directly.

If you nevertheless want to proceed with the calculation please click 'OK'.", "6.75", "9.75"], check_kxtb:["The corneal radius {2} is outside of tolerance ({0} - {1} mm).
An online AddOn calculation is not recommended. Please get in touch with 1stQ directly.

If you nevertheless want to proceed with the calculation please click 'OK'.", "30.0", "65.0"], check_cdvaval:["The increase of visual acuity with refraction is less than {0}.
An online AddOn calculation is not recommended. Please get in touch with 1stQ directly.

If you nevertheless want to proceed with the calculation please click 'OK'.", "0.2", ""], check_srdate:["Subjective refraction was performed more than one month ago, please check.", "", ""], check_psbdate:["Biometry measurement was performed more than one month ago, please check.", "", ""], check_ioldate:["We recommend to wait at least 2 months after cataract surgery in order that measuring data are stable. ", "", ""], check_srdate_fut:["Subjective refraction is in the future, please check.", "", ""], check_psbdate_fut:["Biometry measurement is in the future, please check.", "", ""], check_ioldate_fut:["Cataract surgery is in the future, please check. ", "", ""], confirm_plus_not:["You have entered the refraction in plus-notation. Is that correct?", "", ""], confirm_minus_not:["You have entered the refraction in minus-notation. Is that correct?", "", ""], check_valid_date:["{0} is not a valid date.", "", ""] }; var state_data = { check_subj_biom:{algm:true,ask:true,subj:true,biom:true,impl:false,oldst:false,msg:"check_subj_biom",value:10,min:0,max:0,show_dialog:false,text:"Attention: the axis of subjective refraction differs {0}° from biometry!",condition:function(data) {if (data["CYL2"] == "" || data["CYL2"] == 0 ) return false; if (data["K1mm"] == data["K2mm"]) return false; var staSubj = data["AX2"]; var staBiom = data["K1mm"] < data["K2mm"] ? data["axisK1"] : data["axisK2"]; if (staSubj == 0 && staBiom > 90) staSubj = 180; var dif = Math.abs(staSubj - staBiom); if (dif > 90) dif = Math.abs(dif - 180); this.params[0] = dif; return dif > this.value;}}, axis_zero:{algm:true,ask:true,subj:false,biom:true,impl:false,oldst:false,msg:"axis_zero",value:0,min:0,max:0,show_dialog:false,text:"Axis K1 and K2 must not be 0!",condition:function(data) {return data["axis_zero"] == "true";}}, avail_error:{algm:true,ask:true,subj:true,biom:false,impl:false,oldst:false,msg:"avail_error",value:0,min:0,max:0,show_dialog:false,text:"The power of the required AddOn IOL is incombatible to the standard range. An online AddOn calculation is not recommended. Please get in touch with 1stQ directly.",condition:function(data) {return data["avail_error"] == "out";}}, toric_lens_sel:{algm:true,ask:true,subj:true,biom:false,impl:false,oldst:false,msg:"toric_lens_sel",value:0,min:0,max:0,show_dialog:false,text:"The recommended AddOn implantation axis is based on subjective refraction. ",condition:function(data) {return data["lens"] == "toric_addon";}}, iol_misalign_subj:{algm:true,ask:true,subj:true,biom:false,impl:true,oldst:false,msg:"iol_misalign_subj",value:0,min:0,max:0,show_dialog:false,text:"The alignment of the implanted toric IOL differs significantly from the steep implantation axis.",condition:function(data) {if (data["CYL2"] == 0 || data["CYL2"] == "") return false; var isToric = data["radio_impl"] == "toric" || data["radio_impl"] == "toricmf"; return isToric && data["iol_misalign_subj"] == "plausible";}}, iol_misalign_biom:{algm:true,ask:true,subj:true,biom:false,impl:true,oldst:false,msg:"iol_misalign_biom",value:0,min:0,max:0,show_dialog:false,text:"The alignment of the implanted toric IOL differs significantly from the steep corneal meridian.",condition:function(data) {var isToric = data["radio_impl"] == "toric" || data["radio_impl"] == "toricmf"; return isToric && data["iol_misalign_biom"] == "plausible";}}, acd_depth_shallow:{algm:true,ask:true,subj:true,biom:false,impl:false,oldst:false,msg:"acd_depth_shallow",value:0,min:0,max:0,show_dialog:false,text:"The postoperative ACD measured is too shallow for an AddOn IOL. The implantation of the calculated AddOn IOL is a contraindication.",condition:function(data) {return data["acd_depth"] == "shallow" && data["ACDtb"] != "";}}, rest_ref_dif:{algm:true,ask:true,subj:false,biom:true,impl:true,oldst:false,msg:"rest_ref_dif",value:0,min:-1,max:0.75,show_dialog:false,text:"The SEQ of the theoretical residual refraction differs significantly from the actual refraction. ",condition:function(data) {return data["dif_seq"] < this.min || data["dif_seq"] > this.max;}}, rest_cyl_dif:{algm:true,ask:true,subj:false,biom:true,impl:true,oldst:false,msg:"rest_cyl_dif",value:0,min:-0.75,max:0.75,show_dialog:false,text:"The theoretical residual cylinder differs significantly from the actual cylinder of refraction. ",condition:function(data) {return data["dif_zyl"] < this.min || data["dif_zyl"] > this.max;}}, visus_not_filled:{algm:true,ask:true,subj:true,biom:false,impl:false,oldst:false,msg:"visus_not_filled",value:0,min:0,max:0,show_dialog:false,text:"Data of visual acuity not complete. ",condition:function(data) {return data["CDVAval"] == "" || data["UDVAval"] == "";}}, fill_srdate:{algm:true,ask:true,subj:true,biom:false,impl:false,oldst:false,msg:"fill_srdate",value:0,min:0,max:0,show_dialog:false,text:"Please enter date of examination.",condition:function(data) {return data["sr_date"] == "";}}, subj_ref_not_filled:{algm:true,ask:true,subj:false,biom:false,impl:false,oldst:false,msg:"subj_ref_not_filled",value:0,min:0,max:0,show_dialog:false,text:"Data of subjective refraction not complete. Calculation not possible!",condition:function(data) {return data["CB_SubRef"] == "false";}}, psbdate_not_filled:{algm:true,ask:true,subj:false,biom:true,impl:false,oldst:false,msg:"psbdate_not_filled",value:0,min:0,max:0,show_dialog:false,text:"Please enter date of measurement. ",condition:function(data) {return data["psb_date"] == "";}}, biom_not_filled:{algm:true,ask:true,subj:false,biom:false,impl:false,oldst:false,msg:"biom_not_filled",value:0,min:0,max:0,show_dialog:false,text:"Biometry data incomplete.",condition:function(data) {return data["CB_Biom"] == "false";}}, ioldate_not_filled:{algm:true,ask:true,subj:false,biom:false,impl:true,oldst:false,msg:"ioldate_not_filled",value:0,min:0,max:0,show_dialog:false,text:"Please enter date of implantation. ",condition:function(data) {return data["iol_date"] == "";}}, impl_not_filled:{algm:true,ask:true,subj:false,biom:false,impl:false,oldst:false,msg:"impl_not_filled",value:0,min:0,max:0,show_dialog:false,text:"Data of IOL implanted not complete.",condition:function(data) {return data["CB_Impl"] == "false" && data["eye_state"] == "pseudo";}}, visus_rest_ref:{algm:true,ask:true,subj:true,biom:false,impl:false,oldst:false,msg:"visus_rest_ref",value:0.2,min:0,max:0,show_dialog:false,text:"Increase of visual acuity with refraction is less than {0}.",condition:function(data) {if (data["UDVAval"] == "" || data["CDVAval"] == "") return false; this.params[0] = this.value; return data["CDVAval"] - data["UDVAval"] < this.value;}}, visus_low:{algm:true,ask:true,subj:true,biom:false,impl:false,oldst:false,msg:"visus_low",value:0.7,min:0,max:0,show_dialog:false,text:"Visus cc is less than {0} - progressive AddOn not recommended.",condition:function(data) {if (data["CDVAval"] == "" || data["UDVAval"] == "") return false; this.params[0] = this.value; return data["CDVAval"] < this.value;}}, srdate_check:{algm:true,ask:true,subj:false,biom:false,impl:false,oldst:false,msg:"srdate_check",value:-32,min:0,max:0,show_dialog:false,text:"Subjektive refraktion was performed more than 1 month ago. ",condition:function(data) {return daysFromToday(data["sr_date"]) < this.value;}}, psbdate_check:{algm:true,ask:true,subj:false,biom:false,impl:false,oldst:false,msg:"psbdate_check",value:-32,min:0,max:0,show_dialog:false,text:"Biometry was perfomred more than 1 month ago. ",condition:function(data) {return daysFromToday(data["psb_date"]) < this.value;}}, ioldate_check:{algm:true,ask:true,subj:false,biom:false,impl:false,oldst:false,msg:"ioldate_check",value:-2,min:0,max:0,show_dialog:false,text:"Cataract surgery was performed less than 2 months ago. ",condition:function(data) {return daysFromToday(data["iol_date"]) > 31 * this.value && data["eye_state"] == "pseudo";}}, allgm_not_filled:{algm:false,ask:false,subj:false,biom:false,impl:false,oldst:false,msg:"allgm_not_filled",value:0,min:0,max:0,show_dialog:false,text:"Please enter general data.",condition:function(data) {return data["CB_Allgm"] == "false";}}, anam_not_filled:{algm:true,ask:false,subj:false,biom:false,impl:false,oldst:false,msg:"anam_not_filled",value:0,min:0,max:0,show_dialog:false,text:"Please enter data of medical history",condition:function(data) {return data["CB_Ask"] == "false";}}, srdate_check_fut:{algm:true,ask:true,subj:false,biom:false,impl:false,oldst:false,msg:"srdate_check_fut",value:0,min:0,max:0,show_dialog:false,text:"Subjektive refraktion is in the future.",condition:function(data) {return daysFromToday(data["sr_date"]) > 0;}}, psbdate_check_fut:{algm:true,ask:true,subj:false,biom:false,impl:false,oldst:false,msg:"psbdate_check_fut",value:0,min:0,max:0,show_dialog:false,text:"Biometry is in the future.",condition:function(data) {return daysFromToday(data["psb_date"]) > 0;}}, ioldate_check_fut:{algm:true,ask:true,subj:false,biom:false,impl:false,oldst:false,msg:"ioldate_check_fut",value:0,min:0,max:0,show_dialog:false,text:"Cataract surgery is in the future.",condition:function(data) {return daysFromToday(data["iol_date"]) > 0 && data["eye_state"] == "pseudo";}}, cy_dif_biom:{algm:true,ask:true,subj:false,biom:false,impl:false,oldst:false,msg:"cy_dif_biom",value:1,min:0,max:0,show_dialog:false,text:"Achtung: Der bestehende Hornhautastigmathismus spiegelt sich nicht in der Biometrie wieder",condition:function(data) {if (data["K1tb"] != data["K2tb"]) return false; if (data["K1tb"] == "" || data["K2tb"] == "") return false; var abw = Math.abs(data["CYL2"] - Math.abs(data["K1tb"] - data["K2tb"])); return abw > this.value; }}, cyl_dif_subref:{algm:true,ask:true,subj:false,biom:false,impl:false,oldst:false,msg:"cyl_dif_subref",value:1,min:0,max:0,show_dialog:false,text:"Achtung: Der bestehende Hornhautastigmatismus spiegelt sich nicht in der subjektiven Refraktion wieder.",condition:function(data) {if (data["CYL2"] != 0 && data["CYL2"] != "") return false; if (data["radio_impl"] != "") return false; var abw = Math.abs(data["CYL2"] - Math.abs(data["K1tb"] - data["K2tb"])); return abw > this.value;}}, anam_not_ok:{algm:true,ask:true,subj:false,biom:false,impl:false,oldst:false,msg:"anam_not_ok",value:0,min:0,max:0,show_dialog:false,text:"At least one question was confirmed. An online AddOn calculation is not recommended. Please get in touch with 1stQ directly.",condition:function(data) {return data["anam_ok"] == "false";}}, phak_status:{algm:true,ask:false,subj:false,biom:false,impl:false,oldst:false,msg:"phak_status",value:0,min:0,max:0,show_dialog:true,text:"Please note that you have selected the eye status \"phakic\". In this case an AddOn IOL implantation is possible only through the simultaneous implantation of a capsular bag IOL.",condition:function(data) {return data["eye_state"] == "phak";}}, ueb_kor:{algm:true,ask:true,subj:false,biom:false,impl:false,oldst:false,msg:"ueb_kor",value:0,min:0,max:0,show_dialog:true,text:"Attention cylinder over correction!",condition:function(data) {return data["ueb_kor"] == "ueb_kor";}}, rest_ref_tor_prog:{algm:true,ask:true,subj:false,biom:false,impl:false,oldst:false,msg:"rest_ref_tor_prog",value:0,min:-0.3,max:0.3,show_dialog:true,text:"Attention, no emmetropia",condition:function(data) {return (data["reseq"] < this.min || data["reseq"] > this.max) && data["lens"] == "toric_progr_addon";}} }; var lens_recommanded = "Recommended"; var lens_not_recommanded = "Not recommended"; var lens_not_allowed = "Not allowed";