Esempio n. 1
0
    public bool commitInsert(string _fname, string _lname, string _uname, string _pass, int _phone, string _email)
    {
        patientsDataContext objPatientDC = new patientsDataContext();
        using (objPatientDC)
        {
            patient objNewPatient = new patient();
            objNewPatient.firstname = _fname;
            objNewPatient.lastname = _lname;
            objNewPatient.username = _uname;
            objNewPatient.passwd = _pass;
            objNewPatient.phone = _phone;
            objNewPatient.email = _email;

            objPatientDC.patients.InsertOnSubmit(objNewPatient);
            objPatientDC.SubmitChanges();
            return true;
        }
    }
Esempio n. 2
0
        private void tbSavePatient_Click(object sender, RoutedEventArgs e)
        {
            var      p             = context.patients;
            bool     CanAdd        = true;
            string   firstName     = tbFirstName.Text.ToString();
            string   lastName      = tbLastName.Text.ToString();
            string   phone         = tbPhone.Text.ToString();
            string   email         = tbEmail.Text.ToString();
            DateTime?dob           = DateTime.Parse(dpDOB.Text);
            string   medicalCardNo = tbMedicalCardNo.Text.ToString();
            string   userName      = tbUserName.Text.ToString();
            string   loginPassword = tbLoginPassword.Text.ToString();

            // check if username is unique in with patients table
            foreach (patient pat in p)
            {
                if (pat.UserName == userName)
                {
                    CanAdd = false;
                    break;
                }
            }
            if (!CanAdd)
            {
                MessageBox.Show(string.Format("The UserName {0} exist already, please enter another userName", userName));
            }
            if (CanAdd)
            {
                patient newPatient = new patient(firstName, lastName, phone, email, dob, medicalCardNo, userName, loginPassword);
                context.patients.Add(newPatient);
                try
                {
                    context.SaveChanges();
                }
                catch (DbEntityValidationException dbEx)
                {
                    foreach (var validationErrors in dbEx.EntityValidationErrors)
                    {
                        foreach (var validationError in validationErrors.ValidationErrors)
                        {
                            Trace.TraceInformation("Property: {0} Error: {1}",
                                                   validationError.PropertyName,
                                                   validationError.ErrorMessage);
                            MessageBox.Show(validationError.ErrorMessage);
                        }
                    }
                }
                MessageBox.Show("new patient added");

                //after add, ask user if need to add more, if yes, set the ui field to empty if now close dialog window

                MessageBoxResult messageBoxResult = MessageBox.Show("Do you need to add another new patient?", "Add more?", System.Windows.MessageBoxButton.YesNo);
                if (messageBoxResult == MessageBoxResult.Yes)
                {
                    tbFirstName.Text     = "";
                    tbLastName.Text      = "";
                    tbPhone.Text         = "";
                    tbEmail.Text         = "";
                    dpDOB.Text           = "";
                    tbMedicalCardNo.Text = "";
                    tbUserName.Text      = "";
                    tbLoginPassword.Text = "";
                }
                if (messageBoxResult == MessageBoxResult.No)
                {
                    Close();
                }
            }
        }
Esempio n. 3
0
 // POST: api/myApi
 public patient Post([FromBody] patient patient)
 {
     return(patientService.addPatient(patient));
 }
Esempio n. 4
0
        public void ValidatePatient(patient patient)
        {
            string taj          = patient.Taj;
            string jelszo       = patient.Jelszo;
            string vezeteknev   = patient.Vezeteknev;
            string keresztnev   = patient.Keresztnev;
            int    iranyitoszam = patient.Iranyitoszam;
            string telepules    = patient.Telepules;
            string lakcim       = patient.Lakcim;
            string email        = patient.Email;
            string telefon      = patient.Telefon;

            if (string.IsNullOrEmpty(taj) ||
                string.IsNullOrEmpty(jelszo) ||
                string.IsNullOrEmpty(vezeteknev) ||
                string.IsNullOrEmpty(keresztnev) ||
                string.IsNullOrEmpty(telepules) ||
                string.IsNullOrEmpty(lakcim) ||
                string.IsNullOrEmpty(email) ||
                string.IsNullOrEmpty(telefon))
            {
                throw new Exception("Üres bemenet.");
            }

            if (taj.Length != 11 || !taj.Contains('-') || taj.Any(char.IsLetter))
            {
                throw new Exception(
                          "Taj számnak tartalmaznia kell kötőjelet és 3-as tagolással összesen 11 karakter hosszú lehet, valamint nem tartalmazhat betűt.");
            }

            if (vezeteknev.Length > 50 || keresztnev.Length > 50)
            {
                throw new Exception("A vezetéknév vagy a keresztnév nem lehet hosszabb 50 karakternél.");
            }

            if (char.IsLower(vezeteknev.ElementAt(0)) || char.IsLower(keresztnev.ElementAt(0)))
            {
                throw new Exception("Vezetéknévnek vagy keresztnévnek nagy betűvel kell kezdődjön.");
            }

            if (jelszo.Length > 11)
            {
                throw new Exception("Jelszó 11 karakterből állhat.");
            }

            if (iranyitoszam == 0 || iranyitoszam.ToString().Length != 4)
            {
                throw new Exception("Irányítószám nem tartalmazhat betűt és 4 karakternek kell lennie!");
            }

            if (char.IsLower(telepules.ElementAt(0)) || telepules.Any(char.IsNumber))
            {
                throw new Exception("Teleülés neve nem kezdődhet kisbetűvel és nem tartalmazhat számot.");
            }

            if (char.IsLower(lakcim.ElementAt(0)))
            {
                throw new Exception("Lakcím nem kezdődhet kisbetűvel.");
            }

            if (!email.Contains('@'))
            {
                throw new Exception("Nem megfelelő e-mail cím formátum.");
            }

            if (telefon.Length > 11 || !telefon.Any(char.IsNumber))
            {
                throw new Exception(
                          "Telefonszám maximum 11 karakter hosszú lehet, és nem tartalmazhat speciális karaktereket (zárójel, kötőjel, stb.), illetve betűt.");
            }
        }
