public async Task <IActionResult> Edit([Bind(patientInfoProperties)] PersonInfoViewModel c)
        {
            var currentDate = DateTime.Now;

            if (!ModelState.IsValid)
            {
                return(View(c));
            }
            var personMed = await personMedicines.GetObject(c.MedicineID, c.ID);

            var perObj = await persons.GetObject(c.ID);

            var dosObj = await dosages.GetObject(c.DosageID);

            dosObj.DbRecord.Description = c.Description;

            if (personMed.DbRecord.Suitability != c.Suitability)
            {
                await personMedicines.DeleteObject(personMed);

                var medObj = await medicines.GetObject(c.MedicineID);

                await personMedicines.AddObject(PersonMedicineObjectFactory.Create(perObj, medObj, c.Suitability, currentDate));
            }
            //await dosages.UpdateObject(dosObj);
            return(RedirectToAction("PatientInfo", PersonViewModelFactory.Create(perObj)));
        }
Ejemplo n.º 2
0
        public MainWindow()
        {
            InitializeComponent();
            var personInfoVm = new PersonInfoViewModel();

            PersonInfoGrid.DataContext = personInfoVm;
            DataContext = new MainWindowViewModel(personInfoVm);
        }
        public void ConfirmCommandExecution_AfterPassingNotNullPersonParameterInCtor_UpdatesPersonInStorage()
        {
            //Arrange
            var stubStorage = new Mock <IStorage>();

            stubStorage.Setup(stor => stor.TryUpdatePersonAsync(It.IsAny <Person>(), It.IsAny <Person>())).Returns(Task.FromResult(true));

            Person person = CreateTestPerson();
            var    personInfoViewModel = new PersonInfoViewModel(stubStorage.Object, ref person);

            //Act
            personInfoViewModel.ConfirmCommand.Execute(null);

            //Assert
            stubStorage.Verify(storage => storage.TryUpdatePersonAsync(It.IsAny <Person>(), It.IsAny <Person>()), Times.Once);
        }
Ejemplo n.º 4
0
        // GET: Log
        public ActionResult Index()
        {
            LogListViewModel ListViewModel = new LogListViewModel()
            {
                Items = new List <PersonInfoViewModel>()
            };

            foreach (var item in _logservice.GetAll())
            {
                PersonInfoViewModel vm = new PersonInfoViewModel()
                {
                    MemberId = item.MemberId,
                    LogId    = item.LogId,
                    DateTime = item.DateTime,
                    //Content = _logservice.Readtext(item.Path)
                };
                ListViewModel.Items.Add(vm);
            }
            return(View(ListViewModel.Items));
        }
Ejemplo n.º 5
0
        public PartialViewResult PersonInfo()
        {
            PersonInfoViewModel model;

            if (AbpSession.UserId.HasValue)
            {
                model = new PersonInfoViewModel
                {
                    //LoginInformations = AsyncHelper.RunSync(() => _sessionAppService.GetCurrentLoginInformations()),
                    IsMultiTenancyEnabled = _multiTenancyConfig.IsEnabled,
                };
            }
            else
            {
                model = new PersonInfoViewModel
                {
                    IsMultiTenancyEnabled = _multiTenancyConfig.IsEnabled
                };
            }

            return(PartialView("_PersonInfo", model));
        }
Ejemplo n.º 6
0
        private PersonInfoViewModel CollectPersonInfo(Person person)
        {
            var personInfo = new PersonInfoViewModel
            {
                Id                                      = person.Id,
                UniqueId                                = person.UniqueId,
                FirstName                               = Lng == Lang.KU ? person.FirstName_Ku : Lng == Lang.AR ? person.FirstName_Ar : person.FirstName,
                SecondName                              = Lng == Lang.KU ? person.SecondName_Ku : Lng == Lang.AR ? person.SecondName_Ar : person.SecondName,
                ThirdName                               = Lng == Lang.KU ? person.ThirdName_Ku : Lng == Lang.AR ? person.ThirdName_Ar : person.ThirdName,
                Address                                 = person.Address,
                Age                                     = person.Age ?? 0,
                Birthdate                               = person.Birthdate != null?person.Birthdate.Value.ToString("yyyy-MM-dd") : "",
                                               Height   = person.Height ?? 0,
                                               IdNumber = person.IdNumber,
                                               Language = person.Language != null?person.Language.GetLocalizedDisplayName() : "",
                                                              MarriageStatus = person.MarriageStatus != null?person.MarriageStatus.GetLocalizedDisplayName() : "",
                                                                                   MobileNumber = person.Mobile,
                                                                                   Sex          = person.Gender.GetLocalizedDisplayName(),
                                                                                   Weight       = person.Weight ?? 0,
                                                                                   Avatar       = person.RealAvatar
            };

            return(personInfo);
        }
