MRD00700.js 101 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963
  1. /**
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 진료 - 질병 및 수술분류 ( SMMRD00700_질병및수술분류.xrw - JScript )
  4. - Version :
  5. 1) : Ver.1.00.01
  6. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  7. **/
  8. /**
  9. * @ver : 2007/12/27
  10. * @desc :폼초기화 및 공통코드 load,opener여부
  11. * @ :
  12. * @by : 이창록
  13. * @param :
  14. * @return :
  15. * @---------------------------------------------------
  16. **/
  17. function fInitialize()
  18. {
  19. // KNUH_20101207_박성호_start_의무기록 부서코드 가져오기
  20. mmbfGetHardCodeInfo("/root/send/reqdata", "/root/temp/deptcd", 5501);
  21. mmbfGetHardCodeInfo("/root/send/reqdata", "/root/temp/dutplcecd", 5502);
  22. // KNUH_20101207_박성호_end
  23. //공통코드 가져오기(종교,감염종류1,감염원인2,합병증,재수술코드,직업,차트상태,주/부진단,R/o진단,확정진단,종양구분,가코딩사유코드 가져오기)
  24. zbcfGetCodeList(new Array("M0070","M0151","M0414", "M0484", "M0159","M0149","M0416","M0019","M0018","M0417","M0433","M0434", "M0415"),
  25. new Array("/root/init/relignList","/root/init/maryStatList","/root/init/cmpllist", "/root/init/infccaselist","/root/init/reOpResnList",
  26. "/root/init/jobList","/root/init/disposstatlist","/root/init/diagkindcdflag",
  27. "/root/init/diagkindcd","/root/init/unprepstatlist","/root/init/cncrlist","/root/init/tmpcoderesnlist", "/root/init/wundcasclslist"), true);
  28. zsdfGetInOrdDeptList(getUserInfo("dutplceinstcd"), "/root/init/diagchgndeptlist", "depthngnm", "asc");// 임상과리스트
  29. copyNodeset("/root/init/opchgndeptlist/dept", "/root/init/diagchgndeptlist/dept");
  30. model.removeNodeset("/root/main/indxinfo/ccindxinfo/ccindxlist");
  31. model.removeNodeset("/root/main/indxinfo/bfindxlist/bfindxinfo");
  32. model.removeNodeset("/root/main/indxinfo/diagindxinfo/diagindxlist");
  33. model.removeNodeset("/root/main/indxinfo/diaginfo/diaglist");
  34. model.removeNodeset("/root/main/indxinfo/insudiaginfo/insudiaglist");
  35. model.removeNodeset("/root/opinfo/opindxdtlinfo/opindxdtllist");
  36. model.removeNodeset("/root/main/indxinfo/cnstinfo/cnstlist");
  37. model.removeNodeset("/root/main/indxinfo/opinfo/oplist");
  38. model.removeNodeset("/root/main/indxinfo/cureindxinfo/cureindxlist");
  39. model.removeNodeset("/root/main/indxinfo/dethindxinfo/dethindxlist");
  40. model.removeNodeset("/root/main/indxinfo/serdiaginfo/serdiaglist");
  41. model.removeNodeset("/root/main/indxinfo/cnstinfo/cnstlist");
  42. if(checkOpener()){
  43. var parampid = opener.javascript.getParameter("SMMRD00400_pid");
  44. var paramdschdd = opener.javascript.getParameter("SMMRD00400_dschdd");
  45. fUserAdmin();//의료정보사용자한하여 저장버튼 visible
  46. chk_cretchknum.value = "false";
  47. model.setValue("/root/main/indxinfo/dschpatinfo/patinfo/pid", parampid);
  48. if(parampid != "")
  49. {
  50. fPidKeyPress();
  51. if(paramdschdd!=""){
  52. var sDschdd=model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd");
  53. if(paramdschdd!=sDschdd){
  54. cmb_dschdd.refresh();
  55. model.setValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd", paramdschdd);
  56. fSelectDschdd();
  57. }
  58. }
  59. }
  60. }
  61. model.refresh();
  62. }
  63. /**
  64. * @desc : 수술 색인정보 조회
  65. * @id :
  66. * @event : xforms
  67. * @return : void
  68. * @authur :
  69. */
  70. function fOpIndxInfo()
  71. {
  72. submit("TRMRD00706");
  73. }
  74. function fOpIndxList()
  75. {
  76. submit("TRMRD00707");
  77. }
  78. /**
  79. * @desc : 등록번호로 조회
  80. * @id :
  81. * @event : xforms
  82. * @return : void
  83. * @authur :
  84. */
  85. function fPidKeyPress()
  86. {
  87. button99.dispatch("onclick");
  88. var sPid = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid");
  89. var instcd= getUserInfo("dutplceinstcd");
  90. if(model.getValue("/root/init/checknum/value") == "true"){//체킹번호 체크
  91. var cret_pid = getCretCheckNo(sPid, instcd);
  92. model.makeValue("/root/send/reqdata/pid", cret_pid);
  93. model.makeValue("/root/main/indxinfo/dschpatinfo/patinfo/pid", cret_pid);
  94. } else {
  95. model.makeValue("/root/send/reqdata/pid", sPid);
  96. }
  97. // 이중번호 체크 관련
  98. model.makeValue("/root/send/cond/srchcond", "1");
  99. model.makeValue("/root/send/cond/pid", ipt_pid.currentText);
  100. if(model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid").length >= 1 )
  101. {
  102. if(submit("TRPMC02500"))
  103. {
  104. model.removeNodeset("/root/main/indxinfo/infdisinfo/infdislist");
  105. model.makeValue("/root/send/reqdata/instcd",instcd);
  106. if(submit("TRMRD00703")){
  107. //퇴원일자와 동시에 퇴원일자에 따른 환자내용 가져오기
  108. if(getNodesetCnt(model,"/root/init/dschpatinfo/chgdschinfo/chgdschddlist")>0){
  109. var dschdd = model.getValue("/root/init/dschpatinfo/chgdschinfo/chgdschddlist/dschdd[1]");
  110. var dschddnm = model.getValue("/root/init/dschpatinfo/chgdschinfo/chgdschddlist/dschddnm[1]");
  111. var indxmyn = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/indxmyn");
  112. model.setValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd" ,dschddnm);
  113. model.makeValue("/root/send/reqdata/dschdd" ,dschdd);
  114. model.makeValue("/root/send/reqdata/indd" ,model.getValue("/root/init/dschpatinfo/chgdschinfo/chgdschddlist[dschdd='"+dschdd+"']/indd"));
  115. model.makeValue("/root/send/reqdata/cretno" ,model.getValue("/root/init/dschpatinfo/chgdschinfo/chgdschddlist[dschdd='"+dschdd+"']/cretno"));
  116. fOpIndxInfo();
  117. if(submit("TRMRD00702")){
  118. //2013/01/08 Start 퇴원분석이 되지 않은 상태에서는 질병 및 수술분류를 하지 못하도록 블럭킹 처리
  119. var getcretno=model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/cretno");
  120. if(getcretno==""){
  121. messageBox("퇴원 분석 후 ","C003");
  122. btn_save.disabled=true;
  123. return;
  124. }
  125. btn_save.disabled=false;
  126. //2013/01/08 End
  127. var code = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/infccas");
  128. var chngdeptyn = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/chngdeptyn");
  129. fGetInFcCas(code);
  130. fChgTmpCodeyn();
  131. if(chngdeptyn !="Y"){ //전출 여부에 따른 진단,수술 전출과컬럼 disabled
  132. grd_diagindxlist.colDisabled(grd_diagindxlist.colRef("chngdeptcd"))=true;
  133. grd_diagindxlist.colDisabled(grd_diagindxlist.colRef("chngclrsdeptcd"))=true;
  134. grd_opindxlist.colDisabled(grd_opindxlist.colRef("chngdeptcd"))=true;
  135. grd_opindxlist.colDisabled(grd_opindxlist.colRef("chngclrsdeptcd"))=true;
  136. }else{
  137. grd_diagindxlist.colDisabled(grd_diagindxlist.colRef("chngdeptcd"))=false;
  138. grd_diagindxlist.colDisabled(grd_diagindxlist.colRef("chngclrsdeptcd"))=false;
  139. grd_opindxlist.colDisabled(grd_opindxlist.colRef("chngdeptcd"))=false;
  140. grd_opindxlist.colDisabled(grd_opindxlist.colRef("chngclrsdeptcd"))=false;
  141. }
  142. if(getNodesetCnt(model,"/root/main/indxinfo/infdisinfo/infdislist")>0){
  143. model.setValue("/root/main/indxinfo/dschpatinfo/patinfo/infdisyn","01");
  144. btn_infdis.disabled= false;
  145. }else{
  146. model.setValue("/root/main/indxinfo/dschpatinfo/patinfo/infdisyn","02");
  147. btn_infdis.disabled= true;
  148. }
  149. model.makeValue("/root/main/indxinfo/dschpatinfo/patinfo/infdisyncd",model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/infdisyn"));
  150. cmb_infdisyn.refresh();
  151. ipt_infdisyncd.refresh();
  152. var sPid = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid");
  153. var sDschDD = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd");
  154. sDschDD = sDschDD.substr(0,4)+"/"+sDschDD.substr(4,2)+"/"+sDschDD.substr(6,2)
  155. var diagtermcd = model.getValue("/root/main/indxinfo/diagindxinfo/diagindxlist/diagtermcd");
  156. var fstrgstdt = model.getValue("/root/main/indxinfo/indxmastinfo/indxmast/fstrgstdt");
  157. var fstrgstrnm = model.getValue("/root/main/indxinfo/indxmastinfo/indxmast/fstrgstrnm");
  158. if((diagtermcd!="")&&((fstrgstdt!="")||(fstrgstrnm!="")) ){
  159. messageBox(sPid + "환자의" + sDschDD +"의 질병및수술분류가 되어","I010");
  160. }
  161. }
  162. }else{
  163. messageBox("없는 환자 번호 입니다.", "E999", "");
  164. model.setFocus("ipt_pid");
  165. }
  166. }
  167. }
  168. }else{
  169. messageBox("환자등록번호를 정확히", "C001");
  170. }
  171. model.refresh();
  172. }
  173. /**
  174. * @desc : 환자의 퇴원일자 가져오기
  175. * @id :
  176. * @event : xforms
  177. * @return : void
  178. * @authur :
  179. */
  180. function fSelectDschdd()
  181. {
  182. //퇴원일자 선택시 모든 정보 변경
  183. var dschdd=model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd");
  184. var sPid=model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid");
  185. var indd=model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/orgindd");
  186. var cretno=model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/cretno");
  187. model.removeNodeset("/root/main/indxinfo/infdisinfo/infdislist");
  188. model.makeValue("/root/send/reqdata/dschdd" ,dschdd);
  189. model.makeValue("/root/send/reqdata/pid" ,sPid);
  190. model.makeValue("/root/send/reqdata/indd" ,model.getValue("/root/init/dschpatinfo/chgdschinfo/chgdschddlist[dschdd='"+dschdd+"']/indd"));
  191. model.makeValue("/root/send/reqdata/cretno" ,model.getValue("/root/init/dschpatinfo/chgdschinfo/chgdschddlist[dschdd='"+dschdd+"']/cretno"));
  192. if(submit("TRMRD00702")){
  193. //2013/01/08 Start 퇴원분석이 되지 않은 상태에서는 질병 및 수술분류를 하지 못하도록 블럭킹 처리
  194. var getcretno=model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/cretno");
  195. if(getcretno==""){
  196. messageBox("퇴원 분석 후 ","C003");
  197. btn_save.disabled=true;
  198. return;
  199. }
  200. btn_save.disabled=false;
  201. //2013/01/08 End
  202. var code = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/infccas");
  203. var chngdeptyn = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/chngdeptyn");
  204. fGetInFcCas(code);
  205. fChgTmpCodeyn();
  206. // 수술정보 가져오기(20120831 이윤주)
  207. fOpIndxInfo();
  208. if(chngdeptyn !="Y"){ //전출 여부에 따른 진단,수술 전출과컬럼 disabled
  209. grd_diagindxlist.colDisabled(grd_diagindxlist.colRef("chngdeptcd"))=true;
  210. grd_diagindxlist.colDisabled(grd_diagindxlist.colRef("chngclrsdeptcd"))=true;
  211. grd_opindxlist.colDisabled(grd_opindxlist.colRef("chngdeptcd"))=true;
  212. grd_opindxlist.colDisabled(grd_opindxlist.colRef("chngclrsdeptcd"))=true;
  213. }else{
  214. grd_diagindxlist.colDisabled(grd_diagindxlist.colRef("chngdeptcd"))=false;
  215. grd_diagindxlist.colDisabled(grd_diagindxlist.colRef("chngclrsdeptcd"))=false;
  216. grd_opindxlist.colDisabled(grd_opindxlist.colRef("chngdeptcd"))=false;
  217. grd_opindxlist.colDisabled(grd_opindxlist.colRef("chngclrsdeptcd"))=false;
  218. }
  219. if(getNodesetCnt(model,"/root/main/indxinfo/infdisinfo/infdislist")>0){
  220. model.setValue("/root/main/indxinfo/dschpatinfo/patinfo/infdisyn","01");
  221. btn_infdis.disabled= false;
  222. }else{
  223. model.setValue("/root/main/indxinfo/dschpatinfo/patinfo/infdisyn","02");
  224. btn_infdis.disabled= true;
  225. }
  226. model.makeValue("/root/main/indxinfo/dschpatinfo/patinfo/infdisyncd",model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/infdisyn"));
  227. cmb_infdisyn.refresh();
  228. ipt_infdisyncd.refresh();
  229. var sPid = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid");
  230. var sDschDD = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd");
  231. sDschDD = sDschDD.substr(0,4)+"/"+sDschDD.substr(4,2)+"/"+sDschDD.substr(6,2)
  232. var diagtermcd = model.getValue("/root/main/indxinfo/diagindxinfo/diagindxlist/diagtermcd");
  233. var fstrgstdt = model.getValue("/root/main/indxinfo/indxmastinfo/indxmast/fstrgstdt");
  234. var fstrgstrnm = model.getValue("/root/main/indxinfo/indxmastinfo/indxmast/fstrgstrnm");
  235. if((diagtermcd!="")&&((fstrgstdt!="")||(fstrgstrnm!="")) ){
  236. messageBox(sPid + "환자의" + sDschDD +"의 질병및수술분류가 되어","I010");
  237. }
  238. }
  239. }
  240. /**
  241. * @desc :
  242. * @id : 주호소 팝업 과 연계
  243. * @event : xforms-select
  244. * @return : void
  245. * @authur :
  246. */
  247. function fCcIndxList(flag)
  248. {
  249. var sPid = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid");
  250. var sDschdd = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd");
  251. if((sPid=="")&&(sDschdd=="")){
  252. messageBox("퇴원일자가 선택되지" ,"E007");
  253. return;
  254. }
  255. clearParameter("SPMRF04200_SEARCHDATA");
  256. model.removeNodeset("/root/temp/selectdiaglist");
  257. var ccengnm = model.getValue("/root/main/indxinfo/ccindxinfo/ccindxlist["+grd_ccindxlist.Row+"]/ccengnm");
  258. var cCol=grd_ccindxlist.col;
  259. if(flag == "eng"){
  260. if(ccengnm==""){
  261. return;
  262. }else
  263. setParameter("SPMRF04200_SEARCHDATA", ccengnm);
  264. }else{
  265. setParameter("SPMRF04200_SEARCHDATA","");
  266. }
  267. modal("SPMRF04200");
  268. var nodelist = instance1.selectNodes("/root/temp/selectdiaglist");
  269. for(var i = 1; i <= nodelist.length; i++)
  270. {
  271. var termcd = model.getValue("/root/temp/selectdiaglist["+i+"]/termcd");
  272. var termengnm = model.getValue("/root/temp/selectdiaglist["+i+"]/termengnm");
  273. var termhngnm = model.getValue("/root/temp/selectdiaglist["+i+"]/termhngnm");
  274. var pid = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid");
  275. var dschdd = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd");
  276. var instcd = getUserInfo("dutplceinstcd");
  277. var iFndRow = grd_ccindxlist.findRow(termcd, 0, parseInt(grd_ccindxlist.colRef("cctermcd")), "true", "true");//중복 code check
  278. if(flag != "eng"){
  279. if(iFndRow > 0){
  280. messageBox(termcd+" 코드는 이미입력하신 코드","I009");
  281. }else{
  282. grd_ccindxlist.addRow(false);
  283. model.makeValue("/root/main/indxinfo/ccindxinfo/ccindxlist["+grd_ccindxlist.Row+"]/cctermcd", termcd);
  284. model.makeValue("/root/main/indxinfo/ccindxinfo/ccindxlist["+grd_ccindxlist.Row+"]/cchngnm" , termhngnm);
  285. model.makeValue("/root/main/indxinfo/ccindxinfo/ccindxlist["+grd_ccindxlist.Row+"]/ccengnm" , termengnm);
  286. model.setValue("/root/main/indxinfo/ccindxinfo/ccindxlist["+grd_ccindxlist.Row+"]/pid" , pid);
  287. model.setValue("/root/main/indxinfo/ccindxinfo/ccindxlist["+grd_ccindxlist.Row+"]/dschdd" , dschdd);
  288. model.setValue("/root/main/indxinfo/ccindxinfo/ccindxlist["+grd_ccindxlist.Row+"]/instcd" , instcd);
  289. grd_ccindxlist.refresh();
  290. }
  291. }else if((flag == "eng") && (i != 1)){
  292. if(iFndRow > 0){
  293. messageBox(termcd+" 코드는 이미입력하신 코드","I009");
  294. }else{
  295. grd_ccindxlist.addRow(false);
  296. model.makeValue("/root/main/indxinfo/ccindxinfo/ccindxlist["+grd_ccindxlist.Row+"]/cctermcd", termcd);
  297. model.makeValue("/root/main/indxinfo/ccindxinfo/ccindxlist["+grd_ccindxlist.Row+"]/cchngnm" , termhngnm);
  298. model.makeValue("/root/main/indxinfo/ccindxinfo/ccindxlist["+grd_ccindxlist.Row+"]/ccengnm" , termengnm);
  299. model.setValue("/root/main/indxinfo/ccindxinfo/ccindxlist["+grd_ccindxlist.Row+"]/pid" , pid);
  300. model.setValue("/root/main/indxinfo/ccindxinfo/ccindxlist["+grd_ccindxlist.Row+"]/dschdd" , dschdd);
  301. model.setValue("/root/main/indxinfo/ccindxinfo/ccindxlist["+grd_ccindxlist.Row+"]/instcd" , instcd);
  302. grd_ccindxlist.refresh();
  303. }
  304. }else if((flag == "eng") && (i == 1)){
  305. if(iFndRow > 0){
  306. messageBox(termcd+" 코드는 이미입력하신 코드","I009");
  307. }else{
  308. model.makeValue("/root/main/indxinfo/ccindxinfo/ccindxlist["+grd_ccindxlist.Row+"]/cctermcd", termcd);
  309. model.makeValue("/root/main/indxinfo/ccindxinfo/ccindxlist["+grd_ccindxlist.Row+"]/cchngnm" , termhngnm);
  310. model.makeValue("/root/main/indxinfo/ccindxinfo/ccindxlist["+grd_ccindxlist.Row+"]/ccengnm" , termengnm);
  311. model.setValue("/root/main/indxinfo/ccindxinfo/ccindxlist["+grd_ccindxlist.Row+"]/pid" , pid);
  312. model.setValue("/root/main/indxinfo/ccindxinfo/ccindxlist["+grd_ccindxlist.Row+"]/dschdd" , dschdd);
  313. model.setValue("/root/main/indxinfo/ccindxinfo/ccindxlist["+grd_ccindxlist.Row+"]/instcd" , instcd);
  314. grd_ccindxlist.refresh();
  315. }
  316. }
  317. }
  318. model.refresh();
  319. }
  320. /**
  321. * @desc :
  322. * @id : 진단 팝업과 연계
  323. * @event : xforms-select
  324. * @return : void
  325. * @authur :
  326. */
  327. function fDiagIndxList(flag){
  328. //진단용어
  329. var sPid = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid");
  330. var sDschdd = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd");
  331. var iCol = grd_diagindxlist.colRef("dispdiagcd");
  332. var diagRow = grd_diagindxlist.row - grd_diagindxlist.fixedRows + 1
  333. if((sPid=="")&&(sDschdd=="")){
  334. messageBox("퇴원일자가 선택되지" ,"E007");
  335. return;
  336. }
  337. clearParameter("SPMRT01600_FLAG");
  338. clearParameter("SPMRT01600_SEARCHDATA");
  339. clearParameter("stndd");
  340. model.removeNodeset("/root/temp/selectdiaglist");
  341. model.removeNodeset("/root/tmp/selectoplist");
  342. var dispdiagcd = model.getValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+diagRow+"]/dispdiagcd");
  343. if((iCol!="")&&(flag == "code")){
  344. if(dispdiagcd !=""){
  345. if(dispdiagcd.indexOf("/") > 0){
  346. setParameter("SPMRT01600_FLAG","2");
  347. }else{
  348. setParameter("SPMRT01600_FLAG","1");
  349. setParameter("stndd",sDschdd);
  350. }
  351. setParameter("SPMRT01600_SEARCHDATA",dispdiagcd);
  352. setParameter("stndd",sDschdd);
  353. }else
  354. return;
  355. }else{
  356. setParameter("SPMRT01600_FLAG","1");
  357. setParameter("stndd",sDschdd);
  358. }
  359. modal("SPMRT01600");
  360. var nodelist = instance1.selectNodes("/root/temp/selectdiaglist");
  361. var duplFlag = false;
  362. for(var i = 1; i <= nodelist.length; i++)
  363. {
  364. var diagcd = model.getValue("/root/temp/selectdiaglist["+i+"]/diagcd"); //진단코드
  365. var dispdiagcd = model.getValue("/root/temp/selectdiaglist["+i+"]/dispdiagcd"); //진단속성코드
  366. var diagengnm = model.getValue("/root/temp/selectdiaglist["+i+"]/diagengnm");
  367. var diaghngnm = model.getValue("/root/temp/selectdiaglist["+i+"]/diaghngnm");
  368. var seqno = model.getValue("/root/temp/selectdiaglist["+i+"]/seqno"); //Mophology 코드 순번
  369. var lglydisflag = model.getValue("/root/temp/selectdiaglist["+i+"]/lglydisflag"); //전염병 구분
  370. var pid = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid");
  371. var dschdd = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd");
  372. var instcd = getUserInfo("dutplceinstcd");
  373. for(var rowcnt = 0; rowcnt < grd_diagindxlist.rows; rowcnt++){
  374. if((model.getValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+ rowcnt + "]/diagtermcd") == diagcd)
  375. && (model.getValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+ rowcnt + "]/diagseqno") == seqno)){
  376. duplFlag = true;
  377. break;
  378. } else {
  379. duplFlag = false;
  380. }
  381. }
  382. if(flag != "code"){
  383. if(duplFlag == true){
  384. messageBox(diagcd+" 코드는 이미입력하신 코드","I009");
  385. }else{
  386. grd_diagindxlist.addRow(false);
  387. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/poa" , "Y");
  388. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/diagtermcd" , diagcd);
  389. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/dispdiagcd" , dispdiagcd);
  390. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/hngnm" , diaghngnm);
  391. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/engnm" , diagengnm);
  392. if((lglydisflag=="00")||(lglydisflag=="")){
  393. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/lglydisflag" , "");
  394. }else{
  395. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/lglydisflag" , lglydisflag+"군");
  396. }
  397. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/diagseqno" , seqno);
  398. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/pid" , pid);
  399. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/dschdd" , dschdd);
  400. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/instcd" , instcd);
  401. //grd_diagindxlist.refresh();
  402. }
  403. }else if((flag == "code")&& (i != 1)){
  404. if(duplFlag == true){
  405. messageBox(diagcd+" 코드는 이미입력하신 코드","I009");
  406. }else{
  407. grd_diagindxlist.addRow(false);
  408. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/poa" , "Y");
  409. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/diagtermcd" , diagcd);
  410. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/dispdiagcd" , dispdiagcd);
  411. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/hngnm" , diaghngnm);
  412. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/engnm" , diagengnm);
  413. if((lglydisflag=="00")||(lglydisflag=="")){
  414. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/lglydisflag" , "");
  415. }else{
  416. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/lglydisflag" , lglydisflag+"군");
  417. }
  418. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/diagseqno" , seqno);
  419. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/pid" , pid);
  420. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/dschdd" , dschdd);
  421. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/instcd" , instcd);
  422. //grd_diagindxlist.refresh();
  423. }
  424. }else if((flag == "code") && (i == 1)){
  425. if(duplFlag == true){
  426. messageBox(diagcd+" 코드는 이미입력하신 코드","I009");
  427. }else{
  428. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/poa" , "Y");
  429. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/diagtermcd" , diagcd);
  430. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/dispdiagcd" , dispdiagcd);
  431. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/hngnm" , diaghngnm);
  432. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/engnm" , diagengnm);
  433. if((lglydisflag=="00")||(lglydisflag=="")){
  434. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/lglydisflag" ,"");
  435. }else{
  436. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/lglydisflag" , lglydisflag+"군");
  437. }
  438. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/diagseqno" , seqno);
  439. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/pid" , pid);
  440. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/dschdd" , dschdd);
  441. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/instcd" , instcd);
  442. //grd_diagindxlist.refresh();
  443. }
  444. }
  445. }
  446. //수술용어
  447. if(getNodesetCnt(model,"/root/tmp/selectoplist")>0){
  448. var nodelist = instance1.selectNodes("/root/tmp/selectoplist");
  449. for(var i = 1; i <= nodelist.length; i++){
  450. var opcd = model.getValue("/root/tmp/selectoplist["+i+"]/opcd");
  451. var dispopcd = model.getValue("/root/tmp/selectoplist["+i+"]/dispopcd");
  452. var opengnm = model.getValue("/root/tmp/selectoplist["+i+"]/opengnm");
  453. var ophngnm = model.getValue("/root/tmp/selectoplist["+i+"]/ophngnm");
  454. var pid = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid");
  455. var dschdd=model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd");
  456. var instcd= getUserInfo("dutplceinstcd");
  457. var opflag=1;//수술,처치 구분 수술="0",처치="1"
  458. var iFndRow1 = grd_cureindxlist.findRow(opcd, 0, parseInt(grd_cureindxlist.colRef("optermcd")), "true", "true");//중복 code check
  459. if(flag != "code"){
  460. if(iFndRow1>0){
  461. messageBox(opcd+" 코드는 이미입력하신 코드","I009");
  462. }else{
  463. grd_cureindxlist.addRow(false);
  464. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/disoptermcd" ,dispopcd);
  465. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/optermcd" ,opcd);
  466. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/ophngnm" ,ophngnm);
  467. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/opengnm" ,opengnm);
  468. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/pid" ,pid);
  469. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/dschdd" ,dschdd);
  470. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/instcd" ,instcd);
  471. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/opflag" ,opflag);
  472. //grd_cureindxlist.refresh();
  473. }
  474. }else if((flag == "code") && (i != 1)){
  475. if(iFndRow1>0){
  476. messageBox(opcd+" 코드는 이미입력하신 코드","I009");
  477. }else{
  478. grd_cureindxlist.addRow(false);
  479. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/disoptermcd" ,dispopcd);
  480. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/optermcd" ,opcd);
  481. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/ophngnm" ,ophngnm);
  482. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/opengnm" ,opengnm);
  483. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/pid" ,pid);
  484. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/dschdd" ,dschdd);
  485. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/instcd" ,instcd);
  486. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/opflag" ,opflag);
  487. // grd_cureindxlist.refresh();
  488. }
  489. }else if((flag == "code") && (i == 1)){
  490. if(iFndRow1>0){
  491. messageBox(opcd+" 코드는 이미입력하신 코드","I009");
  492. }else{
  493. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/disoptermcd" ,dispopcd);
  494. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/optermcd" ,opcd);
  495. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/ophngnm" ,ophngnm);
  496. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/opengnm" ,opengnm);
  497. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/pid" ,pid);
  498. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/dschdd" ,dschdd);
  499. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/instcd" ,instcd);
  500. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/opflag" ,opflag);
  501. // grd_cureindxlist.refresh();
  502. }
  503. }
  504. }
  505. }
  506. model.refresh();
  507. }
  508. /**
  509. * @desc :
  510. * @id : 수술 팝업
  511. * @event : xforms-select
  512. * @return : void
  513. * @authur :
  514. */
  515. function fOpGridIndxList(flag)
  516. {
  517. var sPid = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid");
  518. var sDschdd = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd");
  519. var iCol = grd_opindxlist.col;
  520. if((sPid=="")&&(sDschdd=="")){
  521. messageBox("퇴원일자가 선택되지" ,"E007");
  522. return;
  523. }
  524. clearParameter("SPMRT01600_FLAG");
  525. clearParameter("SPMRT01600_SEARCHDATA");
  526. clearParameter("stndd");
  527. model.removeNodeset("/root/temp/selectdiaglist");
  528. model.removeNodeset("/root/tmp/selectoplist");
  529. var disoptermcd =model.getValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/disoptermcd");
  530. if((iCol!="")&&(flag == "code")){
  531. if(disoptermcd !=""){
  532. setParameter("SPMRT01600_FLAG","5");
  533. setParameter("SPMRT01600_SEARCHDATA",disoptermcd);
  534. setParameter("stndd",sDschdd);
  535. }else{
  536. return;
  537. }
  538. }else{
  539. setParameter("SPMRT01600_FLAG","5");
  540. setParameter("stndd",sDschdd);
  541. }
  542. modal("SPMRT01600");
  543. var nodelist = instance1.selectNodes("/root/tmp/selectoplist");
  544. for(var i = 1; i <= nodelist.length; i++){
  545. var opcd = model.getValue("/root/tmp/selectoplist["+i+"]/opcd");
  546. var dispopcd = model.getValue("/root/tmp/selectoplist["+i+"]/dispopcd");
  547. var opengnm = model.getValue("/root/tmp/selectoplist["+i+"]/opengnm");
  548. var ophngnm = model.getValue("/root/tmp/selectoplist["+i+"]/ophngnm");
  549. var pid = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid");
  550. var dschdd = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd");
  551. var instcd = getUserInfo("dutplceinstcd");
  552. var opflag=0;//수술,처치 구분 수술="0",처치="1"
  553. var iFndRow1 = grd_opindxlist.findRow(opcd, 0, parseInt(grd_opindxlist.colRef("optermcd")), "true", "true");//중복 code check
  554. iFndRow1 = 0 ;
  555. var selectedRow = grd_oplist.row ;
  556. var dsopno = model.getValue("/root/main/indxinfo/opinfo/oplist["+selectedRow+"]/dsopno") ;
  557. if(flag != "code"){
  558. if(iFndRow1>0){
  559. messageBox(opcd+" 코드는 이미입력하신 코드","I009");
  560. }else{
  561. grd_opindxlist.addRow(false);
  562. model.makeValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/disoptermcd" ,dispopcd);
  563. model.makeValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/optermcd" ,opcd);
  564. model.makeValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/ophngnm" ,ophngnm);
  565. model.makeValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/opengnm" ,opengnm);
  566. model.setValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/pid" ,pid);
  567. model.setValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/dschdd" ,dschdd);
  568. model.setValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/instcd" ,instcd);
  569. model.makeValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/opflag" ,opflag);
  570. model.makeValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/dsopno" ,dsopno);
  571. //grd_opindxlist.refresh();
  572. }
  573. }else if((flag == "code") && (i != 1)){
  574. if(iFndRow1>0){
  575. messageBox(opcd+" 코드는 이미입력하신 코드","I009");
  576. }else{
  577. grd_opindxlist.addRow(false);
  578. model.makeValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/disoptermcd" ,dispopcd);
  579. model.makeValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/optermcd" ,opcd);
  580. model.makeValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/ophngnm" ,ophngnm);
  581. model.makeValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/opengnm" ,opengnm);
  582. model.setValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/pid" ,pid);
  583. model.setValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/dschdd" ,dschdd);
  584. model.setValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/instcd" ,instcd);
  585. model.makeValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/opflag" ,opflag);
  586. model.makeValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/dsopno" ,dsopno);
  587. // grd_opindxlist.refresh();
  588. }
  589. }else if((flag == "code") && (i == 1)){
  590. if(iFndRow1>0){
  591. messageBox(opcd+" 코드는 이미입력하신 코드","I009");
  592. }else{
  593. model.makeValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/disoptermcd" ,dispopcd);
  594. model.makeValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/optermcd" ,opcd);
  595. model.makeValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/ophngnm" ,ophngnm);
  596. model.makeValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/opengnm" ,opengnm);
  597. model.setValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/pid" ,pid);
  598. model.setValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/dschdd" ,dschdd);
  599. model.setValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/instcd" ,instcd);
  600. model.makeValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/opflag" ,opflag);
  601. model.makeValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+grd_opindxlist.row+"]/dsopno" ,dsopno);
  602. // grd_opindxlist.refresh();
  603. }
  604. }
  605. }
  606. if(getNodesetCnt(model,"/root/temp/selectdiaglist")>0){
  607. var nodelist = instance1.selectNodes("/root/temp/selectdiaglist");
  608. var duplFlag = false;
  609. for(var i = 1; i <= nodelist.length; i++)
  610. {
  611. var diagcd = model.getValue("/root/temp/selectdiaglist["+i+"]/diagcd"); //진단코드
  612. var dispdiagcd = model.getValue("/root/temp/selectdiaglist["+i+"]/dispdiagcd");//진단속성코드
  613. var diagengnm = model.getValue("/root/temp/selectdiaglist["+i+"]/diagengnm");
  614. var diaghngnm = model.getValue("/root/temp/selectdiaglist["+i+"]/diaghngnm");
  615. var seqno = model.getValue("/root/temp/selectdiaglist["+i+"]/seqno");//Mophology 코드 순번
  616. var lglydisflag = model.getValue("/root/temp/selectdiaglist["+i+"]/lglydisflag");
  617. var pid = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid");
  618. var dschdd = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd");
  619. var instcd = getUserInfo("dutplceinstcd");
  620. for(var rowcnt = 0; rowcnt < grd_diagindxlist.rows; rowcnt++){
  621. if((model.getValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+ rowcnt + "]/diagtermcd") == diagcd)
  622. && (model.getValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+ rowcnt + "]/diagseqno") == seqno)){
  623. duplFlag = true;
  624. break;
  625. } else {
  626. duplFlag = false;
  627. }
  628. }
  629. if(flag != "code"){
  630. if(duplFlag == true){
  631. messageBox(diagcd+" 코드는 이미입력하신 코드","I009");
  632. }else{
  633. grd_diagindxlist.addRow(false);
  634. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/diagtermcd" , diagcd);
  635. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/dispdiagcd" , dispdiagcd);
  636. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/hngnm" , diaghngnm);
  637. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/engnm" , diagengnm);
  638. if((lglydisflag=="00")||(lglydisflag=="")){
  639. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/lglydisflag" , "");
  640. }else{
  641. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/lglydisflag" , lglydisflag+"군");
  642. }
  643. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/diagseqno" , seqno);
  644. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/pid" , pid);
  645. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/dschdd" , dschdd);
  646. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/instcd" , instcd);
  647. // grd_diagindxlist.refresh();
  648. }
  649. }else if((flag == "code")&& (i != 1)){
  650. if(duplFlag == true){
  651. messageBox(diagcd+" 코드는 이미입력하신 코드","I009");
  652. }else{
  653. grd_diagindxlist.addRow(false);
  654. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/diagtermcd" , diagcd);
  655. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/dispdiagcd" , dispdiagcd);
  656. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/hngnm" , diaghngnm);
  657. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/engnm" , diagengnm);
  658. if((lglydisflag=="00")||(lglydisflag=="")){
  659. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/lglydisflag" , "");
  660. }else{
  661. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/lglydisflag" , lglydisflag+"군");
  662. }
  663. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/diagseqno" , seqno);
  664. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/pid" , pid);
  665. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/dschdd" , dschdd);
  666. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/instcd" , instcd);
  667. // grd_diagindxlist.refresh();
  668. }
  669. }else if((flag == "code") && (i == 1)){
  670. if(duplFlag == true){
  671. messageBox(diagcd+" 코드는 이미입력하신 코드","I009");
  672. }else{
  673. grd_diagindxlist.addRow(false);
  674. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/diagtermcd" , diagcd);
  675. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/dispdiagcd" , dispdiagcd);
  676. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/hngnm" , diaghngnm);
  677. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/engnm" , diagengnm);
  678. if((lglydisflag=="00")||(lglydisflag=="")){
  679. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/lglydisflag" ,"");
  680. }else{
  681. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/lglydisflag" , lglydisflag+"군");
  682. }
  683. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/diagseqno" , seqno);
  684. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/pid" , pid);
  685. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/dschdd" , dschdd);
  686. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/instcd" , instcd);
  687. //grd_diagindxlist.refresh();
  688. }
  689. }
  690. }
  691. }
  692. model.refresh();
  693. }
  694. function fCureGridIndxList(flag)
  695. {
  696. var sPid = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid");
  697. var sDschdd = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd");
  698. var iCol = grd_cureindxlist.col;
  699. if((sPid=="")&&(sDschdd=="")){
  700. messageBox("퇴원일자가 선택되지" ,"E007");
  701. return;
  702. }
  703. clearParameter("SPMRT01600_FLAG");
  704. clearParameter("SPMRT01600_SEARCHDATA");
  705. clearParameter("stndd");
  706. model.removeNodeset("/root/temp/selectdiaglist");
  707. model.removeNodeset("/root/tmp/selectoplist");
  708. var disoptermcd =model.getValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/disoptermcd");
  709. if((iCol!="")&&(flag == "code")){
  710. if(disoptermcd !=""){
  711. setParameter("SPMRT01600_FLAG","5");
  712. setParameter("SPMRT01600_SEARCHDATA",disoptermcd);
  713. setParameter("stndd",sDschdd);
  714. }else{
  715. return;
  716. }
  717. }else{
  718. setParameter("SPMRT01600_FLAG","5");
  719. setParameter("stndd",sDschdd);
  720. }
  721. modal("SPMRT01600");
  722. var nodelist = instance1.selectNodes("/root/tmp/selectoplist");
  723. for(var i = 1; i <= nodelist.length; i++){
  724. var opcd = model.getValue("/root/tmp/selectoplist["+i+"]/opcd");
  725. var dispopcd = model.getValue("/root/tmp/selectoplist["+i+"]/dispopcd");
  726. var opengnm = model.getValue("/root/tmp/selectoplist["+i+"]/opengnm");
  727. var ophngnm = model.getValue("/root/tmp/selectoplist["+i+"]/ophngnm");
  728. var pid = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid");
  729. var dschdd = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd");
  730. var instcd = getUserInfo("dutplceinstcd");
  731. var opflag=1;//수술,처치 구분 수술="0",처치="1"
  732. var iFndRow1 = grd_cureindxlist.findRow(opcd, 0, parseInt(grd_cureindxlist.colRef("optermcd")), "true", "true");//중복 code check
  733. if(flag != "code"){
  734. if(iFndRow1>0){
  735. messageBox(opcd+" 코드는 이미입력하신 코드","I009");
  736. }else{
  737. grd_cureindxlist.addRow(false);
  738. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/disoptermcd" ,dispopcd);
  739. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/optermcd" ,opcd);
  740. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/ophngnm" ,ophngnm);
  741. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/opengnm" ,opengnm);
  742. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/pid" ,pid);
  743. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/dschdd" ,dschdd);
  744. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/instcd" ,instcd);
  745. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/opflag" ,opflag);
  746. //grd_cureindxlist.refresh();
  747. }
  748. }else if((flag == "code") && (i != 1)){
  749. if(iFndRow1>0){
  750. messageBox(opcd+" 코드는 이미입력하신 코드","I009");
  751. }else{
  752. grd_cureindxlist.addRow(false);
  753. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/disoptermcd" ,dispopcd);
  754. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/optermcd" ,opcd);
  755. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/ophngnm" ,ophngnm);
  756. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/opengnm" ,opengnm);
  757. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/pid" ,pid);
  758. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/dschdd" ,dschdd);
  759. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/instcd" ,instcd);
  760. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/opflag" ,opflag);
  761. // grd_cureindxlist.refresh();
  762. }
  763. }else if((flag == "code") && (i == 1)){
  764. if(iFndRow1>0){
  765. messageBox(opcd+" 코드는 이미입력하신 코드","I009");
  766. }else{
  767. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/disoptermcd" ,dispopcd);
  768. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/optermcd" ,opcd);
  769. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/ophngnm" ,ophngnm);
  770. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/opengnm" ,opengnm);
  771. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/pid" ,pid);
  772. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/dschdd" ,dschdd);
  773. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/instcd" ,instcd);
  774. model.makeValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+grd_cureindxlist.row+"]/opflag" ,opflag);
  775. // grd_cureindxlist.refresh();
  776. }
  777. }
  778. }
  779. if(getNodesetCnt(model,"/root/temp/selectdiaglist")>0){
  780. var nodelist = instance1.selectNodes("/root/temp/selectdiaglist");
  781. var duplFlag = false;
  782. for(var i = 1; i <= nodelist.length; i++)
  783. {
  784. var diagcd = model.getValue("/root/temp/selectdiaglist["+i+"]/diagcd"); //진단코드
  785. var dispdiagcd = model.getValue("/root/temp/selectdiaglist["+i+"]/dispdiagcd");//진단속성코드
  786. var diagengnm = model.getValue("/root/temp/selectdiaglist["+i+"]/diagengnm");
  787. var diaghngnm = model.getValue("/root/temp/selectdiaglist["+i+"]/diaghngnm");
  788. var seqno = model.getValue("/root/temp/selectdiaglist["+i+"]/seqno");//Mophology 코드 순번
  789. var lglydisflag = model.getValue("/root/temp/selectdiaglist["+i+"]/lglydisflag");
  790. var pid = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid");
  791. var dschdd = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd");
  792. var instcd = getUserInfo("dutplceinstcd");
  793. for(var rowcnt = 0; rowcnt < grd_diagindxlist.rows; rowcnt++){
  794. if((model.getValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+ rowcnt + "]/diagtermcd") == diagcd)
  795. && (model.getValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+ rowcnt + "]/diagseqno") == seqno)){
  796. duplFlag = true;
  797. break;
  798. } else {
  799. duplFlag = false;
  800. }
  801. }
  802. if(flag != "code"){
  803. if(duplFlag == true){
  804. messageBox(diagcd+" 코드는 이미입력하신 코드","I009");
  805. }else{
  806. grd_diagindxlist.addRow(false);
  807. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/diagtermcd" , diagcd);
  808. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/dispdiagcd" , dispdiagcd);
  809. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/hngnm" , diaghngnm);
  810. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/engnm" , diagengnm);
  811. if((lglydisflag=="00")||(lglydisflag=="")){
  812. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/lglydisflag" , "");
  813. }else{
  814. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/lglydisflag" , lglydisflag+"군");
  815. }
  816. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/diagseqno" , seqno);
  817. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/pid" , pid);
  818. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/dschdd" , dschdd);
  819. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/instcd" , instcd);
  820. // grd_diagindxlist.refresh();
  821. }
  822. }else if((flag == "code")&& (i != 1)){
  823. if(duplFlag == true){
  824. messageBox(diagcd+" 코드는 이미입력하신 코드","I009");
  825. }else{
  826. grd_diagindxlist.addRow(false);
  827. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/diagtermcd" , diagcd);
  828. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/dispdiagcd" , dispdiagcd);
  829. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/hngnm" , diaghngnm);
  830. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/engnm" , diagengnm);
  831. if((lglydisflag=="00")||(lglydisflag=="")){
  832. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/lglydisflag" , "");
  833. }else{
  834. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/lglydisflag" , lglydisflag+"군");
  835. }
  836. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/diagseqno" , seqno);
  837. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/pid" , pid);
  838. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/dschdd" , dschdd);
  839. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/instcd" , instcd);
  840. // grd_diagindxlist.refresh();
  841. }
  842. }else if((flag == "code") && (i == 1)){
  843. if(duplFlag == true){
  844. messageBox(diagcd+" 코드는 이미입력하신 코드","I009");
  845. }else{
  846. grd_diagindxlist.addRow(false);
  847. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/diagtermcd" , diagcd);
  848. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/dispdiagcd" , dispdiagcd);
  849. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/hngnm" , diaghngnm);
  850. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/engnm" , diagengnm);
  851. if((lglydisflag=="00")||(lglydisflag=="")){
  852. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/lglydisflag" ,"");
  853. }else{
  854. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/lglydisflag" , lglydisflag+"군");
  855. }
  856. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/diagseqno" , seqno);
  857. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/pid" , pid);
  858. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/dschdd" , dschdd);
  859. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+grd_diagindxlist.row+"]/instcd" , instcd);
  860. //grd_diagindxlist.refresh();
  861. }
  862. }
  863. }
  864. }
  865. model.refresh();
  866. }
  867. /**
  868. * @desc : 사망 분석 버튼 클릭(팝업)
  869. * @id :
  870. * @event : xforms-select
  871. * @return : void
  872. * @authur :
  873. */
  874. function fDethPopup()
  875. {
  876. var dschdd =model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd");
  877. var xDschpatinfoPath ="/root/main/indxinfo/dschpatinfo/patinfo";
  878. if(dschdd==""){
  879. messageBox("환자의 퇴원일자가 선택되지", "E007");
  880. return;
  881. }
  882. if(model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dethyn")=="N"){
  883. messageBox("사망환자일 경우에만 선택","I006");
  884. return;
  885. }
  886. var sPid = model.getValue(xDschpatinfoPath+"/pid" );
  887. setParameter("SMMRD00500_pid",sPid);
  888. open("SMMRD00500", 1, 0, 0, "", "", "", "left:0px; top:0px");
  889. }
  890. /**
  891. * @desc : 진단 팝업 선택시(사망인덱스)
  892. * @id :
  893. * @event : xforms-select
  894. * @return : void
  895. * @authur :
  896. */
  897. function fDethCd(flag,editflag)
  898. {
  899. var dPid = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid");
  900. if(dPid ==""){
  901. messageBox("환자번호를","C001");
  902. return;
  903. }
  904. if(model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dethyn")=="N"){
  905. messageBox("사망환자일 경우에만 선택","I006");
  906. return;
  907. }
  908. clearParameter("SPMRT01600_FLAG");
  909. clearParameter("SPMRT01600_SEARCHDATA");
  910. clearParameter("stndd");
  911. model.removeNodeset("/root/temp/selectdiaglist");
  912. var iRow = grd_dethindxlist.row -grd_dethindxlist.fixedRows + 1
  913. var iCol = grd_dethindxlist.col;
  914. var Dschdd = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd");
  915. var basedethcd = model.getValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+iRow+"]/basedethcd");
  916. var mdldethcd = model.getValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+iRow+"]/mdldethcd");
  917. var direcdethcd = model.getValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+iRow+"]/direcdethcd");
  918. if(flag == "B"){
  919. if(((flag == "B")&&(editflag=="1"))&&(iCol==0)){
  920. if(basedethcd!=""){
  921. setParameter("SPMRT01600_FLAG","1");
  922. setParameter("SPMRT01600_SEARCHDATA",basedethcd);
  923. setParameter("stndd",Dschdd);
  924. }else{
  925. if(basedethcd==""){
  926. return;
  927. }
  928. setParameter("SPMRT01600_FLAG","1");
  929. setParameter("stndd",Dschdd);
  930. }
  931. }else{
  932. setParameter("SPMRT01600_FLAG","1");
  933. setParameter("stndd",Dschdd);
  934. }
  935. }else if(flag=="M"){
  936. if(((flag=="M")&&(editflag=="2"))&&(iCol==2)){
  937. if(mdldethcd!=""){
  938. setParameter("SPMRT01600_FLAG","1");
  939. setParameter("SPMRT01600_SEARCHDATA",mdldethcd);
  940. setParameter("stndd",Dschdd);
  941. }else{
  942. if(mdldethcd==""){
  943. return;
  944. }
  945. setParameter("SPMRT01600_FLAG","1");
  946. setParameter("stndd",Dschdd);
  947. }
  948. }else{
  949. setParameter("SPMRT01600_FLAG","1");
  950. setParameter("stndd",Dschdd);
  951. }
  952. }else if(flag =="D"){
  953. if(((flag =="D")&&(editflag=="3"))&&(iCol==4)){
  954. if(direcdethcd!=""){
  955. setParameter("SPMRT01600_FLAG","1");
  956. setParameter("SPMRT01600_SEARCHDATA",direcdethcd);
  957. setParameter("stndd",Dschdd);
  958. }else{
  959. if(direcdethcd==""){
  960. return;
  961. }
  962. setParameter("SPMRT01600_FLAG","1");
  963. setParameter("stndd",Dschdd);
  964. }
  965. }else{
  966. setParameter("SPMRT01600_FLAG","1");
  967. setParameter("stndd",Dschdd);
  968. }
  969. }
  970. modal("SPMRT01600");
  971. var nodelist = instance1.selectNodes("/root/temp/selectdiaglist");
  972. var iRow = grd_dethindxlist.row - grd_dethindxlist.fixedRows + 1
  973. var duplFlag = false;
  974. var nodelist = instance1.selectNodes("/root/temp/selectdiaglist");
  975. for(var i = 1; i <= nodelist.length; i++){
  976. var Disdethcd =model.getValue("/root/temp/selectdiaglist["+i+"]/dispdiagcd");//진단속성코드
  977. var dethcd = model.getValue("/root/temp/selectdiaglist["+i+"]/diagcd"); //진단코드
  978. if(getNodesetCnt(model,"/root/temp/selectdiaglist")>0){
  979. for(var rowcnt = 0; rowcnt < grd_dethindxlist.rows; rowcnt++){
  980. var basedethcd = model.getValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+rowcnt+"]/basedethcd");
  981. var mdldethdiagcd = model.getValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+rowcnt+"]/mdldethdiagcd");
  982. var direcdethcd = model.getValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+rowcnt+"]/direcdethcd");
  983. if((basedethcd == dethcd)||(mdldethdiagcd == dethcd)||(direcdethcd == dethcd)){
  984. duplFlag = true; //중복 코드 체크
  985. break;
  986. } else {
  987. duplFlag = false;
  988. }
  989. }
  990. if(flag =="B"){
  991. if(duplFlag==true){
  992. messageBox(dethcd+" 코드는 이미입력하신 코드","I009");
  993. }else{
  994. grd_dethindxlist.addRow(false);
  995. model.makeValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+grd_dethindxlist.row+"]/basedethcd" ,Disdethcd);
  996. model.makeValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+grd_dethindxlist.row+"]/basedethdiagcd" ,dethcd);
  997. model.makeValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+grd_dethindxlist.row+"]/pid" ,model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid"));
  998. model.makeValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+grd_dethindxlist.row+"]/dschdd" ,model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd"));
  999. model.makeValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+grd_dethindxlist.row+"]/instcd" ,getUserInfo("dutplceinstcd"));
  1000. model.makeValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+grd_dethindxlist.row+"]/dethcdflag1" ,"B");
  1001. }
  1002. }else if((flag == "B")&&(editflag=="1")){
  1003. if(duplFlag==true){
  1004. messageBox(dethcd+" 코드는 이미입력하신 코드","I009");
  1005. }else{
  1006. model.makeValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+grd_dethindxlist.row+"]/basedethcd" ,Disdethcd);
  1007. model.makeValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+grd_dethindxlist.row+"]/basedethdiagcd" ,dethcd);
  1008. model.makeValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+grd_dethindxlist.row+"]/pid" ,model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid"));
  1009. model.makeValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+grd_dethindxlist.row+"]/dschdd" ,model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd"));
  1010. model.makeValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+grd_dethindxlist.row+"]/instcd" ,getUserInfo("dutplceinstcd"));
  1011. model.makeValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+grd_dethindxlist.row+"]/dethcdflag1" ,"B");
  1012. }
  1013. }else if((flag =="M")||(editflag=="2")){
  1014. if(duplFlag==true){
  1015. messageBox(dethcd+" 코드는 이미입력하신 코드","I009");
  1016. }else{
  1017. model.makeValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+grd_dethindxlist.row+"]/mdldethcd" ,Disdethcd);
  1018. model.makeValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+grd_dethindxlist.row+"]/mdldethdiagcd" ,dethcd);
  1019. model.makeValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+grd_dethindxlist.row+"]/dethcdflag2" ,"M");
  1020. }
  1021. }else if((flag =="D")||(editflag=="3")){
  1022. if(duplFlag==true){
  1023. messageBox(dethcd+" 코드는 이미입력하신 코드","I009");
  1024. }else{
  1025. model.makeValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+grd_dethindxlist.row+"]/direcdethcd" ,Disdethcd);
  1026. model.makeValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+grd_dethindxlist.row+"]/direcdethdiagcd" ,dethcd);
  1027. model.makeValue("/root/main/indxinfo/dethindxinfo/dethindxlist["+grd_dethindxlist.row+"]/dethcdflag3" ,"D");
  1028. }
  1029. }
  1030. }
  1031. }
  1032. model.refresh();
  1033. }
  1034. /**
  1035. * @desc : 저장
  1036. * @id :
  1037. * @event : xforms-select(주호소인덱스,진단인덱스,수술인덱스,처치인덱스,가코딩 및 종양구분 저장
  1038. ,감염원인1,감염원인2,전염병,합병증,재수술 업데이트)
  1039. * @return : void
  1040. * @authur :
  1041. */
  1042. function fSave()
  1043. {
  1044. var dschdd = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd");
  1045. var pid = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid");
  1046. var cctermcd = model.getValue("/root/main/indxinfo/ccindxinfo/ccindxlist/cctermcd");
  1047. var diagtermcd = model.getValue("/root/main/indxinfo/diagindxinfo/diagindxlist/diagtermcd");
  1048. var dethyn = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dethyn");
  1049. if(pid=="")
  1050. {
  1051. messageBox("환자 등록번호가 입력되지","E007");
  1052. model.setFocus("ipt_pid");
  1053. return;
  1054. }
  1055. if(dschdd=="")
  1056. {
  1057. messageBox("환자의 퇴원일자가 선택되지", "E007");
  1058. return;
  1059. }
  1060. if(diagtermcd=="")
  1061. {
  1062. messageBox("환자의 진단이 선택되지", "E007");
  1063. return;
  1064. }
  1065. //2012/10/19 Start
  1066. //모든 수술건에 대해서 수술코딩을 했는지 확인
  1067. var nodeSetcnt = getNodesetCount("/root/main/indxinfo/dsopinfo/dsoplist");
  1068. for (var i=1; i<=nodeSetcnt; i++)
  1069. {
  1070. var dsopno = model.getValue("/root/main/indxinfo/dsopinfo/dsoplist["+i+"]/dsopno");
  1071. var dsopinfo = model.getValue("/root/main/indxinfo/dsopinfo/dsoplist["+i+"]/dsopinfo");
  1072. var existcnt = getNodesetCnt(model, "/root/opinfo/opindxdtlinfo/opindxdtllist[dsopno = '" + dsopno + "']");
  1073. if ( existcnt == 0) {
  1074. messageBox("수술코딩 되지 않은 수술정보("+dsopinfo+")가 존재하여 진행 불가합니다", "E999");
  1075. return;
  1076. }
  1077. }
  1078. //2012/10/19 End
  1079. //병용금기상병 체크(20180402 이윤주)
  1080. fGetHardCDList("N", 6157, 0 , "/root/hidden/icd10s");
  1081. var icd10cnt = getNodeSetCnt("/root/hidden/icd10s/hardcd");
  1082. var gicd10cd1 ="";
  1083. var gicd10cd2 ="";
  1084. var t1="";
  1085. var t2="";
  1086. var a1="";
  1087. var a2="";
  1088. for(var i = grd_diagindxlist.fixedrows; i < grd_diagindxlist.rows; i++) {
  1089. gicd10cd1 = grd_diagindxlist.valueMatrix(i,grd_diagindxlist.colRef("dispdiagcd"));
  1090. for(var k = grd_diagindxlist.fixedrows; k < grd_diagindxlist.rows; k++){
  1091. gicd10cd2 = grd_diagindxlist.valueMatrix(k,grd_diagindxlist.colRef("dispdiagcd"));
  1092. t1 = gicd10cd1.split(".")[0];
  1093. t2 = gicd10cd2.split(".")[0];
  1094. for ( var j = 1; j <= icd10cnt; j++) {
  1095. a1 = model.getValue("/root/hidden/icd10s/hardcd["+j+"]/hardcd");
  1096. a2 = model.getValue("/root/hidden/icd10s/hardcd["+j+"]/hardcdnm");
  1097. if (t1+t2==a1+a2 || t1+t2==a2+a1 || t2+t1==a1+a2 || t2+t1==a2+a1 ) {
  1098. messageBox(a1+", "+a2+" 병용 불가상병 재확인 부탁드립니다!","Q");
  1099. return;
  1100. }
  1101. }
  1102. }
  1103. }
  1104. //주호소 인덱스저장
  1105. grd_ccindxlist.clearStatus();
  1106. for(var i = grd_ccindxlist.fixedrows; i < grd_ccindxlist.rows; i++)
  1107. {
  1108. grd_ccindxlist.addStatus(i, "insert")
  1109. }
  1110. //진단 인덱스 저장
  1111. grd_diagindxlist.clearStatus();
  1112. for(var i = grd_diagindxlist.fixedrows; i < grd_diagindxlist.rows; i++)
  1113. {
  1114. grd_diagindxlist.addStatus(i, "insert");
  1115. /*if(i==1){
  1116. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+i+"]/diagkindcdflag","M");
  1117. }else{
  1118. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+i+"]/diagkindcdflag","S");
  1119. }*/
  1120. }
  1121. //수술 인덱스 저장
  1122. grd_opindxlist.clearStatus();
  1123. for(var i = grd_opindxlist.fixedrows; i < grd_opindxlist.rows; i++)
  1124. {
  1125. var opkindcdflag = model.getValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+i+"]/opkindcdflag");
  1126. var dsopno = model.getValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+i+"]/dsopno");
  1127. model.setValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+i+"]/opflag","0");
  1128. grd_opindxlist.addStatus(i, "insert");
  1129. }
  1130. //처치 인덱스 저장
  1131. grd_cureindxlist.clearStatus();
  1132. for(var i = grd_cureindxlist.fixedrows; i < grd_cureindxlist.rows; i++)
  1133. {
  1134. var opkindcdflag = model.getValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+i+"]/opkindcdflag");
  1135. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+i+"]/opflag","1");
  1136. grd_cureindxlist.addStatus(i, "insert");
  1137. }
  1138. //사망 인덱스 저장
  1139. grd_dethindxlist.clearStatus();
  1140. for(var i = grd_dethindxlist.fixedrows; i < grd_dethindxlist.rows; i++)
  1141. {
  1142. grd_dethindxlist.addStatus(i, "insert");
  1143. }
  1144. //주호소인덱스 저장
  1145. model.makeValue("/root/send/savedata/ccindxlist" , grd_ccindxlist.getUpdateData());
  1146. //진단인덱스 저장
  1147. model.makeValue("/root/send/savedata/diagindxlist" , grd_diagindxlist.getUpdateData());
  1148. //수술인덱스 저장
  1149. model.makeValue("/root/send/savedata/opindxlist" , grd_opindxlist.getUpdateData());
  1150. //처지인덱스 저장(20120831 이윤주)
  1151. model.makeValue("/root/send/savedata/cureindxlist" , grd_cureindxlist.getUpdateData());
  1152. //사망인덱스 저장
  1153. if(dethyn =="Y"){
  1154. if(grd_dethindxlist.labelMatrix(1,1) ==""){
  1155. messageBox("사망환자의 사인이 선택되지", "E007");
  1156. return;
  1157. }else{
  1158. model.makeValue("/root/send/savedata/dethindxlist" , grd_dethindxlist.getUpdateData());
  1159. }
  1160. }
  1161. //가코딩 여부 및 종양 구분 저장
  1162. model.makeValue("/root/send/savedata/indxmast/cncrflag" , model.getValue("/root/main/indxinfo/indxmastinfo/indxmast/cncrflag"));
  1163. model.makeValue("/root/send/savedata/indxmast/tmpcodeyn" , model.getValue("/root/main/indxinfo/indxmastinfo/indxmast/tmpcodeyn"));
  1164. model.makeValue("/root/send/savedata/indxmast/tmpcoderesncd" , model.getValue("/root/main/indxinfo/indxmastinfo/indxmast/tmpcoderesncd"));
  1165. model.makeValue("/root/send/savedata/indxmast/memo" , model.getValue("/root/main/indxinfo/indxmastinfo/indxmast/memo"));
  1166. model.makeValue("/root/send/savedata/indxmast/pid" , model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid"));
  1167. model.makeValue("/root/send/savedata/indxmast/dschdd" , model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd"));
  1168. model.makeValue("/root/send/savedata/indxmast/instcd" , getUserInfo("dutplceinstcd"));
  1169. model.makeValue("/root/send/savedata/indxmast/fstrgstrid" , model.getValue("/root/main/indxinfo/indxmastinfo/indxmast/fstrgstrid"));
  1170. model.makeValue("/root/send/savedata/indxmast/fstrgstdt" , model.getValue("/root/main/indxinfo/indxmastinfo/indxmast/fstrgstdt"));
  1171. model.makeValue("/root/send/savedata/indxmast/lastupdtrid" , model.getValue("/root/main/indxinfo/indxmastinfo/indxmast/lastupdtrid"));
  1172. model.makeValue("/root/send/savedata/indxmast/lastupdtdt" , model.getValue("/root/main/indxinfo/indxmastinfo/indxmast/lastupdtdt"));
  1173. //감염원인,감염부위,전염병,합병증,재수술을 퇴원분석에 저장
  1174. model.makeValue("/root/send/savedata/dschpatinfo/infccascd" , model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/infccascd"));
  1175. model.makeValue("/root/send/savedata/dschpatinfo/infcpartcd" , model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/infcpartcd"));
  1176. model.makeValue("/root/send/savedata/dschpatinfo/infdisyn" , model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/infdisyn").substr(1,1));
  1177. model.makeValue("/root/send/savedata/dschpatinfo/cmplcd" , model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/cmplcd"));
  1178. model.makeValue("/root/send/savedata/dschpatinfo/reopresncd" , model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/reopresncd"));
  1179. model.makeValue("/root/send/savedata/dschpatinfo/pid" , model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid"));
  1180. model.makeValue("/root/send/savedata/dschpatinfo/indd" , model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/indd"));
  1181. model.makeValue("/root/send/savedata/dschpatinfo/dschdd" , model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd"));
  1182. model.makeValue("/root/send/savedata/dschpatinfo/cretno" , model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/cretno"));
  1183. //재검토 저장
  1184. model.makeValue("/root/send/savedata/indxmast/reviewyn" , model.getValue("/root/main/indxinfo/indxmastinfo/indxmast/reviewyn"));
  1185. if(submit("TXMRD00703"))
  1186. {
  1187. messageBox("저장","I002");
  1188. model.setValue("/root/main/indxinfo/dschpatinfo/patinfo/pid", "");
  1189. model.setFocus("ipt_pid");
  1190. fOpIndxInfo();
  1191. //button100.dispatch("onclick");
  1192. }else{
  1193. messageBox("저장을", "E009");
  1194. }
  1195. model.removeNodeset("/root/send/savedata");
  1196. model.refresh();
  1197. }
  1198. /**
  1199. * @desc : 인덱스 그리드 위아래 변경
  1200. * @id :
  1201. * @event : grdobj =해당그리드,direcflag = up,down여부, flag=구분값
  1202. * @return : void
  1203. * @authur :
  1204. */
  1205. function fChgValueIndxGrd(grdObj, direcflag,flag)
  1206. {
  1207. var srcRow = grdObj.row - grdObj.fixedRows + 1; //(화면 그리드베이스에서 선택한 행 - 그리드 제목 줄)+1
  1208. if(srcRow =="0")
  1209. return;
  1210. var sRow; //방향 위치가 위로 일때
  1211. if(direcflag == "up"){ //위로
  1212. if(srcRow == 1){ //현재 위치가 맨 위일 경우
  1213. return;
  1214. }
  1215. sRow = srcRow - 1; //아니면 위로 올린다
  1216. }else if(direcflag == "down"){ //아래로
  1217. if(srcRow == grdObj.rows - grdObj.fixedRows){ //현재 위치가 맨 아래일 경우
  1218. return;
  1219. }
  1220. sRow = srcRow + 1;
  1221. }
  1222. if(flag =="Ccindx"){//주호소 인덱스
  1223. model.removeNodeset("/root/temp/tmp");
  1224. model.makeNode("/root/temp/tmp/ccindx");
  1225. model.copyNode("/root/temp/tmp/ccindx", "/root/main/indxinfo/ccindxinfo/ccindxlist[" + srcRow + "]");
  1226. model.copyNode("/root/main/indxinfo/ccindxinfo/ccindxlist[" + srcRow + "]", "/root/main/indxinfo/ccindxinfo/ccindxlist[" + sRow + "]");
  1227. model.copyNode("/root/main/indxinfo/ccindxinfo/ccindxlist[" + sRow + "]", "/root/temp/tmp/ccindx");
  1228. }else if(flag =="diagindx"){//진단인덱스
  1229. model.removeNodeset("/root/temp/tmp");
  1230. model.makeNode("/root/temp/tmp/diagindx");
  1231. model.copyNode("/root/temp/tmp/diagindx", "/root/main/indxinfo/diagindxinfo/diagindxlist[" + srcRow + "]");
  1232. model.copyNode("/root/main/indxinfo/diagindxinfo/diagindxlist[" + srcRow + "]", "/root/main/indxinfo/diagindxinfo/diagindxlist[" + sRow + "]");
  1233. model.copyNode("/root/main/indxinfo/diagindxinfo/diagindxlist[" + sRow + "]", "/root/temp/tmp/diagindx");
  1234. }else if(flag =="opindx"){//수술인덱스
  1235. model.removeNodeset("/root/temp/tmp");
  1236. model.makeNode("/root/temp/tmp/opindx");
  1237. model.copyNode("/root/temp/tmp/opindx", "/root/opinfo/opindxdtlinfo/opindxdtllist[" + srcRow + "]");
  1238. model.copyNode("/root/opinfo/opindxdtlinfo/opindxdtllist[" + srcRow + "]", "/root/opinfo/opindxdtlinfo/opindxdtllist[" + sRow + "]");
  1239. model.copyNode("/root/opinfo/opindxdtlinfo/opindxdtllist[" + sRow + "]", "/root/temp/tmp/opindx");
  1240. }else if(flag =="cureindx"){//처치인덱스
  1241. model.removeNodeset("/root/temp/tmp");
  1242. model.makeNode("/root/temp/tmp/cureindx");
  1243. model.copyNode("/root/temp/tmp/cureindx", "/root/main/indxinfo/cureindxinfo/cureindxlist[" + srcRow + "]");
  1244. model.copyNode("/root/main/indxinfo/cureindxinfo/cureindxlist[" + srcRow + "]", "/root/main/indxinfo/cureindxinfo/cureindxlist[" + sRow + "]");
  1245. model.copyNode("/root/main/indxinfo/cureindxinfo/cureindxlist[" + sRow + "]", "/root/temp/tmp/cureindx");
  1246. }
  1247. // grdObj.rebuild();
  1248. grdObj.refresh();
  1249. return sRow;
  1250. }
  1251. /**
  1252. * @desc :오른쪽 마우스 클릭시 추가 ,삭제(인덱스 )
  1253. * @id :
  1254. * @event :
  1255. * @return : void
  1256. * @authur :
  1257. */
  1258. function fMouseRightindx(){
  1259. if(event.button == 3){
  1260. window.setPopupMenu(true, "/root/hidden/menu/indxlist", "label", "func", false);
  1261. return;
  1262. }
  1263. }
  1264. /**
  1265. * @desc : 인덱스 행추가
  1266. * @id :
  1267. * @event :
  1268. * @return : void
  1269. * @authur :
  1270. */
  1271. function fAddRow_indxlist(grdObj)
  1272. {
  1273. var Pid = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid");
  1274. var Dschdd = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd");
  1275. //var flag = model.getValue("/Root/Hidden/Chgrowflag");
  1276. var chngdeptyn = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/chngdeptyn");//전출정보 여부
  1277. if((Pid=="")&&(Dschdd=="")){
  1278. messageBox("퇴원일자를 입력 후에 추가","I006");
  1279. return;
  1280. }
  1281. var grdRow = grdObj.row - grdObj.fixedRows + 1;
  1282. if(grdRow < 1){
  1283. grdObj.addRow();
  1284. }else if(grdRow >= 1){
  1285. grdObj.insertRow(grdRow, "below", true);
  1286. }
  1287. grdObj.valueMatrix( grdObj.row, grdObj.colRef("poa")) = "Y";
  1288. if(chngdeptyn !="Y"){ //전출 여부에 따른 진단,수술 전출과컬럼 disabled
  1289. grd_diagindxlist.colDisabled(grd_diagindxlist.colRef("chngdeptcd"))=true;
  1290. grd_diagindxlist.colDisabled(grd_diagindxlist.colRef("chngclrsdeptcd"))=true;
  1291. grd_opindxlist.colDisabled(grd_opindxlist.colRef("chngdeptcd"))=true;
  1292. grd_opindxlist.colDisabled(grd_opindxlist.colRef("chngclrsdeptcd"))=true;
  1293. }else{
  1294. grd_diagindxlist.colDisabled(grd_diagindxlist.colRef("chngdeptcd"))=false;
  1295. grd_diagindxlist.colDisabled(grd_diagindxlist.colRef("chngclrsdeptcd"))=false;
  1296. grd_opindxlist.colDisabled(grd_opindxlist.colRef("chngdeptcd"))=false;
  1297. grd_opindxlist.colDisabled(grd_opindxlist.colRef("chngclrsdeptcd"))=false;
  1298. }
  1299. }
  1300. /**
  1301. * @desc : 오른쪽마우스 클릭시 행추가
  1302. * @id :
  1303. * @event : flag= (CC->주호소,DA->진단,OP->수술,DT->사망),//아래로 추가->below,위로 추가-> above
  1304. * @return : void
  1305. * @authur :
  1306. */
  1307. function fAddRow_Rindxlist()
  1308. {
  1309. var Pid = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid");
  1310. var Dschdd = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd");
  1311. var flag = model.getValue("/root/hidden/chgrowflag");
  1312. var chngdeptyn = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/chngdeptyn");
  1313. if((Pid=="")&&(Dschdd=="")){
  1314. messageBox("퇴원일자를 입력 후에 추가","I006");
  1315. return;
  1316. }
  1317. if(flag=="CC"){
  1318. var ccRow = grd_ccindxlist.row - grd_ccindxlist.fixedRows + 1;
  1319. if(ccRow < 1){
  1320. grd_ccindxlist.addRow();
  1321. }else if(ccRow >= 1){
  1322. grd_ccindxlist.insertRow( ccRow, "above", true);
  1323. }
  1324. }else if(flag=="DA"){
  1325. var diagRow = grd_diagindxlist.row - grd_diagindxlist.fixedRows + 1;
  1326. if(diagRow < 1){
  1327. grd_diagindxlist.addRow();
  1328. }else if(diagRow >= 1){
  1329. grd_diagindxlist.insertRow( diagRow, "above", true);
  1330. }
  1331. if(chngdeptyn !="Y"){ //전출 여부에 따른 진단,수술 전출과컬럼 disabled
  1332. grd_diagindxlist.colDisabled(grd_diagindxlist.colRef("chngdeptcd"))=true;
  1333. grd_diagindxlist.colDisabled(grd_diagindxlist.colRef("chngclrsdeptcd"))=true;
  1334. }else{
  1335. grd_diagindxlist.colDisabled(grd_diagindxlist.colRef("chngdeptcd"))=false;
  1336. grd_diagindxlist.colDisabled(grd_diagindxlist.colRef("chngclrsdeptcd"))=false;
  1337. }
  1338. }else if(flag=="OP"){
  1339. var opRow = grd_opindxlist.row - grd_opindxlist.fixedRows + 1;
  1340. if(opRow < 1){
  1341. grd_opindxlist.addRow();
  1342. }else if(opRow >= 1){
  1343. grd_opindxlist.insertRow( opRow, "above", true);
  1344. }
  1345. if(chngdeptyn !="Y"){ //전출 여부에 따른 진단,수술 전출과컬럼 disabled
  1346. grd_opindxlist.colDisabled(grd_opindxlist.colRef("chngdeptcd"))=true;
  1347. grd_opindxlist.colDisabled(grd_opindxlist.colRef("chngclrsdeptcd"))=true;
  1348. }else{
  1349. grd_opindxlist.colDisabled(grd_opindxlist.colRef("chngdeptcd"))=false;
  1350. grd_opindxlist.colDisabled(grd_opindxlist.colRef("chngclrsdeptcd"))=false;
  1351. }
  1352. }else if(flag=="DT"){
  1353. var dethRow = grd_dethindxlist.row - grd_dethindxlist.fixedRows + 1;
  1354. if(dethRow < 1){
  1355. grd_dethindxlist.addRow();
  1356. }else if(dethRow >= 1){
  1357. grd_dethindxlist.insertRow( dethRow, "above", true);
  1358. }
  1359. }
  1360. //model.refresh();
  1361. }
  1362. /**
  1363. * @desc : 인덱스 행삭제
  1364. * @id :
  1365. * @event : flag= (CC->주호소,DA->진단,OP->수술,DT->사망)
  1366. * @return : void
  1367. * @authur :
  1368. */
  1369. function fDelRow_indxlist(grdObj)
  1370. {
  1371. var flag = model.getValue("/root/hidden/chgrowflag");
  1372. if(flag=="CC")
  1373. {
  1374. if(grd_ccindxlist.row < 0)
  1375. {
  1376. messageBox("삭제할 행이 ", "I004")
  1377. return;
  1378. }
  1379. if (grd_ccindxlist.selectedRows > 0) {
  1380. var selectedRows = Array(grd_ccindxlist.selectedRows);
  1381. for(i=0;i<grd_ccindxlist.selectedRows;i++) {
  1382. selectedRows[i] = grd_ccindxlist.selectedRow(i);
  1383. }
  1384. }
  1385. var rowIdx;
  1386. for ( var i= selectedRows.length ; i >= 0 ; i--)
  1387. {
  1388. rowIdx = selectedRows[i];
  1389. grd_ccindxlist.deleteRow( rowIdx , false);
  1390. }
  1391. }else if(flag=="DA"){
  1392. if(grd_diagindxlist.row < 0)
  1393. {
  1394. messageBox("삭제할 행이 ", "I004")
  1395. return;
  1396. }
  1397. if (grd_diagindxlist.selectedRows > 0) {
  1398. var selectedRows = Array(grd_diagindxlist.selectedRows);
  1399. for(i=0;i<grd_diagindxlist.selectedRows;i++) {
  1400. selectedRows[i] = grd_diagindxlist.selectedRow(i);
  1401. }
  1402. }
  1403. var rowIdx;
  1404. for ( var i= selectedRows.length ; i >= 0 ; i--)
  1405. {
  1406. rowIdx = selectedRows[i];
  1407. grd_diagindxlist.deleteRow( rowIdx , false);
  1408. }
  1409. }else if(flag=="OP"){
  1410. if(grd_opindxlist.row < 0)
  1411. {
  1412. messageBox("삭제할 행이 ", "I004")
  1413. return;
  1414. }
  1415. if (grd_opindxlist.selectedRows > 0) {
  1416. var selectedRows = Array(grd_opindxlist.selectedRows);
  1417. for(i=0;i<grd_opindxlist.selectedRows;i++) {
  1418. selectedRows[i] = grd_opindxlist.selectedRow(i);
  1419. }
  1420. }
  1421. var rowIdx;
  1422. for ( var i= selectedRows.length ; i >= 0 ; i--)
  1423. {
  1424. rowIdx = selectedRows[i];
  1425. grd_opindxlist.deleteRow( rowIdx , false);
  1426. }
  1427. }else if(flag=="CURE"){
  1428. if(grd_cureindxlist.row < 0)
  1429. {
  1430. messageBox("삭제할 행이 ", "I004")
  1431. return;
  1432. }
  1433. if (grd_cureindxlist.selectedRows > 0) {
  1434. var selectedRows = Array(grd_cureindxlist.selectedRows);
  1435. for(i=0;i<grd_cureindxlist.selectedRows;i++) {
  1436. selectedRows[i] = grd_cureindxlist.selectedRow(i);
  1437. }
  1438. }
  1439. var rowIdx;
  1440. for ( var i= selectedRows.length ; i >= 0 ; i--)
  1441. {
  1442. rowIdx = selectedRows[i];
  1443. grd_cureindxlist.deleteRow( rowIdx , false);
  1444. }
  1445. }else if(flag=="DT"){
  1446. if(grd_dethindxlist.row < 0)
  1447. {
  1448. messageBox("삭제할 행이 ", "I004")
  1449. return;
  1450. }
  1451. if (grd_dethindxlist.selectedRows > 0) {
  1452. var selectedRows = Array(grd_dethindxlist.selectedRows);
  1453. for(i=0;i<grd_dethindxlist.selectedRows;i++) {
  1454. selectedRows[i] = grd_dethindxlist.selectedRow(i);
  1455. }
  1456. }
  1457. var rowIdx;
  1458. for ( var i= selectedRows.length ; i >= 0 ; i--)
  1459. {
  1460. rowIdx = selectedRows[i];
  1461. grd_dethindxlist.deleteRow( rowIdx , false);
  1462. }
  1463. }
  1464. //model.refresh();
  1465. }
  1466. /**
  1467. * @desc :
  1468. * @id :
  1469. * @event : 가코딩 유무시 가코딩사유및 메모 disabled상태 변경(tmpcodeyn = "Y,N")
  1470. * @return : void
  1471. * @authur :
  1472. */
  1473. function fChgTmpCodeyn()
  1474. {
  1475. var tmpcodeyn=model.getValue("/root/main/indxinfo/indxmastinfo/indxmast/tmpcodeyn")
  1476. if(tmpcodeyn=="Y")
  1477. {
  1478. cmb_tmpcoderesncd.disabled =false;
  1479. tar_memo.disabled=false;
  1480. }else if(tmpcodeyn!="Y")
  1481. {
  1482. if(tmpcodeyn=="N"){
  1483. chk_tmpcodeyn.value="";
  1484. chk_tmpcodeyn.refresh();
  1485. }
  1486. cmb_tmpcoderesncd.disabled =true;
  1487. tar_memo.disabled=true;
  1488. }
  1489. //model.refresh();
  1490. }
  1491. /**
  1492. * @desc :
  1493. * @id :
  1494. * @event : 주진단시 자동으로 나머지 행 부진단으로 변경
  1495. * @return : void
  1496. * @authur : flag =diag -> 진단 인덱스,flag="op" ->수술인덱스 ,flag="cure" ->처치인덱스
  1497. */
  1498. function fChgKindcdFlag(flag)
  1499. {
  1500. var diagRow = grd_diagindxlist.row - grd_diagindxlist.fixedRows + 1;
  1501. var opRow = grd_opindxlist.row - grd_opindxlist.fixedRows + 1;
  1502. var cureRow = grd_cureindxlist.row - grd_cureindxlist.fixedRows + 1;
  1503. var Diagkindcdflag = model.getValue("/root/main/indxinfo/diagindxinfo/diagindxlist[" +diagRow + "]/diagkindcdflag");
  1504. var Opkindcdflag = model.getValue("/root/opinfo/opindxdtlinfo/opindxdtllist[" + opRow + "]/opkindcdflag");
  1505. var Curekindcdflag = model.getValue("/root/main/indxinfo/cureindxinfo/cureindxlist[" + cureRow + "]/opkindcdflag");
  1506. var diagCol = grd_diagindxlist.col;
  1507. var opCol = grd_opindxlist.col;
  1508. var cureCol = grd_cureindxlist.col;
  1509. if(flag =="diag"){
  1510. if(diagCol==1){
  1511. for ( var i= 1; i < grd_diagindxlist.rows; i++){
  1512. if(Diagkindcdflag=="M"){
  1513. if(i != diagRow){
  1514. grd_diagindxlist.valueMatrix(i,1)="S";
  1515. }
  1516. }
  1517. }
  1518. }
  1519. }else if(flag=="op"){
  1520. if(opCol==2){
  1521. for ( var i= 1; i< grd_opindxlist.rows; i++){
  1522. if(Opkindcdflag=="M"){
  1523. if(i != opRow){
  1524. grd_opindxlist.valueMatrix(i,2)="S";
  1525. }
  1526. }
  1527. }
  1528. }
  1529. }else if(flag =="cure"){
  1530. if(cureCol==1){
  1531. for( var i= 1; i< grd_cureindxlist.rows; i++){
  1532. if(Curekindcdflag=="M"){
  1533. if(i != cureRow){
  1534. grd_cureindxlist.valueMatrix(i,1)="S";
  1535. }
  1536. }
  1537. }
  1538. }
  1539. }
  1540. model.refresh();
  1541. }
  1542. /**
  1543. * @ver : 2007-12-01
  1544. * @desc : 초기화버튼
  1545. * @ :
  1546. * @by : 이창록
  1547. * @param :
  1548. * @return :
  1549. * @---------------------------------------------------
  1550. */
  1551. function fClearIndxInfo()
  1552. {
  1553. model.resetInstanceNode("/root/main/indxinfo");
  1554. model.removeNodeset("/root/main/indxinfo/ccindxinfo/ccindxlist");
  1555. model.removeNodeset("/root/main/indxinfo/diagindxinfo/diagindxlist");
  1556. model.removeNodeset("/root/opinfo/opindxdtlinfo/opindxdtllist");
  1557. model.removeNodeset("/root/main/indxinfo/cureindxinfo/cureindxlist");
  1558. model.removeNodeset("/root/main/indxinfo/dethindxinfo/dethindxlist");
  1559. model.removeNodeset("/root/main/indxinfo/bfindxlist/bfindxinfo");
  1560. model.removeNodeset("/root/main/indxinfo/diaginfo/diaglist");
  1561. model.removeNodeset("/root/main/indxinfo/insudiaginfo/insudiaglist");
  1562. model.removeNodeset("/root/main/indxinfo/serdiaginfo/serdiaglist");
  1563. model.removeNodeset("/root/main/indxinfo/cnstinfo/cnstlist");
  1564. model.removeNodeset("/root/main/indxinfo/opinfo/oplist");
  1565. model.removeNodeset("/root/init/dschpatinfo/chgdschinfo/chgdschddlist");
  1566. model.removeNodeset("/root/init/infdcpartinfo/infdcpartlist");
  1567. model.refresh();
  1568. cmb_tmpcoderesncd.disabled =true;
  1569. tar_memo.disabled=true;
  1570. }
  1571. /**
  1572. * @ver : 2007-12-01
  1573. * @desc : 의료정보사용자에 한하여 저장버튼 visibility
  1574. * @ :
  1575. * @by : 이창록
  1576. * @param :
  1577. * @return :
  1578. * @---------------------------------------------------
  1579. */
  1580. function fUserAdmin()
  1581. {
  1582. var userinfo = getUserInfo("dutplcecd");
  1583. //의료정보팀
  1584. // KNUH_20101207_박성호_start_의무기록 부서코드 가져오기
  1585. //if(userinfo=="3230000000")
  1586. if(model.getValue("/root/temp/deptcd/hardcd[hardcd='" + userinfo + "']/hardcd") != "")
  1587. {
  1588. // KNUH_20101207_박성호_end
  1589. btn_save.visible = "true";
  1590. btn_clear.visible = "true";
  1591. model.refresh();
  1592. }
  1593. else
  1594. {
  1595. btn_save.visible = "false";
  1596. btn_clear.visible = "false";
  1597. model.refresh();
  1598. }
  1599. }
  1600. /**
  1601. * @ver : 2008-08-25
  1602. * @desc : 감염종류1의 감염종류2의 하부항목들 조회(퇴원분석과 동일)
  1603. * @by : 이창록
  1604. * @param :
  1605. * @return :
  1606. * @---------------------------------------------------
  1607. */
  1608. function fGetInFcCas(code){
  1609. switch(code){
  1610. case "01":
  1611. zbcfGetCodeList(new Array("M0485"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1612. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0485");
  1613. break;
  1614. case "02":
  1615. zbcfGetCodeList(new Array("M0486"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1616. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0486");
  1617. break;
  1618. case "03":
  1619. zbcfGetCodeList(new Array("M0487"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1620. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0487");
  1621. break;
  1622. case "04":
  1623. zbcfGetCodeList(new Array("M0488"),new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1624. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0488");
  1625. break;
  1626. case "05":
  1627. zbcfGetCodeList(new Array("M0489"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1628. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0489");
  1629. break;
  1630. case "06":
  1631. zbcfGetCodeList(new Array("M0490"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1632. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0490");
  1633. break;
  1634. case "07":
  1635. zbcfGetCodeList(new Array("M0491"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1636. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0491");
  1637. break;
  1638. case "08":
  1639. zbcfGetCodeList(new Array("M0492"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1640. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0492");
  1641. break;
  1642. case "09":
  1643. zbcfGetCodeList(new Array("M0493"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1644. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0493");
  1645. break;
  1646. case "10":
  1647. zbcfGetCodeList(new Array("M0494"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1648. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0494");
  1649. break;
  1650. case "11":
  1651. zbcfGetCodeList(new Array("M0495"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1652. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0495");
  1653. break;
  1654. case "12":
  1655. zbcfGetCodeList(new Array("M0496"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1656. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0496");
  1657. break;
  1658. case "13":
  1659. zbcfGetCodeList(new Array("M0497"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1660. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0497");
  1661. break;
  1662. }
  1663. model.refresh();
  1664. model.removeNodeset("/root/hidden/infdcpartinfo/infdcpartlist");
  1665. model.makeNode("/root/hidden/infdcpartinfo/infdcpartlist");
  1666. }
  1667. /**
  1668. * @ver : 2008-12-17
  1669. * @desc : 법정 전염병신고서 화면과 연계
  1670. * @by : 이창록
  1671. * @param :
  1672. * @return :
  1673. * @---------------------------------------------------
  1674. */
  1675. function fSendInfdisInfo()
  1676. {
  1677. var reptflag = model.getValue("/root/main/indxinfo/infdisinfo/infdislist/reptflag");
  1678. if(reptflag=="01"){
  1679. setParameter("wrtedt",model.getValue("/root/main/indxinfo/infdisinfo/infdislist/wrtedt"));
  1680. setParameter("seqno",model.getValue("/root/main/indxinfo/infdisinfo/infdislist/seqno"));
  1681. setParameter("pid" , model.getValue("/root/main/indxinfo/infdisinfo/infdislist/pid"));
  1682. setParameter("indd" , model.getValue("/root/main/indxinfo/infdisinfo/infdislist/indd"));
  1683. setParameter("psnflag", "I");
  1684. setParameter("state", "S");
  1685. open("SPASI01500");//법정 전염병신고서
  1686. }else if(reptflag=="02"){
  1687. setParameter("wrtedt",model.getValue("/root/main/indxinfo/infdisinfo/infdislist/wrtedt"));
  1688. setParameter("seqno",model.getValue("/root/main/indxinfo/infdisinfo/infdislist/seqno"));
  1689. setParameter("pid" , model.getValue("/root/main/indxinfo/infdisinfo/infdislist/pid"));
  1690. setParameter("indd" , model.getValue("/root/main/indxinfo/infdisinfo/infdislist/indd"));
  1691. setParameter("psnflag", "I");
  1692. setParameter("state", "S");
  1693. open("SPASI01800");//결핵신고서
  1694. }else if(reptflag=="03"){
  1695. setParameter("wrtedt",model.getValue("/root/main/indxinfo/infdisinfo/infdislist/wrtedt"));
  1696. setParameter("seqno",model.getValue("/root/main/indxinfo/infdisinfo/infdislist/seqno"));
  1697. setParameter("pid" ,model.getValue("/root/main/indxinfo/infdisinfo/infdislist/pid"));
  1698. setParameter("indd" ,model.getValue("/root/main/indxinfo/infdisinfo/infdislist/indd"));
  1699. setParameter("psnflag", "I");
  1700. setParameter("state","S");
  1701. open("SPASI01600");//간염신고서
  1702. }else if(reptflag=="04"){
  1703. setParameter("wrtedt",model.getValue("/root/main/indxinfo/infdisinfo/infdislist/wrtedt"));
  1704. setParameter("seqno" ,model.getValue("/root/main/indxinfo/infdisinfo/infdislist/seqno"));
  1705. setParameter("pid" ,model.getValue("/root/main/indxinfo/infdisinfo/infdislist/pid"));
  1706. setParameter("indd" ,model.getValue("/root/main/indxinfo/infdisinfo/infdislist/indd"));
  1707. setParameter("psnflag", "I");
  1708. setParameter("state" ,"S");
  1709. open("SPASI01900");//선천성 매독신고서
  1710. }else if(reptflag=="05"){
  1711. setParameter("wrtedt",model.getValue("/root/main/indxinfo/infdisinfo/infdislist/wrtedt"));
  1712. setParameter("seqno",model.getValue("/root/main/indxinfo/infdisinfo/infdislist/seqno"));
  1713. setParameter("pid" ,model.getValue("/root/main/indxinfo/infdisinfo/infdislist/pid"));
  1714. setParameter("indd" ,model.getValue("/root/main/indxinfo/infdisinfo/infdislist/indd"));
  1715. setParameter("psnflag", "I");
  1716. setParameter("state","S");
  1717. open("SPASI01700");//성병신고서
  1718. }
  1719. }
  1720. /**
  1721. * @ver : 2009-02-16
  1722. * @desc : 진단/수술 FULL 코드 조회, FULL 코드가 아니면 팝업과 연계
  1723. * @by : 이창록
  1724. * @param :
  1725. * @return :
  1726. * @---------------------------------------------------
  1727. */
  1728. function fDiagOpCdFullSearch(flag)
  1729. {
  1730. if(event.keyCode == "13") {
  1731. if(flag =="grd_diagindxlist"){
  1732. var iRow = grd_diagindxlist.row - grd_diagindxlist.fixedRows + 1;
  1733. var dispdiagcd = model.getValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+iRow+"]/dispdiagcd");
  1734. if(dispdiagcd==""){
  1735. return;
  1736. }
  1737. if(dispdiagcd!=""){
  1738. model.removenode("/root/send");
  1739. model.makeNode("/root/send");
  1740. model.makeValue("/root/send/indxcd", "null");
  1741. model.makeValue("/root/send/indxflag", "0");
  1742. // KNUH_20101207_박성호_start_의무기록 부서코드 가져오기
  1743. var dutplcecd = model.getValue("/root/temp/dutplcecd/hardcd/hardcd");
  1744. //model.makeValue("/root/send/deptcd", "3230000000");//의료정보팀 진단용어만
  1745. model.makeValue("/root/send/deptcd", dutplcecd);//의료정보팀 진단용어만
  1746. // KNUH_20101207_박성호_end
  1747. model.makeValue("/root/send/deptflag", "Y");
  1748. model.makeValue("/root/send/srchflag", "C");
  1749. var Srchnm = grd_diagindxlist.valueMatrix(iRow,grd_diagindxlist.colRef("dispdiagcd")).toUpperCase();
  1750. model.makeValue("/root/send/srchnm", Srchnm);
  1751. model.makeValue("/root/send/stndd",cmb_dschdd.value);
  1752. if(Srchnm.indexOf("/") > 0){
  1753. if(submit("TRMRT00209")){//Mophology 코드
  1754. if(getNodesetCnt(model,"/root/main/diagcdinfo/kcd4m")==1){
  1755. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+iRow+"]/dispdiagcd" ,model.getValue("/root/main/diagcdinfo/kcd4m/morphlgccd"));
  1756. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+iRow+"]/diagtermcd" ,model.getValue("/root/main/diagcdinfo/kcd4m/morphlgccd"));
  1757. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+iRow+"]/diagseqno" ,model.getValue("/root/main/diagcdinfo/kcd4m/kcd4mseqno"));
  1758. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+iRow+"]/hngnm" ,model.getValue("/root/main/diagcdinfo/kcd4m/kcd4mhngnm"));
  1759. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+iRow+"]/engnm" ,model.getValue("/root/main/diagcdinfo/kcd4m/kcd4mengnm"));
  1760. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+iRow+"]/pid" ,model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid"));
  1761. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+iRow+"]/dschdd" ,model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd"));
  1762. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+iRow+"]/instcd" ,getUserInfo("dutplceinstcd"));
  1763. model.removeNodeset("/root/main/diagcdinfo/kcd4");
  1764. model.makeNode("/root/main/diagcdinfo/kcd4");
  1765. grd_diagindxlist.refresh();
  1766. }else{
  1767. fDiagIndxList("code");
  1768. }
  1769. }
  1770. }else if(submit("TRMRT01600")){//진단코드
  1771. if(getNodesetCnt(model,"/root/main/deptdiagcdlist/deptdiagcdinfo")==1){
  1772. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+iRow+"]/dispdiagcd" ,model.getValue("/root/main/deptdiagcdlist/deptdiagcdinfo/termcd"));
  1773. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+iRow+"]/diagtermcd" ,model.getValue("/root/main/deptdiagcdlist/deptdiagcdinfo/termcd"));
  1774. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+iRow+"]/hngnm" ,model.getValue("/root/main/deptdiagcdlist/deptdiagcdinfo/termhngnm"));
  1775. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+iRow+"]/engnm" ,model.getValue("/root/main/deptdiagcdlist/deptdiagcdinfo/termengnm"));
  1776. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+iRow+"]/pid" ,model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid"));
  1777. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+iRow+"]/dschdd" ,model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd"));
  1778. model.setValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+iRow+"]/instcd" ,getUserInfo("dutplceinstcd"));
  1779. var lglydisflag = model.getValue("/root/main/deptdiagcdlist/deptdiagcdinfo/lglydisflag");
  1780. if((lglydisflag=="00")||(lglydisflag=="")){
  1781. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+iRow+"]/lglydisflag" , "");
  1782. }else{
  1783. model.makeValue("/root/main/indxinfo/diagindxinfo/diagindxlist["+iRow+"]/lglydisflag" , lglydisflag+"군");
  1784. }
  1785. model.removeNodeset("/root/main/deptdiagcdlist/deptdiagcdinfo");
  1786. model.makeNode("/root/main/deptdiagcdlist/deptdiagcdinfo");
  1787. grd_diagindxlist.refresh();
  1788. }else{
  1789. fDiagIndxList("code");
  1790. }
  1791. }
  1792. }
  1793. }else if(flag =="grd_opindxlist"){
  1794. var opRow = grd_opindxlist.row - grd_opindxlist.fixedRows + 1;
  1795. var disoptermcd = model.getValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+opRow+"]/disoptermcd");
  1796. if(disoptermcd==""){
  1797. return;
  1798. }
  1799. model.removenode("/root/send");
  1800. model.makeNode("/root/send");
  1801. model.makeValue("/root/send/indxcd", "null");
  1802. model.makeValue("/root/send/indxflag", "9");
  1803. // KNUH_20101207_박성호_start_의무기록 부서코드 가져오기
  1804. var dutplcecd = model.getValue("/root/temp/dutplcecd/hardcd/hardcd");
  1805. //model.makeValue("/root/send/deptcd", "3230000000");
  1806. model.makeValue("/root/send/deptcd", dutplcecd);//의료정보팀 진단용어만
  1807. // KNUH_20101207_박성호_end
  1808. model.makeValue("/root/send/deptflag", "Y");
  1809. model.makeValue("/root/send/srchflag", "C");
  1810. var Srchnm = grd_opindxlist.valueMatrix(opRow,grd_opindxlist.colRef("disoptermcd")).toUpperCase();
  1811. model.makeValue("/root/send/srchnm", Srchnm);
  1812. model.makeValue("/root/send/stndd",cmb_dschdd.value);
  1813. if(submit("TRMRT01601")){//수술코드
  1814. if(getNodesetCnt(model,"/root/main/deptopcdlist/deptopcdinfo")==1){
  1815. model.setValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+opRow+"]/disoptermcd" ,model.getValue("/root/main/deptopcdlist/deptopcdinfo/termcd"));
  1816. model.setValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+opRow+"]/optermcd" ,model.getValue("/root/main/deptopcdlist/deptopcdinfo/termcd"));
  1817. model.setValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+opRow+"]/ophngnm" ,model.getValue("/root/main/deptopcdlist/deptopcdinfo/termhngnm"));
  1818. model.setValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+opRow+"]/opengnm" ,model.getValue("/root/main/deptopcdlist/deptopcdinfo/termengnm"));
  1819. model.setValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+opRow+"]/pid" ,model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid"));
  1820. model.setValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+opRow+"]/dschdd" ,model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd"));
  1821. model.setValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+opRow+"]/opflag" ,"0");
  1822. model.setValue("/root/opinfo/opindxdtlinfo/opindxdtllist["+opRow+"]/instcd" ,getUserInfo("dutplceinstcd"));
  1823. model.removeNodeset("/root/main/deptopcdlist/deptopcdinfo");
  1824. model.makeNode("/root/main/deptopcdlist/deptopcdinfo");
  1825. grd_opindxlist.refresh();
  1826. }else{
  1827. fOpGridIndxList("code");
  1828. }
  1829. }
  1830. }else if(flag =="grd_cureindxlist"){
  1831. var opRow = grd_cureindxlist.row - grd_cureindxlist.fixedRows + 1;
  1832. var disoptermcd = model.getValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+opRow+"]/disoptermcd");
  1833. if(disoptermcd==""){
  1834. return;
  1835. }
  1836. model.removenode("/root/send");
  1837. model.makeNode("/root/send");
  1838. model.makeValue("/root/send/indxcd", "null");
  1839. model.makeValue("/root/send/indxflag", "9");
  1840. // KNUH_20101207_박성호_start_의무기록 부서코드 가져오기
  1841. var dutplcecd = model.getValue("/root/temp/dutplcecd/hardcd/hardcd");
  1842. //model.makeValue("/root/send/deptcd", "3230000000");
  1843. model.makeValue("/root/send/deptcd", dutplcecd);//의료정보팀 진단용어만
  1844. // KNUH_20101207_박성호_end
  1845. model.makeValue("/root/send/deptflag", "Y");
  1846. model.makeValue("/root/send/srchflag", "C");
  1847. var Srchnm = grd_cureindxlist.valueMatrix(opRow,grd_cureindxlist.colRef("disoptermcd")).toUpperCase();
  1848. model.makeValue("/root/send/srchnm", Srchnm);
  1849. model.makeValue("/root/send/stndd",cmb_dschdd.value);
  1850. if(submit("TRMRT01601")){//수술코드
  1851. if(getNodesetCnt(model,"/root/main/deptopcdlist/deptopcdinfo")==1){
  1852. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+opRow+"]/disoptermcd" ,model.getValue("/root/main/deptopcdlist/deptopcdinfo/termcd"));
  1853. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+opRow+"]/optermcd" ,model.getValue("/root/main/deptopcdlist/deptopcdinfo/termcd"));
  1854. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+opRow+"]/ophngnm" ,model.getValue("/root/main/deptopcdlist/deptopcdinfo/termhngnm"));
  1855. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+opRow+"]/opengnm" ,model.getValue("/root/main/deptopcdlist/deptopcdinfo/termengnm"));
  1856. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+opRow+"]/pid" ,model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid"));
  1857. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+opRow+"]/dschdd" ,model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/dschdd"));
  1858. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+opRow+"]/opflag" ,"0");
  1859. model.setValue("/root/main/indxinfo/cureindxinfo/cureindxlist["+opRow+"]/instcd" ,getUserInfo("dutplceinstcd"));
  1860. model.removeNodeset("/root/main/deptopcdlist/deptopcdinfo");
  1861. model.makeNode("/root/main/deptopcdlist/deptopcdinfo");
  1862. grd_cureindxlist.refresh();
  1863. }else{
  1864. fOpGridIndxList("code");
  1865. }
  1866. }
  1867. }
  1868. }
  1869. }
  1870. //입퇴원요약기록지 보여주기
  1871. function fViewDischarge() {
  1872. var formrecseq = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/formrecseq");
  1873. var pid = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/pid");
  1874. var hngnm = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/hngnm");
  1875. var sex = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/sex");
  1876. var age = model.getValue("/root/main/indxinfo/dschpatinfo/patinfo/age");
  1877. var sa = sex+"/"+age;
  1878. var orddeptnm = "";
  1879. var roomcd = "";
  1880. var disppatinfo = pid +"▦" + hngnm +"▦" + sa+"▦"+orddeptnm +"▦" + roomcd + "▦";
  1881. setParameter("openmode", "recform"); //오픈모드는 "recform"
  1882. setParameter("formrecseq", formrecseq); //서식기록테이블의 formrecseq(기록순번)
  1883. setParameter("disppatinfo", disppatinfo);
  1884. modal("SSMMR01100", 1, 0, 0 ,"", "", "");
  1885. }