コード例 #1
0
        /// <summary>
        /// 将数据信息加载到DataGridView中
        /// </summary>
        /// <param name="row"></param>
        /// <param name="qcWorkloadStatInfo"></param>
        private void SetRowData(DataGridViewRow row, EMRDBLib.PatVisitInfo patVisitLog, EMRDBLib.PatDoctorInfo patDoctorInfo)
        {
            if (row == null || patVisitLog == null)
            {
                return;
            }
            if (row.DataGridView == null)
            {
                return;
            }

            row.Cells[this.colDeptName.Index].Value      = patVisitLog.DEPT_NAME;
            row.Cells[this.colPatientID.Index].Value     = patVisitLog.PATIENT_ID;
            row.Cells[this.colPatientName.Index].Value   = patVisitLog.PATIENT_NAME;
            row.Cells[this.colPatSex.Index].Value        = patVisitLog.PATIENT_SEX;
            row.Cells[this.colVisitID.Index].Value       = patVisitLog.VISIT_ID;
            row.Cells[this.colVisitTime.Index].Value     = patVisitLog.VISIT_TIME.ToString("yyyy-MM-dd");
            row.Cells[this.colChargeType.Index].Value    = patVisitLog.CHARGE_TYPE;
            row.Cells[this.colAge.Index].Value           = GlobalMethods.SysTime.GetAgeText(patVisitLog.BIRTH_TIME, DateTime.Now);
            row.Cells[this.colDischargeTime.Index].Value = patVisitLog.DISCHARGE_TIME.ToString("yyyy-MM-dd");
            row.Cells[this.colDiagnosis.Index].Value     = patVisitLog.DIAGNOSIS;
            TimeSpan timeSpan = patVisitLog.DISCHARGE_TIME - patVisitLog.VISIT_TIME;

            row.Cells[this.colCost.Index].Value       = patVisitLog.TOTAL_COSTS;
            row.Cells[this.colRequestDoc.Index].Value = patVisitLog.INCHARGE_DOCTOR;
            if (patDoctorInfo != null)
            {
                row.Cells[this.colRequestDoc.Index].Value = patDoctorInfo.RequestDoctorName;
                //开启三级医生审核的显示上级 、主任

                row.Cells[this.colParentDoc.Index].Value = patDoctorInfo.ParentDoctorName;
                row.Cells[this.colSuperDoc.Index].Value  = patDoctorInfo.SuperDoctorName;
            }
            row.Tag = patVisitLog;
        }
コード例 #2
0
 /// <summary>
 /// 将数据信息加载到DataGridView中
 /// </summary>
 /// <param name="row"></param>
 /// <param name="qcWorkloadStatInfo"></param>
 private void SetRowData(DataGridViewRow row, EMRDBLib.PatVisitInfo patVisitLog)
 {
     if (row == null || patVisitLog == null)
     {
         return;
     }
     if (row.DataGridView == null)
     {
         return;
     }
     row.Cells[this.colPatientID.Index].Value = patVisitLog.PATIENT_ID;
     row.Cells[this.colVisitID.Index].Value   = patVisitLog.VISIT_ID;
     row.Cells[this.colDeptName.Index].Value  = patVisitLog.DEPT_NAME;
     if (patVisitLog.BIRTH_TIME != patVisitLog.DefaultTime)
     {
         row.Cells[this.colAge.Index].Value = GlobalMethods.SysTime.GetAgeText(patVisitLog.BIRTH_TIME);
     }
     row.Cells[this.colSex.Index].Value         = patVisitLog.PATIENT_SEX;
     row.Cells[this.colPatientName.Index].Value = patVisitLog.PATIENT_NAME;
     row.Cells[this.colBedNO.Index].Value       = patVisitLog.BED_CODE;
     row.Cells[this.colPatStatus.Index].Value   = patVisitLog.PATIENT_CONDITION;
     row.Cells[this.colSeriousDate.Index].Value = patVisitLog.LogDateTime.ToString("yyyy-MM-dd HH:mm");
     row.Cells[this.colDiagnosis.Index].Value   = patVisitLog.DIAGNOSIS;
     row.Cells[this.colVisitTime.Index].Value   = patVisitLog.VISIT_TIME.ToString("yyyy-MM-dd");
     row.Cells[this.colChargeType.Index].Value  = patVisitLog.CHARGE_TYPE;
     row.Tag = patVisitLog;
 }
コード例 #3
0
        private void btnQuery_Click(object sender, EventArgs e)
        {
            DeptInfo deptInfo   = this.cboDeptName.SelectedItem as DeptInfo;
            string   szDeptCode = null;

            if (deptInfo != null)
            {
                szDeptCode = deptInfo.DEPT_CODE;
            }
            if (string.IsNullOrEmpty(this.cboDeptName.Text))
            {
                szDeptCode = null;
            }

            GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);
            this.ShowStatusMessage("正在查询数据,请稍候...");
            this.dataGridView1.Rows.Clear();
            List <EMRDBLib.PatVisitInfo> lstPatVisitLog = null;
            short shRet = InpVisitAccess.Instance.GetSeriousPatList(szDeptCode, DateTime.Parse(dtpStatTimeBegin.Value.ToString("yyyy-M-d 00:00:00")),
                                                                    DateTime.Parse(dtpStatTimeEnd.Value.ToString("yyyy-M-d 23:59:59")), ref lstPatVisitLog);

            if (shRet != SystemData.ReturnValue.OK &&
                shRet != SystemData.ReturnValue.RES_NO_FOUND)
            {
                GlobalMethods.UI.SetCursor(this, Cursors.Default);
                MessageBoxEx.Show("查询数据失败!");
                return;
            }
            if (lstPatVisitLog == null || lstPatVisitLog.Count <= 0)
            {
                GlobalMethods.UI.SetCursor(this, Cursors.Default);
                MessageBoxEx.Show("没有符合条件的数据!", MessageBoxIcon.Information);
                return;
            }
            string pre       = null;
            int    nRowIndex = 0;

            for (int index = 0; index < lstPatVisitLog.Count; index++)
            {
                EMRDBLib.PatVisitInfo patVisitLog = lstPatVisitLog[index];
                if (pre != string.Format("{0}_{1}", patVisitLog.PATIENT_ID, patVisitLog.VISIT_ID))
                {
                    nRowIndex = this.dataGridView1.Rows.Add();
                    pre       = string.Format("{0}_{1}", patVisitLog.PATIENT_ID, patVisitLog.VISIT_ID);
                }
                DataGridViewRow row = this.dataGridView1.Rows[nRowIndex];
                this.SetRowData(row, patVisitLog);
            }
            this.ShowStatusMessage(string.Format("查询结果总数:{0}条", this.dataGridView1.Rows.Count.ToString()));
            GlobalMethods.UI.SetCursor(this, Cursors.Default);
        }
コード例 #4
0
        /// <summary>
        /// 三级医生信息从历史表里读取
        /// </summary>
        /// <param name="lstPatDoctorInfos"></param>
        /// <returns></returns>
        private void UpdateInchargeDoctor(List <EMRDBLib.PatDoctorInfo> lstPatDoctorInfos)
        {
            //有选择经治医生,直接绑定
            UserInfo userInfo = this.cobRequestDoc.SelectedItem as  UserInfo;

            if (userInfo != null)
            {
                foreach (DataGridViewRow row in this.dataGridView1.Rows)
                {
                    row.Cells[this.colDoctor.Index].Value = userInfo.USER_NAME;
                }
            }

            //一次查询一批患者的三级患者信息
            //获取三级医生信息
            if (lstPatDoctorInfos == null)
            {
                return;
            }
            short shRet = PatVisitAccess.Instance.GetPatSanjiDoctors(ref lstPatDoctorInfos);

            if (shRet != EMRDBLib.SystemData.ReturnValue.OK)
            {
                return;
            }
            foreach (DataGridViewRow row in this.dataGridView1.Rows)
            {
                EMRDBLib.PatVisitInfo patVistiLog = row.Tag as EMRDBLib.PatVisitInfo;
                if (patVistiLog == null)
                {
                    continue;
                }
                EMRDBLib.PatDoctorInfo patDoctorInfo = lstPatDoctorInfos.Find(delegate(EMRDBLib.PatDoctorInfo p)
                {
                    if (p.PatientID == patVistiLog.PATIENT_ID && p.VisitID == patVistiLog.VISIT_ID)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                });
                if (patDoctorInfo != null)
                {
                    row.Cells[this.colDoctor.Index].Value = patDoctorInfo.RequestDoctorName;
                }
            }
        }
