Пример #1
0
        /// <summary>
        /// Search Patient  from Fhir Service
        /// </summary>
        /// <param name="id"></param>
        /// <param name="familyName"></param>
        /// <param name="givenName"></param>
        /// <param name="dob"></param>
        /// <param name="gender"></param>
        /// <param name="mrn"></param>
        /// <returns></returns>
        public JsonResult SearchPatientList(string id, string familyName, string givenName, string dob, string gender, string mrn)
        {
            List <PatientViewModel> patientList = new List <PatientViewModel>();
            PatientSearchModel      search      = new PatientSearchModel()
            {
                Id     = id == "0" ? null : id,
                Family = familyName,
                Given  = givenName,
                DOB    = dob,
                Gender = gender,
                MRN    = mrn
            };

            if (!string.IsNullOrEmpty(search.Id) ||
                !string.IsNullOrEmpty(search.Family) ||
                !string.IsNullOrEmpty(search.Given) ||
                !string.IsNullOrEmpty(search.DOB) ||
                !string.IsNullOrEmpty(search.Gender) ||
                !string.IsNullOrEmpty(search.MRN))
            {
                patientList = patientService.SearchPatients(search.Id, search.Family, search.Given, search.DOB, search.Gender, search.MRN);
            }

            return(Json(patientList, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        /// <summary>
        /// /Patient/Search
        /// </summary>
        public ActionResult Search(PatientSearchModel model)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    model.IsError = true;
                }
                else if (model.FamilyName != null || model.GivenName != null || model.DateOfBirth != null || model.Identifier != null)
                {
                    int page = 1;
                    if (Request.QueryString["page"] != null)
                    {
                        page = Int32.Parse(Request.QueryString["page"]);
                    }

                    model.Outcome = CrUtil.Search(model.FamilyName, model.GivenName, model.DateOfBirth, model.Identifier, (page - 1) * 10, 10);
                    model.IsError = false;
                }
                else if (model.WasSubmitted)
                {
                    ModelState.AddModelError(String.Empty, "Must provide at least one search parameter");
                }
                model.WasSubmitted = true;
            }
            catch (Exception e)
            {
                model.IsError = true;
            }
            return(View(model));
        }
Пример #3
0
        //
        // GET: /Patient/
        public ActionResult Index()
        {
            PatientSearchModel model = new PatientSearchModel();

            try
            {
                if (!ModelState.IsValid)
                {
                    model.IsError = true;
                }
                else
                {
                    int page = 1;
                    if (Request.QueryString["page"] != null)
                    {
                        page = Int32.Parse(Request.QueryString["page"]);
                    }
                    var recent = CrUtil.GetRecentActivity(new TimeSpan(0, 1, 0, 0), (page - 1) * 10, 10);
                    model.Outcome = recent;
                    //model.Outcome = new List<PatientMatch>(tResults);
                    model.IsError = false;
                }
            }
            catch (Exception e)
            {
                model.IsError = true;
                Trace.TraceError(e.ToString());
            }
            return(View(model));
        }
Пример #4
0
        public virtual IQueryable <Patient> SearchPatients(PatientSearchModel model)
        {
            var name       = new SqlParameter("@name", (object)model.Name ?? DBNull.Value);
            var year       = new SqlParameter("@year", (object)model.YearOfBirth ?? DBNull.Value);
            var regionId   = new SqlParameter("@regionId", (object)model.RegionId ?? DBNull.Value);
            var districtId = new SqlParameter("@districtId", (object)model.DistrictId ?? DBNull.Value);
            var cityId     = new SqlParameter("@cityId", (object)model.CityId ?? DBNull.Value);

            var patients = Patients.FromSqlRaw("SELECT * FROM SearchPatients(@name, @year, @regionId, @districtId, @cityId)",
                                               name, year, regionId, districtId, cityId);

            return(patients);
        }
