private TreeNode FindRecordNode(int aRecordID) { for (int i = 0; i < tvRecord.Nodes.Count; i++) { if (EMR.TreeNodeIsRecord(tvRecord.Nodes[i])) { return(tvRecord.Nodes[i]); } } return(null); }
private void DoSyncDeItem(object sender, HCCustomData aData, HCCustomItem aItem) { if (aItem is DeItem) { DeItem vDeItem = aItem as DeItem; if (vDeItem.IsElement) { string vDeIndex = vDeItem[DeProp.Index]; if (vDeIndex != "") { DataRow[] vDataRows = FDataElementSetMacro.Select("ObjID=" + vDeIndex); if (vDataRows.Length == 1) // 有此数据元的替换信息 { string vsResult = ""; switch (vDataRows[0]["MacroType"].ToString()) { case "1": // 患者信息(客户端处理) vsResult = EMR.GetValueAsString(PatientInfo.FieldByName(vDataRows[0]["Macro"].ToString())); break; case "2": // 用户信息(客户端处理) vsResult = EMR.GetValueAsString(UserInfo.FieldByName(vDataRows[0]["Macro"].ToString())); break; case "3": // 病历信息(服务端处理) vsResult = GetDeValueFromStruct(PatientInfo.PatID, int.Parse(vDataRows[0]["Macro"].ToString()), vDeItem[DeProp.Index]); break; case "4": // 环境信息(服务端,如当前时间等) vsResult = EMR.GetValueAsString(FServerInfo.FieldByName(vDataRows[0]["Macro"].ToString())); break; case "5": // SQL脚本(服务端处理) vsResult = GetMarcoSqlResult(vDeIndex, vDataRows[0]["Macro"].ToString()); break; default: break; } if (vsResult != "") { vDeItem.Text = vsResult; } } } } } }
private void 导出XML结构ToolStripMenuItem_Click(object sender, EventArgs e) { if (!EMR.TreeNodeIsRecord(tvRecord.SelectedNode)) { return; } int vDesPID = -1, vDesID = -1, vRecordID = -1; GetNodeRecordInfo(tvRecord.SelectedNode, ref vDesPID, ref vDesID, ref vRecordID); if (vRecordID > 0) { SaveFileDialog vSaveDlg = new SaveFileDialog(); vSaveDlg.Filter = "XML|*.xml"; vSaveDlg.ShowDialog(); if (vSaveDlg.FileName != "") { int vPageIndex = GetRecordPageIndex(vRecordID); if (vPageIndex < 0) { LoadPatientRecordContent(tvRecord.SelectedNode.Tag as RecordInfo); vPageIndex = GetRecordPageIndex(vRecordID); } else { tabRecord.SelectedIndex = vPageIndex; } frmRecord vFrmRecord = GetPageRecord(vPageIndex); string vFileName = Path.GetExtension(vSaveDlg.FileName); if (vFileName.ToLower() != ".xml") { vFileName = vSaveDlg.FileName + ".xml"; } else { vFileName = vSaveDlg.FileName; } SaveStructureToXml(vFrmRecord, vFileName); } } }
private void 编辑ToolStripMenuItem_Click(object sender, EventArgs e) { if (!EMR.TreeNodeIsRecord(tvRecord.SelectedNode)) { return; } int vDesPID = -1, vDesID = -1, vRecordID = -1; GetNodeRecordInfo(tvRecord.SelectedNode, ref vDesPID, ref vDesID, ref vRecordID); if (vRecordID > 0) { int vPageIndex = GetRecordPageIndex(vRecordID); if (vPageIndex < 0) { LoadPatientRecordContent(tvRecord.SelectedNode.Tag as RecordInfo); vPageIndex = GetRecordPageIndex(vRecordID); } else { tabRecord.SelectedIndex = vPageIndex; } frmRecord vFrmRecord = GetPageRecord(vPageIndex); vFrmRecord.EmrView.ReadOnly = false; vFrmRecord.EmrView.UpdateView(); try { vFrmRecord.EmrView.Trace = emrMSDB.DB.GetInchRecordSignature(vRecordID); if (vFrmRecord.EmrView.Trace) { MessageBox.Show("病历已经签名,后续的修改将留下修改痕迹!"); } } catch (Exception exp) { vFrmRecord.EmrView.ReadOnly = true; MessageBox.Show("编辑病历失败!" + exp.Message + "\n\r" + emrMSDB.DB.ErrMsg); } } }
private void 查看ToolStripMenuItem_Click(object sender, EventArgs e) { if (!EMR.TreeNodeIsRecord(tvRecord.SelectedNode)) { return; } int vDesPID = -1, vDesID = -1, vRecordID = -1; GetNodeRecordInfo(tvRecord.SelectedNode, ref vDesPID, ref vDesID, ref vRecordID); if (vRecordID > 0) { int vPageIndex = GetRecordPageIndex(vRecordID); if (vPageIndex < 0) { LoadPatientRecordContent(tvRecord.SelectedNode.Tag as RecordInfo); vPageIndex = GetRecordPageIndex(vRecordID); } else { tabRecord.SelectedIndex = vPageIndex; } frmRecord vFrmRecord = null; try { vFrmRecord = GetPageRecord(vPageIndex); } finally { vFrmRecord.EmrView.ReadOnly = true; } vFrmRecord.EmrView.Trace = emrMSDB.DB.GetInchRecordSignature(vRecordID); } }
private void tbxPY_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Return) { if (tbxPY.Text == "") { ShowDataElement(); } else { DataRow[] vRows = null; if (EMR.IsPY(tbxPY.Text[0])) { vRows = emrMSDB.DB.DataElementDT.Select("py like '%" + tbxPY.Text + "%'"); } else { vRows = emrMSDB.DB.DataElementDT.Select("dename like '%" + tbxPY.Text + "%'"); } ShowDataElement(vRows); } } }
public static void GetNodeRecordInfo(TreeNode aNode, ref int aDesPID, ref int aDesID, ref int aRecordID) { aDesPID = -1; aDesID = -1; aRecordID = -1; if (EMR.TreeNodeIsRecord(aNode)) { aDesID = (aNode.Tag as RecordInfo).DesID; aRecordID = (aNode.Tag as RecordInfo).ID; aDesPID = -1; TreeNode vNode = aNode; while (vNode.Parent != null) { vNode = vNode.Parent; if (EMR.TreeNodeIsRecordDataSet(vNode)) { aDesPID = (vNode.Tag as RecordDataSetInfo).DesPID; break; } } } }
private void 预览全部病程ToolStripMenuItem_Click(object sender, EventArgs e) { if (!EMR.TreeNodeIsRecord(tvRecord.SelectedNode)) { return; } int vDesPID = -1, vDesID = -1, vRecordID = -1; GetNodeRecordInfo(tvRecord.SelectedNode, ref vDesPID, ref vDesID, ref vRecordID); if (vDesPID == DataSetInfo.Proc) { int vPageIndex = GetRecordPageIndex(-vDesPID); if (vPageIndex < 0) { LoadPatientDataSetContent(vDesPID); } else { tabRecord.SelectedIndex = vPageIndex; } } }