Пример #1
0
        private void pRoomPandect_Paint(object sender, PaintEventArgs e)
        {
            int      offX = 1;
            int      offY = 5;
            Graphics gac  = e.Graphics;

            for (int i = 0; i < OperationRoomContentList.Count; i++)
            {
                OperationRoomContent room = OperationRoomContentList[i];
                if (i % 2 == 1)
                {
                    using (Pen pen = new Pen(Color.FromArgb(221, 226, 233), 1))
                    {
                        gac.DrawLine(pen, room.Left - 5, room.Top, room.Left - 5, room.Top + room.Height);
                    }
                }
                else if (i != 0)
                {
                    using (Pen pen = new Pen(Color.FromArgb(221, 226, 233), 1))
                    {
                        gac.DrawLine(pen, 2, room.Top - 5, room.Width * 2 + 10, room.Top - 5);
                    }
                }
            }
        }
Пример #2
0
 private void operRoomContent_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         if (!_canSelect)
         {
             return;
         }
         OperationRoomContent operationRoomContent = sender as OperationRoomContent;
         if (ExtendApplicationContext.Current.AppType == ApplicationType.PACU)
         {
             if (operationRoomContent != null)
             {
                 if (string.IsNullOrEmpty(operationRoomContent.PatientID))
                 {
                     _selectedOperationRoomContent = operationRoomContent;
                     if (ParentForm != null)
                     {
                         ParentForm.DialogResult = DialogResult.OK;
                     }
                     RefreshRoom(operationRoomContent.RoomNo, ExtendApplicationContext.Current.PatientContextExtend.PatientID, ExtendApplicationContext.Current.PatientContextExtend.VisitID,
                                 ExtendApplicationContext.Current.PatientContextExtend.OperID);
                 }
             }
         }
     }
     catch (Exception err)
     {
         ExceptionHandler.Handle(err);
     }
 }
Пример #3
0
 private void operRoomContent_OperRoomSelected(object sender, EventArgs e)
 {
     if (sender is OperationRoomContent)
     {
         _selectedOpeRoom        = sender as OperationRoomContent;
         _selectedOpeRoom.RoomNo = _selectedOpeRoom.OperRoomNo;
         foreach (OperationRoomContent roomContent in OperationRoomContentList)
         {
             if (roomContent != sender)
             {
                 roomContent.CancelFocus();
             }
         }
     }
     ;
 }
Пример #4
0
        private void GetPacuInfo()
        {
            OperationRoomContent operationRoomContent = null;

            for (int i = 0; i < OperationRoomContentList.Count; i++)
            {
                operationRoomContent            = OperationRoomContentList[i];
                operationRoomContent.VisitID    = 0;
                operationRoomContent.OperID     = 0;
                operationRoomContent.PatientID  = "";
                operationRoomContent.InPacuTime = "";
                MED_OPERATING_ROOM pacuRoom = pacuRoomList.Where(x => x.ROOM_NO.Equals(operationRoomContent.OperRoomKey)).ToList()[0];
                if (pacuRoom != null)
                {
                    if (!string.IsNullOrEmpty(pacuRoom.PATIENT_ID))
                    {
                        operationRoomContent.PatientID = pacuRoom.PATIENT_ID;
                        operationRoomContent.VisitID   = pacuRoom.VISIT_ID.Value;
                        operationRoomContent.OperID    = pacuRoom.OPER_ID.Value;
                        MED_PAT_MASTER_INDEX patMaster       = operationInfoRepository.GetPatMasterIndex(operationRoomContent.PatientID).Data;
                        MED_OPERATION_MASTER operationMaster = operationInfoRepository.GetOperMaster(operationRoomContent.PatientID, operationRoomContent.VisitID, operationRoomContent.OperID).Data;//ExtendApplicationContext.Current.MED_OPERATION_MASTER;
                        if (operationMaster != null && !string.IsNullOrEmpty(operationMaster.OPER_STATUS_CODE.ToString()))
                        {
                            if (operationMaster.OPER_STATUS_CODE != 45)
                            {
                                operationRoomContent.PatientID = "";
                                operationRoomContent.VisitID   = 0;
                                operationRoomContent.OperID    = 0;
                            }
                            else
                            {
                                if (operationMaster.IN_PACU_DATE_TIME.HasValue)
                                {
                                    TimeSpan timeDiff = accountRepository.GetServerTime().Data - operationMaster.IN_PACU_DATE_TIME.Value;
                                    operationRoomContent.inTime = (int)timeDiff.TotalMinutes;
                                }
                            }
                        }
                    }
                }
                operationRoomContent.RefreshValue();
                operationRoomContent.CancelFocus();
            }
        }
