123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377 |
- <?xml version="1.0" encoding="utf-8"?>
- <FDL version="1.5">
- <TypeDefinition url="..\..\..\default_typedef.xml"/>
- <Form id="SearchPatInfo" classname="SearchPatInfo" inheritanceid="" position="absolute 0 0 429 50" titletext="New Form" onload="SearchPatInfo_onload" style="background:transparent;" scrollbars="none">
- <Layouts>
- <Layout>
- <Edit id="edt_pid" taborder="0" onkeyup="lf_searchPid" maxlength="9" anchor="default" position="absolute 71 0 169 20" positiontype="position" inputtype="number" visible="true" ontextchanged="lf_edit_ontextchanged"/>
- <Static id="stt_pid" text="등록번호" class="search_name" anchor="left top" position="absolute 0 1 68 21" positiontype="position"/>
- <Static id="stt_patnm" text="성명" class="search_name" anchor="default" position="absolute 193 1 235 21" positiontype="position"/>
- <Edit id="edt_patnm" taborder="1" onkeyup="lf_searchPatNm" anchor="default" position="absolute 238 0 336 20" positiontype="position" imemode="hangul" visible="true" ontextchanged="lf_edit_ontextchanged"/>
- <Button id="btn_search" taborder="2" class="icon_search" onclick="lf_searchPatient" anchor="default" position="absolute 339 0 359 20" positiontype="position"/>
- <Edit id="edt_rgstno1" taborder="3" inputtype="number" maxlength="6" onkeyup="lf_search" position="absolute 447 5 545 25" visible="false" ontextchanged="lf_edit_ontextchanged"/>
- <Edit id="edt_rgstno2" taborder="4" onkeyup="lf_search" position="absolute 548 5 646 25" visible="false" maxlength="7" inputtype="number" ontextchanged="lf_edit_ontextchanged"/>
- <Edit id="edt_address" taborder="5" maxlength="9" onkeyup="lf_search" position="absolute 447 28 646 48" visible="false" ontextchanged="lf_edit_ontextchanged"/>
- <Edit id="edt_hometel" taborder="6" inputtype="number" maxlength="9" onkeyup="lf_search" position="absolute 448 51 546 71" visible="false" ontextchanged="lf_edit_ontextchanged"/>
- <Edit id="edt_mphone" taborder="7" inputtype="number" maxlength="9" onkeyup="lf_search" position="absolute 449 75 547 95" visible="false" ontextchanged="lf_edit_ontextchanged"/>
- <Calendar id="cal_acptdd" taborder="8" position="absolute 449 99 546 119" visible="false" onchanged="cal_acptdd_onchanged"/>
- </Layout>
- </Layouts>
- <InitValue/>
- <Objects>
- <Dataset id="ds_patInfo" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
- <Dataset id="ds_c1" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="srchcond" type="INT" size="256"/>
- <Column id="checkfnexam" type="INT" size="256"/>
- <Column id="pid" type="STRING" size="256"/>
- <Column id="hngnm" type="STRING" size="256"/>
- <Column id="rrgstno1" type="STRING" size="256"/>
- <Column id="rrgstno2" type="STRING" size="256"/>
- <Column id="acptdd" type="STRING" size="256"/>
- <Column id="instcd" type="STRING" size="256"/>
- <Column id="insukind" type="STRING" size="256"/>
- <Column id="inhospyn" type="STRING" size="256"/>
- <Column id="address" type="STRING" size="256"/>
- <Column id="hometel" type="STRING" size="256"/>
- <Column id="mpphontel" type="STRING" size="256"/>
- <Column id="onlyPtspYN" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_ptsp" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
- </Objects>
- <Script type="xscript4.0"><![CDATA[
- include "com_commonxp::comm_main.xjs"
- include "com_commodulexp::SSZFM00301.xjs"
- //==============================================================================================
- // Global Form Variable
- //----------------------------------------------------------------------------------------------
- var lgv_sDept = ""; //사용부서
- var lgv_nCheckfnexam = 0; //신환, 구환 구분
- var lgv_sPopupDsPatInfo = ""; //환자 조회 정보 데이터셋
- var lgv_sPopupDsPtsp = ""; //특이환자 조회 정보 데이터셋
- var lgv_max_cnt = 20;
- //==============================================================================================
- // Event
- //----------------------------------------------------------------------------------------------
- /***********************************************************************************************
- * Components : Edit
- * Components ID: edt_pid
- * Event :
- * Argument : 01.obj : Object Event has occurred
- * : 02.e : Event Object
- * Description :
- ************************************************************************************************/
- function lf_searchPid(obj:Edit, e:KeyEventInfo)
- {
- if(e.keycode != 13) return;
-
- var nPid = edt_pid.text;
- if(nPid == ""){
- alert("등록번호를 입력하세요");
- return;
- }
- nPid = utlf_lPad(nPid, 9 , 0); //9자리 '0'으로 채우기
- edt_pid.value = nPid;
- lgv_srchCond = 1;
-
- lf_getPatientInfo(1, edt_pid.value, edt_patnm.value); //pid로 환자정보 검색하기
- }
- //타 edit 입력시 value 초기화 함수(ontextchanged event)
- function lf_edit_ontextchanged(obj:Edit, e:TextChangedEventInfo)
- {
- if(e.posttext.length == 0 && obj.name != "edt_rgstno2"){
- if(!utlf_isNull(lgv_firstCtrl)){
- if(obj.name != lgv_firstCtrl.name) lgv_firstCtrl.value = "";
- }
-
- if(!utlf_isNull(lgv_secondCtrl)){
- if(obj.name != lgv_secondCtrl) lgv_secondCtrl.value = "";
- }
-
- if(!utlf_isNull(lgv_thirdCtrl)){
- if(obj.name != lgv_thirdCtrl) lgv_thirdCtrl.value = "";
- }
- }
- }
- /***********************************************************************************************
- * Components : Edit
- * Components ID: edt_patnm
- * Event :
- * Argument : 01.obj : Object Event has occurred
- * : 02.e : Event Object
- * Description :
- ************************************************************************************************/
- function lf_searchPatNm(obj:Edit, e:KeyEventInfo)
- {
- if(e.keycode != 13) return;
-
- if(obj.value.getTrim().length < 2){
- sysf_messageBox("2글자 이상 입력하세요.", "I");
- return;
- }
- lgv_srchCond = obj.kind;
-
- var sFirstValue = utlf_isNull(lgv_firstCtrl) ? "" : utlf_isNull(lgv_firstCtrl.value) ? "" : lgv_firstCtrl.value;
- var sSecondValue = utlf_isNull(lgv_secondCtrl) ? "" : utlf_isNull(lgv_secondCtrl.value) ? "" : lgv_secondCtrl.value;
- var sThirdValue = utlf_isNull(lgv_thirdCtrl) ? "" : utlf_isNull(lgv_thirdCtrl.value) ? "" : lgv_thirdCtrl.value;
-
- lf_getPatientInfo(obj.kind, sFirstValue, sSecondValue, sThirdValue); //pid로 환자정보 검색하기
-
- }
- /***********************************************************************************************
- * Components : Button
- * Components ID:
- * Event :
- * Argument : 01.obj : Object Event has occurred
- * : 02.e : Event Object
- * Description :
- ************************************************************************************************/
- function lf_searchPatient(obj:Button, e:ClickEventInfo)
- {
- var sResult="";
- var sFirstValue = utlf_isNull(lgv_firstCtrl) ? "" : utlf_isNull(lgv_firstCtrl.value) ? "" : lgv_firstCtrl.value;
- var sSecondValue = utlf_isNull(lgv_secondCtrl) ? "" : utlf_isNull(lgv_secondCtrl.value) ? "" : lgv_secondCtrl.value;
- var sThirdValue = utlf_isNull(lgv_thirdCtrl) ? "" : utlf_isNull(lgv_thirdCtrl.value) ? "" : lgv_thirdCtrl.value;
-
- if(sFirstValue != "" && lgv_firstCtrl.name == "edt_pid" && lgv_firstCtrl.text != ""){ //등록번호 컨트롤에 값이 있는 경우
- edt_pid.value = utlf_lPad(lgv_firstCtrl.text, 9 , 0); //9자리 '0'으로 채우기;
- }
-
- if(utlf_isNull(lgv_showPtPopup)) lgv_showPtPopup = false; //아무런 값이 매핑 되어 있지 않으면 default : false
-
- if(sFirstValue == "" && sSecondValue == "" && sThirdValue == "" || lgv_showPtPopup == true){ //아무 값도 입력하지 않은 경우
- sResult = lf_popupPatientInfo(lgv_srchCond, sFirstValue, sSecondValue, sThirdValue);
-
- edt_pid.value = ds_patInfo.getColumn(0, "pid"); //등록번호
- edt_patnm.value = ds_patInfo.getColumn(0, "hngnm"); //성명 채우기
- edt_rgstno1.value = ds_patInfo.getColumn(0, "rrgstno1"); //주민번호1
- edt_rgstno2.value = ds_patInfo.getColumn(0, "rrgstno2"); //주민번호2
- edt_address.value = ds_patInfo.getColumn(0, "addr"); //주소
- edt_hometel.value = ds_patInfo.getColumn(0, "hometel"); //전화번호
- edt_mphone.value = ds_patInfo.getColumn(0, "mpphontel"); //핸드폰
-
- lf_callBack_SearchPatInfo(this.name, sResult);
- }else{ //입력한 값이 있는 경우
- lf_getPatientInfo(lgv_srchCond, sFirstValue, sSecondValue, sThirdValue);
- }
- }
- //==============================================================================================
- // Function
- //----------------------------------------------------------------------------------------------
- /***********************************************************************************************
- * 함수명 : lf_setDataSearchPatInfo
- * 설 명 : 사용부서 및 산환, 구환 구분 초기화.
- * argument : sDept - 환자정보 조회를 사용하는 부서(1: 원무이외의 부서 2: 원무)
- * : sCheckfnexam - 사용부서가 원무일 때 신환/구환 구분 flag(1: 구환, 2: 신환)
- * return Type :
- * 작성자 : 윤지현
- ************************************************************************************************/
- function lf_setDataSearchPatInfo(sDept, sCheckfnexam)
- {
- lgv_sDept = sDept;
- lgv_nCheckfnexam = Number(sCheckfnexam);
- }
- /***********************************************************************************************
- * 함수명 : lf_popupPatientInfo
- * 설 명 : 환자조회화면(SPXXX00000) 모달 띄우기.
- * argument : sSrchcond - 검색옵션 1 : 등록번호
- * return Type :
- ************************************************************************************************/
- function lf_popupPatientInfo(sSrchcond, pFirstValue, pSecondValue, pThirdValue){
- var objArg = new Object();
- objArg.firstValue = pFirstValue;
- objArg.secondValue = pSecondValue;
- objArg.thirdValue = pThirdValue;
- objArg.srchcond = sSrchcond;
- objArg.dept = lgv_sDept;
- objArg.checkfnexam = lgv_nCheckfnexam;
- var rtn = frmf_modal("SPZFM00301", "SPZFM00301", objArg, -1, -1, -1, -1, "title=true");
-
- if(rtn == false){ //취소나 닫기 버튼을 누른 경우
- if(!utlf_isNull(lgv_firstCtrl)) lgv_firstCtrl.value = "";
- if(!utlf_isNull(lgv_secondCtrl)) lgv_secondCtrl.value = "";
- if(!utlf_isNull(lgv_thirdCtrl)) lgv_thirdCtrl.value = "";
- ds_patInfo.clear();
- ds_ptsp.clear();
- }else{
- ds_patInfo.copyData(lgv_sPopupDsPatInfo);
- ds_ptsp.copyData(lgv_sPopupDsPtsp);
- }
- return rtn;
- }
- /***********************************************************************************************
- * 함수명 : lf_getPatientInfo
- * 설 명 : 환자ID 로 환자정보조회
- * argument : sSrchcond - 검색옵션
- * : sPid - 검색할 환자명
- * return Type :
- ************************************************************************************************/
- function lf_getPatientInfo(sSrchcond, pFirstValue, pSecondValue, pThirdValue)
- {
- ds_c1.clearData();
- var nRow = ds_c1.addRow();
- ds_c1.setColumn(nRow, "srchcond", sSrchcond);
-
- if(sSrchcond == "1" || sSrchcond == "2"){ //등록번호 , 환자명일 경우
- if(utlf_isNull(pFirstValue)){
- if(sSrchcond == "1") sysf_messageBox("등록번호를 입력하세요.", "I");
- else if(sSrchcond == "2") sysf_messageBox("환자명을 입력하세요.", "I");
- return;
- }
- ds_c1.setColumn(nRow, "pid", utlf_lPad(pFirstValue, 9 , 0));
- ds_c1.setColumn(nRow, "hngnm", pSecondValue);
- }
-
- if(sSrchcond == "3"){ //주민번호일 경우
- if(pFirstValue == "" && pSecondValue ==""){
- sysf_messageBox("주민번호를 입력하세요.", "I");
- return;
- }
- ds_c1.setColumn(nRow, "rrgstno1", pFirstValue);
- ds_c1.setColumn(nRow, "rrgstno2", pSecondValue);
- }
-
- if(sSrchcond == "4"){ //환자명/주민번호일 경우
- if(pFirstValue == "" && pSecondValue =="" && pThirdValue ==""){
- sysf_messageBox("환자명/주민번호를 입력하세요.", "I");
- return;
- }
- ds_c1.setColumn(nRow, "hngnm", pFirstValue);
- ds_c1.setColumn(nRow, "rrgstno1", pSecondValue);
- ds_c1.setColumn(nRow, "rrgstno2", pThirdValue);
- }
-
- if(sSrchcond == "7"){ //환자명/주소일 경우
- if(pFirstValue == "" && pSecondValue ==""){
- sysf_messageBox("환자명/주소를 입력하세요.", "I");
- return;
- }
-
- ds_c1.setColumn(nRow, "hngnm", pFirstValue);
- ds_c1.setColumn(nRow, "address", pSecondValue);
- }
-
- if(sSrchcond == "9"){ //전화/핸드폰번호일 경우
- if(pFirstValue == "" && pSecondValue ==""){
- sysf_messageBox("전화/핸드폰을 입력하세요.", "I");
- return;
- }
-
- ds_c1.setColumn(nRow, "hometel", pFirstValue);
- ds_c1.setColumn(nRow, "mpphontel", pSecondValue);
- }
-
- ds_c1.setColumn(nRow, "onlyPtspYN", "N");
-
- var sPageDs = dsf_createDsRow("in_ds_page"
- , [{col: "max_cnt", type: "int", val: lgv_max_cnt }
- , {col: "offset", type: "int", val: 0}
- , {col: "tot_cnt", type: "string", val: "true"}]);
-
- tranf_submit({
- id: "tr_reqGetPatInfo"
- , service: "commoduleapp.BizModule"
- , method: "reqGetPatInfo"
- , inds: "req=ds_c1 page=" + sPageDs
- , outds: "ds_patInfo=patinfolist ds_ptsp=ptsp ds_countInfo=countinfo"
- , async: true
- , callback: "cbf_tr_reqGetPatInfo"
- });
- }
- function cbf_tr_reqGetPatInfo(strSvcID, nErrorCode, strErrorMag)
- {
- if(nErrorCode != 0){
- sysf_messageBox("환자정보를 조회하는데 실패하였습니다.", "E");
- }else{
- if(ds_patInfo.rowcount < 1){
- sysf_messageBox("해당 환자가 존재하지 않습니다.", "I");
- return;
- }
- var sResult="";
- if(ds_patInfo.rowcount > 1){
-
- ds_patInfo.clear();
- ds_ptsp.clear();
-
- var sFirstValue = utlf_isNull(lgv_firstCtrl) ? "" : utlf_isNull(lgv_firstCtrl.value) ? "" : lgv_firstCtrl.value;
- var sSecondValue = utlf_isNull(lgv_secondCtrl) ? "" : utlf_isNull(lgv_secondCtrl.value) ? "" : lgv_secondCtrl.value;
- var sThirdValue = utlf_isNull(lgv_thirdCtrl) ? "" : utlf_isNull(lgv_thirdCtrl.value) ? "" : lgv_thirdCtrl.value;
-
- sResult = lf_popupPatientInfo(lgv_srchCond, sFirstValue, sSecondValue, sThirdValue);
- }
-
-
- edt_pid.value = ds_patInfo.getColumn(0, "pid"); //등록번호
- edt_patnm.value = ds_patInfo.getColumn(0, "hngnm"); //성명 채우기
- edt_rgstno1.value = ds_patInfo.getColumn(0, "rrgstno1"); //주민번호1
- edt_rgstno2.value = ds_patInfo.getColumn(0, "rrgstno2"); //주민번호2
- edt_address.value = ds_patInfo.getColumn(0, "addr"); //주소
- edt_hometel.value = ds_patInfo.getColumn(0, "hometel"); //전화번호
- edt_mphone.value = ds_patInfo.getColumn(0, "mpphontel"); //핸드폰
-
- // 이중합번 체크 (2015-01-19, 이상준)
- var sBindPid = ds_patInfo.getColumn(0, "bindpid"); //합번
- if( sBindPid != '-' && sBindPid != '' && sBindPid != ' ' && utlf_isNull(sBindPid)==false )
- {
- var sPid = ds_patInfo.getColumn(0, "pid"); //등록번호
- var sHngnm = ds_patInfo.getColumn(0, "hngnm"); //성명 채우기
-
- var retValue = sysf_messageBox(sPid + "(" + sHngnm + ") 환자의 등록번호가 [ " + sBindPid + " ] 로 합번 되었습니다. 합번된 등록번호로 재조회 하시겠습니까?", "Q999", "");
- if( retValue == '6' )
- {
- edt_pid.value = ds_patInfo.getColumn(0, "bindpid"); //합번
- lf_getPatientInfo(1, edt_pid.value, edt_patnm.value); //pid로 환자정보 검색하기
- }
- }
-
-
- lf_callBack_SearchPatInfo(this.name, sResult);
- }
- }
- //edit control keyup 이벤트
- function lf_search(obj:Edit, e:KeyEventInfo)
- {
- if(e.keycode != 13) return;
-
- var sFirstValue = utlf_isNull(lgv_firstCtrl) ? "" : utlf_isNull(lgv_firstCtrl.value) ? "" : lgv_firstCtrl.value;
- var sSecondValue = utlf_isNull(lgv_secondCtrl) ? "" : utlf_isNull(lgv_secondCtrl.value) ? "" : lgv_secondCtrl.value;
- var sThirdValue = utlf_isNull(lgv_thirdCtrl) ? "" : utlf_isNull(lgv_thirdCtrl.value) ? "" : lgv_thirdCtrl.value;
-
- lf_getPatientInfo(lgv_srchCond, sFirstValue, sSecondValue, sThirdValue); //pid로 환자정보 검색하기
- }
- function SearchPatInfo_onload(obj:Form, e:LoadEventInfo)
- {
- lf_setCtrl("1");
- }
- ]]></Script>
- </Form>
- </FDL>
|