Exemplo n.º 1
0
        private void ValuateNow_Load(object sender, EventArgs e)
        {
            SetYsbm();
            DataTable dt1           = new DataTable();
            XmlNode   testsAndExams = null;

            using (gjtEmrPatients.emrPatients ep = new gjtEmrPatients.emrPatients())
            {
                testsAndExams = ep.ValuateNowEx();
            }
            XmlNodeList archives = testsAndExams.SelectNodes(EmrConstant.ElementNames.archive);
            DataGridViewComboBoxColumn dgvComboBoxColumn = new DataGridViewComboBoxColumn();

            dgvComboBoxColumn.HeaderText = "科级扣分原因";

            DataGridViewTextBoxColumn KF = new DataGridViewTextBoxColumn();

            KF.HeaderText = "科级扣分";
            DataGridViewTextBoxColumn MC = new DataGridViewTextBoxColumn();

            MC.HeaderText = "项目内容";

            DataGridViewTextBoxColumn SZF = new DataGridViewTextBoxColumn();

            SZF.HeaderText = "所占分";
            DataGridViewTextBoxColumn Content = new DataGridViewTextBoxColumn();

            Content.HeaderText = "检查内容与评分标准";
            DataGridViewTextBoxColumn GLMC = new DataGridViewTextBoxColumn();

            Content.HeaderText = "评分标准";
            //   DataGridViewTextBoxColumn YGKF = new DataGridViewTextBoxColumn();
            //YGKF.HeaderText = "缺陷应该扣分";
            //   DataGridViewTextBoxColumn XH = new DataGridViewTextBoxColumn();
            //XH.HeaderText = "缺陷序号";
            dgvValuate.Columns.Add(MC);

            dgvValuate.Columns.Add(SZF);
            dgvValuate.Columns.Add(Content);
            dgvValuate.Columns.Add(dgvComboBoxColumn);
            dgvValuate.Columns.Add(KF);
            dgvValuate.Columns.Add(GLMC);
            GLMC.Visible = false;

            XmlNodeList items = null;

            foreach (XmlNode archive in archives)
            {
                string ProName  = archive.Attributes[EmrConstant.AttributeNames.ProName].Value;
                string SZFv     = archive.Attributes[EmrConstant.AttributeNames.SZF].Value;
                string SZFHJ    = archive.Attributes[EmrConstant.AttributeNames.SZFHJ].Value;
                string Contentv = archive.Attributes[EmrConstant.AttributeNames.Content].Value;
                string glmc     = archive.Attributes[EmrConstant.AttributeNames.GLMC].Value;
                int    index    = dgvValuate.Rows.Add();

                items = archive.ChildNodes;
                DataGridViewComboBoxCell dcc = null;
                //if (ProName == "") ProName = "首页病程";
                dgvValuate.Rows[index].Cells[0].Value = ProName;
                dgvValuate.Rows[index].Cells[1].Value = SZFHJ;
                dgvValuate.Rows[index].Cells[2].Value = Contentv;
                dgvValuate.Rows[index].Cells[5].Value = glmc;
                dcc = (DataGridViewComboBoxCell)dgvValuate.Rows[index].Cells[3];


                foreach (XmlNode item in items)
                {
                    // string XH = item.Attributes[EmrConstant.AttributeNames.XH].Value;
                    string KFYY = item.Attributes[EmrConstant.AttributeNames.KFYY].Value;
                    string CKKF = item.Attributes[EmrConstant.AttributeNames.CKKF].Value;
                    int    dex  = dcc.Items.Add(KFYY + "\n -" + CKKF);
                }
                dcc.Items.Add("------------");
            }
            dgvValuate.Columns[4].ReadOnly = true;
            //判断是否已经审核了
            using (gjtEmrPatients.emrPatients ep = new gjtEmrPatients.emrPatients())
            {
                string    flag   = ep.ValuateNowISSH(registryID);
                DataTable dt     = ep.ValuateNowBAPSBZNew(registryID);
                string    oldStr = "";
                string    newStr = "";

                if (dt.Rows.Count != 0 && dt.Rows[0][0].ToString() == "1")
                {
                    btnUpate.Enabled        = false;
                    btnPS.Enabled           = false;
                    btnChecked.Enabled      = false;
                    btnPrintPreview.Enabled = true;
                    btnValuatPrint.Enabled  = true;
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        for (int j = 0; j < dgvValuate.Rows.Count; j++)
                        {
                            if (dgvValuate.Rows[j].Cells[5].Value.ToString() == dt.Rows[i][2].ToString())
                            {
                                DataGridViewComboBoxCell dcc = (DataGridViewComboBoxCell)dgvValuate.Rows[j].Cells[3];
                                for (int k = 0; k < dcc.Items.Count; k++)
                                {
                                    oldStr = dcc.Items[k].ToString().Replace(" ", "");
                                    newStr = dt.Rows[i][1].ToString().Trim() + "\n-" + dt.Rows[i][5].ToString().Trim();
                                    if (oldStr == newStr)
                                    {
                                        dcc.Value = dcc.Items[k].ToString();

                                        // cb_SelectedIndexChanged(sender, e);
                                    }
                                }
                                string[] strdcc = dcc.Value.ToString().Split('-');
                                dgvValuate.Rows[j].Cells[4].Value = strdcc[1].ToString();
                            }
                        }
                    }
                    lblZDF.Text = dt.Rows[0][4].ToString();
                    lblPJ.Text  = dt.Rows[0][3].ToString();
                }
                else
                {
                    btnUpate.Enabled        = false;
                    btnPS.Enabled           = true;
                    btnChecked.Enabled      = false;
                    btnPrintPreview.Enabled = false;
                    btnValuatPrint.Enabled  = false;
                    return;
                }

                if (flag == "1")
                {
                    btnUpate.Enabled        = false;
                    btnChecked.Enabled      = false;
                    btnPS.Enabled           = false;
                    btnPrintPreview.Enabled = true;
                    btnValuatPrint.Enabled  = true;
                    return;
                }
            }
            btnUpate.Enabled        = true;
            btnChecked.Enabled      = true;
            btnPrintPreview.Enabled = false;
            btnValuatPrint.Enabled  = false;
        }