Esempio n. 5
0
        public ActionResult DetailsUpdateAll(System.Web.Mvc.FormCollection form)
        {
            string  mrn     = Request.Form["mrn"];
            patient p       = db.patients.Where(r => r.medical_record_number == mrn).FirstOrDefault();
            user    account = db.users.Find(UserAccount.GetUserID());

            int patientID = p.patient_id;
            //Tables
            List <patient_name>       pn  = db.patient_name.Where(r => r.patient_id == patientID).ToList();
            List <patient_family>     pf  = db.patient_family.Where(r => r.patient_id == patientID).ToList();
            patient_birth_information pbi = db.patient_birth_information.Where(r => r.patient_id == patientID).FirstOrDefault();
            List <patient_address>    pa  = db.patient_address.Where(r => r.patient_id == patientID).ToList();
            List <patient_insurance>  pi  = db.patient_insurance.Where(r => r.patient_id == patientID).ToList();
            //Form inputs
            //PrimaryName
            string fName = Request.Form["firstName"];
            string mName = Request.Form["middleName"];
            string lName = Request.Form["lastName"];
            //NewAlias
            string AfName = Request.Form["AfirstName"];
            string AmName = Request.Form["AmiddleName"];
            string AlName = Request.Form["AlastName"];


            //Work out Patient Names
            if (pn.Any())
            {
                //Find Primary Name
                patient_name foundPrimary = db.patient_name.Where(r => r.patient_id == patientID && r.patient_name_type_id == 1).FirstOrDefault();
                if (foundPrimary != null)
                {                                              //if the patient has a primary name (Which they should)
                    if (foundPrimary.first_name != fName || foundPrimary.middle_name != mName || foundPrimary.last_name != lName)
                    {                                          //check if the primary name changed
                        foundPrimary.patient_name_type_id = 2; //change primary name to an alias.
                        foundPrimary.date_edited          = DateTime.Now;
                        foundPrimary.edited_by            = account.userId;
                        db.Entry(foundPrimary).State      = EntityState.Modified;
                        patient_name newPrimary = new patient_name();
                        newPrimary.patient_name_type_id = 1;
                        newPrimary.patient_id           = patientID;
                        newPrimary.first_name           = fName;
                        newPrimary.middle_name          = mName;
                        newPrimary.last_name            = lName;
                        newPrimary.date_added           = DateTime.Now;
                        db.patient_name.Add(newPrimary);
                        db.SaveChanges();
                    }
                    if (AfName.Length > 1 && AlName.Length > 1)
                    {//Add an Alias
                        patient_name newAlias = new patient_name();
                        newAlias.patient_name_type_id = 2;
                        newAlias.patient_id           = patientID;
                        newAlias.first_name           = AfName;
                        newAlias.middle_name          = AmName;
                        newAlias.last_name            = AlName;
                        newAlias.date_added           = DateTime.Now;
                        db.patient_name.Add(newAlias);
                        db.SaveChanges();
                    }
                }
            }
            //update any other General Info
            string motherMaidenName = Request.Form["mothersMaidenName"];
            string sex           = Request.Form["sex"];
            string gender        = Request.Form["gender"];
            int    maritalStatus = Convert.ToInt32(Request.Form["maritalStatus"]);
            int    race          = Convert.ToInt32(Request.Form["race"]);
            int    ethnicity     = Convert.ToInt32(Request.Form["ethnicity"]);
            int    changed       = 0;

            if (p.mother_maiden_name != motherMaidenName)
            {
                p.mother_maiden_name = motherMaidenName; changed++;
            }
            if (p.patient_ethnicity_id != ethnicity)
            {
                p.patient_ethnicity_id = ethnicity; changed++;
            }
            if (p.marital_status_id != maritalStatus)
            {
                p.marital_status_id = maritalStatus; changed++;
            }
            if (p.patient_race_id != race)
            {
                p.patient_race_id = race; changed++;
            }
            if (changed > 0)//if there were any changes, update patient record.
            {
                p.date_edited     = DateTime.Now;
                p.edited_by       = account.userId;
                db.Entry(p).State = EntityState.Modified;
            }
            string address  = Request.Form["address"];
            string address2 = Request.Form["address2"];
            string city     = Request.Form["city"];
            string state    = Request.Form["state"];
            string zip      = Request.Form["zip"];

            string addressBilling  = Request.Form["addressBilling"];
            string address2Billing = Request.Form["address2Billing"];
            string cityBilling     = Request.Form["cityBilling"];
            string stateBilling    = Request.Form["stateBilling"];
            string zipBilling      = Request.Form["zipBilling"];

            changed = 0;
            if (pa.Any())
            {
                patient_address primaryAddress = db.patient_address.Where(r => r.address_type_id == 1).FirstOrDefault();
                if (primaryAddress != null)
                {
                    if (primaryAddress.street_address_one != address || primaryAddress.street_address_two != address2)
                    {
                        changed++;
                        primaryAddress.address_type_id = 4;
                        primaryAddress.date_edited     = DateTime.Now;
                        primaryAddress.edited_by       = account.userId;
                        db.Entry(primaryAddress).State = EntityState.Modified;
                        patient_address newPrimary = new patient_address();
                        newPrimary.patient_id         = patientID;
                        newPrimary.street_address_one = address;
                        newPrimary.street_address_two = address2;
                        newPrimary.city            = city;
                        newPrimary.state           = state;
                        newPrimary.zip             = zip;
                        newPrimary.address_type_id = 1;
                        newPrimary.date_added      = DateTime.Now;
                        db.patient_address.Add(newPrimary);
                    }
                }
                else
                {
                    changed++;
                    patient_address newPrimary = new patient_address();
                    newPrimary.patient_id         = patientID;
                    newPrimary.street_address_one = address;
                    newPrimary.street_address_two = address2;
                    newPrimary.city            = city;
                    newPrimary.state           = state;
                    newPrimary.zip             = zip;
                    newPrimary.address_type_id = 1;
                    newPrimary.date_added      = DateTime.Now;
                    db.patient_address.Add(newPrimary);
                }
                patient_address primaryAddressBilling = db.patient_address.Where(r => r.address_type_id == 2).FirstOrDefault();
                if (primaryAddressBilling != null)
                {
                    if (primaryAddressBilling.street_address_one != addressBilling || primaryAddressBilling.street_address_two != address2Billing)
                    {
                        changed++;

                        patient_address newPrimaryBilling = new patient_address();
                        newPrimaryBilling.patient_id         = patientID;
                        newPrimaryBilling.street_address_one = addressBilling;
                        newPrimaryBilling.street_address_two = address2Billing;
                        newPrimaryBilling.city            = cityBilling;
                        newPrimaryBilling.state           = stateBilling;
                        newPrimaryBilling.zip             = zipBilling;
                        newPrimaryBilling.address_type_id = 2;
                        newPrimaryBilling.date_added      = DateTime.Now;
                        db.patient_address.Add(newPrimaryBilling);
                        primaryAddressBilling.address_type_id = 4;
                        primaryAddressBilling.date_edited     = DateTime.Now;
                        primaryAddressBilling.edited_by       = account.userId;
                        db.Entry(primaryAddressBilling).State = EntityState.Modified;
                    }
                }
                else
                {
                    changed++;
                    patient_address newPrimaryBilling = new patient_address();
                    newPrimaryBilling.patient_id         = patientID;
                    newPrimaryBilling.street_address_one = addressBilling;
                    newPrimaryBilling.street_address_two = address2Billing;
                    newPrimaryBilling.city            = cityBilling;
                    newPrimaryBilling.state           = stateBilling;
                    newPrimaryBilling.zip             = zipBilling;
                    newPrimaryBilling.address_type_id = 2;
                    newPrimaryBilling.date_added      = DateTime.Now;
                    db.patient_address.Add(newPrimaryBilling);
                }
            }
            else  //If no addresses exist add them
            {
                if (address.Length > 1 || address2.Length > 1 || city.Length > 1 || state.Length > 1 || zip.Length > 1)
                {
                    changed++;
                    patient_address newAddress = new patient_address();
                    newAddress.patient_id         = patientID;
                    newAddress.street_address_one = address;
                    newAddress.street_address_two = address2;
                    newAddress.city            = city;
                    newAddress.state           = state;
                    newAddress.zip             = zip;
                    newAddress.address_type_id = 1;
                    newAddress.date_added      = DateTime.Now;
                    db.patient_address.Add(newAddress);
                }
                if (addressBilling.Length > 1 || address2Billing.Length > 1 || cityBilling.Length > 1 || stateBilling.Length > 1 || zipBilling.Length > 1)
                {
                    changed++;
                    patient_address newAddressBilling = new patient_address();
                    newAddressBilling.patient_id         = patientID;
                    newAddressBilling.street_address_one = addressBilling;
                    newAddressBilling.street_address_two = address2Billing;
                    newAddressBilling.city            = cityBilling;
                    newAddressBilling.state           = stateBilling;
                    newAddressBilling.zip             = zipBilling;
                    newAddressBilling.address_type_id = 2;
                    newAddressBilling.date_added      = DateTime.Now;
                    db.patient_address.Add(newAddressBilling);
                }
            }
            if (changed > 0)
            {//If address is added or updated, save the changes.
                db.SaveChanges();
            }

            ViewBag.patientId = mrn;
            return(View("Details", new { id = mrn }));
        }
