예제 #1
0
        private void ButtonSubmit_Click(object sender, EventArgs e)
        {
            ConnectDB EMRDatabase   = new ConnectDB();
            Boolean   patientExists = EMRDatabase.PatientExists(SSN);

            //if the SSN is already in the DB
            if (patientExists == true)
            {
                Console.WriteLine("patient already exists!");
                EMRDatabase.UpdatePatient(SSN, Fname, Lname, Address, Email, Phone, Sex, Birthday, BloodType, PrimaryPhysician, InsProvider, InsNum);
                EMRDatabase.AddAllergiesExisting(SSN, Allergy, AllergyDate);
            }
            else
            {
                Console.WriteLine("patient doesn't exist, adding to DB...");
                EMRDatabase.InsertPatient(SSN, Fname, Lname, Address, Email, Phone, Sex, Birthday, BloodType, PrimaryPhysician, InsProvider, InsNum);
                EMRDatabase.AddAllergies(SSN, Allergy, AllergyDate);
            }
            confirmationBox.Visible = false;
            labelConfirm.Visible    = false;
            buttonCancel.Visible    = false;
            buttonSubmit.Visible    = false;
            button2.Visible         = true;
            button3.Visible         = true;
        }
예제 #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            ConnectDB EMRDatabase   = new ConnectDB();
            Boolean   patientExists = EMRDatabase.PatientExists(SSN);

            EMRDatabase.AddAllergies(SSN, Allergy, AllergyDate);
        }
예제 #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            ConnectDB EMRDatabase   = new ConnectDB();
            Boolean   patientExists = EMRDatabase.PatientExists(SSN);

            //if the SSN is already in the DB
            if (patientExists == true)
            {
                MedicalHistory medHistory = new MedicalHistory(SSN);
                medHistory.Show();
            }
            else
            {
            }
        }
예제 #4
0
        //SSN
        private void textSetSSN_TextChanged(object sender, EventArgs e)
        {
            SSN = textSetSSN.Text;
            ConnectDB EMRDatabase   = new ConnectDB();
            Boolean   patientExists = EMRDatabase.PatientExists(SSN);

            if (patientExists == true)
            {
                button1.Text = "Update Patient";
            }
            else
            {
                button1.Text    = "Create Patient Record";
                button2.Visible = false;
                button3.Visible = false;
            }
        }