public ActionResult DischargedPatient(string id, string submit)
        {
            Patient patient = new Patient()
            {
                UserId = id
            };

            patient = patient.FindPatientById();
            MedicalCard md = new MedicalCard()
            {
                UserId = patient.UserId
            };

            ViewBag.Medcard = md;
            if (patient.User.Lastname == submit)
            {
                patient.DischargedPatient(User.Identity.GetUserId().ToString());
                ViewBag.success = patient.User.Lastname + " " + patient.User.Name + " " + patient.User.Patronymic + " was successfully discharged from hospital!";
            }
            else
            {
                ViewBag.error = "Fields do not match!";
            }
            return(View(patient));
        }
Beispiel #2
0
        public static void Patient(Patient patient, string who)  //Add new patien and create medical card
        {
            EventLog ev = new EventLog() { EventText = "Add new patient", UserId = patient.UserId };
            MedicalCard md = new MedicalCard();
            md.CardId = Guid.Parse(patient.MedicalCardID);
            md.UserId = patient.UserId;
            md.Health_Complaint = patient.Health_Complaint;            
            Doctor doc = new Doctor() { DoctorId = Guid.Parse(patient.DoctorId)};
            Doctor nurse = doc;            
            doc = doc.DoctorByDoctorId();
            nurse = nurse.DoctorByDoctorId();
            doc.NumberOfPatients++;
            nurse.NumberOfPatients++;
            EditUsers.Doctor(doc, who);
            EditUsers.Doctor(nurse, who);

            using (ApplicationDbContext db = new ApplicationDbContext())
            {
                db.Patients.Add(patient);
                db.MedicalCard.Add(md);
                db.SaveChanges();
            }

            ev.FixEvent(who);
        }
Beispiel #3
0
        /// <summary>
        /// Data input
        /// </summary>
        /// <returns>Medical card</returns>
        private static MedicalCard CreateMedicalCard()
        {
            int Num = Number;

            Console.WriteLine("Медицинская карта:");
            Console.WriteLine("Введите имя:");
            string Name = Console.ReadLine();

            Console.WriteLine("Введите фамилию:");
            string Surname = Console.ReadLine();

            Console.WriteLine("Введите отчество:");
            string Middlename = Console.ReadLine();

            Console.WriteLine("Введите пол:");
            string Sex = Console.ReadLine();

            Console.WriteLine("Введите дату рождения:");
            DateTime DateOfBirth = Convert.ToDateTime(Console.ReadLine());

            Console.WriteLine("Введите адрес:");
            string Adress = Console.ReadLine();

            Console.WriteLine("Введите наименование учереждения:");
            string PhoneNumber = Console.ReadLine();

            Console.WriteLine("Введите номер телефона:");
            string      InstitutionName = Console.ReadLine();
            MedicalCard medicalCard     = new MedicalCard(Name, Surname, Num, Middlename, Sex, DateOfBirth, Adress, PhoneNumber, InstitutionName);

            cards.Add(medicalCard);
            Console.WriteLine("Ваша карта:\n" + medicalCard.ToString());
            return(medicalCard);
        }
Beispiel #4
0
        static public MedicalCard FindMedicalCardByUserID(this MedicalCard medcard)
        {
            using (ApplicationDbContext db = new ApplicationDbContext())
            {
                medcard = db.MedicalCard.FirstOrDefault(x => x.UserId == medcard.UserId);
            }

            return(medcard);
        }
