Exemplo n.º 1
0
        public CarePlan AddCareplan(CarePlan cplan)
        {
            CarePlan phy = _Careplans.FindAll().OrderBy(p => p.CarePlanid).Last();

            cplan._id = ObjectId.GenerateNewId().ToString();
            Int32 carepl = phy.CarePlanid + 1;

            cplan.CarePlanid = carepl;
            if (cplan.EncounterType == "P")
            {
                cplan.EncounterType = "I,A";
            }
            _Careplans.Insert(cplan);
            return(cplan);
        }
Exemplo n.º 2
0
        public CarePlan UpdatePatient(CarePlan cplan)
        {
            var session = HttpContext.Current.Session;

            if (session["UserId"] != null)
            {
                userId = session["UserId"].ToString();
            }
            CarePlan        care = repository.UpdatePatient(cplan);
            EncounterReport erp  = new EncounterReport();

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

            return(care);
        }
Exemplo n.º 3
0
        public CarePlan UpdatePatient(CarePlan CarePlan)
        {
            var carepexist = GetByUserId(CarePlan.UserId);

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

            cares.Goal         = CarePlan.Goal;
            cares.Instructions = CarePlan.Instructions;
            cares.SNOMEDCT     = CarePlan.SNOMEDCT;
            _Careplans.Save(cares);

            return(cares);
        }