Example #1
0
        private void btnChecked_Click(object sender, EventArgs e)
        {
            if (lblCyDate.Text.Trim() == "")
            {
                MessageBox.Show("请确认该患者已经出院再审核评分!!!", ErrorMessage.Warning,
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                return;
            }
            if (MessageBox.Show("确认审核吗!审核后无法再次修改评分定级!!!", ErrorMessage.Warning,
                                MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1)
                == DialogResult.Cancel)
            {
                return;
            }

            using (gjtEmrPatients.emrPatients ep = new gjtEmrPatients.emrPatients())
            {
                try
                {
                    //
                    XmlDocument doc  = new XmlDocument();
                    XmlElement  note = doc.CreateElement(ElementNames.EmrNote);
                    // note.SetAttribute(AttributeNames.RegistryID, registryID);
                    note.SetAttribute(AttributeNames.ArchiveNum, lblBH.Text);
                    note.SetAttribute(AttributeNames.PSCYRQ, lblCyDate.Text);
                    // note.SetAttribute(AttributeNames.SHRQ, DateTime.Now.ToString());
                    // note.SetAttribute(AttributeNames.DepartmentCode, departID);
                    note.SetAttribute(AttributeNames.PSZJYS, Globals.DoctorName);
                    note.SetAttribute(AttributeNames.BAPSBZ, "1");
                    note.SetAttribute(AttributeNames.PSRQ, DateTime.Now.ToString());

                    //note.SetAttribute(AttributeNames.SHBZ, shbz);
                    //note.SetAttribute(AttributeNames.SHRQ, "");
                    //note.SetAttribute(AttributeNames.SHRY, "");
                    note.SetAttribute(AttributeNames.RegistryID, registryID);
                    //if (noteID != "00") note.SetAttribute(AttributeNames.Series, series);

                    foreach (DataGridViewRow row in dgvValuate.Rows)
                    {
                        if (row.Cells[4].Value == null || row.Cells[4].Value.ToString() == "" || row.Cells[4].Value.ToString() == "------------")
                        {
                            continue;
                        }

                        this.knockTotal += Convert.ToDecimal(row.Cells[4].Value);
                        XmlElement flaw = doc.CreateElement(ElementNames.Flaw);
                        flaw.SetAttribute(AttributeNames.KFXM, row.Cells[0].Value.ToString());
                        string   strqxmc = row.Cells[3].Value.ToString();
                        string[] mcs     = strqxmc.Split('-');
                        flaw.SetAttribute(AttributeNames.KFYY, mcs[0].ToString());
                        flaw.SetAttribute(AttributeNames.KF, mcs[1].ToString());
                        flaw.SetAttribute(AttributeNames.GLMC, row.Cells[5].Value.ToString());
                        note.AppendChild(flaw);
                    }
                    // MakeScore(this.knockTotal);
                    note.SetAttribute(AttributeNames.PJ, lblPJ.Text);
                    note.SetAttribute(AttributeNames.SDF, lblZDF.Text);
                    decimal knoc = 0;
                    if (lblZDF.Text != "")
                    {
                        knoc = (100 - Convert.ToDecimal(lblZDF.Text));
                    }
                    note.SetAttribute(AttributeNames.GKF, knoc.ToString());
                    bool msg = false;
                    msg = ep.ValuateNowSH(registryID, Globals.DoctorName, DateTime.Now.ToString(), note);
                    if (msg)
                    {
                        btnChecked.Enabled      = false;
                        btnPS.Enabled           = false;
                        btnUpate.Enabled        = false;
                        btnPrintPreview.Enabled = true;
                        btnValuatPrint.Enabled  = true;
                    }
                }
                catch
                {
                }
            }
        }