public ExaminationSurgery UpdateTreatment(ExaminationSurgery examinationSurgery, Treatment treatment) { ExaminationSurgery examinationToUdate = examinationSurgeryRepository.GetObject(examinationSurgery.IdNumber); examinationToUdate.Treatments.Add(treatment); return(examinationSurgeryRepository.Update(examinationToUdate)); }
public ExaminationSurgery CreateExaminationSurgery(ExaminationSurgery examinationSurgery) { if (!CheckIfAlreadyStartedExamining(examinationSurgery)) { return(examinationSurgeryRepository.Create(examinationSurgery)); } else { return(GetCurrentExamination(examinationSurgery.MedicalRecord.IdRecord)); } }
private static ExaminationSurgery FindLast(List <ExaminationSurgery> allForOneRecord) { ExaminationSurgery lastExamination = allForOneRecord[0]; foreach (ExaminationSurgery examinationSurgery in allForOneRecord) { if (lastExamination.StartTime.Date.CompareTo(examinationSurgery.StartTime.Date) < 0) { lastExamination = examinationSurgery; } } return(lastExamination); }
private void SetPatients() { int max = todayAppointments.Count == 4 ? 4 : todayAppointments.Count; lastIndex = todayAppointments.Count == 4 ? 4 : todayAppointments.Count; buttoni = new List <ButtonAppointment>(); for (int i = 0; i < max; i++) { ExaminationSurgery examinationSurgery = new ExaminationSurgery(); examinationSurgery.MedicalRecord = todayAppointments[i].patient.record.MedicalRecord; examinationSurgery.StartTime = todayAppointments[i].appointment.StartTime; examinationSurgery.Doctor = MainWindow.doctor; examinationSurgery = examinationSurgeryController.CreateExaminationSurgery(examinationSurgery); buttoni.Add(new ButtonAppointment() { appointment = todayAppointments[i], name = todayAppointments[i].FullName, visible = Visibility.Visible, record = todayAppointments[i].patient.record, examination = new ModelHCI.ExaminationSurgeryHCI() { examinationSurgery = examinationSurgery } }); } if (buttoni[0].appointment.patient.record.MedicalRecord.Patient.ProfileImage != null) { Profile.Source = new BitmapImage(new Uri(buttoni[0].appointment.patient.record.MedicalRecord.Patient.ProfileImage, UriKind.Relative)); } ButtonList.ItemsSource = buttoni; FullName.Text = buttoni[0].appointment.FullName; DateAppointment.Text = buttoni[0].appointment.Date.Date.ToString("dd.MM.yyyy."); StringTime.Text = buttoni[0].appointment.timeString; Record_Number.Text = buttoni[0].appointment.patient.record.MedicalRecord.IdRecord.ToString(); Gender.Text = buttoni[0].appointment.Gender; ID_Number.Text = buttoni[0].appointment.patient.record.MedicalRecord.Patient.IdentificationNumber; DateOfBirth.Text = buttoni[0].appointment.patient.dateOfBirth.ToString("dd.MM.yyyy."); Curr_Residence.Text = buttoni[0].appointment.patient.record.MedicalRecord.Patient.CurrResidence.City.Name; State.Text = buttoni[0].appointment.patient.record.MedicalRecord.Patient.CurrResidence.City.State.Name; MedicalRecord.Informations.currentRecord = buttoni[0].appointment.patient.record; Circle1.Fill = Brushes.LightGray; }
private void AddPrescription_Click(object sender, RoutedEventArgs e) { autoList.Visibility = Visibility.Collapsed; boxic.Visibility = Visibility.Collapsed; if (Medication.Text.Equals("") && HourlyUsage.SelectedItem == null) { ErrorMessage.Visibility = Visibility.Visible; } else { TreatmentForm form = new TreatmentForm(); form.TreatmentType = TreatmentType.prescription; form.AdditionalNotes = HowToUSe.Text; form.Medications.Add(medication); form.DateOfExamination = DateTime.Today; if (HourlyUsage.SelectedIndex != 0) { form.Intake = int.Parse((string)HourlyUsage.SelectedItem); } form.Flag = (bool)Reserved.IsChecked; Treatment treatment = treatmentController.CreateTreatment(TreatmentFactory.CreateTreatment(form)); ExaminationSurgery examination = examinationSurgeryController.GetCurrentExamination(MedicalRecord.Informations.currentRecord.MedicalRecord.IdRecord); examinationSurgeryController.UpdateTreatment(examination, treatment); /* * ModelHCI.MedicationHCI medForPrescription = null; * foreach (ModelHCI.MedicationHCI med in ModelHCI.MedicationData.meds) * { * if (med.name.ToLower().Equals(Medication.Text.ToLower())) * { * medForPrescription = med; * } * } * ModelHCI.PrescriptionHCI prescription = new ModelHCI.PrescriptionHCI(); * prescription.medication = medForPrescription; * * if (HourlyUsage.SelectedIndex != 0) * { * prescription.intake = int.Parse((string)HourlyUsage.SelectedItem); * } * prescription.reasonWhy = HowToUSe.Text; * prescription.patient = Appointments.currentExamination.appointment.patient; */ // Appointments.currentExamination.examination.treatments.Add(prescription); // Pages.MedicalRecord.Informations.currentRecord.Therapies.Add(new ModelHCI.TherapyHCI() { medication = prescription.medication, hourlyUsage = prescription.intake }); NavigationService.Navigate(new Uri("Pages/MedicalRecord/Informations.xaml", UriKind.Relative)); } }
private void AddPrescription_Click(object sender, RoutedEventArgs e) { TreatmentForm treatmentForm = new TreatmentForm(); treatmentForm.LabTestTypes = types; treatmentForm.TreatmentType = TreatmentType.labTestType; Treatment t = treatmentController.CreateTreatment(TreatmentFactory.CreateTreatment(treatmentForm)); ExaminationSurgery exam = ExaminationSurgeryController.GetCurrentExamination(Informations.currentRecord.MedicalRecord.IdRecord); ExaminationSurgeryController.UpdateTreatment(exam, t); NavigationService.Navigate(new Uri("Pages/MedicalRecord/Vaccines.xaml", UriKind.Relative)); }
private void Add_Form_Click(object sender, RoutedEventArgs e) { if (StartDate.SelectedDate == null || EndDate.SelectedDate == null || Department.SelectedItem == null) { ErrorMessage.Visibility = Visibility.Visible; Error.Text = ALL_INPUTS_ERROR; } else { TreatmentForm form = new TreatmentForm(); form.TreatmentType = TreatmentType.hospitalTreatment; form.Department = departmentController.GetDepartmentByName((string)Department.SelectedItem); form.StartDate = (DateTime)StartDate.SelectedDate; form.EndDate = (DateTime)EndDate.SelectedDate; Treatment treatment = treatmentController.CreateTreatment(TreatmentFactory.CreateTreatment(form)); ExaminationSurgery examination = examinationSurgeryController.GetCurrentExamination(MedicalRecord.Informations.currentRecord.MedicalRecord.IdRecord); examinationSurgeryController.UpdateTreatment(examination, treatment); NavigationService.Navigate(new Uri("/Pages/MedicalRecord/Informations.xaml", UriKind.Relative)); } }
public DoctorsAppointmentReport GenerateExaminationReport(ExaminationSurgery examination) => reportService.GenerateExaminationReport(examination);
public ExaminationSurgery FinishExamination(ExaminationSurgery examinationSurgery) => examinationSurgeryRepository.Update(examinationSurgery);
public bool CheckIfAlreadyStartedExamining(ExaminationSurgery examinationSurgery) { return(examinationSurgeryRepository.GetAll().ToList().Any(entity => entity.StartTime.Date.CompareTo(DateTime.Today.Date) == 0 && entity.MedicalRecord.IdRecord == examinationSurgery.MedicalRecord.IdRecord)); }
public static void ExportAsPDF(DoctorsAppointmentReport report) { ExaminationSurgery examinationSurgery = report.ExaminationSurgery; FlowDocument doc = new FlowDocument(); doc.PagePadding = new System.Windows.Thickness(40); doc.PageWidth = 700; doc.ColumnWidth = 700; doc.PageHeight = 900; doc.Background = Brushes.White; StackPanel stackPanel = new StackPanel(); stackPanel.Orientation = Orientation.Horizontal; stackPanel.VerticalAlignment = System.Windows.VerticalAlignment.Center; Image logo = new Image(); logo.Source = new BitmapImage(new Uri(@"..\..\Resources\HospitalLogo.png", UriKind.RelativeOrAbsolute)); logo.Width = 300; logo.Height = 300; TextBlock tb = new TextBlock(); tb.Text = "Izveštaj pregleda"; tb.FontSize = 25; tb.VerticalAlignment = System.Windows.VerticalAlignment.Center; tb.Margin = new System.Windows.Thickness(0, 0, 0, 0); tb.FontFamily = new FontFamily("Helvetica"); stackPanel.Children.Add(logo); stackPanel.Children.Add(tb); Paragraph top = new Paragraph(); top.Inlines.Add(stackPanel); top.BorderThickness = new System.Windows.Thickness(0, 0, 0, 1); doc.Blocks.Add(top); Paragraph datum = new Paragraph(); datum.FontSize = 20; tb = new TextBlock(); Paragraph pat = new Paragraph(); pat.FontSize = 20; Paragraph valid = new Paragraph(); valid.FontSize = 20; tb.FontFamily = new FontFamily("Helvetica"); tb.Text = "Datum pregleda: " + report.Date.Date.ToString("dd.MM.yyyy."); TextBlock pacijent = new TextBlock(); pacijent.FontFamily = new FontFamily("Helvetica"); pacijent.Text = "Pacijent: " + examinationSurgery.MedicalRecord.Patient.Name + " " + examinationSurgery.MedicalRecord.Patient.Name; TextBlock lekar = new TextBlock(); lekar.FontFamily = new FontFamily("Helvetica"); lekar.Text = "Pregled izvršen od strane: " + MainWindow.doctor.Name + " " + MainWindow.doctor.Surname; datum.Inlines.Add(tb); pat.Inlines.Add(pacijent); valid.Inlines.Add(lekar); doc.Blocks.Add(datum); doc.Blocks.Add(pat); doc.Blocks.Add(valid); StackPanel safe = new StackPanel(); safe.Orientation = Orientation.Horizontal; safe.HorizontalAlignment = System.Windows.HorizontalAlignment.Center; //id TextBlock tbId = new TextBlock(); tbId.Text = "Postavljena dijagnoza"; TextBlock tbbId = new TextBlock(); tbbId.Foreground = (Brush)(new BrushConverter()).ConvertFrom("#FF047AA6"); tbbId.Text = examinationSurgery.Diagnoses.Count > 0 ? "DA" : "NE"; StackPanel sast = new StackPanel(); sast.Orientation = Orientation.Vertical; TextBlock sastojcileka = new TextBlock(); sastojcileka.Text = "Dijagnoze: "; StackPanel sastojci = new StackPanel(); sastojci.Orientation = Orientation.Vertical; foreach (var m in examinationSurgery.Diagnoses) { TextBlock sastojak = new TextBlock(); sastojak.Text = m.Name; sastojak.Foreground = (Brush)(new BrushConverter()).ConvertFrom("#FF047AA6"); sastojak.FontFamily = new FontFamily("Helvetica"); sastojci.Children.Add(sastojak);; } tbbId.Foreground = (Brush)(new BrushConverter()).ConvertFrom("#FF047AA6"); TextBlock treatments = new TextBlock(); treatments.Text = "Nova lečenja: "; TextBlock lecenja = new TextBlock(); lecenja.Foreground = (Brush)(new BrushConverter()).ConvertFrom("#FF047AA6"); tbbId.Text = examinationSurgery.Treatments.Count > 0 ? "DA" : "NE"; StackPanel aler = new StackPanel(); aler.Orientation = Orientation.Vertical; TextBlock alerg = new TextBlock(); alerg.Text = "Lečenja: "; StackPanel alergije = new StackPanel(); alergije.Orientation = Orientation.Vertical; foreach (var m in examinationSurgery.Treatments) { TextBlock alergija = new TextBlock(); if (m.Type == TreatmentType.prescription) { var p = (Prescription)m; string str = ""; foreach (var med in p.Medications) { if (!str.Equals("")) { str += ", "; } str += med.Med; } alergija.Text = "Prepisani lekovi " + str; } if (m.Type == TreatmentType.hospitalTreatment) { var hosp = (HospitalTreatment)m; alergija.Text = "Prepisano lečenje od " + hosp.StartDate.Date.ToString("dd.MM.yyyy.") + " do " + hosp.EndDate.Date.ToString("dd.MM.yyyy."); } alergija.Foreground = (Brush)(new BrushConverter()).ConvertFrom("#FF047AA6"); alergija.FontFamily = new FontFamily("Helvetica"); alergije.Children.Add(alergija);; } safe.Children.Add(tbId); safe.Children.Add(tbbId); sast.Children.Add(sastojcileka); sast.Children.Add(sastojci); aler.Children.Add(alerg); aler.Children.Add(alergije); Paragraph inf = new Paragraph(); inf.FontSize = 15; Paragraph inf2 = new Paragraph(); inf2.FontSize = 15; Paragraph inf3 = new Paragraph(); inf3.FontSize = 15; inf.Inlines.Add(safe); inf2.Inlines.Add(sast); inf3.Inlines.Add(aler); doc.Blocks.Add(inf); doc.Blocks.Add(inf2); doc.Blocks.Add(inf3); PrintDialog printDialog = new PrintDialog(); if (printDialog.ShowDialog() == true) { printDialog.PrintDocument(((IDocumentPaginatorSource)doc).DocumentPaginator, ""); } }
public DoctorsAppointmentReport GenerateExaminationReport(ExaminationSurgery examination) { DoctorsAppointmentReport report = new DoctorsAppointmentReport(examination, DateTime.Today); return(report); }
public ExaminationSurgery FinishExamination(ExaminationSurgery examinationSurgery) => examinationSurgeryService.FinishExamination(examinationSurgery);
public ExaminationSurgery UpdateTreatment(ExaminationSurgery examinationSurgery, Treatment treatment) => examinationSurgeryService.UpdateTreatment(examinationSurgery, treatment);
public ExaminationSurgery CreateExaminationSurgery(ExaminationSurgery examinationSurgery) => examinationSurgeryService.CreateExaminationSurgery(examinationSurgery);