public PatientMD updatePersonalinfo(UpdateInfo upinfo, string userid)
        {
            PatientMD patexist = GetByUserId(userid).First();

            patexist.PatientName = upinfo.PatientName;
            patexist.DateOfBirth = upinfo.DOB;
            patexist.Sex         = upinfo.Sex;

            _Patients.Save(patexist);

            return(patexist);
        }
Exemplo n.º 2
0
        public ActionResult PersonalInfo()
        {
            IPatientMDRepository _pat = new PatientMDRepository();
            var            userId     = Session["UserId"].ToString();
            var            username   = Session["UserName"].ToString();
            PatientMD      user       = _pat.GetByUserId(userId).First();
            MembershipUser muser      = Membership.GetUser(username);
            var            updateinfo = new UpdateInfo();

            updateinfo.PatientName = user.PatientName;
            updateinfo.DOB         = user.DateOfBirth;
            updateinfo.Sex         = user.Sex;
            updateinfo.EmailId     = muser.Email;
            return(Json(updateinfo));
        }
        public PatientMD AddPatDemo(PatientMD patmd)
        {
            PatientMD demo = _Patients.FindAll().OrderBy(p => p.PatientID).Last();

            patmd._id = ObjectId.GenerateNewId().ToString();
            Int32 patid = patmd.PatientID + 1;

            patmd.PatientID = patid;
            if (patmd.EncounterType == "P")
            {
                patmd.EncounterType = "I,A";
            }
            _Patients.Insert(patmd);
            return(patmd);
        }
        public PatientMD UpdatePatient(PatientMD patientmd)
        {
            var session = HttpContext.Current.Session;

            if (session["UserId"] != null)
            {
                userId = session["UserId"].ToString();
            }
            PatientMD       patmd = _patients.UpdatePatient(patientmd);
            EncounterReport erp   = new EncounterReport();

            erp.RefId     = patmd._id;
            erp.PatientId = patmd.UserId;
            erp.UpdateBy  = userId;
            erp.Action    = "update PatientMD";
            var encreports = encrepo.AddEncReport(erp);

            return(patmd);
        }
        public PatientMD UpdatePatient(PatientMD PatientMd)
        {
            var patexist = GetByUserId(PatientMd.UserId);

            if (PatientMd.EncounterType == "P")
            {
                if (PatientMd.UserId != "a8a56c1d-203c-4c53-9d95-972dec7a2ef5" || PatientMd.UserId == "b6c625f5-653a-429f-b134-5b4d128ce4e8" || PatientMd.UserId == "a24e6d62-414d-4434-bbe3-b3eec3a026e7")
                {
                    PatientMd.EncounterType = "I,A";
                }
            }
            PatientMD patient = patexist.Where(p => p._id == PatientMd._id).First();

            patient.PatientName = PatientMd.PatientName;
            patient.Sex         = PatientMd.Sex;
            patient.DateOfBirth = PatientMd.DateOfBirth;
            patient.Race        = PatientMd.Race;
            patient.Height      = PatientMd.Height;
            patient.Weight      = PatientMd.Weight;

            _Patients.Save(patient);

            return(patient);
        }