/// <summary> /// 根据文书名加载文书 /// </summary> public BaseDoc GetAnesDoc(string docName) { Dictionary <string, MedicalDocElement> docs = MedicalDocSettings.GetMedicalDocNameAndPath(); KeyValuePair <string, MedicalDocElement> keyValuePairDoc = new KeyValuePair <string, MedicalDocElement>(); foreach (KeyValuePair <string, MedicalDocElement> keyValuePair in docs) { if (keyValuePair.Key.Trim() == docName.Trim()) { keyValuePairDoc = keyValuePair; break; } } Type t = Type.GetType(keyValuePairDoc.Value.Type); BaseDoc baseDoc = Activator.CreateInstance(t) as BaseDoc; baseDoc.BackColor = Color.White; baseDoc.Name = docName; baseDoc.Initial(); string path = null; if (MedicalDocSettings.GetMedicalDocNameAndPath().ContainsKey(docName)) { path = MedicalDocSettings.GetMedicalDocNameAndPath()[docName].Path; baseDoc.LoadReport(Path.Combine(ExtendAppContext.Current.AppPath, path)); } return(baseDoc); }
private void MultiPrintFrm_Load(object sender, EventArgs e) { List <string> fileList = new List <string>(); //foreach (CheckedListBoxItem boxItem in chkUpFileList.Items) //{ // if (boxItem.CheckState == CheckState.Checked) // { // fileList.Add(boxItem.Value.ToString()); // } //} //if (!string.IsNullOrEmpty(ApplicationConfiguration.multiPrintNames)) //{ // IEnumerator ie = ApplicationConfiguration.multiPrintNames.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).GetEnumerator(); // while (ie.MoveNext()) // { // fileList.Add(ie.Current.ToString()); // } //} //todo Dictionary <string, MedicalDocElement> docKeyValuePairs = MedicalDocSettings.GetMedicalDocNameAndPath(); foreach (KeyValuePair <string, MedicalDocElement> keyValuePair in docKeyValuePairs) { CheckedListBoxItem boxItemDocCheck = new CheckedListBoxItem(keyValuePair.Key, keyValuePair.Value.Key); chkDocCheckList.Items.Add(boxItemDocCheck); if (fileList.Contains(keyValuePair.Key)) { boxItemDocCheck.CheckState = CheckState.Checked; } } }
public static string GetCustomConfig(string key) { Dictionary <string, MedicalDocElement> docs = MedicalDocSettings.GetCustomForms(); foreach (KeyValuePair <string, MedicalDocElement> keyValuePair in docs) { if (keyValuePair.Key.Trim() == key) { return(keyValuePair.Value.Type); } } return(""); }
/// <summary> /// 导航菜单相关内容显示 /// </summary> /// <param name="currentButtonStrings"></param> /// <param name="groupIndex"></param> private void SetNavigateAndGrid(string[] currentButtonStrings, int groupIndex) { List <string> menus = new List <string>(); dgvMenuCanSelect.Rows.Clear(); Type type = typeof(ViewNames); FieldInfo[] fieldInfos = type.GetFields(); foreach (FieldInfo fieldInfo in fieldInfos) { dgvMenuCanSelect.Rows.Add(new string[] { fieldInfo.GetRawConstantValue().ToString().Trim() }); menus.Add(fieldInfo.GetRawConstantValue().ToString().Trim()); } Dictionary <string, MedicalDocElement> customViews = MedicalDocSettings.GetCustomForms(); foreach (KeyValuePair <string, MedicalDocElement> keyValuePair in customViews) { if (!menus.Contains(keyValuePair.Key)) { dgvMenuCanSelect.Rows.Add(new string[] { keyValuePair.Key }); menus.Add(keyValuePair.Key); } } dgvMenuSelected.Rows.Clear(); foreach (string str in currentButtonStrings) { string[] groupButtons = str.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); foreach (string text in groupButtons) { string btnText = text; if (btnText.Contains("\t")) { btnText = btnText.Replace("\t", ""); } while (btnText.Contains(" ")) { btnText = btnText.Replace(" ", ""); } if (!string.IsNullOrEmpty(btnText)) { if (str == currentButtonStrings[groupIndex]) { dgvMenuSelected.Rows.Add(new string[] { btnText }); } RemoveFromGrid(dgvMenuCanSelect, btnText); } } } }
/// <summary> /// 加载事件,显示所有的文书 /// </summary> private void MultiPrintFrm_Load(object sender, EventArgs e) { List <string> fileList = new List <string>(); Dictionary <string, MedicalDocElement> docKeyValuePairs = MedicalDocSettings.GetMedicalDocNameAndPath(); foreach (KeyValuePair <string, MedicalDocElement> keyValuePair in docKeyValuePairs) { CheckedListBoxItem boxItemDocCheck = new CheckedListBoxItem(keyValuePair.Key, keyValuePair.Value.Key); chkDocCheckList.Items.Add(boxItemDocCheck); if (fileList.Contains(keyValuePair.Key)) { boxItemDocCheck.CheckState = CheckState.Checked; } } }
public static MedicalDocucementElement GetMedicalDocument(string documentName) { MedicalDocucementElement medicalDocElement = new MedicalDocucementElement(); string key = "MedicalDocument." + documentName; string text = ApplicationConfiguration.GetFromConfigTable(key); if (!string.IsNullOrEmpty(text)) { List <string> list = new List <string>(text.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)); medicalDocElement.FromList(list); } else { List <string> list = new List <string>(); Dictionary <string, MedicalDocElement> docKeyValuePairs = MedicalDocSettings.GetMedicalDocNameAndPath(); foreach (KeyValuePair <string, MedicalDocElement> keyValuePair in docKeyValuePairs) { if (keyValuePair.Key.Trim() == documentName.Trim()) { medicalDocElement.Caption = keyValuePair.Value.Caption; medicalDocElement.Key = keyValuePair.Value.Key; medicalDocElement.Path = keyValuePair.Value.Path; medicalDocElement.Type = keyValuePair.Value.Type; break; } } if (string.IsNullOrEmpty(medicalDocElement.Key)) { docKeyValuePairs = MedicalDocSettings.GetMedicalFormsNameAndPath(); foreach (KeyValuePair <string, MedicalDocElement> keyValuePair in docKeyValuePairs) { if (keyValuePair.Key.Trim() == documentName.Trim()) { medicalDocElement.Caption = keyValuePair.Value.Caption; medicalDocElement.Key = keyValuePair.Value.Key; medicalDocElement.Path = keyValuePair.Value.Path; medicalDocElement.Type = keyValuePair.Value.Type; break; } } } } if (string.IsNullOrEmpty(medicalDocElement.Key)) { medicalDocElement.Key = documentName; } return(medicalDocElement); }
/// <summary> /// 打印后自动打印PACU护理记录单 /// </summary> protected override void OnAfterPrint() { DialogResult dr = MessageBox.Show("是否打印PACU护理记录单?", "提示", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes || dr == DialogResult.OK) { string docName = "PACU护理记录单"; Dictionary <string, MedicalDocElement> docs = MedicalDocSettings.GetMedicalDocNameAndPath(); Type t = Type.GetType(docs[docName].Type); BaseDoc baseDoc = Activator.CreateInstance(t) as BaseDoc; baseDoc.BackColor = Color.White; baseDoc.Name = docs[docName].Caption; baseDoc.HideScrollBar(); baseDoc.Initial(); baseDoc.LoadReport(Path.Combine(System.Windows.Forms.Application.StartupPath, docs[docName].Path)); baseDoc.PrintBaseDoc(); } }
/// <summary> /// 根据文书名称获取文书的PDF图片 /// </summary> /// <param name="docName">文书名称</param> public List <Image> GetAnesDocImageList(string docName) { Dictionary <string, MedicalDocElement> docs = MedicalDocSettings.GetMedicalDocNameAndPath(); KeyValuePair <string, MedicalDocElement> keyValuePairDoc = new KeyValuePair <string, MedicalDocElement>(); foreach (KeyValuePair <string, MedicalDocElement> keyValuePair in docs) { if (keyValuePair.Key.Trim() == docName.Trim()) { keyValuePairDoc = keyValuePair; break; } } Type t = Type.GetType(keyValuePairDoc.Value.Type); BaseDoc baseDoc = Activator.CreateInstance(t) as BaseDoc; baseDoc.BackColor = Color.White; baseDoc.Name = docName; ExtendAppContext.Current.CurrentDocName = docName; baseDoc.Initial(); long l1 = System.DateTime.Now.Ticks; string path = null; if (MedicalDocSettings.GetMedicalDocNameAndPath().ContainsKey(docName)) { path = MedicalDocSettings.GetMedicalDocNameAndPath()[docName].Path; baseDoc.LoadReport(Path.Combine(ExtendAppContext.Current.AppPath, path)); } long l2 = System.DateTime.Now.Ticks; Console.WriteLine((l2 - l1) / 1000000); List <Image> list = baseDoc.ExportJPG(); return(list); }
/// <summary> /// 加载双面文书 /// </summary> /// <param name="docName1">文书名称1</param> /// <param name="docName2">文书名称2</param> protected UIElementPrinter[] GetNursePrinters(string docName1, string docName2) { UIElementPrinter[] NursePrinters = new UIElementPrinter[2]; Dictionary <string, MedicalDocElement> docs = MedicalDocSettings.GetMedicalDocNameAndPath(); Type t = Type.GetType(docs[docName1].Type); BaseDoc baseDoc = Activator.CreateInstance(t) as BaseDoc; baseDoc.BackColor = Color.White; baseDoc.Name = docs[docName1].Caption; baseDoc.HideScrollBar(); baseDoc.Initial(); baseDoc.LoadReport(Path.Combine(System.Windows.Forms.Application.StartupPath, docs[docName1].Path)); NursePrinters[0] = new UIElementPrinter(baseDoc, _paperSize, _pageFromHeight, _pagePrintHeight, _pageName); t = Type.GetType(docs[docName2].Type); baseDoc = Activator.CreateInstance(t) as BaseDoc; baseDoc.BackColor = Color.White; baseDoc.Name = docs[docName2].Caption; baseDoc.HideScrollBar(); baseDoc.Initial(); baseDoc.LoadReport(Path.Combine(System.Windows.Forms.Application.StartupPath, docs[docName2].Path)); NursePrinters[1] = new UIElementPrinter(baseDoc, _paperSize, _pageFromHeight, _pagePrintHeight, _pageName); return(NursePrinters); }
private void UserConfig_Load(object sender, EventArgs e) { this.SetDefaultGridViewStyle(dgvDocumentNames); this.SetDefaultGridViewStyle(dgvSelectedDoc); this.SetDefaultGridViewStyle(dgvMenuCanSelect); this.SetDefaultGridViewStyle(dgvMenuSelected); if (!DesignMode) { //通用运行参数 txtOpertionRoom.Text = ExtendApplicationContext.Current.OperRoom; txtAnesthesiaWardCode.Text = ExtendApplicationContext.Current.AnesthesiaWardCode; cmbDrugShow.SelectedIndex = ApplicationConfiguration.DrugShow; cmbProLonged.SelectedIndex = ApplicationConfiguration.ProLonged; txtHospBranchCode.Text = ExtendApplicationContext.Current.HospBranchCode; chkDrugAutoStop.Checked = ApplicationConfiguration.DrugAutoStop; cmbDrugStopOperationStatus.Text = ApplicationConfiguration.DrugAutoStopOperationStatus; chkSignModification.Checked = ApplicationConfiguration.IsModifyVitalSignShowDifferent; chkVerificationAudit.Checked = ApplicationConfiguration.IsVerificationAudit; //本机运行参数 if (ApplicationConfiguration.ApplicationPatterns == "0") { cboPatterns.EditValue = "手术间"; } else if (ApplicationConfiguration.ApplicationPatterns == "1") { cboPatterns.EditValue = "办公室"; } txtOpertionRoomNo.Text = ExtendApplicationContext.Current.OperRoomNo; txtBaseAddress.Text = ExtendApplicationContext.Current.BaseAddress; txtWebApiUri.Text = ExtendApplicationContext.Current.WebApiUri; chkPACUProgram.Checked = ApplicationConfiguration.IsPACUProgram; //接口相关参数 chkSyncOpen.Checked = ApplicationConfiguration.SyncOpen; chkIsUpdateScheduleStatus.Checked = ApplicationConfiguration.IsUpdateScheduleStatus; chkIsUpdateHisStatus.Checked = ApplicationConfiguration.IsUpdateHisStatus; chkIsUpdateAnesFei.Checked = ApplicationConfiguration.IsUpdateAnesCharge; //打印设置 medTextBoxPageName.Text = ApplicationConfiguration.PrintPageName; medTextBoxPaperHeight.Text = ApplicationConfiguration.PrintPaperHeight.ToString(); medTextBoxPaperWidth.Text = ApplicationConfiguration.PrintPaperWidth.ToString(); medTextBoxPaperLeftOff.Text = ApplicationConfiguration.PaperLeftOff.ToString(); medTextBoxPaperTopOff.Text = ApplicationConfiguration.PaperTopOff.ToString(); //文书上传设置 txtPDFServerUrl.Text = ApplicationConfiguration.PDFServerUrl; txtPDFLocalUrl.Text = ApplicationConfiguration.PDFLocalUrl; chkDeleteAfterCommitDoc.Checked = ApplicationConfiguration.IsDeleteAfterCommitDoc; List <string> fileList = new List <string>(); if (!string.IsNullOrEmpty(ApplicationConfiguration.PostPDF_Names)) { IEnumerator ie = ApplicationConfiguration.PostPDF_Names.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).GetEnumerator(); while (ie.MoveNext()) { fileList.Add(ie.Current.ToString()); } } Dictionary <string, MedicalDocElement> docKeyValuePairs = MedicalDocSettings.GetMedicalDocNameAndPath(); foreach (KeyValuePair <string, MedicalDocElement> keyValuePair in docKeyValuePairs) { CheckedListBoxItem boxItem = new CheckedListBoxItem(keyValuePair.Key, keyValuePair.Value.Key); //上传文件检查 chkUpFileList.Items.Add(boxItem); if (fileList.Contains(keyValuePair.Key)) { boxItem.CheckState = CheckState.Checked; } } chkAutomaticArchiving.Checked = ApplicationConfiguration.IsAutomaticArchiving; cboArchivOperAfterDay.EditValue = ApplicationConfiguration.ArchivOperAfterDay.ToString(); //文书配置 _statusButtonStrList.Add(ProgramStatus.NoPatient, ApplicationConfiguration.NoPatientButtons); _statusButtonStrList.Add(ProgramStatus.PeroperativePatient, ApplicationConfiguration.PeroperativePatientButtons); _statusButtonStrList.Add(ProgramStatus.AnesthesiaRecord, ApplicationConfiguration.AnesthesiaRecordButtons); _statusButtonStrList.Add(ProgramStatus.PACURecord, ApplicationConfiguration.PACUButtons); _statusButtonStrList.Add(ProgramStatus.PostoperativePatient, ApplicationConfiguration.PostoperativePatientButtons); _operDocuments.Add(ProgramStatus.PeroperativePatient, ApplicationConfiguration.PeroperativePatientDocuments); _operDocuments.Add(ProgramStatus.AnesthesiaRecord, ApplicationConfiguration.AnesthesiaRecordDocuments); _operDocuments.Add(ProgramStatus.PACURecord, ApplicationConfiguration.PACURecordEndDocuments); _operDocuments.Add(ProgramStatus.PostoperativePatient, ApplicationConfiguration.PostoperativePatientDocuments); _operActions.Add(ProgramStatus.PeroperativePatient, ApplicationConfiguration.PeroperativePatientActions); _operActions.Add(ProgramStatus.AnesthesiaRecord, ApplicationConfiguration.AnesthesiaRecordActions); _operActions.Add(ProgramStatus.PACURecord, ApplicationConfiguration.PACURecordActions); _operActions.Add(ProgramStatus.PostoperativePatient, ApplicationConfiguration.PostoperativePatientActions); radioGroupProgramStatusByDoc.SelectedIndex = 0; } }
public void StartWebDocPicService() { HttpListener listener = new HttpListener(); listener.Prefixes.Add(WebRequestDocUrl); listener.Start(); while (true) { HttpListenerContext context = listener.GetContext(); HttpListenerRequest request = context.Request; HttpListenerResponse response = context.Response; Stream outputStream = response.OutputStream; StreamWriter writer = new StreamWriter(outputStream); string patientID = request.QueryString["patientID"]; string visitID = request.QueryString["visitID"]; string operID = request.QueryString["operID"]; string docName = "术前访视单"; HttpUtility.UrlDecode(request.QueryString["docName"]);; ExtendAppContext.Current.PatientID = patientID; ExtendAppContext.Current.VisitID = Convert.ToInt32(visitID); ExtendAppContext.Current.OperID = Convert.ToInt32(operID); if (!string.IsNullOrEmpty(patientID) && !string.IsNullOrEmpty(docName)) { Dictionary <string, MedicalDocElement> docs = MedicalDocSettings.GetMedicalDocNameAndPath(); KeyValuePair <string, MedicalDocElement> keyValuePairDoc = new KeyValuePair <string, MedicalDocElement>(); foreach (KeyValuePair <string, MedicalDocElement> keyValuePair in docs) { if (keyValuePair.Key.Trim() == docName.Trim()) { keyValuePairDoc = keyValuePair; break; } } Type t = Type.GetType(keyValuePairDoc.Value.Type); BaseDoc baseDoc = Activator.CreateInstance(t) as BaseDoc; baseDoc.BackColor = Color.White; baseDoc.Name = docName; baseDoc.Initial(); long l1 = System.DateTime.Now.Ticks; string path = null; if (MedicalDocSettings.GetMedicalDocNameAndPath().ContainsKey(docName)) { path = MedicalDocSettings.GetMedicalDocNameAndPath()[docName].Path; baseDoc.LoadReport(Path.Combine(ExtendAppContext.Current.AppPath, path)); } long l2 = System.DateTime.Now.Ticks; Console.WriteLine((l2 - l1) / 1000000); if (!System.IO.Directory.Exists(string.Format(@"{0}\文书图片", Application.StartupPath))) { System.IO.Directory.CreateDirectory(string.Format(@"{0}\文书图片", Application.StartupPath)); } string fileName = patientID + "_" + visitID + "_" + operID; if (!System.IO.Directory.Exists(string.Format(@"{0}\文书图片\{1}", Application.StartupPath, fileName))) { System.IO.Directory.CreateDirectory(string.Format(@"{0}\文书图片\{1}", Application.StartupPath, fileName)); } string jpgPath = string.Format(@"{0}\文书图片\{1}\{2}", Application.StartupPath, fileName, docName); if (!System.IO.Directory.Exists(jpgPath)) { System.IO.Directory.CreateDirectory(jpgPath); } else { System.IO.Directory.Delete(jpgPath, true); System.IO.Directory.CreateDirectory(jpgPath); } bool isPic = baseDoc.ExportDocToWebJPG(jpgPath, docName); } } }