DoctorList.aspx.cs 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. using System;
  2. using System.Collections.Generic;
  3. using CLIP.eForm.Consent.WebService;
  4. using CLIP.eForm.Consent.Entity;
  5. using System.Web.Services;
  6. namespace CLIP.eForm.Consent.Web {
  7. public partial class DoctorList : System.Web.UI.Page {
  8. protected void Page_Load(object sender, EventArgs e) {
  9. // srchdd = (string.IsNullOrEmpty(this.Request.Params["IO_ADdate"])) ? DateTime.Now.ToShortDateString() : this.Request.Params["IO_ADdate"];
  10. }
  11. [WebMethod]
  12. public static string SetDeptDropdown(string gubun, string instcd) {
  13. List<DeptListVO> resultList = null;
  14. string sResultJson = string.Empty;
  15. using (HospitalSvc svc = new HospitalSvc()) {
  16. //수술,시술 선택에 따른 진료과 정보 바인딩
  17. resultList = svc.GetDeptList(gubun, instcd);
  18. resultList.Remove(resultList.Find(kvp => kvp.deptCd.Trim() == ""));
  19. if (resultList != null) {
  20. if (resultList != null && resultList.Count > 0) {
  21. sResultJson = "[";
  22. int i = 0;
  23. foreach (DeptListVO cVO in resultList) {
  24. if (i > 0) {
  25. sResultJson += ",";
  26. } else {
  27. sResultJson += "{ \"DeptListVo\":{ \"deptnm\":\"선택\",\"deptcd\":\"\",\"deptAbbr\":\"\",\"No\":\"\"} },";
  28. }
  29. sResultJson += "{\"DeptListVo\":{";
  30. sResultJson += "\"deptnm\":\"" + cVO.deptNm + "\",";
  31. sResultJson += "\"deptcd\":\"" + cVO.deptCd + "\",";
  32. //sResultJson += "\"deptAbbr\":\"" + cVO.deptAbbr + "\",";
  33. sResultJson += "\"No\":\"" + (i + 1) + "\"";
  34. sResultJson += "} }";
  35. i++;
  36. }
  37. sResultJson += "]";
  38. }
  39. }
  40. }
  41. CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(sResultJson);
  42. return sResultJson;
  43. }
  44. [WebMethod]
  45. public static string SetDoctorList(string deptCd, string deptNm, string srchdd, string dutinstcd) {
  46. //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("SetDoctorList : deptCd[{0}]", deptCd));
  47. //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("SetDoctorList : deptNm[{0}]", deptNm));
  48. //CLIP.eForm.Server.Diagnostics.LogHelper.LoggingHandler.Debug(string.Format("SetDoctorList : srchdd[{0}]", srchdd));
  49. List<DocListVO> resultList = null;
  50. string sResultJson = string.Empty;
  51. using (HospitalSvc svc = new HospitalSvc()) {
  52. resultList = svc.GetDoctorList(srchdd.Replace("-", "").Replace("/", ""), deptCd, dutinstcd);
  53. if (resultList != null) {
  54. if (resultList != null && resultList.Count > 0) {
  55. sResultJson = "[";
  56. int i = 0;
  57. foreach (DocListVO cVO in resultList) {
  58. if (i > 0) sResultJson += ",";
  59. var drKindValue = "C";
  60. // 의사 정보가 없다면 C 로 매핑
  61. if (!string.IsNullOrEmpty(cVO.drKind))
  62. drKindValue = cVO.drKind;
  63. sResultJson += "{";
  64. sResultJson += "\"doctorid\":\"" + cVO.doctorId + "\",";
  65. sResultJson += "\"doctornm\":\"" + cVO.doctorNm + "\",";
  66. sResultJson += "\"deptCd\":\"" + deptCd + "\",";
  67. sResultJson += "\"deptNm\":\"" + deptNm + "\",";
  68. sResultJson += "\"drKind\":\"" + drKindValue + "\",";
  69. sResultJson += "\"No\":\"" + (i + 1) + "\"";
  70. sResultJson += "}";
  71. i++;
  72. }
  73. sResultJson += "]";
  74. }
  75. }
  76. }
  77. return sResultJson;
  78. }
  79. }
  80. }