コード例 #5
0
        private void virtualTree1_NodeMouseClick(object sender, VirtualTreeEventArgs e)
        {
            this.m_SelectedNode = e.Node;
            EMRDBLib.PatVisitInfo patVisitLog = e.Node.Tag as EMRDBLib.PatVisitInfo;
            if (patVisitLog == null)
            {
                return;
            }

            if (SystemParam.Instance.PatVisitInfo != patVisitLog)
            {
                SystemParam.Instance.PatVisitInfo = patVisitLog;
                this.MainForm.OnPatientInfoChanged(EventArgs.Empty);
            }
        }
コード例 #6
0
 /// <summary>
 /// 判定指定的病人就诊信息是否是同一次就诊
 /// </summary>
 /// <param name="patVisit">待判定病人就诊信息</param>
 /// <returns>是否是同一次就诊</returns>
 public bool IsPatVisitSame(PatVisitInfo patVisit)
 {
     if (patVisit == null)
     {
         return(false);
     }
     if (this.PATIENT_ID != patVisit.PATIENT_ID || this.VISIT_ID != patVisit.VISIT_ID)
     {
         return(false);
     }
     if (this.VISIT_TIME != patVisit.VISIT_TIME || this.VISIT_TYPE != patVisit.VISIT_TYPE)
     {
         return(false);
     }
     return(true);
 }
コード例 #7
0
        /// <summary>
        /// 绑定患者病情
        /// </summary>
        /// <param name="lstPatVisitLog"></param>
        private void BindPatientCondition(List <PatVisitInfo> lstPatVisitLog)
        {
            if (!string.IsNullOrEmpty(this.cboPatientCondition.Text))
            {
                string szCondition = this.cboPatientCondition.Text;
                foreach (DataGridViewRow row in this.dataGridView1.Rows)
                {
                    row.Cells[this.colPatientCondition.Index].Value = szCondition;
                }
                return;
            }
            //查询病情
            short shRet = PatVisitAccess.Instance.GetOutPatientCondition(lstPatVisitLog);

            if (shRet != SystemData.ReturnValue.OK
                )
            {
                return;
            }
            if (lstPatVisitLog == null || lstPatVisitLog.Count == 0)
            {
                return;
            }
            foreach (DataGridViewRow row in this.dataGridView1.Rows)
            {
                EMRDBLib.PatVisitInfo patVistiLog = row.Tag as EMRDBLib.PatVisitInfo;
                if (patVistiLog == null)
                {
                    continue;
                }
                EMRDBLib.PatVisitInfo patVisitLog2 = lstPatVisitLog.Find(delegate(EMRDBLib.PatVisitInfo p)
                {
                    if (p.PATIENT_ID == patVistiLog.PATIENT_ID && p.VISIT_ID == patVistiLog.VISIT_ID)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                });
                if (patVisitLog2 != null)
                {
                    row.Cells[this.colPatientCondition.Index].Value = patVisitLog2.PATIENT_CONDITION;
                }
            }
        }
コード例 #8
0
        private PatientInfo GetPatientInfo(string patientId, string visitId)
        {
            EMRDBLib.PatVisitInfo patVisitInfo = null;
            PatVisitAccess.Instance.GetPatVisitInfo(patientId, visitId, ref patVisitInfo);
            if (patVisitInfo == null)
            {
                return(null);
            }

            PatientInfo patInfo = new PatientInfo();

            patInfo.ID        = patientId;
            patInfo.Name      = patVisitInfo.PATIENT_NAME;
            patInfo.Gender    = patVisitInfo.PATIENT_SEX;
            patInfo.BirthTime = patVisitInfo.BIRTH_TIME;
            return(patInfo);
        }
コード例 #9
0
ファイル: SearchDeathForm.cs プロジェクト: zuifengke/MedQCSys
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }
            DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex];

            EMRDBLib.PatVisitInfo patVisit = row.Tag as EMRDBLib.PatVisitInfo;

            if (patVisit == null)
            {
                return;
            }

            this.MainForm.OpenDocument(string.Empty, patVisit.PATIENT_ID, patVisit.VISIT_ID);
        }
コード例 #10
0
        /// <summary>
        /// 获取当前患者本次就诊最近一次的病历阅读日志信息
        /// </summary>
        private void GetQCActionLogInfo()
        {
            if (SystemParam.Instance.PatVisitLogList == null)
            {
                return;
            }

            List <EMRDBLib.PatVisitInfo> lstPatVisitLog = SystemParam.Instance.PatVisitLogList;
            short shRet        = SystemData.ReturnValue.OK;
            int   nLogType     = 1;
            int   nOperateType = 0;

            for (int index = 0; index < lstPatVisitLog.Count; index++)
            {
                EMRDBLib.PatVisitInfo patVisitLog = lstPatVisitLog[index];
                if (patVisitLog == null)
                {
                    continue;
                }

                List <EMRDBLib.MedicalQcLog> lstQCActionLog = null;
                shRet = MedicalQcLogAccess.Instance.GetQCLogInfo(patVisitLog.PATIENT_ID, patVisitLog.VISIT_ID, nLogType, nOperateType, ref lstQCActionLog);
                if (shRet != SystemData.ReturnValue.OK)
                {
                    continue;
                }

                if (lstQCActionLog == null || lstQCActionLog.Count <= 0)
                {
                    continue;
                }

                for (int nIndex = 0; nIndex < lstQCActionLog.Count; nIndex++)
                {
                    if (string.IsNullOrEmpty(lstQCActionLog[nIndex].DOC_SETID))
                    {
                        continue;
                    }

                    if (!this.m_htQCActionLog.ContainsKey(lstQCActionLog[nIndex].DOC_SETID))
                    {
                        this.m_htQCActionLog.Add(lstQCActionLog[nIndex].DOC_SETID, lstQCActionLog[nIndex].CHECK_DATE);
                    }
                }
            }
        }
コード例 #11
0
        public PatInfoCard AddPatInfo(EMRDBLib.PatVisitInfo patVisitLog)
        {
            PatInfoCard patInfoCard = new PatInfoCard();

            patInfoCard.Dock = DockStyle.Top;
            // patInfoCard.MinimumSize = new Size(500, 28);
            patInfoCard.PatVisitLog = patVisitLog;
            patInfoCard.MouseUp    += new MouseEventHandler(this.patInfoCard_MouseUp);
            patInfoCard.Tag         = patVisitLog;
            this.Controls.Add(patInfoCard);
            if (this.PatInfoCards == null)
            {
                this.PatInfoCards = new List <PatInfoCard>();
            }
            this.PatInfoCards.Add(patInfoCard);
            return(patInfoCard);
        }
コード例 #12
0
        private VisitInfo GetVisitInfo(string patientId, string visitId)
        {
            EMRDBLib.PatVisitInfo patVisitInfo = null;
            PatVisitAccess.Instance.GetPatVisitInfo(patientId, visitId, ref patVisitInfo);
            if (patVisitInfo == null)
            {
                return(null);
            }
            VisitInfo clientVisitInfo = new VisitInfo();

            clientVisitInfo.ID       = visitId;
            clientVisitInfo.InpID    = patVisitInfo.INP_NO;
            clientVisitInfo.Time     = patVisitInfo.VISIT_TIME;
            clientVisitInfo.WardCode = patVisitInfo.WARD_CODE;
            clientVisitInfo.WardName = patVisitInfo.WardName;
            clientVisitInfo.BedCode  = patVisitInfo.BED_CODE;
            clientVisitInfo.Type     = VisitType.IP;
            return(clientVisitInfo);
        }