Esempio n. 6
0
        public ActionResult CreateGeneral(System.Web.Mvc.FormCollection form)
        {
            string  mrn = Request.Form["mrn"];
            patient p   = db.patients.Where(r => r.medical_record_number == mrn).FirstOrDefault();

            try
            {
                user account = db.users.Find(UserAccount.GetUserID());

                int patientID = p.patient_id;

                patient_name              pn     = new patient_name();
                patient_family            mother = new patient_family();
                patient_family            father = new patient_family();
                patient_birth_information pbi    = db.patient_birth_information.Where(r => r.patient_id == patientID).FirstOrDefault();

                // Update patient's patient table

                p.gender_id            = Convert.ToInt32(Request.Form["gender"]);
                p.mother_maiden_name   = Request.Form["mothersMaidenName"];
                p.date_edited          = DateTime.Now;
                p.marital_status_id    = Convert.ToInt32(Request.Form["maritalStatus"]);
                p.patient_ethnicity_id = Convert.ToInt32(Request.Form["ethnicity"]);
                p.patient_race_id      = Convert.ToInt32(Request.Form["race"]);
                if (Request.Cookies["userId"] != null)
                {
                    HttpCookie aCookie = Request.Cookies["userId"];
                    p.edited_by = Convert.ToInt32(Server.HtmlEncode(aCookie.Value));
                }
                db.Entry(p).State = EntityState.Modified;
                db.SaveChanges();
                //update patient's name table
                //Primary Name
                pn.first_name           = Request.Form["firstName"];
                pn.middle_name          = Request.Form["middleName"];
                pn.last_name            = Request.Form["lastName"];
                pn.patient_id           = patientID;
                pn.patient_name_type_id = 1; //Find this in db later
                pn.date_added           = DateTime.Now;

                db.patient_name.Add(pn);
                db.SaveChanges();
                string aliasFirstName  = Request.Form["AfirstName"];
                string aliasMiddleName = Request.Form["AmiddleName"];
                string aliasLastName   = Request.Form["AlastName"];

                if (aliasFirstName.Length > 1 && aliasLastName.Length > 1)
                {
                    patient_name pna = new patient_name();
                    pna.first_name           = aliasFirstName;
                    pna.middle_name          = aliasMiddleName;
                    pna.last_name            = aliasLastName;
                    pna.patient_id           = patientID;
                    pna.patient_name_type_id = 2;
                    pna.date_added           = DateTime.Now;

                    db.patient_name.Add(pna);
                    db.SaveChanges();
                }
                if (pbi != null)
                {
                }
                else
                {
                    patient_birth_information newPBI = new patient_birth_information();
                    newPBI.birth_date = DateTime.Parse(Request.Form["dob"]).Date;
                    newPBI.patient_id = patientID;
                    newPBI.date_added = DateTime.Now;
                    db.patient_birth_information.Add(newPBI);
                    db.SaveChanges();
                }

                //logger.Info("User " + account.firstName + " " + account.lastName + " created patient: " + p.medical_record_number);
                // return View("Details", new { id = p.medical_record_number });
                return(Redirect("Details/" + p.medical_record_number));
            }
            catch (DbEntityValidationException dbEx)
            {
                //return View("Details", new { id = p.medical_record_number });
                return(Redirect("Details/" + p.medical_record_number));
            }
        }
    public void AddPatient()
    {
        patient item = new patient();
        Text    currentfield;
        string  field;

        currentfield = (Text)GameObject.Find("Text_AddPatient_NameField").GetComponent(typeof(Text));
        field        = currentfield.text;
        string[] names = Regex.Split(field, ", ");
        item.lastName  = names[0];
        item.givenName = names[1];

        currentfield = (Text)GameObject.Find("Text_AddPatient_DateofBirthField").GetComponent(typeof(Text));
        item.DOB     = currentfield.text;

        currentfield = (Text)GameObject.Find("Text_AddPatient_AddressField").GetComponent(typeof(Text));
        field        = currentfield.text;
        names        = Regex.Split(field, ", ");
        item.address = names[0];
        item.city    = names[1];
        item.state   = names[2];

        currentfield = (Text)GameObject.Find("Text_AddPatient_PhoneField").GetComponent(typeof(Text));
        item.phone   = currentfield.text;

        currentfield = (Text)GameObject.Find("Text_AddPatient_GenderField").GetComponent(typeof(Text));
        item.gender  = currentfield.text;

        currentfield    = (Text)GameObject.Find("Text_AddPatient_BloodgroupField").GetComponent(typeof(Text));
        item.bloodgroup = currentfield.text;

        currentfield = (Text)GameObject.Find("Text_AddPatient_EmailField").GetComponent(typeof(Text));
        item.email   = currentfield.text;

        currentfield    = (Text)GameObject.Find("Text_AddPatient_InjuryField").GetComponent(typeof(Text));
        item.injuryName = currentfield.text;

        currentfield    = (Text)GameObject.Find("Text_AddPatient_InjurydateField").GetComponent(typeof(Text));
        item.injuryDate = currentfield.text;

        currentfield        = (Text)GameObject.Find("Text_AddPatient_InjurySeverityField").GetComponent(typeof(Text));
        item.injurySeverity = currentfield.text;

        currentfield           = (Text)GameObject.Find("Text_AddPatient_ContactField").GetComponent(typeof(Text));
        item.familyContactName = currentfield.text;

        currentfield            = (Text)GameObject.Find("Text_AddPatient_ContactPhoneField").GetComponent(typeof(Text));
        item.familyContactPhone = currentfield.text;

        //put therapist stuff here

        currentfield     = (Text)GameObject.Find("Text_AddPatient_CommentsField").GetComponent(typeof(Text));
        item.commentText = currentfield.text;


        try
        {
            string query = "INSERT INTO magni_patient (givenName, lastName, DOB, address, city, state, gender, bloodgroup, " +
                           "email, injuryName, injuryDate, injurySeverity, familyContactName, commentText) VALUES (?givenName, ?lastName, " +
                           "?DOB, ?address, ?city, ?state, ?gender, ?bloodgroup, ?email, ?injuryName, ?injuryDate, ?injurySeverity, " +
                           "?familyContactName, ?commentText)";             //, ?MRN, ?recordCreate_TS)";
            cmd = new MySqlCommand(query, con);
            MySqlParameter param1 = cmd.Parameters.Add("?givenName", MySqlDbType.VarChar);
            param1.Value = item.givenName;
            MySqlParameter param2 = cmd.Parameters.Add("?lastName", MySqlDbType.VarChar);
            param2.Value = item.lastName;
            MySqlParameter param3 = cmd.Parameters.Add("?DOB", MySqlDbType.VarChar);
            param3.Value = item.DOB;
            MySqlParameter param4 = cmd.Parameters.Add("?address", MySqlDbType.VarChar);
            param4.Value = item.address;
            MySqlParameter param5 = cmd.Parameters.Add("?city", MySqlDbType.VarChar);
            param5.Value = item.city;
            MySqlParameter param6 = cmd.Parameters.Add("?state", MySqlDbType.VarChar);
            param6.Value = item.state;
            //MySqlParameter param7 = cmd.Parameters.Add("?phone", MySqlDbType.Int64);
            //param7.Value = Int64.Parse(item.phone);
            MySqlParameter param8 = cmd.Parameters.Add("?gender", MySqlDbType.VarChar);
            param8.Value = item.gender;
            MySqlParameter param9 = cmd.Parameters.Add("?bloodgroup", MySqlDbType.VarChar);
            param9.Value = item.bloodgroup;
            MySqlParameter param10 = cmd.Parameters.Add("?email", MySqlDbType.VarChar);
            param10.Value = item.email;
            MySqlParameter param11 = cmd.Parameters.Add("?injuryName", MySqlDbType.VarChar);
            param11.Value = item.injuryName;
            MySqlParameter param12 = cmd.Parameters.Add("?injuryDate", MySqlDbType.VarChar);
            param12.Value = item.injuryDate;
            MySqlParameter param13 = cmd.Parameters.Add("?injurySeverity", MySqlDbType.VarChar);
            param13.Value = item.injurySeverity;
            MySqlParameter param14 = cmd.Parameters.Add("?familyContactName", MySqlDbType.VarChar);
            param14.Value = item.familyContactName;
            //MySqlParameter param15 = cmd.Parameters.Add("?familyContactPhone", MySqlDbType.Int64);
            //param15.Value = Int64.Parse(item.familyContactPhone);
            MySqlParameter param16 = cmd.Parameters.Add("?commentText", MySqlDbType.VarChar);
            param16.Value = item.commentText;
            //			MySqlParameter param17 = cmd.Parameters.Add("?MRN", MySqlDbType.Int64);
            //			param17.Value = 123;
            //			MySqlParameter param18 = cmd.Parameters.Add("?recordCreate_TS", MySqlDbType.Int64);
            //			param18.Value = 123;
            cmd.ExecuteNonQuery();

            Canvas can = (Canvas)GameObject.Find("Canvas_AddPatient").GetComponent(typeof(Canvas));
            can.enabled = false;
            can         = (Canvas)GameObject.Find("Canvas_PatientSearch").GetComponent(typeof(Canvas));
            can.enabled = true;
        }
        catch (Exception e)
        {
            Debug.Log(e.ToString());
        }
    }