Beispiel #5
0
        public void UpdateForm(MedicalCard medicalCard)
        {
            current = medicalCard;
            Label   dateExtract = (Label)Controls.Find("dateExtract", true)[0];
            TextBox reasonTB    = (TextBox)Controls.Find("reasonTB", true)[0];

            if (medicalCard.extract != null)
            {
                dateExtract.Text = medicalCard.extract.dateExtract.ToString();
                reasonTB.Text    = medicalCard.extract.reason;
            }
        }
        /// <summary>
        /// Method for showing entry from xml-file
        /// </summary>
        /// <param name="childnode">XmlNode</param>
        /// <returns>Medical card</returns>
        public MedicalCard XMLShowMedicalCard(XmlNode childnode)
        {
            MedicalCard card = new MedicalCard();

            foreach (XmlNode childnode1 in childnode.ChildNodes)
            {
                if (childnode1.Name == "number")
                {
                    card.Number = Convert.ToInt32(childnode1.InnerText);
                }

                if (childnode1.Name == "surname")
                {
                    card.Surname = childnode1.InnerText;
                }

                if (childnode1.Name == "name")
                {
                    card.Name = childnode1.InnerText;
                }

                if (childnode1.Name == "middlename")
                {
                    card.Middlename = childnode1.InnerText;
                }

                if (childnode1.Name == "sex")
                {
                    card.Sex = childnode1.InnerText;
                }

                if (childnode1.Name == "dateOfBirth")
                {
                    card.DateOfBirth = Convert.ToDateTime(childnode1.InnerText);
                }

                if (childnode1.Name == "adress")
                {
                    card.Adress = childnode1.InnerText;
                }

                if (childnode1.Name == "phoneNumber")
                {
                    card.PhoneNumber = childnode1.InnerText;
                }

                if (childnode1.Name == "institutionName")
                {
                    card.InstitutionName = childnode1.InnerText;
                }
            }
            return(card);
        }
        public ActionResult DischargedPatient(MedicalCard medcard)
        {
            medcard = medcard.FindMedicalCardByUserID();
            Patient patient = new Patient()
            {
                UserId = medcard.UserId, MedicalCardID = medcard.CardId.ToString()
            };

            patient             = patient.FindPatientById();
            patient.MedicalCard = medcard;
            ViewBag.Medcard     = medcard;
            return(View(patient));
        }
        public async Task <IHttpActionResult> Get(int pageIndex, int pageSize, string filter = "")
        {
            try
            {
                MedicalCard card = await this.MedicalCardService.GetMedicalCardPagesAsync(this.User.Identity.Name, pageIndex, pageSize, filter);

                return(this.Ok(card));
            }
            catch
            {
                return(this.BadRequest());
            }
        }
Beispiel #9
0
        static public void MedicalCard(MedicalCard card, string who)
        {
            EventLog ev = new EventLog()
            {
                EventText = "Update user medical card", UserId = card.UserId
            };

            using (ApplicationDbContext db = new ApplicationDbContext())
            {
                db.Entry(card).State = EntityState.Modified;
                db.SaveChanges();
            }
            ev.FixEvent(who);
        }
        public ActionResult PatienMedicalCard(Patient patient)  //return View with patien medical card
        {
            ApplicationUser user    = new ApplicationUser();
            MedicalCard     medical = new MedicalCard()
            {
                UserId = patient.UserId
            };

            user.Id       = patient.UserId;
            patient.User  = user.FindUserById();
            ViewBag.User  = patient.User;
            ViewBag.error = "To discharge a patient you need to make a diagnosis";
            return(View(medical.FindMedicalCardByUserID()));
        }
Beispiel #11
0
        private void extractBtn_Click(object sender, EventArgs e)
        {
            CardSearchingControl cardSearchingControl1 = (CardSearchingControl)Controls.Find("cardSearchingControl1", true)[0];
            CardsList            cardsList             = (CardsList)cardSearchingControl1.Controls.Find("cardsList1", true)[0];
            ListBox       listBox1 = (ListBox)cardsList.Controls.Find("listBox1", true)[0];
            NumericUpDown chamberN = (NumericUpDown)Controls.Find("chamberN", true)[0];

            MedicalCard medicalCard = (MedicalCard)listBox1.SelectedItem;

            if (medicalCard.extract == null)
            {
                registerExtractForm.UpdateForm(medicalCard);
                registerExtractForm.ShowDialog();
            }
            else
            {
                MessageBox.Show("Пацієнт вже виписаний");
            }
        }
