/// [설계자]
/// 클립소프트 연구소 홍지철 (jchong@clipsoft.co.kr)
/// [원본 작성자]
/// 클립소프트 기술부 이창훈 (chlee@clipsoft.co.kr)
/// [수정 작성자]
/// 클립소프트 기술부 이인희
/// ----------------------------------------------------------------------------------------
/// [HISTORY]
/// 2016-06-21 : 최초작성
/// ----------------------------------------------------------------------------------------
///
public partial class PatientInfoCtrl : PatientInfoCtrlBase {
private HospitalSvcRef.HospitalSvcSoapClient hospitalWebService = null;
IConsentMain consentMain = null;
ConsentCommandCtrl commandControl = null;
public PatientInfoCtrl() {
InitializeComponent();
}
public void SetPatientInfo() {
if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
SetPatientBasicInfo(consentMain);
SetClnDateItem();
}
private void PatientInfoCtrl_Load(object sender, EventArgs e) {
if (this.DesignMode || LicenseManager.UsageMode == LicenseUsageMode.Designtime) {
return;
}
consentMain = ConsentMainControl.GetConsentMainInterface(this);
commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
consentMain.OnLoadPartControls += ConsentMain_OnLoadPartControls;
hospitalWebService = WebMethodCommon.GetHospitalWebService(consentMain.PluginExecuteInfo["hospitalSvcUrl"]);
}
private void ConsentMain_OnLoadPartControls(object sender, EventArgs e) {
if (consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
if (commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
try {
SetEndUser(consentMain);
SetPatientBasicInfo(consentMain);
SetClnDateItem();
if (comboTrmtPrd.Items.Count > 0) comboTrmtPrd.SelectedIndex = 0;
// 로딩 될 때 발행리스트 탭이 갱신 되어야 한다.
consentMain.ConsentListCtrl.consentSelectTabPageAllRefresh();
} catch (UserException uex) {
MessageBox.Show(string.Format(uex.Message)
, string.Format(Properties.Resources.msg_caption_fail),
MessageBoxButtons.OK, MessageBoxIcon.Error);
consentMain.TerminateConsentMain();
}
}
// 작성자 정보 셋팅
private void SetEndUser(IConsentMain consentMain) {
if (commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
GetUserDetailInfo(consentMain.ConsentExecuteInfo["userId"]
, consentMain.ConsentExecuteInfo["dutinstcd"]
, consentMain.ConsentExecuteInfo["userDeptCd"]
, commandControl);
}
private void GetUserDetailInfo(string userid, string dutinstcd, string dutplcecd, ConsentCommandCtrl commandControl) {
UserVO userVO = (UserVO) this.hospitalWebService.GetUserInfo(userid, dutinstcd, dutplcecd);
if (userVO == null) {
if (!string.IsNullOrEmpty(consentMain.ConsentExecuteInfo["userDeptCd"])) {
// 실행 정보에 있는 사용자 정보 설정
commandControl.CurrentEndUser = new EndUser();
commandControl.CurrentEndUser.userId = this.labelUserNo.Text = consentMain.ConsentExecuteInfo["userId"];
commandControl.CurrentEndUser.userName = this.labelUserNm.Text = consentMain.ConsentExecuteInfo["userName"];
commandControl.CurrentEndUser.Password = "";
commandControl.CurrentEndUser.deptcd = consentMain.ConsentExecuteInfo["userDeptCd"];
commandControl.CurrentEndUser.supportDeptcd = consentMain.ConsentExecuteInfo["userSupportDeptCd"];
commandControl.CurrentEndUser.supportBaseCd = consentMain.ConsentExecuteInfo["supportBaseCd"];
commandControl.CurrentEndUser.depthngnm = this.labelUserDept.Text = consentMain.ConsentExecuteInfo["userDeptName"];
//commandControl.CurrentEndUser.UserGroupCode = "";
commandControl.CurrentEndUser.instcd = consentMain.ConsentExecuteInfo["dutinstcd"];
commandControl.CurrentEndUser.userTelNo = "";
commandControl.CurrentEndUser.jobkindcd = userVO.jobKindCd;
commandControl.CurrentEndUser.jobkindnm = userVO.jobKindNm;
commandControl.CurrentEndUser.drkind = userVO.drKind;
} else {
string _msg = string.Format("[{0}] 에 해당하는 의사정보가 없습니다.", userid);
MessageBox.Show(_msg);
throw new Exception(_msg);
}
} else {
commandControl.CurrentEndUser = new EndUser();
commandControl.CurrentEndUser.userId = this.labelUserNo.Text = userVO.userId;
commandControl.CurrentEndUser.userName = this.labelUserNm.Text = userVO.userName;
commandControl.CurrentEndUser.deptcd = userVO.userDeptcd;
commandControl.CurrentEndUser.supportDeptcd = userVO.userSupportDeptCd;
commandControl.CurrentEndUser.supportBaseCd = userVO.userSupportBaseCd;
commandControl.CurrentEndUser.depthngnm = this.labelUserDept.Text = userVO.userDepthngnm;
//commandControl.CurrentEndUser.UserGroupCode = userVO.UserGroupCode;
//commandControl.CurrentEndUser.supportBaseCd = userVO.;
commandControl.CurrentEndUser.instcd = consentMain.ConsentExecuteInfo["dutinstcd"];
commandControl.CurrentEndUser.userTelNo = userVO.userTelNo;
commandControl.CurrentEndUser.jobkindcd = userVO.jobKindCd;
commandControl.CurrentEndUser.jobkindnm = userVO.jobKindNm;
commandControl.CurrentEndUser.ioflag = userVO.ioFlag ?? "";
commandControl.CurrentEndUser.drkind = userVO.drKind;
consentMain.ConsentExecuteInfo["userIOFlag"] = commandControl.CurrentEndUser.ioflag;
}
}
// 환자 정보 셋팅
private void SetPatientBasicInfo(IConsentMain consentMain) {
PatientVO[] patientVOList = this.hospitalWebService.GetPatientInfo(consentMain.ConsentExecuteInfo["patientId"]
, consentMain.ConsentExecuteInfo["patientClnDate"]
, consentMain.ConsentExecuteInfo["patientOrdtype"]
, consentMain.ConsentExecuteInfo["patientClnDept"]
, consentMain.ConsentExecuteInfo["cretno"]
, consentMain.ConsentExecuteInfo["dutinstcd"]
, consentMain.ConsentExecuteInfo["opRsrvNo"]);
// 환자 정보가 없는 경우
if (patientVOList == null || patientVOList.Length == 0) {
commandControl.CurrentTargetPatient = new TargetPatient();
} else {
PatientVO vo = patientVOList[0];
this.labelPtntNm.Text = vo.patientName;
this.labelPtntNo.Text = vo.pid;
commandControl.CurrentTargetPatient = new TargetPatient();
SetTargetPatientInfo(vo);
}
}
///