예제 #1
0
        public ActionResult AdaugarePacient(Pacient pacient)
        {
            try
            {
                using (SqlConnection connection2 = new SqlConnection("Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=aspnet-Farmasist2-20180324102509;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"))
                {
                    SqlCommand cmd_pacient = new SqlCommand("Insert into Pacienti values(@cnp,@nume,@prenume,@adresa,@grupaSanguina,@alergii)", connection2);
                    cmd_pacient.CommandType = CommandType.Text;
                    cmd_pacient.Parameters.AddWithValue("cnp", pacient.CNP);
                    cmd_pacient.Parameters.AddWithValue("nume", pacient.Nume);
                    cmd_pacient.Parameters.AddWithValue("prenume", pacient.Prenume);
                    cmd_pacient.Parameters.AddWithValue("adresa", pacient.Adresa);
                    cmd_pacient.Parameters.AddWithValue("grupaSanguina", pacient.Grupa_Sanguina);
                    cmd_pacient.Parameters.AddWithValue("alergii", pacient.Alergii);
                    SqlDataAdapter adp_pacient = new SqlDataAdapter(cmd_pacient);
                    DataSet        ds_pacient  = new DataSet();
                    adp_pacient.Fill(ds_pacient);

                    return(Json(" "));
                }
            }
            catch (SqlException err)
            {
                // Replace the error with something less specific.
                // You could also log the error now.
                throw new ApplicationException("Data error. " + err.Message.ToString());
            }
        }
예제 #2
0
        // GET: Salariat/Details/5
        public ActionResult Details(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Pacient pacient = db.Pacient.Find(id);

            db.Entry(pacient).Collection(p => p.Istorics).Load();

            if (pacient == null)
            {
                return(HttpNotFound());
            }

            MedicAndPacientsViewModel medicAndPacientsViewModel = new MedicAndPacientsViewModel();

            medicAndPacientsViewModel.Pacient = pacient;
            string guid  = User.Identity.GetUserId();
            Medic  medic = db.Medic.Where(_ => _.accountGuid.ToString() == guid).FirstOrDefault();

            medicAndPacientsViewModel.Medic = medic;

            return(View(medicAndPacientsViewModel));
        }
예제 #3
0
        public void Load()
        {
            Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;
            if (!File.Exists(fileName))
            {
                PacientGenerator();
            }
            else
            {
                using (var file = new FileStream(fileName, FileMode.Open, FileAccess.Read))
                {
                    using (var reader = XmlReader.Create(file))
                    {
                        if (reader.ReadToFollowing(nameof(PacientList)))
                        {
                            while (reader.ReadToFollowing(nameof(Pacient)))
                            {
                                var pacient = new Pacient();
                                while (reader.Read())
                                {
                                    if (reader.NodeType == XmlNodeType.EndElement)
                                    {
                                        break;
                                    }
                                    if (reader.NodeType == XmlNodeType.Whitespace)
                                    {
                                        continue;
                                    }
                                    var name = reader.Name;
                                    reader.Read();
                                    switch (name)
                                    {
                                    case nameof(Pacient.IIN):
                                        pacient.IIN = reader.ReadContentAsInt();
                                        break;

                                    case nameof(Pacient.Familiya):
                                        pacient.Familiya = reader.ReadContentAsString();
                                        break;

                                    case nameof(Pacient.Imya):
                                        pacient.Imya = reader.ReadContentAsString();
                                        break;

                                    case nameof(Pacient.Otchestvo):
                                        pacient.Otchestvo = reader.ReadContentAsString();
                                        break;

                                    case nameof(Pacient.MedOrganizationId):
                                        pacient.MedOrganizationId = reader.ReadContentAsInt();
                                        break;
                                    }
                                }
                                PacientList.Add(pacient);
                            }
                        }
                    }
                }
            }
        }
