SMMQR00400.js 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. /**
  2. * @---------------------------------------------------
  3. * @desc : 낙상 조회시 기본정보 setting
  4. * @param :
  5. * @return :
  6. * @---------------------------------------------------
  7. */
  8. function fInitialize_00400(){
  9. zbcfGetCodeList(new Array("M0443", "M0435"), new Array("/root/init/falldata/fallplce", "/root/init/falldata/bodydam"), true);
  10. model.setValue("/root/main/cond/detlcnts" , parent.model.getValue("/root/tmp/reptinfo/recinfo/detlcnts" ));
  11. model.setValue("/root/main/cond/detlcnts_how" , parent.model.getValue("/root/tmp/reptinfo/recinfo/detlcnts_how" ));
  12. model.setValue("/root/main/cond/detlcnts_why" , parent.model.getValue("/root/tmp/reptinfo/recinfo/detlcnts_why" ));
  13. model.setValue("/root/main/cond/doctorcalldt" , parent.model.getValue("/root/tmp/reptinfo/recinfo/doctorcalldt" ));
  14. model.setValue("/root/main/cond/doctorcallyn" , parent.model.getValue("/root/tmp/reptinfo/recinfo/doctorcallyn" ));
  15. model.setValue("/root/main/cond/mediationdt" , parent.model.getValue("/root/tmp/reptinfo/recinfo/mediationdt" ));
  16. model.setValue("/root/main/cond/mediationyn" , parent.model.getValue("/root/tmp/reptinfo/recinfo/mediationyn" ));
  17. if( getUserInfo("dutplceinstcd") == "031" ){
  18. // 임상에서 담당의/당직의 호출시간 및 중재시간이 있을경우 시간입력 Input 컴포넌트 활성화
  19. checkedVisibleInput(ipt_doctorcall, "/root/main/cond/doctorcalldt", model.getValue("/root/main/cond/doctorcallyn"));
  20. checkedVisibleInput(ipt_mediation, "/root/main/cond/mediationdt", model.getValue("/root/main/cond/mediationyn"));
  21. }
  22. if(parent.model.getValue("/root/main/condition/acptno") != ""){
  23. model.setValue("/root/main/cond/fallplcecd" , parent.model.getValue("/root/tmp/reptinfo/fallinfo/fallplcecd" ) );
  24. if(model.getValue("/root/main/cond/fallplcecd") == "06" || model.getValue("/root/main/cond/fallplcecd") == "05"){
  25. ipt_fallplcecnts.disabled = false;
  26. }
  27. else{
  28. ipt_fallplcecnts.disabled = true;
  29. }
  30. model.setValue("/root/main/cond/fallplcecnts" , parent.model.getValue("/root/tmp/reptinfo/fallinfo/fallplcecnts" ) );
  31. model.setValue("/root/main/cond/falldngrasesyn" , parent.model.getValue("/root/tmp/reptinfo/fallinfo/falldngrasesyn" ) );
  32. cmb_falldngrasesyn.dispatch("xforms-value-changed");
  33. var fallbfpnt = parent.model.getValue("/root/tmp/reptinfo/fallinfo/fallbfpnt");
  34. if(fallbfpnt != ""){
  35. if( fallbfpnt <= 100 ){
  36. ipt_fallbfpnt.visible = true;
  37. cmb_fallbfpnt.visible = false;
  38. }else{
  39. ipt_fallbfpnt.visible = false;
  40. cmb_fallbfpnt.visible = true;
  41. }
  42. model.setValue("/root/main/cond/fallbfpnt", fallbfpnt);
  43. }
  44. var fallaftpnt = parent.model.getValue("/root/tmp/reptinfo/fallinfo/fallaftpnt");
  45. if(fallaftpnt != ""){
  46. if( fallaftpnt <= 100 ){
  47. ipt_fallaftpnt.visible = true;
  48. cmb_fallaftpnt.visible = false;
  49. }else{
  50. ipt_fallaftpnt.visible = false;
  51. cmb_fallaftpnt.visible = true;
  52. }
  53. model.setValue("/root/main/cond/fallaftpnt", fallaftpnt);
  54. }
  55. model.setValue("/root/main/cond/pvneducyn" , parent.model.getValue("/root/tmp/reptinfo/fallinfo/pvneducyn" ) );
  56. model.setValue("/root/main/cond/cscsstatyn" , parent.model.getValue("/root/tmp/reptinfo/fallinfo/cscsstatyn" ) );
  57. model.setValue("/root/main/cond/actfuntyn" , parent.model.getValue("/root/tmp/reptinfo/fallinfo/actfuntyn" ) );
  58. var bodydamcd = parent.model.getValue("/root/tmp/reptinfo/fallinfo/bodydamcd");
  59. model.setValue("/root/main/cond/bodydamcd" , bodydamcd );
  60. if(bodydamcd != "01"){
  61. model.setValue("/root/main/cond/bodypart" , parent.model.getValue("/root/tmp/reptinfo/fallinfo/bodypart" ) );
  62. }
  63. var envcasyn = parent.model.getValue("/root/tmp/reptinfo/fallinfo/envcasyn");
  64. model.setValue("/root/main/cond/envcasyn" , envcasyn ) ;
  65. if(envcasyn.search("08") > -1){
  66. model.setValue("/root/main/cond/envcasetccntsyn" , parent.model.getValue("/root/tmp/reptinfo/fallinfo/envcasetccntsyn" ) );
  67. tar_envcasetccntsyn.visible = true;
  68. }
  69. var bodystatyn = parent.model.getValue("/root/tmp/reptinfo/fallinfo/bodystatyn");
  70. model.setValue("/root/main/cond/bodystatyn" , bodystatyn );
  71. if(bodystatyn.search("13") > -1){
  72. copyNodesetType("/root/main/cond/druglist","/root/tmp/reptinfo/falldrug","replace",model,parent);
  73. grd_druglist.visible = true;
  74. button4.visible = true;
  75. button5.visible = true;
  76. }else if(bodystatyn.search("15") > -1){
  77. model.setValue("/root/main/cond/bodystatetccnts" , parent.model.getValue("/root/tmp/reptinfo/fallinfo/bodystatetccnts" ) );
  78. tar_bodystatetccnts.visible = true;
  79. }
  80. var arbitrationcntsyn = parent.model.getValue("/root/tmp/reptinfo/fallinfo/arbitrationcntsyn");
  81. model.setValue("/root/main/cond/arbitrationcntsyn" , arbitrationcntsyn );
  82. if(arbitrationcntsyn.search("07") > -1){
  83. model.setValue("/root/main/cond/arbitrationetccnts" , parent.model.getValue("/root/tmp/reptinfo/fallinfo/arbitrationetccnts" ) );
  84. tar_arbitrationetccnts.visible = true;
  85. }
  86. }
  87. model.refresh();
  88. }
  89. /**
  90. * @---------------------------------------------------
  91. * @desc : 필수입력 콘트롤에 값이 입력되어있는지 체크
  92. * @param :
  93. * @return : true or false
  94. * @---------------------------------------------------
  95. */
  96. function fDetlCheck(){
  97. if(!fAnyOneCheck("chk_cscsstatyn", "chk_actfuntyn", "chk_bodystatyn", "chk_envcasyn")){
  98. return false;
  99. }
  100. if(!isRequiredControls("cmb_fallplcecd", "cmb_falldngrasesyn", "cmb_pvneducyn", "chk_arbitrationcntsyn" ,"cmb_bodydamcd" )){
  101. return false;
  102. }
  103. if(model.getValue("/root/main/cond/falldngrasesyn") == "Y"){
  104. if(!isRequiredControls("ipt_fallbfpnt", "ipt_fallaftpnt") || !isRequiredControls("cmb_fallbfpnt", "cmb_fallaftpnt")){
  105. return false;
  106. }
  107. }
  108. var bodystatyn = model.getValue("/root/main/cond/bodystatyn");
  109. if(bodystatyn.search("13") > -1){
  110. if(!isRequiredControls("ipt_medidrugcd")){
  111. return false;
  112. }
  113. }
  114. return true;
  115. }
  116. /**
  117. * @-----------------------------------------------------------------------------
  118. * @desc : SMMQR00100_낙상의 투약약품그리드를 재조회 할때 실행되는 function
  119. * @param :
  120. * @return :
  121. * @-----------------------------------------------------------------------------
  122. */
  123. function dreload(){
  124. var acptno = parent.model.getValue("/root/main/condition/acptno");
  125. model.setValue("root/send/acptno",acptno)
  126. model.removeNode("root/tmp");
  127. model.removeNode("root/main/cond/druglist");
  128. model.makeNode("root/main/cond/druglist");
  129. submit("TRMQR00103");
  130. var lrg = parent.model.getValue("/root/main/condition/lrg");
  131. var mdl = parent.model.getValue("/root/main/condition/mdl");
  132. var bodystatyn = model.getValue("/root/main/cond/bodystatyn");
  133. if(bodystatyn.search("13") > -1){
  134. model.resetInstanceNode("/root/main/cond/drugdump");
  135. copyNodesetType("/root/main/cond/druglist","/root/tmp/reptinfo/druglist","replace",model,model);
  136. model.refresh();
  137. grd_druglist.refresh();
  138. }
  139. }
  140. /**
  141. * @-----------------------------------------------------------------------------
  142. * @desc : SMMQR00100_낙상의 투약 체크박스 미체크시 투약약품그리드삭제 function
  143. * @param :
  144. * @return :
  145. * @-----------------------------------------------------------------------------
  146. */
  147. function chkbodystat(){
  148. var bodystatyn = model.getValue("/root/main/cond/bodystatyn");
  149. if(bodystatyn.search("13") <= -1){
  150. for(var i = 1 ; i<grd_druglist.rows ; i++){
  151. grd_druglist.rowStatus(i) = 4;
  152. }
  153. var str =getGridUpdateData(grd_druglist);
  154. model.setValue("/root/main/cond/drugdump",str);
  155. SetVisible("grd_druglist", "/root/main/cond/bodystatyn", "13");
  156. SetVisible("button4", "/root/main/cond/bodystatyn", "13");
  157. SetVisible("button5", "/root/main/cond/bodystatyn", "13");
  158. }
  159. }
  160. /**
  161. * @---------------------------------------------------------------------------------
  162. * @desc : SMMQR00100_낙상의 투약 체크박스에 투약 약품이 하나이상 입력되었는지 확인
  163. * @param :
  164. * @return :
  165. * @---------------------------------------------------------------------------------
  166. */
  167. function checkFalldrug(){
  168. //alert(grd_druglist.valuematrix(1,1));
  169. var bodystatyn = model.getValue("/root/main/cond/bodystatyn");
  170. var row = 1 ;
  171. for(var i = 1 ; i<grd_druglist.rows ; i++){
  172. if(grd_druglist.rowStatus(i) != 4){
  173. row =0;
  174. }
  175. }
  176. if ( (bodystatyn.search("13") > -1) && row == 1){
  177. messageBox("하나이상의 약품은", "I003");
  178. //약제 그리드를 지운다.
  179. if(grd_druglist.rows > 1){
  180. for(var i = 1 ; i<grd_druglist.rows ; i++){
  181. grd_druglist.rowStatus(i) = 0;
  182. }
  183. }
  184. return false;
  185. }
  186. else{
  187. return true;
  188. }
  189. }