SMMRD01200.js 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  1. /**
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 의료정보 - 챠트분석관리 ( SMMRD01200_챠트분석관리.xrw - JScript )
  4. - Version :
  5. 1) : Ver.1.00.01
  6. - Author : 박종훈
  7. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  8. **/
  9. /**
  10. * @ver : 2007/12/05 -> 2008/01/21
  11. * @desc : 화면초기화
  12. * @
  13. * @by : 박종훈 -> 이창록(수정)
  14. * @param :
  15. * @return :
  16. * @---------------------------------------------------
  17. */
  18. function fInitialize()
  19. {
  20. todd = getCurrentDate();
  21. var today = new Date();
  22. var frday = new Date();
  23. var diffdt = -1;
  24. model.removeNodeset("/root/main/list/chrtanaly/patlist");
  25. model.removeNodeset("/root/main/list/templist/dschpat");
  26. model.removeNodeset("/root/main/list/templist1/dschanaly");
  27. model.removeNodeset("/root/main/list/templist2/dschindxlist");
  28. model.removeNodeset("/root/main/list/templist3/dschunprep");
  29. fDisabled("dsch");
  30. frday = today.getAddDate(diffdt , "D");
  31. frdd = frday.getDateFormat();
  32. model.setValue("/root/cond/srchfrdd", frdd);
  33. model.setValue("/root/cond/srchtodd", todd);
  34. zsdfGetInOrdDeptList(getUserInfo("dutplceinstcd"), "/root/init/orddept", "depthngnm", "asc");//입원과
  35. mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/init/ward", "W"); //병동코드 콤보
  36. addComboInstance("/root/init/orddept" , "deptcd^depthngnm", "-^전체", "dept"); //부서콤보 전체항목 추가
  37. addComboInstance("/root/init/ward" , "deptcd^depthngnm", "-^전체", "dept"); //병동콤보 전체항목 추가
  38. addComboItem("cmb_medispc","전체", "-", "above"); //주치의 전체 추가
  39. cmb_medispc.value="-";
  40. model.setValue("/root/cond/orddeptcd", "-");
  41. model.setValue("/root/cond/ward", "-");
  42. model.removeNodeset("/root/temp/flag/excelflag");
  43. model.makeValue("/root/temp/flag/excelflag","2"); //각 그리드별 엑셀저장시 flag값 1:수거,2:분석,3:미반납건수현황
  44. btn_flag.dispatch("DOMActivate");
  45. //model.refresh();
  46. }
  47. /**
  48. * @ver : 2007-12-05
  49. * @desc : 진료과 선택시 주치의 명단 가져오기
  50. * @
  51. * @by : 이창록
  52. * @param :
  53. * @return :
  54. * @---------------------------------------------------
  55. */
  56. function fGetDrList(ref, rsltRef, orddeptcd, queryflag,stflag)
  57. {
  58. model.makeValue(ref + "/orddeptcd" , orddeptcd);
  59. model.makeValue(ref + "/queryflag" , queryflag);
  60. model.makeValue(ref + "/stflag" , stflag);//스태프구분
  61. submit("TRMRF02303", true, ref, rsltRef);
  62. model.removeNodeset("/root/send/reqdata");
  63. }
  64. /**
  65. * @ver : 2008/07/30
  66. * @desc : 진료과 선택시 분과정보 및 주치의조회(Staff만)
  67. * @ :
  68. * @by : 이창록
  69. * @param :
  70. * @return :
  71. * @---------------------------------------------------
  72. */
  73. function fChgUserListClsDept()
  74. {
  75. if(model.getValue("/root/temp/flag/excelflag")=="2"){
  76. model.removeNodeset("/root/init/clsdeptlist/dept");
  77. model.makeNode("/root/init/clsdeptlist/dept");
  78. zsdfGetInClsDeptList(getUserInfo("dutplceinstcd"), cmb_orddept.value, "/root/init/clsdeptlist", "depthngnm", "asc");//분과
  79. if( getNodesetCnt(model,"/root/init/clsdeptlist/dept/deptcd") > 0){
  80. model.removeNodeset("root/cond/clsdeptflag");
  81. model.makeValue("root/cond/clsdeptflag","Y");
  82. }else
  83. model.removeNodeset("root/cond/clsdeptflag");
  84. model.resetInstanceNode("/root/init/userlist/drlist");
  85. fGetDrList("/root/send/reqdata", "/root/init/userlist/drlist", cmb_orddept.value, "total","staff");//주치의 staff만 조회
  86. if(getNodesetCnt(model, "/root/init/userlist/drlist") > 0){
  87. if(model.getValue("/root/cond/orddeptcd")=="-"){
  88. model.setValue("/root/cond/atdoctid", model.getValue("/root/init/userlist/drlist/drid[1]"));
  89. cmb_medispc.refresh();
  90. }else
  91. model.setValue("/root/cond/atdoctid", model.getValue("/root/init/userlist/drlist/drid[1]"));
  92. }
  93. }else if(model.getValue("/root/temp/flag/excelflag")=="1"){
  94. model.removeNodeset("root/cond/clsdeptflag");
  95. model.removeNodeset("/root/init/clsdeptlist/dept");
  96. model.resetInstanceNode("/root/init/userlist/drlist");
  97. fGetDrList("/root/send/reqdata", "/root/init/userlist/drlist", cmb_orddept.value, "total","staff");//주치의 staff만 조회
  98. if(getNodesetCnt(model, "/root/init/userlist/drlist") > 0){
  99. model.setValue("/root/cond/atdoctid", model.getValue("/root/init/userlist/drlist/drid[1]"));
  100. cmb_medispc.refresh();
  101. }
  102. }
  103. model.refresh();
  104. }
  105. /**
  106. * @ver : 2007-12-06
  107. * @desc : 환자리스트 가져오기(수거,분석)
  108. * @
  109. * @by : 박종훈
  110. * @param :
  111. * @return :수정 이창록
  112. * @---------------------------------------------------
  113. */
  114. function fGetPatList()
  115. {
  116. var rem = model.getValue("/root/init/rem"); //수거
  117. var urem = model.getValue("/root/init/urem"); //미수거
  118. var indelyn=model.getValue("/root/cond/indelyn"); //입원 삭제
  119. var orddeptcd = model.getValue("/root/cond/orddeptcd");//진료과
  120. var clsdeptcd = model.getValue("/root/hidden/clsdeptcd");//분과
  121. var remyn = "";
  122. var sRemFlag = model.getValue("/root/cond/remanalyflag"); //수거,분석 구분
  123. if(sRemFlag == "rem"){
  124. model.removeNodeset("/root/main/list/chrtanaly/patlist");
  125. if(submit("TRMRD01201"))
  126. {
  127. grd_chrtanaly.rebuild();
  128. grd_chrtanaly.rebuildStyle();
  129. setRowStyle("grd_chrtanaly","4","Y","readprtflag","equal"); // 출력/미출력구분 RowStyle변경
  130. var Mflag = model.getValue("/root/hidden/mflag");
  131. if(Mflag=="1"){
  132. }else
  133. messageBox("검색이","I002");
  134. model.setValue("/root/search/srchcnt", grd_chrtanaly.rows - 1);//해당그리드의 건수 보여주기
  135. model.removeNodeset("/root/hidden/mflag");
  136. }
  137. }else{
  138. var reqflag = model.getValue("/root/init/reqflag");
  139. model.makeValue("/root/cond/reqflag",reqflag);
  140. reqflag = reqflag.substr(0,4);
  141. if( "dsch" == reqflag){
  142. model.removeNodeset("/root/main/list/templist");
  143. }else if( "anly" == reqflag){
  144. model.removeNodeset("/root/main/list/templist1");
  145. }else if( "indx" == reqflag){
  146. model.removeNodeset("/root/main/list/templist2");
  147. }else if( "unpr" == reqflag){
  148. model.removeNodeset("/root/main/list/templist3");
  149. }
  150. model.makeValue("/root/cond/cntflag",model.getValue("/root/init/remanalyflag/cntflag"));
  151. if(submit("TRMRD01202")==true)
  152. {
  153. if(reqflag=="dsch"){
  154. model.removeNodeset("root/search");
  155. model.makeNode("root/search");
  156. messageBox("검색이","I002");
  157. model.makeValue("/root/search/srchcnt" ,grd_dschpat.rows - 1);
  158. }else if(reqflag=="anly"){
  159. model.removeNodeset("root/search");
  160. model.makeNode("root/search");
  161. messageBox("검색이","I002");
  162. model.makeValue("/root/search/srchcnt" ,grd_dschanaly.rows - 1);
  163. }else if(reqflag=="indx"){
  164. model.removeNodeset("root/search");
  165. model.makeNode("root/search");
  166. messageBox("검색이","I002");
  167. model.makeValue("/root/search/srchcnt" ,grd_indxlist.rows - 1);
  168. }else if(reqflag == "unpr"){
  169. model.removeNodeset("root/search");
  170. model.makeNode("root/search");
  171. messageBox("검색이","I002");
  172. model.makeValue("/root/search/srchcnt" ,grd_unprep.rows - 1);
  173. }
  174. }
  175. }
  176. model.refresh();
  177. }
  178. /**
  179. * @ver : 2007-12-06
  180. * @desc : 저장
  181. * @
  182. * @by : 박종훈
  183. * @param :
  184. * @return :
  185. * @---------------------------------------------------
  186. */
  187. function fSave()
  188. {
  189. var sPid = model.getValue("/root/main/list/chrtanaly/patlist["+ grd_chrtanaly.row +"]/pid");
  190. if(sPid==""){
  191. messageBox("환자를 선택","I008");
  192. return;
  193. }
  194. var updateData = grd_chrtanaly.getUpdateData();
  195. model.makeValue("/root/hidden/mflag","1");
  196. model.makeValue("/root/send/reqdata/chrtanaly" , updateData);
  197. model.makeValue("/root/send/reqdata/idflag" , model.getValue("/root/cond/idflag"));
  198. model.makeValue("/root/send/reqdata/pid" , model.getValue("/root/cond/pid"));
  199. model.makeValue("/root/send/reqdata/srchfrdd" , model.getValue("/root/cond/srchfrdd"));
  200. model.makeValue("/root/send/reqdata/srchtodd" , model.getValue("/root/cond/srchtodd"));
  201. model.makeValue("/root/send/reqdata/orddeptcd" , model.getValue("/root/cond/orddeptcd"));
  202. model.makeValue("/root/send/reqdata/atdoctid" , model.getValue("/root/cond/atdoctid"));
  203. model.makeValue("/root/send/reqdata/ward" , model.getValue("/root/cond/ward"));
  204. model.makeValue("/root/send/reqdata/longinhosp" , model.getValue("/root/cond/longinhosp"));
  205. model.makeValue("/root/send/reqdata/remyn" , model.getValue("/root/cond/remyn"));
  206. model.makeValue("/root/send/reqdata/inhospdd" , model.getValue("/root/cond/inhospdd"));
  207. if(submit("TXMRD01201")==true){
  208. var Mflag = model.getValue("/root/hidden/mflag");
  209. if(Mflag=="1"){
  210. messageBox("저장이","I002");
  211. }
  212. }
  213. //저장한 후 다시 조회 하기 (이창록)수정
  214. model.removeNodeset("/root/temp/tmp/autoprtlist");
  215. model.makeValue("/root/cond/remanalyflag","dsch"); //수거,분석 구분
  216. fGetPatList();
  217. }
  218. /**
  219. * @ver : 2007-12-06
  220. * @desc : 퇴원 재원 조건에따른 저장버튼 disable 및 caption text 상태 변화
  221. * @ : 퇴원시->퇴원일자 .입원시-> 입원환자,수거시 ->수거일자
  222. * @
  223. * @by : 박종훈
  224. * @param : 수정(이창록)2008-02-11
  225. * @return :
  226. * @---------------------------------------------------
  227. */
  228. function fSaveDisable()
  229. {
  230. var idflag = model.getValue("/root/cond/idflag");
  231. if ( idflag== "I")
  232. {
  233. btn_save.disabled = true;
  234. cap_snm.text="재원기간";
  235. chk_rflag.disabled = true;
  236. chk_rflag.value="";
  237. grd_chrtanaly.colHidden(grd_chrtanaly.colRef("sixdethflag"))=true;
  238. }
  239. else if(idflag=="D")
  240. {
  241. btn_save.disabled = false;
  242. cap_snm.text="퇴원일자 :";
  243. chk_rflag.disabled = false;
  244. grd_chrtanaly.colHidden(grd_chrtanaly.colRef("sixdethflag"))=false;
  245. }
  246. }
  247. /**
  248. * @ver : 2007-12-06
  249. * @desc : 수거체크시 저장버튼 disable 및 caption text 상태 변화
  250. * @ :
  251. * @
  252. * @by : 박종훈
  253. * @param : 수정(이창록)2008-02-11,이창록 작업 flag 값 추가->2009-02-06
  254. * @return :
  255. * @---------------------------------------------------
  256. */
  257. function fRflagChg()
  258. {
  259. var rflag = model.getValue("/root/cond/rflag");
  260. var userflag = model.getValue("/root/cond/userflag");
  261. var Todd = getCurrentDate();
  262. if(rflag =="R")
  263. {
  264. //btn_save.disabled = true;
  265. model.setValue("/root/cond/srchfrdd", Todd);
  266. model.setValue("/root/cond/srchtodd", Todd);
  267. ipt_srchfrdd.refresh();
  268. ipt_srchtodd.refresh();
  269. cap_snm.text="수거일자 :";
  270. }else if(rflag =="")
  271. {
  272. //btn_save.disabled = false;
  273. var todd = getCurrentDate();
  274. var today = new Date();
  275. var frday = new Date();
  276. var diffdt = -1;
  277. frday = today.getAddDate(diffdt , "D");
  278. frdd = frday.getDateFormat();
  279. model.setValue("/root/cond/srchfrdd", frdd);
  280. model.setValue("/root/cond/srchtodd", todd);
  281. ipt_srchfrdd.refresh();
  282. ipt_srchtodd.refresh();
  283. fSaveDisable();
  284. }
  285. if(userflag=="dsch"){
  286. model.setValue("/root/cond/srchfrdd", Todd);
  287. model.setValue("/root/cond/srchtodd", Todd);
  288. ipt_srchfrdd.refresh();
  289. ipt_srchtodd.refresh();
  290. cap_snm.text="작업일자 :";
  291. }else if(userflag==""){
  292. var todd = getCurrentDate();
  293. var today = new Date();
  294. var frday = new Date();
  295. var diffdt = -1;
  296. frday = today.getAddDate(diffdt , "D");
  297. frdd = frday.getDateFormat();
  298. model.setValue("/root/cond/srchfrdd", frdd);
  299. model.setValue("/root/cond/srchtodd", todd);
  300. ipt_srchfrdd.refresh();
  301. ipt_srchtodd.refresh();
  302. fSaveDisable();
  303. }
  304. }
  305. /**
  306. * @ver : 2008/01/21
  307. * @desc : 차트분석 조회한 것을 엑셀에 저장
  308. * @
  309. * @by : 이창록
  310. * @param :(추가)
  311. * @return :
  312. * @---------------------------------------------------
  313. */
  314. function fChrtanalySaveExcel(){
  315. var excelflag = model.getValue("/root/temp/flag/excelflag");
  316. var reqflag = model.getValue("/root/init/reqflag");
  317. if(excelflag=="1"){
  318. var fileName = window.fileDialog("save", ",", false, "excel", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  319. if (fileName != ""){
  320. grd_chrtanaly.saveExcel(fileName, "SheetName", false, false, "", "", "false");
  321. }
  322. }else if(excelflag=="2"){
  323. if(reqflag=="dsch1"){
  324. var fileName = window.fileDialog("save", ",", false, "퇴원환자", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  325. if (fileName != ""){
  326. grd_dschpat.saveExcel(fileName, "SheetName", false, false, "", "", "false");
  327. }
  328. }else if(reqflag=="anly1"){
  329. var fileName = window.fileDialog("save", ",", false, "퇴원분석", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  330. if (fileName != ""){
  331. grd_dschanaly.saveExcel(fileName, "SheetName", false, false, "", "", "false");
  332. }
  333. }else if(reqflag=="anly2"){
  334. var fileName = window.fileDialog("save", ",", false, "미퇴원분석", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  335. if (fileName != ""){
  336. grd_dschanaly.saveExcel(fileName, "SheetName", false, false, "", "", "false");
  337. }
  338. }else if(reqflag=="indx1"){
  339. var fileName = window.fileDialog("save", ",", false, "코딩", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  340. if (fileName != ""){
  341. grd_indxlist.saveExcel(fileName, "SheetName", false, false, "", "", "false");
  342. }
  343. }else if(reqflag=="indx2"){
  344. var fileName = window.fileDialog("save", ",", false, "가코딩", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  345. if (fileName != ""){
  346. grd_indxlist.saveExcel(fileName, "SheetName", false, false, "", "", "false");
  347. }
  348. }else if(reqflag=="indx3"){
  349. var fileName = window.fileDialog("save", ",", false, "미코딩", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  350. if (fileName != ""){
  351. grd_indxlist.saveExcel(fileName, "SheetName", false, false, "", "", "false");
  352. }
  353. }else if(reqflag=="unpr"){
  354. var fileName = window.fileDialog("save", ",", false, "미비관리", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  355. if (fileName != ""){
  356. grd_unprep.saveExcel(fileName, "SheetName", false, false, "", "", "false");
  357. }
  358. }else if(reqflag=="indx4"){
  359. var fileName = window.fileDialog("save", ",", false, "재검토", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  360. if (fileName != ""){
  361. grd_indxlist.saveExcel(fileName, "SheetName", false, false, "", "", "false");
  362. }
  363. }
  364. }else if(excelflag=="3"){
  365. var UnrtnFlag =model.getValue("/root/cond/unrtnflag");
  366. if(UnrtnFlag=="wardunremcnt"){
  367. var fileName = window.fileDialog("save", ",", false, "병동별(미수거)", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  368. if (fileName != ""){
  369. grd_wardunremcntlist.saveExcel(fileName, "SheetName", true, true, "", "", "false");
  370. }
  371. }else if(UnrtnFlag=="deptunremcnt"){
  372. var fileName = window.fileDialog("save", ",", false, "진료과별(미수거)", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  373. if (fileName != ""){
  374. grd_deptunremcntlist.saveExcel(fileName, "SheetName", true, true, "", "", "false");
  375. }
  376. }else if(UnrtnFlag=="deptuntrncnt"){
  377. var fileName = window.fileDialog("save", ",", false, "진료과별미반납건수현황", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  378. if (fileName != ""){
  379. grd_deptunrtncntlist.saveExcel(fileName, "SheetName", true, true, "", "", "false");
  380. }
  381. }else if(UnrtnFlag == "warduntrncnt"){
  382. var fileName = window.fileDialog("save", ",", false, "병동별미반납건수현황", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  383. if (fileName != ""){
  384. grd_wardunrtncntlist.saveExcel(fileName, "SheetName", true, true, "", "", "false");
  385. }
  386. }
  387. }
  388. }
  389. /**
  390. * @ver : 2008/01/21
  391. * @desc : 등록번호로 차트분석을 조회(등록번호 앞에 0이 붙어도 앞에 0을 없애고 조회)
  392. * @ 예)00000098077755 - > 98077755 (getRemoveLeftChar)함수 사용
  393. * @by : 이창록
  394. * @param :(추가)
  395. * @return :
  396. * @---------------------------------------------------
  397. */
  398. function fPidKeyPress()
  399. {
  400. var Pid = model.getValue("/root/cond/pid");
  401. var str_pid = Pid;
  402. if ( getUserInfo("dutplceinstcd") != "017" ) //20091031, hkjoo 추가
  403. str_pid = getRemoveLeftChar(Pid, '0');
  404. if(model.getValue("/root/cond/checknum/value") == "true"){
  405. str_pid = getCretCheckNo(str_pid, getUserInfo("dutplceinstcd"));
  406. } else {
  407. str_pid = model.getValue("/root/cond/pid");
  408. }
  409. model.setValue("/root/cond/pid",str_pid);
  410. fGetPatList();
  411. }
  412. /**
  413. * @ver : 2008/01/21
  414. * @desc : 장기재원일수 선택시 input disable 및 값 없애기
  415. * @
  416. * @by : 이창록
  417. * @param :(추가)
  418. * @return :
  419. * @---------------------------------------------------
  420. */
  421. function fChgInhospdd()
  422. {
  423. var xCondpath ="/root/cond";
  424. var longinhosp=model.getValue("/root/cond/longinhosp");
  425. if(longinhosp=="H")
  426. {
  427. ipt_inhospdd.disabled=false;
  428. }else if(longinhosp==false)
  429. {
  430. ipt_inhospdd.disabled=true;
  431. ipt_inhospdd.value="";
  432. }
  433. }
  434. /**
  435. * @ver : 2008/01/21
  436. * @desc : 삭제시 수거랑 같이 체크 ,미반납시 수거 상태 풀기
  437. * @
  438. * @by : 이창록(추가)
  439. * @param :
  440. * @return :
  441. * @---------------------------------------------------
  442. */
  443. function fChgUnrtnyn()
  444. {
  445. if(grd_chrtanaly.isCell(event.target) && grd_chrtanaly.mouserow >= grd_chrtanaly.fixedrows)
  446. var iRow = grd_chrtanaly.row - grd_chrtanaly.fixedRows + 1;
  447. var remyn = model.getValue("/root/main/list/chrtanaly/patlist[" + iRow + "]/remyn"); //수거
  448. var delyn = model.getValue("/root/main/list/chrtanaly/patlist[" + iRow + "]/delyn"); //삭제
  449. var unrtnyn = model.getValue("/root/main/list/chrtanaly/patlist[" + iRow + "]/unrtnyn"); //미반납
  450. if(unrtnyn == "N")
  451. {
  452. if(delyn=="N")
  453. {
  454. //alert(remyn);
  455. if((remyn == "Y")&&(delyn == "N"))
  456. {
  457. model.setValue("/root/main/list/chrtanaly/patlist[" + iRow + "]/remyn", "Y");
  458. } else {
  459. model.setValue("/root/main/list/chrtanaly/patlist[" + iRow + "]/remyn", "N");
  460. grd_chrtanaly.refresh();
  461. return;
  462. }
  463. } else if(delyn=="Y"){
  464. model.setValue("/root/main/list/chrtanaly/patlist[" + iRow + "]/remyn", "Y");
  465. grd_chrtanaly.refresh();
  466. return;
  467. }
  468. }
  469. }
  470. /**
  471. * @desc : 사용자 정보 얻기(사용자 팝업 연계)
  472. * @id : 안종수(추가)
  473. * @event : xforms-select()
  474. * @return : void
  475. * @authur :
  476. */
  477. function fGetUserInfo(userid,usernm,deptcd ,instcd){
  478. model.makeValue("/root/temp/userinfo/userid", userid);
  479. model.makeValue("/root/temp/userinfo/usernm", usernm.getTrim());
  480. model.makeValue("/root/temp/userinfo/deptcd", deptcd);
  481. model.makeValue("/root/temp/userinfo/instcd", instcd);
  482. model.makeValue("/root/temp/userinfo/userid", userid);
  483. model.makeValue("/root/temp/userinfo/usernm", usernm.getTrim());
  484. model.makeValue("/root/temp/userinfo/deptcd", deptcd);
  485. model.makeValue("/root/temp/userinfo/instcd", instcd);
  486. }
  487. /**
  488. * @desc : 수거시 입퇴원요약지,수술기록지 출력
  489. * @by : 이창록(추가)
  490. * @id : E->EMR차트 ,I->영상차트
  491. * @event : xforms-onmousedown
  492. * @return : void
  493. * @authur :
  494. */
  495. function fMouseRightchrt(){
  496. if(event.button == 3){
  497. window.setPopupMenu(true, "/root/hidden/menu/chrtanaly", "label", "func", false);
  498. return;
  499. }
  500. }
  501. //입퇴원요약지
  502. function fPrint_Chrt()
  503. {
  504. model.makeNode("/root/temp/keyinfo/keylist");
  505. var iRow = grd_chrtanaly.row - grd_chrtanaly.fixedRows + 1;
  506. var removedd = model.getValue("/root/main/list/chrtanaly/patlist["+iRow+"]/removedd");
  507. var remyn = model.getValue("/root/main/list/chrtanaly/patlist["+iRow+"]/remyn");
  508. if(iRow < 1){
  509. return;
  510. }
  511. if((remyn=="N")&&(removedd=='-')){
  512. messageBox("차트수거된 환자만 출력이","I006");
  513. return;
  514. }
  515. var msg = "";
  516. var Pid = model.getValue("/root/init/tmp/pid");
  517. var indd = model.getValue("/root/init/tmp/indd");
  518. var cretno = model.getValue("/root/init/tmp/cretno");
  519. clearParameter("SPMRI02400_prtrecinfo");
  520. model.removeNodeset("/root/send/reqdata");
  521. model.makeValue("/root/send/reqdata/pid" ,Pid);
  522. model.makeValue("/root/send/reqdata/indd" ,indd);
  523. model.makeValue("/root/send/reqdata/cretno" ,cretno);
  524. model.makeValue("/root/send/reqdata/formflag","S");
  525. submit("TRMRD01203")
  526. var Chrtflag = model.getValue("/root/temp/keyinfo/keylist/chrtflag");
  527. var sFormcd = model.getValue("/root/temp/keyinfo/keylist/formcd");
  528. if(Chrtflag =="E"){
  529. msg = Chrtflag + "▦" + model.getValue("/root/temp/keyinfo/keylist/signno") + "▦"+sFormcd+"▩";
  530. setParameter("SPMRI02400_prtrecinfo", msg); //oldflag▦signno▦formcd▩//통합기록출력창 파라미터
  531. modal("SPMRI02400");
  532. }else{
  533. messageBox("입퇴원요약기록이","I004");
  534. return;
  535. }
  536. model.removeNodeset("/root/temp/keyinfo/keylist");
  537. }
  538. //수술기록지
  539. function fPrint_OpChrt()
  540. {
  541. model.makeNode("/root/temp/keyinfo/keylist");
  542. var iRow = grd_chrtanaly.row - grd_chrtanaly.fixedRows + 1;
  543. var Pid = model.getValue("/root/init/tmp/pid");
  544. var indd = model.getValue("/root/init/tmp/indd");
  545. var cretno = model.getValue("/root/init/tmp/cretno");
  546. var remyn = model.getValue("/root/main/list/chrtanaly/patlist["+iRow+"]/remyn");
  547. var removedd = model.getValue("/root/main/list/chrtanaly/patlist["+iRow+"]/removedd");
  548. var msg = "";
  549. if(iRow < 1){
  550. return;
  551. }
  552. if((remyn=="N")&&(removedd=='-')){
  553. messageBox("차트수거된 환자만 출력이","I006");
  554. return;
  555. }
  556. clearParameter("SPMRI02400_prtrecinfo");
  557. model.removeNodeset("/root/send/reqdata");
  558. model.makeValue("/root/send/reqdata/pid" ,Pid);
  559. model.makeValue("/root/send/reqdata/indd" ,indd);
  560. model.makeValue("/root/send/reqdata/cretno" ,cretno);
  561. model.makeValue("/root/send/reqdata/formflag","P");
  562. submit("TRMRD01203")
  563. var opflag = model.getValue("/root/temp/keyinfo/keylist/opflag");
  564. var opFormcd = model.getValue("/root/temp/keyinfo/keylist/formcd");
  565. if(opflag == "E"){
  566. msg = opflag + "▦" + model.getValue("/root/temp/keyinfo/keylist/opsignno") +"▦"+opFormcd+"▩";
  567. setParameter("SPMRI02400_prtrecinfo", msg); //oldflag▦opsignno▦formcd▩//통합기록출력창 파라미터
  568. modal("SPMRI02400");
  569. }else if(opflag ==""){
  570. messageBox("수술기록이","I004");
  571. return;
  572. }
  573. model.removeNodeset("/root/temp/keyinfo/keylist");
  574. }
  575. /**
  576. * @desc : 그리드에서 선택한 환자정보 가져오기
  577. * @by : 이창록(추가)2008-09-17
  578. * @id :
  579. * @event : DOMActivate
  580. * @return : void
  581. * @authur :
  582. */
  583. function fSelectPatInfo(flag)
  584. {
  585. model.removeNodeset("/root/init/tmp");
  586. model.makeNode("/root/init/tmp");
  587. if(flag=="rem"){
  588. var dschdt =model.getValue("/root/main/list/chrtanaly/patlist["+ grd_chrtanaly.row +"]/dschdt")
  589. var dschdd = dschdt.substring(0,8);
  590. if(grd_chrtanaly.isCell(event.target) && grd_chrtanaly.mouserow >= grd_chrtanaly.fixedrows){//그리드에서 데이타영역만 선택
  591. model.makeValue("/root/init/tmp/pid" ,model.getValue("/root/main/list/chrtanaly/patlist["+ grd_chrtanaly.row +"]/pid"));
  592. //이창록 수정20090211 indd ->orgindd
  593. model.makeValue("/root/init/tmp/indd" ,model.getValue("/root/main/list/chrtanaly/patlist["+ grd_chrtanaly.row +"]/orgindd"));
  594. model.makeValue("/root/init/tmp/cretno" ,model.getValue("/root/main/list/chrtanaly/patlist["+ grd_chrtanaly.row +"]/cretno"));
  595. model.makeValue("/root/init/tmp/dschdd" ,dschdd);
  596. }
  597. }else if(flag=="dsch1"){
  598. if(grd_dschpat.isCell(event.target) && grd_dschpat.mouserow >= grd_dschpat.fixedrows) {//그리드에서 데이타영역만 선택
  599. var dschdt =model.getValue("/root/main/list/templist/dschpat["+ grd_dschpat.row +"]/dschdt")
  600. var dschdd = dschdt.substring(0,8);
  601. model.makeValue("/root/init/tmp/pid" ,model.getValue("/root/main/list/templist/dschpat["+ grd_dschpat.row +"]/pid"));
  602. model.makeValue("/root/init/tmp/indd ",model.getValue("/root/main/list/templist/dschpat["+ grd_dschpat.row +"]/indd"));
  603. model.makeValue("/root/init/tmp/dschdd" ,dschdd);
  604. }
  605. }else if(flag=="analy"){
  606. if(grd_dschanaly.isCell(event.target) && grd_dschanaly.mouserow >= grd_dschanaly.fixedrows) {//그리드에서 데이타영역만 선택
  607. model.makeValue("/root/init/tmp/pid" ,grd_dschanaly.valueMatrix(grd_dschanaly.row,grd_dschanaly.colRef("pid")));
  608. model.makeValue("/root/init/tmp/indd" ,grd_dschanaly.valueMatrix(grd_dschanaly.row,grd_dschanaly.colRef("indd")));
  609. model.makeValue("/root/init/tmp/dschdd",grd_dschanaly.valueMatrix(grd_dschanaly.row,grd_dschanaly.colRef("dschdt")).substring(0,8));
  610. }
  611. }else if(flag=="indx"){
  612. if(grd_indxlist.isCell(event.target) && grd_indxlist.mouserow >= grd_indxlist.fixedrows) {//그리드에서 데이타영역만 선택
  613. model.makeValue("/root/init/tmp/pid" ,grd_indxlist.valueMatrix(grd_indxlist.row,grd_indxlist.colRef("pid")));
  614. model.makeValue("/root/init/tmp/indd" ,grd_indxlist.valueMatrix(grd_indxlist.row,grd_indxlist.colRef("indd")));
  615. model.makeValue("/root/init/tmp/dschdd" ,grd_indxlist.valueMatrix(grd_indxlist.row,grd_indxlist.colRef("dschdt")).substring(0,8));
  616. }
  617. }else if(flag=="unpr"){
  618. if(grd_unprep.isCell(event.target) && grd_unprep.mouserow >= grd_unprep.fixedrows) {//그리드에서 데이타영역만 선택
  619. model.makeValue("/root/init/tmp/pid" ,grd_unprep.valueMatrix(grd_unprep.row,grd_unprep.colRef("pid")));
  620. model.makeValue("/root/init/tmp/indd" ,grd_unprep.valueMatrix(grd_unprep.row,grd_unprep.colRef("indd")));
  621. model.makeValue("/root/init/tmp/dschdd" ,grd_unprep.valueMatrix(grd_unprep.row,grd_unprep.colRef("dschdd")));
  622. }
  623. }
  624. model.refresh();
  625. }
  626. /**
  627. * @desc : 미반납건수현황조회(통계)
  628. * @by : 이창록(추가)
  629. * @id :
  630. * @event : DOMActivate
  631. * @return : void
  632. * @authur :
  633. */
  634. function fChrtUnrtnRemCntPresCondList()
  635. {
  636. var UnrtnFlag =model.getValue("/root/cond/unrtnflag");
  637. if(UnrtnFlag=="wardunremcnt"){
  638. model.removeNodeset("/root/main/chrtunrtnlist1/wardunremcntlist");
  639. }else if(UnrtnFlag=="deptunremcnt"){
  640. model.removeNodeset("/root/main/chrtunrtnlist2/deptunremcntlist");
  641. }else if(UnrtnFlag=="deptuntrncnt"){
  642. model.removeNodeset("/root/main/chrtunrtnlist3/deptunrtncntlist");
  643. }else if(UnrtnFlag=="warduntrncnt"){
  644. model.removeNodeset("/root/main/chrtunrtnlist4/wardunrtncntlist");
  645. }
  646. model.makeValue("/root/send/reqdata/unrtnflag" ,model.getValue("/root/cond/unrtnflag"));
  647. model.makeValue("/root/send/reqdata/srchfrdd" ,model.getValue("/root/cond/srchfrdd"));
  648. model.makeValue("/root/send/reqdata/srchtodd" ,model.getValue("/root/cond/srchtodd"));
  649. if(submit("TRMRD01204")){
  650. if(UnrtnFlag=="wardunremcnt"){
  651. var wumRow = grd_wardunremcntlist.rows-1;
  652. model.removeNodeset("root/search");
  653. model.makeNode("root/search");
  654. messageBox("검색이","I002");
  655. model.makeValue("/root/search/srchcnt" ,wumRow);
  656. }else if(UnrtnFlag=="deptunremcnt"){
  657. var durRow = grd_deptunremcntlist.rows-1;
  658. model.removeNodeset("root/search");
  659. model.makeNode("root/search");
  660. messageBox("검색이","I002");
  661. model.makeValue("/root/search/srchcnt" ,durRow);
  662. }else if(UnrtnFlag=="deptuntrncnt"){
  663. var dutRow = grd_deptunrtncntlist.rows-1;
  664. model.removeNodeset("root/search");
  665. model.makeNode("root/search");
  666. messageBox("검색이","I002");
  667. model.makeValue("/root/search/srchcnt" ,dutRow);
  668. }else if(UnrtnFlag == "warduntrncnt"){
  669. var wutRow = grd_wardunrtncntlist.rows-1;
  670. model.removeNodeset("root/search");
  671. model.makeNode("root/search");
  672. messageBox("검색이","I002");
  673. model.makeValue("/root/search/srchcnt" ,wutRow);
  674. }
  675. }
  676. model.refresh();
  677. }
  678. /**
  679. * @desc : 탭별조회조건 visble flag값 ->rem->수거,dsch->분석,unrtn->미반납 건수
  680. * @by : 이창록(추가)
  681. * @id :
  682. * @event : DOMActivate
  683. * @return : void
  684. * @authur :
  685. */
  686. function fDisabled(flag){
  687. if(flag=="rem"){
  688. btn_save.disabled =false;
  689. cap_indschflag.visible =true;
  690. rdo_ioflag.visible =true;
  691. chk_rflag.visible =true;
  692. chk_userflag.visible =false;
  693. cap_pid.visible =true;
  694. ipt_pid.visible =true;
  695. chb_value.visible =true;
  696. btn_srchpid.visible =true;
  697. cap_dept.visible =true;
  698. cap_dept.value ="진 료 과 :";
  699. cmb_orddept.visible =true;
  700. cap_medispc.visible =true;
  701. cmb_medispc.visible =true;
  702. cap_ward.visible =true;
  703. cbo_ward.visible =true;
  704. cap_user.visible =false;
  705. ipt_unprepdrnm.visible =false;
  706. cap_remyn.visible =true;
  707. cap_remyn.attribute("top") =220;
  708. rdo_remyn.visible =true;
  709. rdo_remyn.attribute("top") =220;
  710. cap_reqflag.visible =false;
  711. rdo_reqflag.visible =false;
  712. chk_longinhosp.visible =true;
  713. ipt_inhospdd.visible =true;
  714. btn_r_chrtmovelist.visible =true;
  715. cap_unrtnflag.visible =false;
  716. rdo_unrtnflag.visible =false;
  717. btn_chrtuncntprescond.visible =false;
  718. btn_patdinfo.disabled =false;
  719. btn_search.disabled =false;
  720. btn_dsch.disabled =false;
  721. btn_indx.disabled =false;
  722. btn_unprep.disabled =false;
  723. btn_cncr.disabled =false;
  724. btn_save.visible =true;
  725. btn_excel.attribute("left") =1097;
  726. btn_cncr.attribute("left") =1041;
  727. btn_unprep.attribute("left") =974;
  728. btn_indx.attribute("left") =875;
  729. btn_dsch.attribute("left") =808;
  730. btn_search.attribute("left") =719;
  731. }else if(flag=="dsch"){
  732. cap_indschflag.visible =true;
  733. rdo_ioflag.visible =true;
  734. chk_rflag.visible =false;
  735. chk_userflag.visible =true;
  736. cap_pid.visible =true;
  737. ipt_pid.visible =true;
  738. chb_value.visible =true;
  739. btn_srchpid.visible =true;
  740. cap_dept.visible =true;
  741. cap_dept.value ="퇴 원 과 :";
  742. cmb_orddept.visible =true;
  743. cap_medispc.visible =true;
  744. cmb_medispc.visible =true;
  745. cap_ward.visible =true;
  746. cbo_ward.visible =true;
  747. cap_user.visible =true;
  748. ipt_unprepdrnm.visible =true;
  749. cap_remyn.visible =false;
  750. rdo_remyn.visible =false;
  751. cap_reqflag.visible =true;
  752. cap_reqflag.attribute("top") =255;
  753. rdo_reqflag.visible =true;
  754. rdo_reqflag.attribute("top") =255;
  755. chk_longinhosp.visible =true;
  756. ipt_inhospdd.visible =true;
  757. btn_r_chrtmovelist.visible =true;
  758. cap_unrtnflag.visible =false;
  759. rdo_unrtnflag.visible =false;
  760. btn_chrtuncntprescond.visible =false;
  761. btn_patdinfo.disabled =false;
  762. btn_search.disabled =false;
  763. btn_dsch.disabled =false;
  764. btn_indx.disabled =false;
  765. btn_unprep.disabled =false;
  766. btn_cncr.disabled =false;
  767. btn_save.visible =false;
  768. btn_excel.attribute("left") =1152;
  769. btn_cncr.attribute("left") =1090;
  770. btn_unprep.attribute("left") =1028;
  771. btn_indx.attribute("left") =932;
  772. btn_dsch.attribute("left") =867;
  773. btn_search.attribute("left") =780;
  774. }else if(flag=="unrtn"){
  775. cap_indschflag.visible =false;
  776. rdo_ioflag.visible =false;
  777. chk_rflag.visible =false;
  778. chk_userflag.visible =false;
  779. cap_pid.visible =false;
  780. ipt_pid.visible =false;
  781. chb_value.visible =false;
  782. btn_srchpid.visible =false;
  783. cap_dept.visible =false;
  784. cmb_orddept.visible =false;
  785. cap_medispc.visible =false;
  786. cmb_medispc.visible =false;
  787. cap_ward.visible =false;
  788. cbo_ward.visible =false;
  789. cap_user.visible =false;
  790. cap_remyn.visible =false;
  791. ipt_unprepdrnm.visible =false;
  792. rdo_remyn.visible =false;
  793. cap_reqflag.visible =false;
  794. rdo_reqflag.visible =false;
  795. chk_longinhosp.visible =false;
  796. ipt_inhospdd.visible =false;
  797. btn_r_chrtmovelist.visible =false;
  798. cap_unrtnflag.visible =true;
  799. rdo_unrtnflag.visible =true;
  800. btn_chrtuncntprescond.visible =true;
  801. btn_chrtuncntprescond.visible =true;
  802. btn_chrtuncntprescond.attribute("top")=439;
  803. btn_patdinfo.disabled =true;
  804. btn_search.disabled =true;
  805. btn_dsch.disabled =true;
  806. btn_indx.disabled =true;
  807. btn_unprep.disabled =true;
  808. btn_cncr.disabled =true;
  809. btn_save.visible =false;
  810. btn_excel.attribute("left") =1152;
  811. btn_cncr.attribute("left") =1090;
  812. btn_unprep.attribute("left") =1028;
  813. btn_indx.attribute("left") =932;
  814. btn_dsch.attribute("left") =867;
  815. btn_search.attribute("left") =780;
  816. }
  817. model.refresh();
  818. }