Beispiel #1
0
        public async Task <ActionResult <PatientDetail> > PostPatientDetail(PatientDetail patientDetail)
        {
            _context.PatientDetails.Add(patientDetail);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetPatientDetail", new { id = patientDetail.PatientId }, patientDetail));
        }
Beispiel #2
0
    public bool CheckPatientDetailByID(string ID)
    {
        PatientDetail t = null;

        using (AppointmentSchedulerEntities3 conf = new AppointmentSchedulerEntities3())
        {
            var conflist = conf.PatientDetails;
            try
            {
                t = (from n in conflist where n.PatientName == ID select n).First();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                //   throw;
            }


            if (t == null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
    }
        public bool CreatePatientDetail(PatientDetail p)
        {
            p.Created = DateTime.Now;
            _db.Add(p);

            return(Save());
        }
        private void frmImagesReport_Load(object sender, EventArgs e)
        {
            try
            {
                var DC1Context      = new DataClasses1DataContext();
                var PatintDataTable = new PatientDetail();

                //=============================================================================

                var LoopListBox = from DD in DC1Context.PatientDetails

                                  select DD;
                foreach (var DD in LoopListBox)
                {
                    listBox1.Items.Add(DD.PatientID);
                }
            }
            catch {; }



            // TODO: This line of code loads data into the 'BMDBDataSet.SelectBoneMarrowImages' table. You can move, or remove it, as needed.
            this.SelectBoneMarrowImagesTableAdapter.FillBy(this.BMDBDataSet.SelectBoneMarrowImages, ParamIDD);
            this.reportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);
            this.reportViewer1.RefreshReport();
        }
        public async Task <IActionResult> PutPatientDetail([FromRoute] int id, [FromBody] PatientDetail patientDetail)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != patientDetail.Id)
            {
                return(BadRequest());
            }

            _context.Entry(patientDetail).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PatientDetailExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Beispiel #6
0
        // This method is used to setup the data.
        public void Setup()
        {
            patientDetail = new PatientDetail()
            {
                ForeName = "Vishwa", SurName = "Reddy", Gender = "Male"
            };

            List <PatientDetail> lstPatient = new List <PatientDetail>();

            lstPatient.Add(new PatientDetail()
            {
                ForeName = "Vishwa", SurName = "Reddy", DateofBirth = DateTime.Now.AddDays(-20), Gender = "Male"
            });
            lstPatient.Add(new PatientDetail()
            {
                ForeName = "Aadit", SurName = "Reddy", DateofBirth = DateTime.Now.AddDays(-20), Gender = "Male"
            });
            PatientPagingModel patientPagingModel = new PatientPagingModel()
            {
                TotalRecords = 5, PatientDetails = lstPatient
            };

            ////Used MOQ framework to return predefined  data
            var PatientDemographicRepository = new Mock <IPatientDemographicsRepository>();

            PatientDemographicRepository.Setup(x => x.GetAllPatientDemographics(1, 4)).Returns(patientPagingModel);
            PatientDemographicRepository.Setup(x => x.PostPatientDetails(patientDetail)).Returns(true);
            _PatientDemographicsRepository = PatientDemographicRepository.Object;
        }
Beispiel #7
0
        public async Task <IActionResult> Get(int id, PatientDetail patientDetail)
        {
            if (id != patientDetail.Id)
            {
                return(BadRequest());
            }
            _context.Entry(patientDetail).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PatientExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        private void frmBMAReport_Load(object sender, EventArgs e)
        {
            try
            {
                var DC1Context      = new DataClasses1DataContext();
                var PatintDataTable = new PatientDetail();

                //=============================================================================

                var LoopListBox = from DD in DC1Context.PatientDetails

                                  select DD;
                foreach (var DD in LoopListBox)
                {
                    listBox1.Items.Add(DD.PatientID);
                }
            }
            catch {; }


            //this.reportViewer1.RefreshReport();
            this.SelectBMAsp_DATATableAdapter.FillBy(this.BMDBDataSet.SelectBMAsp_DATA, MyParam);
            this.reportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);

            this.reportViewer1.RefreshReport();
        }
