MRF04300.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. var instance = document.models(0).instances(0);
  2. var pageInfo = new PAGEINFO();
  3. /**
  4. * @group :
  5. * @ver : 2007.03.20
  6. * @by : ??????
  7. * @---------------------------------------------------
  8. * @type : function
  9. * @access : public
  10. * @desc : ?????? Enable / Disable
  11. * @param :
  12. * @return :
  13. * @---------------------------------------------------
  14. */
  15. function fInitialize() {
  16. model.removeNodeset("/root/main/recinfo");
  17. grd_diaglist.col = 4;
  18. grd_diaglist.row = grd_diaglist.rows - 1;
  19. model.refresh();
  20. //dispOnLoadComplete("", model.getValue(pageInfo.formmastRef + "/formcd"));
  21. dispOnLoadComplete("", "0000000900");
  22. //parent.body.dispatch("opr_onloadcomplete");
  23. }
  24. /**
  25. * @group :
  26. * @ver : 2007.03.20
  27. * @by : ??????
  28. * @---------------------------------------------------
  29. * @type : function
  30. * @access : public
  31. * @desc : ?????? Enable / Disable
  32. * @param :
  33. * @return :
  34. * @---------------------------------------------------
  35. */
  36. function fGrdDelRow(){
  37. var iRow = grd_diaglist.row;
  38. var smmcnts = model.getValue("/root/main/recinfo/grid[" + iRow + "]/recitem[colno='0']/rectermnm");
  39. var smmcntcd = model.getValue("/root/main/recinfo/grid[" + iRow + "]/recitem[colno='0']/rectermcd");
  40. if(iRow > 0 && (smmcnts != "" || smmcntcd != "")){
  41. model.removeNodeset("/root/main/recinfo/grid[" + iRow + "]");
  42. model.removeNodeset("/root/main/selectdiaglist[" + iRow + "]");
  43. model.removeNodeset("/root/tmpop/selectoplist[" + iRow + "]");
  44. }
  45. else
  46. {
  47. return;
  48. }
  49. var nodelist = model.instance1.selectNodes("/root/main/recinfo/grid");
  50. var totrow = nodelist.length;
  51. var irowcnt = 0;
  52. for(var i = 0; i < totrow; i++)
  53. {
  54. var node = nodelist.item(i);
  55. var tmpnode = node.selectNodes("recitem");
  56. for(var j = 0; j < tmpnode.length; j++)
  57. {
  58. var node = tmpnode.item(j);
  59. var path1 = node.selectSingleNode("rowno");
  60. path1.text = irowcnt;
  61. }
  62. /*
  63. var path1 = node.selectSingleNode("recitem[degnitemlevlcd='0000509.0000509']/rowno"); //수술명header
  64. var path2 = node.selectSingleNode("recitem[degnitemlevlcd='0000509.0000509.0000509']/rowno"); //수술명
  65. var path3 = node.selectSingleNode("recitem[degnitemlevlcd='0000509.0000509.0000168']/rowno"); //Comments
  66. path1.text = irowcnt;
  67. path2.text = irowcnt;
  68. path3.text = irowcnt;
  69. */
  70. irowcnt++;
  71. }
  72. grd_diaglist.rebuild();
  73. }
  74. /**
  75. * @group :
  76. * @ver : 2007.03.20
  77. * @by : ??????
  78. * @---------------------------------------------------
  79. * @type : function
  80. * @access : public
  81. * @desc : ?????? Enable / Disable
  82. * @param :
  83. * @return :
  84. * @---------------------------------------------------
  85. */
  86. function fAfterSrch()
  87. {
  88. var pageInfo = new PAGEINFO();
  89. var instance = document.models(0).instances(0);
  90. var nodelistMain = null;
  91. var nodelistTemp = null;
  92. var iLeng = 0;
  93. var sTmpdiagcd = "";
  94. var sTmpdiagengnm = "";
  95. nodelistMain = instance.selectNodes("/root/main/selectoplist");
  96. nodelistTemp = instance.selectNodes("/root/tmpop/selectoplist");
  97. var iMainleng = nodelistMain.length;
  98. //var iMainleng = instance.selectNodes("/root/main/recinfo/grid").length;
  99. var iRow = grd_diaglist.row;
  100. var path = "/root/main/recinfo/grid";
  101. var nodelistJuh = instance.selectNodes(path);
  102. var nodelength = nodelistJuh.length;
  103. var smmcnts = model.getValue(path + "[" + nodelength + "]/recitem[degnitemcd = '0000509001' and degnitemkind = 'GSU']/rectermnm");
  104. if (smmcnts == "")
  105. {
  106. model.removeNodeset("/root/main/recinfo/grid[" + nodelength + "]");
  107. model.removeNodeset("/root/main/selectdiaglist[" + nodelength + "]");
  108. grd_diaglist.refresh();
  109. }
  110. if(nodelistTemp.length >= 1)
  111. {
  112. for(var i = 1; i <= nodelistTemp.length; i++)
  113. {
  114. sTmpdiagcd = model.getValue("/root/tmpop/selectoplist[" + i + "]/opcd");
  115. sTmpdiagengnm = model.getValue("/root/tmpop/selectoplist[" + i + "]/opengnm");
  116. var iFndRow = getNodesetCnt(model, "/root/main/recinfo/grid/recitem[rectermcd='" + sTmpdiagcd + "']");
  117. if(iFndRow > 0){
  118. iMainleng = iMainleng - 1;
  119. }else if(iFndRow <= 0){
  120. iLeng = i + iMainleng;
  121. model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 1 + "]/rectermcd", sTmpdiagcd);
  122. model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 1 + "]/reccnts", sTmpdiagengnm);
  123. model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 1 + "]/cntsyn", "N");
  124. model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 1 + "]/comp", "true");
  125. model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 1 + "]/colno", "0");
  126. model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 1 + "]/rectermflag", "003");
  127. }
  128. }
  129. }
  130. makeProgInstance(pageInfo, instance, nodelistMain);
  131. fAddrow();
  132. }
  133. /**
  134. * @desc : 줄추가
  135. * @
  136. * @param :
  137. * @return :
  138. * @---------------------------------------------------
  139. */
  140. function fAddrow()
  141. {
  142. var path1 = "/root/main/recinfo/grid[degnitemno = '1']";
  143. var nodelistDGN = instance.selectNodes(path1);
  144. var nodelength = nodelistDGN.length;
  145. var path2 = "/root/main/recinfo/grid[degnitemno = '1'][" + nodelength + "]";
  146. copyNodeset("/root/tmp", path2, "replace", model, model);
  147. var smmcnts = model.getValue("/root/tmp/recitem[colno='0']/rectermnm");
  148. if(smmcnts != "" || nodelength == 0)
  149. {
  150. model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 1 + "]/rectermcd", "");
  151. model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 1 + "]/reccnts", "-");
  152. model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 1 + "]/cntsyn", "N");
  153. model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 1 + "]/comp", "true");
  154. model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 1 + "]/colno", "0");
  155. model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 1 + "]/rectermflag", "003");
  156. nodelistMain = instance.selectNodes("/root/main/selectdiaglist");
  157. makeProgInstance(pageInfo, instance, nodelistMain);
  158. // grd_diaglist.row = nodelength + 1;
  159. // grd_diaglist.col = 2;
  160. // grd_diaglist.editCell();
  161. grd_diaglist.refresh();
  162. }
  163. }
  164. /**
  165. * @desc : 편집 후 termcd가 없는 경우 '-'를 넣어줌(저장문제)
  166. * @
  167. * @param :
  168. * @return :
  169. * @---------------------------------------------------
  170. */
  171. function fEndEdit()
  172. {
  173. //debugger;
  174. var path1 = "/root/main/recinfo/grid[degnitemno = '1']";
  175. var nodelistJuh = instance.selectNodes(path1);
  176. var nodelength = nodelistJuh.length;
  177. var smmcnts = model.getValue("/root/main/recinfo/grid[degnitemno = '1'][" + nodelength + "]/recitem[colno='0']/rectermnm");
  178. var termcd = model.getValue("/root/main/recinfo/grid[degnitemno = '1'][" + nodelength + "]/recitem[colno='0']/rectermcd");
  179. if(smmcnts != "" && termcd == "")
  180. {
  181. model.setValue("/root/main/recinfo/grid[degnitemno = '1'][" + nodelength + "]/recitem[colno='0']/rectermcd", "-");
  182. }
  183. var sOprnm = model.getValue("/root/main/recinfo/grid[degnitemno = '1'][" + grd_diaglist.row + "]/recitem[colno='0']/rectermnm");
  184. if (sOprnm == "")
  185. {
  186. fGrdDelRow();
  187. }
  188. }
  189. function old_fSrchOprlist()
  190. {
  191. model.removeNodeset("/root/tmpop/selectoplist");
  192. model.removeNodeset("/root/main/paminfo/list");
  193. var node = getGlobalVariable("paminfo");
  194. if(node != "" && node != null){
  195. setCSVToNode("/root/main/paminfo", node);
  196. model.makeValue("/root/send/pid", model.getValue("/root/main/paminfo/list/pid"));
  197. model.makeValue("/root/send/cretno", model.getValue("/root/main/paminfo/list/cretno"));
  198. if (model.getValue("/root/main/paminfo/list/ioflag") == "O")
  199. {
  200. model.makeValue("/root/send/orddd", model.getValue("/root/main/paminfo/list/orddd"));
  201. }
  202. else
  203. {
  204. model.makeValue("/root/send/orddd", model.getValue("/root/main/paminfo/list/indd"));
  205. }
  206. model.makeValue("/root/send/srchmode", "opr");
  207. model.removeNodeset("/root/main/recinfo/recitem[degnitemno = '1']");
  208. if ( submit("TRMRF04301") )
  209. {
  210. fAfterSrch();
  211. }
  212. }
  213. }
  214. function fSrchOprlist(paminfo)
  215. {
  216. var pageInfo = new PAGEINFO();
  217. var degnlvcd = model.getValue(pageInfo.initRecinfoGridrecItemRef + "[orgdegnitemkind='OPN']/degnitemlevlcd").substring(0, 7);
  218. fSetOpNmbyDegnItemLevlCd(paminfo, degnlvcd);
  219. fAddrow();
  220. }
  221. //삭제예정(해당기록지에서 직접 조회하여 데이터 넘김) 2008.05.20 박종훈
  222. function fSrchOprPerfDrlist(oprsrvno, cOdt1)
  223. {
  224. model.removeNodeset("/root/tmpop/selectoplist");
  225. model.removeNodeset("/root/main/paminfo/list");
  226. var node = getGlobalVariable("paminfo");
  227. if(node != "" && node != null){
  228. setCSVToNode("/root/main/paminfo", node);
  229. model.makeValue("/root/send/pid", model.getValue("/root/main/paminfo/list/pid"));
  230. model.makeValue("/root/send/cretno", model.getValue("/root/main/paminfo/list/cretno"));
  231. if (model.getValue("/root/main/paminfo/list/ioflag") == "O")
  232. {
  233. model.makeValue("/root/send/orddd", model.getValue("/root/main/paminfo/list/orddd"));
  234. }
  235. else
  236. {
  237. model.makeValue("/root/send/orddd", model.getValue("/root/main/paminfo/list/indd"));
  238. }
  239. model.makeValue("/root/send/oprsrvno", oprsrvno);
  240. model.makeValue("/root/send/srchmode", "dr");
  241. model.removeNodeset("/root/main/recinfo/recitem[degnitemno = '1']");
  242. if ( submit("TRMRF04301") )
  243. {
  244. fAfterSrch();
  245. }
  246. if ( submit("TRMRF04302") )
  247. {
  248. var perfdrid = model.getValue("/root/tmp/perfdr/perfdrid");
  249. parent.model.setValue("/root/main/recinfo/recitem[degnitemno='" + cOdt1 + "']/recrefcd", perfdrid);
  250. }
  251. }
  252. }
  253. function fSrchOprPerfDrlist_loc(oprsrvno, cOdt1)
  254. {
  255. model.removeNodeset("/root/tmpop/selectoplist");
  256. // model.makeValue("/root/send/pid", pid);
  257. // model.makeValue("/root/send/orddd", orddd);
  258. // model.makeValue("/root/send/cretno", cretno);
  259. model.makeValue("/root/send/oprsrvno", oprsrvno);
  260. model.makeValue("/root/send/pid", "00005726");
  261. model.makeValue("/root/send/orddd", "20070105");
  262. model.makeValue("/root/send/cretno", 1);
  263. model.makeValue("/root/send/oprsrvno", oprsrvno);
  264. model.makeValue("/root/send/srchmode", "dr");
  265. model.removeNodeset("/root/main/recinfo/recitem[degnitemno = '1']");
  266. if ( submit("TRMRF04301") ) {
  267. fAfterSrch();
  268. }
  269. if ( submit("TRMRF04302") )
  270. {
  271. var perfdrid = model.getValue("/root/tmp/perfdr/perfdrid");
  272. parent.model.setValue("/root/main/recinfo/recitem[degnitemno='" + cOdt1 + "']/recrefcd", perfdrid);
  273. }
  274. }
  275. function fSrchOprlist_loc()
  276. {
  277. model.removeNodeset("/root/tmpop/selectoplist");
  278. // model.makeValue("/root/send/pid", pid);
  279. // model.makeValue("/root/send/orddd", orddd);
  280. // model.makeValue("/root/send/cretno", cretno);
  281. model.makeValue("/root/send/pid", "00005726");
  282. model.makeValue("/root/send/orddd", "20070105");
  283. model.makeValue("/root/send/cretno", 1);
  284. model.makeValue("/root/send/srchmode", "opr");
  285. model.removeNodeset("/root/main/recinfo/recitem[degnitemno = '1']");
  286. if ( submit("TRMRF04301") ) {
  287. fAfterSrch();
  288. }
  289. }
  290. function fInitPage(colhide, heig, wid, ivwID)
  291. {
  292. body.attribute("height") = heig;
  293. body.attribute("width") = wid;
  294. grd_diaglist.attribute("height") = heig - 2;
  295. grd_diaglist.attribute("width") = wid - 4;
  296. grd_diaglist.extendLastCol = "scroll";
  297. if(colhide)
  298. {
  299. grd_diaglist.colhidden(0) = colhide;
  300. btn_pop.attribute("visibility") = "hidden";
  301. }
  302. if (ivwID != null && ivwID != "")
  303. gSendParentCallID = ivwID;
  304. body.refresh();
  305. }
  306. function clearData()
  307. {
  308. model.removeNodeset("/root/main/recinfo");
  309. model.refresh();
  310. }
  311. /**
  312. * @desc : Comments 기록 존재 여부에 따른 컬럼 표시
  313. * @
  314. * @param :
  315. * @return :
  316. * @---------------------------------------------------
  317. */
  318. function fIsCommentExist()
  319. {
  320. var iFndRow = getNodesetCnt(model, "/root/main/recinfo/grid/recitem[degnitemcd ='0000509001' and degnitemkind = 'GSU' and reccnts != '']");
  321. if (iFndRow > 0)
  322. {
  323. grd_diaglist.colhidden(grd_diaglist.colref("recitem[colno='0']/reccnts")) = false;
  324. }
  325. else
  326. {
  327. grd_diaglist.colhidden(grd_diaglist.colref("recitem[colno='0']/reccnts")) = true;
  328. }
  329. grd_diaglist.refresh();
  330. }