PAM.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. /**
  2. * @(#) PAM.js
  3. *????
  4. * - 2007. 4. 19 / ???? / ???
  5. */
  6. //var pamResultRef = "/root/hidden/tmp";
  7. function makePamResultRef(){ model.makeNode(pamResultRef); }
  8. function removePamResultRef(){ model.removeNode(pamResultRef); }
  9. function pamGetDeptCDDrIDList(result_ref){
  10. //makePamResultRef();
  11. submit("TRPAM00101"); //getParameterPath(), zbcResultRef););
  12. if( result_ref == "" || result_ref == null ){
  13. model.makeNode("root/hidden/tmp/orddeptcd");
  14. model.makeNode("root/hidden/tmp/orddrid");
  15. model.removeNodeset("root/init/orddeptcd");
  16. model.removeNodeset("root/init/orddrid");
  17. model.makeNode("root/init/orddeptcd");
  18. model.makeNode("root/init/orddrid");
  19. model.copyNode("root/init/orddeptcd", "root/hidden/tmp/orddeptcd");
  20. model.copyNode("root/init/orddrid", "root/hidden/tmp/orddrid");
  21. model.removeNodeset("root/hidden/tmp/orddeptcd");
  22. model.removeNodeset("root/hidden/tmp/orddrid");
  23. }else{
  24. model.makeNode("root/hidden/tmp/orddeptcd");
  25. model.makeNode("root/hidden/tmp/orddrid");
  26. model.copyNode(result_ref, "root/hidden/tmp");
  27. model.removeNodeset("root/hidden/tmp/orddeptcd");
  28. model.removeNodeset("root/hidden/tmp/orddrid");
  29. }
  30. //model.refresh();
  31. }
  32. //??? ??? ???? ??? ????.
  33. //??? TRUE && ??? FALSE
  34. function pamCompareNodes(originalNode, copyNode){
  35. var ins = document.models( 0 ).instances( 0 );
  36. // 1. ?????? ???? ??
  37. var original = ins.selectSingleNode(originalNode).xml;
  38. var copy = ins.selectSingleNode(copyNode).xml;
  39. //??? ???? ??? ????? ??? ?? ?? FALSE? ????.
  40. if(original == null || copy == null){
  41. return false;
  42. }else if (original == copy){
  43. return true;
  44. }else{
  45. return false;
  46. }
  47. }
  48. /**
  49. * @desc : 주민번호 앞자리 체크
  50. * <pre>
  51. * 1. 주민번호 앞자리 길이 체크
  52. * 2. 숫자형태 체크
  53. * </pre>
  54. * @param : vRrgstno1 - 주민번호 앞자리, ctrlNm - 주민번호 앞자리 컨트롤이름
  55. * @return : true/false
  56. * @---------------------------------------------------
  57. */
  58. function fRrgstNo1Veri(vRrgstno1, ctrlNm){
  59. if (vRrgstno1 != null && vRrgstno1 != "" && vRrgstno1 != " " && vRrgstno1 != "-")
  60. {
  61. if (vRrgstno1.length != 6)
  62. {
  63. messageBox("주민번호1은 6자리여야 합니다!","E999","");
  64. model.setFocus(ctrlNm);
  65. model.refresh();
  66. return false;
  67. }
  68. if (vRrgstno1.isNumber() != true)
  69. {
  70. messageBox("주민번호1은 숫자형태로 입력되어야 합니다!","E999","");
  71. model.setFocus(ctrlNm);
  72. model.refresh();
  73. return false;
  74. }
  75. }
  76. else
  77. {
  78. messageBox("주민번호1은 6자리여야 합니다!","E999","");
  79. model.setFocus(ctrlNm);
  80. model.refresh();
  81. return false;
  82. }
  83. }
  84. /**
  85. * @desc : 주민번호 뒷자리 체크
  86. * <pre>
  87. * 1. 주민번호 앞자리 길이
  88. * 2. 주민번호 뒷자리 길이
  89. * 3. 주민번호 앞자리 날짜형식 체크
  90. * 4. 생년월일 구하기
  91. * 5. 성별 구하기
  92. * 6. 나이 구하기
  93. * </pre>
  94. * @param : vRrgstno1 - 주민번호 앞자리, vRrgstno2 - 주민번호 뒷자리, ctrlNm1- 주민번호 앞자리 컨트롤이름, ctrlNm2- 주민번호 뒷자리 컨트롤이름
  95. * @return : true/false , 생년월일(8자리), 성별, 나이
  96. * @---------------------------------------------------
  97. */
  98. function fRrgstNo2Veri(vRrgstno1, vRrgstno2, ctrlNm1, ctrlNm2, rBrthdd, rSex, rAge){
  99. if (vRrgstno1.length != 6)
  100. {
  101. messageBox("환자주민번호1은 6자리입니다!","E999","");
  102. model.setFocus(ctrlNm1);
  103. return false;
  104. }
  105. if (vRrgstno2.length != 7)
  106. {
  107. messageBox("환자주민번호2은 7자리입니다!","E999","");
  108. model.setFocus(ctrlNm2);
  109. return false;
  110. }
  111. var gubn = vRrgstno2.substr(0,1);
  112. switch(gubn){
  113. case '1' :
  114. case '2' :
  115. case '5' :
  116. case '6' :
  117. vBrthdd = '19'.concat(vRrgstno1);
  118. break;
  119. case '3' :
  120. case '4' :
  121. case '7' :
  122. case '8' :
  123. vBrthdd = '20'.concat(vRrgstno1);
  124. break;
  125. case '9' :
  126. case '0' :
  127. vBrthdd = '18'.concat(vRrgstno1);
  128. break;
  129. default :
  130. vBrthdd = '19'.concat(vRrgstno1);
  131. break;
  132. }
  133. if (isValidDateTime(vBrthdd, "YYYYMMDD") == false)
  134. {
  135. messageBox("주민번호 앞6자리 형식오류입니다. 올바른 일자형태로 입력하십시요!","E999","");
  136. model.refresh();
  137. model.setFocus(ctrlNm1);
  138. return false;
  139. }
  140. //성별
  141. rSex = getGender(vRrgstno2);
  142. //나이
  143. rAge = getFullAge(vBrthdd);
  144. rBrthdd = vBrthdd;
  145. var ptbs_rrgstno = vRrgstno1.concat(vRrgstno2);
  146. if (isResidentNo(ptbs_rrgstno) == false)
  147. {
  148. messageBox("유효하지 않은 주민번호입니다!","E999","");
  149. return false;
  150. }
  151. }