private void SearchButton_Click(object sender, EventArgs e) { Patient patient = DicomUtils.FindPatient(this, _find, _scp, textBoxId.Text); if (patient != null) { textBoxLastname.Text = patient.Name.Family; textBoxFirstname.Text = patient.Name.Given; comboBoxSex.SelectedIndex = comboBoxSex.FindStringExact(patient.Sex); if (patient.BirthDate.HasValue) { dateTimePickerBirth.Value = patient.BirthDate.Value; dateTimePickerBirth.Checked = true; } if (Program.OtherPID.ContainsKey(patient.Id)) { textBoxOtherPid.Text = Program.OtherPID[patient.Id]; } else { OtherPatientIds.Text = string.Empty; textBoxOtherPid.Text = string.Empty; } } else { TaskDialogHelper.ShowMessageBox(this, "Patient Search", "Patient with specified id was not found.", string.Empty, string.Empty, TaskDialogStandardButtons.Close, TaskDialogStandardIcon.Information, null); } ActionButton.Enabled = patient != null; }
private void SearchButton_Click(object sender, EventArgs e) { Patient patient = DicomUtils.FindPatient(this, _find, _scp, textBoxId.Text); if (!radioButtonMoveStudyToNewPatient.Checked) { if (patient != null) { textBoxLastname.Text = patient.Name.Family; textBoxFirstname.Text = patient.Name.Given; if (Program.OtherPID.ContainsKey(patient.Id)) { textBoxOtherPid.Text = Program.OtherPID[patient.Id]; } else { textBoxOtherPid.Text = string.Empty; } if (string.IsNullOrEmpty(patient.Sex)) { comboBoxSex.Text = string.Empty; } else { comboBoxSex.SelectedIndex = comboBoxSex.FindStringExact(patient.Sex); } if (patient.BirthDate.HasValue) { dateTimePickerBirth.Value = patient.BirthDate.Value; dateTimePickerBirth.Checked = true; } else { dateTimePickerBirth.Checked = false; } } else { TaskDialogHelper.ShowMessageBox(this, "Patient Search", "Patient with specified id was not found.", string.Empty, string.Empty, TaskDialogStandardButtons.Close, TaskDialogStandardIcon.Information, null); } ActionButton.Enabled = patient != null; } else { if (patient != null) { TaskDialogResult result = TaskDialogResult.Yes; result = TaskDialogHelper.ShowMessageBox(this, "Patient Id Already Exits", "Would you like to merge the study with existing patient?", "The patient id already exisits.", "Existing Patient: " + patient.Name.Full, TaskDialogStandardButtons.Yes | TaskDialogStandardButtons.No, TaskDialogStandardIcon.Error, TaskDialogStandardIcon.Warning); if (result == TaskDialogResult.Yes) { radioButtonMoveStudyToExistingPatient.Checked = true; textBoxLastname.Text = patient.Name.Family; textBoxFirstname.Text = patient.Name.Given; if (string.IsNullOrEmpty(patient.Sex)) { comboBoxSex.Text = string.Empty; } else { comboBoxSex.SelectedIndex = comboBoxSex.FindStringExact(patient.Sex); } if (patient.BirthDate.HasValue) { dateTimePickerBirth.Value = patient.BirthDate.Value; dateTimePickerBirth.Checked = true; } else { dateTimePickerBirth.Checked = false; } ActionButton.Enabled = true; } else { ActionButton.Enabled = false; } } else { ActionButton.Enabled = true; } } CopyButton.Enabled = ActionButton.Enabled && !radioButtonMoveSeriesToExistingPatient.Checked; }