Beispiel #12
0
        public void UpdateForm(MedicalCard medicalCard)
        {
            current = medicalCard;
            Label   nameL            = (Label)Controls.Find("nameL", true)[0];
            Label   surnameL         = (Label)Controls.Find("surnameL", true)[0];
            Label   patronymicL      = (Label)Controls.Find("patronymicL", true)[0];
            Label   ageL             = (Label)Controls.Find("ageL", true)[0];
            Label   dateEntryL       = (Label)Controls.Find("dateEntryL", true)[0];
            TextBox directionTB      = (TextBox)Controls.Find("directionTB", true)[0];
            TextBox additionalDescTB = (TextBox)Controls.Find("additionalDescTB", true)[0];

            nameL.Text            = medicalCard.name;
            surnameL.Text         = medicalCard.surname;
            patronymicL.Text      = medicalCard.patronymic;
            ageL.Text             = "" + medicalCard.age;
            dateEntryL.Text       = medicalCard.dateEntry.ToString();
            directionTB.Text      = medicalCard.direction;
            additionalDescTB.Text = medicalCard.additionalDescription;
        }
Beispiel #13
0
        public void TestToGetHashCode()
        {
            MedicalCard card = new MedicalCard()
            {
                Number          = 1,
                Name            = "Alex",
                Surname         = "Korneev",
                Middlename      = "Ivanovich",
                Sex             = "men",
                DateOfBirth     = new DateTime(2002, 10, 10),
                Adress          = "Gomel",
                PhoneNumber     = "+375446788987",
                InstitutionName = "MEDCENTER"
            };

            var actual = card.GetHashCode();
            var except = card.Number;

            Assert.AreEqual(except, actual);
        }
        public void registerNewPatient()
        {
            DateTime now = DateTime.Now;

            _patient      = new Patient(Name, Surname, Gender, DateOfBirth, Convert.ToInt32(MobileNumber), Email, now);
            _receptionist = new Receptionist();

            try
            {
                _receptionist.registerNewPatient(_patient);
                _medicalCard = new MedicalCard(_patient.getPatientIDFromDb());
                _receptionist.createMedicalCard(_medicalCard);
                _receptionist.updatePatientMedicalCard(_patient, _medicalCard);
                CloseAction.Invoke();
            }
            catch (MySqlException ex)
            {
                ErrorMessage = "Problem with writing data(MySQLException)";
            }
        }
        private void button1_Click_1(object sender, EventArgs e)
        {
            TextBox        nameTB           = (TextBox)Controls.Find("nameTB", true)[0];
            TextBox        surnameTB        = (TextBox)Controls.Find("surnameTB", true)[0];
            TextBox        patronymicTB     = (TextBox)Controls.Find("patronymicTB", true)[0];
            NumericUpDown  ageN             = (NumericUpDown)Controls.Find("ageN", true)[0];
            DateTimePicker dateEntry        = (DateTimePicker)Controls.Find("dateEntry", true)[0];
            TextBox        directionTB      = (TextBox)Controls.Find("directionTB", true)[0];
            TextBox        additionalDescTB = (TextBox)Controls.Find("additionalDescTB", true)[0];
            NumericUpDown  chamberN         = (NumericUpDown)Controls.Find("chamberN", true)[0];

            MedicalCard medicalCard = new MedicalCard();

            medicalCard.name                  = nameTB.Text;
            medicalCard.surname               = surnameTB.Text;
            medicalCard.patronymic            = patronymicTB.Text;
            medicalCard.age                   = (int)ageN.Value;
            medicalCard.dateEntry             = dateEntry.Value;
            medicalCard.direction             = directionTB.Text;
            medicalCard.additionalDescription = additionalDescTB.Text;

            Chamber chamber_g = Program.clinicalHospital.GetChamber((int)chamberN.Value);
            Chamber chamber   = null;

            if (chamber_g != null)
            {
                chamber = new Chamber(chamber_g.number, chamber_g.numberTel, dateEntry.Value);
                medicalCard.SetChamber(chamber);
            }

            if (Program.clinicalHospital.RegisterMedicalCard(medicalCard))
            {
                MessageBox.Show("Медична карта зареєстрована");
            }
            else
            {
                medicalCard = null;
                MessageBox.Show("Помилка в реєстрації медичної карти! Спробуйте ще раз");
            }
        }
