예제 #1
0
        private void btnSelect_Click(object sender, EventArgs e)
        {
            List <string> lstYGItem      = new List <string>();
            bool          flgYG          = false;
            string        recorddate     = string.Empty;
            string        crvalSpan      = string.Empty;
            string        doctadvicedate = string.Empty;
            string        BeginDate      = this.dteRq1.Value.ToString("yyyy-MM-dd");
            string        EndDate        = this.dteRq2.Value.ToString("yyyy-MM-dd");

            getdeptstr();

            if (!chkDeptSelect.Checked)
            {
                deptstr = null;
            }

            if (Convert.ToDateTime(BeginDate + " 00:00:01") > Convert.ToDateTime(EndDate + " 00:00:01"))
            {
                MessageBox.Show("开始日期不能大于结束日期。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            try
            {
                clsPublic.PlayAvi("findFILE.avi", "正在项目信息,请稍候...");
                dwRep.Reset();
                lstYGItem = GetYGItem();
                clsHISReportZy_Supported_Svc svc = (clsHISReportZy_Supported_Svc)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(clsHISReportZy_Supported_Svc));
                DataTable dt  = svc.GetCriticalMedicaldept(BeginDate, EndDate, deptstr);
                DataTable dt1 = svc.GetCrval();
                DataTable dt2 = svc.GetCrval2();
                if (dt != null && dt.Rows.Count > 0)
                {
                    int row = 0;
                    dwRep.SetRedrawOff();
                    foreach (DataRow dr in dt.Rows)
                    {
                        for (int i = 0; i < lstYGItem.Count; i++)
                        {
                            if (dr["resultval"].ToString().Trim() == lstYGItem[i].Trim())
                            {
                                flgYG = true;
                                break;
                            }
                        }

                        if (flgYG == true)
                        {
                            flgYG = false;
                            continue;
                        }

                        crvalSpan = "";

                        if (dr["doctadvicedate"].ToString() != "")
                        {
                            doctadvicedate = (Convert.ToDateTime(dr["doctadvicedate"].ToString())).ToString("yyyy-MM-dd HH:mm");
                        }

                        if (dr["recorddate"].ToString() != "")
                        {
                            recorddate = (Convert.ToDateTime(dr["recorddate"].ToString())).ToString("yyyy-MM-dd HH:mm");
                        }
                        else
                        {
                            continue;
                        }

                        foreach (DataRow dr1 in dt1.Rows)
                        {
                            if (dr["checkitemid"].ToString() == dr1["check_item_id_chr"].ToString())
                            {
                                crvalSpan = dr1["ALERT_VALUE_RANGE_VCHR"].ToString().Trim();
                                break;
                            }
                        }

                        if (crvalSpan == "")
                        {
                            foreach (DataRow dr2 in dt2.Rows)
                            {
                                if (dr["checkitemid"].ToString() == dr2["check_item_id_chr"].ToString())
                                {
                                    crvalSpan = dr2["ALERT_VALUE_RANGE_VCHR"].ToString().Trim();
                                    break;
                                }
                            }
                        }

                        row = dwRep.InsertRow(0);

                        dwRep.SetItemString(row, "responsedate", recorddate);
                        dwRep.SetItemString(row, "patname", dr["patname"].ToString());
                        dwRep.SetItemString(row, "bedno", dr["bedno"].ToString());
                        dwRep.SetItemString(row, "ipno", dr["ipno"].ToString());
                        dwRep.SetItemString(row, "checkitemresult", dr["checkitemname"].ToString() + "; " + dr["resultval"].ToString());
                        dwRep.SetItemString(row, "crval_span", crvalSpan);
                        dwRep.SetItemString(row, "recorddeptid", dr["recorddeptid"].ToString());
                        dwRep.SetItemString(row, "recorddeptid", dr["recorddeptid"].ToString());
                        dwRep.SetItemString(row, "recorder", dr["recorder"].ToString());
                        dwRep.SetItemString(row, "appdeptname", dr["appdeptname"].ToString());
                        dwRep.SetItemString(row, "responsename", dr["responseopername"].ToString());
                        dwRep.SetItemString(row, "doctname", dr["doctname"].ToString());       //dr["doctname"].ToString()
                        dwRep.SetItemString(row, "responsemsg", dr["responsemsg"].ToString()); //dr["doctname"].ToString()
                        dwRep.SetItemString(row, "doctadvicemsg", dr["doctadvicemsg"].ToString());
                        dwRep.SetItemString(row, "doctadvicedate", doctadvicedate);
                    }
                    dwRep.SetRedrawOn();
                }
                else
                {
                    dwRep.InsertRow(0);
                }
                dwRep.Modify("t_date.text = '" + BeginDate + " ~ " + EndDate + "'");
            }
            finally
            {
                clsPublic.CloseAvi();
                frm = null;
            }
            this.dwRep.Refresh();
        }