public static AppointmentDbContext CreateInMemoryDbContext()
        {
            var builder = new DbContextOptionsBuilder <AppointmentDbContext>();

            builder.UseInMemoryDatabase(Guid.NewGuid().ToString());
            var dbcontext = new AppointmentDbContext(builder.Options);

            dbcontext.Database.EnsureCreated();
            return(dbcontext);
        }
Ejemplo n.º 2
0
        public void SeedSurveyQuestions(AppointmentDbContext context)
        {
            context.Add(new SurveyQuestion {
                Question = "How would you rate the kindness of your doctor?", QuestionType = QuestionType.DOCTOR, Status = true
            });
            context.Add(new SurveyQuestion {
                Question = "To what extent has your doctor clearly stated what your examination will look like and instructed you on how to behave?", QuestionType = QuestionType.DOCTOR, Status = true
            });
            context.Add(new SurveyQuestion {
                Question = "How would you rate the clarity and expertise of the doctor in making the diagnosis?", QuestionType = QuestionType.DOCTOR, Status = true
            });
            context.Add(new SurveyQuestion {
                Question = "How would you rate the competence of your doctor during the treatment?", QuestionType = QuestionType.DOCTOR, Status = true
            });
            context.Add(new SurveyQuestion {
                Question = "To what extent has your doctor paid attention to you and contributed to your more comfortable stay in the hospital?", QuestionType = QuestionType.DOCTOR, Status = true
            });
            context.Add(new SurveyQuestion {
                Question = "How would you rate the helpfulness and kindness of the information counter employees?", QuestionType = QuestionType.MEDICAL_STUFF, Status = true
            });
            context.Add(new SurveyQuestion {
                Question = "How would you rate the helpfulness and kindness of nurses and technicians?", QuestionType = QuestionType.MEDICAL_STUFF, Status = true
            });
            context.Add(new SurveyQuestion {
                Question = "To what extent were nurses and technicians professional in treatment?", QuestionType = QuestionType.MEDICAL_STUFF, Status = true
            });
            context.Add(new SurveyQuestion {
                Question = "To what extent have nurses and technicians paid attention to you and your comfortable hospital stay?", QuestionType = QuestionType.MEDICAL_STUFF, Status = true
            });
            context.Add(new SurveyQuestion {
                Question = "To what extent have nurses and technicians instructed you in the procedures they will perform during your treatment?", QuestionType = QuestionType.MEDICAL_STUFF, Status = true
            });
            context.Add(new SurveyQuestion {
                Question = "How would you rate the cleanliness of hospital hallways and waiting rooms?", QuestionType = QuestionType.HOSPITAL, Status = true
            });
            context.Add(new SurveyQuestion {
                Question = "How would you rate the cleanliness of the toilet in the hospital?", QuestionType = QuestionType.HOSPITAL, Status = true
            });
            context.Add(new SurveyQuestion {
                Question = "How would you rate the cleanliness and comfort of the patient's room?", QuestionType = QuestionType.HOSPITAL, Status = true
            });
            context.Add(new SurveyQuestion {
                Question = "To what extent are you satisfied with the equipment of the hospital for the needs of your treatment?", QuestionType = QuestionType.HOSPITAL, Status = true
            });
            context.Add(new SurveyQuestion {
                Question = "How would you rate the organization of the hospital when scheduling an examination?", QuestionType = QuestionType.HOSPITAL, Status = true
            });

            context.SaveChanges();
        }
