Example #1
0
 public AdmissionPresenter(IAdmissionView view)
 {
     admissionView   = view;
     admissionModel  = new AdmissionModel();
     patientRegModel = new PatientRegistrationModel();
     wardModel       = new WardModel();
 }
Example #2
0
 public SurgeryPresenter(ISurgeryView view)
 {
     surgeryView     = view;
     surgeryModel    = new SurgeryModel();
     wardModel       = new WardModel();
     patientRegModel = new PatientRegistrationModel();
 }
Example #3
0
 public ActionResult PatientRegistration(PatientRegistrationModel PReg)
 {
     if (ModelState.IsValid)
     {
         Patient p = new Patient();
         p.PatientEmail = PReg.Email;
         p.UserName     = PReg.UserName;
         p.Password     = PReg.Password;
         dc.Patients.InsertOnSubmit(p);
         dc.SubmitChanges();
         return(Redirect("/PatientAccounts/PatientLogin"));
     }
     else
     {
         return(View());
     }
 }
        public ActionResult PatientSignUp()
        {
            Session["Gridresult"] = null;
            ReadOnlyCollection <TimeZoneInfo> tz    = TimeZoneInfo.GetSystemTimeZones();
            List <SelectListItem>             items = new List <SelectListItem>();

            foreach (TimeZoneInfo tzi in tz)
            {
                items.Add(new SelectListItem {
                    Text = tzi.DisplayName, Value = tzi.Id
                });
            }
            ViewBag.CurrenttimeZone = items;
            PatientRegistrationModel model = new PatientRegistrationModel();

            return(View(model));
        }
        public RegisterResult Register([FromBody] PatientRegistrationModel registerModel)
        {
            if (!ModelState.IsValid)
            {
                return(new RegisterResult()
                {
                    Success = false, Message = "Заполните все необходимые поля"
                });
            }

            if (_dbContext.PatientProfiles.FirstOrDefault(x => x.PhoneNumber == registerModel.PhoneNumber) == null)
            {
                string         apiKey  = GenerateApiKey();
                PatientProfile patient = new PatientProfile()
                {
                    Email        = registerModel.Email,
                    Gender       = registerModel.Gender,
                    RegisterDate = DateTime.Now,
                    BirthdayDate = registerModel.BirthdayDate,
                    Name         = registerModel.Name,
                    LastName     = registerModel.LastName,
                    SecondName   = registerModel.SecondName,
                    PhoneNumber  = registerModel.PhoneNumber,
                    PolicyNumber = registerModel.PolicyNumber,
                };
                _dbContext.PatientProfiles.Add(patient);
                _dbContext.SaveChanges();
                ApiLoginModel apiLogin = new ApiLoginModel
                {
                    PatientProfile = patient,
                    ApiKey         = apiKey
                };
                _dbContext.ApiAuthentication.Add(apiLogin);
                _dbContext.SaveChanges();
                return(new RegisterResult()
                {
                    Success = true, ApiKey = apiKey
                });
            }
            return(new RegisterResult()
            {
                Success = false, Message = "Пользователь с таким номером уже зарегистрирован"
            });
        }
Example #6
0
 private void PopulateTreatmentRoom(PatientRegistrationModel patient, PatientAndRequirements patientRequirements)
 {
     if (patient.Condition == "flu")
     {
         patientRequirements.TreatmentRoom = _hospitalResource.TreatmentRooms
                                             .Where(x => String.IsNullOrEmpty(x.TreatmentMachine))
                                             .Select(n => n.Name)
                                             .ToList();
     }
     else if (patient.Topography == "head_neck")
     {
         patientRequirements.TreatmentRoom = _hospitalResource.TreatmentRooms
                                             .Where(x => _hospitalResource.TreatmentMachines
                                                    .Where(t => t.Capability == "Advanced")
                                                    .Select(n => n.Name)
                                                    .Contains(x.TreatmentMachine))
                                             .Select(name => name.Name)
                                             .ToList();
     }
     else if (patient.Topography == "breast")
     {
         patientRequirements.TreatmentRoom = _hospitalResource.TreatmentRooms
                                             .Where(x => _hospitalResource.TreatmentMachines
                                                    .Where(t => t.Capability == "Advanced" || t.Capability == "Simple")
                                                    .Select(n => n.Name)
                                                    .Contains(x.TreatmentMachine))
                                             .Select(name => name.Name)
                                             .ToList();
     }
     else
     {
         Console.WriteLine($"No matching treatment room found for customer, " +
                           $"ID: {patient.UniqueId}, Condition: {patient.Condition}, Topography: {patient.Topography}");
         patientRequirements.TreatmentRoom = new List <string>()
         {
             "unknown"
         };
     }
 }
