Пример #1
0
        private void search_Click(object sender, EventArgs e)
        {
            try
            {
                XmlNode patients = ThisAddIn.GetPatientsList(gjtEmrPatients.QueryMode.PatientName, txtName.Text.ToString().Trim());

                if (patients != null)
                {
                    if (patients.ChildNodes.Count > 0)
                    {
                        //string filename = Path.Combine(Globals.currentDirectory, "patients.xml");
                        //if (File.Exists(filename)) File.Delete(filename);
                        //XmlWriter writer = XmlWriter.Create(filename);
                        //patients.WriteTo(writer);
                        //writer.Close();
                        ThisAddIn.LoadTreeviewWithPatients(tvSelect, patients);
                    }
                    else
                    {
                        MessageBox.Show(EmrConstant.ErrorMessage.NoFindResult, EmrConstant.ErrorMessage.Warning);
                    }
                }
            }
            catch (Exception ex)
            {
                Globals.logAdapter.Record("EX925511256769", ex.Message + ">>" + ex.ToString(), true);
            }
        }
Пример #2
0
        private void LoadScoreDetail(string registryID)
        {
            XmlNode flaws = null;

            #region Get flaws from database
            using (EMR.gjtEmrService.emrServiceXml es = new EMR.gjtEmrService.emrServiceXml())
            {
                string msg = es.GetValuateDetail(selfReport, registryID, ref flaws);
                if (msg != null)
                {
                    MessageBox.Show(msg, ErrorMessage.Error);
                    return;
                }
            }
            if (flaws == null)
            {
                return;
            }
            #endregion
            dgvPatients.Visible = false;
            newLocation         = 0;
            foreach (XmlNode note in flaws.ChildNodes)
            {
                NewFlaw(note);
            }
            lbInfo.Text = ThisAddIn.GetPatientNameByRegistryID(registryID);
        }
Пример #3
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (ThisAddIn.CanOption(ElementNames.UKey))
     {
         IsUkey();
     }
 }