Ejemplo n.º 3
0
        private async Task SeedUserData(IServiceProvider serviceProvider, AppointmentDbContext context)
        {
            var userManager = serviceProvider.GetService <UserManager <User> >();

            var superAdminEmail = Configuration.GetValue <string>("Admin:Email");
            var user            = await userManager.FindByEmailAsync(superAdminEmail);

            if (user == null)
            {
                user = new User
                {
                    UserName       = superAdminEmail,
                    Email          = superAdminEmail,
                    EmailConfirmed = true
                };

                string superAdminPassword = Configuration.GetValue <string>("Admin:Password");
                await userManager.CreateAsync(user, superAdminPassword);
            }
        }
        public async Task Initialize(AppointmentDbContext context)
        {
            string[] customers = { "John Oliver", "Trevor Noah", "Stephen Colbert" };
            string[] carModels = { "Audi A3", "Audi Q4", "Audi Q5" };

            for (int i = 0; i < customers.Length; i++)
            {
                var appointment = new AppointmentItem()
                {
                    Price           = 100,
                    CustomerName    = customers[i],
                    CarModel        = carModels[i],
                    Created         = DateTime.Now,
                    Status          = AppointmentStatus.Active,
                    AppointmentDate = appointmentsHelper.GetRandomAppointmentDate(appSettings.MaximumDaysForRandomAppointmentDate)
                };
                context.AppointmentItems.Add(appointment);
            }
            await context.SaveChangesAsync();
        }
Ejemplo n.º 5
0
        public string Post()
        {
            DanpheHTTPResponse <Object> responseData = new DanpheHTTPResponse <Object>();

            try
            {
                string str     = this.ReadPostData();
                string reqType = this.ReadQueryStringData("reqType");
                //if (!string.IsNullOrEmpty(reqType) && reqType == "quickAppointment")
                //{
                //    return QuickAppointmentCreate();
                //}
                //else
                //{
                AppointmentModel ipApptModel = DanpheJSONConvert.DeserializeObject <AppointmentModel>(str);

                if (ipApptModel.PatientId == 0)
                {
                    ipApptModel.PatientId = null;
                }

                AppointmentDbContext apptDbContext = new AppointmentDbContext(connString);

                apptDbContext.Appointments.Add(ipApptModel);
                apptDbContext.SaveChanges();
                responseData.Results = ipApptModel;
                responseData.Status  = "OK";

                // }
            }
            catch (Exception ex)
            {
                responseData.Status       = "Failed";
                responseData.ErrorMessage = ex.Message + " exception details:" + ex.ToString();
            }

            return(DanpheJSONConvert.SerializeObject(responseData, true));
        }
Ejemplo n.º 6
0
        public static async Task Seed(IServiceScope scope)
        {
            var serviceProvider                  = scope.ServiceProvider;
            AppointmentDbContext appContext      = serviceProvider.GetRequiredService <AppointmentDbContext>();
            ApplicationDbContext identityContext = serviceProvider.GetRequiredService <ApplicationDbContext>();

            appContext.Database.Migrate();

            if (!appContext.Doctors.Any())
            {
                await SeedEverything(appContext);
            }

            //var adminID = await EnsureUser(serviceProvider, "1234", "*****@*****.**",0);
            //await EnsureRole(serviceProvider, adminID, RandevuTakip.Entities.Identity.Security.Constants.AdministratorsRole);

            var sampleDoctor = await EnsureUser <Doctor>(serviceProvider, "1234", "*****@*****.**", appContext.Doctors.SingleOrDefault(x => x.Surname == "Kahraman").UserGuidId);

            await EnsureRole(serviceProvider, sampleDoctor, RandevuTakip.Entities.Identity.Security.Constants.Doctor);

            var sampleDoctor2 = await EnsureUser <Doctor>(serviceProvider, "1234", "*****@*****.**", appContext.Doctors.SingleOrDefault(x => x.Surname == "Açıkalın").UserGuidId);

            await EnsureRole(serviceProvider, sampleDoctor2, RandevuTakip.Entities.Identity.Security.Constants.Doctor);

            var sampleDoctor3 = await EnsureUser <Doctor>(serviceProvider, "1234", "*****@*****.**", appContext.Doctors.SingleOrDefault(x => x.Surname == "Denek").UserGuidId);

            await EnsureRole(serviceProvider, sampleDoctor3, RandevuTakip.Entities.Identity.Security.Constants.Doctor);

            var samplePatient = await EnsureUser <Patient>(serviceProvider, "1234", "*****@*****.**", appContext.Patients.SingleOrDefault(x => x.Surname == "Federer").UserGuidId);

            await EnsureRole(serviceProvider, samplePatient, RandevuTakip.Entities.Identity.Security.Constants.Patient);

            var samplePatient2 = await EnsureUser <Patient>(serviceProvider, "1234", "*****@*****.**", appContext.Patients.SingleOrDefault(x => x.Surname == "Gelirgeçer").UserGuidId);

            await EnsureRole(serviceProvider, samplePatient2, RandevuTakip.Entities.Identity.Security.Constants.Patient);
        }
