SMMRT00700.js 73 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591
  1. /**
  2. * @group :
  3. * @ver : 2008.03.19
  4. * @by : 나종천
  5. * @---------------------------------------------------
  6. * @type : function
  7. * @access : public
  8. * @desc : 화면을 초기화 한다
  9. * @param :
  10. * @return :
  11. * @---------------------------------------------------
  12. */
  13. function fInitalize(){
  14. grd_termlist.colHidden(1) = true;
  15. var currentTime = getCurrentTime();
  16. var instcd = getUserInfo("dutplceinstcd");
  17. // Edited by NJ 2007-07-21 getDate() -> getCurrentDate()
  18. //model.setValue("/root/init/today", getDate());
  19. model.setValue("/root/init/today", getCurrentDate());
  20. model.setValue("/root/init/curruntTime", currentTime.substr(0,4));
  21. model.setValue("/root/hidden/condition/selctedmode", "D");
  22. model.setValue("/root/init/userinfo/userid", getUserId());
  23. model.setValue("/root/init/userinfo/usernm", getUserName());
  24. model.setValue("/root/init/userinfo/instcd", getUserInfo("dutplceinstcd"));
  25. //2009-05-06 오전 9:55:28 강지훈 수정 : 선택할수있는 기관을 공통코드로 관리한다.
  26. zbcfGetCodeList( new Array("M0534"), new Array("/root/init/M0534list") ); //화면하단의 사용되는 기관 CheckBox instance 초기화
  27. copyNodeset("/root/init/M0534selcmb", "/root/init/M0534list", "replace");//중앙의료원일때 보이는 기관선택 Combo Instance 초기화
  28. copyNodeset("/root/init/M0534allcmb", "/root/init/M0534list", "replace");//기관별이력조회의 Combo Instance 초기화
  29. addComboInstance("/root/init/M0534selcmb", "cdid^cdnm", "001^전체", "M0534");
  30. addComboInstance("/root/init/M0534allcmb", "cdid^cdnm", "-^전체", "M0534");
  31. //2009-03-12 오전 10:59:38 강지훈 수정 : 접속 기관별 보여지는 항목이 다르다.
  32. //maininstyn : 중앙관리자여부, selInstcd : 선택기관코드
  33. if(instcd == "001"){ //중앙의료원에서 접속할경우
  34. model.setValue("/root/hidden/condition/maininstyn", "Y");
  35. cap_selInst.visible = true;
  36. cmb_selInst.visible = true;
  37. cmb_selInst.value = "001";
  38. cap_selInst.refresh();
  39. btn_saverow.disabled = true;
  40. }
  41. else{
  42. model.setValue("/root/hidden/condition/maininstyn", "N");
  43. model.setValue("/root/hidden/condition/selInstcd", instcd);
  44. }
  45. model.makeValue("/root/send/mode", model.getValue("/root/hidden/condition/indxviewmode"));
  46. model.makeValue("/root/send/indxflag", model.getValue("/root/hidden/condition/indxflag"));
  47. submit("TRMRT00701");
  48. model.refresh();
  49. }
  50. /**
  51. * @group :
  52. * @ver : 2007.03.20
  53. * @by : 이은영
  54. * @---------------------------------------------------
  55. * @type : function
  56. * @access : public
  57. * @desc : 버튼 Enable / Disable
  58. * @param :
  59. * @return :
  60. * @---------------------------------------------------
  61. */
  62. function fDisabled(flag) {
  63. var maininstyn = model.getValue("/root/hidden/condition/maininstyn");
  64. if(flag == "ETN" || flag == "ETM") {
  65. cmb_icd9cd.disabled = "false";
  66. if(flag == "ETM"){
  67. ipt_opattrcd.disabled = "true";
  68. btn_opattrcd.disabled = "true";
  69. ipt_termcd.disabled = "true";
  70. ipt_snmdcnptid.disabled = "false";
  71. ipt_termtodd.disabled = "true";
  72. if(maininstyn == "Y"){
  73. rdo_essntermflag.disabled = "false";
  74. }
  75. } else {
  76. ipt_opattrcd.disabled = "true";
  77. btn_opattrcd.disabled = "true";
  78. ipt_termcd.disabled = "true";
  79. ipt_snmdcnptid.disabled = "false";
  80. ipt_termtodd.disabled = "false";
  81. opt_Hdicd9cd.visible = "false";
  82. cmb_icd9cd.visible = "true";
  83. btn_delete2.disabled = "true";
  84. if(maininstyn == "Y"){
  85. cap_appinst.disabled = "false";
  86. chk_appinst.disabled = "false";
  87. rdo_essntermflag.disabled = "false";
  88. }
  89. }
  90. //btn_snmddescid.disabled = "false";
  91. ipt_termfromdd.disabled = "false";
  92. ipt_engnm.disabled = "false";
  93. ipt_hngnm.disabled = "false";
  94. cmb_reprflag.disabled = "false";
  95. //ipt_verflag.disabled = "false";
  96. btn_medreccd.disabled = "false";
  97. cmb_version.disabled = "false";
  98. ipt_calcscor.disabled = "false";
  99. } else if(flag == "TN" || flag == "TM") {
  100. ipt_opattrcd.disabled = "true";
  101. btn_opattrcd.disabled = "true";
  102. ipt_termcd.disabled = "true";
  103. cmb_reprflag.disabled = "false";
  104. ipt_engnm.disabled = "false";
  105. ipt_hngnm.disabled = "false";
  106. ipt_termfromdd.disabled = "false";
  107. ipt_termtodd.disabled = "false";
  108. cmb_version.disabled = "true";
  109. ipt_snmdcnptid.disabled = "false"; // 동의어 일때도 conceptid 등록 가능
  110. chk_appinst.disabled = "true";
  111. rdo_essntermflag.disabled = "true";
  112. //btn_snmdcnptid.disabled = "true";
  113. } else if(flag == "AS") {
  114. //??? ?? ??
  115. cmb_icd9cd.disabled = "true";
  116. ipt_opattrcd.disabled = "true";
  117. btn_opattrcd.disabled = "true";
  118. ipt_termcd.disabled = "true";
  119. ipt_snmdcnptid.disabled = "true";
  120. btn_snmdcnptid.disabled = "true";
  121. //btn_snmddescid.disabled = "true";
  122. ipt_engnm.disabled = "true";
  123. ipt_hngnm.disabled = "true";
  124. cmb_reprflag.disabled = "true";
  125. //ipt_verflag.disabled = "true";
  126. btn_medreccd.disabled = "true";
  127. ipt_termfromdd.disabled = "true";
  128. ipt_termtodd.disabled = "true";
  129. ipt_calcscor.disabled = "true";
  130. cmb_version.disabled = "true";
  131. chk_appinst.disabled = "true";
  132. rdo_essntermflag.disabled = "true";
  133. }
  134. }
  135. function fCntlReset(flag) {
  136. if(flag == "TN"){
  137. model.resetInstanceNode("/root/main/peprterminfo/info/termengnm");
  138. model.resetInstanceNode("/root/main/peprterminfo/info/termhngnm");
  139. model.resetInstanceNode("/root/main/peprterminfo/info/reprflag");
  140. }
  141. if((flag == "ETN") || (flag == "SAVE")){
  142. model.resetInstanceNode("/root/main/peprterminfo/info/snmdcnptid");
  143. model.resetInstanceNode("/root/main/peprterminfo/info/snmdcnptnm");
  144. model.resetInstanceNode("/root/main/peprterminfo/info/calcscorcd");
  145. model.resetInstanceNode("/root/main/peprterminfo/info/opattrverflag");
  146. model.resetInstanceNode("/root/main/peprterminfo/info/icd9cd");
  147. model.resetInstanceNode("/root/main/icd9cdlist/info");
  148. model.resetInstanceNode("/root/main/peprterminfo/info/opattrcd");
  149. model.resetInstanceNode("/root/main/peprterminfo/info/termcd");
  150. model.resetInstanceNode("/root/main/peprterminfo/info/opattrmedireccd");
  151. model.resetInstanceNode("/root/main/peprterminfo/info/termengnm");
  152. model.resetInstanceNode("/root/main/peprterminfo/info/termhngnm");
  153. model.resetInstanceNode("/root/main/peprterminfo/info/reprflag");
  154. model.resetInstanceNode("/root/main/peprterminfo/info/attrfromdd");
  155. model.resetInstanceNode("/root/main/peprterminfo/info/icdfromdd");
  156. }
  157. }
  158. function fAddRow(flag) {
  159. var iRow = 0;
  160. var currentTime = getCurrentTime();
  161. if(flag == "I") {
  162. grd_icd9.addItem();
  163. iRow = grd_icd9.row - grd_icd9.fixedRows + 1;
  164. model.setValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/state", "I");
  165. model.setValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/icd9todd", "99991231");
  166. model.setValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/icd9fromdd", model.getValue("/root/init/today"));
  167. model.setValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/fstrgstdt", model.getValue("/root/init/today") + currentTime.substr(0,6));
  168. model.setValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/lastupdtdt", model.getValue("/root/init/today") + currentTime.substr(0,6));
  169. model.setValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/fstrgstrid", model.getValue("/root/init/userinfo/userid"));
  170. model.setValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/lastupdtrid", model.getValue("/root/init/userinfo/userid"));
  171. } else if(flag == "D") {
  172. grd_opcd.addItem();
  173. iRow = grd_opcd.row - grd_opcd.fixedRows + 1;
  174. model.setValue("/root/main/opcdinfo/opcd[" + iRow + "]/state", "I" );
  175. model.setValue("/root/main/opcdinfo/opcd[" + iRow + "]/opattrtodt", "99991231235959");
  176. }
  177. }
  178. /**
  179. * @group :
  180. * @ver : 2007.04.11
  181. * @by : 이은영
  182. * @---------------------------------------------------
  183. * @type : function
  184. * @access : public
  185. * @desc : 부서선택
  186. * @param :
  187. * @return :
  188. * @---------------------------------------------------
  189. */
  190. function fCallDeptInfo(){
  191. var xCondPath = "/root/hidden/condition";
  192. model.removenodeset("/root/main/indxlist/item");
  193. model.removenodeset("/root/main/deptopcdlist/deptopcdinfo");
  194. trv_dgindx.rebuild();
  195. grd_deptop.rebuild();
  196. zbcfOpenInstDeptCodeList("deptnm", model.getValue(xCondPath+"/deptset/selecteddeptnm"), xCondPath+"/deptset/selecteddeptcd", xCondPath+"/deptset/selecteddeptnm", "ordduseryn", "");
  197. if(model.getValue(xCondPath+"/deptset/selecteddeptcd") != ""){
  198. model.removenode("/root/send");
  199. model.makeValue("/root/send/indxflag", model.getValue("/root/hidden/condition/indxflag"));
  200. model.makeValue("/root/send/deptcd", model.getValue("/root/hidden/condition/deptset/selecteddeptcd"));
  201. if(submit("TRMRT00710")){
  202. model.removenodeset("/root/main/deptopcdlist/deptopcdinfo");
  203. model.setValue(xCondPath+"/selectedIndx","");
  204. grd_deptop.rebuild();
  205. trv_dgindx.rebuild();
  206. }
  207. }else{
  208. model.refresh();
  209. }
  210. }
  211. /**
  212. * @group :
  213. * @ver : 2007.04.11
  214. * @by : 이은영
  215. * @---------------------------------------------------
  216. * @type : function
  217. * @access : public
  218. * @desc : 과수술 용어 조회
  219. * @param :
  220. * @return :
  221. * @---------------------------------------------------
  222. */
  223. function fSrchDeptOpInfo(){
  224. var xCondPath = "/root/hidden/condition";
  225. var sIndxCd = model.getValue(xCondPath+"/selectedIndx");
  226. var sDeptCd = model.getValue(xCondPath+"/deptset/selecteddeptcd");
  227. if(sDeptCd == ""){
  228. messageBox("부서코드를 먼저", "C002");
  229. return;
  230. }
  231. if(sIndxCd == ""){
  232. messageBox("색인코드를 먼저", "C002");
  233. return;
  234. }
  235. model.removeNodeset("/root/send");
  236. model.makeValue("/root/send/indxcd", sIndxCd);
  237. model.makeValue("/root/send/indxflag", model.getValue(xCondPath+"/indxflag"));
  238. model.makeValue("/root/send/deptcd", sDeptCd);
  239. submit("TRMRT00711");
  240. }
  241. /**
  242. * @group :
  243. * @ver : 2007.04.12
  244. * @by : 이은영
  245. * @---------------------------------------------------
  246. * @type : function
  247. * @access : public
  248. * @desc : 과수술 용어 저장
  249. * @param :
  250. * @return :
  251. * @---------------------------------------------------
  252. */
  253. function fSaveDeptOpInfo(){
  254. var xCondPath = "/root/hidden/condition";
  255. var sSelIndxCd = model.getValue(xCondPath+"/selectedIndx");
  256. model.removenode("/root/send");
  257. model.makeValue("/root/send/indxcd", sSelIndxCd);
  258. model.makeValue("/root/send/indxflag", model.getValue("/root/hidden/condition/indxflag"));
  259. model.makeValue("/root/send/deptcd", model.getValue(xCondPath+"/deptset/selecteddeptcd"));
  260. model.makeValue("/root/send/deptopcdlist", grd_deptop.getUpdateDataAll("i"));
  261. submit("TXMRT00702");
  262. }
  263. /**
  264. * @group :
  265. * @ver : 2007.04.12
  266. * @by : 이은영
  267. * @---------------------------------------------------
  268. * @type : function
  269. * @access : public
  270. * @desc : 과수술에 수술 추가
  271. * @param :
  272. * @return :
  273. * @---------------------------------------------------
  274. */
  275. function fSendDeptOp(){
  276. var sCondPath = "/root/hidden/condition/deptset";
  277. var sIndxListPath = "/root/main/indxlist/item";
  278. var sSrchedOpCdListPath = "/root/main/srchedopcdlist/srchedopcdinfo";
  279. var sDeptOpCdListPath = "/root/main/deptopcdlist/deptopcdinfo";
  280. var sDeptCd = model.getValue(sCondPath+"/selecteddeptcd");
  281. var sIndxCd = model.getValue("/root/hidden/condition/selectedIndx");
  282. var sIndxNm = model.getValue("/root/main/indxlist/item[indxcd='"+sIndxCd+"']/indxhngnm");;
  283. var sSrchedOpRowCnt = grd_srchedopinfo.rows - grd_srchedopinfo.fixedrows;
  284. var iDeptOpRow = 0;
  285. var sTermcd = "";
  286. if(sDeptCd == ""){
  287. messageBox("부서코드를 먼저", "C002");
  288. return;
  289. }
  290. if(sIndxCd == ""){
  291. messageBox("색인코드를 먼저", "C002");
  292. return;
  293. }
  294. for(var iSrchedOpRow = 1; iSrchedOpRow <= sSrchedOpRowCnt; iSrchedOpRow++){
  295. if(model.getValue(sSrchedOpCdListPath+"["+iSrchedOpRow+"]/check") == "true"){
  296. sTermcd = model.getValue(sSrchedOpCdListPath+"["+iSrchedOpRow+"]/termcd");
  297. if(model.getValue(sDeptOpCdListPath+"[termcd = '"+sTermcd+"' and deptindxcd = '"+sIndxCd+"']/termcd") != "") continue;
  298. grd_deptop.addItem();
  299. iDeptOpRow = grd_deptop.rows - grd_deptop.fixedrows;
  300. model.setValue(sDeptOpCdListPath+"["+iDeptOpRow+"]/status","I");
  301. model.setValue(sDeptOpCdListPath+"["+iDeptOpRow+"]/deptcd",sDeptCd);
  302. model.setValue(sDeptOpCdListPath+"["+iDeptOpRow+"]/deptnm",model.getValue(sCondPath+"/selecteddeptnm"));
  303. model.setValue(sDeptOpCdListPath+"["+iDeptOpRow+"]/termcd",sTermcd);
  304. model.setValue(sDeptOpCdListPath+"["+iDeptOpRow+"]/deptindxcd",sIndxCd);
  305. model.setValue(sDeptOpCdListPath+"["+iDeptOpRow+"]/deptindxnm",sIndxNm);
  306. model.setValue(sDeptOpCdListPath+"["+iDeptOpRow+"]/termengnm",model.getValue(sSrchedOpCdListPath+"["+iSrchedOpRow+"]/termengnm"));
  307. model.setValue(sDeptOpCdListPath+"["+iDeptOpRow+"]/termhngnm",model.getValue(sSrchedOpCdListPath+"["+iSrchedOpRow+"]/termhngnm"));
  308. model.setValue(sDeptOpCdListPath+"["+iDeptOpRow+"]/deptindxflag",model.getValue("/root/hidden/condition/indxflag"));
  309. }
  310. }
  311. grd_deptop.rebuild();
  312. }
  313. /**
  314. * @group :
  315. * @ver : 2007.04.12
  316. * @by : 이은영
  317. * @---------------------------------------------------
  318. * @type : function
  319. * @access : public
  320. * @desc : 과수술 추가시 수술 용어 조회
  321. * @param :
  322. * @return :
  323. * @---------------------------------------------------
  324. */
  325. function fSrchOpInfo(){
  326. var sCondPath = "/root/hidden/condition/deptset";
  327. var sSrchedOpCdInfoPath = "/root/main/srchedopcdlist/srchedopcdinfo";
  328. var srchnm = model.getValue(sCondPath+"/srchnm");
  329. srchnm = srchnm.replace(/^ *| *$/g, "");
  330. model.removenode("/root/send");
  331. if(model.getValue(sCondPath+"/srchnm") == ""){
  332. messageBox("조회할 내용을","C001");
  333. return;
  334. }
  335. model.removenodeset(sSrchedOpCdInfoPath);
  336. grd_srchedopinfo.rebuild();
  337. model.makeValue("/root/send/srchflag", model.getValue(sCondPath+"/srchflag")); //
  338. model.makeValue("/root/send/srchnm", srchnm); // ??????
  339. model.makeValue("/root/send/termflag",model.getValue("/root/hidden/condition/indxflag")); // ????????
  340. submit("TRMRT00712");
  341. }
  342. /**
  343. * @group :
  344. * @ver : 2007.04.16
  345. * @by : 이은영
  346. * @---------------------------------------------------
  347. * @type : function
  348. * @access : public
  349. * @desc : 전체수술조회 팝업 호출
  350. * @param :
  351. * @return :
  352. * @---------------------------------------------------
  353. */
  354. function fCallExtnOpInfo(){
  355. setParameter("indxflag", model.getValue("/root/hidden/condition/indxflag"));
  356. modal("SPMRT01000", 1,10,10);
  357. }
  358. /**
  359. * @group :
  360. * @ver : 2008.03.19
  361. * @by : 나종천
  362. * @---------------------------------------------------
  363. * @type : function
  364. * @access : public
  365. * @desc : 수가 조회 화면 호출
  366. * @param :
  367. * @return :
  368. * @---------------------------------------------------
  369. */
  370. function fGetCalcScor(){
  371. model.removeNodeset("/root/temp");
  372. model.makeValue("/root/temp", model.getValue("/root/main/peprterminfo/info/calcscorcd"));
  373. modal("SMPIC00200", 1,10, 10, "SMPIC00200", "/root/temp", "/root/temp");
  374. model.setValue("/root/main/peprterminfo/info/calcscorcd", model.getValue("/root/temp/mech/calcscorcd"));
  375. ipt_calcscor.refresh();
  376. }
  377. /**
  378. * @group :
  379. * @ver : 2008.03.19
  380. * @by : 나종천
  381. * @---------------------------------------------------
  382. * @type : function
  383. * @access : public
  384. * @desc : 수술 용어 리스트를 조회
  385. * @param :
  386. * @return :
  387. * @---------------------------------------------------
  388. */
  389. function fSelOpList(){
  390. btn_addrow.attribute("visibility") = "hidden";
  391. btn_delrow.attribute("visibility") = "hidden";
  392. btn_saverow.attribute("visibility") = "visible";
  393. btn_modify.attribute("visibility") = "hidden";
  394. model.setValue("/root/hidden/condition/selctedmode", "D");
  395. model.makeValue("/root/send/mode", model.getValue("/root/hidden/condition/indxviewmode"));
  396. model.makeValue("/root/send/indxflag", model.getValue("/root/hidden/condition/indxflag"));
  397. submit("TRMRT00701");
  398. model.refresh();
  399. }
  400. /**
  401. * @group :
  402. * @ver : 2008.03.19
  403. * @by : 나종천
  404. * @---------------------------------------------------
  405. * @type : function
  406. * @access : public
  407. * @desc : 과수술 선택
  408. * @param :
  409. * @return :
  410. * @---------------------------------------------------
  411. */
  412. function fSelDeptOp(){
  413. btn_addrow.attribute("visibility") = "hidden";
  414. btn_delrow.attribute("visibility") = "hidden";
  415. btn_saverow.attribute("visibility") = "hidden";
  416. btn_modify.attribute("visibility") = "hidden";
  417. model.setValue("/root/hidden/condition/deptset/srchflag","H");
  418. model.setValue("/root/hidden/condition/deptset/srchnm","");
  419. model.setValue("/root/hidden/condition/deptset/selecteddeptcd","");
  420. model.setValue("/root/hidden/condition/deptset/selecteddeptnm","");
  421. model.setValue("/root/hidden/condition/selctedmode", "P");
  422. model.setValue("/root/hidden/condition/indxflag", "9"); // 진단 : 0, 수술 : 9
  423. model.removenodeset("/root/main/indxlist/item");
  424. model.removenodeset("/root/main/srchedopcdlist/srchedopcdinfo");
  425. model.removenodeset("/root/main/deptopcdlist/deptopcdinfo");
  426. model.refresh();
  427. }
  428. /**
  429. * @group :
  430. * @ver : 2008.03.19
  431. * @by : 나종천
  432. * @---------------------------------------------------
  433. * @type : function
  434. * @access : public
  435. * @desc : 수술 용어 신규 등록시 확장코드 생성
  436. * @param :
  437. * @return :
  438. * @---------------------------------------------------
  439. */
  440. function fGetNewExtCd(){
  441. //ICD9코드 선택 시, 새로운 확장, 용어코드 및 ICD시작일자 함께 조회
  442. var iCd = cmb_icd9cd.focusIndex + 1;
  443. var selCd = model.getValue("/root/main/icd9cdlist/info[" + iCd + "]/icd9cd");
  444. // var iSelCd = selCd.substr(0,2) + "." + selCd.substr(2, selCd.length-2);
  445. // Edited by Nj 2007-08-07 IDC9코드의 '.'을 삭제하기로함
  446. var iSelCd = selCd;
  447. var path = model.getValue("/root/hidden/condition/selectedIndxPath"); //인덱스코드.속성코드.용어코드
  448. model.removeNodeset("/root/send");
  449. model.removeNodeset("/root/main/temp");
  450. model.makeValue("/root/send/icd9cd", iSelCd);
  451. model.setValue("/root/hidden/condition/selectedicd9", iSelCd);
  452. model.makeNode("/root/main/temp/icd9info");
  453. submit("TRMRT00707");
  454. model.setValue("/root/main/peprterminfo/info/icd9cd", selCd);
  455. model.setValue("/root/main/peprterminfo/info/opattrcd", model.getValue("/root/main/temp/icd9info/opattrcd"));
  456. model.setValue("/root/main/peprterminfo/info/termcd", model.getValue("/root/main/temp/icd9info/termcd"));
  457. var path = model.getValue("/root/hidden/condition/selectedIndxPath").split(".");
  458. model.setValue("/root/main/peprterminfo/info/opattrdrindxcd", path[path.length-2]);
  459. if(model.getValue("/root/main/temp/icd9info/opattrmedireccd") == ""){
  460. model.setValue("/root/main/peprterminfo/info/opattrmedireccd", model.getValue("/root/main/peprterminfo/info/opattrdrindxcd"));
  461. } else {
  462. model.setValue("/root/main/peprterminfo/info/opattrmedireccd", model.getValue("/root/main/temp/icd9info/opattrmedireccd"));
  463. }
  464. model.setValue("/root/main/peprterminfo/info/icdfromdd", model.getValue("/root/main/temp/icd9info/icdfromdd"));
  465. // Edited by NJ 2007-07-21 getDate()- > getCurrentDate()
  466. //model.setValue("/root/main/peprterminfo/info/attrfromdd", getDate());
  467. model.setValue("/root/main/peprterminfo/info/attrfromdd", getCurrentDate());
  468. model.setValue("/root/main/peprterminfo/info/attrtodd", "99991231");
  469. model.setValue("/root/main/peprterminfo/info/reprflag", "R"); //신규모드일때에는 디폴트 R
  470. model.setValue("/root/main/peprterminfo/info/termflag", "9");
  471. model.setValue("/root/main/peprterminfo/info/fstrgstdate", model.getValue("/root/init/today"));
  472. model.setValue("/root/main/peprterminfo/info/fstrgsttime", model.getValue("/root/init/curruntTime"));
  473. model.setValue("/root/main/peprterminfo/info/fstrgstdt", model.getValue("/root/main/peprterminfo/info/fstrgstdate")+model.getValue("/root/main/peprterminfo/info/fstrgsttime")+"00");
  474. model.setValue("/root/main/peprterminfo/info/termfromdd", model.getValue("/root/init/today"));
  475. model.setValue("/root/main/peprterminfo/info/termtodd", "99991231");
  476. model.setValue("/root/main/peprterminfo/info/fstrgstrid", model.getValue("/root/init/userinfo/userid"));
  477. model.refresh();
  478. }
  479. /**
  480. * @group :
  481. * @ver : 2008.03.19
  482. * @by : 나종천
  483. * @---------------------------------------------------
  484. * @type : function
  485. * @access : public
  486. * @desc : 동의어 리스트에서 선택
  487. * @param :
  488. * @return :
  489. * @---------------------------------------------------
  490. */
  491. function fGetSynom(){
  492. var iRow = grd_termlist.row;
  493. var indx = model.getValue("/root/hidden/condition/selectedIndx");
  494. var path = model.getValue("/root/hidden/condition/selectedIndxPath");
  495. var term = model.getValue("/root/main/sametermlist/info[" + iRow + "]/termcd");
  496. model.setValue("/root/hidden/condition/selectedtermcd", term);
  497. opt_Hdicd9cd.visible = "true";
  498. cmb_icd9cd.visible = "false";
  499. btn_delete2.disabled = "false";
  500. fDisabled("AS");
  501. if( !isNull(iRow) ){
  502. model.setValue("/root/hidden/condition/status", "STM");
  503. //model.setValue("/root/main/peprterminfo/info/icd9cd", term.split(".")[0] + term.split(".")[1]); //icd9
  504. //model.setValue("/root/main/peprterminfo/info/opattrcd", term.split(".")[2]); // 확장코드
  505. //model.setValue("/root/main/peprterminfo/info/termcd", term.split(".")[3]); // 대표어(동의어)코드
  506. model.setValue("/root/main/peprterminfo/info/icd9cd", term.split(".")[0]); //icd9
  507. model.setValue("/root/main/peprterminfo/info/opattrcd", term.split(".")[1]); // 확장코드
  508. model.setValue("/root/main/peprterminfo/info/termcd", term.split(".")[2]); // 대표어(동의어)코드
  509. model.setValue("/root/main/peprterminfo/info/snmdcnptid", model.getValue("/root/main/sametermlist/info[" + iRow + "]/snmdcnptid")); // 스노메드-dscrpt
  510. model.setValue("/root/main/peprterminfo/info/snmdcnptnm", model.getValue("/root/main/sametermlist/info[" + iRow + "]/snmdcnptnm")); // 스노메드명
  511. model.setValue("/root/main/peprterminfo/info/calcscorcd", model.getValue("/root/main/sametermlist/info[" + iRow + "]/calcscorcd")); // 수가코드
  512. model.setValue("/root/main/peprterminfo/info/termengnm", model.getValue("/root/main/sametermlist/info[" + iRow + "]/termengnm")); // 영문
  513. model.setValue("/root/main/peprterminfo/info/termhngnm", model.getValue("/root/main/sametermlist/info[" + iRow + "]/termhngnm")); // 한글
  514. model.setValue("/root/main/peprterminfo/info/reprflag", model.getValue("/root/main/sametermlist/info[" + iRow + "]/reprflag")); // 대표어구분
  515. model.setValue("/root/main/peprterminfo/info/termflag", model.getValue("/root/main/sametermlist/info[" + iRow + "]/termflag")); // 용어구분
  516. model.setValue("/root/main/peprterminfo/info/fstrgstrid", model.getValue("/root/main/sametermlist/info[" + iRow + "]/lastupdtrnm"));
  517. //저장시 필요한 키값
  518. model.setValue("/root/main/peprterminfo/info/attrfromdd", model.getValue("/root/main/sametermlist/info[" + iRow + "]/attrfromdd"));
  519. model.setValue("/root/main/peprterminfo/info/attrtodd", model.getValue("/root/main/sametermlist/info[" + iRow + "]/attrtodd"));
  520. model.setValue("/root/main/peprterminfo/info/icdfromdd", model.getValue("/root/main/sametermlist/info[" + iRow + "]/icdfromdd"));
  521. model.setValue("/root/main/peprterminfo/info/alttermcd", model.getValue("/root/main/sametermlist/info[" + iRow + "]/alttermcd"));
  522. var fstrgstdt = model.getValue("/root/main/sametermlist/info[" + iRow + "]/fstrgstdt");
  523. var termfromdd = model.getValue("/root/main/sametermlist/info[" + iRow + "]/termfromdd");
  524. var termtodd = model.getValue("/root/main/sametermlist/info[" + iRow + "]/termtodd");
  525. model.setValue("/root/main/peprterminfo/info/fstrgstdt", fstrgstdt); // 등록일
  526. model.setValue("/root/main/peprterminfo/info/fstrgstdate", fstrgstdt.substr(0,8));
  527. model.setValue("/root/main/peprterminfo/info/fstrgsttime", fstrgstdt.substr(8,4));
  528. model.setValue("/root/main/peprterminfo/info/termfromdd", termfromdd); // 시작일
  529. model.setValue("/root/main/peprterminfo/info/termtodd", termtodd); // 종료일
  530. model.refresh();
  531. }
  532. }
  533. /**
  534. * @group :
  535. * @ver : 2008.03.19
  536. * @by : 나종천
  537. * @---------------------------------------------------
  538. * @type : function
  539. * @access : public
  540. * @desc : 수술용어 사용종료
  541. * @param :
  542. * @return :
  543. * @---------------------------------------------------
  544. */
  545. function fEndOpTerm(){
  546. var selTermcd = model.getValue("/root/hidden/condition/selectedtermcd");
  547. var selCd = model.getValue("/root/main/peprterminfo/info/icd9cd");
  548. // var insicd9cd = selCd.substr(0,2) + "." + selCd.substr(2, selCd.length-2);
  549. // Edited by Nj 2007-08-07 IDC9코드의 '.'을 삭제하기로 함
  550. var insicd9cd = selCd
  551. var insopattrcd = model.getValue("/root/main/peprterminfo/info/opattrcd");
  552. var insTermcd = model.getValue("/root/main/peprterminfo/info/termcd");
  553. var fullTermCode = insicd9cd + "." + insopattrcd + "." + insTermcd;
  554. var sRow = grd_termlist.rows - grd_termlist.fixedRows;
  555. if(insTermcd == "" || insTermcd == null){
  556. var rtn = messageBox("삭제할 수술용어 코드를 ", "C002");
  557. return;
  558. }
  559. //대표어일지라도 동의어/유사어가 없다면 삭제 가능함.
  560. if(model.getValue("/root/main/peprterminfo/info/reprflag") == "R" && sRow >= 1) {
  561. model.makeValue("/root/send/reqdata/termcd", fullTermCode);
  562. model.makeValue("/root/send/reqdata/opattrcd", insicd9cd + "." + insopattrcd);
  563. model.makeValue("/root/send/reqdata/termflag", model.getValue("/root/hidden/condition/indxflag"));
  564. if(submit("TRMRT00709")){
  565. var sametermyn = model.getValue("/root/hidden/exists/sametermyn");
  566. if(sametermyn == "Y"){
  567. var rtn = messageBox("대표어는 삭제 ", "E001");
  568. return;
  569. }
  570. } else {
  571. return;
  572. }
  573. }
  574. var rtn = messageBox("선택한 수술용어를", "Q001");
  575. if( rtn == "6") { //수술코드를 삭제하시겠습니까?
  576. var altmsg = messageBox("대체코드를", "Q014");
  577. if(altmsg == "6"){
  578. btn_altterm.disabled = "false";
  579. var ref1 = "/root/main/peprterminfo/info/alttermcd";
  580. var altflag = fCallTermSrch(ref1);
  581. btn_altterm.disabled = "true";
  582. if(!altflag){
  583. return;
  584. }
  585. }
  586. model.setValue("/root/hidden/condition/status", "TD");
  587. model.removeNodeset("/root/send/reqdata");
  588. model.makeValue("/root/send/reqdata/indxcd", model.getValue("/root/hidden/condition/selectedIndx"));
  589. model.makeValue("/root/send/reqdata/icd9cd", insicd9cd);
  590. model.makeValue("/root/send/reqdata/opattrcd", insicd9cd + "." + insopattrcd);
  591. model.makeValue("/root/send/reqdata/termcd", fullTermCode);
  592. model.makeValue("/root/send/reqdata/status", model.getValue("/root/hidden/condition/status")); //N:등록, M:수정, D:삭제
  593. model.makeValue("/root/send/reqdata/termflag", "9"); //용어구분
  594. model.makeValue("/root/send/reqdata/termfromdd", model.getValue("/root/main/peprterminfo/info/termfromdd"));
  595. model.makeValue("/root/send/reqdata/oldtermfromdd", model.getValue("/root/main/peprterminfo/info/termfromdd"));
  596. model.makeValue("/root/send/reqdata/attrfromdd", model.getValue("/root/main/peprterminfo/info/attrfromdd"));
  597. model.makeValue("/root/send/reqdata/oldattrfromdd", model.getValue("/root/main/peprterminfo/info/attrfromdd"));
  598. model.makeValue("/root/send/reqdata/alttermcd", model.getValue("/root/main/peprterminfo/info/alttermcd"));
  599. submit("TXMRT00701");
  600. } else if( rtn == "7") {
  601. return;
  602. }
  603. var iRow = grd_opcd.findRow(insicd9cd + "." + insopattrcd, 0, 4, true, true);
  604. grd_opcd.row = iRow;
  605. model.refresh();
  606. }
  607. /**
  608. * @group :
  609. * @ver : 2008.03.19
  610. * @by : 나종천
  611. * @---------------------------------------------------
  612. * @type : function
  613. * @access : public
  614. * @desc : 신규 용어 등록
  615. * @param :
  616. * @return :
  617. * @---------------------------------------------------
  618. */
  619. function fSetNewTerm(){
  620. var sIndx = model.getValue("/root/hidden/condition/selectedIndx");
  621. var fromdd = ((getCurrentDate()).toDate()).getAddDate(1);
  622. if(sIndx == "" || sIndx == null){
  623. var rtn = messageBox("색인을 ", "C002");
  624. return;
  625. }
  626. model.removeNodeset("/root/main/sametermlist/info"); // 신규버튼 클릭시 동의어 그리스 초기화
  627. fCntlReset("ETN");
  628. fDisabled("ETN");
  629. model.setValue("/root/hidden/condition/status", "ETN");
  630. model.removeNodeset("/root/send");
  631. model.makeValue("/root/send/indxcd",sIndx);
  632. model.makeValue("/root/send/indxflag",model.getValue("/root/hidden/condition/indxflag"));
  633. model.makeValue("/root/main/peprterminfo/info/reprflag", "");
  634. //선택한 인덱스에 해당하는 icd9코드를 가지고 온다..
  635. submit("TRMRT00706");
  636. // Edited by NJ 2007-07-21 getDate() -> getCurrentDate()
  637. //model.setValue("/root/main/peprterminfo/info/attrfromdd", getDate());
  638. model.setValue("/root/main/peprterminfo/info/termfromdd", fromdd.getDateFormat());
  639. model.setValue("/root/main/peprterminfo/info/termtodd", "99991231");
  640. model.setValue("/root/main/peprterminfo/info/attrfromdd", model.getValue("/root/main/peprterminfo/info/termfromdd"));
  641. model.setValue("/root/main/peprterminfo/info/attrtodd", model.getValue("/root/main/peprterminfo/info/termtodd"));
  642. model.setValue("/root/main/peprterminfo/info/fstrgstdate", getCurrentDate());
  643. model.setValue("/root/main/peprterminfo/info/fstrgsttime", getCurrentTime());
  644. model.setValue("/root/main/peprterminfo/info/fstrgstrid", getUserName());
  645. model.setValue("/root/main/peprterminfo/info/essntermflag", "N");
  646. model.refresh();
  647. }
  648. /**
  649. * @group :
  650. * @ver : 2008.03.19
  651. * @by : 나종천
  652. * @---------------------------------------------------
  653. * @type : function
  654. * @access : public
  655. * @desc : 동의어 등록
  656. * @param :
  657. * @return :
  658. * @---------------------------------------------------
  659. */
  660. function fSetInj(){
  661. //동의어 신규
  662. var jRow = grd_opcd.row;
  663. var term1 = model.getValue("/root/main/opcdinfo/opcd[" + jRow + "]/termcd"); //수술용어 그리드에서 선택한 term
  664. var opattr = model.getValue("/root/main/opcdinfo/opcd[" + jRow + "]/opattrcd"); //그리드에서 선택한 term
  665. var icd9cd = model.getValue("/root/main/opcdinfo/opcd[" + jRow + "]/icd9cd"); //그리드에서 선택한 term
  666. var indx = model.getValue("/root/hidden/condition/selectedIndx"); //트리에서 선택한 index
  667. var fromdd = ((getCurrentDate()).toDate()).getAddDate(1);
  668. if(term1 == "" || term1 == null){
  669. var rtn = messageBox("수술 용어를 ", "C002");
  670. return;
  671. }
  672. fDisabled("TN");
  673. opt_Hdicd9cd.visible = "true";
  674. cmb_icd9cd.visible = "false";
  675. btn_delete2.disabled = "true";
  676. fCntlReset("TN");
  677. model.setValue("/root/hidden/condition/status", "TN"); //term만 new
  678. model.removeNodeset("/root/send");
  679. model.removeNodeset("/root/main/temp");
  680. model.makeValue("/root/send/reqdata/reqdata/icd9cd", icd9cd);
  681. model.makeValue("/root/send/reqdata/reqdata/opattrcd", opattr);
  682. model.makeNode("/root/main/temp/info");
  683. submit("TRMRT00708");
  684. //Edited by nj 20071010 ICD9코드에서 .을 제거
  685. //icd9cd = icd9cd.substr(0,2) + icd9cd.substr(3, icd9cd.length-2);
  686. model.setValue("/root/main/peprterminfo/info/icd9cd", icd9cd);
  687. model.setValue("/root/main/peprterminfo/info/opattrcd", model.getValue("/root/main/temp/info/opattrcd").split(".")[1]);
  688. model.setValue("/root/main/peprterminfo/info/termcd", model.getValue("/root/main/temp/info/termcd"));
  689. model.setValue("/root/main/peprterminfo/info/reprflag", "");
  690. model.setValue("/root/main/peprterminfo/info/opattrmedireccd", model.getValue("/root/main/opcdinfo/opcd[" + jRow + "]/opattrmedireccd"));
  691. //model.setValue("/root/main/peprterminfo/info/opattrdrindxcd", model.getValue("/root/main/opcdinfo/opcd[" + jRow + "]/opattrmedireccd").split(".")[0]);
  692. var path = model.getValue("/root/hidden/condition/selectedIndxPath").split(".");
  693. model.setValue("/root/main/peprterminfo/info/opattrdrindxcd", path[path.length-2]);
  694. model.setValue("/root/main/peprterminfo/info/termflag", "9");
  695. model.setValue("/root/main/peprterminfo/info/fstrgstrid", model.getValue("/root/init/userinfo/userid"));
  696. model.setValue("/root/main/peprterminfo/info/termengnm", model.getValue("/root/main/opcdinfo/opcd[" + jRow + "]/termengnm"));
  697. model.setValue("/root/main/peprterminfo/info/termhngnm", model.getValue("/root/main/opcdinfo/opcd[" + jRow + "]/termhngnm"));
  698. model.makeValue("/root/main/peprterminfo/info/oldattrfromdd", model.getValue("/root/main/opcdinfo/opcd[" + jRow + "]/attrfromdd"));
  699. //신규 등록 모드는 디폴트를 설정
  700. model.setValue("/root/main/peprterminfo/info/fstrgstdate", model.getValue("/root/init/today"));
  701. model.setValue("/root/main/peprterminfo/info/fstrgsttime", model.getValue("/root/init/curruntTime"));
  702. model.setValue("/root/main/peprterminfo/info/fstrgstdt", model.getValue("/root/main/peprterminfo/info/fstrgstdate")+model.getValue("/root/main/peprterminfo/info/fstrgsttime")+"00");
  703. model.setValue("/root/main/peprterminfo/info/termfromdd", fromdd.getDateFormat());
  704. model.setValue("/root/main/peprterminfo/info/termtodd", "99991231");
  705. model.setValue("/root/main/peprterminfo/info/fstrgstrid", model.getValue("/root/init/userinfo/usernm"));
  706. model.refresh();
  707. }
  708. /**
  709. * @group :
  710. * @ver : 2008.03.19
  711. * @by : 나종천
  712. * @---------------------------------------------------
  713. * @type : function
  714. * @access : public
  715. * @desc : 용어 수정
  716. * @param :
  717. * @return :
  718. * @---------------------------------------------------
  719. */
  720. function fSetTermUpdt(){
  721. var selTermcd = model.getValue("/root/hidden/condition/selectedtermcd");
  722. var fromdd = ((getCurrentDate()).toDate()).getAddDate(1);
  723. if(selTermcd == "" || selTermcd == null){
  724. var rtn = messageBox("icd9 코드를 ", "C002");
  725. return;
  726. }
  727. // Edited by NJ 2007-07-21 getDate() -> getCurrentDate()
  728. //var today = getDate();
  729. var today = getCurrentDate();
  730. if(model.getValue("/root/main/peprterminfo/info/termfromdd") == today){
  731. var rtn = messageBox("당일 등록한 용어는 수정 ", "E001");
  732. return;
  733. }
  734. fDisabled("ETM");
  735. btn_delete2.disabled = "true";
  736. model.setValue("/root/hidden/condition/status", "ETM");
  737. model.makeValue("/root/main/peprterminfo/info/oldtermfromdd", model.getValue("/root/main/peprterminfo/info/termfromdd"));
  738. model.makeValue("/root/main/peprterminfo/info/oldattrfromdd", model.getValue("/root/main/peprterminfo/info/attrfromdd"));
  739. model.setValue("/root/main/peprterminfo/info/termfromdd", fromdd.getDateFormat());
  740. model.setValue("/root/main/peprterminfo/info/termtodd", "99991231");
  741. model.setValue("/root/main/peprterminfo/info/attrfromdd", model.getValue("/root/main/peprterminfo/info/termfromdd"));
  742. model.setValue("/root/main/peprterminfo/info/attrtodd", model.getValue("/root/main/peprterminfo/info/termtodd"));
  743. model.setValue("/root/main/peprterminfo/info/fstrgstdate", getCurrentDate());
  744. model.setValue("/root/main/peprterminfo/info/fstrgsttime", getCurrentTime());
  745. model.setValue("/root/main/peprterminfo/info/fstrgstrid", getUserName());
  746. model.refresh();
  747. }
  748. /**
  749. * @group :
  750. * @ver : 2008.03.19
  751. * @by : 나종천
  752. * @---------------------------------------------------
  753. * @type : function
  754. * @access : public
  755. * @desc : 수술용어 저장
  756. * @param :
  757. * @return :
  758. * @---------------------------------------------------
  759. */
  760. function fSaveOp(){
  761. var selCd = model.getValue("/root/main/peprterminfo/info/icd9cd");
  762. //var insicd9cd = selCd.substr(0,2) + "." + selCd.substr(2, selCd.length-2);
  763. // Edited by Nj 2007-08-07 IDC9코드의 '.'을 삭제하기로 함
  764. var insicd9cd = selCd;
  765. var insopattrcd = model.getValue("/root/main/peprterminfo/info/opattrcd");
  766. var insTermcd = model.getValue("/root/main/peprterminfo/info/termcd");
  767. var fullTermCode = insicd9cd + "." + insopattrcd + "." + insTermcd;
  768. var rowCnt = grd_opcd.row;
  769. var orgReprFlag = model.getValue("/root/main/opcdinfo/opcd[" + rowCnt + "]/reprflag"); //상단 그리드의 원래 대표어구분
  770. var chngReprFlag = model.getValue("/root/main/peprterminfo/info/reprflag"); //저장 전 선택한 대표어구분
  771. model.removeNodeset("/root/send");
  772. model.makeNode("/root/send/reqdata");
  773. model.copyNode("/root/send/reqdata", "/root/main/peprterminfo/info");
  774. model.setValue("/root/send/reqdata/icd9cd", insicd9cd);
  775. model.setValue("/root/send/reqdata/opattrcd", insicd9cd + "." + insopattrcd);
  776. model.setValue("/root/send/reqdata/termcd", fullTermCode);
  777. model.setValue("/root/send/reqdata/fstrgstdt", model.getValue("/root/main/peprterminfo/info/fstrgstdate") + model.getValue("/root/main/peprterminfo/info/fstrgsttime")+"00");
  778. model.setValue("/root/send/reqdata/termflag", "9"); //defalut :수술용어(9)
  779. model.makeValue("/root/send/reqdata/indxcd", model.getValue("/root/hidden/condition/selectedIndx"));
  780. model.makeValue("/root/send/reqdata/status", model.getValue("/root/hidden/condition/status")); //TN:용어만 등록, ETN:용어,속성함께등록,TM:용어만수정, EM:속성만수정,
  781. //ETM:용어,속성함께수정, 용어수정+대표어교환, ETM:속성수정+대표어교환, ETFM:용어,속성수정+대표어교환, FM:대표어만 교환
  782. model.makeValue("/root/send/reqdata/maininstyn", model.getValue("/root/hidden/condition/maininstyn"));
  783. model.makeValue("/root/send/reqdata/selInstcd", model.getValue("/root/hidden/condition/selInstcd"));
  784. if(model.getValue("/root/hidden/condition/status") == "ETN" || model.getValue("/root/hidden/condition/status") == "TN") {
  785. if(submit("TXMRT00701")){
  786. fCntlReset("SAVE");
  787. model.removeNodeset("/root/main/sametermlist");
  788. model.resetInstanceNode("/root/main/peprterminfo/info");
  789. model.refresh();
  790. }
  791. } else if( model.getValue("/root/hidden/condition/status") == "STM" ) {
  792. //오른쪽 그리드에서 정보를 선택했을 때
  793. var sRowCnt = grd_termlist.row;
  794. var OrgReprFlag2 = model.getValue("/root/main/sametermlist/info[" + sRowCnt + "]/reprflag");
  795. if(fullTermCode == model.getValue("/root/main/sametermlist/info[" + sRowCnt + "]/termcd")) {
  796. if(model.getValue("/root/main/sametermlist/info[" + sRowCnt + "]/termengnm") != model.getValue("/root/main/peprterminfo/info/termengnm") ||
  797. model.getValue("/root/main/sametermlist/info[" + sRowCnt + "]/termhngnm") != model.getValue("/root/main/peprterminfo/info/termhngnm") ||
  798. model.getValue("/root/main/sametermlist/info[" + sRowCnt + "]/termflag") != model.getValue("/root/main/peprterminfo/info/termflag")) {
  799. if( OrgReprFlag2 != chngReprFlag ){
  800. if( OrgReprFlag2 != "R" ) {
  801. //동의어나 유사어를 대표어로 수정하는 경우 (대표어구분코드를 맞교환)
  802. if( chngReprFlag != "R" )
  803. model.setValue("/root/send/reqdata/status", "TM");
  804. else {
  805. model.setValue("/root/send/reqdata/reprflag", OrgReprFlag2); //대표어구분을 교환하기 위해 원래 값을 다시 세팅한다.
  806. model.setValue("/root/send/reqdata/status", "TFM");
  807. }
  808. if(submit("TXMRT00701")){
  809. fCntlReset("SAVE");
  810. model.removeNodeset("/root/main/sametermlist");
  811. model.resetInstanceNode("/root/main/peprterminfo/info");
  812. model.refresh();
  813. }
  814. } else {
  815. var rtn = messageBox("대표어를 동의어나 유사어로 수정 ", "E001");
  816. return;
  817. //동의어를 대표어로 바꾸는 것만 허용
  818. }
  819. } else {
  820. model.setValue("/root/send/reqdata/status", "TM");
  821. if(submit("TXMRT00701")){
  822. fCntlReset("SAVE");
  823. model.removeNodeset("/root/main/sametermlist");
  824. model.resetInstanceNode("/root/main/peprterminfo/info");
  825. model.refresh();
  826. }
  827. }
  828. } else {
  829. var rtn = messageBox("변경된 내용이 없으므로 저장 ", "E001");
  830. return;
  831. }
  832. } else {
  833. var rtn = messageBox("신규입력 버튼을 ", "C002");
  834. return;
  835. }
  836. } else {
  837. if(fullTermCode == model.getValue("/root/main/opcdinfo/opcd[" + rowCnt + "]/termcd")) {
  838. // 용어명칭이 바뀐 경우
  839. if(model.getValue("/root/main/opcdinfo/opcd[" + rowCnt + "]/termengnm") != model.getValue("/root/main/peprterminfo/info/termengnm") ||
  840. model.getValue("/root/main/opcdinfo/opcd[" + rowCnt + "]/termhngnm") != model.getValue("/root/main/peprterminfo/info/termhngnm") ||
  841. model.getValue("/root/main/opcdinfo/opcd[" + rowCnt + "]/termflag") != model.getValue("/root/main/peprterminfo/info/termflag")) {
  842. if(model.getValue("/root/main/opcdinfo/opcd[" + rowCnt + "]/opattrverflag") != model.getValue("/root/main/peprterminfo/info/opattrverflag") ||
  843. //model.getValue("/root/main/opcdinfo/opcd[" + rowCnt + "]/opattrdrindxcd") != model.getValue("/root/main/peprterminfo/info/opattrdrindxcd") ||
  844. model.getValue("/root/main/opcdinfo/opcd[" + rowCnt + "]/opattrmedireccd") != model.getValue("/root/main/peprterminfo/info/opattrmedireccd") ||
  845. //model.getValue("/root/main/opcdinfo/opcd[" + rowCnt + "]/snmdcnptid") != model.getValue("/root/main/peprterminfo/info/snmdcnptid") ||
  846. model.getValue("/root/main/opcdinfo/opcd[" + rowCnt + "]/calcscorcd") != model.getValue("/root/main/peprterminfo/info/calcscorcd")) {
  847. if(orgReprFlag != chngReprFlag ){
  848. if(orgReprFlag != "R" ) {
  849. //동의어나 유사어를 대표어로 수정하는 경우 (대표어구분코드를 맞교환)
  850. if( chngReprFlag != "R" )
  851. model.setValue("/root/send/reqdata/status", "ETM");
  852. else {
  853. model.setValue("/root/send/reqdata/orgreprflag", orgReprFlag); //대표어구분을 교환하기 위해 원래 값을 다시 세팅한다.
  854. model.setValue("/root/send/reqdata/status", "ETFM");
  855. }
  856. if(submit("TXMRT00701")){
  857. fCntlReset("SAVE");
  858. model.removeNodeset("/root/main/sametermlist");
  859. model.resetInstanceNode("/root/main/peprterminfo/info");
  860. model.refresh();
  861. }
  862. } else {
  863. var rtn = messageBox("대표어를 동의어나 유사어로 수정 ", "E001");
  864. return;
  865. //동의어를 대표어로 바꾸는 것만 허용
  866. }
  867. } else {
  868. model.setValue("/root/send/reqdata/status", "ETM");
  869. if(submit("TXMRT00701")){
  870. fCntlReset("SAVE");
  871. model.removeNodeset("/root/main/sametermlist");
  872. model.resetInstanceNode("/root/main/peprterminfo/info");
  873. model.refresh();
  874. }
  875. }
  876. } else {
  877. //용어테이블만 수정되었을 경우
  878. if(orgReprFlag != chngReprFlag ){
  879. if(orgReprFlag != "R" ) {
  880. //동의어나 유사어를 대표어로 수정하는 경우 (대표어구분코드를 맞교환)
  881. if( chngReprFlag != "R" )
  882. model.setValue("/root/send/reqdata/status", "TM");
  883. else {
  884. model.setValue("/root/send/reqdata/orgreprflag", orgReprFlag); //대표어구분을 교환하기 위해 원래 값을 다시 세팅한다.
  885. model.setValue("/root/send/reqdata/status", "TFM");
  886. }
  887. if(submit("TXMRT00701")){
  888. fCntlReset("SAVE");
  889. model.removeNodeset("/root/main/sametermlist");
  890. model.refresh();
  891. }
  892. } else {
  893. var rtn = messageBox("대표어를 동의어나 유사어로 수정 ", "E001");
  894. return;
  895. }
  896. } else {
  897. model.setValue("/root/send/reqdata/status", "TM");
  898. if(submit("TXMRT00701")){
  899. fCntlReset("SAVE");
  900. model.removeNodeset("/root/main/sametermlist");
  901. model.resetInstanceNode("/root/main/peprterminfo/info");
  902. model.refresh();
  903. }
  904. }
  905. }
  906. } else {
  907. //속성만 수정
  908. if(model.getValue("/root/main/opcdinfo/opcd[" + rowCnt + "]/opattrverflag") != model.getValue("/root/main/peprterminfo/info/opattrverflag") ||
  909. //model.getValue("/root/main/opcdinfo/opcd[" + rowCnt + "]/opattrdrindxcd") != model.getValue("/root/main/peprterminfo/info/opattrdrindxcd") ||
  910. model.getValue("/root/main/opcdinfo/opcd[" + rowCnt + "]/opattrmedireccd") != model.getValue("/root/main/peprterminfo/info/opattrmedireccd") ||
  911. //model.getValue("/root/main/opcdinfo/opcd[" + rowCnt + "]/snmdcnptid") != model.getValue("/root/main/peprterminfo/info/snmdcnptid") ||
  912. model.getValue("/root/main/opcdinfo/opcd[" + rowCnt + "]/calcscorcd") != model.getValue("/root/main/peprterminfo/info/calcscorcd")) {
  913. if(orgReprFlag != chngReprFlag ){
  914. if(orgReprFlag != "R" ) {
  915. //동의어나 유사어를 대표어로 수정하는 경우 (대표어구분코드를 맞교환)
  916. model.setValue("/root/send/reqdata/reprflag", orgReprFlag); //대표어구분을 교환하기 위해 원래 값을 다시 세팅한다.
  917. if( chngReprFlag != "R" )
  918. model.setValue("/root/send/reqdata/status", "ETM");
  919. else {
  920. model.setValue("/root/send/reqdata/reprflag", orgReprFlag); //대표어구분을 교환하기 위해 원래 값을 다시 세팅한다.
  921. model.setValue("/root/send/reqdata/status", "EFM");
  922. }
  923. if(submit("TXMRT00701")){
  924. fCntlReset("SAVE");
  925. model.removeNodeset("/root/main/sametermlist");
  926. model.resetInstanceNode("/root/main/peprterminfo/info");
  927. model.refresh();
  928. }
  929. } else {
  930. var rtn = messageBox("대표어를 동의어나 유사어로 수정 ", "E001");
  931. return;
  932. //동의어를 대표어로 바꾸는 것만 허용
  933. }
  934. } else {
  935. model.setValue("/root/send/reqdata/status", "EM");
  936. if(submit("TXMRT00701")){
  937. fCntlReset("SAVE");
  938. model.removeNodeset("/root/main/sametermlist");
  939. model.resetInstanceNode("/root/main/peprterminfo/info");
  940. model.refresh();
  941. }
  942. }
  943. } else {
  944. //용어테이블만 수정되었을 경우
  945. if(orgReprFlag != chngReprFlag ){
  946. if(orgReprFlag != "R" ) {
  947. //동의어나 유사어를 대표어로 수정하는 경우 (대표어구분코드를 맞교환)
  948. if( chngReprFlag != "R" )
  949. model.setValue("/root/send/reqdata/status", "TM");
  950. else {
  951. model.setValue("/root/send/reqdata/reprflag", orgReprFlag); //대표어구분을 교환하기 위해 원래 값을 다시 세팅한다.
  952. model.setValue("/root/send/reqdata/status", "FM");
  953. }
  954. if(submit("TXMRT00701")){
  955. fCntlReset("SAVE");
  956. model.removeNodeset("/root/main/sametermlist");
  957. model.resetInstanceNode("/root/main/peprterminfo/info");
  958. model.refresh();
  959. }
  960. } else {
  961. var rtn = messageBox("대표어를 동의어나 유사어로 수정 ", "E001");
  962. return;
  963. //동의어를 대표어로 바꾸는 것만 허용
  964. }
  965. } else {
  966. if (model.getValue("/root/main/opcdinfo/opcd[" + rowCnt + "]/snmdcnptid") != model.getValue("/root/main/peprterminfo/info/snmdcnptid"))
  967. {
  968. model.setValue("/root/send/reqdata/status", "TM");
  969. if(submit("TXMRT00701")){
  970. fCntlReset("SAVE");
  971. model.removeNodeset("/root/main/sametermlist");
  972. model.resetInstanceNode("/root/main/peprterminfo/info");
  973. model.refresh();
  974. }
  975. }
  976. else {
  977. var rtn = messageBox("수정된 사항이 없으므로 수정 ", "E001");
  978. return;
  979. }
  980. }
  981. }
  982. }
  983. } else {
  984. var rtn = messageBox("용어를 입력하시려면 입력 버튼을 ", "C002");
  985. return;
  986. }
  987. }
  988. fDisabled("AS");
  989. btn_delete2.disabled = "false";
  990. model.setValue("/root/hidden/condition/status", ""); //서브밋 실행 후 상태 초기화
  991. }
  992. /**
  993. * @group :
  994. * @ver : 2008.03.19
  995. * @by : 나종천
  996. * @---------------------------------------------------
  997. * @type : function
  998. * @access : public
  999. * @desc : 동의어 리스트 조회
  1000. * @param :
  1001. * @return :
  1002. * @---------------------------------------------------
  1003. */
  1004. function fGetSynomList(){
  1005. grd_termlist.colHidden(1) = true;
  1006. var iRow = grd_opcd.row;
  1007. opt_Hdicd9cd.visible = "true";
  1008. cmb_icd9cd.visible = "false";
  1009. cap_allinsthist.visible = "false";
  1010. cmb_allinsthist.visible = "false";
  1011. fDisabled("S");
  1012. btn_insert2.disabled = "false";
  1013. button4.disabled = "false";
  1014. btn_save1.disabled = "false";
  1015. btn_delete2.disabled = "false";
  1016. //2009-04-28 오후 3:21:38 강지훈 수정 : 중앙이 아닌 기관일경우 확장,용어코드가 000.00인것은 수정불가처리
  1017. var term = model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/termcd");
  1018. var diagattrcd = model.getValue("/root/main/peprterminfo/info/opattrcd");
  1019. var termcd = model.getValue("/root/main/peprterminfo/info/termcd");
  1020. var maininstyn = model.getValue("/root/hidden/condition/maininstyn");
  1021. if(maininstyn == "N" && diagattrcd == "000" && termcd == "00"){
  1022. btn_modify1.disabled = true;
  1023. }
  1024. else{
  1025. btn_modify1.disabled = false;
  1026. }
  1027. model.setValue("/root/hidden/condition/sametermmode", "U");
  1028. model.removeNodeset("/root/send");
  1029. model.makeValue("/root/send/opattrcd", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/opattrcd"));
  1030. model.makeValue("/root/send/sametermmode", model.getValue("/root/hidden/condition/sametermmode"));
  1031. model.makeValue("/root/send/selInstcd", model.getValue("/root/hidden/condition/selInstcd"));
  1032. submit("TRMRT00705");
  1033. model.refresh();
  1034. }
  1035. /**
  1036. * @group :
  1037. * @ver : 2008.03.19
  1038. * @by : 나종천
  1039. * @---------------------------------------------------
  1040. * @type : function
  1041. * @access : public
  1042. * @desc : 용어 이력 리스트 조회
  1043. * @param :
  1044. * @return :
  1045. * @---------------------------------------------------
  1046. */
  1047. function fGetOpTermHistList(){
  1048. grd_termlist.colHidden(1) = true;
  1049. var iRow = grd_opcd.row - grd_opcd.fixedRows + 1;
  1050. opt_Hdicd9cd.visible = "true";
  1051. cmb_icd9cd.visible = "false";
  1052. cap_allinsthist.visible = "false";
  1053. cmb_allinsthist.visible = "false";
  1054. fDisabled("S");
  1055. btn_insert2.disabled = "false";
  1056. button4.disabled = "false";
  1057. btn_save1.disabled = "false";
  1058. btn_delete2.disabled = "false";
  1059. //2009-04-28 오후 3:21:38 강지훈 수정 : 중앙이 아닌 기관일경우 확장,용어코드가 000.00인것은 수정불가처리
  1060. var term = model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/termcd");
  1061. var diagattrcd = model.getValue("/root/main/peprterminfo/info/opattrcd");
  1062. var termcd = model.getValue("/root/main/peprterminfo/info/termcd");
  1063. var maininstyn = model.getValue("/root/hidden/condition/maininstyn");
  1064. if(maininstyn == "N" && diagattrcd == "000" && termcd == "00"){
  1065. btn_modify1.disabled = true;
  1066. }
  1067. else{
  1068. btn_modify1.disabled = false;
  1069. }
  1070. model.setValue("/root/hidden/condition/sametermmode", "N");
  1071. model.removeNodeset("/root/send");
  1072. model.makeValue("/root/send/opattrcd", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/opattrcd"));
  1073. model.makeValue("/root/send/sametermmode", model.getValue("/root/hidden/condition/sametermmode"));
  1074. model.makeValue("/root/send/selInstcd", model.getValue("/root/hidden/condition/selInstcd"));
  1075. submit("TRMRT00705");
  1076. model.refresh();
  1077. }
  1078. /**
  1079. * @group :
  1080. * @ver : 2009.03.19
  1081. * @by : 강지훈
  1082. * @---------------------------------------------------
  1083. * @type : function
  1084. * @access : public
  1085. * @desc : 용어 기관별 이력 리스트 조회
  1086. * @param :
  1087. * @return :
  1088. * @---------------------------------------------------
  1089. */
  1090. function fGetDiagInstTermHistList(){
  1091. var iRow = grd_opcd.row - grd_opcd.fixedRows + 1;
  1092. opt_Hdicd9cd.visible = "true";
  1093. cmb_icd9cd.visible = "false";
  1094. fDisabled("AS");
  1095. grd_termlist.colHidden(1) = false;
  1096. cap_allinsthist.visible = "true";
  1097. cmb_allinsthist.visible = "true";
  1098. btn_insert2.disabled = "true";
  1099. btn_modify1.disabled = "true";
  1100. button4.disabled = "true";
  1101. btn_save1.disabled = "true";
  1102. btn_delete2.disabled = "true";
  1103. model.setValue("/root/hidden/condition/sametermmode", "H");
  1104. model.removeNodeset("/root/send");
  1105. model.makeValue("/root/send/opattrcd", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/opattrcd"));
  1106. model.makeValue("/root/send/sametermmode", model.getValue("/root/hidden/condition/sametermmode"));
  1107. model.makeValue("/root/send/allinsthist", model.getValue("/root/hidden/condition/allinsthist"));
  1108. submit("TRMRT00705");
  1109. model.refresh();
  1110. }
  1111. /**
  1112. * @group :
  1113. * @ver : 2008.03.19
  1114. * @by : 나종천
  1115. * @---------------------------------------------------
  1116. * @type : function
  1117. * @access : public
  1118. * @desc : 수술 용어 선택
  1119. * @param :
  1120. * @return :
  1121. * @---------------------------------------------------
  1122. */
  1123. function fSelOpTerm(){
  1124. opt_Hdicd9cd.visible = "true";
  1125. cmb_icd9cd.visible = "false";
  1126. //2009-03-20 오전 9:12:31 강지훈 수정 : 기관별 사용 이력조회에서는 신규입력외의 Operation 금지
  1127. var sameTermMode = model.getValue("/root/hidden/condition/sametermmode");
  1128. if(sameTermMode != "H"){
  1129. btn_delete2.disabled = "false";
  1130. }
  1131. fDisabled("AS");
  1132. var iRow = grd_opcd.row;
  1133. var opattr = model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/opattrcd");
  1134. var term = model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/termcd");
  1135. var icd9cd = term.split(".")[0];
  1136. var opattrcd = term.split(".")[1];
  1137. var termcd = term.split(".")[2];
  1138. if( !isNull(iRow) ) {
  1139. model.setValue("/root/hidden/condition/status", "");
  1140. model.setValue("/root/hidden/condition/selectedtermcd", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/termcd"));
  1141. model.setValue("/root/main/peprterminfo/info/icd9cd", icd9cd); //icd9
  1142. model.setValue("/root/main/peprterminfo/info/opattrcd", opattrcd); // 확장코드
  1143. model.setValue("/root/main/peprterminfo/info/termcd", termcd); // 대표어(동의어)코드
  1144. model.setValue("/root/main/peprterminfo/info/snmdcnptid", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/snmdcnptid")); // 스노메드-dscrpt
  1145. model.setValue("/root/main/peprterminfo/info/snmdcnptnm", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/snmdcnptnm")); // 스노메드-dscrpt
  1146. model.setValue("/root/main/peprterminfo/info/snmddescid", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/snmddescid")); // 스노메드-cncpt
  1147. model.setValue("/root/main/peprterminfo/info/termengnm", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/termengnm")); // 영문
  1148. model.setValue("/root/main/peprterminfo/info/termhngnm", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/termhngnm")); // 한글
  1149. model.setValue("/root/main/peprterminfo/info/reprflag", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/reprflag")); // 대표어구분
  1150. model.setValue("/root/main/peprterminfo/info/termflag", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/termflag")); // 용어구분
  1151. model.setValue("/root/main/peprterminfo/info/opattrdrindxcd", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/opattrdrindxcd")); // 의사색인
  1152. model.setValue("/root/main/peprterminfo/info/opattrmedireccd", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/opattrmedireccd")); // 의무기록색인
  1153. model.setValue("/root/main/peprterminfo/info/opattrverflag", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/opattrverflag")); // 버전
  1154. model.setValue("/root/main/peprterminfo/info/calcscorcd", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/calcscorcd")); // 수가코드
  1155. model.setValue("/root/main/peprterminfo/info/umlscd", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/umlscd")); // UMLS코드
  1156. //model.setValue("/root/main/peprterminfo/info/fstrgstrid", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/fstrgstrid"));
  1157. model.setValue("/root/main/peprterminfo/info/fstrgstrid", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/lastupdtrnm"));
  1158. model.setValue("/root/main/peprterminfo/info/attrfromdd", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/attrfromdd"));
  1159. model.setValue("/root/main/peprterminfo/info/attrtodd", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/attrtodd"));
  1160. model.setValue("/root/main/peprterminfo/info/icdfromdd", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/icdfromdd"));
  1161. model.setValue("/root/main/peprterminfo/info/alttermcd", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/alttermcd"));
  1162. model.setValue("/root/main/peprterminfo/info/essntermflag", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/essntermflag"));
  1163. var fstrgstdt = model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/fstrgstdt");
  1164. var termfromdd = model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/termfromdd");
  1165. var termtodd = model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/termtodd");
  1166. model.setValue("/root/main/peprterminfo/info/fstrgstdt", fstrgstdt); // 등록일
  1167. model.setValue("/root/main/peprterminfo/info/fstrgstdate", fstrgstdt.substr(0,8));
  1168. model.setValue("/root/main/peprterminfo/info/fstrgsttime", fstrgstdt.substr(8,4));
  1169. model.setValue("/root/main/peprterminfo/info/termfromdd", termfromdd); // 시작일
  1170. model.setValue("/root/main/peprterminfo/info/termtodd", termtodd); // 종료일
  1171. //2009-04-28 오후 3:21:38 강지훈 수정 : 중앙이 아닌 기관일경우 확장,용어코드가 000.00인것은 수정불가처리, 기관별사용이력조회일때도 불가
  1172. var maininstyn = model.getValue("/root/hidden/condition/maininstyn");
  1173. if(sameTermMode != "H"){
  1174. if(maininstyn == "N" && opattrcd == "000" && termcd == "00"){
  1175. btn_modify1.disabled = true;
  1176. }
  1177. else{
  1178. btn_modify1.disabled = false;
  1179. }
  1180. }
  1181. else{
  1182. btn_modify1.disabled = true;
  1183. }
  1184. model.removeNodeset("/root/send");
  1185. model.makeValue("/root/send/opattrcd", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/opattrcd"));
  1186. model.makeValue("/root/send/sametermmode", model.getValue("/root/hidden/condition/sametermmode"));
  1187. model.makeValue("/root/send/allinsthist", model.getValue("/root/hidden/condition/allinsthist"));
  1188. model.makeValue("/root/send/selInstcd", model.getValue("/root/hidden/condition/selInstcd"));
  1189. model.makeValue("/root/send/termcd", term);
  1190. model.makeValue("/root/send/termflag", model.getValue("/root/main/opcdinfo/opcd[" + iRow + "]/termflag"));
  1191. submit("TRMRT00705");
  1192. model.setValue("/root/main/peprterminfo/info/appinstcd", model.getValue("/root/main/sametermlist/appinstcd/appinstcd"));
  1193. model.refresh();
  1194. }
  1195. }
  1196. function fChngLangIndx(){
  1197. var selectedmode = model.getValue("/root/hidden/condition/selctedmode");
  1198. if(selectedmode != "P"){
  1199. model.removeNodeset("/root/send");
  1200. model.makeValue("/root/send/mode",model.getValue("/root/hidden/condition/indxviewmode"));
  1201. model.makeValue("/root/send/indxflag",model.getValue("/root/hidden/condition/indxflag"));
  1202. model.makeValue("/root/send/indxuseflag",model.getValue("/root/hidden/condition/indxuseflag"));
  1203. submit("TRMRT00701");
  1204. trv_dgindx.rebuild();
  1205. model.refresh();
  1206. }
  1207. }
  1208. function fSelICD9List(){
  1209. var sSelectedMode = model.getValue("/root/hidden/condition/selctedmode");
  1210. btn_addrow.attribute("visibility") = "visible";
  1211. btn_delrow.attribute("visibility") = "visible";
  1212. btn_saverow.attribute("visibility") = "visible";
  1213. btn_modify.attribute("visibility") = "visible";
  1214. if(sSelectedMode == "D" || sSelectedMode == "P") {
  1215. model.setValue("/root/hidden/condition/indxflag", "9");
  1216. model.removeNodeset("/root/send");
  1217. model.makeValue("/root/send/mode", model.getValue("/root/hidden/condition/indxviewmode"));
  1218. model.makeValue("/root/send/indxflag", model.getValue("/root/hidden/condition/indxflag"));
  1219. submit("TRMRT00701");
  1220. model.refresh();
  1221. }
  1222. model.setValue("/root/hidden/condition/selctedmode", "I");
  1223. }
  1224. function fICD9Save(){
  1225. model.removeNodeset("/root/send");
  1226. var RowCnt = grd_icd9.rows;
  1227. model.makeValue("/root/send/reqdata","");
  1228. var cnt = 1;
  1229. for ( i=1; i<=RowCnt; i++) {
  1230. if(model.getValue("/root/main/opcdinfo/icd9cd[" + i + "]/state") == "I" || model.getValue("/root/main/opcdinfo/icd9cd[" + i + "]/state") == "U" || model.getValue("/root/main/opcdinfo/icd9cd[" + i + "]/state") == "D") {
  1231. model.makeValue("/root/send/reqdata[" + cnt + "]/state", model.getValue("/root/main/opcdinfo/icd9cd[" + i + "]/state"));
  1232. model.makeValue("/root/send/reqdata[" + cnt + "]/icd9cd", model.getValue("/root/main/opcdinfo/icd9cd[" + i + "]/icd9cd"));
  1233. model.makeValue("/root/send/reqdata[" + cnt + "]/icd9drindxcd", model.getValue("/root/main/opcdinfo/icd9cd[" + i + "]/icd9drindxcd"));
  1234. model.makeValue("/root/send/reqdata[" + cnt + "]/icd9medireccd", model.getValue("/root/main/opcdinfo/icd9cd[" + i + "]/icd9medireccd"));
  1235. model.makeValue("/root/send/reqdata[" + cnt + "]/icd9engnm", model.getValue("/root/main/opcdinfo/icd9cd[" + i + "]/icd9engnm"));
  1236. model.makeValue("/root/send/reqdata[" + cnt + "]/icd9hngnm", model.getValue("/root/main/opcdinfo/icd9cd[" + i + "]/icd9hngnm"));
  1237. model.makeValue("/root/send/reqdata[" + cnt + "]/icd9seqno", model.getValue("/root/main/opcdinfo/icd9cd[" + i + "]/icd9seqno"));
  1238. model.makeValue("/root/send/reqdata[" + cnt + "]/icd9fromdd", model.getValue("/root/main/opcdinfo/icd9cd[" + i + "]/icd9fromdd"));
  1239. model.makeValue("/root/send/reqdata[" + cnt + "]/icd9todd", model.getValue("/root/main/opcdinfo/icd9cd[" + i + "]/icd9todd"));
  1240. model.makeValue("/root/send/reqdata[" + cnt + "]/fstrgstrid", model.getValue("/root/main/opcdinfo/icd9cd[" + i + "]/fstrgstrid"));
  1241. model.makeValue("/root/send/reqdata[" + cnt + "]/lastupdtrid", model.getValue("/root/main/opcdinfo/icd9cd[" + i + "]/lastupdtrid"));
  1242. cnt++;
  1243. }
  1244. }
  1245. model.makeValue("/root/send/reqdata/indxcd", model.getValue("/root/hidden/condition/selectedIndx"));
  1246. model.makeValue("/root/send/reqdata/indxflag", model.getValue("/root/hidden/condition/indxflag"));
  1247. submit("TXMRT00703");
  1248. grd_icd9.rebuild();
  1249. model.refresh();
  1250. }
  1251. /**
  1252. * @group :
  1253. * @ver : 2008.07.19
  1254. * @by : 나종천
  1255. * @---------------------------------------------------
  1256. * @type : function
  1257. * @access : public
  1258. * @desc : ICD9코드 삭제
  1259. * @param :
  1260. * @return :
  1261. * @---------------------------------------------------
  1262. */
  1263. function fDelRow(flag) {
  1264. var iRow = grd_icd9.row - grd_icd9.fixedRows + 1;
  1265. if(model.getValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/icd9cd") == ""){
  1266. return;
  1267. }
  1268. if(flag == "I") {
  1269. iRow = grd_icd9.row - grd_icd9.fixedRows + 1;
  1270. model.setValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/state", "D");
  1271. model.setValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/icd9todd", model.getValue("/root/init/today"));
  1272. model.setValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/lastupdtdt", model.getValue("/root/init/today"));
  1273. model.setValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/lastupdtrid", model.getValue("/root/init/userinfo/userid"));
  1274. }
  1275. model.refresh();
  1276. }
  1277. /**
  1278. * @group :
  1279. * @ver : 2008.11.29
  1280. * @by : 나종천
  1281. * @---------------------------------------------------
  1282. * @type : function
  1283. * @access : public
  1284. * @desc : 사용종료 용어 되살리기
  1285. * @param :
  1286. * @return :
  1287. * @---------------------------------------------------
  1288. */
  1289. function fRollbackTerm(){
  1290. var icd9cd = model.getValue("/root/main/peprterminfo/info/icd9cd");
  1291. var attrcd = model.getValue("/root/main/peprterminfo/info/opattrcd");
  1292. var termcd = model.getValue("/root/main/peprterminfo/info/termcd");
  1293. var fullTermcd = icd9cd + "." + attrcd + "." + termcd;
  1294. model.removeNodeset("/root/send");
  1295. model.makeNode("/root/send/reqdata");
  1296. model.copyNode("/root/send/reqdata", "/root/main/peprterminfo/info");
  1297. model.setValue("/root/send/reqdata/icd9cd", icd9cd);
  1298. model.setValue("/root/send/reqdata/opattrcd", icd9cd + "." + attrcd);
  1299. model.setValue("/root/send/reqdata/termcd", fullTermcd);
  1300. model.setValue("/root/send/reqdata/termflag", "9");
  1301. model.setValue("/root/send/reqdata/termfromdd", model.getValue("/root/init/today"));
  1302. model.setValue("/root/send/reqdata/termtodd", "99991231");
  1303. model.makeValue("/root/send/reqdata/indxcd", model.getValue("/root/hidden/condition/selectedIndx"));
  1304. if(termcd == "00"){
  1305. model.makeValue("/root/send/reqdata/status", "ETN");
  1306. model.makeValue("/root/send/reqdata/attrfromdd", model.getValue("/root/init/today"));
  1307. model.makeValue("/root/send/reqdata/attrtodd", "99991231");
  1308. } else {
  1309. model.makeValue("/root/send/reqdata/status", "TN");
  1310. }
  1311. submit("TXMRT00701");
  1312. }
  1313. /**
  1314. * @group :
  1315. * @ver : 2008.11.29
  1316. * @by : 나종천
  1317. * @---------------------------------------------------
  1318. * @type : function
  1319. * @access : public
  1320. * @desc : ICD9
  1321. * @param :
  1322. * @return :
  1323. * @---------------------------------------------------
  1324. */
  1325. function fEditRow(flag){
  1326. var iRow = grd_icd9.row - grd_icd9.fixedRows + 1;
  1327. var currentTime = getCurrentTime();
  1328. if(model.getValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/icd9cd") == ""){
  1329. return;
  1330. }
  1331. if(flag == "I") {
  1332. model.setValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/state", "U");
  1333. model.makeValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/oldfromdd", model.getValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/icd9fromdd"));
  1334. model.makeValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/oldtodd", model.getValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/icd9todd"));
  1335. model.setValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/icd9fromdd", model.getValue("/root/init/today"));
  1336. model.setValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/icd9todd", "99991231");
  1337. model.setValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/fstrgstdt", model.getValue("/root/init/today") + currentTime.substr(0,6));
  1338. model.setValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/fstrgstrid", model.getValue("/root/init/userinfo/userid"));
  1339. model.setValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/lastupdtdt", model.getValue("/root/init/today") + currentTime.substr(0,6));
  1340. model.setValue("/root/main/opcdinfo/icd9cd[" + iRow + "]/lastupdtrid", model.getValue("/root/init/userinfo/userid"));
  1341. }
  1342. model.refresh();
  1343. }
  1344. /**
  1345. * @group :
  1346. * @ver : 2008.12.11
  1347. * @by : 나종천
  1348. * @---------------------------------------------------
  1349. * @type : function
  1350. * @access : public
  1351. * @desc : 오른쪽 마우스 팝업 호출
  1352. * @param :
  1353. * @return :
  1354. * @---------------------------------------------------
  1355. */
  1356. function fCallPopup(flag){
  1357. if(flag == "grd_opcd"){
  1358. if(isDataCell()){
  1359. setPopupMenu(flag, false, "/root/init/func/mouserght", "label", "value");
  1360. }
  1361. } else if(flag == "trv_dgindx"){
  1362. if(trv_dgindx.value == ""){
  1363. return;
  1364. }
  1365. setPopupMenu(flag, false, "/root/init/func/trvmouserght", "label", "value");
  1366. } else {
  1367. initPopupMenu();
  1368. }
  1369. }
  1370. /**
  1371. * @group :
  1372. * @ver : 2008.12.11
  1373. * @by : 나종천
  1374. * @---------------------------------------------------
  1375. * @type : function
  1376. * @access : public
  1377. * @desc : 색인 변경 처리
  1378. * @param :
  1379. * @return :
  1380. * @---------------------------------------------------
  1381. */
  1382. function fModifyIndx(){
  1383. var selTab = model.getValue("/root/hidden/condition/selctedmode");
  1384. model.removenode("/root/hidden/reqdata");
  1385. if(selTab == "D"){
  1386. selectedRows = grd_opcd.selectedRows;
  1387. for(var cnt = 0; cnt <= selectedRows -1; cnt++){
  1388. copyNodeset("/root/hidden/reqdata/opindxlist", "/root/main/opcdinfo/opcd[" + grd_opcd.selectedrow(cnt) + "]", "append");
  1389. }
  1390. }
  1391. }
  1392. /**
  1393. * @group :
  1394. * @ver : 2008.12.11
  1395. * @by : 나종천
  1396. * @---------------------------------------------------
  1397. * @type : function
  1398. * @access : public
  1399. * @desc : 색인 변경할 인덱스로 이동 처리
  1400. * @param :
  1401. * @return :
  1402. * @---------------------------------------------------
  1403. */
  1404. function fPasteIndx(){
  1405. var selTab = model.getValue("/root/hidden/condition/selctedmode");
  1406. var iIndx = trv_dgindx.focusIndex + 1;
  1407. var selIndxCd = model.getValue("/root/main/indxlist/item[" + iIndx + "]/indxcd");
  1408. var selIndxDrdiflag = model.getValue("/root/main/indxlist/item[" + iIndx + "]/indxdrdiflag");
  1409. var msg = messageBox("색인을", "Q012");
  1410. if(msg == "7"){
  1411. return;
  1412. }
  1413. switch(selTab){
  1414. case "D":
  1415. copyNodeset("/root/send/reqdata/opindxlist", "/root/hidden/reqdata/opindxlist");
  1416. model.makeValue("/root/send/reqdata/chnginfo/chngindxcd", selIndxCd);
  1417. model.makeValue("/root/send/reqdata/chnginfo/indxdrdiflag", selIndxDrdiflag);
  1418. model.makeValue("/root/send/reqdata/chnginfo/indxflag", selTab);
  1419. if(msg == "6"){
  1420. if(submit("TXMRT00704")){
  1421. messageBox("색인 변경이","I001");
  1422. grd_opcd.refresh();
  1423. } else {
  1424. messageBox("색인 변경을","E009");
  1425. }
  1426. }
  1427. model.removeNodeset("/root/send/reqdata");
  1428. model.removeNodeset("/root/hidden/reqdata");
  1429. break;
  1430. }
  1431. }
  1432. /**
  1433. * @group :
  1434. * @ver : 2008.12.11
  1435. * @by : 나종천
  1436. * @---------------------------------------------------
  1437. * @type : function
  1438. * @access : public
  1439. * @desc : 대체코드 검색
  1440. * @param :
  1441. * @return :
  1442. * @---------------------------------------------------
  1443. */
  1444. function fCallTermSrch(ref1){
  1445. var alttermcd = model.getValue("/root/main/peprterminfo/info/alttermcd");
  1446. var curr_date = model.getValue("/root/init/today");
  1447. model.removeNodeset("/root/temp/terminfo/altterminfo");
  1448. setParameter("SPMRT01500_param_nodepath", "/root/temp/terminfo/altterminfo");
  1449. setParameter("SPMRT01500_SEARCHDATA", alttermcd);
  1450. setParameter("SPMRT01500_FLAG", "5");
  1451. setParameter("stndd", curr_date);
  1452. // 2009-08-03 nj 추가
  1453. setParameter("maininstyn", "Y");
  1454. modal("SPMRT01500");
  1455. if(getParameter("SPMRT01500_FLAG") == ""){
  1456. return;
  1457. }
  1458. if(getNodesetCnt(model,"/root/temp/terminfo/altterminfo")>0){
  1459. model.setValue(ref1, model.getValue("/root/temp/terminfo/altterminfo/selectoplist/opcd"));
  1460. ipt_alttermcd.refresh();
  1461. return true;
  1462. } else {
  1463. return false;
  1464. }
  1465. }
  1466. /**
  1467. * @group :
  1468. * @ver : 2009.02.11
  1469. * @by : 강지훈
  1470. * @---------------------------------------------------
  1471. * @type : function
  1472. * @access : public
  1473. * @desc : 기관별 용어 사용여부 설정
  1474. * @param :
  1475. * @return :
  1476. * @---------------------------------------------------
  1477. */
  1478. function fTermUseSave(){
  1479. model.removeNodeset("/root/send");
  1480. var RowCnt = grd_opcd.rows;
  1481. model.makeValue("/root/send/termuse",getGridUpdateData(grd_opcd));
  1482. submit("TXMRT00206");
  1483. model.refresh();
  1484. }