callingMainDoctor_hospitalInfo.aspx.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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.Common;
  8. using HNWD.Pregrant.WebService;
  9. using HNWD.Pregrant.Model;
  10. namespace HNWD.DoctorHost.WebService.WDYS_I
  11. {
  12. public partial class callingMainDoctor_hospitalInfo : PageBase
  13. {
  14. protected void Page_Load(object sender, EventArgs e)
  15. {
  16. if (!this.InitializeDataAccess())
  17. {
  18. this.ResponseDefaultError(PromptingMessage.Error_Data_Initialized);
  19. return;
  20. }
  21. if (this.wd_PartInfoDataAccess.ext.messageDataList.Count < 0)
  22. {
  23. this.ResponseDefaultError(PromptingMessage.Error_PartInfo);
  24. return;
  25. }
  26. hospital hr = new hospital();
  27. hr.patientNum = wd_PatientInfoDataAccess.ext.messageDataList.FindAll(f => Convert.ToInt32(f.PATIENT_STATUS) > 0 && Convert.ToInt32(f.PATIENT_STATUS) < 3).Count.ToString();
  28. hr.freeBeds = wd_DeviceInfoDataAccess.ext.messageDataList.FindAll(f => Convert.ToInt32(string.IsNullOrEmpty(f.DEVICE_HUMAN_ID) ? "0" : f.DEVICE_HUMAN_ID) == 0 && (Convert.ToInt32(f.DEVICE_TYPE) == 4 || Convert.ToInt32(f.DEVICE_TYPE) == 12)).Count.ToString();
  29. hr.admissionToday = wd_PatientInfoDataAccess.ext.messageDataList.FindAll(f => Convert.ToInt32(f.PATIENT_STATUS) == 1 && f.DiffDays == "0").Count.ToString();
  30. hr.dischargedToday = wd_PatientInfoDataAccess.ext.messageDataList.FindAll(f => Convert.ToInt32(f.PATIENT_STATUS) == 2 && f.DiffDays == "1").Count.ToString();
  31. hr.dischargeTomorrow = wd_PatientInfoDataAccess.ext.messageDataList.FindAll(f => Convert.ToInt32(f.PATIENT_STATUS) == 2 && f.DiffDays == "0").Count.ToString();
  32. hr.operationToday = wd_PatientInfoDataAccess.ext.messageDataList.FindAll(f => Convert.ToInt32(f.PATIENT_STATUS) == 4 && f.DiffDays == "1").Count.ToString();
  33. hr.operationTomorrow = wd_PatientInfoDataAccess.ext.messageDataList.FindAll(f => Convert.ToInt32(f.PATIENT_STATUS) == 4 && f.DiffDays == "0").Count.ToString();
  34. string specialCare_fiter = wd_PartInfoDataAccess.ext.messageDataList[0].PART_SPECIAL_CARE;
  35. string primaryCare_fiter = wd_PartInfoDataAccess.ext.messageDataList[0].PART_PRIMARY_CARE;
  36. hr.specialCare = wd_PatientInfoDataAccess.ext.messageDataList.FindAll(f => f.PATIENT_NURSE_LEVEL0 == specialCare_fiter).Count.ToString();
  37. hr.primaryCare = wd_PatientInfoDataAccess.ext.messageDataList.FindAll(f => f.PATIENT_NURSE_LEVEL0 == primaryCare_fiter).Count.ToString();
  38. wd_StaffInfoDataAccess.ext.messageDataList.FindAll(f => f.STAFF_DUTY == "1" && f.STAFF_TYPE == "1").ForEach(x => hr.dutyDoctorList.Add(x.STAFF_NAME));
  39. wd_StaffInfoDataAccess.ext.messageDataList.FindAll(f => f.STAFF_DUTY == "1" && f.STAFF_TYPE == "2").ForEach(x => hr.nurseOnDutyList.Add(x.STAFF_NAME));
  40. wd_MessageInfoDataAccess.ext.messageDataList.ForEach(x => hr.importantMessageList.Add(x.MESSAGE_CONTENT + "【" + x.MESSAGE_DATETIME + "】"));
  41. hr.dutyDoctorsList = this.wd_StaffInfoDataAccess.ext.messageDataList.FindAll(f => f.STAFF_TYPE == "1");
  42. hr.nursesOnDutyList = this.wd_StaffInfoDataAccess.ext.messageDataList.FindAll(f => f.STAFF_TYPE == "2");
  43. Response.Write(JsonHelper.SerializeWithSuffix(hr));
  44. }
  45. }
  46. }