コード例 #13
0
        /// <summary>
        /// 双击打开病历,此统计报表已有双击时间,因此添加隐藏列保存DocSetID
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }
            DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex];

            EMRDBLib.PatVisitInfo patVisitLog = row.Tag as EMRDBLib.PatVisitInfo;
            if (patVisitLog == null)
            {
                return;
            }
            string szDocSetID = this.dataGridView1.Rows[e.RowIndex].Cells[this.colDocSetID.Index].Value != null
                ? this.dataGridView1.Rows[e.RowIndex].Cells[this.colDocSetID.Index].Value.ToString()
                : string.Empty;

            this.MainForm.OpenDocument(szDocSetID, patVisitLog.PATIENT_ID, patVisitLog.VISIT_ID);
        }
コード例 #14
0
        ///<summary>
        /// 记录质控者阅读病历日志信息
        /// </summary>
        /// <param name="lstDocInfo">病历文档信息列表</param>
        /// <param name="dtCheckTime">检查时间</param>
        /// <param name="node">当前节点</param>
        private void SaveReadLogInfo(MedDocInfo docInfo, DateTime dtCheckTime, VirtualNode node)
        {
            if (string.IsNullOrEmpty(docInfo.DOC_SETID))
            {
                return;
            }
            EMRDBLib.PatVisitInfo patVisitLog = node.Tag as EMRDBLib.PatVisitInfo;
            if (patVisitLog == null)
            {
                return;
            }

            SystemParam.Instance.PatVisitInfo = patVisitLog;

            EMRDBLib.MedicalQcLog qcActionLog = new EMRDBLib.MedicalQcLog();
            qcActionLog.PATIENT_ID    = SystemParam.Instance.PatVisitInfo.PATIENT_ID;
            qcActionLog.VISIT_ID      = SystemParam.Instance.PatVisitInfo.VISIT_ID;
            qcActionLog.DOC_SETID     = docInfo.DOC_SETID;
            qcActionLog.CHECKED_BY    = SystemParam.Instance.UserInfo.USER_NAME;
            qcActionLog.CHECKED_ID    = SystemParam.Instance.UserInfo.USER_ID;
            qcActionLog.DEPT_CODE     = SystemParam.Instance.UserInfo.DEPT_CODE;
            qcActionLog.DEPT_NAME     = SystemParam.Instance.UserInfo.DEPT_NAME;
            qcActionLog.CHECK_TYPE    = 0;
            qcActionLog.CHECK_DATE    = dtCheckTime;
            qcActionLog.LOG_TYPE      = 1;
            qcActionLog.LOG_DESC      = "质控者阅读病历";
            qcActionLog.AddQCQuestion = false;
            short shRet = MedicalQcLogAccess.Instance.Insert(qcActionLog);

            if (shRet != SystemData.ReturnValue.OK)
            {
                return;
            }

            node.SubItems[4].Text = "是";
            node.SubItems[5].Text = dtCheckTime.ToString("yyyy-MM-dd HH:mm:ss");
            node.ForeColor        = Color.Green;
            for (int index = 0; index < node.SubItems.Count; index++)
            {
                node.SubItems[index].ForeColor = Color.Green;
            }
        }
コード例 #15
0
 /// <summary>
 /// 将数据信息加载到DataGridView中
 /// </summary>
 /// <param name="row"></param>
 /// <param name="qcWorkloadStatInfo"></param>
 private void SetRowData(DataGridViewRow row, EMRDBLib.PatVisitInfo patVisitLog)
 {
     if (row == null || patVisitLog == null)
     {
         return;
     }
     if (row.DataGridView == null)
     {
         return;
     }
     row.Cells[this.colSpecialistName.Index].Value   = string.Empty;
     row.Cells[this.colPatientName.Index].Value      = patVisitLog.PATIENT_NAME;
     row.Cells[this.colPatientID.Index].Value        = patVisitLog.PATIENT_ID;
     row.Cells[this.colVisitID.Index].Value          = patVisitLog.VISIT_ID;
     row.Cells[this.colVisitTime.Index].Value        = patVisitLog.VISIT_TIME.ToString("yyyy-MM-dd");
     row.Cells[this.colDischargeTime.Index].Value    = patVisitLog.DISCHARGE_TIME.ToString("yyyy-MM-dd");
     row.Cells[this.colDept.Index].Value             = patVisitLog.DEPT_NAME;
     row.Cells[this.colPatientCondition.Index].Value = patVisitLog.PATIENT_CONDITION;
     row.Cells[this.colDischargeMode.Index].Value    = patVisitLog.DISCHARGE_MODE;
     row.Tag = patVisitLog;
 }
コード例 #16
0
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }
            DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex];

            EMRDBLib.PatVisitInfo patVisit = row.Tag as EMRDBLib.PatVisitInfo;

            if (patVisit == null)
            {
                return;
            }

            if (SystemParam.Instance.LocalConfigOption.IsNewTheme)
            {
                this.MainForm.SwitchPatient(patVisit);
                return;
            }
            this.MainForm.OpenDocument(string.Empty, patVisit.PATIENT_ID, patVisit.VISIT_ID);
        }
コード例 #17
0
        private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }

            DataGridViewCell currCell = this.dataGridView1.CurrentCell;

            if (currCell == null)
            {
                return;
            }
            if (currCell.ColumnIndex != this.colScore.Index)
            {
                return;
            }
            if (SystemParam.Instance.PatVisitLogTable == null)
            {
                return;
            }

            DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex];

            EMRDBLib.PatVisitInfo patVisitLog = row.Tag as EMRDBLib.PatVisitInfo;
            if (patVisitLog == null)
            {
                return;
            }

            SystemParam.Instance.PatVisitInfo = patVisitLog;


            this.MainForm.ShowDocScoreForm();
            if (this.MainForm.DocScoreForm != null)
            {
                this.MainForm.DocScoreForm.DocScoreSaved += new EventHandler(DocScoreForm_DocScoreSaved);
            }
        }
コード例 #18
0
        //急诊手术患者
        public bool Jizhen(string szPatientID, string szVisitID)
        {
            if (htJiZhen == null)
            {
                htJiZhen = new Hashtable();
            }
            if (htJiZhen.ContainsKey(string.Format("{0}_{1}", szPatientID, szVisitID)))
            {
                bool result = bool.Parse(htJiZhen[string.Format("{0}_{1}", szPatientID, szVisitID)].ToString());
                return(result);
            }
            //查询患者的入院时间
            //查询患者本次入院最早的手术时间
            //判断手术时间是否在入院时间的二十四小时以内
            EMRDBLib.PatVisitInfo patVisitLog = null;
            short shRet = EMRDBLib.DbAccess.PatVisitAccess.Instance.GetPatVisitInfo(szPatientID, szVisitID, ref patVisitLog);

            if (shRet != EMRDBLib.SystemData.ReturnValue.OK)
            {
                return(false);
            }
            DateTime dtOperationDate = EMRDBLib.DbAccess.OperationMasterAccess.Instance.GetOperationTime(szPatientID, szVisitID);

            if (dtOperationDate == DateTime.Parse("1900-01-01"))
            {
                htJiZhen.Add(string.Format("{0}_{1}", szPatientID, szVisitID), false);
                return(false);
            }
            else
            {
                if (patVisitLog.VISIT_TIME.AddHours(24) > dtOperationDate)
                {
                    htJiZhen.Add(string.Format("{0}_{1}", szPatientID, szVisitID), true);
                    return(true);
                }
            }
            return(false);
        }
コード例 #19
0
        private void mnuAddFeedInfo_Click(object sender, EventArgs e)
        {
            if (this.MainForm == null || this.MainForm.IsDisposed)
            {
                return;
            }

            VirtualNode selectedNode = this.virtualTree1.SelectedNode;

            if (selectedNode == null)
            {
                return;
            }
            EMRDBLib.PatVisitInfo patVisitLog = selectedNode.Tag as EMRDBLib.PatVisitInfo;
            if (patVisitLog == null)
            {
                return;
            }
            SystemParam.Instance.PatVisitInfo = patVisitLog;
            MedDocInfo docInfo = new MedDocInfo();

            this.GetSelectedNodeInfo(selectedNode, ref docInfo);
            this.MainForm.AddMedicalQcMsg(docInfo);
        }
