SMMRT00200.js 114 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417
  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. model.setValue("/root/hidden/condition/selctedmode", "D");
  16. var currentTime = getCurrentTime();
  17. var instcd = getUserInfo("dutplceinstcd");
  18. // Edited by NJ 2007-07-21 getDate() -> getCurrentDate()
  19. //model.setValue("/root/init/today", getDate());
  20. model.setValue("/root/init/today", getCurrentDate());
  21. model.setValue("/root/init/curruntTime", currentTime.substr(0,4));
  22. model.setValue("/root/init/userinfo/userid", getUserId());
  23. model.setValue("/root/init/userinfo/usernm", getUserName());
  24. model.setValue("/root/init/userinfo/instcd", instcd);
  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. // 공통코드를 조회한다.
  46. zbcfGetCodeList( new Array("A0129"), new Array("/root/init/A0129list") );
  47. zbcfGetCodeList( new Array("M0382"), new Array("/root/init/M0382list") );
  48. model.makeValue("/root/send/mode", model.getValue("/root/hidden/condition/indxviewmode"));
  49. model.makeValue("/root/send/indxflag", model.getValue("/root/hidden/condition/indxflag"));
  50. model.makeValue("/root/send/indxuseflag", model.getValue("/root/hidden/condition/indxuseflag"));
  51. model.makeValue("/root/send/selInst", model.getValue("/root/hidden/condition/selInst"));
  52. submit("TRMRT00201");
  53. model.refresh();
  54. }
  55. /**
  56. * @group :
  57. * @ver : 2007.03.20
  58. * @by : 나종천
  59. * @---------------------------------------------------
  60. * @type : function
  61. * @access : public
  62. * @desc : 입력창 세팅 Enable / Disable
  63. * @param :
  64. * @return :
  65. * @---------------------------------------------------
  66. */
  67. function fDisabled(flag) {
  68. var maininstyn = model.getValue("/root/hidden/condition/maininstyn");
  69. if(flag == "ETN" || flag == "ETM") {
  70. cmb_icd10cd.disabled = "false";
  71. if(flag=="ETM"){
  72. ipt_diagattrcd.disabled = "true";
  73. btn_diagattrcd.attribute("visibility") = "hidden";
  74. ipt_termcd.disabled = "true";
  75. ipt_snmdcnptid.disabled = "false";
  76. ipt_termtodd.disabled = "true";
  77. cap_appinst.disabled = "true";
  78. chk_appinst.disabled = "true";
  79. if(maininstyn == "Y"){
  80. rdo_essntermflag.disabled = "false";
  81. }
  82. } else {
  83. ipt_diagattrcd.disabled = "true";
  84. btn_diagattrcd.attribute("visibility") = "hidden";
  85. ipt_termcd.disabled = "true";
  86. ipt_snmdcnptid.disabled = "false";
  87. ipt_termtodd.disabled = "false";
  88. if(maininstyn == "Y"){
  89. cap_appinst.disabled = "false";
  90. chk_appinst.disabled = "false";
  91. rdo_essntermflag.disabled = "false";
  92. }
  93. }
  94. ipt_termfromdd.disabled = "false";
  95. btn_snmdcnptid.disabled = "false";
  96. //btn_snmddescid.disabled = "false";
  97. btn_medireccd.disabled = "false";
  98. ipt_engnm.disabled = "false";
  99. ipt_hngnm.disabled = "false";
  100. cmb_reprflag.disabled = "false";
  101. cmb_diagattrverflag.disabled = "false";
  102. cmb_lglydisflag.disabled = "false";
  103. rdo_chrncsickyn.disabled = "false";
  104. rdo_estmexptyn.disabled = "false";
  105. rdo_serdiagclsyn.disabled = "false";
  106. rdo_cncryn.disabled = "false";
  107. rdo_manwomflag.disabled = "false";
  108. cmb_ageflag.disabled = "false";
  109. btn_termsave.disabled = "false";
  110. } else if(flag == "TN" || flag == "TM") {
  111. ipt_diagattrcd.disabled = "true";
  112. btn_diagattrcd.attribute("visibility") = "hidden";
  113. ipt_termcd.disabled = "true";
  114. ipt_snmdcnptid.disabled = "false"; // 동의어 입력시에도 등록가능하게.
  115. //btn_snmdcnptid.attribute("visibility") = "hidden";
  116. btn_snmdcnptid.attribute("visibility") = "visible";
  117. btn_medireccd.disabled = "true";
  118. ipt_engnm.disabled = "false";
  119. ipt_hngnm.disabled = "false";
  120. cmb_reprflag.disabled = "true";
  121. cmb_diagattrverflag.disabled = "true";
  122. cmb_lglydisflag.disabled = "true";
  123. rdo_chrncsickyn.disabled = "true";
  124. rdo_estmexptyn.disabled = "true";
  125. rdo_serdiagclsyn.disabled = "true";
  126. rdo_cncryn.disabled = "true";
  127. rdo_manwomflag.disabled = "true";
  128. ipt_termfromdd.disabled = "false";
  129. ipt_termtodd.disabled = "false";
  130. cmb_ageflag.disabled = "true";
  131. chk_appinst.disabled = "true";
  132. rdo_essntermflag.disabled = "true";
  133. } else if(flag == "AS") {
  134. cmb_icd10cd.disabled = "true";
  135. ipt_diagattrcd.disabled = "true";
  136. btn_diagattrcd.attribute("visibility") = "hidden";
  137. ipt_termcd.disabled = "true";
  138. ipt_snmdcnptid.disabled = "true";
  139. ipt_snmdcnptnm.disabled = "true";
  140. btn_snmdcnptid.disabled = "true";
  141. //btn_snmddescid.disabled = "true";
  142. btn_medireccd.disabled = "true";
  143. ipt_engnm.disabled = "true";
  144. ipt_hngnm.disabled = "true";
  145. cmb_reprflag.disabled = "true";
  146. cmb_diagattrverflag.disabled = "true";
  147. cmb_lglydisflag.disabled = "true";
  148. rdo_chrncsickyn.disabled = "true";
  149. rdo_estmexptyn.disabled = "true";
  150. rdo_serdiagclsyn.disabled = "true";
  151. rdo_cncryn.disabled = "true";
  152. rdo_manwomflag.disabled = "true";
  153. ipt_termfromdd.disabled = "true";
  154. ipt_termtodd.disabled = "true";
  155. cmb_ageflag.disabled = "true";
  156. chk_appinst.disabled = "true";
  157. rdo_essntermflag.disabled = "true";
  158. }
  159. }
  160. /**
  161. * @group :
  162. * @ver : 2007.03.20
  163. * @by : 나종천
  164. * @---------------------------------------------------
  165. * @type : function
  166. * @access : public
  167. * @desc : 진단/MORPHOLOGY 노드세팅
  168. * @param :
  169. * @return :
  170. * @---------------------------------------------------
  171. */
  172. function fCntlReset( flag ) {
  173. if(flag == "diag"){
  174. if(model.getValue("/root/hidden/condition/status")=="ETN"){
  175. model.resetInstanceNode("/root/main/peprterminfo/info/snmdcnptid");
  176. model.resetInstanceNode("/root/main/peprterminfo/info/snmdcnptnm");
  177. model.resetInstanceNode("/root/main/peprterminfo/info/lglydisflag");
  178. }
  179. model.resetInstanceNode("/root/main/peprterminfo/info/serdiagclsyn");
  180. model.resetInstanceNode("/root/main/peprterminfo/info/chrncsickyn");
  181. model.resetInstanceNode("/root/main/peprterminfo/info/estmexptyn");
  182. model.resetInstanceNode("/root/main/peprterminfo/info/termengnm");
  183. model.resetInstanceNode("/root/main/peprterminfo/info/termhngnm");
  184. model.resetInstanceNode("/root/main/peprterminfo/info/reprflag");
  185. model.resetInstanceNode("/root/main/peprterminfo/info/ageflag");
  186. } else if(flag == "kcd4m"){
  187. model.resetInstanceNode("/root/main/kcd4minfo/info");
  188. }
  189. }
  190. /**
  191. * @group :
  192. * @ver : 2007.03.20
  193. * @by : 나종천
  194. * @---------------------------------------------------
  195. * @type : function
  196. * @access : public
  197. * @desc : ICD10코드 추가 및 삭제
  198. * @param :
  199. * @return :
  200. * @---------------------------------------------------
  201. */
  202. function fAddRow(flag) {
  203. var iRow = 0;
  204. var currentTime = getCurrentTime();
  205. if(flag == "I") {
  206. grd_icd10.addItem();
  207. iRow = grd_icd10.row - grd_icd10.fixedRows + 1;
  208. model.setValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/state", "I");
  209. model.setValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/icd10todd", "99991231");
  210. // Edited by 나종천 ICD10 신규 추가 2008-06-16
  211. model.setValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/lastupdtdt", model.getValue("/root/init/today") + currentTime.substr(0,6));
  212. model.setValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/fstrgstdt", model.getValue("/root/init/today") + currentTime.substr(0,6));
  213. model.setValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/fstrgstrid", model.getValue("/root/init/userinfo/userid"));
  214. model.setValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/lastupdtrid", model.getValue("/root/init/userinfo/userid"));
  215. model.setValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/icd10fromdd", model.getValue("/root/init/today"));
  216. } else if(flag == "D") {
  217. grd_diagcd.addItem();
  218. iRow = grd_diagcd.row - grd_diagcd.fixedRows + 1;
  219. model.setValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/state", "I" );
  220. model.setValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/termtodd", "99991231");
  221. }
  222. }
  223. /**
  224. * @group :
  225. * @ver : 2007.04.09
  226. * @by : 나종천
  227. * @---------------------------------------------------
  228. * @type : function
  229. * @access : public
  230. * @desc : 과진단추가시 진단 용어 조회
  231. * @param :
  232. * @return :
  233. * @---------------------------------------------------
  234. */
  235. function fSrchDiagInfo(){
  236. var sCondPath = "/root/hidden/condition/deptset";
  237. var sSrchedDiagCdInfoPath = "/root/main/srcheddiagcdlist/srcheddiagcdinfo";
  238. var srchnm = model.getValue(sCondPath+"/srchnm");
  239. srchnm = srchnm.replace(/^ *| *$/g, "");
  240. model.removenode("/root/send");
  241. if(srchnm == ""){
  242. messageBox("조회 할 내용을","C001");
  243. return;
  244. }
  245. model.removenodeset(sSrchedDiagCdInfoPath);
  246. grd_srcheddiaginfo.rebuild();
  247. model.makeValue("/root/send/srchflag", model.getValue(sCondPath+"/srchflag")); //
  248. model.makeValue("/root/send/srchnm", srchnm); // ??????
  249. model.makeValue("/root/send/termflag", model.getValue("/root/hidden/condition/indxflag")); // ????????
  250. submit("TRMRT00211");
  251. }
  252. /**
  253. * @group :
  254. * @ver : 2007.04.10
  255. * @by : 나종천
  256. * @---------------------------------------------------
  257. * @type : function
  258. * @access : public
  259. * @desc : 과진단에 진단 추가
  260. * @param :
  261. * @return :
  262. * @---------------------------------------------------
  263. */
  264. function fSendDeptDiag(){
  265. var sCondPath = "/root/hidden/condition/deptset";
  266. var sIndxListPath = "/root/main/indxlist/item";
  267. var sSrchedDiagCdListPath = "/root/main/srcheddiagcdlist/srcheddiagcdinfo";
  268. var sDeptDiagCdListPath = "/root/main/deptdiagcdlist/deptdiagcdinfo";
  269. var sDeptCd = model.getValue(sCondPath+"/selecteddeptcd");
  270. var sIndxCd = model.getValue("/root/hidden/condition/selectedIndx");
  271. var sIndxNm = model.getValue("/root/main/indxlist/item[indxcd='"+sIndxCd+"']/indxhngnm");
  272. var sSrchedDiagRowCnt = grd_srcheddiaginfo.rows - grd_srcheddiaginfo.fixedrows;
  273. var iDeptDiagRow = 0;
  274. var sTermcd = "";
  275. if(sDeptCd == ""){
  276. messageBox("부서코드를 먼저", "C002");
  277. return;
  278. }
  279. if(sIndxCd == ""){
  280. messageBox("색인코드를 먼저", "C002");
  281. return;
  282. }
  283. //debugger;
  284. for(var iSrchedDiagRow = 1; iSrchedDiagRow <= sSrchedDiagRowCnt; iSrchedDiagRow++){
  285. if(model.getValue(sSrchedDiagCdListPath+"["+iSrchedDiagRow+"]/check") == "true"){
  286. sTermcd = model.getValue(sSrchedDiagCdListPath+"["+iSrchedDiagRow+"]/termcd");
  287. if(model.getValue(sDeptDiagCdListPath+"[termcd = '"+sTermcd+"' and deptindxcd = '"+sIndxCd+"']/termcd") != "") continue;
  288. grd_deptdiag.addItem();
  289. iDeptDiagRow = grd_deptdiag.rows - grd_deptdiag.fixedrows;
  290. model.setValue(sDeptDiagCdListPath+"["+iDeptDiagRow+"]/status","I");
  291. model.setValue(sDeptDiagCdListPath+"["+iDeptDiagRow+"]/deptcd",sDeptCd);
  292. model.setValue(sDeptDiagCdListPath+"["+iDeptDiagRow+"]/deptnm",model.getValue(sCondPath+"/selecteddeptnm"));
  293. model.setValue(sDeptDiagCdListPath+"["+iDeptDiagRow+"]/termcd",sTermcd);
  294. model.setValue(sDeptDiagCdListPath+"["+iDeptDiagRow+"]/deptindxcd",sIndxCd);
  295. model.setValue(sDeptDiagCdListPath+"["+iDeptDiagRow+"]/deptindxnm",sIndxNm);
  296. model.setValue(sDeptDiagCdListPath+"["+iDeptDiagRow+"]/termengnm",model.getValue(sSrchedDiagCdListPath+"["+iSrchedDiagRow+"]/termengnm"));
  297. model.setValue(sDeptDiagCdListPath+"["+iDeptDiagRow+"]/termhngnm",model.getValue(sSrchedDiagCdListPath+"["+iSrchedDiagRow+"]/termhngnm"));
  298. model.setValue(sDeptDiagCdListPath+"["+iDeptDiagRow+"]/deptindxflag",model.getValue("/root/hidden/condition/indxflag"));
  299. }
  300. }
  301. grd_deptdiag.rebuild();
  302. }
  303. /**
  304. * @group :
  305. * @ver : 2007.04.11
  306. * @by : 나종천
  307. * @---------------------------------------------------
  308. * @type : function
  309. * @access : public
  310. * @desc : 과진단 저장
  311. * @param :
  312. * @return :
  313. * @---------------------------------------------------
  314. */
  315. function fSaveDeptDiagInfo(){
  316. var xCondPath = "/root/hidden/condition";
  317. var sSelIndxCd = model.getValue(xCondPath+"/selectedIndx");
  318. model.removenode("/root/send");
  319. model.makeValue("/root/send/indxcd", sSelIndxCd);
  320. model.makeValue("/root/send/indxflag", model.getValue("/root/hidden/condition/indxflag"));
  321. model.makeValue("/root/send/deptcd", model.getValue(xCondPath+"/deptset/selecteddeptcd"));
  322. model.makeValue("/root/send/deptdiagcdlist", grd_deptdiag.getUpdateDataAll("i"));
  323. if(submit("TXMRT00203")) fSrchDeptDiagInfo();
  324. }
  325. /**
  326. * @group :
  327. * @ver : 2007.04.11
  328. * @by : 나종천
  329. * @---------------------------------------------------
  330. * @type : function
  331. * @access : public
  332. * @desc : 선택부서 과진단 조회
  333. * @param :
  334. * @return :
  335. * @---------------------------------------------------
  336. */
  337. function fSrchDeptDiagInfo(){
  338. var xCondPath = "/root/hidden/condition";
  339. var sIndxCd = model.getValue(xCondPath+"/selectedIndx");
  340. var sDeptCd = model.getValue(xCondPath+"/deptset/selecteddeptcd");
  341. if(sDeptCd == ""){
  342. messageBox("부서코드를 먼저", "C002");
  343. return;
  344. }
  345. if(sIndxCd == ""){
  346. messageBox("색인코드를 먼저", "C002");
  347. return;
  348. }
  349. model.removeNodeset("/root/send");
  350. model.makeValue("/root/send/indxcd", sIndxCd);
  351. model.makeValue("/root/send/indxflag", model.getValue(xCondPath+"/indxflag"));
  352. model.makeValue("/root/send/deptcd", sDeptCd);
  353. model.makeValue("/root/send/pagesize",pagesize);
  354. model.makeValue("/root/send/offset","0");
  355. model.removenodeset("/root/main/deptdiagcdlist/deptdiagcdinfo");
  356. pinfo = 1;
  357. submit("TRMRT00212");
  358. }
  359. /**
  360. * @group :
  361. * @ver : 2007.04.11
  362. * @by : 나종천
  363. * @---------------------------------------------------
  364. * @type : function
  365. * @access : public
  366. * @desc : 부서 선택 팝업 호출
  367. * @param :
  368. * @return :
  369. * @---------------------------------------------------
  370. */
  371. function fCallDeptInfo(){
  372. var xCondPath = "/root/hidden/condition";
  373. model.removenodeset("/root/main/indxlist/item");
  374. model.removenodeset("/root/main/deptdiagcdlist/deptdiagcdinfo");
  375. trv_dgindx.rebuild();
  376. grd_deptdiag.rebuild();
  377. zbcfOpenInstDeptCodeList("deptnm", model.getValue(xCondPath+"/deptset/selecteddeptnm"), xCondPath+"/deptset/selecteddeptcd", xCondPath+"/deptset/selecteddeptnm", "ordduseryn", "");
  378. if(model.getValue(xCondPath+"/deptset/selecteddeptcd") != ""){
  379. model.removenode("/root/send");
  380. model.makeValue("/root/send/indxflag", model.getValue("/root/hidden/condition/indxflag"));
  381. model.makeValue("/root/send/deptcd", model.getValue("/root/hidden/condition/deptset/selecteddeptcd"));
  382. if(submit("TRMRT00210")){
  383. model.removenodeset("/root/main/deptdiagcdlist/deptdiagcdinfo");
  384. model.setValue(xCondPath+"/selectedIndx","");
  385. grd_deptdiag.rebuild();
  386. }
  387. }else{
  388. model.refresh();
  389. }
  390. }
  391. /**
  392. * @group :
  393. * @ver : 2007.04.12
  394. * @by : 나종천
  395. * @---------------------------------------------------
  396. * @type : function
  397. * @access : public
  398. * @desc : 전체진단조회 팝업 호출
  399. * @param :
  400. * @return :
  401. * @---------------------------------------------------
  402. */
  403. function fCallExtnDiagInfo(){
  404. setParameter("indxflag", model.getValue("/root/hidden/condition/indxflag"));
  405. modal("SPMRT01000", 1,10,10);
  406. }
  407. /**
  408. * @group :
  409. * @ver : 2007.04.12
  410. * @by : 나종천
  411. * @---------------------------------------------------
  412. * @type : function
  413. * @access : public
  414. * @desc : KCD4M 용어 컨트롤 세팅
  415. * @param :
  416. * @return :
  417. * @---------------------------------------------------
  418. */
  419. function fCtrlSet(flag){
  420. if(flag == "N"){
  421. ipt_morphlgccd.disabled = "false";
  422. ipt_kcd4mseqno.disabled = "false";
  423. ipt_kcdsnmdcnptid.disabled = "false";
  424. ipt_kcd4mengnm.disabled = "false";
  425. ipt_kcd4mhngnm.disabled = "false";
  426. ipt_kcd4mfromdate.disabled = "false";
  427. ipt_kcd4mtodate.disabled = "false";
  428. cmb_version.disabled = "false";
  429. } else if(flag == "M") {
  430. ipt_kcd4mengnm.disabled = "false";
  431. ipt_kcd4mhngnm.disabled = "false";
  432. ipt_kcdsnmdcnptid.disabled = "false";
  433. ipt_kcd4mfromdate.disabled = "false";
  434. ipt_kcd4mtodate.disabled = "false";
  435. cmb_version.disabled = "false";
  436. }else {
  437. ipt_morphlgccd.disabled = "true";
  438. ipt_kcd4mengnm.disabled = "true";
  439. ipt_kcd4mhngnm.disabled = "true";
  440. ipt_kcd4mfromdate.disabled = "true";
  441. ipt_kcd4mtodate.disabled = "true";
  442. ipt_kcd4mseqno.disabled = "true";
  443. ipt_kcdsnmdcnptid.disabled = "true";
  444. cmb_version.disabled = "true";
  445. }
  446. }
  447. /**
  448. * @group :
  449. * @ver : 2008.03.19
  450. * @by : 나종천
  451. * @---------------------------------------------------
  452. * @type : function
  453. * @access : public
  454. * @desc : ICD10코드 리스트를 조회
  455. * @param :
  456. * @return :
  457. * @---------------------------------------------------
  458. */
  459. function fSelICD10List(){
  460. var sSelectedMode = model.getValue("/root/hidden/condition/selctedmode");
  461. btn_addrow.attribute("visibility") = "visible";
  462. btn_delrow.attribute("visibility") = "visible";
  463. btn_saverow.attribute("visibility") = "visible";
  464. btn_modify.attribute("visibility") = "visible";
  465. cap_selInst.visible = false;
  466. cmb_selInst.visible = false;
  467. if(sSelectedMode == "K" || sSelectedMode == "P") {
  468. model.setValue("/root/hidden/condition/indxflag", "0");
  469. model.removeNodeset("/root/send");
  470. model.makeValue("/root/send/mode",model.getValue("/root/hidden/condition/indxviewmode"));
  471. model.makeValue("/root/send/indxflag",model.getValue("/root/hidden/condition/indxflag"));
  472. submit("TRMRT00201");
  473. model.refresh();
  474. }
  475. model.setValue("/root/hidden/condition/selctedmode", "I");
  476. }
  477. /**
  478. * @group :
  479. * @ver : 2008.03.19
  480. * @by : 나종천
  481. * @---------------------------------------------------
  482. * @type : function
  483. * @access : public
  484. * @desc : 진단코드 리스트를 조회
  485. * @param :
  486. * @return :
  487. * @---------------------------------------------------
  488. */
  489. function fSelDiagList(){
  490. var sSelectedMode = model.getValue("/root/hidden/condition/selctedmode");
  491. btn_addrow.attribute("visibility") = "hidden";
  492. btn_delrow.attribute("visibility") = "hidden";
  493. btn_saverow.attribute("visibility") = "visible";
  494. btn_modify.attribute("visibility") = "hidden";
  495. //2009-03-19 오후 2:26:46 강지훈 수정 : 기관별 용어를 조회한다.
  496. if(getUserInfo("dutplceinstcd") == "001"){
  497. cap_selInst.visible = true;
  498. cmb_selInst.visible = true;
  499. }
  500. if(sSelectedMode == "K" || sSelectedMode == "P") {
  501. model.setValue("/root/hidden/condition/indxflag", "0");
  502. model.removeNodeset("/root/send");
  503. model.makeValue("/root/send/mode",model.getValue("/root/hidden/condition/indxviewmode"));
  504. model.makeValue("/root/send/indxflag",model.getValue("/root/hidden/condition/indxflag"));
  505. model.makeValue("/root/send/indxuseflag",model.getValue("/root/hidden/condition/indxuseflag"));
  506. submit("TRMRT00201");
  507. model.refresh();
  508. }
  509. model.setValue("/root/hidden/condition/selctedmode", "D");
  510. }
  511. /**
  512. * @group :
  513. * @ver : 2008.03.19
  514. * @by : 나종천
  515. * @---------------------------------------------------
  516. * @type : function
  517. * @access : public
  518. * @desc : Morphology코드 리스트를 조회
  519. * @param :
  520. * @return :
  521. * @---------------------------------------------------
  522. */
  523. function fSelMorphoList(){
  524. btn_addrow.attribute("visibility") = "hidden";
  525. btn_delrow.attribute("visibility") = "hidden";
  526. btn_saverow.attribute("visibility") = "hidden";
  527. btn_modify.attribute("visibility") = "hidden";
  528. cap_selInst.visible = false;
  529. cmb_selInst.visible = false;
  530. model.setValue("/root/hidden/condition/selctedmode", "K");
  531. model.setValue("/root/hidden/condition/indxflag", "4");
  532. model.removeNodeset("/root/send");
  533. model.makeValue("/root/send/mode",model.getValue("/root/hidden/condition/indxviewmode"));
  534. model.makeValue("/root/send/indxflag",model.getValue("/root/hidden/condition/indxflag"));
  535. submit("TRMRT00201");
  536. model.refresh();
  537. }
  538. /**
  539. * @group :
  540. * @ver : 2008.03.19
  541. * @by : 나종천
  542. * @---------------------------------------------------
  543. * @type : function
  544. * @access : public
  545. * @desc : 동의어 리스트에서 선택
  546. * @param :
  547. * @return :
  548. * @---------------------------------------------------
  549. */
  550. function fGetSynom(){
  551. var iRow = grd_termlist.row;
  552. var indx = model.getValue("/root/hidden/condition/selectedIndx");
  553. var icd10 = model.getValue("/root/hidden/condition/selectedicd10");
  554. var path = model.getValue("/root/hidden/condition/selectedIndxPath");
  555. var term = model.getValue("/root/main/sametermlist/info[" + iRow + "]/termcd");
  556. model.setValue("/root/hidden/condition/selectedtermcd", term);
  557. opt_Hdicd10cd.visible = "true";
  558. cmb_icd10cd.visible = "false";
  559. btn_delete2.disabled = "false";
  560. fDisabled("AS");
  561. if( !isNull(iRow) ) {
  562. model.setValue("/root/hidden/condition/status", "STM");
  563. model.setValue("/root/main/peprterminfo/info/icd10cd", term.split(".")[0]); // ICD10
  564. model.setValue("/root/main/peprterminfo/info/diagattrcd", term.split(".")[1]); // 확장코드
  565. model.setValue("/root/main/peprterminfo/info/termcd", term.split(".")[2]); // 대표어(동의어)코드
  566. model.setValue("/root/main/peprterminfo/info/snmdcnptid", model.getValue("/root/main/sametermlist/info[" + iRow + "]/snmdcnptid")); // 스노메드-cnpt id
  567. model.setValue("/root/main/peprterminfo/info/snmdcnptnm", model.getValue("/root/main/sametermlist/info[" + iRow + "]/snmdcnptnm")); // 스노메드-cncpt 명
  568. model.setValue("/root/main/peprterminfo/info/umlscd", model.getValue("/root/main/sametermlist/info[" + iRow + "]/umlscd")); // UMLS 코드
  569. model.setValue("/root/main/peprterminfo/info/termengnm", model.getValue("/root/main/sametermlist/info[" + iRow + "]/termengnm")); // 영문
  570. model.setValue("/root/main/peprterminfo/info/termhngnm", model.getValue("/root/main/sametermlist/info[" + iRow + "]/termhngnm")); // 한글
  571. model.setValue("/root/main/peprterminfo/info/reprflag", model.getValue("/root/main/sametermlist/info[" + iRow + "]/reprflag")); // 대표어구분
  572. model.setValue("/root/main/peprterminfo/info/termflag", model.getValue("/root/main/sametermlist/info[" + iRow + "]/termflag")); // 용어구분
  573. model.setValue("/root/main/peprterminfo/info/fstrgstrid", model.getValue("/root/main/sametermlist/info[" + iRow + "]/lastupdtrnm")); // 최종등록자
  574. //저장시 필요한 키값
  575. model.setValue("/root/main/peprterminfo/info/attrfromdd", model.getValue("/root/main/sametermlist/info[" + iRow + "]/attrfromdd"));
  576. model.setValue("/root/main/peprterminfo/info/attrtodd", model.getValue("/root/main/sametermlist/info[" + iRow + "]/attrtodd"));
  577. model.setValue("/root/main/peprterminfo/info/icdfromdd", model.getValue("/root/main/sametermlist/info[" + iRow + "]/icdfromdd"));
  578. model.setValue("/root/main/peprterminfo/info/alttermcd", model.getValue("/root/main/sametermlist/info[" + iRow + "]/alttermcd"));
  579. model.setValue("/root/main/peprterminfo/info/essntermflag", model.getValue("/root/main/sametermlist/info[" + iRow + "]/essntermflag"));
  580. model.setValue("/root/main/peprterminfo/info/appinstcd", model.getValue("/root/main/sametermlist/info[" + iRow + "]/appinstcd")); //적용기관
  581. var fstrgstdt = model.getValue("/root/main/sametermlist/info[" + iRow + "]/fstrgstdt");
  582. var termfromdd = model.getValue("/root/main/sametermlist/info[" + iRow + "]/termfromdd");
  583. var termtodd = model.getValue("/root/main/sametermlist/info[" + iRow + "]/termtodd");
  584. model.setValue("/root/main/peprterminfo/info/fstrgstdt", fstrgstdt); // 등록일
  585. model.setValue("/root/main/peprterminfo/info/fstrgstdate", fstrgstdt.substr(0,8));
  586. model.setValue("/root/main/peprterminfo/info/fstrgsttime", fstrgstdt.substr(8,4));
  587. model.setValue("/root/main/peprterminfo/info/termfromdd", termfromdd); // 시작일
  588. model.setValue("/root/main/peprterminfo/info/termtodd", termtodd); // 종료일
  589. model.refresh();
  590. }
  591. }
  592. /**
  593. * @group :
  594. * @ver : 2008.03.19
  595. * @by : 나종천
  596. * @---------------------------------------------------
  597. * @type : function
  598. * @access : public
  599. * @desc : 동의어 등록
  600. * @param :
  601. * @return :
  602. * @---------------------------------------------------
  603. */
  604. function fSetInj(){
  605. //동의어 신규
  606. var jRow = grd_diagcd.row;
  607. var term1 = model.getValue("/root/main/diagcdinfo/diagcd[" + jRow + "]/termcd"); //그리드에서 선택한 term
  608. var diagattr = model.getValue("/root/main/diagcdinfo/diagcd[" + jRow + "]/diagattrcd"); //그리드에서 선택한 term
  609. var icd10cd = model.getValue("/root/main/diagcdinfo/diagcd[" + jRow + "]/icd10cd"); //그리드에서 선택한 term
  610. var indx = model.getValue("/root/hidden/condition/selectedIndx"); //트리에서 선택한 index
  611. var fromdd = ((getCurrentDate()).toDate()).getAddDate(1);
  612. if(term1 == "" || term1 == null){
  613. var rtn = messageBox("진단 용어를 ", "C002");
  614. return;
  615. }
  616. fDisabled("TN");
  617. opt_Hdicd10cd.visible = "true";
  618. cmb_icd10cd.visible = "false";
  619. btn_delete2.disabled = "true";
  620. fCntlReset("diag");
  621. model.setValue("/root/hidden/condition/status", "TN"); //term만 new
  622. model.removeNodeset("/root/send");
  623. model.removeNodeset("/root/main/temp");
  624. model.makeValue("/root/send/reqdata/icd10cd", icd10cd);
  625. model.makeValue("/root/send/reqdata/diagattrcd", diagattr);
  626. model.makeNode("/root/main/temp/info");
  627. submit("TRMRT00208");
  628. model.setValue("/root/main/peprterminfo/info/icd10cd", model.getValue("/root/main/temp/info/icd10cd"));
  629. model.setValue("/root/main/peprterminfo/info/diagattrcd", model.getValue("/root/main/temp/info/diagattrcd").split(".")[1]);
  630. model.setValue("/root/main/peprterminfo/info/termcd", model.getValue("/root/main/temp/info/termcd"));
  631. // Edited by 2007-08-16 대표어 'R' 그 외 값은 ''로 처리
  632. // model.setValue("/root/main/peprterminfo/info/reprflag", "S");
  633. model.setValue("/root/main/peprterminfo/info/reprflag", "");
  634. model.setValue("/root/main/peprterminfo/info/diagattrmedireccd", model.getValue("/root/main/diagcdinfo/diagcd[" + jRow + "]/diagattrmedireccd"));
  635. var path = model.getValue("/root/hidden/condition/selectedIndxPath").split(".");
  636. model.setValue("/root/main/peprterminfo/info/diagattrdrindxcd", path[path.length-2]);
  637. model.setValue("/root/main/peprterminfo/info/termflag", "0");
  638. model.setValue("/root/main/peprterminfo/info/fstrgstrid", model.getValue("/root/init/userinfo/userid"));
  639. model.setValue("/root/main/peprterminfo/info/termengnm", model.getValue("/root/main/diagcdinfo/diagcd[" + jRow + "]/termengnm"));
  640. model.setValue("/root/main/peprterminfo/info/termhngnm", model.getValue("/root/main/diagcdinfo/diagcd[" + jRow + "]/termhngnm"));
  641. model.makeValue("/root/main/peprterminfo/info/oldattrfromdd", model.getValue("/root/main/diagcdinfo/diagcd[" + jRow + "]/attrfromdd"));
  642. //신규 등록 모드는 디폴트를 설정
  643. model.setValue("/root/main/peprterminfo/info/fstrgstdate", model.getValue("/root/init/today"));
  644. model.setValue("/root/main/peprterminfo/info/fstrgsttime", model.getValue("/root/init/curruntTime"));
  645. model.setValue("/root/main/peprterminfo/info/fstrgstdt", model.getValue("/root/main/peprterminfo/info/fstrgstdate")+model.getValue("/root/main/peprterminfo/info/fstrgsttime")+"00");
  646. model.setValue("/root/main/peprterminfo/info/termfromdd", fromdd.getDateFormat());
  647. model.setValue("/root/main/peprterminfo/info/termtodd", "99991231");
  648. model.setValue("/root/main/peprterminfo/info/fstrgstrid", model.getValue("/root/init/userinfo/usernm"));
  649. model.refresh();
  650. }
  651. /**
  652. * @group :
  653. * @ver : 2008.03.19
  654. * @by : 나종천
  655. * @---------------------------------------------------
  656. * @type : function
  657. * @access : public
  658. * @desc : 신규 용어 등록
  659. * @param :
  660. * @return :
  661. * @---------------------------------------------------
  662. */
  663. function fSetNewTerm(){
  664. var sIndx = model.getValue("/root/hidden/condition/selectedIndx");
  665. var fromdd = ((getCurrentDate()).toDate()).getAddDate(1);
  666. var maininstyn = model.getValue("/root/hidden/condition/maininstyn");
  667. if(sIndx == "" || sIndx == null){
  668. var rtn = messageBox("색인을 ", "C002");
  669. return;
  670. }
  671. model.setValue("/root/main/peprterminfo/info/appinstcd", "");
  672. model.setValue("/root/main/peprterminfo/info/essntermflag", "N");
  673. model.removeNodeset("/root/main/sametermlist/info"); // 신규버튼 클릭시 동의어 그리드 초기화
  674. model.setValue("/root/hidden/condition/status", "ETN");
  675. opt_Hdicd10cd.visible = "false";
  676. cmb_icd10cd.visible = "true";
  677. btn_delete2.disabled = "true";
  678. fCntlReset("diag");
  679. fDisabled("ETN");
  680. model.removeNodeset("/root/send");
  681. model.makeValue("/root/send/indxcd",sIndx);
  682. model.makeValue("/root/send/indxflag",model.getValue("/root/hidden/condition/indxflag"));
  683. //선택한 인덱스에 해당하는 ICD10코드를 가지고 온다..
  684. submit("TRMRT00206");
  685. cmb_icd10cd.refresh();
  686. cmb_reprflag.select(0);
  687. // Edited by NJ 2007-07-21 getDate() -> getCurrentDate()
  688. //model.setValue("/root/main/peprterminfo/info/attrfromdd", getDate() );
  689. model.setValue("/root/main/peprterminfo/info/termfromdd", fromdd.getDateFormat());
  690. model.setValue("/root/main/peprterminfo/info/termtodd", "99991231");
  691. model.setValue("/root/main/peprterminfo/info/attrfromdd", model.getValue("/root/main/peprterminfo/info/termfromdd"));
  692. model.setValue("/root/main/peprterminfo/info/attrtodd", model.getValue("/root/main/peprterminfo/info/termtodd"));
  693. model.setValue("/root/main/peprterminfo/info/fstrgstdate", getCurrentDate());
  694. model.setValue("/root/main/peprterminfo/info/fstrgsttime", getCurrentTime());
  695. model.setValue("/root/main/peprterminfo/info/fstrgstrid", getUserName());
  696. model.refresh();
  697. }
  698. /**
  699. * @group :
  700. * @ver : 2008.03.19
  701. * @by : 나종천
  702. * @---------------------------------------------------
  703. * @type : function
  704. * @access : public
  705. * @desc : 용어 수정
  706. * @param :
  707. * @return :
  708. * @---------------------------------------------------
  709. */
  710. function fSetTermUpdt(){
  711. var selTermcd = model.getValue("/root/hidden/condition/selectedtermcd");
  712. var fromdd = ((getCurrentDate()).toDate()).getAddDate(1);
  713. if(selTermcd == "" || selTermcd == null){
  714. var rtn = messageBox("icd10 코드를 ", "C002");
  715. return;
  716. }
  717. // Edited by NJ 2007-07-21 getDate() -> getCurrentDate()
  718. //var today = getDate();
  719. var today = getCurrentDate();
  720. //alert(today);
  721. //alert(model.getValue("/root/main/peprterminfo/info/termfromdd"));
  722. if(model.getValue("/root/main/peprterminfo/info/termfromdd") >= today){
  723. var rtn = messageBox("당일 등록한 용어는 수정 ", "E001");
  724. return;
  725. }
  726. fDisabled("ETM");
  727. model.setValue("/root/hidden/condition/status", "ETM");
  728. btn_delete2.disabled = "true";
  729. model.makeValue("/root/main/peprterminfo/info/oldtermfromdd", model.getValue("/root/main/peprterminfo/info/termfromdd"));
  730. model.makeValue("/root/main/peprterminfo/info/oldattrfromdd", model.getValue("/root/main/peprterminfo/info/attrfromdd"));
  731. model.setValue("/root/main/peprterminfo/info/termfromdd", fromdd.getDateFormat());
  732. model.setValue("/root/main/peprterminfo/info/termtodd", "99991231");
  733. model.setValue("/root/main/peprterminfo/info/attrfromdd", model.getValue("/root/main/peprterminfo/info/termfromdd"));
  734. model.setValue("/root/main/peprterminfo/info/attrtodd", model.getValue("/root/main/peprterminfo/info/termtodd"));
  735. model.setValue("/root/main/peprterminfo/info/fstrgstdate", getCurrentDate());
  736. model.setValue("/root/main/peprterminfo/info/fstrgsttime", getCurrentTime());
  737. model.setValue("/root/main/peprterminfo/info/fstrgstrid", getUserName());
  738. model.refresh();
  739. }
  740. /**
  741. * @group :
  742. * @ver : 2008.03.19
  743. * @by : 나종천
  744. * @---------------------------------------------------
  745. * @type : function
  746. * @access : public
  747. * @desc : 진단용어 저장
  748. * @param :
  749. * @return :
  750. * @---------------------------------------------------
  751. */
  752. function fSaveDiag(){
  753. var insICD10cd = model.getValue("/root/main/peprterminfo/info/icd10cd");
  754. var insdiagattrcd = model.getValue("/root/main/peprterminfo/info/diagattrcd");
  755. var insTermcd = model.getValue("/root/main/peprterminfo/info/termcd");
  756. var fullTermCode = insICD10cd + "." + insdiagattrcd + "." + insTermcd;
  757. var rowCnt = grd_diagcd.row;
  758. var orgReprFlag = model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/reprflag"); //상단 그리드의 원래 대표어구분
  759. var chngReprFlag = model.getValue("/root/main/peprterminfo/info/reprflag"); //저장시, 변경된 대표어구분
  760. model.removeNodeset("/root/send");
  761. model.makeNode("/root/send/reqdata");
  762. model.copyNode("/root/send/reqdata", "/root/main/peprterminfo/info");
  763. model.setValue("/root/send/reqdata/icd10cd", insICD10cd);
  764. model.setValue("/root/send/reqdata/diagattrcd", insICD10cd + "." + insdiagattrcd);
  765. model.setValue("/root/send/reqdata/termcd", fullTermCode);
  766. model.setValue("/root/send/reqdata/fstrgstdt", model.getValue("/root/main/peprterminfo/info/fstrgstdate") + model.getValue("/root/main/peprterminfo/info/fstrgsttime")+"00"); //용어등록일
  767. model.setValue("/root/send/reqdata/termflag", "0"); //용어구분
  768. model.makeValue("/root/send/reqdata/indxcd", model.getValue("/root/hidden/condition/selectedIndx"));
  769. model.makeValue("/root/send/reqdata/status", model.getValue("/root/hidden/condition/status")); //TN:용어만 등록, ETN:용어,속성함께등록,TM:용어만수정, EM:속성만수정,
  770. model.makeValue("/root/send/reqdata/maininstyn", model.getValue("/root/hidden/condition/maininstyn"));
  771. model.makeValue("/root/send/reqdata/selInstcd", model.getValue("/root/hidden/condition/selInstcd"));
  772. //ETM:용어,속성함께수정, 용어수정+대표어교환, ETM:속성수정+대표어교환, ETFM:용어,속성수정+대표어교환, FM:대표어만 교환
  773. if(model.getValue("/root/hidden/condition/status") == "ETN" || model.getValue("/root/hidden/condition/status") == "TN") {
  774. //2009-03-28 오후 1:49:29 강지훈 수정 : 기관에서 등록할때는 적용기관이 필수이다.
  775. var mainInstYn = model.getValue("/root/hidden/condition/maininstyn");
  776. var appInstcd = model.getValue("/root/main/peprterminfo/info/appinstcd");
  777. if(mainInstYn == "Y" && appInstcd == ""){
  778. var rtn = messageBox("선택된 적용기관이 없으므로 저장 ", "E001");
  779. return;
  780. }
  781. if(submit("TXMRT00201")){
  782. fCntlReset("diag");
  783. model.resetInstanceNode("/root/main/peprterminfo/info");
  784. model.removeNodeset("/root/main/sametermlist");
  785. model.refresh();
  786. }
  787. } else if(model.getValue("/root/hidden/condition/status") == "STM") {
  788. //왼쪽 그리드에서 정보를 선택했을 때
  789. var sRowCnt = grd_termlist.row;
  790. var orgReprFlag2 = orgReprFlag2;
  791. if(fullTermCode == model.getValue("/root/main/sametermlist/info[" + sRowCnt + "]/termcd")) {
  792. if(model.getValue("/root/main/sametermlist/info[" + sRowCnt + "]/termengnm") != model.getValue("/root/main/peprterminfo/info/termengnm") ||
  793. model.getValue("/root/main/sametermlist/info[" + sRowCnt + "]/termhngnm") != model.getValue("/root/main/peprterminfo/info/termhngnm") ||
  794. model.getValue("/root/main/sametermlist/info[" + sRowCnt + "]/termflag") != model.getValue("/root/main/peprterminfo/info/termflag")) {
  795. if(orgReprFlag2 != chngReprFlag ){
  796. if(orgReprFlag2 != "R" ) {
  797. //동의어나 유사어를 대표어로 수정하는 경우 (대표어구분코드를 맞교환)
  798. if( chngReprFlag != "R" )
  799. model.setValue("/root/send/reqdata/status", "TM");
  800. else {
  801. model.setValue("/root/send/reqdata/orgreprflag", orgReprFlag2); //대표어구분을 교환하기 위해 원래 값을 다시 세팅한다.
  802. model.setValue("/root/send/reqdata/status", "TFM");
  803. }
  804. if(submit("TXMRT00201")){
  805. fCntlReset("diag");
  806. model.removeNodeset("/root/main/sametermlist");
  807. model.resetInstanceNode("/root/main/peprterminfo/info");
  808. model.refresh();
  809. }
  810. } else {
  811. var rtn = messageBox("대표어를 동의어나 유사어로 수정 ", "E001");
  812. return;
  813. //동의어를 대표어로 바꾸는 것만 허용
  814. }
  815. } else {
  816. model.setValue("/root/send/reqdata/status", "TM");
  817. if(submit("TXMRT00201")){
  818. fCntlReset("diag");
  819. model.removeNodeset("/root/main/sametermlist");
  820. model.resetInstanceNode("/root/main/peprterminfo/info");
  821. model.refresh();
  822. }
  823. }
  824. } else {
  825. var rtn = messageBox("변경된 내용이 없으므로 저장 ", "E001");
  826. return;
  827. }
  828. } else {
  829. var rtn = messageBox("신규입력 버튼을 ", "C002");
  830. return;
  831. }
  832. } else {
  833. if(fullTermCode == model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/termcd")) {
  834. // 용어명칭이 바뀐 경우
  835. if(model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/termengnm") != model.getValue("/root/main/peprterminfo/info/termengnm") ||
  836. model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/termhngnm") != model.getValue("/root/main/peprterminfo/info/termhngnm") ||
  837. model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/termflag") != model.getValue("/root/main/peprterminfo/info/termflag") ||
  838. model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/essntermflag") != model.getValue("/root/main/peprterminfo/info/essntermflag")) {
  839. if(model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/lglydisflag") != model.getValue("/root/main/peprterminfo/info/lglydisflag") ||
  840. model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/chrncsickyn") != model.getValue("/root/main/peprterminfo/info/chrncsickyn") ||
  841. model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/estmexptyn") != model.getValue("/root/main/peprterminfo/info/estmexptyn") ||
  842. model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/serdiagclsyn") != model.getValue("/root/main/peprterminfo/info/serdiagclsyn") ||
  843. model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/manwomflag") != model.getValue("/root/main/peprterminfo/info/manwomflag") ||
  844. model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/cncryn") != model.getValue("/root/main/peprterminfo/info/cncryn") ||
  845. //model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/diagattrdrindxcd") != model.getValue("/root/main/peprterminfo/info/diagattrdrindxcd") ||
  846. model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/diagattrmedireccd") != model.getValue("/root/main/peprterminfo/info/diagattrmedireccd") ||
  847. model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/diagattrverflag") != model.getValue("/root/main/peprterminfo/info/diagattrverflag") ||
  848. //model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/snmdcnptid") != model.getValue("/root/main/peprterminfo/info/snmdcnptid") ||
  849. //model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/snmdcnptnm") != model.getValue("/root/main/peprterminfo/info/snmdcnptnm") ||
  850. model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/ageflag") != model.getValue("/root/main/peprterminfo/info/ageflag")) {
  851. if(orgReprFlag != chngReprFlag ){
  852. if(orgReprFlag != "R" ) {
  853. //동의어나 유사어를 대표어로 수정하는 경우 (대표어구분코드를 맞교환)
  854. if( chngReprFlag != "R" )
  855. model.setValue("/root/send/reqdata/status", "ETM"); // 유사어 구분이 없기 때문에 이 로직은 타지 않는다.
  856. else {
  857. model.makeValue("/root/send/reqdata/orgreprflag", orgReprFlag); //대표어구분을 교환하기 위해 원래 값을 다시 세팅한다.
  858. model.setValue("/root/send/reqdata/status", "ETFM");
  859. }
  860. if(submit("TXMRT00201")){
  861. fCntlReset("diag");
  862. model.removeNodeset("/root/main/sametermlist");
  863. model.resetInstanceNode("/root/main/peprterminfo/info");
  864. model.refresh();
  865. }
  866. } else {
  867. var rtn = messageBox("대표어를 동의어나 유사어로 수정 ", "E001");
  868. return;
  869. //동의어를 대표어로 바꾸는 것만 허용
  870. }
  871. } else {
  872. model.setValue("/root/send/reqdata/status", "ETM");
  873. if(submit("TXMRT00201")){
  874. fCntlReset("diag");
  875. model.removeNodeset("/root/main/sametermlist");
  876. model.resetInstanceNode("/root/main/peprterminfo/info");
  877. model.refresh();
  878. }
  879. }
  880. } else {
  881. //용어테이블만 수정되었을 경우
  882. if(orgReprFlag != chngReprFlag ){
  883. if(orgReprFlag != "R" ) {
  884. //동의어나 유사어를 대표어로 수정하는 경우 (대표어구분코드를 맞교환)
  885. if( chngReprFlag != "R" )
  886. model.setValue("/root/send/reqdata/status", "TM"); // 동의어 유사어 구분이 없기 때문에 이 로직은 타지 않는다
  887. else {
  888. model.makeValue("/root/send/reqdata/orgreprflag", orgReprFlag); //대표어구분을 교환하기 위해 원래 값을 다시 세팅한다.
  889. model.setValue("/root/send/reqdata/status", "TFM");
  890. }
  891. if(submit("TXMRT00201")){
  892. fCntlReset("diag");
  893. model.removeNodeset("/root/main/sametermlist");
  894. model.resetInstanceNode("/root/main/peprterminfo/info");
  895. model.refresh();
  896. }
  897. } else {
  898. var rtn = messageBox("대표어를 동의어나 유사어로 수정 ", "E001");
  899. return;
  900. //동의어를 대표어로 바꾸는 것만 허용
  901. }
  902. } else {
  903. model.setValue("/root/send/reqdata/status", "TM");
  904. if(submit("TXMRT00201")){
  905. fCntlReset("diag");
  906. model.removeNodeset("/root/main/sametermlist");
  907. model.resetInstanceNode("/root/main/peprterminfo/info");
  908. model.refresh();
  909. }
  910. }
  911. }
  912. // 용어 명칭 외의 것이 바뀐 경우
  913. } else {
  914. //속성만 수정
  915. if(model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/lglydisflag") != model.getValue("/root/main/peprterminfo/info/lglydisflag") ||
  916. model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/chrncsickyn") != model.getValue("/root/main/peprterminfo/info/chrncsickyn") ||
  917. model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/estmexptyn") != model.getValue("/root/main/peprterminfo/info/estmexptyn") ||
  918. model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/serdiagclsyn") != model.getValue("/root/main/peprterminfo/info/serdiagclsyn") ||
  919. model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/manwomflag") != model.getValue("/root/main/peprterminfo/info/manwomflag") ||
  920. model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/cncryn") != model.getValue("/root/main/peprterminfo/info/cncryn") ||
  921. //model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/diagattrdrindxcd") != model.getValue("/root/main/peprterminfo/info/diagattrdrindxcd") ||
  922. model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/diagattrmedireccd") != model.getValue("/root/main/peprterminfo/info/diagattrmedireccd") ||
  923. model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/diagattrverflag") != model.getValue("/root/main/peprterminfo/info/diagattrverflag") ||
  924. //model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/snmdcnptid") != model.getValue("/root/main/peprterminfo/info/snmdcnptid") ||
  925. //model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/snmdcnptnm") != model.getValue("/root/main/peprterminfo/info/snmdcnptnm") ||
  926. model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/ageflag") != model.getValue("/root/main/peprterminfo/info/ageflag")) {
  927. if(orgReprFlag != chngReprFlag ){
  928. if(orgReprFlag != "R" ) {
  929. //동의어나 유사어를 대표어로 수정하는 경우 (대표어구분코드를 맞교환)
  930. if( chngReprFlag != "R" )
  931. model.setValue("/root/send/reqdata/status", "ETM"); // 동의어 유사어 구분이 없기 때문에 이 로직은 타지 않는다
  932. else {
  933. //2009 02 16 강지훈 수정 : 오류수정
  934. //model.setValue("/root/send/reqdata/orgreprflag", orgReprFlag); //대표어구분을 교환하기 위해 원래 값을 다시 세팅한다.
  935. model.makeValue("/root/send/reqdata/orgreprflag", orgReprFlag); //대표어구분을 교환하기 위해 원래 값을 다시 세팅한다.
  936. model.setValue("/root/send/reqdata/status", "EFM");
  937. }
  938. if(submit("TXMRT00201")){
  939. fCntlReset("diag");
  940. model.removeNodeset("/root/main/sametermlist");
  941. model.resetInstanceNode("/root/main/peprterminfo/info");
  942. model.refresh();
  943. }
  944. } else {
  945. var rtn = messageBox("대표어를 동의어나 유사어로 수정 ", "E001");
  946. return;
  947. //동의어를 대표어로 바꾸는 것만 허용
  948. }
  949. } else {
  950. model.setValue("/root/send/reqdata/status", "EM");
  951. if(submit("TXMRT00201")){
  952. fCntlReset("diag");
  953. model.removeNodeset("/root/main/sametermlist");
  954. model.resetInstanceNode("/root/main/peprterminfo/info");
  955. model.refresh();
  956. }
  957. }
  958. } else {
  959. //순수 용어 테이블만 수정되었을 경우(기존에는 대표어, 동의어)
  960. //alert(orgReprFlag + "||" + chngReprFlag);
  961. if(orgReprFlag != chngReprFlag ){
  962. if(orgReprFlag != "R" ) {
  963. //동의어나 유사어를 대표어로 수정하는 경우 (대표어구분코드를 맞교환)
  964. if( chngReprFlag != "R" )
  965. model.setValue("/root/send/reqdata/status", "TM");
  966. else {
  967. if (model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/snmdcnptid") != model.getValue("/root/main/peprterminfo/info/snmdcnptid"))
  968. {
  969. model.setValue("/root/send/reqdata/status", "TM");
  970. }
  971. else {
  972. //2009 02 16 강지훈 수정 : 오류수정
  973. //model.setValue("/root/send/reqdata/orgreprflag", orgReprFlag); //대표어구분을 교환하기 위해 원래 값을 다시 세팅한다.
  974. model.makeValue("/root/send/reqdata/orgreprflag", orgReprFlag); //대표어구분을 교환하기 위해 원래 값을 다시 세팅한다.
  975. model.setValue("/root/send/reqdata/status", "FM");
  976. }
  977. }
  978. if(submit("TXMRT00201")){
  979. fCntlReset("diag");
  980. model.removeNodeset("/root/main/sametermlist");
  981. model.resetInstanceNode("/root/main/peprterminfo/info");
  982. model.refresh();
  983. }
  984. } else {
  985. var rtn = messageBox("대표어를 동의어나 유사어로 수정 ", "E001");
  986. return;
  987. //동의어를 대표어로 바꾸는 것만 허용
  988. }
  989. // 대표어구분이 바뀌지 않고 snomed만 바뀐 경우
  990. } else {
  991. if (model.getValue("/root/main/diagcdinfo/diagcd[" + rowCnt + "]/snmdcnptid") != model.getValue("/root/main/peprterminfo/info/snmdcnptid"))
  992. {
  993. model.setValue("/root/send/reqdata/status", "TM");
  994. if(submit("TXMRT00201")){
  995. fCntlReset("diag");
  996. model.removeNodeset("/root/main/sametermlist");
  997. model.resetInstanceNode("/root/main/peprterminfo/info");
  998. model.refresh();
  999. }
  1000. }
  1001. else
  1002. {
  1003. var rtn = messageBox("수정된 사항이 없으므로 수정 ", "E001");
  1004. return;
  1005. }
  1006. }
  1007. }
  1008. }
  1009. } else {
  1010. var rtn = messageBox("용어를 입력하시려면 입력 버튼을 ", "C002");
  1011. }
  1012. }
  1013. fDisabled("AS");
  1014. btn_delete2.disabled = "false";
  1015. model.setValue("/root/hidden/condition/status", "");
  1016. }
  1017. /**
  1018. * @group :
  1019. * @ver : 2008.03.19
  1020. * @by : 나종천
  1021. * @---------------------------------------------------
  1022. * @type : function
  1023. * @access : public
  1024. * @desc : 진단용어 사용종료
  1025. * @param :
  1026. * @return :
  1027. * @---------------------------------------------------
  1028. */
  1029. function fEndDiagTerm(){
  1030. var selTermcd = model.getValue("/root/hidden/condition/selectedtermcd");
  1031. var insicd10cd = model.getValue("/root/main/peprterminfo/info/icd10cd");
  1032. var diagattrcd = model.getValue("/root/main/peprterminfo/info/diagattrcd");
  1033. var insTermcd = model.getValue("/root/main/peprterminfo/info/termcd");
  1034. var sRow = grd_termlist.rows - grd_termlist.fixedRows;
  1035. if(insTermcd == "" || insTermcd == null){
  1036. var rtn = messageBox("삭제할 진단용어를 ", "C002");
  1037. return;
  1038. }
  1039. //대표어일지라도 동의어/유사어가 없다면 삭제 가능함.
  1040. if(model.getValue("/root/main/peprterminfo/info/reprflag") == "R" && sRow >= 1) {
  1041. model.makeValue("/root/send/reqdata/termcd", insicd10cd + "." + diagattrcd + "." + insTermcd);
  1042. model.makeValue("/root/send/reqdata/diagattrcd", insicd10cd + "." + diagattrcd);
  1043. model.makeValue("/root/send/reqdata/termflag", model.getValue("/root/hidden/condition/indxflag"));
  1044. if(submit("TRMRT00215")){
  1045. var sametermyn = model.getValue("/root/hidden/exists/sametermyn");
  1046. if(sametermyn == "Y"){
  1047. var rtn = messageBox("대표어는 삭제 ", "E001");
  1048. return;
  1049. }
  1050. } else {
  1051. return;
  1052. }
  1053. }
  1054. var rtn = messageBox("선택한 진단용어를", "Q001");
  1055. if( rtn == "6") { //진단코드를 삭제하시겠습니까?
  1056. var altmsg = messageBox("대체코드를", "Q014");
  1057. if(altmsg == "6"){
  1058. btn_altterm.disabled = "false";
  1059. var ref1 = "/root/main/peprterminfo/info/alttermcd";
  1060. var altflag = fCallTermSrch(ref1);
  1061. btn_altterm.disabled = "true";
  1062. if(!altflag){
  1063. return;
  1064. }
  1065. }
  1066. model.setValue("/root/hidden/condition/status", "TD");
  1067. model.removeNodeset("/root/send/reqdata");
  1068. model.makeValue("/root/send/reqdata/indxcd", model.getValue("/root/hidden/condition/selectedIndx"));
  1069. model.makeValue("/root/send/reqdata/icd10cd", insicd10cd);
  1070. model.makeValue("/root/send/reqdata/diagattrcd", insicd10cd + "." + diagattrcd);
  1071. model.makeValue("/root/send/reqdata/termcd", insicd10cd + "." + diagattrcd + "." + insTermcd);
  1072. model.makeValue("/root/send/reqdata/status", model.getValue("/root/hidden/condition/status")); //N:등록, M:수정, D:삭제
  1073. model.makeValue("/root/send/reqdata/termflag", "0"); //용어구분
  1074. model.makeValue("/root/send/reqdata/termfromdd", model.getValue("/root/main/peprterminfo/info/termfromdd"));
  1075. model.makeValue("/root/send/reqdata/oldtermfromdd", model.getValue("/root/main/peprterminfo/info/termfromdd"));
  1076. model.makeValue("/root/send/reqdata/attrfromdd", model.getValue("/root/main/peprterminfo/info/attrfromdd"));
  1077. model.makeValue("/root/send/reqdata/oldattrfromdd", model.getValue("/root/main/peprterminfo/info/attrfromdd"));
  1078. model.makeValue("/root/send/reqdata/alttermcd", model.getValue("/root/main/peprterminfo/info/alttermcd"));
  1079. submit("TXMRT00201");
  1080. grd_diagcd.refresh();
  1081. } else if( rtn == "7") {
  1082. return;
  1083. }
  1084. }
  1085. /**
  1086. * @group :
  1087. * @ver : 2008.03.19
  1088. * @by : 나종천
  1089. * @---------------------------------------------------
  1090. * @type : function
  1091. * @access : public
  1092. * @desc : 동의어 리스트 조회
  1093. * @param :
  1094. * @return :
  1095. * @---------------------------------------------------
  1096. */
  1097. function fGetSynomList(){
  1098. grd_termlist.colHidden(1) = true;
  1099. grd_termlist.colHidden(3) = false;
  1100. var iRow = grd_diagcd.row;
  1101. opt_Hdicd10cd.visible = "true";
  1102. cmb_icd10cd.visible = "false";
  1103. cap_allinsthist.visible = "false";
  1104. cmb_allinsthist.visible = "false";
  1105. btn_delete2.disabled = "true";
  1106. btn_sameterm.disabled = "false";
  1107. btn_modify1.disabled = "false";
  1108. btn_rollback.disabled = "false";
  1109. btn_termsave.disabled = "false";
  1110. //2009-04-28 오후 3:21:38 강지훈 수정 : 중앙이 아닌 기관일경우 확장,용어코드가 000.00인것은 수정불가처리
  1111. var term = model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/termcd");
  1112. var diagattrcd = model.getValue("/root/main/peprterminfo/info/diagattrcd");
  1113. var termcd = model.getValue("/root/main/peprterminfo/info/termcd");
  1114. var maininstyn = model.getValue("/root/hidden/condition/maininstyn");
  1115. if(maininstyn == "N" && diagattrcd == "000" && termcd == "00"){
  1116. btn_modify1.disabled = true;
  1117. }
  1118. else{
  1119. btn_modify1.disabled = false;
  1120. }
  1121. model.setValue("/root/hidden/condition/sametermmode", "U");
  1122. model.removeNodeset("/root/send");
  1123. model.makeValue("/root/send/diagattrcd", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/diagattrcd"));
  1124. model.makeValue("/root/send/sametermmode", model.getValue("/root/hidden/condition/sametermmode"));
  1125. model.makeValue("/root/send/selInstcd", model.getValue("/root/hidden/condition/selInstcd"));
  1126. submit("TRMRT00205");
  1127. model.refresh();
  1128. }
  1129. /**
  1130. * @group :
  1131. * @ver : 2008.03.19
  1132. * @by : 나종천
  1133. * @---------------------------------------------------
  1134. * @type : function
  1135. * @access : public
  1136. * @desc : 용어 이력 리스트 조회
  1137. * @param :
  1138. * @return :
  1139. * @---------------------------------------------------
  1140. */
  1141. function fGetDiagTermHistList(){
  1142. grd_termlist.colHidden(1) = true;
  1143. grd_termlist.colHidden(3) = true;
  1144. var iRow = grd_diagcd.row;
  1145. opt_Hdicd10cd.visible = "true";
  1146. cmb_icd10cd.visible = "false";
  1147. cap_allinsthist.visible = "false";
  1148. cmb_allinsthist.visible = "false";
  1149. btn_delete2.disabled = "true";
  1150. btn_sameterm.disabled = "false";
  1151. //2009-04-28 오후 3:21:38 강지훈 수정 : 중앙이 아닌 기관일경우 확장,용어코드가 000.00인것은 수정불가처리
  1152. var term = model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/termcd");
  1153. var diagattrcd = model.getValue("/root/main/peprterminfo/info/diagattrcd");
  1154. var termcd = model.getValue("/root/main/peprterminfo/info/termcd");
  1155. var maininstyn = model.getValue("/root/hidden/condition/maininstyn");
  1156. if(maininstyn == "N" && diagattrcd == "000" && termcd == "00"){
  1157. btn_modify1.disabled = true;
  1158. }
  1159. else{
  1160. btn_modify1.disabled = false;
  1161. }
  1162. btn_rollback.disabled = "false";
  1163. btn_termsave.disabled = "false";
  1164. model.setValue("/root/hidden/condition/sametermmode", "N");
  1165. model.removeNodeset("/root/send");
  1166. model.makeValue("/root/send/diagattrcd", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/diagattrcd"));
  1167. model.makeValue("/root/send/sametermmode", model.getValue("/root/hidden/condition/sametermmode"));
  1168. model.makeValue("/root/send/selInstcd", model.getValue("/root/hidden/condition/selInstcd"));
  1169. submit("TRMRT00205");
  1170. model.refresh();
  1171. }
  1172. /**
  1173. * @group :
  1174. * @ver : 2009-02-23 오후 10:30:15
  1175. * @by : 강지훈
  1176. * @---------------------------------------------------
  1177. * @type : function
  1178. * @access : public
  1179. * @desc : 기관별 용어 이력 리스트 조회
  1180. * @param :
  1181. * @return :
  1182. * @---------------------------------------------------
  1183. */
  1184. function fGetDiagInstTermHistList(){
  1185. grd_termlist.colHidden(1) = false;
  1186. grd_termlist.colHidden(3) = true;
  1187. var iRow = grd_diagcd.row;
  1188. opt_Hdicd10cd.visible = "true";
  1189. cmb_icd10cd.visible = "false";
  1190. cap_allinsthist.visible = "true";
  1191. cmb_allinsthist.visible = "true";
  1192. btn_delete2.disabled = "true";
  1193. btn_sameterm.disabled = "true";
  1194. btn_modify1.disabled = "true";
  1195. btn_rollback.disabled = "true";
  1196. btn_termsave.disabled = "true";
  1197. model.setValue("/root/hidden/condition/sametermmode", "H");
  1198. model.removeNodeset("/root/send");
  1199. model.makeValue("/root/send/diagattrcd", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/diagattrcd"));
  1200. model.makeValue("/root/send/sametermmode", model.getValue("/root/hidden/condition/sametermmode"));
  1201. model.makeValue("/root/send/allinsthist", model.getValue("/root/hidden/condition/allinsthist"));
  1202. //alert(model.getValue("/root/hidden/condition/allinsthist"));
  1203. submit("TRMRT00205");
  1204. model.refresh();
  1205. }
  1206. /**
  1207. * @group :
  1208. * @ver : 2008.03.19
  1209. * @by : 나종천
  1210. * @---------------------------------------------------
  1211. * @type : function
  1212. * @access : public
  1213. * @desc : 용어 조회
  1214. * @param :
  1215. * @return :
  1216. * @---------------------------------------------------
  1217. */
  1218. function fSrchDiagTerm(){
  1219. if(model.getValue("/root/hidden/condition/srchnm") == "" || model.getValue("/root/hidden/condition/srchnm") == null){
  1220. var rtn = messageBox("검색어를 ", "C001");
  1221. return;
  1222. } else {
  1223. model.removeNodeset("/root/send");
  1224. model.makeValue("/root/send/srchflag", model.getValue("/root/hidden/condition/srchflag"));
  1225. model.makeValue("/root/send/srchnm", model.getValue("/root/hidden/condition/srchnm"));
  1226. model.makeValue("/root/send/srchfromdd", model.getValue("/root/hidden/condition/srchfromdd"));
  1227. model.makeValue("/root/send/srchtodd", model.getValue("/root/hidden/condition/srchtodd"));
  1228. model.makeValue("/root/send/endflag", model.getValue("/root/hidden/condition/endflag"));
  1229. model.makeValue("/root/send/maininstyn", model.getValue("/root/hidden/condition/maininstyn"));
  1230. model.makeValue("/root/send/selInstcd", model.getValue("/root/hidden/condition/selInstcd"));
  1231. var srchnm = model.getValue("/root/hidden/condition/srchnm");
  1232. srchnm = srchnm.replace(/^ *| *$/g, "");
  1233. if(model.getValue("/root/send/srchflag") == "C" || model.getValue("/root/send/srchflag") == "E") {
  1234. srchnm = srchnm.toUpperCase();
  1235. model.setValue("/root/send/srchnm", srchnm);
  1236. }
  1237. if(model.getValue("/root/hidden/condition/selctedmode") == "I" ) {
  1238. model.removeNodeset("/root/main/diagcdinfo/icd10cd");
  1239. submit("TRMRT00203");
  1240. } else if (model.getValue("/root/hidden/condition/selctedmode") == "D" ) {
  1241. model.removeNodeset("/root/main/diagcdinfo/diagcd");
  1242. submit("TRMRT00204");
  1243. } else if (model.getValue("/root/hidden/condition/selctedmode") == "K" ) {
  1244. model.removeNodeset("/root/main/diagcdinfo/kcd4m");
  1245. submit("TRMRT00209");
  1246. } else if(model.getValue("/root/hidden/condition/selctedmode") == "P" ) {
  1247. if(model.getValue("/root/hidden/condition/deptset/selecteddeptcd") == ""){
  1248. messageBox("과를", "C002");
  1249. return;
  1250. }
  1251. model.removeNodeset("/root/send");
  1252. model.removeNodeset("/root/main/deptdiagcdlist/deptdiagcdinfo");
  1253. model.makeValue("/root/send/indxflag", model.getValue("/root/hidden/condition/indxflag"));
  1254. model.makeValue("/root/send/indxcd", "null");
  1255. model.makeValue("/root/send/deptcd", model.getValue("/root/hidden/condition/deptset/selecteddeptcd"));
  1256. model.makeValue("/root/send/srchflag", model.getValue("/root/hidden/condition/srchflag"));
  1257. model.makeValue("/root/send/srchnm", model.getValue("/root/hidden/condition/srchnm"));
  1258. model.makeValue("/root/send/pagesize",pagesize);
  1259. model.makeValue("/root/send/offset","0");
  1260. model.removenodeset("/root/main/deptdiagcdlist/deptdiagcdinfo");
  1261. pinfo = 1;
  1262. submit("TRMRT00212");
  1263. }
  1264. model.refresh();
  1265. }
  1266. }
  1267. /**
  1268. * @group :
  1269. * @ver : 2008.03.19
  1270. * @by : 나종천
  1271. * @---------------------------------------------------
  1272. * @type : function
  1273. * @access : public
  1274. * @desc : KCD4M 용어 사용종료
  1275. * @param :
  1276. * @return :
  1277. * @---------------------------------------------------
  1278. */
  1279. function fEndKCD4M(){
  1280. model.setValue("/root/hidden/condition/status", "MD");
  1281. model.removeNodeset("/root/send");
  1282. model.removeNodeset("/root/main/diagcdinfo");
  1283. model.makeValue("/root/send/morphlgccd", model.getValue("/root/main/kcd4minfo/info/morphlgccd"));
  1284. model.makeValue("/root/send/kcd4mseqno", model.getValue("/root/main/kcd4minfo/info/kcd4mseqno"));
  1285. model.makeValue("/root/send/indxcd", model.getValue("/root/main/kcd4minfo/info/indxcd"));
  1286. model.makeValue("/root/send/kcd4mengnm", model.getValue("/root/main/kcd4minfo/info/kcd4mengnm"));
  1287. model.makeValue("/root/send/kcd4mhngnm", model.getValue("/root/main/kcd4minfo/info/kcd4mhngnm"));
  1288. model.setValue("/root/main/kcd4minfo/info/kcd4mfromdate", model.getValue("/root/init/today"));
  1289. model.setValue("/root/main/kcd4minfo/info/kcd4mfromtime", model.getValue("/root/init/curruntTime"));
  1290. model.setValue("/root/main/kcd4minfo/info/kcd4mtodate", getCurrentDate());
  1291. model.setValue("/root/main/kcd4minfo/info/kcd4mtotime", "2359");
  1292. //model.setValue("/root/main/kcd4minfo/info/fstrgstdt", "");
  1293. //Edited by 나종천 2008-06-23 사용종료의 시작일자 수정
  1294. model.makeValue("/root/send/oldkcd4mfromdd", model.getValue("/root/main/kcd4minfo/info/kcd4mfromdd"));
  1295. model.makeValue("/root/send/kcd4mfromdd", model.getValue("/root/main/kcd4minfo/info/kcd4mfromdate"));
  1296. model.makeValue("/root/send/kcd4mtodd", model.getValue("/root/main/kcd4minfo/info/kcd4mtodate"));
  1297. model.makeValue("/root/send/status", model.getValue("/root/hidden/condition/status"));
  1298. submit("TXMRT00202");
  1299. fCntlReset("kcd4m");
  1300. grd_kcd4minfo.rebuild();
  1301. }
  1302. /**
  1303. * @group :
  1304. * @ver : 2008.03.19
  1305. * @by : 나종천
  1306. * @---------------------------------------------------
  1307. * @type : function
  1308. * @access : public
  1309. * @desc : KCD4M 용어 저장
  1310. * @param :
  1311. * @return :
  1312. * @---------------------------------------------------
  1313. */
  1314. function fSaveKCD4M(){
  1315. var selectedIndx = model.getValue("/root/hidden/condition/indxflag");
  1316. if(selectedIndx == "" || selectedIndx == null){
  1317. var rtn = messageBox("색인 코드를 ", "C002");
  1318. return;
  1319. }
  1320. var rowcnt = model.getValue("/root/hidden/condition/rowcnt");
  1321. if(model.getValue("/root/hidden/condition/status") == "MN"){
  1322. model.removeNodeset("/root/send");
  1323. model.removeNodeset("/root/main/diagcdinfo");
  1324. model.makeValue("/root/send/morphlgccd", model.getValue("/root/main/kcd4minfo/info/morphlgccd"));
  1325. model.makeValue("/root/send/indxcd", model.getValue("/root/main/kcd4minfo/info/indxcd"));
  1326. model.makeValue("/root/send/kcd4mengnm", model.getValue("/root/main/kcd4minfo/info/kcd4mengnm"));
  1327. model.makeValue("/root/send/kcd4mhngnm", model.getValue("/root/main/kcd4minfo/info/kcd4mhngnm"));
  1328. model.makeValue("/root/send/kcd4mseqno", model.getValue("/root/main/kcd4minfo/info/kcd4mseqno"));
  1329. model.makeValue("/root/send/snmdcnptid", model.getValue("/root/main/kcd4minfo/info/snmdcnptid"));
  1330. model.makeValue("/root/send/kcd4mfromdd", model.getValue("/root/main/kcd4minfo/info/kcd4mfromdd"));
  1331. model.makeValue("/root/send/kcd4mtodd", model.getValue("/root/main/kcd4minfo/info/kcd4mtodd"));
  1332. model.makeValue("/root/send/oldkcd4mfromdd", model.getValue("/root/main/kcd4minfo/info/oldkcd4mfromdd"));
  1333. model.makeValue("/root/send/snmdcnptid", model.getValue("/root/main/kcd4minfo/info/snmdcnptid"));
  1334. model.makeValue("/root/send/version", model.getValue("/root/main/kcd4minfo/info/version"));
  1335. model.makeValue("/root/send/status", model.getValue("/root/hidden/condition/status"));
  1336. if(submit("TXMRT00202")){
  1337. model.resetInstanceNode("/root/main/kcd4minfo/info");
  1338. fCntlReset("kcd4m");
  1339. grd_kcd4minfo.rebuild();
  1340. }
  1341. return;
  1342. }
  1343. if(model.getValue("/root/main/kcd4minfo/info/morphlgccd") == model.getValue("/root/main/diagcdinfo/kcd4m[" + rowcnt + "]/morphlgccd") &&
  1344. model.getValue("/root/main/kcd4minfo/info/kcd4mengnm") == model.getValue("/root/main/diagcdinfo/kcd4m[" + rowcnt + "]/kcd4mengnm") &&
  1345. model.getValue("/root/main/kcd4minfo/info/kcd4mhngnm") == model.getValue("/root/main/diagcdinfo/kcd4m[" + rowcnt + "]/kcd4mhngnm") &&
  1346. model.getValue("/root/main/kcd4minfo/info/snmdcnptid") == model.getValue("/root/main/diagcdinfo/kcd4m[" + rowcnt + "]/snmdcnptid") &&
  1347. model.getValue("/root/main/kcd4minfo/info/indxcd") == model.getValue("/root/main/diagcdinfo/kcd4m[" + rowcnt + "]/indxcd") &&
  1348. model.getValue("/root/main/kcd4minfo/info/version") == model.getValue("/root/main/diagcdinfo/kcd4m[" + rowcnt + "]/version")){
  1349. var rtn = messageBox("수정되지 ", "E007");
  1350. return;
  1351. } else{
  1352. model.removeNodeset("/root/send");
  1353. model.removeNodeset("/root/main/diagcdinfo");
  1354. model.makeValue("/root/send/morphlgccd", model.getValue("/root/main/kcd4minfo/info/morphlgccd"));
  1355. model.makeValue("/root/send/indxcd", model.getValue("/root/main/kcd4minfo/info/indxcd"));
  1356. model.makeValue("/root/send/kcd4mengnm", model.getValue("/root/main/kcd4minfo/info/kcd4mengnm"));
  1357. model.makeValue("/root/send/kcd4mhngnm", model.getValue("/root/main/kcd4minfo/info/kcd4mhngnm"));
  1358. model.makeValue("/root/send/kcd4mseqno", model.getValue("/root/main/kcd4minfo/info/kcd4mseqno"));
  1359. model.makeValue("/root/send/snmdcnptid", model.getValue("/root/main/kcd4minfo/info/snmdcnptid"));
  1360. //model.setValue("/root/main/kcd4minfo/info/kcd4mfromdate", model.getValue("/root/init/today"));
  1361. //model.setValue("/root/main/kcd4minfo/info/kcd4mfromtime", model.getValue("/root/init/curruntTime"));
  1362. //model.setValue("/root/main/kcd4minfo/info/kcd4mtodate", "99991231");
  1363. //model.setValue("/root/main/kcd4minfo/info/kcd4mtotime", "2359");
  1364. //model.setValue("/root/main/kcd4minfo/info/fstrgstdt", "");
  1365. model.makeValue("/root/send/kcd4mfromdd", model.getValue("/root/main/kcd4minfo/info/kcd4mfromdd"));
  1366. model.makeValue("/root/send/kcd4mtodd", model.getValue("/root/main/kcd4minfo/info/kcd4mtodd"));
  1367. model.makeValue("/root/send/oldkcd4mfromdd", model.getValue("/root/main/kcd4minfo/info/oldkcd4mfromdd"));
  1368. model.makeValue("/root/send/version", model.getValue("/root/main/kcd4minfo/info/version"));
  1369. model.makeValue("/root/send/status", model.getValue("/root/hidden/condition/status"));
  1370. if(submit("TXMRT00202")){
  1371. model.resetInstanceNode("/root/main/kcd4minfo/info");
  1372. fCntlReset("kcd4m");
  1373. grd_kcd4minfo.rebuild();
  1374. }
  1375. }
  1376. }
  1377. /**
  1378. * @group :
  1379. * @ver : 2008.03.19
  1380. * @by : 나종천
  1381. * @---------------------------------------------------
  1382. * @type : function
  1383. * @access : public
  1384. * @desc : KCD4M 용어 수정
  1385. * @param :
  1386. * @return :
  1387. * @---------------------------------------------------
  1388. */
  1389. function fSetKCD4MUpdt(){
  1390. var fromdd = ((getCurrentDate()).toDate()).getAddDate(1);
  1391. iRow = grd_kcd4minfo.row - grd_kcd4minfo.fixedRows + 1;
  1392. model.setValue("/root/hidden/condition/status", "MM");
  1393. fCtrlSet("M");
  1394. model.setValue("/root/main/kcd4minfo/info/indxcd", model.getValue("/root/main/diagcdinfo/kcd4m[" + iRow + "]/indxcd"));
  1395. model.setValue("/root/main/kcd4minfo/info/kcd4mfromdate", fromdd.getDateFormat());
  1396. model.setValue("/root/main/kcd4minfo/info/kcd4mfromtime", model.getValue("/root/init/curruntTime"));
  1397. model.setValue("/root/main/kcd4minfo/info/kcd4mtodate", "99991231");
  1398. model.setValue("/root/main/kcd4minfo/info/kcd4mtotime", "2359");
  1399. model.setValue("/root/main/kcd4minfo/info/kcd4mfromdd", model.getValue("/root/main/kcd4minfo/info/kcd4mfromdate"));
  1400. model.setValue("/root/main/kcd4minfo/info/kcd4mtodd", model.getValue("/root/main/kcd4minfo/info/kcd4mtodate"));
  1401. model.setValue("/root/main/kcd4minfo/info/fstrgstdt", model.getValue("/root/main/kcd4minfo/info/kcd4mfromdate")+model.getValue("/root/main/kcd4minfo/info/kcd4mfromtime")+"00");
  1402. model.setValue("/root/main/kcd4minfo/info/fstrgstrid", getUserName());
  1403. model.refresh();
  1404. }
  1405. /**
  1406. * @group :
  1407. * @ver : 2008.03.19
  1408. * @by : 나종천
  1409. * @---------------------------------------------------
  1410. * @type : function
  1411. * @access : public
  1412. * @desc : KCD4M 용어 신규 등록
  1413. * @param :
  1414. * @return :
  1415. * @---------------------------------------------------
  1416. */
  1417. function fSetNewKCD4M(){
  1418. var sIndx = model.getValue("/root/hidden/condition/selectedIndx");
  1419. var fromdd = ((getCurrentDate()).toDate()).getAddDate(1);
  1420. if(trv_dgindx.focusIndex < 0){
  1421. var rtn = messageBox("색인을 ", "C002");
  1422. return;
  1423. }
  1424. model.setValue("/root/hidden/condition/status", "MN");
  1425. fCntlReset("kcd4m");
  1426. fCtrlSet("N");
  1427. model.setValue("/root/main/kcd4minfo/info/indxcd", model.getValue("/root/hidden/condition/selectedIndx"));
  1428. model.setValue("/root/main/peprterminfo/info/fstrgstdate", model.getValue("/root/init/today"));
  1429. model.setValue("/root/main/peprterminfo/info/fstrgsttime", model.getValue("/root/init/curruntTime"));
  1430. model.setValue("/root/main/kcd4minfo/info/kcd4mfromdate", fromdd.getDateFormat());
  1431. model.setValue("/root/main/kcd4minfo/info/kcd4mfromtime", model.getValue("/root/init/curruntTime"));
  1432. model.setValue("/root/main/kcd4minfo/info/kcd4mtodate", "99991231");
  1433. model.setValue("/root/main/kcd4minfo/info/kcd4mtotime", "2359");
  1434. model.setValue("/root/main/kcd4minfo/info/kcd4mfromdd", model.getValue("/root/main/kcd4minfo/info/kcd4mfromdate"));
  1435. model.setValue("/root/main/kcd4minfo/info/kcd4mtodd", model.getValue("/root/main/kcd4minfo/info/kcd4mtodate"));
  1436. model.setValue("/root/main/kcd4minfo/info/fstrgstdate", model.getValue("/root/main/kcd4minfo/info/kcd4mfromdate"));
  1437. model.setValue("/root/main/kcd4minfo/info/fstrgsttime", model.getValue("/root/main/kcd4minfo/info/kcd4mfromtime"));
  1438. model.setValue("/root/main/kcd4minfo/info/fstrgstdt", model.getValue("/root/main/kcd4minfo/info/kcd4mfromdate")+model.getValue("/root/main/kcd4minfo/info/kcd4mfromtime")+"00");
  1439. model.setValue("/root/main/kcd4minfo/info/fstrgstrid", getUserId());
  1440. model.refresh();
  1441. }
  1442. /**
  1443. * @group :
  1444. * @ver : 2008.03.19
  1445. * @by : 나종천
  1446. * @---------------------------------------------------
  1447. * @type : function
  1448. * @access : public
  1449. * @desc : KCD4M 용어 이력 선택
  1450. * @param :
  1451. * @return :
  1452. * @---------------------------------------------------
  1453. */
  1454. function fGetKCD4MHistList(){
  1455. var iRow = grd_kcd4mhist.row;
  1456. model.setValue("/root/hidden/condition/rowcnt", iRow);
  1457. var kcd4mfromdd = model.getValue("/root/main/kcd4mhist/list[" + iRow + "]/kcd4mfromdd");
  1458. var kcd4mtodd = model.getValue("/root/main/kcd4mhist/list[" + iRow + "]/kcd4mtodd");
  1459. var lastupdtdt = model.getValue("/root/main/kcd4mhist/list[" + iRow + "]/lastupdtdt");
  1460. fCtrlSet();
  1461. model.setValue("/root/main/kcd4minfo/info/morphlgccd", model.getValue("/root/main/kcd4mhist/list[" + iRow + "]/morphlgccd")); // 스노메드-dscrpt
  1462. model.setValue("/root/main/kcd4minfo/info/kcd4mengnm", model.getValue("/root/main/kcd4mhist/list[" + iRow + "]/kcd4mengnm")); // 스노메드-cncpt
  1463. model.setValue("/root/main/kcd4minfo/info/kcd4mhngnm", model.getValue("/root/main/kcd4mhist/list[" + iRow + "]/kcd4mhngnm")); // 영문
  1464. model.setValue("/root/main/kcd4minfo/info/indxcd", model.getValue("/root/main/kcd4mhist/list[" + iRow + "]/indxcd")); // 한글
  1465. model.setValue("/root/main/kcd4minfo/info/kcd4mfromdd", kcd4mfromdd);
  1466. model.setValue("/root/main/kcd4minfo/info/kcd4mfromdate", kcd4mfromdd.substr(0,8));
  1467. model.setValue("/root/main/kcd4minfo/info/kcd4mfromtime", kcd4mfromdd.substr(8,4));
  1468. model.setValue("/root/main/kcd4minfo/info/kcd4mtodd", kcd4mtodd);
  1469. model.setValue("/root/main/kcd4minfo/info/kcd4mtodate", kcd4mtodd.substr(0,8));
  1470. model.setValue("/root/main/kcd4minfo/info/kcd4mtotime", kcd4mtodd.substr(8,4));
  1471. model.setValue("/root/main/kcd4minfo/info/fstrgstdate", lastupdtdt.substr(0,8));
  1472. model.setValue("/root/main/kcd4minfo/info/fstrgsttime", lastupdtdt.substr(8,4));
  1473. model.setValue("/root/main/kcd4minfo/info/fstrgstrid", model.getValue("/root/main/kcd4mhist/list["+iRow+"]/lastupdtrnm"));
  1474. }
  1475. /**
  1476. * @group :
  1477. * @ver : 2008.03.19
  1478. * @by : 나종천
  1479. * @---------------------------------------------------
  1480. * @type : function
  1481. * @access : public
  1482. * @desc : Tree 선택
  1483. * @param :
  1484. * @return :
  1485. * @---------------------------------------------------
  1486. */
  1487. function fSelTreeIndx(){
  1488. var sSelectedMode = model.getValue("/root/hidden/condition/selctedmode");
  1489. var iIndx = trv_dgindx.focusIndex + 1;
  1490. var selIndxCd = model.getValue("/root/main/indxlist/item[" + iIndx + "]/indxcd");
  1491. model.removeNodeset("/root/send");
  1492. model.makeValue("/root/send/indxcd", selIndxCd);
  1493. model.makeValue("/root/send/indxuseflag", model.getValue("/root/hidden/condition/indxuseflag"));
  1494. model.makeValue("/root/send/indxflag", model.getValue("/root/hidden/condition/indxflag"));
  1495. model.makeValue("/root/send/maininstyn", model.getValue("/root/hidden/condition/maininstyn"));
  1496. model.makeValue("/root/send/selInstcd", model.getValue("/root/hidden/condition/selInstcd"));
  1497. switch(sSelectedMode){
  1498. case 'P' : // 과진단 코드
  1499. model.makeValue("/root/send/deptcd", model.getValue("/root/hidden/condition/deptset/selecteddeptcd"));
  1500. model.makeValue("/root/send/pagesize",pagesize);
  1501. model.makeValue("/root/send/offset", "0");
  1502. model.removenodeset("/root/main/deptdiagcdlist/deptdiagcdinfo");
  1503. pinfo = 1;
  1504. submit("TRMRT00212");
  1505. break;
  1506. default :
  1507. model.setValue("/root/hidden/condition/selectedIndx", model.getValue("/root/main/indxlist/item[" + iIndx + "]/indxcd"));
  1508. model.setValue("/root/hidden/condition/selectedIndxDepth", model.getValue("/root/main/indxlist/item[" + iIndx + "]/depth"));
  1509. model.setValue("/root/hidden/condition/selectedIndxPath", model.getValue("/root/main/indxlist/item[" + iIndx + "]/pathcd")); //경로
  1510. submit("TRMRT00202"); //인덱스 트리를 가지고 온다
  1511. grd_icd10.rebuild();
  1512. grd_diagcd.rebuild();
  1513. grd_kcd4minfo.rebuild();
  1514. if(sSelectedMode == "K"){
  1515. fCtrlSet();
  1516. } else if(sSelectedMode == "D"){
  1517. fDisabled("AS");
  1518. }
  1519. }
  1520. }
  1521. /**
  1522. * @group :
  1523. * @ver : 2008.03.19
  1524. * @by : 나종천
  1525. * @---------------------------------------------------
  1526. * @type : function
  1527. * @access : public
  1528. * @desc : 색인추가
  1529. * @param :
  1530. * @return :
  1531. * @---------------------------------------------------
  1532. */
  1533. function fAddIndx(){
  1534. var selectedmode = model.getValue("/root/hidden/condition/selctedmode");
  1535. if(selectedmode != "P"){
  1536. model.removeNodeset("/root/send");
  1537. model.makeValue("/root/send/paramindx","");
  1538. model.setValue("/root/send/paramindx", model.getValue("/root/hidden/condition/indxflag"));
  1539. modal("SMMRT00100", 1,10, 10, "SMMRT00100", "/root/send", "/root/hidden/condition/getdata");
  1540. var child = "SPMRT01200";
  1541. if(child != null){
  1542. var getVal = getParameter("setVal");
  1543. // 색인추가후 재조회가 안됨... Edited by 나종천 20080928
  1544. //if(getVal == "I" || getVal == "U" || getVal == "D") {
  1545. if(getVal == "0" || getVal == "4") {
  1546. model.removeNodeset("/root/send");
  1547. model.makeValue("/root/send/indxflag",model.getValue("/root/hidden/condition/indxflag"));
  1548. model.makeValue("/root/send/mode",model.getValue("/root/hidden/condition/indxviewmode"));
  1549. submit("TRMRT00201");
  1550. trv_dgindx.rebuild();
  1551. }
  1552. }
  1553. }else {
  1554. model.removeNodeset("/root/send");
  1555. model.makeValue("/root/send/indxflag","0");
  1556. model.makeValue("/root/send/deptcd", model.getValue("/root/hidden/condition/deptset/selecteddeptcd"));
  1557. model.makeValue("/root/send/deptnm", model.getValue("/root/hidden/condition/deptset/selecteddeptnm"));
  1558. modal("SMMRT01300",1,10,10,"SMMRT01300","/root/send","/root/hidden/condition/getdata");
  1559. if(getParameter("saveyn") == "Y" && model.getValue("/root/hidden/condition/deptset/selecteddeptcd") != ""){
  1560. model.removenode("/root/send");
  1561. model.makeValue("/root/send/indxflag", model.getValue("/root/hidden/condition/indxflag"));
  1562. model.makeValue("/root/send/deptcd", model.getValue("/root/hidden/condition/deptset/selecteddeptcd"));
  1563. if(submit("TRMRT00210")){
  1564. model.removenodeset("/root/main/deptdiagcdlist/deptdiagcdinfo");
  1565. model.setValue("/root/hidden/condition/selectedIndx","");
  1566. grd_deptdiag.rebuild();
  1567. trv_dgindx.rebuild();
  1568. }
  1569. }
  1570. }
  1571. }
  1572. /**
  1573. * @group :
  1574. * @ver : 2008.03.19
  1575. * @by : 나종천
  1576. * @---------------------------------------------------
  1577. * @type : function
  1578. * @access : public
  1579. * @desc : 색인 언어 변경
  1580. * @param :
  1581. * @return :
  1582. * @---------------------------------------------------
  1583. */
  1584. function fChngLangIndx(){
  1585. var selectedmode = model.getValue("/root/hidden/condition/selctedmode");
  1586. if(selectedmode != "P"){
  1587. model.removeNodeset("/root/send");
  1588. model.makeValue("/root/send/indxflag",model.getValue("/root/hidden/condition/indxflag"));
  1589. model.makeValue("/root/send/mode",model.getValue("/root/hidden/condition/indxviewmode"));
  1590. model.makeValue("/root/send/indxuseflag",model.getValue("/root/hidden/condition/indxuseflag"));
  1591. submit("TRMRT00201");
  1592. }
  1593. trv_dgindx.rebuild();
  1594. model.refresh();
  1595. }
  1596. /**
  1597. * @group :
  1598. * @ver : 2008.03.19
  1599. * @by : 나종천
  1600. * @---------------------------------------------------
  1601. * @type : function
  1602. * @access : public
  1603. * @desc : 색인 코드 조회
  1604. * @param :
  1605. * @return :
  1606. * @---------------------------------------------------
  1607. */
  1608. function fSrchIndxCd(){
  1609. if(model.getValue("/root/hidden/condition/srchindxcd") == "" || model.getValue("/root/hidden/condition/srchindxcd") == null){
  1610. var rtn = messageBox("검색할 색인코드를 ", "C001");
  1611. return;
  1612. } else {
  1613. model.setValue("/root/hidden/condition/selectedIndx", model.getValue("/root/hidden/condition/srchindxcd"));
  1614. trv_dgindx.expandDepth = "3";
  1615. model.refresh();
  1616. }
  1617. trv_dgindx.vscroll.attribute("pos") = ( parseInt(trv_dgindx.attribute("itemheight")) + 1 ) * trv_dgindx.selectedIndex;
  1618. }
  1619. /**
  1620. * @group :
  1621. * @ver : 2008.03.19
  1622. * @by : 나종천
  1623. * @---------------------------------------------------
  1624. * @type : function
  1625. * @access : public
  1626. * @desc : 과진단 선택
  1627. * @param :
  1628. * @return :
  1629. * @---------------------------------------------------
  1630. */
  1631. function fSelDeptDiag(){
  1632. btn_addrow.attribute("visibility") = "hidden";
  1633. btn_delrow.attribute("visibility") = "hidden";
  1634. btn_saverow.attribute("visibility") = "hidden";
  1635. btn_modify.attribute("visibility") = "hidden";
  1636. cap_selInst.visible = false;
  1637. cmb_selInst.visible = false;
  1638. cap_allinsthist.visible = false;
  1639. cmb_allinsthist.visible = false;
  1640. pinfo = 1;
  1641. model.setValue("/root/hidden/condition/deptset/srchflag","H");
  1642. model.setValue("/root/hidden/condition/deptset/srchnm","");
  1643. model.setValue("/root/hidden/condition/deptset/selecteddeptcd","");
  1644. model.setValue("/root/hidden/condition/deptset/selecteddeptnm","");
  1645. model.setValue("/root/hidden/condition/selctedmode", "P");
  1646. model.setValue("/root/hidden/condition/indxflag", "0"); // 진단 : 0, 수술 : 9
  1647. model.removenodeset("/root/main/indxlist/item");
  1648. model.removenodeset("/root/main/srcheddiagcdlist/srcheddiagcdinfo");
  1649. model.removenodeset("/root/main/deptdiagcdlist/deptdiagcdinfo");
  1650. model.refresh();
  1651. }
  1652. /**
  1653. * @group :
  1654. * @ver : 2008.03.19
  1655. * @by : 나종천
  1656. * @---------------------------------------------------
  1657. * @type : function
  1658. * @access : public
  1659. * @desc : 진단 용어 선택
  1660. * @param :
  1661. * @return :
  1662. * @---------------------------------------------------
  1663. */
  1664. function fSelDiagTerm(){
  1665. var iRow = grd_diagcd.row;
  1666. if(grd_diagcd.isCell(event.target) && grd_diagcd.mouserow >= grd_diagcd.fixedrows) {
  1667. opt_Hdicd10cd.visible = "true";
  1668. cmb_icd10cd.visible = "false";
  1669. var sameTermMode = model.getValue("/root/hidden/condition/sametermmode");
  1670. //2009-03-20 오전 9:12:31 강지훈 수정 : 기관별 사용 이력조회에서는 신규입력외의 Operation 금지
  1671. if(sameTermMode != "H"){
  1672. btn_delete2.disabled = "false";
  1673. }
  1674. fDisabled("AS");
  1675. if( !isNull(iRow) ) {
  1676. model.setValue("/root/hidden/condition/status", "");
  1677. var diagAttr = model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/diagattrcd");
  1678. var term = model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/termcd");
  1679. var icd10cd = term.split(".")[0];
  1680. var diagattrcd = term.split(".")[1];
  1681. var termcd = term.split(".")[2];
  1682. model.setValue("/root/hidden/condition/selectedtermcd" , term);
  1683. model.setValue("/root/main/peprterminfo/info/icd10cd" , icd10cd); //ICD10
  1684. model.setValue("/root/main/peprterminfo/info/diagattrcd" , diagattrcd); // 확장코드
  1685. model.setValue("/root/main/peprterminfo/info/termcd" , termcd); // 대표어(동의어)코드
  1686. model.setValue("/root/main/peprterminfo/info/snmdcnptid", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/snmdcnptid")); // 스노메드-cnpt id
  1687. model.setValue("/root/main/peprterminfo/info/snmdcnptnm", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/snmdcnptnm")); // 스노메드-cncpt 명
  1688. model.setValue("/root/main/peprterminfo/info/snmddescid", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/snmddescid")); // 스노메드-dscrpt
  1689. model.setValue("/root/main/peprterminfo/info/umlscd", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/umlscd")); // UMLS코드
  1690. model.setValue("/root/main/peprterminfo/info/termengnm", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/termengnm")); // 영문
  1691. model.setValue("/root/main/peprterminfo/info/termhngnm", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/termhngnm")); // 한글
  1692. model.setValue("/root/main/peprterminfo/info/reprflag", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/reprflag")); // 대표어구분
  1693. model.setValue("/root/main/peprterminfo/info/termflag", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/termflag")); // 용어구분
  1694. model.setValue("/root/main/peprterminfo/info/lglydisflag", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/lglydisflag")); // 법정전염병
  1695. model.setValue("/root/main/peprterminfo/info/chrncsickyn", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/chrncsickyn")); // 만성질환
  1696. model.setValue("/root/main/peprterminfo/info/estmexptyn", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/estmexptyn")); // 산정특례
  1697. model.setValue("/root/main/peprterminfo/info/serdiagclsyn", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/serdiagclsyn")); // 중증도분류
  1698. model.setValue("/root/main/peprterminfo/info/ageflag", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/ageflag")); // 연령별 구분
  1699. model.setValue("/root/main/peprterminfo/info/manwomflag", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/manwomflag")); // 남여구분
  1700. model.setValue("/root/main/peprterminfo/info/cncryn", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/cncryn")); // 남여구분
  1701. model.setValue("/root/main/peprterminfo/info/diagattrdrindxcd", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/diagattrdrindxcd")); // 의사색인
  1702. model.setValue("/root/main/peprterminfo/info/diagattrmedireccd", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/diagattrmedireccd")); // 의무기록색인
  1703. model.setValue("/root/main/peprterminfo/info/diagattrverflag", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/diagattrverflag")); // 버전
  1704. model.setValue("/root/main/peprterminfo/info/fstrgstrid", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/lastupdtrnm")); // 최종등록자
  1705. model.setValue("/root/main/peprterminfo/info/attrfromdd", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/attrfromdd"));
  1706. model.setValue("/root/main/peprterminfo/info/attrtodd", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/attrtodd"));
  1707. model.setValue("/root/main/peprterminfo/info/icdfromdd", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/icdfromdd"));
  1708. model.setValue("/root/main/peprterminfo/info/alttermcd", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/alttermcd"));
  1709. model.setValue("/root/main/peprterminfo/info/essntermflag", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/essntermflag"));
  1710. var fstrgstdt = model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/fstrgstdt");
  1711. var termfromdd = model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/termfromdd");
  1712. var termtodd = model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/termtodd");
  1713. model.setValue("/root/main/peprterminfo/info/fstrgstdt", fstrgstdt); // 등록일
  1714. model.setValue("/root/main/peprterminfo/info/fstrgstdate", fstrgstdt.substr(0,8));
  1715. model.setValue("/root/main/peprterminfo/info/fstrgsttime", fstrgstdt.substr(8,4));
  1716. model.setValue("/root/main/peprterminfo/info/termfromdd",termfromdd);
  1717. model.setValue("/root/main/peprterminfo/info/termtodd", termtodd);
  1718. //2009-04-28 오후 3:21:38 강지훈 수정 : 중앙이 아닌 기관일경우 확장,용어코드가 000.00인것은 수정불가처리, 기관별사용이력조회일때도 불가
  1719. var maininstyn = model.getValue("/root/hidden/condition/maininstyn");
  1720. if(sameTermMode != "H"){
  1721. if(maininstyn == "N" && diagattrcd == "000" && termcd == "00"){
  1722. btn_modify1.disabled = true;
  1723. }
  1724. else{
  1725. btn_modify1.disabled = false;
  1726. }
  1727. }
  1728. else{
  1729. btn_modify1.disabled = true;
  1730. }
  1731. model.removeNodeset("/root/send");
  1732. model.makeValue("/root/send/diagattrcd", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/diagattrcd"));
  1733. model.makeValue("/root/send/sametermmode", model.getValue("/root/hidden/condition/sametermmode"));
  1734. model.makeValue("/root/send/allinsthist", model.getValue("/root/hidden/condition/allinsthist"));
  1735. model.makeValue("/root/send/termcd", term);
  1736. model.makeValue("/root/send/termflag", model.getValue("/root/main/diagcdinfo/diagcd[" + iRow + "]/termflag"));
  1737. model.makeValue("/root/send/maininstyn", model.getValue("/root/hidden/condition/maininstyn"));
  1738. model.makeValue("/root/send/selInstcd", model.getValue("/root/hidden/condition/selInstcd"));
  1739. submit("TRMRT00205");
  1740. model.setValue("/root/main/peprterminfo/info/appinstcd", model.getValue("/root/main/sametermlist/appinstcd/appinstcd"));
  1741. model.refresh();
  1742. }
  1743. }
  1744. }
  1745. /**
  1746. * @group :
  1747. * @ver : 2008.03.19
  1748. * @by : 나종천
  1749. * @---------------------------------------------------
  1750. * @type : function
  1751. * @access : public
  1752. * @desc : KCD4M 용어 선택
  1753. * @param :
  1754. * @return :
  1755. * @---------------------------------------------------
  1756. */
  1757. function fSelKCD4M(){
  1758. var iRow = grd_kcd4minfo.row;
  1759. model.setValue("/root/hidden/condition/rowcnt", iRow);
  1760. var kcd4mfromdd = model.getValue("/root/main/diagcdinfo/kcd4m[" + iRow + "]/kcd4mfromdd");
  1761. var kcd4mtodd = model.getValue("/root/main/diagcdinfo/kcd4m[" + iRow + "]/kcd4mtodd");
  1762. var lastupdtdt = model.getValue("/root/main/diagcdinfo/kcd4m[" + iRow + "]/lastupdtdt");
  1763. fCtrlSet();
  1764. model.setValue("/root/main/kcd4minfo/info/morphlgccd", model.getValue("/root/main/diagcdinfo/kcd4m[" + iRow + "]/morphlgccd"));
  1765. model.setValue("/root/main/kcd4minfo/info/kcd4mengnm", model.getValue("/root/main/diagcdinfo/kcd4m[" + iRow + "]/kcd4mengnm"));
  1766. model.setValue("/root/main/kcd4minfo/info/kcd4mhngnm", model.getValue("/root/main/diagcdinfo/kcd4m[" + iRow + "]/kcd4mhngnm"));
  1767. model.setValue("/root/main/kcd4minfo/info/indxcd", model.getValue("/root/main/diagcdinfo/kcd4m[" + iRow + "]/indxcd"));
  1768. model.setValue("/root/main/kcd4minfo/info/kcd4mseqno", model.getValue("/root/main/diagcdinfo/kcd4m[" + iRow + "]/kcd4mseqno"));
  1769. model.setValue("/root/main/kcd4minfo/info/snmdcnptid", model.getValue("/root/main/diagcdinfo/kcd4m[" + iRow + "]/snmdcnptid"));
  1770. model.setValue("/root/main/kcd4minfo/info/snmdcnptnm", model.getValue("/root/main/diagcdinfo/kcd4m[" + iRow + "]/snmdcnptnm"));
  1771. model.setValue("/root/main/kcd4minfo/info/version", model.getValue("/root/main/diagcdinfo/kcd4m[" + iRow + "]/version"));
  1772. model.setValue("/root/main/kcd4minfo/info/kcd4mfromdd", kcd4mfromdd);
  1773. model.setValue("/root/main/kcd4minfo/info/oldkcd4mfromdd", kcd4mfromdd);
  1774. model.setValue("/root/main/kcd4minfo/info/kcd4mfromdate", kcd4mfromdd.substr(0,8));
  1775. model.setValue("/root/main/kcd4minfo/info/kcd4mfromtime", kcd4mfromdd.substr(8,4));
  1776. model.setValue("/root/main/kcd4minfo/info/kcd4mtodd", kcd4mtodd);
  1777. model.setValue("/root/main/kcd4minfo/info/kcd4mtodate", kcd4mtodd.substr(0,8));
  1778. model.setValue("/root/main/kcd4minfo/info/kcd4mtotime", kcd4mtodd.substr(8,4));
  1779. model.setValue("/root/main/kcd4minfo/info/fstrgstdate", lastupdtdt.substr(0,8));
  1780. model.setValue("/root/main/kcd4minfo/info/fstrgsttime", lastupdtdt.substr(8,4));
  1781. model.setValue("/root/main/kcd4minfo/info/fstrgstrid", model.getValue("/root/main/diagcdinfo/kcd4m["+iRow+"]/lastupdtrnm"));
  1782. model.setValue("/root/hidden/condition/sametermmode", "N");
  1783. model.removeNodeset("/root/send");
  1784. model.makeValue("/root/send/morphlgccd", model.getValue("/root/main/diagcdinfo/kcd4m[" + iRow + "]/morphlgccd"));
  1785. model.makeValue("/root/send/sametermmode", model.getValue("/root/hidden/condition/sametermmode"));
  1786. submit("TRMRT00213");
  1787. }
  1788. /**
  1789. * @group :
  1790. * @ver : 2008.03.19
  1791. * @by : 나종천
  1792. * @---------------------------------------------------
  1793. * @type : function
  1794. * @access : public
  1795. * @desc : 과진단추가 리스트 선택
  1796. * @param :
  1797. * @return :
  1798. * @---------------------------------------------------
  1799. */
  1800. function fSelAddDiagList(){
  1801. if(grd_srcheddiaginfo.row == 0){
  1802. var sRowCnt = grd_srcheddiaginfo.rows- grd_srcheddiaginfo.fixedRows;
  1803. var sCheck = model.getValue("/root/main/srcheddiagcdlist/srcheddiagcdinfo[1]/check");
  1804. if(sCheck == "true"){
  1805. for(var iRow=1; iRow <= sRowCnt; iRow++){
  1806. model.setValue("/root/main/srcheddiagcdlist/srcheddiagcdinfo["+iRow+"]/check","false");
  1807. }
  1808. }else{
  1809. for(var iRow=1; iRow <= sRowCnt; iRow++){
  1810. model.setValue("/root/main/srcheddiagcdlist/srcheddiagcdinfo["+iRow+"]/check","true");
  1811. }
  1812. }
  1813. grd_srcheddiaginfo.rebuild();
  1814. }
  1815. }
  1816. /**
  1817. * @group :
  1818. * @ver : 2008.03.19
  1819. * @by : 나종천
  1820. * @---------------------------------------------------
  1821. * @type : function
  1822. * @access : public
  1823. * @desc : 과진단 용어 삭제
  1824. * @param :
  1825. * @return :
  1826. * @---------------------------------------------------
  1827. */
  1828. function fDelDeptDiagTerm(){
  1829. var iRow = grd_deptdiag.row;
  1830. if(iRow < 1){
  1831. return;
  1832. }
  1833. if(model.getValue("/root/main/deptdiagcdlist/deptdiagcdinfo["+iRow+"]/status") == "I"){
  1834. grd_deptdiag.deleteItem(iRow);
  1835. }else{
  1836. model.setValue("/root/main/deptdiagcdlist/deptdiagcdinfo["+iRow+"]/status","D");
  1837. }
  1838. grd_deptdiag.rebuild();
  1839. }
  1840. /**
  1841. * @group :
  1842. * @ver : 2008.03.19
  1843. * @by : 나종천
  1844. * @---------------------------------------------------
  1845. * @type : function
  1846. * @access : public
  1847. * @desc : 진단 용어 신규 등록시 확장코드 생성
  1848. * @param :
  1849. * @return :
  1850. * @---------------------------------------------------
  1851. */
  1852. function fGetNewExtCd(){
  1853. //ICD10코드 선택 시, 새로운 확장, 용어코드 및 ICD시작일자 함께 조회
  1854. var iCd = cmb_icd10cd.focusIndex + 1;
  1855. var selCd = model.getValue("/root/main/icd10cdlist/info[" + iCd + "]/icd10cd");
  1856. var path = model.getValue("/root/hidden/condition/selectedIndxPath");
  1857. model.setValue("/root/hidden/condition/selectedicd10", selCd);
  1858. model.setValue("/root/main/peprterminfo/info/icd10cd", selCd);
  1859. model.removeNodeset("/root/send");
  1860. model.removeNodeset("/root/main/temp");
  1861. model.makeValue("/root/send/icd10cd", selCd);
  1862. model.makeNode("/root/main/temp/icd10info");
  1863. submit("TRMRT00207");
  1864. model.setValue("/root/main/peprterminfo/info/icd10cd", model.getValue("/root/main/temp/icd10info/icd10cd"));
  1865. model.setValue("/root/main/peprterminfo/info/diagattrcd", model.getValue("/root/main/temp/icd10info/diagattrcd"));
  1866. model.setValue("/root/main/peprterminfo/info/termcd", model.getValue("/root/main/temp/icd10info/termcd"));
  1867. if(model.getValue("/root/main/temp/icd10info/diagattrmedireccd") == ""){
  1868. model.setValue("/root/main/peprterminfo/info/diagattrmedireccd", model.getValue("/root/hidden/condition/selectedIndx"));
  1869. } else {
  1870. model.setValue("/root/main/peprterminfo/info/diagattrmedireccd", model.getValue("/root/main/temp/icd10info/diagattrmedireccd"));
  1871. }
  1872. model.setValue("/root/main/peprterminfo/info/diagattrmedireccd", model.getValue("/root/main/temp/icd10info/diagattrmedireccd"));
  1873. var path = model.getValue("/root/hidden/condition/selectedIndxPath").split(".");
  1874. model.setValue("/root/main/peprterminfo/info/diagattrdrindxcd", path[path.length-2]);
  1875. model.setValue("/root/main/peprterminfo/info/icdfromdd", model.getValue("/root/main/temp/icd10info/icdfromdd"));
  1876. model.setValue("/root/main/peprterminfo/info/reprflag", "R"); //신규모드일때에는 디폴트 R
  1877. // Edited by NJ 2007-07-21 getDate() -> getCurrentDate()
  1878. //model.setValue("/root/main/peprterminfo/info/attrfromdd", getDate());
  1879. /* model.setValue("/root/main/peprterminfo/info/attrfromdd", getCurrentDate());
  1880. model.setValue("/root/main/peprterminfo/info/attrtodd", "99991231");
  1881. model.setValue("/root/main/peprterminfo/info/fstrgstdate", model.getValue("/root/init/today"));
  1882. model.setValue("/root/main/peprterminfo/info/fstrgsttime", model.getValue("/root/init/curruntTime"));
  1883. model.setValue("/root/main/peprterminfo/info/fstrgstdt", model.getValue("/root/main/peprterminfo/info/fstrgstdate") + model.getValue("/root/main/peprterminfo/info/fstrgsttime") + "00");
  1884. model.setValue("/root/main/peprterminfo/info/termfromdd", model.getValue("/root/init/today"));
  1885. model.setValue("/root/main/peprterminfo/info/termtodd", "99991231");
  1886. model.setValue("/root/main/peprterminfo/info/fstrgstrid", model.getValue("/root/init/userinfo/usernm"));
  1887. */
  1888. model.refresh();
  1889. }
  1890. /**
  1891. * @group :
  1892. * @ver : 2008.06.18
  1893. * @by : 나종천
  1894. * @---------------------------------------------------
  1895. * @type : function
  1896. * @access : public
  1897. * @desc : ICD10코드 저장 후 ICD10 재조회
  1898. * @param :
  1899. * @return :
  1900. * @---------------------------------------------------
  1901. */
  1902. function fICD10Save(){
  1903. model.removeNodeset("/root/send");
  1904. var RowCnt = grd_icd10.rows;
  1905. model.makeValue("/root/send/reqdata","");
  1906. var cnt = 1;
  1907. for ( i=1; i<=RowCnt; i++) {
  1908. if(model.getValue("/root/main/diagcdinfo/icd10cd[" + i + "]/state") == "I" || model.getValue("/root/main/diagcdinfo/icd10cd[" + i + "]/state") == "U" || model.getValue("/root/main/diagcdinfo/icd10cd[" + i + "]/state") == "D") {
  1909. /* model.makeValue("/root/send/reqdata[" + cnt + "]/state","");
  1910. model.makeValue("/root/send/reqdata[" + cnt + "]/icd10cd","");
  1911. model.makeValue("/root/send/reqdata[" + cnt + "]/icd10drindxcd","");
  1912. model.makeValue("/root/send/reqdata[" + cnt + "]/icd10medireccd","");
  1913. model.makeValue("/root/send/reqdata[" + cnt + "]/icd10engnm","");
  1914. model.makeValue("/root/send/reqdata[" + cnt + "]/icd10hngnm","");
  1915. model.makeValue("/root/send/reqdata[" + cnt + "]/icd10seqno","");
  1916. model.makeValue("/root/send/reqdata[" + cnt + "]/icd10fromdd", "");
  1917. model.makeValue("/root/send/reqdata[" + cnt + "]/icd10todd",""); */
  1918. model.makeValue("/root/send/reqdata[" + cnt + "]/state", model.getValue("/root/main/diagcdinfo/icd10cd[" + i + "]/state"));
  1919. model.makeValue("/root/send/reqdata[" + cnt + "]/icd10cd", model.getValue("/root/main/diagcdinfo/icd10cd[" + i + "]/icd10cd"));
  1920. model.makeValue("/root/send/reqdata[" + cnt + "]/icd10drindxcd", model.getValue("/root/main/diagcdinfo/icd10cd[" + i + "]/icd10drindxcd"));
  1921. model.makeValue("/root/send/reqdata[" + cnt + "]/icd10medireccd", model.getValue("/root/main/diagcdinfo/icd10cd[" + i + "]/icd10medireccd"));
  1922. model.makeValue("/root/send/reqdata[" + cnt + "]/icd10engnm", model.getValue("/root/main/diagcdinfo/icd10cd[" + i + "]/icd10engnm"));
  1923. model.makeValue("/root/send/reqdata[" + cnt + "]/icd10hngnm", model.getValue("/root/main/diagcdinfo/icd10cd[" + i + "]/icd10hngnm"));
  1924. model.makeValue("/root/send/reqdata[" + cnt + "]/icd10seqno", model.getValue("/root/main/diagcdinfo/icd10cd[" + i + "]/icd10seqno"));
  1925. model.makeValue("/root/send/reqdata[" + cnt + "]/icd10fromdd", model.getValue("/root/main/diagcdinfo/icd10cd[" + i + "]/icd10fromdd"));
  1926. model.makeValue("/root/send/reqdata[" + cnt + "]/icd10todd", model.getValue("/root/main/diagcdinfo/icd10cd[" + i + "]/icd10todd"));
  1927. model.makeValue("/root/send/reqdata[" + cnt + "]/fstrgstrid", model.getValue("/root/main/diagcdinfo/icd10cd[" + i + "]/fstrgstrid"));
  1928. model.makeValue("/root/send/reqdata[" + cnt + "]/lastupdtrid", model.getValue("/root/main/diagcdinfo/icd10cd[" + i + "]/lastupdtrid"));
  1929. model.makeValue("/root/send/reqdata[" + cnt + "]/oldfromdd", model.getValue("/root/main/diagcdinfo/icd10cd[" + i + "]/oldfromdd"));
  1930. model.makeValue("/root/send/reqdata[" + cnt + "]/oldtodd", model.getValue("/root/main/diagcdinfo/icd10cd[" + i + "]/oldtodd"));
  1931. cnt++;
  1932. }
  1933. }
  1934. model.makeValue("/root/send/reqdata/indxcd", model.getValue("/root/hidden/condition/selectedIndx"));
  1935. model.makeValue("/root/send/reqdata/indxflag", model.getValue("/root/hidden/condition/indxflag"));
  1936. submit("TXMRT00204");
  1937. grd_icd10.rebuild();
  1938. model.refresh();
  1939. }
  1940. /**
  1941. * @group :
  1942. * @ver : 2008.06.18
  1943. * @by : 나종천
  1944. * @---------------------------------------------------
  1945. * @type : function
  1946. * @access : public
  1947. * @desc : ICD10코드 삭제
  1948. * @param :
  1949. * @return :
  1950. * @---------------------------------------------------
  1951. */
  1952. function fDelRow(flag) {
  1953. var iRow = grd_icd10.row - grd_icd10.fixedRows + 1;
  1954. var currentTime = getCurrentTime();
  1955. if(model.getValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/icd10cd") == ""){
  1956. return;
  1957. }
  1958. if(flag == "I") {
  1959. iRow = grd_icd10.row - grd_icd10.fixedRows + 1;
  1960. model.setValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/state", "D");
  1961. model.setValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/icd10todd", model.getValue("/root/init/today"));
  1962. model.setValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/lastupdtdt", model.getValue("/root/init/today") + currentTime.substr(0,6));
  1963. model.setValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/lastupdtrid", model.getValue("/root/init/userinfo/userid"));
  1964. }
  1965. model.refresh();
  1966. }
  1967. /**
  1968. * @group :
  1969. * @ver : 2008.11.24
  1970. * @by : 나종천
  1971. * @---------------------------------------------------
  1972. * @type : function
  1973. * @access : public
  1974. * @desc : ICD10코드 수정
  1975. * @param :
  1976. * @return :
  1977. * @---------------------------------------------------
  1978. */
  1979. function fEditRow(flag){
  1980. var iRow = grd_icd10.row - grd_icd10.fixedRows + 1;
  1981. var currentTime = getCurrentTime();
  1982. if(model.getValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/icd10cd") == ""){
  1983. return;
  1984. }
  1985. if(flag == "I") {
  1986. model.setValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/state", "U");
  1987. model.makeValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/oldfromdd", model.getValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/icd10fromdd"));
  1988. model.makeValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/oldtodd", model.getValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/icd10todd"));
  1989. model.setValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/icd10fromdd", model.getValue("/root/init/today"));
  1990. model.setValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/icd10todd", "99991231");
  1991. model.setValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/fstrgstdt", model.getValue("/root/init/today") + currentTime.substr(0,6));
  1992. model.setValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/fstrgstrid", model.getValue("/root/init/userinfo/userid"));
  1993. model.setValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/lastupdtdt", model.getValue("/root/init/today") + currentTime.substr(0,6));
  1994. model.setValue("/root/main/diagcdinfo/icd10cd[" + iRow + "]/lastupdtrid", model.getValue("/root/init/userinfo/userid"));
  1995. }
  1996. model.refresh();
  1997. }
  1998. /**
  1999. * @group :
  2000. * @ver : 2008.11.29
  2001. * @by : 나종천
  2002. * @---------------------------------------------------
  2003. * @type : function
  2004. * @access : public
  2005. * @desc : 사용종료 용어 되살리기
  2006. * @param :
  2007. * @return :
  2008. * @---------------------------------------------------
  2009. */
  2010. function fRollbackTerm(){
  2011. var icd10cd = model.getValue("/root/main/peprterminfo/info/icd10cd");
  2012. var attrcd = model.getValue("/root/main/peprterminfo/info/diagattrcd");
  2013. var termcd = model.getValue("/root/main/peprterminfo/info/termcd");
  2014. var fullTermcd = icd10cd + "." + attrcd + "." + termcd;
  2015. model.removeNodeset("/root/send");
  2016. model.makeNode("/root/send/reqdata");
  2017. model.copyNode("/root/send/reqdata", "/root/main/peprterminfo/info");
  2018. model.setValue("/root/send/reqdata/icd10cd", icd10cd);
  2019. model.setValue("/root/send/reqdata/diagattrcd", icd10cd + "." + attrcd);
  2020. model.setValue("/root/send/reqdata/termcd", fullTermcd);
  2021. model.setValue("/root/send/reqdata/termflag", "0");
  2022. model.setValue("/root/send/reqdata/termfromdd", model.getValue("/root/init/today"));
  2023. model.setValue("/root/send/reqdata/termtodd", "99991231");
  2024. model.makeValue("/root/send/reqdata/indxcd", model.getValue("/root/hidden/condition/selectedIndx"));
  2025. model.makeValue("/root/send/reqdata/maininstyn", model.getValue("/root/hidden/condition/maininstyn"));
  2026. if(termcd == "00"){
  2027. model.makeValue("/root/send/reqdata/status", "ETN");
  2028. model.makeValue("/root/send/reqdata/attrfromdd", model.getValue("/root/init/today"));
  2029. model.makeValue("/root/send/reqdata/attrtodd", "99991231");
  2030. } else {
  2031. model.makeValue("/root/send/reqdata/status", "TN");
  2032. }
  2033. submit("TXMRT00201");
  2034. }
  2035. /**
  2036. * @group :
  2037. * @ver : 2008.12.11
  2038. * @by : 나종천
  2039. * @---------------------------------------------------
  2040. * @type : function
  2041. * @access : public
  2042. * @desc : 오른쪽 마우스 팝업 호출
  2043. * @param :
  2044. * @return :
  2045. * @---------------------------------------------------
  2046. */
  2047. function fCallPopup(flag){
  2048. if(flag == "grd_diagcd"){
  2049. if(isDataCell()){
  2050. setPopupMenu(flag, false, "/root/init/func/mouserght", "label", "value");
  2051. }
  2052. } else if(flag == "trv_dgindx"){
  2053. if(trv_dgindx.value == ""){
  2054. return;
  2055. }
  2056. setPopupMenu(flag, false, "/root/init/func/trvmouserght", "label", "value");
  2057. } else if(flag == "grd_kcd4minfo"){
  2058. if(isDataCell()){
  2059. setPopupMenu(flag, false, "/root/init/func/mouserght", "label", "value");
  2060. }
  2061. } else {
  2062. initPopupMenu();
  2063. }
  2064. }
  2065. /**
  2066. * @group :
  2067. * @ver : 2008.12.11
  2068. * @by : 나종천
  2069. * @---------------------------------------------------
  2070. * @type : function
  2071. * @access : public
  2072. * @desc : 색인 변경 처리
  2073. * @param :
  2074. * @return :
  2075. * @---------------------------------------------------
  2076. */
  2077. function fModifyIndx(){
  2078. var selTab = model.getValue("/root/hidden/condition/selctedmode");
  2079. model.removenode("/root/hidden/reqdata");
  2080. if(selTab == "D"){
  2081. selectedRows = grd_diagcd.selectedRows;
  2082. for(var cnt = 0; cnt <= selectedRows -1; cnt++){
  2083. copyNodeset("/root/hidden/reqdata/diagindxlist", "/root/main/diagcdinfo/diagcd[" + grd_diagcd.selectedrow(cnt) + "]", "append");
  2084. }
  2085. } else if(selTab == "K"){
  2086. selectedRows = grd_kcd4minfo.selectedRows;
  2087. for(var cnt = 0; cnt <= selectedRows -1; cnt++){
  2088. copyNodeset("/root/hidden/reqdata/kcd4mindxlist", "/root/main/diagcdinfo/kcd4m[" + grd_kcd4minfo.selectedrow(cnt) + "]", "append");
  2089. }
  2090. }
  2091. }
  2092. /**
  2093. * @group :
  2094. * @ver : 2008.12.11
  2095. * @by : 나종천
  2096. * @---------------------------------------------------
  2097. * @type : function
  2098. * @access : public
  2099. * @desc : 색인 변경 처리
  2100. * @param :
  2101. * @return :
  2102. * @---------------------------------------------------
  2103. */
  2104. function fPasteIndx(){
  2105. var selTab = model.getValue("/root/hidden/condition/selctedmode");
  2106. var iIndx = trv_dgindx.focusIndex + 1;
  2107. var selIndxCd = model.getValue("/root/main/indxlist/item[" + iIndx + "]/indxcd");
  2108. var selIndxDrdiflag = model.getValue("/root/main/indxlist/item[" + iIndx + "]/indxdrdiflag");
  2109. var msg = messageBox("색인을", "Q012");
  2110. if(msg == "7"){
  2111. return;
  2112. }
  2113. switch(selTab){
  2114. case "D":
  2115. copyNodeset("/root/send/reqdata/diagindxlist", "/root/hidden/reqdata/diagindxlist");
  2116. model.makeValue("/root/send/reqdata/chnginfo/chngindxcd", selIndxCd);
  2117. model.makeValue("/root/send/reqdata/chnginfo/indxdrdiflag", selIndxDrdiflag);
  2118. model.makeValue("/root/send/reqdata/chnginfo/indxflag", selTab);
  2119. if(msg == "6"){
  2120. if(submit("TXMRT00205")){
  2121. messageBox("색인 변경이","I001");
  2122. grd_diagcd.refresh();
  2123. } else {
  2124. messageBox("색인 변경을","E009");
  2125. }
  2126. }
  2127. model.removeNodeset("/root/send/reqdata");
  2128. model.removeNodeset("/root/hidden/reqdata");
  2129. break;
  2130. case "K":
  2131. copyNodeset("/root/send/reqdata/kcd4mindxlist", "/root/hidden/reqdata/kcd4mindxlist");
  2132. model.makeValue("/root/send/reqdata/chnginfo/chngindxcd", selIndxCd);
  2133. model.makeValue("/root/send/reqdata/chnginfo/indxdrdiflag", selIndxDrdiflag);
  2134. model.makeValue("/root/send/reqdata/chnginfo/indxflag", selTab);
  2135. if(msg == "6"){
  2136. if(submit("TXMRT00205")){
  2137. messageBox("색인 변경이","I001");
  2138. grd_diagcd.refresh();
  2139. } else {
  2140. messageBox("색인 변경을","E009");
  2141. }
  2142. }
  2143. model.removeNodeset("/root/send/reqdata");
  2144. model.removeNodeset("/root/hidden/reqdata");
  2145. break;
  2146. }
  2147. }
  2148. /**
  2149. * @group :
  2150. * @ver : 2008.12.11
  2151. * @by : 나종천
  2152. * @---------------------------------------------------
  2153. * @type : function
  2154. * @access : public
  2155. * @desc : 대체코드 검색
  2156. * @param :
  2157. * @return :
  2158. * @---------------------------------------------------
  2159. */
  2160. function fCallTermSrch(ref1){
  2161. var alttermcd = model.getValue("/root/main/peprterminfo/info/alttermcd");
  2162. var curr_date = model.getValue("/root/init/today");
  2163. model.removeNodeset("/root/temp/terminfo/altterminfo");
  2164. setParameter("SPMRT01500_param_nodepath", "/root/temp/terminfo/altterminfo");
  2165. setParameter("SPMRT01500_SEARCHDATA", alttermcd);
  2166. setParameter("SPMRT01500_FLAG", "1");
  2167. setParameter("stndd", curr_date);
  2168. // 2009-08-03 nj 추가
  2169. setParameter("maininstyn", "Y");
  2170. modal("SPMRT01500");
  2171. if(getParameter("SPMRT01500_FLAG") == ""){
  2172. return;
  2173. }
  2174. if(getNodesetCnt(model,"/root/temp/terminfo/altterminfo")>0){
  2175. model.setValue(ref1, model.getValue("/root/temp/terminfo/altterminfo/selectdiaglist/diagcd"));
  2176. ipt_alttermcd.refresh();
  2177. return true;
  2178. } else {
  2179. return false;
  2180. }
  2181. }
  2182. /**
  2183. * @group :
  2184. * @ver : 2009.02.09
  2185. * @by : 강지훈
  2186. * @---------------------------------------------------
  2187. * @type : function
  2188. * @access : public
  2189. * @desc : 기관별 용어 사용여부 설정
  2190. * @param :
  2191. * @return :
  2192. * @---------------------------------------------------
  2193. */
  2194. function fTermUseSave(){
  2195. model.removeNodeset("/root/send");
  2196. var RowCnt = grd_icd10.rows;
  2197. model.makeValue("/root/send/termuse",getGridUpdateData(grd_diagcd));
  2198. submit("TXMRT00206");
  2199. model.refresh();
  2200. }
  2201. /**
  2202. * @group :
  2203. * @ver : 2009.07.16
  2204. * @by : 이은영
  2205. * @---------------------------------------------------
  2206. * @type : function
  2207. * @access : public
  2208. * @desc : 스크롤 페이지단위 조회
  2209. * @param :
  2210. * @return :
  2211. * @---------------------------------------------------
  2212. */
  2213. var pinfo = 1;
  2214. var pagesize = 10000;
  2215. function fSubmitOnScroll() {
  2216. if(grd_deptdiag.vscroll.attribute("max") == grd_deptdiag.vscroll.attribute("pos")) { // end of scroll
  2217. if ( (grd_deptdiag.rows-grd_deptdiag.fixedRows) < eval(pinfo*pagesize))return;
  2218. model.makeValue("/root/send/pagesize",pagesize);
  2219. model.makeValue("/root/send/offset", grd_deptdiag.rows-grd_deptdiag.fixedRows); // grid의 header row는 제외
  2220. submit("TRMRT00212");
  2221. pinfo += 1;
  2222. grd_deptdiag.dispatch("onmouseup"); // 스크롤바 처리를 위한 이벤트 발생
  2223. }
  2224. }