SMMRI01700.xjs 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Script type="xscript4.0"><![CDATA[var sORDERBY = "desc";
  3. var sMEDIALERT = ""; //의료정보 전달사항
  4. var sDRALERT = ""; //의사 전달사항
  5. // 이전 등록번호, 입원일자, 생성번호를 저장하여, 환자정보가 다른 경우 기록지를 새로 조회하기 설정해 둠
  6. // 2008. 1. 7. 오지훈
  7. var sBFPID = ""; //이전등록번호
  8. var sBFORDDD = ""; //이전입원일자
  9. var sBFCRETNO = ""; //이전생성번호
  10. var getDataG = "";
  11. function fInitialize()
  12. {
  13. //차트분석관리 화면 연동 처리
  14. if(frmf_checkOpener()){
  15. var recvparam = opener.frmf_getParameter("SMMRI01700_Param");
  16. if(!utlf_isNull(recvparam)){
  17. recvparam = utlf_transNullToEmpty(recvparam).split("▩");
  18. data = utlf_transNullToEmpty(recvparam[1]).split("▦");
  19. ds_main_cond_unpreppatbase.setColumn(0, "pid", data[0]);
  20. fReqGetUnPrepPatChosInfo(data[0], "I", "A");
  21. cmb_chosinfo.index = 0;
  22. var pid = ds_main_patinfo_pathistlist.lookup("rowcnt", cmb_chosinfo.value, "pid");
  23. var indd = ds_main_patinfo_pathistlist.lookup("rowcnt", cmb_chosinfo.value, "orddd");
  24. var cretno = ds_main_patinfo_pathistlist.lookup("rowcnt", cmb_chosinfo.value, "cretno");
  25. var hngnm = ds_main_patinfo_pathistlist.lookup("rowcnt", cmb_chosinfo.value, "hngnm");
  26. ds_main_cond_unpreppatbase.setColumn(0, "pid" , pid);
  27. ds_main_cond_unpreppatbase.setColumn(0, "indd" , indd);
  28. ds_main_cond_unpreppatbase.setColumn(0, "cretno", cretno);
  29. ds_main_cond_unpreppatbase.setColumn(0, "hngnm" , hngnm);
  30. frmf_inputEnterKey("cmb_chosinfo", "onitemchanged", new ItemChangeEventInfo );
  31. }
  32. }
  33. var arrParam = [{dsNm: "ds_init_M0501", cdGrpId: "M0501"},
  34. {dsNm: "ds_init_M0502", cdGrpId: "M0502"},
  35. {dsNm: "ds_init_M0503", cdGrpId: "M0503"}];
  36. appf_getCodeList(arrParam);
  37. }
  38. function fn_unprepflag(){
  39. var getData = String(chk_unprepflag.getData()).replace(","," ");
  40. ds_main_cond_unprepdrbase.setColumn(0, "unprepstat", getData);
  41. if(utlf_isSearchString(getDataG, "8") == true){
  42. var objChk = eval("chk_" + "6");
  43. objChk.enableevent =false;
  44. objChk.value = "";
  45. objChk.enableevent =true;
  46. var getData = String(chk_unprepflag.getData()).replace(","," ");
  47. ds_main_cond_unprepdrbase.setColumn(0, "unprepstat", getData);
  48. }
  49. getDataG = getData;
  50. //전체
  51. var unprepstatA = utlf_isSearchString(ds_main_cond_unprepdrbase.getColumn(0, "unprepstat"), "-");
  52. if(unprepstatA == true){
  53. chk_unprepflag.setCheckAll(false);
  54. chk_unprepflag.components[2].enable = false;
  55. chk_unprepflag.components[3].enable = false;
  56. chk_unprepflag.components[4].enable = false;
  57. chk_unprepflag.components[5].enable = false;
  58. chk_unprepflag.components[6].enable = false;
  59. chk_unprepflag.components[7].enable = false;
  60. ds_main_cond_unprepdrbase.setColumn(0, "unprepstat", "-");
  61. chk_unprepflag.setData(ds_main_cond_unprepdrbase.getColumn(0, "unprepstat").split(" "), " ", false);
  62. }else{
  63. chk_unprepflag.components[2].enable = true;
  64. chk_unprepflag.components[3].enable = true;
  65. chk_unprepflag.components[4].enable = true;
  66. chk_unprepflag.components[5].enable = true;
  67. chk_unprepflag.components[6].enable = true;
  68. chk_unprepflag.components[7].enable = true;
  69. }
  70. var unprepstatDel = utlf_isSearchString(ds_main_cond_unprepdrbase.getColumn(0, "unprepstat"), "8");
  71. if(unprepstatDel == true){
  72. for(var i = 1; i < ds_checkList.rowcount - 1;i++){
  73. var objChk = eval("chk_" + i);
  74. objChk.enableevent =false;
  75. objChk.value = "";
  76. objChk.enableevent =true;
  77. }
  78. ds_main_cond_unprepdrbase.setColumn(0, "unprepstat", "8");
  79. }
  80. //배치미비
  81. var unprepstatB = utlf_isSearchString(ds_main_cond_unprepdrbase.getColumn(0, "unprepstat"), "0");
  82. if(unprepstatB == true){
  83. var objChk = eval("chk_" + "0");
  84. objChk.enableevent =false;
  85. objChk.value = "";
  86. objChk.enableevent =true;
  87. var objChk = eval("chk_" + "6");
  88. objChk.enableevent =false;
  89. objChk.value = "";
  90. objChk.enableevent =true;
  91. }
  92. var unprepstatC = utlf_isSearchString(ds_main_cond_unprepdrbase.getColumn(0, "unprepstat"), "1");
  93. if(unprepstatC == true){
  94. var objChk = eval("chk_" + "0");
  95. objChk.enableevent =false;
  96. objChk.value = "";
  97. objChk.enableevent =true;
  98. var objChk = eval("chk_" + "6");
  99. objChk.enableevent =false;
  100. objChk.value = "";
  101. objChk.enableevent =true;
  102. }
  103. var unprepstatD = utlf_isSearchString(ds_main_cond_unprepdrbase.getColumn(0, "unprepstat"), "2");
  104. if(unprepstatD == true){
  105. var objChk = eval("chk_" + "0");
  106. objChk.enableevent =false;
  107. objChk.value = "";
  108. objChk.enableevent =true;
  109. var objChk = eval("chk_" + "6");
  110. objChk.enableevent =false;
  111. objChk.value = "";
  112. objChk.enableevent =true;
  113. }
  114. var unprepstatR = utlf_isSearchString(ds_main_cond_unprepdrbase.getColumn(0, "unprepstat"), "3");
  115. if(unprepstatR == true){
  116. var objChk = eval("chk_" + "0");
  117. objChk.enableevent =false;
  118. objChk.value = "";
  119. objChk.enableevent =true;
  120. var objChk = eval("chk_" + "6");
  121. objChk.enableevent =false;
  122. objChk.value = "";
  123. objChk.enableevent =true;
  124. }
  125. var unprepstatS = utlf_isSearchString(ds_main_cond_unprepdrbase.getColumn(0, "unprepstat"), "4");
  126. if(unprepstatS == true){
  127. var objChk = eval("chk_" + "0");
  128. objChk.enableevent =false;
  129. objChk.value = "";
  130. objChk.enableevent =true;
  131. var objChk = eval("chk_" + "6");
  132. objChk.enableevent =false;
  133. objChk.value = "";
  134. objChk.enableevent =true;
  135. }
  136. var getData = String(chk_unprepflag.getData()).replace(","," ");
  137. ds_main_cond_unprepdrbase.setColumn(0, "unprepstat", getData);
  138. }
  139. /**
  140. * @desc 미비항목코드 Count예외코드 조회
  141. */
  142. function reqGetUnPrepBaseExptCnt(){
  143. ds_send_reqdata.clearData();
  144. var oParam = {};
  145. oParam.id = "TRMRI01703";
  146. oParam.service = "unprepmngtapp.ChrtUnprepMngt";
  147. oParam.method = "reqGetUnPrepBaseExptCnt";
  148. oParam.inds = "req=ds_send_reqdata";
  149. oParam.outds = "ds_main_unprepiteminfo_unprepiteminfo=unprepiteminfo";
  150. oParam.async = false;
  151. tranf_submit(oParam);
  152. }
  153. /**
  154. * @desc 미비환자 내원정보 조회
  155. */
  156. function fReqGetUnPrepPatChosInfo(pid, ioflag, dschflag){
  157. ds_send_reqdata.clearData();
  158. ds_send_reqdata.addColumn("pid", "string");
  159. ds_send_reqdata.addColumn("ioflag", "string");
  160. ds_send_reqdata.addColumn("dschflag", "string");
  161. var nRow = ds_send_reqdata.addRow();
  162. ds_send_reqdata.setColumn(nRow, "pid", pid);
  163. ds_send_reqdata.setColumn(nRow, "ioflag", ioflag);
  164. ds_send_reqdata.setColumn(nRow, "dschflag", dschflag);
  165. var oParam = {};
  166. oParam.id = "TRMRI02605";
  167. oParam.service = "unprepmngtapp.ChrtUnprepMngt";
  168. oParam.method = "reqGetUnPrepPatChosInfo";
  169. oParam.inds = "req=ds_send_reqdata";
  170. oParam.outds = "ds_main_patinfo_pathistlist=pathistlist";
  171. oParam.async = false;
  172. //oParam.callback = "cf_TRMRI02605";
  173. tranf_submit(oParam);
  174. }
  175. /**
  176. * @desc 미비삭제
  177. */
  178. function fDelUnPrepRecInfo(){
  179. var len = grdf_getSelectedRows(grd_unprepreclist);
  180. ds_main_unpreprecinfo_unprepreclist.updatecontrol = false;
  181. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  182. for(var i = len.length -1 ; i >= 0; i--){
  183. var currow = len[i];
  184. var status = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "status");
  185. if(status == "i"){
  186. ds_main_unpreprecinfo_unprepreclist.deleteRow(currow);
  187. }else{
  188. var startcol = grd_unprepreclist.getBindCellIndex("body", "dschdd");
  189. var endcol = grd_unprepreclist.getBindCellIndex("body", "lastupdtdt");
  190. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "bkDelcolor", "#ff0000");
  191. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "status", "d");
  192. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "unprepstat", "9");
  193. }
  194. }
  195. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  196. ds_main_unpreprecinfo_unprepreclist.updatecontrol = true;
  197. }
  198. /**
  199. * @desc 미비 정보 저장
  200. */
  201. function fSaveUnPrepInfo(){
  202. var savenodelist = ds_main_unpreprecinfo_unprepreclist.getCaseCount("!utlf_isNull(status)");
  203. var srchflag = ds_main_cond.getColumn(0, "srchflag");
  204. if(srchflag == "pat"){
  205. var srchnodelist = ds_main_cond_unpreppatbase;
  206. }else{
  207. var srchnodelist = ds_main_cond_unprepdrbase;
  208. }
  209. if(savenodelist == 0){
  210. sysf_messageBox("저장할 정보가", "I004");
  211. return;
  212. }else{
  213. grd_patreclist.visible = false;
  214. ds_send_savedata.clearData();
  215. ds_main_unpreprecinfo_unprepreclist.filter("!utlf_isNull(status)");
  216. ds_send_savedata.copyData(ds_main_unpreprecinfo_unprepreclist, true);
  217. ds_main_unpreprecinfo_unprepreclist.filter("");
  218. ds_send_srchdata.copyData(srchnodelist, true);
  219. dsf_makeValue(ds_send, "savedata", "string", dsf_getDsCSV(ds_send_savedata));
  220. dsf_makeValue(ds_send, "srchdata", "string", dsf_getDsCSV(ds_send_srchdata));
  221. dsf_setDefaultVal(ds_send_savedata, "drcnfmrid:-");
  222. var oParam = {};
  223. oParam.id = "TXMRI02101";
  224. oParam.service = "unprepmngtapp.ChrtUnprepMngt";
  225. oParam.method = "reqExeSaveUnPrepRecList";
  226. oParam.inds = "savedata=ds_send_savedata srchdata=ds_send_srchdata";
  227. oParam.outds = "ds_main_unpreprecinfo_unprepreclist=unprepreclist";
  228. oParam.async = false;
  229. oParam.callback = "cf_TXMRI02101";
  230. tranf_submit(oParam);
  231. ds_main_unpreprecinfo_unprepreclist.addColumn("check", "string");
  232. ds_main_unpreprecinfo_unprepreclist.addColumn("bkcolor", "string");
  233. ds_main_unpreprecinfo_unprepreclist.addColumn("bkcolorcheck", "string");
  234. ds_main_unpreprecinfo_unprepreclist.addColumn("bkDelcolor", "string");
  235. ds_main_unpreprecinfo_unprepreclist.addColumn("orgunprepstat", "string");
  236. ds_main_unpreprecinfo_unprepreclist.addColumn("orgunprepdrnm", "string");
  237. ds_main_unpreprecinfo_unprepreclist.addColumn("orgunprepdeptnm", "string");
  238. ds_main_unpreprecinfo_unprepreclist.addColumn("orgdetldeptnm", "string");
  239. ds_main_unpreprecinfo_unprepreclist.addColumn("orgdetldeptcd", "string");
  240. ds_main_unpreprecinfo_unprepreclist.addColumn("orgorddeptcd", "string");
  241. ds_main_unpreprecinfo_unprepreclist.addColumn("orgunprepdrid", "string");
  242. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  243. ds_main_unpreprecinfo_unprepreclist.updatecontrol = false;
  244. for(var i = 0; i < ds_main_unpreprecinfo_unprepreclist.rowcount; i++){
  245. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgunprepstat", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "unprepstat"));
  246. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgunprepdrnm", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "unprepstat"));
  247. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgunprepdeptnm", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "unprepdeptnm"));
  248. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgdetldeptnm", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "detldeptnm"));
  249. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgdetldeptcd", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "detldeptcd"));
  250. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgorddeptcd", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "orddeptcd"));
  251. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgunprepdrid", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "unprepdrid"));
  252. }
  253. ds_main_unpreprecinfo_unprepreclist.updatecontrol = true;
  254. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  255. if(arErrorCode.pop("TXMRI02101") > -1){
  256. fDoMergeUnPrepRecList();
  257. }
  258. }
  259. }
  260. function cf_TXMRI02101(sSvcId, nErrorCode, sErrorMsg) {
  261. arErrorCode.push(sSvcId, nErrorCode);
  262. }
  263. /**
  264. * @desc 미비기록 리스트 조회, 의사정보 기준
  265. */
  266. function fReqGetUnPrepRecDrBaseList(unprepsign){
  267. //미비기록추가, 저장 이후에 현재 조회된 미비기록리스트를 재조회하기 위해 설정함
  268. ds_main_cond.setColumn(0, "srchflag", "dr");
  269. ds_main_cond_unprepdrbase.setColumn(0, "scrnflag" , "unprepdrbase");
  270. ds_main_cond_unprepdrbase.setColumn(0, "unprepsign", unprepsign); //실제미비리스트 조회시
  271. //미비의사명이 없는 경우, 조회조건의 의사ID를 삭제
  272. if(utlf_isNull(ipt_unprepdrnm.text)){
  273. ds_main_cond_unprepdrbase.setColumn(0, "unprepdrid", "");
  274. }
  275. //조회조건 미비상태값 설정
  276. var unprepstat = utlf_transNullToEmpty(ds_main_cond_unprepdrbase.getColumn(0, "unprepstat"));
  277. if(unprepstat != "-"){
  278. var unprepstatArray = unprepstat.split(' ');
  279. var cond = "";
  280. for(var i = 0; i < unprepstatArray.length; i++){
  281. cond += unprepstatArray[i] + '\',\'';
  282. }
  283. ds_main_cond_unprepdrbase.setColumn(0, "unprepstatlist", utlf_transNullToEmpty(cond).substr(0, utlf_transNullToEmpty(cond).length - 3));
  284. }
  285. ds_send_reqdata.clearData();
  286. ds_send_reqdata.copyData(ds_main_cond_unprepdrbase);
  287. var oParam = {};
  288. oParam.id = "TRMRI02107";
  289. oParam.service = "unprepmngtapp.ChrtUnprepMngt";
  290. oParam.method = "reqGetUnPrepRecList";
  291. oParam.inds = "req=ds_send_reqdata";
  292. oParam.outds = "ds_main_unpreprecinfo_unprepreclist=unprepreclist ds_main_unpreprecinfo_unprepreccnt=unprepreccnt";
  293. oParam.async = false;
  294. oParam.callback = "cf_TRMRI02107";
  295. tranf_submit(oParam);
  296. ds_main_unpreprecinfo_unprepreclist.addColumn("check", "string");
  297. ds_main_unpreprecinfo_unprepreclist.addColumn("bkcolor", "string");
  298. ds_main_unpreprecinfo_unprepreclist.addColumn("bkcolorcheck", "string");
  299. ds_main_unpreprecinfo_unprepreclist.addColumn("bkDelcolor", "string");
  300. ds_main_unpreprecinfo_unprepreclist.addColumn("orgunprepstat", "string");
  301. ds_main_unpreprecinfo_unprepreclist.addColumn("orgunprepdrnm", "string");
  302. ds_main_unpreprecinfo_unprepreclist.addColumn("orgunprepdeptnm", "string");
  303. ds_main_unpreprecinfo_unprepreclist.addColumn("orgdetldeptnm", "string");
  304. ds_main_unpreprecinfo_unprepreclist.addColumn("orgdetldeptcd", "string");
  305. ds_main_unpreprecinfo_unprepreclist.addColumn("orgorddeptcd", "string");
  306. ds_main_unpreprecinfo_unprepreclist.addColumn("orgunprepdrid", "string");
  307. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  308. ds_main_unpreprecinfo_unprepreclist.updatecontrol = false;
  309. for(var i = 0; i < ds_main_unpreprecinfo_unprepreclist.rowcount; i++){
  310. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgunprepstat", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "unprepstat"));
  311. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgunprepdrnm", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "unprepstat"));
  312. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgunprepdeptnm", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "unprepdeptnm"));
  313. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgdetldeptnm", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "detldeptnm"));
  314. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgdetldeptcd", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "detldeptcd"));
  315. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgorddeptcd", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "orddeptcd"));
  316. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgunprepdrid", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "unprepdrid"));
  317. }
  318. ds_main_unpreprecinfo_unprepreclist.updatecontrol = true;
  319. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  320. if(arErrorCode.pop("TRMRI02107") > -1){
  321. fDoMergeUnPrepRecList();
  322. }
  323. }
  324. function cf_TRMRI02107(sSvcId, nErrorCode, sErrorMsg) {
  325. arErrorCode.push(sSvcId, nErrorCode);
  326. }
  327. /**
  328. * @desc 미비기록관리 merge
  329. */
  330. function fDoMergeUnPrepRecList()
  331. {
  332. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  333. ds_main_unpreprecinfo_unprepreclist.updatecontrol = false;
  334. for(var i = 0; i < ds_main_unpreprecinfo_unprepreclist.rowcount ;i++){
  335. ds_main_unpreprecinfo_unprepreclist.setColumn(0, "bkcolor", "");
  336. }
  337. ds_main_unpreprecinfo_unprepreclist.updatecontrol = true;
  338. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  339. var patcnt = 0;
  340. var reccnt = 0;
  341. var icnt = 0;
  342. var startrow = 1;
  343. var color = "#ffffcc"; // 그리드 배경색
  344. var checkcol = grd_unprepreclist.getBindCellIndex("body", "check");
  345. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  346. ds_main_unpreprecinfo_unprepreclist.updatecontrol = false;
  347. for(var i = 0; i < ds_main_unpreprecinfo_unprepreclist.rowcount; i++)
  348. {
  349. var unprepitemcd = ds_main_unpreprecinfo_unprepreclist.getColumn(i, "unprepitemcd");
  350. var formrecseq = ds_main_unpreprecinfo_unprepreclist.getColumn(i, "formrecseq");
  351. var delyn = ds_main_unpreprecinfo_unprepreclist.getColumn(i, "delyn");
  352. var result = utlf_transNullToEmpty(ds_main_unprepiteminfo_unprepiteminfo.lookup("unprepitemcd", unprepitemcd, "unprepitemcd"));
  353. var deldt = ds_main_unpreprecinfo_unprepreclist.getColumn(i, "deldt");
  354. var deluserid = ds_main_unpreprecinfo_unprepreclist.getColumn(i, "deluserid");
  355. var delusernm = ds_main_unpreprecinfo_unprepreclist.getColumn(i, "delusernm");
  356. var formcd = ds_main_unpreprecinfo_unprepreclist.getColumn(i, "formcd");
  357. if(utlf_isNull(result)){
  358. reccnt++;
  359. }
  360. if(i == 0){
  361. patcnt++;
  362. var orgpid = ds_main_unpreprecinfo_unprepreclist.getColumn(i, "pid");
  363. var orgdschdd = ds_main_unpreprecinfo_unprepreclist.getColumn(i, "dschdd");
  364. var orgindd = ds_main_unpreprecinfo_unprepreclist.getColumn(i, "indd");
  365. startrow = 0;
  366. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "bkcolor", color);
  367. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "bkcolorcheck", color);
  368. if (formcd != "0000002022") { //마취기록지가 아닐때(20131031 이윤주)
  369. if(formrecseq <= 0 ){
  370. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "bkcolorcheck", "#ff0000");// 기록지 연결안된 미비내역(빨간색)
  371. }
  372. }
  373. if(delyn == "Y" || (formrecseq == "-1" && !utlf_isNull(deluserid) && !utlf_isNull(deldt))){
  374. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "bkcolor", "#999999");// 삭제된 기록지(연한 회색)
  375. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "bkcolorcheck", "#999999");
  376. }
  377. continue;
  378. }
  379. var pid = ds_main_unpreprecinfo_unprepreclist.getColumn(i, "pid");
  380. var indd = ds_main_unpreprecinfo_unprepreclist.getColumn(i, "indd");
  381. var dschdd = ds_main_unpreprecinfo_unprepreclist.getColumn(i, "dschdd");
  382. if(orgpid == pid && orgdschdd == dschdd && orgindd == indd){
  383. // grd_unprepreclist.mergeByFree(startrow, grd_unprepreclist.colRef("pid") , i, grd_unprepreclist.colRef("pid"));
  384. // grd_unprepreclist.mergeByFree(startrow, grd_unprepreclist.colRef("hngnm") , i, grd_unprepreclist.colRef("hngnm"));
  385. // grd_unprepreclist.mergeByFree(startrow, grd_unprepreclist.colRef("dschdd") , i, grd_unprepreclist.colRef("dschdd"));
  386. // grd_unprepreclist.mergeByFree(startrow, grd_unprepreclist.colRef("dschdeptnm"), i, grd_unprepreclist.colRef("dschdeptnm"));
  387. // grd_unprepreclist.mergeByFree(startrow, grd_unprepreclist.colRef("medispclnm"), i, grd_unprepreclist.colRef("medispclnm"));
  388. }
  389. else
  390. {
  391. patcnt++;
  392. var orgpid = ds_main_unpreprecinfo_unprepreclist.getColumn(i, "pid");
  393. var orgdschdd= ds_main_unpreprecinfo_unprepreclist.getColumn(i, "dschdd");
  394. var orgindd = ds_main_unpreprecinfo_unprepreclist.getColumn(i, "indd");
  395. startrow = i;
  396. if(color == "#ffffcc"){
  397. color = "#ffffff"; // 투명색
  398. }else{
  399. color = "#ffffcc"; // 그리드 배경색(연한 노란색)
  400. }
  401. }
  402. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "bkcolor", color);
  403. if (formcd != "0000002022") { //마취기록지가 아닐때(20131031 이윤주)
  404. if(formrecseq <= 0 || utlf_isNull(formrecseq)){
  405. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "bkcolorcheck", "#ff0000");// 기록지 연결안된 미비내역(빨간색)
  406. }else{
  407. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "bkcolorcheck", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "bkcolor"));
  408. }
  409. }else{
  410. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "bkcolorcheck", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "bkcolor"));
  411. }
  412. if(delyn == "Y" || (formrecseq == "-1" && !utlf_isNull(deluserid) && !utlf_isNull(deldt))){
  413. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "bkcolor", "#999999");// 삭제된 기록지(연한 회색)
  414. }
  415. }
  416. ds_main_unpreprecinfo_unprepreclist.updatecontrol = true;
  417. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  418. ds_main_cond.setColumn(0, "patcnt", patcnt);
  419. ds_main_cond.setColumn(0, "reccnt", reccnt);
  420. }
  421. /**
  422. * @desc 미비의사 조회
  423. */
  424. function fReqGetUnPrepDrSmplList(srchflag, srchdata){
  425. ds_send_reqdata.clearData();
  426. dsf_makeValue(ds_send_reqdata, "srchflag", "string", srchflag);
  427. dsf_makeValue(ds_send_reqdata, "srchdata", "string", srchdata);
  428. var oParam = {};
  429. oParam.id = "TRMRI02901";
  430. oParam.service = "unprepmngtapp.ChrtUnprepMngt";
  431. oParam.method = "reqGetUnPrepDrSmplList";
  432. oParam.inds = "req=ds_send_reqdata";
  433. oParam.outds = "ds_temp_userinfo_usercombo=usercombo";
  434. oParam.async = false;
  435. tranf_submit(oParam);
  436. }
  437. /**
  438. * @desc 미비기록 리스트 조회, 환자정보 기준
  439. */
  440. function fReqGetUnPrepRecList(){
  441. ds_main_cond.setColumn(0, "srchflag", "pat");
  442. ds_main_cond_unpreppatbase.setColumn(0, "scrnflag", "unpreppatbase");
  443. ds_send_reqdata.copyData(ds_main_cond_unpreppatbase);
  444. var oParam = {};
  445. oParam.id = "TRMRI02106";
  446. oParam.service = "unprepmngtapp.ChrtUnprepMngt";
  447. oParam.method = "reqGetUnPrepRecList";
  448. oParam.inds = "req=ds_send_reqdata";
  449. oParam.outds = "ds_main_unpreprecinfo_unprepreclist=unprepreclist";
  450. oParam.async = false;
  451. oParam.callback = "cf_TRMRI02106";
  452. tranf_submit(oParam);
  453. ds_main_unpreprecinfo_unprepreclist.addColumn("check", "string");
  454. ds_main_unpreprecinfo_unprepreclist.addColumn("bkcolor", "string");
  455. ds_main_unpreprecinfo_unprepreclist.addColumn("bkcolorcheck", "string");
  456. ds_main_unpreprecinfo_unprepreclist.addColumn("bkDelcolor", "string");
  457. ds_main_unpreprecinfo_unprepreclist.addColumn("orgunprepstat", "string");
  458. ds_main_unpreprecinfo_unprepreclist.addColumn("orgunprepdrnm", "string");
  459. ds_main_unpreprecinfo_unprepreclist.addColumn("orgunprepdeptnm", "string");
  460. ds_main_unpreprecinfo_unprepreclist.addColumn("orgdetldeptnm", "string");
  461. ds_main_unpreprecinfo_unprepreclist.addColumn("orgdetldeptcd", "string");
  462. ds_main_unpreprecinfo_unprepreclist.addColumn("orgorddeptcd", "string");
  463. ds_main_unpreprecinfo_unprepreclist.addColumn("orgunprepdrid", "string");
  464. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  465. ds_main_unpreprecinfo_unprepreclist.updatecontrol = false;
  466. for(var i = 0; i < ds_main_unpreprecinfo_unprepreclist.rowcount; i++){
  467. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgunprepstat", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "unprepstat"));
  468. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgunprepdrnm", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "unprepstat"));
  469. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgunprepdeptnm", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "unprepdeptnm"));
  470. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgdetldeptnm", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "detldeptnm"));
  471. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgdetldeptcd", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "detldeptcd"));
  472. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgorddeptcd", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "orddeptcd"));
  473. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgunprepdrid", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "unprepdrid"));
  474. }
  475. ds_main_unpreprecinfo_unprepreclist.updatecontrol = true;
  476. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  477. if(arErrorCode.pop("TRMRI02106") > -1){
  478. fDoMergeUnPrepRecList();
  479. }
  480. }
  481. function cf_TRMRI02106(sSvcId, nErrorCode, sErrorMsg) {
  482. arErrorCode.push(sSvcId, nErrorCode);
  483. }
  484. /**
  485. * @desc 환자 기록지 조회
  486. */
  487. function fReqGetPatRecList(pid, orddd, cretno){
  488. ds_send_recreqdata.clearData();
  489. dsf_makeValue(ds_send_recreqdata, "pid", "string", pid);
  490. dsf_makeValue(ds_send_recreqdata, "orddd", "string", orddd);
  491. dsf_makeValue(ds_send_recreqdata, "cretno", "string", cretno);
  492. var oParam = {};
  493. oParam.id = "TRMRI01704";
  494. oParam.service = "unprepmngtapp.ChrtUnprepMngt";
  495. oParam.method = "reqGetPatRecList";
  496. oParam.inds = "req=ds_send_recreqdata";
  497. oParam.outds = "ds_main_patreclist_patreclist=patreclist";
  498. oParam.async = false;
  499. tranf_submit(oParam);
  500. ds_main_patreclist_patreclist.addColumn("check", "string");
  501. }
  502. /**
  503. * @desc 미비기록 load
  504. */
  505. function fLoadUnPrepFormRec(){
  506. var currow = ds_main_unpreprecinfo_unprepreclist.rowposition;
  507. if(currow < 0){
  508. return;
  509. }
  510. var pid = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "pid");
  511. var indd = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "indd");
  512. var cretno = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "cretno");
  513. var formcd = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "formcd");
  514. var srcformcd = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "srcformcd");
  515. var dschdd = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "dschdd");
  516. var oprsrvno = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "oprsrvno");
  517. var orddrid = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "unprepdrid");
  518. var orddeptcd = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "indschdeptcd");
  519. var formrecseq = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "formrecseq");
  520. var formrecdd = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "formrecdd");
  521. var instcd = sysf_getUserInfo("dutplceinstcd");
  522. //2009-07-08 오후 8:03:43 강지훈 수정 : 20091002로 하드코딩된 내역을 공통코드 "M0546" 유형코드 "M0037" 로 관리
  523. var opendd = utlf_transNullToEmpty(ds_init_openday_M0037M0546.getColumn(0, "cdid")); // 병원별 오픈일
  524. var preopendd = opendd.toDate().getAddDate(-1, "D").getDateFormat();
  525. var preOpenMonth = utlf_transNullToEmpty(preopendd).substr(4,6);
  526. var preOpenDay = utlf_transNullToEmpty(preopendd).substr(6,8);
  527. if(formrecdd <= preopendd){
  528. sysf_messageBox(preOpenMonth+"월 "+preOpenDay+"일까지 발생된 미비기록은 구OCS프로그램과 종이에 작성", "I008");
  529. return;
  530. }
  531. if((srcformcd != "0000002022")){
  532. // 2009-11-02 이경희
  533. // 오픈이전 기록 메시지와 기록지 연결이 안된 미비 메시지와 순서를 변경함
  534. if(formrecseq == 0 || formrecseq == -1){
  535. sysf_messageBox("기록지와 연결이 되지 않은 미비", "I009");
  536. return;
  537. }
  538. }
  539. // 2009.07.01 이경희
  540. // 환자의 퇴원일이 해당 일자 이후인 경우. 즉 재원중인 환자는 dschdd를 현재일자로 넘긴다.
  541. var today = utlf_getCurrentDate();
  542. if(dschdd > today) {
  543. dschdd = today
  544. }
  545. //수술기록인 경우, 상단정보 처리
  546. if(srcformcd == "0000000676" || srcformcd == "0000002022" || srcformcd == "0000000737"){
  547. var param = "T" + "▦" +
  548. pid + "▦" +
  549. formrecdd + "▦" +
  550. cretno + "▦" +
  551. instcd + "▦" +
  552. "" + "▦" +
  553. "" + "▦" +
  554. "I" + "▦" +
  555. "F" + "▦" +
  556. oprsrvno + "▦" +
  557. "" + "▦" +
  558. dschdd;
  559. frmf_setParameter("condparam", param);
  560. //수술기록 이외의 상단정보 처리
  561. }else{
  562. var param = "I" + "▦" +
  563. pid + "▦" +
  564. indd + "▦" +
  565. cretno + "▦" +
  566. instcd + "▦" +
  567. dschdd;
  568. frmf_setParameter("condparam", param);
  569. }
  570. sysf_setGlobalVariable("linked_formcd" , formcd , "emr");
  571. sysf_setGlobalVariable("linked_formrecseq", formrecseq , "emr");
  572. sysf_setGlobalVariable("linked_formrecdd" , formrecdd , "emr");
  573. //modal("SPMMO08900", 1, 0, 0, "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  574. appf_initPatientInfo(param);
  575. var gmainwnd = frmf_getMainViewer();
  576. frmf_setParameter("SMMMO04100_ANSWCNT", "");
  577. /*
  578. gmainwnd.javascript.navigate("SMMMR00100");
  579. */
  580. // 2013.10.15 김영기 마취기록지 및 마취전 평가 및 협진서 추가를 위한 로직 수정
  581. if(srcformcd == "0000002022" || srcformcd == "0000000737"){ //서식코드가 마취기록지 및 마취전 평가 일경우
  582. //gmainwnd.navigate("SMMMR03700");
  583. gmainwnd.frmf_openForm("SMMMR03700", null, null);
  584. }else{
  585. //gmainwnd.navigate("SMMMR00100");
  586. gmainwnd.frmf_openForm("SMMMR00100", null, null);
  587. }
  588. }
  589. /**
  590. * @desc 미비과 변경
  591. */
  592. function fReqSetUnPrepDeptCD(){
  593. var len = grdf_getSelectedRows(grd_unprepreclist);
  594. //trace(len)
  595. var orddeptcd = ds_init.getColumn(0, "unprepdeptcd");
  596. var orddeptnm = group1.combo1.text;
  597. for(var i = 0; i < len.length; i++){
  598. var currow = len[i]
  599. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  600. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "status" , "di");
  601. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "orddeptcd" , orddeptcd);
  602. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  603. }
  604. var savenodelist = ds_main_unpreprecinfo_unprepreclist.getCaseCount("status=='di'");
  605. var srchnodelist = ds_send_reqdata.rowcount;
  606. if(savenodelist == 0){
  607. sysf_messageBox("저장할 정보가", "I004");
  608. return;
  609. }else{
  610. // var savedata = getNodeListCSV(savenodelist);
  611. // var srchdata = getNodeListCSV(srchnodelist);
  612. ds_send_savedata.clearData();
  613. ds_main_unpreprecinfo_unprepreclist.filter("status=='di'");
  614. ds_send_savedata.copyData(ds_main_unpreprecinfo_unprepreclist, true);
  615. ds_main_unpreprecinfo_unprepreclist.filter("");
  616. ds_send_srchdata.copyData(ds_send_reqdata);
  617. var oParam = {};
  618. oParam.id = "TXMRI01702";
  619. oParam.service = "unprepmngtapp.ChrtUnprepMngt";
  620. oParam.method = "reqSetUnPrepDeptCD";
  621. oParam.inds = "savedata=ds_send_savedata srchdata=ds_send_srchdata";
  622. oParam.outds = "ds_main_unpreprecinfo_unprepreclist=unprepreclist";
  623. oParam.async = false;
  624. oParam.callback = "cf_TXMRI01702";
  625. tranf_submit(oParam);
  626. ds_main_unpreprecinfo_unprepreclist.addColumn("check", "string");
  627. ds_main_unpreprecinfo_unprepreclist.addColumn("bkcolor", "string");
  628. ds_main_unpreprecinfo_unprepreclist.addColumn("bkcolorcheck", "string");
  629. ds_main_unpreprecinfo_unprepreclist.addColumn("bkDelcolor", "string");
  630. ds_main_unpreprecinfo_unprepreclist.addColumn("orgunprepstat", "string");
  631. ds_main_unpreprecinfo_unprepreclist.addColumn("orgunprepdrnm", "string");
  632. ds_main_unpreprecinfo_unprepreclist.addColumn("orgunprepdeptnm", "string");
  633. ds_main_unpreprecinfo_unprepreclist.addColumn("orgdetldeptnm", "string");
  634. ds_main_unpreprecinfo_unprepreclist.addColumn("orgdetldeptcd", "string");
  635. ds_main_unpreprecinfo_unprepreclist.addColumn("orgorddeptcd", "string");
  636. ds_main_unpreprecinfo_unprepreclist.addColumn("orgunprepdrid", "string");
  637. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  638. ds_main_unpreprecinfo_unprepreclist.updatecontrol = false;
  639. for(var i = 0; i < ds_main_unpreprecinfo_unprepreclist.rowcount; i++){
  640. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgunprepstat", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "unprepstat"));
  641. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgunprepdrnm", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "unprepstat"));
  642. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgunprepdeptnm", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "unprepdeptnm"));
  643. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgdetldeptnm", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "detldeptnm"));
  644. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgdetldeptcd", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "detldeptcd"));
  645. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgorddeptcd", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "orddeptcd"));
  646. ds_main_unpreprecinfo_unprepreclist.setColumn(i, "orgunprepdrid", ds_main_unpreprecinfo_unprepreclist.getColumn(i, "unprepdrid"));
  647. }
  648. ds_main_unpreprecinfo_unprepreclist.updatecontrol = true;
  649. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  650. if(arErrorCode.pop("TXMRI01702") > -1){
  651. // grd_unprepreclist.allstyle("data", "color") = "#000000";
  652. // grd_unprepreclist.mergeCells = "bycol";
  653. // grd_unprepreclist.mergeCol(grd_unprepreclist.colRef("pid")) = true;
  654. // grd_unprepreclist.mergeCol(grd_unprepreclist.colRef("hngnm"))= true;
  655. // grd_unprepreclist.merge();
  656. }
  657. }
  658. }
  659. function cf_TXMRI01702(sSvcId, nErrorCode, sErrorMsg) {
  660. arErrorCode.push(sSvcId, nErrorCode);
  661. }
  662. /**
  663. * @desc 미비 Excel화일 생성
  664. */
  665. function reqGetUnPrepCreateExcelFile(){//cms
  666. var fd = new FileDialog();
  667. var files = fd.open("Excel Export", FileDialog.SAVE ,"%MYDOCUMENT%", "");
  668. if (utlf_isNull(files))
  669. {
  670. return;
  671. }
  672. if(!utlf_isNull(files)){
  673. ds_send_reqdata.clearData();
  674. //화일 디렉토리 위치, 화일명을 받는다.
  675. var filenm = files.filename;
  676. var filepath = files.fullpath.replace(filenm, "");
  677. var colref = "pid^hngnm^dschdeptnm^dschdd^indd^medispclnm^unprepstatnm^doctkindflag^unprepdrnm^unprepdeptnm^formnm^unprepitemnm^formrecdd^medirecalertcnts^drcnfmdt^dralertcnts^fstrgstrnm^fstrgstdt^lastupdtrnm^lastupdtdt";
  678. //조회시 조건을 설정하여 CSV형태로 전환하여 조회
  679. ds_main_cond.setColumn(0, "srchflag", "dr");
  680. var unprepstat = ds_main_cond_unprepdrbase.getColumn(0, "unprepstat");
  681. if(unprepstat != "-"){
  682. var unprepstatArray = utlf_transNullToEmpty(unprepstat).split(' ');
  683. var cond = "";
  684. for(var i = 0; i < unprepstatArray.length; i++){
  685. cond += unprepstatArray[i] + '\',\'';
  686. }
  687. ds_main_cond_unprepdrbase.setColumn(0, "unprepstatlist", utlf_transNullToEmpty(cond).substr(0, utlf_transNullToEmpty(cond).length - 3));
  688. }
  689. //미비의사명이 없는 경우, ID를 clear
  690. if(utlf_isNull(ipt_unprepdrnm.text)){
  691. ds_main_cond_unprepdrbase.setColumn(0, "unprepdrid", "");
  692. }
  693. ds_send_reqdata.clearData();
  694. ds_main_cond_unprepdrbase.setColumn(0, "unprepsign", "N");
  695. dsf_makeValue(ds_main_cond_unprepdrbase, "scrnflag", "string", "unprepdrbase");
  696. //전체조회 월별로 나눠서 file로 다운로드처리
  697. //2008. 12. 22 오지훈
  698. var dayflag = ds_main_cond_unprepdrbase.getColumn(0, "dayflag");
  699. if(dayflag == "N"){
  700. ds_main_cond_unprepdrbase.setColumn(0, "dayflag", "Y");
  701. // 2009-07-25 이경희
  702. // 엑셀저장시 2009/07/01로 고정된 부분을 수정.
  703. //var startdate = "20070101";
  704. var opendd = ds_init_openday_M0037M0546.getColumn(0, "cdid"); // 병원별 오픈일
  705. var startdate = opendd.toDate().getDateFormat("YYYYMM") + "01"; // 오픈한 달의 첫날부터로 설정
  706. var enddate = utlf_getCurrentDate();
  707. }else{
  708. ds_main_cond_unprepdrbase.setColumn(0, "dayflag", "Y");
  709. var startdate = ds_main_cond_unprepdrbase.getColumn(0, "fromdd");
  710. var enddate = ds_main_cond_unprepdrbase.getColumn(0, "todd");
  711. var backupflag = "Y";
  712. }
  713. var steps = parseInt(ds_main_cond_excelcond.getColumn(0, "steps")) - 1;
  714. var lastdd = "";
  715. var enddd = "";
  716. //시작일자와 종료일자가 동일한 달인 경우(monthcnt == 0), 종료일자는 그대로
  717. //동일한 달이 아닌 경우, 그 달의 마지막 날짜를 concat한다.
  718. while(enddate > startdate){
  719. enddd = utlf_transNullToEmpty(((startdate.toDate()).getAddDate(steps, "M")).getDateFormat());
  720. if(enddd.substr(0, 6) >= enddate.substr(0, 6)){
  721. enddd = enddate;
  722. }else{
  723. var dd1 = enddd.substr(0, 6).concat("01");
  724. var dd2 = ((dd1.toDate()).getAddDate(1, "M")).getDateFormat();
  725. lastdd = utlf_getDateInterval(dd1, dd2);
  726. enddd = enddd.substring(0, 6).concat(lastdd);
  727. }
  728. ds_main_cond_unprepdrbase.setColumn(0, "fromdd", startdate);
  729. ds_main_cond_unprepdrbase.setColumn(0, "todd" , enddd);
  730. var condnode = ds_main_cond_unprepdrbase;
  731. dsf_makeValue(ds_send_reqdata, "colref" , "string", colref);
  732. dsf_makeValue(ds_send_reqdata, "sqlid" , "string", "getUnPrepRecList");
  733. dsf_makeValue(ds_send_reqdata, "srchcond", "string", doSrchCondCSV(condnode, "^", "|"));
  734. var oParam = {};
  735. oParam.id = "TRMRI02108";
  736. oParam.service = "unprepmngtapp.ChrtUnprepMngt";
  737. oParam.method = "reqGetUnPrepCreateExcelFile";
  738. oParam.inds = "req=ds_send_reqdata";
  739. oParam.outds = "ds_attachfile=attachfile";
  740. oParam.async = false;
  741. tranf_submit(oParam);
  742. dsf_readFileFromDs(filepath + filenm + "_" + startdate + "_" + enddd + ".xls", ds_attachfile, 0, "filedata"); // 파일저장
  743. startdate = ((startdate.toDate()).getAddDate(steps + 1, "M")).getDateFormat();
  744. }
  745. //원래 기간 조회가 아니었으므로 기간조회를 N으로 처리함
  746. if(backupflag == "Y"){
  747. ds_main_cond_unprepdrbase.setColumn(0, "dayflag", "N");
  748. }
  749. }else{
  750. return;
  751. }
  752. }
  753. function doSrchCondCSV(nodeList, sColSep, sRowSep){
  754. if( nodeList.rowcount == 0 ){
  755. return;
  756. }
  757. var rCSV = "";
  758. for(var i = 0; i < ds_main_cond_unprepdrbase.colcount - 1; i++){
  759. rCSV += ds_main_cond_unprepdrbase.getColID(i) + sColSep;
  760. }
  761. rCSV += ds_main_cond_unprepdrbase.getColID(i) + sRowSep;
  762. for(var i = 0; i < ds_main_cond_unprepdrbase.rowcount ;i++){
  763. for(var j = 0; j < ds_main_cond_unprepdrbase.colcount - 1;j++ ){
  764. rCSV += ds_main_cond_unprepdrbase.getColumn(i, j) + sColSep;
  765. }
  766. rCSV += ds_main_cond_unprepdrbase.getColumn(i, j) + sRowSep;
  767. }
  768. return rCSV;
  769. }
  770. /**
  771. * @desc 세부과설정
  772. */
  773. function fSetDetlDeptCD(){
  774. var loopcnt = grdf_getSelectedRows(grd_unprepreclist);
  775. for(var i = 0 ; i < loopcnt.length; i++){
  776. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  777. ds_main_unpreprecinfo_unprepreclist.setColumn(loopcnt[i], "status", "l");
  778. ds_main_unpreprecinfo_unprepreclist.setColumn(loopcnt[i], "detldeptnm", group3.cmb_detldeptcd.text);
  779. ds_main_unpreprecinfo_unprepreclist.setColumn(loopcnt[i], "detldeptcd", group3.cmb_detldeptcd.value);
  780. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  781. }
  782. }
  783. /**
  784. * @desc 미비기록상태 배치미비수정
  785. */
  786. function fSetUnPrepRecInfo0(){
  787. var len = grdf_getSelectedRows(grd_unprepreclist);
  788. for(var i = 0 ; i < len.length; i++){
  789. var currow = len[i];
  790. var status = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "status");
  791. if(status == "ud"){
  792. sysf_messageBox("의사변경 후에 미비상태를 변경", "I006");
  793. continue;
  794. }
  795. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  796. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "status" , "u");
  797. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "unprepstat", "0");
  798. var startcol = grd_unprepreclist.getBindCellIndex("body", "dschdd");
  799. var endcol = grd_unprepreclist.getBindCellIndex("body", "lastupdtdt");
  800. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "bkDelcolor", "#0000ff");
  801. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  802. }
  803. }
  804. /**
  805. * @desc 미비기록상태 미비확인수정
  806. */
  807. function fSetUnPrepRecInfo1(){
  808. var len = grdf_getSelectedRows(grd_unprepreclist);
  809. for(var i = 0 ; i < len.length; i++){
  810. var currow = len[i];
  811. var status = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "status");
  812. if(status == "ud"){
  813. sysf_messageBox("의사변경 후에 미비상태를 변경", "I006");
  814. continue;
  815. }
  816. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  817. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "status", "u");
  818. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "unprepstat", "1");
  819. var startcol = grd_unprepreclist.getBindCellIndex("body", "dschdd");
  820. var endcol = grd_unprepreclist.getBindCellIndex("body", "lastupdtdt");
  821. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "bkDelcolor", "#0000ff");
  822. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  823. }
  824. }
  825. /**
  826. * @desc 미비기록상태 의사확인수정
  827. */
  828. function fSetUnPrepRecInfo2(){
  829. var len = grdf_getSelectedRows(grd_unprepreclist);
  830. for(var i = 0 ; i < len.length; i++){
  831. var currow = len[i];
  832. var status = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "status");
  833. if(status == "ud"){
  834. sysf_messageBox("의사변경 후에 미비상태를 변경", "I006");
  835. continue;
  836. }
  837. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  838. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "status", "u");
  839. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "unprepstat", "2");
  840. var startcol = grd_unprepreclist.getBindCellIndex("body", "dschdd");
  841. var endcol = grd_unprepreclist.getBindCellIndex("body", "lastupdtdt");
  842. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "bkDelcolor", "#0000ff");
  843. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  844. }
  845. }
  846. /**
  847. * @desc 미비기록상태 재미비수정
  848. */
  849. function fSetUnPrepRecInfo3(){
  850. var len = grdf_getSelectedRows(grd_unprepreclist);
  851. for(var i = 0 ; i < len.length; i++){
  852. var currow = len[i];
  853. var status = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "status");
  854. if(status == "ud"){
  855. sysf_messageBox("의사변경 후에 미비상태를 변경", "I006");
  856. continue;
  857. }
  858. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  859. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "status", "u");
  860. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "unprepstat", "3");
  861. var startcol = grd_unprepreclist.getBindCellIndex("body", "dschdd");
  862. var endcol = grd_unprepreclist.getBindCellIndex("body", "lastupdtdt");
  863. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "bkDelcolor", "#0000ff");
  864. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  865. }
  866. }
  867. /**
  868. * @desc 미비기록상태 완료수정
  869. */
  870. function fSetUnPrepRecInfo4(){
  871. var len = grdf_getSelectedRows(grd_unprepreclist);
  872. for(var i = 0 ; i < len.length; i++){
  873. var currow = len[i];
  874. var status = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "status");
  875. if(status == "ud"){
  876. sysf_messageBox("의사변경 후에 미비상태를 변경", "I006");
  877. continue;
  878. }
  879. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  880. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "status", "u");
  881. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "unprepstat", "4");
  882. var startcol = grd_unprepreclist.getBindCellIndex("body", "dschdd");
  883. var endcol = grd_unprepreclist.getBindCellIndex("body", "lastupdtdt");
  884. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "bkDelcolor", "#0000ff");
  885. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  886. }
  887. }
  888. /**
  889. * @desc 미비의사변경
  890. */
  891. function fChngUnPrepDrInfo(){
  892. var orddd = ds_main_unpreprecinfo_unprepreclist.getColumn(ds_main_unpreprecinfo_unprepreclist.rowposition, "formrecdd");
  893. frmf_setParameter("SPMRI02900_stnddd", orddd);
  894. frmf_modal("SPMRI02900", "SPMRI02900", "", null, "", "", "", null, null, null, null, null, "M");
  895. if(frmf_getParameter("SPMRI02900_useyn")=="Y"){
  896. var doctinfo = frmf_getParameter("SPMRI02900_rtnparam");
  897. doctinfo = utlf_transNullToEmpty(doctinfo).split("^");
  898. var len = grdf_getSelectedRows(grd_unprepreclist);
  899. for(var i = 0; i < len.length; i++){
  900. var currow = len[i];
  901. var status = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "status");
  902. if(status != "i"){ //신규가 아닌 경우, 의사변경으로 상태변경
  903. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  904. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "status", "ud");
  905. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  906. }
  907. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  908. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "orddeptcd" , doctinfo[0]);
  909. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "unprepdeptnm", doctinfo[1]);
  910. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "doctkindflag", doctinfo[2]);
  911. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "unprepdrid" , doctinfo[3]);
  912. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "unprepdrnm" , doctinfo[4]);
  913. var startcol = grd_unprepreclist.getBindCellIndex("body", "dschdd");
  914. var endcol = grd_unprepreclist.getBindCellIndex("body", "lastupdtdt");
  915. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "bkDelcolor", "#808080");
  916. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  917. }
  918. }
  919. frmf_setParameter("SPMRI02900_useyn" , "");
  920. frmf_setParameter("SPMRI02900_rtnparam", "");
  921. }
  922. /**
  923. * @desc 미비의사 직종(Intern)으로 변경
  924. */
  925. function fChngUnPrepInternPos(){
  926. var len = grdf_getSelectedRows(grd_unprepreclist);
  927. for(var i = 0; i < len.length; i++){
  928. var currow = len[i];
  929. var status = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "status");
  930. if(status != "i"){
  931. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  932. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "status", "up");
  933. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  934. }
  935. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  936. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "doctkindflag", "I");
  937. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  938. }
  939. }
  940. /**
  941. * @desc 미비의사 직종(Resident)로 변경
  942. */
  943. function fChngUnPrepResiPos(){
  944. var len = grdf_getSelectedRows(grd_unprepreclist);
  945. for(var i = 0; i < len.length; i++){
  946. var currow = len[i];
  947. var status = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "status");
  948. if(status != "i"){
  949. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  950. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "status", "up");
  951. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  952. }
  953. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  954. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "doctkindflag", "R");
  955. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  956. }
  957. }
  958. /**
  959. * @desc 미비의사 직종(Staff)로 변경
  960. */
  961. function fChngUnPrepStaffPos(){
  962. var len = grdf_getSelectedRows(grd_unprepreclist);
  963. for(var i = 0; i < len.length; i++){
  964. var currow = len[i];
  965. var status = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "status");
  966. if(status != "i"){
  967. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  968. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "status", "up");
  969. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  970. }
  971. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  972. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "doctkindflag", "St");
  973. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  974. }
  975. }
  976. /**
  977. * @desc 미비과 변경 팝업창 open
  978. */
  979. function fOpenUnPrepDeptCD(){
  980. group1.position.left = clientX;
  981. group1.position.top = clientY;
  982. group1.position.height = 55;
  983. group1.position.width = 218;
  984. }
  985. /**
  986. * @desc 미비분과 설정창 open
  987. */
  988. function fOpenUnPrepDeltDeptCD(){
  989. sysf_messageBox("사용하지 않는 기능입니다","I");
  990. return;
  991. var currow = ds_main_unpreprecinfo_unprepreclist.rowposition;
  992. if(currow >= 0){
  993. group3.position.left = clientX;
  994. group3.position.top = clientY;
  995. // targetX가 간혹 음수가 나오는 케이스를 수정
  996. group3.position.height = 55;
  997. group3.position.width = 218;
  998. var orddeptcd = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "orddeptcd");
  999. //미비과에 따라 미비분과 combo정보를 변경
  1000. if(orddeptcd == "2040000000"){ //외과
  1001. group3.cmb_detldeptcd.innerdataset = "ds_init_M0501";
  1002. }else if(orddeptcd == "2100000000"){ //산부인과
  1003. group3.cmb_detldeptcd.innerdataset = "ds_init_M0502";
  1004. }else if(orddeptcd == "2110000000"){ //소아과
  1005. group3.cmb_detldeptcd.innerdataset = "ds_init_M0503";
  1006. }
  1007. else
  1008. {
  1009. group3.cmb_detldeptcd.innerdataset = "ds_init_M0504";
  1010. dsf_makeValue(ds_main_unprepdeptcd, "detldeptcd", "string", "");
  1011. return;
  1012. }
  1013. group3.cmb_detldeptcd.index = 1;
  1014. }
  1015. }
  1016. /**
  1017. * @desc 수정취소
  1018. */
  1019. function fCnclSetPrepRecInfo(){
  1020. var len = grdf_getSelectedRows(grd_unprepreclist);
  1021. for(var i = 0 ; i < len.length; i++){
  1022. var currow = len[i];
  1023. var status = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "status");
  1024. var orgunprepstat = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "orgunprepstat");
  1025. var orgunprepdrnm = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "orgunprepdrnm");
  1026. var orgdoctkindflag = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "orgdoctkindflag");
  1027. var orgunprepdrid = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "orgunprepdrid");
  1028. var orgorddeptcd = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "orgorddeptcd");
  1029. var orgdetldeptnm = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "orgdetldeptnm");
  1030. var orgdetldeptcd = ds_main_unpreprecinfo_unprepreclist.getColumn(currow, "orgdetldeptcd");
  1031. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "unprepstat", orgunprepstat);
  1032. var startcol = grd_unprepreclist.getBindCellIndex("body", "dschdd");
  1033. var endcol = grd_unprepreclist.getBindCellIndex("body", "lastupdtdt");
  1034. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "bkDelcolor", "#000000");
  1035. if(status == "ud" || status == "l"){
  1036. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "unprepdrnm" , orgunprepdrnm);
  1037. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "doctkindflag", orgdoctkindflag);
  1038. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "unprepdrid" , orgunprepdrid);
  1039. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "orddeptcd" , orgorddeptcd);
  1040. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "detldeptnm" , orgdetldeptnm);
  1041. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "detldeptcd" , orgdetldeptcd);
  1042. }
  1043. ds_main_unpreprecinfo_unprepreclist.setColumn(currow, "status", "");
  1044. }
  1045. }
  1046. /**
  1047. * @desc 기록연동 해제
  1048. */
  1049. function fCnclFormRecSeq(){
  1050. var loopcnt = grdf_getSelectedRows(grd_unprepreclist);
  1051. for(var i = 0 ; i < loopcnt.length ; i++){
  1052. ds_main_unpreprecinfo_unprepreclist.setColumn(loopcnt[i], "status", "f");
  1053. }
  1054. }
  1055. /**
  1056. * @desc 권고상병 보기
  1057. */
  1058. function fGetDetlPropDiag(){
  1059. var srow = ds_main_unpreprecinfo_unprepreclist.rowposition;
  1060. var unprepitemnm = ds_main_unpreprecinfo_unprepreclist.getColumn(srow,"unprepitemnm");
  1061. var pid = ds_main_unpreprecinfo_unprepreclist.getColumn(srow,"pid");
  1062. var indd = ds_main_unpreprecinfo_unprepreclist.getColumn(srow,"indd");
  1063. var cretno = ds_main_unpreprecinfo_unprepreclist.getColumn(srow,"cretno");
  1064. if (unprepitemnm != "권고상병") {
  1065. sysf_messageBox("권고상병 항목이 아니므로 상세화면을 열 수 없습니다","I");
  1066. return;
  1067. }
  1068. frmf_setParameter("SPMRI02001_pid", pid);
  1069. frmf_setParameter("SPMRI02001_indd", indd);
  1070. frmf_setParameter("SPMRI02001_cretno", cretno);
  1071. frmf_modal("SPMRI02001", "SPMRI02001", null, null, null, null, null, null, null, null, null, null, "M");
  1072. }
  1073. /**
  1074. * @desc 미비추가된 정보 생성
  1075. */
  1076. function fCretUnPrepSaveInfo(){
  1077. fSetUnPrepSaveInfo();
  1078. }
  1079. /**
  1080. * @desc : 미비추가 후 저장될 정보 설정
  1081. */
  1082. function fSetUnPrepSaveInfo(){
  1083. for(var i = 0 ; i < ds_temp_unpreprecinfo_unprepreclist.rowcount; i++){
  1084. var pid = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "pid"));
  1085. var indd = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "indd"));
  1086. var cretno = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "cretno"));
  1087. var hngnm = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "hngnm"));
  1088. var dschdeptcd = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "dschdeptcd"));
  1089. var dschdeptnm = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "dschdeptnm"));
  1090. var dschdd = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "dschdd"));
  1091. var doctkindflag = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "jobposnm"));
  1092. var unprepdrnm = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "unprepdrnm"));
  1093. var unprepdrid = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "unprepdrid"));
  1094. var formcd = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "formcd"));
  1095. var formnm = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "formnm"));
  1096. var unprepitemnm = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "unprepitemnm"));
  1097. var unprepitemcd = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "unprepitemcd"));
  1098. var oprsrvno = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "oprsrvno"));
  1099. var orddd = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "orddd"));
  1100. var indschflag = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "indschflag"));
  1101. var orddeptcd = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "orddeptcd"));
  1102. var formrecseq = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "formrecseq"));
  1103. var medirecalertcnts = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "medirecalertcnts"));
  1104. var unprepno = utlf_transNullToEmpty(ds_temp_unpreprecinfo_unprepreclist.getColumn(i, "unprepno"));
  1105. if(utlf_isNull(formrecseq)){
  1106. formrecseq = "-1";
  1107. }
  1108. ds_main_unpreprecinfo_unprepreclist.enableevent = false;
  1109. var trgtrow = ds_main_unpreprecinfo_unprepreclist.addRow();
  1110. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "status" , "i");
  1111. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "indschflag" , indschflag);
  1112. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "pid" , pid);
  1113. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "indd" , indd);
  1114. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "cretno" , cretno);
  1115. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "hngnm" , hngnm);
  1116. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "dschdeptcd" , dschdeptcd);
  1117. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "dschdeptnm" , dschdeptnm);
  1118. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "dschdd" , dschdd);
  1119. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "unprepstat" , "1");
  1120. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "doctkindflag", doctkindflag);
  1121. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "unprepdrnm" , unprepdrnm);
  1122. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "unprepdrid" , unprepdrid);
  1123. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "formrecdd" , orddd);
  1124. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "orddeptcd" , orddeptcd);
  1125. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "formcd" , formcd);
  1126. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "formnm" , formnm);
  1127. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "oprsrvno" , oprsrvno);
  1128. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "unprepitemnm" , unprepitemnm);
  1129. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "unprepitemcd" , unprepitemcd);
  1130. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "formrecseq" , formrecseq);
  1131. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "medirecalertcnts" , medirecalertcnts);
  1132. ds_main_unpreprecinfo_unprepreclist.setColumn(trgtrow, "unprepno" , unprepno);
  1133. ds_main_unpreprecinfo_unprepreclist.enableevent = true;
  1134. }
  1135. ds_temp_unpreprecinfo_unprepreclist.clearData();
  1136. }
  1137. function fReqGetFormList(){
  1138. var oParam = {};
  1139. oParam.id = "TRMRI01804";
  1140. oParam.service = "unprepmngtapp.ChrtUnprepMngt";
  1141. oParam.method = "reqGetUnPrepFormCD";
  1142. oParam.outds = "ds_init_cmb_formcd=unprepformcd";
  1143. oParam.async = false;
  1144. oParam.callback = "cf_TRMRI01804";
  1145. tranf_submit(oParam);
  1146. }
  1147. function cf_TRMRI01804(sSvcId, nErrorCode, sErrorMsg){
  1148. if(nErrorCode < 0) return;
  1149. arErrorCode.push(sSvcId, nErrorCode);
  1150. utlf_addLog("***** cf_TRMRI01804 *****");
  1151. frmf_addComboItem( "cmb_formcd", "전체" , "-" , "above" );
  1152. cmb_formcd.value = "-";
  1153. cf_TRMRI01805();
  1154. }
  1155. function fReqGetFormItemList(formcd){
  1156. ds_send_reqdata.clearData();
  1157. ds_send_reqdata.addColumn("formcd", "string");
  1158. var nRow = ds_send_reqdata.addRow();
  1159. ds_send_reqdata.setColumn(nRow, "formcd", formcd);
  1160. var oParam = {};
  1161. oParam.id = "TRMRI01805";
  1162. oParam.service = "unprepmngtapp.ChrtUnprepMngt";
  1163. oParam.method = "reqGetUnPrepItemCD";
  1164. oParam.inds = "req=ds_send_reqdata";
  1165. oParam.outds = "ds_init_cmb_itemcd=itemcd";
  1166. oParam.async = false;
  1167. oParam.callback = "cf_TRMRI01805";
  1168. tranf_submit(oParam);
  1169. }
  1170. function cf_TRMRI01805(sSvcId, nErrorCode, sErrorMsg){
  1171. if(nErrorCode < 0) return;
  1172. arErrorCode.push(sSvcId, nErrorCode);
  1173. utlf_addLog("***** cf_TRMRI01805*****");
  1174. frmf_addComboItem("cmb_itemcd", "전체", "-" , "above");
  1175. cmb_itemcd.value = "-";
  1176. }
  1177. function fOpenMedirecList(){
  1178. var rowIdx = ds_main_unpreprecinfo_unprepreclist.rowposition;
  1179. var pid = ds_main_unpreprecinfo_unprepreclist.getColumn(rowIdx, "pid");
  1180. var formrecseq = ds_main_unpreprecinfo_unprepreclist.getColumn(rowIdx, "formrecseq");
  1181. var srcformcd = ds_main_unpreprecinfo_unprepreclist.getColumn(rowIdx, "srcformcd");
  1182. frmf_setParameter("SPMMR07000_param_pid", pid);
  1183. if(formrecseq != "-1"){
  1184. frmf_setParameter("SPMMR07000_param_formrecseq", formrecseq);
  1185. }
  1186. //frmf_setParameter("SPMMR07000_param_formrecseq", formrecseq);
  1187. //frmf_setParameter("SPMMR07000_param_srcformcd", srcformcd);
  1188. //frmf_setParameter("SPMMR07000_param_lastyn", "Y");
  1189. //frmf_setParameter("SPMMR07000_param_bEnable", "");
  1190. frmf_modal("SPMMR07000", "SPMMR07000", null, null, null, null, null, null, null, null, null, null, "M");
  1191. frmf_clearParameter("SPMMR07000_param_pid");
  1192. frmf_clearParameter("SPMMR07000_param_formrecseq");
  1193. }
  1194. /**
  1195. * @desc 기록비교
  1196. */
  1197. function lf_recCompare(){
  1198. var aRows = grdf_getSelectedRows(grd_patreclist);
  1199. if( aRows.length != 2 ){
  1200. sysf_messageBox("비교할 기록 2개를 정확히 선택하시기 바랍니다.", "I");
  1201. return;
  1202. }
  1203. if(ds_main_patreclist_patreclist.getColumn(aRows[0], "formcd") != ds_main_patreclist_patreclist.getColumn(aRows[1], "formcd")){
  1204. sysf_messageBox("동일한 서식의 기록 2개를 선택하시기 바랍니다.", "I");
  1205. return;
  1206. }
  1207. //선택한 기록의 rechistseq, updtdd, updttm 조회
  1208. dsf_createDs("ds_compare");
  1209. dsf_createDs("ds_temp_rechistlist", [{col: "rechistseq", type:"string", size:256, val:""}
  1210. , {col: "updtdd", type:"string", size:256, val:"Y"}
  1211. , {col: "updttm", type:"string", size:256, val:""}]);
  1212. for(var i = 0; i < aRows.length; i++){
  1213. dsf_createDsRow("ds_temp_cond", [{col: "formrecseq", type:"string", size:256, val:ds_main_patreclist_patreclist.getColumn(aRows[i], "formrecseq")}
  1214. , {col: "lastyn", type:"string", size:256, val:"Y"}]); // Y: 가장 최근 기록만 조회
  1215. var oParam = {};
  1216. oParam.id = "GetLastRecHist";
  1217. oParam.service = "medirecapp.ComnMediRec";
  1218. oParam.method = "reqGetRecHistList";
  1219. oParam.inds = "req=ds_temp_cond";
  1220. oParam.outds = "ds_compare=rechistlist";
  1221. oParam.async = false;
  1222. tranf_submit(oParam);
  1223. if(ds_compare.rowcount > 0){
  1224. var row = ds_temp_rechistlist.addRow();
  1225. ds_temp_rechistlist.setColumn(row, "rechistseq", ds_compare.getColumn(0, "rechistseq"));
  1226. ds_temp_rechistlist.setColumn(row, "updtdd", ds_compare.getColumn(0, "updtdd"));
  1227. ds_temp_rechistlist.setColumn(row, "updttm", ds_compare.getColumn(0, "updttm"));
  1228. }else{
  1229. sysf_messageBox("아래 기록의 작성이력이 없으므로 비교 불가합니다."
  1230. + ds_main_patreclist_patreclist.getColumn(aRows[i], "formrecdd") + " "
  1231. + ds_main_patreclist_patreclist.getColumn(aRows[i], "formrechm").substr(0, 2) + ":"
  1232. + ds_main_patreclist_patreclist.getColumn(aRows[i], "formrechm").substr(2, 2) + " "
  1233. + ds_main_patreclist_patreclist.getColumn(aRows[i], "formnm")
  1234. , "I");
  1235. return;
  1236. }
  1237. }
  1238. dsf_deleteDs("ds_compare");
  1239. lf_Compare_detail("grd_medireclist", "ds_temp_rechistlist", aRows);
  1240. }]]></Script>