123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using HNWD.Pregrant.WebService;
- using HNWD.Pregrant.Model;
- using System.Text;
- using HNWD.Pregrant.DataAccess;
- using HNWD.Pregrant.Common;
- namespace HNWD.Pregrant.WebService.WDMK_I
- {
- /// <summary>
- /// 主界面
- /// </summary>
- public partial class callingDoor_main : PageBase
- {
- ////////测试可用列表
- ///deviceId
- ///791
- ///797
- ///804
- ///811
- ///////////////////////////////
- protected void Page_Load(object sender, EventArgs e)
- {
- string deviceID = this.GetValueByKey("deviceId");
- if (string.IsNullOrEmpty(deviceID))
- {
- this.ResponseDefaultError();
- return;
- }
- /////////////////////////////////////////
- /////////////////////////////////////////
- if (!this.InitializeDataAccess())
- {
- this.ResponseDefaultError(PromptingMessage.Error_Data_Initialized);
- return;
- }
- ///找门口机
- ///
- ///获取数据区域
- ///
- if(!wd_PartInfoDataAccess.ext.bSuccess || wd_PartInfoDataAccess.ext.messageDataList.Count == 0)
- {
- this.ResponseDefaultError(PromptingMessage.Error_PartInfo);
- return;
- }
-
- WD_DeviceInfo wd_DeviceInfo = wd_DeviceInfoDataAccess.ext.messageDataList.Find(f => f.ID == deviceID);
- if (wd_DeviceInfo == null)
- {
- this.ResponseDefaultError(PromptingMessage.Error_DeviceInfo);
- return;
- }
- else
- {
- wd_PartInfoDataAccess.ext.messageDataList.ForEach(f => f.wardNum = wd_DeviceInfo.deviceRoomNum);
- wd_PartInfoDataAccess.ext.messageDataList.ForEach(f => f.roomByname = wd_DeviceInfo.DEVICE_NAME);
- }
-
- List<WD_DeviceInfo> listBedDevice = wd_DeviceInfoDataAccess.ext.messageDataList.FindAll(f => f.DEVICE_ROOM_ID == deviceID).OrderBy(f=>f.DEVICE_BED_NUM).ToList() ;
- /////////////////////////////////////////////////
- ////////////////////////////////////////////////
- foreach (WD_DeviceInfo wd in listBedDevice)
- {
- bedInfo bedInfo = new bedInfo();
- WD_PatientInfo wd_PatientInfo = wd_PatientInfoDataAccess.ext.messageDataList.Find(f => f.ID == wd.DEVICE_HUMAN_ID);
- if(wd_PatientInfo == null)
- {
- wd_PartInfoDataAccess.ext.messageDataList.ForEach(f => f.bedInfoList.Add(bedInfo));
- }
- else
- {
- bedInfo.DoctorID = wd_PatientInfo.PATIENT_DOCTOR_ID;
- bedInfo.NurseID = wd_PatientInfo.PATIENT_NURSE_ID;
- bedInfo.bedNum = wd.deviceBedNum;
- bedInfo.bedName = wd.DEVICE_BED_NAME;
- bedInfo.roomNum = wd.DEVICE_ROOM_NUM;
- bedInfo.bedStatus = Convert.ToInt32(wd.deviceHumanId) > 0 ? "1" : "0";
- bedInfo.HumanID = wd.deviceHumanId;
- bedInfo.babyName = wd_PatientInfo.PATIENT_BABYNAME;
- bedInfo.name = wd_PatientInfo.PATIENT_NAME;
- bedInfo.babySex = wd_PatientInfo.PATIENT_BABYSEX;
- bedInfo.avoidCertainFood = wd_PatientInfo.PATIENT_ILLNESS;
- List<WD_UrgeInfo> listUrgeInfo = wd_UrgeInfoDataAccess.ext.messageDataList.FindAll(f => f.URGE_PATIENT_ID == wd.DEVICE_HUMAN_ID);
- if (listUrgeInfo == null || listUrgeInfo.Count == 0)
- {
- }
- else
- {
- listUrgeInfo.ForEach(f => bedInfo.carefulMatter.Add(new CarefulMatter(){ item = f.URGE_VALUE }));
- }
- bedInfo.roomByname = wd.DEVICE_NAME;
- WD_StaffInfo wdStaffdoc = wd_StaffInfoDataAccess.ext.messageDataList.Find(f => f.ID == bedInfo.DoctorID);
- if (wdStaffdoc == null)
- {
- bedInfo.doctorName = "";
- bedInfo.doctorHeadIcon = "";
- }
- else
- {
- bedInfo.doctorName = wdStaffdoc.STAFF_NAME;
- bedInfo.doctorHeadIcon = wdStaffdoc.STAFF_PICTURE;
- }
- WD_StaffInfo wdStaffnur = wd_StaffInfoDataAccess.ext.messageDataList.Find(f => f.ID == bedInfo.NurseID);
- if (wdStaffnur == null)
- {
- bedInfo.nurseName = "";
- bedInfo.nurseHeadIcon = "";
- }
- else
- {
- bedInfo.nurseName = wdStaffnur.STAFF_NAME;
- bedInfo.nurseHeadIcon = wdStaffnur.STAFF_PICTURE;
- }
- wd_PartInfoDataAccess.ext.messageDataList.ForEach(f => f.bedInfoList.Add(bedInfo));
- }
- }
- ///////////////////////////////////////////////
- ////////////////////////////////////////////////
- Response.Write(JsonHelper.SerializeWithSuffix(wd_PartInfoDataAccess.ext.messageDataList[0]));
- WD_SysLogInfo wd_SysLogInfo = new WD_SysLogInfo();
- wd_SysLogInfo.LOG_TYPE = "3";
- wd_SysLogInfo.LOG_SOURCE = "门口机ID号【" + deviceID + "】";
- wd_SysLogInfo.LOG_CONTENT = "请求【设备配置】数据!" ;
- }
- }
- }
|