Example #1
0
 public int try1()
 {
     try
     {
         dtReferenceDoctor = dc.getData("GetPatientDoctor", dictionary);
         int a = int.Parse(dtReferenceDoctor.Rows[0][0].ToString());
         return(a);
     }
     catch
     {
         int a = 0;
         return(a);
     }
 }
        private void PatientAssesment_Load(object sender, EventArgs e)
        {
            
            DatabaseConnector dc = new DatabaseConnector();
            dictionary = createGetPatientDictionary(PatientAssesmentPatientId);
            dtPatient = dc.getData("GetPatient", dictionary);
            label11.Text = dtPatient.Rows[0][0].ToString();

            String regDate = dtPatient.Rows[0][1].ToString();
            DateTime dte1 = Convert.ToDateTime(regDate);
            label13.Text = dte1.Year.ToString() + "-" + dte1.Month + "-" + dte1.Day;
           
            label5.Text = dtPatient.Rows[0][2].ToString();
            label4.Text = dtPatient.Rows[0][3].ToString();

            String dob = dtPatient.Rows[0][4].ToString();
            DateTime dte2 = Convert.ToDateTime(dob);
            label8.Text = dte2.Year.ToString() + "-" + dte2.Month + "-" + dte2.Day;

            label9.Text = dtPatient.Rows[0][5].ToString();
            textBox1.Enabled = false;
            txt_cheifcomplaint.Enabled = false;

           this.getPatientEMRDatesTableAdapter.Fill(dataSetGetEMRDatesIntoComboBox.GetPatientEMRDates, patid);
        }
        private void PatientAssesment_Load(object sender, EventArgs e)
        {
            DatabaseConnector dc = new DatabaseConnector();

            dictionary   = createGetPatientDictionary(PatientAssesmentPatientId);
            dtPatient    = dc.getData("GetPatient", dictionary);
            label11.Text = dtPatient.Rows[0][0].ToString();

            String   regDate = dtPatient.Rows[0][1].ToString();
            DateTime dte1    = Convert.ToDateTime(regDate);

            label13.Text = dte1.Year.ToString() + "-" + dte1.Month + "-" + dte1.Day;

            label5.Text = dtPatient.Rows[0][2].ToString();
            label4.Text = dtPatient.Rows[0][3].ToString();

            String   dob  = dtPatient.Rows[0][4].ToString();
            DateTime dte2 = Convert.ToDateTime(dob);

            label8.Text = dte2.Year.ToString() + "-" + dte2.Month + "-" + dte2.Day;

            label9.Text                = dtPatient.Rows[0][5].ToString();
            textBox1.Enabled           = false;
            txt_cheifcomplaint.Enabled = false;

            this.getPatientEMRDatesTableAdapter.Fill(dataSetGetEMRDatesIntoComboBox.GetPatientEMRDates, patid);
        }
        public DataTable getPatientEMRAccordingToDate(Dictionary <String, String> dict, DatabaseConnector conn)
        {
            DataTable dataTable;

            dataTable = conn.getData("GetPatientEMRAccordingToDate", dict);
            return(dataTable);
        }
Example #5
0
        public void getEmployees()
        {
            Dictionary <String, String> param = new Dictionary <string, string>();
            DatabaseConnector           dconn = new DatabaseConnector();

            EmployeeTable = dconn.getData("getEmployees", param);
        }
        private void CreateDemForm_Load(object sender, EventArgs e)
        {
            dictionary = new Dictionary <string, string>();
            dictionary.Add("@patientId", patientId.ToString());

            dc                = new DatabaseConnector();
            dtPatient         = dc.getData("GetPatient", dictionary);
            dtPatientEmail    = dc.getData("GetPatientEmail", dictionary);
            dtPatientAddress  = dc.getData("GetPatientAddress", dictionary);
            dtPatientPhone    = dc.getData("GetPatientPhone", dictionary);
            dtReferenceDoctor = dc.getData("GetPatientDoctor", dictionary);
            dtAllergy         = dc.getData("GetAllery", dictionary);
            dtPatientAddress  = dc.getData("GetPatientAddress", dictionary);
            dtInsurance       = dc.getData("GetPatientOHIPInsurance", dictionary);

            txtLname.Text = dtPatient.Rows[0][2].ToString();
            txtFname.Text = dtPatient.Rows[0][3].ToString();
            string   sourceDateTex = dtPatient.Rows[0][4].ToString();
            DateTime dt            = Convert.ToDateTime(sourceDateTex);

            sourceDateTex  = dt.Year.ToString() + "/" + dt.Month + "/" + dt.Day;
            patDob.Text    = sourceDateTex;
            cmbGender.Text = dtPatient.Rows[0][5].ToString();

            txtRefDoctor.Text   = dtReferenceDoctor.Rows[0][0].ToString();
            txtBillingCode.Text = dtReferenceDoctor.Rows[0][1].ToString();

            txtAlergyName.Text     = dtAllergy.Rows[0][1].ToString();
            txtAlergyCategory.Text = dtAllergy.Rows[0][2].ToString();

            txtInsNum.Text     = dtInsurance.Rows[0][2].ToString();
            txtInsVersion.Text = dtInsurance.Rows[0][3].ToString();

            string   sourceDateText = dtInsurance.Rows[0][4].ToString();
            DateTime dte            = Convert.ToDateTime(sourceDateText);

            sourceDateText  = dte.Year.ToString() + "/" + dte.Month + "/" + dte.Day;
            txtExpDate.Text = sourceDateText;


            cmbAddType.Text    = dtPatientAddress.Rows[0][2].ToString();
            txtAdd.Text        = dtPatientAddress.Rows[0][3].ToString();
            txtCity.Text       = dtPatientAddress.Rows[0][4].ToString();
            txtProvince.Text   = dtPatientAddress.Rows[0][5].ToString();
            txtPostalCode.Text = dtPatientAddress.Rows[0][6].ToString();
            txtCountry.Text    = dtPatientAddress.Rows[0][7].ToString();

            txtPhone.Text     = dtPatientPhone.Rows[0][3].ToString();
            cmbPhoneType.Text = dtPatientPhone.Rows[0][2].ToString();



            txtEmail.Text     = dtPatientEmail.Rows[0][3].ToString();
            cmbEmailType.Text = dtPatientEmail.Rows[0][2].ToString();
        }
        private void getAllDoctors(String Date) {
            Dictionary<String, String> param = new Dictionary<string, string>();
            param.Add("date", Date);
            DatabaseConnector dconn = new DatabaseConnector();
            doctors = dconn.getData("getAllDoctor2", param);

            cmbDoctor.DataSource = doctors;
            cmbDoctor.DisplayMember = "doctorName";
            cmbDoctor.ValueMember = "doctorID";
        }