예제 #4
0
        public Pacient Put(int id, PacientDTO value)
        {
            Pacient model = IPacientRepository.Get(id);

            if (value.PacientNume != null)
            {
                model.PacientNume = value.PacientNume;
            }

            if (value.PacientPrenume != null)
            {
                model.PacientPrenume = value.PacientPrenume;
            }

            if (value.CNP != null)
            {
                model.CNP = value.CNP;
            }

            if (value.Varsta >= 0)
            {
                model.Varsta = value.Varsta;
            }

            return(IPacientRepository.Update(model));
        }
        // GET: Salariat/Details/5
        public ActionResult Details(int?id)
        {
            MedicAndPacientsViewModel medicAndPacientsViewModel = new MedicAndPacientsViewModel();
            Medic   medic;
            Pacient pacient = new Pacient();

            if (id == null)
            {
                string guid = User.Identity.GetUserId();
                pacient = db.Pacient
                          .Include(_ => _.Istorics)
                          .Include(_ => _.Programari)
                          .Where(_ => _.AccountGuid.ToString() == guid)
                          .FirstOrDefault();
                medic = db.Medic.Find(pacient.MedicCNP);
            }
            else
            {
                medic = db.Medic.Find(id);
            }
            if (medic == null)
            {
                return(HttpNotFound());
            }
            medicAndPacientsViewModel.Medic   = medic;
            medicAndPacientsViewModel.Pacient = pacient;
            return(View(medicAndPacientsViewModel));
        }
예제 #6
0
        public ActionResult Edit(newPacient data)
        {
            Doctor  d  = db.doctors.Where(t => t.ID == data.pacient.doctor.ID).First();
            Pacient pc = db.pacients.Find(data.pacient.ID);

            if (d == null)
            {
                return(RedirectToAction("Index", "Pacients"));
            }
            //pc = data.pacient;
            //pc.doctor = dr;
            if (ModelState.IsValid)
            {
                pc.adress   = data.pacient.adress;
                pc.birthday = data.pacient.birthday;
                pc.cart     = data.pacient.cart;
                pc.comments = data.pacient.comments;
                pc.doctor   = d;
                pc.father   = data.pacient.father;
                pc.mother   = data.pacient.mother;
                pc.name     = data.pacient.name;
                pc.phone    = data.pacient.phone;
                pc.sex      = data.pacient.sex;
                db.SaveChanges();
            }
            return(RedirectToAction("Details", new { id = pc.ID }));
        }
예제 #7
0
        public async Task <IActionResult> OnPostAsync(string returnUrl = null)
        {
            returnUrl ??= Url.Content("~/");
            ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();
            if (ModelState.IsValid)
            {
                var user = new Pacient
                {
                    UserName         = Input.Email,
                    Email            = Input.Email,
                    Address          = new Addresses(),
                    RegistrationDate = DateTime.Now,
                    Name1            = Input.Name1,
                    Name2            = Input.Name2,
                    Name3            = Input.Name3,
                    Card             = new Card(),
                    Contacts         = new Contacts()
                };
                var result = await _userManager.CreateAsync(user, Input.Password);

                if (result.Succeeded)
                {
                    await _userManager.AddToRoleAsync(user, "Pacient");

                    _logger.LogInformation("User created a new account with password.");

                    if (_userManager.Options.SignIn.RequireConfirmedAccount)
                    {
                        var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);

                        code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code));
                        var callbackUrl = Url.Page(
                            "/Account/ConfirmEmail",
                            pageHandler: null,
                            values: new { area = "Identity", userId = user.Id, code = code, returnUrl = returnUrl },
                            protocol: Request.Scheme);
                        await _emailSender.SendEmailAsync(Input.Email, "Confirm your email",
                                                          $"Please confirm your account by <a href='{HtmlEncoder.Default.Encode(callbackUrl)}'>clicking here</a>.");

                        return(RedirectToPage("RegisterConfirmation", new { email = Input.Email, returnUrl = returnUrl }));
                    }
                    else
                    {
                        await _signInManager.SignInAsync(user, isPersistent : false);

                        user.LastLoginDate = DateTime.Now;
                        await _userManager.UpdateAsync(user);

                        return(LocalRedirect(returnUrl));
                    }
                }
                foreach (var error in result.Errors)
                {
                    ModelState.AddModelError(string.Empty, error.Description);
                }
            }

            // If we got this far, something failed, redisplay form
            return(Page());
        }
