Exemplo n.º 1
0
        /// <summary>
        /// 模式显示窗体
        /// </summary>
        /// <param name="view"></param>
        /// <param name="caption"></param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        /// <returns></returns>
        public DialogResult ShowViewDialog(BaseView view, int width, int height)
        {
            DialogHostFormPC dialogHostForm = new DialogHostFormPC(view.Caption, width, height);

            dialogHostForm.Child = view;
            return(dialogHostForm.ShowDialog());
        }
Exemplo n.º 2
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            EditSchedule     view = new EditSchedule(currentDay, _loginName);
            DialogHostFormPC pc   = new DialogHostFormPC("编辑事项", view.Width, view.Height);

            pc.Child = view;
            pc.ShowDialog();

            TitleFormat();
        }
Exemplo n.º 3
0
        private void btnInsertColumns_Click(object sender, EventArgs e)
        {
            if (dgMonitorEditorView.ColumnCount > 0)
            {
                int rowIndex = -1;
                if (dgMonitorEditorView.SelectedRows != null && dgMonitorEditorView.SelectedRows.Count > 0)
                {
                    rowIndex = dgMonitorEditorView.SelectedRows[0].Index;
                }
                List <string> items  = new List <string>();
                List <object> values = new List <object>();
                for (int i = 2; i < ((DataTable)dgMonitorEditorView.DataSource).Columns.Count; i++)
                {
                    DataColumn column = ((DataTable)dgMonitorEditorView.DataSource).Columns[i];
                    items.Add(column.Caption);
                    if (rowIndex >= 0)
                    {
                        object v = ((DataTable)dgMonitorEditorView.DataSource).Rows[rowIndex][i];
                        if (v == System.DBNull.Value)
                        {
                            values.Add("0");
                        }
                        else
                        {
                            values.Add(v.ToString());
                        }
                    }
                }

                MonitorDataEditor monitorEditor;
                if (rowIndex >= 0)
                {
                    monitorEditor = new MonitorDataEditor(_patientID, _visitID, _operID, items
                                                          , DateTime.Parse(((DataTable)dgMonitorEditorView.DataSource).Rows[rowIndex][0].ToString()), values, _eventNo);
                }
                else
                {
                    monitorEditor = new MonitorDataEditor(_patientID, _visitID, _operID, items, _eventNo);
                }
                DialogHostFormPC dialogHostForm = new DialogHostFormPC(monitorEditor.Caption, monitorEditor.Width, monitorEditor.Height + 30);
                dialogHostForm.Child = monitorEditor;
                dialogHostForm.ShowDialog();
                object result = monitorEditor.Result;
                if (result != null && result is DialogResult && (DialogResult)result == DialogResult.OK)
                {
                    GetVitalSignDataTable();
                    _dataChanged = true;
                    if (SignVitalSaveClicked != null)
                    {
                        SignVitalSaveClicked(this, EventArgs.Empty);
                    }
                }
            }
        }
Exemplo n.º 4
0
        public void EditItem(MedicalSystem.Anes.Domain.MED_DAILY_SCHEDULE item)
        {
            EditSchedule view = new EditSchedule(currentDay, _loginName);

            view.Edit(item);
            DialogHostFormPC pc = new DialogHostFormPC("编辑事项", view.Width, view.Height);

            pc.Child = view;
            pc.ShowDialog();

            TitleFormat();
        }
Exemplo n.º 5
0
        private void panelTurnTo_Click(object sender, EventArgs e)
        {
            TurnToControl    control        = new TurnToControl(ExtendApplicationContext.Current.OperationStatus);
            DialogHostFormPC dialogHostForm = new DialogHostFormPC("患者转出", control.Width, control.Height);

            dialogHostForm.Child = control;
            dialogHostForm.ShowDialog();
            if (control.result == DialogResult.OK)
            {
                patientStatusContrl1.SetOperTurnStatus(control.CurrentOperStatus);
            }
        }
Exemplo n.º 6
0
        public DialogResult ShowViewDialog2(BaseView view, bool isMaximized)
        {
            DialogHostFormPC dialogHostForm = new DialogHostFormPC(view.Caption, false);

            dialogHostForm.Child           = view;
            dialogHostForm.MaximizeBox     = false;
            dialogHostForm.Height          = Screen.PrimaryScreen.WorkingArea.Height - 80;;
            dialogHostForm.Width           = Screen.PrimaryScreen.WorkingArea.Width - 80;
            dialogHostForm.StartPosition   = FormStartPosition.CenterScreen;
            dialogHostForm.FormBorderStyle = FormBorderStyle.FixedDialog;
            return(dialogHostForm.ShowDialog());
        }
Exemplo n.º 7
0
 /// <summary>
 /// 修改体征
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void lblDetection_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(PatientID))
     {
         SelectRoomContent(sender, e);
         PatMonitorEditor monitoeEditor  = new PatMonitorEditor(PatientID, VisitID, OperID, ExtendApplicationContext.Current.EventNo);
         DialogHostFormPC dialogHostForm = new DialogHostFormPC(monitoeEditor.Caption, monitoeEditor.Width, monitoeEditor.Height);
         dialogHostForm.Child = monitoeEditor;
         dialogHostForm.Text  = "修改体征数据";
         dialogHostForm.ShowDialog();
         RefreshVitalSign();
     }
 }
Exemplo n.º 8
0
        /// <summary>
        /// 选中某个患者双击进入患者病案首页界面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex == -1 || e.ColumnIndex == -1)
            {
                return;
            }
            string           patientID      = dataGridView1.CurrentRow.Cells[this.ColumnPatientID.Index].Value.ToString();
            int              visitID        = int.Parse(dataGridView1.CurrentRow.Cells[this.ColumnVisitID.Index].Value.ToString());
            int              operID         = int.Parse(dataGridView1.CurrentRow.Cells[this.ColumnOperID.Index].Value.ToString());
            string           name           = dataGridView1.CurrentRow.Cells[this.ColumnNAME.Index].Value.ToString();
            DialogHostFormPC dialogHostForm = new DialogHostFormPC(name + "的首页", true);

            dialogHostForm.Child = new PatientMain(patientID, visitID, operID);
            dialogHostForm.ShowDialog();
        }
Exemplo n.º 9
0
        private void dgFinishedYesterday_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dgFinishedYesterday.ReadOnly || e.RowIndex == -1 || e.ColumnIndex == -1)
            {
                return;
            }
            string           patientID      = dgFinishedYesterday.CurrentRow.Cells["ColumnYPatientID"].Value.ToString();
            int              visitID        = (int)dgFinishedYesterday.CurrentRow.Cells["ColumnYVisitID"].Value;
            int              operID         = (int)dgFinishedYesterday.CurrentRow.Cells["ColumnYOperID"].Value;
            string           name           = dgFinishedYesterday.CurrentRow.Cells["ColumnYName"].Value.ToString();
            DialogHostFormPC dialogHostForm = new DialogHostFormPC(name + "的首页", 1600, 1000);

            dialogHostForm.Child = new PatientMain(patientID, visitID, operID);//446343
            dialogHostForm.ShowDialog();
        }
Exemplo n.º 10
0
        public object Excute(OperationStatus operationStatus)
        {
            string roomNo = "";
            OperationRoomPandect operationRoomPandect = new OperationRoomPandect("1", true);
            DialogHostFormPC     dialogHostForm       = new DialogHostFormPC("选择床位 - 双击空床位完成选择", 1000, 600);

            dialogHostForm.Child = operationRoomPandect;
            dialogHostForm.ShowDialog();
            if (operationRoomPandect.SelectedOperationRoomContent != null)
            {
                roomNo = operationRoomPandect.SelectedOperationRoomContent.OperRoomKey;
            }

            return(roomNo);
        }
