private void LoadData()
        {
            DateTime?visit1Date = visRepos.GetVisit1Date(patientID);

            string dateStr = string.Format("{0}  AND  {1}",
                                           VisitDateCalculator.GetVisit2StartDate(visit1Date).ToString("dd-MMM-yyyy"),
                                           VisitDateCalculator.GetVisit2EndDate(visit1Date).ToString("dd-MMM-yyyy"));

            this.lblDates.Text = dateStr;

            this.lblName.Text = patientRepos.GetPatientName(patientID);
        }
        protected void imgSubmit_clicked(object sender, EventArgs e)
        {
            if (isReadonly)
            {
                string url = "~/Portal/Patients.aspx";

                Response.Redirect(url);
            }
            else
            {
                if (Page.IsValid)
                {
                    //SaveData();

                    visRepos.UpdateVisitScreen(1, 1, patientID);

                    visRepos.ChangeActiveVisit(patientID, 1, 2);

                    DateTime?visit1Date = visRepos.GetVisit1Date(patientID);

                    visRepos.UpdateVisitDates(
                        2,
                        patientID,
                        VisitDateCalculator.GetVisit2StartDate(visit1Date),
                        VisitDateCalculator.GetVisit2EndDate(visit1Date)
                        );

                    string url = "~/Portal/Patients.aspx";

                    Response.Redirect(url);
                }
            }
        }
Example #3
0
 public DateTime?GetVisit1Date(int patientID)
 {
     return(visRepos.GetVisit1Date(patientID));
 }
