public static string GetAreaCodeOfDepartment(string departmentCode) { using (gjtEmrPatients.emrPatients pi = new gjtEmrPatients.emrPatients()) { return(pi.GetAreaCodeOfDepartment(departmentCode)); } }
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; } }
public DataTable GetDataNew() { string strStart = dateTimePickerStart.Value.ToString(); string[] strListStart = strStart.Split(' '); strStart = strListStart[0].ToString() + " 00:00:00"; string strEnd = dateTimePickerEnd.Value.ToString() + " 23:59:59"; string[] strListEnd = strEnd.Split(' '); strEnd = strListEnd[0].ToString() + " 23:59:59"; DataTable dt = new DataTable(); dt.TableName = "getqc"; DataSet dst = new DataSet(); using (gjtEmrPatients.emrPatients pi = new gjtEmrPatients.emrPatients()) { dst = pi.GetQCTableByMonthEndNew(strStart, strEnd, "$", Globals.DoctorID); dt = dst.Tables[0]; } return(dt); }
public static void Archive_Single(DateTime endDischargedDate, String RegistryID, ListBox archiveList) { /* Get a set of registryIDs from local storage. */ //XmlNode inRegistryIDs = GetInRegistryIDs(); XmlDocument doc = new XmlDocument(); XmlNode inRegistryIDs = doc.CreateElement(EmrConstant.ElementNames.RegistryIDs); XmlElement inRegistryID = doc.CreateElement(EmrConstant.ElementNames.RegistryID); inRegistryID.InnerText = RegistryID; inRegistryIDs.AppendChild(inRegistryID); XmlNode outRegistryIDs = doc.CreateElement(EmrConstant.ElementNames.RegistryIDs); /* Are there discharged in this set. */ using (gjtEmrPatients.emrPatients ep = new gjtEmrPatients.emrPatients()) { try { ep.IsDischarged(inRegistryIDs, endDischargedDate, ref outRegistryIDs); } catch (Exception ex) { Globals.logAdapter.Record("EX7569874508", ex.Message + ">>" + ex.ToString(), true); return; } } /* No discharged patients */ if (outRegistryIDs.ChildNodes.Count == 0) { return; } /* Set lock flag of the emrDocuments for these patients. */ using (gjtEmrService.emrServiceXml es = new gjtEmrService.emrServiceXml()) { try { es.ArchiveBatch(outRegistryIDs); } catch (Exception ex) { Globals.logAdapter.Record("EX756987451988", ex.Message + ">>" + ex.ToString(), true); return; } } /* Clear the loacl storage. */ foreach (XmlNode outRegistryID in outRegistryIDs) { Directory.Delete(Path.Combine(Globals.workFolder, outRegistryID.InnerText), true); if (archiveList != null) { archiveList.Items.Remove(outRegistryID.InnerText); archiveList.Update(); } } }
public static string GetPatientNameByRegistryID(string registryID) { using (gjtEmrPatients.emrPatients pi = new gjtEmrPatients.emrPatients()) { string archiveNum = null; string pname = null; pi.GetNameAndArchiveNumberForInpatient(registryID, ref pname, ref archiveNum); return(pname); } }
public static bool DegreeOrderTime(string registryID, ref XmlNode degreeOrder) { using (gjtEmrPatients.emrPatients pi = new gjtEmrPatients.emrPatients()) { string msg = pi.DegreeOrderTime(registryID, ref degreeOrder); if (msg != null) { MessageBox.Show(msg, ErrorMessage.Error); return(false); } } return(true); }
public static DateTime LastDegreeOrderTime(string registryID) { DateTime dot = DateTime.MinValue; using (gjtEmrPatients.emrPatients pi = new gjtEmrPatients.emrPatients()) { string msg = pi.LastStratTimeForDegreeOrder(registryID, ref dot); if (msg != null) { MessageBox.Show(msg, ErrorMessage.Error); } } return(dot); }
private static void AssignInitialRolesForAllOperators() { XmlNode ops = null; string msg = null; #region Get operators using (gjtEmrPatients.emrPatients ep = new gjtEmrPatients.emrPatients()) { msg = ep.Getoperators(ref ops); if (msg != null) { MessageBox.Show(msg, ErrorMessage.Error); return; } } #endregion using (gjtEmrService.emrServiceXml es = new gjtEmrService.emrServiceXml()) { XmlNode roles = null; msg = es.GetRolesForOneOperator(StringGeneral.supperUser, ref roles); if (msg != null) { MessageBox.Show(msg, ErrorMessage.Error); return; } /* If hi has been assigned as roles, initial can not be done again. */ if (roles != null) { return; } foreach (XmlNode op in ops) { XmlElement roleid0 = op.OwnerDocument.CreateElement(ElementNames.RoleID); roleid0.InnerText = "01"; op.AppendChild(roleid0); XmlElement roleid1 = op.OwnerDocument.CreateElement(ElementNames.RoleID); roleid1.InnerText = "03"; op.AppendChild(roleid1); msg = es.SetOperatorRoles(op); if (msg != null) { MessageBox.Show(msg, ErrorMessage.Error); return; } } } }
public static DateTime StartTime(string noteID, string stime, string registryID) { DateTime fromTime = DateTime.MinValue; using (gjtEmrPatients.emrPatients pi = new gjtEmrPatients.emrPatients()) { string msg = pi.GetStartTime(noteID, stime, registryID, ref fromTime); if (msg != null) { MessageBox.Show(msg, EmrConstant.ErrorMessage.Error); return(fromTime); } return(fromTime); } }
private void SetYsbm() { DataSet ds = null; using (gjtEmrPatients.emrPatients ep = new gjtEmrPatients.emrPatients()) { ds = ep.GetValuateNowYsm(lblBH.Text); if (ds != null && ds.Tables.Count != 0 && ds.Tables[0].Rows.Count != 0) { lblZz.Text = ds.Tables[0].Rows[0][1].ToString(); //主任医师ChiefDoctor lblZg.Text = ds.Tables[0].Rows[0][0].ToString(); //主管医师 lblZr.Text = ds.Tables[0].Rows[0][2].ToString(); //责任医师 } } }
private void get_jtgx(DataRow dr, string para1) { string jtgxbm = dr[para1].ToString(); using (gjtEmrPatients.emrPatients ep = new gjtEmrPatients.emrPatients()) { DataSet ds = ep.GetMedicalDataEx("JTGXDM", jtgxbm); if (ds.Tables[0].Rows.Count == 0) { return; } DataRow dr1 = ds.Tables[0].Rows[0]; dr[para1] = dr1["JTGX"].ToString(); } }
private void get_gjmc(DataRow dr, string para1) { string gjbm = dr[para1].ToString(); using (gjtEmrPatients.emrPatients ep = new gjtEmrPatients.emrPatients()) { DataSet ds = ep.GetMedicalDataEx("SJDM", gjbm); if (ds.Tables[0].Rows.Count == 0) { return; } DataRow dr1 = ds.Tables[0].Rows[0]; dr[para1] = dr1["ZWMC_1"].ToString(); } }
public void ShowVs() { string Knock = this.lbKnock.Text; string Score = this.lbScore.Text; string strDep = patientDepartment; using (gjtEmrPatients.emrPatients ep = new gjtEmrPatients.emrPatients()) { strDep = ep.GetDepartmentName(patientDepartment); } bool blSelf = false; string strRegistryID = regID; blSelf = true; GetNewReport(GetData(blSelf, strRegistryID), Score, Knock, strDep); }
private static XmlNode GetDoctorNames() { using (gjtEmrPatients.emrPatients pi = new gjtEmrPatients.emrPatients()) { try { return(pi.DoctorNameList()); } catch (Exception ex) { Globals.logAdapter.Record("EX121584274152", ex.Message + ">>" + ex.ToString(), true); return(null); } } }
private void cbxAreaLoad() { //cbDepartment.SelectedIndex = -1; XmlNode areas = null; using (gjtEmrPatients.emrPatients pi = new gjtEmrPatients.emrPatients()) { areas = pi.GetAreas(); } cbxArea.Items.Clear(); foreach (XmlNode area in areas.SelectNodes(ElementNames.Area)) { string text = area.Attributes[AttributeNames.Code].Value + Delimiters.Space + area.Attributes[AttributeNames.Name].Value; cbxArea.Items.Add(text); } if (cbxArea.Items.Count == 0) { return; } /* Show current department set*/ //cbDepartment.SelectedIndex = -1; string code = Globals.myConfig.GetAreaCode(); if (code == StringGeneral.NullCode) { string departmentCode = Globals.myConfig.GetDepartmentCode(); code = ThisAddIn.GetAreaCodeOfDepartment(departmentCode); if (code == null || code.Length == 0) { cbxArea.SelectedIndex = 0; return; } } for (int i = 0; i < cbxArea.Items.Count; i++) { if (code == cbxArea.Items[i].ToString().Split(' ')[0]) { cbxArea.SelectedIndex = i; return; } } cbxArea.SelectedIndex = 0; }
public static void Archive_Search(DateTime endDischargedDate, ListBox archiveList) { /* Get a set of registryIDs from local storage. */ XmlNode inRegistryIDs = GetInRegistryIDs(); XmlDocument doc = new XmlDocument(); XmlNode outRegistryIDs = doc.CreateElement(EmrConstant.ElementNames.RegistryIDs); /* Are there discharged in this set. */ using (gjtEmrPatients.emrPatients ep = new gjtEmrPatients.emrPatients()) { try { ep.IsDischarged(inRegistryIDs, endDischargedDate, ref outRegistryIDs); } catch (Exception ex) { Globals.logAdapter.Record("EX756987457749", ex.Message + ">>" + ex.ToString(), true); return; } } /* No discharged patients */ if (outRegistryIDs.ChildNodes.Count == 0) { return; } /* Add to archiveList. */ archiveList.Items.Clear(); foreach (XmlNode outRegistryID in outRegistryIDs) { if (archiveList != null) { archiveList.Items.Add(outRegistryID.InnerText); archiveList.Update(); } } }
public static bool FinishConsultNote(string sequence, string registryID) { using (gjtEmrPatients.emrPatients ep = new gjtEmrPatients.emrPatients()) { try { string msg = ep.FinishConsultNote(sequence, registryID, Globals.DoctorID); if (msg != null) { MessageBox.Show(msg, ErrorMessage.Error); return(Return.Failed); } return(Return.Successful); } catch (Exception ex) { Globals.logAdapter.Record("EX4563584274152", ex.Message + ">>" + ex.ToString(), true); return(Return.Failed); } } }
public DataTable GetDataNew() { string strStart = dateTimePickerStart.Value.ToString(); string[] strListStart = strStart.Split(' '); strStart = strListStart[0].ToString() + " 00:00:00"; string strEnd = dateTimePickerEnd.Value.ToString() + " 23:59:59"; string[] strListEnd = strEnd.Split(' '); strEnd = strListEnd[0].ToString() + " 23:59:59"; DataTable dt = new DataTable(); dt.TableName = "getqc"; using (gjtEmrPatients.emrPatients pi = new gjtEmrPatients.emrPatients()) { // DataSet dst = pi.GetQCTableByMonthNew(strStart, strEnd, "$", Globals.DoctorID); if (ks) { // dt = pi.ValuateNowPSSelect(strStart, strEnd, Globals.OpDepartID); dt = pi.ValuateNowPSSelectKs(strStart, strEnd, Globals.OpDepartName); } else if (hz) { // dt = pi.ValuateNowPjL(strStart, strEnd); dt = pi.ValuateNowPSSelectHz(strStart, strEnd); } else if (qy) { dt = pi.ValuateNowPSSelectQy(strStart, strEnd); } //dt = dst.Tables[0]; } return(dt); }
private void cboDepart_SelectedIndexChanged(object sender, EventArgs e) { using (gjtEmrPatients.emrPatients ep = new gjtEmrPatients.emrPatients()) { DataTable dt = new DataTable(); dt.TableName = "getdoc"; DataSet dst = new DataSet(); if (cboDepart.SelectedValue.ToString() != "$") { dst = ep.GetDoctorListByDepartment(cboDepart.SelectedValue.ToString()); dt = dst.Tables[0]; DataRow dr = dt.NewRow(); dr["ysm"] = "-----"; dr["ysbm"] = "$"; dt.Rows.InsertAt(dr, 0); cboDoctor.DataSource = dt; cboDoctor.DisplayMember = "ysm"; cboDoctor.ValueMember = "ysbm"; cboDoctor.SelectedIndex = 0; } else { dst = ep.GetDoctorList(); dt = dst.Tables[0]; DataRow dr = dt.NewRow(); dr["ysm"] = "全部"; dr["ysbm"] = "$"; dt.Rows.InsertAt(dr, 0); cboDoctor.DataSource = dt; cboDoctor.DisplayMember = "ysm"; cboDoctor.ValueMember = "ysbm"; cboDoctor.SelectedIndex = 0; } } }
public static XmlNode GetDepartmentsByMode(gjtEmrPatients.WorkMode mode) { using (gjtEmrPatients.emrPatients pi = new gjtEmrPatients.emrPatients()) { try { XmlNode node = pi.GetDepartmentListByMode(mode); if (node.FirstChild.Name == "error") { return(null); } else { return(node); } } catch (Exception ex) { Globals.logAdapter.Record("EX123582274152", ex.Message + ">>" + ex.ToString(), true); return(null); } } }
public static string GetDepartCodeByRegistryID(string registryID) { using (gjtEmrPatients.emrPatients pi = new gjtEmrPatients.emrPatients()) { string DepartCode = null; XmlNode patients = pi.QueryPatientList(gjtEmrPatients.QueryMode.RegistryID, registryID, Globals.inStyle); if (patients == null) { return(null); } if (patients.SelectNodes(ElementNames.Patient).Count == 0) { return(null); } foreach (XmlNode patient in patients.SelectNodes(ElementNames.Patient)[0]) { if (patient.Attributes[AttributeNames.RegistryID].Value == registryID) { return(patient.Attributes[AttributeNames.DepartmentCode].Value); } } return(DepartCode); } }
public DoctorOrders(string registryID, Word.Application WordApplication, string status) { InitializeComponent(); WordApp = WordApplication; existError = false; dgvOrderLocation = dgvOrder.Location; dgvOrderSize.Width = dgvOrder.Width; dgvOrderSize.Height = dgvOrder.Height; dgvOrder.Tag = StringGeneral.Zero; //string status = Globals.ThisAddIn.emrTaskPane.GetTreeviewPatientsStatus(); #region Get tests, examine, drug, treat using (gjtEmrPatients.emrPatients pi = new gjtEmrPatients.emrPatients()) { try { testsAndExams = pi.GetTestsAndExams(registryID, true); } catch (Exception ex) { Globals.logAdapter.Record("EX741852965", ex.Message + ">>" + ex.ToString(), true); existError = true; return; } if (testsAndExams.HasChildNodes) { if (testsAndExams.FirstChild.Name == ErrorMessage.XmlErr) { string msg = testsAndExams.FirstChild.Attributes[AttributeNames.Message].Value; MessageBox.Show(msg, ErrorMessage.Warning); existError = true; return; } } try { if (status == InpatientStatus.Stay) { orders = pi.GetDoctorOrders(registryID, true); } else { orders = pi.GetDoctorOrdersDischarged(registryID); } } catch (Exception ex) { Globals.logAdapter.Record("EX741852966", ex.Message + ">>" + ex.ToString(), true); existError = true; return; } if (orders.HasChildNodes) { if (orders.FirstChild.Name == EmrConstant.ErrorMessage.XmlErr) { string msg = orders.FirstChild.Attributes[AttributeNames.Message].Value; MessageBox.Show(msg, ErrorMessage.Warning); existError = true; return; } } } #endregion if (!testsAndExams.HasChildNodes && !orders.HasChildNodes) { MessageBox.Show(ErrorMessage.NoOrderRecord, ErrorMessage.Warning); existError = true; return; } /* display laboratory tests and examinations*/ if (testsAndExams != null) { LoadTestsAndExams(); if (lbTest.Items.Count > 0) { lbTest.SelectedIndex = 0; } if (lbExam.Items.Count > 0) { lbExam.SelectedIndex = 0; } } /* load dgvOrder control */ if (orders != null) { LoadOrders(); } }
private void ValuateNow_Load(object sender, EventArgs e) { SetYsbm(); DataTable dt1 = new DataTable(); XmlNode testsAndExams = null; using (gjtEmrPatients.emrPatients ep = new gjtEmrPatients.emrPatients()) { testsAndExams = ep.ValuateNowEx(); } XmlNodeList archives = testsAndExams.SelectNodes(EmrConstant.ElementNames.archive); DataGridViewComboBoxColumn dgvComboBoxColumn = new DataGridViewComboBoxColumn(); dgvComboBoxColumn.HeaderText = "科级扣分原因"; DataGridViewTextBoxColumn KF = new DataGridViewTextBoxColumn(); KF.HeaderText = "科级扣分"; DataGridViewTextBoxColumn MC = new DataGridViewTextBoxColumn(); MC.HeaderText = "项目内容"; DataGridViewTextBoxColumn SZF = new DataGridViewTextBoxColumn(); SZF.HeaderText = "所占分"; DataGridViewTextBoxColumn Content = new DataGridViewTextBoxColumn(); Content.HeaderText = "检查内容与评分标准"; DataGridViewTextBoxColumn GLMC = new DataGridViewTextBoxColumn(); Content.HeaderText = "评分标准"; // DataGridViewTextBoxColumn YGKF = new DataGridViewTextBoxColumn(); //YGKF.HeaderText = "缺陷应该扣分"; // DataGridViewTextBoxColumn XH = new DataGridViewTextBoxColumn(); //XH.HeaderText = "缺陷序号"; dgvValuate.Columns.Add(MC); dgvValuate.Columns.Add(SZF); dgvValuate.Columns.Add(Content); dgvValuate.Columns.Add(dgvComboBoxColumn); dgvValuate.Columns.Add(KF); dgvValuate.Columns.Add(GLMC); GLMC.Visible = false; XmlNodeList items = null; foreach (XmlNode archive in archives) { string ProName = archive.Attributes[EmrConstant.AttributeNames.ProName].Value; string SZFv = archive.Attributes[EmrConstant.AttributeNames.SZF].Value; string SZFHJ = archive.Attributes[EmrConstant.AttributeNames.SZFHJ].Value; string Contentv = archive.Attributes[EmrConstant.AttributeNames.Content].Value; string glmc = archive.Attributes[EmrConstant.AttributeNames.GLMC].Value; int index = dgvValuate.Rows.Add(); items = archive.ChildNodes; DataGridViewComboBoxCell dcc = null; //if (ProName == "") ProName = "首页病程"; dgvValuate.Rows[index].Cells[0].Value = ProName; dgvValuate.Rows[index].Cells[1].Value = SZFHJ; dgvValuate.Rows[index].Cells[2].Value = Contentv; dgvValuate.Rows[index].Cells[5].Value = glmc; dcc = (DataGridViewComboBoxCell)dgvValuate.Rows[index].Cells[3]; foreach (XmlNode item in items) { // string XH = item.Attributes[EmrConstant.AttributeNames.XH].Value; string KFYY = item.Attributes[EmrConstant.AttributeNames.KFYY].Value; string CKKF = item.Attributes[EmrConstant.AttributeNames.CKKF].Value; int dex = dcc.Items.Add(KFYY + "\n -" + CKKF); } dcc.Items.Add("------------"); } dgvValuate.Columns[4].ReadOnly = true; //判断是否已经审核了 using (gjtEmrPatients.emrPatients ep = new gjtEmrPatients.emrPatients()) { string flag = ep.ValuateNowISSH(registryID); DataTable dt = ep.ValuateNowBAPSBZNew(registryID); string oldStr = ""; string newStr = ""; if (dt.Rows.Count != 0 && dt.Rows[0][0].ToString() == "1") { btnUpate.Enabled = false; btnPS.Enabled = false; btnChecked.Enabled = false; btnPrintPreview.Enabled = true; btnValuatPrint.Enabled = true; for (int i = 0; i < dt.Rows.Count; i++) { for (int j = 0; j < dgvValuate.Rows.Count; j++) { if (dgvValuate.Rows[j].Cells[5].Value.ToString() == dt.Rows[i][2].ToString()) { DataGridViewComboBoxCell dcc = (DataGridViewComboBoxCell)dgvValuate.Rows[j].Cells[3]; for (int k = 0; k < dcc.Items.Count; k++) { oldStr = dcc.Items[k].ToString().Replace(" ", ""); newStr = dt.Rows[i][1].ToString().Trim() + "\n-" + dt.Rows[i][5].ToString().Trim(); if (oldStr == newStr) { dcc.Value = dcc.Items[k].ToString(); // cb_SelectedIndexChanged(sender, e); } } string[] strdcc = dcc.Value.ToString().Split('-'); dgvValuate.Rows[j].Cells[4].Value = strdcc[1].ToString(); } } } lblZDF.Text = dt.Rows[0][4].ToString(); lblPJ.Text = dt.Rows[0][3].ToString(); } else { btnUpate.Enabled = false; btnPS.Enabled = true; btnChecked.Enabled = false; btnPrintPreview.Enabled = false; btnValuatPrint.Enabled = false; return; } if (flag == "1") { btnUpate.Enabled = false; btnChecked.Enabled = false; btnPS.Enabled = false; btnPrintPreview.Enabled = true; btnValuatPrint.Enabled = true; return; } } btnUpate.Enabled = true; btnChecked.Enabled = true; btnPrintPreview.Enabled = false; btnValuatPrint.Enabled = false; }
private void btnPS_Click(object sender, EventArgs e) { this.knockTotal = 0; if ((ValuateOpcode != Globals.DoctorName) && (ValuateOpcode != null)) { MessageBox.Show("不能给别人评过分的病历评分!", ErrorMessage.Warning); return; } if (MessageBox.Show("确认保存评分结果!", ErrorMessage.Warning, MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) == DialogResult.Cancel) { return; } 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.PSRQ, DateTime.Now.ToString()); // note.SetAttribute(AttributeNames.DepartmentCode, departID); note.SetAttribute(AttributeNames.PSZJYS, Globals.DoctorName); note.SetAttribute(AttributeNames.BAPSBZ, "1"); note.SetAttribute(AttributeNames.RegistryID, registryID); //note.SetAttribute(AttributeNames.SHBZ, shbz); //note.SetAttribute(AttributeNames.SHRQ, ""); //note.SetAttribute(AttributeNames.SHRY, ""); //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); note.SetAttribute(AttributeNames.GKF, knockTotal.ToString()); // note.SetAttribute(AttributeNames.KFXM, lblPJ.Text); bool msg = false; int counts = 0; using (gjtEmrPatients.emrPatients ep = new gjtEmrPatients.emrPatients()) { try { if (Update) { //counts = ep.DelValuateNow(registryID); //if (counts != 0) //{ // msg = ep.ValuateNowPS(note); // if (msg) // { // btnPS.Enabled = false; // btnUpate.Enabled = true; // btnChecked.Enabled = true; // Update = false; // } // else // { // MessageBox.Show("插入更新修改失败!!"); // } //} //else //{ // MessageBox.Show("删除更新修改失败!"); //} msg = ep.DeleteAndInsertValue(note); if (msg) { btnPS.Enabled = false; btnUpate.Enabled = true; btnChecked.Enabled = true; Update = false; } else { MessageBox.Show("修改评分失败!!"); } } else { msg = ep.ValuateNowPS(note); if (msg) { btnPS.Enabled = false; btnUpate.Enabled = true; btnChecked.Enabled = true; } } } catch (Exception ex) { Globals.logAdapter.Record("EX741852969", ex.Message + ">>" + ex.ToString(), true); } } }
public bool ElementFromBookmarks(XmlElement emrNote, Boolean newNote, EmrConstant.Button button) { if (!newNote) { for (int k = emrNote.ChildNodes.Count - 1; k >= 0; k--) { emrNote.RemoveChild(emrNote.ChildNodes[k]); } } string RegistryID = emrNote.OwnerDocument.ChildNodes[0].Attributes[EmrConstant.AttributeNames.RegistryID].Value; if (ThisAddIn.CanOption(ElementNames.EHRInterface) == true) { #region 定义健康档案接口变量 string PatientID = ""; string StateIn = ""; string DiagnosisIn = ""; string Treatment = ""; string StateOut = ""; string DiagnosisOut = ""; string OrderOut = ""; string ResidentPhysician = ""; string PhysicianInCharge = ""; string Department = ""; string Bah = ""; string zyh = ""; DateTime AdmitDateTime = new DateTime(); DateTime OutDateTime = new DateTime(); #endregion string Hospital = "东方地球物理公司第二职工医院"; using (gjtEmrPatients.emrPatients ep = new gjtEmrPatients.emrPatients()) try { DataSet dst = ep.GetPatientInf(RegistryID); PatientID = dst.Tables[0].Rows[0]["sfzh"].ToString(); //Department = dst.Tables[0].Rows[0]["ksbm"].ToString(); Bah = dst.Tables[0].Rows[0]["bah"].ToString(); zyh = dst.Tables[0].Rows[0]["zyh"].ToString(); AdmitDateTime = Convert.ToDateTime(dst.Tables[0].Rows[0]["zyrq"].ToString()); OutDateTime = Convert.ToDateTime(dst.Tables[0].Rows[0]["cyrq"].ToString()); if (PatientID == null || PatientID == "") { Globals.health = false; } } catch (Exception ex) { Globals.logAdapter.Record("EX741852968", ex.Message + ">>" + ex.ToString(), true); } if (PatientID == null || PatientID == "") { Globals.health = false; } if (Globals.health == true) { foreach (Word.XMLNode xn in ActiveDocumentManager.getDefaultAD().XMLNodes) { string content = xn.BaseName; switch (content) { case "科室": Department = xn.Range.Text.Trim(); break; case "入院情况": StateIn = xn.Range.Text.Trim(); break; case "入院诊断": DiagnosisIn = xn.Range.Text.Trim(); break; case "诊疗经过": Treatment = xn.Range.Text.Trim(); break; case "出院情况": StateOut = xn.Range.Text.Trim(); break; case "出院诊断": DiagnosisOut = xn.Range.Text.Trim(); break; case "出院医嘱": OrderOut = xn.Range.Text.Trim(); break; case "住院医师": if (xn.Range.Text != null) { ResidentPhysician = xn.Range.Text.Trim(); } break; case "医师": PhysicianInCharge = Globals.DoctorName; break; default: break; } } } if (Globals.health == true) { //WebReference.Hiss h = new WebReference.Hiss(); //{ // try // { // int result = h.Insert_InpatientInfo_EMR(PatientID, AdmitDateTime, OutDateTime, zyh, StateIn, DiagnosisIn, Treatment, StateOut, DiagnosisOut, OrderOut, // ResidentPhysician, PhysicianInCharge, Department, Hospital, Bah, ref err); // result++; // } // catch (Exception ex) // { // } //} Globals.health = false; } } Word.ContentControl title = null; Word.ContentControl titleNext = null; Word.Range range = ActiveDocumentManager.getDefaultAD().Paragraphs.First.Range; ArrayList lables = new ArrayList(); foreach (Word.ContentControl lable in ActiveDocumentManager.getDefaultAD().ContentControls) { if (lable.Title == StringGeneral.Label) { lables.Add(lable); } else if (lable.Title == StringGeneral.Control) { //lable.LockContentControl = false; //lable.LockContents = false; //lable.Delete(false); } } #region Check empty subtitle /* If the content of a subtitle is empty, you should delete it, otherwise, the insignificant * value of a xml element will be removed by sql 2005 for a xml column. */ if (button == EmrConstant.Button.CommitNote) { /* When commit note, required subtitle must not be empty. */ for (int i = lables.Count - 1; i > 0; i--) { title = (Word.ContentControl)lables[i - 1]; string required = title.Tag.ToString(); titleNext = (Word.ContentControl)lables[i]; range.Start = title.Range.End + 1; range.End = titleNext.Range.Start - 1; //20100128 if (required == StringGeneral.Yes) { if (range.Text != null) { //if (range.Text.Contains("选择一项")) //{ // MessageBox.Show(title.Range.Text + " -- 是必须要填写的!", ErrorMessage.Warning); // range.Select(); // return Return.Failed; //} } } if (!IsSignificant(range.Text)) { #region Empty subtitle if (required == StringGeneral.Yes) { /* Required subtitle must has content. */ //MessageBox.Show(title.Range.Text + " -- 是必须要填写的!", ErrorMessage.Warning); //range.Select(); //return Return.Failed; } else { /* Not required empty subtitle is removed. */ //range.Text = ""; //title.LockContentControl = false; //title.LockContents = false; //title.Delete(true); //lables.RemoveAt(i - 1); title.LockContents = false; ///guojt 2009/7/15 title.Range.Font.Color = Globals.labelFont.Color; title.LockContents = true; } #endregion } else { #region Not required empty subtitle needs change font color with that of the required if (required == EmrConstant.StringGeneral.No) { title.LockContents = false; title.Range.Font.Color = Globals.labelFont.Color; title.LockContents = true; } #endregion } } } #endregion #region Fill subtitel into emrNote for (int i = 0; i < lables.Count - 1; i++) { title = (Word.ContentControl)lables[i]; titleNext = (Word.ContentControl)lables[i + 1]; range.Start = title.Range.End + 1; range.End = titleNext.Range.Start - 1; XmlElement subTitle = emrNote.OwnerDocument.CreateElement(ElementNames.SubTitle); ElementFromBookmarkMe(subTitle, range); subTitle.SetAttribute(AttributeNames.TitleName, title.Range.Text); /* 2007-07-20 using doubale storage: word document and xml emrDocument. In emrDocuments, * only text is allowed. */ //ElementFromTables(doc, subTitle, range); //ElementFromImages(doc, subTitle, range); emrNote.AppendChild(subTitle); } #endregion //XmlElement revisions = doc.CreateElement(EmrConstant.ElementNames.Revisions); //range = ActiveDocumentManager.getDefaultAD().Content; //RevisionFromBookmark(doc, range, ref revisions); //emrNote.AppendChild(revisions); return(EmrConstant.Return.Successful); }
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 { } } }
private void LoadFlaws(string RegistryID) { this.reportViewer2.RefreshReport(); DataSet ds1 = new DataSet(); DataSet ds2 = new DataSet(); DataSet ds3 = new DataSet(); DataSet ds4 = new DataSet(); DataSet ds5 = new DataSet(); using (gjtEmrPatients.emrPatients ep = new gjtEmrPatients.emrPatients()) { //ep.GetMedicalData(ref ds1, ref ds2, ref ds3, RegistryID); ep.GetNewMedicalData(ref ds1, ref ds2, ref ds3, ref ds4, ref ds5, RegistryID); } //ReportParameter[] rp = new ReportParameter[1]; //rp[0] = new ReportParameter("Report_Parameter_0", "这里是参数"); //ReportViewer2.Visible = false; //return; //ReportViewer2.LocalReport.DataSources.Clear(); //ReportParameter[] rp = new ReportParameter[1]; //rp[0] = new ReportParameter("strParas", strParas); this.reportViewer2.LocalReport.DataSources.Clear(); //this.reportViewer2.Reset(); //this.reportViewer2.LocalReport.ReportPath = @"E:\emr\WordAddInEmrw\WordAddInEmrw\order\Report1.rdlc"; //if (ds4.Tables[0].Rows.Count > 0) //{ // DataRow dr = ds4.Tables[0].Rows[0]; //} if (ds1.Tables[0].Rows.Count > 0) { DataRow dr = ds1.Tables[0].Rows[0]; // DataRow dr4 = ds4.Tables[0].Rows[0]; dr.Table.Columns.Add("yydm"); dr.Table.Columns.Add("yymc"); dr.Table.Columns.Add("sfgm"); dr["yydm"] = dr4.ItemArray[0]; dr["yymc"] = dr4.ItemArray[1]; dr.Table.Columns.Add("xsrnl"); if (dr["nldw"].ToString() == "月") { dr["xsrnl"] = (Convert.ToInt16(dr["nl"])).ToString(); } // dr.Table.Columns.Add("zdmc"); dr.Table.Columns.Add("icd"); dr.Table.Columns.Add("rybq"); for (int i = 1; i < 22; i++) { dr.Table.Columns.Add("zdmc" + i.ToString("00")); dr.Table.Columns.Add("icd" + i.ToString("00")); dr.Table.Columns.Add("rybq" + i.ToString("00")); } get_mzmc(dr, "mz"); get_gjmc(dr, "gjdm"); get_ksmc(dr, "ryksbm"); get_ksmc(dr, "zkksbm"); get_ksmc(dr, "ksbm"); get_ysmc(dr, "kzr"); get_ysmc(dr, "zrys"); get_ysmc(dr, "zzys"); get_ysmc(dr, "zyys"); get_ysmc(dr, "jxys"); get_ysmc(dr, "yjssxys"); get_ysmc(dr, "sxys"); get_jtgx(dr, "lxrgx"); if (dr["bxbs"].ToString() == "1") { dr["bxbs"] = "1"; } else { dr["bxbs"] = "3"; }; dr["zdmc"] = "主要诊断:" + ds5.Tables[0].Rows[0][0].ToString(); dr["icd"] = ds5.Tables[0].Rows[0][1].ToString(); dr["rybq"] = ds5.Tables[0].Rows[0][2].ToString(); dr["zdmc01"] = "其他诊断:" + ds5.Tables[0].Rows[0][3].ToString(); dr["icd01"] = ds5.Tables[0].Rows[0][4].ToString(); dr["rybq01"] = ds5.Tables[0].Rows[0][5].ToString(); dr["zdmc02"] = ds5.Tables[0].Rows[0][6].ToString(); dr["icd02"] = ds5.Tables[0].Rows[0][7].ToString(); dr["rybq02"] = ds5.Tables[0].Rows[0][8].ToString(); dr["zdmc03"] = ds5.Tables[0].Rows[0][9].ToString(); dr["icd03"] = ds5.Tables[0].Rows[0][10].ToString(); dr["rybq03"] = ds5.Tables[0].Rows[0][11].ToString(); dr["zdmc04"] = ds5.Tables[0].Rows[0][12].ToString(); dr["icd04"] = ds5.Tables[0].Rows[0][13].ToString(); dr["rybq04"] = ds5.Tables[0].Rows[0][14].ToString(); dr["zdmc05"] = ds5.Tables[0].Rows[0][15].ToString(); dr["icd05"] = ds5.Tables[0].Rows[0][16].ToString(); dr["rybq05"] = ds5.Tables[0].Rows[0][17].ToString(); dr["zdmc06"] = ds5.Tables[0].Rows[0][18].ToString(); dr["icd06"] = ds5.Tables[0].Rows[0][19].ToString(); dr["rybq06"] = ds5.Tables[0].Rows[0][20].ToString(); dr["zdmc07"] = ds5.Tables[0].Rows[0][21].ToString(); dr["icd07"] = ds5.Tables[0].Rows[0][22].ToString(); dr["rybq07"] = ds5.Tables[0].Rows[0][23].ToString(); dr["zdmc08"] = ds5.Tables[0].Rows[0][24].ToString(); dr["icd08"] = ds5.Tables[0].Rows[0][25].ToString(); dr["rybq08"] = ds5.Tables[0].Rows[0][26].ToString(); dr["zdmc09"] = ds5.Tables[0].Rows[0][27].ToString(); dr["icd09"] = ds5.Tables[0].Rows[0][28].ToString(); dr["rybq09"] = ds5.Tables[0].Rows[0][29].ToString(); dr["zdmc10"] = ds5.Tables[0].Rows[0][30].ToString(); dr["icd10"] = ds5.Tables[0].Rows[0][31].ToString(); dr["rybq10"] = ds5.Tables[0].Rows[0][32].ToString(); dr["zdmc11"] = "其他诊断:" + ds5.Tables[0].Rows[0][33].ToString(); dr["icd11"] = ds5.Tables[0].Rows[0][34].ToString(); dr["rybq11"] = ds5.Tables[0].Rows[0][35].ToString(); dr["zdmc12"] = ds5.Tables[0].Rows[0][36].ToString(); dr["icd12"] = ds5.Tables[0].Rows[0][37].ToString(); dr["rybq12"] = ds5.Tables[0].Rows[0][38].ToString(); dr["zdmc13"] = ds5.Tables[0].Rows[0][39].ToString(); dr["icd13"] = ds5.Tables[0].Rows[0][40].ToString(); dr["rybq13"] = ds5.Tables[0].Rows[0][41].ToString(); dr["zdmc14"] = ds5.Tables[0].Rows[0][42].ToString(); dr["icd14"] = ds5.Tables[0].Rows[0][43].ToString(); dr["rybq14"] = ds5.Tables[0].Rows[0][44].ToString(); dr["zdmc15"] = ds5.Tables[0].Rows[0][45].ToString(); dr["icd15"] = ds5.Tables[0].Rows[0][46].ToString(); dr["rybq15"] = ds5.Tables[0].Rows[0][47].ToString(); dr["zdmc16"] = ds5.Tables[0].Rows[0][48].ToString(); dr["icd16"] = ds5.Tables[0].Rows[0][49].ToString(); dr["rybq16"] = ds5.Tables[0].Rows[0][50].ToString(); dr["zdmc17"] = ds5.Tables[0].Rows[0][51].ToString(); dr["icd17"] = ds5.Tables[0].Rows[0][52].ToString(); dr["rybq17"] = ds5.Tables[0].Rows[0][53].ToString(); dr["zdmc18"] = ds5.Tables[0].Rows[0][54].ToString(); dr["icd18"] = ds5.Tables[0].Rows[0][55].ToString(); dr["rybq18"] = ds5.Tables[0].Rows[0][56].ToString(); dr["zdmc19"] = ds5.Tables[0].Rows[0][57].ToString(); dr["icd19"] = ds5.Tables[0].Rows[0][58].ToString(); dr["rybq19"] = ds5.Tables[0].Rows[0][59].ToString(); dr["zdmc20"] = ds5.Tables[0].Rows[0][60].ToString(); dr["icd20"] = ds5.Tables[0].Rows[0][61].ToString(); dr["rybq20"] = ds5.Tables[0].Rows[0][62].ToString(); dr["zdmc21"] = ds5.Tables[0].Rows[0][63].ToString(); dr["icd21"] = ds5.Tables[0].Rows[0][64].ToString(); dr["rybq21"] = ds5.Tables[0].Rows[0][65].ToString(); // if ((Convert.IsDBNull(dr["ywgm"]) == true) || (dr["ywgm"].ToString().Trim() == "") || (dr["ywgm"].ToString().Trim() == "-") || (dr["ywgm"].ToString().Trim() == "—") || (dr["ywgm"].ToString().Trim() == "无")) { dr["sfgm"] = "1"; } else { dr["sfgm"] = "2"; } // dr["cyzd"] = "主要诊断 " + dr["cyzd"]; dr["qtzd"] = "其他诊断 " + dr["qtzd"]; dr["qtzd2"] = " " + dr["qtzd2"]; dr["qtzd3"] = " " + dr["qtzd3"]; dr["qtzd4"] = " " + dr["qtzd4"]; dr["qtzd5"] = " " + dr["qtzd5"]; dr["yngr"] = "医院感染名称 " + dr["yngr"]; dr["blzd"] = "病例诊断 " + dr["blzd"]; dr["hznl"] = (Convert.ToInt16(dr["nl"])).ToString() + dr["nldw"]; DateTime dt, dt1, dt2; if (Convert.IsDBNull(dr["csny"]) == false) { dt = Convert.ToDateTime(dr["csny"]); dr["csrq_n"] = dt.Year.ToString(); dr["csrq_y"] = dt.Month.ToString(); dr["csrq_r"] = dt.Day.ToString(); } if (Convert.IsDBNull(dr["zyrq"]) == false) { dt = Convert.ToDateTime(dr["zyrq"]); dr["zyrq_n"] = dt.Year.ToString(); dr["zyrq_y"] = dt.Month.ToString(); dr["zyrq_r"] = dt.Day.ToString(); dr["zyrq_s"] = dt.Hour.ToString(); } if (Convert.IsDBNull(dr["cyrq"]) == false) { dt = Convert.ToDateTime(dr["cyrq"]); dr["cyrq_n"] = dt.Year.ToString(); dr["cyrq_y"] = dt.Month.ToString(); dr["cyrq_r"] = dt.Day.ToString(); dr["cyrq_s"] = dt.Hour.ToString(); } if (Convert.IsDBNull(dr["ryzdrq"]) == false) { dt = Convert.ToDateTime(dr["ryzdrq"]); dr["ryzdrq_n"] = dt.Year.ToString(); dr["ryzdrq_y"] = dt.Month.ToString(); dr["ryzdrq_r"] = dt.Day.ToString(); } if (Convert.IsDBNull(dr["cyrq"]) == false) { dt1 = Convert.ToDateTime(dr["zyrq"]).Date; dt2 = Convert.ToDateTime(dr["cyrq"]).Date; TimeSpan span = dt2.Subtract(dt1); int dayDiff = span.Days; if (dayDiff == 0) { dayDiff = 1; } dr["zyts"] = dayDiff.ToString(); } else { dt1 = Convert.ToDateTime(dr["zyrq"]).Date; dt2 = DateTime.Now.Date; TimeSpan span = dt2.Subtract(dt1); int dayDiff = span.Days; if (dayDiff == 0) { dayDiff = 1; } dr["zyts"] = dayDiff.ToString(); } if (dr["cyqk"].ToString() == "01") { dr["cyqk01"] = "√"; } if (dr["cyqk"].ToString() == "02") { dr["cyqk02"] = "√"; } if (dr["cyqk"].ToString() == "03") { dr["cyqk03"] = "√"; } if (dr["cyqk"].ToString() == "04") { dr["cyqk04"] = "√"; } if (dr["cyqk"].ToString() == "05") { dr["cyqk05"] = "√"; } if (dr["qtcyqk"].ToString() == "01") { dr["cyqk11"] = "√"; } if (dr["qtcyqk"].ToString() == "02") { dr["cyqk12"] = "√"; } if (dr["qtcyqk"].ToString() == "03") { dr["cyqk13"] = "√"; } if (dr["qtcyqk"].ToString() == "04") { dr["cyqk14"] = "√"; } if (dr["qtcyqk"].ToString() == "05") { dr["cyqk15"] = "√"; } if (dr["qtcyqk2"].ToString() == "01") { dr["cyqk21"] = "√"; } if (dr["qtcyqk2"].ToString() == "02") { dr["cyqk22"] = "√"; } if (dr["qtcyqk2"].ToString() == "03") { dr["cyqk23"] = "√"; } if (dr["qtcyqk2"].ToString() == "04") { dr["cyqk24"] = "√"; } if (dr["qtcyqk2"].ToString() == "05") { dr["cyqk25"] = "√"; } if (dr["qtcyqk3"].ToString() == "01") { dr["cyqk31"] = "√"; } if (dr["qtcyqk3"].ToString() == "02") { dr["cyqk32"] = "√"; } if (dr["qtcyqk3"].ToString() == "03") { dr["cyqk33"] = "√"; } if (dr["qtcyqk3"].ToString() == "04") { dr["cyqk34"] = "√"; } if (dr["qtcyqk3"].ToString() == "05") { dr["cyqk35"] = "√"; } if (dr["qtcyqk4"].ToString() == "01") { dr["cyqk41"] = "√"; } if (dr["qtcyqk4"].ToString() == "02") { dr["cyqk42"] = "√"; } if (dr["qtcyqk4"].ToString() == "03") { dr["cyqk43"] = "√"; } if (dr["qtcyqk4"].ToString() == "04") { dr["cyqk44"] = "√"; } if (dr["qtcyqk4"].ToString() == "05") { dr["cyqk45"] = "√"; } if (dr["qtcyqk5"].ToString() == "01") { dr["cyqk51"] = "√"; } if (dr["qtcyqk5"].ToString() == "02") { dr["cyqk52"] = "√"; } if (dr["qtcyqk5"].ToString() == "03") { dr["cyqk53"] = "√"; } if (dr["qtcyqk5"].ToString() == "04") { dr["cyqk54"] = "√"; } if (dr["qtcyqk5"].ToString() == "05") { dr["cyqk55"] = "√"; } } if (ds2.Tables[0].Rows.Count > 0) { DataRow dr = ds2.Tables[0].Rows[0]; int irowcount8; irowcount8 = ds3.Tables[0].Rows.Count; if (irowcount8 > 8) { irowcount8 = 8; } for (int i = 0; i < irowcount8; i++) { DataRow dr3 = ds3.Tables[0].Rows[i]; dr["CZBM" + (i + 1).ToString()] = dr3["SSBM"].ToString(); dr["SSRQ" + (i + 1).ToString()] = dr3["SSKSRQ"].ToString().Substring(0, 10); dr["SSJB" + (i + 1).ToString()] = dr3["SSDJ"].ToString(); dr["SSMC" + (i + 1).ToString()] = dr3["SSMC"].ToString(); dr["SSYS" + (i + 1).ToString()] = dr3["SSYS1"].ToString(); dr["Z1" + (i + 1).ToString()] = dr3["SSYS2"].ToString(); dr["Z2" + (i + 1).ToString()] = dr3["SSYS3"].ToString(); dr["MZ" + (i + 1).ToString()] = dr3["MZBM"].ToString(); dr["QK" + (i + 1).ToString()] = dr3["QKYHDJ"].ToString(); dr["MZYS" + (i + 1).ToString()] = dr3["MZYS1"].ToString(); } dr["ERZD1"] = "新生儿诊断 " + dr["ERZD1"]; if (dr["ERCYQK1"].ToString() == "01") { dr["ERCYQK11"] = "√"; } if (dr["ERCYQK1"].ToString() == "02") { dr["ERCYQK12"] = "√"; } if (dr["ERCYQK1"].ToString() == "03") { dr["ERCYQK13"] = "√"; } if (dr["ERCYQK1"].ToString() == "04") { dr["ERCYQK14"] = "√"; } if (dr["ERCYQK1"].ToString() == "05") { dr["ERCYQK15"] = "√"; } if (dr["ERCYQK2"].ToString() == "01") { dr["ERCYQK21"] = "√"; } if (dr["ERCYQK2"].ToString() == "02") { dr["ERCYQK22"] = "√"; } if (dr["ERCYQK2"].ToString() == "03") { dr["ERCYQK23"] = "√"; } if (dr["ERCYQK2"].ToString() == "04") { dr["ERCYQK24"] = "√"; } if (dr["ERCYQK2"].ToString() == "05") { dr["ERCYQK25"] = "√"; } if (dr["ERCYQK3"].ToString() == "01") { dr["ERCYQK31"] = "√"; } if (dr["ERCYQK3"].ToString() == "02") { dr["ERCYQK32"] = "√"; } if (dr["ERCYQK3"].ToString() == "03") { dr["ERCYQK33"] = "√"; } if (dr["ERCYQK3"].ToString() == "04") { dr["ERCYQK34"] = "√"; } if (dr["ERCYQK3"].ToString() == "05") { dr["ERCYQK35"] = "√"; } if (dr["SZQXLB"].ToString() == "周") { dr["SZQX_Z"] = dr["SZQX"].ToString(); } else if (dr["SZQXLB"].ToString() == "月") { dr["SZQX_Y"] = dr["SZQX"].ToString(); } else if (dr["SZQXLB"].ToString() == "年") { dr["SZQX_N"] = dr["SZQX"].ToString(); } dr["FY01"] = Convert.ToDecimal(dr["FY01"]) + Convert.ToDecimal(dr["FY17"]) + Convert.ToDecimal(dr["FY18"]) + Convert.ToDecimal(dr["FY19"]); dr["FY02"] = Convert.ToDecimal(dr["FY02"]) + Convert.ToDecimal(dr["FY20"]) + Convert.ToDecimal(dr["FY24"]); dr["FY03"] = Convert.ToDecimal(dr["FY03"]) + Convert.ToDecimal(dr["FY21"]); dr["FY04"] = Convert.ToDecimal(dr["FY04"]) + Convert.ToDecimal(dr["FY22"]); dr["FY09"] = Convert.ToDecimal(dr["FY09"]) + Convert.ToDecimal(dr["FY12"]); dr["FY05"] = Convert.ToDecimal(dr["FY05"]) + Convert.ToDecimal(dr["FY16"]) + Convert.ToDecimal(dr["FY23"]); dr["FY06"] = Convert.ToDecimal(dr["FY06"]) + Convert.ToDecimal(dr["FY07"]) + Convert.ToDecimal(dr["FY11"]); } //DataTable dtScoreOther = new DataTable("Result"); //dtScoreOther.Columns.Add("PatientName"); //DataRow dr2 = dtScoreOther.NewRow(); //dr2["PatientName"] = "strPaitientName"; //dtScoreOther.Rows.Add(dr2); //reportViewer2.LocalReport.DataSources.Add(new ReportDataSource("ScoreResult_Result", dtScoreOther)); //reportViewer2.LocalReport.DataSources.Add(new ReportDataSource("ScoreResult_Result", ds1.Tables[0])); this.reportViewer2.LocalReport.DataSources.Add(new ReportDataSource("BA", ds1.Tables[0])); this.reportViewer2.LocalReport.DataSources.Add(new ReportDataSource("BA2", ds2.Tables[0])); this.reportViewer2.LocalReport.Refresh(); this.reportViewer2.RefreshReport(); }
private void LoadData() { try { if (!Directory.Exists(Globals.workFolder)) { Directory.CreateDirectory(Globals.workFolder); File.SetAttributes(Globals.workFolder, FileAttributes.Hidden); } if (!Directory.Exists(Globals.templateFolder)) { Directory.CreateDirectory(Globals.templateFolder); } #region Check if offline string serverName = ""; try { serverName = ThisAddIn.CheckOffline(); } catch (Exception ex) { Globals.logAdapter.Record("EX756987457750", ex.Message + ">>" + ex.ToString(), true); } if (Globals.offline) { MessageBox.Show(serverName + ErrorMessage.OfflineAgain, ErrorMessage.Warning); } #endregion //#region Get current version number //string manifest = Path.Combine(Globals.currentDirectory, "EMR.vshost.exe.config"); //using (XmlReader reader = XmlReader.Create(manifest)) //{ // reader.ReadToFollowing("assemblyIdentity"); // Globals.currentVersion = reader.GetAttribute("version"); // reader.Close(); //} //#endregion //Globals.currentVersion = Application.ProductVersion; //#region Is there new version //if (!Globals.offline) //{ // CheckVersion cv = new CheckVersion(); // if (cv.IsThereHigherVersion(Globals.currentVersion)) // { // if (MessageBox.Show("有 S2012 的更新版本发布,下载吗?\n\n下载完毕,自动退出程序;\n需要重新启动Word 2007!", // EmrConstant.ErrorMessage.Warning, MessageBoxButtons.YesNo, MessageBoxIcon.Question, // MessageBoxDefaultButton.Button1) == DialogResult.Yes) // { // if (!Directory.Exists(Globals.newVersionFolder)) Directory.CreateDirectory(Globals.newVersionFolder); // string msg = cv.DownloadNewVersion(Globals.newVersionFolder); // if (msg != null) // { // if (msg != EmrConstant.ErrorMessage.NoNewVersion) // MessageBox.Show(msg, EmrConstant.ErrorMessage.Warning); // } // else // { // /* Download success */ // #region Replace the old with the new // string[] components; // cv.GetComponentList(out components); // for (int i = 0; i < components.Length; i++) // { // string destinationFile = Path.Combine(Globals.currentDirectory, components[i]); // string oldFile = destinationFile + ".old"; // string sourceFile = ""; // sourceFile = Path.Combine(Globals.newVersionFolder, components[i]); // if (File.Exists(oldFile)) File.Delete(oldFile); // File.Move(destinationFile, oldFile); // File.Move(sourceFile, destinationFile); // } // #endregion // // ExitWord(); // } // } // } //} //#endregion Globals.emrPatternFile = Path.Combine(Globals.currentDirectory, ResourceName.EmrPatternXml); Globals.ChildPatternFile = Path.Combine(Globals.currentDirectory, ResourceName.ChildPatternXml); #region Environment configuration string myConfigFile = Path.Combine(Globals.currentDirectory, ResourceName.MyConfigXml); string configString = Properties.Resources.ResourceManager.GetString("myconfig"); Globals.myConfig = new MyConfig(myConfigFile, configString); string dpCode = Globals.myConfig.GetDepartmentCode(); Globals.AreaID = Globals.myConfig.GetAreaCode(); #endregion /* Local parameters */ //GetLocalOptionValues(); /* Global parameters */ ThisAddIn.GetOptionValues(); /* Create local storage */ ThisAddIn.CreateWorkFolders(EmrConstant.CreateWorkFolderMode.Build); if (Globals.offline) { Globals.emrPattern = new EmrPattern(Globals.emrPatternFile, null, ThisAddIn.PutPattern); Globals.childPattern = new EmrPattern(Globals.ChildPatternFile, null, ThisAddIn.PutChildPattern); } else { Globals.emrPattern = new EmrPattern(Globals.emrPatternFile, ThisAddIn.GetRules(), ThisAddIn.PutPattern); Globals.childPattern = new EmrPattern(Globals.ChildPatternFile, null, ThisAddIn.PutChildPattern); } //InitTem(); #region Get local machine name and ip address Globals.localMachineName = Environment.MachineName; System.Net.IPAddress[] ips = System.Net.Dns.GetHostAddresses(Globals.localMachineName); byte[] bytes = ips[0].GetAddressBytes(); Globals.localMachineIP = bytes[0].ToString() + "." + bytes[1].ToString() + "." + bytes[2].ToString() + "." + bytes[3].ToString(); #endregion #region Get hospital name if (Globals.offline) { Globals.hospitalName = Globals.myConfig.GetHospitalName(); } else { using (gjtEmrPatients.emrPatients ep = new gjtEmrPatients.emrPatients()) { try { Globals.hospitalName = ep.GetHospitalName(); Globals.myConfig.SetHospitalName(Globals.hospitalName); } catch (Exception ex) { Globals.logAdapter.Record("EX756987457751", ex.Message + ">>" + ex.ToString(), true); Globals.hospitalName = " "; } } } #endregion lblStatus.Text = "正在进行初始化..."; ThisAddIn.logon = new Logon(); #region Use windows identity if (ThisAddIn.CanOption(ElementNames.UseDigitalSign)) { System.Security.Principal.WindowsIdentity user = System.Security.Principal.WindowsIdentity.GetCurrent(); string[] items = user.Name.Split(EmrConstant.Delimiters.Slash); string code = items[items.Length - 1]; Globals.tmpFolder = "C:\\" + code; string passwd = null; string userName = null; using (gjtEmrPatients.emrPatients pi = new gjtEmrPatients.emrPatients()) { pi.AuthenticChek(code, ref userName, ref passwd); } if (userName != null) { ThisAddIn.logon.InternalPassed(code, userName); return; } } #endregion ThisAddIn.InitRoles(configString); ThisAddIn.InitForNonQC(); #region Init note fonts //SetFonts(configString); //GetLabelFont(); //GetHeaderFont(); //GetNoteNameFont(); //GetContentFont(); #endregion Globals.doctors = new Doctors(Globals.doctorsFile); Globals.departments = new Departments(Globals.departmentFile); Globals.icd10File = Path.Combine(Globals.templateFolder, Globals.icd10File); if (!Globals.offline) { DataSet dsicd = ThisAddIn.GetIcd10(); if (dsicd != null) { dsicd.WriteXml(Globals.icd10File); } } } catch (Exception ex) { Globals.logAdapter.Record("EX756987457752", ex.Message + ">>" + ex.ToString(), true); } this.Close(); this.Dispose(); }