Пример #5
0
 public async Task <IEnumerable <Patient> > SearchPatients(PatientSearchModel model) => await db.SearchPatients(model)
 .Include(p => p.Person).ThenInclude(p => p.Address).ThenInclude(a => a.Country)
 .Include(p => p.Person).ThenInclude(p => p.Address).ThenInclude(a => a.Region)
 .Include(p => p.Person).ThenInclude(p => p.Address).ThenInclude(a => a.District)
 .Include(p => p.Person).ThenInclude(p => p.Address).ThenInclude(a => a.City).ThenInclude(c => c.CityType)
 .Include(p => p.Person).ThenInclude(p => p.Address).ThenInclude(a => a.Street).ThenInclude(s => s.StreetType)
 .Include(p => p.Person).ThenInclude(p => p.CountryOfBirth)
 .Include(p => p.Person).ThenInclude(p => p.PlaceOfBirth)
 .Include(p => p.Person).ThenInclude(p => p.Gender)
 .Include(p => p.Person).ThenInclude(p => p.Phones).ThenInclude(p => p.Phone)
 .Include(p => p.Person).ThenInclude(p => p.Emails).ThenInclude(e => e.Email)
 .Include(p => p.Person).ThenInclude(p => p.Documents).ThenInclude(d => d.DocumentType)
 .Include(p => p.Person).ThenInclude(p => p.Guardians).ThenInclude(g => g.Guardian).ThenInclude(g => g.Address).ThenInclude(a => a.Region)
 .Include(p => p.Person).ThenInclude(p => p.Guardians).ThenInclude(g => g.Guardian).ThenInclude(g => g.Address).ThenInclude(a => a.District)
 .Include(p => p.Person).ThenInclude(p => p.Guardians).ThenInclude(g => g.Guardian).ThenInclude(g => g.Address).ThenInclude(a => a.City).ThenInclude(c => c.CityType)
 .Include(p => p.Person).ThenInclude(p => p.Guardians).ThenInclude(g => g.Guardian).ThenInclude(g => g.Address).ThenInclude(a => a.Street).ThenInclude(s => s.StreetType)
 .Include(p => p.CaseHistories).ThenInclude(h => h.DocumentRegistry)
 .Include(p => p.CaseHistories).ThenInclude(h => h.Hospital)
 .Include(p => p.CaseHistories).ThenInclude(h => h.Admissions).ThenInclude(a => a.Department)
 .AsNoTracking().ToListAsync();
Пример #6
0
        public ActionResult GetPatientList(PatientSearchModel model)
        {
            List <PatientModel> Patientlist = null;

            Patientlist = PatientServices.SearchPatient(Convert.ToInt32(Session["BranchId"]));

            if (model.date != null)
            {
                Patientlist = Patientlist.Where(p => p.Date.Value.ToShortDateString() == model.date.Value.ToShortDateString()).ToList();
            }
            if (model.Name != null)
            {
                Patientlist = Patientlist.Where(p => p.Name.Contains(model.Name)).ToList();
            }
            if (model.PatientId > 0)
            {
                Patientlist = Patientlist.Where(P => P.Id == model.PatientId).ToList();
            }

            return(Json(Patientlist, JsonRequestBehavior.AllowGet));
        }
Пример #7
0
 public ActionResult Main(PatientSearchModel model)
 {
     try
     {
         using (InhCheckupDataContext cdc = new InhCheckupDataContext())
         {
             PatientInformationModel pi = new PatientInformationModel();
             pi.queue_no = model.queue_no;
             pi.listPatientInformation = cdc.trn_patient_regis
                                         .Where(x => x.tpr_queue_no == model.queue_no)
                                         .Select(x => new PatientInformation
             {
                 tpr_id       = x.tpr_id,
                 name         = x.trn_patient.tpt_first_name,
                 lastname     = x.trn_patient.tpt_last_name,
                 hn           = x.trn_patient.tpt_hn_no,
                 en           = x.tpr_en_no,
                 arrived_date = x.trn_patient_regis_detail == null ? x.tpr_arrive_date.Value : x.trn_patient_regis_detail.tpr_real_arrived_date.Value
             }).OrderByDescending(x => x.arrived_date)
                                         .ToList();
             if (pi.listPatientInformation.Count == 0)
             {
                 ViewBag.QueueNo = model.queue_no + " is Not Found.";
                 ModelState.Clear();
                 return(View("Main", new PatientSearchModel()));
             }
             else
             {
                 ViewBag.QueueNo = model.queue_no;
                 return(View("PatientList", pi));
             }
         }
     }
     catch
     {
         ViewBag.PageTitle = "Error (Please Try Again)";
         return(View(model));
     }
 }
Пример #8
0
 public async Task <IEnumerable <Patient> > Search(PatientSearchModel model) =>
 await _repository.SearchPatients(model);
Пример #9
0
        /// <summary>
        /// Patient search partial view
        /// </summary>
        /// <returns></returns>
        public PartialViewResult SearchPatient()
        {
            PatientSearchModel searchModel = new PatientSearchModel();

            return(PartialView(searchModel));
        }