Example #8
0
        public void editEmployee(String employeeID, String UserName, String Password, String Role, String FirstName, String LastName, String Gender)
        {
            // more error checking needed
            if (String.IsNullOrEmpty(employeeID))
            {
                throw new System.ArgumentNullException("employeeID");
            }
            else if (String.IsNullOrEmpty(UserName))
            {
                throw new System.ArgumentNullException("User Name");
            }
            else if (String.IsNullOrEmpty(Password))
            {
                throw new System.ArgumentNullException("Password");
            }
            if (String.IsNullOrEmpty(Role))
            {
                throw new System.ArgumentNullException("Role");
            }
            else if (String.IsNullOrEmpty(FirstName))
            {
                throw new System.ArgumentNullException("First Name");
            }
            else if (String.IsNullOrEmpty(FirstName))
            {
                throw new System.ArgumentNullException("Last Name");
            }
            else
            {
                Dictionary <String, String> param = new Dictionary <string, string>();
                param.Add("employeeID", employeeID);
                param.Add("userName", UserName);
                param.Add("role", Role);
                param.Add("firstName", FirstName);
                param.Add("lastName", LastName);
                param.Add("gender", Gender);

                DatabaseConnector dconn   = new DatabaseConnector();
                DataTable         results = dconn.getData("editEmployee", param);

                if (!String.IsNullOrEmpty(Password))
                {
                    Password = Encrypt.MD5(Password);

                    param = new Dictionary <string, string>();
                    param.Add("employeeID", employeeID);
                    param.Add("password", Password);

                    dconn   = new DatabaseConnector();
                    results = dconn.getData("editEmployeePassword", param);
                }
            }
        }
 public void addToSchedule(String ScheduleID, String DoctorID, String DoctorName, String Date, String PatientID, String LastName, String FirstName)
 {
     Dictionary<String, String> param = new Dictionary<string, string>();
     param.Add("scheduleID", ScheduleID);
     param.Add("doctorID", DoctorID);
     param.Add("doctorName", DoctorName);
     param.Add("date", Date);
     param.Add("patientID", PatientID);
     param.Add("lastName", LastName);
     param.Add("firstName", FirstName);
     DatabaseConnector dconn = new DatabaseConnector();
     DataTable result = dconn.getData("addToSchedule", param);
 }
Example #10
0
        private void getAllDoctors(String Date)
        {
            Dictionary <String, String> param = new Dictionary <string, string>();

            param.Add("date", Date);
            DatabaseConnector dconn = new DatabaseConnector();

            doctors = dconn.getData("getAllDoctor2", param);

            cmbDoctor.DataSource    = doctors;
            cmbDoctor.DisplayMember = "doctorName";
            cmbDoctor.ValueMember   = "doctorID";
        }
Example #11
0
        private void btn_Save_Click(object sender, EventArgs e)
        {
            Dictionary <String, String> dict = new Dictionary <string, string>();

            dict.Add("@patientID", patId.ToString());

            DatabaseConnector dc = new DatabaseConnector();

            DataTable dtPatient = dc.getData("try1", dict);

            docID = int.Parse(dtPatient.Rows[0][0].ToString());

            String myDiag = comboBox1.Text;



            Dictionary <String, String> dic = new Dictionary <string, string>();

            dic.Add("@diagnosisId", myDiag);
            dic.Add("@patId", patId.ToString());


            //string fromFormat = "yyyy/mm/dd";


            //DateTime newDate = DateTime.ParseExact(System.DateTime.Today.ToShortDateString(), fromFormat, null);
            ;
            string[] formats = { "MM/dd/yyyy" };
            DateTime parsedDateTime;

            DateTime.TryParseExact(System.DateTime.Today.ToShortDateString(), formats, new CultureInfo("en-US"),
                                   DateTimeStyles.None, out parsedDateTime);
            dic.Add("@myTodays", "2012/12/12");
            dic.Add("@docId", docID.ToString());


            dc.getData("SaveEMRDaignosis", dic);
        }
Example #12
0
        public void addToSchedule(String ScheduleID, String DoctorID, String DoctorName, String Date, String PatientID, String LastName, String FirstName)
        {
            Dictionary <String, String> param = new Dictionary <string, string>();

            param.Add("scheduleID", ScheduleID);
            param.Add("doctorID", DoctorID);
            param.Add("doctorName", DoctorName);
            param.Add("date", Date);
            param.Add("patientID", PatientID);
            param.Add("lastName", LastName);
            param.Add("firstName", FirstName);
            DatabaseConnector dconn  = new DatabaseConnector();
            DataTable         result = dconn.getData("addToSchedule", param);
        }
Example #13
0
 public void deleteEmployee(String employeeID)
 {
     if (String.IsNullOrEmpty(employeeID))
     {
         throw new System.ArgumentNullException("employeeID");
     }
     else
     {
         Dictionary <String, String> param = new Dictionary <string, string>();
         param.Add("employeeID", employeeID);
         DatabaseConnector dconn   = new DatabaseConnector();
         DataTable         results = dconn.getData("deleteEmployee", param);
     }
 }
        private void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                dc = new DatabaseConnector();
                DateTime d = DateTime.Today;
                dic = new Dictionary <string, string>();
                dic.Add("@patientId", patId.ToString());
                dtDoctor = dc.getData("try1", dic);
                docId    = int.Parse(dtDoctor.Rows[0][0].ToString());

                dictionary = new Dictionary <string, string>();
                dictionary.Add("@patientId", patId.ToString());
                dictionary.Add("@doctorId", docId.ToString());
                dictionary.Add("@timestamp", d.ToShortDateString());// if you need date time please convert d.ToString()
                //d.ToShortDateString()
                //dictionary.Add("@patientId", patientId.ToString());
                dictionary.Add("@blooppressure", txt_Bp.Text);
                dictionary.Add("@respiratoryrate", txt_Rr.Text);
                dictionary.Add("@pulserate ", txt_Pr.Text);
                dictionary.Add("@temperature", txt_temp.Text);
                dictionary.Add("@height", txt_Height.Text);
                dictionary.Add("@weight", txt_Weight.Text);
                dictionary.Add("@painscale", txt_PainScale.Text);
                dictionary.Add("@clinicalimpression", txt_Clinical.Text);
                dictionary.Add("@chiefcomplaint", txt_cheifcomplaint.Text);
                dc.getData("EnterAssesment", dictionary);


                MessageBox.Show("Record Saved Successfully");
            }
            catch
            {
                MessageBox.Show("Failed to save record please check if the patient is already been assessed");
            }
        }