Ejemplo n.º 7
0
 internal PersonInfoView()
 {
     InitializeComponent();
     DataContext = new PersonInfoViewModel();
 }
        public async Task <IActionResult> SendInfo(PersonInfoViewModel c)
        {
            await Task.Delay(500);

            var person = await persons.GetObject(c.ID);

            var informationPreference = person.DbRecord.GetMedicineInfo;
            var medicine = await medicines.GetObject(c.MedicineID);

            var dosage = await dosages.GetObject(c.DosageID);

            await schemes.LoadSchemes(dosage);

            var schems = dosage.SchemesInUse;
            var scheme = schems[0];

            char[] males   = new[] { '1', '3', '5', '7', '9' };
            char[] females = new[] { '2', '4', '6', '8', '0' };
            string sex;

            if (males.Contains(person.DbRecord.IDCode[0]))
            {
                sex = "härra";
            }
            else
            {
                sex = "preili/proua";
            }

            string link;

            if (medicine.DbRecord.Spc.Contains("http"))
            {
                link = medicine.DbRecord.Spc;
            }
            else
            {
                link = "http://ravimiregister.ravimiamet.ee/Data/SPC/" + medicine.DbRecord.Spc;
            }
            string header     = "Tervist lp " + sex + " " + person.DbRecord.LastName + "@" + "@";
            string suggestion = "Siin on teile kirjutatud soovitus Dr. Mardna poolt kuupäeval: " + c.ValidFrom +
                                "@" + "Isikukood : " + person.DbRecord.IDCode +
                                "@" + "Eesnimi : " + person.DbRecord.FirstName +
                                "@" + "Perekonnanimi : " + person.DbRecord.LastName +
                                "@" + "Ravimi nimi : " + medicine.DbRecord.Name +
                                "@" + "Ravimi manustamise viis : " + medicine.DbRecord.FormOfInjection +
                                "@" + "Ravimi tugevus : " + medicine.DbRecord.Strength;

            if (scheme.DbRecord.Length != Constants.Unspecified)
            {
                suggestion += "@" + "@" + "------ANNUSTAMINE------" +
                              "@" + "Ravimi manustamise tüüp : " + dosage.DbRecord.TypeOfTreatment +
                              "@" + "Ravikuuri pikkus : " + scheme.DbRecord.Length +
                              "@" + "Ravimit manustada ühe korraga : " + scheme.DbRecord.Amount +
                              "@" + "Ravimit manustada kordi päevas : " + scheme.DbRecord.Times +
                              "@" + "Eelistatud manustamise aeg : " + scheme.DbRecord.TimeOfDay;
            }

            suggestion += "@" + "Lisainfot ravimi kohta ning annustamise info leiad: " + link + " (annustamine alates peatükk 4.2)";
            string finalMessage = header + suggestion;

            finalMessage = finalMessage.Replace("@", System.Environment.NewLine);
            if (informationPreference == GetMedicineInfo.Email)
            {
                if (person.DbRecord.Email != null && person.DbRecord.Email.Contains('@'))
                {
                    SendEmail(finalMessage, person);
                }
            }
            else if (informationPreference == GetMedicineInfo.SMS)
            {
                if (person.DbRecord.PhoneNumber != null)
                {
                    //sendSms(finalmessage, person);
                }
            }
            return(RedirectToAction("PatientInfo", PersonViewModelFactory.Create(person)));
        }
        public async Task <IActionResult> FinalBookConfirm(int serviceSupplyId, int centerServiceId, int patientId, DateTime start, DateTime end)
        {
            EnsureAllowAccess(serviceSupplyId);

            var serviceSupply = await _serviceSupplyService.GetServiceSupplyByIdAsync(serviceSupplyId);

            if (serviceSupply == null)
            {
                throw new AwroNoreException(Global.Err_DoctorNotFound);
            }

            var centerService = _healthServiceService.GetShiftCenterServiceById(centerServiceId);

            if (centerService == null)
            {
                throw new AwroNoreException(NewResource.NotAnyServiceDefinedForThisCenter);
            }

            var patient = await _patientService.GetByIdAsync(patientId);

            if (patient == null)
            {
                throw new AwroNoreException("Patient Not Found");
            }

            var person = patient.Person ?? throw new AwroNoreException("Person Not Found");

            var doctorPerson = serviceSupply.Person ?? throw new AwroNoreException("Doctor Not Found");

            var personInfo = new PersonInfoViewModel
            {
                Id                                      = person.Id,
                UniqueId                                = person.UniqueId,
                FirstName                               = Lng == Lang.KU ? person.FirstName_Ku : Lng == Lang.AR ? person.FirstName_Ar : person.FirstName,
                SecondName                              = Lng == Lang.KU ? person.SecondName_Ku : Lng == Lang.AR ? person.SecondName_Ar : person.SecondName,
                ThirdName                               = Lng == Lang.KU ? person.ThirdName_Ku : Lng == Lang.AR ? person.ThirdName_Ar : person.ThirdName,
                Address                                 = person.Address,
                Age                                     = person.Age ?? 0,
                Birthdate                               = person.Birthdate != null?person.Birthdate.Value.ToString("yyyy-MM-dd") : "",
                                               Height   = person.Height ?? 0,
                                               IdNumber = person.IdNumber,
                                               Language = person.Language != null?person.Language.GetLocalizedDisplayName() : "",
                                                              MarriageStatus = person.MarriageStatus != null?person.MarriageStatus.GetLocalizedDisplayName() : "",
                                                                                   MobileNumber = person.Mobile,
                                                                                   Sex          = person.Gender.GetLocalizedDisplayName(),
                                                                                   Weight       = person.Weight ?? 0,
                                                                                   Avatar       = person.RealAvatar
            };

            var doctorPersonInfo = new PersonInfoViewModel
            {
                Id         = doctorPerson.Id,
                FirstName  = Lng == Lang.KU ? doctorPerson.FirstName_Ku : Lng == Lang.AR ? doctorPerson.FirstName_Ar : doctorPerson.FirstName,
                SecondName = Lng == Lang.KU ? doctorPerson.SecondName_Ku : Lng == Lang.AR ? doctorPerson.SecondName_Ar : doctorPerson.SecondName,
                ThirdName  = Lng == Lang.KU ? doctorPerson.ThirdName_Ku : Lng == Lang.AR ? doctorPerson.ThirdName_Ar : doctorPerson.ThirdName,
                Address    = doctorPerson.Address,
                Sex        = doctorPerson.Gender.GetLocalizedDisplayName(),
                Avatar     = doctorPerson.RealAvatar
            };

            var firstExpertise = serviceSupply?.DoctorExpertises.FirstOrDefault();

            var model = new PolyclinicConfirmBookingViewModel
            {
                BookingData = new PolyclinicBookingViewModel
                {
                    ServiceSupplyId = serviceSupplyId,
                    CenterServiceId = centerServiceId,
                    PatientId       = patientId
                },
                DoctorPersonInfo        = doctorPersonInfo,
                PatientPersonInfo       = personInfo,
                Service                 = Lng == Lang.KU ? centerService.Service.Name_Ku : Lng == Lang.AR ? centerService.Service.Name_Ar : centerService.Service.Name,
                StartTime               = start,
                EndTime                 = end,
                DoctorExpertiseCategory = firstExpertise != null ? Lng == Lang.AR ? firstExpertise.Expertise.ExpertiseCategory.Name_Ar : Lng == Lang.KU ? firstExpertise.Expertise.ExpertiseCategory.Name_Ku : firstExpertise.Expertise.ExpertiseCategory.Name : "",
            };

            ViewBag.Lang = Lng;

            return(PartialView(model));
        }
Ejemplo n.º 10
0
 public PersonInfoWindow(Person person)
 {
     InitializeComponent();
     DataContext = new PersonInfoViewModel(person);
 }