SMMRC00101.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /**
  2. * @desc : 환자번호 합번여부 체크
  3. * @id :
  4. * @param : pPid - 환자번호
  5. * pRef - 'TRMRC00510'의 파라미터 노드
  6. * pResultref - 'TRMRC00510'의 결과 노드
  7. * @return : String sResult
  8. * @authur : 김영기
  9. *
  10. */
  11. function fCheckedBindPid(pPid, pRef, pResultref){
  12. var sResult;
  13. if(pResultref == null || pResultref == "" || pResultref == "undefined"){
  14. return pPid;
  15. }
  16. if(!(pPid == null || pPid == "" || pPid == "undefined")){
  17. /*TRMRC00509에 사용할 환자번호 설정*/
  18. model.makeValue(pRef + "/pid", pPid);
  19. model.makeNode(pResultref);
  20. var nResultrefLength = pResultref.length;
  21. if(pResultref.substring(eval(nResultrefLength - 1),nResultrefLength) != "/"){
  22. pResultref = pResultref + "/";
  23. }
  24. if(submit("TRMRC00510", true, pRef, pResultref)){
  25. var sBindPid = model.getValue( pResultref + "item/bindpid" );
  26. if(sBindPid != '-' && sBindPid != '' && sBindPid != ' '){
  27. var sHngnm = model.getValue( pResultref + "item/hngnm" );
  28. var messageValue = messageBox(pPid + "(" + sHngnm + ") 환자의 등록번호가 [ " + sBindPid + " ] 로 합번 되었습니다. 합번된 등록번호를 사용 하시겠습니까?", "Q999", "");
  29. if( messageValue == '6' ){
  30. sResult = sBindPid;
  31. }else{
  32. sResult = pPid;
  33. }
  34. }else{
  35. sResult = pPid;
  36. }
  37. }else{
  38. sResult = pPid;
  39. }
  40. }else{
  41. sResult = pPid;
  42. }
  43. var subResultref;
  44. if(pResultref.substring(eval(nResultrefLength - 1),nResultrefLength) != "/"){
  45. subResultref = pResultref.substring(0,nResultrefLength);
  46. }else{
  47. subResultref = pResultref.substring(0,eval(nResultrefLength - 1));
  48. }
  49. model.removeNode(subResultref);
  50. return sResult;
  51. }