public MyPhysician UpdatePatient(MyPhysician physician) { var physexist = GetByUserId(physician.UserId); MembershipUser usert = Membership.GetUser(physician.Name); if (physician.EncounterType == "P") { if (physician.UserId != "a8a56c1d-203c-4c53-9d95-972dec7a2ef5" || physician.UserId == "b6c625f5-653a-429f-b134-5b4d128ce4e8" || physician.UserId == "a24e6d62-414d-4434-bbe3-b3eec3a026e7") { physician.EncounterType = "I,A"; } } MyPhysician myphy = physexist.Where(p => p._id == physician._id).First(); myphy.Name = physician.Name; myphy.StreetAddress = physician.StreetAddress; myphy.Locality = physician.Locality; myphy.Region = physician.Region; myphy.PostalCode = physician.PostalCode; myphy.PrimaryPhone = physician.PrimaryPhone; myphy.PhyUserId = usert.ProviderUserKey.ToString(); myphy.EncounterType = physician.EncounterType; _Physicians.Save(myphy); return(myphy); }
public MyPhysician AddPhy(MyPhysician physician) { MyPhysician phy = _Physicians.FindAll().OrderBy(p => p.Physicianid).Last(); physician._id = ObjectId.GenerateNewId().ToString(); Int32 newphyid = phy.Physicianid + 1; physician.Physicianid = newphyid; MembershipUser usert = Membership.GetUser(physician.Name); physician.PhyUserId = usert.ProviderUserKey.ToString(); if (physician.EncounterType == "P") { physician.EncounterType = "I,A"; } _Physicians.Insert(physician); return(physician); }
public MyPhysician UpdatePatient(MyPhysician phys) { var session = HttpContext.Current.Session; if (session["UserId"] != null) { userId = session["UserId"].ToString(); } MyPhysician myphys = _physicians.UpdatePatient(phys); EncounterReport erp = new EncounterReport(); erp.RefId = myphys._id; erp.PatientId = myphys.UserId; erp.UpdateBy = userId; erp.Action = "update MyPhysician"; var encreports = encrepo.AddEncReport(erp); return(myphys); }
public MyPhysician AddPatient(MyPhysician physician) { var session = HttpContext.Current.Session; if (session["UserId"] != null) { userId = session["UserId"].ToString(); } MyPhysician phy = _physicians.AddPhy(physician); EncounterReport erp = new EncounterReport(); erp.RefId = phy._id; erp.PatientId = phy.UserId; erp.UpdateBy = userId; erp.Action = "Add new MyPhysician"; var encreports = encrepo.AddEncReport(erp); return(phy); }