Exemplo n.º 1
0
        //Sends test emails with working callbacks to the email specified
        public string SendTestEmail()
        {
            var u  = new User();
            var p  = new Patient();
            var n  = new Notification();
            var pr = new Prescription();
            var r  = new Refill();

            u.Email     = "*****@*****.**";     // PUT YOUR EMAIL HERE TO TEST
            u.FirstName = "Test";
            u.LastName  = "User";
            u.Phone     = "+14055555555";
            u.UserId    = DatabaseUserService.Insert(u);

            p.UserId              = u.UserId;
            p.PharmacyId          = 1;
            p.DateOfBirth         = DateTime.Now;
            p.PreferedContactTime = DateTime.Now;
            p.ContactMethod       = Patient.PrimaryContactMethod.Email;
            p.PersonCode          = "0";
            p.SendBirthdayMessage = true;
            p.SendRefillMessage   = true;
            p.PatientId           = DatabasePatientService.Insert(p);

            pr.PatientId = p.PatientId;
            pr.PrescriptionDaysSupply = 30;
            pr.PrescriptionRefills    = 3;
            pr.PrescriptionName       = "Tylenol";
            pr.PrescriptionNumber     = 1;
            pr.PrescriptionUpc        = "ABC123";
            pr.PrescriptionDateFilled = DateTime.Now;
            pr.PrescriptionId         = DatabasePrescriptionService.Insert(pr);

            r.RefillIt       = false;
            r.PrescriptionId = pr.PrescriptionId;
            r.Refilled       = false;
            r.RefillDate     = DateTime.Now;
            r.RefillId       = DatabaseRefillService.Insert(r);

            n.PatientId           = p.PatientId;
            n.Type                = Notification.NotificationType.Refill;
            n.NotificationMessage = "This is a test email for a refill";
            n.ScheduledTime       = DateTime.Now;
            n.SentTime            = null;
            n.Sent                = false;
            n.NotificationId      = DatabaseNotificationService.Insert(n);


            EmailService.SendNotification(n);
            EmailService.SendReset(u);

            return("Sent an notification and reset email to test account");
        }
Exemplo n.º 2
0
        public string AddFakePresRefillNotif(long pid)
        {
            var pres = new Prescription {
                PatientId              = pid,
                PrescriptionName       = "Test Prescription",
                PrescriptionNumber     = 12345,
                PrescriptionRefills    = 3,
                PrescriptionDateFilled = System.DateTime.Now.AddDays(-27),
                PrescriptionDaysSupply = 30,
                PrescriptionUpc        = "123456789"
            };

            pres.PrescriptionId = DatabasePrescriptionService.Insert(pres);
            var refill = new Refill(pres);

            refill.RefillIt = false;
            refill.RefillId = DatabaseRefillService.Insert(refill);
            return("Sucesss");
        }