SMPID20000.js 73 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492
  1. // =================================================================================================
  2. // 사후심사 공통 Java Script (김상진)
  3. // @ver : 2008.06.03
  4. // @by : 김상진
  5. // @desc : 사후심사 공통관련 함수 (명명규칙 : 함수명 앞에 "pidf"를 붙인다.)
  6. // =================================================================================================
  7. /*
  8. * @---------------------------------------------------
  9. * @ver : 2008.08.23
  10. * @by : 김상진
  11. * @type : function
  12. * @access : public
  13. * @desc : 청구차수 : 이전월 다음월 계산
  14. * @param :
  15. * @return :
  16. * @---------------------------------------------------
  17. */
  18. function pidfCalMonth(idc, av_ym){
  19. var lv_date = av_ym.toDate("YYYYMM" + "01");
  20. lv_date = lv_date.getAddDate(idc, "M")
  21. return lv_date.getDateFormat("YYYYMM");
  22. }
  23. /*
  24. * @---------------------------------------------------
  25. * @ver : 2008.08.23
  26. * @by : 김상진
  27. * @type : function
  28. * @access : public
  29. * @desc : 청구차수조회
  30. * @param :
  31. * @return :
  32. * @---------------------------------------------------
  33. */
  34. function pidfGetClamdg() {
  35. model.removeNodeset("/root/init/clamdg");
  36. model.makeNode("/root/init/clamdg");
  37. submit("TRPID20407");
  38. cmb_clamdg.select(0);
  39. model.refreshpart("/root/init/clamdg");
  40. //model.setValue("/root/send/clamdg", 0);
  41. }
  42. /**
  43. * @---------------------------------------------------
  44. * @ver : 2008.06.08
  45. * @by : 김상진
  46. * @type : function
  47. * @access : public
  48. * @desc : 선택처방조회
  49. * @param :
  50. * @return :
  51. * @---------------------------------------------------
  52. */
  53. function pidfGetSpcOrdList() {
  54. var row = grd_clodhist.findRow("선", 1, grd_clodhist.colRef("payflag"), false, false);
  55. if (row < 1) {
  56. messageBox("조회된 선택처방이", "I004"); ///조회된 선택처방이 없습니다.
  57. //chk_choiordtotamt.dispatch("xforms-deselect");
  58. chk_choiordtotamt.value = "";
  59. return;
  60. }
  61. var insukind = model.getValue("/root/main/Item1/clbs/insukindcd");
  62. insukind = insukind.substr(1,1);
  63. for (var i = grd_clodhist.fixedRows; i < grd_clodhist.rows; i++) {
  64. grd_clodhist.rowHidden(i) = false;
  65. var payflag = model.getValue("/root/main/list2/clod["+ i +"]/payflag");
  66. if (insukind == "3" || insukind == "4") {
  67. if (payflag != "8") {
  68. grd_clodhist.rowHidden(i) = true;
  69. }
  70. } else {
  71. if (payflag != "9") {
  72. grd_clodhist.rowHidden(i) = true;
  73. }
  74. }
  75. }
  76. }
  77. /* @---------------------------------------------------
  78. * @ver : 2008.06.08
  79. * @by : 김상진
  80. * @type : function
  81. * @access : public
  82. * @desc : 선택처방해제
  83. * @param :
  84. * @return :
  85. * @---------------------------------------------------
  86. */
  87. function pidfSetSpcOrdListBack() {
  88. for (var i = grd_clodhist.fixedRows; i < grd_clodhist.rows; i++) {
  89. if (grd_clodhist.rowHidden(i)) {
  90. grd_clodhist.rowHidden(i) = false;
  91. }
  92. }
  93. }
  94. // padding
  95. function fPaddingData(sData,sflag,sPad,iLeng){
  96. if ( sData == "" || sflag == "" || sPad == "" || iLeng == "" ) {
  97. return;
  98. }
  99. if ( sData.length >= iLeng ) {
  100. return;
  101. }
  102. if ( iLeng <= 0 ) {
  103. return;
  104. }
  105. if ( sflag == "L" ) {
  106. sData = sData.getLeftPad(iLeng, sPad);
  107. } else if ( sflag == "R" ) {
  108. sData = sData.getRightPad(iLeng, sPad);
  109. } else {
  110. //
  111. }
  112. return sData;
  113. }
  114. //-----------------------------------
  115. //명세서 합철
  116. //-----------------------------------
  117. function pidfDocuMerge() {
  118. var irow = grd_clbsmast.row;
  119. var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
  120. if (clamkey) {
  121. model.setValue("/root/hidden/smpid20600/cond/makeflag", "1"); // 1:명세서 합철
  122. model.setValue("/root/hidden/smpid20600/cond/copyflag", ""); // 명세서복사인 경우만 해당
  123. model.setValue("/root/hidden/smpid20600/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
  124. model.setValue("/root/hidden/smpid20600/cond/clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
  125. model.setValue("/root/hidden/smpid20600/cond/clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
  126. model.setValue("/root/hidden/smpid20600/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
  127. model.setValue("/root/hidden/smpid20600/cond/pidsn", model.getValue("/root/main/list1/clbs[" + irow + "]/pidsn"));
  128. modal("SMPID22300", "1", "50", "100", "SMPID22300", "/root/hidden/smpid20600/cond", "/root/init/item1", "", ""); // SMPID22300_명세서합철.xrw
  129. }
  130. }
  131. //-----------------------------------
  132. //명세서 복사
  133. //-----------------------------------
  134. function pidfDocuCopy() {
  135. var irow = grd_clbsmast.row;
  136. var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
  137. if (clamkey) {
  138. model.setValue("/root/hidden/smpid20600/cond/makeflag", "2"); // 2:명세서 복사
  139. model.setValue("/root/hidden/smpid20600/cond/copyflag", "1"); // 명세서복사인 경우만 해당(1.기본만생성)
  140. model.setValue("/root/hidden/smpid20600/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
  141. model.setValue("/root/hidden/smpid20600/cond/clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
  142. model.setValue("/root/hidden/smpid20600/cond/clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
  143. model.setValue("/root/hidden/smpid20600/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
  144. model.setValue("/root/hidden/smpid20600/cond/pidsn", model.getValue("/root/main/list1/clbs[" + irow + "]/pidsn"));
  145. model.setValue("/root/hidden/smpid20600/cond/t_clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym")); //생성청구년월
  146. model.setValue("/root/hidden/smpid20600/cond/t_clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg")); //생성청구차수
  147. model.setValue("/root/hidden/smpid20600/cond/t_clamflagcd", "0"); //생청청구구분
  148. modal("SMPID22400", "1", "50", "100", "SMPID22400", "/root/hidden/smpid20600/cond", "/root/init/item1", "", ""); // SMPID22400_명세서복사.xrw
  149. }
  150. }
  151. //-----------------------------------
  152. //명세서 이동
  153. //-----------------------------------
  154. function pidfDocuMove() {
  155. var irow = grd_clbsmast.row;
  156. var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
  157. if (clamkey) {
  158. model.setValue("/root/hidden/smpid20600/cond/makeflag", "3"); // 3:명세서 이동
  159. model.setValue("/root/hidden/smpid20600/cond/copyflag", ""); // 명세서복사인 경우만 해당
  160. model.setValue("/root/hidden/smpid20600/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
  161. model.setValue("/root/hidden/smpid20600/cond/clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
  162. model.setValue("/root/hidden/smpid20600/cond/clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
  163. model.setValue("/root/hidden/smpid20600/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
  164. model.setValue("/root/hidden/smpid20600/cond/pidsn", model.getValue("/root/main/list1/clbs[" + irow + "]/pidsn"));
  165. model.setValue("/root/hidden/smpid20600/cond/t_clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym")); //생성청구년월
  166. model.setValue("/root/hidden/smpid20600/cond/t_clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg")); //생성청구차수
  167. model.setValue("/root/hidden/smpid20600/cond/t_clamflagcd", "0"); //생청청구구분
  168. modal("SMPID22500", "1", "50", "100", "SMPID22500", "/root/hidden/smpid20600/cond", "/root/init/item1", "", ""); // SMPID22500_명세서이동.xrw
  169. }
  170. }
  171. //-----------------------------------
  172. //명세서 처방이동
  173. //-----------------------------------
  174. function pidfDocuOrderMove() {
  175. var irow = grd_clbsmast.row;
  176. var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
  177. if (clamkey) {
  178. model.setValue("/root/hidden/smpid20600/cond/makeflag", "6"); // 6:명세서 처방이동
  179. model.setValue("/root/hidden/smpid20600/cond/copyflag", ""); // 명세서복사인 경우만 해당
  180. model.setValue("/root/hidden/smpid20600/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
  181. model.setValue("/root/hidden/smpid20600/cond/clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
  182. model.setValue("/root/hidden/smpid20600/cond/clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
  183. model.setValue("/root/hidden/smpid20600/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
  184. model.setValue("/root/hidden/smpid20600/cond/pidsn", model.getValue("/root/main/list1/clbs[" + irow + "]/pidsn"));
  185. modal("SMPID23200", "1", "50", "100", "SMPID23200", "/root/hidden/smpid20600/cond", "/root/init/item1", "", ""); // SMPID23200_명세서처방이동.xrw
  186. }
  187. }
  188. //-----------------------------------
  189. //추가청구
  190. //-----------------------------------
  191. function pidfDocuAddClam() {
  192. var irow = grd_clbsmast.row;
  193. var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
  194. if (clamkey) {
  195. model.setValue("/root/hidden/smpid20600/cond/makeflag", "4"); // 4:추가청구생성
  196. model.setValue("/root/hidden/smpid20600/cond/copyflag", ""); // 명세서복사인 경우만 해당
  197. model.setValue("/root/hidden/smpid20600/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
  198. model.setValue("/root/hidden/smpid20600/cond/clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
  199. model.setValue("/root/hidden/smpid20600/cond/clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
  200. model.setValue("/root/hidden/smpid20600/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
  201. model.setValue("/root/hidden/smpid20600/cond/pidsn", model.getValue("/root/main/list1/clbs[" + irow + "]/pidsn"));
  202. model.setValue("/root/hidden/smpid20600/cond/t_clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym")); //생성청구년월
  203. model.setValue("/root/hidden/smpid20600/cond/t_clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg")); //생성청구차수
  204. model.setValue("/root/hidden/smpid20600/cond/t_clamflagcd", "2"); //생청청구구분
  205. modal("SMPID22600", "1", "50", "100", "SMPID22600", "/root/hidden/smpid20600/cond", "/root/init/item1", "", ""); // SMPID22600_명세서추가청구생성.xrw
  206. }
  207. }
  208. //-----------------------------------
  209. //자격수정
  210. //-----------------------------------
  211. function pidfDocuChange() {
  212. var irow = grd_clbsmast.row;
  213. var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
  214. var clamflagcd = model.getValue("root/main/list1/clbs[" + irow + "]/clamflagcd");
  215. if (clamflagcd == "1")
  216. {
  217. messageBox("보완청구의 경우에는 자격 변경을 방지하기 위해 명세서 자격수정을", "E001");
  218. }
  219. else
  220. {
  221. if (clamkey) {
  222. model.setValue("/root/hidden/smpid20600/cond/makeflag", "5"); // 5:자격수정
  223. model.setValue("/root/hidden/smpid20600/cond/copyflag", ""); // 명세서복사인 경우만 해당
  224. model.setValue("/root/hidden/smpid20600/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
  225. model.setValue("/root/hidden/smpid20600/cond/clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
  226. model.setValue("/root/hidden/smpid20600/cond/clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
  227. model.setValue("/root/hidden/smpid20600/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
  228. model.setValue("/root/hidden/smpid20600/cond/pidsn", model.getValue("/root/main/list1/clbs[" + irow + "]/pidsn"));
  229. modal("SMPID22700", "1", "50", "100", "SMPID22700", "/root/hidden/smpid20600/cond", "/root/init/item1", "", ""); // SMPID22700_명세서자격수정.xrw
  230. }
  231. }
  232. }
  233. //-----------------------------------
  234. //공여자명세서생성
  235. //-----------------------------------
  236. function pidfDocuDonor() {
  237. var irow = grd_clbsmast.row;
  238. var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
  239. if (clamkey) {
  240. model.setValue("/root/hidden/smpid22200/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
  241. model.setValue("/root/hidden/smpid22200/cond/clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
  242. model.setValue("/root/hidden/smpid22200/cond/clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
  243. model.setValue("/root/hidden/smpid22200/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
  244. model.setValue("/root/hidden/smpid22200/cond/pidsn", model.getValue("/root/main/list1/clbs[" + irow + "]/pidsn"));
  245. modal("SMPID22200", "1", "250", "220", "SMPID22200", "/root/hidden/smpid22200/cond", "/root/init/item1", "", ""); // SMPID22200_공여자명세서생성.xrw
  246. }
  247. }
  248. //-----------------------------------
  249. //명세서처방 이동/복사
  250. //-----------------------------------
  251. function pidfDocuCopyMove() {
  252. var irow = grd_clbsmast.row;
  253. var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
  254. if (clamkey) {
  255. model.setValue("/root/hidden/smpid23200/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
  256. model.setValue("/root/hidden/smpid23200/cond/clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
  257. model.setValue("/root/hidden/smpid23200/cond/clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
  258. model.setValue("/root/hidden/smpid23200/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
  259. model.setValue("/root/hidden/smpid23200/cond/pidsn", model.getValue("/root/main/list1/clbs[" + irow + "]/pidsn"));
  260. model.setValue("/root/hidden/smpid23200/cond/patnm", model.getValue("/root/main/list1/clbs[" + irow + "]/patnm"));
  261. model.setValue("/root/hidden/smpid23200/cond/insukind", model.getValue("/root/main/list1/clbs[" + irow + "]/insukindcd"));
  262. model.setValue("/root/hidden/smpid23200/cond/suppkind", model.getValue("/root/main/list1/clbs[" + irow + "]/suppkindcd"));
  263. model.setValue("/root/hidden/smpid23200/cond/orddeptcd", model.getValue("/root/main/list1/clbs[" + irow + "]/orddeptcd"));
  264. modal("SMPID23200", "1", "50", "100", "SMPID23200", "/root/hidden/smpid23200/cond", "/root/init/item1", "", ""); // SMPID23200_명세서처방복사.xrw
  265. }
  266. }
  267. //-----------------------------------
  268. //심사자변경
  269. //-----------------------------------
  270. function pidfJudgridChange() {
  271. var irow = grd_clbsmast.row;
  272. var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
  273. if (clamkey) {
  274. model.setValue("/root/hidden/smpid23000/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
  275. model.setValue("/root/hidden/smpid23000/cond/clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
  276. model.setValue("/root/hidden/smpid23000/cond/clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
  277. model.setValue("/root/hidden/smpid23000/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
  278. model.setValue("/root/hidden/smpid23000/cond/pidsn", model.getValue("/root/main/list1/clbs[" + irow + "]/pidsn"));
  279. modal("SMPID23000", "1", "50", "100", "SMPID23000", "/root/hidden/smpid23000/cond", "/root/init/item1", "", ""); // SMPID23000_심사자변경.xrw
  280. }
  281. }
  282. //-------------------------------------------------------------------
  283. // 1. 재청구 삭제일 경우 : (1). 반송부제기사유 체크
  284. // (2). 반송부제기사유 UPDATE
  285. //-------------------------------------------------------------------
  286. function pidfChkAbdResncd() {
  287. var abdresncd = model.getValue("/root/main/item1/clbs/abdresncd");
  288. if (abdresncd == "") {
  289. messageBox("반송부제기사유는","I003"); //I003=필수입력입니다.
  290. model.setFocus("cmb_abdresncd");
  291. return false;
  292. } else {
  293. return true;
  294. }
  295. }
  296. //-------------------------------------------------------------------
  297. // 2. 명세서삭제일 경우 : (1). 명세서삭제사유 체크
  298. // (2). 기타일경우 심사자메모에 기타사유 추가
  299. //-------------------------------------------------------------------
  300. function pidfChkDocuDelResncd() {
  301. var docudelresncd = model.getValue("/root/main/item1/clbs/docudelresncd");
  302. if (docudelresncd == "") {
  303. messageBox("명세서삭제사유는","I003"); //I003=필수입력입니다.
  304. model.setFocus("cmb_docudelresncd");
  305. return false;
  306. } else {
  307. var docudelresncd = model.getValue("/root/main/item1/clbs/docudelresncd");
  308. if (docudelresncd == "Z") {
  309. // 명세서삭제사유가 "기타"인경우 심사자메모에 기타사유 넣는다.
  310. var judgmemo = model.getValue("/root/main/item1/memo/judgmemo");
  311. judgmemo = "[명세서 삭제: 기타]" || " " || judgmemo
  312. model.setValue("/root/main/item1/memo/judgmemo", judgmemo);
  313. }
  314. return true;
  315. }
  316. }
  317. //-----------------------------------
  318. // 상병별 청구환자조회
  319. //-----------------------------------
  320. function pidfOpenSMPIS00400(ioflag) {
  321. if (ioflag == "I") {
  322. var irow = grd_clbsmast.row;
  323. } else {
  324. var srchmode = model.getValue("/root/hidden/clbs/srchmode");
  325. if (srchmode == "specclbs") { // 선별심사 모드인 경우
  326. var irow = grd_specclbs.row;
  327. } else {
  328. var irow = grd_clbsmast.row;
  329. }
  330. }
  331. var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
  332. if (clamkey) {
  333. model.setValue("/root/hidden/smpis00400/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
  334. model.setValue("/root/hidden/smpis00400/cond/clamymfrom", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
  335. model.setValue("/root/hidden/smpis00400/cond/clamymto", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
  336. model.setValue("/root/hidden/smpis00400/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
  337. model.setValue("/root/hidden/smpis00400/cond/insukind", model.getValue("/root/main/list1/clbs[" + irow + "]/insukindcd"));
  338. var i = 1;
  339. var nodeList = instance1.selectNodes("/root/init/orddeptcd/orddeptcdlist");
  340. var orddeptcd = model.getValue("/root/main/list1/clbs[" + irow + "]/orddeptcd");
  341. for ( i = 1; i < nodeList.length; i++) {
  342. if ( orddeptcd == model.getValue("/root/init/orddeptcd/orddeptcdlist[" + i + "]/deptengabbr")) {
  343. orddeptcd = model.getValue("/root/init/orddeptcd/orddeptcdlist[" + i + "]/cd");
  344. break;
  345. }
  346. }
  347. model.setValue("/root/hidden/smpis00400/cond/orddeptcd", orddeptcd);
  348. model.setValue("/root/hidden/smpis00400/cond/diagcond", "M"); // 상병조건 : M:주상병, S:부상병
  349. model.setValue("/root/hidden/smpis00400/cond/diagcdfr", ""); // 시작상병
  350. model.setValue("/root/hidden/smpis00400/cond/diagcdto", ""); // 종료상병
  351. }
  352. modal("SMPIS00400", "1", "10", "10", "SMPIS00400", "/root/hidden/smpis00400/cond", "/root/send/item1", "", ""); // SMPIS00400_상병별청구환자조회.xrw
  353. }
  354. //-----------------------------------
  355. // 처방별 환자조회(계산)
  356. //-----------------------------------
  357. function pidfOpenSMPIS00500(ioflag, calltype, codetype) {
  358. model.resetInstanceNode("/root/hidden/smpis00500/cond");
  359. // calltype : M:사후대상자조회 호출(환자별검색), D:사후메인에서 호출(코드별검색)
  360. if (calltype == "M") {
  361. if (ioflag == "I") {
  362. var irow = grd_clbsmast.row;
  363. } else {
  364. var srchmode = model.getValue("/root/hidden/clbs/srchmode");
  365. if (srchmode == "specclbs") { // 선별심사 모드인 경우
  366. var irow = grd_specclbs.row;
  367. } else {
  368. var irow = grd_clbsmast.row;
  369. }
  370. }
  371. var pid = model.getValue("/root/main/list1/clbs[" + irow + "]/pid");
  372. if (pid) {
  373. model.makeValue("/root/hidden/smpis00500/cond/patunitsrch", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
  374. model.makeValue("/root/hidden/smpis00500/cond/fromdd", model.getValue("/root/main/list1/clbs[" + irow + "]/ordfromdd"));
  375. model.makeValue("/root/hidden/smpis00500/cond/todd", model.getValue("/root/main/list1/clbs[" + irow + "]/ordtodd"));
  376. if (ioflag == "O") {
  377. model.makeValue("/root/hidden/smpis00500/cond/ioflag", "A");
  378. model.makeValue("/root/hidden/smpis00500/cond/orddrid", "");
  379. }
  380. else {
  381. model.makeValue("/root/hidden/smpis00500/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
  382. model.makeValue("/root/hidden/smpis00500/cond/orddrid", model.getValue("/root/main/list1/clbs[" + irow + "]/orddrid"));
  383. }
  384. model.makeValue("/root/hidden/smpis00500/cond/orddeptcd", model.getValue("/root/main/list1/clbs[" + irow + "]/orddeptcd"));
  385. model.makeValue("/root/hidden/smpis00500/cond/codecond", "calc"); // calc:코드별, cancer:항암제, kind:분류별
  386. model.makeValue("/root/hidden/smpis00500/cond/code", ""); // 검색할 수가코드
  387. }
  388. }
  389. else {
  390. var irow = grd_clodhist.row;
  391. var pid = model.getValue("/root/main/item1/clbs/pid");
  392. if (pid) {
  393. model.makeValue("/root/hidden/smpis00500/cond/patunitsrch", model.getValue("/root/main/item1/clbs/pid"));
  394. if (ioflag == "O") {
  395. model.makeValue("/root/hidden/smpis00500/cond/fromdd", model.getValue("/root/main/item1/clbs/indd"));
  396. model.makeValue("/root/hidden/smpis00500/cond/todd", model.getValue("/root/main/item1/clbs/dschdd"));
  397. model.makeValue("/root/hidden/smpis00500/cond/orddrid", "");
  398. if (model.getValue("/root/main/item1/clbs/stsioflag") == "-")
  399. model.makeValue("/root/hidden/smpis00500/cond/ioflag", "O");
  400. else
  401. model.makeValue("/root/hidden/smpis00500/cond/ioflag", "I");
  402. }
  403. else {
  404. model.makeValue("/root/hidden/smpis00500/cond/fromdd", model.getValue("/root/main/item1/clbs/ordfromdd"));
  405. model.makeValue("/root/hidden/smpis00500/cond/todd", model.getValue("/root/main/item1/clbs/ordtodd"));
  406. model.makeValue("/root/hidden/smpis00500/cond/orddrid", model.getValue("/root/main/item1/clbs/orddrid"));
  407. model.makeValue("/root/hidden/smpis00500/cond/ioflag", model.getValue("/root/main/item1/clbs/ioflag"));
  408. }
  409. //model.makeValue("/root/hidden/smpis00500/cond/orddeptcd", model.getValue("/root/main/list1/clbs[" + irow + "]/orddeptcd"));
  410. //model.makeValue("/root/hidden/smpis00500/cond/orddeptcd", " ");
  411. // 20100322 김용민 수정
  412. model.makeValue("/root/hidden/smpis00500/cond/orddeptcd", "");
  413. model.makeValue("/root/hidden/smpis00500/cond/orddrid", "");
  414. model.makeValue("/root/hidden/smpis00500/cond/codecond", "calc"); // calc:코드별, cancer:항암제, kind:분류별
  415. if (codetype == "SnglCD")
  416. model.makeValue("/root/hidden/smpis00500/cond/code", model.getValue("/root/main/list2/clod["+ irow +"]/snglcalcscorcd")); // 검색할 수가코드
  417. else
  418. model.makeValue("/root/hidden/smpis00500/cond/edicd", model.getValue("/root/main/list2/clod["+ irow +"]/edicd")); // 검색할 EDI코드
  419. }
  420. }
  421. modal("SMPIS00500", "1", "10", "10", "SMPIS00500", "/root/hidden/smpis00500/cond", "/root/send", "", ""); // SMPIS00500_계산처방시행조회.xrw
  422. }
  423. //-----------------------------------
  424. // 처방별 환자조회(청구/삭감)
  425. //-----------------------------------
  426. function pidfOpenSMPIS00600(ioflag, calltype) {
  427. // calltype : M:사후대상자조회 호출(환자별검색), D:사후메인에서 호출(코드별검색)
  428. if (calltype == "M") {
  429. if (ioflag == "I") {
  430. var irow = grd_clbsmast.row;
  431. } else {
  432. var srchmode = model.getValue("/root/hidden/clbs/srchmode");
  433. if (srchmode == "specclbs") { // 선별심사 모드인 경우
  434. var irow = grd_specclbs.row;
  435. } else {
  436. var irow = grd_clbsmast.row;
  437. }
  438. }
  439. var pid = model.getValue("/root/main/list1/clbs[" + irow + "]/pid");
  440. if (pid) {
  441. model.makeValue("/root/hidden/smpis00600/cond/patunitsrch", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
  442. model.makeValue("/root/hidden/smpis00600/cond/clamym", "");
  443. model.makeValue("/root/hidden/smpis00600/cond/clamymfrom", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
  444. //model.makeValue("/root/hidden/smpis00600/cond/clamdgfrom", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
  445. model.makeValue("/root/hidden/smpis00600/cond/clamymto", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
  446. //model.makeValue("/root/hidden/smpis00600/cond/clamdgto", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
  447. model.makeValue("/root/hidden/smpis00600/cond/clamflag", model.getValue("/root/main/list1/clbs[" + irow + "]/clamflagcd"));
  448. model.makeValue("/root/hidden/smpis00600/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
  449. model.makeValue("/root/hidden/smpis00600/cond/insukind", model.getValue("/root/main/list1/clbs[" + irow + "]/insukindcd"));
  450. //model.makeValue("/root/hidden/smpis00600/cond/orddeptcd", model.getValue("/root/main/list1/clbs[" + irow + "]/orddeptcd"));
  451. //model.makeValue("/root/hidden/smpis00600/cond/orddrid", model.getValue("/root/main/list1/clbs[" + irow + "]/orddrid"));
  452. model.makeValue("/root/hidden/smpis00600/cond/cutonly", "false"); // 삭감처방만조회:true, 청구처방조회:false
  453. model.makeValue("/root/hidden/smpis00600/cond/code", ""); // 수가코드
  454. // 20100322 김용민 기본값 추가
  455. model.makeValue("/root/hidden/smpis00600/cond/codecond", "calc"); // calc:코드별, cancer:항암제, kind:분류별
  456. model.makeValue("/root/hidden/smpis00600/cond/trustinstcd", "N"); //
  457. model.makeValue("/root/hidden/smpis00600/cond/clamdgfrom", "");
  458. model.makeValue("/root/hidden/smpis00600/cond/clamdgto", "");
  459. model.makeValue("/root/hidden/smpis00600/cond/orddeptcd", "");
  460. model.makeValue("/root/hidden/smpis00600/cond/orddrid", "");
  461. } else {
  462. model.makeValue("/root/hidden/smpis00600/cond/patunitsrch", "");
  463. model.makeValue("/root/hidden/smpis00600/cond/clamym", "");
  464. model.makeValue("/root/hidden/smpis00600/cond/clamymfrom", "");
  465. model.makeValue("/root/hidden/smpis00600/cond/clamymto", "");
  466. model.makeValue("/root/hidden/smpis00600/cond/clamflag", "");
  467. model.makeValue("/root/hidden/smpis00600/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
  468. model.makeValue("/root/hidden/smpis00600/cond/insukind", "");
  469. model.makeValue("/root/hidden/smpis00600/cond/cutonly", "false"); // 삭감처방만조회:true, 청구처방조회:false
  470. model.makeValue("/root/hidden/smpis00600/cond/code", ""); // 수가코드
  471. // 20100322 김용민 기본값 추가
  472. model.makeValue("/root/hidden/smpis00600/cond/codecond", "calc"); // calc:코드별, cancer:항암제, kind:분류별
  473. model.makeValue("/root/hidden/smpis00600/cond/trustinstcd", "N"); //
  474. model.makeValue("/root/hidden/smpis00600/cond/clamdgfrom", "");
  475. model.makeValue("/root/hidden/smpis00600/cond/clamdgto", "");
  476. model.makeValue("/root/hidden/smpis00600/cond/orddeptcd", "");
  477. model.makeValue("/root/hidden/smpis00600/cond/orddrid", "");
  478. }
  479. }
  480. else {
  481. var irow = grd_clodhist.row;
  482. var pid = model.getValue("/root/main/item1/clbs/pid");
  483. if (pid) {
  484. model.makeValue("/root/hidden/smpis00600/cond/patunitsrch", model.getValue("/root/main/item1/clbs/pid"));
  485. model.makeValue("/root/hidden/smpis00600/cond/clamym", "");
  486. model.makeValue("/root/hidden/smpis00600/cond/clamymfrom", model.getValue("/root/main/item1/clbs/clamym"));
  487. //model.makeValue("/root/hidden/smpis00600/cond/clamdgfrom", model.getValue("/root/main/item1/clbs/clamdg"));
  488. model.makeValue("/root/hidden/smpis00600/cond/clamymto", model.getValue("/root/main/item1/clbs/clamym"));
  489. //model.makeValue("/root/hidden/smpis00600/cond/clamdgto", model.getValue("/root/main/item1/clbs/clamdg"));
  490. model.makeValue("/root/hidden/smpis00600/cond/clamflag", model.getValue("/root/main/item1/clbs/clamflagcd"));
  491. model.makeValue("/root/hidden/smpis00600/cond/ioflag", model.getValue("/root/main/item1/clbs/ioflag"));
  492. model.makeValue("/root/hidden/smpis00600/cond/insukind", model.getValue("/root/main/item1/clbs/insukindcd"));
  493. //model.makeValue("/root/hidden/smpis00600/cond/orddeptcd", model.getValue("/root/main/item1/clbs/orddeptcd"));
  494. //model.makeValue("/root/hidden/smpis00600/cond/orddrid", model.getValue("/root/main/item1/clbs/orddrid"));
  495. model.makeValue("/root/hidden/smpis00600/cond/cutonly", "false"); // 삭감처방만조회:true, 청구처방조회:false
  496. model.makeValue("/root/hidden/smpis00600/cond/code", model.getValue("/root/main/list2/clod["+ irow +"]/snglcalcscorcd")); // 수가코드
  497. // 20100322 김용민 기본값 추가
  498. model.makeValue("/root/hidden/smpis00600/cond/codecond", "calc"); // calc:코드별, cancer:항암제, kind:분류별
  499. model.makeValue("/root/hidden/smpis00600/cond/trustinstcd", "N"); //
  500. model.makeValue("/root/hidden/smpis00600/cond/clamdgfrom", "");
  501. model.makeValue("/root/hidden/smpis00600/cond/clamdgto", "");
  502. model.makeValue("/root/hidden/smpis00600/cond/orddeptcd", "");
  503. model.makeValue("/root/hidden/smpis00600/cond/orddrid", "");
  504. var curFrom = getCurrentDate().toDate().getAddDate(-6,"M").getDateFormat("YYYYMM");
  505. var curTo = getCurrentDate().toDate().getDateFormat("YYYYMM");
  506. model.makeValue("/root/hidden/smpis00600/cond/clamymfrom", curFrom);
  507. model.makeValue("/root/hidden/smpis00600/cond/clamymto", curTo);
  508. }
  509. }
  510. modal("SMPIS00600", "1", "10", "10", "SMPIS00600", "/root/hidden/smpis00600/cond", "/root/send", "", ""); // SMPIS00600_청구삭감조회.xrw
  511. }
  512. //------------------------------------
  513. // 급여구분별 사후처방조회
  514. //------------------------------------
  515. function pidfGetOrderWithPayflag() {
  516. var pid = model.getValue("/root/send/item1/clbs/pid");
  517. if (pid) {
  518. var payflag = model.getValue("/root/hidden/list2/clodsrch/selectedRdoPay");
  519. model.makeValue("/root/send/item1/clbs/payflag", payflag);
  520. if (submit("TRPID20310")) {
  521. grd_selectclod.attribute("left") = "0";
  522. grd_selectclod.attribute("top") = "286";
  523. grd_selectclod.visible = true;
  524. grd_clodhist.visible = false;
  525. }
  526. }
  527. }
  528. //-------------------------------------------------------------------
  529. // 생성삭제(입원,외래사후심사 대상자조회에서 "생성삭제"버튼 눌렀을 때
  530. //-------------------------------------------------------------------
  531. function pidfDelClamData(ioflag, deptcd) {
  532. /*
  533. if (grd_clbsmast.visible == true) {
  534. var iSel_Row = grd_clbsmast.selectedrow(0);
  535. var clamkey = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamkey");
  536. var pid = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/pid");
  537. var pidsn = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/pidsn");
  538. var patnm = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/patnm");
  539. var clamendyn = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamendyn");
  540. var lockyn = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/lockyn");
  541. if (clamkey != "" && clamkey != '-') {
  542. //if (clamendyn == "A" ) {
  543. if (lockyn != "Y" ) {
  544. var ans = messageBox("[ 환자명:" + patnm + ", 등록번호:" + pid + ", 순번:" + pidsn + " ] 생성삭제", "S001"); ///하시려면 예(Yes)\n아니면 아니오(No)
  545. if (ans == 6) { // 6: yes, 7:no, 2:cancel
  546. model.setValue("/root/send/item4/clbs/clamym", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamym"));
  547. model.setValue("/root/send/item4/clbs/clamdg", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamdg"));
  548. model.setValue("/root/send/item4/clbs/pid", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/pid"));
  549. model.setValue("/root/send/item4/clbs/pidsn", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/pidsn"));
  550. model.setValue("/root/send/item4/clbs/clamkey", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamkey"));
  551. model.setValue("/root/send/item4/clbs/ioflag", "I");
  552. model.setValue("/root/send/item4/clbs/instcd", getUserInfo("posinstcd"));
  553. if (submit("TXPID20303")) {
  554. model.removeNode("/root/main/list1/clbs["+iSel_Row+"]");
  555. grd_clbsmast.refresh();
  556. grd_clbsmast.row = iSel_Row;
  557. }
  558. }
  559. } else {
  560. messageBox("잠금설정상태입니다. 삭제", "E001"); ///할 수 없습니다.
  561. }
  562. }
  563. }
  564. else {
  565. messageBox("선별심사모드에서는 생성삭제", "E001"); ///선별심사모드에서는 생성삭제 할 수 없습니다.
  566. }
  567. */
  568. // 청구생성 삭제로직으로 변경함.
  569. if (grd_clbsmast.visible == true) {
  570. var iSel_Row = grd_clbsmast.selectedrow(0);
  571. var clamkey = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamkey");
  572. var lockyn = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/lockyn");
  573. if (clamkey != "" && clamkey != '-') {
  574. if (lockyn != "Y" ) {
  575. var pid = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/pid");
  576. var patnm = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/patnm");
  577. //var ans = messageBox("[ 환자명:" + patnm + ", 등록번호:" + pid + " ] 생성삭제", "S001"); ///하시려면 예(Yes)\n아니면 아니오(No)
  578. //var ans = messageBox("[ 환자명:" + patnm + ", 등록번호:" + pid + " ] 해당 환자의 전체보험유형, 진료분야, 진료과를 생성삭제", "S001"); ///하시려면 예(Yes)\n아니면 아니오(No)
  579. //var message = "1. 선택한 진료과만 삭제하시려면 : 예(Y)\n\n2. 전 체 진료과를 모두 삭제하시려면 : 아니오(N) 를 누르세요"
  580. //var ans = messageBox("[ 환자명:" + patnm + ", 등록번호:" + pid + ", 진료과:" + deptcd + " ]\n\n" + message, "S006"); ///하시려면 예(Yes)\n아니면 아니오(No)
  581. var message = "2. 전 체 진료과를 모두 삭제|3. 취 소";
  582. var ans = messageBox("[ 환자명:" + patnm + ", 등록번호:" + pid + ", 진료과:" + deptcd + " ]\n\n" + "1. 선택한 진료과만 삭제", "S006", message); ///하시려면 예(Yes)\n아니면 아니오(No)
  583. if (ans == 6 || ans == 7) { // 6: yes, 7:no, 2:cancel
  584. model.setValue("/root/send/item6/clbs/clamym", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamym")); // 1.청구년월
  585. model.setValue("/root/send/item6/clbs/clamdg", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamdg")); // 2.청구차수
  586. model.setValue("/root/send/item6/clbs/clamfromdd", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/cretfromdd")); // 3.생성시작일
  587. model.setValue("/root/send/item6/clbs/clamtodd", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/crettodd")); // 4.생성종료일
  588. // 전체보험유형,진료분야,진료과 삭제이면( 7:no )
  589. if (ans == 7) {
  590. // 5.보험유형 : -.전체
  591. model.setValue("/root/send/item6/clbs/insutype", "-");
  592. // 6.진료분야 : -.전체
  593. model.setValue("/root/send/item6/clbs/ordfildcd", "-");
  594. // 7.진료과
  595. model.setValue("/root/send/item6/clbs/orddeptcd", "");
  596. } else {
  597. // 5.보험유형
  598. var insukind = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/insukindcd");
  599. if (insukind == "11") {
  600. model.setValue("/root/send/item6/clbs/insutype", "2"); // 보험
  601. } else if (insukind == "21") {
  602. model.setValue("/root/send/item6/clbs/insutype", "4"); // 급여1종
  603. } else if (insukind == "22") {
  604. model.setValue("/root/send/item6/clbs/insutype", "5"); // 급여2종
  605. } else if (insukind == "41") {
  606. model.setValue("/root/send/item6/clbs/insutype", "6"); // 산재
  607. } else if (insukind == "31") {
  608. model.setValue("/root/send/item6/clbs/insutype", "7"); // 자보
  609. }
  610. // 6.진료분야
  611. model.setValue("/root/send/item6/clbs/ordfildcd", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/ordfildcd"));
  612. // 7.진료과
  613. model.setValue("/root/send/item6/clbs/orddeptcd", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/orddeptcd"));
  614. }
  615. model.setValue("/root/send/item6/clbs/clamflag", '-'); // 8.청구구분 : -.퇴원+중간, 1.퇴원청구, 2.중간청구
  616. model.setValue("/root/send/item6/clbs/predata", "4"); // 9.이전자료 : 4.삭제
  617. model.setValue("/root/send/item6/clbs/ownb100", "N"); // 10.전액본인 : N.생성안함
  618. model.setValue("/root/send/item6/clbs/datacretflag", "-"); // 11.생성여부 : -.전체
  619. model.setValue("/root/send/item6/clbs/pid", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/pid")); // 12.등록번호
  620. model.setValue("/root/send/item6/clbs/name", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/name")); // 13.환자명
  621. model.setValue("/root/send/item6/clbs/chk", "true"); // 14.선택여부
  622. // 15.집계구분
  623. if (ioflag == "I") {
  624. model.setValue("/root/send/item6/clbs/weekflag", "T");
  625. model.setValue("/root/send/item6/clbs/ioflag", ioflag);
  626. } else {
  627. model.setValue("/root/send/item6/clbs/weekflag", "S"); // S:집계 월단위 청구
  628. model.setValue("/root/send/item6/clbs/ioflag", ioflag);
  629. }
  630. // 16. 생성삭제
  631. if (submit("TXPID10102")) {
  632. //model.removeNode("/root/main/list1/clbs["+iSel_Row+"]");
  633. //grd_clbsmast.refresh();
  634. //grd_clbsmast.row = iSel_Row;
  635. }
  636. // 17. 생성삭제로그 자동호출
  637. btn_logview.dispatch("DOMActivate");
  638. messageBox("생성삭제되었는지 반드시 로그를 확인하시기 바랍니다. 생성삭제 호출", "I001"); //I001=처리되었습니다.
  639. }
  640. } else {
  641. messageBox("잠금설정상태입니다. 삭제", "E001"); ///할 수 없습니다.
  642. }
  643. }
  644. }
  645. else {
  646. messageBox("선별심사모드에서는 생성삭제", "E001"); ///선별심사모드에서는 생성삭제 할 수 없습니다.
  647. }
  648. }
  649. //-------------------------------------------------------------------
  650. // 2011.11.08 syjung
  651. // 명세서삭제(입원,외래사후심사 대상자조회에서 "명세서삭제"버튼 눌렀을 때
  652. //-------------------------------------------------------------------
  653. function pidfDelClbsData(ioflag, deptcd) {
  654. if (grd_clbsmast.visible == true) {
  655. var iSel_Row = grd_clbsmast.selectedrow(0);
  656. var clamkey = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamkey");
  657. var pid = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/pid");
  658. var pidsn = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/pidsn");
  659. var patnm = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/patnm");
  660. var clamendyn = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamendyn");
  661. var lockyn = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/lockyn");
  662. if (clamkey != "" && clamkey != '-') {
  663. //if (clamendyn == "A" ) {
  664. if (lockyn != "Y" ) {
  665. var ans = messageBox("[ 환자명:" + patnm + ", 등록번호:" + pid + ", 순번:" + pidsn + " ] 명세서를 삭제합니다. 삭제된 명세서는 복구할 수 없습니다. 계속 ", "S001"); ///하시려면 예(Yes)\n아니면 아니오(No)
  666. if (ans == 6) { // 6: yes, 7:no, 2:cancel
  667. model.setValue("/root/send/item4/clbs/clamym", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamym"));
  668. model.setValue("/root/send/item4/clbs/clamdg", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamdg"));
  669. model.setValue("/root/send/item4/clbs/pid", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/pid"));
  670. model.setValue("/root/send/item4/clbs/pidsn", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/pidsn"));
  671. model.setValue("/root/send/item4/clbs/clamkey", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamkey"));
  672. model.setValue("/root/send/item4/clbs/ioflag", ioflag);
  673. model.setValue("/root/send/item4/clbs/instcd", getUserInfo("posinstcd"));
  674. if (submit("TXPID20303")) {
  675. model.removeNode("/root/main/list1/clbs["+iSel_Row+"]");
  676. grd_clbsmast.refresh();
  677. grd_clbsmast.row = iSel_Row;
  678. }
  679. }
  680. } else {
  681. messageBox("잠금설정상태입니다. 삭제", "E001"); ///할 수 없습니다.
  682. }
  683. }
  684. }
  685. else {
  686. messageBox("선별심사모드에서는 생성삭제", "E001"); ///선별심사모드에서는 생성삭제 할 수 없습니다.
  687. }
  688. }
  689. //-----------------------------------------------------------------------------------
  690. // 결과조회 : SMAER00800_결과조회 (외래, 입원사후대상자조회에서 마우스 팝업으로 조회)
  691. //-------------------------------------------------------------
  692. function pidfOrderRsltSrch() {
  693. var row = grd_clbsmast.row;
  694. var pid = model.getValue("/root/main/list1/clbs[" + row + "]/pid");
  695. if (pid) { // 조회된 심사대상자가 있으면
  696. // ast/examcureweb/xrw/SMAER00800_결과조회.xrw
  697. model.makeValue("/root/hidden/smaer00800/cond/srchdate1", model.getValue("/root/main/list1/clbs[" + row + "]/indd"));
  698. model.makeValue("/root/hidden/smaer00800/cond/srchdate2", getCurrentDate()); // (dateHelper.js) 현재날짜 반환
  699. model.makeValue("/root/hidden/smaer00800/cond/srchpid", model.getValue("/root/main/list1/clbs[" + row + "]/pid"));
  700. model.makeValue("/root/hidden/smaer00800/cond/wardcd", ""); //model.getValue("/root/main/item1/iteminfo/wardcd"));
  701. model.makeValue("/root/hidden/smaer00800/cond/roomcd", ""); //model.getValue("/root/main/item1/iteminfo/roomcd"));
  702. model.makeValue("/root/hidden/smaer00800/cond/listflag", "P");
  703. model.makeValue("/root/hidden/smaer00800/cond/deptcd", model.getValue("/root/main/list1/clbs[" + row + "]/orddeptcd"));
  704. model.makeNode("/root/hidden/smaer00800/cond/drid");
  705. model.makeNode("/root/hidden/smaer00800/cond/chkcheck");
  706. model.makeValue("/root/hidden/smaer00800/cond/chkcheck1", "A");
  707. model.makeValue("/root/hidden/smaer00800/cond/chkcheck2", "B");
  708. model.makeValue("/root/hidden/smaer00800/cond/chkcheck3", "C");
  709. model.makeValue("/root/hidden/smaer00800/cond/chkcheck4", "D");
  710. model.makeValue("/root/hidden/smaer00800/cond/chkcheck5", "E");
  711. model.makeValue("/root/hidden/smaer00800/cond/chkcheck6", "F");
  712. model.makeValue("/root/hidden/smaer00800/cond/chkcheck7", "G");
  713. model.makeNode("/root/hidden/smaer00800/cond/chkcheck8");
  714. model.makeNode("/root/hidden/smaer00800/cond/tabflag");
  715. model.makeNode("/root/hidden/smaer00800/cond/mdlcd");
  716. model.makeNode("/root/hidden/smaer00800/cond/examgubun");
  717. model.makevalue("/root/hidden/smaer00800/cond/srchflag", "B");
  718. model.makevalue("/root/hidden/smaer00800/cond/hlaflag", "N");
  719. model.makevalue("/root/hidden/smaer00800/cond/prntfrmflag", "");
  720. //modal("SMAER00800", "1", "10", "10", "SMAER00800", "/root/hidden/smaer00800/cond", "/root/send/data/singdata", "", ""); // SMAER00800_결과조회
  721. open("SMAER00800", "1", "10", "10", "SMAER00800", "/root/hidden/smaer00800/cond", "/root/send/data/singdata", "", ""); // SMAER00800_결과조회
  722. }
  723. }
  724. //-----------------------------------------------------------------------------------
  725. // 결과조회 : SMAER00800_결과조회 (외래사후대상자조회 선별조회 에서 마우스 팝업으로 조회)
  726. //-------------------------------------------------------------
  727. function pidfOrderRsltSrch2() {
  728. var row = grd_specclbs.row;
  729. var pid = model.getValue("/root/main/list1/clbs[" + row + "]/pid");
  730. if (pid) { // 조회된 심사대상자가 있으면
  731. // ast/examcureweb/xrw/SMAER00800_결과조회.xrw
  732. model.makeValue("/root/hidden/smaer00800/cond/srchdate1", model.getValue("/root/main/list1/clbs[" + row + "]/indd"));
  733. model.makeValue("/root/hidden/smaer00800/cond/srchdate2", getCurrentDate()); // (dateHelper.js) 현재날짜 반환
  734. model.makeValue("/root/hidden/smaer00800/cond/srchpid", model.getValue("/root/main/list1/clbs[" + row + "]/pid"));
  735. model.makeValue("/root/hidden/smaer00800/cond/wardcd", ""); //model.getValue("/root/main/item1/iteminfo/wardcd"));
  736. model.makeValue("/root/hidden/smaer00800/cond/roomcd", ""); //model.getValue("/root/main/item1/iteminfo/roomcd"));
  737. model.makeValue("/root/hidden/smaer00800/cond/listflag", "P");
  738. model.makeValue("/root/hidden/smaer00800/cond/deptcd", model.getValue("/root/main/list1/clbs[" + row + "]/orddeptcd"));
  739. model.makeNode("/root/hidden/smaer00800/cond/drid");
  740. model.makeNode("/root/hidden/smaer00800/cond/chkcheck");
  741. model.makeValue("/root/hidden/smaer00800/cond/chkcheck1", "A");
  742. model.makeValue("/root/hidden/smaer00800/cond/chkcheck2", "B");
  743. model.makeValue("/root/hidden/smaer00800/cond/chkcheck3", "C");
  744. model.makeValue("/root/hidden/smaer00800/cond/chkcheck4", "D");
  745. model.makeValue("/root/hidden/smaer00800/cond/chkcheck5", "E");
  746. model.makeValue("/root/hidden/smaer00800/cond/chkcheck6", "F");
  747. model.makeValue("/root/hidden/smaer00800/cond/chkcheck7", "G");
  748. model.makeNode("/root/hidden/smaer00800/cond/chkcheck8");
  749. model.makeNode("/root/hidden/smaer00800/cond/tabflag");
  750. model.makeNode("/root/hidden/smaer00800/cond/mdlcd");
  751. model.makeNode("/root/hidden/smaer00800/cond/examgubun");
  752. model.makevalue("/root/hidden/smaer00800/cond/srchflag", "B");
  753. model.makevalue("/root/hidden/smaer00800/cond/hlaflag", "N");
  754. model.makevalue("/root/hidden/smaer00800/cond/prntfrmflag", "");
  755. //modal("SMAER00800", "1", "10", "10", "SMAER00800", "/root/hidden/smaer00800/cond", "/root/send/data/singdata", "", ""); // SMAER00800_결과조회
  756. open("SMAER00800", "1", "10", "10", "SMAER00800", "/root/hidden/smaer00800/cond", "/root/send/data/singdata", "", ""); // SMAER00800_결과조회
  757. }
  758. }
  759. //--------------------------
  760. // KDRG 3.2 DRG분류번호 생성
  761. //--------------------------
  762. function pidfGetKDRGCode() {
  763. var fso,fileObj,inputStr='';
  764. var ForReading=1,ForWriting=2; // 화일/읽기 쓰기 지정을 쉽게하기 위한 변수
  765. // var gExecfilePath ='c:\\kdrg32batch\\kdrg30.exe';
  766. // var gWritefilePath ='c:\\kdrg32batch\\kdrg30.in';
  767. // var gReadfilePath ='c:\\kdrg32batch\\kdrg30.out';
  768. var gExecfilePath ='c:\\kdrg33\\kdrg33.exe';
  769. var gWritefilePath ='c:\\kdrg33\\kdrg33.in';
  770. var gReadfilePath ='c:\\kdrg33\\kdrg33.out';
  771. fso=new ActiveXObject('Scripting.FileSystemObject');
  772. // KDRG 3.2 배치 프로그램이 설치되어 있고 DRG분류번호가 '-'인 경우 실행
  773. if (fso.FileExists(gExecfilePath) && model.getValue("/root/main/item1/clbs/drgcd") == '-') {
  774. var cnt01=0, cnt02=0, cnt03=0, cnt04=0, cnt05=0; // 각 코드별 객수
  775. var code01Arr = Array();
  776. var code02Arr = Array();
  777. var code03Arr = Array();
  778. var code04Arr = Array();
  779. var code05Arr = Array();
  780. var i=1, k=0;
  781. var rowstaus;
  782. var diagcd = "";
  783. var unit = "";
  784. var codetype = "";
  785. var payflag = "";
  786. var basecd = "";
  787. var makeStr = "";
  788. var cldinodeList = instance1.selectNodes("/root/main/list1/cldi");
  789. var clodnodeList = instance1.selectNodes("/root/main/list2/clod");
  790. // 상병 및 처방갯수가 0개만 아닌 경우만 실행
  791. if (cldinodeList.length > 0 && clodnodeList.length > 0) {
  792. // 1. KDRG - 환자기본조회(요양기관번호,주민번호, 요야개시일, 입원일수, 진료결과, 입원시체중등..)
  793. makeStr += model.getValue("/root/main/item1/clbs/proccorpcd"); // (1).요양기관기호 : 1 8
  794. makeStr += model.getValue("/root/main/item1/clbs/patrrgstno"); // (2).주민번호 : 9 13
  795. makeStr += model.getValue("/root/main/item1/clbs/ordfromdd"); // (3).요양개시일 : 22 8
  796. makeStr += model.getValue("/root/main/item1/clbs/chosindayno").getLeftPad(3, "0"); // (4).입원일수 : 30 3
  797. makeStr += model.getValue("/root/main/item1/clbs/ordrsltcd"); // (5).진료결과 : 33 1
  798. // 2. KDRG - 진단코드조회
  799. for( i=1; i <= cldinodeList.length; i++) {
  800. rowstaus = model.getValue("/root/main/list1/cldi[" + i + "]/rowstat");
  801. if ( rowstaus != "D") { // 삭제아닌것만...
  802. diagcd = model.getValue("/root/main/list1/cldi[" + i + "]/diagcd");
  803. //diagcd = diagcd.getLeftPad(5, " ");
  804. diagcd = diagcd.getRightPad(5, " "); // 20100201 수정
  805. makeStr += diagcd
  806. if (i == 10) break;
  807. }
  808. }
  809. // 20100201 추가
  810. for( k=i; k <= 10; k++) {
  811. makeStr += " ";
  812. }
  813. // 3. KDRG - 적용수가코드(시술, 검사, 방사선, 주사및혈액제제, 마취및호흡치료)
  814. for( i=1; i <= clodnodeList.length; i++) {
  815. payflag = model.getValue("/root/main/list2/clod[" + i + "]/payflag");
  816. rowstaus = model.getValue("/root/main/list2/clod[" + i + "]/rowstat");
  817. //if (payflag == "0" || payflag == "9" || grd_clodhist.rowHidden(i) == false) {
  818. if ( payflag == "0" && rowstaus != "D" ) {
  819. unit = model.getValue("/root/main/list2/clod[" + i + "]/unit");
  820. basecd = model.getValue("/root/main/list2/clod[" + i + "]/basecd");
  821. basecd = basecd.substr(0, 5);
  822. if (unit >= "자1" && unit <= "자810") codetype = "01"; // 01. 시술코드
  823. else if (unit >= "저21" && unit <= "저891") codetype = "01";
  824. else if (unit >= "차1" && unit <= "차113") codetype = "01";
  825. else if (unit >= "처1" && unit <= "처102") codetype = "01";
  826. else if (unit >= "나610" && unit <= "나624") codetype = "02"; // 02. 검사코드
  827. else if (unit >= "나720" && unit <= "나729") codetype = "02";
  828. else if (unit >= "너681" && unit <= "너705") codetype = "02";
  829. else if (unit >= "너871" && unit <= "너874") codetype = "02";
  830. else if (unit >= "나750" && unit <= "나862") codetype = "02";
  831. else if (unit == "너961") codetype = "02";
  832. else if (unit >= "다201" && unit <= "다276") codetype = "03"; // 03. 방사선코드
  833. else if (unit >= "다401" && unit <= "다412-1") codetype = "03";
  834. else if (unit >= "더401" && unit <= "더402") codetype = "03";
  835. else if (unit >= "마1" && unit <= "마16" ) codetype = "04"; // 04. 주사및혈액제제코드
  836. else if (unit == "머1") codetype = "04";
  837. else if (unit >= "마102" && unit <= "마107") codetype = "04";
  838. else if (unit >= "파1" && unit <= "파2" ) codetype = "04";
  839. else if (unit >= "바21" && unit <= "바26") codetype = "05"; // 05. 마취및호흡치료코드
  840. else if (unit == "버51") codetype = "05";
  841. else if (unit >= "바31" && unit <= "바35") codetype = "05";
  842. else if (unit == "버71") codetype = "05";
  843. else if (unit >= "사30" && unit <= "사41") codetype = "05";
  844. else if (unit >= "서31" && unit <= "서36") codetype = "05";
  845. else codetype = "-";
  846. if (codetype == "01" ) {
  847. if (cnt01 == 10) continue;
  848. code01Arr[cnt01] = basecd.getRightPad(5, " ");
  849. cnt01++;
  850. } else if (codetype == "02") {
  851. if (cnt02 == 5) continue;
  852. code02Arr[cnt02] = basecd.getRightPad(5, " ");
  853. cnt02++;
  854. } else if (codetype == "03" && cnt01 != 5) {
  855. if (cnt03 == 5) continue;
  856. code03Arr[cnt03] = basecd.getRightPad(5, " ");
  857. cnt03++;
  858. } else if (codetype == "04" && cnt01 != 5) {
  859. if (cnt04 == 5) continue;
  860. code04Arr[cnt04] = basecd.getRightPad(5, " ");
  861. cnt04++;
  862. } else if (codetype == "05" && cnt01 != 5) {
  863. if (cnt05 == 5) continue;
  864. code05Arr[cnt05] = basecd.getRightPad(5, " ");
  865. cnt05++;
  866. }
  867. }
  868. }
  869. // (7). 시술코드1-10 (시작위치:84, 길이:50)
  870. for (k = 0; k < code01Arr.length; k++) {
  871. makeStr += code01Arr[k];
  872. }
  873. if (cnt01 != 10) {
  874. for ( i = 1; i <= (10 - cnt01); i++) {;
  875. makeStr += " ";
  876. }
  877. }
  878. // (8). 검사코드1-5 (시작위치:134, 길이:25)
  879. for (k = 0; k < code02Arr.length; k++) {
  880. makeStr += code02Arr[k];
  881. }
  882. if (cnt02 != 5) {
  883. for ( i = 1; i <= (5 - cnt02); i++) {
  884. makeStr += " ";
  885. }
  886. }
  887. // (9). 방사선코드1-5 (시작위치:159, 길이:25)
  888. for (k = 0; k < code03Arr.length; k++) {
  889. makeStr += code03Arr[k];
  890. }
  891. if (cnt03 != 5) {
  892. for ( i = 1; i <= (5 - cnt03); i++) {
  893. makeStr += " ";
  894. }
  895. }
  896. // (10). 주사및혈액제제코드1-5 (시작위치:184, 길이:25)
  897. for (k = 0; k < code04Arr.length; k++) {
  898. makeStr += code04Arr[k];
  899. }
  900. if (cnt04 != 5) {
  901. for ( i = 1; i <= (5 - cnt04); i++) {
  902. makeStr += " ";
  903. }
  904. }
  905. // (11). 마취및호흡치료코드1-5 (시작위치:209, 길이:25)
  906. for (k = 0; k < code05Arr.length; k++) {
  907. makeStr += code05Arr[k];
  908. }
  909. if (cnt05 != 5) {
  910. for ( i = 1; i <= (5 - cnt05); i++) {
  911. makeStr += " ";
  912. }
  913. }
  914. // (12). 알콜및약물중독재활치료코드 (시작위치:234, 길이:5)
  915. makeStr += " ";
  916. // (13). 부가코드1-5 (시작위치:239, 길이:25)
  917. for ( i = 1;i <= 5; i++) {
  918. makeStr += " ";
  919. }
  920. // (14). 입원시체중(g) : 만1세미만 기재 (시작위치:264, 길이:5)
  921. makeStr += "00000";
  922. // (15). 인공호흡시간(hour) : 만1세미만 기재 (시작위치:269, 길이:5) ==> 현재 EMR팀 미개발(2008-10-16)");
  923. makeStr += "00000";
  924. // (16). MDC (시작위치:274, 길이:3)
  925. makeStr += "000";
  926. // (17). ADRG (시작위치:277, 길이:4)
  927. makeStr += "0000";
  928. // (18). PCCL (시작위치:281, 길이:1)
  929. makeStr += "0";
  930. // (19). DRG (시작위치:282, 길이:6)
  931. makeStr += "000000";
  932. // (20). version (시작위치:288, 길이:8)
  933. makeStr += "00000000";
  934. ////////////////////////////////////////////////////////////////////////////////////////////////////////////
  935. // 1.기존파일 삭제 ==> 2.파일 쓰기 ==> 3.KDRG실행 ==> 4. Timer ==> 5.파일 읽기
  936. ////////////////////////////////////////////////////////////////////////////////////////////////////////////
  937. // 1.기존파일 삭제
  938. if (fso.FileExists(gWritefilePath)) {
  939. fso.DeleteFile(gWritefilePath); // kdrg30.in 삭제
  940. }
  941. if (fso.FileExists(gReadfilePath)) {
  942. fso.DeleteFile(gReadfilePath); // kdrg30.out 삭제
  943. }
  944. // 2. 파일 쓰기(kdrg30.in)
  945. fileObj=fso.CreateTextFile(gWritefilePath, true); // 쓰기 위한 화일을 변수에 개체를 할당한다.
  946. fileObj.WriteLine(makeStr);
  947. fileObj.Close(); // 화일을 닫는다.
  948. // kdrg30.in 파일이 있는 경우만 실행
  949. if (fso.FileExists(gWritefilePath)) {
  950. // 3. KDRG 실행
  951. //window.exec("cmd.exe", "/c cd c:\\KDRG32batch\\ && kdrg30.exe");
  952. window.exec("c:\\kdrg33\\kdrg33.exe","","c:\\kdrg33");
  953. // 4. kdrg30.out파일이 생성될때까지 timer
  954. //fTimer();
  955. // 5. 파일 읽기(kdrg30.out)
  956. var fileChk = true;
  957. var iCnt = 0, jCnt=0;
  958. while (fileChk) { // kdrg30.out 파일이 있는 경우만 실행
  959. if (fso.FileExists(gReadfilePath)) {
  960. fileObj = fso.OpenTextFile(gReadfilePath, ForReading); // 읽기 위한 화일을 변수에 개체를 할당한다.
  961. while (!fileObj.AtEndOfStream){
  962. if (!fileObj.AtEndOfLine){
  963. inputStr += fileObj.ReadLine();
  964. }
  965. }
  966. fileObj.Close();
  967. if (inputStr != "") {
  968. //alert(inputStr);
  969. //alert(inputStr.substr(273, 3)); // (16). MDC (시작위치:274, 길이:3)
  970. //alert(inputStr.substr(276, 4)); // (17). ADRG (시작위치:277, 길이:4)
  971. //alert(inputStr.substr(280, 1)); // (18). PCCL (시작위치:281, 길이:1)
  972. //alert(inputStr.substr(281, 6)); // (19). DRG (시작위치:282, 길이:6)
  973. // 6. KDRG코드 셋팅 (시작위치:282, 길이:6)
  974. model.setValue("/root/main/item1/clbs/drgcd", inputStr.substr(281, 6));
  975. opt_drgcd.refresh();
  976. fileChk = false;
  977. }
  978. } else {
  979. fileChk = true;
  980. }
  981. }
  982. }
  983. }
  984. }
  985. }
  986. //------------------------------
  987. // KDRG 번호 생성 (입원사후메인)
  988. //------------------------------
  989. function fSetKDRGpid() {
  990. var fso,fileObj = "";
  991. var ForReading=1,ForWriting=2; // 화일/읽기 쓰기 지정을 쉽게하기 위한 변수
  992. var gJobPath = "c:\\kdrg33";
  993. var gExecfilePath = "c:\\kdrg33\\kdrg33.exe";
  994. var gWritefilePath = "c:\\kdrg33\\kdrg33.in";
  995. var gReadfilePath = "c:\\kdrg33\\kdrg33.out";
  996. var makeStr,inputStr,kdrgNo = "";
  997. // 실행화일 유무 체크
  998. fso = new ActiveXObject("Scripting.FileSystemObject");
  999. if ( !fso.FileExists(gExecfilePath) ) {
  1000. messageBox( "실행화일이 PC에 존재하지 않습니다.\n\n"
  1001. + "KDRG 3.3 ver 을 설치하세요.\n\n"
  1002. + gExecfilePath + " 의 존재여부를 확인하세요"
  1003. ,"");
  1004. return;
  1005. }
  1006. // 최종 사용자 확인
  1007. var message = messageBox("대상자의 DRG 정보를 생성합니다.\n\n"
  1008. +"계속 진행"
  1009. ,"S001");
  1010. if ( message != 6 ) { return; }
  1011. model.resetInstanceNode("/root/send/item4/clbs"); // 공백으로 삭제
  1012. model.resetInstanceNode("/root/hidden/item6/kdrginfo"); // 공백으로 삭제
  1013. model.setValue("/root/send/item4/clbs/clamym", model.getValue("/root/main/item1/clbs/clamym"));
  1014. model.setValue("/root/send/item4/clbs/clamdg", model.getValue("/root/main/item1/clbs/clamdg"));
  1015. model.setValue("/root/send/item4/clbs/pid", model.getValue("/root/main/item1/clbs/pid"));
  1016. model.setValue("/root/send/item4/clbs/pidsn", model.getValue("/root/main/item1/clbs/pidsn"));
  1017. //model.setValue("/root/send/item4/clbs/instcd", getUserInfo("posinstcd"));
  1018. model.setValue("/root/send/item4/clbs/instcd", model.getValue("/root/main/item1/clbs/instcd"));
  1019. // 에러시 바로 종료
  1020. if ( !submit("TXPID20305") ) { return; }
  1021. // 상병,처방 없으면 다음 대상자로..
  1022. if ( model.getValue("/root/hidden/item6/kdrginfo/ordyn") != "Y" ) { return; }
  1023. // string 생성
  1024. makeStr = "";
  1025. makeStr += model.getValue("/root/hidden/item6/kdrginfo/proccorpcd"); // (1) 요양기관기호
  1026. makeStr += model.getValue("/root/hidden/item6/kdrginfo/resno"); // (2) 주민번호
  1027. makeStr += model.getValue("/root/hidden/item6/kdrginfo/ordfromdd"); // (3) 요양개시일
  1028. makeStr += model.getValue("/root/hidden/item6/kdrginfo/chosindayno"); // (4) 입원일수
  1029. makeStr += model.getValue("/root/hidden/item6/kdrginfo/ordrsltcd"); // (5) 진료결과
  1030. makeStr += model.getValue("/root/hidden/item6/kdrginfo/diag").getRightPad(50," "); // (6) 진단코드
  1031. makeStr += model.getValue("/root/hidden/item6/kdrginfo/optr").getRightPad(50," "); // (7) 시술코드
  1032. makeStr += model.getValue("/root/hidden/item6/kdrginfo/exam").getRightPad(25," "); // (8) 검사코드
  1033. makeStr += model.getValue("/root/hidden/item6/kdrginfo/xray").getRightPad(25," "); // (9) 방사선코드
  1034. makeStr += model.getValue("/root/hidden/item6/kdrginfo/ijbd").getRightPad(25," "); // (10) 주사및혈액
  1035. makeStr += model.getValue("/root/hidden/item6/kdrginfo/anst").getRightPad(25," "); // (11) 마취및호흡치료
  1036. makeStr += " ".getRightPad(5," "); // (12) 알콜및약물중독재활치료코드
  1037. makeStr += " ".getRightPad(25," "); // (13) 부가코드1-5
  1038. makeStr += model.getValue("/root/hidden/item6/kdrginfo/mt027"); // (14) 입원시체중
  1039. makeStr += model.getValue("/root/hidden/item6/kdrginfo/mt026"); // (15) 인공호흡시간
  1040. makeStr += " ".getRightPad(3," "); // (16) MDC
  1041. makeStr += " ".getRightPad(4," "); // (17) ADRG
  1042. makeStr += " "; // (18) PCCL
  1043. makeStr += " ".getRightPad(6," "); // (19) DRG분류번호
  1044. makeStr += " ".getRightPad(8," "); // (20) version
  1045. ////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1046. // 1.기존파일 삭제 ==> 2.파일 쓰기 ==> 3.KDRG실행 ==> 4.파일 읽기
  1047. ////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1048. // 1.기존파일 삭제
  1049. if (fso.FileExists(gWritefilePath)) {
  1050. fso.DeleteFile(gWritefilePath); // kdrg30.in 삭제
  1051. }
  1052. if (fso.FileExists(gReadfilePath)) {
  1053. fso.DeleteFile(gReadfilePath); // kdrg30.out 삭제
  1054. }
  1055. // 2. 파일 쓰기(kdrg30.in)
  1056. fileObj=fso.CreateTextFile(gWritefilePath, true); // 쓰기 위한 화일을 변수에 개체를 할당한다.
  1057. fileObj.WriteLine(makeStr);
  1058. fileObj.Close(); // 화일을 닫는다.
  1059. // kdrg33.in 파일이 없으면 다음 대상자로..
  1060. if ( !fso.FileExists(gWritefilePath) ) { return; }
  1061. // 3. KDRG 실행
  1062. window.exec(gExecfilePath,"",gJobPath);
  1063. // 4. 파일읽기
  1064. var fileChk = true;
  1065. while (fileChk) { // kdrg33.out 파일이 있는 경우만 실행
  1066. if (fso.FileExists(gReadfilePath)) {
  1067. fileObj = fso.OpenTextFile(gReadfilePath, ForReading); // 읽기 위한 화일을 변수에 개체를 할당한다.
  1068. inputStr = ""; // 초기화
  1069. while (!fileObj.AtEndOfStream){
  1070. if (!fileObj.AtEndOfLine){
  1071. inputStr += fileObj.ReadLine();
  1072. }
  1073. }
  1074. fileObj.Close();
  1075. if ( inputStr != "" ) {
  1076. kdrgNo = inputStr.substr(281, 6).getTrim();
  1077. fileChk = false;
  1078. }
  1079. }
  1080. }
  1081. // 값이 없으면 다음 대상자로
  1082. if ( kdrgNo == "" ) { return; }
  1083. // KDRG번호 저장
  1084. model.resetInstanceNode("/root/hidden/item7/kdrgval"); // 공백으로 삭제
  1085. model.setValue("/root/send/item4/clbs/kdrgno",kdrgNo);
  1086. if ( !submit("TXPID20306") ) { return; }
  1087. // 그리드에 표시
  1088. model.setValue("/root/main/item1/clbs/drgcd" ,kdrgNo);
  1089. model.setValue("/root/main/item1/clbs/kstage",model.getValue("/root/hidden/item7/kdrgval/kstage"));
  1090. model.setValue("/root/main/item1/clbs/kmdc" ,model.getValue("/root/hidden/item7/kdrgval/kmdc"));
  1091. model.setValue("/root/main/item1/clbs/kdrgnm",model.getValue("/root/hidden/item7/kdrgval/kdrgnm"));
  1092. opt_drgcd.refresh();
  1093. opt_kstage.refresh();
  1094. opt_kdrgnm.refresh();
  1095. // 대상자조회 화면에도 표시
  1096. var trgtManWindow = getChildWindow("SMPID20200"); // SMPID20200_입원사후심사대상자조회.xrw
  1097. if (trgtManWindow != null) {
  1098. var selectedRow = model.getValue("/root/hidden/smpid20200/rslt/selectedRow");
  1099. if (selectedRow) {
  1100. var trgtmanlist = trgtManWindow.instance1.selectSingleNode("/root/main/list1/clbs");
  1101. if (trgtmanlist != null) {
  1102. var srchmode = trgtManWindow.model.getValue("/root/hidden/clbs/srchmode");
  1103. if (srchmode != "specclbs") { // 선별심사 모드 아닌경우
  1104. if ( trgtManWindow.model.getValue("/root/main/list1/clbs["+ selectedRow +"]/clamym") == model.getValue("/root/main/item1/clbs/clamym")
  1105. && trgtManWindow.model.getValue("/root/main/list1/clbs["+ selectedRow +"]/clamdg") == model.getValue("/root/main/item1/clbs/clamdg")
  1106. && trgtManWindow.model.getValue("/root/main/list1/clbs["+ selectedRow +"]/pid") == model.getValue("/root/main/item1/clbs/pid")
  1107. && trgtManWindow.model.getValue("/root/main/list1/clbs["+ selectedRow +"]/pidsn") == model.getValue("/root/main/item1/clbs/pidsn")
  1108. ) {
  1109. trgtManWindow.model.setValue("/root/main/list1/clbs["+ selectedRow +"]/drgcd", kdrgNo);
  1110. trgtManWindow.model.setValue("/root/main/list1/clbs["+ selectedRow +"]/kstage", model.getValue("/root/hidden/item7/kdrgval/kstage"));
  1111. trgtManWindow.model.setValue("/root/main/list1/clbs["+ selectedRow +"]/kmdc" , model.getValue("/root/hidden/item7/kdrgval/kmdc"));
  1112. trgtManWindow.model.setValue("/root/main/list1/clbs["+ selectedRow +"]/kdrgnm", model.getValue("/root/hidden/item7/kdrgval/kdrgnm"));
  1113. }
  1114. }
  1115. }
  1116. }
  1117. }
  1118. }
  1119. //------------------------------------------------------------
  1120. // KDRG 처방정보 생성 _ 대상자 조회 화면 (pam.pidhkdrg) - 20100709
  1121. //------------------------------------------------------------
  1122. function fSetKDRGclodlist() {
  1123. var fso,fileObj = "";
  1124. var ForReading=1,ForWriting=2; // 화일/읽기 쓰기 지정을 쉽게하기 위한 변수
  1125. var gJobPath = "c:\\kdrg33";
  1126. var gExecfilePath = "c:\\kdrg33\\kdrg33.exe";
  1127. var gWritefilePath = "c:\\kdrg33\\kdrg33.in";
  1128. var gReadfilePath = "c:\\kdrg33\\kdrg33.out";
  1129. var summit_error = false;
  1130. var makeStr,inputStr,kdrgNo = "";
  1131. // 실행화일 유무 체크
  1132. fso = new ActiveXObject("Scripting.FileSystemObject");
  1133. if ( !fso.FileExists(gExecfilePath) ) {
  1134. messageBox( "실행화일이 PC에 존재하지 않습니다.\n\n"
  1135. + "KDRG 3.3 ver 을 설치하세요.\n\n"
  1136. + gExecfilePath + " 의 존재여부를 확인하세요"
  1137. ,"");
  1138. return;
  1139. }
  1140. // 대상자 선택여부 확인
  1141. if ( grd_clbsmast.selectedRows == 0
  1142. || grd_clbsmast.rows <= 1
  1143. ) {
  1144. messageBox("DRG 정보를 생성할 대상자를", "C002"); // DRG 정보를 생성할 대상자를 선택하십시오.
  1145. return;
  1146. }
  1147. // 최종 사용자 확인
  1148. var message = messageBox("선택된 대상자의 DRG 정보를 생성합니다.\n\n"
  1149. +"(기존에 생성된 정보는 삭제후 다시 생성됩니다.)\n\n"
  1150. +"계속 진행"
  1151. ,"S001");
  1152. if ( message != 6 ) {
  1153. return;
  1154. }
  1155. // 로딩창열기
  1156. var sWindowMsg = "DRG 정보 생성중입니다....";
  1157. callLoadingWindow(sWindowMsg);
  1158. // 선택된 모든 대상자의 DRG 적용 처방정보를 생성한다.
  1159. for (var i = 0; i < grd_clbsmast.selectedRows; i++) {
  1160. model.resetInstanceNode("/root/send/item4/clbs"); // 공백으로 삭제
  1161. model.resetInstanceNode("/root/hidden/item6/kdrginfo"); // 공백으로 삭제
  1162. var row = grd_clbsmast.selectedrow(i);
  1163. model.setValue("/root/send/item4/clbs/clamym", model.getValue("/root/main/list1/clbs[" + row + "]/clamym"));
  1164. model.setValue("/root/send/item4/clbs/clamdg", model.getValue("/root/main/list1/clbs[" + row + "]/clamdg"));
  1165. model.setValue("/root/send/item4/clbs/pid", model.getValue("/root/main/list1/clbs[" + row + "]/pid"));
  1166. model.setValue("/root/send/item4/clbs/pidsn", model.getValue("/root/main/list1/clbs[" + row + "]/pidsn"));
  1167. model.setValue("/root/send/item4/clbs/instcd", getUserInfo("posinstcd"));
  1168. // 에러시 바로 종료
  1169. if ( !submit("TXPID20305") ) {
  1170. summit_error = true;
  1171. break;
  1172. }
  1173. // 상병,처방 없으면 다음 대상자로..
  1174. if ( model.getValue("/root/hidden/item6/kdrginfo/ordyn") != "Y" ) {
  1175. continue;
  1176. }
  1177. // string 생성
  1178. makeStr = "";
  1179. makeStr += model.getValue("/root/hidden/item6/kdrginfo/proccorpcd"); // (1) 요양기관기호
  1180. makeStr += model.getValue("/root/hidden/item6/kdrginfo/resno"); // (2) 주민번호
  1181. makeStr += model.getValue("/root/hidden/item6/kdrginfo/ordfromdd"); // (3) 요양개시일
  1182. makeStr += model.getValue("/root/hidden/item6/kdrginfo/chosindayno"); // (4) 입원일수
  1183. makeStr += model.getValue("/root/hidden/item6/kdrginfo/ordrsltcd"); // (5) 진료결과
  1184. makeStr += model.getValue("/root/hidden/item6/kdrginfo/diag").getRightPad(50," "); // (6) 진단코드
  1185. makeStr += model.getValue("/root/hidden/item6/kdrginfo/optr").getRightPad(50," "); // (7) 시술코드
  1186. makeStr += model.getValue("/root/hidden/item6/kdrginfo/exam").getRightPad(25," "); // (8) 검사코드
  1187. makeStr += model.getValue("/root/hidden/item6/kdrginfo/xray").getRightPad(25," "); // (9) 방사선코드
  1188. makeStr += model.getValue("/root/hidden/item6/kdrginfo/ijbd").getRightPad(25," "); // (10) 주사및혈액
  1189. makeStr += model.getValue("/root/hidden/item6/kdrginfo/anst").getRightPad(25," "); // (11) 마취및호흡치료
  1190. makeStr += " ".getRightPad(5," "); // (12) 알콜및약물중독재활치료코드
  1191. makeStr += " ".getRightPad(25," "); // (13) 부가코드1-5
  1192. makeStr += model.getValue("/root/hidden/item6/kdrginfo/mt027"); // (14) 입원시체중
  1193. makeStr += model.getValue("/root/hidden/item6/kdrginfo/mt026"); // (15) 인공호흡시간
  1194. makeStr += " ".getRightPad(3," "); // (16) MDC
  1195. makeStr += " ".getRightPad(4," "); // (17) ADRG
  1196. makeStr += " "; // (18) PCCL
  1197. makeStr += " ".getRightPad(6," "); // (19) DRG분류번호
  1198. makeStr += " ".getRightPad(8," "); // (20) version
  1199. ////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1200. // 1.기존파일 삭제 ==> 2.파일 쓰기 ==> 3.KDRG실행 ==> 4.파일 읽기
  1201. ////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1202. // 1.기존파일 삭제
  1203. if (fso.FileExists(gWritefilePath)) {
  1204. fso.DeleteFile(gWritefilePath); // kdrg30.in 삭제
  1205. }
  1206. if (fso.FileExists(gReadfilePath)) {
  1207. fso.DeleteFile(gReadfilePath); // kdrg30.out 삭제
  1208. }
  1209. // 2. 파일 쓰기(kdrg30.in)
  1210. fileObj=fso.CreateTextFile(gWritefilePath, true); // 쓰기 위한 화일을 변수에 개체를 할당한다.
  1211. fileObj.WriteLine(makeStr);
  1212. fileObj.Close(); // 화일을 닫는다.
  1213. // kdrg33.in 파일이 없으면 다음 대상자로..
  1214. if ( !fso.FileExists(gWritefilePath) ) { continue; }
  1215. // 3. KDRG 실행
  1216. window.exec(gExecfilePath,"",gJobPath);
  1217. //window.exec("cmd.exe -b"," /c cd c:\\kdrg33\\ && kdrg33.exe");
  1218. // 4. 파일읽기
  1219. var fileChk = true;
  1220. while (fileChk) { // kdrg33.out 파일이 있는 경우만 실행
  1221. if (fso.FileExists(gReadfilePath)) {
  1222. fileObj = fso.OpenTextFile(gReadfilePath, ForReading); // 읽기 위한 화일을 변수에 개체를 할당한다.
  1223. inputStr = ""; // 초기화
  1224. while (!fileObj.AtEndOfStream){
  1225. if (!fileObj.AtEndOfLine){
  1226. inputStr += fileObj.ReadLine();
  1227. }
  1228. }
  1229. fileObj.Close();
  1230. if ( inputStr != "" ) {
  1231. kdrgNo = inputStr.substr(281, 6).getTrim();
  1232. fileChk = false;
  1233. }
  1234. }
  1235. }
  1236. // 값이 없으면 다음 대상자로
  1237. if ( kdrgNo == "" ) { continue; }
  1238. // KDRG번호 저장
  1239. model.resetInstanceNode("/root/hidden/item7/kdrgval"); // 공백으로 삭제
  1240. model.setValue("/root/send/item4/clbs/kdrgno",kdrgNo);
  1241. if ( !submit("TXPID20306") ) {
  1242. summit_error = true;
  1243. break;
  1244. }
  1245. // 그리드에 표시
  1246. model.setValue("/root/main/list1/clbs[" + row + "]/drgcd" ,kdrgNo);
  1247. model.setValue("/root/main/list1/clbs[" + row + "]/kstage",model.getValue("/root/hidden/item7/kdrgval/kstage"));
  1248. model.setValue("/root/main/list1/clbs[" + row + "]/kmdc" ,model.getValue("/root/hidden/item7/kdrgval/kmdc"));
  1249. model.setValue("/root/main/list1/clbs[" + row + "]/kdrgnm",model.getValue("/root/hidden/item7/kdrgval/kdrgnm"));
  1250. }
  1251. // 로딩창닫기
  1252. removeLoadingWindow();
  1253. if ( summit_error ) {
  1254. messageBox("DRG 정보 생성중 오류발생","");
  1255. } else {
  1256. messageBox("DRG 정보 생성 완료","");
  1257. }
  1258. }
  1259. //-----------------------------------
  1260. //명세서 KDRG 상세정보 조회 (대상자조회)
  1261. //-----------------------------------
  1262. function fDocuKdrgViewList() {
  1263. var irow = grd_clbsmast.row;
  1264. var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
  1265. if (clamkey) {
  1266. model.setValue("/root/hidden/smpid23300/cond/clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
  1267. model.setValue("/root/hidden/smpid23300/cond/clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
  1268. model.setValue("/root/hidden/smpid23300/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
  1269. model.setValue("/root/hidden/smpid23300/cond/pidsn", model.getValue("/root/main/list1/clbs[" + irow + "]/pidsn"));
  1270. model.setValue("/root/hidden/smpid23300/cond/patnm", model.getValue("/root/main/list1/clbs[" + irow + "]/patnm"));
  1271. model.setValue("/root/hidden/smpid23300/cond/insukind", model.getValue("/root/main/list1/clbs[" + irow + "]/insukindcd"));
  1272. model.setValue("/root/hidden/smpid23300/cond/suppkind", model.getValue("/root/main/list1/clbs[" + irow + "]/suppkindcd"));
  1273. model.setValue("/root/hidden/smpid23300/cond/orddeptcd", model.getValue("/root/main/list1/clbs[" + irow + "]/orddeptcd"));
  1274. model.setValue("/root/hidden/smpid23300/cond/indd", model.getValue("/root/main/list1/clbs[" + irow + "]/indd"));
  1275. modal("SMPID23300", "1", "50", "100", "SMPID23300", "/root/hidden/smpid23300/cond", "/root/init/item1", "", ""); // SMPID23300_KDRG상세정보.xrw
  1276. }
  1277. }
  1278. //-----------------------------------
  1279. //명세서 KDRG 상세정보 조회 (심사메인)
  1280. //-----------------------------------
  1281. function fDocuKdrgViewPid() {
  1282. var pid = model.getValue("/root/main/item1/clbs/pid");
  1283. if (pid) {
  1284. model.setValue("/root/hidden/smpid23300/cond/clamym", model.getValue("/root/main/item1/clbs/clamym"));
  1285. model.setValue("/root/hidden/smpid23300/cond/clamdg", model.getValue("/root/main/item1/clbs/clamdg"));
  1286. model.setValue("/root/hidden/smpid23300/cond/pid", model.getValue("/root/main/item1/clbs/pid"));
  1287. model.setValue("/root/hidden/smpid23300/cond/pidsn", model.getValue("/root/main/item1/clbs/pidsn"));
  1288. model.setValue("/root/hidden/smpid23300/cond/patnm", model.getValue("/root/main/item1/clbs/patnm"));
  1289. model.setValue("/root/hidden/smpid23300/cond/insukind", model.getValue("/root/main/item1/clbs/insukindcd"));
  1290. model.setValue("/root/hidden/smpid23300/cond/suppkind", model.getValue("/root/main/item1/clbs/suppkindcd"));
  1291. model.setValue("/root/hidden/smpid23300/cond/orddeptcd", model.getValue("/root/main/item1/clbs/orddeptcd"));
  1292. model.setValue("/root/hidden/smpid23300/cond/indd", model.getValue("/root/main/item1/clbs/indd"));
  1293. modal("SMPID23300", "1", "50", "100", "SMPID23300", "/root/hidden/smpid23300/cond", "/root/init/item1", "", ""); // SMPID23300_KDRG상세정보.xrw
  1294. }
  1295. }