Example #15
0
        public Dictionary<String, String> getEmployee(String employeeID)
        {
            Dictionary<String, String> param = new Dictionary<string, string>();
            param.Add("employeeID", employeeID);
            DatabaseConnector dconn = new DatabaseConnector();
            DataTable results = dconn.getData("getEmployeeByID", param);

            Dictionary<String, String> r = new Dictionary<string, string>();
            r.Add("userName", results.Rows[0]["userName"].ToString());
            r.Add("role", results.Rows[0]["role"].ToString());
            r.Add("firstName", results.Rows[0]["firstName"].ToString());
            r.Add("lastName", results.Rows[0]["lastName"].ToString());
            r.Add("gender", results.Rows[0]["gender"].ToString());
            return r;
        }
Example #16
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            String myDiag = comboBox1.Text;
            Dictionary <String, String> dic = new Dictionary <string, string>();

            dic.Add("@myDaignosisName", myDiag);

            DatabaseConnector dc = new DatabaseConnector();

            DataTable dtPatient = dc.getData("GetDaignosisDescription", dic);

            if (dtPatient.Rows.Count > 0)
            {
                txt_DiagnosisDescription.Text = dtPatient.Rows[0][0].ToString();
            }
        }
Example #17
0
 private int getDoctorIdfromDoctorTbl1()
 {
     try
     {
         dictionary = new Dictionary <string, string>();
         dictionary.Add("@billingCode", txtDoctorBillingCode.Text);
         dc       = new DatabaseConnector();
         dtDoctor = dc.getData("GetDoctorID1", dictionary);
         int doctorID = int.Parse(dtDoctor.Rows[0][0].ToString());
         return(doctorID);
     }
     catch
     {
         int doctorID = 0;
         return(doctorID);
     }
 }
Example #18
0
 private int getAllergyIdfromAllergyTbl1()
 {
     try
     {
         dictionary = new Dictionary <string, string>();
         dictionary.Add("@allergyName", txtAllergyName.Text);
         dc        = new DatabaseConnector();
         dtAllergy = dc.getData("GetAllergyID1", dictionary);
         int allergyID = int.Parse(dtAllergy.Rows[0][0].ToString());
         return(allergyID);
     }
     catch
     {
         int allergyID = 0;
         return(allergyID);
     }
 }
Example #19
0
        public Dictionary <String, String> getEmployee(String employeeID)
        {
            Dictionary <String, String> param = new Dictionary <string, string>();

            param.Add("employeeID", employeeID);
            DatabaseConnector dconn   = new DatabaseConnector();
            DataTable         results = dconn.getData("getEmployeeByID", param);

            Dictionary <String, String> r = new Dictionary <string, string>();

            r.Add("userName", results.Rows[0]["userName"].ToString());
            r.Add("role", results.Rows[0]["role"].ToString());
            r.Add("firstName", results.Rows[0]["firstName"].ToString());
            r.Add("lastName", results.Rows[0]["lastName"].ToString());
            r.Add("gender", results.Rows[0]["gender"].ToString());
            return(r);
        }
Example #20
0
        public void addEmployee(String UserName, String Password, String HireDate, String Role, String FirstName, String LastName, String DateOfBirth, String Gender)
        {
            // error checking needed
            if (String.IsNullOrEmpty(UserName))
            {
                throw new System.ArgumentNullException("User Name");
            }
            else if (String.IsNullOrEmpty(Password))
            {
                throw new System.ArgumentNullException("Password");
            }
            if (String.IsNullOrEmpty(Role))
            {
                throw new System.ArgumentNullException("Role");
            }
            else if (String.IsNullOrEmpty(FirstName))
            {
                throw new System.ArgumentNullException("First Name");
            }
            else if (String.IsNullOrEmpty(FirstName))
            {
                throw new System.ArgumentNullException("Last Name");
            }
            else
            {
                Password = Encrypt.MD5(Password);

                Dictionary<String, String> param = new Dictionary<string, string>();
                param.Add("userName", UserName);
                param.Add("password", Password);
                param.Add("hireDate", HireDate);
                param.Add("role", Role);
                param.Add("firstName", FirstName);
                param.Add("lastName", LastName);
                param.Add("dateOfBirth", DateOfBirth);
                param.Add("gender", Gender);

                DatabaseConnector dconn = new DatabaseConnector();
                DataTable results = dconn.getData("addEmployee", param);
            }
        }
Example #21
0
        public void addEmployee(String UserName, String Password, String HireDate, String Role, String FirstName, String LastName, String DateOfBirth, String Gender)
        {
            // error checking needed
            if (String.IsNullOrEmpty(UserName))
            {
                throw new System.ArgumentNullException("User Name");
            }
            else if (String.IsNullOrEmpty(Password))
            {
                throw new System.ArgumentNullException("Password");
            }
            if (String.IsNullOrEmpty(Role))
            {
                throw new System.ArgumentNullException("Role");
            }
            else if (String.IsNullOrEmpty(FirstName))
            {
                throw new System.ArgumentNullException("First Name");
            }
            else if (String.IsNullOrEmpty(FirstName))
            {
                throw new System.ArgumentNullException("Last Name");
            }
            else
            {
                Password = Encrypt.MD5(Password);

                Dictionary <String, String> param = new Dictionary <string, string>();
                param.Add("userName", UserName);
                param.Add("password", Password);
                param.Add("hireDate", HireDate);
                param.Add("role", Role);
                param.Add("firstName", FirstName);
                param.Add("lastName", LastName);
                param.Add("dateOfBirth", DateOfBirth);
                param.Add("gender", Gender);

                DatabaseConnector dconn   = new DatabaseConnector();
                DataTable         results = dconn.getData("addEmployee", param);
            }
        }