Esempio n. 8
0
        public ActionResult Edit(string page, string sortOrder, string currentFilter, string preColumn, patient patient)
        {
            int intPage = Convert.ToInt32(page); // Convert page to integer

            if (ModelState.IsValid)              // Update patient
            {
                db.Entry(patient).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index", new { sucMsg = "Patient modified", page = intPage, sortOrder = sortOrder, currentFilter = currentFilter, preColumn = preColumn }));    // Go back to list and display successful message
            }

            int userID = Convert.ToInt32(Session["UserID"] != null ? Session["UserID"].ToString() : "0"); // Convert session user id to integer for comparison and prevent from NULL

            ViewBag.Page          = intPage;                                                              // Create viewbag variable for current page
            ViewBag.CurrentSort   = sortOrder;                                                            // Create viewbag variable for current sort
            ViewBag.CurrentFilter = currentFilter;                                                        // Create viewbag variable for current filter
            ViewBag.PreColumn     = preColumn;                                                            // Create viewbag variable for filtering column

            ViewBag.userName = (from u in db.users
                                where (u.UserID == userID)
                                select u.UserFName).FirstOrDefault().ToString();      // Passing user first name to view

            return(View(patient));
        }
Esempio n. 9
0
 public void Add(patient Patient)
 {
     data.Add(Patient);
 }
