コード例 #1
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));
        }
コード例 #2
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));
        }
コード例 #3
0
        /// <summary>
        /// View a patient
        /// </summary>
        public ActionResult View(Decimal id)
        {
            PatientMatch model = null;

            try
            {
                model = CrUtil.Get(id);
            }
            catch (Exception e)
            {
            }
            return(View("View", model));
        }
コード例 #4
0
        /// <summary>
        /// Show the resolution screen
        /// </summary>
        public ActionResult Resolve(Decimal?id)
        {
            ConflictPatientMatch model = new ConflictPatientMatch();

            try
            {
                if (id.HasValue)
                {
                    model = CrUtil.GetConflict(id.Value);
                }
            }
            catch
            {
            }
            return(View(model));
        }
コード例 #5
0
 /// <summary>
 /// Conflict list
 /// </summary>
 public ActionResult Conflict(ConflictListModel model)
 {
     try
     {
         int page = 1;
         if (Request.QueryString["page"] != null)
         {
             page = Int32.Parse(Request.QueryString["page"]);
         }
         model.Patients = CrUtil.GetConflicts((page - 1) * 10, 10);
         model.IsError  = false;
     }
     catch
     {
         model.IsError = true;
     }
     return(View(model));
 }