123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309 |
- #region Copyright © 2015 CLIPSOFT Co.,Ltd. All Rights Reserved.
- //
- // All rights are reserved. Reproduction or transmission in whole or in part,
- // in any form or by any means, electronic, mechanical or otherwise, is
- // prohibited without the prior written consent of the copyright owner.
- //
- // Filename:ConsentSelectTabConsentSearch.cs
- //
- #endregion
- using System;
- using System.ComponentModel;
- using System.Windows.Forms;
- using CLIP.eForm.Consent.Dfh.UI.ConsentSvcRef;
- using CLIP.eForm.Consent.Dfh.UI.HospitalSvcRef;
- namespace CLIP.eForm.Consent.Dfh.UI
- {
- /// <summary>
- /// 동의서 찾기 탭 클래스
- /// </summary>
- /// <remarks>
- /// <p>[설계자]</p>
- /// <p> 클립소프트 연구소 홍지철 (jchong@clipsoft.co.kr)</p>
- /// <p>[원본 작성자]</p>
- /// <p> 클립소프트 기술부 4팀 이창훈 (chlee@clipsoft.co.kr)</p>
- /// <p>[수정 작성자]</p>
- /// <p> 클립소프트 기술부 이인희</p>
- /// <p>----------------------------------------------------------------------------------------</p>
- /// <p>[HISTORY]</p>
- /// <p> 2015-07-30 : 최초작성</p>
- /// <p>----------------------------------------------------------------------------------------</p>
- /// </remarks>
- public partial class ConsentSelectTabConsentSearch : UserControl
- {
- private ConsentSvcRef.ConsentSvcSoapClient consentWebService = null;
- private HospitalSvcRef.HospitalSvcSoapClient hospitalWebService = null;
- private IConsentMain consentMain = null;
- private ConsentCommandCtrl commandControl = null;
- public ConsentSelectTabConsentSearch()
- {
- InitializeComponent();
- }
- private void ConsentSelectTabConsentSearch_Load(object sender, EventArgs e)
- {
- if (this.DesignMode || LicenseManager.UsageMode == LicenseUsageMode.Designtime)
- {
- return;
- }
- consentMain = ConsentMainControl.GetConsentMainInterface(this);
- commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
- consentWebService = WebMethodCommon.GetConsentWebService(consentMain.PluginExecuteInfo["consentSvcUrl"]);
- hospitalWebService = WebMethodCommon.GetHospitalWebService(consentMain.PluginExecuteInfo["hospitalSvcUrl"]);
- InitComboBoxConsentType();
- InitDataGrid();
- }
-
- private void InitDataGrid()
- {
- this.dataGridViewConsentSelectResult.AllowUserToAddRows = false;
- this.dataGridViewConsentSelectResult.CellDoubleClick += new DataGridViewCellEventHandler(dataGridViewConsentSelectResult_CellDoubleClick);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "동의서명", "FormName", true, 250);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "동의서 코드", "FormCd", true, 100);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "동의서 종류", "FullCategoryName", true, 150);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "동의서 고유코드", "FormGuid", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "동의서 고유RID", "FormRid", false);
- CommonUtil.AddNewColumnToDataGridView(this.dataGridViewConsentSelectResult, "전자서명 여부", "EsignYn", false);
- }
- #region 동의서 카테고리 바인딩
- private void InitComboBoxConsentType()
- {
- CategoryForDropdownVO[] arrayData = consentWebService.GetCategoryForDropdown("1");
- this.comboBoxConsentType.DisplayMember = "CategoryName";
- this.comboBoxConsentType.ValueMember = "CategoryId";
- this.comboBoxConsentType.DataSource = arrayData;
- }
- private void comboBoxConsentType_SelectedIndexChanged(object sender, EventArgs e)
- {
- SetSubConentTypeDataToComboBox();
- }
- private void SetSubConentTypeDataToComboBox()
- {
- string comboBoxConsentTypeValue = comboBoxConsentType.SelectedValue.ToString();
- if (comboBoxConsentTypeValue.Equals("CATE_ALL"))
- {
- this.comboBoxConsentSubType.DataSource = null;
- this.comboBoxConsentSubType.Enabled = false;
- }
- else
- {
- this.comboBoxConsentSubType.Enabled = true;
- InitComboBoxConsentSubType(comboBoxConsentTypeValue);
- }
- }
- private void InitComboBoxConsentSubType(string parentValue)
- {
- CategoryForDropdownVO[] arrayData = consentWebService.GetCategoryForDropdown(parentValue);
- this.comboBoxConsentSubType.DisplayMember = "CategoryName";
- this.comboBoxConsentSubType.ValueMember = "CategoryId";
- this.comboBoxConsentSubType.DataSource = arrayData;
- }
- #endregion
-
- #region 동의서 조회하고 그리드 바인딩
- private void textBoxConsentSearchKeyWord_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- {
- this.buttonConsentSelect.PerformClick();
- }
- }
- private void buttonConsentSelect_Click(object sender, EventArgs e)
- {
- IConsentMain consentMain = ConsentMainControl.GetConsentMainInterface(this);
- ConsentCommandCtrl commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
- consentMain.preParamClean();
- GetConsentBySearch();
- }
- private void GetConsentBySearch()
- {
- Cursor currentCursor = this.Cursor;
- try
- {
- this.Cursor = Cursors.WaitCursor;
- string consentType = string.Empty;
- if (this.comboBoxConsentSubType.SelectedValue == null)
- {
- consentType = this.comboBoxConsentType.SelectedValue.ToString();
- }
- else
- {
- consentType = this.comboBoxConsentSubType.SelectedValue.ToString();
- }
- string keyWord = string.Empty;
- keyWord = "%" + this.textBoxConsentSearchKeyWord.Text + "%";
- ConsentBySearchVO[] arrayData = consentWebService.GetConsentBySearch(consentType, keyWord);
- if (arrayData == null)
- {
- return;
- }
- this.dataGridViewConsentSelectResult.DataSource = new SortableBindingList<ConsentBySearchVO>(arrayData);
- }
- catch (Exception ex)
- {
- throw ex;
- }
- finally
- {
- this.Cursor = currentCursor;
- }
- }
- #endregion
- #region 그리드 이벤트
- private void dataGridViewConsentSelectResult_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
- {
- ConsentBySearchVO vo = GetCurrentConsentSearchVO(e.RowIndex);
- if (vo != null)
- {
- ExecutePreviewWithSelectedConsent(vo);
- RunConsentDualView();
- }
- }
- private void RunConsentDualView()
- {
- if (this.consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
- if (this.commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
- commandControl.RunConsentDualView();
- }
- private void dataGridViewConsentSelectResult_CellContextMenuStripNeeded(object sender, DataGridViewCellContextMenuStripNeededEventArgs e)
- {
- if (e.RowIndex >= 0 && this.dataGridViewConsentSelectResult.Rows[e.RowIndex].Selected == true)
- {
- ContextMenuStrip strip = new ContextMenuStrip();
- ToolStripMenuItem setItemAdd = new ToolStripMenuItem();
- setItemAdd.Text = "즐겨찾기 추가";
- strip.Items.Add(setItemAdd);
- setItemAdd.Click += new EventHandler(setItemAdd_Click);
- e.ContextMenuStrip = strip;
- }
- }
- // 선택된 동의서를 개인SET에 등록
- private void setItemAdd_Click(object sender, EventArgs e)
- {
- IConsentMain consentMain = ConsentMainControl.GetConsentMainInterface(this);
- ConsentCommandCtrl commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
- if (this.dataGridViewConsentSelectResult.SelectedRows.Count != 0)
- {
- Cursor currentCursor = this.Cursor;
- try
- {
- this.Cursor = Cursors.WaitCursor;
- ConsentBySearchVO vo = GetCurrentConsentSearchVO(this.dataGridViewConsentSelectResult.SelectedRows[0].Index);
- // 동의서 SET에 추가하는 웹서비스 콜
- hospitalWebService.SetUserFormSetList(commandControl.CurrentEndUser.UserNo, vo.FormCd);
- this.Cursor = currentCursor;
- MessageBox.Show(string.Format(Properties.Resources.msg_consent_set_added)
- , string.Format(Properties.Resources.msg_caption_confirm), MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- catch
- {
- this.Cursor = currentCursor;
- }
- }
- }
- #endregion
- #region 동의서 미리보기
- private ConsentBySearchVO GetCurrentConsentSearchVO(int rowIndex)
- {
- ConsentBySearchVO vo = null;
- if (rowIndex < 0)
- {
- return vo;
- }
- vo = this.dataGridViewConsentSelectResult.Rows[rowIndex].DataBoundItem as ConsentBySearchVO;
- return vo;
- }
- private void ExecutePreviewWithSelectedConsent(ConsentBySearchVO vo)
- {
- if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
- if (commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
- Cursor currentCursor = this.Cursor;
- try
- {
- this.Cursor = Cursors.WaitCursor;
- commandControl.CurrentPreviewConsent = new PreviewConsent();
- commandControl.CurrentPreviewConsent.FormRid = vo.FormRid.ToString();
- commandControl.CurrentPreviewConsent.FormGuid = vo.FormGuid;
- commandControl.CurrentPreviewConsent.FormCd = vo.FormCd.ToString();
- commandControl.CurrentPreviewConsent.FormName = vo.FormName;
- commandControl.CurrentPreviewConsent.PrntCnt = vo.PrntCnt;
- commandControl.CurrentPreviewConsent.ConsentMstRid = "-1";
- commandControl.CurrentPreviewConsent.ConsentState = string.Empty;
- if (commandControl.CurrentTargetPatient.VisitType.Equals("I") || commandControl.CurrentTargetPatient.VisitType.Equals("E"))
- {
- commandControl.CurrentPreviewConsent.InputId = commandControl.CurrentTargetPatient.MainDrId;
- commandControl.CurrentPreviewConsent.InputNm = commandControl.CurrentTargetPatient.MainDrNm;
- }
- else
- {
- commandControl.CurrentPreviewConsent.InputId = commandControl.CurrentTargetPatient.MainDrId = commandControl.CurrentEndUser.UserNo;
- commandControl.CurrentPreviewConsent.InputNm = commandControl.CurrentTargetPatient.MainDrNm = commandControl.CurrentEndUser.UserName;
- }
- commandControl.CurrentPreviewConsent.ReissueConsentMstRid = 0;
- commandControl.CurrentPreviewConsent.RewriteConsentMstRid = 0;
- commandControl.CurrentPreviewConsent.Ocrtagprntyn = vo.OcrTagYN;
- commandControl.CurrentPreviewConsent.PrintOnly = vo.PrntOnly;
-
- //동의서 맵핑 정보를 상단의 선택된 진료일과 작성자 정보로 한다.
- //consentMain.PatientInfoCtrl.SetBasicPatientInfo();
- consentMain.PatientInfoCtrl.SetConsentDocumentName(vo.FormName);
- commandControl.PreviewConsent(consentMain);
- this.Cursor = currentCursor;
- }
- catch
- {
- this.Cursor = currentCursor;
- }
- }
- #endregion
- }
- }
|