Example #4
0
        protected void customVal_OnServerValidate(object source, ServerValidateEventArgs args)
        {
            float    dummy;
            DateTime dummyDT;

            bool validated = true;

            if (this.isReadonly)
            {
                args.IsValid = true;
                return;
            }


            DateTime?visit1Date = visRepos.GetVisit1Date(this.patientID);

            //float choles = float.Parse(txtTotalCholesterol.Text + "." + txtTotalCholesterol2.Text);
            //float HDL_C = float.Parse(txtHDLC1.Text + "." + this.txtHDLC2.Text);
            ////   float nonHDLC = float.Parse(txtNonHDLC1.Text + "." + txtNonHDLC2.Text);
            //float Triglycerides = float.Parse(txtTriglycerides1.Text + "." + txtTriglycerides2.Text);
            //float glucose = float.Parse(txtFastingPlasmaGlucose1.Text + "." + txtFastingPlasmaGlucose2.Text);

            float choles = float.Parse(txtTotalCholesterol.Text);
            float HDL_C  = float.Parse(txtHDLC1.Text);
            //   float nonHDLC = float.Parse(txtNonHDLC1.Text + "." + txtNonHDLC2.Text);
            float Triglycerides = float.Parse(txtTriglycerides1.Text);
            float glucose       = float.Parse(txtFastingPlasmaGlucose1.Text);


            if (choles < 1 || choles > 10)
            {
                validated          = false;
                lblCholest.Visible = true;
            }

            if (HDL_C < 0.1 || HDL_C > 5)
            {
                validated       = false;
                lblHLDC.Visible = true;
            }

            if (Triglycerides < 0.1 || Triglycerides > 10)
            {
                validated       = false;
                lblTrig.Visible = true;
            }

            if (glucose < 3 || glucose > 12)
            {
                validated          = false;
                lblFasting.Visible = true;
            }


            //DLC
            //string ldl = txtLDL_C1.Text + "." + this.txtLDL_C2.Text;
            string ldl = txtLDL_C1.Text;

            if (!float.TryParse(ldl, out dummy))
            {
                validated       = false;
                imgLDLC.Visible = true;
            }
            else
            {
                var result = float.Parse(ldl);
                if (result <= 2 || result > 10)
                {
                    validated           = false;
                    imgLDLC.Visible     = true;
                    lblLDLValue.Visible = true;
                }
            }


            if (

                !rdoStatinAtorvastatin20.Checked &&
                !rdoStatinAtorvastatin40.Checked &&
                !rdoStatinAtorvastatin80.Checked &&
                !rdoStatinSimvastatin40.Checked &&
                !rdoStatinRosuvastatin10.Checked &&
                !rdoStatinRosuvastatin20.Checked

                )
            {
                validated         = false;
                imgStatin.Visible = true;
            }


            if (

                !rdoMetformin_Metformin.Checked &&
                !rdoMetformin_Glumetza.Checked &&
                !rdoMetformin_Linagliptin.Checked &&
                !rdoMetformin_Saxagliptin.Checked &&
                !rdoMetformin_Sitagliptin.Checked &&
                !rdoMetformin_SitagliptinExt.Checked
                )
            {
                validated             = false;
                imgMetaformin.Visible = true;
            }


            //aic
            //string AIC = txtAIC1.Text + "." + this.txtAIC2.Text;
            string AIC = txtAIC1.Text;

            if (!float.TryParse(AIC, out dummy))
            {
                validated      = false;
                imgAIC.Visible = true;
            }
            else
            {
                var result = float.Parse(AIC);

                if (result <= 7 || result > 8.9)
                {
                    validated      = false;
                    imgAIC.Visible = true;
                    lblAIC.Visible = true;
                }
            }
            //lipd date
            DateTime?MostRecentLipidLabDate = null;

            MostRecentLipidLabDate = Domain.Helper.GetCanadianDate(txtMostRecentLipidLabDate.Text);

            if (MostRecentLipidLabDate > visit1Date || MostRecentLipidLabDate < visit1Date.Value.AddMonths(-6))
            {
                validated = false;
                lblMostRecentLipidLabDate.Visible = true;
                imgMostRecentLipidLabDate.Visible = true;
            }


            DateTime?MostRecentA1CLabDate = null;

            MostRecentA1CLabDate = Domain.Helper.GetCanadianDate(txtRecentA1CLabDate.Text);


            if (MostRecentA1CLabDate > visit1Date || MostRecentA1CLabDate < visit1Date.Value.AddMonths(-6))
            {
                validated             = false;
                lblA1C.Visible        = true;
                imgA1CLabDate.Visible = true;
            }

            //duration of diabetes and patient's age
            PatientRepository patRepos = new PatientRepository();

            int patientAge       = Int32.Parse(patRepos.GetPatientAge(this.patientID));
            int diabetesDuration = Int32.Parse(ddDiabetesDuration.SelectedValue);

            if (diabetesDuration == 31) //more than 30 years
            {
                if (patientAge <= 30)
                {
                    validated = false;
                    this.lblDiabetesDuration.Visible = true;
                }
            }
            else
            if (patientAge < diabetesDuration)
            {
                validated = false;
                this.lblDiabetesDuration.Visible = true;
            }


            if (

                !chk_Antihyperglycemic_Glucosidase.Checked &&
                !chk_Antihyperglycemic_DPP4.Checked &&
                !chk_Antihyperglycemic_GLP1.Checked &&
                !chk_Antihyperglycemic_Insulin.Checked &&
                !chk_Antihyperglycemic_Meglitinide.Checked &&
                !chk_Antihyperglycemic_SGLT2.Checked &&
                !chk_Antihyperglycemic_Sulfonylurea.Checked &&
                !chk_Antihyperglycemic_Thiazolidinedione.Checked &&
                !chk_Antihyperglycemic_None.Checked

                )
            {
                validated = false;
                imgAdditionalAntihyperglycemicTherapy.Visible = true;
            }



            if (

                !chkLipidBileAcidSequestrant.Checked &&
                !chkLipidEzetimibe.Checked &&
                !chkLipidFibrate.Checked &&
                !chkLipidNiacin.Checked &&
                !chkLipidOmega.Checked &&
                !chkLipidNone.Checked

                )
            {
                validated = false;
                imgLipidLoweringTherapy.Visible = true;
            }


            args.IsValid = validated;

            if (!validated)
            {
                Helper.Utility.FocusControlOnPageLoad(this.pnlCustVal.ClientID, this.Page);
            }
        }