Example #22
0
        public void Login(String UserName, String Password)
        {
            if (String.IsNullOrEmpty(UserName))
            {
                throw new System.ArgumentNullException("UserName");
            }
            else if (String.IsNullOrEmpty(Password))
            {
                throw new System.ArgumentNullException("Password");
            }
            else {
                Password = Encrypt.MD5(Password);

                Dictionary<String, String> param = new Dictionary<string,string>();
                param.Add("userName", UserName);
                DatabaseConnector dconn = new DatabaseConnector();
                DataTable result = dconn.getData("getEmployeeByUser", param);

                if (result.Rows.Count == 1)
                {
                    String p = result.Rows[0]["password"].ToString();
                    if (Object.Equals(p, Password))
                    {
                        ID = (int)result.Rows[0]["employeeID"];
                        Role = (int)result.Rows[0]["role"];
                        FirstName = result.Rows[0]["firstName"].ToString();
                        LastName = result.Rows[0]["lastName"].ToString();
                    }
                    else
                    {
                        throw new System.ArgumentException("Passwords do not match.");
                    }
                }
                else
                {
                    throw new System.ArgumentException("UserName does not exist in system.");
                }
            }
        }
        private void btn_update_Click(object sender, EventArgs e)
        {
            String errors = checkErrors(txtFname.Text, txtLname.Text, txtInsNum.Text, txtInsVersion.Text);

            if (errors != null)
            {
                MessageBox.Show(errors);
            }
            else
            {
                dictionary = createUpdatePatientDictionary(patientId.ToString(), txtFname.Text, txtLname.Text, patDob.Text, cmbGender.Text);
                dc.getData("UpdatePatient", dictionary);

                dictionary = createUpdateInsuranceDictionary(patientId.ToString(), txtInsNum.Text, txtInsVersion.Text, txtExpDate.Text);
                dc.getData("UpdateInsurance", dictionary);

                dictionary = createUpdatePatientAllergyDictionary(patientId.ToString(), "0", txtAlergyName.Text, txtAlergyCategory.Text);
                dc.getData("updatePatientAllergy", dictionary);

                dictionary = createUpdatePatientReferalDoctorDictionary(patientId.ToString(), "0", txtRefDoctor.Text, txtBillingCode.Text);
                dc.getData("updatePatientDoctor", dictionary);

                dictionary = createUpdatePatientPhoneDictionary(patientId.ToString(), txtPhone.Text, cmbPhoneType.Text);
                dc.getData("UpdatePatientPhone", dictionary);

                dictionary = createUpdatePatientEmailDictionary(patientId.ToString(), txtEmail.Text, cmbEmailType.Text);
                dc.getData("UpdatePatientEmail", dictionary);

                dictionary = createUpdatePatientAddressDictionary(patientId.ToString(), cmbAddType.Text, txtAdd.Text, txtCity.Text, txtProvince.Text, txtPostalCode.Text, txtCountry.Text);
                dc.getData("UpdatePatientAddress", dictionary);


                MessageBox.Show("Patient Update Successful!!");
                forEdit = false;
                BtnEditDemo.Show();
                enableFields();
                btn_update.Hide();
            }
        }
        private void EnterAssesment_Load(object sender, EventArgs e)
        {
            dc         = new DatabaseConnector();
            dictionary = new Dictionary <string, string>();
            // patId = int.Parse();
            dictionary.Add("@patientId", patId.ToString());
            dtPatient    = dc.getData("GetPatient", dictionary);
            label11.Text = dtPatient.Rows[0][0].ToString();

            String   regDate = dtPatient.Rows[0][1].ToString();
            DateTime dte1    = Convert.ToDateTime(regDate);

            label13.Text = dte1.Year.ToString() + "-" + dte1.Month + "-" + dte1.Day;

            label5.Text = dtPatient.Rows[0][2].ToString();
            label4.Text = dtPatient.Rows[0][3].ToString();

            String   dob  = dtPatient.Rows[0][4].ToString();
            DateTime dte2 = Convert.ToDateTime(dob);

            label8.Text = dte2.Year.ToString() + "-" + dte2.Month + "-" + dte2.Day;

            label9.Text = dtPatient.Rows[0][5].ToString();
        }
Example #25
0
        private int getDoctorIdfromDoctorTbl1()
        {
            try
            {
                dictionary = new Dictionary<string, string>();
                dictionary.Add("@billingCode", txtDoctorBillingCode.Text);
                dc = new DatabaseConnector();
                dtDoctor = dc.getData("GetDoctorID1", dictionary);
                int doctorID = int.Parse(dtDoctor.Rows[0][0].ToString());
                return doctorID;
            }
            catch
            {
                int doctorID = 0;
                return doctorID;

            }
        }
Example #26
0
        public void editEmployee(String employeeID, String UserName, String Password, String Role, String FirstName, String LastName, String Gender)
        {
            // more error checking needed
            if (String.IsNullOrEmpty(employeeID))
            {
                throw new System.ArgumentNullException("employeeID");
            }
            else if (String.IsNullOrEmpty(UserName))
            {
                throw new System.ArgumentNullException("User Name");
            }
            else if (String.IsNullOrEmpty(Password))
            {
                throw new System.ArgumentNullException("Password");
            }
            if (String.IsNullOrEmpty(Role))
            {
                throw new System.ArgumentNullException("Role");
            }
            else if (String.IsNullOrEmpty(FirstName))
            {
                throw new System.ArgumentNullException("First Name");
            }
            else if (String.IsNullOrEmpty(FirstName))
            {
                throw new System.ArgumentNullException("Last Name");
            }
            else
            {
                Dictionary<String, String> param = new Dictionary<string, string>();
                param.Add("employeeID", employeeID);
                param.Add("userName", UserName);
                param.Add("role", Role);
                param.Add("firstName", FirstName);
                param.Add("lastName", LastName);
                param.Add("gender", Gender);

                DatabaseConnector dconn = new DatabaseConnector();
                DataTable results = dconn.getData("editEmployee", param);

                if (!String.IsNullOrEmpty(Password))
                {
                    Password = Encrypt.MD5(Password);

                    param = new Dictionary<string, string>();
                    param.Add("employeeID", employeeID);
                    param.Add("password", Password);

                    dconn = new DatabaseConnector();
                    results = dconn.getData("editEmployeePassword", param);
                }
            }
        }