Beispiel #16
0
        /// <summary>
        /// Method for adding a new entry in xml-file
        /// </summary>
        /// <param name="card">Medical card</param>
        public void XMLCreateMedicalCard(MedicalCard card)
        {
            XmlDocument xDoc = new XmlDocument();

            xDoc.Load(@"../../XMLFileCardInf.xml");
            XmlElement xRoot    = xDoc.DocumentElement;
            XmlElement userElem = xDoc.CreateElement("medicalCard");
            XmlElement a1       = xDoc.CreateElement("number");
            XmlElement a2       = xDoc.CreateElement("surname");
            XmlElement a3       = xDoc.CreateElement("name");
            XmlElement a4       = xDoc.CreateElement("middlename");
            XmlElement a5       = xDoc.CreateElement("sex");
            XmlElement a6       = xDoc.CreateElement("dateOfBirth");
            XmlElement a7       = xDoc.CreateElement("adress");
            XmlElement a8       = xDoc.CreateElement("phoneNumber");
            XmlElement a9       = xDoc.CreateElement("institutionName");

            a1.AppendChild(xDoc.CreateTextNode(card.Number.ToString()));
            a2.AppendChild(xDoc.CreateTextNode(card.Surname));
            a3.AppendChild(xDoc.CreateTextNode(card.Name));
            a4.AppendChild(xDoc.CreateTextNode(card.Middlename));
            a5.AppendChild(xDoc.CreateTextNode(card.Sex));
            a6.AppendChild(xDoc.CreateTextNode(card.DateOfBirth.ToShortDateString()));
            a7.AppendChild(xDoc.CreateTextNode(card.Adress));
            a8.AppendChild(xDoc.CreateTextNode(card.PhoneNumber));
            a9.AppendChild(xDoc.CreateTextNode(card.InstitutionName));
            userElem.AppendChild(a1);
            userElem.AppendChild(a2);
            userElem.AppendChild(a3);
            userElem.AppendChild(a4);
            userElem.AppendChild(a5);
            userElem.AppendChild(a6);
            userElem.AppendChild(a7);
            userElem.AppendChild(a8);
            userElem.AppendChild(a9);
            xRoot.AppendChild(userElem);
            xDoc.Save(@"../../XMLFileCardInf.xml");
        }
Beispiel #17
0
        public static List <MedicalCard> GetMedicalRecords(string dbResult)
        {
            var values = dbResult.Split('*');
            var result = new List <MedicalCard>();

            for (int i = 0; i < values.Length - 1; i += 8)
            {
                var medicalCard = new MedicalCard
                {
                    CardId          = Convert.ToInt32(values.GetValue(i)),
                    Description     = values.GetValue(1 + i).ToString(),
                    Cure            = values.GetValue(2 + i).ToString(),
                    DoctorFirstname = values.GetValue(3 + i).ToString(),
                    Doctorlastname  = values.GetValue(4 + i).ToString(),
                    IdPatient       = Convert.ToInt32(values.GetValue(5 + i)),
                    StartDateTime   = Convert.ToDateTime(values.GetValue(6 + i)),
                    IdVisit         = Convert.ToInt32(values.GetValue(7 + i))
                };
                result.Add(medicalCard);
            }

            return(result);
        }
Beispiel #18
0
        private void setChamberBtn_Click(object sender, EventArgs e)
        {
            CardSearchingControl cardSearchingControl1 = (CardSearchingControl)Controls.Find("cardSearchingControl1", true)[0];
            CardsList            cardsList             = (CardsList)cardSearchingControl1.Controls.Find("cardsList1", true)[0];
            ListBox       listBox1 = (ListBox)cardsList.Controls.Find("listBox1", true)[0];
            NumericUpDown chamberN = (NumericUpDown)Controls.Find("chamberN", true)[0];

            MedicalCard medicalCard = (MedicalCard)listBox1.SelectedItem;

            Chamber chamber_g = Program.clinicalHospital.GetChamber((int)chamberN.Value);
            Chamber chamber   = null;

            if (chamber_g != null)
            {
                chamber = new Chamber(chamber_g.number, chamber_g.numberTel, DateTime.Now);
                medicalCard.SetChamber(chamber);
                MessageBox.Show("Пацієнт був переведений");
            }
            else
            {
                MessageBox.Show("Пацієнт не переведений! Спробуйте ще раз");
            }
        }