Пример #4
0
        private string OpenWordDoc(string wdDocName)
        {
            if (!File.Exists(wdDocName))
            {
                return(null);
            }
            object oMissing = System.Reflection.Missing.Value;
            string filename = wdDocName;

            try
            {
                this.Invoke(new EventHandler(btnExit_Click));
                axWbDoCView2.Navigate(filename, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
                return("success");
            }
            catch (Exception ex)
            {
                Globals.logAdapter.Record("EX925511256758", ex.Message + ">>" + ex.ToString(), true);

                ThisAddIn.killWordProcess();
                wordApp2 = null;
                axWbDoCView2.Navigate("about:blank");
                return(null);
            }
        }
Пример #5
0
        public bool DeleteEmrNote(int series)
        {
            XmlNode emrNote = GetEmrNoteBySeries(series);

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

            string registryID = emrDoc.DocumentElement.GetAttribute(AttributeNames.RegistryID);
            string noteID     = emrNote.Attributes[AttributeNames.NoteID].Value;

            if (!Globals.offline)
            {
                if (ThisAddIn.DeleteOneEmrNote(registryID, noteID, series)
                    == Return.Failed)
                {
                    return(Return.Failed);
                }
            }
            /* Update the local storage. */
            string LastWriteTime = ThisAddIn.Today().ToFileTime().ToString();

            emrDoc.DocumentElement.SetAttribute(AttributeNames.LastWriteTime, LastWriteTime);
            emrDoc.DocumentElement.RemoveChild(emrNote);
            emrDoc.Save(emrDocFile);
            udt.jj.EncodeEmrDocument(emrDocFile);

            string wdDocName = udt.MakeWdDocumentFileName(registryID, noteID, series, Globals.workFolder);

            File.Delete(wdDocName);

            return(Return.Successful);
        }
Пример #6
0
        public void SetLastPageNumber(string groupCode, int pageNumber)
        {
            string attributeLastPageNumber = AttributeNames.LastPageNumber;

            switch (groupCode)
            {
            case Groups.Two:
                attributeLastPageNumber = AttributeNames.LastPageNumber2;
                break;

            case Groups.Three:
                attributeLastPageNumber = AttributeNames.LastPageNumber3;
                break;
            }
            emrDoc.DocumentElement.SetAttribute(attributeLastPageNumber, pageNumber.ToString());
            if (!Globals.offline)
            {
                //20110712 gL  lose emrdoc
                XmlDocument xmlDoc = null;
                XmlElement  xmlEle = createEmptyXmlElement("Node", out xmlDoc);
                addXmlAttribute(xmlDoc, xmlEle, attributeLastPageNumber, pageNumber.ToString());
                ThisAddIn.updateTheEmrElementOfEmrDocument(
                    emrDoc.DocumentElement.GetAttribute(AttributeNames.RegistryID), xmlEle);
                /* Save document into database */
                //Globals.ThisAddIn.PutEmrDocumentForOneRegistry(
                //    emrDoc.DocumentElement.GetAttribute(AttributeNames.RegistryID), emrDoc.DocumentElement);
            }
            emrDoc.Save(emrDocFile);
            udt.jj.EncodeEmrDocument(emrDocFile);
        }
Пример #7
0
        private string RescueSequence(string registryID, string noteID)
        {
            XmlNode rescues = null;

            ThisAddIn.RescueTime(registryID, ref rescues);
            if (rescues == null)
            {
                return(null);
            }

            XmlNodeList emrNotes  = emrDoc.DocumentElement.SelectNodes(ElementNames.EmrNote);
            XmlNode     congeners = ThisAddIn.GetCongener0(noteID, emrNotes);

            if (congeners.ChildNodes.Count == 0)
            {
                return(rescues.FirstChild.Attributes[AttributeNames.RescueSequence].Value);
            }

            string sequence = null;

            foreach (XmlNode rescue in rescues.ChildNodes)
            {
                string commitT = "";
                sequence = rescue.Attributes[AttributeNames.RescueSequence].Value;
                if (ThisAddIn.NoteExistsWithSequence(AttributeNames.RescueSequence, sequence, congeners, ref commitT)
                    != null && commitT != "")
                {
                    continue;
                }
                break;
            }
            return(sequence);
        }
Пример #8
0
        private void txtUserCode_Leave(object sender, EventArgs e)
        {
            txtUserCode.Text = udt.NormalizeOpcode(txtUserCode.Text);
            lblUserName.Text = "";

            bool   ret      = Return.Failed;
            string userName = "";

            if (txtUserCode.Text.Length == 4)
            {
                ret = ThisAddIn.GetOperatorInf(txtUserCode.Text, ref userName, ref passwd, ref departmentCode, ref departName);
            }
            if (ret == Return.Successful)
            {
                lblUserName.Text     = userName;
                lblDepartment.Text   = departName;
                Globals.OpDepartName = departName;
                Globals.OpDepartID   = departmentCode;
            }
            else
            {
                lblUserName.Text   = "";
                lblDepartment.Text = "";
            }
        }
Пример #9
0
 public void SetGrading()
 {
     if (emrDoc.DocumentElement.Attributes["Grading"] == null)
     {
         ThisAddIn.SetGrade(emrDoc.DocumentElement.GetAttribute(AttributeNames.RegistryID));
     }
 }
Пример #10
0
        public CSelectP(MainForm etp)
        {
            InitializeComponent();
            emrTaskPane   = etp;
            this.Location = new Point(450, 120);


            if (ThisAddIn.CanOption(ElementNames.ArchiveDepartment))
            {
                cboQy.Enabled = !Globals.ArchiveDepartment;
                string str = ThisAddIn.CanOptionText(ElementNames.ArchiveDepartmentText).Trim();
                if (ThisAddIn.CanOption(ElementNames.ArchiveDepartment) && ThisAddIn.CanOptionText(ElementNames.ArchiveDepartmentText).Trim() != "")
                {
                    if (str.Contains(",") == true)
                    {
                        string[] strlist = str.Split(',');
                        foreach (string strEach in strlist)
                        {
                            if (strEach.Trim() == Globals.OpDepartID)
                            {
                                cboQy.Enabled = true;
                                cboHz.Enabled = true;
                                return;
                            }
                            else
                            {
                                cboQy.Enabled = false;
                                cboHz.Enabled = false;
                            }
                            return;
                        }
                    }
                }
            }
        }
Пример #11
0
        public void SetEditModes()
        {
            switch (editModes)
            {
            case EmrConstant.NoteEditMode.Nothing:
                emrTaskPane.SetReadonly();
                break;

            case EmrConstant.NoteEditMode.Checking:
                emrTaskPane.SetRevision2();
                //Globals.ThisAddIn.SetRevisionColor("审核者");
                break;

            case EmrConstant.NoteEditMode.FinallyCkecking:
                emrTaskPane.SetRevision2();
                //Globals.ThisAddIn.SetRevisionColor("终身者");
                break;

            case EmrConstant.NoteEditMode.Writing:
                if (ThisAddIn.CanOption(ElementNames.chxTrace) == true && Globals.Isfanxiu)
                {
                    emrTaskPane.SetRevision2();
                    Globals.Isfanxiu = false;
                }
                else
                {
                    emrTaskPane.SetReadWrite();
                }
                break;

            case EmrConstant.NoteEditMode.Reading:
                emrTaskPane.SetReadonly();
                break;
            }
        }
Пример #12
0
        private void btnCopyOrder1_Click(object sender, EventArgs e)
        {
            char padChar = ' ';

            //string copyText = "";
            for (int i = dgvOrder1.SelectedRows.Count - 1; i >= 0; i--)
            {
                string name   = dgvOrder1.SelectedRows[i].Cells[0].Value.ToString();
                int    length = TextLenght(name);
                int    spaces = 20 - length;
                copyText += name.PadRight(spaces + spaces + length, padChar);
                string quantity = dgvOrder1.SelectedRows[i].Cells[1].Value.ToString()
                                  + dgvOrder1.SelectedRows[i].Cells[2].Value.ToString();
                copyText += quantity.PadRight(8);
                copyText += dgvOrder1.SelectedRows[i].Cells[3].Value.ToString().PadRight(12);
                copyText += dgvOrder1.SelectedRows[i].Cells[4].Value.ToString();
                copyText += "\r";
            }
            //try
            //{
            //    WordApp.Selection.InsertAfter(copyText);
            //}
            //catch (Exception error)
            //{
            //    MessageBox.Show(error.Message, error.Source);
            //}
            ///* close current form */
            //this.Close();
            //FocusOnEnd();
            this.DialogResult = DialogResult.OK;
            ThisAddIn.ResetBeginTime();
        }
Пример #13
0
        private void lbTest_SelectedIndexChanged(object sender, EventArgs e)
        {
            dgvTest.Rows.Clear();
            XmlNode form = FindFormNote(EmrConstant.StringGeneral.Test, lbTest.SelectedItem.ToString());

            if (form == null)
            {
                return;
            }

            XmlNodeList items = form.ChildNodes;

            foreach (XmlNode item in items)
            {
                string name      = item.Attributes[EmrConstant.AttributeNames.Name].Value;
                string value     = item.Attributes[EmrConstant.AttributeNames.Value].Value;
                string unit      = item.Attributes[EmrConstant.AttributeNames.Unit].Value;
                string valueunit = item.Attributes[EmrConstant.AttributeNames.ValueUnit].Value;
                string result    = item.Attributes[EmrConstant.AttributeNames.Result].Value;
                dgvTest.Rows.Add(name, value, unit, valueunit, result);
            }
            SelectAllTestItems();

            ThisAddIn.ResetBeginTime();
        }
Пример #14
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            ThisAddIn.ResetBeginTime();
            DateTime endDate = dtpDischargedDate.Value;

            RegistryID = lsbArchiveList.Text;
            if (RegistryID == "")
            {
                MessageBox.Show("请选中需要归档的患者!", "提示");
                return;
            }

            if (JudgeNoteStatus(RegistryID) == 0)
            {
                return;
            }
            if (JudgeNoteFilingSetup(RegistryID) == 0)
            {
                return;
            }
            //JudgeNoteSign();

            ThisAddIn.Archive_Single(endDate, RegistryID, lsbArchiveList);
            ThisAddIn.ResetBeginTime();
        }