Example #7
0
        public PatientAndRequirements IdentifyResources(PatientRegistrationModel patient)
        {
            var patientRequirements = new PatientAndRequirements();

            patientRequirements.Name     = patient.Name;
            patientRequirements.UniqueId = patient.UniqueId;
            PopulateTreatmentRoom(patient, patientRequirements);
            if (patient.Condition == "cancer")
            {
                patientRequirements.DoctorsSpecialization = "Oncologist";
            }
            else if (patient.Condition == "flu")
            {
                patientRequirements.DoctorsSpecialization = "GeneralPractitioner";
            }
            else
            {
                Console.WriteLine($"Unexpected doctor specialization, {patient.Condition}");
                patientRequirements.DoctorsSpecialization = "unknown";
            }

            return(patientRequirements);
        }
 public PatientExaminationPresenter(IPatientExaminationView view)
 {
     patientView        = view;
     patientExaminModel = new PatientExaminationModel();
     patientRegModel    = new PatientRegistrationModel();
 }
Example #9
0
 /// <summary>
 /// constructor of the patient presenter
 /// </summary>
 /// <param name="view"></param>
 public PatientInquiryPresenter(IPatientInquiryView view)
 {
     patientView         = view;
     patientRegistration = new PatientRegistrationModel();
 }
        public ActionResult PatientSignUp(PatientRegistrationModel model)
        {
            ReadOnlyCollection <TimeZoneInfo> tz    = TimeZoneInfo.GetSystemTimeZones();
            List <SelectListItem>             items = new List <SelectListItem>();

            //TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById(timezone);

            //double offSetHours = tzi.BaseUtcOffset.TotalHours + ((tzi.IsDaylightSavingTime(DateTime.Now)) ? 1 : 0);
            foreach (TimeZoneInfo tzi in tz)
            {
                items.Add(new SelectListItem {
                    Text = tzi.DisplayName, Value = tzi.Id
                });
            }
            ViewBag.CurrenttimeZone = items;
            try
            {
                //if (this.IsCaptchaValid("Captcha is not valid"))
                // RecaptchaVerificationHelper recaptchaHelper = this.GetRecaptchaVerificationHelper();

                //if (String.IsNullOrEmpty(recaptchaHelper.Response))
                //{
                //    ModelState.AddModelError("", "Error :Captcha value cannot be empty.");
                //    return View(model);
                //}

                // RecaptchaVerificationResult recaptchaResult = await recaptchaHelper.VerifyRecaptchaResponseTaskAsync();

                //if (recaptchaResult != RecaptchaVerificationResult.Success)
                //{
                //    ModelState.AddModelError("", "Error :Incorrect captcha value.");
                //    return View(model);
                //}
                //else
                //{
                if (model.USERSTATE != null || model.COUNTRY != null)
                {
                    if (ModelState.IsValid)
                    {
                        if (model.AGREETERMS)
                        {
                            USERSINFORMATION       user         = uw.Context.UsersInformations.SingleOrDefault(f => f.UserName == model.UserName);
                            MembershipCreateStatus createStatus = MembershipCreateStatus.UserRejected;
                            if (user == null)
                            {
                                createStatus = account.CreateUser(model.UserName, model.PASSWORD, model.UserName);
                            }

                            if (createStatus == MembershipCreateStatus.Success)
                            {
                                using (var repo = new PatientInformationRepository(uw))
                                {
                                    user = uw.Context.UsersInformations.SingleOrDefault(f => f.UserName == model.UserName);
                                    USERPASSWORD  userpwd = new USERPASSWORD();
                                    StringBuilder bodyMsg = new StringBuilder();
                                    user.PASSWORDHASH           = user.PASSWORDHASH;
                                    user.PASSWORDSALT           = user.PASSWORDSALT;
                                    user.DateLastActivity       = DateTime.UtcNow;
                                    user.DateLastLogin          = DateTime.UtcNow;
                                    user.DateLastPasswordChange = DateTime.UtcNow;
                                    user.IsApproved             = false;
                                    user.IsfirstLogin           = "******";
                                    user.FIRSTNAME = model.FIRSTNAME;
                                    user.LASTNAME  = model.LASTNAME;
                                    user.GENDER    = model.GENDER;
                                    //model.DOB = new DateTime(Convert.ToInt32(model.DOBYEAR), Convert.ToInt32(model.DOBMonth), Convert.ToInt32(model.DOBDAY));
                                    //user.DOB = model.DOB;
                                    user.USERTYPE = "P";
                                    //user.STREETADDRESS = model.USERSTREETADDRESS1;
                                    //user.CITY = model.CITY;
                                    user.COUNTRY = model.COUNTRY;
                                    if (model.COUNTRY != null && model.COUNTRY == "United States")
                                    {
                                        user.USERSTATE = model.USERSTATE;
                                    }
                                    //user.ZIPCODE = model.ZIPCODE;
                                    user.UserName        = model.UserName;
                                    user.Email           = model.UserName;
                                    user.SECURITYQESTID1 = model.SECURITYQESTID1;
                                    user.ANSWER1         = model.ANSWER1;
                                    //user.SECURITYQESTID2 = model.SECURITYQESTID2;
                                    //user.ANSWER2 = model.ANSWER2;
                                    user.AGREETERMS        = true;
                                    user.USERPHOTOFILEPATH = "/Images/profile_doctor.jpg";
                                    user.VERIFICATIONCODE  = GenerateRandom.genereteRandomNumber();
                                    user.CREATEDBY         = User.Identity.Name;
                                    user.MODIFIEDBY        = User.Identity.Name;
                                    user.DateCreated       = DateTime.UtcNow;
                                    user.MODIFIEDON        = DateTime.UtcNow;
                                    user.REGISTEREDON      = DateTime.UtcNow;
                                    //user.CurrenttimeZone = model.CurrenttimeZone;
                                    //user.Salutation = model.Salutation;
                                    user.HITCOUNT = "0";
                                    user.State    = State.Modified;

                                    PATIENTINFORMATION patientInformation = new PATIENTINFORMATION();
                                    patientInformation.MODIFIEDBY  = User.Identity.Name;
                                    patientInformation.DateCreated = DateTime.UtcNow;
                                    patientInformation.MODIFIEDON  = DateTime.UtcNow;
                                    patientInformation.CREATEDBY   = User.Identity.Name;
                                    patientInformation.POVEMAIL    = user.UserName;
                                    patientInformation.PATIENTTYPE = "P";
                                    patientInformation.State       = DOCVIDEO.ObjectState.State.Added;
                                    patientInformation.UserName    = user.UserName;

                                    user.PatientInformations.Add(patientInformation);

                                    userpwd.CREATEDBY    = User.Identity.Name;
                                    userpwd.MODIFIEDON   = DateTime.UtcNow;
                                    userpwd.DateCreated  = DateTime.UtcNow;
                                    userpwd.MODIFIEDBY   = User.Identity.Name;
                                    userpwd.State        = State.Added;
                                    userpwd.UserName     = model.UserName;
                                    userpwd.EXPIRYDATE   = DateTime.UtcNow.AddMonths(1);
                                    userpwd.PASSWORDHASH = user.PASSWORDHASH;
                                    userpwd.PASSWORDSALT = user.PASSWORDSALT;
                                    userpwd.STATUS       = "A";
                                    user.UserPasswords.Add(userpwd);

                                    repo.InsertOrUpdate(user);
                                    uw.Save();
                                    string comment = "Patient SignUp.";
                                    string data    = string.Format("<Data><Info><![CDATA[{0}]]></Info></Data>", comment);
                                    //DOCVIDEO.DAL.Event.EventPublisher.PublishEvent((int)DocVideoEvents.PatientSignUp, 0, 0, model.UserName, data);

                                    /*
                                     *
                                     * bodyMsg.Append("<div style='width: 750px; background-color: #fff; color: #4d4d4d; border: 1px solid #999; font-size: 14px; font-family: serif; letter-spacing: 0.02em;'>");
                                     * bodyMsg.Append("<div style='height: 50px; border-bottom: 1px solid #aaa; background: #D3D0D0; padding: 8px;'>");
                                     * bodyMsg.Append("<div>");
                                     * bodyMsg.Append("<img src='" + System.Configuration.ConfigurationManager.AppSettings["server_url"] + "/content/images/logo.png' title='doccare_logo' alt='docare logo' /></div>");
                                     * bodyMsg.Append("</div>");
                                     * bodyMsg.Append("<div style='padding: 10px;'>");
                                     * bodyMsg.Append("<div style='text-align: right;'>Date:" + String.Format("{0:dddd, MMMM d, yyyy HH:mm:ss tt}", DateTime.Now) + "</div>");
                                     * bodyMsg.Append("<h2 style='color: #1072B5; font-style: italic;'>Dear," + model.FIRSTNAME + " " + model.LASTNAME + "</h2>");
                                     * bodyMsg.Append("<div style='float: left; width: 490px;'>");
                                     * bodyMsg.Append("<div>Thank you for signing up with docare. <br/>");
                                     * bodyMsg.Append("docare online is an online care system that allows patients to connect with doctors immediately, whenever and wherever.");
                                     * bodyMsg.Append("Please  <a href='" + System.Configuration.ConfigurationManager.AppSettings["server_url"] + "Account/LogOn?id=" + user.VERIFICATIONCODE + " 'title='Click'  style='color: #1072B5;'>Click here  </a>   to login to your docare account!");
                                     * bodyMsg.Append("Account.");
                                     * bodyMsg.Append(" </p>");
                                     * bodyMsg.Append("</div>");
                                     * bodyMsg.Append("<div style='color: #1072B5; margin: 10px 0px -10px 0px;'><strong>Benefits of signing up</strong></div>");
                                     * bodyMsg.Append("<div style='font-style: italic; font-weight: bold; line-height: 20px;'>");
                                     * bodyMsg.Append("<ul>");
                                     * bodyMsg.Append("<li>Access to doctors’ profiles and quality e-medicine</li>");
                                     * bodyMsg.Append("<li>No travel time</li>");
                                     * bodyMsg.Append("<li>Minimal wait time </li>");
                                     * bodyMsg.Append("<li>No insurance paperwork</li>");
                                     * bodyMsg.Append("<li>Electronic scheduling</li>");
                                     * bodyMsg.Append("<li>Avoid waiting rooms </li>");
                                     * bodyMsg.Append("<li>Eliminate time off from work. </li>");
                                     * bodyMsg.Append("</ul>");
                                     * bodyMsg.Append("</div>");
                                     * bodyMsg.Append("<div style='color: #1072B5; text-align: center; font-size: 19px; font-style: italic;'>");
                                     * bodyMsg.Append("<strong>See your Doctors, anytime, anywhere!</strong>");
                                     * bodyMsg.Append("</div>");
                                     * bodyMsg.Append("<p>");
                                     * bodyMsg.Append(" If you have questions about docare online, please email us at");
                                     * bodyMsg.Append("<a href='mailto:[email protected].' style='color: #1072B5;'>  [email protected].</a> For FAQ, please visit <a href=' www.PROFESSORSONLINE.com/faq' title='PROFESSORSONLINE' style='color: #1072B5;'> www.PROFESSORSONLINE.com/faq.</a>");
                                     * bodyMsg.Append("</p>");
                                     * bodyMsg.Append("</div>");
                                     * bodyMsg.Append("<div style='float: right; margin-left: 10px; width: 230px;'>");
                                     * bodyMsg.Append("<img src='" + System.Configuration.ConfigurationManager.AppSettings["server_url"] + "/content/images/amy_inner.png' alt='amy_image' />");
                                     * bodyMsg.Append("<div style='color: #1072B5; text-align: center; font-size: 19px; font-style: italic;'>docare online helps doctors and patients connect securely anytime, anywhere!</div>");
                                     * bodyMsg.Append("</div>");
                                     * bodyMsg.Append("<div style='clear: both;'></div>");
                                     * bodyMsg.Append("</div>");
                                     * bodyMsg.Append("<div style='font-size: 12px; background: #D3D0D0; padding: 10px; clear: both; margin-top: 10px;'>");
                                     * bodyMsg.Append("<strong>Disclaimer:</strong> This message is intended for the use of the person or entity to which it is addressed and may contain information that is privileged and confidential, the disclosure of which is governed by applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this information is STRICTLY PROHIBITED. If you have received this message by error, please notify us immediately and destroy the related message. You, the recipient, are obligated to maintain it in a safe, secure and confidential manner. Re-disclosure without appropriate member authorization or as permitted by law is prohibited. Unauthorized re-disclosure or failure to maintain confidentiality <strong>could subject you to penalties described in Federal and State law.</strong>");
                                     * bodyMsg.Append("</div>");
                                     * bodyMsg.Append("</div>");
                                     *
                                     * //Mail to pateint
                                     * DOCVIDEO.Utility.MailUtility.SendEmail("*****@*****.**", model.UserName, "", "", "Welcome to docare online", bodyMsg.ToString(), false, "", 0);
                                     */
                                    return(RedirectToAction("RegistrationSuccess", "Account"));
                                }
                            }
                            else
                            {
                                ModelState.AddModelError("", "Error :This user is already registered.");
                            }
                        }
                        else
                        {
                            ModelState.AddModelError("", "Error : Please accept the terms of service.");
                        }
                    }
                    else
                    {
                        ModelState.AddModelError("", "Error: Some data are not valid.");
                    }
                }
                else
                {
                    ModelState.AddModelError("", "Error: Please enter User State or Country.");
                }

                //}
            }
            catch (Exception ex)
            {
                throw new CustomException("Exception:- Project: {0} \n Error Message: {1} ", ex.InnerException, new Object[] { ex.Source, ex.Message });
            }
            return(View(model));
        }