/// [설계자]
/// 클립소프트 연구소 홍지철 (jchong@clipsoft.co.kr)
/// [원본 작성자]
/// 클립소프트 기술부 이인희
/// [수정 작성자]
///
/// ----------------------------------------------------------------------------------------
/// [HISTORY]
/// 2016-07-11 : 최초작성
/// ----------------------------------------------------------------------------------------
///
public partial class PatientSelectTabInPatient : UserControl {
private IConsentMain consentMain = null;
private ConsentCommandCtrl commandControl = null;
private HospitalSvcRef.HospitalSvcSoapClient hospitalWebService = null;
public PatientSelectTabInPatient() {
InitializeComponent();
}
private void PatientSelectTabInPatient_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"]);
// 의사로 Agent 를 실행할 경우 입원 환자 탭에서 내환자 체크 박스 숨기기
//if (commandControl.CurrentEndUser != null) {
// if (!string.IsNullOrEmpty(commandControl.CurrentEndUser.jobkindcd)) {
// if (!commandControl.CurrentEndUser.jobkindcd.Substring(0, 2).Equals("11")) {
// chkMyPatient.Visible = false;
// }
// }
//}
this.dateTimePickerClnDate.Value = DateTime.Now;
InitComboBind();
foreach (DeptListVO ward in (DeptListVO[]) comboWard.DataSource) {
if (ward.deptCd.Equals(commandControl.CurrentEndUser.deptcd)) {
comboWard.SelectedValue = commandControl.CurrentEndUser.deptcd;
break;
}
}
InitDataGrid();
}
public Hashtable getQueryString() {
//var result = new {
// fromdd = dateTimePickerClnDate.Value.ToString("yyyyMMdd"),
// wardcd = (this.comboWard.Items.Count > 0) ? this.comboWard.SelectedValue.ToString().Trim() : "",
// deptcd = (this.comboDept.Items.Count > 0) ? this.comboDept.SelectedValue.ToString().Trim() : "",
// doctorId = (this.comboDoctor.Items.Count > 0) ? this.comboDoctor.SelectedValue.ToString().Trim() : ""
//};
string srchDd = dateTimePickerClnDate.Value.ToString("yyyyMMdd");
string wardCd = (this.comboWard.Items.Count > 0) ? this.comboWard.SelectedValue.ToString().Trim() : "";
string deptCd = (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;
string strGubun = "";
string myPatient = "N";
DocListVO[] list = (DocListVO[]) comboDoctor.DataSource;
var drKind = "";
foreach(DocListVO vo in list) {
if(vo != null && vo.doctorId.Equals(doctorId)) {
drKind = vo.drKind;
break;
}
}
//string drKind = commandControl.CurrentEndUser.drkind;
if (this.radioGubunIng.Checked) {
strGubun = radioGubunIng.Tag.ToString();
} else if (this.radioGubunOut.Checked) {
strGubun = radioGubunOut.Tag.ToString();
} else if (this.radioGubunFuture.Checked) {
strGubun = radioGubunFuture.Tag.ToString();
} else {
strGubun = radioGubunTemp.Tag.ToString();
}
if (this.chkMyPatient.Checked == true) {
myPatient = "Y";
}
Hashtable result = new Hashtable();
result.Add("pid", pid);
result.Add("srchDd", srchDd);
result.Add("wardCd", wardCd);
result.Add("ordDeptCd", deptCd);
result.Add("doctorId", doctorId);
result.Add("patientState", strGubun);
result.Add("myPatient", myPatient);
result.Add("ordType", "I");
result.Add("drKind", drKind);
return result;
}
private void InitComboBind() {
// 병동 정보 가져오기 및 설정
DeptListVO[] wardList = this.hospitalWebService.GetWardList(this.consentMain.ConsentExecuteInfo["dutinstcd"]);
if (wardList != null) {
this.comboWard.DisplayMember = "deptnm";
this.comboWard.ValueMember = "deptcd";
this.comboWard.DataSource = wardList;
}
// 진료과 정보 가져오기 및 설정
//DeptListVO[] deptList = this.hospitalWebService.GetDeptList(GetSelectGubunValue(), this.consentMain.ConsentExecuteInfo["dutinstcd"]);
DeptListVO[] deptList = this.hospitalWebService.GetOrgDeptList(GetSelectGubunValue(), this.consentMain.ConsentExecuteInfo["dutinstcd"]);
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", false, 30, DataGridViewContentAlignment.MiddleCenter);
CommonUtil.AddNewColumnToDataGridView(this.dataGridViewPatientSelectResult, "입원일자", "indd", true, 70);
CommonUtil.AddNewColumnToDataGridView(this.dataGridViewPatientSelectResult, "병실", "roomcd", true, 40);
CommonUtil.AddNewColumnToDataGridView(this.dataGridViewPatientSelectResult, "성별/나이", "hngnm", true, 90);
CommonUtil.AddNewColumnToDataGridView(this.dataGridViewPatientSelectResult, "등록번호", "pid", true, 60);
CommonUtil.AddNewColumnToDataGridView(this.dataGridViewPatientSelectResult, "진료과", "deptnm", true, 120);
CommonUtil.AddNewColumnToDataGridView(this.dataGridViewPatientSelectResult, "담당교수", "doctornm", true, 80);
CommonUtil.AddNewColumnToDataGridView(this.dataGridViewPatientSelectResult, "구분", "dschnoti", false, 80);
//dataGridViewPatientSelectResult.Columns["colCheck"].Visible = false;
}
#region 환자 조회
///