Пример #15
0
        private TimeSpan StayInHospitalHours(string noteID, string regID)
        {
            DateTime regdate       = ThisAddIn.StartTime(noteID, StartTime.Registry, regID);
            DateTime dischagedDate = ThisAddIn.StartTime(noteID, StartTime.Discharged, regID);
            TimeSpan passHours     = dischagedDate.Subtract(regdate);

            return(passHours);
        }
Пример #16
0
        private void pnlNote_DragDrop(object sender, DragEventArgs e)
        {
            object data = e.Data.GetData(DataFormats.StringFormat);

            string[] items = data.ToString().Split(Delimiters.Colon);
            NewFilingUC(items[1] + ":" + items[2], items[0]);
            ThisAddIn.ResetBeginTime();
        }
Пример #17
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            ThisAddIn.ResetBeginTime();
            DateTime endDate = dtpDischargedDate.Value;

            ThisAddIn.Archive_Search(endDate, lsbArchiveList);
            ThisAddIn.ResetBeginTime();
        }
Пример #18
0
        private bool SatisfiedCondition(string condition, string noteID, XmlNode emrdoc)
        {
            bool ret = false;

            switch (condition)
            {
            case Condition.Dead:
                DateTime deadtime = ThisAddIn.StartTime(noteID, StartTime.Dead, regID);
                if (deadtime == DateTime.MinValue)
                {
                    ret = false;
                }
                else
                {
                    ret = Absence(noteID, emrdoc);
                }
                break;

            case Condition.Operation:
                #region Operation
                XmlNode opetime = null;
                ThisAddIn.OperationTime(regID, ref opetime);
                if (opetime == null)
                {
                    ret = false;
                }
                else if (opetime.HasChildNodes)
                {
                    foreach (XmlNode item in opetime.ChildNodes)
                    {
                        string seq = item.Attributes[AttributeNames.Sequence].Value;
                        if (Absence(noteID, seq, emrdoc))
                        {
                            ret = true;
                            break;
                        }
                    }
                }
                #endregion
                break;

            case Condition.Hours48:
                if (StayInHospitalHours(noteID, regID).TotalHours > 48)
                {
                    ret = Absence(noteID, emrdoc);
                }
                break;

            case Condition.Hours72:
                if (StayInHospitalHours(noteID, regID).TotalHours > 72)
                {
                    ret = Absence(noteID, emrdoc);
                }
                break;
            }
            return(ret);
        }
