Ejemplo n.º 1
0
        // Open Patient information
        private void btnOpen_Click(object sender, EventArgs e)
        {
            try
            {
                if (selectedPatient != null)
                {
                    CloseCurrentOpenView(currentViewOpened);
                    string message = selectedPatient.FirstName + selectedPatient.LastName + " Record is now open. ID : " + selectedPatient.PatientID;
                    Status(message, Color.Transparent);
                    patientInfoRibbonController     = new PatientInfoRibbonController(this, new frmPatientInfoRibbon());
                    patientRecordTabsViewController = new PatientRecordTabsViewController(this, new frmPatientRecordTabs());
                    AddToContainer(patientRecordTabsViewController, MIDDLE);
                    AddToContainer(patientInfoRibbonController, RIGHT);
                    patienRibbon   = patientInfoRibbonController.ribbon;
                    frmPatientTabs = patientRecordTabsViewController.frmPatientRecordTabs;
                    // Disable Tabs
                    frmPatientTabs.tabPatientRecord.TabPages.Remove(frmPatientTabs.tabOrderTests);
                    frmPatientTabs.tabPatientRecord.TabPages.Remove(frmPatientTabs.tabDiagnosis);

                    //add patient ribbon
                    AddPatientRibonInfo(selectedPatient);
                    patienRibbon.btnSearchPatient.Click += new EventHandler(btnSearchPatient_Click);

                    //Fill View appointments
                    selectedPatientAppointments = eClinicalsController.GetAllAppointmentsByPatientID(selectedPatientID);
                    frmPatientTabs.dgViewAppointments_ViewAppointments.DataSource = selectedPatientAppointments;

                    patientRecordTabsViewController.fillPatientInfo(selectedPatient);
                    frmPatientTabs.dgTestResults_TestResults.DataSource = eClinicalsController.GetTestResults(selectedPatientID);


                    ExtensionGridView.RemoveAppointmentIdColumns(frmPatientTabs.dgViewAppointments_ViewAppointments);
                }
                else
                {
                    Status("No Patient Selected", Color.Yellow);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " Error in  : " + ex.TargetSite);
                Status(ex.Message + " Error in  : " + ex.TargetSite, Color.Red);
            }


            try
            {
                currentNurse = eClinicalsController.GetNurseByID(currentUser.ContactID);
                Status("Current Nures: " + currentNurse.FirstName, Color.Yellow);
            }
            catch (Exception ex)
            {
                Status(ex.Message + " Error in  : " + ex.TargetSite, Color.Red);
            }
        }