예제 #8
0
        private async void SaveAndQuit()
        {
            GameObject.Find("Canvas").transform.Find("SavingBgPanel").gameObject.SetActive(true);

            Pacient.Loaded.CalibrationManoDone = Pacient.Loaded.IsCalibrationManoDone;

            var pacientSendDto  = Pacient.MapToPacientSendDto();
            var responsePacient = await DataManager.Instance.UpdatePacient(pacientSendDto);

            var responseCalibration = await DataManager.Instance.SaveCalibrationOverview(_calibrationOverviewSendDto);

            GameObject.Find("Canvas").transform.Find("SavingBgPanel").gameObject.SetActive(false);

            if (responsePacient.ApiResponse == null)
            {
                SysMessage.Info("Erro ao atualizar os dados do paciente na nuvem!\n Os dados poderão ser enviados posteriormente..");
            }

            if (responseCalibration.ApiResponse == null)
            {
                SysMessage.Info("Erro salvar os dados de calibração na nuvem!\n Os dados poderão ser enviados posteriormente..");
            }

            FindObjectOfType <ManoLogger>().StopLogging();
            ReturnToMainMenu();
        }
        public async Task <ActionResult <Pacient> > PostPacient(Pacient pacient)
        {
            _context.Pacients.Add(pacient);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetPacient", new { id = pacient.Id }, pacient));
        }
예제 #10
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Nume,Prenume,NumarFisa,Medic,SerieCi,NumarCi,Cnp,Telefon,Observatii")] Pacient pacient)
        {
            if (id != pacient.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(pacient);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PacientExists(pacient.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(pacient));
        }
        public async Task <IActionResult> PutPacient(int id, Pacient pacient)
        {
            if (id != pacient.Id)
            {
                return(BadRequest());
            }

            _context.Entry(pacient).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PacientExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
예제 #12
0
        public IHttpActionResult UpdatePacient(Pacient pacient)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            //var Pac = _context.Pacient.FirstOrDefault(m => m.Id == pacient.Id);
            //if (Pac == null)
            //{
            //    return NotFound();
            //}
            //Pac.Address = pacient.Address;
            //Pac.AddressId = pacient.AddressId;
            //Pac.BirthDate = pacient.BirthDate;
            ////Pac.Email = pacient.Email;
            //Pac.Gender = pacient.Gender;
            //Pac.ListAppointment = pacient.ListAppointment;
            //Pac.ListBlock = pacient.ListBlock;
            //Pac.ListNotifaction = pacient.ListNotifaction;
            //Pac.ListPost = pacient.ListPost;
            //Pac.fName = pacient.fName;
            //Pac.lName = pacient.lName;
            //Pac.PhoneNumber = pacient.PhoneNumber;
            //Pac.Rating = pacient.Rating;
            //Pac.RatingId = pacient.RatingId;

            _context.SaveChanges();
            return(Ok());
        }
        public ActionResult Programare(string id)
        {
            string guid  = User.Identity.GetUserId();
            Medic  medic = db.Medic
                           .Include(_ => _.Programari.Select(y => y.Pacient))//.OrderBy(_ => _.StartDateTime))

                           .Where(_ => _.accountGuid.ToString() == guid)
                           .FirstOrDefault();
            Pacient pacient = db.Pacient.Find(id);

            DateTime refereceDateTime = DateTime.Now;

            Programare programare = new Programare
            {
                StartDateTime = refereceDateTime,
                EndDateTime   = refereceDateTime,
                Medic         = medic,
                Pacient       = pacient,
                MedicCNP      = medic.CNP,
                PacientCNP    = pacient.CNP
            };

            medic.Programari.Add(programare);
            medic.Programari =
                medic.Programari
                .Where(_ => _.StartDateTime >= refereceDateTime)
                .OrderBy(_ => _.StartDateTime)
                .ToList();

            return(View(medic.Programari));
        }
예제 #14
0
        // GET: Salariat/Edit/5
        public ActionResult Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MedicAndPacientsViewModel medicAndPacientsViewModel = new MedicAndPacientsViewModel();
            Pacient pacient = db.Pacient.Find(id);

            if (pacient == null)
            {
                return(HttpNotFound());
            }

            string medicguid = User.Identity.GetUserId();

            medicAndPacientsViewModel.Medic =
                db.Medic
                .Where(_ => _.accountGuid.ToString() == medicguid)
                .SingleOrDefault();

            medicAndPacientsViewModel.Medic.CNP =
                medicAndPacientsViewModel.Medic.CNP;

            medicAndPacientsViewModel.Pacient = pacient;
            return(View(medicAndPacientsViewModel));
        }