Beispiel #9
0
        public UserDTO Login(string username, string password)
        {
            try
            {
                var user          = context.GetUser(username: username, password: password);
                var patientDetail = new PatientDetail();

                if (user != null)
                {
                    if (user.UserId > 0 && user.UserTypeNo == (int)UserType.Patient)
                    {
                        patientDetail = context.GetPatient(user.UserId);
                    }
                }
                else
                {
                    return(new UserDTO {
                        Valid = false
                    });
                }

                var dto = mapper.MergeInto <UserDTO>(user, patientDetail);
                dto.Valid = true;

                return(dto);
            }
            catch (Exception ex)
            {
                throw new ApplicationException("Failed login!", ex);
            }
        }
 public PatientDetailViewModel MapPatient(PatientDetail model)
 {
     return(new PatientDetailViewModel
     {
         Complaints = model.Complaints,
         ConsultationType = model.ConsultationType,
         CreatedBy = model.CreatedBy,
         CreatedByEntity = model.CreatedByEntity,
         CreatedOn = model.CreatedOn,
         Files = model.Files == string.Empty ? new List <string>() : new List <string>(model.Files.Split(',')),
         FileId = model.FileId,
         Id = model.Id,
         IsDeleted = model.IsDeleted,
         ModifiedBy = model.ModifiedBy,
         ModifiedEntity = model.ModifiedByEntity,
         ModifiedOn = model.ModifiedOn,
         PatientAge = model.PatientAge,
         PatientGender = model.PatientGender,
         PatientName = model.PatientName,
         PatientPhone = model.PatientPhone,
         TanentId = model.TenantID,
         DoctorId = model.DoctorId,
         UserID = model.UserID,
         Case = model.Case,
         PreferredTime = model.PreferredTime
     });
 }
        public ActionResult DeleteConfirmed(int id)
        {
            PatientDetail patientDetail = db.PatientDetails.Find(id);

            db.PatientDetails.Remove(patientDetail);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #12
0
        public void GetPatientDetails()
        {
            _mockRepository.Setup(r => r.GetAllPatientDetails()[0]).Returns(PatientDetail.GetPatient());
            var patient = _patientService.GetAllPatientDetails()[0];

            //Assert
            Assert.IsNotNull(patient);
        }
Beispiel #13
0
        // This method is used to create patient with invalid request
        public void PostPatientDetailInvalidRequest()
        {
            patientDetail = null;

            HttpResponseException ex = Assert.Throws <HttpResponseException>(() => new PatientsController(_PatientDemographicsRepository).Post(patientDetail));

            Assert.That(ex.Response.StatusCode, Is.EqualTo(HttpStatusCode.BadRequest));
        }
Beispiel #14
0
        //Fail test case for creating a patient
        public void PostPatientDetailFailed()
        {
            patientDetail = new PatientDetail()
            {
                ForeName = "Aadit", SurName = "S", Gender = "Male"
            };
            IHttpActionResult actionResult = new PatientsController(_PatientDemographicsRepository).Post(patientDetail);
            var contentResult = actionResult as OkNegotiatedContentResult <bool>;

            Assert.IsFalse(contentResult.Content);
        }
 public decimal?isFollowUpCheck(Guid?id)
 {
     try
     {
         return(PatientDetail.isFollowUpCheck(id));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public async Task <IActionResult> PostPatientDetail([FromBody] PatientDetail patientDetail)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.PatientDetail.Add(patientDetail);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetPatientDetail", new { id = patientDetail.Id }, patientDetail));
        }
        public ActionResult createPatient()
        {
            PatientDetail patientDetail = new PatientDetail()
            {
                TypeId = PatientDetail.TelephoneType.Home, Telephones = new List <Models.TelephoneDataModel>()
                {
                }
            };

            televm = new List <TelephoneDataModel>();
            return(View(patientDetail));
        }
 public PatientDetailModel GetByName(string name)
 {
     try
     {
         PatientDetail entity = new PatientDetail();
         return(entity.GetByName(name));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public List <PatientDetailModel> Get()
 {
     try
     {
         PatientDetail entity = new PatientDetail();
         return(entity.Get());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public bool CreateOPD(PatientDetailModel model)
 {
     try
     {
         PatientDetail entity = new PatientDetail();
         return(entity.CreateOPD(model));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public async Task <IPagedList <PatientDetailModel> > AdvanceSearch(string searchText, int pageIndex = 1, int pageSize = 40)
 {
     try
     {
         PatientDetail entity = new PatientDetail();
         return(await entity.AdvanceSearch(searchText, pageIndex, pageSize));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public ActionResult Edit([Bind(Include = "patientdetailID,insuranceCompany,amountOwed,patientID,operationID")] PatientDetail patientDetail)
 {
     if (ModelState.IsValid)
     {
         db.Entry(patientDetail).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.operationID = new SelectList(db.Operations, "operationID", "operationDescription");
     ViewBag.patientID   = new SelectList(db.Patients, "patientID", "fullName");
     return(View(patientDetail));
 }
 public string getNewCasePaperNumber()
 {
     try
     {
         PatientDetail entity = new PatientDetail();
         return(entity.getNewCasePaperNumber());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public PatientDetailModel GetByParentId(Guid id)
 {
     try
     {
         PatientDetail entity = new PatientDetail();
         return(entity.GetByParentId(id));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #25
0
 public async Task <int> AddPatientAsync(PatientDetail patientDetail)
 {
     using (IDal dal = await _adoDataContext.GetDbAsync())
     {
         IDataParameter[] parameters =
         {
             await dal.GetParameterAsync("@Record", patientDetail.Record)
         };
         return(await dal.ExecuteScalarAsync <int>(Constants.PatientDetailsAdd, parameters,
                                                   CommandType.StoredProcedure));
     }
 }
Beispiel #26
0
        public async Task <ActionResult <PatientDetail> > PatientLogin(PatientDetail patientDetail)
        {
            var thePatientDetail = await _context.PatientDetails.Where(d => d.Username == patientDetail.Username).FirstOrDefaultAsync();

            if (thePatientDetail ? .Password == patientDetail.Password)
            {
                return(this.Ok(thePatientDetail));
            }
            else
            {
                return(this.NotFound());
            }
        }
 public Task <int> SavePatient(PatientDetail item)
 {
     if (item.ID != 0)
     {
         //code for update
         return(database.UpdateAsync(item));
     }
     else
     {
         //code for insert
         return(database.InsertAsync(item));
     }
 }
Beispiel #28
0
 public string DownloadIPDReport(OPDFilterSearchModel searchModel)
 {
     try
     {
         PatientDetail             entity = new PatientDetail();
         List <PatientDetailModel> model  = entity.GetGenericReport(GetIPDPredicate(searchModel));
         return(createIPDReport(model));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public async Task <ActionResult <PatientDetail> > GetPatient(long id)
        {
            var patient = await _context
                          .Patients
                          .Include(f => f.Prescriptions)
                          .FirstOrDefaultAsync(f => f.Id == id);

            if (patient == null)
            {
                return(NotFound());
            }

            return(PatientDetail.FromPatient(patient));
        }
Beispiel #30
0
        public PatientDetail RegisterPatient(PatientDetail patient)
        {
            var result = List <PatientDetail>("InsertPatientDetail", p =>
            {
                p.Add("@Address", SqlDbType.VarChar, 100).Value = patient.Address;
                p.Add("@PhoneNo", SqlDbType.VarChar, 20).Value  = patient.PhoneNo;
                p.Add("@Email", SqlDbType.VarChar, 30).Value    = patient.Email;
                p.Add("@Age", SqlDbType.Int).Value           = patient.Age;
                p.Add("@Gender", SqlDbType.VarChar, 1).Value = patient.Gender;
                p.Add("@UserId", SqlDbType.Int).Value        = patient.UserID;
            }).FirstOrDefault();

            return(result);
        }