Пример #19
0
        private void GetDocInfo(string registryID)
        {
            DataSet dst = new DataSet();

            using (gjtEmrService.emrServiceXml es = new gjtEmrService.emrServiceXml())
            {
                dst = es.GetTransferInfoExEx(registryID, Globals.DoctorID, false);


                DataTable dt = dst.Tables[0];
                dt.Columns.Add("选择", typeof(bool));
                dt.Columns["选择"].SetOrdinal(0);

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    dt.Rows[i]["选择"] = true;
                }


                if (dt.Rows.Count > 0)
                {
                    dataGridView1.DataSource = dt;
                    return;
                }
                string    noteID   = ThisAddIn.CanOptionText(ElementNames.ConsentID);
                XmlNode[] emrNotes = Globals.childPattern.GetChildNote(ThisAddIn.CanOptionText(ElementNames.ConsentID));
                DataTable dtN      = new DataTable();
                dtN.Columns.Add("选择", typeof(bool));
                dtN.Columns.Add("病历名称", typeof(string));
                dtN.Columns.Add("张数", typeof(int));

                string departmentCode = Globals.myConfig.GetDepartmentCode();
                foreach (XmlNode emrNote in emrNotes)
                {
                    if (emrNote == null)
                    {
                        break;
                    }
                    if (emrNote.Attributes[AttributeNames.BelongDepartment] != null && emrNote.Attributes[AttributeNames.BelongDepartment].Value != departmentCode)
                    {
                        continue;
                    }
                    string noteName = emrNote.Attributes[AttributeNames.NoteName].Value;
                    if (!HaveID(dt, noteName))
                    {
                        DataRow drTemp = dtN.NewRow();
                        drTemp["选择"]   = false;
                        drTemp["病历名称"] = noteName;
                        drTemp["张数"]   = 1;

                        dtN.Rows.Add(drTemp);
                    }
                }
                dataGridView1.DataSource = dtN;
            }
        }