Esempio n. 10
0
 public void MarkAsModified(patient item)
 {
 }
 //add reservation record to database
 public ActionResult reservation(string name, string phone, string appointementDate, string interval, Guid docID)
 {
     try
     {
         //convert from string to date format
         var appointDate = DateTime.Parse(appointementDate);
         //booked doctor
         var targetDoctor = db.doctors.Find(docID);
         if (!isValidReservingData(phone, name, targetDoctor.bookingType, interval))
         {                                                     //reservation data is not valid
             TempData["error"] = Resource1.invalidBookingData; //show error data on page
             //redirect to reservation page
             return(RedirectToAction("doctorReservingsPage", new { id = docID }));
         }
         //user is not authenticated
         if (!isUserAuthenticated())
         {
             return(RedirectToAction("doctorReservingsPage", new { id = docID }));
         }
         patient currentPatient = getCurrentpatient();
         //number of resrevation that patient already reserved before for the same doctor
         int numberOfreservingAtTheSameDoctorAtTheSameDate = currentPatient.reservings.Count(r => r.doctorID == docID && r.reservingDate == appointDate.Date);
         //onlay available for patinet to reserve 2 times at same doctor at same date
         if (numberOfreservingAtTheSameDoctorAtTheSameDate > 2)
         {
             TempData["error"] = Resource1.maxBookingNumber;
             return(RedirectToAction("doctorReservingsPage", new { id = docID }));
         }
         //return if this patient has already booked at this doctor ,with the same date ,with the same patient name
         bool isHasAnybookingForThatPatient =
             currentPatient.reservings.Any(r => r.doctorID == docID && r.reservingDate == appointDate.Date && r.patientName == name);
         //user can not book a reservation at the same doctor with the same time with the same patient name
         if (isHasAnybookingForThatPatient)
         {
             TempData["error"] = Resource1.haveBookingAlready;
             return(RedirectToAction("doctorReservingsPage", new { id = docID }));
         }
         //add new reservation record at database
         reserving newReservation = new reserving();
         newReservation.doctorID      = docID;
         newReservation.patientName   = name;
         newReservation.patientID     = currentPatient.id;
         newReservation.reservingDate = appointDate.Date;
         newReservation.visitType     = true;
         newReservation.phone         = phone;
         newReservation.interval      = interval;
         newReservation.id            = Guid.NewGuid();
         currentPatient.reservings.Add(newReservation);
         db.SaveChanges();
         thankForBookingData bookingDoneData = new thankForBookingData();
         bookingDoneData.name             = name;
         bookingDoneData.clinicAddress    = (currentLanguage == "en") ? targetDoctor.doctorInfo.clinicAddressEng : targetDoctor.doctorInfo.clinicAddressAr;
         bookingDoneData.appointementDate = appointDate;
         bookingDoneData.interval         = interval;
         bookingDoneData.bookingType      = targetDoctor.bookingType;
         //go to thank you page(booking is done)
         return(RedirectToAction("thankYouForBooking", bookingDoneData));
     }
     catch (Exception)
     {
         TempData["error"] = Resource1.serverProblem;
         return(RedirectToAction("doctorReservingsPage"));
     }
 }
Esempio n. 12
0
        internal void Modify(appointment selectedAppointment, patient selectedPatient, doctor doctor, DateTime selectedDate, doctorProcedure procedure, int duration)
        {
            DentistOfficeEntities2 context = new DentistOfficeEntities2();

            context.ModifyAppointment(selectedDate, duration, selectedAppointment.idAppointment, doctor.idDoctor, selectedPatient.idPatient, procedure.idProcedure);
        }
Esempio n. 13
0
 private List <temp_service> GetCurrentPatientBills(patient patient)
 {
     return(dbHelper.temp_service.Where(b => b.patient_id == patient.patient_id).ToList());
 }
Esempio n. 14
0
 public Invoice(patient currentPatient)
 {
     InitializeComponent();
     _curentPatient = currentPatient;
 }
Esempio n. 15
0
 public void AddPatient(patient patient)
 {
     Patients.Add(patient);
 }
Esempio n. 16
0
 public void Update(patient Patient)
 {
     data.Update(Patient);
 }
 public void Modify(patient patient, int index)
 {
     repository.Update(patient);
     view.bindingList.RemoveAt(index);
     view.bindingList.Insert(index, patient);
 }
