Ejemplo n.º 1
0
        private void SendQCMessage(DataRow patientRow, string docId, InpatientState preState, DateTime inTime)
        {
            if (m_Qcsv == null)
            {
                return;
            }

            try
            {
                int       firstPageNo = Convert.ToInt32(patientRow[colFirstPageNo]);
                Inpatient inpatient   = new Inpatient(firstPageNo);
                inpatient.ReInitializeProperties();
                inpatient.PreState = preState;
                // m_Qcsv.AddRuleRecord(firstPageNo, -1, docId, QCConditionType.PatStateChange, inpatient, inTime);
            }
            catch (Exception err)
            {
                JobLogHelper.WriteLog(new JobExecuteInfoArgs(Parent, "时限", err));
            }
        }
Ejemplo n.º 2
0
        private void DoAfterPatientStateChanged(DataRow sourceRow, DataRow targetRow)
        {
            InpatientState oldState = (InpatientState)Enum.Parse(typeof(InpatientState)
                                                                 , targetRow[colPatientState].ToString());
            InpatientState newState = (InpatientState)Enum.Parse(typeof(InpatientState)
                                                                 , sourceRow[colPatientState].ToString());

            bool             isRollback  = false;
            OrderCeaseReason ceaseReason = OrderCeaseReason.None;
            bool             needHandle  = false; // 标记是否需要处理长期医嘱的状态

            if (oldState == InpatientState.InWard)
            {
                switch (newState)
                {
                case InpatientState.ShiftDept:
                    // 转科
                    isRollback  = false;
                    ceaseReason = OrderCeaseReason.ShiftDept;
                    needHandle  = true;
                    // 发送转科消息
                    break;

                case InpatientState.OutWard:
                    // 出区
                    isRollback  = false;
                    ceaseReason = OrderCeaseReason.LeaveHospital;
                    needHandle  = true;
                    // 发送出院消息
                    break;
                }
            }
            else if (newState == InpatientState.InWard)
            {
                switch (oldState)
                {
                case InpatientState.ShiftDept:
                case InpatientState.InICU:
                case InpatientState.InDeliveryRoom:
                    if ((targetRow[colFinalyWard].ToString() == sourceRow[colFinalyWard].ToString()) &&
                        (targetRow[colFinalyDept].ToString() == sourceRow[colFinalyDept].ToString()))
                    {
                        // 撤销转科
                        isRollback  = true;
                        ceaseReason = OrderCeaseReason.ShiftDept;
                        needHandle  = true;
                    }
                    else
                    {
                        // 如果是转科,则发送转入消息
                    }
                    break;

                case InpatientState.OutWard:
                case InpatientState.CancleBalanced:
                    // 出区召回
                    isRollback  = true;
                    ceaseReason = OrderCeaseReason.LeaveHospital;
                    needHandle  = true;
                    break;
                }
            }
        }
Ejemplo n.º 3
0
        private void DoAfterPatientStateChanged(DataRow sourceRow, DataRow targetRow)
        {
            InpatientState oldState = (InpatientState)Enum.Parse(typeof(InpatientState)
                                                                 , targetRow[colPatientState].ToString());
            InpatientState newState = (InpatientState)Enum.Parse(typeof(InpatientState)
                                                                 , sourceRow[colPatientState].ToString());

            OrderCeaseReason ceaseReason = OrderCeaseReason.None;

            if (oldState == InpatientState.InWard)
            {
                switch (newState)
                {
                case InpatientState.ShiftDept:
                    // 转科
                    ceaseReason = OrderCeaseReason.ShiftDept;
                    // 发送转科消息
                    SendQCMessage(targetRow, targetRow[colBedDoctor].ToString(), oldState
                                  , Convert.ToDateTime(sourceRow[colTimeOfLeaveWard]));
                    break;

                case InpatientState.OutWard:
                    // 出区
                    ceaseReason = OrderCeaseReason.LeaveHospital;
                    // 发送出院消息
                    SendQCMessage(targetRow, targetRow[colBedDoctor].ToString(), oldState
                                  , Convert.ToDateTime(sourceRow[colTimeOfLeaveWard]));
                    break;
                }
            }
            else if (newState == InpatientState.InWard)
            {
                switch (oldState)
                {
                case InpatientState.ShiftDept:
                case InpatientState.InICU:
                case InpatientState.InDeliveryRoom:
                    if ((targetRow[colFinalyWard].ToString() == sourceRow[colFinalyWard].ToString()) &&
                        (targetRow[colFinalyDept].ToString() == sourceRow[colFinalyDept].ToString()))
                    {
                        // 撤销转科
                        ceaseReason = OrderCeaseReason.ShiftDept;
                    }
                    else
                    {
                        // 如果是转科,则发送转入消息
                        SendQCMessage(targetRow, targetRow[colBedDoctor].ToString(), oldState, DateTime.Now);
                    }
                    break;

                case InpatientState.OutWard:
                case InpatientState.CancleBalanced:
                    // 出区召回
                    ceaseReason = OrderCeaseReason.LeaveHospital;
                    break;
                }
            }
            else if (newState == InpatientState.Balanced)
            {
                if (oldState != InpatientState.Balanced) // 发送出院消息
                {
                    SendQCMessage(targetRow, targetRow[colBedDoctor].ToString(), InpatientState.OutWard, DateTime.Parse(sourceRow["OutWardDate"].ToString()));
                }
            }
        }