Example #27
0
 public void getEmployees()
 {
     Dictionary<String, String> param = new Dictionary<string,string>();
     DatabaseConnector dconn = new DatabaseConnector();
     EmployeeTable = dconn.getData("getEmployees", param);
 }
Example #28
0
 public void deleteEmployee(String employeeID)
 {
     if (String.IsNullOrEmpty(employeeID))
     {
         throw new System.ArgumentNullException("employeeID");
     }
     else
     {
         Dictionary<String, String> param = new Dictionary<string, string>();
         param.Add("employeeID", employeeID);
         DatabaseConnector dconn = new DatabaseConnector();
         DataTable results = dconn.getData("deleteEmployee", param);
     }
 }
        public DataTable createGetPatient(Dictionary <String, String> dic)
        {
            DataTable dTab = dc.getData("GetPatient", dic);

            return(dTab);
        }
Example #30
0
        private void ViewDemography_Load(object sender, EventArgs e)
        {
            dictionary = createDictionary(patientId.ToString());

            dc = new DatabaseConnector();

            dtPatient         = dc.getData("GetPatient", dictionary);
            dtPatientEmail    = dc.getData("GetPatientEmail", dictionary);
            dtPatientAddress  = dc.getData("GetPatientAddress", dictionary);
            dtPatientPhone    = dc.getData("GetPatientPhone", dictionary);
            dtReferenceDoctor = dc.getData("GetPatientDoctor", dictionary);
            dtAllergy         = dc.getData("GetAllery", dictionary);
            dtInsurance       = dc.getData("GetPatientOHIPInsurance", dictionary);

            lblLastName.Text  = dtPatient.Rows[0][2].ToString();
            lblFirstName.Text = dtPatient.Rows[0][3].ToString();
            string   dob = dtPatient.Rows[0][4].ToString();
            DateTime dt  = Convert.ToDateTime(dob);

            dob               = dt.Year.ToString() + "-" + dt.Month + "-" + dt.Day;
            lblDOB.Text       = dob;
            lblGender.Text    = dtPatient.Rows[0][5].ToString();
            lblPatientID.Text = patientId.ToString();


            if (try1() != 0)
            {
                lblReferralDoctor.Text = dtReferenceDoctor.Rows[0][2].ToString();
                lblBillingCode.Text    = dtReferenceDoctor.Rows[0][1].ToString();
            }

            if (try2() != 0)
            {
                lblAllergyName.Text     = dtAllergy.Rows[0][1].ToString();
                lblAllergyCategory.Text = dtAllergy.Rows[0][2].ToString();
            }

            lblInsNo.Text = dtInsurance.Rows[0][2].ToString() + " " + dtInsurance.Rows[0][3].ToString();

            string   date = dtInsurance.Rows[0][4].ToString();
            DateTime edt  = Convert.ToDateTime(date);

            date            = edt.Year.ToString() + "-" + edt.Month + "-" + edt.Day;
            lblExpDate.Text = date;

            if (try3() != 0)
            {
                lblAddressType.Text = dtPatientAddress.Rows[0][2].ToString();
                lblAddress.Text     = dtPatientAddress.Rows[0][3].ToString();
                lblCity.Text        = dtPatientAddress.Rows[0][4].ToString();
                lblProvince.Text    = dtPatientAddress.Rows[0][5].ToString();
                lblPostalCode.Text  = dtPatientAddress.Rows[0][6].ToString();
            }

            if (try4() != 0)
            {
                lblPhone.Text     = dtPatientPhone.Rows[0][3].ToString();
                lblPhoneType.Text = dtPatientPhone.Rows[0][2].ToString();
            }

            if (try5() != 0)
            {
                lblEmailType.Text = dtPatientEmail.Rows[0][2].ToString();
                lblEmail.Text     = dtPatientEmail.Rows[0][3].ToString();
            }
        }