Ejemplo n.º 7
0
 public void SeedAllEntities(AppointmentDbContext context)
 {
     SeedAppointments(context);
     SeedSurveyQuestions(context);
 }
 public AppointmentRenovationRepository(AppointmentDbContext context) : base(context)
 {
 }
 public AppointmentRequestRepository(AppointmentDbContext dbContext)
 {
     this.dbContext = dbContext;
 }
Ejemplo n.º 10
0
 public BookAppointmentDetailController(AppointmentDbContext context)
 {
     _context = context;
 }
Ejemplo n.º 11
0
 public bool IsAlreadyFull(AppointmentDbContext context) => context.Appointments.Count() > 0;
Ejemplo n.º 12
0
        public string Get(string department,
                          string reqType,
                          int providerId,
                          int patientId,
                          DateTime requestDate,
                          string status,
                          int membershipTypeId)
        {
            AppointmentDbContext        dbContextAppointment = new AppointmentDbContext(connString);
            DanpheHTTPResponse <object> responseData         = new DanpheHTTPResponse <object>();

            //RbacUser currentUser = HttpContext.Session.Get<RbacUser>("currentuser");
            //if (currentUser == null || !RBAC.UserHasPermission(currentUser.UserId, "APT", "appointment-read"))
            //{
            //    HttpResponseMessage message = new HttpResponseMessage(System.Net.HttpStatusCode.NotFound);
            //    responseData.Status = "Failed";
            //    responseData.ErrorMessage = "Unauthorized access.";
            //    return DanpheJSONConvert.SerializeObject(responseData);
            //}

            #region get request example
            //for reference
            //if (!string.IsNullOrEmpty(fName) || !string.IsNullOrEmpty(doctor) || appointmentId != 0)
            //{
            //    //If nothing is passed during search->Condition in LHS is TRUE and neglects the condition in the RHS
            //    //If some value is passed during search -> LHS will be false and checks if RHS is TRUE
            //    //If both the LHS and RHS in any one of the 3 conditions is false then query returns nothing.
            //    result = (from app in dbContextSearch.Appointments
            //              where (appointmentId == 0 || appointmentId == app.AppointmentId)
            //             && (string.IsNullOrEmpty(fName) || app.FirstName.ToLower().Contains(fName.ToLower()))
            //             && (string.IsNullOrEmpty(doctor) || app.ProviderName.ToLower().Contains(doctor.ToLower()))
            //              select app).ToList();
            //    return JsonConvert.SerializeObject(result);
            //}
            #endregion
            try
            {
                //gets the doctorschedule from appointment table
                if (reqType == "doctorschedule")
                {
                    //.ToList()is done two times,since we can't use requestDate.Date inside IQueryable
                    List <AppointmentModel> apptList = (from d in dbContextAppointment.Appointments
                                                        where d.ProviderId == providerId
                                                        select d).ToList().Where(a => a.AppointmentDate.Date == requestDate.Date).ToList();
                    AppointmentDay apptDay = AppointmentDay.FormatData(apptList);
                    responseData.Status  = "OK";
                    responseData.Results = apptDay;
                }
                //loads appointments with requested status
                else if (reqType == "getAppointments")
                {
                    var date = DateTime.Today;
                    List <AppointmentModel> appointmentList = (from app in dbContextAppointment.Appointments
                                                               select app
                                                               ).OrderByDescending(x => x.AppointmentId).ToList();
                    responseData.Status  = "OK";
                    responseData.Results = appointmentList;
                }
                //get the patient's today's or future's appointments
                else if (reqType == "checkForClashingAppointment")
                {
                    List <AppointmentModel> patAppointmentList = (from app in dbContextAppointment.Appointments
                                                                  where app.PatientId == patientId &&
                                                                  app.AppointmentDate >= DbFunctions.TruncateTime(requestDate.Date) &&
                                                                  app.ProviderId == providerId
                                                                  select app).ToList();

                    VisitDbContext dbContext = new VisitDbContext(base.connString);

                    List <VisitModel> patientvisitList = (from visit in dbContext.Visits
                                                          where visit.PatientId == patientId &&
                                                          DbFunctions.TruncateTime(visit.VisitDate) == DbFunctions.TruncateTime(requestDate.Date) &&
                                                          visit.ProviderId == providerId
                                                          select visit).ToList();

                    if ((patAppointmentList != null && patAppointmentList.Count != 0) || (patientvisitList != null && patientvisitList.Count != 0))
                    {
                        responseData.Status  = "OK";
                        responseData.Results = true;
                    }
                    else
                    {
                        responseData.Status  = "OK";
                        responseData.Results = false;
                    }
                }
                //get the discoutnpercantage using membershipTypeid
                else if (reqType == "GetMembershipDeatils")
                {
                    PatientDbContext patientDbContext = new PatientDbContext(connString);
                    var membershipDeatils             = (from mem in patientDbContext.MembershipTypes
                                                         where mem.MembershipTypeId == membershipTypeId
                                                         select new
                    {
                        MembershipTypeId = mem.MembershipTypeId,
                        DiscountPercent = mem.DiscountPercent,
                        MembershipTypeName = mem.MembershipTypeName
                    }).FirstOrDefault();

                    responseData.Status  = "OK";
                    responseData.Results = membershipDeatils;
                }
                //get the TotalAmount using providerId
                else if (reqType == "GetTotalAmountByProviderId")
                {
                    BillingDbContext billingDbContext = new BillingDbContext(connString);

                    ServiceDepartmentModel srvDept = billingDbContext.ServiceDepartment.Where(s => s.ServiceDepartmentName == "OPD").FirstOrDefault();

                    if (srvDept != null)
                    {
                        ///remove tolist from below query-- one doc will have only one opd-tkt price.. <sudrshan:14jul2017>
                        var billingItemPrice = (from bill in billingDbContext.BillItemPrice
                                                where bill.ServiceDepartmentId == srvDept.ServiceDepartmentId && bill.ItemId == providerId
                                                select bill.Price).ToList();

                        responseData.Status  = "OK";
                        responseData.Results = billingItemPrice;
                    }
                    else
                    {
                        responseData.Status       = "Failed";
                        responseData.ErrorMessage = "Failed to get OPD-Ticket Price";
                    }
                }   //getting appointment list of selected ProvideId
                else if (reqType == "get-appointment-list")
                {
                    ////.ToList()is done two times,since we can't use requestDate.Date inside IQueryable
                    //List<AppointmentModel> apptList = (from d in dbContextAppointment.Appointments
                    //                                   where d.ProviderId == providerId
                    //                                   select d).ToList();
                    //AppointmentDay apptDay = AppointmentDay.FormatData(apptList);

                    ////responseData.Status = "OK";
                    //responseData.Results = apptDay;

                    var apptList = (from apt in dbContextAppointment.Appointments
                                    where apt.ProviderId == providerId && apt.AppointmentDate == requestDate
                                    select new
                    {
                        PatientName = apt.FirstName + " " + (string.IsNullOrEmpty(apt.MiddleName) ? "" : apt.MiddleName + " ") + apt.LastName,
                        Time = apt.AppointmentTime,
                        Date = apt.AppointmentDate,
                    }).ToList();
                    if (apptList != null)
                    {
                        responseData.Status  = "OK";
                        responseData.Results = apptList;
                    }
                    else
                    {
                        responseData.Status = "Failed";
                    }
                }
            }
            catch (Exception ex)
            {
                responseData.Status       = "Failed";
                responseData.ErrorMessage = ex.Message + " exception details:" + ex.ToString();
            }
            return(DanpheJSONConvert.SerializeObject(responseData, true));
        }