Пример #20
0
 /*----------------------------------------------------------------------------------------------------
  * copy examination reports onto the word document
  * ------------------------------------------------------------------------------------------------------*/
 private void btCopyExam_Click(object sender, EventArgs e)
 {
     copyText          = rtbExam.Text.Replace("\n", " ");
     this.DialogResult = DialogResult.OK;
     //WordApp.Selection.InsertAfter(text);
     ///* close current form */
     //this.Close();
     //FocusOnEnd();
     ThisAddIn.ResetBeginTime();
 }
Пример #21
0
 public static void InitForNonQC()
 {
     /* Init auditSystem and auditLevelSystem */
     GetAuditSys();
     /* Lock emrDocuments for discharged patients */
     if (!Globals.offline && ThisAddIn.CanOption(ElementNames.AutoArchive))
     {
         Archive(Today(), null);
     }
 }
Пример #22
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            ThisAddIn.ResetBeginTime();
            XmlDocument doc   = new XmlDocument();
            XmlElement  rules = doc.CreateElement(ElementNames.Rules);

            #region Put into database
            using (gjtEmrService.emrServiceXml es = new gjtEmrService.emrServiceXml())
            {
                try
                {
                    string msg = "";


                    foreach (Control cc in pnlNote.Controls)
                    {
                        FilingUC FilingUC = (FilingUC)cc;
                        msg = es.NewFilingSetup(RegistryID, FilingUC.GetNoteID().Trim(), rules, Globals.DoctorID);
                    }

                    if (pnlNote.Controls.Count == 0)
                    {
                        if (szlx == "个人")
                        {
                            MessageBox.Show("个人归档项目设置为空,将自动引用此人所属科室归档项目", "提示");
                            return;
                        }
                        else
                        {
                            MessageBox.Show("设置完成", "提示");
                            return;
                        }
                    }

                    if (msg == null)
                    {
                        MessageBox.Show("设置完成", "提示");
                        return;
                    }
                    else
                    {
                        MessageBox.Show(msg, ErrorMessage.Error);
                        return;
                    }
                }
                catch (Exception ex)
                {
                    Globals.logAdapter.Record("EX925511256895", ex.Message + ">>" + ex.ToString(), true);

                    return;
                }
            }
            #endregion
            ThisAddIn.ResetBeginTime();
        }
Пример #23
0
        //public void Destroy(string registryID, PermissionLevel permission)
        //{
        //    if (emrDoc == null) return;
        //    if (permission != PermissionLevel.ReadOnly)
        //    {
        //        if (!Globals.offline)
        //        {
        //            ThisAddIn.SetTrafficLightToGreen(registryID);
        //        }
        //    }
        //    if (emrDoc.HasChildNodes) emrDoc.RemoveAll();
        //}
        private string ConsultSequence(string registryID, string noteID)
        {
            XmlNode consults = null;

            ThisAddIn.ConsultTime(registryID, Globals.PatientConsultSequence, ref consults);
            if (consults == null)
            {
                return(null);
            }
            return(consults.FirstChild.Attributes[AttributeNames.Sequence].Value);
        }