コード例 #20
0
 private void LoadDelyUnCommitDocInfos(List <EMRDBLib.PatVisitInfo> lstPatVisitLog)
 {
     for (int index = 0; index < lstPatVisitLog.Count; index++)
     {
         EMRDBLib.PatVisitInfo patVisitLog = lstPatVisitLog[index];
         if (patVisitLog == null)
         {
             continue;
         }
         int             nRowIndex = this.dataGridView1.Rows.Add();
         DataGridViewRow row       = this.dataGridView1.Rows[nRowIndex];
         row.Cells[this.colPatientID.Index].Value     = patVisitLog.PATIENT_ID;
         row.Cells[this.colVisitID.Index].Value       = patVisitLog.VISIT_ID;
         row.Cells[this.colDeptName.Index].Value      = patVisitLog.DEPT_NAME;
         row.Cells[this.colPatName.Index].Value       = patVisitLog.PATIENT_NAME;
         row.Cells[this.colAdmissionDate.Index].Value = patVisitLog.VISIT_TIME.ToString("yyyy-MM-dd");
         if (patVisitLog.DISCHARGE_TIME != patVisitLog.DefaultTime)
         {
             row.Cells[this.colDischargeDate.Index].Value = patVisitLog.DISCHARGE_TIME.ToString("yyyy-MM-dd");
             row.Cells[this.colDelayDays.Index].Value     = (DateTime.Now - patVisitLog.DISCHARGE_TIME).Days;
         }
         row.Tag = patVisitLog;
     }
 }
コード例 #21
0
        private void btnQuery_Click(object sender, EventArgs e)
        {
            try
            {
                this.m_OutPatientCount = 0;
                DeptInfo deptInfo   = this.cboDeptName.SelectedItem as DeptInfo;
                string   szDeptCode = null;
                if (deptInfo != null)
                {
                    szDeptCode = deptInfo.DEPT_CODE;
                }
                if (string.IsNullOrEmpty(this.cboDeptName.Text))
                {
                    szDeptCode = null;
                }
                string szPatientID = this.txtPatientID.Text.Trim();
                GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);
                this.ShowStatusMessage("正在查询数据,请稍候...");
                this.dataGridView1.Rows.Clear();
                List <PatVisitInfo> lstPatVisitLog = null;

                short shRet = PatVisitAccess.Instance.GetPatientListByDisChargeTime(szPatientID, DateTime.Parse(dtpStatTimeBegin.Value.ToString("yyyy-M-d 00:00:00")),
                                                                                    DateTime.Parse(dtpStatTimeEnd.Value.ToString("yyyy-M-d 23:59:59")), szDeptCode, ref lstPatVisitLog);

                if (shRet != SystemData.ReturnValue.OK &&
                    shRet != SystemData.ReturnValue.RES_NO_FOUND)
                {
                    GlobalMethods.UI.SetCursor(this, Cursors.Default);
                    MessageBoxEx.Show("查询数据失败!");
                    return;
                }
                if (lstPatVisitLog == null || lstPatVisitLog.Count <= 0)
                {
                    GlobalMethods.UI.SetCursor(this, Cursors.Default);
                    MessageBoxEx.Show("没有符合条件的数据!", MessageBoxIcon.Information);
                    return;
                }
                this.m_OutPatientCount = lstPatVisitLog.Count;
                string preDeptName = string.Empty;
                int    nRowIndex   = 0;
                for (int index = 0; index < lstPatVisitLog.Count; index++)
                {
                    EMRDBLib.PatVisitInfo patVisitLog = lstPatVisitLog[index];
                    if (preDeptName == string.Empty)
                    {
                        preDeptName = patVisitLog.DEPT_NAME;
                    }
                    if (preDeptName != patVisitLog.DEPT_NAME)
                    {
                        nRowIndex = this.dataGridView1.Rows.Add();
                        this.dataGridView1.Rows[nRowIndex].Cells[2].Value             = "合计";
                        this.dataGridView1.Rows[nRowIndex].Cells[3].Value             = "出院人次:";
                        this.dataGridView1.Rows[nRowIndex].DefaultCellStyle.BackColor = Color.FromArgb(200, 200, 200);
                        this.dataGridView1.Rows[nRowIndex].Cells[4].Value             = lstPatVisitLog.Where(m => m.DEPT_NAME == preDeptName).Count();
                        preDeptName = patVisitLog.DEPT_NAME;
                    }
                    nRowIndex = this.dataGridView1.Rows.Add();
                    DataGridViewRow row = this.dataGridView1.Rows[nRowIndex];
                    this.SetRowData(row, patVisitLog);
                }
                nRowIndex = this.dataGridView1.Rows.Add();
                this.dataGridView1.Rows[nRowIndex].Cells[2].Value             = "合计";
                this.dataGridView1.Rows[nRowIndex].Cells[3].Value             = "出院人次:";
                this.dataGridView1.Rows[nRowIndex].Cells[4].Value             = lstPatVisitLog.Where(m => m.DEPT_NAME == preDeptName).Count();
                this.dataGridView1.Rows[nRowIndex].DefaultCellStyle.BackColor = Color.FromArgb(200, 200, 200);
                #region 绑定转科记录
                List <Transfer> lstTransfers = null;
                TransferAccess.Instance.GetList(lstPatVisitLog, ref lstTransfers);
                int nTransfer = 0;
                if (lstTransfers != null && lstTransfers.Count > 0)
                {
                    foreach (DataGridViewRow item in this.dataGridView1.Rows)
                    {
                        PatVisitInfo patVisitInfo = item.Tag as PatVisitInfo;
                        if (patVisitInfo == null)
                        {
                            continue;
                        }
                        var result = lstTransfers.Where(m => m.PATIENT_ID == patVisitInfo.PATIENT_ID && m.VISIT_ID == patVisitInfo.VISIT_ID).ToList();
                        if (result != null && result.Count > 1)
                        {
                            var first = result.FirstOrDefault();
                            if (first.DEPT_STAYED != first.DEPT_TRANSFER_TO)
                            {
                                item.Cells[this.colTransferTime.Index].Value = first.DISCHARGE_DATE_TIME.ToString("yyyy-MM-dd");
                            }
                            nTransfer++;
                        }
                        if (result != null && result.Count > 0)
                        {
                            var last = result.LastOrDefault();
                            item.Cells[this.col_MEDICAL_GROUP.Index].Value = last.MEDICAL_GROUP_NAME;
                            item.Cells[this.col_BED_CODE.Index].Value      = last.BED_LABEL;
                        }
                    }
                }
                #endregion
                #region 绑定取消催送病历(归档日期)
                List <QcMrIndex> lstQcMrIndexs = null;
                QcMrIndexAccess.Instance.GetList(lstPatVisitLog, ref lstQcMrIndexs);
                if (lstTransfers != null && lstTransfers.Count > 0)
                {
                    foreach (DataGridViewRow item in this.dataGridView1.Rows)
                    {
                        PatVisitInfo patVisitInfo = item.Tag as PatVisitInfo;
                        if (patVisitInfo == null)
                        {
                            continue;
                        }
                        var result = lstQcMrIndexs.Where(m => m.PATIENT_ID == patVisitInfo.PATIENT_ID && m.VISIT_ID == patVisitInfo.VISIT_ID).FirstOrDefault();
                        if (result != null && result.ARCHIVE_TIME != result.DefaultTime)
                        {
                            item.Cells[this.col_ARCHIVE_TIME.Index].Value = result.ARCHIVE_TIME.ToString("yyyy-MM-dd HH:mm");
                        }
                        item.Cells[this.col_ARCHIVE_TIME.Index].Tag = result;
                    }
                }
                #endregion
                this.lblTransferCount.Text   = nTransfer.ToString();
                this.lblOutPatientCount.Text = lstPatVisitLog.Count.ToString();
                this.ShowStatusMessage(null);
                GlobalMethods.UI.SetCursor(this, Cursors.Default);
            }
            catch (Exception ex)
            {
                LogManager.Instance.WriteLog(ex.ToString());
            }
        }