Ejemplo n.º 13
0
        public string Put()
        {
            DanpheHTTPResponse <string> responseData = new DanpheHTTPResponse <string>();

            try
            {
                string   str           = this.ReadPostData();
                string   reqType       = this.ReadQueryStringData("reqType");
                string   status        = this.ReadQueryStringData("status");
                int      appointmentId = ToInt(this.ReadQueryStringData("appointmentId"));
                int      patientId     = ToInt(this.ReadQueryStringData("patientId"));
                RbacUser currentUser   = HttpContext.Session.Get <RbacUser>("currentuser");
                //update patientId in Appointment Table
                if (reqType == "updatePatientId" && patientId != 0)
                {
                    AppointmentDbContext dbContextUpdate = new AppointmentDbContext(connString);
                    AppointmentModel     dbAppointment   = dbContextUpdate.Appointments
                                                           .Where(a => a.AppointmentId == appointmentId)
                                                           .FirstOrDefault <AppointmentModel>();

                    dbAppointment.PatientId = patientId;
                    dbContextUpdate.Entry(dbAppointment).State = EntityState.Modified;
                    dbContextUpdate.SaveChanges();

                    responseData.Status  = "OK";
                    responseData.Results = "Appointment information updated successfully.";
                }
                //update appointmentStatus
                else if (reqType == "updateAppStatus" && !string.IsNullOrEmpty(status))
                {
                    AppointmentDbContext dbContextUpdate = new AppointmentDbContext(connString);
                    AppointmentModel     dbAppointment   = dbContextUpdate.Appointments
                                                           .Where(a => a.AppointmentId == appointmentId)
                                                           .FirstOrDefault <AppointmentModel>();
                    dbAppointment.AppointmentStatus            = status.ToLower();
                    dbContextUpdate.Entry(dbAppointment).State = EntityState.Modified;
                    dbContextUpdate.SaveChanges();

                    responseData.Status  = "OK";
                    responseData.Results = "Appointment information updated successfully.";
                }
                else if (reqType == "updateAppointmentStatus")
                {
                    AppointmentDbContext dbContextUpdate = new AppointmentDbContext(connString);
                    AppointmentModel     appointmentData = DanpheJSONConvert.DeserializeObject <AppointmentModel>(str);

                    dbContextUpdate.Appointments.Attach(appointmentData);
                    dbContextUpdate.Entry(appointmentData).State = EntityState.Modified;

                    dbContextUpdate.Entry(appointmentData).Property(x => x.CreatedOn).IsModified = false;
                    dbContextUpdate.Entry(appointmentData).Property(x => x.CreatedBy).IsModified = false;

                    appointmentData.CancelledOn = System.DateTime.Now;
                    appointmentData.CancelledBy = currentUser.EmployeeId;

                    dbContextUpdate.SaveChanges();

                    responseData.Status  = "OK";
                    responseData.Results = "Appointment information updated successfully";
                }
                else
                {
                    //throw new Exception("Cannot match any reqType");
                    //throw new NotImplementedException("cannot match any request type. given requesttype " + reqType + "  is not implemented.");
                    responseData.Status       = "Failed";
                    responseData.ErrorMessage = "Cannot match any reqType";
                }
            }
            catch (Exception ex)
            {
                responseData.Status       = "Failed";
                responseData.ErrorMessage = ex.Message + " exception details:" + ex.ToString();
            }
            return(DanpheJSONConvert.SerializeObject(responseData, true));
        }
 public AppointmentRepository(AppointmentDbContext appointmentDbContext)
 {
     _appointmentDbContext = appointmentDbContext;
 }
