callingMainNurse_patientinfo.aspx.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using HNWD.Pregrant.Model;
  8. using HNWD.Pregrant.Common;
  9. using System.Text;
  10. using HNWD.Pregrant.DataAccess;
  11. using HNWD.Pregrant.WebService;
  12. namespace HNWD.Pregrant.WebService.WDHS_I
  13. {
  14. /// <summary>
  15. /// 获取客户个人信息数据
  16. /// </summary>
  17. public partial class callingMainNurse_patientinfo : PageBase
  18. {
  19. protected void Page_Load(object sender, EventArgs e)
  20. {
  21. string bedId = this.GetValueByKey("bedId");
  22. if(string.IsNullOrEmpty(bedId))
  23. {
  24. this.ResponseDefaultError();
  25. return;
  26. }
  27. if (!this.InitializeDataAccess())
  28. {
  29. this.ResponseDefaultError(PromptingMessage.Error_Data_Initialized);
  30. return;
  31. }
  32. WD_DeviceInfo wd_DeviceInfo = wd_DeviceInfoDataAccess.ext.messageDataList.Find(f => f.DEVICE_TYPE == "4" && f.ID == bedId);
  33. if (wd_DeviceInfo == null)
  34. {
  35. this.ResponseDefaultError(PromptingMessage.Error_DeviceInfo);
  36. return;
  37. }
  38. WD_PatientInfo wd_PatientInfo = wd_PatientInfoDataAccess.ext.messageDataList.Find(f => f.ID == wd_DeviceInfo.DEVICE_HUMAN_ID);
  39. if (wd_PatientInfo == null)
  40. {
  41. this.ResponseDefaultError(PromptingMessage.Error_PatientInfo);
  42. return;
  43. }
  44. wd_DeviceInfo.bedId = bedId;
  45. wd_DeviceInfo.bedNum = wd_DeviceInfo.DEVICE_ROOM_NUM;
  46. //wd_DeviceInfo.trusteeshipState = wd_DeviceInfo.DEVICE_SIP_HOSTING_ID.Contains("#") ? "1" : "0";
  47. wd_DeviceInfo.PatientID = wd_DeviceInfo.DEVICE_HUMAN_ID;
  48. wd_DeviceInfo.patientName = wd_PatientInfo.PATIENT_NAME;
  49. wd_DeviceInfo.PatientAge = wd_PatientInfo.PATIENT_AGE + wd_PatientInfo.PATIENT_AGE_UNIT;
  50. wd_DeviceInfo.patientGender = wd_PatientInfo.PATIENT_SEX;
  51. wd_DeviceInfo.admissionTime = wd_PatientInfo.PATIENT_INDATE;
  52. wd_DeviceInfo.babyName = wd_PatientInfo.PATIENT_BABYNAME;
  53. wd_DeviceInfo.babySex = wd_PatientInfo.PATIENT_BABYSEX;
  54. wd_DeviceInfo.name = wd_PatientInfo.PATIENT_NAME;
  55. wd_DeviceInfo.avoidCertainFood = wd_PatientInfo.PATIENT_ILLNESS;
  56. List<WD_UrgeInfo> listUrgeInfo = wd_UrgeInfoDataAccess.ext.messageDataList.FindAll(f => f.URGE_PATIENT_ID == wd_DeviceInfo.DEVICE_HUMAN_ID);
  57. if (listUrgeInfo == null || listUrgeInfo.Count == 0)
  58. {
  59. }
  60. else
  61. {
  62. listUrgeInfo.ForEach(f => wd_DeviceInfo.carefulMatter.Add(new CarefulMatter() { item = f.URGE_VALUE }));
  63. }
  64. wd_DeviceInfo.roomByname = wd_DeviceInfo.DEVICE_NAME;
  65. WD_StaffInfo wd_StaffInfoDoc = wd_StaffInfoDataAccess.ext.messageDataList.Find(f => f.ID == wd_PatientInfo.PATIENT_DOCTOR_ID);
  66. if (wd_StaffInfoDoc == null)
  67. {
  68. this.ResponseDefaultError(PromptingMessage.Error_StaffInfo);
  69. return;
  70. }
  71. else
  72. {
  73. wd_DeviceInfo.attendingDoctor = wd_StaffInfoDoc.STAFF_NAME;
  74. }
  75. WD_StaffInfo wd_StaffInfoNurse = wd_StaffInfoDataAccess.ext.messageDataList.Find(f => f.ID == wd_PatientInfo.PATIENT_NURSE_ID);
  76. if (wd_StaffInfoNurse == null)
  77. {
  78. this.ResponseDefaultError(PromptingMessage.Error_StaffInfo);
  79. return;
  80. }
  81. else
  82. {
  83. wd_DeviceInfo.nurseInCharge = wd_StaffInfoNurse.STAFF_NAME;
  84. }
  85. wd_DeviceInfo.Condition = wd_PatientInfo.PATIENT_ILLNESS;
  86. //////////////////////////////////
  87. Response.Write(JsonHelper.SerializeWithSuffix(wd_DeviceInfo));
  88. WD_SysLogInfo wd_SysLogInfo = new WD_SysLogInfo();
  89. wd_SysLogInfo.LOG_TYPE = "3";
  90. wd_SysLogInfo.LOG_SOURCE ="主机";
  91. wd_SysLogInfo.LOG_CONTENT ="下载了分机的设备数据";
  92. this.DataBaseLog(wd_SysLogInfo);
  93. }
  94. }
  95. }