Beispiel #19
0
        public static List <Patient> Patients()
        {
            List <Patient> patientList = new List <Patient>();
            MedicalCard medical        = new MedicalCard();

            using (ApplicationDbContext db = new ApplicationDbContext())
            {                                           //select only working doctors
                var WorkPatientList = db.Patients.Where(y => db.Users.Any(x => x.Id == y.UserId && x.Status != "discharged")).ToList();
                patientList = WorkPatientList;
                foreach (var i in db.Users)
                {
                    foreach (var patient in patientList)
                    {
                        if (i.Id == patient.UserId)
                        {
                            medical.UserId      = patient.UserId;
                            patient.User        = i;                                 //assign to the doctor his user data
                            patient.MedicalCard = medical.FindMedicalCardByUserID(); //difine user medical card
                        }
                    }
                }
            }
            return(patientList);
        }
Beispiel #20
0
        public void createMedicalCard(MedicalCard medicalCardObj)
        {
            String query = String.Format("INSERT INTO Medical_cards (patientID) VALUES('{0}')", medicalCardObj.patientID);

            _database.executeQuery(query);
        }
Beispiel #21
0
 public void printMedicalCardCopy(MedicalCard medCard)
 {
 }
Beispiel #22
0
        /// <summary>
        /// Show main menu
        /// </summary>
        public static void ShowMenu()
        {
            WorkWithXML work = new WorkWithXML();

            Number = work.GetLastNumber() + 1;
            bool flag = true;
            int  navigation;

            while (flag)
            {
                Console.WriteLine("\nCоздание универсальной электронной карты:\n\t1. Банковская карта;\n\t2. Образовательная карта;\n\t3. Страховой полис;\n\t4. Медицинская карта;\n\t5. Паспорт;\n\t6. Просмотреть записи;\n\t7. Выйти.");

                Console.WriteLine("\nВведите № операции для выполнения: ");
                navigation = Convert.ToInt32(Console.ReadLine());
                switch (navigation)
                {
                case 1:
                    BankCard    card     = CreateBankCard();
                    XMLBankCard bankCard = new XMLBankCard();
                    bankCard.XMLCreateBankCard(card);
                    break;

                case 2:
                    EducationalCard    card1           = CreateEducationalCard();
                    XMLEducationalCard educationalCard = new XMLEducationalCard();
                    educationalCard.XMLCreateEducationalCard(card1);
                    break;

                case 3:

                    InsurancePolicy    card2           = CreateInsurancePolicy();
                    XMLInsurancePolicy insurancePolicy = new XMLInsurancePolicy();
                    insurancePolicy.XMLCreateInsurancePolicy(card2);
                    break;

                case 4:
                    MedicalCard    card3       = CreateMedicalCard();
                    XMLMedicalCard medicalCard = new XMLMedicalCard();
                    medicalCard.XMLCreateMedicalCard(card3);
                    break;

                case 5:
                    Passport    card4    = CreatePassport();
                    XMLPassport passport = new XMLPassport();
                    passport.XMLCreatePassport(card4);
                    break;

                case 6:
                    foreach (var v in work.ShowXML())
                    {
                        Console.WriteLine(v.ToString());
                    }
                    Console.ReadKey();
                    break;

                case 7:
                    flag = false;
                    break;

                default:
                    Console.WriteLine("№ операции неверный,нажмите любую клавишу для продолжения и введите цифру от 1 до 7");
                    break;
                }
            }
        }
Beispiel #23
0
 public void UpdateForm(MedicalCard medicalCard)
 {
     current = medicalCard;
 }
            public async Task <IEnumerable> GetRecordsAsync(int startingIndex, int numberOfRecords, object filter)
            {
                MedicalCard medicalCard = await this.MedicalCardService.GetMedicalCardAsync(startingIndex / numberOfRecords, numberOfRecords, filter as string ?? string.Empty);

                return(medicalCard.Records.Cast <object>().ToList());
            }
        public ActionResult PatienMedicalCard(MedicalCard card)
        {
            EditUsers.MedicalCard(card, User.Identity.GetUserId().ToString());            //Updating patien medical card

            return(RedirectToAction("ListOfPatients", "Opportunities"));
        }
Beispiel #26
0
        public void updatePatientMedicalCard(Patient patient, MedicalCard medicalCardObj)
        {
            String query = String.Format("UPDATE Patients SET medicalCardID={0} WHERE patientID={1}", medicalCardObj.getMedicalCardIDFromDb(), patient.getPatientIDFromDb());

            _database.executeQuery(query);
        }