/// [설계자]
/// 클립소프트 연구소 홍지철 (jchong@clipsoft.co.kr)
/// [원본 작성자]
/// 클립소프트 기술부 이인희
/// [수정 작성자]
///
/// ----------------------------------------------------------------------------------------
/// [HISTORY]
/// 2016-07-11 : 최초작성
/// ----------------------------------------------------------------------------------------
///
public partial class PatientSelectTabOutPatient : UserControl
{
private IConsentMain consentMain = null;
private ConsentCommandCtrl commandControl = null;
private HospitalSvcRef.HospitalSvcSoapClient hospitalWebService = null;
public PatientSelectTabOutPatient()
{
InitializeComponent();
}
private void PatientSelectTabOutPatient_Load(object sender, EventArgs e)
{
if (this.DesignMode || LicenseManager.UsageMode == LicenseUsageMode.Designtime)
{
return;
}
consentMain = ConsentMainControl.GetConsentMainInterface(this);
if (commandControl == null) commandControl = consentMain.ConsentCommandCtrl as ConsentCommandCtrl;
hospitalWebService = WebMethodCommon.GetHospitalWebService(consentMain.PluginExecuteInfo["hospitalSvcUrl"]);
this.dateTimePickerClnDate.Value = DateTime.Now;
InitComboBind();
//setSearchDeptCode(commandControl.CurrentTargetPatient.clnDeptCode);
string tempval = "";
if (commandControl.CurrentEndUser.DeptCode.Substring(0, 3).Equals("201"))//내과계열은 직원 소속 부서가 전부 내과 외래라 구분 불가
{
if (commandControl.CurrentEndUser.DeptCode.Substring(0, 4).Equals("2011"))//감염내과 세팅
{
tempval = commandControl.CurrentEndUser.DeptCode.Substring(0, 4) + "000000";
}
else
{
tempval = "";
}
}
else//내과아닌곳은 세팅
{
tempval = commandControl.CurrentEndUser.DeptCode.Substring(0, 3) +"0000000";
}
setSearchDeptCode(tempval);
InitDataGrid();
}
public void setSearchDeptCode(string clnDeptCode)
{
if (!string.IsNullOrEmpty(clnDeptCode) && this.comboDept != null)
{
this.comboDept.SelectedValue = clnDeptCode;
}
}
private void InitComboBind()
{
// 진료과
DeptListVO[] deptList = this.hospitalWebService.GetDeptList(GetSelectGubunValue());
if (deptList != null)
{
this.comboDept.DisplayMember = "deptnm";
this.comboDept.ValueMember = "deptcd";
this.comboDept.DataSource = deptList;
}
}
private void InitDataGrid()
{
this.dataGridViewPatientSelectResult.AutoGenerateColumns = false;
this.dataGridViewPatientSelectResult.AllowUserToAddRows = false;
//this.dataGridViewPatientSelectResult.CellPainting += new DataGridViewCellPaintingEventHandler(this.dataGridViewPatientSelectResult_CellPainting);
this.dataGridViewPatientSelectResult.ColumnHeaderMouseClick += new DataGridViewCellMouseEventHandler(this.dataGridViewPatientSelectResult_ColumnHeaderMouseClick);
this.dataGridViewPatientSelectResult.RowPostPaint += new DataGridViewRowPostPaintEventHandler(this.dataGridViewPatientSelectResult_RowPostPaint);
CommonUtil.AddNewCheckBoxColumnToDataGridView(this.dataGridViewPatientSelectResult, "□", "colCheck", true, 30, DataGridViewContentAlignment.MiddleCenter);
CommonUtil.AddNewColumnToDataGridView(this.dataGridViewPatientSelectResult, "등록번호", "pid", true, 60);
CommonUtil.AddNewColumnToDataGridView(this.dataGridViewPatientSelectResult, "성명", "hngnm", true, 80);
CommonUtil.AddNewColumnToDataGridView(this.dataGridViewPatientSelectResult, "구분", "elbulbodstat", true, 40);
CommonUtil.AddNewColumnToDataGridView(this.dataGridViewPatientSelectResult, "초진", "fsexamflag", true, 60);
CommonUtil.AddNewColumnToDataGridView(this.dataGridViewPatientSelectResult, "진료일자", "indd", true, 80);
CommonUtil.AddNewColumnToDataGridView(this.dataGridViewPatientSelectResult, "시간", "ordtm", true, 60);
CommonUtil.AddNewColumnToDataGridView(this.dataGridViewPatientSelectResult, "과", "deptengabbr", true, 40);
CommonUtil.AddNewColumnToDataGridView(this.dataGridViewPatientSelectResult, "진료의", "doctornm", true, 80);
}
#region 환자 조회
public void BindDataGridRows()
{
if (this.consentMain == null) consentMain = ConsentMainControl.GetConsentMainInterface(this);
if (this.hospitalWebService == null) this.hospitalWebService = WebMethodCommon.GetHospitalWebService(consentMain.PluginExecuteInfo["hospitalSvcUrl"]);
string srchdd = this.dateTimePickerClnDate.Value.ToShortDateString().Replace("-", "");
string orddeptcd = (this.comboDept.Items.Count > 0) ? this.comboDept.SelectedValue.ToString().Trim() : "";
string doctorid = (this.comboDoctor.Items.Count > 0) ? this.comboDoctor.SelectedValue.ToString().Trim() : "";
string pid = this.textBoxSearchText.Text.Trim();
string patstat = GetSelectGubunValue();
PatListVO[] resultData = hospitalWebService.GetOutPatList(srchdd, orddeptcd, doctorid, pid, patstat);
if (resultData == null)
{
return;
}
this.dataGridViewPatientSelectResult.DataSource = new SortableBindingList