Example #31
0
        private void btnAddRecord_Click(object sender, EventArgs e)
        {
            bool DOB_valid;
            bool exp_valid;
            bool pass = false;

            //check whether Insurance numer exits
            dictionary = new Dictionary <string, string>();
            dictionary.Add("@insuranceNumber", txtInsuranceNumber.Text);
            dc          = new DatabaseConnector();
            dtInsurance = dc.getData("CheckInsuranceExists", dictionary);
            int ins_exist = int.Parse(dtInsurance.Rows[0][0].ToString());

            //create new patient
            Patient patient = new Patient();

            patient.firstName = txtFirstName.Text;
            patient.lastName  = txtLastName.Text;
            patient.dob       = txtDOB.Text;
            patient.gender    = cmbxGender.GetItemText(cmbxGender.SelectedItem);

            //create new insurance
            Insurance insurance = new Insurance();

            insurance.timestamp   = System.DateTime.Today.ToShortDateString();
            insurance.insNumber   = txtInsuranceNumber.Text;
            insurance.versionCode = txtVersionCode.Text;
            insurance.expDate     = txtInsuranceExpDate.Text;

            //create new allergy
            Allergy allergy = new Allergy();

            allergy.name     = txtAllergyName.Text;
            allergy.category = txtAllergyCatergory.Text;

            //create new allergy-patient
            PatientAllergy ptAllgergy = new PatientAllergy();

            //
            Doctor doctor = new Doctor();

            doctor.billingCode = txtDoctorBillingCode.Text;
            doctor.name        = txtReferralDoctor.Text;

            //
            ReferralDoctor refDoctor = new ReferralDoctor();


            //ins number : number only
            //ins vc : character only
            //no blank: name, dob

            Phone phone = new Phone();

            phone.type        = cmbxPhoneType.GetItemText(cmbxPhoneType.SelectedItem);
            phone.phoneNumber = txtPhoneNumber.Text;

            Email email = new Email();

            email.type  = cmbxEmailType.GetItemText(cmbxEmailType.SelectedItem);
            email.email = txtEmail.Text;

            Address address = new Address();

            address.type       = cmbxAddressType.GetItemText(cmbxAddressType.SelectedItem);
            address.address    = txtAddress.Text;
            address.city       = txtCity.Text;
            address.province   = txtProvince.Text;
            address.postalCode = txtPostalCode.Text;

            DOB_valid = DOB_validation();
            exp_valid = exp_validation();

            if (DOB_valid == true && exp_valid == true && ins_exist == 0 && txtInsuranceNumber.TextLength == 10)
            {
                pass = true;
            }

            if (pass == true)
            {
                insertPatient(patient);

                patient.patientID   = getPtIdfromPatienTbl();
                insurance.patientID = patient.patientID;
                phone.patientID     = patient.patientID;
                email.patientID     = patient.patientID;
                address.patientID   = patient.patientID;


                insertInsurance(insurance);

                if (txtAllergyCatergory.Text != "" && txtAllergyName.Text != "")
                {
                    if (getAllergyIdfromAllergyTbl1() != 0)
                    {
                        ptAllgergy.patientId = patient.patientID;
                        ptAllgergy.allergyId = getAllergyIdfromAllergyTbl1();
                        insertPatientAllergy(ptAllgergy);
                    }
                    else
                    {
                        insertAllergy(allergy);
                        ptAllgergy.patientId = patient.patientID;
                        ptAllgergy.allergyId = getAllergyIdfromAllergyTbl2();
                        insertPatientAllergy(ptAllgergy);
                    }
                }

                if (txtPhoneNumber.Text != "")
                {
                    insertPhone(phone);
                }
                if (txtAddress.Text != "")
                {
                    insertAdress(address);
                }
                if (txtEmail.Text != "")
                {
                    insertEmail(email);
                }

                if (txtReferralDoctor.Text != "")
                {
                    refDoctor.patientID = patient.patientID;
                    refDoctor.doctorID  = getDoctorIdfromDoctorTbl1();
                    insertReferralDoctor(refDoctor);
                }

                /*   if (txtDoctorBillingCode.Text != "" && txtReferralDoctor.Text != "")
                 * {
                 *
                 *     if (getDoctorIdfromDoctorTbl1() != 0)
                 *     {
                 *         refDoctor.patientID = patient.patientID;
                 *         refDoctor.doctorID = getDoctorIdfromDoctorTbl1();
                 *         insertReferralDoctor(refDoctor);
                 *     }
                 *     else
                 *     {
                 *         insertDoctor(doctor);
                 *         refDoctor.patientID = patient.patientID;
                 *         refDoctor.doctorID = getDoctorIdfromDoctorTbl2();
                 *         insertReferralDoctor(refDoctor);
                 *     }
                 * }*/



                clearText();
                MessageBox.Show("Patient was registed");
                DialogResult result = MessageBox.Show("Go to patient demography?", "Patient registed", MessageBoxButtons.OKCancel,
                                                      MessageBoxIcon.Question);

                if (result == DialogResult.OK)
                {
                    this.Hide();
                    ViewDemography viewDemo = new ViewDemography();
                    viewDemo.patientId = patient.patientID;
                    viewDemo.Show();
                }
                else if (result == DialogResult.Cancel)
                {
                    this.Close();
                }
            }

            else if (txtInsuranceNumber.TextLength != 10)   //number incorrect of left blank
            {
                MessageBox.Show("Please insert correct insurance number");
            }
            else if (ins_exist != 0)
            {
                MessageBox.Show("Insurance Number already exists");
            }
            else if (DOB_valid == false)
            {
                MessageBox.Show("D.O.B not valid");
            }

            else if (exp_valid == false)
            {
                MessageBox.Show("Insurance Expiry Date not valid");
            }
        }
Example #32
0
        public DataTable checkPatientExists(Dictionary <String, String> dic)
        {
            DataTable dTab = dc.getData("CheckPatientExists", dic);

            return(dTab);
        }
Example #33
0
        public DataTable createGetDoctorDaySchedule(Dictionary <String, String> dic)
        {
            DataTable dTab = dc.getData("GetDoctorDaySchedule", dic);

            return(dTab);
        }
Example #34
0
        private void ViewDemography_Load(object sender, EventArgs e)
        {
            dictionary = createDictionary(patientId.ToString());

            dc = new DatabaseConnector();

            dtPatient = dc.getData("GetPatient", dictionary);
            dtPatientEmail = dc.getData("GetPatientEmail", dictionary);
            dtPatientAddress = dc.getData("GetPatientAddress", dictionary);
            dtPatientPhone = dc.getData("GetPatientPhone", dictionary);
            dtReferenceDoctor = dc.getData("GetPatientDoctor", dictionary);
            dtAllergy = dc.getData("GetAllery", dictionary);
            dtInsurance = dc.getData("GetPatientOHIPInsurance", dictionary);

            lblLastName.Text = dtPatient.Rows[0][2].ToString();
            lblFirstName.Text = dtPatient.Rows[0][3].ToString();
            string dob = dtPatient.Rows[0][4].ToString();
            DateTime dt = Convert.ToDateTime(dob);
            dob = dt.Year.ToString() + "-" + dt.Month + "-" + dt.Day;
            lblDOB.Text = dob;
            lblGender.Text = dtPatient.Rows[0][5].ToString();
            lblPatientID.Text = patientId.ToString();


            if (try1() != 0)
            {
                lblReferralDoctor.Text = dtReferenceDoctor.Rows[0][2].ToString();
                lblBillingCode.Text = dtReferenceDoctor.Rows[0][1].ToString();
            }

            if (try2() != 0)
            {

                lblAllergyName.Text = dtAllergy.Rows[0][1].ToString();
                lblAllergyCategory.Text = dtAllergy.Rows[0][2].ToString();
            }

            lblInsNo.Text = dtInsurance.Rows[0][2].ToString() + " " + dtInsurance.Rows[0][3].ToString();

            string date = dtInsurance.Rows[0][4].ToString();
            DateTime edt = Convert.ToDateTime(date);
            date = edt.Year.ToString() + "-" + edt.Month + "-" + edt.Day;
            lblExpDate.Text = date;

            if (try3() != 0)
            {
                lblAddressType.Text = dtPatientAddress.Rows[0][2].ToString();
                lblAddress.Text = dtPatientAddress.Rows[0][3].ToString();
                lblCity.Text = dtPatientAddress.Rows[0][4].ToString();
                lblProvince.Text = dtPatientAddress.Rows[0][5].ToString();
                lblPostalCode.Text = dtPatientAddress.Rows[0][6].ToString();
            }

            if (try4() != 0)
            {
                lblPhone.Text = dtPatientPhone.Rows[0][3].ToString();
                lblPhoneType.Text = dtPatientPhone.Rows[0][2].ToString();
            }

            if (try5() != 0)
            {
                lblEmailType.Text = dtPatientEmail.Rows[0][2].ToString();
                lblEmail.Text = dtPatientEmail.Rows[0][3].ToString();
            }

        }