Пример #24
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     if (txtPassword.Text == "")
     {
         return;
     }
     if (ThisAddIn.CanOption(ElementNames.UKey))
     {
         IsUkey(); return;
     }
     if (lblUserName.Text.Trim() != "" && txtPassword.Text == passwd)
     {
         Globals.DoctorID   = txtUserCode.Text;
         Globals.OpDepartID = departmentCode;
         Globals.DoctorName = lblUserName.Text;
         // Globals.AreaID = ThisAddIn.GetAreaID(departmentCode);
         XmlNode Config = null;
         string  msg    = ThisAddIn.GetConfig(ref Config);
         if (msg == null || msg == "")
         {
             Globals.Config = Config;
             RetrieveMyroles(txtUserCode.Text);
             //ThisAddIn.RetrieveMyrolesHIS(txtUserCode.Text);
             this.DialogResult  = DialogResult.OK;
             txtPassword.Text   = "";
             txtUserCode.Text   = "";
             lblUserName.Text   = "";
             lblDepartment.Text = "";
             txtUserCode.Focus();
             this.Hide();
             if (Globals.WriteOff)
             {
                 MainForm m = new MainForm();
                 m.Show();
                 Globals.WriteOff = false;
             }
             return;
         }
         MessageBox.Show(msg);
         this.DialogResult = DialogResult.Cancel;
         this.Close();
     }
     else
     {
         MessageBox.Show("无效的用户名或密码!");
         txtUserCode.Text = "";
         txtPassword.Text = "";
         departmentCode   = "";
         lblUserName.Text = "";
         departName       = "";
     }
 }
Пример #25
0
        private void tvNotes_ItemDrag(object sender, ItemDragEventArgs e)
        {
            ThisAddIn.ResetBeginTime();
            TreeNode note = (TreeNode)e.Item;

            if (note.Nodes.Count > 0)
            {
                return;
            }
            object item = note.Text + ":" + note.Name;

            DoDragDrop(item, DragDropEffects.Copy);
        }
Пример #26
0
        public void UncommitConsult(int series)
        {
            XmlNode emrNote    = GetEmrNoteBySeries(series);
            string  RegistryID = emrDoc.DocumentElement.Attributes[AttributeNames.RegistryID].Value;

            if (emrNote.Attributes[AttributeNames.Sequence] == null)
            {
                return;
            }
            string Sequence = emrNote.Attributes[AttributeNames.Sequence].Value;

            ThisAddIn.UncommitConsultNote(Sequence, RegistryID);
        }
Пример #27
0
        private void FilingSetup_Resize(object sender, EventArgs e)
        {
            ThisAddIn.ResetBeginTime();
            split.Height = this.Height - split.Top - 34;
            split.Width  = this.Width - 8;


            if (this.Tag != null)
            {
                RemoveFilingUC(this.Tag.ToString());
                this.Tag = null;
            }
            RerangeFilingUC();
        }
Пример #28
0
        private void Passed()
        {
            if (ThisAddIn.CanOption(ElementNames.OperatorDepartment))
            {
                ThisAddIn.ChangeDepartment(departmentCode);
            }

            //  Globals.qualityInfo = Globals.myConfig.GetShowQCI(txtUserCode.Text);

            if (Globals.inStyle)
            {
                //     Globals.QualityInfo(txtUserCode.Text.Trim());
            }
        }
Пример #29
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     ThisAddIn.ResetBeginTime();
     if (rtbReasion.Text.Length > 0)
     {
         if (MessageBox.Show("放弃开封操作?", ErrorMessage.Warning, MessageBoxButtons.YesNo,
                             MessageBoxIcon.Question, MessageBoxDefaultButton.Button1)
             == DialogResult.No)
         {
             return;
         }
     }
     DialogResult = DialogResult.Cancel;
     Close();
 }
Пример #30
0
        private bool Late(string noteID, XmlNode emrdoc)
        {
            DateTime lwt = DateTime.Now;

            foreach (XmlNode note in emrdoc.SelectNodes(ElementNames.EmrNote))
            {
                if (noteID == note.Attributes[AttributeNames.NoteID].Value)
                {
                    long lastWritenTime = Convert.ToInt64(note.Attributes[AttributeNames.LastWriteTime].Value);
                    lwt = DateTime.FromFileTime(lastWritenTime);
                    break;
                }
            }

            return
                (ThisAddIn.TimeOutEmr(noteID, emrdoc.Attributes[AttributeNames.RegistryID].Value, lwt));
        }