private void btnOk_Click(object sender, EventArgs e) { try { if (checkedListBoxControlEmrNode.CheckedItems.Count == 0) { MyMessageBox.Show("没有需要导入的病历,请勾选【病历列表】中的病历。", "提示", MyMessageBoxButtons.Ok, DrectSoft.Common.Ctrs.DLG.MessageBoxIcon.WarningIcon); return; } List <EmrNode> emrNodeList = new List <EmrNode>(); foreach (ListBoxItem item in checkedListBoxControlEmrNode.CheckedItems) { EmrNode emrNode = item.Value as EmrNode; emrNodeList.Add(emrNode); } //保存选中的历史病历 m_HistoryEmrBll.HistoryEmrBatchIn(emrNodeList, null); MyMessageBox.Show("历史病历导入成功", "提示", MyMessageBoxButtons.Ok, DrectSoft.Common.Ctrs.DLG.MessageBoxIcon.InformationIcon); this.Close(); RefreshEMRMainPad(); return; } catch (Exception ex) { MyMessageBox.Show(1, ex); } }
private void checkedListBoxControlEmrNode_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e) { try { if (e.State == CheckState.Checked) { EmrNode emrNode = checkedListBoxControlEmrNode.Items[e.Index].Value as EmrNode; if (emrNode != null) { if (emrNode.DataRowItem["isfirstdaily"].ToString() == "1") { EmrModel firstDailyEmrModelInMemory = Util.GetFirstDailyEmrModel(m_CurrentUCEmrInput.CurrentInputBody.CurrentTreeList); //获取内存中是否存在首次病程的节点 bool isHasFirstDailyEmrInDataBase = m_HistoryEmrBll.IsHasFirstDailyEmr(m_CurrentInpatient.NoOfFirstPage.ToString()); //获取数据库中是否存在首次病程的节点 if (firstDailyEmrModelInMemory != null && isHasFirstDailyEmrInDataBase) { MyMessageBox.Show("该病人已经存在首次病程,不能重复导入。", "提示", MyMessageBoxButtons.Ok, DrectSoft.Common.Ctrs.DLG.MessageBoxIcon.WarningIcon); checkedListBoxControlEmrNode.Items[e.Index].CheckState = CheckState.Unchecked; return; } } } foreach (CheckedListBoxItem subItem in checkedListBoxControlEmrNode.Items) { if (subItem.CheckState == CheckState.Unchecked) { SetCheckAllStateUnEvent(false); return; } } SetCheckAllStateUnEvent(true); } else { SetCheckAllStateUnEvent(false); } } catch (Exception ex) { MyMessageBox.Show(1, ex); } }
private void SelectedIndexChanged(int selectedIndex) { try { if (selectedIndex < 0) { return; } m_CurrentEditorForm.CurrentEditorControl.EMRDoc.ClearContent(); EmrNode emrNode = checkedListBoxControlEmrNode.Items[selectedIndex].Value as EmrNode; if (emrNode != null) { if (emrNode.DataRowItem["content"].ToString() == "") { emrNode.DataRowItem["content"] = m_HistoryEmrBll.GetEmrContentByID(emrNode.ID); } string content = emrNode.DataRowItem["content"].ToString(); if (content != "") { try { XmlDocument doc = new XmlDocument(); doc.PreserveWhitespace = true; doc.LoadXml(content); m_CurrentEditorForm.CurrentEditorControl.LoadXML(doc); InitEditor(); m_CurrentEditorForm.CurrentEditorControl.EMRDoc.Content.SelectStart = 0; m_CurrentEditorForm.CurrentEditorControl.ScrollViewtopToCurrentElement(); } catch { } } } } catch (Exception ex) { throw ex; } }
private void checkedListBoxControlEmrNode_MouseDown(object sender, MouseEventArgs e) { try { if (e.Button != System.Windows.Forms.MouseButtons.Left) { return; } Point point = checkedListBoxControlEmrNode.PointToClient(Cursor.Position); int itemIndex = checkedListBoxControlEmrNode.IndexFromPoint(point); if (itemIndex >= 0) { CheckedListBoxItem item = (CheckedListBoxItem)checkedListBoxControlEmrNode.GetItem(itemIndex); if (point.X >= 4 && point.X <= 16) { if (m_FocusedCheckItem != item) { if (item.CheckState == CheckState.Checked) { item.CheckState = CheckState.Unchecked; } else { item.CheckState = CheckState.Checked; } } m_FocusedCheckItem = item; return; } m_CurrentEditorForm.CurrentEditorControl.EMRDoc.ClearContent(); if (item != null) { EmrNode emrNode = item.Value as EmrNode; if (emrNode != null) { if (emrNode.DataRowItem["content"].ToString() == "") { emrNode.DataRowItem["content"] = m_HistoryEmrBll.GetEmrContentByID(emrNode.ID); } string content = emrNode.DataRowItem["content"].ToString(); if (content != "") { try { XmlDocument doc = new XmlDocument(); doc.PreserveWhitespace = true; doc.LoadXml(content); m_CurrentEditorForm.CurrentEditorControl.LoadXML(doc); InitEditor(); m_CurrentEditorForm.CurrentEditorControl.EMRDoc.Content.SelectStart = 0; m_CurrentEditorForm.CurrentEditorControl.ScrollViewtopToCurrentElement(); } catch { } } } } m_FocusedCheckItem = item; } } catch (Exception ex) { MyMessageBox.Show(1, ex); } }
private void HistoryEmrBatchInInner(EmrNode node, string deptChangeID) { try { SqlParameter[] parms = new SqlParameter[] { new SqlParameter("@noofinpat", SqlDbType.VarChar), new SqlParameter("@templateid", SqlDbType.VarChar), new SqlParameter("@name", SqlDbType.VarChar), new SqlParameter("@content", SqlDbType.VarChar), new SqlParameter("@sortid", SqlDbType.VarChar), new SqlParameter("@owner", SqlDbType.VarChar), new SqlParameter("@createtime", SqlDbType.VarChar), new SqlParameter("@captiondatetime", SqlDbType.VarChar), new SqlParameter("@firstdailyflag", SqlDbType.VarChar), new SqlParameter("@isyihuangougong", SqlDbType.VarChar), new SqlParameter("@ip", SqlDbType.VarChar), new SqlParameter("@isconfigpagesize", SqlDbType.VarChar), new SqlParameter("@departcode", SqlDbType.VarChar), new SqlParameter("@wardcode", SqlDbType.VarChar), new SqlParameter("@changeid", SqlDbType.VarChar) }; parms[0].Value = m_Inpatient.NoOfFirstPage; parms[1].Value = node.DataRowItem["templateid"].ToString(); if (node.DataRowItem["sortid"].ToString() == "AC") { parms[2].Value = node.DataRowItem["mr_name"].ToString() + " " + node.DataRowItem["captiondatetime"].ToString() + " " + m_Host.User.Name; } else { parms[2].Value = node.DataRowItem["mr_name"].ToString() + " " + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " " + m_Host.User.Name; } string emrContent = node.DataRowItem["content"].ToString(); emrContent = Util.ProcessEmrContent(emrContent);//处理病历中的SaveLog节点和creator、deleter属性的值 parms[3].Value = emrContent; parms[4].Value = node.DataRowItem["sortid"].ToString(); parms[5].Value = m_Host.User.Id; parms[6].Value = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); parms[7].Value = node.DataRowItem["captiondatetime"].ToString(); parms[8].Value = node.DataRowItem["isfirstdaily"].ToString(); parms[9].Value = node.DataRowItem["isyihuangoutong"].ToString(); parms[10].Value = DS_Common.GetIPHost(); parms[11].Value = node.DataRowItem["isconfigpagesize"].ToString(); parms[12].Value = m_Host.User.CurrentDeptId; parms[13].Value = m_Host.User.CurrentWardId; parms[14].Value = null == deptChangeID ? string.Empty : deptChangeID; string sqlInsert = @"INSERT INTO recorddetail(id, noofinpat, templateid, name, content, sortid, owner, createtime, valid, hassubmit, hasprint, hassign, captiondatetime, islock, firstdailyflag, isyihuangoutong, ip, isconfigpagesize, departcode, wardcode, changeid) VALUES(seq_recorddetail_id.nextval, @noofinpat, @templateid, @name, @content, @sortid, @owner, @createtime, '1', '4600', '3600', '0', @captiondatetime, '4700', @firstdailyflag, @isyihuangougong, @ip, @isconfigpagesize, @departcode, @wardcode, @changeid)"; DS_SqlHelper.ExecuteNonQuery(sqlInsert, parms, CommandType.Text); } catch (Exception ex) { throw ex; } }
private void btnOk_Click(object sender, EventArgs e) { try { if (checkedListBoxControlEmrNode.CheckedItems.Count == 0) { MyMessageBox.Show("没有需要导入的病历,请勾选【病历列表】中的病历。", "提示", MyMessageBoxButtons.Ok, DrectSoft.Common.Ctrs.DLG.MessageBoxIcon.WarningIcon); return; } else { List <EmrNode> emrNodeList = new List <EmrNode>(); foreach (ListBoxItem item in checkedListBoxControlEmrNode.CheckedItems) { EmrNode emrNode = item.Value as EmrNode; emrNodeList.Add(emrNode); } if (emrNodeList.Any(node => { if (node.DataRowItem["sortid"].ToString() == "AC") { return(true); } return(false); })) { //检查在内存中或数据库中是否存在首次病程 bool isHaveFirstDailyEmr = CheckIsHaveFirstDailyEmr(); //判断是否选择首次病程 if (emrNodeList.Any(node => { if (node.DataRowItem["sortid"].ToString() == "AC" && node.DataRowItem["isfirstdaily"].ToString() == "1") { return(true); } return(false); })) {//有选择首次病程 if (isHaveFirstDailyEmr) { MyMessageBox.Show("已经存在首次病程,不能重复导入", "提示", MyMessageBoxButtons.Ok, DrectSoft.Common.Ctrs.DLG.MessageBoxIcon.WarningIcon); return; } } else {//没有选择首次病程 if (!isHaveFirstDailyEmr) { MyMessageBox.Show("导入病程时同时需要导入首次病程,请选择", "提示", MyMessageBoxButtons.Ok, DrectSoft.Common.Ctrs.DLG.MessageBoxIcon.WarningIcon); return; } } int dayCnt = 0; emrNodeList = emrNodeList.OrderBy(node => { return(Convert.ToDateTime(node.DataRowItem["captiondatetime"])); }).ToList(); foreach (EmrNode node in emrNodeList) { if (node.DataRowItem["sortid"].ToString() == "AC") { node.DataRowItem["captiondatetime"] = System.DateTime.Now.AddDays(dayCnt).ToString("yyyy-MM-dd HH:mm:ss"); dayCnt++; } } HistoryEmrTimeAndCaption timeAndCaption = new HistoryEmrTimeAndCaption(emrNodeList, m_CurrentUCEmrInput); timeAndCaption.StartPosition = FormStartPosition.CenterScreen; if (timeAndCaption.ShowDialog() == System.Windows.Forms.DialogResult.OK) { //保存选中的历史病历 m_HistoryEmrBll.HistoryEmrBatchIn(emrNodeList, m_DeptChangeID); MyMessageBox.Show("历史病历导入成功", "提示", MyMessageBoxButtons.Ok, DrectSoft.Common.Ctrs.DLG.MessageBoxIcon.InformationIcon); this.Close(); RefreshEMRMainPad(); return; } else { return; } } //保存选中的历史病历 m_HistoryEmrBll.HistoryEmrBatchIn(emrNodeList, m_DeptChangeID); MyMessageBox.Show("历史病历导入成功", "提示", MyMessageBoxButtons.Ok, DrectSoft.Common.Ctrs.DLG.MessageBoxIcon.InformationIcon); this.Close(); RefreshEMRMainPad(); return; } } catch (Exception ex) { MyMessageBox.Show(1, ex); } }