Example #35
0
        private void btnAddRecord_Click(object sender, EventArgs e)
        {
            bool DOB_valid;
            bool exp_valid;
            bool pass=false;

            //check whether Insurance numer exits
            dictionary = new Dictionary<string, string>();
            dictionary.Add("@insuranceNumber", txtInsuranceNumber.Text);
            dc = new DatabaseConnector();
            dtInsurance = dc.getData("CheckInsuranceExists", dictionary);
            int ins_exist = int.Parse(dtInsurance.Rows[0][0].ToString());

            //create new patient
            Patient patient = new Patient();
            patient.firstName = txtFirstName.Text;
            patient.lastName = txtLastName.Text;
            patient.dob = txtDOB.Text;
            patient.gender = cmbxGender.GetItemText(cmbxGender.SelectedItem);

            //create new insurance
            Insurance insurance = new Insurance();
            insurance.timestamp = System.DateTime.Today.ToShortDateString();
            insurance.insNumber = txtInsuranceNumber.Text;
            insurance.versionCode = txtVersionCode.Text;
            insurance.expDate = txtInsuranceExpDate.Text;

            //create new allergy
            Allergy allergy = new Allergy();
            allergy.name = txtAllergyName.Text;
            allergy.category = txtAllergyCatergory.Text;

            //create new allergy-patient
            PatientAllergy ptAllgergy = new PatientAllergy();

            //
            Doctor doctor = new Doctor();
            doctor.billingCode = txtDoctorBillingCode.Text;
            doctor.name = txtReferralDoctor.Text;

            //
            ReferralDoctor refDoctor = new ReferralDoctor();

                    
            //ins number : number only
            //ins vc : character only
            //no blank: name, dob

            Phone phone = new Phone();
            phone.type = cmbxPhoneType.GetItemText(cmbxPhoneType.SelectedItem);
            phone.phoneNumber = txtPhoneNumber.Text;

            Email email = new Email();
            email.type = cmbxEmailType.GetItemText(cmbxEmailType.SelectedItem);
            email.email = txtEmail.Text;

            Address address = new Address();
            address.type = cmbxAddressType.GetItemText(cmbxAddressType.SelectedItem);
            address.address = txtAddress.Text;
            address.city = txtCity.Text;
            address.province = txtProvince.Text;
            address.postalCode = txtPostalCode.Text;

            DOB_valid = DOB_validation();
            exp_valid = exp_validation();

            if (DOB_valid == true && exp_valid == true && ins_exist == 0 && txtInsuranceNumber.TextLength == 10)
            {
                pass = true;
            }

              if (pass == true )
              {
                  insertPatient(patient);

                  patient.patientID = getPtIdfromPatienTbl();
                  insurance.patientID = patient.patientID;
                  phone.patientID = patient.patientID;
                  email.patientID = patient.patientID;
                  address.patientID = patient.patientID;
                  

                  insertInsurance(insurance);

                  if (txtAllergyCatergory.Text != "" && txtAllergyName.Text != "")
                  {

                      if (getAllergyIdfromAllergyTbl1() != 0)
                      {
                          ptAllgergy.patientId = patient.patientID;
                          ptAllgergy.allergyId = getAllergyIdfromAllergyTbl1();
                          insertPatientAllergy(ptAllgergy);
                      }
                      else
                      {
                          insertAllergy(allergy);
                          ptAllgergy.patientId = patient.patientID;
                          ptAllgergy.allergyId = getAllergyIdfromAllergyTbl2();
                          insertPatientAllergy(ptAllgergy);
                      }
                  }
                    
                  if (txtPhoneNumber.Text != "")
                  insertPhone(phone);
                  if (txtAddress.Text != "")
                  insertAdress(address);
                  if (txtEmail.Text != "")
                  insertEmail(email);

                  if (txtReferralDoctor.Text != "")
                  {
                      refDoctor.patientID = patient.patientID;
                      refDoctor.doctorID = getDoctorIdfromDoctorTbl1();
                      insertReferralDoctor(refDoctor);
                  }

               /*   if (txtDoctorBillingCode.Text != "" && txtReferralDoctor.Text != "")
                  {

                      if (getDoctorIdfromDoctorTbl1() != 0)
                      {
                          refDoctor.patientID = patient.patientID;
                          refDoctor.doctorID = getDoctorIdfromDoctorTbl1();
                          insertReferralDoctor(refDoctor);
                      }
                      else
                      {
                          insertDoctor(doctor);
                          refDoctor.patientID = patient.patientID;
                          refDoctor.doctorID = getDoctorIdfromDoctorTbl2();
                          insertReferralDoctor(refDoctor);
                      }
                  }*/


                

                    clearText();
                    MessageBox.Show("Patient was registed");
                    DialogResult result = MessageBox.Show("Go to patient demography?", "Patient registed", MessageBoxButtons.OKCancel,
                    MessageBoxIcon.Question);

                   if (result == DialogResult.OK)
                   {
                         this.Hide();
                        ViewDemography viewDemo = new ViewDemography();
                        viewDemo.patientId = patient.patientID;
                       viewDemo.Show();        
                      
                                         
                      
                       
                   }
                   else if (result == DialogResult.Cancel)
                       this.Close();
              }

              else if (txtInsuranceNumber.TextLength != 10) //number incorrect of left blank
              {
                  MessageBox.Show("Please insert correct insurance number");
              }
              else if (ins_exist != 0)
              {
                  MessageBox.Show("Insurance Number already exists");
              }
              else if (DOB_valid == false)
              {
                  MessageBox.Show("D.O.B not valid");
              }

              else if (exp_valid == false)
              {
                  MessageBox.Show("Insurance Expiry Date not valid");
              }
              
 
       

            

            

           
        }
