private void btn_Search_Click(object sender, EventArgs e) { lv_Studies.Items.Clear(); using (PService.PSearchSvcClient client = new PService.PSearchSvcClient()) { List <PService.Study> studies = new List <PService.Study>(client.SearchStudiesByDate(dt_From.Value, dt_To.Value, null)); studies.RemoveAll(st => !("Keratoscope".Equals(st.Device) || "Scheimpflug Camera".Equals(st.Device))); foreach (PService.Study st in studies) { ListViewItem item = new ListViewItem(new string[] { st.PatientsFirstName + " " + st.PatientsLastName, st.PatientsBirthDate.ToString("dd.MM.yyyy"), st.StudyDate.ToString("dd.MM.yyyy HH.mm.ss"), st.Device }); item.Tag = st; lv_Studies.Items.Add(item); try { if (lv_Studies.SelectedItems.Count == 0 && item != null) { item.Selected = true; } } catch (NullReferenceException) { } } } }
private void tb_LatestStudy_Click(object sender, EventArgs e) { using (PService.PSearchSvcClient client = new PService.PSearchSvcClient()) { List <PService.Study> studies = new List <PService.Study>(client.SearchStudies(10, 0)); PService.Study study = studies.Find(st => "Keratoscope".Equals(st.Device) || "Scheimpflug Camera".Equals(st.Device)); if (study != null) { m_Study = study; } btn_GetImages_Click(sender, e); } }
private void btn_SearchPatientID_Click(object sender, EventArgs e) { cmb_Patients.Items.Clear(); using (PService.PSearchSvcClient client = new PService.PSearchSvcClient()) { foreach (PService.Patient patient in client.SearchPatients(txt_FirstName.Text.Trim(), txt_LastName.Text.Trim())) { cmb_Patients.Items.Add(patient); } if (cmb_Patients.Items.Count > 0) { cmb_Patients.SelectedIndex = 0; } if (cmb_Patients.Items.Count > 1) { cmb_Patients.DroppedDown = true; } } }
private void btn_SearchStudyID_Click(object sender, EventArgs e) { cmb_Studies.Items.Clear(); using (PService.PSearchSvcClient client = new PService.PSearchSvcClient()) { foreach (PService.Study study in client.FindStudies(((PService.Patient)cmb_Patients.SelectedItem).PatientId)) { if ("Keratoscope".Equals(study.Device) || "Scheimpflug Camera".Equals(study.Device)) { cmb_Studies.Items.Add(study); } } if (cmb_Studies.Items.Count > 0) { cmb_Studies.SelectedIndex = 0; } if (cmb_Studies.Items.Count > 1) { cmb_Studies.DroppedDown = true; } } }
private void btn_GetImages_Click(object sender, EventArgs e) { lv_ImagesOD.Items.Clear(); iml_ImagesOD.Images.Clear(); lv_ImagesOS.Items.Clear(); iml_ImagesOS.Images.Clear(); using (PService.PSearchSvcClient client = new PService.PSearchSvcClient()) { foreach (PService.Image image in client.FindImages(m_Study.StudyId, null)) { ListViewItem item = new ListViewItem(image.ImageId); item.Tag = image; Image thumbnail = Image.FromStream(client.GetImage(image.ImageId)).GetThumbnailImage(150, 113, null, IntPtr.Zero); if ("OD".Equals(image.Laterality)) { iml_ImagesOD.Images.Add(thumbnail); lv_ImagesOD.Items.Add(item); item.ImageIndex = iml_ImagesOD.Images.Count - 1; if (lv_ImagesOD.SelectedItems.Count == 0) { item.Selected = true; } } else { iml_ImagesOS.Images.Add(thumbnail); lv_ImagesOS.Items.Add(item); item.ImageIndex = iml_ImagesOS.Images.Count - 1; if (lv_ImagesOS.SelectedItems.Count == 0) { item.Selected = true; } } } if (Properties.Settings.Default.Autoclose) { btn_Close_Click(sender, e); } } }
private void SelectImage(PService.Image OD, PService.Image OS, PService.Study Study) { //string ImageName = Path.Combine(Properties.Settings.Default.EgoDirectory, Path.GetFileNameWithoutExtension(FileName) + OD.Laterality + ".jpg"); using (PService.PSearchSvcClient client = new PService.PSearchSvcClient()) { Data DOS = null, DOD = null; PService.PeripheralDegreesModule POS = null, POD = null; if (OS != null) { try { POS = client.GetPeripheralDegrees(OS.ImageId, true); } catch { } DOS = new Data(client.GetBCS(OS.ImageId)); } if (OD != null) { try { POD = client.GetPeripheralDegrees(OD.ImageId, true); } catch { } DOD = new Data(client.GetBCS(OD.ImageId)); } string filename = Path.Combine(Properties.Settings.Default.EgoDirectory, Study.StudyId + ".ker"); using (StreamWriter sw = File.AppendText(filename)) { sw.WriteLine("Woehlk Contactlinsen Schönkirchen Version 1.2.2/17.11.11"); sw.WriteLine(Study.Device); sw.WriteLine(Study.PatientsFirstName); sw.WriteLine(Study.PatientsLastName); sw.WriteLine(Study.PatientsBirthDate.ToString("dd.MM.yy")); sw.WriteLine("----------------------------"); sw.WriteLine(Study.StudyDate.ToString("dd.MM.yy")); sw.WriteLine(Study.StudyDate.ToString("HH.mm")); sw.WriteLine("----------------------------"); sw.WriteLine("Ey_Para:"); if (OS != null) { WriteEyPara(sw, OS, DOS, POS); sw.WriteLine("-----"); } if (OD != null) { WriteEyPara(sw, OD, DOD, POD); } for (int i = 0; i < 10; i++) { sw.WriteLine("-----"); } sw.WriteLine("----------------------------"); sw.WriteLine("Ey_Exze:"); if (OS != null) { WriteEyExze(sw, OS, DOS, POS); sw.WriteLine("-----"); } if (OD != null) { WriteEyExze(sw, OD, DOD, POD); } for (int i = 0; i < 8; i++) { sw.WriteLine("-----"); } sw.WriteLine("----------------------------"); if (OS != null) { WriteRest(sw, OS, DOS, POS); } if (OD != null) { WriteRest(sw, OD, DOD, POD); } } if (OS != null) { WriteImage(OS, Study); } if (OD != null) { WriteImage(OD, Study); } } }