public void GetDiangosesReturnsListOfPatientDiagnoses() { //Arrange long patientId = 1; var diagnoses = new List <PatientDiagnosys> { new PatientDiagnosys { PatientId = patientId }, new PatientDiagnosys { PatientId = patientId + 1 }, new PatientDiagnosys { PatientId = patientId }, new PatientDiagnosys { PatientId = patientId + 2 } }; var dbSet = diagnoses.AsQueryable().BuildMockDbSet(); context.Setup(c => c.PatientDiagnoses).Returns(dbSet.Object); PatientsRepository repository = new PatientsRepository(context.Object); //Act var result = repository.GetDiagnoses(patientId).Result; //Assert Assert.IsInstanceOfType(result, typeof(IEnumerable <PatientDiagnosys>)); Assert.AreEqual(2, result.Count()); }
/// <summary> This method converts <paramref name="patientDto"/> to <c>PatientUser</c> using <c>PatientAdapter</c> and sends it to <c>PatientsRepository</c>. </summary> /// <returns>Returns successfully created patient; otherwise, return <c>null</c></returns> public PatientUser Create(PatientDto patientDto) { PatientUser patient = PatientsRepository.Add(PatientAdapter.PatientDtoToPatient(patientDto)); EmailVerificationService.SendVerificationMail(new MailAddress(patient.email), patient.id); return(patient); }
public DoctorService() { doctorRepository = new DoctorRepository(path); patientsRepository = new PatientsRepository(path2); operationRepository = new OperationRepository(path3); appointmentRepository = new AppointmentRepository(path4); employeesScheduleRepository = new EmployeesScheduleRepository(path5); }
public UnitOfWork() { _context = new ApplicationDbContext(); Doctors = new DoctorsRepository(_context); Cities = new CityRepository(_context); Appointments = new AppointmentsRepository(_context); Specializations = new SpecializationRepository(_context); Patients = new PatientsRepository(_context); }
/// <summary> This method converts <paramref name="patientDto"/> to <c>PatientUser</c> using <c>PatientAdapter</c> and sends it to <c>PatientsRepository</c>. </summary> /// <returns>Returns successfully created patient; otherwise, return <c>null</c></returns> public PatientUser Create(PatientDto patientDto) { if (PatientsRepository.GetByEmail(patientDto.Email) == null) { PatientUser patient = PatientsRepository.Add(PatientAdapter.PatientDtoToPatient(patientDto)); EmailVerificationService.SendVerificationMail(new MailAddress(patient.Email), patient.Id); return(patient); } return(null); }
/// <summary> This method is calling <c>PatientsRepository</c> to validate patients account. </summary> /// <param name="id"><c>id</c> is id of patient who's account needs to be validated. /// </param> /// <returns>if validated patient exists returns successfully validated patient; otherwise, return <c>null</c></returns> public PatientUser Validate(int id) { PatientUser patient = PatientsRepository.Find(id); if (patient != null) { return(PatientsRepository.Validate(patient)); } return(null); }
public void TEST_IF_CAN_QUERY() { PatientsRepository repo = new PatientsRepository(CONNECTION_STRING, DB_NAME); //string query = "{'Name':'g','Diagnose.Symptoms':{'DoseDay':'21'}}"; string query = "{'$and':[{'Diagnose':{$exists:true}},{'Diagnose.Symptoms':{$exists:true}},{'Diagnose.Symptoms.DoseDay':{'$eq':'21'}}]}"; var patientsTask = repo.GetPatients(query, 100, 0); Console.WriteLine(patientsTask.Result); }
private void InitRepositories() { PatientsRepository = new PatientsRepository(); months = new List <string>() { "Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie" }; MonthsNames = new Dictionary <int, string>(); for (int i = 0; i < 12; i++) { MonthsNames.Add(i, months[i]); } PaymentInterval = new PaymentInterval(); }
public void PatientSearchTest() { //Arrange var patients = new List <Patient>().AsQueryable().BuildMockDbSet(); context.Setup(c => c.SearchPatients(It.IsAny <PatientSearchModel>())).Returns(patients.Object); PatientsRepository repository = new PatientsRepository(context.Object); //Act var result = repository.SearchPatients(new PatientSearchModel()).Result; //Assert Assert.IsInstanceOfType(result, typeof(IEnumerable <Patient>)); }
public Boolean isFoundInPatients(string email, string ucin, T user) { String path = bingPathToAppDir(@"JsonFiles\patients.json"); PatientsRepository patientsRepository = new PatientsRepository(path); List <PatientUser> listOfPatients = patientsRepository.GetAll(); foreach (PatientUser patient in listOfPatients) { if (!areIDsEqual(patient.id, user.id) && (areUCINsEqual(patient.uniqueCitizensidentityNumber, ucin) || areEmailsEqual(patient.email, email))) { return(false); } } return(true); }
public PatientsViewModel ReadOnePatient(int _id) { PatientsEntity _patient = new PatientsRepository().ReadOne(_id); PatientsViewModel doctor_vm = new PatientsViewModel(); doctor_vm = new PatientsViewModel { Id = _patient.Id, PatientNS = _patient.Person.Name + ' ' + _patient.Person.Surname, DoctorNS = _patient.Doctor.Person.Name + ' ' + _patient.Doctor.Person.Surname, Address = _patient.Person.Address, Phone = _patient.Person.Phone, Removed = _patient.Removed }; return(doctor_vm); }
public IEnumerable <PatientsViewModel> SearchPatients(string _search) { IEnumerable <PatientsEntity> patients = new PatientsRepository().Search(_search); List <PatientsViewModel> patients_vm = new List <PatientsViewModel>(); foreach (PatientsEntity _patient in patients) { patients_vm.Add(new PatientsViewModel { Id = _patient.Id, PatientNS = _patient.Person.Name + ' ' + _patient.Person.Surname, DoctorNS = _patient.Doctor.Person.Name + ' ' + _patient.Doctor.Person.Surname, Address = _patient.Person.Address, Phone = _patient.Person.Phone, Removed = _patient.Removed }); } return(patients_vm); }
public async Task UpdatePatientsInfo() { IFixture fixture = new Fixture(); fixture.Behaviors.Add(new OmitOnRecursionBehavior()); var databaseName = fixture.Create <string>(); var options = new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase(databaseName).Options; var patient = fixture.Create <Patient>(); var firstNameBefore = patient.FirstName; var birthDateBefore = patient.BirthDate; using (var context = new ApplicationDbContext(options)) { var repository = new PatientsRepository(context); await repository.CreateAsync(patient, CancellationToken.None); } using (var context = new ApplicationDbContext(options)) { context.Patients.Count().Should().Be(1); patient.LastName = "TestAfter"; patient.Phone = "888"; var repository = new PatientsRepository(context); await repository.Update(patient, CancellationToken.None); context.Patients.Count().Should().Be(1); context.Patients.First().Phone.Should().Be("888"); context.Patients.First().LastName.Should().Be("TestAfter"); context.Patients.First().FirstName.Should().Be(firstNameBefore); context.Patients.First().BirthDate.Should().Be(birthDateBefore); } }
public void TEST_IF_UPDATE_AND_CREATE() { PatientsRepository repo = new PatientsRepository(CONNECTION_STRING, DB_NAME); var patient = repo.GetPatients(new FindPatientModel { PatientId = "333333333" }, 1, 0); Console.WriteLine(patient.Result); var added = repo.AddOrUpdateDiagnoseAsync(new PatientDiagnoseDTO { PatientId = "333333333", General = "Short, Too short.", Symptoms = new System.Collections.Generic.Dictionary <string, dynamic> { ["Age"] = 13 }, DoctorId = "5e", InOutPatient = true }); Console.WriteLine(added.Result); }
public UnitOfWork( PatientsRepository patients, PractitionersRepository practitioners, PractitionerRolesRepository practitionerRoles, RelatedPeopleRepository relatedPeople, PeopleRepository people, OrganizationsRepository organizations, HealthcareServicesRepository healthcareServices, LocationsRepository locations, DevicesRepository devices, TasksRepository tasks, AppointmentsRepository appointments, SchedulesRepository schedules, EncountersRepository encounters, EpisodesOfCareRepository episodesOfCare, FlagsRepository flags ) { var database = new FhirDevelopment01DB(); Patients = patients; Practitioners = practitioners; PractitionerRoles = practitionerRoles; RelatedPeople = relatedPeople; People = people; Organizations = organizations; HealthcareServices = healthcareServices; Locations = locations; Devices = devices; Tasks = tasks; Appointments = appointments; Schedules = schedules; Encounters = encounters; EpisodesOfCare = episodesOfCare; Flags = flags; }
/// <summary> This method provides <c>PatientUser</c> <paramref name="patientId"/> and sends it to <c>PatientsRepository</c> there patient.IsBlocked will be set to true. </summary> /// <param name="patientId"><c>PatientUser</c> is <c>PatientUser</c> that needs to be blocked. /// </param> /// <returns>null if PatientUser is not valid; otherwise, succesfully blocked PatientUser. </returns> public PatientUser BlockPatient(int patientId) { PatientUser patient = PatientsRepository.FindOne(patientId); return(patient == null ? null : PatientsRepository.BlockPatient(patient)); }
private void Zakazi_click(object sender, RoutedEventArgs e) { String b = bingPathToAppDir(@"JsonFiles\appointments.json"); String c = bingPathToAppDir(@"JsonFiles\refferal.json"); String d = bingPathToAppDir(@"JsonFiles\patients.json"); String m = bingPathToAppDir(@"JsonFiles\doctors.json"); PatientsRepository patientRepo = new PatientsRepository(d); List <PatientUser> patientLista = patientRepo.GetAll(); PatientUser ovajPacijent = new PatientUser(); foreach (PatientUser r1 in patientLista) { if (r1.medicalIdNumber.Equals(KnjizicaBox.Text.ToString())) { ovajPacijent = r1; KnjizicaBox.Text = r1.medicalIdNumber; } } DoctorRepository docRepo = new DoctorRepository(m); List <DoctorUser> doktori = docRepo.GetAll(); DoctorUser drOvaj = new DoctorUser(); foreach (DoctorUser d1 in doktori) { if (d1.email.Equals(emailLekarBox.Text.ToString())) { drOvaj = d1; } } if (!Regex.Match(Time1Box.Text, "^[0-9]{2}:[0-9]{2}$").Success || !Regex.Match(Time2Box.Text, "^[0-9]{2}:[0-9]{2}$").Success) { MessageBox.Show("Vreme mora biti u formatu 00:00", "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; } String[] startParts = Time1Box.Text.Split(':'); String[] endParts = Time2Box.Text.Split(':'); int startIntPart1 = int.Parse(startParts[0]); int startIntPart2 = int.Parse(startParts[1]); int ensIntPart1 = int.Parse(endParts[0]); int endtIntPart2 = int.Parse(endParts[1]); if (startIntPart1 > 23 || startIntPart2 > 60 || ensIntPart1 > 23 || endtIntPart2 > 60 || startIntPart1 > ensIntPart1) { MessageBox.Show("Najveca vrednost za vreme je 23:59", "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; } TimeSpan vremee = new TimeSpan(startIntPart1, startIntPart2, 00); TimeSpan vremee2 = new TimeSpan(ensIntPart1, endtIntPart2, 00); int broj = getNextid(); DoctorAppointment drap = new DoctorAppointment(broj, vremee, DatumBox.Text.ToString(), ovajPacijent, drOvaj, null, ordinacijaBox.Text); AppointmentRepository arepo = new AppointmentRepository(b); List <DoctorAppointment> lista2 = new List <DoctorAppointment>(); PatientController regPat = new PatientController(); List <PatientUser> pac = new List <PatientUser>(); pac = regPat.GetAll(); if (arepo.GetAll() != null) { lista2 = arepo.GetAll(); } String o = bingPathToAppDir(@"JsonFiles\operations.json"); int broj1 = getNextid1(); Operation op = new Operation(broj1, ovajPacijent, DatumBox.Text.ToString(), vremee, vremee2, drOvaj, ordinacijaBox.Text, null); OperationRepository opRep = new OperationRepository(o); List <Operation> lista3 = new List <Operation>(); if (opRep.GetAll() != null) { lista3 = opRep.GetAll(); } if (pregled == true) { String datum = DatumBox.Text; String[] delovi2 = datum.Split('/'); int mesec = int.Parse(delovi2[1]); int dan = int.Parse(delovi2[0]); int godina = int.Parse(delovi2[2]); DateTime dt1 = new DateTime(godina, mesec, dan, 0, 0, 0); DateTime dt2 = DateTime.Now; if (dt1 < dt2) { MessageBox.Show("Molimo vas da unesete datum koji tek predstoji", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } String x = bingPathToAppDir(@"JsonFiles\appointments.json"); AppointmentRepository apc = new AppointmentRepository(x); List <DoctorAppointment> listaPregleda = apc.GetAll(); /* foreach (DoctorAppointment dd in listaPregleda) * { * DoctorUser dr = dd.doctor; * if (dr.id == drOvaj.id) * { * if (dd.Date.Equals(DatumBox.Text)) * { * TimeSpan krajPr = dd.Time + new TimeSpan(0, 15, 0); * int result = TimeSpan.Compare(vremee, dd.Time); * int result1 = TimeSpan.Compare(vremee, krajPr); * if ((result == 1 && result1 == -1) || result == 0) * { * MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * return; * } * } * * * * * } * }*/ /* String pre = bingPathToAppDir(@"JsonFiles\operations.json"); * OperationRepository apc1 = new OperationRepository(pre); * List<Operation> listaPregleda1 = apc1.GetAll(); * foreach (Operation dd in listaPregleda1) * { * DoctorUser dr = dd.isResponiable; * if (dr.id == drOvaj.id) * { * if (dd.Date.Equals(DatumBox.Text)) * { * int result = TimeSpan.Compare(vremee, dd.Start); * int result1 = TimeSpan.Compare(vremee, dd.End); * if ((result == 1 && result1 == -1)||result==0 ||result1==0) * { * * MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * return; * } * * } * * * * * } * }*/ EmployeesScheduleController schCon = new EmployeesScheduleController(); List <Schedule> listaRasporeda = schCon.GetAll(); Shift smena = schCon.getShiftForDoctorForSpecificDay(DatumBox.Text, drOvaj); if (smena == null || smena.startTime == null || smena.endTime == null) { MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi tog dana.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } AppointmentController appointmentController = new AppointmentController(); Boolean notAvaible = appointmentController.isTermNotAvailable(drOvaj, vremee, DatumBox.Text, ovajPacijent); if (notAvaible == true) { MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } /* foreach (Schedule s in listaRasporeda) * { * * if (s.employeeid.Equals(drOvaj.id.ToString())) * { * if (s.Date.Equals(DatumBox.Text)) * { * smena = s.shift; * } * } * } * if(smena.StartTime==null || smena.EndTime == null) * { * * }*/ bool slobodan = schCon.isDoctorWorkingAtSpecifiedTime(DatumBox.Text, drOvaj, vremee); if (slobodan == false) { MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi u to vreme.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } /* String pocetak = smena.StartTime; * String kraj = smena.EndTime; * String[] deloviPocetak = pocetak.Split(':'); * String[] deloviKraj = kraj.Split(':'); * * TimeSpan pocetakTime = new TimeSpan(int.Parse(deloviPocetak[0]), int.Parse(deloviPocetak[1]), 0); * TimeSpan krajTime = new TimeSpan(int.Parse(deloviKraj[0]), int.Parse(deloviKraj[1]), 0); * int result3 = TimeSpan.Compare(vremee, pocetakTime); * int result4 = TimeSpan.Compare(krajTime, vremee); * * if (result3 != 1 || result4 != 1) * { * MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi u to vreme.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * * return; * * }*/ AppointmentController apCon = new AppointmentController(); apCon.New(drap, null); int id1 = 0; String ime = ""; String prezime = ""; String jmbg = ""; String datumRodj = ""; String brojTel = ""; String brKnj = ""; List <Question> pitanja = new List <Question>(); String alergije = ""; String grad = ""; Boolean guest = false; String email = ""; String password = ""; Boolean sekr = false; // foreach (PatientUser pat in lista) // { // if (pat.id.Equals(d.patient.id)) // { id1 = drap.patient.id; ime = drap.patient.firstName; prezime = drap.patient.secondName; jmbg = drap.patient.uniqueCitizensidentityNumber; datumRodj = drap.patient.dateOfBirth; brKnj = drap.patient.medicalIdNumber; brojTel = drap.patient.phoneNumber; alergije = drap.patient.allergie; grad = drap.patient.city; email = drap.patient.email; guest = drap.patient.guest; password = drap.patient.password; sekr = drap.patient.isRegisteredBySecretary; if (drap.patient.notifications == null) { drap.patient.notifications = new List <ModelNotification>(); } List <ModelNotification> notifications = drap.patient.notifications; // } notifications.Add(new ModelNotification("Postovani, zakazana vam je novi pregled datuma : " + drap.date + " u " + drap.time + " h kod lekara " + drap.doctor.firstName + " " + drap.doctor.secondName + ". Ordinacija: " + drap.roomid)); drap.patient.notifications = notifications; // PatientUser rp = new PatientUser(id1, ime, prezime, jmbg, datumRodj, brojTel, brKnj, pitanja, alergije, grad, guest, email, password, sekr, notifications); PatientController pCon = new PatientController(); pCon.Update(drap.patient); Panel.Children.Clear(); UserControl usc = new RezervisaniiTermini(); Panel.Children.Add(usc); } else if (operacija == true) { String datum = DatumBox.Text; String[] delovi2 = datum.Split('/'); int mesec = int.Parse(delovi2[1]); int dan = int.Parse(delovi2[0]); int godina = int.Parse(delovi2[2]); DateTime dt1 = new DateTime(godina, mesec, dan, 0, 0, 0); DateTime dt2 = DateTime.Now; if (dt2 > dt1) { MessageBox.Show("Molimo vas da unesete termin koji tek predstoji", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } String x = bingPathToAppDir(@"JsonFiles\appointments.json"); AppointmentRepository apc = new AppointmentRepository(x); /* List<DoctorAppointment> listaPregleda = apc.GetAll(); * foreach (DoctorAppointment dd in listaPregleda) * { * DoctorUser dr = dd.doctor; * if (dr.id == drOvaj.id) * { * if (dd.Date.Equals(DatumBox.Text)) * { * TimeSpan krajPr = dd.Time + new TimeSpan(0, 15, 0); * int result = TimeSpan.Compare(vremee, dd.Time); * int result1 = TimeSpan.Compare(vremee, krajPr); * if ((result == 1 && result1 == -1) || result == 0) * { * MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * return; * } * int rezultat = TimeSpan.Compare(vremee2, dd.Time); * int rezultat1 = TimeSpan.Compare(vremee2, krajPr); * if ((rezultat == 1 && rezultat1 == -1) || rezultat == 0) * { * * MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * return; * } * } * * * * * } * }*/ /*String pre = bingPathToAppDir(@"JsonFiles\operations.json"); * OperationRepository apc1 = new OperationRepository(pre); * List<Operation> listaPregleda1 = apc1.GetAll(); * foreach (Operation dd in listaPregleda1) * { * DoctorUser dr = dd.isResponiable; * if (dr.id == drOvaj.id) * { * if (dd.Date.Equals(DatumBox.Text)) * { * int result = TimeSpan.Compare(vremee, dd.Start); * int result1 = TimeSpan.Compare(vremee, dd.End); * if ((result == 1 && result1 == -1) || result == 0) * { * * MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * return; * } * int rezultat = TimeSpan.Compare(vremee2, dd.Start); * int rezultat1 = TimeSpan.Compare(vremee2, dd.End); * if ((rezultat == 1 && rezultat1 == -1) || rezultat == 0) * { * * MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * return; * } * } * * * * * } * }*/ OperationController opCon = new OperationController(); bool zauzetTermin = opCon.isTermNotAvailable(drOvaj, vremee, vremee2, DatumBox.Text, ovajPacijent); if (zauzetTermin == true) { MessageBox.Show("Trazeni termin nije dostupan.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } EmployeesScheduleController schCon = new EmployeesScheduleController(); List <Schedule> listaRasporeda = schCon.GetAll(); Shift smena = schCon.getShiftForDoctorForSpecificDay(DatumBox.Text, drOvaj); if (smena == null || smena.startTime == null || smena.endTime == null) { MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi tog dana.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } bool slobodan = schCon.isDoctorWorkingAtSpecifiedTime(DatumBox.Text, drOvaj, vremee); if (slobodan == false) { MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi u to vreme.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } String pocetak = smena.startTime; String kraj = smena.endTime; String[] deloviPocetak = pocetak.Split(':'); String[] deloviKraj = kraj.Split(':'); TimeSpan pocetakTime = new TimeSpan(int.Parse(deloviPocetak[0]), int.Parse(deloviPocetak[1]), int.Parse("00")); TimeSpan krajTime = new TimeSpan(int.Parse(deloviKraj[0]), int.Parse(deloviKraj[1]), int.Parse("00")); int result3 = TimeSpan.Compare(vremee2, pocetakTime); int result4 = TimeSpan.Compare(krajTime, vremee2); if (result3 != 1 || result4 != 1) { MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi u to vreme.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } /* EmployeesScheduleController schCon = new EmployeesScheduleController(); * List<Schedule> listaRasporeda = schCon.GetAll(); * Shift smena = new Shift(); * foreach (Schedule s in listaRasporeda) * { * * if (s.employeeid.Equals(drOvaj.id.ToString())) * { * if (s.Date.Equals(DatumBox.Text)) * { * smena = s.shift; * } * } * } * if (smena.StartTime == null || smena.EndTime == null) * { * MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi tog dana.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * * return; * }*/ /* String pocetak = smena.StartTime; * String kraj = smena.EndTime; * String[] deloviPocetak = pocetak.Split(':'); * String[] deloviKraj = kraj.Split(':'); * * TimeSpan pocetakTime = new TimeSpan(int.Parse(deloviPocetak[0]), int.Parse(deloviPocetak[1]), int.Parse("00")); * TimeSpan krajTime = new TimeSpan(int.Parse(deloviKraj[0]), int.Parse(deloviKraj[1]), int.Parse("00")); * int result3 = TimeSpan.Compare(vremee, pocetakTime); * int result4 = TimeSpan.Compare(krajTime, vremee); * * if (result3 != 1 || result4 != 1) * { * MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi u to vreme.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * * return; * * }*/ opCon.New(null, op); PatientController pCon = new PatientController(); List <PatientUser> pacijenti = pCon.GetAll(); int id1 = 0; String ime = ""; String prezime = ""; String jmbg = ""; String datumRodj = ""; String brojTel = ""; String brKnj = ""; List <Question> pitanja = new List <Question>(); String alergije = ""; String grad = ""; Boolean guest = false; String email = ""; String password = ""; Boolean sekr = false; List <ModelNotification> notifications = new List <ModelNotification>(); // foreach (PatientUser pat in lista) // { // if (pat.id.Equals(d.patient.id)) // { id1 = op.patient.id; ime = op.patient.firstName; prezime = op.patient.secondName; jmbg = op.patient.uniqueCitizensidentityNumber; datumRodj = op.patient.dateOfBirth; brojTel = op.patient.phoneNumber; alergije = op.patient.allergie; grad = op.patient.city; email = op.patient.email; guest = op.patient.guest; password = op.patient.password; sekr = op.patient.isRegisteredBySecretary; notifications = op.patient.notifications; // } if (notifications == null) { notifications = new List <ModelNotification>(); } notifications.Add(new ModelNotification("Postovani, zakazana Vam je nova operacija datuma : " + op.date + " u " + op.start + " h, kod lekara " + op.isResponiable.firstName + " " + op.isResponiable.secondName + " Sala " + op.idRoom)); PatientUser rp = new PatientUser(id1, ime, prezime, jmbg, datumRodj, brojTel, brKnj, alergije, grad, guest, email, password, sekr, notifications); pCon.Update(rp); Panel.Children.Clear(); UserControl usc = new RezervisaniiTermini(); Panel.Children.Add(usc); } }
public RetrieveResponse <VisitTypesPerGenderChartResponse> VisitTypesPerGenderChart(IDbConnection connection) { var response = new VisitTypesPerGenderChartResponse(); var visitTypes = new VisitTypesRepository().List(connection, new ListRequest()).Entities; if (visitTypes.Any()) { response.labels = visitTypes.Select(vt => vt.Name).ToList(); } // For each the enum because we don't know the count of genders foreach (Gender gender in Enum.GetValues(typeof(Gender))) { var dataset = new VisitTypesPerGenderChartResponse.Dataset(); dataset.label = gender.ToString(); dataset.backgroundColor = visitTypes.Select(s => s.BackgroundColor).ToList(); // Get Patients contained in filtered visits var patientFields = PatientsRow.Fields; var patientsRequest = new ListRequest(); patientsRequest.ColumnSelection = ColumnSelection.KeyOnly; patientsRequest.IncludeColumns = new HashSet <string> { patientFields.Gender.Name }; patientsRequest.Criteria = (new Criteria(patientFields.Gender.Name) == gender); var patients = new PatientsRepository().List(connection, patientsRequest).Entities; if (patients.Any()) { dataset.PatientsTotal = patients.Count; var visitsFields = VisitsRow.Fields; var visits = connection.List <VisitsRow>(s => s .Select(visitsFields.VisitId).Select(visitsFields.VisitTypeId).Select(visitsFields.PatientId) .Where(visitsFields.PatientId.In(patients.Select(p => p.PatientId)))); dataset.VisitsTotal = visits.Count; var tempCounter = 0; foreach (var visitTypesRow in visitTypes) { var visitsCounter = connection.Count <VisitsRow>( visitsFields.VisitTypeId == visitTypesRow.VisitTypeId.Value && visitsFields.PatientId.In(patients.Select(p => p.PatientId))); if (visitsCounter > tempCounter) { dataset.MostReservedVisitType = visitTypesRow.Name; } dataset.data.Add(visitsCounter); } } else { dataset.data.Add(0); } response.datasets.Add(dataset); } return(new RetrieveResponse <VisitTypesPerGenderChartResponse> { Entity = response }); }
public PatientService(ILogger <PatientService> logger, PatientsRepository db) { Db = db; Logger = logger; }
/// <summary> This method is calling <c>PatientsRepository</c> to get list of all<c>PatientUser</c>. </summary> /// <returns> List of all patients. </returns> public List <PatientUser> GetAll() { return(PatientsRepository.GetAll()); }
/// <summary> This method is calling <c>PatientsRepository</c> to validate patients account. </summary> /// <param name="id"><c>id</c> is id of patient who's account needs to be validated. /// </param> /// <returns>if validated patient exists returns successfully validated patient; otherwise, return <c>null</c></returns> public PatientUser Validate(int id) { PatientUser patient = PatientsRepository.FindOne(id); return(patient != null?PatientsRepository.Validate(patient) : null); }
public PatientService() { _patientsFile = new PatientsRepository(); }
/// <summary> This method is calling <c>PatientRepository</c> to find one patient using <paramref name="id"/>. </summary> /// <param name="id"><c>id</c> is <c>id</c> of a <c>PatientUser</c> that needs to be found. /// <returns>One patient</returns> public PatientUser GetOne(int id) { return(PatientsRepository.FindOne(id)); }
private async void PopulatePatientsRepository() { var patients = await DatabaseHandler.Instance.GetPatients(CurrentUser.Id); PatientsRepository.SetPatient(patients); }
public void InitRepositories() { PatientsRepository = new PatientsRepository(); WeekRepository = new WeekRepository(); }
private void Zakazi_click(object sender, RoutedEventArgs e) { String b = bingPathToAppDir(@"JsonFiles\appointments.json"); String c = bingPathToAppDir(@"JsonFiles\refferal.json"); String d = bingPathToAppDir(@"JsonFiles\patients.json"); String m = bingPathToAppDir(@"JsonFiles\doctors.json"); PatientsRepository patientRepo = new PatientsRepository(d); List <PatientUser> patientLista = patientRepo.GetAll(); PatientUser ovajPacijent = new PatientUser(); foreach (PatientUser r1 in patientLista) { if (r1.medicalIdNumber.Equals(KnjizicaBox.Text.ToString())) { ovajPacijent = r1; KnjizicaBox.Text = r1.medicalIdNumber; } } DoctorRepository docRepo = new DoctorRepository(m); List <DoctorUser> doktori = docRepo.GetAll(); DoctorUser drOvaj = new DoctorUser(); foreach (DoctorUser d1 in doktori) { if (d1.email.Equals(emailLekarBox.Text.ToString())) { drOvaj = d1; } } String konacnoVreme = ""; String vreme = TimeText; Console.WriteLine(vreme); String[] deliciVreme = vreme.Split(' '); String[] satIminut = deliciVreme[0].Split(':'); String sat = satIminut[0]; String minut = satIminut[1]; String kada = deliciVreme[1]; StringBuilder sb = new StringBuilder(); if (kada.Equals("AM")) { sb.Append(deliciVreme[0]); sb.Append(":00"); } else { if (sat.Equals("1")) { sb.Append("13:"); sb.Append(minut); sb.Append(":00"); } else if (sat.Equals("2")) { sb.Append("14:"); sb.Append(minut); sb.Append(":00"); } else if (sat.Equals("3")) { sb.Append("15:"); sb.Append(minut); sb.Append(":00"); } else if (sat.Equals("4")) { sb.Append("16:"); sb.Append(minut); sb.Append(":00"); } else if (sat.Equals("5")) { sb.Append("17:"); sb.Append(minut); sb.Append(":00"); } else if (sat.Equals("6")) { sb.Append("18:"); sb.Append(minut); sb.Append(":00"); } else if (sat.Equals("7")) { sb.Append("19:"); sb.Append(minut); sb.Append(":00"); } else if (sat.Equals("8")) { sb.Append("20:"); sb.Append(minut); sb.Append(":00"); } else if (sat.Equals("9")) { sb.Append("21:"); sb.Append(minut); sb.Append(":00"); } else if (sat.Equals("10")) { sb.Append("22:"); sb.Append(minut); sb.Append(":00"); } else if (sat.Equals("11")) { sb.Append("23:"); sb.Append(minut); sb.Append(":00"); } else { sb.Append("00:"); sb.Append(minut); sb.Append(":00"); } } konacnoVreme = sb.ToString(); Console.WriteLine(konacnoVreme); String[] zaTs = konacnoVreme.Split(':'); int minutiVreme = int.Parse(zaTs[1]); TimeSpan ts = new TimeSpan(int.Parse(zaTs[0]), minutiVreme, int.Parse(zaTs[2])); String konacnoVreme1 = ""; String vreme1 = TimeText1; Console.WriteLine(vreme); String[] deliciVreme1 = vreme1.Split(' '); String[] satIminut1 = deliciVreme1[0].Split(':'); String sat1 = satIminut1[0]; String minut1 = satIminut1[1]; String kada1 = deliciVreme1[1]; StringBuilder sb1 = new StringBuilder(); if (kada1.Equals("AM")) { sb1.Append(deliciVreme1[0]); sb1.Append(":00"); } else { if (sat1.Equals("1")) { sb1.Append("13:"); sb1.Append(minut1); sb1.Append(":00"); } else if (sat1.Equals("2")) { sb1.Append("14:"); sb1.Append(minut1); sb1.Append(":00"); } else if (sat1.Equals("3")) { sb1.Append("15:"); sb1.Append(minut1); sb1.Append(":00"); } else if (sat1.Equals("4")) { sb1.Append("16:"); sb1.Append(minut1); sb1.Append(":00"); } else if (sat1.Equals("5")) { sb1.Append("17:"); sb1.Append(minut1); sb1.Append(":00"); } else if (sat1.Equals("6")) { sb1.Append("18:"); sb1.Append(minut1); sb1.Append(":00"); } else if (sat1.Equals("7")) { sb1.Append("19:"); sb1.Append(minut1); sb1.Append(":00"); } else if (sat1.Equals("8")) { sb1.Append("20:"); sb1.Append(minut1); sb1.Append(":00"); } else if (sat1.Equals("9")) { sb1.Append("21:"); sb1.Append(minut1); sb1.Append(":00"); } else if (sat1.Equals("10")) { sb1.Append("22:"); sb1.Append(minut1); sb1.Append(":00"); } else if (sat1.Equals("11")) { sb1.Append("23:"); sb1.Append(minut1); sb1.Append(":00"); } else { sb1.Append("00:"); sb1.Append(minut1); sb1.Append(":00"); } } konacnoVreme1 = sb1.ToString(); Console.WriteLine(konacnoVreme); Console.WriteLine(konacnoVreme1); String[] zaTs1 = konacnoVreme1.Split(':'); int minutiVreme1 = int.Parse(zaTs1[1]); TimeSpan ts1 = new TimeSpan(int.Parse(zaTs1[0]), minutiVreme1, int.Parse(zaTs1[2])); String[] deloviVreme = vreme.Split(':'); //String[] deloviVreme2 = vreme2.Split(':'); // TimeSpan vremee = new TimeSpan(int.Parse(deloviVreme[0]), int.Parse(deloviVreme[1]), 0); // TimeSpan vremee2 = new TimeSpan(int.Parse(deloviVreme2[0]), int.Parse(deloviVreme2[1]), 0); int broj = getNextid(); DoctorAppointment drap = new DoctorAppointment(0, ts, DatumBox.Text.ToString(), ovajPacijent, drOvaj, null, ordinacijaBox.Text); AppointmentRepository arepo = new AppointmentRepository(b); List <DoctorAppointment> lista2 = new List <DoctorAppointment>(); PatientController regPat = new PatientController(); List <PatientUser> pac = new List <PatientUser>(); pac = regPat.GetAll(); if (arepo.GetAll() != null) { lista2 = arepo.GetAll(); } String o = bingPathToAppDir(@"JsonFiles\operations.json"); int broj1 = getNextid1(); Operation op = new Operation(0, ovajPacijent, DatumBox.Text.ToString(), ts, ts1, drOvaj, ordinacijaBox.Text, null); OperationRepository opRep = new OperationRepository(o); List <Operation> lista3 = new List <Operation>(); if (opRep.GetAll() != null) { lista3 = opRep.GetAll(); } if (pregled == true) { String datum = DatumBox.Text; String[] delovi2 = datum.Split('/'); int mesec = int.Parse(delovi2[1]); int dan = int.Parse(delovi2[0]); int godina = int.Parse(delovi2[2]); DateTime dt1 = new DateTime(godina, mesec, dan, 0, 0, 0); DateTime dt2 = DateTime.Now; if (dt1 < dt2) { MessageBox.Show("Molimo vas da unesete datum koji tek predstoji", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } String x = bingPathToAppDir(@"JsonFiles\appointments.json"); AppointmentRepository apc = new AppointmentRepository(x); List <DoctorAppointment> listaPregleda = apc.GetAll(); /* foreach (DoctorAppointment dd in listaPregleda) * { * DoctorUser dr = dd.doctor; * if (dr.id == drOvaj.id) * { * if (dd.Date.Equals(DatumBox.Text)) * { * TimeSpan krajPr = dd.Time + new TimeSpan(0, 15, 0); * int result = TimeSpan.Compare(vremee, dd.Time); * int result1 = TimeSpan.Compare(vremee, krajPr); * if ((result == 1 && result1 == -1) || result == 0) * { * MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * return; * } * } * * * * * } * }*/ /* String pre = bingPathToAppDir(@"JsonFiles\operations.json"); * OperationRepository apc1 = new OperationRepository(pre); * List<Operation> listaPregleda1 = apc1.GetAll(); * foreach (Operation dd in listaPregleda1) * { * DoctorUser dr = dd.isResponiable; * if (dr.id == drOvaj.id) * { * if (dd.Date.Equals(DatumBox.Text)) * { * int result = TimeSpan.Compare(vremee, dd.Start); * int result1 = TimeSpan.Compare(vremee, dd.End); * if ((result == 1 && result1 == -1)||result==0 ||result1==0) * { * * MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * return; * } * * } * * * * * } * }*/ EmployeesScheduleController schCon = new EmployeesScheduleController(); List <Schedule> listaRasporeda = schCon.GetAll(); Shift smena = schCon.getShiftForDoctorForSpecificDay(DatumBox.Text, drOvaj); if (smena == null || smena.startTime == null || smena.endTime == null) { MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi tog dana.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } AppointmentController appointmentController = new AppointmentController(); Boolean notAvaible = appointmentController.isTermNotAvailable(drOvaj, ts, DatumBox.Text, ovajPacijent); if (notAvaible == true) { MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } /* foreach (Schedule s in listaRasporeda) * { * * if (s.employeeid.Equals(drOvaj.id.ToString())) * { * if (s.Date.Equals(DatumBox.Text)) * { * smena = s.shift; * } * } * } * if(smena.StartTime==null || smena.EndTime == null) * { * * }*/ bool slobodan = schCon.isDoctorWorkingAtSpecifiedTime(DatumBox.Text, drOvaj, ts); if (slobodan == false) { MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi u to vreme.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } /* String pocetak = smena.StartTime; * String kraj = smena.EndTime; * String[] deloviPocetak = pocetak.Split(':'); * String[] deloviKraj = kraj.Split(':'); * * TimeSpan pocetakTime = new TimeSpan(int.Parse(deloviPocetak[0]), int.Parse(deloviPocetak[1]), 0); * TimeSpan krajTime = new TimeSpan(int.Parse(deloviKraj[0]), int.Parse(deloviKraj[1]), 0); * int result3 = TimeSpan.Compare(vremee, pocetakTime); * int result4 = TimeSpan.Compare(krajTime, vremee); * * if (result3 != 1 || result4 != 1) * { * MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi u to vreme.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * * return; * * }*/ AppointmentController apCon = new AppointmentController(); apCon.New(drap, null); int id1 = 0; String ime = ""; String prezime = ""; String jmbg = ""; String datumRodj = ""; String brojTel = ""; String brKnj = ""; List <Question> pitanja = new List <Question>(); String alergije = ""; String grad = ""; Boolean guest = false; String email = ""; String password = ""; Boolean sekr = false; // foreach (PatientUser pat in lista) // { // if (pat.id.Equals(d.patient.id)) // { id1 = drap.patient.id; ime = drap.patient.firstName; prezime = drap.patient.secondName; jmbg = drap.patient.uniqueCitizensidentityNumber; datumRodj = drap.patient.dateOfBirth; brKnj = drap.patient.medicalIdNumber; brojTel = drap.patient.phoneNumber; alergije = drap.patient.allergie; grad = drap.patient.city; email = drap.patient.email; guest = drap.patient.guest; password = drap.patient.password; sekr = drap.patient.isRegisteredBySecretary; if (drap.patient.notifications == null) { drap.patient.notifications = new List <ModelNotification>(); } List <ModelNotification> notifications = drap.patient.notifications; // } notifications.Add(new ModelNotification("Postovani, zakazana vam je novi pregled datuma : " + drap.date + " u " + drap.time + " h kod lekara " + drap.doctor.firstName + " " + drap.doctor.secondName + ". Ordinacija: " + drap.roomid)); drap.patient.notifications = notifications; // PatientUser rp = new PatientUser(id1, ime, prezime, jmbg, datumRodj, brojTel, brKnj, pitanja, alergije, grad, guest, email, password, sekr, notifications); PatientController pCon = new PatientController(); pCon.Update(drap.patient); Panel.Children.Clear(); UserControl usc = new PopunjeniTermini(); Panel.Children.Add(usc); } else if (operacija == true) { String datum = DatumBox.Text; String[] delovi2 = datum.Split('/'); int mesec = int.Parse(delovi2[1]); int dan = int.Parse(delovi2[0]); int godina = int.Parse(delovi2[2]); DateTime dt1 = new DateTime(godina, mesec, dan, 0, 0, 0); DateTime dt2 = DateTime.Now; if (dt2 > dt1) { MessageBox.Show("Molimo vas da unesete termin koji tek predstoji", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } String x = bingPathToAppDir(@"JsonFiles\appointments.json"); AppointmentRepository apc = new AppointmentRepository(x); /* List<DoctorAppointment> listaPregleda = apc.GetAll(); * foreach (DoctorAppointment dd in listaPregleda) * { * DoctorUser dr = dd.doctor; * if (dr.id == drOvaj.id) * { * if (dd.Date.Equals(DatumBox.Text)) * { * TimeSpan krajPr = dd.Time + new TimeSpan(0, 15, 0); * int result = TimeSpan.Compare(vremee, dd.Time); * int result1 = TimeSpan.Compare(vremee, krajPr); * if ((result == 1 && result1 == -1) || result == 0) * { * MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * return; * } * int rezultat = TimeSpan.Compare(vremee2, dd.Time); * int rezultat1 = TimeSpan.Compare(vremee2, krajPr); * if ((rezultat == 1 && rezultat1 == -1) || rezultat == 0) * { * * MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * return; * } * } * * * * * } * }*/ /*String pre = bingPathToAppDir(@"JsonFiles\operations.json"); * OperationRepository apc1 = new OperationRepository(pre); * List<Operation> listaPregleda1 = apc1.GetAll(); * foreach (Operation dd in listaPregleda1) * { * DoctorUser dr = dd.isResponiable; * if (dr.id == drOvaj.id) * { * if (dd.Date.Equals(DatumBox.Text)) * { * int result = TimeSpan.Compare(vremee, dd.Start); * int result1 = TimeSpan.Compare(vremee, dd.End); * if ((result == 1 && result1 == -1) || result == 0) * { * * MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * return; * } * int rezultat = TimeSpan.Compare(vremee2, dd.Start); * int rezultat1 = TimeSpan.Compare(vremee2, dd.End); * if ((rezultat == 1 && rezultat1 == -1) || rezultat == 0) * { * * MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * return; * } * } * * * * * } * }*/ OperationController opCon = new OperationController(); bool zauzetTermin = opCon.isTermNotAvailable(drOvaj, ts, ts1, DatumBox.Text, ovajPacijent); if (zauzetTermin == true) { MessageBox.Show("Trazeni termin nije dostupan.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } EmployeesScheduleController schCon = new EmployeesScheduleController(); List <Schedule> listaRasporeda = schCon.GetAll(); Shift smena = schCon.getShiftForDoctorForSpecificDay(DatumBox.Text, drOvaj); if (smena == null || smena.startTime == null || smena.endTime == null) { MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi tog dana.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } bool slobodan = schCon.isDoctorWorkingAtSpecifiedTime(DatumBox.Text, drOvaj, ts); if (slobodan == false) { MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi u to vreme.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } int ispravno = TimeSpan.Compare(ts1, ts); if (ispravno == -1 || ispravno == 0) { MessageBox.Show("Operacija mora imati trajanje!", "Greska", MessageBoxButton.OK); return; } /* String pocetak = smena.StartTime; * String kraj = smena.EndTime; * String[] deloviPocetak = pocetak.Split(':'); * String[] deloviKraj = kraj.Split(':'); * * TimeSpan pocetakTime = new TimeSpan(int.Parse(deloviPocetak[0]), int.Parse(deloviPocetak[1]), int.Parse("00")); * TimeSpan krajTime = new TimeSpan(int.Parse(deloviKraj[0]), int.Parse(deloviKraj[1]), int.Parse("00")); * int result3 = TimeSpan.Compare(vremee2, pocetakTime); * int result4 = TimeSpan.Compare(krajTime, vremee2); * * if (result3 != 1 || result4 != 1) * { * MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi u to vreme.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * * return; * * }*/ /* EmployeesScheduleController schCon = new EmployeesScheduleController(); * List<Schedule> listaRasporeda = schCon.GetAll(); * Shift smena = new Shift(); * foreach (Schedule s in listaRasporeda) * { * * if (s.employeeid.Equals(drOvaj.id.ToString())) * { * if (s.Date.Equals(DatumBox.Text)) * { * smena = s.shift; * } * } * } * if (smena.StartTime == null || smena.EndTime == null) * { * MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi tog dana.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * * return; * }*/ /* String pocetak = smena.StartTime; * String kraj = smena.EndTime; * String[] deloviPocetak = pocetak.Split(':'); * String[] deloviKraj = kraj.Split(':'); * * TimeSpan pocetakTime = new TimeSpan(int.Parse(deloviPocetak[0]), int.Parse(deloviPocetak[1]), int.Parse("00")); * TimeSpan krajTime = new TimeSpan(int.Parse(deloviKraj[0]), int.Parse(deloviKraj[1]), int.Parse("00")); * int result3 = TimeSpan.Compare(vremee, pocetakTime); * int result4 = TimeSpan.Compare(krajTime, vremee); * * if (result3 != 1 || result4 != 1) * { * MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi u to vreme.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * * return; * * }*/ opCon.New(null, op); PatientController pCon = new PatientController(); List <PatientUser> pacijenti = pCon.GetAll(); int id1 = 0; String ime = ""; String prezime = ""; String jmbg = ""; String datumRodj = ""; String brojTel = ""; String brKnj = ""; List <Question> pitanja = new List <Question>(); String alergije = ""; String grad = ""; Boolean guest = false; String email = ""; String password = ""; Boolean sekr = false; // List<String> notifications = new List<String>(); // foreach (PatientUser pat in lista) // { // if (pat.id.Equals(d.patient.id)) // { id1 = op.patient.id; ime = op.patient.firstName; prezime = op.patient.secondName; jmbg = op.patient.uniqueCitizensidentityNumber; datumRodj = op.patient.dateOfBirth; brojTel = op.patient.phoneNumber; alergije = op.patient.allergie; grad = op.patient.city; email = op.patient.email; guest = op.patient.guest; password = op.patient.password; sekr = op.patient.isRegisteredBySecretary; // } // PatientUser rp = new PatientUser(id1, ime, prezime, jmbg, datumRodj, brojTel, brKnj, pitanja, alergije, grad, guest, email, password, sekr, notifications); if (op.patient.notifications == null) { op.patient.notifications = new List <ModelNotification>(); } List <ModelNotification> notifications = drap.patient.notifications; // } notifications.Add(new ModelNotification("Postovani, zakazana Vam je nova operacija datuma : " + op.date + " u " + op.start + " h, kod lekara " + op.isResponiable.firstName + " " + op.isResponiable.secondName + " Sala " + op.idRoom)); op.patient.notifications = notifications; pCon.Update(op.patient); Panel.Children.Clear(); UserControl usc = new PopunjeniTermini(); Panel.Children.Add(usc); } }
public PatientService() { patientsRepository = new PatientsRepository(path); }
public PatientService(MyDbContext context) { PatientsRepository = new PatientsRepository(context); }
public PatientsController(PatientsRepository patientsRepository) { _patientsRepository = patientsRepository; }