SMMNO01800.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. /*
  2. 외래진료예약 환자 조회(SMMNO01800.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var xOutRsrvPatListPath = "/root/main/outrsrvpatlist";
  7. var xOutRsrvPatCodeListPath = "/root/main/outrsrvpatcodelist";
  8. var MDdeptcd; // 내과부서코드_20090423
  9. var uijeongbuinstcd="", sunggainstcd="", vincentinstcd="", yeuidoinstcd=""; // 의정부성모,부천성가, 성빈센트병원기관코드_20090606, 여의도_20100219_SMY
  10. var seoulinstcd=""; //서울성모기관코드 추가-20090811-kys
  11. var tdayAcptYN = "N"; // 외래진료예약 시 당일접수환자포함 조회 병원 (2009.06.23 JJE)
  12. /**
  13. * @group :
  14. * @ver : 2007.09.17
  15. * @by : 문창곤
  16. * @---------------------------------------------------
  17. * @type : function
  18. * @access : public
  19. * @desc : 화면 초기화
  20. * @param :
  21. * @return :
  22. * @---------------------------------------------------
  23. */
  24. function fInitialize(){
  25. //오늘 날짜로 초기화 하는 부분.(진료일자를 default로 오늘 날짜로 선택함)
  26. var dt = getCurrentDate();
  27. model.removenode("/root/main/outrsrvpatlist");
  28. model.refresh();
  29. //model.removeNodeset(xOutRsrvPatListPath);
  30. model.setValue("/root/main/cond/ordfromdd", dt);
  31. model.setValue("/root/main/cond/ordtodd", dt);
  32. var instcd = getUserInfo("dutplceinstcd");
  33. var standard_yn = "rcptuseyn";
  34. var ord_deptflag = 'X';
  35. var rslt_ref = "/root/init/orddept";
  36. var sort_field = "depthngnm";
  37. var sort_method = "asc";
  38. var dt = getCurrentDate();
  39. // 간호외래진료부서콤보 (특정하위부서를 포함- 분만실, 육아상담실, 인공신장실)
  40. zsdfGetCareOutOrderDepartmentList(instcd, rslt_ref, dt);
  41. addComboInstance("/root/init/orddept", "deptcd^depthngnm", "0000000000^전체진료과", "dept"); //진료부서 콤보 전체추가
  42. model.resetInstanceNode("/root/main/cond/orddept");
  43. // 공통코드 스크립트 호출
  44. zbcfGetCodeList( new Array("Z0008"), new Array("/root/init/comcd"));
  45. var dutplcecd = getUserInfo("dutplcecd"); // 근무지부서코드
  46. var suporddeptcd = getUserInfo("ordsupdeptcd");
  47. if (dutplcecd != "") {
  48. model.setValue("/root/main/cond/orddeptcd", dutplcecd); // 근무지부서코드
  49. fDeptDoctSearch(); // 의사리스트조회
  50. }
  51. // 간호 환경설정테이블 조회
  52. var pCode = "'065', '077', '107'"; // 조회할 CdGrupID 코드정보
  53. var pDate = getCurrentDate(); //조회기준일자
  54. fGetNursHardCdInfo(pCode, pDate);
  55. for(var i=1; i<=getNodesetCount("/root/code/codeinfo/codelist"); i++){
  56. switch (model.getValue("/root/code/codeinfo/codelist["+i+"]/cdgrupid")){
  57. case "065": // 내과
  58. MDdeptcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
  59. break;
  60. case "077": // 의정부성모병원기관코드_20090606
  61. switch(model.getValue("/root/code/codeinfo/codelist["+i+"]/supcdid")){
  62. case "01": // (01:서울성모,02:의정부성모,03:부천성가, 04:성빈센트)-20090811
  63. seoulinstcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
  64. break;
  65. case "02": // (01:서울성모,02:의정부성모,03:부천성가, 04:성빈센트)
  66. uijeongbuinstcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
  67. break;
  68. case "03": // (01:서울성모,02:의정부성모,03:부천성가, 04:성빈센트)
  69. sunggainstcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
  70. break;
  71. case "04": // (01:서울성모,02:의정부성모,03:부천성가, 04:성빈센트)
  72. vincentinstcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
  73. break;
  74. case "05": // (01:서울성모,02:의정부성모,03:부천성가, 04:성빈센트, 05:여의도성모)
  75. yeuidoinstcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
  76. break;
  77. }
  78. case "107": // 외래진료예약 시 당일접수환자포함 조회 병원 (2009.06.23 JJE)
  79. if( model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid") == getUserInfo("dutplceinstcd") )
  80. tdayAcptYN = "Y";
  81. break;
  82. }
  83. }
  84. //출력방식,출력용도 병원전체적용으로 변경_20100127_SMY
  85. /*
  86. // 의정부성모병원의 경우 출력용도의 게시판부착용에 오전(~12:00),오후(12:01~),전체 구분하여 출력 할 수 있도록 변경함_의정부 이혜민ITC(20090606)
  87. if((getUserInfo("dutplceinstcd") == uijeongbuinstcd) || (getUserInfo("dutplceinstcd") == sunggainstcd) || (getUserInfo("dutplceinstcd") == vincentinstcd) ){
  88. rdo_prntstat.visible = false;
  89. rdo_prntstat013.visible = true;
  90. }else{
  91. rdo_prntstat.visible = true;
  92. rdo_prntstat013.visible = false;
  93. }
  94. */
  95. // 성가, 의정부, 성빈센트병원 요청: 출력용도에 [당일접수포함] 선택, 당일접수포함 선택후 출력용도 선택시에는 당일접수환자 포함하여 게시판용,업무용의 명단이 출력되도록 해야 함 (2009.06.23 JJE)
  96. model.setValue("/root/main/cond/gettdayacptyn", tdayAcptYN);
  97. if(tdayAcptYN == "Y" ){
  98. bol_tdayacptyn.visible = true;
  99. cap_tdayacptyn.visible = true;
  100. }else{
  101. bol_tdayacptyn.visible = false;
  102. cap_tdayacptyn.visible = false;
  103. }
  104. model.refresh();
  105. }
  106. /**
  107. * @group :
  108. * @ver : 2007.09.17
  109. * @by : 문창곤
  110. * @---------------------------------------------------
  111. * @type : function
  112. * @access : public
  113. * @desc : 진료과의 의사 조회
  114. * @param :
  115. * @return :
  116. * @---------------------------------------------------
  117. */
  118. function fDeptDoctSearch(typegubn){
  119. cmb_orddr.disabled = false;
  120. model.removenode("/root/main/outrsrvpatlist");
  121. model.refresh();
  122. if(model.getValue("/root/main/cond/orddeptcd") == "0000000000" && model.getValue("/root/main/cond/pid") == "") {
  123. //messageBox("전체진료과는 현재 조회할 수 없습니다", "E");
  124. // return;
  125. }
  126. model.makeValue("/root/send/cond/ordfromdd", model.getValue("/root/main/cond/ordtodd"));
  127. model.makeValue("/root/send/reqdata/orddd", model.getValue("/root/main/cond/ordfromdd"));
  128. model.makeValue("/root/send/reqdata/orddeptcd", model.getValue("/root/main/cond/orddeptcd"));
  129. model.makeValue("/root/send/reqdata/prcpspecflag", model.getValue("/root/main/cond/prcpspecflag"));
  130. var sordclsdeptflag = model.getValue("/root/init/orddept/dept[deptcd = '"+model.getValue("/root/main/cond/orddeptcd")+"']/ordclsdeptflag"); // 센터/대표/분과/서브 구분
  131. var ssupdeptcd = model.getValue("/root/init/orddept/dept[deptcd = '"+model.getValue("/root/main/cond/orddeptcd")+"']/supdeptcd"); // 상위부서코드
  132. var sorddeptkind = model.getValue("/root/init/orddept/dept[deptcd = '"+model.getValue("/root/main/cond/orddeptcd")+"']/orddeptkind"); // 센터/대표 구분
  133. var sorddeptflag = "";
  134. if (sorddeptkind == "C") { // 센터이면
  135. sorddeptflag = "C";
  136. //} else if (sorddeptkind != "C" && sordclsdeptflag == "A") { // 센터가 아니면서 분과이면
  137. // sorddeptflag = "A";
  138. } else { // 그외에 기타과
  139. sorddeptflag = "etc";
  140. }
  141. model.setValue("/root/main/cond/ordclsdeptflag",sorddeptflag);
  142. model.setValue("/root/main/cond/supdeptcd",ssupdeptcd);
  143. model.makeValue("/root/send/reqdata/ordclsdeptflag", model.getValue("/root/main/cond/ordclsdeptflag"));
  144. model.makeValue("/root/send/reqdata/supdeptcd", model.getValue("/root/main/cond/supdeptcd"));
  145. submit("TRMNO00104");
  146. if(getNodesetCount("/root/init/orddr/orddr") > 0){
  147. for(var i = 0; i < grd_OutRsrvPatList.cols;i++) {
  148. grd_OutRsrvPatList.colsort(i) = "asc";
  149. }
  150. //addComboInstance("/root/init/orddr", "userid^usernm", "00000000^전체의사", "orddr"); //진료의콤보 전체추가
  151. addComboInstance("/root/init/orddr", "userid^userdepthngnm", "00000000^전체의사", "orddr"); //진료의콤보 전체추가
  152. model.resetInstanceNode("/root/main/cond/orddr");
  153. } else {
  154. model.makenode("/root/init/orddr");
  155. model.makenode("/root/init/orddr/orddr");
  156. model.makenode("/root/init/orddr/orddr/userid");
  157. model.makenode("/root/init/orddr/orddr/usernm");
  158. //addComboInstance("/root/init/orddr", "userid^usernm", "00000000^전체의사", "orddr"); //진료의콤보 전체추가
  159. addComboInstance("/root/init/orddr", "userid^userdepthngnm", "00000000^전체의사", "orddr"); //진료의콤보 전체추가
  160. cmb_orddr.select(0);
  161. }
  162. model.setValue("/root/main/cond/orddeptnm", cmb_orddept.label);
  163. cmb_orddr.refresh();
  164. }
  165. /**
  166. * @group :
  167. * @ver : 2007.09.17
  168. * @by : 문창곤
  169. * @---------------------------------------------------
  170. * @type : function
  171. * @access : public
  172. * @desc : 외래진료예약 환자 조회
  173. * @param :
  174. * @return :
  175. * @---------------------------------------------------
  176. */
  177. function fBtnRefClicked(prntyn){
  178. group2.attribute("visibility") = "hidden"; //20100202-kys-추가
  179. //model.removeNodeset("/root/main/outrsrvpatlist/outrsrvpatinfo");
  180. model.removenode("/root/main/outrsrvpatlist");
  181. model.refresh();
  182. var sorddept = model.getValue("/root/main/cond/orddeptcd");
  183. var sorddr = model.getValue("/root/main/cond/orddr");
  184. var pid = model.getValue("/root/main/cond/pid");
  185. var rsrvflag7 = model.getValue("/root/main/cond/rsrvflag7"); // 기타포함 조회여부_20090312(ByJA)
  186. var fromDate = model.getValue("/root/main/cond/ordfromdd"); // fromdd
  187. var endDate = model.getValue("/root/main/cond/ordtodd"); // todd
  188. var sdaycnt = getDateInterval(fromDate, endDate); // todd - fromdd 일수계산
  189. //alert(sdaycnt);
  190. if(cmb_orddept.value == "") {
  191. messageBox("진료과를 선택하지 ","E007");
  192. return;
  193. }
  194. // 1. 기타포함 조회는 해당진료과,진료일자 하루로 제한_20090312(ByJA)
  195. if(rsrvflag7 == "Y" && (sorddept == "0000000000" || sdaycnt != 0)){
  196. messageBox("[기타포함]조회는 해당진료과,진료일자 하루만 가능합니다.", "E");
  197. model.setValue("/root/main/cond/ordfromdd", getCurrentDate());
  198. model.setValue("/root/main/cond/ordtodd" , getCurrentDate());
  199. model.setFocus("cmb_orddept");
  200. model.refresh();
  201. return;
  202. }
  203. // 2. 전체진료과, 전체의사 일경우는 조회일자 하루로 제한
  204. if (sorddept == "0000000000" && sorddr == "00000000" && pid == "" && sdaycnt != 0) {
  205. messageBox("전체진료과/전체의사 조회는 조회일자가 하루만 가능합니다.", "E");
  206. //model.removeNodeset("/root/main/outrsrvpatlist/outrsrvpatinfo");
  207. //model.removenode("/root/main/outrsrvpatlist");
  208. //model.makeValue("/root/main/outrsrvpatlist","");
  209. //model.refresh();
  210. model.setValue("/root/main/cond/ordfromdd", getCurrentDate());
  211. model.setValue("/root/main/cond/ordtodd", getCurrentDate());
  212. model.refresh();
  213. return;
  214. }
  215. model.makenode("/root/send/req");
  216. model.copynode("/root/send/req", "/root/main/cond");
  217. model.makeValue("/root/send/req/MDdeptcd", MDdeptcd); // 내과부서코드 하드코딩_20090423(ByJA)
  218. if(prntyn == "P"){ //출력함수에서 호출한경우 조회예약시간setting추가-20100203-kys(출력시는 입력시간으로 조회, 조회버튼으로 조회시는 12:00으로 set)
  219. model.makeValue("/root/send/req/prntrsrvtm", model.getValue("/root/temp/tmpprntrsrvtm"));
  220. }else{
  221. model.makeValue("/root/send/req/prntrsrvtm", "1200");
  222. }
  223. //20090811-kys(서울성모이면서 등록번호로 조회시 예약대기인 경우 예약대기로 표시)
  224. if((getUserInfo("dutplceinstcd") == seoulinstcd) && pid != ""){
  225. model.makeValue("/root/send/req/rsrvreteyn", "Y");
  226. }
  227. if(submit("TRMNO01801")){
  228. model.setValue("/root/main/cond/cnt", grd_OutRsrvPatList.rows-1);
  229. opt_cnt.refresh();
  230. }
  231. model.setValue("/root/main/cond/orddrnm", cmb_orddr.label);
  232. var dethyn;
  233. var medamtpostyn;
  234. for(var i = grd_OutRsrvPatList.fixedRows; i < grd_OutRsrvPatList.rows; i++) {
  235. dethyn = model.getValue("/root/main/outrsrvpatlist/outrsrvpatinfo["+ i +"]/dethyn");
  236. medamtpostyn = model.getValue("/root/main/outrsrvpatlist/outrsrvpatinfo["+ i +"]/medamtpostyn");
  237. if(dethyn == "Y") {
  238. grd_OutRsrvPatList.cellstyle("background-color", i, 1, i, grd_OutRsrvPatList.cols-1) ="#999999";
  239. } else if(medamtpostyn == "V") {
  240. grd_OutRsrvPatList.cellstyle("background-color", i, 1, i, grd_OutRsrvPatList.cols-1) ="#ffff00";
  241. }
  242. }
  243. //grd_OutRsrvPatList.sortClear();
  244. //20090811-kys(예약대기일경우 bold체로 셀 font표시)-서울성모인경우에만..
  245. if((getUserInfo("dutplceinstcd") == seoulinstcd) && pid != ""){
  246. for(var i=1;i<=getNodesetCount("/root/main/outrsrvpatlist/outrsrvpatinfo");i++){
  247. //간호테이블의 입원외래구분과 실제 환자의 입원외래구분이 다른경우 셀 색상표시
  248. if(model.getValue("/root/main/outrsrvpatlist/outrsrvpatinfo["+i+"]/orddd") == "예약대기"){
  249. grd_OutRsrvPatList.cellstyle("font-weight", i, 1) = "bold";
  250. }
  251. }
  252. }
  253. grd_OutRsrvPatList.refresh();
  254. //grd_OutRsrvPatList.dispatch("onmouseup");
  255. }
  256. /**
  257. * @group :
  258. * @ver : 2007.09.17
  259. * @by : 문창곤
  260. * @---------------------------------------------------
  261. * @type : function
  262. * @access : public
  263. * @desc : 외래진료예약 환자 조회(게시판부착용)
  264. * @param :
  265. * @return :
  266. * @---------------------------------------------------
  267. */
  268. function fBoardSearch(){
  269. if(cmb_orddept.value == "") {
  270. messageBox("진료과를 선택하지 ","E007");
  271. return;
  272. }
  273. //model.removeNodeset("/root/temp/boarddata/outrsrvpatlist/outrsrvpatinfo");
  274. model.removenode("/root/main/outrsrvpatlist");
  275. model.refresh();
  276. model.makenode("/root/send/req");
  277. model.copynode("/root/send/req", "/root/main/cond");
  278. model.makeValue("/root/send/req/MDdeptcd", MDdeptcd); // 내과부서코드 하드코딩_20090423(ByJA)
  279. model.makeValue("/root/send/req/prntrsrvtm", model.getValue("/root/temp/tmpprntrsrvtm")); // 20100203-kys-출력입력예약시간추가
  280. if(submit("TRMNO01802")){
  281. grd_OutRsrvPatList.refresh();
  282. }
  283. model.setValue("/root/main/cond/orddrnm", cmb_orddr.label);
  284. model.makeValue("/root/main/cond/curdd", getCurrentDate());
  285. }
  286. /**
  287. * @group :
  288. * @ver : 2007.09.17
  289. * @by : 문창곤
  290. * @---------------------------------------------------
  291. * @type : function
  292. * @access : public
  293. * @desc : 환자 검색 기능
  294. * @param :
  295. * @param :
  296. * @return :
  297. * @---------------------------------------------------
  298. */
  299. function fUseridPopup(pPath, pNodeID, pNodeNM, pNodeRrgsNo1, pNodeRrgsNo2, pDOC) {
  300. model.removeNodeset("/root/properties/parameters/SendData/SendDatavalue");
  301. modal("SMMNE03700", 1, event.screenX-600, event.screenY, "SMMNE03700", "", "/root/init/searchitem");
  302. var pParam = model.getValue("/root/properties/parameters/SendData/SendDatavalue");
  303. var pParamValue = pParam.split("|");
  304. ipt_pid.Value = pParamValue[0];
  305. }
  306. /**
  307. * @group :
  308. * @ver : 2007.09.17
  309. * @by : 문창곤
  310. * @---------------------------------------------------
  311. * @type : function
  312. * @access : public
  313. * @desc : 외래재진예약 출력
  314. * @param :
  315. * @param :
  316. * @return :
  317. * @---------------------------------------------------
  318. */
  319. function fClickPrint(){
  320. //출력방식 추가_20100127_SMY
  321. var sPrntMthd = model.getValue("/root/main/cond/prntmthd");
  322. if (sPrntMthd == "") {
  323. messageBox("출력방식을 선택하지 ","E007");
  324. return;
  325. }
  326. var sPrntusge = model.getValue("/root/main/cond/prntusge");
  327. if (sPrntusge == "") {
  328. messageBox("출력용도를 선택하지 ","E007");
  329. return;
  330. }
  331. if(cmb_orddr.value == "00000000") { // 전체의사인 경우에는 모든 의사을 조회하면서 출력
  332. if(getNodesetCount("/root/init/orddr/orddr") > 0){
  333. var iLength = instance1.selectNodes("/root/init/orddr/orddr").length;
  334. for(var i = 2; i <= iLength; i++) {
  335. var sUserid = model.getValue("/root/init/orddr/orddr["+i+"]/userid");
  336. if(sUserid != ""){ // 전체인경우 제외
  337. cmb_orddr.value = sUserid;
  338. if (sPrntusge == "A" || sPrntusge == "AAM" || sPrntusge == "APM" || sPrntusge == "E") { // 게시판 부착용
  339. fBoardSearch();
  340. if (getNodesetCount("/root/temp/boarddata/outrsrvpatlist/outrsrvpatinfo") > 0) { // 자료가 존재하면 출력함
  341. fPrintPreview(sPrntusge);
  342. }
  343. } else if (sPrntusge == "B" || sPrntusge == "C" || sPrntusge == "D" || sPrntusge == "F" || sPrntusge == "G" || sPrntusge=="H") { //업무용, 라벨출력
  344. fBtnRefClicked("P");
  345. // sort정렬
  346. //grd_OutRsrvPatList.sortClear();
  347. //grd_OutRsrvPatList.sort(1, 3, grd_OutRsrvPatList.rows-1, grd_OutRsrvPatList.cols-1) = "asc";
  348. grd_OutRsrvPatList.sortClear();
  349. if (sPrntusge == "B" || sPrntusge == "F") { // 시간순
  350. //2010-03-02 ycd 업무용 출력시 게시판용과 동일하게 출력되도록 Sort 로직 주석처리
  351. //grd_OutRsrvPatList.sort(1, 2, grd_OutRsrvPatList.rows-1, grd_OutRsrvPatList.cols-1) = "asc";
  352. } else if (sPrntusge == "C") { // 등록번호순
  353. grd_OutRsrvPatList.sort(1, 3, grd_OutRsrvPatList.rows-1, grd_OutRsrvPatList.cols-1) = "asc";
  354. }else if (sPrntusge == "D") { // 이름순
  355. grd_OutRsrvPatList.sort(1, 4, grd_OutRsrvPatList.rows-1, grd_OutRsrvPatList.cols-1) = "asc";
  356. }
  357. grd_OutRsrvPatList.gridToInstance();
  358. if (grd_OutRsrvPatList.rows > 1) { // 자료가 존재하면 출력함
  359. fPrintPreview(sPrntusge);
  360. }
  361. }
  362. }
  363. }
  364. }
  365. } else {
  366. if (sPrntusge == "A" || sPrntusge == "AAM" || sPrntusge == "APM" || sPrntusge == "E") { // 게시판 부착용
  367. fBoardSearch();
  368. if (getNodesetCount("/root/temp/boarddata/outrsrvpatlist/outrsrvpatinfo") > 0) { // 자료가 존재하면 출력함
  369. fPrintPreview(sPrntusge);
  370. }
  371. } else if (sPrntusge == "B" || sPrntusge == "C" || sPrntusge == "D" || sPrntusge == "F"|| sPrntusge == "G" || sPrntusge == "H") { //업무용, 라벨출력
  372. fBtnRefClicked("P"); //추가-20100203-kys(출력시 재조회한다-출력입력시간때문.)
  373. grd_OutRsrvPatList.sortClear();
  374. if (sPrntusge == "B" || sPrntusge == "F"|| sPrntusge == "G") { // 시간순
  375. //2010-03-02 ycd 업무용 출력시 게시판용과 동일하게 출력되도록 Sort 로직 주석처리
  376. //grd_OutRsrvPatList.sort(1, 2, grd_OutRsrvPatList.rows-1, grd_OutRsrvPatList.cols-1) = "asc";
  377. } else if (sPrntusge == "C") { // 등록번호순
  378. grd_OutRsrvPatList.sort(1, 3, grd_OutRsrvPatList.rows-1, grd_OutRsrvPatList.cols-1) = "asc";
  379. }else if (sPrntusge == "D") { // 이름순
  380. grd_OutRsrvPatList.sort(1, 4, grd_OutRsrvPatList.rows-1, grd_OutRsrvPatList.cols-1) = "asc";
  381. }
  382. grd_OutRsrvPatList.gridToInstance();
  383. if (grd_OutRsrvPatList.rows > 1) { // 자료가 존재하면 출력함
  384. //grd_OutRsrvPatList.gridToInstance();
  385. fPrintPreview(sPrntusge);
  386. }
  387. }
  388. }
  389. }
  390. /**
  391. * @group :
  392. * @ver : 2007.09.17
  393. * @by : 문창곤
  394. * @---------------------------------------------------
  395. * @type : function
  396. * @access : public
  397. * @desc : 선택된 출력물을 출력 작업
  398. * @param :
  399. * @param :
  400. * @return :
  401. * @---------------------------------------------------
  402. */
  403. function fPrintPreview(pPrntusge){
  404. if (pPrntusge == "A" || pPrntusge == "AAM" || pPrntusge == "APM" || pPrntusge == "E") { // 게시판 부착용
  405. model.removenode("/root/temp/boarddata/cond");
  406. //send 재구성
  407. //model.makeValue("/root/temp/boarddata/cond","");
  408. model.makeNode("/root/temp/boarddata/cond");
  409. model.copyNode("/root/temp/boarddata/cond", "/root/main/cond");
  410. //여의도 성모 : 환자이름에 *포함_20100219_SMY
  411. if(getUserInfo("dutplceinstcd") == yeuidoinstcd){
  412. model.makeValue("/root/temp/boarddata/cond/instflag", "yeuido");
  413. }
  414. exeReportPreview("RPMNO01800", "XMLSTR", "", "", "true", "", "", "", "", "true");//20090923_미리보기없이출력_kys
  415. } else if (pPrntusge == "B" || pPrntusge == "C" || pPrntusge == "D") { //업무용
  416. model.removenode("/root/temp/printdata");
  417. //send 재구성
  418. model.makeValue("/root/temp/printdata","");
  419. model.copyNode("/root/temp/printdata", "/root/main");
  420. //exeReportPreview("RPMNO01801", "XMLSTR", "");
  421. exeReportPreview("RPMNO01801", "XMLSTR", "", "", "true", "", "", "", "", "true");//20090923_미리보기없이출력_kys
  422. } else if (pPrntusge == "F") { //라벨출력
  423. model.removenode("/root/temp/printdata");
  424. //send 재구성
  425. model.makeValue("/root/temp/printdata","");
  426. model.copyNode("/root/temp/printdata", "/root/main");
  427. //exeReportPreview("RPMNO01801", "XMLSTR", "");
  428. exeReportPreview("RPMNO01802", "XMLSTR", "", "", "true", "", "", "", "", "true");//201100404_미리보기없이출력_kys
  429. } else if (pPrntusge == "G") { //라벨(안과전용)
  430. model.removenode("/root/temp/printdata");
  431. //send 재구성
  432. model.makeValue("/root/temp/printdata","");
  433. model.copyNode("/root/temp/printdata", "/root/main");
  434. exeReportPreview("RPMNO01803", "XMLSTR", "", "", "true", "", "", "", "", "true");//201100404_미리보기없이출력_kys
  435. } else if(pPrntusge == "H") { //라벨(안과전용)
  436. model.removenode("/root/temp/printdata");
  437. //send 재구성
  438. model.makeValue("/root/temp/printdata","");
  439. model.copyNode("/root/temp/printdata", "/root/main");
  440. exeReportPreview("RPMNO01804", "XMLSTR");//201100404_미리보기없이출력_kys
  441. }
  442. }
  443. /**
  444. * @desc : 콤보박스에 원하는 instance node와 value를 설정
  445. * @
  446. * @param :
  447. * @event :
  448. * @return :
  449. * @---------------------------------------------------
  450. */
  451. function addComboInstance(combopath, nodename, nodeval, parentnode){
  452. nodename = nodename.split("^");
  453. nodeval = nodeval.split("^");
  454. if(nodename.length != nodeval.length){
  455. return;
  456. }
  457. var label = model.instances(0).createElement(nodename[0]);
  458. var val = model.instances(0).createElement(nodename[1]);
  459. var combo = model.instances(0).createElement(parentnode);
  460. label.value = "" + nodeval[0] + "";
  461. val.value = "" + nodeval[1] + "";
  462. combo.appendChild(label);
  463. combo.appendChild(val);
  464. chkNode = model.instances(0).selectSingleNode(combopath);
  465. if(chkNode == null){
  466. model.makeNode(combopath);
  467. srcNode = model.instances(0).selectSingleNode(combopath);
  468. }else{
  469. srcNode = model.instances(0).selectSingleNode(combopath);
  470. }
  471. desNode = model.instances(0).selectSingleNode(combopath + "/" + parentnode);
  472. srcNode.insertBefore(combo, desNode);
  473. model.refresh();
  474. }
  475. /**
  476. * @group :
  477. * @ver : 2008. 01. 01
  478. * @by : 김병국
  479. * @---------------------------------------------------
  480. * @type : function
  481. * @access : public
  482. * @desc : 환자의 진료내역을 가져온다.
  483. * @param :
  484. * @param : yr, dt
  485. * @return :
  486. * @---------------------------------------------------
  487. */
  488. function fCalcDate(yr, dt) {
  489. dt = dt.toDate("YYYYMMDD");
  490. dt = dt.getAddDate(yr, "Y");
  491. dt = dt.getDateFormat("YYYYMMDD");
  492. return dt;
  493. }
  494. /**
  495. * @group :
  496. * @ver : 2010. 02. 02
  497. * @by : 김양수
  498. * @---------------------------------------------------
  499. * @type : function
  500. * @access : public
  501. * @desc : 출력시 출력할 예약시간을 받는다.
  502. * @param :
  503. * @param :
  504. * @return :
  505. * @---------------------------------------------------
  506. */
  507. function fGetRsrvTm(sprntmthd, sprntusge) {
  508. //20100202-kys-출력시 오전오후시간을 입력하여 출력할수 있도록 변경
  509. var msgstr = "";
  510. var msgstr2 = "";
  511. if(sprntmthd == "AAM" ){
  512. msgstr = radio2.label + "(오전)";
  513. msgstr2 = "까지";
  514. model.makeValue("/root/temp/tmpprntrsrvtm" , "1200"); //오전일 경우에만 디폴트 12:00 set
  515. }else if(sprntmthd == "APM"){
  516. msgstr = radio2.label + "(오후)";
  517. msgstr2 = "부터";
  518. }
  519. caption12.text = msgstr + " 리스트에 포함시킬 예약시간을 지정하십시오.";
  520. caption13.text = msgstr2;
  521. ipt_prntrsrvtm.refresh();
  522. group2.attribute("visibility") = "visible";
  523. }
  524. /**
  525. * @group :
  526. * @ver : 2011. 01. 16
  527. * @by : 박성호
  528. * @---------------------------------------------------
  529. * @type : function
  530. * @access : public
  531. * @desc : 리스트를 엑셀로 저장한다.
  532. * @param :
  533. * @param :
  534. * @return :
  535. * @---------------------------------------------------
  536. */
  537. function fExcel()
  538. {
  539. if (grd_OutRsrvPatList.rows <= 1) return;
  540. var fileName = window.fileDialog("save", ",", false, "외래진료예약 리스트", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  541. if (fileName != ""){
  542. grd_OutRsrvPatList.saveExcel(fileName, "SheetName", false, false, "", "", false);
  543. }
  544. }