コード例 #22
0
        /// <summary>
        /// 刷新患者当次就诊产生的病程记录
        /// </summary>
        public override void OnRefreshView()
        {
            base.OnRefreshView();
            this.Update();
            if (SystemParam.Instance.PatVisitLogList == null)
            {
                return;
            }

            List <EMRDBLib.PatVisitInfo> lstPatVisitLog = SystemParam.Instance.PatVisitLogList;

            GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);
            this.ShowStatusMessage("正在刷新病程记录,请稍候...");
            if (this.m_htQCActionLog == null)
            {
                this.m_htQCActionLog = new Hashtable();
            }
            else
            {
                this.m_htQCActionLog.Clear();
            }
            this.GetQCActionLogInfo();
            this.virtualTree1.SuspendLayout();
            this.virtualTree1.Tag = null;
            this.virtualTree1.Nodes.Clear();
            this.virtualTree1.PerformLayout();
            this.m_SelectedNode = null;

            this.virtualTree1.SuspendLayout();
            VirtualNode deptNode    = null;
            VirtualNode patientNode = null;

            if (this.m_htDeptInfo == null)
            {
                this.m_htDeptInfo = new Hashtable();
            }
            this.m_htDeptInfo.Clear();
            for (int index = 0; index < lstPatVisitLog.Count; index++)
            {
                EMRDBLib.PatVisitInfo patVisitLog = lstPatVisitLog[index];
                if (patVisitLog == null)
                {
                    continue;
                }

                if (!this.m_htDeptInfo.ContainsKey(patVisitLog.DEPT_CODE))
                {
                    deptNode            = new VirtualNode(patVisitLog.DEPT_NAME);
                    deptNode.Font       = new Font("宋体", 11f, FontStyle.Regular);
                    deptNode.ImageIndex = 0;
                    deptNode.ForeColor  = Color.Blue;
                    deptNode.Expand();
                    this.virtualTree1.Nodes.Add(deptNode);
                    this.m_htDeptInfo.Add(patVisitLog.DEPT_CODE, deptNode);
                }
                else
                {
                    deptNode = this.m_htDeptInfo[patVisitLog.DEPT_CODE] as VirtualNode;
                    if (deptNode == null)
                    {
                        continue;
                    }
                }

                string szPatName = patVisitLog.PATIENT_NAME;
                string szBedNo   = null;
                if (!GlobalMethods.Misc.IsEmptyString(patVisitLog.BED_CODE))
                {
                    szBedNo = patVisitLog.BED_CODE;
                    if (szBedNo.Length < 3)
                    {
                        szBedNo = szBedNo.PadLeft(2, ' ');
                    }
                    szPatName = string.Format("{0} {1}", szBedNo, szPatName);
                }
                patientNode           = new VirtualNode(szPatName);
                patientNode.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                patientNode.Data      = PAT_NODE_TAG;
                patientNode.ForeColor = Color.Blue;
                if (patVisitLog.PATIENT_SEX == "男")
                {
                    patientNode.ImageIndex = 2;
                }
                else
                {
                    patientNode.ImageIndex = 3;
                }
                this.LoadMedDocList(patVisitLog, patientNode);
                //this.LoadPastDocList(patVisitLog, patientNode);
                deptNode.Nodes.Add(patientNode);
            }
            this.virtualTree1.ExpandAll();
            this.virtualTree1.PerformLayout();
            this.ShowStatusMessage(null);
            GlobalMethods.UI.SetCursor(this, Cursors.Default);
        }
コード例 #23
0
        private void LoadMedDocList(EMRDBLib.PatVisitInfo patVisitLog, VirtualNode patientNode)
        {
            if (patVisitLog == null)
            {
                return;
            }

            string szPatientID = patVisitLog.PATIENT_ID;
            string szVisitID   = patVisitLog.VISIT_ID;

            if (GlobalMethods.Misc.IsEmptyString(szPatientID) || GlobalMethods.Misc.IsEmptyString(szVisitID))
            {
                return;
            }

            string     szVisitType = MedDocSys.DataLayer.SystemData.VisitType.IP;
            MedDocList lstDocInfos = null;
            short      shRet       = EmrDocAccess.Instance.GetDocInfos(szPatientID, szVisitID, szVisitType, DateTime.Now, string.Empty, ref lstDocInfos);

            if (shRet != SystemData.ReturnValue.OK &&
                shRet != SystemData.ReturnValue.RES_NO_FOUND)
            {
                MessageBoxEx.Show("获取新格式病程记录失败!");
                return;
            }
            if (lstDocInfos == null || lstDocInfos.Count <= 0)
            {
                return;
            }

            lstDocInfos.Sort();

            //文档时间显示格式
            string szDocTimeFormat = "yyyy-MM-dd HH:mm";

            this.virtualTree1.SuspendLayout();
            this.virtualTree1.Tag = lstDocInfos;

            VirtualNode lastDocRootNode = new VirtualNode();

            lastDocRootNode.Text       = "医生的病历";
            lastDocRootNode.ImageIndex = 0;
            lastDocRootNode.Font       = new Font("宋体", 10.5f, FontStyle.Regular);
            lastDocRootNode.Data       = DOCTOR_NODE_TAG;
            lastDocRootNode.Expand();

            VirtualNode LastNurRootNode = new VirtualNode();

            LastNurRootNode.Text       = "护士的病历";
            LastNurRootNode.ImageIndex = 0;
            LastNurRootNode.Font       = new Font("宋体", 10.5f, FontStyle.Regular);
            LastNurRootNode.Data       = NURSE_NODE_TAG;
            LastNurRootNode.CollapseAll();

            VirtualNode otherDocRootNode = new VirtualNode("未被归类的病历");

            otherDocRootNode.ImageIndex = 1;
            otherDocRootNode.Font       = new Font("宋体", 10.5f, FontStyle.Regular);
            otherDocRootNode.Data       = UNKNOWN_NODE_TAG;
            otherDocRootNode.Expand();

            Hashtable htDocType = new Hashtable();

            //加载已有文档列表到指定的容器
            for (int index = 0; index < lstDocInfos.Count; index++)
            {
                MedDocInfo docInfo = lstDocInfos[index];
                if (docInfo == null)
                {
                    continue;
                }

                VirtualNode docInfoNode = new VirtualNode(docInfo.DOC_TITLE);
                docInfoNode.Data      = docInfo;
                docInfoNode.Tag       = patVisitLog;
                docInfoNode.ForeColor = Color.Black;
                docInfoNode.Font      = new Font("宋体", 10.5f, FontStyle.Regular);

                VirtualSubItem subItem   = null;
                DateTime       dtDocTime = docInfo.DOC_TIME;
                dtDocTime         = docInfo.DOC_TIME;
                subItem           = new VirtualSubItem(dtDocTime.ToString(szDocTimeFormat));
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(docInfo.CREATOR_NAME);
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(docInfo.MODIFY_TIME.ToString(szDocTimeFormat));
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(docInfo.MODIFIER_NAME);
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);

                string szReadTime = string.Empty;
                if (this.m_htQCActionLog.Contains(docInfo.DOC_SETID))
                {
                    szReadTime = this.m_htQCActionLog[docInfo.DOC_SETID].ToString();
                }

                subItem           = new VirtualSubItem();
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                if (!string.IsNullOrEmpty(szReadTime))
                {
                    subItem.Text = "是";
                }
                else
                {
                    subItem.Text = "否";
                }
                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(szReadTime);
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);
                //如果病历被阅读过,则子项的字体颜色分为绿色
                if (!string.IsNullOrEmpty(szReadTime))
                {
                    docInfoNode.ForeColor = Color.Green;
                    for (int nIndex = 0; nIndex < docInfoNode.SubItems.Count; nIndex++)
                    {
                        docInfoNode.SubItems[nIndex].ForeColor = Color.Green;
                    }
                }
                DocTypeInfo currDocType = null;
                DocTypeAccess.Instance.GetDocTypeInfo(docInfo.DOC_TYPE, ref currDocType);
                if (currDocType == null)
                {
                    otherDocRootNode.Nodes.Add(docInfoNode);
                    continue;
                }
                DocTypeInfo hostDocType = null;
                DocTypeAccess.Instance.GetDocTypeInfo(currDocType.HostTypeID, ref hostDocType);
                if (hostDocType == null)
                {
                    otherDocRootNode.Nodes.Add(docInfoNode);
                    continue;
                }

                VirtualNode hostDocRootNode = null;
                if (!htDocType.Contains(hostDocType.DocTypeID))
                {
                    hostDocRootNode           = new VirtualNode();
                    hostDocRootNode.Text      = hostDocType.DocTypeName;
                    hostDocRootNode.Tag       = hostDocType.DocTypeName;
                    hostDocRootNode.Data      = COMBIN_NODE_TAG;
                    hostDocRootNode.HitExpand = HitExpandMode.Click;
                    hostDocRootNode.Expand();
                    hostDocRootNode.Font       = new Font("宋体", 10.5f, FontStyle.Regular);
                    hostDocRootNode.ImageIndex = 1;
                    if (hostDocType.DocRight != MedDocSys.DataLayer.SystemData.UserType.NURSE)
                    {
                        lastDocRootNode.Nodes.Add(hostDocRootNode);
                    }
                    else if (hostDocType.DocRight == MedDocSys.DataLayer.SystemData.UserType.NURSE)
                    {
                        LastNurRootNode.Nodes.Add(hostDocRootNode);
                    }
                    else
                    {
                        this.virtualTree1.Nodes.Add(hostDocRootNode);
                    }
                    htDocType.Add(hostDocType.DocTypeID, hostDocRootNode);
                }
                else
                {
                    hostDocRootNode = htDocType[hostDocType.DocTypeID] as VirtualNode;
                }
                hostDocRootNode.Nodes.Add(docInfoNode);
            }
            htDocType.Clear();
            this.m_DoctorNode = lastDocRootNode;
            this.m_NurseNode  = LastNurRootNode;
            if (otherDocRootNode.Nodes.Count > 0)
            {
                patientNode.Nodes.Add(otherDocRootNode);
            }
            if (lastDocRootNode.Nodes.Count > 0)
            {
                patientNode.Nodes.Add(lastDocRootNode);
            }
            if (LastNurRootNode.Nodes.Count > 0)
            {
                patientNode.Nodes.Add(LastNurRootNode);
            }
        }
