MRF04200.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. /**
  2. * @group :
  3. * @ver : 2007.03.20
  4. * @by : ??????
  5. * @---------------------------------------------------
  6. * @type : function
  7. * @access : public
  8. * @desc : ?????? Enable / Disable
  9. * @param :
  10. * @return :
  11. * @---------------------------------------------------
  12. */
  13. function fInitialize() {
  14. //btn_deptindx.selected = "true";
  15. model.removeNodeset("/root/main/selectdiaglist/selectdiaglist");
  16. fInitializeDone_Switch("deptcd");
  17. model.refresh();
  18. }
  19. /**
  20. * @desc : switch화면 변경
  21. * @
  22. * @param : caseID - switch case화면ID
  23. * @return :
  24. * @---------------------------------------------------
  25. */
  26. function fInitializeDone_Switch(caseID){
  27. model.removeNodeset("/root/send/reqdata");
  28. model.removeNodeset("/root/main/cccdinfo");
  29. model.toggle(caseID);
  30. model.refresh();
  31. if(caseID == "ccindx")
  32. { //전체보기
  33. button3.attribute("visibility") = "hidden";
  34. var currentTime = getCurrentTime();
  35. model.setValue("/root/init/today", getCurrentDate());
  36. model.setValue("/root/init/curruntTime", currentTime.substr(0,4));
  37. model.setValue("/root/hidden/condition/selctedmode", "C");
  38. model.setValue("/root/init/userinfo/userid", getUserId());
  39. model.setValue("/root/init/userinfo/usernm", getUserName());
  40. model.setValue("/root/init/userinfo/instcd", getUserInfo("posinstcd"));
  41. model.removeNodeset("/root/send");
  42. model.makeValue("/root/send/mode", model.getValue("/root/hidden/condition/indxviewmode"));
  43. model.makeValue("/root/send/indxflag", model.getValue("/root/hidden/condition/indxflag"));
  44. if(submit("TRMRF04201"))
  45. {
  46. btn_icd10.selected = "true";
  47. btn_deptindx.selected = "false";
  48. btn_indset.selected = "false";
  49. trv_ccindx.refresh();
  50. }
  51. }
  52. else if(caseID == "deptcd")
  53. { //과색인코드
  54. button3.attribute("visibility") = "hidden";
  55. model.makeValue("/root/send/reqdata/deptindxflag", "2");
  56. model.makeValue("/root/send/reqdata/deptcd", getUserInfo("dutplcecd"));
  57. model.makeValue("/root/send/reqdata/deptnm", getUserInfo("dutplcenm"));
  58. // model.makeValue("/root/send/reqdata/deptcd", "2060000000");
  59. // model.makeValue("/root/send/reqdata/deptnm", "신경외과");
  60. if(submit("TRMRF04205")) //과색인코드 조회
  61. {
  62. btn_icd10.selected = "false";
  63. btn_deptindx.selected = "true";
  64. btn_indset.selected = "false";
  65. trv_deptindxcdlist.refresh();
  66. var instance = document.models(0).instances(0);
  67. var ccDeptsetList = instance.selectNodes("/root/main/deptindxcdlist/deptindxcdlist");
  68. if (ccDeptsetList.length > 0)
  69. {
  70. fSelectTree("deptcd", "N");
  71. }
  72. }
  73. }
  74. else if(caseID == "prms")
  75. { //개인SET
  76. button3.attribute("visibility") = "visible";
  77. if(submit("TRMRF04207"))
  78. {
  79. btn_icd10.selected = "false";
  80. btn_deptindx.selected = "false";
  81. btn_indset.selected = "true";
  82. var instance = document.models(0).instances(0);
  83. var ccsetList = instance.selectNodes("/root/main/cclist/ccset");
  84. if (ccsetList.length <= 0)
  85. {
  86. //fInitializeDone_Switch("deptcd");
  87. }
  88. }
  89. }
  90. }
  91. /**
  92. * @group :
  93. * @ver : 2007.03.20
  94. * @by : ??????
  95. * @---------------------------------------------------
  96. * @type : function
  97. * @access : public
  98. * @desc : ?????? Enable / Disable
  99. * @param :
  100. * @return :
  101. * @---------------------------------------------------
  102. */
  103. function fSelectTree(caseID, selyn) {
  104. model.removeNodeset("/root/send");
  105. if(caseID == "ccindx"){ //전체보기
  106. var iIndx = trv_ccindx.focusIndex + 1;
  107. var selIndxCd = model.getValue("/root/main/indxlist/item[" + iIndx + "]/indxcd");
  108. model.makeValue("/root/send/indxcd", selIndxCd);
  109. if(model.getValue("/root/hidden/condition/selctedmode") == "C"){
  110. model.setValue("/root/hidden/condition/selectedIndx", model.getValue("/root/main/indxlist/item[" + iIndx + "]/indxcd"));
  111. model.setValue("/root/hidden/condition/selectedIndxDepth", model.getValue("/root/main/indxlist/item[" + iIndx + "]/depth"));
  112. model.setValue("/root/hidden/condition/selectedIndxPath", model.getValue("/root/main/indxlist/item[" + iIndx + "]/pathcd"));
  113. submit("TRMRF04202"); //인덱스 트리를 가지고 온다
  114. grd_cccd.rebuild();
  115. }else{
  116. model.makeValue("/root/send/indxflag", model.getValue("/root/hidden/condition/indxflag"));
  117. model.makeValue("/root/send/deptcd", model.getValue("/root/hidden/condition/deptset/selecteddeptcd"));
  118. submit("TRMRF04203");
  119. }
  120. }else if(caseID == "deptcd"){ //과색인코드
  121. if(selyn == "N")
  122. {
  123. var iRow = 1;
  124. }
  125. else
  126. {
  127. var iRow = trv_deptindxcdlist.focusIndex + 1;
  128. }
  129. var deptindxcd = model.getValue("/root/main/deptindxcdlist/deptindxcdlist[" + iRow + "]/deptindxcd");
  130. var deptcd = model.getValue("/root/main/deptindxcdlist/deptindxcdlist[" + iRow + "]/deptcd");
  131. model.removeNodeset("/root/send/reqdata");
  132. model.makeValue("/root/send/reqdata/deptindxflag", "2");
  133. model.makeValue("/root/send/reqdata/deptindxcd", deptindxcd);
  134. model.makeValue("/root/send/reqdata/deptcd", deptcd);
  135. submit("TRMRF04206");
  136. }
  137. }
  138. /**
  139. * @desc : 단일 주호소코드 선택, 그리드 클릭
  140. * @
  141. * @param : iRow - 현재 클릭한 그리드의 row 위치
  142. * @return :이창록 수정(주호소 한글명 추가)2008.6.16
  143. * @---------------------------------------------------
  144. */
  145. function fAddDiag(iRow, iCol){
  146. var sUmlscd = model.getValue("/root/main/cccdinfo/cccd[" + iRow + "]/umlscd");
  147. var sTermcd = model.getValue("/root/main/cccdinfo/cccd[" + iRow + "]/termcd");
  148. var sTermhngnm = model.getValue("/root/main/cccdinfo/cccd[" + iRow + "]/termhngnm");
  149. var sTermengnm = "";
  150. if (iCol == "6")
  151. {
  152. sTermengnm = model.getValue("/root/main/cccdinfo/cccd[" + iRow + "]/termhngnm");
  153. }
  154. else
  155. {
  156. sTermengnm = model.getValue("/root/main/cccdinfo/cccd[" + iRow + "]/termengnm");
  157. }
  158. var iFndRow = grd_selectdiag.findRow(sTermengnm, 1, 1, "true", "true");
  159. if(iFndRow < 0 && sTermengnm !=""){
  160. grd_selectdiag.addRow(false);
  161. iCurRow = grd_selectdiag.row;
  162. model.makeValue("/root/main/selectdiaglist/selectdiaglist[" + iCurRow + "]/umlscd" , sUmlscd);
  163. model.makeValue("/root/main/selectdiaglist/selectdiaglist[" + iCurRow + "]/termcd" , sTermcd);
  164. model.makeValue("/root/main/selectdiaglist/selectdiaglist[" + iCurRow + "]/termengnm", sTermengnm);
  165. model.makeValue("/root/main/selectdiaglist/selectdiaglist[" + iCurRow + "]/termhngnm", sTermhngnm);
  166. }
  167. model.refresh();
  168. }
  169. /**
  170. * @desc : 다수의 주호소코드 선택, 주호소추가버튼 클릭
  171. * @
  172. * @param :
  173. * @return :
  174. * @---------------------------------------------------
  175. */
  176. function fAppendDiag(){
  177. var iTotRow = grd_cccd.rows;
  178. for(var iRow = 1; iRow < iTotRow; iRow++){
  179. var bFlag = grd_cccd.valueMatrix(iRow,0);
  180. if(bFlag == "true"){
  181. fAddDiag(iRow);
  182. }
  183. }
  184. grd_selectdiag.rebuild();
  185. }
  186. /**
  187. * @desc : 주호소코드 전달
  188. * @
  189. * @param :
  190. * @return :
  191. * @---------------------------------------------------
  192. */
  193. function fSendDiagCD(){
  194. if(!fVailCheck())
  195. {
  196. messageBox("주호소는", "I003");
  197. return;
  198. }
  199. if(checkOpener()){
  200. var nodepath = opener.javascript.getParameter("SPMRF04200_param_nodepath");
  201. if(nodepath == ""){
  202. var selectNode = opener.instance1.selectSingleNode("/root/temp/selectdiaglist");
  203. if(selectNode == null){
  204. opener.model.makeNode("/root/temp/selectdiaglist");
  205. }
  206. model.copyNode(opener.root.temp, root.main.selectdiaglist);
  207. }else{
  208. var selectnode = opener.instance1.selectSingleNode(nodepath);
  209. if(selectnode == null){
  210. opener.model.makeNode(nodepath);
  211. }
  212. opener.model.copyNode(nodepath, root.main.selectdiaglist);
  213. }
  214. }else{
  215. messageBox("상위화면이 변경되어 데이터를 전달", "E001");
  216. }
  217. opener.javascript.setParameter("MRF04200_DataYn", "Y");
  218. window.close();
  219. }
  220. /**
  221. * @desc : 주호소 입력 여부 체크
  222. * @
  223. * @param :
  224. * @return :
  225. * @---------------------------------------------------
  226. */
  227. function fVailCheck(){
  228. var instance = document.models(0).instances(0);
  229. var rtn = true;
  230. var sTmpdiagengnm = "";
  231. var nodelistMain = instance.selectNodes("/root/main/selectdiaglist/selectdiaglist");
  232. for (var i = 1; i <= nodelistMain.length; i++)
  233. {
  234. sTmpdiagengnm = model.getValue("/root/main/selectdiaglist/selectdiaglist[" + i + "]/termengnm");
  235. if (sTmpdiagengnm == "")
  236. {
  237. rtn = false;
  238. }
  239. }
  240. return rtn;
  241. }
  242. /**
  243. * @desc : 주호소 조회(검색 조건)
  244. * @
  245. * @param :
  246. * @return :
  247. * @---------------------------------------------------
  248. */
  249. function fReqDiagSrchCond(){
  250. model.removeNodeset("/root/send/reqdata");
  251. var reqdata = model.getValue("/root/main/cond/reqdata");
  252. if(reqdata.charCodeAt(0) > 255){
  253. model.setValue("/root/main/cond/wordflag", "hng");
  254. }else{
  255. model.setValue("/root/main/cond/wordflag", "eng");
  256. }
  257. model.setValue("/root/main/cond/reqdata", reqdata.toUpperCase());
  258. model.makeValue("/root/send/reqdata/reqdata" , model.getValue("/root/main/cond/reqdata"));
  259. model.makeValue("/root/send/reqdata/srchflag", model.getValue("/root/main/cond/srchflag"));
  260. model.makeValue("/root/send/reqdata/wordflag", model.getValue("/root/main/cond/wordflag"));
  261. submit("TRMRF04204");
  262. grd_cccd.rebuild();
  263. }
  264. /**
  265. * @desc : tremcd 초기화
  266. * @
  267. * @param :
  268. * @return :
  269. * @---------------------------------------------------
  270. */
  271. function fEndEditSelcc(){
  272. var iRow = grd_selectdiag.row;
  273. var iCol = grd_selectdiag.col;
  274. if (iCol == "1")
  275. {
  276. model.makeValue("/root/main/selectdiaglist/selectdiaglist[" + iRow + "]/termcd", "");
  277. model.refresh();
  278. }
  279. }
  280. /**
  281. * @desc : 개인주호소 추가(조회)
  282. * @
  283. * @param :
  284. * @return :
  285. * @---------------------------------------------------
  286. */
  287. function fSetCCfavor()
  288. {
  289. model.setValue("/root/main/cccdinfo/cccd[" + grd_cccd.Row + "]/boolflag", "true");
  290. grd_cccd.addStatus(grd_cccd.row, "update");
  291. model.refresh();
  292. var iTotRow = grd_cccd.rows;
  293. var cnt = 0;
  294. for(var iRow = 1; iRow < iTotRow; iRow++){
  295. var bFlag = grd_cccd.valueMatrix(iRow,0);
  296. var multiTermnm = model.getValue("/root/main/cccdinfo/cccd[" + iRow + "]/termengnm");
  297. if(bFlag == "true"){
  298. model.makeValue("/root/main/cccdinfo/cccd[" + iRow + "]/charflag", "E");
  299. model.makeValue("/root/main/cccdinfo/cccd[" + iRow + "]/cctermnm", multiTermnm);
  300. cnt++;
  301. }
  302. }
  303. model.removeNodeset("/root/send");
  304. model.refresh();
  305. if (cnt > 1)
  306. {
  307. model.makeValue("/root/send/ccset", grd_cccd.getUpdateData());
  308. }
  309. else if (cnt == 1)
  310. {
  311. var iRow = grd_cccd.Row;
  312. var iCol = grd_cccd.Col;
  313. var charflag = "";
  314. var sTermnm = "";
  315. if (iCol == "5")
  316. {
  317. sTermnm = model.getValue("/root/main/cccdinfo/cccd[" + iRow + "]/termhngnm");
  318. charflag = "H";
  319. }
  320. else
  321. {
  322. sTermnm = model.getValue("/root/main/cccdinfo/cccd[" + iRow + "]/termengnm");
  323. charflag = "E";
  324. }
  325. if (sTermnm == "")
  326. {
  327. var msg = "한글 주호소가";
  328. if (charflag == "E")
  329. {
  330. msg = "영문 주호소가";
  331. }
  332. messageBox(msg, "I004");
  333. return;
  334. }
  335. model.makeValue("/root/main/cccdinfo/cccd[" + grd_cccd.Row + "]/cctermnm", sTermnm);
  336. model.makeValue("/root/main/cccdinfo/cccd[" + grd_cccd.Row + "]/charflag", charflag);
  337. model.refresh();
  338. model.makeValue("/root/send/ccset", grd_cccd.getUpdateData());
  339. model.setValue("/root/main/cccdinfo/cccd[" + grd_cccd.Row + "]/boolflag", "false");
  340. grd_cccd.removeStatus(grd_cccd.row, "update");
  341. }
  342. model.makeValue("/root/send/flag", "insert");
  343. submit("TXMRF04201");
  344. model.refresh();
  345. }
  346. /**
  347. * @desc : 개인주호소 추가(선택)
  348. * @
  349. * @param :
  350. * @return :
  351. * @---------------------------------------------------
  352. */
  353. function fSetSelCCfavor()
  354. {
  355. var sTermcd = model.getValue("/root/main/selectdiaglist/selectdiaglist[" + grd_selectdiag.Row + "]/termcd");
  356. var sTermnm = model.getValue("/root/main/selectdiaglist/selectdiaglist[" + grd_selectdiag.Row + "]/termengnm");
  357. model.removeNodeset("/root/send");
  358. model.removeNodeset("/root/hidden/tmpsend");
  359. model.refresh();
  360. if (sTermcd != "") //용어코드가 있을 경우 한/영구분
  361. {
  362. var charflag = "E";
  363. for(var i = 0; i <= sTermnm.length; i++)
  364. {
  365. if(sTermnm.charCodeAt(i) > 255)
  366. {
  367. charflag = "H";
  368. break;
  369. }
  370. }
  371. model.makeValue("/root/hidden/tmpsend/m", "u");
  372. model.makeValue("/root/hidden/tmpsend/termcd", sTermcd);
  373. model.makeValue("/root/hidden/tmpsend/cctermnm", sTermnm);
  374. model.makeValue("/root/hidden/tmpsend/charflag", charflag);
  375. }
  376. else
  377. {
  378. model.makeValue("/root/hidden/tmpsend/m", "u");
  379. model.makeValue("/root/hidden/tmpsend/termcd", "-");
  380. model.makeValue("/root/hidden/tmpsend/cctermnm", sTermnm);
  381. model.makeValue("/root/hidden/tmpsend/charflag", "");
  382. }
  383. var nodelist = model.instances(0).selectNodes("/root/hidden/tmpsend");
  384. var cccinfo = getNodeListCSV(nodelist);
  385. model.makeValue("/root/send/ccset", cccinfo);
  386. model.makeValue("/root/send/flag", "insert");
  387. submit("TXMRF04201");
  388. }
  389. /**
  390. * @desc : 체크 해제시 상태 초기화
  391. * @
  392. * @param :
  393. * @return :
  394. * @---------------------------------------------------
  395. */
  396. function fCheckChange()
  397. {
  398. if ((grd_cccd.valueMatrix ( grd_cccd.row, 0) == "false" || (grd_cccd.valueMatrix ( grd_cccd.row, 0) == "")) && grd_cccd.col == "0" ) {
  399. grd_cccd.removeStatus(grd_cccd.row, "update");
  400. }
  401. }
  402. /**
  403. * @desc : 개인주호소 더블클릭
  404. * @
  405. * @param :이창록 수정(주호소 한글명 추가)2008.6.16
  406. * @return :
  407. * @---------------------------------------------------
  408. */
  409. function fCcsetdbClick(iRow)
  410. {
  411. var sTermcd = model.getValue("/root/main/cclist/ccset[" + iRow + "]/cctermcd");
  412. var sTermengnm = model.getValue("/root/main/cclist/ccset[" + iRow + "]/cctermnm");
  413. //var sTermhngnm = model.getValue("/root/main/cclist/ccset[" + iRow + "]/cctermnm");
  414. var iFndRow = grd_selectdiag.findRow(sTermengnm, 1, 1, "true", "true");
  415. if(iFndRow < 0 && sTermengnm !=""){
  416. grd_selectdiag.addRow(false);
  417. iCurRow = grd_selectdiag.row;
  418. model.makeValue("/root/main/selectdiaglist/selectdiaglist[" + iCurRow + "]/termcd" , sTermcd);
  419. model.makeValue("/root/main/selectdiaglist/selectdiaglist[" + iCurRow + "]/termengnm", sTermengnm);
  420. model.makeValue("/root/main/selectdiaglist/selectdiaglist[" + iCurRow + "]/termhngnm", sTermengnm);
  421. }
  422. model.refresh();
  423. }
  424. /**
  425. * @desc : 순서이동
  426. * @
  427. * @param :
  428. * @return :
  429. * @---------------------------------------------------
  430. */
  431. function fMoveUp()
  432. {
  433. var iRow = grd_ccset.row;
  434. if (iRow != 1){
  435. model.makeValue("root/hidden/temp", "");
  436. model.makeValue("root/hidden/seq", "");
  437. var oldseq = model.getValue("/root/main/cclist/ccset[" + iRow + "]/sortno");
  438. var newseq = model.getValue("/root/main/cclist/ccset[" + (iRow - 1) + "]/sortno");
  439. model.copyNode("root/hidden/temp", "/root/main/cclist/ccset[" + iRow + "]");
  440. model.copyNode("/root/main/cclist/ccset[" + iRow + "]", "/root/main/cclist/ccset[" + (iRow - 1) + "]");
  441. model.copyNode("/root/main/cclist/ccset[" + (iRow - 1) + "]", "root/hidden/temp");
  442. model.setValue("/root/main/cclist/ccset[" + iRow + "]/sortno", oldseq);
  443. model.setValue("/root/main/cclist/ccset[" + (iRow - 1) + "]/sortno", newseq);
  444. model.removeNodeset("root/hidden/temp");
  445. grd_ccset.row = (iRow - 1);
  446. grd_ccset.col = 1;
  447. grd_ccset.addStatus(grd_ccset.row, "update");
  448. grd_ccset.addStatus(grd_ccset.row + 1, "update");
  449. model.refresh();
  450. }
  451. }
  452. /**
  453. * @desc : 순서이동
  454. * @
  455. * @param :
  456. * @return :
  457. * @---------------------------------------------------
  458. */
  459. function fMoveDown()
  460. {
  461. var iRow = grd_ccset.row;
  462. var iRows = grd_ccset.rows;
  463. if (iRow != (iRows - 1)){
  464. model.makeValue("root/hidden/temp", "");
  465. model.makeValue("root/hidden/seq", "");
  466. var oldseq = model.getValue("/root/main/cclist/ccset[" + iRow + "]/sortno");
  467. var newseq = model.getValue("/root/main/cclist/ccset[" + (iRow + 1) + "]/sortno");
  468. model.copyNode("root/hidden/temp", "/root/main/cclist/ccset[" + iRow + "]");
  469. model.copyNode("/root/main/cclist/ccset[" + iRow + "]", "/root/main/cclist/ccset[" + (iRow + 1) + "]");
  470. model.copyNode("/root/main/cclist/ccset[" + (iRow + 1) + "]", "root/hidden/temp");
  471. model.setValue("/root/main/cclist/ccset[" + iRow + "]/sortno", oldseq);
  472. model.setValue("/root/main/cclist/ccset[" + (iRow + 1) + "]/sortno", newseq);
  473. model.removeNodeset("root/hidden/temp");
  474. grd_ccset.row = (iRow + 1);
  475. grd_ccset.col = 1;
  476. grd_ccset.addStatus(grd_ccset.row, "update");
  477. grd_ccset.addStatus(grd_ccset.row - 1, "update");
  478. model.refresh();
  479. }
  480. }
  481. /**
  482. * @desc : 개인주호소 삭제
  483. * @
  484. * @param :
  485. * @return :
  486. * @---------------------------------------------------
  487. */
  488. function fDelCcset()
  489. {
  490. //var iRow = grd_ccset.row;
  491. //grd_ccset.addStatus(grd_ccset.row, "delete");
  492. var iRow = grd_ccset.selectedRows;
  493. for (var i = 0; i < iRow; i++)
  494. {
  495. grd_ccset.addStatus(grd_ccset.selectedRow(i), "delete");
  496. }
  497. }
  498. /**
  499. * @desc : 개인주호소 수정사항 저장
  500. * @
  501. * @param :
  502. * @return :
  503. * @---------------------------------------------------
  504. */
  505. function fSave()
  506. {
  507. model.makeValue("/root/send/ccset", grd_ccset.getUpdateData());
  508. model.makeValue("/root/send/flag", "update");
  509. if(submit("TXMRF04201"))
  510. {
  511. grd_ccset.clearStatus();
  512. }
  513. }