SMMNO00900.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. /*
  2. 외래Acting 관리(SMMNO00900.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var sACTPRCPLIST_PATH = "/root/main/prcpendlist/prcpendlist";
  7. var g_initGrdData; // 리스트 관련 초기 Instance값
  8. /**
  9. * @group :
  10. * @ver : 2007.10.14
  11. * @by : 하재륜
  12. * @---------------------------------------------------
  13. * @type : function
  14. * @access : public
  15. * @desc : 화면 초기화
  16. * @param :
  17. * @return :
  18. * @---------------------------------------------------
  19. */
  20. function fInitialize(){
  21. model.setValue("/root/main/cond/prcpdd", getCurrentDate());
  22. zbcfGetDeptCodeList("012", "orduseyn", "D", "/root/init/orddept", "depthngnm", "asc"); //부서코드 콤보조회
  23. model.setValue("/root/main/cond/orddeptcd", getUserInfo("dutplcecd")); // 근무지부서코드
  24. model.refresh();
  25. //if(cmb_orddept.label != "") fOrddridSearch();
  26. }
  27. /**
  28. * @group :
  29. * @ver : 2007.10.14
  30. * @by : 하재륜
  31. * @---------------------------------------------------
  32. * @type : function
  33. * @access : public
  34. * @desc : 진료과의 해당하는 진료의 조회
  35. * @param :
  36. * @return :
  37. * @---------------------------------------------------
  38. */
  39. function fOrddridSearch() {
  40. //cmb_orddr.disabled = false;
  41. model.makeNode("/root/send");
  42. model.makeValue("/root/send/enddd", model.getValue("/root/main/cond/enddd"));
  43. model.makeValue("/root/send/orddeptcd", model.getValue("/root/main/cond/orddeptcd"));
  44. var sordclsdeptflag = model.getValue("/root/init/orddept/dept[deptcd = '"+model.getValue("/root/main/cond/orddeptcd")+"']/ordclsdeptflag"); // 센터/대표/분과/서브 구분
  45. var sorddeptkind = model.getValue("/root/init/orddept/dept[deptcd = '"+model.getValue("/root/main/cond/orddeptcd")+"']/orddeptkind"); // 센터/대표 구분
  46. var ssupdeptcd = model.getValue("/root/init/orddept/dept[deptcd = '"+model.getValue("/root/main/cond/orddeptcd")+"']/supdeptcd"); // 상위부서코드
  47. var sorddeptflag = "";
  48. if (sorddeptkind == "C") { // 센터이면
  49. sorddeptflag = "C";
  50. //} else if (sorddeptkind != "C" && sordclsdeptflag == "A") { // 센터가 아니면서 분과이면
  51. // sorddeptflag = "A";
  52. } else { // 그외에 기타과
  53. sorddeptflag = "etc";
  54. }
  55. model.setValue("/root/main/cond/ordclsdeptflag",sorddeptflag);
  56. model.setValue("/root/main/cond/supdeptcd",ssupdeptcd);
  57. model.makeValue("/root/send/ordclsdeptflag", model.getValue("/root/main/cond/ordclsdeptflag"));
  58. model.makeValue("/root/send/supdeptcd", model.getValue("/root/main/cond/supdeptcd"));
  59. submit("TRMNO00902");
  60. //진료의콤보 전체추가-kys-20091116
  61. if(getNodesetCount("/root/init/orddr/orddr") > 0){
  62. if(getUserInfo("dutplceinstcd") == seoulinstcd && model.getValue("/root/main/cond/orddeptcd") == Eyedeptcd){
  63. //서울성모이면서 안센터이면 전체의사 추가 제외-20091116-kys
  64. }else{
  65. addComboInstance("/root/init/orddr", "deptcd^userid^usernm", "0000000000^00000000^전체의사", "orddr");
  66. model.resetInstanceNode("/root/main/cond/orddrid");
  67. }
  68. }
  69. }
  70. /**
  71. * @group :
  72. * @ver : 2007.10.14
  73. * @by : 하재륜
  74. * @---------------------------------------------------
  75. * @type : function
  76. * @access : public
  77. * @desc : 외래 Actng 관리 조회
  78. * @param :
  79. * @return :
  80. * @---------------------------------------------------
  81. */
  82. function fSearch() {
  83. model.removeNodeset("/root/main/prcpendlist/prcpendlist");
  84. grd_prcpendlist.fixedcellischeck(0,0) = false;
  85. model.removeNodeset("/root/send");
  86. model.makeNode("/root/send");
  87. model.makeValue("/root/send/enddd" , model.getValue("/root/main/cond/enddd"));
  88. model.makeValue("/root/send/orddeptcd" , model.getValue("/root/main/cond/orddeptcd"));
  89. model.makeValue("/root/send/orddrid" , model.getValue("/root/main/cond/orddrid"));
  90. model.makeValue("/root/send/execflag" , model.getValue("/root/main/cond/execflag"));
  91. /* 센터개념으로 인해 추가 - 20090305 */
  92. model.makeValue("/root/send/ordclsdeptflag", model.getValue("/root/main/cond/ordclsdeptflag"));
  93. model.makeValue("/root/send/supdeptcd", model.getValue("/root/main/cond/supdeptcd"));
  94. //20090811-kys(서울성모인경우 수납전에도 진료예약일시가 조회되어야 한다)
  95. if(getUserInfo("dutplceinstcd") == seoulinstcd){
  96. model.makeValue("/root/send/seoulyn" , "Y");
  97. }
  98. submit("TRMNO00901");
  99. for(var i = 1 ; i <= grd_prcpendlist.rows ; i++ ){
  100. if(model.getValue("/root/main/prcpendlist/prcpendlist["+i+"]/endacptdt") !=""){
  101. grd_prcpendlist.isReadOnly(i, grd_prcpendlist.colRef("chk")) = true;
  102. } else {
  103. grd_prcpendlist.isReadOnly(i, grd_prcpendlist.colRef("chk")) = false;
  104. }
  105. }
  106. //fSetGridData();// 구분에 따른 마감버튼 제어기능
  107. fSetBackColor() //20090226추가(미수납자에 대한 색표시)
  108. model.refresh();
  109. }
  110. /**
  111. * @group :
  112. * @ver : 2007.10.14
  113. * @by : 하재륜
  114. * @---------------------------------------------------
  115. * @type : function
  116. * @access : public
  117. * @desc : 외래 Actng 관리 저장
  118. * @param :
  119. * @return :
  120. * @---------------------------------------------------
  121. */
  122. function fSave() {
  123. //var grdData = getGridUpdateData(grd_prcpendlist);
  124. //model.removeNodeset("/root/send/data");
  125. //model.makeValue("/root/send/data", grdData);
  126. var Row = grd_prcpendlist.rows;
  127. var prcpdetlPATH = "/root/main/prcpendlist/prcpendlist"
  128. var iRow = grd_prcpendlist.row;
  129. var sSrchData = "";
  130. var chek = 0;
  131. var kRow = 0;
  132. for (i=1; i<Row; i++){
  133. chek = chek + grd_prcpendlist.textmatrix(i,0);
  134. if(grd_prcpendlist.textmatrix(i,0) == "true"){
  135. kRow = kRow +","+ i
  136. }
  137. }
  138. if(chek==0){
  139. messageBox("하나 이상의 처방내역을", "C002")
  140. return;
  141. }
  142. for (i=1; i<Row; i++){
  143. //alert(grd_prcpendlist.textmatrix(i,0));
  144. if(grd_prcpendlist.textmatrix(i,0) == "true"){
  145. //var sSrchData = "";
  146. var sSrchHeader = "m▦rownum▦chk▦pid▦patnm▦sexage▦prcpstat▦prcpkindcd▦prcpclscd▦prcpcd▦prcpnm▦prcpvol▦prcpqty▦prcpdayno▦calcflag▦payflagcd▦prcprgstdt▦execdd▦endacptdt▦endid▦enddd▦prcpdd▦prcpno▦prcphistno▦instcd▩";
  147. var sSrchData = sSrchData
  148. + "u" +"▦"
  149. + i +"▦"
  150. + model.getValue(prcpdetlPATH+ "["+i+"]/chk" )+"▦"
  151. + model.getValue(prcpdetlPATH+ "["+i+"]/pid" )+"▦"
  152. + model.getValue(prcpdetlPATH+ "["+i+"]/patnm" )+"▦"
  153. + model.getValue(prcpdetlPATH+ "["+i+"]/sexage" )+"▦"
  154. + model.getValue(prcpdetlPATH+ "["+i+"]/prcpstat" )+"▦"
  155. + model.getValue(prcpdetlPATH+ "["+i+"]/prcpkindcd" )+"▦"
  156. + model.getValue(prcpdetlPATH+ "["+i+"]/prcpclscd" )+"▦"
  157. + model.getValue(prcpdetlPATH+ "["+i+"]/prcpcd" )+"▦"
  158. + model.getValue(prcpdetlPATH+ "["+i+"]/prcpnm" )+"▦"
  159. + model.getValue(prcpdetlPATH+ "["+i+"]/prcpvol" )+"▦"
  160. + model.getValue(prcpdetlPATH+ "["+i+"]/prcpqty" )+"▦"
  161. + model.getValue(prcpdetlPATH+ "["+i+"]/prcpdayno" )+"▦"
  162. + model.getValue(prcpdetlPATH+ "["+i+"]/calcflag " )+"▦"
  163. + model.getValue(prcpdetlPATH+ "["+i+"]/payflagcd " )+"▦"
  164. + model.getValue(prcpdetlPATH+ "["+i+"]/prcprgstdt" )+"▦"
  165. + model.getValue(prcpdetlPATH+ "["+i+"]/execdd " )+"▦"
  166. + model.getValue(prcpdetlPATH+ "["+i+"]/endacptdt " )+"▦"
  167. + model.getValue(prcpdetlPATH+ "["+i+"]/endid " )+"▦"
  168. + model.getValue(prcpdetlPATH+ "["+i+"]/enddd " )+"▦"
  169. + model.getValue(prcpdetlPATH+ "["+i+"]/prcpdd " )+"▦"
  170. + model.getValue(prcpdetlPATH+ "["+i+"]/prcpno " )+"▦"
  171. + model.getValue(prcpdetlPATH+ "["+i+"]/prcphistno" )+"▦"
  172. + model.getValue(prcpdetlPATH+ "["+i+"]/instcd" )+"▩";
  173. } // if end
  174. } // for end
  175. model.removenode("/root/send/data");
  176. model.makeValue("/root/send/data", sSrchHeader + sSrchData);
  177. model.makeValue("/root/send/enddd", model.getValue("/root/main/cond/enddd"));
  178. model.makeValue("/root/send/enddeptcd", model.getValue("/root/main/cond/orddeptcd"));
  179. submit("TXMNO00901");
  180. fSearch();
  181. }
  182. /**
  183. * @group :
  184. * @ver : 2009.02.26
  185. * @by : 김양수
  186. * @---------------------------------------------------
  187. * @type : function
  188. * @access : public
  189. * @desc : 미수납환자 백그라운드 색표시
  190. * @param :
  191. * @return :
  192. * @---------------------------------------------------
  193. */
  194. function fSetBackColor() {
  195. var calcflag;
  196. for(var i = 1; i < grd_prcpendlist.rows; i++) {
  197. calcflag = model.getValue("/root/main/prcpendlist/prcpendlist[" + i + "]/calcflag");
  198. if(calcflag != "Y" ) { //미수납환자
  199. grd_prcpendlist.cellstyle("background-color", i, 1, i, grd_prcpendlist.cols-1) ="#ffff00";
  200. }else {
  201. grd_prcpendlist.cellstyle("background-color", i, 1, i, grd_prcpendlist.cols-1) ="#FFFFF8";
  202. }
  203. }
  204. grd_prcpendlist.refresh();
  205. }
  206. /**
  207. * @group :
  208. * @ver : 2009.11.16
  209. * @by :
  210. * @---------------------------------------------------
  211. * @type : function
  212. * @access : public
  213. * @desc : Add Combo
  214. * @param :
  215. * @return :
  216. * @---------------------------------------------------
  217. */
  218. function addComboInstance(combopath, nodename, nodeval, parentnode){
  219. nodename = nodename.split("^");
  220. nodeval = nodeval.split("^");
  221. if(nodename.length != nodeval.length){
  222. return;
  223. }
  224. var label = model.instances(0).createElement(nodename[0]);
  225. var val = model.instances(0).createElement(nodename[1]);
  226. var val2 = model.instances(0).createElement(nodename[2]);
  227. var combo = model.instances(0).createElement(parentnode);
  228. label.value = "" + nodeval[0] + "";
  229. val.value = "" + nodeval[1] + "";
  230. val2.value = "" + nodeval[2] + "";
  231. combo.appendChild(label);
  232. combo.appendChild(val);
  233. combo.appendChild(val2);
  234. chkNode = model.instances(0).selectSingleNode(combopath);
  235. if(chkNode == null){
  236. model.makeNode(combopath);
  237. srcNode = model.instances(0).selectSingleNode(combopath);
  238. }else{
  239. srcNode = model.instances(0).selectSingleNode(combopath);
  240. }
  241. desNode = model.instances(0).selectSingleNode(combopath + "/" + parentnode);
  242. srcNode.insertBefore(combo, desNode);
  243. model.refresh();
  244. }