コード例 #1
0
        private void alterPatient(bool update, Patient patient)
        {
            string queryString = "addPatient";

            if (update)
            {
                queryString = "updatePatient";
            }

            SqlCommand command = new SqlCommand(queryString, conn);

            command.CommandType = System.Data.CommandType.StoredProcedure;
            command.Parameters.Add(new SqlParameter("@gender", patient.getGender()));
            command.Parameters.Add(new SqlParameter("@ssn", patient.getSSN()));
            command.Parameters.Add(new SqlParameter("@birthDate", patient.getBirthDate()));
            command.Parameters.Add(new SqlParameter("@firstName", patient.getFirstName()));
            command.Parameters.Add(new SqlParameter("@middleInitial", patient.getMiddleInitial()));
            command.Parameters.Add(new SqlParameter("@lastName", patient.getLastName()));
            command.Parameters.Add(new SqlParameter("@addressLine1", patient.getAddressLine1()));
            command.Parameters.Add(new SqlParameter("@addressLine2", patient.getAddressLine2()));
            command.Parameters.Add(new SqlParameter("@state", patient.getState()));
            command.Parameters.Add(new SqlParameter("@city", patient.getCity()));
            command.Parameters.Add(new SqlParameter("@zipcode", patient.getZipcode()));
            command.Parameters.Add(new SqlParameter("@insurerId", patient.getInsurer()));
            command.Parameters.Add(new SqlParameter("@doNotResuscitate", patient.getDoNotResuscitateStatus()));
            command.Parameters.Add(new SqlParameter("@organDonor", patient.getOrganDonorStatus()));

            command.Connection = conn;

            SqlDataReader reader = command.ExecuteReader();

            reader.Close();
        }
コード例 #2
0
        private void displayPatient()
        {
            patientFirstNameTextBox.Text     = selectedPatient.getFirstName();
            PatientMiddleInitialTextBox.Text = selectedPatient.getMiddleInitial().ToString();
            patientLastNameTextBox.Text      = selectedPatient.getLastName();
            patientAddressLine1TextBox.Text  = selectedPatient.getAddressLine1();
            patientAddressLine2TextBox.Text  = selectedPatient.getAddressLine2();
            patientCityTextBox.Text          = selectedPatient.getCity();
            patientStateTextBox.Text         = selectedPatient.getState();
            patientZipTextBox.Text           = selectedPatient.getZipcode();
            patientGenderTextBox.Text        = selectedPatient.getGender().ToString();
            patientSSN.Text       = selectedPatient.getSSN();
            patientInsurerID.Text = selectedPatient.getInsurer();

            if (selectedPatient.getDoNotResuscitateStatus())
            {
                patientDNR.Text = "True";
            }
            else
            {
                patientDNR.Text = "False";
            }
            if (selectedPatient.getOrganDonorStatus())
            {
                patientOrganDonor.Text = "True";
            }
            else
            {
                patientOrganDonor.Text = "False";
            }


            //patientBirthdateTextBox.Text = selectedPatient.getBirthDate().ToString("MM/dd/yyyy");
            dateBirthdate.Value = selectedPatient.getBirthDate();
            if (selectedVisit == null)
            {
                EntryDatePicker.Visible       = false;
                changeRoomButton.Enabled      = false;
                diagnosisWizardButton.Enabled = false;
                useInventoryButton.Enabled    = false;
            }
            else
            {
                EntryDatePicker.Visible = true;
                EntryDatePicker.Value   = selectedVisit.getEntryDate();

                if (selectedVisit.getRoomList().Count > 0)
                {
                    visitRoomNumber.Text = selectedVisit.getRoomList()[selectedVisit.getRoomList().Count - 1].getRoomNumber();
                }
                textSymptoms.Text = "";
                foreach (string s in selectedVisit.getSymptomList())
                {
                    textSymptoms.Text += s + "\r\n";
                }
                VisitDiagnosisTextBox.Text    = selectedVisit.getDiagnosis();
                textAttendingPhy.Text         = selectedVisit.getAttendingPhysician();
                visitNotes.Text               = selectedVisit.getNote();
                changeRoomButton.Enabled      = true;
                diagnosisWizardButton.Enabled = true;
                useInventoryButton.Enabled    = true;
                //roomNumber.Items = selectedVisit.getRoomList()
            }
            listPreviousVisits.Items.Clear();


            for (int i = selectedPatient.getVisitList().Count - 1; i >= 0; i--) // selectedPatient.getVisitList.Count Visit v in selectedPatient.getVisitList())
            {
                Visit v = selectedPatient.getVisitList()[i];
                if (selectedVisit != null && selectedVisit.getEntryDate() == v.getEntryDate())
                {
                    continue;                                                                            // we don't want to display current visit in previous visit list
                }
                Console.WriteLine("Adding previous visit at date: " + v.getEntryDate().ToShortDateString());

                ListViewItem previousVisit = new ListViewItem(v.getEntryDate().ToString());
                previousVisit.SubItems.Add(v.getAttendingPhysician());
                previousVisit.SubItems.Add(v.getDiagnosis());

                // previousVisitList.Items.Add(previousVisit);
                listPreviousVisits.Items.Add(previousVisit);
            }

            if (selectedVisit == null)
            {
                textSymptoms.Enabled          = true;
                VisitDiagnosisTextBox.Enabled = true;
                textAttendingPhy.Enabled      = true;
                visitNotes.Enabled            = true;
            }
            else
            {
                textSymptoms.Enabled          = false;
                VisitDiagnosisTextBox.Enabled = false;
                textAttendingPhy.Enabled      = false;
                visitNotes.Enabled            = false;
            }
        }