/// [설계자]
/// 클립소프트 연구소 홍지철 (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["userNo"]
, 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.UserNo = this.labelUserNo.Text = consentMain.ConsentExecuteInfo["userNo"];
commandControl.CurrentEndUser.UserName = this.labelUserNm.Text = consentMain.ConsentExecuteInfo["userName"];
// dbs227, password 를 왜 사용하지?
//commandControl.CurrentEndUser.Password = "";
//commandControl.CurrentEndUser.UserGroupCode = "";
commandControl.CurrentEndUser.DeptCode = consentMain.ConsentExecuteInfo["userDeptCd"];
commandControl.CurrentEndUser.DeptName = this.labelUserDept.Text = consentMain.ConsentExecuteInfo["userDeptName"];
commandControl.CurrentEndUser.HosType = consentMain.ConsentExecuteInfo["dutinstcd"];
commandControl.CurrentEndUser.UserTelNo = "";
commandControl.CurrentEndUser.JobKindCd = "9999";
commandControl.CurrentEndUser.JobKindNm = "";
}
else {
string _msg = string.Format("[{0}] 에 해당하는 의사정보가 없습니다.", userid);
MessageBox.Show(_msg);
throw new Exception(_msg);
}
}
else {
commandControl.CurrentEndUser = new EndUser();
commandControl.CurrentEndUser.UserNo = this.labelUserNo.Text = userVO.userId;
commandControl.CurrentEndUser.UserName = this.labelUserNm.Text = userVO.userName;
//commandControl.CurrentEndUser.Password = userVO.;
//commandControl.CurrentEndUser.UserGroupCode = userVO.;
commandControl.CurrentEndUser.DeptCode = userVO.userDeptCode;
commandControl.CurrentEndUser.DeptName = this.labelUserDept.Text = userVO.userDeptName;
commandControl.CurrentEndUser.HosType = userVO.instCd;
commandControl.CurrentEndUser.UserTelNo = userVO.userTelNo;
// 사용자의 직군코드가 없으면 9999 로 설정
commandControl.CurrentEndUser.JobKindCd = string.IsNullOrEmpty(userVO.jobKindCd) ? "9999" : userVO.jobKindCd;
commandControl.CurrentEndUser.JobKindNm = userVO.jobKindNm ?? "";
commandControl.CurrentEndUser.IOFlag = userVO.ioFlag ?? "";
consentMain.ConsentExecuteInfo["userIOFlag"] = commandControl.CurrentEndUser.IOFlag;
}
}
// 환자 정보 셋팅
private void SetPatientBasicInfo(IConsentMain consentMain) {
PatientVO[] patientVOList = this.hospitalWebService.GetPatientInfo(consentMain.ConsentExecuteInfo["patientNo"]
, consentMain.ConsentExecuteInfo["clnDate"]
, consentMain.ConsentExecuteInfo["visitType"]
, consentMain.ConsentExecuteInfo["clnDept"]
, 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);
}
}
///