Ejemplo n.º 1
0
        public Vaccination AddVaccine(Vaccination vaccination)
        {
            Vaccination phy = _vaccination.FindAll().OrderBy(p => p.Vaccinationid).Last();

            vaccination._id = ObjectId.GenerateNewId().ToString();
            Int32 vaccid = phy.Vaccinationid + 1;

            vaccination.Vaccinationid = vaccid;
            if (vaccination.EncounterType == "P")
            {
                vaccination.EncounterType = "I,A";
            }
            _vaccination.Insert(vaccination);
            return(vaccination);
        }
Ejemplo n.º 2
0
        public Vaccination UpdatePatient(Vaccination vaccine)
        {
            var session = HttpContext.Current.Session;

            if (session["UserId"] != null)
            {
                userId = session["UserId"].ToString();
            }
            Vaccination     vacc = repository.UpdatePatient(vaccine);
            EncounterReport erp  = new EncounterReport();

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

            return(vacc);
        }
Ejemplo n.º 3
0
        public Vaccination UpdatePatient(Vaccination Vaccin)
        {
            var vaccexist = GetByUserId(Vaccin.UserId);

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

            vaccint.VaccineName      = Vaccin.VaccineName;
            vaccint.VaccineStatus    = Vaccin.VaccineStatus;
            vaccint.DateAdministered = Vaccin.DateAdministered;
            vaccint.CVXCode          = Vaccin.CVXCode;

            _vaccination.Save(vaccint);

            return(vaccint);
        }