周口郸城医院 DanChengCallCenter_API

FollowUpController.cs 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. using CallCenter.Utility;
  2. using CallCenterApi.DB;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Web;
  8. using System.Web.Mvc;
  9. namespace CallCenterApi.Interface.Controllers.MedicalFollowup
  10. {
  11. public class FollowUpController : Controller
  12. {
  13. // GET: FollowUp
  14. public ActionResult Index()
  15. {
  16. return View();
  17. }
  18. /// <summary>
  19. /// 获取随访列表
  20. /// </summary>
  21. /// <returns></returns>
  22. public ActionResult GetListAll()
  23. {
  24. string sql = " and F_IsDel=0 ";
  25. DataTable dt = new DataTable();
  26. string dischargedept = HttpUtility.UrlDecode(RequestString.GetQueryString("dischargedept"));//出院科室
  27. string strstate = HttpUtility.UrlDecode(RequestString.GetQueryString("state"));//状态
  28. string strcode = HttpUtility.UrlDecode(RequestString.GetQueryString("code"));//病案号
  29. string stropename = HttpUtility.UrlDecode(RequestString.GetQueryString("opename"));//手术名称
  30. //来电号码
  31. string strtel = HttpUtility.UrlDecode(RequestString.GetQueryString("phone"));//联系人电话
  32. string strname = HttpUtility.UrlDecode(RequestString.GetQueryString("name"));//姓名
  33. string strdoctor = HttpUtility.UrlDecode(RequestString.GetQueryString("tubedoctor"));//管床医生
  34. //诊断名称
  35. string strzdmc = HttpUtility.UrlDecode(RequestString.GetQueryString("zdmc"));//诊断名称
  36. //出院日期
  37. string strstarttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));//查询起始时间
  38. string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));//查询截止时间
  39. //总费用
  40. string strcosts = HttpUtility.UrlDecode(RequestString.GetQueryString("costs"));
  41. string strcoste = HttpUtility.UrlDecode(RequestString.GetQueryString("coste"));
  42. //随访日期
  43. string strtime = HttpUtility.UrlDecode(RequestString.GetQueryString("sftime"));
  44. //仅包含随访结束的
  45. string strsfend = HttpUtility.UrlDecode(RequestString.GetQueryString("sfend"));
  46. //仅二级随访未完成
  47. string strejwwc = HttpUtility.UrlDecode(RequestString.GetQueryString("secondlevel"));
  48. string strpageindex = RequestString.GetQueryString("page");
  49. int pageindex = 1;
  50. string strpagesize = RequestString.GetQueryString("pagesize");
  51. int pagesize = 10;
  52. if (dischargedept.Trim() != "" && dischargedept != "undefined")
  53. {
  54. sql += " and F_DischargeDept like '%" + dischargedept.Trim() + "%' ";
  55. }
  56. if (strstate.Trim() != "" && strstate != "undefined")
  57. {
  58. sql += " and F_State = '" + strstate.Trim() + "' ";
  59. }
  60. if (strcode.Trim() != "" && strcode != "undefined")
  61. {
  62. sql += " and F_Code = '" + strcode.Trim() + "' ";
  63. }
  64. if (stropename.Trim() != "" && stropename != "undefined")
  65. {
  66. sql += " and F_OpeName like '%" + stropename.Trim() + "%' ";
  67. }
  68. if (strname.Trim() != "" && strname != "undefined")
  69. {
  70. sql += " and F_Name = '" + strname.Trim() + "' ";
  71. }
  72. if (strdoctor.Trim() != "" && strdoctor != "undefined")
  73. {
  74. sql += " and F_TubeDoctor like '%" + strdoctor.Trim() + "%' ";
  75. }
  76. if (strtel.Trim() != "" && strtel != "undefined")
  77. {
  78. sql += " and F_Phone like '%" + strtel + "%' ";
  79. }
  80. if (strstarttime.Trim() != "" && strstarttime != "undefined")
  81. {
  82. sql += " and datediff(day,F_OutDate,'" + strstarttime + "')<=0 ";
  83. }
  84. if (strendtime.Trim() != "" && strendtime != "undefined")
  85. {
  86. sql += " and datediff(day,F_OutDate,'" + strendtime + "')>=0 ";
  87. }
  88. if (strzdmc.Trim() != "" && strzdmc != "undefined")
  89. {
  90. sql += " and F_ZDMC = '" + strzdmc.Trim() + "' ";
  91. }
  92. if (strcosts.Trim() != "" && strcosts != "undefined")
  93. {
  94. sql += " and F_TotalCosts >= '" + strzdmc.Trim() + "' ";
  95. }
  96. if (strcoste.Trim() != "" && strcoste != "undefined")
  97. {
  98. sql += " and F_TotalCosts <= '" + strzdmc.Trim() + "' ";
  99. }
  100. if (strtime.Trim() != "" && strtime != "undefined")
  101. {
  102. sql += " and datediff(day,F_SFDate,'" + strtime + "')=0 ";
  103. }
  104. if (strsfend.Trim() != "" && strsfend != "undefined")
  105. {
  106. sql += " and F_State = 3 ";//随访完成状态
  107. }
  108. if (strejwwc.Trim() != "" && strejwwc != "undefined")
  109. {
  110. sql += " and F_State = 2 ";//随访完成状态
  111. }
  112. if (strpageindex.Trim() != "")
  113. {
  114. pageindex = Convert.ToInt32(strpageindex);
  115. }
  116. if (strpagesize.Trim() != "")
  117. {
  118. pagesize = Convert.ToInt32(strpagesize);
  119. }
  120. int recordCount = 0;
  121. dt = BLL.PagerBLL.GetListPager(
  122. "T_Med_FollowUp",
  123. "T_Med_FollowUp.F_Id",
  124. "*",
  125. sql,
  126. "ORDER BY T_Med_FollowUp.F_Id desc",
  127. pagesize,
  128. pageindex,
  129. true,
  130. out recordCount);
  131. var obj = new
  132. {
  133. state = "success",
  134. message = "成功",
  135. rows = dt,
  136. total = recordCount
  137. };
  138. return Content(obj.ToJson());
  139. }
  140. }
  141. }