예제 #15
0
        public Pacient MeniuAdaugarePacient()
        {
            Console.WriteLine("Dati cnp pacient: "); var           cnp     = Console.ReadLine();
            Console.WriteLine("Dati numele pacientului: "); var    nume    = Console.ReadLine();
            Console.WriteLine("Dati prenumele pacientului: "); var prenume = Console.ReadLine();
            var numePacient = new NumeIntreg(nume, prenume);

            Console.WriteLine("Dati sexul pacientului (M/F) : "); var sex  = Console.ReadLine();
            Console.WriteLine("Dati ziua de nastere: "); var          zi   = Convert.ToInt16(Console.ReadLine());
            Console.WriteLine("Dati luna nasterii: "); var            luna = Convert.ToInt16(Console.ReadLine());
            Console.WriteLine("Dati anul nasterii: "); var            an   = Convert.ToInt16(Console.ReadLine());
            var dataNastere = new Data(zi, luna, an);

            Console.WriteLine("Dati judet pacient: "); var      judet      = Console.ReadLine();
            Console.WriteLine("Dati localitate pacient: "); var localitate = Console.ReadLine();
            Console.WriteLine("Dati strada pacient: "); var     strada     = Console.ReadLine();
            Console.WriteLine("Dati nr Strada pacient: "); var  nrStrada   = Convert.ToInt16(Console.ReadLine());
            var adresa = new Adresa(judet, localitate, strada, nrStrada);

            Console.WriteLine("Dati ocupatia pacient: "); var  ocupatie = Console.ReadLine();
            Console.WriteLine("Dati loc munca pacient: "); var locMunca = Console.ReadLine();

            var pacient = new Pacient(cnp, numePacient, sex, dataNastere, adresa, ocupatie, locMunca);

            return(pacient);
        }
예제 #16
0
        private string createEmail(Istoric istoric, RetetaModel reteta, Pacient pacient, Medic medic)
        {
            string mesaj = $"Bună ziua {pacient.Prenume} {pacient.Nume},\n\n" +
                           $"V-a fost eliberată o rețetă de către Doctor {medic.Prenume} {medic.Nume} pentru următorul diagnostic: \n" +
                           $"  -Data: {istoric.Data}.\n" +
                           $"  -Diagnostic: {istoric.Diagnostic}.\n" +
                           $"  -Tratament: {istoric.Tratament}\n" +
                           $"  -Zile de spitalizare: {istoric.ZileSpitalizare}\n\n" +
                           $"Aceasta conține:\n";

            if (reteta.Medicament1 != null)
            {
                mesaj = mesaj + $"  -{reteta.Medicament1} cu administrarea: {reteta.Administrare1}\n";
            }
            if (reteta.Medicament2 != null)
            {
                mesaj = mesaj + $"  -{reteta.Medicament2} cu administrarea: {reteta.Administrare2}\n";
            }
            if (reteta.Medicament3 != null)
            {
                mesaj = mesaj + $"  -{reteta.Medicament3} cu administrarea: {reteta.Administrare3}\n";
            }
            if (reteta.Medicament4 != null)
            {
                mesaj = mesaj + $"  -{reteta.Medicament4} cu administrarea: {reteta.Administrare4}\n";
            }
            if (reteta.Medicament5 != null)
            {
                mesaj = mesaj + $"  -{reteta.Medicament5} cu administrarea: {reteta.Administrare5}\n";
            }
            mesaj = mesaj + $"\nAceasta poate fii eliberată la orice farmacie pe baza buletinului.\n" +
                    $"Vă rugăm să contactați medicul de familie în caz de orice nelămurire la numărul de telefon: {medic.Numartelefon}\n\n" +
                    $"Vă mulțumim!";
            return(mesaj);
        }
