SSZFM00301_PatientInfoRtrv.xfdl 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SearchPatInfo" classname="SearchPatInfo" inheritanceid="" position="absolute 0 0 429 50" titletext="New Form" onload="SearchPatInfo_onload" style="background:transparent;" scrollbars="none">
  5. <Layouts>
  6. <Layout>
  7. <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"/>
  8. <Static id="stt_pid" text="등록번호" class="search_name" anchor="left top" position="absolute 0 1 68 21" positiontype="position"/>
  9. <Static id="stt_patnm" text="성명" class="search_name" anchor="default" position="absolute 193 1 235 21" positiontype="position"/>
  10. <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"/>
  11. <Button id="btn_search" taborder="2" class="icon_search" onclick="lf_searchPatient" anchor="default" position="absolute 339 0 359 20" positiontype="position"/>
  12. <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"/>
  13. <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"/>
  14. <Edit id="edt_address" taborder="5" maxlength="9" onkeyup="lf_search" position="absolute 447 28 646 48" visible="false" ontextchanged="lf_edit_ontextchanged"/>
  15. <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"/>
  16. <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"/>
  17. <Calendar id="cal_acptdd" taborder="8" position="absolute 449 99 546 119" visible="false" onchanged="cal_acptdd_onchanged"/>
  18. </Layout>
  19. </Layouts>
  20. <InitValue/>
  21. <Objects>
  22. <Dataset id="ds_patInfo" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  23. <Dataset id="ds_c1" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  24. <ColumnInfo>
  25. <Column id="srchcond" type="INT" size="256"/>
  26. <Column id="checkfnexam" type="INT" size="256"/>
  27. <Column id="pid" type="STRING" size="256"/>
  28. <Column id="hngnm" type="STRING" size="256"/>
  29. <Column id="rrgstno1" type="STRING" size="256"/>
  30. <Column id="rrgstno2" type="STRING" size="256"/>
  31. <Column id="acptdd" type="STRING" size="256"/>
  32. <Column id="instcd" type="STRING" size="256"/>
  33. <Column id="insukind" type="STRING" size="256"/>
  34. <Column id="inhospyn" type="STRING" size="256"/>
  35. <Column id="address" type="STRING" size="256"/>
  36. <Column id="hometel" type="STRING" size="256"/>
  37. <Column id="mpphontel" type="STRING" size="256"/>
  38. <Column id="onlyPtspYN" type="STRING" size="256"/>
  39. </ColumnInfo>
  40. </Dataset>
  41. <Dataset id="ds_ptsp" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  42. </Objects>
  43. <Script type="xscript4.0"><![CDATA[
  44. include "com_commonxp::comm_main.xjs"
  45. include "com_commodulexp::SSZFM00301.xjs"
  46. //==============================================================================================
  47. // Global Form Variable
  48. //----------------------------------------------------------------------------------------------
  49. var lgv_sDept = ""; //사용부서
  50. var lgv_nCheckfnexam = 0; //신환, 구환 구분
  51. var lgv_sPopupDsPatInfo = ""; //환자 조회 정보 데이터셋
  52. var lgv_sPopupDsPtsp = ""; //특이환자 조회 정보 데이터셋
  53. var lgv_max_cnt = 20;
  54. //==============================================================================================
  55. // Event
  56. //----------------------------------------------------------------------------------------------
  57. /***********************************************************************************************
  58. * Components : Edit
  59. * Components ID: edt_pid
  60. * Event :
  61. * Argument : 01.obj : Object Event has occurred
  62. * : 02.e : Event Object
  63. * Description :
  64. ************************************************************************************************/
  65. function lf_searchPid(obj:Edit, e:KeyEventInfo)
  66. {
  67. if(e.keycode != 13) return;
  68. var nPid = edt_pid.text;
  69. if(nPid == ""){
  70. alert("등록번호를 입력하세요");
  71. return;
  72. }
  73. nPid = utlf_lPad(nPid, 9 , 0); //9자리 '0'으로 채우기
  74. edt_pid.value = nPid;
  75. lgv_srchCond = 1;
  76. lf_getPatientInfo(1, edt_pid.value, edt_patnm.value); //pid로 환자정보 검색하기
  77. }
  78. //타 edit 입력시 value 초기화 함수(ontextchanged event)
  79. function lf_edit_ontextchanged(obj:Edit, e:TextChangedEventInfo)
  80. {
  81. if(e.posttext.length == 0 && obj.name != "edt_rgstno2"){
  82. if(!utlf_isNull(lgv_firstCtrl)){
  83. if(obj.name != lgv_firstCtrl.name) lgv_firstCtrl.value = "";
  84. }
  85. if(!utlf_isNull(lgv_secondCtrl)){
  86. if(obj.name != lgv_secondCtrl) lgv_secondCtrl.value = "";
  87. }
  88. if(!utlf_isNull(lgv_thirdCtrl)){
  89. if(obj.name != lgv_thirdCtrl) lgv_thirdCtrl.value = "";
  90. }
  91. }
  92. }
  93. /***********************************************************************************************
  94. * Components : Edit
  95. * Components ID: edt_patnm
  96. * Event :
  97. * Argument : 01.obj : Object Event has occurred
  98. * : 02.e : Event Object
  99. * Description :
  100. ************************************************************************************************/
  101. function lf_searchPatNm(obj:Edit, e:KeyEventInfo)
  102. {
  103. if(e.keycode != 13) return;
  104. if(obj.value.getTrim().length < 2){
  105. sysf_messageBox("2글자 이상 입력하세요.", "I");
  106. return;
  107. }
  108. lgv_srchCond = obj.kind;
  109. var sFirstValue = utlf_isNull(lgv_firstCtrl) ? "" : utlf_isNull(lgv_firstCtrl.value) ? "" : lgv_firstCtrl.value;
  110. var sSecondValue = utlf_isNull(lgv_secondCtrl) ? "" : utlf_isNull(lgv_secondCtrl.value) ? "" : lgv_secondCtrl.value;
  111. var sThirdValue = utlf_isNull(lgv_thirdCtrl) ? "" : utlf_isNull(lgv_thirdCtrl.value) ? "" : lgv_thirdCtrl.value;
  112. lf_getPatientInfo(obj.kind, sFirstValue, sSecondValue, sThirdValue); //pid로 환자정보 검색하기
  113. }
  114. /***********************************************************************************************
  115. * Components : Button
  116. * Components ID:
  117. * Event :
  118. * Argument : 01.obj : Object Event has occurred
  119. * : 02.e : Event Object
  120. * Description :
  121. ************************************************************************************************/
  122. function lf_searchPatient(obj:Button, e:ClickEventInfo)
  123. {
  124. var sResult="";
  125. var sFirstValue = utlf_isNull(lgv_firstCtrl) ? "" : utlf_isNull(lgv_firstCtrl.value) ? "" : lgv_firstCtrl.value;
  126. var sSecondValue = utlf_isNull(lgv_secondCtrl) ? "" : utlf_isNull(lgv_secondCtrl.value) ? "" : lgv_secondCtrl.value;
  127. var sThirdValue = utlf_isNull(lgv_thirdCtrl) ? "" : utlf_isNull(lgv_thirdCtrl.value) ? "" : lgv_thirdCtrl.value;
  128. if(sFirstValue != "" && lgv_firstCtrl.name == "edt_pid" && lgv_firstCtrl.text != ""){ //등록번호 컨트롤에 값이 있는 경우
  129. edt_pid.value = utlf_lPad(lgv_firstCtrl.text, 9 , 0); //9자리 '0'으로 채우기;
  130. }
  131. if(utlf_isNull(lgv_showPtPopup)) lgv_showPtPopup = false; //아무런 값이 매핑 되어 있지 않으면 default : false
  132. if(sFirstValue == "" && sSecondValue == "" && sThirdValue == "" || lgv_showPtPopup == true){ //아무 값도 입력하지 않은 경우
  133. sResult = lf_popupPatientInfo(lgv_srchCond, sFirstValue, sSecondValue, sThirdValue);
  134. edt_pid.value = ds_patInfo.getColumn(0, "pid"); //등록번호
  135. edt_patnm.value = ds_patInfo.getColumn(0, "hngnm"); //성명 채우기
  136. edt_rgstno1.value = ds_patInfo.getColumn(0, "rrgstno1"); //주민번호1
  137. edt_rgstno2.value = ds_patInfo.getColumn(0, "rrgstno2"); //주민번호2
  138. edt_address.value = ds_patInfo.getColumn(0, "addr"); //주소
  139. edt_hometel.value = ds_patInfo.getColumn(0, "hometel"); //전화번호
  140. edt_mphone.value = ds_patInfo.getColumn(0, "mpphontel"); //핸드폰
  141. lf_callBack_SearchPatInfo(this.name, sResult);
  142. }else{ //입력한 값이 있는 경우
  143. lf_getPatientInfo(lgv_srchCond, sFirstValue, sSecondValue, sThirdValue);
  144. }
  145. }
  146. //==============================================================================================
  147. // Function
  148. //----------------------------------------------------------------------------------------------
  149. /***********************************************************************************************
  150. * 함수명 : lf_setDataSearchPatInfo
  151. * 설 명 : 사용부서 및 산환, 구환 구분 초기화.
  152. * argument : sDept - 환자정보 조회를 사용하는 부서(1: 원무이외의 부서 2: 원무)
  153. * : sCheckfnexam - 사용부서가 원무일 때 신환/구환 구분 flag(1: 구환, 2: 신환)
  154. * return Type :
  155. * 작성자 : 윤지현
  156. ************************************************************************************************/
  157. function lf_setDataSearchPatInfo(sDept, sCheckfnexam)
  158. {
  159. lgv_sDept = sDept;
  160. lgv_nCheckfnexam = Number(sCheckfnexam);
  161. }
  162. /***********************************************************************************************
  163. * 함수명 : lf_popupPatientInfo
  164. * 설 명 : 환자조회화면(SPXXX00000) 모달 띄우기.
  165. * argument : sSrchcond - 검색옵션 1 : 등록번호
  166. * return Type :
  167. ************************************************************************************************/
  168. function lf_popupPatientInfo(sSrchcond, pFirstValue, pSecondValue, pThirdValue){
  169. var objArg = new Object();
  170. objArg.firstValue = pFirstValue;
  171. objArg.secondValue = pSecondValue;
  172. objArg.thirdValue = pThirdValue;
  173. objArg.srchcond = sSrchcond;
  174. objArg.dept = lgv_sDept;
  175. objArg.checkfnexam = lgv_nCheckfnexam;
  176. var rtn = frmf_modal("SPZFM00301", "SPZFM00301", objArg, -1, -1, -1, -1, "title=true");
  177. if(rtn == false){ //취소나 닫기 버튼을 누른 경우
  178. if(!utlf_isNull(lgv_firstCtrl)) lgv_firstCtrl.value = "";
  179. if(!utlf_isNull(lgv_secondCtrl)) lgv_secondCtrl.value = "";
  180. if(!utlf_isNull(lgv_thirdCtrl)) lgv_thirdCtrl.value = "";
  181. ds_patInfo.clear();
  182. ds_ptsp.clear();
  183. }else{
  184. ds_patInfo.copyData(lgv_sPopupDsPatInfo);
  185. ds_ptsp.copyData(lgv_sPopupDsPtsp);
  186. }
  187. return rtn;
  188. }
  189. /***********************************************************************************************
  190. * 함수명 : lf_getPatientInfo
  191. * 설 명 : 환자ID 로 환자정보조회
  192. * argument : sSrchcond - 검색옵션
  193. * : sPid - 검색할 환자명
  194. * return Type :
  195. ************************************************************************************************/
  196. function lf_getPatientInfo(sSrchcond, pFirstValue, pSecondValue, pThirdValue)
  197. {
  198. ds_c1.clearData();
  199. var nRow = ds_c1.addRow();
  200. ds_c1.setColumn(nRow, "srchcond", sSrchcond);
  201. if(sSrchcond == "1" || sSrchcond == "2"){ //등록번호 , 환자명일 경우
  202. if(utlf_isNull(pFirstValue)){
  203. if(sSrchcond == "1") sysf_messageBox("등록번호를 입력하세요.", "I");
  204. else if(sSrchcond == "2") sysf_messageBox("환자명을 입력하세요.", "I");
  205. return;
  206. }
  207. ds_c1.setColumn(nRow, "pid", utlf_lPad(pFirstValue, 9 , 0));
  208. ds_c1.setColumn(nRow, "hngnm", pSecondValue);
  209. }
  210. if(sSrchcond == "3"){ //주민번호일 경우
  211. if(pFirstValue == "" && pSecondValue ==""){
  212. sysf_messageBox("주민번호를 입력하세요.", "I");
  213. return;
  214. }
  215. ds_c1.setColumn(nRow, "rrgstno1", pFirstValue);
  216. ds_c1.setColumn(nRow, "rrgstno2", pSecondValue);
  217. }
  218. if(sSrchcond == "4"){ //환자명/주민번호일 경우
  219. if(pFirstValue == "" && pSecondValue =="" && pThirdValue ==""){
  220. sysf_messageBox("환자명/주민번호를 입력하세요.", "I");
  221. return;
  222. }
  223. ds_c1.setColumn(nRow, "hngnm", pFirstValue);
  224. ds_c1.setColumn(nRow, "rrgstno1", pSecondValue);
  225. ds_c1.setColumn(nRow, "rrgstno2", pThirdValue);
  226. }
  227. if(sSrchcond == "7"){ //환자명/주소일 경우
  228. if(pFirstValue == "" && pSecondValue ==""){
  229. sysf_messageBox("환자명/주소를 입력하세요.", "I");
  230. return;
  231. }
  232. ds_c1.setColumn(nRow, "hngnm", pFirstValue);
  233. ds_c1.setColumn(nRow, "address", pSecondValue);
  234. }
  235. if(sSrchcond == "9"){ //전화/핸드폰번호일 경우
  236. if(pFirstValue == "" && pSecondValue ==""){
  237. sysf_messageBox("전화/핸드폰을 입력하세요.", "I");
  238. return;
  239. }
  240. ds_c1.setColumn(nRow, "hometel", pFirstValue);
  241. ds_c1.setColumn(nRow, "mpphontel", pSecondValue);
  242. }
  243. ds_c1.setColumn(nRow, "onlyPtspYN", "N");
  244. var sPageDs = dsf_createDsRow("in_ds_page"
  245. , [{col: "max_cnt", type: "int", val: lgv_max_cnt }
  246. , {col: "offset", type: "int", val: 0}
  247. , {col: "tot_cnt", type: "string", val: "true"}]);
  248. tranf_submit({
  249. id: "tr_reqGetPatInfo"
  250. , service: "commoduleapp.BizModule"
  251. , method: "reqGetPatInfo"
  252. , inds: "req=ds_c1 page=" + sPageDs
  253. , outds: "ds_patInfo=patinfolist ds_ptsp=ptsp ds_countInfo=countinfo"
  254. , async: true
  255. , callback: "cbf_tr_reqGetPatInfo"
  256. });
  257. }
  258. function cbf_tr_reqGetPatInfo(strSvcID, nErrorCode, strErrorMag)
  259. {
  260. if(nErrorCode != 0){
  261. sysf_messageBox("환자정보를 조회하는데 실패하였습니다.", "E");
  262. }else{
  263. if(ds_patInfo.rowcount < 1){
  264. sysf_messageBox("해당 환자가 존재하지 않습니다.", "I");
  265. return;
  266. }
  267. var sResult="";
  268. if(ds_patInfo.rowcount > 1){
  269. ds_patInfo.clear();
  270. ds_ptsp.clear();
  271. var sFirstValue = utlf_isNull(lgv_firstCtrl) ? "" : utlf_isNull(lgv_firstCtrl.value) ? "" : lgv_firstCtrl.value;
  272. var sSecondValue = utlf_isNull(lgv_secondCtrl) ? "" : utlf_isNull(lgv_secondCtrl.value) ? "" : lgv_secondCtrl.value;
  273. var sThirdValue = utlf_isNull(lgv_thirdCtrl) ? "" : utlf_isNull(lgv_thirdCtrl.value) ? "" : lgv_thirdCtrl.value;
  274. sResult = lf_popupPatientInfo(lgv_srchCond, sFirstValue, sSecondValue, sThirdValue);
  275. }
  276. edt_pid.value = ds_patInfo.getColumn(0, "pid"); //등록번호
  277. edt_patnm.value = ds_patInfo.getColumn(0, "hngnm"); //성명 채우기
  278. edt_rgstno1.value = ds_patInfo.getColumn(0, "rrgstno1"); //주민번호1
  279. edt_rgstno2.value = ds_patInfo.getColumn(0, "rrgstno2"); //주민번호2
  280. edt_address.value = ds_patInfo.getColumn(0, "addr"); //주소
  281. edt_hometel.value = ds_patInfo.getColumn(0, "hometel"); //전화번호
  282. edt_mphone.value = ds_patInfo.getColumn(0, "mpphontel"); //핸드폰
  283. // 이중합번 체크 (2015-01-19, 이상준)
  284. var sBindPid = ds_patInfo.getColumn(0, "bindpid"); //합번
  285. if( sBindPid != '-' && sBindPid != '' && sBindPid != ' ' && utlf_isNull(sBindPid)==false )
  286. {
  287. var sPid = ds_patInfo.getColumn(0, "pid"); //등록번호
  288. var sHngnm = ds_patInfo.getColumn(0, "hngnm"); //성명 채우기
  289. var retValue = sysf_messageBox(sPid + "(" + sHngnm + ") 환자의 등록번호가 [ " + sBindPid + " ] 로 합번 되었습니다. 합번된 등록번호로 재조회 하시겠습니까?", "Q999", "");
  290. if( retValue == '6' )
  291. {
  292. edt_pid.value = ds_patInfo.getColumn(0, "bindpid"); //합번
  293. lf_getPatientInfo(1, edt_pid.value, edt_patnm.value); //pid로 환자정보 검색하기
  294. }
  295. }
  296. lf_callBack_SearchPatInfo(this.name, sResult);
  297. }
  298. }
  299. //edit control keyup 이벤트
  300. function lf_search(obj:Edit, e:KeyEventInfo)
  301. {
  302. if(e.keycode != 13) return;
  303. var sFirstValue = utlf_isNull(lgv_firstCtrl) ? "" : utlf_isNull(lgv_firstCtrl.value) ? "" : lgv_firstCtrl.value;
  304. var sSecondValue = utlf_isNull(lgv_secondCtrl) ? "" : utlf_isNull(lgv_secondCtrl.value) ? "" : lgv_secondCtrl.value;
  305. var sThirdValue = utlf_isNull(lgv_thirdCtrl) ? "" : utlf_isNull(lgv_thirdCtrl.value) ? "" : lgv_thirdCtrl.value;
  306. lf_getPatientInfo(lgv_srchCond, sFirstValue, sSecondValue, sThirdValue); //pid로 환자정보 검색하기
  307. }
  308. function SearchPatInfo_onload(obj:Form, e:LoadEventInfo)
  309. {
  310. lf_setCtrl("1");
  311. }
  312. ]]></Script>
  313. </Form>
  314. </FDL>