コード例 #1
0
ファイル: ValuateScore.cs プロジェクト: zhanglg40/hmr
        private void btnSave_Click(object sender, EventArgs e)
        {
            using (gjtEmrService.emrServiceXml es = new gjtEmrService.emrServiceXml())
            {
                string msg = "";
                if (Globals.isEndRule == false)
                {
                    msg = es.NewValuateScore(selfValuate, regID, patientDoctor, patientDepartment,
                                             Globals.DoctorID, scorePercent, vi);
                }
                else
                {
                    msg = es.NewValuateScoreEnd(selfValuate, regID, patientDoctor, patientDepartment,
                                                Globals.DoctorID, scorePercent, vi);
                }
                if (msg != null)
                {
                    MessageBox.Show(msg, ErrorMessage.Error);
                    return;
                }
                using (gjtEmrPatients.emrPatients ep = new gjtEmrPatients.emrPatients())
                {
                    //string strRegistryID = Globals.ThisAddIn
                    for (int i = 0; i < ArrayListNoteID.Count; i++)
                    {
                        ep.InSertValueOff(registryIDTemp, ArrayListNoteID[i].ToString(), ArrayListReason[i].ToString(), ArrayListOff[i].ToString());
                    }
                }
                OpDone opd = new OpDone("保存成功!");
                opd.Show();

                this.Tag = StringGeneral.Zero;
            }
        }
コード例 #2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (cboCertificate.Text.Trim() == "")
            {
                MessageBox.Show("确认提交者已插入u-Key!", ErrorMessage.Warning);
                return;
            }
            if (MessageBox.Show("确认保存接收文档!", ErrorMessage.Warning,
                                MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1)
                == DialogResult.Cancel)
            {
                return;
            }
            using (gjtEmrService.emrServiceXml es = new gjtEmrService.emrServiceXml())
            {
                foreach (DataGridViewRow row in dataGridView1.Rows)
                {
                    if (row.Cells[2].Value == null)
                    {
                        continue;
                    }
                    if (!udt.jj.IsNumaric(row.Cells[2].Value.ToString()))
                    {
                        MessageBox.Show("输入格式不正确!");
                        return;
                    }
                    bool selected = (bool)row.Cells[0].FormattedValue;
                    if (!selected)
                    {
                        continue;
                    }
                    int count = Convert.ToInt32(row.Cells[2].Value.ToString());
                    if (es.UpdateTransferInfo(registryID, row.Cells[1].Value.ToString(), row.Cells[3].Value.ToString(), Globals.DoctorID,
                                              cboCertificate.Text.Trim(), ThisAddIn.Today(), count) == 0)
                    {
                        es.PutTransferInfo(registryID, row.Cells[1].Value.ToString(), "", row.Cells[3].Value.ToString(), Globals.DoctorID, cboCertificate.Text.Trim(), ThisAddIn.Today(), count, true);
                    }
                }
            }
            OpDone op = new OpDone("接收成功");

            op.Show();
            this.Close();
        }
コード例 #3
0
        private void btnRefer_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("请确认提交文档!", ErrorMessage.Warning,
                                MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1)
                == DialogResult.Cancel)
            {
                return;
            }
            using (gjtEmrService.emrServiceXml es = new gjtEmrService.emrServiceXml())
            {
                es.DelTransferInfo(registryID, Globals.DoctorID);
                foreach (DataGridViewRow row in dataGridView1.Rows)
                {
                    if (row.Cells[2].Value == null)
                    {
                        continue;
                    }
                    if (!udt.jj.IsNumaric(row.Cells[2].Value.ToString()))
                    {
                        MessageBox.Show("输入格式不正确!");
                        return;
                    }
                    bool selected = (bool)row.Cells[0].FormattedValue;
                    if (!selected)
                    {
                        continue;
                    }
                    int count = Convert.ToInt32(row.Cells[2].Value.ToString());
                    es.PutTransferInfo(registryID, row.Cells[1].Value.ToString(), Globals.DoctorID,
                                       Globals.DoctorName, "", "", ThisAddIn.Today(), count, false);
                }
            }
            OpDone op = new OpDone("提交成功");

            op.Show();
            this.Close();
        }