예제 #17
0
파일: InitDb.cs 프로젝트: sancousic/Thesis
        private static async Task SeedPacient(UserManager <AppUser> userManager)
        {
            var pacientEmail    = "*****@*****.**";
            var pacientPassword = "******";
            var user            = (await userManager.FindByEmailAsync(pacientEmail)) as Pacient;

            if (user == null)
            {
                user = new Pacient
                {
                    Email          = pacientEmail,
                    Name1          = "Pacient",
                    Name2          = "Account",
                    UserName       = pacientEmail,
                    EmailConfirmed = true,
                    Card           = new Card()
                    {
                        Number      = 123,
                        DateOfIssue = DateTime.Now
                    },
                    SomeData = "data",
                    Address  = new Addresses(),
                    Contacts = new Contacts()
                };
                await userManager.CreateAsync(user, pacientPassword);

                await userManager.AddToRoleAsync(user, "Pacient");
            }
        }
        // GET: Salariat/Details/5
        public ActionResult Reteta(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Pacient pacient = db.Pacient
                              .Include(_ => _.Istorics.Select(x => x.Retete))
                              .Where(_ => _.CNP == id)
                              .FirstOrDefault();
            List <RetetaModel> retete = new List <RetetaModel>();

            foreach (Istoric istoric in pacient.Istorics)
            {
                foreach (RetetaModel reteta in istoric.Retete)
                {
                    if (!reteta.Retras)
                    {
                        retete.Add(reteta);
                    }
                }
            }

            return(View(retete));
        }
예제 #19
0
        private void pridatButton_Click(object sender, EventArgs e)
        {
            if (!CheckInput())
            {
                MessageBox.Show("Nie su vyplnene vsetky povinne polia!!");
                return;
            }
            var newPacient = new Pacient();

            newPacient.Meno                 = menoText.Text;
            newPacient.Priezvisko           = priezviskoText.Text;
            newPacient.Ulica                = ulicaText.Text;
            newPacient.Mesto                = mestoText.Text;
            newPacient.Cislo                = cisloText.Text;
            newPacient.PSC                  = pscText.Text;
            newPacient.RodneCislo           = rod_cisText.Text;
            newPacient.MobilneCislo         = tel_cisText.Text;
            newPacient.EvidujuciZamestnanec = LoginManager.Instance.LoggedUser;
            newPacient.DatumNarodenia       = dat_narDateTimePicker.Value;
            newPacient.DatumPoslednejZmeny  = DateTime.Now;
            newPacient.DatumVytvorenia      = DateTime.Now;
            newPacient.ZdravotnaPoistovna   = _dataManager.GetPoistovnaById((int)zpCombo.SelectedValue);
            _dataManager.AddNewPacient(newPacient);
            this.Close();
        }
예제 #20
0
        public Pacient Delete(Pacient Pacient)
        {
            var result = _context.Remove(Pacient);

            _context.SaveChanges();
            return(result.Entity);
        }
예제 #21
0
        public ViewResult Edit(int id)
        {
            Pacient pacient = _pacientRepository.GetPacient(id);
            PacientiEditViewModel pacientiEditViewModel = new PacientiEditViewModel
            {
                Id                 = pacient.Id,
                Nume               = pacient.Nume,
                Prenume            = pacient.Prenume,
                CNP                = pacient.CNP,
                Sexul              = pacient.Sexul,
                Adresa             = pacient.Adresa,
                Inaltime           = pacient.Inaltime,
                Greutate           = pacient.Greutate,
                Temperatura        = pacient.Temperatura,
                Puls               = pacient.Puls,
                Tensiune           = pacient.Tensiune,
                Frecventa_Cardiaca = pacient.Frecventa_Cardiaca,
                Frecv_Respiratorie = pacient.Frecv_Respiratorie,
                Inspectie_Toracica = pacient.Inspectie_Toracica,
                Auscultatie        = pacient.Auscultatie,
                Hemoglobina        = pacient.Hemoglobina,
                Leucocite          = pacient.Leucocite,
                Eritrocite         = pacient.Eritrocite,
                Trombocite         = pacient.Trombocite,
                Hematocrit         = pacient.Hematocrit
            };

            return(View(pacientiEditViewModel));
        }