Esempio n. 18
0
        private patient getNewPatient()
        {
            int patientnr       = 0;
            int inschrijvingsnr = 0;

            if (int.TryParse(this.patNrBox.Text, out patientnr) && int.TryParse(this.inschrijvingsBox.Text, out inschrijvingsnr))
            {
                try
                {
                    DateTime tempdate = DateTime.Parse(this.geboortedatumBox.Text);
                    patient  tempPat  = new patient(patientnr, inschrijvingsnr, this.naamBox.Text, this.voornaamBox.Text, this.geslachtBox.Text, tempdate, this.woonplaatsbox.Text);;


                    int tempbox;

                    if (int.TryParse(this.boxBox.Text, out tempbox))
                    {
                        tempPat.Box = tempbox;
                    }
                    ;
                    tempPat.Gif = this.gif.Checked;
                    char[]   timedelimiter = { ':', ',', '.' };
                    DateTime tempopname    = DateTime.Parse(this.opnameDatum.Text);

                    string[] opnamesplit = this.opnameUur.Text.Split(timedelimiter, System.StringSplitOptions.RemoveEmptyEntries);
                    tempopname         = tempopname.AddHours(Convert.ToDouble(opnamesplit[0]));
                    tempopname         = tempopname.AddMinutes(Convert.ToDouble(opnamesplit[1]));
                    tempPat.TijdOpname = tempopname;
                    DateTime tempontslag = DateTime.Parse(this.ontslagDatumBox.Text);

                    string[] ontslagsplit = this.ontslagUur.Text.Split(timedelimiter, System.StringSplitOptions.RemoveEmptyEntries);
                    tempontslag         = tempontslag.AddHours(Convert.ToDouble(ontslagsplit[0]));
                    tempontslag         = tempontslag.AddMinutes(Convert.ToDouble(ontslagsplit[1]));
                    tempPat.TijdOntslag = tempontslag;
                    tempPat.Komtvan     = this.komtVanBox.Text;
                    tempPat.Gaatnaar    = this.gaatNaarBox.Text;
                    if (this.gaatnaarKamer.Text != "")
                    {
                        tempPat.Gaatnaarkamer = Convert.ToInt32(this.gaatnaarKamer.Text);
                    }

                    tempPat.CoordArts    = this.coordArts.Text;
                    tempPat.BehandelArts = this.behandArts.Text;
                    tempPat.Diagnose     = this.diagnose.Text;
                    tempPat.DnrCode      = Convert.ToInt32(this.dnrDrop.Text);
                    tempPat.Anamnese     = this.anamnese.Text;
                    tempPat.ThuisMed     = this.thuismedicatie.Text;

                    List <Katheter> tempKathlist = new List <Katheter>();
                    tempPat.HasKathether = false;
                    for (int i = 1; i <= 5; i++)
                    {
                        string tempkathmet  = "kathMet" + i;
                        string tempkathDate = "kathDate" + i;
                        var    kathmet      = this.Controls.Find(tempkathmet, true);
                        var    kathDate     = this.Controls.Find(tempkathDate, true);
                        if (kathmet[0].Text != "" && kathDate[0].Text != "")
                        {
                            tempPat.HasKathether = true;
                            tempKathlist.Add(new Katheter(kathmet[0].Text, DateTime.Parse(kathDate[0].Text)));
                        }
                    }
                    tempPat.KathList = tempKathlist;


                    tempPat.Thoraxdrain = DateTime.Parse(this.thoraxDate.Text);
                    tempPat.Maagsonde   = DateTime.Parse(this.sondeDatum.Text);
                    tempPat.Blaassonde  = DateTime.Parse(this.sondeDatum.Text);
                    tempPat.Pda         = DateTime.Parse(this.pdaDatum.Text);
                    tempPat.Pcea        = DateTime.Parse(this.pceaDatum.Text);
                    tempPat.Pcia        = DateTime.Parse(this.pciaDatum.Text);

                    tempPat.Arterieel     = this.arteriele.Checked;
                    tempPat.Picco         = this.picco.Checked;
                    tempPat.Cvd           = this.cvd.Checked;
                    tempPat.SwanGans      = this.swangans.Checked;
                    tempPat.PMimplant1    = this.pmImp.Checked;
                    tempPat.TempoPM       = this.tempPm.Checked;
                    tempPat.CardiaTromb   = this.cardTromb.Checked;
                    tempPat.NietCardTromb = this.niCardTromb.Checked;
                    //tab2

                    List <Beademing> tempademlist = new List <Beademing>();
                    tempPat.Beademing = false;
                    for (int i = 1; i <= 3; i++)
                    {
                        string tempAdemStart  = "ademStart" + i;
                        string tempAdemStartU = "ademStartU" + i;
                        string tempAdemStop   = "ademStop" + i;
                        string tempAdemStopU  = "ademStopU" + i;

                        var ademstart  = this.Controls.Find(tempAdemStart, true);
                        var ademstartu = this.Controls.Find(tempAdemStartU, true);
                        var ademstop   = this.Controls.Find(tempAdemStop, true);
                        var ademstopu  = this.Controls.Find(tempAdemStopU, true);
                        if (ademstart[0].Text != "" && ademstartu[0].Text != "")
                        {
                            DateTime tempAdemsta = DateTime.Parse(ademstart[0].Text);
                            DateTime tempAdemsto;
                            string[] ademstartsplit = ademstartu[0].Text.Split(timedelimiter, System.StringSplitOptions.RemoveEmptyEntries);
                            tempAdemsta = tempAdemsta.AddHours(Convert.ToDouble(ademstartsplit[0]));
                            tempAdemsta = tempAdemsta.AddMinutes(Convert.ToDouble(ademstartsplit[1]));

                            if (ademstop[0].Text != "" && ademstopu[0].Text != "")
                            {
                                tempAdemsto = DateTime.Parse(ademstop[0].Text);
                                string[] ademstopsplit = ademstopu[0].Text.Split(timedelimiter, System.StringSplitOptions.RemoveEmptyEntries);
                                tempAdemsto = tempAdemsto.AddHours(Convert.ToDouble(ademstopsplit[0]));
                                tempAdemsto = tempAdemsto.AddMinutes(Convert.ToDouble(ademstopsplit[1]));
                            }
                            else
                            {
                                tempAdemsto = DateTime.MinValue;
                            }
                            tempPat.Beademing = true;
                            tempademlist.Add(new Beademing(tempAdemsta, tempAdemsto));
                        }
                    }
                    tempPat.BeadList = tempademlist;

                    List <NIV> tempNivList = new List <NIV>();
                    tempPat.HasNiv = false;
                    for (int i = 1; i <= nivFlowPanel.Controls.Count; i++)
                    {
                        string tempstopNiv   = "stopniv" + i;
                        string tempstopNivU  = "stopnivU" + i;
                        string tempstartniv  = "startniv" + i;
                        string tempstartnivU = "startnivU" + i;

                        var startNiv  = this.Controls.Find(tempstartniv, true);
                        var startNivU = this.Controls.Find(tempstartnivU, true);
                        var stopNiv   = this.Controls.Find(tempstopNiv, true);
                        var stopNivU  = this.Controls.Find(tempstopNivU, true);
                        if (startNiv[0].Text != "" && startNivU[0].Text != "")
                        {
                            DateTime tempnivstart = DateTime.Parse(startNiv[0].Text);

                            string[] nivstartsplit = startNivU[0].Text.Split(timedelimiter, System.StringSplitOptions.RemoveEmptyEntries);
                            tempnivstart = tempnivstart.AddHours(Convert.ToDouble(nivstartsplit[0]));
                            tempnivstart = tempnivstart.AddMinutes(Convert.ToDouble(nivstartsplit[1]));
                            DateTime tempnivstop;
                            if (stopNiv[0].Text != "" && stopNivU[0].Text != "")
                            {
                                tempnivstop = DateTime.Parse(stopNiv[0].Text);
                                string[] nivstopsplit = stopNivU[0].Text.Split(timedelimiter, System.StringSplitOptions.RemoveEmptyEntries);
                                tempnivstop = tempnivstop.AddHours(Convert.ToDouble(nivstopsplit[0]));
                                tempnivstop = tempnivstop.AddMinutes(Convert.ToDouble(nivstopsplit[1]));
                            }
                            else
                            {
                                tempnivstop = DateTime.MinValue;
                            }
                            tempPat.HasNiv = true;
                            tempNivList.Add(new NIV(tempnivstart, tempnivstop));
                        }
                    }
                    tempPat.Nivlist = tempNivList;



                    //tab3

                    tempPat.Ritme      = this.ritmeBox.Text;
                    tempPat.WhatIsP    = Convert.ToInt32(this.pressureBox.Text);
                    tempPat.Bd         = this.bloedDrukBox.Text;
                    tempPat.Dieet      = this.Dieet.Text;
                    tempPat.Sv         = this.svCheckbox.Checked;
                    tempPat.Telemetrie = Convert.ToInt32(this.teleCombo.Text);
                    tempPat.Kine       = this.KineCheckBox.Checked;
                    tempPat.Zalving    = this.zalvingCheckBox.Checked;

                    List <Medicatie> tempMedicList = new List <Medicatie>();
                    tempPat.Medicatie = false;
                    for (int i = 1; i <= 20; i++)
                    {
                        string tempTextName = "medicText" + i;
                        string tempAantName = "medicper" + i;
                        string tempMethName = "medicMeth" + i;
                        var    tempTextNode = this.Controls.Find(tempTextName, true);
                        var    tempAantNode = this.Controls.Find(tempAantName, true);
                        var    tempMetNode  = this.Controls.Find(tempMethName, true);
                        if (tempTextNode[0].Text != "")
                        {
                            tempPat.Medicatie = true;
                            tempMedicList.Add(new Medicatie(tempTextNode[0].Text, Convert.ToInt32(tempAantNode[0].Text), tempMetNode[0].Text));
                        }
                    }
                    tempPat.MedicList = tempMedicList;

                    List <Infuus> tempInfuusList = new List <Infuus>();
                    tempPat.Infuus = false;

                    for (int i = 1; i <= 3; i++)
                    {
                        string tempinfuusName  = "infuustext" + i;
                        string tempinfMiniName = "infuusMini" + i;

                        var tempTextNode = this.Controls.Find(tempinfuusName, true);
                        var tempMiniNode = this.Controls.Find(tempinfMiniName, true);
                        if (tempTextNode[0].Text != "")
                        {
                            tempPat.Infuus = true;
                            tempInfuusList.Add(new Infuus(tempTextNode[0].Text, Convert.ToInt32(tempMiniNode[0].Text)));
                        }
                    }
                    tempPat.InfuusList = tempInfuusList;

                    tempPat.PceaUitleg    = this.pdaText.Text;
                    tempPat.PceaUitlegAt1 = this.pdaMini.Text;
                    tempPat.Zorgen        = this.zorgbox.Text;


                    List <Drains> tempDrainList = new List <Drains>();
                    tempPat.Drains = false;

                    for (int i = 1; i <= 4; i++)
                    {
                        string tempDrainName = "drainbox" + i;
                        var    tempDrainNode = this.Controls.Find(tempDrainName, true);
                        if (tempDrainNode[0].Text != "")
                        {
                            tempPat.Drains = true;
                            tempDrainList.Add(new Drains(tempDrainNode[0].Text));
                        }
                    }
                    tempPat.DrainList = tempDrainList;


                    var tempOnderzoekList = new List <Onderzoek>();
                    tempPat.Onderzoek = false;
                    for (int i = 1; i <= 4; i++)
                    {
                        string tempOndName = "onderzoekbox" + i;
                        var    tempOndNode = this.Controls.Find(tempOndName, true);
                        if (tempOndNode[0].Text != "")
                        {
                            tempPat.Onderzoek = true;
                            tempOnderzoekList.Add(new Onderzoek(tempOndNode[0].Text));
                        }
                    }
                    tempPat.OnderzoekList = tempOnderzoekList;


                    //tab4
                    tempPat.Verpleegkundige = this.verpleegkundigeBox.Text;
                    tempPat.Verslag         = this.VerslagBox.Text;
                    return(tempPat);
                }
                catch (FormatException e)
                {
                    MessageBox.Show("een datum is incorrect geformatteerd: " + e.Message);
                    return(new patient(999999999, 0, "", "", "", DateTime.Now, ""));
                }
                catch (InvalidCastException e)
                {
                    MessageBox.Show("een datum is incorrect geformatteerd: " + e.Message);
                    return(new patient(999999999, 0, "", "", "", DateTime.Now, ""));
                }
            }
            else
            {
                MessageBox.Show("gelieve enkel positieve gehele getallen in te vullen bij patientNr en inschrijvingsNr");
                return(patientList[patientList.Count() - 1]);
            }
        }
    public void PatientSearch()
    {
        GameObject go        = GameObject.Find("InputFieldText_PatientSearch_PatientName");
        Text       namefield = (Text)go.GetComponent(typeof(Text));
        //go = GameObject.Find ("Canvas_PatientSearch");
        string name = namefield.text;

        patientList.Clear();
        patientListReference = 0;
        Text buttontext;

        id1             = id2 = id3 = id4 = id5 = id6 = "";
        go              = GameObject.Find("Text_PatientSearch_Patient1");
        buttontext      = (Text)go.GetComponent(typeof(Text));
        buttontext.text = "No Patient";
        go              = GameObject.Find("Text_PatientSearch_Patient2");
        buttontext      = (Text)go.GetComponent(typeof(Text));
        buttontext.text = "No Patient";
        go              = GameObject.Find("Text_PatientSearch_Patient3");
        buttontext      = (Text)go.GetComponent(typeof(Text));
        buttontext.text = "No Patient";
        go              = GameObject.Find("Text_PatientSearch_Patient4");
        buttontext      = (Text)go.GetComponent(typeof(Text));
        buttontext.text = "No Patient";
        go              = GameObject.Find("Text_PatientSearch_Patient5");
        buttontext      = (Text)go.GetComponent(typeof(Text));
        buttontext.text = "No Patient";
        go              = GameObject.Find("Text_PatientSearch_Patient6");
        buttontext      = (Text)go.GetComponent(typeof(Text));
        buttontext.text = "No Patient";

        if (name.Equals(""))
        {
            return;
        }

        try
        {
            cmd = new MySqlCommand("Select * from magni_patient where lastName like '" + name + "%' order by lastName", con);
            rdr = cmd.ExecuteReader();
            if (rdr.HasRows)
            {
                //Sint i = 1;
                while (rdr.Read())               // && i <= 6)
                {
                    patient item = new patient();
                    item.patientId = rdr["patientId"].ToString();
                    item.givenName = rdr["givenName"].ToString();
                    item.lastName  = rdr["lastName"].ToString();
                    item.DOB       = rdr["DOB"].ToString().Substring(0, 10);
                    patientList.Add(item);
                    Debug.Log(patientList.Count);
                }
                for (int i = 0; (i < 6) && (i < patientList.Count); i++)
                {
                    switch (i)
                    {
                    case 0:
                        id1             = patientList[0].patientId;
                        go              = GameObject.Find("Text_PatientSearch_Patient1");
                        buttontext      = (Text)go.GetComponent(typeof(Text));
                        buttontext.text = patientList[0].lastName + "," + patientList[0].givenName + ", " + patientList[0].DOB;
                        break;

                    case 1:
                        id2             = patientList[1].patientId;
                        go              = GameObject.Find("Text_PatientSearch_Patient2");
                        buttontext      = (Text)go.GetComponent(typeof(Text));
                        buttontext.text = patientList[1].lastName + "," + patientList[1].givenName + ", " + patientList[1].DOB;;
                        break;

                    case 2:
                        id3             = patientList[2].patientId;
                        go              = GameObject.Find("Text_PatientSearch_Patient3");
                        buttontext      = (Text)go.GetComponent(typeof(Text));
                        buttontext.text = patientList[2].lastName + "," + patientList[2].givenName + ", " + patientList[2].DOB;;
                        break;

                    case 3:
                        id4             = patientList[3].patientId;
                        go              = GameObject.Find("Text_PatientSearch_Patient4");
                        buttontext      = (Text)go.GetComponent(typeof(Text));
                        buttontext.text = patientList[3].lastName + "," + patientList[3].givenName + ", " + patientList[3].DOB;;
                        break;

                    case 4:
                        id5             = patientList[4].patientId;
                        go              = GameObject.Find("Text_PatientSearch_Patient5");
                        buttontext      = (Text)go.GetComponent(typeof(Text));
                        buttontext.text = patientList[4].lastName + "," + patientList[4].givenName + ", " + patientList[4].DOB;;
                        break;

                    case 5:
                        id6             = patientList[5].patientId;
                        go              = GameObject.Find("Text_PatientSearch_Patient6");
                        buttontext      = (Text)go.GetComponent(typeof(Text));
                        buttontext.text = patientList[5].lastName + "," + patientList[5].givenName + ", " + patientList[5].DOB;;
                        break;
                    }
                }
                rdr.Close();
                if (patientList.Count > 6)
                {
                    go = GameObject.Find("Button_PatientSearch_Next");
                    Button nextbutton = (Button)go.GetComponent(typeof(Button));
                    nextbutton.interactable = true;
                }
            }
        }
        catch (Exception e)
        {
            Debug.Log(e.ToString());
        }
    }