Пример #5
0
 private void operRoomContent_PACUDocClick(object sender, EventArgs e)
 {
     if (sender is OperationRoomContent)
     {
         _selectedOpeRoom = sender as OperationRoomContent;
         if (!string.IsNullOrEmpty(_selectedOpeRoom.PatientID))
         {
             ExtendApplicationContext.Current.PatientContextExtend.PatientID = _selectedOpeRoom.PatientID;
             ExtendApplicationContext.Current.PatientContextExtend.VisitID   = _selectedOpeRoom.VisitID;
             ExtendApplicationContext.Current.PatientContextExtend.OperID    = _selectedOpeRoom.OperID;
             ExtendApplicationContext.Current.PatientInformationExtend       = patientInfoRepository.GetPatCard(_selectedOpeRoom.PatientID, _selectedOpeRoom.VisitID, _selectedOpeRoom.OperID).Data;
             ExtendApplicationContext.Current.SystemStatus = ProgramStatus.PACURecord;
             EventHandler eventHandle = Events[_PACUPandectDocClick] as EventHandler;
             if (eventHandle != null)
             {
                 eventHandle(sender, e);
             }
         }
     }
 }
Пример #6
0
 private void OperationRoomContent_MouseClick(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right && ApplicationConfiguration.IsPACUProgram)
     {
         ContextMenuStrip  menu = new ContextMenuStrip();
         ToolStripMenuItem item = new ToolStripMenuItem("取消入复苏室");
         item.Click += new EventHandler(delegate(object sender1, EventArgs e1)
         {
             OperationRoomContent operContent = sender as OperationRoomContent;
             string roomNo = operContent.OperRoomNo;
             List <MED_OPERATING_ROOM> operatingRoomList = comnDictRepository.GetOperatingRoomList(operContent.BedType).Data;
             if (operatingRoomList != null && operatingRoomList.Count > 0)
             {
                 operatingRoomList = operatingRoomList.Where(x => x.DEPT_CODE == ExtendApplicationContext.Current.OperRoom).ToList();
             }
             if (string.IsNullOrEmpty(roomNo) || string.IsNullOrEmpty(operContent.PatientID))
             {
                 return;
             }
             else
             {
                 new OperatingRoomRepository().SetOperatingRoomPatient(operatingRoomList, roomNo, ExtendApplicationContext.Current.OperRoom, "", 0, 0);
                 new OperatingRoomRepository().SetOperMaster(operContent.PatientID, operContent.VisitID, operContent.OperID, "IN_PACU_DATE_TIME", DateTime.MinValue, 40);
                 // CommDictService.SaveOperatingRommList(operatingRoomList);
                 new OperatingRoomRepository().SetMonitorDictPatient(operContent.BedType, ExtendApplicationContext.Current.OperRoom, roomNo, "", 0, 0);
             }
             var patListView = (Form.ActiveForm as MainFrm)._patients;
             //patListView.RefreshPatientDataTable(operContent.PatientID, operContent.VisitID, operContent.OperID);
             patListView.BeginInvoke(new Action(patListView.RefreshPatientDataTable),
                                     new object[] { operContent.PatientID, operContent.VisitID, operContent.OperID });
             RefreshControl(roomNo, operContent.BedType);
         });
         menu.Items.Add(item);
         menu.Show(Control.MousePosition);
     }
 }
Пример #7
0
        public void InitOperationRoomContentList()
        {
            int count = pacuRoomList.Count;// pacuRoomList.Count > 12 ? 12 :

            for (int i = 0; i < count; i++)
            {
                MED_OPERATING_ROOM   row             = pacuRoomList[i];
                OperationRoomContent operRoomContent = new OperationRoomContent();
                operRoomContent.BedLabel    = row.BED_LABEL;
                operRoomContent.OperRoomNo  = row.ROOM_NO;
                operRoomContent.RoomNo      = row.ROOM_NO;
                operRoomContent.OperRoomKey = row.ROOM_NO;
                operRoomContent.BedType     = _bedType;
                OperationRoomContentList.Add(operRoomContent);
                operRoomContent.OperRoomSelected += new EventHandler(operRoomContent_OperRoomSelected);
                operRoomContent.Click            += new EventHandler(operRoomContent_Click);
                operRoomContent.DoDoubleClick    += new EventHandler(operRoomContent_DoubleClick);
                operRoomContent.PACUDocClick     += new EventHandler(operRoomContent_PACUDocClick);
                operRoomContent.OutPACUDocClick  += operRoomContent_OutPACUDocClick;
            }
            int contentWidth  = 0;
            int contentHeight = 0;

            if (OperationRoomContentList.Count > 0)
            {
                contentWidth  = OperationRoomContentList[0].Width;
                contentHeight = OperationRoomContentList[0].Height;
            }
            int useWidth = this.Width < OrginWidth ? OrginWidth : this.Width;

            while (colCount * contentWidth >= useWidth)
            {
                colCount--;
            }
            if (colCount <= 0)
            {
                return;
            }
            if (OperationRoomContentList.Count % colCount > 0)
            {
                rowCount = OperationRoomContentList.Count / colCount + 1;
            }
            else
            {
                rowCount = OperationRoomContentList.Count / colCount;
            }
            int offX = 1;
            int offY = 5;
            OperationRoomContent operationRoomContent = null;
            int index = 0;

            //排序
            for (int i = 0; i < rowCount; i++)
            {
                offY = i == 0 ? 5 : 10;
                for (int j = 0; j < colCount; j++)
                {
                    offX  = j == 0 ? 1 : 5;
                    index = (i * colCount) + j;
                    if (index >= OperationRoomContentList.Count)
                    {
                        break;
                    }
                    operationRoomContent         = OperationRoomContentList[index];
                    operationRoomContent.Left    = offX * (j + 1) + contentWidth * j;
                    operationRoomContent.Top     = offY * (i + 1) + contentHeight * i;
                    operationRoomContent.Visible = true;
                }
            }
            pRoomPandect.Controls.AddRange(OperationRoomContentList.ToArray());
        }
