using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using HNWD.Pregrant.Common; using HNWD.Pregrant.WebService; using HNWD.Pregrant.Model; namespace HNWD.DoctorHost.WebService.WDYS_I { public partial class callingMainDoctor_hospitalInfo : PageBase { protected void Page_Load(object sender, EventArgs e) { if (!this.InitializeDataAccess()) { this.ResponseDefaultError(PromptingMessage.Error_Data_Initialized); return; } if (this.wd_PartInfoDataAccess.ext.messageDataList.Count < 0) { this.ResponseDefaultError(PromptingMessage.Error_PartInfo); return; } hospital hr = new hospital(); hr.patientNum = wd_PatientInfoDataAccess.ext.messageDataList.FindAll(f => Convert.ToInt32(f.PATIENT_STATUS) > 0 && Convert.ToInt32(f.PATIENT_STATUS) < 3).Count.ToString(); 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(); hr.admissionToday = wd_PatientInfoDataAccess.ext.messageDataList.FindAll(f => Convert.ToInt32(f.PATIENT_STATUS) == 1 && f.DiffDays == "0").Count.ToString(); hr.dischargedToday = wd_PatientInfoDataAccess.ext.messageDataList.FindAll(f => Convert.ToInt32(f.PATIENT_STATUS) == 2 && f.DiffDays == "1").Count.ToString(); hr.dischargeTomorrow = wd_PatientInfoDataAccess.ext.messageDataList.FindAll(f => Convert.ToInt32(f.PATIENT_STATUS) == 2 && f.DiffDays == "0").Count.ToString(); hr.operationToday = wd_PatientInfoDataAccess.ext.messageDataList.FindAll(f => Convert.ToInt32(f.PATIENT_STATUS) == 4 && f.DiffDays == "1").Count.ToString(); hr.operationTomorrow = wd_PatientInfoDataAccess.ext.messageDataList.FindAll(f => Convert.ToInt32(f.PATIENT_STATUS) == 4 && f.DiffDays == "0").Count.ToString(); string specialCare_fiter = wd_PartInfoDataAccess.ext.messageDataList[0].PART_SPECIAL_CARE; string primaryCare_fiter = wd_PartInfoDataAccess.ext.messageDataList[0].PART_PRIMARY_CARE; hr.specialCare = wd_PatientInfoDataAccess.ext.messageDataList.FindAll(f => f.PATIENT_NURSE_LEVEL0 == specialCare_fiter).Count.ToString(); hr.primaryCare = wd_PatientInfoDataAccess.ext.messageDataList.FindAll(f => f.PATIENT_NURSE_LEVEL0 == primaryCare_fiter).Count.ToString(); wd_StaffInfoDataAccess.ext.messageDataList.FindAll(f => f.STAFF_DUTY == "1" && f.STAFF_TYPE == "1").ForEach(x => hr.dutyDoctorList.Add(x.STAFF_NAME)); wd_StaffInfoDataAccess.ext.messageDataList.FindAll(f => f.STAFF_DUTY == "1" && f.STAFF_TYPE == "2").ForEach(x => hr.nurseOnDutyList.Add(x.STAFF_NAME)); wd_MessageInfoDataAccess.ext.messageDataList.ForEach(x => hr.importantMessageList.Add(x.MESSAGE_CONTENT + "【" + x.MESSAGE_DATETIME + "】")); hr.dutyDoctorsList = this.wd_StaffInfoDataAccess.ext.messageDataList.FindAll(f => f.STAFF_TYPE == "1"); hr.nursesOnDutyList = this.wd_StaffInfoDataAccess.ext.messageDataList.FindAll(f => f.STAFF_TYPE == "2"); Response.Write(JsonHelper.SerializeWithSuffix(hr)); } } }