예제 #22
0
        // GET: Pacients/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            //db.
            Pacient pacient = db.pacients
                              .Include(p => p.doctor)
                              .Include(p => p.visits.Select(w => w.anamnesis.Select(r => r.type)))
                              .Include(p => p.visits.Select(w => w.debutes.Select(r => r.type)))
                              .Include(p => p.visits.Select(w => w.diagnoses.Select(r => r.type)))
                              .Include(p => p.visits.Select(w => w.researches.Select(r => r.type)))
                              .Include(p => p.visits.Select(w => w.anamnesis.Select(r => r.type)))
                              .Include(p => p.visits.Select(w => w.neurostatuses.Select(r => r.type)))
                              .Include(p => p.visits.Select(w => w.assigments.Select(r => r.type)))
                              .Include(p => p.visits.Select(w => w.syndromes.Select(r => r.type)))
                              .Include(p => p.visits.Select(w => w.analysis.Select(r => r.type)))
                              .Include(p => p.visits.Select(w => w.reviews))
                              .Where(p => p.ID == id).Single();

            pacient.visits.Sort(delegate(VisitDate t1, VisitDate t2) { return(t2.date.CompareTo(t1.date)); });
            if (pacient.cart == null)
            {
                pacient.cart = pacient.ID.ToString();
                db.SaveChanges();
            }
            return(View(pacient));
        }
예제 #23
0
 public IActionResult Create(CreatePacientiViewModel pacient)
 {
     if (ModelState.IsValid)
     {
         Pacient newpacient = new Pacient
         {
             Nume               = pacient.Nume,
             Prenume            = pacient.Prenume,
             CNP                = pacient.CNP,
             Sexul              = pacient.Sexul,
             Adresa             = pacient.Adresa,
             Inaltime           = pacient.Inaltime,
             Greutate           = pacient.Greutate,
             Temperatura        = pacient.Temperatura,
             Puls               = pacient.Puls,
             Tensiune           = pacient.Tensiune,
             Frecventa_Cardiaca = pacient.Frecventa_Cardiaca,
             Frecv_Respiratorie = pacient.Frecv_Respiratorie,
             Inspectie_Toracica = pacient.Inspectie_Toracica,
             Auscultatie        = pacient.Auscultatie,
             Hemoglobina        = pacient.Hemoglobina,
             Leucocite          = pacient.Leucocite,
             Eritrocite         = pacient.Eritrocite,
             Trombocite         = pacient.Trombocite,
             Hematocrit         = pacient.Hematocrit
         };
         _pacientRepository.Add(newpacient);
         return(RedirectToAction("index", new { id = newpacient.Id }));
     }
     return(View());
 }
예제 #24
0
        private void EditPacientForm_Load(object sender, EventArgs e)
        {
            this.editedPacient = DataLayer.GetPacientById(this.Id).ToList()[0];

            txtAddress.Text  = editedPacient.Address;
            txtFullName.Text = editedPacient.FullName;
        }
예제 #25
0
        public IActionResult Update(PacientiEditViewModel model)
        {
            if (ModelState.IsValid)
            {
                Pacient pacient = _pacientRepository.GetPacient(model.Id);
                pacient.Nume               = model.Nume;
                pacient.Prenume            = model.Prenume;
                pacient.CNP                = model.CNP;
                pacient.Sexul              = model.Sexul;
                pacient.Adresa             = model.Adresa;
                pacient.Inaltime           = model.Inaltime;
                pacient.Greutate           = model.Greutate;
                pacient.Temperatura        = model.Temperatura;
                pacient.Puls               = model.Puls;
                pacient.Tensiune           = model.Tensiune;
                pacient.Frecventa_Cardiaca = model.Frecventa_Cardiaca;
                pacient.Frecv_Respiratorie = model.Frecv_Respiratorie;
                pacient.Inspectie_Toracica = model.Inspectie_Toracica;
                pacient.Auscultatie        = model.Auscultatie;
                pacient.Hemoglobina        = model.Hemoglobina;
                pacient.Leucocite          = model.Leucocite;
                pacient.Eritrocite         = model.Eritrocite;
                pacient.Trombocite         = model.Trombocite;
                pacient.Hematocrit         = model.Hematocrit;


                _pacientRepository.Update(pacient);
                return(RedirectToAction("index"));
            }
            return(View());
        }