Esempio n. 20
0
 partial void Insertpatient(patient instance);
Esempio n. 21
0
 public patient addPatient(patient patient)
 {
     _db.patients.Add(patient);
     _db.SaveChanges();
     return(patient);
 }
Esempio n. 22
0
 partial void Updatepatient(patient instance);
Esempio n. 23
0
        public ActionResult PatientLookup(System.Web.Mvc.FormCollection form)
        {
            ViewBag.statusMessage = "";
            using (HITProjectData_Fall17Entities1 newDB = new HITProjectData_Fall17Entities1())
            {
                List <patient_general_info> patientToCollection = new List <patient_general_info>();
                patient_general_info        patients            = null;

                string button = Request.Form["button"];


                string mrn  = Request.Form["mrn"];
                string ssn  = Request.Form["ssn1"];
                string last = Request.Form["last"];
                ViewBag.patient = ssn;
                ViewBag.mrn     = mrn;
                if (mrn.Length < 1 && ssn.Length < 1)
                {
                    if (last.Length < 1)
                    {
                        ViewBag.statusMessage = "Both fields were blank when the lookup was submitted";
                    }
                    else
                    {
                        patientToCollection = db.patient_general_info.Where(r => r.last_name.Contains(last)).ToList();
                        return(View("PatientResults", patientToCollection));
                    }
                }
                else if (mrn.Length > 0 && ssn.Length > 0)
                {
                    ViewBag.statusMessage = "Data was contained in both input fields. Please look up a patient by MRN or SSN, not both.";
                }
                else if (mrn.Length > 5 && mrn.Length < 7)
                {
                    patients = db.patient_general_info.Where(r => r.medical_record_number == mrn).FirstOrDefault();

                    if (patients != null)
                    {
                        if (patients.birth_date != null && patients.first_name != null)
                        {
                            patientToCollection.Add(patients);
                            return(View("PatientResults", patientToCollection));
                        }
                        else
                        {
                            ViewBag.patient = ssn;
                            return(View("Create"));
                        }
                    }
                    else
                    {
                        ViewBag.patientFound = false;
                        return(View());
                    }
                }
                else if (ssn.Length > 8 && ssn.Length < 10)
                {
                    patients = db.patient_general_info.Where(r => r.social_security_number == ssn).FirstOrDefault();

                    if (patients != null)
                    {
                        if (patients.birth_date != null && patients.first_name != null)
                        {
                            patientToCollection.Add(patients);
                            ViewBag.patient = ssn;
                            return(View("PatientResults", patientToCollection));
                        }
                        else
                        {
                            ViewBag.patient = ssn;
                            return(View("Create"));
                        }
                    }
                    else
                    {
                        patient p = db.patients.Where(r => r.social_security_number == ssn).FirstOrDefault();

                        if (p != null)
                        {
                            ViewBag.patient = p.social_security_number;
                            ViewBag.mrn     = p.medical_record_number;
                            return(View("Create"));
                        }
                        else
                        {
                            ViewBag.patientFound = false;
                            return(View());
                        }
                    }
                }
                else
                {
                    ViewBag.statusMessage = "Please make sure that the input is the proper length. MRN(6) SSN(9)";
                }

                //Input not filled in.
                return(View());
            }
        }
