MRF04000.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799
  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 :
  11. * @param :
  12. * @return :
  13. * @---------------------------------------------------
  14. */
  15. function fInitialize()
  16. {
  17. model.removeNodeset("/root/main/selectdiaglist");
  18. grd_diaglist.col = 4;
  19. grd_diaglist.row = grd_diaglist.rows - 1;
  20. //dispOnLoadComplete("", model.getValue(pageInfo.formmastRef + "/formcd"));
  21. dispOnLoadComplete("", "0000000899");
  22. // model.refresh();
  23. // parent.body.dispatch("diag_onloadcomplete");
  24. }
  25. /**
  26. * @group :
  27. * @ver : 2007.03.20
  28. * @by :
  29. * @---------------------------------------------------
  30. * @type : function
  31. * @access : public
  32. * @desc :
  33. * @param :
  34. * @return :
  35. * @---------------------------------------------------
  36. */
  37. function fCheckChange()
  38. {
  39. var iLeng = 0;
  40. var degnitemcd = model.getValue("/root/main/recinfo/grid[" + grd_diaglist.row + "]/recitem[degnitemno = '13' and degnitemkind = 'GSU']/degnitemcd");
  41. var dgnm = "";
  42. //2010.02.05 dhkim - 진단명 코드변경
  43. if(degnitemcd.substring(0, 7) == '0000960'){
  44. dgnm = model.getValue("/root/main/recinfo/grid[" + grd_diaglist.row + "]/recitem[degnitemcd = '" + degnitemcd + "' and degnitemkind = 'GSU']/rectermnm");
  45. }
  46. if (dgnm == "")
  47. {
  48. model.setValue("/root/main/recinfo/grid[" + grd_diaglist.row + "]/recitem[degnitemcd='0001443001' and degnitemkind = 'GSU']/rectermnm", "");
  49. model.setValue("/root/main/recinfo/grid[" + grd_diaglist.row + "]/recitem[degnitemcd='0001443001' and degnitemkind = 'GSU']/rectermcd", "S");
  50. model.setValue("/root/main/recinfo/grid[" + grd_diaglist.row + "]/recitem[degnitemcd='0004249001' and degnitemkind = 'GSU']/rectermnm", "");
  51. model.setValue("/root/main/recinfo/grid[" + grd_diaglist.row + "]/recitem[degnitemcd='0004249001' and degnitemkind = 'GSU']/rectermcd", "C");
  52. return false;
  53. }
  54. //주/부 비교 및 주가 맨위로
  55. if ( grd_diaglist.valueMatrix ( grd_diaglist.row,2 ) == "M" && grd_diaglist.col == "2" )
  56. {
  57. for ( var i = 1; i < grd_diaglist.rows; i++ )
  58. {
  59. if ( grd_diaglist.valueMatrix ( i, 2 ) == "M" && i != grd_diaglist.row )
  60. {
  61. grd_diaglist.valueMatrix ( i, 2 ) = "S";
  62. //model.setValue("/root/main/recinfo/recitem[" + i + "]/recitem[degnitemcd='" + '0001443001' + "']/recitemnm", "");
  63. //model.setValue("/root/main/recinfo/grid[" + i + "]/recitem[degnitemcd='" + '0001443001' + "']/recitemnm", "");
  64. model.setValue("/root/main/recinfo/grid[" + i + "]/recitem[degnitemcd='" + '0001443001' + "']/rectermnm", "");
  65. }
  66. }
  67. model.setValue("/root/main/recinfo/grid[" + grd_diaglist.row + "]/recitem[degnitemcd='0001443001']/rectermnm", "주");
  68. model.refresh();
  69. var iRow = grd_diaglist.row;
  70. if (iRow != 1)
  71. {
  72. var sNodeRowNo = ""; //선택된 행의 rowno
  73. var fNodeRowNo = ""; //첫번째 행의 rowno
  74. fNodeRowNo = model.getValue("/root/main/recinfo/grid[" + 1 + "]/recitem[" + 1 + "]/rowno");
  75. sNodeRowNo = model.getValue("/root/main/recinfo/grid[" + iRow + "]/recitem[" + 1 + "]/rowno");
  76. //첫번째 행의 rowno를 선택된 행의 rowno로 바꾼다
  77. var fnodelist = model.instance1.selectNodes("/root/main/recinfo/grid[" + 1 + "]/recitem");
  78. for(var i = 0; i < fnodelist.length; i++)
  79. {
  80. var node = fnodelist.item(i);
  81. var path1 = node.selectSingleNode("rowno");
  82. path1.text = sNodeRowNo;
  83. }
  84. //선택된 행의 rowno를 첫번째 행의 rowno로 바꾼다
  85. var snodelist = model.instance1.selectNodes("/root/main/recinfo/grid[" + iRow + "]/recitem");
  86. for(var i = 0; i < snodelist.length; i++)
  87. {
  88. var node = snodelist.item(i);
  89. var path1 = node.selectSingleNode("rowno");
  90. path1.text = fNodeRowNo;
  91. }
  92. model.makeValue("root/hidden/temp", "");
  93. model.copyNode("root/hidden/temp", "/root/main/recinfo/grid[" + iRow + "]");
  94. model.copyNode("/root/main/recinfo/grid[" + iRow + "]", "/root/main/recinfo/grid[" + 1 + "]");
  95. model.copyNode("/root/main/recinfo/grid[" + 1 + "]", "root/hidden/temp");
  96. model.removeNodeset("root/hidden/temp");
  97. }
  98. }
  99. else if ( grd_diaglist.valueMatrix ( grd_diaglist.row,2 ) == "S" && grd_diaglist.col == "2" )
  100. {
  101. var chkmskind = false;
  102. for ( var i = 1; i < grd_diaglist.rows; i++ )
  103. {
  104. if ( grd_diaglist.valueMatrix ( i, 2 ) == "M")
  105. {
  106. chkmskind = true;
  107. }
  108. }
  109. if(chkmskind)
  110. {
  111. model.setValue("/root/main/recinfo/grid[" + grd_diaglist.row + "]/recitem[degnitemcd='" + '0001443001' + "']/rectermnm", "");
  112. }
  113. else
  114. {
  115. messageBox("하나의 주진단은 필수 ", "I009");
  116. model.setValue("/root/main/recinfo/grid[" + grd_diaglist.row + "]/recitem[degnitemcd='0001443001']/rectermcd", "M");
  117. model.setValue("/root/main/recinfo/grid[" + grd_diaglist.row + "]/recitem[degnitemcd='0001443001']/rectermnm", "주");
  118. return false;
  119. }
  120. }
  121. //R/O비교
  122. if ( grd_diaglist.valueMatrix ( grd_diaglist.row,1 ) == "R" && grd_diaglist.col == "1" )
  123. {
  124. model.setValue("/root/main/recinfo/grid[" + grd_diaglist.row + "]/recitem[degnitemcd='0004249001']/rectermnm", "R/O");
  125. model.refresh();
  126. }
  127. else if ( grd_diaglist.valueMatrix ( grd_diaglist.row,1 ) == "C" && grd_diaglist.col == "1" )
  128. {
  129. model.setValue("/root/main/recinfo/grid[" + grd_diaglist.row + "]/recitem[degnitemcd='" + '0004249001' + "']/rectermnm", "");
  130. }
  131. model.refresh();
  132. }
  133. /**
  134. * @group :
  135. * @ver : 2007.03.20
  136. * @by : ??????
  137. * @---------------------------------------------------
  138. * @type : function
  139. * @access : public
  140. * @desc : ?????? Enable / Disable
  141. * @param :
  142. * @return :
  143. * @---------------------------------------------------
  144. */
  145. function fGrdDelRow()
  146. {
  147. if ( grd_diaglist.valueMatrix ( grd_diaglist.row,2 ) == "M")
  148. {
  149. messageBox("주진단은 삭제", "E001");
  150. return;
  151. }
  152. else
  153. {
  154. var iRow = grd_diaglist.row;
  155. var smmcnts = model.getValue("/root/main/recinfo/grid[" + iRow + "]/recitem[colno='2']/rectermnm");
  156. var smmcntcd = model.getValue("/root/main/recinfo/grid[" + iRow + "]/recitem[colno='2']/rectermcd");
  157. if(iRow > 0 && (smmcnts != "" || smmcntcd != "")){
  158. model.removeNodeset("/root/main/recinfo/grid[" + iRow + "]");
  159. model.removeNodeset("/root/main/selectdiaglist[" + iRow + "]");
  160. model.removeNodeset("/root/tmpdiag/selectdiaglist[" + iRow + "]");
  161. }
  162. else
  163. {
  164. return;
  165. }
  166. var nodelist = model.instance1.selectNodes("/root/main/recinfo/grid");
  167. var totrow = nodelist.length;
  168. var irowcnt = 0;
  169. for(var i = 0; i < totrow; i++)
  170. {
  171. var node = nodelist.item(i);
  172. var tmpnode = node.selectNodes("recitem");
  173. for(var j = 0; j < tmpnode.length; j++)
  174. {
  175. var node = tmpnode.item(j);
  176. var path1 = node.selectSingleNode("rowno");
  177. path1.text = irowcnt;
  178. }
  179. /*
  180. var path1 = node.selectSingleNode("recitem[degnitemlevlcd='0000521.0000960']/rowno"); //진단header
  181. var path2 = node.selectSingleNode("recitem[degnitemlevlcd='0000521.0000960.0004249']/rowno"); //R/O
  182. var path3 = node.selectSingleNode("recitem[degnitemlevlcd='0000521.0000960.0001443']/rowno"); //주/부
  183. var path4 = node.selectSingleNode("recitem[degnitemlevlcd='0000521.0000960.0000960']/rowno"); //진단명
  184. var path5 = node.selectSingleNode("recitem[degnitemlevlcd='0000521.0000960.0000168']/rowno"); //Comments
  185. path1.text = irowcnt;
  186. path2.text = irowcnt;
  187. path3.text = irowcnt;
  188. path4.text = irowcnt;
  189. path5.text = irowcnt;
  190. */
  191. irowcnt++;
  192. }
  193. grd_diaglist.rebuild();
  194. }
  195. }
  196. function fClickPopUp()
  197. {
  198. setParameter("SPMMO3200_param_nodepath", "/root/tmpdiag");
  199. modal("../../../emr/prcpmngtweb/xrw/SPMMO03200_진단팝업.xrw", 1, 0, 0, "", "", "");
  200. var nodelistMain = instance.selectNodes("/root/main/selectdiaglist");
  201. var nodelistTemp = instance.selectNodes("/root/tmpdiag/selectdiaglist");
  202. var iRow = grd_diaglist.row;
  203. var path = "/root/main/recinfo/grid";
  204. var nodelistJuh = instance.selectNodes(path);
  205. var nodelength = nodelistJuh.length;
  206. var smmcnts = "";
  207. //2010.02.05 dhkim - 진단명 코드변경
  208. var degnitemcd = model.getValue("/root/main/recinfo/grid[" + grd_diaglist.row + "]/recitem[degnitemno = '13' and degnitemkind = 'GSU']/degnitemcd");
  209. if(degnitemcd.substring(0, 7) == '0000960'){
  210. smmcnts = model.getValue(path + "[" + nodelength + "]/recitem[degnitemcd = '" + degnitemcd + "' and degnitemkind = 'GSU']/rectermnm");
  211. }
  212. // var smmcnts = model.getValue(path + "[" + nodelength + "]/recitem[degnitemcd = '0000960001' and degnitemkind = 'GSU']/rectermnm")
  213. if (smmcnts == "")
  214. {
  215. model.removeNodeset("/root/main/recinfo/grid[" + nodelength + "]");
  216. model.removeNodeset("/root/main/selectdiaglist[" + nodelength + "]");
  217. grd_diaglist.refresh();
  218. }
  219. var iLeng = 0;
  220. var sTmpdiagcd = "";
  221. var sTmpdiagengnm = "";
  222. var iMainleng = nodelistMain.length;
  223. //var iMainleng = instance.selectNodes("/root/main/recinfo/grid").length;
  224. if(nodelistTemp.length >= 1)
  225. {
  226. for(var i = 1; i <= nodelistTemp.length; i++)
  227. {
  228. sTmpdiagcd = model.getValue("/root/tmpdiag/selectdiaglist[" + i + "]/diagcd");
  229. sTmpdiagengnm = model.getValue("/root/tmpdiag/selectdiaglist[" + i + "]/diagengnm");
  230. //var iFndRow = getNodesetCnt(model, "/root/main/selectdiaglist/col[rectermcd='" + sTmpdiagcd + "']");
  231. var iFndRow = getNodesetCnt(model, "/root/main/recinfo/grid/recitem[rectermcd='" + sTmpdiagcd + "']");
  232. if(iFndRow > 0){
  233. iMainleng = iMainleng - 1;
  234. }else if(iFndRow <= 0){
  235. iLeng = i + iMainleng;
  236. model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 1 + "]/rectermcd", "C");
  237. model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 1 + "]/reccnts", "");
  238. model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 1 + "]/comp", "false");
  239. model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 1 + "]/colno", "0");
  240. model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 2 + "]/rectermcd", "S");
  241. model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 2 + "]/reccnts", "부");
  242. model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 2 + "]/comp", "false");
  243. model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 2 + "]/colno", "1");
  244. model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 3 + "]/rectermcd", sTmpdiagcd);
  245. model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 3 + "]/reccnts", sTmpdiagengnm);
  246. model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 3 + "]/cntsyn", "N");
  247. model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 3 + "]/comp", "true");
  248. model.makeValue("/root/main/selectdiaglist[" + iLeng + "]/col["+ 3 + "]/colno", "2");
  249. }
  250. }
  251. }
  252. makeProgInstance(pageInfo, instance, nodelistMain);
  253. fAddrow();
  254. }
  255. /**
  256. * @desc : 줄추가
  257. * @
  258. * @param :
  259. * @return :
  260. * @---------------------------------------------------
  261. */
  262. function fAddrow()
  263. {
  264. var path1 = "/root/main/recinfo/grid[degnitemno = '1']";
  265. var nodelistDGN = instance.selectNodes(path1);
  266. var nodelength = nodelistDGN.length;
  267. var path2 = "/root/main/recinfo/grid[degnitemno = '1'][" + nodelength + "]";
  268. copyNodeset("/root/tmp", path2, "replace", model, model);
  269. var smmcnts = model.getValue("/root/tmp/recitem[colno='2']/rectermnm");
  270. if(smmcnts != "" || nodelength == 0)
  271. {
  272. model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 1 + "]/rectermcd", "C");
  273. model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 1 + "]/reccnts", "");
  274. model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 1 + "]/comp", "false");
  275. model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 1 + "]/colno", "0");
  276. model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 2 + "]/rectermcd", "S");
  277. model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 2 + "]/reccnts", "");
  278. model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 2 + "]/comp", "false");
  279. model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 2 + "]/colno", "1");
  280. model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 3 + "]/rectermcd", "");
  281. model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 3 + "]/reccnts", "-");
  282. model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 3 + "]/cntsyn", "N");
  283. model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 3 + "]/comp", "true");
  284. model.makeValue("/root/main/selectdiaglist[" + 1 + "]/col["+ 3 + "]/colno", "2");
  285. nodelistMain = instance.selectNodes("/root/main/selectdiaglist");
  286. makeProgInstance(pageInfo, instance, nodelistMain);
  287. // grd_diaglist.row = nodelength + 1;
  288. // grd_diaglist.col = 2;
  289. // grd_diaglist.editCell();
  290. grd_diaglist.refresh();
  291. }
  292. }
  293. /**
  294. * @desc : 편집 후 termcd가 없는 경우 '-'를 넣어줌(저장문제)
  295. * @
  296. * @param :
  297. * @return :
  298. * @---------------------------------------------------
  299. */
  300. function fEndEdit()
  301. {
  302. //debugger;
  303. var path1 = "/root/main/recinfo/grid[degnitemno = '1']";
  304. var nodelistJuh = instance.selectNodes(path1);
  305. var nodelength = nodelistJuh.length;
  306. var smmcnts = model.getValue("/root/main/recinfo/grid[degnitemno = '1'][" + nodelength + "]/recitem[colno='2']/rectermnm");
  307. var termcd = model.getValue("/root/main/recinfo/grid[degnitemno = '1'][" + nodelength + "]/recitem[colno='2']/rectermcd");
  308. if(smmcnts != "" && termcd == "")
  309. {
  310. model.setValue("/root/main/recinfo/grid[degnitemno = '1'][" + nodelength + "]/recitem[colno='2']/rectermcd", "-");
  311. }
  312. var sDisgnm = model.getValue("/root/main/recinfo/grid[degnitemno = '1'][" + grd_diaglist.row + "]/recitem[colno='2']/rectermnm");
  313. if (sDisgnm == "")
  314. {
  315. fGrdDelRow();
  316. }
  317. }
  318. function fInitPage(colhide, heig, wid, ivwID, initnm)
  319. {
  320. body.attribute("height") = heig;
  321. body.attribute("width") = wid;
  322. grd_diaglist.attribute("height") = heig - 2;
  323. grd_diaglist.attribute("width") = wid - 4;
  324. grd_diaglist.extendLastCol = "scroll";
  325. if(colhide)
  326. {
  327. grd_diaglist.colhidden(0) = colhide;
  328. btn_pop.attribute("visibility") = "hidden";
  329. }
  330. if (ivwID != null && ivwID != "")
  331. gSendParentCallID = ivwID;
  332. if (initnm != null && initnm != "")
  333. grd_diaglist.valueMatrix(0, 4) = initnm;
  334. body.refresh();
  335. }
  336. /**
  337. * @group :
  338. * @ver : 2007.03.20
  339. * @by : ??????
  340. * @---------------------------------------------------
  341. * @type : function
  342. * @access : public
  343. * @desc : ?????? Enable / Disable
  344. * @param :
  345. * @return :
  346. * @---------------------------------------------------
  347. */
  348. function old_fGetDiagNm()
  349. {
  350. var pamInfoCvs = getGlobalVariable("paminfo"); //상단정보가 있을 경우는 검색
  351. if(pamInfoCvs != null && pamInfoCvs != "")
  352. { //cvs가 null이 아닌 경우에만 처리함.
  353. model.removeNodeSet ("/root/init/paminfo/list");
  354. setCSVToNode ("/root/init/paminfo", pamInfoCvs);
  355. var sPid = model.getValue ("/root/init/paminfo/list/pid");
  356. var sCretno = cretno = model.getValue ("/root/init/paminfo/list/cretno");
  357. var sIoflag = ioflag = model.getValue ("/root/init/paminfo/list/ioflag");
  358. var sOrddeptcd = orddeptcd = model.getValue ("/root/init/paminfo/list/orddeptcd");
  359. var sOrddd = "";
  360. if (ioflag == "O")
  361. {
  362. sOrddd = model.getValue ("/root/init/paminfo/list/orddd");
  363. } else {
  364. sOrddd = model.getValue ("/root/init/paminfo/list/indd");
  365. }
  366. }
  367. model.removeNodeset("/root/main/diaginfo");
  368. model.makeValue("/root/send/cond1", sPid);
  369. model.makeValue("/root/send/cond2", sOrddd);
  370. model.makeValue("/root/send/cond3", sCretno);
  371. model.makeValue("/root/send/cond4", sOrddeptcd);
  372. model.makeValue("/root/send/cond5", sIoflag);
  373. // model.makeValue("/root/send/cond1", "00301165");
  374. // model.makeValue("/root/send/cond2", "20070524");
  375. // model.makeValue("/root/send/cond3", "1");
  376. // model.makeValue("/root/send/cond4", "1000000004");
  377. // model.makeValue("/root/send/cond5", "I");
  378. submit("TRMMO00105", false);
  379. fSetDiagNmInstance();
  380. }
  381. /**
  382. * @group :
  383. * @ver : 2007.03.20
  384. * @by : ??????
  385. * @---------------------------------------------------
  386. * @type : function
  387. * @access : public
  388. * @desc : ?????? Enable / Disable
  389. * @param :
  390. * @return :
  391. * @---------------------------------------------------
  392. */
  393. function fGetDiagNm(paminfo)
  394. {
  395. var pageInfo = new PAGEINFO();
  396. var degnlvcd = model.getValue(pageInfo.initRecinfoGridrecItemRef + "[orgdegnitemkind='DGN']/degnitemlevlcd").substring(0, 7);
  397. if(paminfo != null)
  398. {
  399. var pid = paminfo.selectSingleNode("pid").text
  400. var cretno = paminfo.selectSingleNode("cretno").text
  401. var orddd = paminfo.selectSingleNode("orddd").text
  402. var orddeptcd = paminfo.selectSingleNode("orddeptcd").text
  403. var ioflag = paminfo.selectSingleNode("chosflag").text
  404. fSetDiagNmbyDegnItemLevlCd(pid, cretno, orddd, orddeptcd, ioflag, degnlvcd);
  405. fAddrow();
  406. }
  407. }
  408. var gDegnItemNm = null;
  409. function fSetDiagNmInstance()
  410. {
  411. var nodelistDiaginfo = instance.selectNodes("/root/main/diaginfo/diagcdlist");
  412. var nodelistMain = instance.selectNodes("/root/main/selectdiaglist");
  413. var ro = "";
  414. var ms = "";
  415. var sDiagkindcd = "";
  416. var sDiagkindcdflag = "";
  417. if(nodelistDiaginfo.length >= 1){
  418. for(var i = 1; i <= nodelistDiaginfo.length; i++)
  419. {
  420. sDiagkindcd = model.getValue("/root/main/diaginfo/diagcdlist[" + i + "]/diagkindcd");
  421. sDiagkindcdflag = model.getValue("/root/main/diaginfo/diagcdlist[" + i + "]/diagkindcdflag");
  422. sTmpdiagcd = model.getValue("/root/main/diaginfo/diagcdlist[" + i + "]/icd10cd");
  423. sTmpdiagengnm = model.getValue("/root/main/diaginfo/diagcdlist[" + i + "]/diagengnm");
  424. if (sDiagkindcd == "R")
  425. {
  426. ro = "R/O";
  427. }
  428. else
  429. {
  430. ro = "";
  431. sDiagkindcd = "C";
  432. }
  433. if (sDiagkindcdflag == "M")
  434. {
  435. ms = "주";
  436. }
  437. else
  438. {
  439. ms = "부";
  440. sDiagkindcdflag = "S";
  441. }
  442. model.makeValue("/root/main/selectdiaglist[" + i + "]/col["+ 1 + "]/rectermcd", sDiagkindcd);
  443. model.makeValue("/root/main/selectdiaglist[" + i + "]/col["+ 1 + "]/reccnts", ro);
  444. model.makeValue("/root/main/selectdiaglist[" + i + "]/col["+ 1 + "]/comp", "false");
  445. model.makeValue("/root/main/selectdiaglist[" + i + "]/col["+ 1 + "]/colno", "0");
  446. model.makeValue("/root/main/selectdiaglist[" + i + "]/col["+ 2 + "]/rectermcd", sDiagkindcdflag);
  447. model.makeValue("/root/main/selectdiaglist[" + i + "]/col["+ 2 + "]/reccnts", ms);
  448. model.makeValue("/root/main/selectdiaglist[" + i + "]/col["+ 2 + "]/comp", "false");
  449. model.makeValue("/root/main/selectdiaglist[" + i + "]/col["+ 2 + "]/colno", "1");
  450. model.makeValue("/root/main/selectdiaglist[" + i + "]/col["+ 3 + "]/rectermcd", sTmpdiagcd);
  451. model.makeValue("/root/main/selectdiaglist[" + i + "]/col["+ 3 + "]/reccnts", sTmpdiagengnm);
  452. model.makeValue("/root/main/selectdiaglist[" + i + "]/col["+ 3 + "]/comp", "true");
  453. model.makeValue("/root/main/selectdiaglist[" + i + "]/col["+ 3 + "]/colno", "2");
  454. model.makeValue("/root/main/selectdiaglist[" + i + "]/col["+ 3 + "]/rectermflag", "002");
  455. if (sDiagkindcdflag == "M")
  456. {
  457. parent.window.javascript.setParameter("SSMRF04000_diagnm", sTmpdiagengnm);
  458. }
  459. }
  460. makeProgInstance(pageInfo, instance, nodelistMain, gDegnItemNm);
  461. }
  462. fAddrow();
  463. model.refresh();
  464. }
  465. /**
  466. * @desc : 수술예약번호를 통한 진단명, 마취종류 조회삭제예정
  467. (해당기록지에서 직접 조회하여 데이터 넘김) 2008.05.20 박종훈
  468. * @
  469. * @param :
  470. * @return :
  471. * @---------------------------------------------------
  472. */
  473. function fGetdiagFormOprsrvno(oprsrvno, iMcdnm, iMcdnm, iScdnm, iScdnm)
  474. {
  475. if(oprsrvno != ""){
  476. model.removeNodeset("/root/main/diaginfo/diagcdlist");
  477. model.makeValue("/root/send/oprsrvno", oprsrvno);
  478. //model.makeValue("/root/send/oprsrvno", "2007000009");
  479. submit("TRMRF04001", false);
  480. var anstmthdcd = model.getValue("/root/main/diaginfo/anstlist/anstmthdcd");
  481. var mcdnm = model.getValue("/root/main/diaginfo/anstlist/mcdnm");
  482. var anstmthdcdsub = model.getValue("/root/main/diaginfo/anstlist/anstmthdcdsub");
  483. var scdnm = model.getValue("/root/main/diaginfo/anstlist/scdnm");
  484. //주마취
  485. parent.model.setValue("/root/main/recinfo/recitem[degnitemno='" + iMcdnm + "']/recrefcd", anstmthdcd);
  486. parent.model.setValue("/root/main/recinfo/recitem[degnitemno='" + iMcdnm + "']/recitemnm", mcdnm);
  487. //부마취
  488. parent.model.setValue("/root/main/recinfo/recitem[degnitemno='" + iScdnm + "']/recrefcd", anstmthdcdsub);
  489. parent.model.setValue("/root/main/recinfo/recitem[degnitemno='" + iScdnm + "']/recitemnm", scdnm);
  490. fSetDiagNmInstance();
  491. return true;
  492. }else{
  493. alert("해당환자는 수술환자가 아닙니다!");
  494. parent.grup_base.disabled = true;
  495. //parent.window.javascript.fBtnDisable();
  496. return false;
  497. }
  498. // var diagcdlistNode = instance1.selectSingleNode("/root/main/diaginfo");
  499. //
  500. // if((diagcdlistNode.childNodes).length > 0){
  501. //
  502. // var selectNode = ivw_0007983001.instance1.selectSingleNode("/root/main/diaginfo");
  503. //
  504. // if(selectNode == null){
  505. // ivw_0007983001.model.makeNode("/root/main/diaginfo");
  506. // }
  507. //
  508. // copyNode(ivw_0007983001.model, model, "/root/main/diaginfo/diagcdlist", "/root/main/diaginfo/diagcdlist");
  509. // ivw_0007983001.window.javascript.fSetDiagNmInstance();
  510. //
  511. // var anstmthdcd = model.getValue("/root/main/diaginfo/diagcdlist/anstmthdcd");
  512. // var mcdnm = model.getValue("/root/main/diaginfo/diagcdlist/mcdnm");
  513. // var anstmthdcdsub = model.getValue("/root/main/diaginfo/diagcdlist/anstmthdcdsub");
  514. // var scdnm = model.getValue("/root/main/diaginfo/diagcdlist/scdnm");
  515. // //주마취
  516. // model.setValue("/root/main/recinfo/recitem[degnitemno='" + iMcdnm + "']/recrefcd", anstmthdcd);
  517. // model.setValue("/root/main/recinfo/recitem[degnitemno='" + iMcdnm + "']/recitemnm", mcdnm);
  518. // //부마취
  519. // model.setValue("/root/main/recinfo/recitem[degnitemno='" + iScdnm + "']/recrefcd", anstmthdcdsub);
  520. // model.setValue("/root/main/recinfo/recitem[degnitemno='" + iScdnm + "']/recitemnm", scdnm);
  521. //
  522. // model.refresh();
  523. // }
  524. }
  525. /**
  526. * @desc : 수술예약번호를 통한 진단명, 마취종류 조회
  527. * @
  528. * @param :
  529. * @return :
  530. * @---------------------------------------------------
  531. */
  532. function fGetdiagFormOprsrvno_loc(tmp, iMcdnm, iMcdnm, iScdnm, iScdnm)
  533. {
  534. model.removeNodeset("/root/main/diaginfo/diagcdlist");
  535. //model.makeValue("/root/send/oprsrvno", oprsrvno);
  536. model.makeValue("/root/send/oprsrvno", tmp);
  537. submit("TRMRF04001", false);
  538. var anstmthdcd = model.getValue("/root/main/diaginfo/anstlist/anstmthdcd");
  539. var mcdnm = model.getValue("/root/main/diaginfo/anstlist/mcdnm");
  540. var anstmthdcdsub = model.getValue("/root/main/diaginfo/anstlist/anstmthdcdsub");
  541. var scdnm = model.getValue("/root/main/diaginfo/anstlist/scdnm");
  542. //주마취
  543. parent.model.setValue("/root/main/recinfo/recitem[degnitemno='" + iMcdnm + "']/recrefcd", anstmthdcd);
  544. parent.model.setValue("/root/main/recinfo/recitem[degnitemno='" + iMcdnm + "']/recitemnm", mcdnm);
  545. //부마취
  546. parent.model.setValue("/root/main/recinfo/recitem[degnitemno='" + iScdnm + "']/recrefcd", anstmthdcdsub);
  547. parent.model.setValue("/root/main/recinfo/recitem[degnitemno='" + iScdnm + "']/recitemnm", scdnm);
  548. fSetDiagNmInstance();
  549. return true;
  550. }
  551. function clearData()
  552. {
  553. model.removeNodeset("/root/main/recinfo");
  554. model.refresh();
  555. }
  556. /**
  557. * @desc : Comments 기록 존재 여부에 따른 컬럼 표시
  558. * @
  559. * @param :
  560. * @return :
  561. * @---------------------------------------------------
  562. */
  563. function fIsCommentExist()
  564. {
  565. var iFndRow = 0;
  566. //2010.02.05 dhkim - 진단명 코드변경
  567. var degnitemcd = model.getValue("/root/main/recinfo/grid[" + grd_diaglist.row + "]/recitem[degnitemno = '13' and degnitemkind = 'GSU']/degnitemcd");
  568. if(degnitemcd.substring(0, 7) == '0000960'){
  569. iFndRow = getNodesetCnt(model, "/root/main/recinfo/grid/recitem[degnitemcd = '" + degnitemcd + "' and degnitemkind = 'GSU' and reccnts != '']");
  570. }
  571. // var iFndRow = getNodesetCnt(model, "/root/main/recinfo/grid/recitem[degnitemcd ='0000960001' and degnitemkind = 'GSU' and reccnts != '']");
  572. if (iFndRow > 0)
  573. {
  574. grd_diaglist.colhidden(grd_diaglist.colref("recitem[colno='2']/reccnts")) = false;
  575. }
  576. else
  577. {
  578. grd_diaglist.colhidden(grd_diaglist.colref("recitem[colno='2']/reccnts")) = true;
  579. }
  580. }
  581. /**
  582. * @desc : 저장전 검사
  583. * : 2010.01.18 dhkim - 추가(isChk가 true일때만 체크함)
  584. * @
  585. * @param : 추가
  586. * @return :
  587. * @---------------------------------------------------
  588. */
  589. function fChkGrdPreSave(isChk, itemNm)
  590. {
  591. if(isChk == null || isChk == false){
  592. return false;
  593. }
  594. if(isChk){
  595. }
  596. }
  597. /**
  598. * @desc : 저장전 검사(입퇴원요약기록_MMR00800에서만 사용)
  599. * : 2010.01.27 dhkim - 추가(isChk가 true일때만 체크함)
  600. * @
  601. * @param : 추가
  602. * @return :
  603. * @---------------------------------------------------
  604. */
  605. function fChkGrdPreSave_MMR00800(isChk, itemNm)
  606. {
  607. if(isChk == null || isChk == false){
  608. return false;
  609. }
  610. if(isChk){
  611. model.addLog("MRF04000.js fChkGrdPreSave_MMR00800내부 == ");
  612. //2010.01.27 dhkim
  613. //1. 주진단체크
  614. //2. 진단이 1건일 경우 부진단이 있는지 여부를 물어봄
  615. //3. 부진단이 있다고 하면 저장안하고 리턴시킴
  616. if(itemNm == null || itemNm == ""){
  617. var pageInfo = new PAGEINFO();
  618. itemNm = model.instances(0).selectSingleNode(pageInfo.formdegnRef + "[degnitemkind = 'GRD']").getXPathString("itemnm");
  619. }
  620. var path = "/root/main/recinfo/grid";
  621. var nodelist = instance.selectNodes(path);
  622. var nodelength = (nodelist.length);
  623. var msFlag, diagnm, diagcd;
  624. var isMChk = false;//주진단체크여부
  625. var isSChk = false;//부진단체크여부
  626. for(var i = 1; i <= nodelength; i++){
  627. msFlag = model.getValue(path + "[" + i + "]/recitem[colno='1']/rectermcd");//주부체크
  628. diagnm = model.getValue(path + "[" + i + "]/recitem[colno='2']/rectermnm");//진단명
  629. diagcd = model.getValue(path + "[" + i + "]/recitem[colno='2']/rectermcd");//진단코드
  630. if(diagcd != ""){
  631. if(msFlag == "M"){
  632. isMChk = true;
  633. }else if(msFlag == "S"){
  634. isSChk = true;
  635. }
  636. }
  637. if(diagcd == "-" && diagnm == ""){
  638. messageBox(i + "행에 진단명을 입력하십시요", "E");
  639. return false;
  640. }
  641. }
  642. //주진단체크여부
  643. if(isMChk == false){
  644. messageBox("하나의 주진단은 필수 ", "I009");
  645. return false;
  646. }
  647. //부진단체크여부 -
  648. //부진단입력확인메세지에 "예" 클릭하는 경우 리턴(예:6, 아니오:7)
  649. if(isSChk == false){
  650. //2010.02.11 dhkim - 메세지변경요청
  651. /*
  652. 김은미 02-11 11:07
  653. 부진단미입력시, 메세지내용을 변경하려고 합니다.
  654. 김은미 02-11 11:09
  655. (기존)부진단이 없습니다. 부진단을 입력하시겠습니까? ->(변경요청내용) 부진단은 JCI 필수입력항목입니다. 해당환자에게 입력된 부진단이 없습니다. 입력하시겠습니까?
  656. 김은미 02-11 11:09
  657. 로 변경해주세요....
  658. */
  659. //if(messageBox("부진단이 없습니다. 부진단을 입력하시겠습니까?", "Q") == 6){
  660. if(messageBox("부진단은 JCI 필수입력항목입니다. 해당환자에게 입력된 부진단이 없습니다. 입력하시겠습니까?", "Q") == 6){
  661. return false;
  662. }
  663. }
  664. return true;
  665. }
  666. }