예제 #26
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Age,Diagnos")] Pacient pacient)
        {
            if (id != pacient.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(pacient);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PacientExists(pacient.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(pacient));
        }
예제 #27
0
        public Pacient Create(Pacient Pacient)
        {
            var result = _context.Add <Pacient>(Pacient);

            _context.SaveChanges();
            return(result.Entity);
        }
예제 #28
0
        public ActionResult CreateByDate(newAnamnesis data)
        {
            Pacient pacient = db.pacients.Include(p => p.visits.Select(v => v.anamnesis)).Include(p => p.doctor).Where(p => p.ID == data.pacientID).First();

            if (pacient == null)
            {
                return(RedirectToAction("Index", "Pacients"));
            }
            VisitDate visit = pacient.visits.Where(v => v.date == data.initialDate).FirstOrDefault();

            if (visit != null)
            {
                AnamnesisEventType type = db.anamnesisTypes.Where(a => a.ID == data.anamnesis.type.ID).First();
                data.anamnesis.type = type;
                visit.anamnesis.Add(data.anamnesis);
                db.SaveChanges();
                return(PartialView("/views/Anamnesis/pacientDetails.cshtml", data.anamnesis));
            }
            else
            {
                AnamnesisEventType type = db.anamnesisTypes.Where(a => a.ID == data.anamnesis.type.ID).First();
                data.anamnesis.type = type;
                visit           = new VisitDate();
                visit.doctorID  = pacient.doctor.ID;
                visit.date      = data.initialDate;
                visit.anamnesis = new List <Anamnesis>();
                visit.anamnesis.Add(data.anamnesis);
                pacient.visits.Add(visit);
                db.SaveChanges();
                return(PartialView("/views/Anamnesis/pacientDetails.cshtml", data.anamnesis));
            }
            //return PartialView("/views/Anamnesis/pacientCreate.cshtml", data);
        }
예제 #29
0
        public Pacient Put(PacientDTO value)
        {
            Pacient model = IPacientRepository.Get(value.Id);

            if (value.UserName != null)
            {
                model.UserName = value.UserName;
            }
            if (value.FirstName != null)
            {
                model.FirstName = value.FirstName;
            }
            if (value.LastName != null)
            {
                model.LastName = value.LastName;
            }
            if (value.Gender != null)
            {
                model.Gender = value.Gender;
            }
            if (value.BirthDate != null)
            {
                model.BirthDate = value.BirthDate;
            }

            /*
             * if (value.Password != null)
             * {
             *  model.Password = value.Password;
             * }
             */
            return(IPacientRepository.Update(model));
        }
예제 #30
0
        public ActionResult Create(newAnamnesis data)
        {
            VisitDate visit = db.visits.Include(v => v.anamnesis).Where(v => v.ID == data.visitID).First();

            if (visit == null)
            {
                return(RedirectToAction("Index", "Pacients"));
            }

            Pacient pacient = db.pacients.Where(p => p.visits.Any(v => v.ID == data.visitID)).First();

            if (pacient == null)
            {
                return(RedirectToAction("Index", "Pacients"));
            }

            if (ModelState.IsValid)
            {
                AnamnesisEventType type = db.anamnesisTypes.Where(a => a.ID == data.anamnesis.type.ID).First();
                data.anamnesis.type = type;
                visit.anamnesis.Add(data.anamnesis);

                db.SaveChanges();
                return(PartialView("/views/Anamnesis/pacientDetails.cshtml", data.anamnesis));
            }
            return(PartialView("/views/Anamnesis/pacientCreate.cshtml", data));
        }
 public Record WriteToReceptionDoctor(int id_Doctor, Pacient thePacient)
 {
     AddPacient(thePacient);
     Record theRecord = new Record(id_Doctor, thePacient.Id, GetTimeDoctor(id_Doctor));
     AddRecord(theRecord);
     return theRecord;
 }
 public Record WriteToReceptionSpecialization(int id_Specialization, Pacient thePacient)
 {
     int idDoctor = GetRecordSpecialization(id_Specialization).OrderByDescending(x => x.Time).FirstOrDefault().Id_Doctor;
     DateTime time = GetTimeSpecialization(id_Specialization);
     Record theRecord = new Record(idDoctor, thePacient.Id, time);
     AddPacient(thePacient);
     AddRecord(theRecord);
     return theRecord;
 }
        public ActionResult ExamRequests(int page = 1)
        {
            ExamRequestListViewModel viewModel;

            if (this.HttpContext.Cache["Exam_Requests_" + page] != null)
            {
                viewModel = (ExamRequestListViewModel) this.HttpContext.Cache["Exam_Requests_" + page];
            }
            else
            {
                this._currentPacient = _pacients.GetPacientFromUser(User.Identity.GetUserId());

                if (_currentPacient != null)
                {
                    TempData["PacientEgn"] = this._currentPacient.EGN;
                    TempData["PacientName"] = this._currentPacient.Name;
                }

                var allItemsCount = this._pacients
                    .GetExamRequests(User.Identity.GetUserId(), page)
                    .Count();
                var totalPages = (int)Math.Ceiling(allItemsCount / (decimal)ItemsPerPage);
                var itemsToSkip = (page - 1) * ItemsPerPage;

                var examRequestList = this._pacients
                    .GetExamRequests(User.Identity.GetUserId(), page)
                    .OrderByDescending(x => x.CreatedOn)
                    .Skip(itemsToSkip)
                    .Take(ItemsPerPage)
                    .ProjectTo<ExamRequestViewModel>()
                    .ToList();

                viewModel = new ExamRequestListViewModel
                {
                    CurrentPage = page,
                    TotalPages = totalPages,
                    ExamRequests = examRequestList
                };
            }

            return View(viewModel);
        }
예제 #34
0
partial         void Pacients_Inserting(Pacient entity)
        {
            entity.createdon = DateTime.Now;
        }
 public string Greeting(Pacient thePacient)
 {
     return String.Format("Hello,{0}!", thePacient.ToString());
 }
        public ActionResult LabDocsDetails(int id)
        {
            this._currentPacient = _pacients.GetPacientFromUser(User.Identity.GetUserId());
            var pacientFromLabDoc = this._pacients.GetPacientForLabDetailDoc(id);

            if ((pacientFromLabDoc == null) || (pacientFromLabDoc.Id != _currentPacient.Id))
            {
                return RedirectToAction("LabDocs");
            }

            if (_currentPacient != null)
            {
                TempData["PacientEgn"] = this._currentPacient.EGN;
                TempData["PacientName"] = this._currentPacient.Name;
            }

            var mainInfo = this._pacients
                .GetLabMainDocHeader(id);

            TempData["DocNumber"] = mainInfo.DocNumber ?? "Няма";
            if (TempData["DoctorSend"] != null)
            {
                TempData["DoctorSend"] = mainInfo.DoctorSend.Name;
            }
            TempData["DoctorPerf"] = mainInfo.DoctorPerf.Name ?? "Няма";
            TempData["DataReg"] = mainInfo.DateReg.ToShortDateString();

            var mainDocsDetails = this._pacients
                .GetLabDocDetails(id)
                .ProjectTo<LabDocDetailsViewModel>()
                .AsQueryable();

            return View(mainDocsDetails);
        }
        public ActionResult LabDocs()
        {
            this._currentPacient = _pacients.GetPacientFromUser(User.Identity.GetUserId());

            var mainDocs = this._pacients
                .GetLabDocsForPacient(this._currentPacient.Id)
                .ProjectTo<LabDocsViewModel>()
                .ToList();

            return View(mainDocs);
        }
        public ActionResult GraphicFiles(int id)
        {
            this._currentPacient = _pacients.GetPacientFromUser(User.Identity.GetUserId());

            var pacientFromExam = this._pacients.GetPacientForExam(id);

            if ((pacientFromExam == null) || (pacientFromExam.Id != _currentPacient.Id))
            {
                return RedirectToAction("Exams");
            }

            if (_currentPacient != null)
            {
                TempData["PacientEgn"] = this._currentPacient.EGN;
                TempData["PacientName"] = this._currentPacient.Name;
            }

            var examList = this._pacients
                .GetGraphicsFileForExam(id)
                .ProjectTo<GraphicFilesViewModel>()
                .AsQueryable();

            return View(examList);
        }