Esempio n. 24
0
 partial void Deletepatient(patient instance);
Esempio n. 25
0
 public void Insert(patient patient)
 {
     db.patients.Add(patient);
 }
Esempio n. 26
0
    static public void SimpleMassiveObjective(double[,] hospital)
    {
        bool is_exist = false;

        Console.WriteLine("Всего в больнице {0} палат\n", hospital.Length);
        for (int i = 0; i < hospital.GetLength(0); i++)
        {
            Console.WriteLine("В палате {0} находится {1} коек(и).\n", i + 1, hospital.GetLength(0));
            for (int j = 0; j < hospital.GetLength(1); j++)
            {
                if (hospital[i, j] != 0 || hospital[i, j] > 0)
                {
                    counter++;
                    Console.WriteLine("В койке {0} лежит пациент с температурой {1}", j + 1, hospital[i, j]);
                }
            }
        }
        patient[] patient_list = new patient[counter];
        Console.WriteLine("\nИнформация о пациентах с одинаковой температурой\n");
        double[] check = new double[counter];
        for (int i = 0; i < hospital.GetLength(0); i++)
        {
            for (int j = 0; j < hospital.GetLength(1); j++)
            {
                for (int y = 0; y < check.Length; y++)
                {
                    if (check[y] == hospital[i, j])
                    {
                        is_exist = true;
                    }
                }
                if (!is_exist)
                {
                    for (int p = 0; p < check.Length; p++)
                    {
                        if (check[p] == 0)
                        {
                            check[p] = hospital[i, j]; break;
                        }
                    }
                }
                is_exist = false;
            }
        }
        for (int l = 0; l < patient_list.Length; l++)
        {
            patient_list[l].ward = -1; patient_list[l].cot = -1;
        }
        for (int p = 0; p < check.Length; p++)
        {
            for (int i = 0; i < hospital.GetLength(0); i++)
            {
                for (int j = 0; j < hospital.GetLength(1); j++)
                {
                    if (check[p] == hospital[i, j])
                    {
                        SolvingTaskMassive.EnterIntoStruct(i, j, hospital[i, j], ref patient_list);
                    }
                }
            }
        }
        int counter_for_out = 0;

        for (int i = 0; i < check.Length; i++)
        {
            for (int j = 0; j < patient_list.Length; j++)
            {
                if (check[i] == patient_list[j].temp)
                {
                    counter_for_out++;
                }
            }
            if (counter_for_out >= 2)
            {
                Console.WriteLine("Пациенты с одинаковой температурой равной {0}\n", check[i]);
                for (int y = 0; y < patient_list.Length; y++)
                {
                    if (check[i] == patient_list[y].temp)
                    {
                        Console.WriteLine("Пациент в палате {0} на койке {1}", patient_list[y].ward + 1, patient_list[y].cot + 1);
                    }
                }
            }
            counter_for_out = 0;
        }
    }
Esempio n. 27
0
        public void CreatePatient(patient objPatient)
        {
            IPatientRepository repo = new PatientRepository();

            repo.CreatePatient(objPatient);
        }
Esempio n. 28
0
        public patient GetPatientById(int id)
        {
            patient patientFromDb = _clinicEntities.patients.FirstOrDefault(patient => patient.id == id);

            return(patientFromDb);
        }
Esempio n. 29
0
 // PUT: api/myApi/5
 public patient Put(int id, [FromBody] patient patient)
 {
     return(patientService.updatePatient(id, patient));
 }
 public Reception()
 {
     InitializeComponent();
     Patient = new patient();
     appoint = new Appointments();
 }