コード例 #4
0
ファイル: EmrDocument.cs プロジェクト: zhanglg40/hmr
        public bool UpdateEmrNote(int series, NoteStatus noteStatus, ref NoteStatus noteStatusEnd, bool CommitFlag)
        {
            noteStatusEnd = noteStatus;
            /* Confirm the note exists. */
            XmlNode emrNote = GetEmrNoteBySeries(series);

            if (emrNote == null)
            {
                return(Return.Failed);
            }


            /* word window to word document */
            string tmpfile = Path.Combine(Globals.currentDirectory, ResourceName.Mytmp);

            //udt.jj.SaveWordDoc(ThisAddIn.Application.ActiveDocument, tmpfile, false);

            #region Update the emrDocument in dadabase
            /* Package the word document into a xml elelement. */
            XmlNode noteDoc = emrDoc.CreateElement(ElementNames.EmrNote);
            noteDoc.InnerText = udt.jj.WordDocumentToString(tmpfile);
            string registryID = emrDoc.DocumentElement.GetAttribute(AttributeNames.RegistryID);
            /* Update the dadabase. */
            if (!Globals.offline)
            {
                using (gjtEmrService.emrServiceXml es = new gjtEmrService.emrServiceXml())
                {
                    try
                    {
                        string strResult = es.IsEnabledCommit(registryID, series);

                        if (strResult == "0")
                        {
                            noteStatusEnd = NoteStatus.Draft;
                            if (CommitFlag == true)
                            {
                                MessageBox.Show("已经超时提交过的文档不能再次提交,请与质管部门联系!", ErrorMessage.Warning, MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk);
                            }
                        }
                        else
                        {
                            emrNote.Attributes["NoteStatus"].Value = (Convert.ToInt32(noteStatusEnd)).ToString();

                            if ((Convert.ToInt32(noteStatusEnd)).ToString() == "1" && ThisAddIn.CanOption(ElementNames.CommitTime))
                            {
                                if (emrNote.Attributes["fanxiu"] == null || emrNote.Attributes["fanxiu"].Value == "No")
                                {
                                    emrNote.Attributes[AttributeNames.WrittenDate].Value = ThisAddIn.Today().ToString();
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        Globals.logAdapter.Record("EX741852968", ex.Message + ">>" + ex.ToString(), true);
                    }
                }
                if (ThisAddIn.UpdateOneEmrNote(registryID, emrNote, noteDoc) ==
                    Return.Failed)
                {
                    return(Return.Failed);
                }
            }
            else
            {
                OpDone opDone = new OpDone("离线,寄存失败!");
                opDone.Show();
                return(Return.Failed);
            }
            #endregion

            #region Update the local storage

            string noteID    = emrNote.Attributes[AttributeNames.NoteID].Value;
            string wdDocName = udt.MakeWdDocumentFileName(registryID, noteID, series, Globals.workFolder);
            File.Copy(tmpfile, wdDocName, true);
            if (Globals.localDocumentEncode)
            {
                udt.jj.EncodeEmrDocument(wdDocName);
            }

            string LastWriteTime = ThisAddIn.Today().ToFileTime().ToString();
            emrNote.Attributes[AttributeNames.NoteStatus].Value    = noteStatus.ToString("d");
            emrNote.Attributes[AttributeNames.LastWriteTime].Value = LastWriteTime;
            emrDoc.DocumentElement.SetAttribute(AttributeNames.LastWriteTime, LastWriteTime);
            emrDoc.Save(emrDocFile);
            udt.jj.EncodeEmrDocument(emrDocFile);
            #endregion

            return(Return.Successful);
        }