Exemplo n.º 11
0
 /// <summary>
 /// 入室评估
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void lblBurglaryAssessment_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(PatientID))
     {
         SelectRoomContent(sender, e);
         ConfirmationInPacu inPacu         = new ConfirmationInPacu(PatientID, VisitID, OperID, true);
         DialogHostFormPC   dialogHostForm = new DialogHostFormPC("入室信息确认", inPacu.Width, inPacu.Height);
         dialogHostForm.Child = inPacu;
         dialogHostForm.ShowDialog();
         if (inPacu.result == DialogResult.OK)
         {
             RefreshInfo();
         }
         // 当前患者未进行苏醒评分,不满足出室条件,是否强制出室?
     }
 }
Exemplo n.º 12
0
 public void ShowFormByDocName(object patientId, object visitId, object operId, string docName)
 {
     ApplicationConfiguration.MedicalDocucementElement document = ApplicationConfiguration.GetMedicalDocument(docName);
     //没有找到退出
     if (string.IsNullOrEmpty(document.Caption))
     {
         return;
     }
     try
     {
         Type    t       = Type.GetType(document.Type);
         BaseDoc baseDoc = Activator.CreateInstance(t) as BaseDoc;
         baseDoc.ShowScrollBar();
         // 设置指定的患者信息
         if (patientId != null)
         {
             object[] objs = new object[3];
             objs[0] = patientId;
             objs[1] = visitId;
             objs[2] = operId;
             baseDoc.SetDocParameters(objs);
         }
         baseDoc.LoadReport(ExtendApplicationContext.Current.AppPath + document.Path);
         DialogHostFormPC dialogHostForm = null;
         dialogHostForm       = new DialogHostFormPC(docName, 1200, 900);
         dialogHostForm.Child = baseDoc;
         if (AccessControl.CheckModifyRightForOperator(docName))//有Modify权限
         {
             baseDoc.SetAllControlEditable(true);
         }
         else
         {
             baseDoc.SetAllButtonsEnable(false);
             baseDoc.SetAllControlEditable(false);
         }
         if (baseDoc.AllowSingleDocModify())
         {
             baseDoc.SetAllControlEditable(true);
         }
         dialogHostForm.ShowDialog();
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemplo n.º 13
0
        private void lblChangeRoom_DoubleClick(object sender, EventArgs e)
        {
            ChangePacuRoom   changePacuRoom = new ChangePacuRoom(PatientID, VisitID, OperID);
            DialogHostFormPC dialogHostForm = new DialogHostFormPC("更换床位", changePacuRoom.Width, changePacuRoom.Height);

            dialogHostForm.Child = changePacuRoom;
            dialogHostForm.ShowDialog();
            if (changePacuRoom.result == DialogResult.OK)
            {
                RefreshControl(OperRoomNo, BedType);
                EventHandler eventHandle = Events[_OutPACUDocClick] as EventHandler;
                if (eventHandle != null)
                {
                    eventHandle(this, e);
                }
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// 出复苏室
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lblOutPacu_Click(object sender, EventArgs e)
        {
            SelectRoomContent(sender, e);
            ConfirmationOutPacu outPacu    = new ConfirmationOutPacu(OperRoomNo, PatientID, VisitID, OperID, DateTime.MinValue);
            DialogHostFormPC    dialogForm = new DialogHostFormPC("出室信息确认", outPacu.Width, outPacu.Height);

            dialogForm.Child = outPacu;
            dialogForm.ShowDialog();
            if (outPacu.result == DialogResult.OK)
            {
                RefreshControl(OperRoomNo, BedType);
                inTime = -1;
                EventHandler eventHandle = Events[_OutPACUDocClick] as EventHandler;
                if (eventHandle != null)
                {
                    eventHandle(this, e);
                }
            }
        }
Exemplo n.º 15
0
        private void btnDosage_Click(object sender, MouseEventArgs e)
        {
            Button simpleButton = sender as Button;

            if (e.Button == MouseButtons.Right)
            {
                ContextMenuStrip  menu = new ContextMenuStrip();
                ToolStripMenuItem item = new ToolStripMenuItem("药品查询");
                item.Click += new EventHandler(delegate(object sender1, EventArgs e1)
                {
                    AcsContent acsContent = new AcsContent();
                    string strSearch      = "";
                    DataRow row           = dataSet.Tables[EventName].Rows[_dictIndexList[(int)(simpleButton.Tag)]];
                    strSearch             = row["EVENT_ITEM_NAME"].ToString();
                    acsContent.SetContextKeyWords(strSearch);
                    DialogHostFormPC dialog = new DialogHostFormPC("临床麻醉知识查询", acsContent.Width, acsContent.Height);
                    dialog.ShowDialog();
                });
                menu.Items.Add(item);
                menu.Show(Control.MousePosition);
            }
            else
            {
                if (!simpleButton.Text.Equals("?"))
                {
                    ItemAdd(Convert.ToInt32(simpleButton.Tag), simpleButton.Text);
                    if (items.Count > 0)
                    {
                        foreach (EventInfo info in items)
                        {
                            MED_ANESTHESIA_EVENT row = _anesthesiaEventsEditor.AddRow(info.ItemClass, info.ItemName, info.ItemSpec, info.ItemCode, info.Administrator, (decimal)info.Concentration
                                                                                      , info.ConcentrationUnit, (decimal)info.Dosage, info.DosageUnits, (decimal)info.PerformSpeed, info.SpeedUnit, ExtendApplicationContext.Current.LoginUser.USER_JOB_ID, info.Event_Attr, (int)info.DuractiveIndicator);
                            SetEventSortValue(row);
                        }
                        items.Clear();
                    }
                }
            }
        }
Exemplo n.º 16
0
 private void searchTextBox1_BtnClicked(object sender, string var)
 {
     if (!string.IsNullOrEmpty(var))
     {
         _patientID = var;
         List <MED_PATIENT_CARD> _patientCardList = patientInfoRepository.GetPatientListDataTableByPatientID(
             _patientID, ExtendApplicationContext.Current.OperRoom,
             ExtendApplicationContext.Current.HospBranchCode).Data;
         if (_patientCardList != null && _patientCardList.Count > 0)
         {
             _patientCardList.ForEach(row =>
             {
                 if (row.OPER_ID > _operID)
                 {
                     _operID = row.OPER_ID;
                 }
             });
             PatientInfoSureControl sure           = new PatientInfoSureControl(_patientCardList);
             DialogHostFormPC       dialogHostForm = new DialogHostFormPC("病人信息选择", sure.Width, sure.Height);
             dialogHostForm.Text  = "病人信息选择";
             dialogHostForm.Child = sure;
             dialogHostForm.ShowDialog();
             if (sure.result == DialogResult.OK)
             {
                 _patientCard = sure.SelectPatientCard;
                 _patientID   = _patientCard.PATIENT_ID;
                 _visitID     = _patientCard.VISIT_ID;
                 _operID      = _operID + 1;
                 LoadPatientID();
             }
         }
         else
         {
             SyncPatientByPatientId(_patientID);
         }
         LoadPatientInfo();
     }
 }
Exemplo n.º 17
0
        void baseDoc_BtnClicked(object sender, int index)
        {
            if (AccessControl.CheckModifyRightForOperator(bocList[index].Caption))//有Modify权限
            {
                bocList[index].SetAllControlEditable(true);
            }
            else
            {
                bocList[index].SetAllButtonsEnable(false);
                bocList[index].SetAllControlEditable(false);
            }
            if (bocList[index].AllowSingleDocModify())
            {
                bocList[index].SetAllControlEditable(true);
            }

            Panel panel = ((UserControl)sender).Parent as Panel;

            panel.Controls.Clear();
            DialogHostFormPC form = panel.Parent as DialogHostFormPC;

            form.Child = bocList[index];
            bocList[index].LoadReport(reportNameDic, bocList[index].Caption);
        }
Exemplo n.º 18
0
        private void panelJZDJ_Click(object sender, EventArgs e)
        {
            //List<MED_OPERATING_ROOM> roomList = CommDictService.GetOperatingRoomList("0").Where(p => p.ROOM_NO == ExtendApplicationContext.Current.OperRoomNo).ToList();
            //if (roomList != null && roomList.Count > 0)
            //{
            //    MED_OPERATING_ROOM operRoom = roomList[0];
            //    if (!string.IsNullOrEmpty(operRoom.PATIENT_ID))
            //    {
            //        MED_PATIENT_CARD cardRow = PatientInfoService.GetPatCard(operRoom.PATIENT_ID, (int)operRoom.VISIT_ID, (int)operRoom.OPER_ID);
            //        MessageBoxFormPC.Show("该手术间" + operRoom.ROOM_NO + "已存在患者【" + cardRow.NAME + " " + cardRow.INP_NO + "】,请换其他手术间!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //        return;
            //    }
            //}
            ConfirmationSureBase emergencyControl = new ConfirmationSureBase(null, 0);
            DialogHostFormPC     dialogHostForm   = new DialogHostFormPC("急诊登记", emergencyControl.Width, emergencyControl.Height);

            dialogHostForm.Text  = "急诊登记";
            dialogHostForm.Child = emergencyControl;
            dialogHostForm.ShowDialog();
            if (emergencyControl.result == DialogResult.OK)
            {
                RefreshPatientDataTable();
            }
        }
Exemplo n.º 19
0
        protected static void PopDrugItem_Selected(object s1, EventArgs e1)
        {
            try
            {
                DataRow row = s1 as DataRow;

                if (row == null)
                {
                    return;
                }
                List <MED_ANESTHESIA_EVENT> anesEvent = ModelHelper <MED_ANESTHESIA_EVENT> .ConvertDataTableToList(_handler.DataSource["AnesAllEvent"]);

                if (anesEvent == null)
                {
                    anesEvent = new List <MED_ANESTHESIA_EVENT>();
                }
                MED_ANESTHESIA_EVENT eventRow = DataContext.GetCurrent().NewAnesthesiaEventRow(anesEvent, _eventNo);

                eventRow.EVENT_CLASS_CODE = row["EVENT_CLASS_CODE"].ToString();
                eventRow.EVENT_ITEM_NAME  = row["EVENT_ITEM_NAME"].ToString();
                eventRow.EVENT_ITEM_SPEC  = row["EVENT_ITEM_SPEC"].ToString();
                eventRow.EVENT_ITEM_CODE  = row["EVENT_ITEM_CODE"].ToString();
                eventRow.START_TIME       = _currentTime;

                if (!row.IsNull("ADMINISTRATOR"))
                {
                    eventRow.ADMINISTRATOR = row["ADMINISTRATOR"].ToString();
                }

                if (!row.IsNull("CONCENTRATION_UNIT"))
                {
                    eventRow.CONCENTRATION_UNIT = row["CONCENTRATION_UNIT"].ToString();
                }

                if (!row.IsNull("DOSAGE_UNITS"))
                {
                    eventRow.DOSAGE_UNITS = row["DOSAGE_UNITS"].ToString();
                }

                if (!row.IsNull("SPEED_UNIT"))
                {
                    eventRow.SPEED_UNIT = row["SPEED_UNIT"].ToString();
                }

                if (!row.IsNull("SUPPLIER_NAME"))
                {
                    eventRow.SUPPLIER_NAME = row["SUPPLIER_NAME"].ToString();
                }

                if (!row.IsNull("CONCENTRATION"))
                {
                    eventRow.CONCENTRATION = Convert.ToDecimal(row["CONCENTRATION"]);
                }

                if (!row.IsNull("DOSAGE"))
                {
                    eventRow.DOSAGE = Convert.ToDecimal(row["DOSAGE"]);
                }

                if (!row.IsNull("PERFORM_SPEED"))
                {
                    eventRow.PERFORM_SPEED = Convert.ToDecimal(row["PERFORM_SPEED"]);
                }

                if (!row.IsNull("DURATIVE_INDICATOR"))
                {
                    eventRow.DURATIVE_INDICATOR = Convert.ToInt32(row["DURATIVE_INDICATOR"]);
                }

                EditEventItem editItem = new EditEventItem();
                editItem.DataSource = eventRow;
                editItem.ItemType   = _title == "事件" ? EditEventItem.ItemTypes.EventItem : EditEventItem.ItemTypes.MedicineItem;
                DialogHostFormPC dialogHostForm = new DialogHostFormPC(editItem.Caption, editItem.Width, editItem.Height);
                dialogHostForm.Child = editItem;
                dialogHostForm.Text  = _title;
                editItem.TitleColor  = Color.Blue;
                DialogResult result = dialogHostForm.ShowDialog(_parent);
                if (result == DialogResult.OK)
                {
                    anesEvent.Add(eventRow);

                    new OperationInfoRepository().SaveAnesthesiaEventList(anesEvent);

                    if (_handler.AttatchDoc != null)
                    {
                        _handler.AttatchDoc.RefreshData();
                    }
                }
            }
            catch (Exception err)
            {
                ExceptionHandler.Handle(err);
            }
        }
Exemplo n.º 20
0
        public void SetDay(DateTime now, bool today, List <MED_DAILY_SCHEDULE> list)
        {
            currentDay = now;
            toDay      = today;
            data       = list;

            this.labTitle.Visible = false;
            if (today)
            {
                this.labDay.Image = Resources.day1;
                this.labDay.Text  = "";
                if (list != null && list.Count > 0)
                {
                    this.labTitle.Text    = string.Format("代办事项{0}项", list.Count);
                    this.labTitle.Visible = true;
                }
            }
            else if (list != null && list.Count > 0)
            {
                this.labDay.Image     = Resources.day2;
                this.labDay.Text      = now.Day.ToString();
                this.labDay.ForeColor = Color.White;

                this.labTitle.Text    = string.Format("代办事项{0}项", list.Count);
                this.labTitle.Visible = true;
            }
            else
            {
                this.labDay.Image     = null;
                this.labDay.Text      = now.Day.ToString();
                this.labDay.ForeColor = Color.Black;
            }

            PanelBorder p   = null;
            Label       lab = null;

            for (int i = 0; i < this.panelNoFlash2.Controls.Count || list != null && i < list.Count; i++)
            {
                if (i < panelTmpList.Count)
                {
                    p   = panelTmpList[i] as PanelBorder;
                    lab = p.Controls[0] as Label;
                }
                else
                {
                    p = new PanelBorder()
                    {
                        Height = 26
                    };
                    p.Padding     = new Padding(6);
                    p.DashStyle   = DashStyle.Custom;
                    p.DashPattern = new float[] { 1f, 3f };
                    panelTmpList.Add(p);
                    this.panelNoFlash2.Controls.Add(p);
                    p.Dock = DockStyle.Top;

                    lab = new Label();
                    p.Controls.Add(lab);
                    lab.Dock       = DockStyle.Fill;
                    lab.ImageAlign = ContentAlignment.MiddleLeft;
                    lab.TextAlign  = ContentAlignment.MiddleLeft;

                    p.Tag            = i;
                    lab.Tag          = i;
                    lab.DoubleClick += (sender, e) =>
                    {
                        EditSchedule view = new EditSchedule(currentDay, ExtendApplicationContext.Current.LoginUser.LOGIN_NAME);
                        view.Edit(list[(int)(sender as Control).Tag]);
                        DialogHostFormPC pc = new DialogHostFormPC("编辑事项", view.Width, view.Height);
                        pc.Child = view;
                        pc.ShowDialog();
                        SetDay(now, today, list);
                    };
                }
                p.BringToFront();

                if (list != null && i < list.Count)
                {
                    var tmp = list[i];
                    if (tmp.STATE == 0)
                    {
                        p.BorderColor = UN_FINISHED_COLOR;
                        p.BackColor   = UN_FINISHED_COLOR;
                        lab.Image     = Resources.unfinished;
                    }
                    else
                    {
                        p.BorderColor = FINISHED_COLOR;
                        p.BorderColor = FINISHED_COLOR;
                        p.BackColor   = FINISHED_COLOR;
                        lab.Image     = Resources.finished;
                    }
                    lab.Text = string.Format("    {0} {1}", tmp.CREATE_DATE.Value.ToString("HH:mm"), tmp.CONTENT);
                }
                else
                {
                    p.Visible = false;
                }
            }
        }
Exemplo n.º 21
0
        /// <summary>
        /// 鼠标单击事件
        /// </summary>
        protected void MedDrugGraph_MouseClick(object sender, MouseEventArgs e)
        {
            try
            {
                RectangleF rectf = _currentGraph.GetMainRect();
                if (!rectf.Contains(e.Location.X, e.Location.Y))
                {
                    return;
                }

                // 鼠标右键
                if (e.Button == MouseButtons.Right)
                {
                    _currentGraph.SetMousePosition(e.Location);
                    string eventNo = ExtendAppContext.Current.EventNo;
                    if (_currentGraph.MouseTime > DateTime.MinValue)
                    {
                        MedDrugPoint pt = _currentGraph.SelectedPoint;
                        _currentTime = _currentGraph.MouseTime;
                        // 弹出:麻药及用药 OR 新增麻药用药数据 窗口
                        if (pt == null)
                        {
                            List <MED_EVENT_DICT>       eventOpenTable = ApplicationModel.Instance.AllDictList.EventDictList;// ExtendAppContext.Current.CommDict.EventDict;
                            List <MED_ANESTHESIA_EVENT> anesEvent      = new ModelHandler <MED_ANESTHESIA_EVENT>().FillModel(this.DataSource["AnesthesiaEvent"]);
                            int    Line      = (int)Math.Ceiling(((double)e.Location.Y - _currentGraph.TopOffSet) / _currentGraph.Height * _currentGraph.LineParameters.Count);
                            double locationH = (double)e.Location.Y - _currentGraph.TopOffSet;
                            double rowH      = _currentGraph.Height / _currentGraph.LineParameters.Count;
                            for (int i = 1; i <= _currentGraph.LineParameters.Count; i++)
                            {
                                if (rowH * i > locationH)
                                {
                                    Line = i;
                                    break;
                                }
                            }

                            if (_currentGraph.Curves.Count < Line)
                            {
                                DataTable sourceTable = new ModelHandler <MED_EVENT_DICT>().FillDataTable(eventOpenTable.Where(x => x.EVENT_CLASS_CODE == "2" || x.EVENT_CLASS_CODE == "C").ToList());

                                PopupDrugSelector.ShowSelector(sourceTable, _currentGraph, e.Location, _currentTime != DateTime.MinValue ? _currentTime : DateTime.Now, this, "麻药及用药", eventNo);
                            }
                            else
                            {
                                if (_currentGraph.GetMainRect().X > e.Location.X)
                                {
                                    return;
                                }

                                List <MED_EVENT_DICT> eventDict = eventOpenTable.Where(x => x.EVENT_ITEM_NAME.Equals(_currentGraph.Curves[Line - 1].Text)).ToList();
                                MED_EVENT_DICT        row       = new MED_EVENT_DICT();
                                if (eventDict != null && eventDict.Count > 0)
                                {
                                    row = eventDict[0];
                                }

                                MED_ANESTHESIA_EVENT eventRow = DataContext.GetCurrent().NewAnesthesiaEventRow(anesEvent, eventNo);
                                eventRow.EVENT_CLASS_CODE = row.EVENT_CLASS_CODE;
                                eventRow.EVENT_ITEM_NAME  = row.EVENT_ITEM_NAME;
                                eventRow.EVENT_ITEM_SPEC  = row.EVENT_ITEM_SPEC;
                                eventRow.EVENT_ITEM_CODE  = row.EVENT_ITEM_CODE;
                                eventRow.START_TIME       = _currentTime;
                                if (!string.IsNullOrEmpty(row.EVENT_ATTR))
                                {
                                    eventRow.EVENT_ATTR = row.EVENT_ATTR;
                                }

                                if (!string.IsNullOrEmpty(_currentGraph.Curves[Line - 1].Points[0].Route))
                                {
                                    eventRow.ADMINISTRATOR = _currentGraph.Curves[Line - 1].Points[0].Route;
                                }

                                if (!string.IsNullOrEmpty(_currentGraph.Curves[Line - 1].Points[0].ThickNessUnit))
                                {
                                    eventRow.CONCENTRATION_UNIT = _currentGraph.Curves[Line - 1].Points[0].ThickNessUnit;
                                }

                                if (!string.IsNullOrEmpty(_currentGraph.Curves[Line - 1].Points[0].Unit))
                                {
                                    eventRow.DOSAGE_UNITS = _currentGraph.Curves[Line - 1].Points[0].Unit;
                                }

                                if (!string.IsNullOrEmpty(_currentGraph.Curves[Line - 1].Points[0].SpeedUnit))
                                {
                                    eventRow.SPEED_UNIT = _currentGraph.Curves[Line - 1].Points[0].SpeedUnit;
                                }

                                if (!string.IsNullOrEmpty(row.SUPPLIER_NAME))
                                {
                                    eventRow.SUPPLIER_NAME = row.SUPPLIER_NAME;
                                }

                                if (!string.IsNullOrEmpty(_currentGraph.Curves[Line - 1].Points[0].ThickNess.ToString()))
                                {
                                    eventRow.CONCENTRATION = (decimal)_currentGraph.Curves[Line - 1].Points[0].ThickNess;
                                }

                                if (!string.IsNullOrEmpty(_currentGraph.Curves[Line - 1].Points[0].Value.ToString()))
                                {
                                    eventRow.DOSAGE = Convert.ToDecimal(_currentGraph.Curves[Line - 1].Points[0].Value);
                                }

                                if (!string.IsNullOrEmpty(_currentGraph.Curves[Line - 1].Points[0].Speed.ToString()))
                                {
                                    eventRow.PERFORM_SPEED = (decimal)_currentGraph.Curves[Line - 1].Points[0].Speed;
                                }

                                if (row.DURATIVE_INDICATOR.HasValue)
                                {
                                    eventRow.DURATIVE_INDICATOR = row.DURATIVE_INDICATOR;
                                }

                                EditEventItem editItem = new EditEventItem();
                                editItem.DataSource = eventRow;
                                editItem.ItemType   = EditEventItem.ItemTypes.MedicineItem;
                                DialogHostFormPC dialogHostForm = new DialogHostFormPC(editItem.Caption, editItem.Width, editItem.Height);
                                dialogHostForm.Child = editItem;
                                dialogHostForm.Text  = "新增麻药用药数据";
                                editItem.TitleColor  = Color.Blue;
                                DialogResult result = dialogHostForm.ShowDialog();
                                if (result == DialogResult.OK)
                                {
                                    eventRow.ITEM_NO = DataContext.GetCurrent().GetMaxItemNO(anesEvent);
                                    anesEvent.Add(eventRow);
                                    AnesInfoService.ClientInstance.UpadteAnesthesiaEvent(anesEvent);
                                    RefreshData();
                                    _currentGraph.Refresh();
                                }
                            }
                        }
                        else // 弹出:修改麻药用药数据 窗口
                        {
                            MED_ANESTHESIA_EVENT        row       = _drugRows[pt];
                            List <MED_ANESTHESIA_EVENT> anesEvent = new ModelHandler <MED_ANESTHESIA_EVENT>().FillModel(this.DataSource["AnesthesiaEvent"]);
                            EditEventItem editItem = new EditEventItem();
                            editItem.DataSource = row;
                            editItem.ItemType   = EditEventItem.ItemTypes.MedicineItem;
                            editItem.IsAllowDel = true;
                            DialogHostFormPC dialogHostForm = new DialogHostFormPC("修改麻药用药数据", editItem.Width, editItem.Height);
                            dialogHostForm.Child = editItem;
                            editItem.TitleColor  = Color.DarkOrange;
                            if (dialogHostForm.ShowDialog() == DialogResult.OK)
                            {
                                if (editItem != null && editItem.IsDelete)
                                {
                                    if (MessageBoxFormPC.Show("是否确定要删除选中事件?", "操作提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                                    {
                                        List <MED_ANESTHESIA_EVENT> allEvent = new ModelHandler <MED_ANESTHESIA_EVENT>().FillModel(this.DataSource["AnesAllEvent"]);
                                        List <MED_ANESTHESIA_EVENT> rows     = allEvent.Where(x => x.EVENT_CLASS_CODE == row.EVENT_CLASS_CODE && x.ITEM_NO == row.ITEM_NO).ToList();
                                        if (rows.Count > 0)
                                        {
                                            allEvent.Remove(rows[0]);
                                        }

                                        AnesInfoService.ClientInstance.DeleteAnesthesiaEventRow(row);
                                    }
                                }
                                else
                                {
                                    List <MED_ANESTHESIA_EVENT> eventList = new List <MED_ANESTHESIA_EVENT>();
                                    eventList.Add(row);
                                    AnesInfoService.ClientInstance.UpadteAnesthesiaEvent(eventList);
                                }

                                this.RefreshData();
                                _currentGraph.Refresh();
                            }
                        }
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// 鼠标按下事件:响应右键
        /// </summary>
        protected void MedGridGraph_MouseClick(object sender, MouseEventArgs e)
        {
            try
            {
                RectangleF rectf = _currentGraph.GetMainRect();
                if (!rectf.Contains(e.Location.X, e.Location.Y))
                {
                    return;
                }

                if (e.Button == MouseButtons.Right)
                {
                    _currentGraph.SetMousePosition(e.Location);
                    if (_currentGraph.MouseTime > DateTime.MinValue)
                    {
                        MedGridPoint pt = _currentGraph.SelectedPoint;
                        _currentTime = _currentGraph.MouseTime;
                        string eventNo = ExtendAppContext.Current.EventNo;
                        if (pt == null)
                        {
                            List <MED_EVENT_DICT>       eventOpenTable = ExtendApplicationContext.Current.CommDict.EventDict;
                            List <MED_ANESTHESIA_EVENT> anesEvent      = ModelHelper <MED_ANESTHESIA_EVENT> .ConvertDataTableToList(this.DataSource["AnesthesiaEvent"]);

                            int Line = (int)Math.Ceiling((double)e.Location.Y / _currentGraph.Height * _currentGraph.Rows.Count);
                            if (_currentGraph.Rows[Line - 1].Points.Count == 0 || Line == 7 || Line == 8 || Line == 9)
                            {
                                List <MED_EVENT_DICT> eventDict = null;
                                if (Line == 6)
                                {
                                    eventDict = eventOpenTable.Where(x => x.EVENT_CLASS_CODE == "B").ToList();
                                }
                                else if (Line == 7 || Line == 8 || Line == 9)
                                {
                                    eventDict = eventOpenTable.Where(x => x.EVENT_CLASS_CODE == "D").ToList();
                                }
                                else
                                {
                                    eventDict = eventOpenTable.Where(x => x.EVENT_CLASS_CODE == "3").ToList();
                                }

                                DataTable sourceTable = ModelHelper <MED_EVENT_DICT> .ConvertListToDataTable(eventDict);

                                DateTime tempDt = _currentTime != DateTime.MinValue ? _currentTime : DateTime.Now;
                                PopupDrugSelector.ShowSelector(sourceTable, _currentGraph, e.Location, tempDt, this, "输血及输液", eventNo);
                            }
                            else
                            {
                                if (_currentGraph.GetMainRect().X > e.Location.X)
                                {
                                    return;
                                }

                                List <MED_EVENT_DICT> eventDict = eventOpenTable.Where(x => x.EVENT_CLASS_CODE == _currentGraph.Rows[Line - 1].Text &&
                                                                                       (x.EVENT_CLASS_CODE == "B" ||
                                                                                        x.EVENT_CLASS_CODE == "D" ||
                                                                                        x.EVENT_CLASS_CODE == "3")).ToList();
                                if (eventDict.Count == 0)
                                {
                                    return;
                                }

                                MED_EVENT_DICT       row      = eventDict[0];
                                MED_ANESTHESIA_EVENT eventRow = DataContext.GetCurrent().NewAnesthesiaEventRow(anesEvent, eventNo);
                                eventRow.EVENT_CLASS_CODE = row.EVENT_CLASS_CODE;
                                eventRow.EVENT_ITEM_NAME  = row.EVENT_ITEM_NAME;
                                eventRow.EVENT_ITEM_SPEC  = row.EVENT_ITEM_SPEC;
                                eventRow.EVENT_ITEM_CODE  = row.EVENT_ITEM_CODE;
                                eventRow.START_TIME       = _currentTime;
                                if (!string.IsNullOrEmpty(row.EVENT_ATTR))
                                {
                                    eventRow.EVENT_ATTR = row.EVENT_ATTR;
                                }

                                MED_ANESTHESIA_EVENT firstrow = _gridRows[_currentGraph.Rows[Line - 1].Points[0]];
                                if (!string.IsNullOrEmpty(firstrow.ADMINISTRATOR))
                                {
                                    eventRow.ADMINISTRATOR = firstrow.ADMINISTRATOR;
                                }

                                if (!string.IsNullOrEmpty(_currentGraph.Rows[Line - 1].Points[0].ThickNessUnit))
                                {
                                    eventRow.CONCENTRATION_UNIT = _currentGraph.Rows[Line - 1].Points[0].ThickNessUnit;
                                }

                                if (!string.IsNullOrEmpty(_currentGraph.Rows[Line - 1].Points[0].Unit))
                                {
                                    eventRow.DOSAGE_UNITS = _currentGraph.Rows[Line - 1].Points[0].Unit;
                                }

                                if (!string.IsNullOrEmpty(_currentGraph.Rows[Line - 1].Points[0].SpeedUnit))
                                {
                                    eventRow.SPEED_UNIT = _currentGraph.Rows[Line - 1].Points[0].SpeedUnit;
                                }

                                if (!string.IsNullOrEmpty(row.SUPPLIER_NAME))
                                {
                                    eventRow.SUPPLIER_NAME = row.SUPPLIER_NAME;
                                }

                                if (!string.IsNullOrEmpty(_currentGraph.Rows[Line - 1].Points[0].ThickNess.ToString()))
                                {
                                    eventRow.CONCENTRATION = (decimal)_currentGraph.Rows[Line - 1].Points[0].ThickNess;
                                }

                                if (!string.IsNullOrEmpty(_currentGraph.Rows[Line - 1].Points[0].Value.ToString()))
                                {
                                    eventRow.DOSAGE = Convert.ToDecimal(_currentGraph.Rows[Line - 1].Points[0].Value);
                                }

                                if (!string.IsNullOrEmpty(_currentGraph.Rows[Line - 1].Points[0].Speed.ToString()))
                                {
                                    eventRow.PERFORM_SPEED = (decimal)_currentGraph.Rows[Line - 1].Points[0].Speed;
                                }

                                if (row.DURATIVE_INDICATOR.HasValue)
                                {
                                    eventRow.DURATIVE_INDICATOR = row.DURATIVE_INDICATOR;
                                }

                                EditEventItem editItem = new EditEventItem();
                                editItem.DataSource = eventRow;
                                editItem.ItemType   = EditEventItem.ItemTypes.MedicineItem;
                                DialogHostForm dialogHostForm = new DialogHostForm(editItem.Caption, 320, 300);
                                dialogHostForm.Child = editItem;
                                dialogHostForm.Text  = "新增输血及输液数据";
                                DialogResult result = dialogHostForm.ShowDialog();
                                if (result == DialogResult.OK)
                                {
                                    eventRow.ITEM_NO = DataContext.GetCurrent().GetMaxItemNO(anesEvent);
                                    anesEvent.Add(eventRow);
                                    operationInfoRepository.SaveAnesthesiaEventList(anesEvent);
                                    this.RefreshData();
                                    this._currentGraph.Refresh();
                                }
                            }
                        }
                        else
                        {
                            MED_ANESTHESIA_EVENT        row       = _gridRows[pt];
                            List <MED_ANESTHESIA_EVENT> anesEvent = ModelHelper <MED_ANESTHESIA_EVENT> .ConvertDataTableToList(this.DataSource["AnesthesiaEvent"]);

                            EditEventItem editItem = new EditEventItem();
                            editItem.DataSource = row;
                            editItem.ItemType   = EditEventItem.ItemTypes.MedicineItem;
                            editItem.IsAllowDel = true;
                            editItem.TitleColor = Color.DarkOrange;
                            DialogHostFormPC dialogHostForm = new DialogHostFormPC("修改输血及输液数据", 320, 300);
                            dialogHostForm.Child = editItem;
                            if (dialogHostForm.ShowDialog() == DialogResult.OK)
                            {
                                if (editItem != null && editItem.IsDelete)
                                {
                                    if (MessageBoxFormPC.Show("是否确定要删除选中事件?", "操作提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                                    {
                                        List <MED_ANESTHESIA_EVENT> allEvent = ModelHelper <MED_ANESTHESIA_EVENT> .ConvertDataTableToList(this.DataSource["AnesAllEvent"]);

                                        List <MED_ANESTHESIA_EVENT> rows = allEvent.Where(x => x.EVENT_CLASS_CODE == row.EVENT_CLASS_CODE && x.ITEM_NO == row.ITEM_NO).ToList();
                                        if (rows.Count > 0)
                                        {
                                            allEvent.Remove(rows[0]);
                                        }
                                        // OperationLogger.WriteOperate("文书液体模块", "右键删除", "右键液体模块弹出药品界面,勾选删除选择项,点确定进行删除保存,事件名称【" + row["ITEM_NAME"].ToString() + "】", false, OperationLogKind.Other);
                                        anesEventRepository.DelAnesEvent(row);
                                    }
                                }
                                operationInfoRepository.SaveAnesthesiaEventList(anesEvent);
                                RefreshData();
                                _currentGraph.Refresh();
                            }
                        }
                    }
                }
            }
            catch (Exception err)
            {
                ExceptionHandler.Handle(err);
            }
        }
Exemplo n.º 23
0
        private string SetDocSettings(string initText)
        {
            string           text           = initText;
            DialogHostFormPC dialogHostForm = new DialogHostFormPC("", 600, 300);
            Panel            panel          = new Panel();
            Panel            panel1         = new Panel();
            DataGridView     grid           = new DataGridView();

            dialogHostForm.Child = panel;
            grid.Columns.Add("Caption", "标题");
            grid.Columns.Add("Key", "键名");
            grid.Columns.Add("Path", "文件");
            grid.Columns.Add("Type", "类全名");
            grid.Columns[2].Width = 200;
            List <string> list = new List <string>();

            if (!string.IsNullOrEmpty(text))
            {
                list = new List <string>(text.Split(','));
            }
            if (list.Count > 4)
            {
                list[3] = list[3] + "," + list[4];
                list.RemoveRange(4, list.Count - 4);
            }
            while (list.Count < 4)
            {
                list.Add("");
            }
            grid.Rows.Add(list.ToArray());
            grid.Columns[1].ReadOnly     = true;
            grid.Columns[2].ReadOnly     = true;
            grid.Columns[3].ReadOnly     = true;
            grid.RowHeadersVisible       = false;
            grid.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            grid.AllowUserToAddRows      = false;
            grid.AllowUserToDeleteRows   = false;
            grid.CellDoubleClick        += new DataGridViewCellEventHandler(grid_CellDoubleClick);
            MedButton btn1 = new MedButton();

            btn1.Text         = "确定";
            btn1.DialogResult = DialogResult.OK;
            MedButton btn2 = new MedButton();

            btn2.Text         = "取消";
            btn2.DialogResult = DialogResult.Cancel;
            panel.Controls.Add(grid);
            panel.Controls.Add(panel1);
            panel1.Height = 50;
            panel1.Dock   = DockStyle.Bottom;
            grid.Dock     = DockStyle.Fill;
            panel1.Controls.Add(btn1);
            panel1.Controls.Add(btn2);
            btn1.Left = 10;
            btn1.Top  = 5;
            btn2.Top  = 5;
            btn2.Left = 100;
            if (dialogHostForm.ShowDialog() == DialogResult.OK)
            {
                text = grid.Rows[0].Cells[0].Value + "," + grid.Rows[0].Cells[1].Value + "," + grid.Rows[0].Cells[2].Value + "," + grid.Rows[0].Cells[3].Value;
            }
            return(text);
        }
Exemplo n.º 24
0
        public void ShowFormByDocName(object patientId, object visitId, object operId, List <string> item)
        {
            string firstDocName = "";

            bocList.Clear();
            reportNameDic.Clear();
            try
            {
                BaseDoc baseDoc = new BaseDoc();

                foreach (string docName in item)
                {
                    if (!string.IsNullOrEmpty(docName))
                    {
                        if (string.IsNullOrEmpty(firstDocName))
                        {
                            firstDocName = docName;
                        }
                        ApplicationConfiguration.MedicalDocucementElement document = ApplicationConfiguration.GetMedicalDocument(docName);
                        //没有找到退出
                        if (!string.IsNullOrEmpty(document.Caption))
                        {
                            Type t = Type.GetType(document.Type);
                            baseDoc             = Activator.CreateInstance(t) as BaseDoc;
                            baseDoc.BtnClicked += baseDoc_BtnClicked;
                            baseDoc.Caption     = docName;
                            baseDoc.ShowScrollBar();
                            // 设置指定的患者信息
                            if (patientId != null)
                            {
                                object[] objs = new object[3];
                                objs[0] = patientId;
                                objs[1] = visitId;
                                objs[2] = operId;
                                baseDoc.SetDocParameters(objs);
                            }
                            bocList.Add(baseDoc);
                            reportNameDic.Add(docName, ExtendApplicationContext.Current.AppPath + document.Path);
                        }
                    }
                }
                if (reportNameDic.Count > 0)
                {
                    bocList[0].LoadReport(reportNameDic, firstDocName);
                    DialogHostFormPC dialogHostForm = null;
                    dialogHostForm       = new DialogHostFormPC("其他文书", 1200, 900);
                    dialogHostForm.Child = bocList[0];
                    if (AccessControl.CheckModifyRightForOperator(firstDocName))//有Modify权限
                    {
                        bocList[0].SetAllControlEditable(true);
                    }
                    else
                    {
                        bocList[0].SetAllButtonsEnable(false);
                        bocList[0].SetAllControlEditable(false);
                    }
                    if (bocList[0].AllowSingleDocModify())
                    {
                        bocList[0].SetAllControlEditable(true);
                    }
                    dialogHostForm.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemplo n.º 25
0
        private void PatientStatusSingleControl_Click(object sender, EventArgs e)
        {
            //验证是否可触发
            if ((_ControlDateTime == DateTime.MinValue || _ControlDateTime == DateTime.MinValue) && ApplicationConfiguration.ApplicationPatterns == "1")
            {
                SetOperationStatusTimeText(DateTime.MinValue);
                return;
            }
            if (!_ServicePatientStatusContrl.OnPatientStatusSingleControlKeyDown(this))
            {
                SetOperationStatusTimeText(DateTime.MinValue);
                return;
            }
            object result = null;

            if (_ControlDateTime != null && _ControlDateTime != DateTime.MinValue &&
                _ControlDateTime != DateTime.MaxValue && !StatusName.Trim().Equals("出复苏室"))
            {
                TimeInPutFrmPC timeInput = new TimeInPutFrmPC();
                timeInput.Text = this.StatusName + "时间";
                if (this._ControlDateTime != null && this._ControlDateTime != DateTime.MinValue &&
                    this._ControlDateTime != DateTime.MaxValue)
                {
                    timeInput.SelectedDateTime = this._ControlDateTime;
                }
                if (timeInput.ShowDialog() != DialogResult.Cancel)
                {
                    result = timeInput.SelectedDateTime;
                }
            }
            else
            {
                if (StatusName.Trim().Equals("出复苏室"))
                {
                    ConfirmationOutPacu outPacu = new ConfirmationOutPacu("", ExtendApplicationContext.Current.PatientContextExtend.PatientID,
                                                                          ExtendApplicationContext.Current.PatientContextExtend.VisitID, ExtendApplicationContext.Current.PatientContextExtend.OperID, _ControlDateTime);
                    DialogHostFormPC dialogForm = new DialogHostFormPC("出室信息确认", outPacu.Width, outPacu.Height);
                    dialogForm.Child = outPacu;
                    dialogForm.ShowDialog();
                    if (outPacu.result == DialogResult.OK)
                    {
                        result = outPacu.statusTime;
                    }
                }
                else if (StatusName.Trim().Equals("入手术室"))
                {
                    ConfirmationSureBase sure           = new ConfirmationSureBase(ExtendApplicationContext.Current.PatientInformationExtend, Convert.ToDecimal(ExtendApplicationContext.Current.EventNo));
                    DialogHostFormPC     dialogHostForm = new DialogHostFormPC("入室信息确认", sure.Width, sure.Height);
                    dialogHostForm.Text  = "信息确认";
                    dialogHostForm.Child = sure;
                    dialogHostForm.ShowDialog();
                    if (sure.result == DialogResult.OK)
                    {
                        result = sure.SelectDateTime;
                    }
                }
                else if (StatusName.Trim().Equals("出手术室"))
                {
                    ConfirmationOutRoom timeControl    = new ConfirmationOutRoom(_ControlDateTime);
                    DialogHostFormPC    dialogHostForm = new DialogHostFormPC("出室确认", timeControl.Width, timeControl.Height);
                    dialogHostForm.Child = timeControl;
                    dialogHostForm.ShowDialog();
                    if (timeControl.result == DialogResult.OK)
                    {
                        result = timeControl.statusTime;
                    }
                }
                else if (StatusName.Trim().Equals("入复苏室"))
                {
                    ConfirmationInPacu inPacu = new ConfirmationInPacu(ExtendApplicationContext.Current.PatientContextExtend.PatientID,
                                                                       ExtendApplicationContext.Current.PatientContextExtend.VisitID, ExtendApplicationContext.Current.PatientContextExtend.OperID, false);
                    DialogHostFormPC dialogHostForm = new DialogHostFormPC("入室信息确认", inPacu.Width, inPacu.Height);
                    dialogHostForm.Child = inPacu;
                    dialogHostForm.ShowDialog();
                    if (inPacu.result == DialogResult.OK)
                    {
                        result = inPacu.SelectDateTime;
                    }
                }
                //else if (StatusName.Equals("麻醉开始") || StatusName.Equals("手术开始") || StatusName.Equals("出手术室"))
                //{
                //   ConfirmationTimeControl timeControl = new ConfirmationTimeControl(StatusName, _ControlDateTime);
                //    DialogHostFormPC dialogHostForm = new DialogHostFormPC(StatusName, timeControl.Width, timeControl.Height);
                //    dialogHostForm.Child = timeControl;
                //    dialogHostForm.ShowDialog();
                //    if (timeControl.result == DialogResult.OK)
                //    {
                //        result = timeControl.statusTime;
                //    }
                //}
                else
                {
                    TimeInPutFrmPC timeInput = new TimeInPutFrmPC();
                    timeInput.Text = this.StatusName + "时间";
                    if (this._ControlDateTime != null && this._ControlDateTime != DateTime.MinValue &&
                        this._ControlDateTime != DateTime.MaxValue)
                    {
                        timeInput.SelectedDateTime = this._ControlDateTime;
                    }
                    if (timeInput.ShowDialog() != DialogResult.Cancel)
                    {
                        result = timeInput.SelectedDateTime;
                    }
                }
            }

            if (result != null)
            {
                _ControlDateTime = Convert.ToDateTime(result);
                DateTime dt = Convert.ToDateTime(result);
                if (_ServicePatientStatusContrl.OnSinglePatientStatusConrolTimeValidate(this))
                {
                    SetOperationStatusTimeText(dt);
                }
            }
        }
Exemplo n.º 26
0
 /// <summary>
 /// 根据状态判断流程
 /// </summary>
 private void ShowPatientStatus(PatientCard patCard)
 {
     if (ApplicationConfiguration.ApplicationPatterns.Equals("0") && AccessControl.CheckModifyRightForOperator("麻醉记录单"))
     {
         List <MED_OPERATING_ROOM> roomList = comnDictRepository.GetOperatingRoomList("0").Data.Where(p => p.ROOM_NO == ExtendApplicationContext.Current.OperRoomNo && p.DEPT_CODE == ExtendApplicationContext.Current.OperRoom).ToList();
         if (roomList != null && roomList.Count > 0)
         {
             MED_OPERATING_ROOM operRoom = roomList[0];
             if (string.IsNullOrEmpty(patCard.PatCard.OPER_STATUS_CODE.ToString()) || patCard.PatCard.OPER_STATUS_CODE < 5)
             {
                 if (string.IsNullOrEmpty(operRoom.PATIENT_ID))
                 {
                     ConfirmationSureBase sure           = new ConfirmationSureBase(patCard.PatCard, Convert.ToDecimal(ExtendApplicationContext.Current.EventNo));
                     DialogHostFormPC     dialogHostForm = new DialogHostFormPC("入室信息确认", sure.Width, sure.Height);
                     dialogHostForm.Text  = "信息确认";
                     dialogHostForm.Child = sure;
                     dialogHostForm.ShowDialog();
                     //确认患者信息
                 }
                 else
                 {
                     MED_PATIENT_CARD cardRow = patientInfoRepository.GetPatCard(operRoom.PATIENT_ID, (int)operRoom.VISIT_ID, (int)operRoom.OPER_ID).Data;
                     MessageBoxFormPC.Show("该手术间" + operRoom.ROOM_NO + "已存在患者【" + cardRow.NAME + " " + cardRow.INP_NO + "】,请换其他手术间!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
             }
             else if (patCard.PatCard.OPER_STATUS_CODE < 35)
             {
                 if (!string.IsNullOrEmpty(operRoom.PATIENT_ID) && !operRoom.PATIENT_ID.Equals(patCard.PatCard.PATIENT_ID))
                 {
                     MED_PATIENT_CARD cardRow = patientInfoRepository.GetPatCard(operRoom.PATIENT_ID, (int)operRoom.VISIT_ID, (int)operRoom.OPER_ID).Data;
                     MessageBoxFormPC.Show("该手术间" + operRoom.ROOM_NO + "已存在患者【" + cardRow.NAME + " " + cardRow.INP_NO + "】,请换其他手术间!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                     return;
                 }
                 if (patCard.PatCard.OPER_ROOM_NO != ExtendApplicationContext.Current.OperRoomNo)
                 {
                     if (DialogResult.Yes == MessageBoxFormPC.Show("显示非本手术间手术,是否更换手术间?", "提示信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
                     {
                         MED_OPERATION_MASTER operationMaster = operationInfoRepository.GetOperMaster(ExtendApplicationContext.Current.PatientContextExtend.PatientID,
                                                                                                      ExtendApplicationContext.Current.PatientContextExtend.VisitID, ExtendApplicationContext.Current.PatientContextExtend.OperID).Data;
                         if (operationMaster != null)
                         {
                             operationMaster.OPER_ROOM_NO = ExtendApplicationContext.Current.OperRoomNo;
                             operationInfoRepository.SaveOperMaster(operationMaster);
                         }
                         ClearPatientRoom(ExtendApplicationContext.Current.PatientContextExtend.PatientID);
                         ClearPatientMonitor(ExtendApplicationContext.Current.PatientContextExtend.PatientID, "0");
                         List <MED_OPERATING_ROOM> operList = comnDictRepository.GetOperatingRoomList("0").Data;
                         if (operList != null && operList.Count > 0)
                         {
                             foreach (MED_OPERATING_ROOM room in operList)
                             {
                                 if (room.ROOM_NO == ExtendApplicationContext.Current.OperRoomNo)
                                 {
                                     room.PATIENT_ID = patCard.PatCard.PATIENT_ID;
                                     room.VISIT_ID   = patCard.PatCard.VISIT_ID;
                                     room.OPER_ID    = patCard.PatCard.OPER_ID;
                                     comnDictRepository.SaveOperatingRoom(room);
                                     break;
                                 }
                             }
                         }
                         // CommDictService.SaveOperatingRommList(operList);
                         SelectMonitor monitor = new SelectMonitor(patCard.PatCard, 1, ExtendApplicationContext.Current.OperRoomNo.ToString(), false);
                         monitor.Save();
                     }
                     else
                     {
                         //权限改为False  术中只读
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 27
0
 private void dgPACUList_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.RowIndex == -1 || e.ColumnIndex == -1)
     {
         return;
     }
     if (e.Button == MouseButtons.Left && e.Clicks == 1)
     {
         MED_PATIENT_CARD card = dgPACUList.Rows[e.RowIndex].DataBoundItem as MED_PATIENT_CARD;
         ExtendApplicationContext.Current.PatientContextExtend.PatientID = card.PATIENT_ID;
         ExtendApplicationContext.Current.PatientContextExtend.VisitID   = card.VISIT_ID;
         ExtendApplicationContext.Current.PatientContextExtend.OperID    = card.OPER_ID;
         ExtendApplicationContext.Current.PatientInformationExtend       = card;
         EventHandler eventHandle = Events[_patientClick] as EventHandler;
         if (eventHandle != null)
         {
             eventHandle(this, null);
         }
         if (dgPACUList.Columns[e.ColumnIndex].Name.Equals("ColAction") && dgPACUList.Rows[e.RowIndex].Cells["OperStatus"].Value != null)
         {
             for (int i = 0; i < dgPACUList.Rows.Count; i++)
             {
                 if (dgPACUList["ColumnPatientID", i].Value.ToString().Trim() == card.PATIENT_ID && Convert.ToInt32(dgPACUList["ColumnVisitID", i].Value) == card.VISIT_ID && Convert.ToInt32(dgPACUList["ColumnOperID", i].Value) == card.OPER_ID)
                 {
                     this.dgPACUList.Rows[i].Selected = true;
                     this.dgPACUList.CurrentCell      = this.dgPACUList.Rows[i].Cells[0];
                     break;
                 }
                 else
                 {
                     this.dgPACUList.Rows[i].Selected = false;
                 }
             }
             if (card.OPER_STATUS_CODE == (int)OperationStatus.TurnToPACU || (card.OPER_STATUS_CODE > (int)OperationStatus.InPACU && !card.IN_PACU_DATE_TIME.HasValue))//dgPACUList.Rows[e.RowIndex].Cells["OperStatus"].Value.ToString().Contains("40")
             {
                 dgPACUList.Rows[e.RowIndex].Cells["ColAction"].Value = Resources.pacu左表格_入室3;
                 RefreshPatientDataTable(card.PATIENT_ID, card.VISIT_ID, card.OPER_ID);
                 RefreshOperatingRoomList();
                 ConfirmationInPacu inPacu         = new ConfirmationInPacu(card.PATIENT_ID, card.VISIT_ID, card.OPER_ID, false);
                 DialogHostFormPC   dialogHostForm = new DialogHostFormPC("入室信息确认", inPacu.Width, inPacu.Height);
                 dialogHostForm.Child = inPacu;
                 dialogHostForm.ShowDialog();
                 if (inPacu.result == DialogResult.OK)
                 {
                     operationRoomPandect1.RefreshRoom(inPacu.PacuRoom, card.PATIENT_ID, card.VISIT_ID, card.OPER_ID);
                     RefreshPatientDataTable(ExtendApplicationContext.Current.CurrentDateTime, ExtendApplicationContext.Current.CurrentSearchStr);
                 }
                 //DragDropEffects effect = (sender as DataGridView).DoDragDrop(_selectedPatient, DragDropEffects.Move);
                 //if (effect == DragDropEffects.Move)
                 //{
                 //    foreach (DataGridViewRow row in dgPACUList.SelectedRows)
                 //    {
                 //        this.dgPACUList.Rows.Remove(row);
                 //    }
                 //}
             }
             else if (card.OPER_STATUS_CODE > (int)OperationStatus.TurnToPACU && card.IN_PACU_DATE_TIME.HasValue)
             {
                 dgPACUList.Rows[e.RowIndex].Cells["ColAction"].Value = Resources.pacu左表格_出室3;
                 RefreshPatientDataTable(card.PATIENT_ID, card.VISIT_ID, card.OPER_ID);
                 patientSelectClick();
             }
         }
     }
 }