123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- /**
- * @(#) PAM.js
- *????
- * - 2007. 4. 19 / ???? / ???
- */
- //var pamResultRef = "/root/hidden/tmp";
- function makePamResultRef(){ model.makeNode(pamResultRef); }
- function removePamResultRef(){ model.removeNode(pamResultRef); }
- function pamGetDeptCDDrIDList(result_ref){
- //makePamResultRef();
- submit("TRPAM00101"); //getParameterPath(), zbcResultRef););
-
- if( result_ref == "" || result_ref == null ){
-
- model.makeNode("root/hidden/tmp/orddeptcd");
- model.makeNode("root/hidden/tmp/orddrid");
-
- model.removeNodeset("root/init/orddeptcd");
- model.removeNodeset("root/init/orddrid");
-
- model.makeNode("root/init/orddeptcd");
- model.makeNode("root/init/orddrid");
-
- model.copyNode("root/init/orddeptcd", "root/hidden/tmp/orddeptcd");
- model.copyNode("root/init/orddrid", "root/hidden/tmp/orddrid");
-
- model.removeNodeset("root/hidden/tmp/orddeptcd");
- model.removeNodeset("root/hidden/tmp/orddrid");
- }else{
- model.makeNode("root/hidden/tmp/orddeptcd");
- model.makeNode("root/hidden/tmp/orddrid");
-
- model.copyNode(result_ref, "root/hidden/tmp");
-
- model.removeNodeset("root/hidden/tmp/orddeptcd");
- model.removeNodeset("root/hidden/tmp/orddrid");
- }
-
- //model.refresh();
- }
- //??? ??? ???? ??? ????.
- //??? TRUE && ??? FALSE
- function pamCompareNodes(originalNode, copyNode){
-
- var ins = document.models( 0 ).instances( 0 );
-
- // 1. ?????? ???? ??
- var original = ins.selectSingleNode(originalNode).xml;
- var copy = ins.selectSingleNode(copyNode).xml;
-
- //??? ???? ??? ????? ??? ?? ?? FALSE? ????.
- if(original == null || copy == null){
-
- return false;
- }else if (original == copy){
-
- return true;
- }else{
-
- return false;
- }
- }
- /**
- * @desc : 주민번호 앞자리 체크
- * <pre>
- * 1. 주민번호 앞자리 길이 체크
- * 2. 숫자형태 체크
- * </pre>
- * @param : vRrgstno1 - 주민번호 앞자리, ctrlNm - 주민번호 앞자리 컨트롤이름
- * @return : true/false
- * @---------------------------------------------------
- */
- function fRrgstNo1Veri(vRrgstno1, ctrlNm){
-
- if (vRrgstno1 != null && vRrgstno1 != "" && vRrgstno1 != " " && vRrgstno1 != "-")
- {
- if (vRrgstno1.length != 6)
- {
- messageBox("주민번호1은 6자리여야 합니다!","E999","");
- model.setFocus(ctrlNm);
- model.refresh();
- return false;
- }
-
- if (vRrgstno1.isNumber() != true)
- {
- messageBox("주민번호1은 숫자형태로 입력되어야 합니다!","E999","");
- model.setFocus(ctrlNm);
- model.refresh();
- return false;
- }
- }
- else
- {
- messageBox("주민번호1은 6자리여야 합니다!","E999","");
- model.setFocus(ctrlNm);
- model.refresh();
- return false;
- }
- }
- /**
- * @desc : 주민번호 뒷자리 체크
- * <pre>
- * 1. 주민번호 앞자리 길이
- * 2. 주민번호 뒷자리 길이
- * 3. 주민번호 앞자리 날짜형식 체크
- * 4. 생년월일 구하기
- * 5. 성별 구하기
- * 6. 나이 구하기
- * </pre>
- * @param : vRrgstno1 - 주민번호 앞자리, vRrgstno2 - 주민번호 뒷자리, ctrlNm1- 주민번호 앞자리 컨트롤이름, ctrlNm2- 주민번호 뒷자리 컨트롤이름
- * @return : true/false , 생년월일(8자리), 성별, 나이
- * @---------------------------------------------------
- */
- function fRrgstNo2Veri(vRrgstno1, vRrgstno2, ctrlNm1, ctrlNm2, rBrthdd, rSex, rAge){
-
- if (vRrgstno1.length != 6)
- {
- messageBox("환자주민번호1은 6자리입니다!","E999","");
- model.setFocus(ctrlNm1);
- return false;
- }
-
- if (vRrgstno2.length != 7)
- {
- messageBox("환자주민번호2은 7자리입니다!","E999","");
- model.setFocus(ctrlNm2);
- return false;
- }
-
- var gubn = vRrgstno2.substr(0,1);
- switch(gubn){
- case '1' :
- case '2' :
- case '5' :
- case '6' :
- vBrthdd = '19'.concat(vRrgstno1);
- break;
- case '3' :
- case '4' :
- case '7' :
- case '8' :
- vBrthdd = '20'.concat(vRrgstno1);
- break;
- case '9' :
- case '0' :
- vBrthdd = '18'.concat(vRrgstno1);
- break;
- default :
- vBrthdd = '19'.concat(vRrgstno1);
- break;
- }
-
- if (isValidDateTime(vBrthdd, "YYYYMMDD") == false)
- {
- messageBox("주민번호 앞6자리 형식오류입니다. 올바른 일자형태로 입력하십시요!","E999","");
- model.refresh();
- model.setFocus(ctrlNm1);
- return false;
- }
-
- //성별
- rSex = getGender(vRrgstno2);
-
- //나이
- rAge = getFullAge(vBrthdd);
-
- rBrthdd = vBrthdd;
-
- var ptbs_rrgstno = vRrgstno1.concat(vRrgstno2);
- if (isResidentNo(ptbs_rrgstno) == false)
- {
- messageBox("유효하지 않은 주민번호입니다!","E999","");
- return false;
- }
- }
|