123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281 |
- #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:ConsentSelectTabPageConsentSet.cs
- //
- #endregion
- using System;
- using System.ComponentModel;
- using System.Windows.Forms;
- using CLIP.eForm.Consent.Dfh.UI.HospitalSvcRef;
- namespace CLIP.eForm.Consent.Dfh.UI
- {
- /// <summary>
- /// 동의서 SET 탭 클래스
- /// </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> 2016-06-28 : 최초작성</p>
- /// <p>----------------------------------------------------------------------------------------</p>
- /// </remarks>
- public partial class ConsentSelectTabPageConsentSet : UserControl
- {
- private HospitalSvcRef.HospitalSvcSoapClient hospitalWebService = null;
- private IConsentMain consentMain = null;
- private ConsentCommandCtrl commandControl = null;
- public ConsentSelectTabPageConsentSet()
- {
- InitializeComponent();
- }
- private void ConsentSelectTabPageConsentSet_Load(object sender, EventArgs e)
- {
- if (this.DesignMode || LicenseManager.UsageMode == LicenseUsageMode.Designtime)
- {
- return;
- }
- consentMain = ConsentMainControl.GetConsentMainInterface(this);
- commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
- hospitalWebService = WebMethodCommon.GetHospitalWebService(consentMain.PluginExecuteInfo["hospitalSvcUrl"]);
- if (commandControl.CurrentEndUser != null)
- {
- InitConsentSetTreeView();
- }
- }
- // 트리 노드 생성 (개인 SET)
- public void InitConsentSetTreeView()
- {
- //개인SET과 진료과SET인 경우
- //ConsentSetVO[] arrayData = this.hospitalWebService.GetConsentSetList(commandControl.CurrentEndUser.UserNo,
- // commandControl.CurrentEndUser.DeptCode);
- ConsentSetVO[] arrayData = this.hospitalWebService.GetConsentSetList(commandControl.CurrentEndUser.UserNo);
- this.treeViewConsentSet.Nodes.Clear();
- TreeNode personalTreeNode = AddFirstChildNodeOfTreeView("PERS", "개인 SET", 1);
- //TreeNode deptTreeNode = AddFirstChildNodeOfTreeView("DEPT", "진료과 SET", 2);
- if (arrayData != null)
- {
- foreach (ConsentSetVO vo in arrayData)
- {
- if (vo.SetAuth.Equals("PERS_SET"))
- {
- AddConsentNode(personalTreeNode, vo);
- }
- //else if (vo.SetAuth.Equals("DEPT_SET"))
- //{
- // AddDeptsConsentSet(vo);
- //}
- }
- }
- this.treeViewConsentSet.Nodes["PERS"].ExpandAll();
- //this.treeViewConsentSet.Nodes["DEPT"].Expand();
- //사용자의 부서에 해당하는 동의서들만 펼친다.
- //if (this.treeViewConsentSet.Nodes["DEPT"].Nodes.ContainsKey(commandControl.CurrentEndUser.DeptCode))
- //{
- // this.treeViewConsentSet.Nodes["DEPT"].Nodes[commandControl.CurrentEndUser.DeptCode].ExpandAll();
- //}
- }
- // 동의서 미리보기
- private void ExecutePreviewWithSelectedConsent()
- {
- ConsentSetVO vo = this.treeViewConsentSet.SelectedNode.Tag as ConsentSetVO;
- if (vo == null)
- {
- return;
- }
- if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
- if (commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
- consentMain.preParamClean();
- PatientInfoCtrl patient = consentMain.PatientInfoCtrl as PatientInfoCtrl;
-
- Cursor currentCursor = this.Cursor;
- 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.PrintOnly;
- //동의서 맵핑 정보를 상단의 선택된 진료일과 작성자 정보로 한다.
- consentMain.PatientInfoCtrl.SetBasicPatientInfo();
-
- consentMain.PatientInfoCtrl.SetConsentDocumentName(vo.FormName);
- commandControl.PreviewConsent(consentMain);
- this.Cursor = currentCursor;
- }
- #region 트리 노드 추가
- private TreeNode AddFirstChildNodeOfTreeView(string treeNodeName, string treeNodeLabel, int imageIndex)
- {
- TreeNode parentNode = new TreeNode(treeNodeLabel);
- parentNode.Name = treeNodeName;
- parentNode.ImageIndex = imageIndex;
- parentNode.SelectedImageIndex = imageIndex;
- this.treeViewConsentSet.Nodes.Add(parentNode);
- return parentNode;
- }
- private void AddConsentNode(TreeNode parentTreeNode, ConsentSetVO consentSet)
- {
- TreeNode childTreeNode = new TreeNode();
- childTreeNode.Text = consentSet.FormName; // + "[" + consentSet.FormCd + "]";
- childTreeNode.ImageIndex = 0;
- childTreeNode.SelectedImageIndex = 0;
- childTreeNode.Tag = consentSet;
- parentTreeNode.Nodes.Add(childTreeNode);
- ContextMenuStrip strip = new ContextMenuStrip();
- ToolStripMenuItem setItemDelete = new ToolStripMenuItem();
- setItemDelete.Text = "즐겨찾기 삭제";
- strip.Items.Add(setItemDelete);
- setItemDelete.Click += new EventHandler(setItemDelete_Click);
- childTreeNode.ContextMenuStrip = strip;
- }
- /*
- private void AddDeptsConsentSet(ConsentSetVO vo)
- {
- TreeNode deptNode = this.treeViewConsentSet.Nodes["DEPT"];
- if (deptNode.Nodes.ContainsKey(vo.DeptCd))
- {
- AddConsentNode(deptNode.Nodes[vo.DeptCd], vo);
- }
- else
- {
- //해당 부서코드 노드를 생성 한다.
- TreeNode deptSubNode = new TreeNode(vo.DeptNm);
- deptSubNode.Name = vo.DeptCd;
- deptSubNode.ImageIndex = 3;
- deptSubNode.SelectedImageIndex = 3;
- deptNode.Nodes.Add(deptSubNode);
- //부서코드 노드에 동의서들을 추가한다.
- AddConsentNode(deptSubNode, vo);
- }
- }
- */
- #endregion
- #region 트리 컨트롤 이벤트
- private void treeViewConsentSet_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
- {
- if (this.treeViewConsentSet.SelectedNode.Tag != null)
- {
- IConsentMain consentMain = ConsentMainControl.GetConsentMainInterface(this);
-
- if (consentMain.ConsentExecuteInfo["patientNo"].Equals(""))
- {
- MessageBox.Show(this, "환자를 먼저 선택하세요.", string.Format(Properties.Resources.msg_caption_confirm),MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- else
- {
- ExecutePreviewWithSelectedConsent();
- RunConsentDualView();
- }
-
- /*
- ConsentSetVO vo = this.treeViewConsentSet.SelectedNode.Tag as ConsentSetVO;
- if (vo != null)
- {
- RunConsentDualView();
- }
- */
- }
- }
- // 트리 노드 선택해서 SET 삭제
- private void setItemDelete_Click(object sender, EventArgs e)
- {
- ConsentSetVO vo = this.treeViewConsentSet.SelectedNode.Tag as ConsentSetVO;
- if (vo == null)
- {
- return;
- }
- IConsentMain consentMain = ConsentMainControl.GetConsentMainInterface(this);
- Cursor currentCursor = this.Cursor;
- try
- {
- this.Cursor = Cursors.WaitCursor;
- // 동의서 SET에 추가하는 웹서비스 콜
- hospitalWebService.DelUserFormSetList(commandControl.CurrentEndUser.UserNo, vo.FormCd);
- this.Cursor = currentCursor;
- MessageBox.Show(string.Format(Properties.Resources.msg_consent_set_deleted)
- , string.Format(Properties.Resources.msg_caption_confirm), MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- catch (Exception ex)
- {
- this.Cursor = currentCursor;
- throw ex;
- }
- finally
- {
- InitConsentSetTreeView();
- }
- }
- private void RunConsentDualView()
- {
- if (this.consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
- if (this.commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
- commandControl.RunConsentDualView();
- }
- #endregion
- }
- }
|