//一键发送
        private void toolStripButton7_Click(object sender, EventArgs e)
        {
            //[20100514.1.04]
            if (IsOper == false && this.tscbType.SelectedIndex == 5)
            {
                MessageBox.Show("手术药品不能在此发送!");
                return;
            }
            //[20100514.1.04]
            if (IsOper == true && this.tscbType.SelectedIndex != 5)
            {
                MessageBox.Show("除了手术药品,其他类型药品不能在此发送!");
                return;
            }

            if (MessageBox.Show("是否执行一键发送[" + this.tscbType.Text + "]到药房?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                HIS.ZY_BLL.DurgMessage.OP_DurgMessage.OneKeySendDrug(this.tscbType.SelectedIndex, _currentDept.DeptID.ToString(), _currentUser.EmployeeID.ToString(), _currentUser.Name, dsMessageData.dtDrugMessage, IsOper);
                MessageBox.Show("发送成功,请重新刷新列表!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
                MessagePromptManager.Messenger senders  = new MessagePromptManager.Messenger(_currentUser.UserID, _currentDept.DeptID, "");
                MessagePromptManager.Messenger receiver = new MessagePromptManager.Messenger();
                MessagePromptManager.Messages  message  = new MessagePromptManager.Messages("002", "【" + _currentDept.Name + "】统领消息", "【" + _currentDept.Name + "】已经发来了药品统领消息,请及时查看!");
                senders.SendMessage(receiver, message);
            }
        }
Beispiel #2
0
        // 入院
        private void ToolSB_Reg_Click(object sender, EventArgs e)
        {
            try
            {
                if (!CheckPatInfo())
                {
                    return;
                }

                //20091025 临床不需要床号
                #region
                //for (int i = 0; i < zypatlist.Count; i++)
                //{
                //    //update 同名病人提示判断更改到输入病人控件离开焦点
                //    //if (this.tbpatName.Text.Trim() == zypatlist[i].PatientInfo.PatName)
                //    //{
                //    //    if (MessageBox.Show("已有同名的病人存在,该病人是否继续保存入院?", "询问", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.OK)
                //    //    {
                //    //        break;
                //    //    }
                //    //    else
                //    //    {
                //    //        return;
                //    //    }
                //    //}

                //    if (this.tbBedNo.Text.Trim() == zypatlist[i].BedCode)
                //    {
                //        if (MessageBox.Show("该床已有病人存在,是否继续保存入院?", "询问", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.OK)
                //        {
                //            break;
                //        }
                //        else
                //        {
                //            return;
                //        }
                //    }
                //}
                #endregion
                //入院后再产生住院号

                BindZYPatList();
                bool b = Controller.RegPat();

                if (b == true)
                {
                    MessageBox.Show("入院成功!", "提示");

                    MessagePromptManager.Messenger senders  = new MessagePromptManager.Messenger(_currentUser.UserID, _currentDept.DeptID, "");
                    MessagePromptManager.Messenger receiver = new MessagePromptManager.Messenger(-1, Convert.ToInt64(_zyPatlist.CureDeptCode), "");
                    MessagePromptManager.Messages  message  = new MessagePromptManager.Messages("003", "病人入院消息", "已经新入院了一个病人,姓名:" + _zyPatlist.patientInfo.PatName + ",住院号为:" + _zyPatlist.CureNo + ",请及时分配床位!");
                    senders.SendMessage(receiver, message);
                    this.ToolControls_Enabled(RegType.修改);
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message, "提示");
            }
        }
 //再次发送
 private void toolStripButton6_Click(object sender, EventArgs e)
 {
     if (this.dataGridViewEx1.CurrentCell != null)
     {
         //未发药
         if (Convert.ToBoolean(dsMessageData.dtMessageMaster.Rows[this.dataGridViewEx1.CurrentCell.RowIndex]["drug_flag"]))
         {
             HIS.ZY_BLL.DurgMessage.OP_DurgMessage.AgainSendMessage(MasterID);
             MessageBox.Show("再次发送成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             MessagePromptManager.Messenger senders  = new MessagePromptManager.Messenger(_currentUser.UserID, _currentDept.DeptID, "");
             MessagePromptManager.Messenger receiver = new MessagePromptManager.Messenger();
             MessagePromptManager.Messages  message  = new MessagePromptManager.Messages("002", "【" + _currentDept.Name + "】统领消息", "【" + _currentDept.Name + "】已经发来了药品统领消息,请及时查看!");
             senders.SendMessage(receiver, message);
         }
         else
         {
             MessageBox.Show("已发药的统领单不能发送!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
 }
Beispiel #4
0
        private void btSendDrug_Click(object sender, EventArgs e)
        {
            if (dtDrugMessage.Rows.Count > 0 && dtDrugMessage.Select("XD=True").Length > 0)
            {
                string message1 = null;
                HIS.ZY_BLL.DurgMessage.OP_DurgMessage.SaveMessage(0, dtDrugMessage.Select("XD=True"), data, out message1);

                MessageBox.Show("请药成功!\n" + message1, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

                //MessageBox.Show("发送成功,请重新刷新列表!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
                MessagePromptManager.Messenger senders  = new MessagePromptManager.Messenger(_currentUser.UserID, _currentDept.DeptID, "");
                MessagePromptManager.Messenger receiver = new MessagePromptManager.Messenger();
                MessagePromptManager.Messages  message  = new MessagePromptManager.Messages("002", "【" + _currentDept.Name + "】统领消息", "【" + _currentDept.Name + "】已经发来了药品统领消息,请及时查看!");
                senders.SendMessage(receiver, message);

                btbrush_Click(null, null);
            }
            else
            {
                MessageBox.Show("没有可请领的药品!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);;
            }
        }
Beispiel #5
0
        private void btn_Out_Click(object sender, EventArgs e)
        {
            string strconfirm;//确认出区信息

            errorMsg  = "";
            unsettled = "";

            if (patlistid == 0)//是否选择患者
            {
                MessageBox.Show(this, "未选择患者", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            currentpat = new Patient(patlistid);
            if (!op_patientout.MayLeave(patlistid, out errorMsg, out unsettled))//是否有未停医嘱,未记账费用
            {
                string strtmp = tabPageControl1.SelectedTab.Text;
                MessageBox.Show(errorMsg + strtmp + unsettled, "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            string UnProvideItems = op_patientout.UnProvide(patlistid);  //判断是否有未发药品

            if (UnProvideItems != "")
            {
                MessageBox.Show("该病人“" + currentpat.patname + "”【有未发药品,请及时统领以下药品】:" + UnProvideItems, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

                if (OP_Config.GetValue("001") == 1)    //001表示未发药是否能够定义出院,返回0表示能,返回1表示不能
                {
                    return;
                }
            }

            string UnWithDrawalItems = op_patientout.UnWithDrawal(patlistid);//判断是否有未退药品

            if (UnWithDrawalItems != "")
            {
                MessageBox.Show("该病人“" + currentpat.patname + "”有未退药品!未退药品如下:" + UnWithDrawalItems, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                if (OP_Config.GetValue("002") == 1)   //001表示未退药是否能够定义出院,返回0表示能,返回1表示不能
                {
                    return;
                }
            }

            //定义出院要判断患者是否在床,以及是否处于出院结算状态
            if (tabPageControl1.SelectedTab == tab_Leave)
            {
                errorMsg = "";
                if (op_patientout.isOnbed(patlistid)) //病人是否在床
                {
                    errorMsg = "对不起,病人“" + currentpat.patname + "”还未开出院医嘱!";
                }
                else if (op_patientout.isOnbalance(patlistid))//结算中,已出院
                {
                    errorMsg = "对不起,病人“" + currentpat.patname + "”已经定义出院!";
                }
                if (errorMsg != "")
                {
                    MessageBox.Show(errorMsg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                strconfirm = "确认“" + currentpat.patname + "”定义出院吗?";
                if (MessageBox.Show(this, strconfirm, "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.No)
                {
                    return;
                }
                DataTable dtPresorder = op_patientout.getDtPresorder(patlistid); //出院操作
                if (dtPresorder.Rows.Count != 0)                                 //未统领药品进统领单
                {
                    List <string[]> depts = new List <string[]>();
                    for (int n = 0; n < dtPresorder.Rows.Count; n++)
                    {
                        if (depts.Exists(x => x[0] == dtPresorder.Rows[n]["presdeptcode"].ToString().Trim() && x[1] == dtPresorder.Rows[n]["execdeptcode"].ToString().Trim()) == false)
                        {
                            depts.Add(new string[] { dtPresorder.Rows[n]["presdeptcode"].ToString().Trim(), dtPresorder.Rows[n]["execdeptcode"].ToString().Trim() });
                        }
                    }

                    for (int m = 0; m < depts.Count; m++)
                    {
                        OP_SendDrugMessage op_sendDrugMessage = new OP_SendDrugMessage();
                        DateTime           sendtime           = XcDate.ServerDateTime;
                        int masterid = op_sendDrugMessage.InsertDrugMaster(sendtime, currentUser.UserID, currentUser.Name, depts[m][0], depts[m][1]);
                        for (int i = 0; i < dtPresorder.Rows.Count; i++)
                        {
                            if (dtPresorder.Rows[i]["presdeptcode"].ToString().Trim() == depts[m][0] && dtPresorder.Rows[i]["execdeptcode"].ToString().Trim() == depts[m][1])
                            {
                                op_sendDrugMessage.InsertDrugMessageRecord(Convert.ToInt32(dtPresorder.Rows[i]["presorderid"]), masterid);
                            }
                        }
                    }
                }
                DataTable dtDBPresorder = op_patientout.getDrawBackDtPresorder(patlistid);
                if (dtDBPresorder.Rows.Count != 0)
                {
                    List <string[]> depts = new List <string[]>();
                    for (int n = 0; n < dtDBPresorder.Rows.Count; n++)
                    {
                        if (depts.Exists(x => x[0] == dtDBPresorder.Rows[n]["presdeptcode"].ToString().Trim() && x[1] == dtDBPresorder.Rows[n]["execdeptcode"].ToString().Trim()) == false)
                        {
                            depts.Add(new string[] { dtDBPresorder.Rows[n]["presdeptcode"].ToString().Trim(), dtDBPresorder.Rows[n]["execdeptcode"].ToString().Trim() });
                        }
                    }
                    for (int m = 0; m < depts.Count; m++)
                    {
                        OP_SendDrugMessage op_sendDrugMessage = new OP_SendDrugMessage();//未退药品进统领单
                        DateTime           sendtime           = XcDate.ServerDateTime;
                        int masterid = op_sendDrugMessage.InsertDBDrugMaster(sendtime, currentUser.UserID, currentUser.Name, depts[m][0], depts[m][1]);
                        for (int i = 0; i < dtDBPresorder.Rows.Count; i++)
                        {
                            if (dtDBPresorder.Rows[i]["presdeptcode"].ToString().Trim() == depts[m][0] && dtDBPresorder.Rows[i]["execdeptcode"].ToString().Trim() == depts[m][1])
                            {
                                op_sendDrugMessage.InsertDBDrugMessageRecord(Convert.ToInt32(dtDBPresorder.Rows[i]["presorderid"]), masterid);
                            }
                        }
                    }
                }
                op_patientout.ApplyLeave(Convert.ToInt32(patlistid), Convert.ToInt32(_currentUser.UserID), out errorMsg);//出区操作
            }
            //病人转科操作
            else if (tabPageControl1.SelectedTab == tab_Transfer)
            {
                strconfirm = "确认“" + currentpat.patname + "”转到“" + BaseData.GetDeptName(getdept) + "”吗?";
                //是否确认转科
                DateTime ServerDate     = XcDate.ServerDateTime.AddDays(1);
                bool     IsCanTransDept = op_patientout.TorrowDrug(patlistid, ServerDate);
                if (IsCanTransDept == true)
                {
                    if (MessageBox.Show(this, strconfirm, "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.No)
                    {
                        return;
                    }
                    //DataTable dtPresorder = op_patientout.getDtPresorder(patlistid);//出院操作
                    //if (dtPresorder.Rows.Count != 0)//未统领药品进统领单
                    //{
                    //    OP_SendDrugMessage op_sendDrugMessage = new OP_SendDrugMessage();
                    //    DateTime sendtime = XcDate.ServerDateTime;
                    //    int masterid = op_sendDrugMessage.InsertDrugMaster(sendtime, currentUser.UserID, currentUser.Name);
                    //    for (int i = 0; i < dtPresorder.Rows.Count; i++)
                    //    {
                    //        op_sendDrugMessage.InsertDrugMessageRecord(Convert.ToInt32(dtPresorder.Rows[i]["presorderid"]), masterid);
                    //    }
                    //}
                    //DataTable dtDBPresorder = op_patientout.getDrawBackDtPresorder(patlistid);
                    //if (dtDBPresorder.Rows.Count != 0)
                    //{
                    //    OP_SendDrugMessage op_sendDrugMessage = new OP_SendDrugMessage();//未退药品进统领单
                    //    DateTime sendtime = XcDate.ServerDateTime;
                    //    int masterid = op_sendDrugMessage.InsertDBDrugMaster(sendtime, currentUser.UserID, currentUser.Name);
                    //    for (int i = 0; i < dtDBPresorder.Rows.Count; i++)
                    //    {
                    //        op_sendDrugMessage.InsertDBDrugMessageRecord(Convert.ToInt32(dtDBPresorder.Rows[i]["presorderid"]), masterid);
                    //    }
                    //}
                }
                op_patientout.ApplyTransfer(patlistid, Convert.ToInt32(_currentUser.UserID), transdeptid, getdept, out errorMsg);

                if (errorMsg != "")
                {
                    MessageBox.Show(errorMsg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                MessageBox.Show(tabPageControl1.SelectedTab.Text + "操作成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                MessagePromptManager.Messenger senders  = new MessagePromptManager.Messenger(_currentUser.UserID, _currentDept.DeptID, "");
                MessagePromptManager.Messenger receiver = new MessagePromptManager.Messenger(-1, -1, "");
                MessagePromptManager.Messages  message  = new MessagePromptManager.Messages("005", "病人定义出区", "已经成功办理了出区病人,姓名:" + currentpat.patname + ",住院号为:" + currentpat.cureno + ",请及时处理!");
                senders.SendMessage(receiver, message);
            }
            else
            {
                MessageBox.Show("该病人有明日药品费用,请将该部分费用冲正掉后再进行操作!");
            }

            //刷新界面
            this.frmload();

            #region 可以不停医嘱转科

            /*
             * errorMsg = "";
             *
             * //判断是否选中患者
             * if (patlistid == 0)
             * {
             *  MessageBox.Show("您还未选择病人", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             *  return;
             * }
             *
             * //是否有未转抄医嘱
             * if (op_patientout.hasUntranscribeOrder(patlistid))
             * {
             *  errorMsg = "对不起,该病人有未转抄的医嘱,不允许转科!";
             *  MessageBox.Show(errorMsg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
             *  return;
             * }
             *
             * //是否有未执行临时医嘱
             * if(op_patientout.hasUndoTempOrder(patlistid))
             * {
             *  errorMsg = "对不起,该病人有未执行的临时医嘱,不允许转科!";
             *  MessageBox.Show(errorMsg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
             *  return;
             * }
             *
             #region 是否执行长期医嘱
             * //执行长期医嘱
             * if (MessageBox.Show("是否运行执行长期医嘱?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
             * {
             *  if (op_patientout.LongOrderStatus(patlistid) == 12 || op_patientout.LongOrderStatus(patlistid) == 112)
             *  {
             *      errorMsg = "对不起,该病人有未执行的长期医嘱,不允许转科!";
             *      MessageBox.Show(errorMsg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
             *      return;
             *  }
             *  else
             *  {
             *      //今天无未执行的长嘱,进入下一个流程,无需代码段
             *  }
             * }
             * //不执行长期医嘱
             * else
             * {
             *  //不执行长期医嘱,直接进入下一个流程,无需代码段
             * }
             *
             #endregion
             *
             * //是否有未停长期账单
             * if (op_patientout.hasUnstopLongTab(patlistid))
             * {
             *  errorMsg = "对不起,该病人有未停止的长期账单,不允许转科!";
             *  MessageBox.Show(errorMsg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
             *  return;
             * }
             * //是否确定转科
             * if (MessageBox.Show("确认“" + patname + "”转到“" + getdept + "”吗?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.No)
             * {
             *  return;
             * }
             *
             * op_patientout.ApplyTransfer(patlistid, Convert.ToInt32(_currentUser.UserID), transdeptid, getdept, out errorMsg);
             *
             * if (errorMsg != "")
             * {
             *  MessageBox.Show(errorMsg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
             *  return;
             * }
             *
             * MessageBox.Show("转科操作成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             *
             * this.frmload();
             */
            #endregion
        }