Пример #8
0
 public void AddPACUInfo(MED_PATIENT_CARD patientCard, OperationRoomContent operContent)
 {
     if (!patientCard.IN_PACU_DATE_TIME.HasValue && patientCard.OPER_STATUS_CODE == 40)
     {
         TimeInPutFrmPC timeInput = new TimeInPutFrmPC();
         timeInput.Text = "入PACU时间";
         if (timeInput.ShowDialog() != DialogResult.Cancel)
         {
             string roomNo = operContent.RoomNo;
             List <MED_OPERATING_ROOM> operatingRoomList = comnDictRepository.GetOperatingRoomList(operContent.BedType).Data;
             if (operatingRoomList != null && operatingRoomList.Count > 0)
             {
                 operatingRoomList = operatingRoomList.Where(x => x.DEPT_CODE == ExtendApplicationContext.Current.OperRoom).ToList();
             }
             MED_OPERATION_MASTER operMaster = operationInfoRepository.GetOperMaster(ExtendApplicationContext.Current.PatientContextExtend.PatientID,
                                                                                     ExtendApplicationContext.Current.PatientContextExtend.VisitID, ExtendApplicationContext.Current.PatientContextExtend.OperID).Data;
             if (operMaster != null)
             {
                 if (operMaster.OUT_DATE_TIME.HasValue)
                 {
                     if (timeInput.SelectedDateTime.AddSeconds(0 - timeInput.SelectedDateTime.Second) < operMaster.OUT_DATE_TIME)
                     {
                         MessageBoxFormPC.Show("【入复苏室】 时间 [" + timeInput.SelectedDateTime + "] 小于 【出手术室】时间 [" + operMaster.OUT_DATE_TIME + "],请重新输入!",
                                               "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                         return;
                     }
                 }
             }
             if (operatingRoomList != null && operatingRoomList.Count > 0)
             {
                 List <string> bedNos = new List <string>();
                 operatingRoomList.ForEach(row =>
                 {
                     if (!string.IsNullOrEmpty(row.BED_TYPE) && row.BED_TYPE.Equals("1"))
                     {
                         bedNos.Add(row.ROOM_NO);
                     }
                 });
             }
             if (string.IsNullOrEmpty(roomNo))
             {
                 return;
             }
             {
                 bool isUpdate = new OperatingRoomRepository().SetOperatingRoomPatient(operatingRoomList, roomNo, ExtendApplicationContext.Current.OperRoom, patientCard.PATIENT_ID
                                                                                       , patientCard.VISIT_ID, patientCard.OPER_ID);
                 if (isUpdate)
                 {
                     new OperatingRoomRepository().SetOperMaster(patientCard.PATIENT_ID, patientCard.VISIT_ID, patientCard.OPER_ID, "IN_PACU_DATE_TIME", timeInput.SelectedDateTime, 45);
                     // CommDictService.SaveOperatingRommList(operatingRoomList);
                     new OperatingRoomRepository().SetMonitorDictPatient(operContent.BedType, ExtendApplicationContext.Current.OperRoom, roomNo, patientCard.PATIENT_ID
                                                                         , patientCard.VISIT_ID, patientCard.OPER_ID);
                     patientCard.OPER_STATUS_CODE  = 45;
                     patientCard.IN_PACU_DATE_TIME = timeInput.SelectedDateTime;
                     ExtendApplicationContext.Current.PatientInformationExtend = patientCard;
                 }
             }
             RefreshControl(roomNo, operContent.BedType);
         }
     }
 }