Ejemplo n.º 15
0
 public SqlAppointmentData(AppointmentDbContext db)
 {
     this.db = db;
 }
Ejemplo n.º 16
0
        private static void SeedAppointments(AppointmentDbContext context)
        {
            context.Add(new Domain.Entities.Appointment
            {
                Period            = new Period(new DateTime(2020, 12, 5, 14, 00, 0), new DateTime(2020, 12, 5, 14, 30, 0)),
                TypeOfAppointment = TypeOfAppointment.Examination,
                ShortDescription  = "standard appointment",
                Urgent            = true,
                Deleted           = false,
                Finished          = true,
                RoomId            = 1,
                DoctorId          = "2406978890047",
                PatientId         = "2406978890046"
            });
            context.Add(new Domain.Entities.Appointment
            {
                Period            = new Period(new DateTime(2020, 12, 4, 14, 00, 0), new DateTime(2020, 12, 4, 14, 30, 0)),
                TypeOfAppointment = TypeOfAppointment.Examination,
                ShortDescription  = "standard appointment",
                Urgent            = true,
                Deleted           = false,
                Finished          = true,
                RoomId            = 1,
                DoctorId          = "2406978890047",
                PatientId         = "2406978890046"
            });
            context.Add(new Domain.Entities.Appointment
            {
                Period            = new Period(new DateTime(2020, 12, 3, 14, 00, 0), new DateTime(2020, 12, 3, 14, 30, 0)),
                TypeOfAppointment = TypeOfAppointment.Examination,
                ShortDescription  = "standard appointment",
                Urgent            = true,
                Deleted           = false,
                Finished          = true,
                RoomId            = 1,
                DoctorId          = "2407978890045",
                PatientId         = "2406978890046"
            });
            context.Add(new Domain.Entities.Appointment
            {
                Period            = new Period(new DateTime(2020, 12, 1, 14, 00, 0), new DateTime(2020, 12, 1, 14, 30, 0)),
                TypeOfAppointment = TypeOfAppointment.Examination,
                ShortDescription  = "standard appointment",
                Urgent            = true,
                Deleted           = false,
                Finished          = true,
                RoomId            = 1,
                DoctorId          = "2407978890045",
                PatientId         = "2406978890046"
            });
            context.Add(new Domain.Entities.Appointment
            {
                Period            = new Period(new DateTime(2020, 12, 5, 14, 00, 0), new DateTime(2020, 12, 5, 14, 30, 0)),
                TypeOfAppointment = TypeOfAppointment.Examination,
                ShortDescription  = "standard appointment",
                Urgent            = true,
                Deleted           = false,
                Finished          = true,
                RoomId            = 1,
                DoctorId          = "2406978890047",
                CanceledByPatient = true,
                CancelationDate   = new DateTime(2020, 6, 5),
                PatientId         = "2406978890046"
            });
            context.Add(new Domain.Entities.Appointment
            {
                Period            = new Period(new DateTime(2020, 12, 5, 14, 00, 0), new DateTime(2020, 12, 5, 14, 30, 0)),
                TypeOfAppointment = TypeOfAppointment.Examination,
                ShortDescription  = "standard appointment",
                Urgent            = true,
                Deleted           = false,
                Finished          = true,
                RoomId            = 1,
                DoctorId          = "2406978890047",
                CanceledByPatient = true,
                CancelationDate   = new DateTime(2020, 11, 25),
                PatientId         = "2406978890046"
            });
            context.Add(new Domain.Entities.Appointment
            {
                Period            = new Period(new DateTime(2020, 12, 5, 14, 00, 0), new DateTime(2020, 12, 5, 14, 30, 0)),
                TypeOfAppointment = TypeOfAppointment.Examination,
                ShortDescription  = "standard appointment",
                Urgent            = true,
                Deleted           = false,
                Finished          = true,
                RoomId            = 1,
                DoctorId          = "2406978890047",
                CanceledByPatient = true,
                CancelationDate   = new DateTime(2020, 12, 14),
                PatientId         = "2406978890046"
            });
            context.Add(new Domain.Entities.Appointment
            {
                Period            = new Period(new DateTime(2020, 12, 5, 14, 00, 0), new DateTime(2020, 12, 5, 14, 30, 0)),
                TypeOfAppointment = TypeOfAppointment.Examination,
                ShortDescription  = "standard appointment",
                Urgent            = true,
                Deleted           = false,
                Finished          = true,
                RoomId            = 1,
                DoctorId          = "2406978890047",
                CanceledByPatient = true,
                CancelationDate   = new DateTime(2020, 12, 15),
                PatientId         = "2406978890046"
            });
            context.Add(new Domain.Entities.Appointment
            {
                Period            = new Period(new DateTime(2020, 12, 14, 13, 30, 0), new DateTime(2020, 12, 14, 14, 0, 0)),
                TypeOfAppointment = TypeOfAppointment.Examination,
                ShortDescription  = "standard appointment",
                Urgent            = true,
                Deleted           = false,
                Finished          = true,
                RoomId            = 1,
                DoctorId          = "2406978890047",
                CanceledByPatient = true,
                CancelationDate   = new DateTime(2020, 12, 21),
                PatientId         = "2406978890046",
            });
            context.Add(new Domain.Entities.Appointment
            {
                Period            = new Period(new DateTime(2020, 12, 14, 13, 30, 0), new DateTime(2020, 12, 14, 14, 0, 0)),
                TypeOfAppointment = TypeOfAppointment.Examination,
                ShortDescription  = "standard appointment",
                Urgent            = true,
                Deleted           = false,
                Finished          = true,
                RoomId            = 1,
                DoctorId          = "2406978890047",
                CanceledByPatient = true,
                CancelationDate   = new DateTime(2020, 12, 24),
                PatientId         = "2406978890046",
            });
            context.Add(new Domain.Entities.Appointment
            {
                Period            = new Period(new DateTime(2021, 01, 21, 13, 30, 0), new DateTime(2021, 01, 21, 14, 0, 0)),
                TypeOfAppointment = TypeOfAppointment.Examination,
                ShortDescription  = "standard appointment",
                Urgent            = true,
                Deleted           = false,
                Finished          = false,
                RoomId            = 1,
                DoctorId          = "2406978890047",
                CanceledByPatient = false,
                PatientId         = "2406978890046",
            });
            context.Add(new Domain.Entities.Appointment
            {
                Period            = new Period(new DateTime(2021, 01, 07, 13, 30, 0), new DateTime(2021, 01, 07, 14, 0, 0)),
                TypeOfAppointment = TypeOfAppointment.Examination,
                ShortDescription  = "standard appointment",
                Urgent            = true,
                Deleted           = false,
                Finished          = false,
                RoomId            = 1,
                DoctorId          = "2406978890047",
                CanceledByPatient = false,
                PatientId         = "2406978890046",
            });
            context.Add(new Domain.Entities.Appointment
            {
                Period            = new Period(new DateTime(2021, 02, 07, 13, 30, 0), new DateTime(2021, 02, 07, 14, 0, 0)),
                TypeOfAppointment = TypeOfAppointment.Examination,
                ShortDescription  = "standard appointment",
                Urgent            = true,
                Deleted           = false,
                Finished          = false,
                RoomId            = 1,
                DoctorId          = "2406978890047",
                CanceledByPatient = false,
                PatientId         = "2406978890046",
            });

            context.SaveChanges();
        }