コード例 #24
0
        private void LoadPastDocList(EMRDBLib.PatVisitInfo patVisitLog, VirtualNode patientNode)
        {
            if (this.MainForm == null || this.MainForm.IsDisposed || patVisitLog == null)
            {
                return;
            }

            string szPatientID = patVisitLog.PATIENT_ID;
            string szVisitID   = patVisitLog.VISIT_ID;

            if (GlobalMethods.Misc.IsEmptyString(szPatientID) || GlobalMethods.Misc.IsEmptyString(szVisitID))
            {
                return;
            }

            MedDocList lstPastDocInfos = null;
            short      shRet           = EMRDBAccess.Instance.GetPastDocList(szPatientID, szVisitID, ref lstPastDocInfos);

            if (shRet != SystemData.ReturnValue.OK &&
                shRet != SystemData.ReturnValue.RES_NO_FOUND)
            {
                MessageBoxEx.Show("获取旧病程记录列表失败!");
                return;
            }
            if (lstPastDocInfos == null || lstPastDocInfos.Count <= 0)
            {
                return;
            }
            lstPastDocInfos.Sort();

            //文档时间显示格式
            string      szDocTimeFormat = "yyyy-MM-dd HH:mm";
            VirtualNode oldDocRootNode  = new VirtualNode("以往旧病历");

            oldDocRootNode.Data       = lstPastDocInfos;
            oldDocRootNode.ImageIndex = 1;
            oldDocRootNode.Font       = new Font("宋体", 10.5f, FontStyle.Regular);
            oldDocRootNode.Expand();

            Hashtable htDocType = new Hashtable();

            //加载已有文档列表到指定的容器
            for (int index = 0; index < lstPastDocInfos.Count; index++)
            {
                MedDocInfo pastDocInfo = lstPastDocInfos[index];
                if (pastDocInfo == null)
                {
                    continue;
                }

                string szDocTitle = "无主题";
                if (!GlobalMethods.Misc.IsEmptyString(pastDocInfo.DOC_TITLE))
                {
                    szDocTitle = pastDocInfo.DOC_TITLE;
                }
                VirtualNode docInfoNode = new VirtualNode(szDocTitle);
                docInfoNode.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                docInfoNode.Data      = pastDocInfo;
                docInfoNode.Tag       = patVisitLog;
                docInfoNode.ForeColor = Color.Black;

                VirtualSubItem subItem = null;
                subItem           = new VirtualSubItem(pastDocInfo.DOC_TIME.ToString(szDocTimeFormat));
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(pastDocInfo.CREATOR_NAME);
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(pastDocInfo.MODIFY_TIME.ToString(szDocTimeFormat));
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(pastDocInfo.MODIFIER_NAME);
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);

                string szReadTime = string.Empty;
                if (this.m_htQCActionLog.Contains(pastDocInfo.DOC_SETID))
                {
                    szReadTime = this.m_htQCActionLog[pastDocInfo.DOC_SETID].ToString();
                }
                subItem           = new VirtualSubItem();
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                if (!string.IsNullOrEmpty(szReadTime))
                {
                    subItem.Text = "是";
                }
                else
                {
                    subItem.Text = "否";
                }
                docInfoNode.SubItems.Add(subItem);

                subItem           = new VirtualSubItem(szReadTime);
                subItem.Font      = new Font("宋体", 10.5f, FontStyle.Regular);
                subItem.Alignment = Alignment.Middle;
                docInfoNode.SubItems.Add(subItem);
                //如果病历被阅读过,则子项的字体颜色分为绿色
                if (!string.IsNullOrEmpty(szReadTime))
                {
                    docInfoNode.ForeColor = Color.Green;
                    for (int nIndex = 0; nIndex < docInfoNode.SubItems.Count; nIndex++)
                    {
                        docInfoNode.SubItems[nIndex].ForeColor = Color.Green;
                    }
                }
                oldDocRootNode.Nodes.Add(docInfoNode);
            }
            patientNode.Nodes.Add(oldDocRootNode);
        }
