SPMMR05500.xjs 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Script type="xscript4.0"><![CDATA[function fInitialize()
  3. {
  4. lf_mmbfGetDeptCodeComboList(ds_init_orddept, "D");
  5. //sysf_trace(ds_init_orddept.saveXML());
  6. frmf_addComboItem("combo6"); //부서콤보 Item '전체'추가
  7. appf_getCodeList([{dsNm: "ds_init_insukindlist_P0008", cdGrpId: "P0008"}
  8. , {dsNm: "ds_init_suppkindlist_P0010", cdGrpId: "P0010"}], true);
  9. ds_main.setColumn(0,"orddeptcd", opener.frmf_getParameter("SPMMR05500_orddeptcd"));
  10. var formcd = opener.frmf_getParameter("SPMMR05500_formcd");
  11. if(formcd != "0000001457")//수술확인서
  12. {
  13. grd_oplist.visible = false;
  14. caption2.visible = false;
  15. line2.visible = false;
  16. bool2.visible = false;
  17. grd_oplist.position2.top = 0;
  18. btn_confirm.position2.top = 336;
  19. btn_cncl.position2.top = 336;
  20. //this.parent.position.width = 690;
  21. this.parent.position.height = 410;//440;
  22. }
  23. ds_main.setColumn(0,"amtyn", "");
  24. if(formcd == "0000001457" || //수술확인서
  25. formcd == "0000002792" || //상급병실확인서 (2009.07.27. 추가)
  26. formcd == "0000001300" || //입퇴원확인서(원무용)
  27. formcd == "0000001283" || //입퇴원확인서(진료용)
  28. formcd == "1100011101" || //입원사실확인서(입원중)
  29. formcd == "1100012297") //진단서
  30. {
  31. // knuh_20110324_박성호(입원사실확인서(입원중) 추가)
  32. if(formcd == "0000001300" || formcd == "1100011101")
  33. {
  34. ds_main.setColumn(0,"orddeptcd", "-");
  35. }
  36. ds_main.setColumn(0,"ordtype", "I");
  37. rdo_ordtype.enable = false;
  38. }
  39. else if(formcd == "0000001312" || //외래진료확인서
  40. formcd == "0000002639" || //통원치료확인서
  41. formcd == "0000002588") //통원치료확인서(영문)
  42. {
  43. if(formcd == "0000001312")
  44. {
  45. ds_main.setColumn(0,"orddeptcd", "-");
  46. }
  47. ds_main.setColumn(0,"ordtype", "O");
  48. rdo_ordtype.enable = false;
  49. ds_main.setColumn(0,"amtyn", "Y"); // 2011-01-19 경북대 최원돈 금액 조회 포함 여부 : 설정
  50. }
  51. //2012/03/29 Start
  52. ds_send_patinfo.setColumn(0,"daykijun","0");
  53. //2012/03/29 End
  54. fGetPatHist();
  55. }
  56. /**
  57. * @desc : 환자 수진이력 조회
  58. * @id :
  59. * @event :
  60. * @return : void
  61. * @authur : 이상현
  62. */
  63. function fGetPatHist(){
  64. dsf_setDefaultVal(ds_send_patinfo, "orddeptcd:-,orddrid:-");
  65. //2009-08-06 오후 5:40:21 강지훈 수정 : nopay Y : 진료부도제외 N : 진료부도 포함
  66. var nopay = opener.frmf_getParameter("SPMMR05500_nopay");
  67. var pid = opener.frmf_getParameter("SPMMR05500_pid");
  68. var orddeptcd = ds_main.getColumn(0,"orddeptcd");
  69. var ordtype = ds_main.getColumn(0,"ordtype");
  70. ds_send_patinfo.setColumn(0,"pid",pid);
  71. ds_send_patinfo.setColumn(0,"orddeptcd",orddeptcd);
  72. ds_send_patinfo.setColumn(0,"ordtype",ordtype);
  73. ds_send_patinfo.setColumn(0,"nopay",nopay);
  74. // 2011-01-19 경북대 최원돈 조회기간 및 금액 조회 포함 여부
  75. ds_send_patinfo.setColumn(0,"ordddfr", ds_main.getColumn(0,"ordddfr"));
  76. ds_send_patinfo.setColumn(0,"ordddto", ds_main.getColumn(0,"ordddto"));
  77. ds_send_patinfo.setColumn(0,"amtyn", ds_main.getColumn(0,"amtyn"));
  78. var oParam = {};
  79. oParam.id = "TRMMR05501";
  80. oParam.service = "medirecapp.ExtnMediRec";
  81. oParam.method = "reqGetPatHistList";
  82. oParam.inds = "req=ds_send_patinfo";
  83. oParam.outds = "ds_main_pathistlist=pathistlist";
  84. oParam.async = true;
  85. oParam.callback = "cf_TRMMR05501";
  86. tranf_submit(oParam);
  87. }
  88. function cf_TRMMR05501(sSvcId, nErrorCode, sErrorMsg) {
  89. if(nErrorCode < 0) return;
  90. dsf_setDefaultVal(ds_main_pathistlist, "chk:N");
  91. }
  92. /**
  93. * @group :
  94. * @ver :
  95. * @by : 이상현
  96. * @modify : 2008.07.22
  97. * @---------------------------------------------------
  98. * @type : function
  99. * @access : public
  100. * @desc : 환자 수진이력 선택시 이벤트
  101. * @param :
  102. * @param :
  103. * @return :
  104. * @---------------------------------------------------
  105. */
  106. function fSelectPatInfo(){
  107. var formcd = opener.frmf_getParameter("SPMMR05500_formcd");
  108. var rowno = ds_main_pathistlist.rowposition;
  109. var pid = ds_main_pathistlist.getColumn(rowno, "pid");
  110. var cretno = ds_main_pathistlist.getColumn(rowno, "cretno");
  111. var orddd = ds_main_pathistlist.getColumn(rowno, "orddd");
  112. var ordtype = ds_main_pathistlist.getColumn(rowno, "ordtype");
  113. var orddeptcd = ds_main_pathistlist.getColumn(rowno, "orddeptcd");
  114. var orddeptnm = ds_main_pathistlist.getColumn(rowno, "orddeptnm");
  115. var tabtype;
  116. if(!utlf_isNull(ds_main_pathistlist.getColumnInfo("tabtype"))){
  117. tabtype = ds_main_pathistlist.getColumn(rowno, "tabtype");
  118. }
  119. var dschdd = ds_main_pathistlist.getColumn(rowno, "dschdd");
  120. var hngnm = ds_main_pathistlist.getColumn(rowno, "hngnm");
  121. // knuh_20110324_박성호(입원사실확인서(입원중) 추가)
  122. if(formcd == "0000001300" || formcd == "0000001283" || formcd == "1100011101"){ //입퇴원확인서, 입원사실확인서
  123. ds_main_pathistlist.filter("chk == 'Y'");
  124. var msg = "";
  125. for(var i = 0; i < ds_main_pathistlist.rowcount; i++){
  126. var indd = ds_main_pathistlist.getColumn(i,"orddd");
  127. indd = indd.toDate().getDateFormat("YYYY/MM/DD");
  128. var dschdd = ds_main_pathistlist.getColumn(i,"dschdd");
  129. if(dschdd != "재원중"){
  130. dschdd = dschdd.toDate().getDateFormat("YYYY/MM/DD");
  131. }
  132. var orddeptnm = ds_main_pathistlist.getColumn(i,"orddeptnm");
  133. if(i == 0){
  134. msg += "[" + orddeptnm + "] " + indd + " - " + dschdd;
  135. }else{
  136. msg += "\n[" + orddeptnm + "] " + indd + " - " + dschdd;
  137. }
  138. }
  139. msg += "\n\n상기환자는 위 기간동안 입원치료 하였음을 확인합니다.";
  140. opener.frmf_setParameter("SPMMR05500_useyn", "Y");
  141. opener.frmf_setParameter("SPMMR05500_msg" , msg);
  142. ds_main_pathistlist.filter("");
  143. close();
  144. }else if(formcd == "0000001312" || formcd == "0000002639"){ //외래진료확인서, 통원치료 확인서
  145. ds_main_pathistlist.filter("chk == 'Y'");
  146. var msg = "";
  147. //2012/04/12 Start
  148. var chk= ds_send_patinfo.getColumn(0,"daykijun");
  149. if(chk=="0"){ //수진일 기준
  150. msg += "[수납금액 기준]" + "\n\n\n";
  151. }else if(chk=="1"){ // 실시일 기준
  152. msg += "[실시금액 기준]" + "\n\n\n";
  153. }
  154. //2012/04/12 End
  155. for(var i = 0; i < ds_main_pathistlist.rowcount; i++){
  156. var orddd = ds_main_pathistlist.getColumn(i,"orddd");
  157. orddd = orddd.toDate().getDateFormat("YYYY/MM/DD");
  158. //2013/02/15 Start 덤프 환자인 경우는 목록에서 안보여 주도록 수정(김무조 파트장님과 통화로 협의)
  159. if(ds_main_pathistlist.getColumn(i,"tranflagyn") == "Y"){
  160. continue;
  161. }
  162. //2013/02/15 End
  163. //KNUH 2011-04-29 최원돈 수진정보 조회 시 DSC/CHEMO 환자일 경우
  164. //외래수진정보(수진일자, 금액, 검사일자) 중 금액 또는 검사일자가 있으면 증명서 복사입력 시
  165. //수진일자를 NULL(' ')로 입력하고, 나머지는 그대로 입력되도록 기능 추가
  166. if(ds_main_pathistlist.getColumn(i,"tranflagyn") == "Y")
  167. {
  168. orddd = " ";
  169. }
  170. var orddeptnm = ds_main_pathistlist.getColumn(i,"orddeptnm");
  171. if(i == 0){
  172. msg += "[" + orddeptnm + "] " + orddd;
  173. }else{
  174. msg += "\n[" + orddeptnm + "] " + orddd;
  175. }
  176. //2012/04/12 Start 실시금액 기준
  177. if(chk=="0"){ //수진일 기준 금액표시
  178. var ls_issamt = ds_main_pathistlist.getColumn(i,"issamt");
  179. if (!utlf_isNull(ls_issamt) && ls_issamt != "0"){
  180. msg += " (금액 : " + fGetaddCommas(ls_issamt) + "원)";
  181. }
  182. }else if(chk=="1"){ // 실시일 기준 금액표시
  183. var ls_silsiamt = ds_main_pathistlist.getColumn(i,"silsiamt");
  184. if (!utlf_isNull(ls_silsiamt) && ls_silsiamt != "0"){
  185. msg += " (금액 : " + fGetaddCommas(ls_silsiamt) + "원)";
  186. }
  187. }
  188. /* 2012/04/12 주석처리
  189. // 2011-01-19 경대병원 최원돈 통원치료확인서 금액추가
  190. var ls_issamt = item.selectSingleNode("issamt").text;
  191. if ( ls_issamt != ""
  192. && ls_issamt != "0")
  193. {
  194. msg += " (금액 : " + fGetaddCommas(item.selectSingleNode("issamt").text) + "원)";
  195. }
  196. */
  197. // 2012/04/12 End
  198. // 2011-03-29 경대병원 최원돈 검사일자 추가
  199. var ls_testdd = ds_main_pathistlist.getColumn(i,"testdd");
  200. if (!utlf_isNull(ls_testdd))
  201. {
  202. msg += " (시행일자 : " + ls_testdd + ")";
  203. }
  204. }
  205. opener.frmf_setParameter("SPMMR05500_useyn", "Y");
  206. opener.frmf_setParameter("SPMMR05500_msg", msg);
  207. ds_main_pathistlist.filter("");
  208. close();
  209. }else if(formcd == "0000002588"){ //통원치료 확인서(영문)
  210. ds_main_pathistlist.filter("chk == 'Y'");
  211. var msg = "";
  212. for(var i = 0; i < ds_main_pathistlist.rowcount; i++){
  213. var orddd = ds_main_pathistlist.getColumn(i,"orddd");
  214. orddd = orddd.toDate().getDateFormat("YYYY/MM/DD");
  215. //KNUH 2011-04-29 최원돈 수진정보 조회 시 DSC/CHEMO 환자일 경우
  216. //외래수진정보(수진일자, 금액, 검사일자) 중 금액 또는 검사일자가 있으면 증명서 복사입력 시
  217. //수진일자를 NULL(' ')로 입력하고, 나머지는 그대로 입력되도록 기능 추가
  218. if(ds_main_pathistlist.getColumn(i,"tranflagyn") == "Y")
  219. {
  220. orddd = " ";
  221. }
  222. var orddeptcd = ds_main_pathistlist.getColumn(i,"orddeptcd");
  223. // 영문 부서명 가져오기
  224. var orddeptnm = ds_main_pathistlist.getColumn(i,"orddeptnm");
  225. dsf_makeValue(ds_send_deptcd,"deptcd", "string", orddeptcd);
  226. var oParam = {};
  227. oParam.id = "TRMRF01217";
  228. oParam.service = "formmngtapp.FormIfMngt";
  229. oParam.method = "reqGetDeptEngNmByDeptcd";
  230. oParam.inds = "req=ds_send_deptcd";
  231. oParam.outds = "ds_main_deptinfo=deptinfo";
  232. oParam.async = false;
  233. //oParam.callback = "cf_TRMRF01217";
  234. tranf_submit(oParam);
  235. orddeptnm = ds_main_deptinfo.getColumn(0,"deptengnm");
  236. if(i == 0){
  237. msg += "[" + orddeptnm + "] " + orddd;
  238. }else{
  239. msg += "\n[" + orddeptnm + "] " + orddd;
  240. }
  241. // 2011-01-19 경대병원 최원돈 통원치료확인서 금액추가
  242. var ls_issamt = ds_main_pathistlist.getColumn(i,"issamt");
  243. if (!utlf_isNull(ls_issamt)
  244. && ls_issamt != "0")
  245. {
  246. msg += " (Amount : " + fGetaddCommas(ls_issamt) + "KW)";
  247. }
  248. // 2011-03-29 경대병원 최원돈 검사일자 추가
  249. var ls_testdd = ds_main_pathistlist.getColumn(i,"testdd");
  250. if (!utlf_isNull(ls_testdd))
  251. {
  252. msg += " (The exam date : " + ls_testdd + ")";
  253. }
  254. }
  255. opener.frmf_setParameter("SPMMR05500_useyn", "Y");
  256. opener.frmf_setParameter("SPMMR05500_msg" , msg);
  257. ds_main_pathistlist.filter("");
  258. close();
  259. }else if(formcd == "0000002792"){ //상급병실확인서 (2009.07.27. 추가)
  260. ds_main_pathistlist.filter("chk == 'Y'");
  261. var msg = "";
  262. for(var i = 0; i < ds_main_pathistlist.rowcount; i++){
  263. var indd = ds_main_pathistlist.getColumn(i,"orddd");
  264. indd = indd.toDate().getDateFormat("YYYY-MM-DD");
  265. var dschdd = ds_main_pathistlist.getColumn(i,"dschdd");
  266. if(dschdd != "재원중"){
  267. dschdd = dschdd.toDate().getDateFormat("YYYY-MM-DD");
  268. }
  269. var orddeptnm = ds_main_pathistlist.getColumn(i,"orddeptnm");
  270. if(i == 0){
  271. msg += indd + " ~ " + dschdd;
  272. }
  273. opener.frmf_setParameter("SPMMR05500_pid" , ds_main_pathistlist.getColumn(i,"pid"));
  274. opener.frmf_setParameter("SPMMR05500_indd" , ds_main_pathistlist.getColumn(i,"orddd"));
  275. opener.frmf_setParameter("SPMMR05500_cretno" , ds_main_pathistlist.getColumn(i,"cretno"));
  276. }
  277. opener.frmf_setParameter("SPMMR05500_useyn", "Y");
  278. opener.frmf_setParameter("SPMMR05500_msg" , msg);
  279. opener.frmf_setParameter("SPMMR05500_orddeptnm", orddeptnm);
  280. ds_main_pathistlist.filter("");
  281. close();
  282. // knuh_20110324_박성호(출생증명서(입원중) 추가)
  283. //}else if(formcd == "0000001113"){
  284. }else if(formcd == "0000001113" || formcd == "1100011102"){
  285. ds_main_pathistlist.filter("chk == 'Y'");
  286. var msg = "";
  287. var len = ds_main_pathistlist.rowcount;
  288. if(len > 1){
  289. msg = "하나의 경우만 선택해주세요.";
  290. return;
  291. }else if(len > 0) {
  292. opener.frmf_setParameter("SPMMR05500_pid" , ds_main_pathistlist.getColumn(0,"pid"));
  293. opener.frmf_setParameter("SPMMR05500_indd" , ds_main_pathistlist.getColumn(0,"orddd"));
  294. opener.frmf_setParameter("SPMMR05500_cretno" , ds_main_pathistlist.getColumn(0,"cretno"));
  295. }
  296. opener.frmf_setParameter("SPMMR05500_useyn", "Y");
  297. opener.frmf_setParameter("SPMMR05500_msg" , msg);
  298. opener.fGetForm();
  299. opener.ds_temp_tempinfo.clearData();
  300. ds_main_pathistlist.filter("");
  301. close();
  302. }else if(formcd == "1100012297"){ // 진단서
  303. ds_main_pathistlist.filter("chk == 'Y'");
  304. var len = ds_main_pathistlist.rowcount;
  305. if(len > 1){
  306. sysf_messageBox("하나의 경우만 선택해주세요.", "I");
  307. return;
  308. }else if(len > 0) {
  309. opener.frmf_setParameter("SPMMR05500_indd" , ds_main_pathistlist.getColumn(0,"orddd"));
  310. opener.frmf_setParameter("SPMMR05500_dschdd" , ds_main_pathistlist.getColumn(0,"dschdd"));
  311. }
  312. opener.frmf_setParameter("SPMMR05500_useyn", "Y");
  313. ds_main_pathistlist.filter("");
  314. close();
  315. }else{
  316. opener.frmf_setParameter("SPMMR05500_useyn", "N");
  317. close();
  318. }
  319. }
  320. /**
  321. * @desc : 금액표시(정규표현)
  322. * @return : string
  323. * @authur : 최원돈
  324. */
  325. function fGetaddCommas(ps_value){
  326. var objRegExp = new RegExp('(-?[0-9]+)([0-9]{3})');
  327. while(objRegExp.test(ps_value)) {
  328. ps_value = String(ps_value).replace(objRegExp, '$1,$2');
  329. }
  330. return ps_value;
  331. }
  332. /**
  333. * @desc : 환자 수술 내역 선택시
  334. * @id :
  335. * @event :
  336. * @return : void
  337. * @authur : 이상현
  338. */
  339. function fSelectOpInfo(){
  340. var opcnts = "";
  341. ds_main_pathistlist.filter("chk == 'Y'");
  342. var orddd = ds_main_pathistlist.getcolumn(0,"orddd");
  343. var dschdd = ds_main_pathistlist.getcolumn(0,"dschdd");
  344. orddd = orddd.toDate().getDateFormat("YYYY-MM-DD");
  345. if(dschdd != "재원중"){
  346. dschdd = dschdd.toDate().getDateFormat("YYYY-MM-DD");
  347. }
  348. var opinfo = "[입원일자] : " + orddd + "~" + dschdd;
  349. for(var i = 0; i <= ds_main_opinfo.rowposition; i++){
  350. var checkflag = ds_main_opinfo.getcolumn(i,"checkflag");
  351. if(checkflag == "Y"){
  352. var opcnfmdd = ds_grd_oplist.getcolumn(i,"opcnfmdd").toDate().getDateFormat("YYYY-MM-DD");
  353. var ophngnm = ds_grd_oplist.getcolumn(i,"ophngnm");
  354. }
  355. if(i == 0){
  356. opcnts = opcnfmdd + " : " + ophngnm;
  357. opinfocnts = ">[수술일자] :" + opcnfmdd + " / [수술명] : " + ophngnm;
  358. }else{
  359. opcnts += "\n" + opcnfmdd + " : " + ophngnm;
  360. opinfocnts += ">[수술일자] :" + opcnfmdd + " / [수술명] : " + ophngnm;
  361. }
  362. }
  363. if(utlf_isNull(opcnts)){
  364. opener.frmf_setParameter("SPMMR05500_useyn", "N");
  365. }else{
  366. opener.frmf_setParameter("SPMMR05500_useyn", "Y");
  367. opener.frmf_setParameter("SPMMR05500_msg" , opcnts);
  368. opener.frmf_setParameter("SPMMR05500_opinfo", opinfo + "\n" + opinfocnts);
  369. }
  370. ds_main_pathistlist.filter("");
  371. close();
  372. }]]></Script>