Ejemplo n.º 17
0
 public AppointmentForRoomManipulationRepository(AppointmentDbContext context) : base(context)
 {
 }
Ejemplo n.º 18
0
 public PartnersRepository(AppointmentDbContext context)
     : base(context)
 {
 }
Ejemplo n.º 19
0
 public SurveyRepository(AppointmentDbContext context) : base(context)
 {
 }
Ejemplo n.º 20
0
 public PatientRepository(AppointmentDbContext dbContext) => _dbContext = dbContext ??
 public AppointmentController(AppointmentDbContext context, IBus publisher)
 {
     _context   = context;
     _publisher = publisher;
 }
Ejemplo n.º 22
0
 public BaseRepository(AppointmentDbContext context)
 {
     this.Context = context;
     this.set     = context.Set <T>();
 }
 public AppointmentController(AppointmentDbContext context)
 {
     _context = context;
 }
 public DoctorDetailController(AppointmentDbContext context)
 {
     _context = context;
 }
Ejemplo n.º 25
0
        private static async Task SeedEverything(AppointmentDbContext context)
        {
            //DEPARTMENTS
            var departments = new List <Department>
            {
                new Department {
                    DepartmentName = "KBB"
                },
                new Department {
                    DepartmentName = "Kardiyoloji"
                },
                new Department {
                    DepartmentName = "Onkoloji"
                },
                new Department {
                    DepartmentName = "Cildiye"
                },
            };
            await context.Departments.AddRangeAsync(departments);

            //DOCTORS
            var doctors = new List <Doctor>
            {
                new Doctor {
                    Name = "Umut", Surname = "Kahraman", Department = departments[0]
                },
                new Doctor {
                    Name = "Yuşa", Surname = "Açıkalın", Department = departments[2]
                },
                new Doctor {
                    Name = "Serhat", Surname = "Denek", Department = departments[3]
                },
            };
            await context.Doctors.AddRangeAsync(doctors);

            //PATIENTS
            var patients = new List <Patient>
            {
                new Patient {
                    Name = "Roger", Surname = "Federer", Address = "Kuzey Kaliforniya", BirthDate = DateTime.Now.AddYears(-30), IdentityNo = "12345678900", Phone = "5066132095"
                },
                new Patient {
                    Name = "Mustafa", Surname = "Gelirgeçer", Address = "Sivas", BirthDate = DateTime.Now.AddYears(-20).AddDays(85), IdentityNo = "4562345345", Phone = "5317985689"
                },
                new Patient {
                    Name = "Mahmut", Surname = "Tuncer", Address = "Los Angeles", BirthDate = DateTime.Now.AddYears(-30).AddDays(15), IdentityNo = "99999999999", Phone = "6985632145"
                },
                new Patient {
                    Name = "İsmail", Surname = "Eşel", Address = "Talas", BirthDate = DateTime.Now.AddYears(-25).AddDays(85), IdentityNo = "23443534534", Phone = "345234445"
                },
                new Patient {
                    Name = "Gökçe", Surname = "Boz", Address = "Kayseri", BirthDate = DateTime.Now.AddYears(-26).AddDays(85), IdentityNo = "324234234234", Phone = "3453453455"
                }
            };
            await context.Patients.AddRangeAsync(patients);

            //APPOINTMENTS
            var appointments = new List <Appointment>
            {
                new Appointment {
                    Department = departments[0], Doctor = doctors[0], Patient = patients[0], Timestamp = DateTime.Parse("2018-11-11 09:00")
                },
                new Appointment {
                    Department = departments[2], Doctor = doctors[1], Patient = patients[1], Timestamp = DateTime.Parse("2018-11-11 10:00")
                },
                new Appointment {
                    Department = departments[2], Doctor = doctors[1], Patient = patients[2], Timestamp = DateTime.Parse("2018-11-11 11:00")
                },
                new Appointment {
                    Department = departments[3], Doctor = doctors[2], Patient = patients[3], Timestamp = DateTime.Parse("2018-11-11 12:00")
                },
                new Appointment {
                    Department = departments[3], Doctor = doctors[2], Patient = patients[4], Timestamp = DateTime.Parse("2018-11-11 11:30")
                },
                new Appointment {
                    Department = departments[2], Doctor = doctors[1], Patient = patients[1], Timestamp = DateTime.Parse("2018-11-11 12:30")
                },
                new Appointment {
                    Department = departments[0], Doctor = doctors[0], Patient = patients[2], Timestamp = DateTime.Parse("2018-11-11 14:30")
                }
            };
            await context.Appointments.AddRangeAsync(appointments);

            await context.SaveChangesAsync();
        }
 public AppointmentEventRepository(AppointmentDbContext context) : base(context)
 {
 }
Ejemplo n.º 27
0
 public EmployeeRepository(AppointmentDbContext context)
     : base(context)
 {
 }