コード例 #25
0
        private void btnQuery_Click(object sender, EventArgs e)
        {
            DeptInfo deptInfo   = this.cboDeptName.SelectedItem as DeptInfo;
            string   szDeptCode = null;

            if (deptInfo != null)
            {
                szDeptCode = deptInfo.DEPT_CODE;
            }
            if (string.IsNullOrEmpty(this.cboDeptName.Text))
            {
                szDeptCode = null;
            }

            GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);
            this.ShowStatusMessage("正在查询数据,请稍候...");
            this.dataGridView1.Rows.Clear();
            List <EMRDBLib.PatVisitInfo> lstPatVisitLog = null;

            short shRet = PatVisitAccess.Instance.GetPatientListByDisChargeTime(null, DateTime.Parse(dtpStatTimeBegin.Value.ToString("yyyy-M-d 00:00:00")),
                                                                                DateTime.Parse(dtpStatTimeEnd.Value.ToString("yyyy-M-d 23:59:59")), szDeptCode, ref lstPatVisitLog);

            if (shRet != SystemData.ReturnValue.OK &&
                shRet != SystemData.ReturnValue.RES_NO_FOUND)
            {
                GlobalMethods.UI.SetCursor(this, Cursors.Default);
                MessageBoxEx.Show("查询数据失败!");
                return;
            }
            if (lstPatVisitLog == null || lstPatVisitLog.Count <= 0)
            {
                GlobalMethods.UI.SetCursor(this, Cursors.Default);
                MessageBoxEx.Show("没有符合条件的数据!", MessageBoxIcon.Information);
                return;
            }
            List <EMRDBLib.PatDoctorInfo> lstPatDoctorInfos = new List <EMRDBLib.PatDoctorInfo>();
            Hashtable hashtable = new Hashtable();

            for (int index = 0; index < lstPatVisitLog.Count; index++)
            {
                EMRDBLib.PatVisitInfo patLog = lstPatVisitLog[index];
                if (!hashtable.ContainsKey(patLog.PATIENT_ID + patLog.VISIT_ID))
                {
                    EMRDBLib.PatDoctorInfo patDoctorInfo = new EMRDBLib.PatDoctorInfo();
                    patDoctorInfo.PatientID = patLog.PATIENT_ID;
                    patDoctorInfo.VisitID   = patLog.VISIT_ID;
                    hashtable.Add(patLog.PATIENT_ID + patLog.VISIT_ID, patDoctorInfo);
                    lstPatDoctorInfos.Add(patDoctorInfo);
                }
            }
            //获取三级医生信息
            shRet = PatVisitAccess.Instance.GetPatSanjiDoctors(ref lstPatDoctorInfos);

            for (int index = 0; index < lstPatVisitLog.Count; index++)
            {
                EMRDBLib.PatVisitInfo patVisitLog    = lstPatVisitLog[index];
                int                    nRowIndex     = this.dataGridView1.Rows.Add();
                DataGridViewRow        row           = this.dataGridView1.Rows[nRowIndex];
                EMRDBLib.PatDoctorInfo patDoctorInfo = lstPatDoctorInfos.Find(delegate(EMRDBLib.PatDoctorInfo p)
                {
                    if (p.PatientID == lstPatVisitLog[index].PATIENT_ID && p.VisitID == lstPatVisitLog[index].VISIT_ID)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                });
                this.SetRowData(row, patVisitLog, patDoctorInfo);
            }
            #region 重新绑定出院诊断
            List <EMRDBLib.Diagnosis> lstDiagnosInfo = new List <EMRDBLib.Diagnosis>();
            shRet = PatVisitAccess.Instance.GetOutPatientFirstDiagnosis(lstPatVisitLog, lstDiagnosInfo);
            if (shRet == SystemData.ReturnValue.OK &&
                lstDiagnosInfo.Count > 0)
            {
                for (int index = 0; index < this.dataGridView1.Rows.Count; index++)
                {
                    DataGridViewRow       row         = this.dataGridView1.Rows[index];
                    EMRDBLib.PatVisitInfo patVisitLog = row.Tag as EMRDBLib.PatVisitInfo;
                    if (patVisitLog == null)
                    {
                        continue;
                    }
                    EMRDBLib.Diagnosis diagnosisInfo = lstDiagnosInfo.Find(
                        delegate(EMRDBLib.Diagnosis p)
                    {
                        return(p.PATIENT_ID == patVisitLog.PATIENT_ID && p.VISIT_ID == patVisitLog.VISIT_ID);
                    });
                    if (diagnosisInfo != null)
                    {
                        row.Cells[this.colDiagnosis.Index].Value =
                            string.Format("{0}({1})", diagnosisInfo.DIAGNOSIS_DESC, string.IsNullOrEmpty(diagnosisInfo.TREAT_RESULT) ? "未知" : diagnosisInfo.TREAT_RESULT);
                    }
                }
            }
            #endregion
            #region 重新绑定费用
            PatVisitAccess.Instance.GetPatConstInfo(ref lstPatVisitLog);
            if (lstPatVisitLog == null || lstPatVisitLog.Count <= 0)
            {
                GlobalMethods.UI.SetCursor(this, Cursors.Default);
                MessageBoxEx.Show("费用信息查询失败!", MessageBoxIcon.Information);
                return;
            }
            for (int index = 0; index < this.dataGridView1.Rows.Count; index++)
            {
                DataGridViewRow       row         = this.dataGridView1.Rows[index];
                EMRDBLib.PatVisitInfo patVisitLog = row.Tag as EMRDBLib.PatVisitInfo;
                if (patVisitLog == null)
                {
                    continue;
                }
                EMRDBLib.PatVisitInfo findPatVisitLog = lstPatVisitLog.Find(
                    delegate(EMRDBLib.PatVisitInfo p)
                {
                    return(p.PATIENT_ID == patVisitLog.PATIENT_ID && p.VISIT_ID == patVisitLog.VISIT_ID);
                });
                if (findPatVisitLog != null)
                {
                    row.Cells[this.colCost.Index].Value = Math.Round(findPatVisitLog.TOTAL_COSTS, 2).ToString();
                }
            }
            #endregion
            this.ShowStatusMessage(null);
            GlobalMethods.UI.SetCursor(this, Cursors.Default);
        }