Example #36
0
        private int getAllergyIdfromAllergyTbl1()
        {
            try
            {
                dictionary = new Dictionary<string, string>();
                dictionary.Add("@allergyName", txtAllergyName.Text);
                dc = new DatabaseConnector();
                dtAllergy = dc.getData("GetAllergyID1", dictionary);
                int allergyID = int.Parse(dtAllergy.Rows[0][0].ToString());
                return allergyID;
            }
            catch
            {
                int allergyID = 0;
                return allergyID;

            }
        }
        private void CreateDemForm_Load(object sender, EventArgs e)
        {
           
            
            dictionary = new Dictionary<string, string>();
            dictionary.Add("@patientId", patientId.ToString());
            
            dc = new DatabaseConnector();
            dtPatient = dc.getData("GetPatient", dictionary);
            dtPatientEmail = dc.getData("GetPatientEmail", dictionary);
            dtPatientAddress = dc.getData("GetPatientAddress", dictionary);
            dtPatientPhone = dc.getData("GetPatientPhone", dictionary);
            dtReferenceDoctor = dc.getData("GetPatientDoctor", dictionary);
            dtAllergy = dc.getData("GetAllery", dictionary);
            dtPatientAddress = dc.getData("GetPatientAddress", dictionary);
            dtInsurance = dc.getData("GetPatientOHIPInsurance", dictionary);
        
            txtLname.Text = dtPatient.Rows[0][2].ToString();
            txtFname.Text = dtPatient.Rows[0][3].ToString();
            string sourceDateTex = dtPatient.Rows[0][4].ToString();
            DateTime dt = Convert.ToDateTime(sourceDateTex);
            sourceDateTex = dt.Year.ToString() + "-" + dt.Month + "-" + dt.Day;
            patDob.Text = sourceDateTex;
            cmbGender.Text = dtPatient.Rows[0][5].ToString();

            txtRefDoctor.Text = dtReferenceDoctor.Rows[0][0].ToString();
            txtBillingCode.Text = dtReferenceDoctor.Rows[0][1].ToString();

            txtAlergyName.Text = dtAllergy.Rows[0][1].ToString();
            txtAlergyCategory.Text = dtAllergy.Rows[0][2].ToString();

            txtInsNum.Text = dtInsurance.Rows[0][2].ToString();
            txtInsVersion.Text = dtInsurance.Rows[0][3].ToString();

            string sourceDateText = dtInsurance.Rows[0][4].ToString(); 
            DateTime dte = Convert.ToDateTime(sourceDateText);
            sourceDateText = dte.Year.ToString() + "-" + dte.Month + "-" + dte.Day;
            txtExpDate.Text = sourceDateText;
          

            cmbAddType.Text=dtPatientAddress.Rows[0][2].ToString();
            txtAdd.Text=dtPatientAddress.Rows[0][3].ToString();
            txtCity.Text = dtPatientAddress.Rows[0][4].ToString();
            txtProvince.Text = dtPatientAddress.Rows[0][5].ToString();
            txtPostalCode.Text = dtPatientAddress.Rows[0][6].ToString();
            txtCountry.Text = dtPatientAddress.Rows[0][7].ToString();

            txtPhone.Text=dtPatientPhone.Rows[0][3].ToString();
            cmbPhoneType.Text = dtPatientPhone.Rows[0][2].ToString();
            
           

            txtEmail.Text = dtPatientEmail.Rows[0][3].ToString();
            cmbEmailType.Text = dtPatientEmail.Rows[0][2].ToString();
           
            

        }
Example #38
0
        private void btn_SearchPatient_Click(object sender, EventArgs e)
        {
            dictionary = new Dictionary <string, string>();
            dc         = new DatabaseConnector();

            if (txt_Output.Text != "")
            {
                bool temp = false;
                int  temp1;
                try
                {
                    temp1 = Convert.ToInt32(txt_Output.Text);
                    temp  = true;
                }
                catch (Exception ex)
                {
                    temp = false;
                }
                if (cm_Options.SelectedIndex == 1 && temp == true)
                {
                    dictionary.Add("@patientId", txt_Output.Text);
                    dtPatient = dc.getData("CheckPatientExists", dictionary);

                    if (int.Parse(dtPatient.Rows[0][0].ToString()) != 0)
                    {
                        dataGridView2.Hide();
                        dataGridView1.Show();
                        this.getPatientByIdTableAdapter.Fill(getPatientByIdDataSet.GetPatientById, txt_Output.Text);
                    }
                    else
                    {
                        MessageBox.Show("Patient does not exist.");
                        DialogResult result = MessageBox.Show("Create New Patient Demography?", "New Demography", MessageBoxButtons.OKCancel,
                                                              MessageBoxIcon.Question);

                        if (result == DialogResult.OK)
                        {
                            CreateDemForm create = new CreateDemForm();

                            create.Show();
                        }
                    }
                }
                else if (cm_Options.SelectedIndex == 2)
                {
                    dictionary.Add("@patientName", txt_Output.Text);
                    dtPatient = dc.getData("CheckPatientExistsByName", dictionary);
                    if (dtPatient.Rows.Count != 0)
                    {
                        dataGridView1.Hide();
                        dataGridView2.Show();
                        this.getPatientByNameTableAdapter.Fill(getPatientByNameDataSet.GetPatientByName, txt_Output.Text.ToString());
                    }
                    else
                    {
                        MessageBox.Show("Patient does not exist.");
                        DialogResult result = MessageBox.Show("Create New Patient Demography?", "New Demography", MessageBoxButtons.OKCancel,
                                                              MessageBoxIcon.Question);

                        if (result == DialogResult.OK)
                        {
                            CreateDemForm create = new CreateDemForm();
                            create.Show();
                        }
                    }
                }
                else
                {
                    MessageBox.Show("Please proper search text!");
                    txt_Output.Focus();
                }
            }
        }
 public DataTable getPatientEMRAccordingToDate(Dictionary<String, String> dict, DatabaseConnector conn)
 {
     DataTable dataTable;
     dataTable= conn.getData("GetPatientEMRAccordingToDate", dict);
     return dataTable;
 }