コード例 #26
0
        /// <summary>
        /// 加载患者的就诊日志信息
        /// </summary>
        /// <param name="patVisitLog">患者就诊日志信息</param>
        /// <param name="backColor">行背景色</param>
        /// <returns>是否需要换背景色、过滤</returns>
        private bool LoadQCQuestionInfo(EMRDBLib.PatVisitInfo patVisitLog, Color backColor)
        {
            List <EMRDBLib.MedicalQcMsg> lstQCQuestionInfo = null;
            short shRet = MedicalQcMsgAccess.Instance.GetMedicalQcMsgList(patVisitLog.PATIENT_ID, patVisitLog.VISIT_ID, ref lstQCQuestionInfo);

            if (shRet != SystemData.ReturnValue.OK && shRet != SystemData.ReturnValue.RES_NO_FOUND)
            {
                return(false);
            }
            #region 是否需要被过滤判断
            //获取患者的病历得分
            EMRDBLib.QCScore qcScore = null;
            shRet = QcScoreAccess.Instance.GetQCScore(patVisitLog.PATIENT_ID, patVisitLog.VISIT_ID, ref qcScore);
            if (shRet != SystemData.ReturnValue.OK || qcScore == null)
            {
                return(false);
            }

            float fScore = -1;
            //院评分数HosAssess默认值为-1,如果HosAssess>=0代表此患者的病历已经被评分。
            if (qcScore.HOS_ASSESS >= 0)
            {
                fScore = qcScore.HOS_ASSESS;
            }
            //筛选已评分的分数
            if (this.cbx.SelectedIndex == 1)
            {
                if (fScore >= 0)
                {
                    float scoreLow = 0.0f;
                    float.TryParse(this.cbbScoreLow.Text.ToString(), out scoreLow);
                    float scoreHigh = 0.0f;
                    float.TryParse(this.cbbScoreHigh.Text.ToString(), out scoreHigh);
                    if (fScore > scoreHigh || fScore < scoreLow)
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
            else if (this.cbx.SelectedIndex == 2)//未评分
            {
                if (fScore > 0)
                {
                    return(false);
                }
            }

            //提交状态 字母o为未提交
            if (this.cbbMrStatus.SelectedItem.ToString() == "未提交" && patVisitLog.MR_STATUS.ToUpper() != "O")
            {
                return(false);
            }
            else if (this.cbbMrStatus.SelectedItem.ToString() == "已提交" && patVisitLog.MR_STATUS.ToUpper() == "O")
            {
                return(false);
            }

            #endregion

            #region 加载未被审查的患者基本信息
            if (lstQCQuestionInfo == null || lstQCQuestionInfo.Count <= 0)
            {
                int             nRowIndex = this.dataGridView1.Rows.Add();
                DataGridViewRow row       = this.dataGridView1.Rows[nRowIndex];
                row.DefaultCellStyle.BackColor                   = backColor;
                row.Cells[this.colPatientID.Index].Value         = patVisitLog.PATIENT_ID;
                row.Cells[this.col_BED_CODE.Index].Value         = patVisitLog.BED_CODE;
                row.Cells[this.colPatName.Index].Value           = patVisitLog.PATIENT_NAME;
                row.Cells[this.colDoctorInCharge.Index].Value    = patVisitLog.INCHARGE_DOCTOR;
                row.Cells[this.colPARENT_DOCTOR.Index].Value     = patVisitLog.AttendingDoctor;
                row.Cells[this.colDeptAdmissionTo.Index].Value   = patVisitLog.DEPT_NAME;
                row.Cells[this.colAdmissionDate.Index].Value     = patVisitLog.VISIT_TIME;
                row.Cells[this.colDeptDischargeFrom.Index].Value = patVisitLog.DischargeDeptCode;
                row.Cells[this.colMrStatus.Index].Value          = patVisitLog.MR_STATUS.ToUpper() == "O" ? "未提交" : "已提交";
                if (patVisitLog.DISCHARGE_TIME != patVisitLog.DefaultTime)
                {
                    row.Cells[this.colDischargeDate.Index].Value = patVisitLog.DISCHARGE_TIME;
                }
                //显示权限改到质控权限控制
                //if (SystemConfig.Instance.Get(SystemData.ConfigKey.STAT_SHOW_CHECKER_NAME, false))

                row.Cells[this.colDocChecker.Index].Value = qcScore.HOS_QCMAN;

                row.Cells[this.colScore.Index].Value    = fScore >= 0 ? fScore.ToString() : string.Empty;
                row.Cells[this.colDocLevel.Index].Value = qcScore.DOC_LEVEL;
                row.Tag = patVisitLog;
                if (!this.m_htPatVisitLog.ContainsKey(patVisitLog))
                {
                    this.m_htPatVisitLog.Add(patVisitLog, row);
                }
                return(true);
            }
            #endregion

            #region 加载质控信息
            for (int index = 0; index < lstQCQuestionInfo.Count; index++)
            {
                int             nRowIndex = this.dataGridView1.Rows.Add();
                DataGridViewRow row       = this.dataGridView1.Rows[nRowIndex];
                row.DefaultCellStyle.BackColor = backColor;
                row.Tag = patVisitLog;
                if (index == 0)
                {
                    row.Cells[this.colPatientID.Index].Value         = patVisitLog.PATIENT_ID;
                    row.Cells[this.colPatName.Index].Value           = patVisitLog.PATIENT_NAME;
                    row.Cells[this.colDeptAdmissionTo.Index].Value   = patVisitLog.DEPT_NAME;
                    row.Cells[this.colAdmissionDate.Index].Value     = patVisitLog.VISIT_TIME.ToString("yyyy-MM-dd");
                    row.Cells[this.colDoctorInCharge.Index].Value    = patVisitLog.INCHARGE_DOCTOR;
                    row.Cells[this.colPARENT_DOCTOR.Index].Value     = patVisitLog.AttendingDoctor;
                    row.Cells[this.colDeptDischargeFrom.Index].Value = patVisitLog.DischargeDeptCode;
                    row.Cells[this.colMrStatus.Index].Value          = patVisitLog.MR_STATUS.ToUpper() == "O" ? "未提交" : "已提交";
                    if (patVisitLog.DISCHARGE_TIME != patVisitLog.DefaultTime)
                    {
                        row.Cells[this.colDischargeDate.Index].Value = patVisitLog.DISCHARGE_TIME.ToString("yyyy-MM-dd");
                    }
                    row.Cells[this.colScore.Index].Value    = fScore >= 0 ? fScore.ToString() : string.Empty;
                    row.Cells[this.colDocLevel.Index].Value = qcScore.DOC_LEVEL;
                    if (!this.m_htPatVisitLog.ContainsKey(patVisitLog))
                    {
                        this.m_htPatVisitLog.Add(patVisitLog, row);
                    }
                    //如果是精简版跳过
                    if (!chboxSimple.Checked)
                    {
                        break;
                    }
                }
                row.Cells[this.colDocChecker.Index].Value   = lstQCQuestionInfo[index].ISSUED_BY;
                row.Cells[this.colDocName.Index].Value      = lstQCQuestionInfo[index].TOPIC;
                row.Cells[this.colQuestionList.Index].Value = lstQCQuestionInfo[index].MESSAGE;
                row.Cells[this.colDocSetID.Index].Value     = lstQCQuestionInfo[index].TOPIC_ID;
            }
            #endregion
            return(true);
        }
コード例 #27
0
ファイル: SearchDeathForm.cs プロジェクト: zuifengke/MedQCSys
        private void btnQuery_Click(object sender, EventArgs e)
        {
            DeptInfo deptInfo   = this.cboDeptName.SelectedItem as DeptInfo;
            string   szDeptCode = null;

            if (deptInfo != null)
            {
                szDeptCode = deptInfo.DEPT_CODE;
            }
            if (string.IsNullOrEmpty(this.cboDeptName.Text))
            {
                szDeptCode = null;
            }

            GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);
            this.ShowStatusMessage("正在查询数据,请稍候...");
            this.dataGridView1.Rows.Clear();
            List <EMRDBLib.PatVisitInfo> lstPatVisitLog = null;
            short shRet = PatVisitAccess.Instance.GetDeathPatList(szDeptCode, DateTime.Parse(dtpStatTimeBegin.Value.ToString("yyyy-M-d 00:00:00")),
                                                                  DateTime.Parse(dtpStatTimeEnd.Value.ToString("yyyy-M-d 23:59:59")), ref lstPatVisitLog);

            if (shRet != SystemData.ReturnValue.OK &&
                shRet != SystemData.ReturnValue.RES_NO_FOUND)
            {
                GlobalMethods.UI.SetCursor(this, Cursors.Default);
                this.ShowStatusMessage(null);
                MessageBoxEx.Show("查询数据失败!");
                return;
            }
            if (lstPatVisitLog == null || lstPatVisitLog.Count <= 0)
            {
                GlobalMethods.UI.SetCursor(this, Cursors.Default);
                this.ShowStatusMessage(null);
                MessageBoxEx.Show("没有符合条件的数据!", MessageBoxIcon.Information);
                return;
            }
            #region  级医生信息
            List <EMRDBLib.PatDoctorInfo> lstPatDoctorInfos = new List <EMRDBLib.PatDoctorInfo>();
            Hashtable hashtable = new Hashtable();
            for (int index = 0; index < lstPatVisitLog.Count; index++)
            {
                PatVisitInfo patInfo = lstPatVisitLog[index];
                if (!hashtable.ContainsKey(patInfo.PATIENT_ID + patInfo.VISIT_ID))
                {
                    EMRDBLib.PatDoctorInfo patDoctorInfo = new EMRDBLib.PatDoctorInfo();
                    patDoctorInfo.PatientID = patInfo.PATIENT_ID;
                    patDoctorInfo.VisitID   = patInfo.VISIT_ID;
                    hashtable.Add(patInfo.PATIENT_ID + patInfo.VISIT_ID, patDoctorInfo);
                    lstPatDoctorInfos.Add(patDoctorInfo);
                }
            }
            //获取三级医生信息
            shRet = PatVisitAccess.Instance.GetPatSanjiDoctors(ref lstPatDoctorInfos);

            string pre       = null;
            int    nRowIndex = 0;

            #endregion
            for (int index = 0; index < lstPatVisitLog.Count; index++)
            {
                EMRDBLib.PatVisitInfo patVisitLog = lstPatVisitLog[index];
                if (pre != string.Format("{0}_{1}", patVisitLog.PATIENT_ID, patVisitLog.VISIT_ID))
                {
                    nRowIndex = this.dataGridView1.Rows.Add();
                    pre       = string.Format("{0}_{1}", patVisitLog.PATIENT_ID, patVisitLog.VISIT_ID);
                }
                DataGridViewRow        row           = this.dataGridView1.Rows[nRowIndex];
                EMRDBLib.PatDoctorInfo patDoctorInfo = lstPatDoctorInfos.Find(delegate(EMRDBLib.PatDoctorInfo p)
                {
                    if (p.PatientID == lstPatVisitLog[index].PATIENT_ID && p.VisitID == lstPatVisitLog[index].VISIT_ID)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                });
                this.SetRowData(row, patVisitLog, patDoctorInfo);
            }

            this.ShowStatusMessage(null);
            GlobalMethods.UI.SetCursor(this, Cursors.Default);
        }