SMMMO04300.xjs 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Script type="xscript4.0"><![CDATA[/*
  3. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  4. 입원환자리스트 ( SMMMO04300_입원환자리스트.xfdl - JScript )
  5. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  6. */
  7. var arErrorCode = new HashArray();
  8. /**
  9. * @desc : 화면 초기화
  10. * @
  11. * @param :
  12. * @return :
  13. * @author : 오지훈
  14. * @---------------------------------------------------
  15. */
  16. function fInitialize_SMMMO04300(){
  17. ds_cond.setColumn(0, "indd", utlf_getCurrentDate());
  18. //의료협력 컬럼 추가 (성가 제외) 091019 kimsj
  19. // 하드코드 테이블 한번에 조회하도록 프로그램 수정
  20. lf_gethardcdArrayList(new Array(
  21. "reqphardcdno|138" , // 진료대상자 의료협력 컬럼 사용여부
  22. "npdeptcd|104", // 정신과 과 코드 조회
  23. "hardcdno|63", // 응급의학과
  24. "opdrugresn|76", // 수술예방적 항생제 사유 입력 부서코드 조회
  25. "jobhardcdno|65", // 주치의 코드(jobposcd)
  26. "hardcd|445",
  27. "508longstay|703", // 20190312 이돈희 : 508응급병동 장기재원환자 기준
  28. "namecharcolor|704", // 20190312 이돈희 : 508응급병동 장기재원환자 색상 표시
  29. "imdeptcd|568" // 20190411 이돈희 : 내과 전체 부서 코드
  30. ),
  31. new Array(
  32. "ds_reqphardcdno",
  33. "ds_npdeptcd",
  34. "ds_hardcdno",
  35. "ds_opdrugresn",
  36. "ds_jobhardcdno",
  37. "ds_hardcd",
  38. "ds_508longstay",
  39. "ds_namecharcolor",
  40. "ds_imdeptcd"
  41. )
  42. )
  43. /*
  44. mmbfGetHardCodeInfo("/root/send/reqdata", "/root/init/reqphardcdno", 138); //진료대상자 의료협력 컬럼 사용여부
  45. mmbfGetHardCodeInfo("/root/send/reqdata", "/root/init/npdeptcd", 104); //정신과 과 코드 조회
  46. */
  47. if (ds_reqphardcdno.getColumn(0, "hardcd") == "N") {
  48. grid.setFormatColProperty(grid.getBindCellIndex("body", "refer"), "size", 0);
  49. grid.setFormatColProperty(grid.getBindCellIndex("body", "replstat"), "size", 0);
  50. }
  51. appf_getCodeList([{dsNm: "ds_P0008", cdGrpId: "P0008"}
  52. , {dsNm: "ds_M0525", cdGrpId: "M0525"}
  53. , {dsNm: "ds_M0623", cdGrpId: "M0623"}], true);
  54. /*
  55. mmbfGetHardCodeInfo("/root/send/reqdata", "/root/init/hardcdno", 63); //응급의학과 부서코드 조회
  56. mmbfGetHardCodeInfo("/root/send/reqdata", "/root/init/opdrugresn", 76); //수술예방적 항생제 사유 입력 부서코드 조회
  57. */
  58. var dutplcecd = sysf_getUserInfo("dutplcecd");
  59. var medispclid = "-";
  60. var atdoctid = "-";
  61. var reopenflag = parent.parent.ds_reopen.getColumn(0, "reopenflag"); //진료대상자 리스트 open여부
  62. if(reopenflag != "Y"){ //다시 열린 경우가 아니면, 기본 조회 조건 설정
  63. medispclid = sysf_getUserId(); //전문의
  64. atdoctid = sysf_getUserId(); //담당의
  65. } else { //다시 열린 경우, main에 ordtab의 condlist(화면이 닫힐때 설정된 정보)를 그대로 재설정
  66. try {
  67. ds_cond.copyData(parent.parent.ds_reopen_condlist);
  68. dutplcecd = ds_cond.getColumn(0, "orddeptcd");
  69. medispclid = ds_cond.getColumn(0, "medispclid");
  70. atdoctid = ds_cond.getColumn(0, "atdoctid");
  71. } catch(E) {
  72. }
  73. parent.parent.ds_reopen.setColumn(0, "reopenflag", "N");
  74. }
  75. if(dutplcecd == "-" || utlf_isNull(dutplcecd)){
  76. dutplcecd = sysf_getUserInfo("dutplcecd");
  77. }
  78. setDeptCodeList(dutplcecd);
  79. //20190411 이돈희 : 내과 전공의가 로그인시 내과전체 체크박스 show
  80. //20200210 이돈희 : 양동헌 실장 요청으로 내과 교수에게
  81. if((!utlf_isNull(ds_imdeptcd.lookup("hardcd", sysf_getUserInfo("dutplcecd"), "hardcd")) && (sysf_getUserInfo("jobposcd") != "1799"))
  82. || (sysf_getUserInfo("userid") == "EMR")){
  83. Div00.CheckBox_allim.visible = true;
  84. Div00.Static04.position.x = Div00.CheckBox_allim.position.right + 5;
  85. Div00.cmb_orddept.position.x = Div00.Static04.position.right + 5;
  86. //사용자환경설정 : 입원 진료대상자리스트화면 오픈시 내과전체 조회 기능 초기 활성화
  87. var ansExamRsrv = lf_mmbfGetUserEnvQuestValue("090")
  88. if(ansExamRsrv == "001"){
  89. fSetAllIM();
  90. //전공의 로그인시 담당의 세팅
  91. setUserList(sysf_getUserInfo("dutplcecd"), "-", sysf_getUserId());
  92. } else{
  93. //전공의가 아닌경우 담당교수 체크 후 세팅
  94. setUserList(dutplcecd, medispclid, "-");
  95. }
  96. }
  97. // 내과 전공의가 아닌 경우
  98. else{
  99. //전공의가 아닌경우 담당교수 체크 후 세팅
  100. setUserList(dutplcecd, medispclid, "-");
  101. }
  102. reqOrderInfoOfCol(ds_reqdata1, ds_gridseq, "SMMMO04300", grd_inpatlist); //입원환자리스트 컬럼 조회 및 설정
  103. if(Div00.cmb_orddept.value == ""){Div00.cmb_orddept.index = 1;} //선택된 진료과가 없는 경우 default로 첫번째 설정
  104. if(Div00.cmb_medispclid.value == ""){Div00.cmb_medispclid.index = 1;} //선택된 담당교수가 없는 경우 default로 첫번째 설정
  105. var orddeptcd = ds_cond.getColumn(0, "orddeptcd");
  106. var medispclid = ds_cond.getColumn(0, "medispclid");
  107. var atdoctid = ds_cond.getColumn(0, "atdoctid");
  108. var wardcd = ds_cond.getColumn(0, "wardcd");
  109. setRadiationMsg(orddeptcd);
  110. setSubDeptCodeList(orddeptcd);
  111. //20190411 이돈희 : 내과전체 조회 - 내과전체인경우 조회조건이 전부로 조회 가능
  112. if (Div00.CheckBox_allim.value == false && orddeptcd == "-" && medispclid == "-" && atdoctid == "-" && wardcd == "-" ) {
  113. sysf_messageBox("조회조건 전부가 전체가 될수는", "I004");
  114. } else {
  115. fReqInPatList();
  116. }
  117. //20190704 이돈희 : 칠곡 응급입원실 1일이상 체류환자 주황색 표시
  118. if(sysf_getUserInfo("dutplceinstcd") == "032"){
  119. rect_longstay2.visible = true;
  120. caption18.visible = true;
  121. caption18.text = "ERW 1일이상 체류";
  122. rect_longstay2.style.fillbrush.color = "#ffcc99ff"; //주황색
  123. }
  124. }
  125. function setDeptCodeList(sDeptcd, sOrddd){
  126. lf_mmbfGetDeptCodeComboList(ds_orddept, "D", sOrddd); //부서코드 콤보
  127. lf_mmbfGetDeptCodeComboList(ds_orddept2, "W", sOrddd); //병동코드 콤보
  128. frmf_addComboItem("Div00.cmb_orddept"); //부서콤보 Item '전체'추가
  129. frmf_addComboItem("Div00.cmb_wardcd"); //병동콤보 전체항목 추가
  130. if(!utlf_isNull(sDeptcd)) {
  131. Div00.cmb_orddept.value = sDeptcd; //진료과
  132. Div00.cmb_wardcd.value = "-"; //병동콤보
  133. }
  134. }
  135. function setUserList(sOrddeptcd, sMedispclid, sAtdoctid, sOrddd){
  136. var sCheckStr = "";
  137. lf_mmbfGetUserComboList(ds_userlist, sOrddeptcd, "0330", "", "M", sOrddd, "", "P");
  138. if(lf_ContainsHardCD("515", sOrddeptcd)) { // 담당의 항목에 교수도 조회해야 하는 부서
  139. lf_mmbfGetUserComboList(ds_userlist2, sOrddeptcd, "0330", "", "T", sOrddd, "", "P"); // 담당의에 주치의도 포함 되도록 수정 -2015.11.06 엄영만 요청서:20151102005
  140. } else {
  141. lf_mmbfGetUserComboList(ds_userlist2, sOrddeptcd, "0330", "", "A", sOrddd, "", "P");
  142. }
  143. frmf_addComboItem("Div00.cmb_medispclid"); //의사콤보 전체항목 추가
  144. frmf_addComboItem("Div00.cmb_atdoctid"); //의사콤보 전체항목 추가
  145. sCheckStr = ds_userlist.lookup("userid", sMedispclid, "userid");
  146. if (!utlf_isNull(sCheckStr)) {
  147. Div00.cmb_medispclid.value = sMedispclid; //전문의
  148. } else {
  149. Div00.cmb_medispclid.value = "-"; //전문의
  150. }
  151. sCheckStr = ds_userlist2.lookup("userid", sAtdoctid, "userid");
  152. if (!utlf_isNull(sCheckStr)) {
  153. Div00.cmb_atdoctid.value = sAtdoctid; //담당의
  154. } else {
  155. Div00.cmb_atdoctid.value = "-"; //담당의
  156. }
  157. }
  158. function setSubDeptCodeList(sOrddeptcd) {
  159. lf_mmbfGetSubDeptComboList(ds_subdeptinfo, sOrddeptcd);
  160. frmf_addComboItem("Div00.cmb_subdept"); //세부과 전체항목 추가
  161. ds_cond.setColumn(0, "subdeptcd", "-");
  162. }
  163. function setRadiationMsg(sOrddeptcd) {
  164. var rtorddeptcd = ds_hardcdno.getColumn(0, "hardcd");
  165. if (sOrddeptcd == rtorddeptcd) { // 진료과가 방사선종양학과 일 경우 stt_radiation이 보여짐
  166. stt_radiation.visible = true;
  167. } else {
  168. stt_radiation.visible = false;
  169. }
  170. }
  171. /**
  172. * @desc : (입원)관심환자등록창 호출
  173. * @
  174. * @param :
  175. * @return :
  176. * @author : 오지훈
  177. * @---------------------------------------------------
  178. */
  179. function fCallWndConcPatRgst(){
  180. var iRow = ds_inpatlist.rowposition;
  181. var pid = ds_inpatlist.getColumn(iRow, "pid");
  182. var hngnm = ds_inpatlist.getColumn(iRow, "hngnm");
  183. var indd = ds_inpatlist.getColumn(iRow, "indd");
  184. var cretno = ds_inpatlist.getColumn(iRow, "cretno");
  185. var seqno = ds_inpatlist.getColumn(iRow, "seqno");
  186. var instcd = ds_inpatlist.getColumn(iRow, "instcd");
  187. var param = "I" + "▩" + pid + "▩" + hngnm + "▩" + indd + "▩" + cretno + "▩" + seqno + "▩" + instcd;
  188. frmf_setParameter("param", param);
  189. frmf_open("SPMMO08200", "SPMMO08200", null, null, null, null, null, null, null, null, null, null, "M");
  190. //frmf_modal("SPMMO08200", "SPMMO08200", null, null, null, null, null, null, null, null, null, null, "M");
  191. //fReqInPatList();
  192. }
  193. /**
  194. * @desc : (입원)주의요망환자창 호출
  195. * @
  196. * @param :
  197. * @return :
  198. * @author : 엄영만
  199. * @---------------------------------------------------
  200. */
  201. function fCallWndWarnPat(){
  202. var nCurRow = ds_inpatlist.rowposition;
  203. var sPid = ds_inpatlist.getColumn(nCurRow, "pid");
  204. var sHngnm = ds_inpatlist.getColumn(nCurRow, "hngnm");
  205. frmf_setParameter("SMMMO19100_warncd" , sPid);
  206. frmf_setParameter("SMMMO19100_warnnm" , sHngnm);
  207. frmf_modal("SMMMO19100", "SMMMO19100", null, null, null, null, null, null, null, null, null, null, "M");
  208. frmf_clearParameter("SMMMO19100_warncd");
  209. frmf_clearParameter("SMMMO19100_warnnm");
  210. }
  211. /**
  212. * @desc : 입원환자 환자 기본정보설정
  213. * @
  214. * @param :
  215. * @return :
  216. * @author : 오지훈
  217. * @---------------------------------------------------
  218. */
  219. function fReqInPatPamInfo(){
  220. var iRow = ds_inpatlist.rowposition;
  221. var pid = ds_inpatlist.getColumn(iRow, "pid");
  222. var indd = ds_inpatlist.getColumn(iRow, "indd");
  223. var cretno = ds_inpatlist.getColumn(iRow, "cretno");
  224. var instcd = ds_inpatlist.getColumn(iRow, "instcd");
  225. var srchdd = ds_cond.getColumn(0, "indd"); //조회일자
  226. var param = "I" + "▦" + pid + "▦" + indd + "▦" + cretno + "▦" + instcd + "▦" + srchdd;
  227. return appf_initPatientInfo(param);
  228. }
  229. /**
  230. * @desc : 내 환자 적용/해제
  231. * @
  232. * @param :
  233. * @event : 팝업창 내 환자 적용 EVENT
  234. * @return :
  235. * @author : 오지훈
  236. * @---------------------------------------------------
  237. */
  238. function fRgstCnclMyPat(){
  239. var mypatinfo = "";
  240. var totrow = ds_inpatlist.rowcount;
  241. for(var currow = 0; currow < totrow; currow++){
  242. if(ds_inpatlist.getSelect(currow)){
  243. var pid = ds_inpatlist.getColumn(currow, "pid");
  244. var indd = ds_inpatlist.getColumn(currow, "indd");
  245. var cretno = ds_inpatlist.getColumn(currow, "cretno");
  246. var seqno = ds_inpatlist.getColumn(currow, "seqno");
  247. var deptcd = ds_inpatlist.getColumn(currow, "orddeptcd");
  248. var tmpstr = "▦" + pid + "▦" + indd + "▦" + cretno + "▦" + seqno + "▦" + deptcd + "▩" ;
  249. mypatinfo += tmpstr;
  250. }
  251. }
  252. frmf_setParameter("apntflag", "mypat"); //화면 적용 구분을 내 환자 적용
  253. frmf_setParameter("mypatinfo", mypatinfo);
  254. frmf_modal("SPMMO10700", "SPMMO10700", null, null, null, null, null, null, null, null, null, null, "P");
  255. fReqInPatList();
  256. }
  257. /**
  258. * @desc : 협진관리 화면 open
  259. * @
  260. * @param :
  261. * @return :
  262. * @author : 오지훈
  263. * @---------------------------------------------------
  264. */
  265. function fOpenCnstPat(){
  266. var currow = ds_inpatlist.rowposition;
  267. if(currow < 0){
  268. return;
  269. }
  270. var pid = ds_inpatlist.getColumn(currow, "pid");
  271. var hngnm = ds_inpatlist.getColumn(currow, "hngnm");
  272. var sa = ds_inpatlist.getColumn(currow, "sa");
  273. var orddeptcd = ds_inpatlist.getColumn(currow, "orddeptcd");
  274. var medispclid = ds_inpatlist.getColumn(currow, "medispclid");
  275. var medispclnm = ds_inpatlist.getColumn(currow, "medispclnm");
  276. var indd = ds_inpatlist.getColumn(currow, "indd");
  277. var roomcd = ds_inpatlist.getColumn(currow, "roomcd");
  278. var cretno = ds_inpatlist.getColumn(currow, "cretno");
  279. var patinfo = hngnm + "▦" + sa + "▦" + orddeptcd + "▦" + medispclid + "▦" + cretno + "▦" + medispclnm;
  280. frmf_setParameter("SPMMO03600_pid" , pid);
  281. frmf_setParameter("SPMMO03600_orddd" , indd);
  282. frmf_setParameter("SPMMO03600_roomcd" , roomcd);
  283. frmf_setParameter("SPMMO03600_patinfo", patinfo);
  284. frmf_setParameter("SPMMO03600_ioflag" , "I");
  285. frmf_modal("SPMMO03600", "SPMMO03600", null, null, null, null, null, null, null, null, null, null, "M");
  286. fReqInPatList();
  287. }
  288. /**
  289. * @desc : 간호 TPR 조회
  290. * @
  291. * @param :
  292. * @return :
  293. * @author :박유진 20091102
  294. * @---------------------------------------------------
  295. */
  296. function fCallCareTPRInfo(){
  297. var currow = ds_inpatlist.rowposition;
  298. var pid = ds_inpatlist.getColumn(currow, "pid");
  299. var indd = ds_inpatlist.getColumn(currow, "indd");
  300. var cretno = ds_inpatlist.getColumn(currow, "cretno");
  301. var instcd = sysf_getUserInfo("dutplceinstcd");
  302. frmf_setParameter("SMMNR00900_Param", "pid▦indd▦cretno▦instcd▦gbn▩" + pid + "▦" + indd + "▦" + cretno + "▦" + instcd +"▦dr▩");
  303. var curNurTprObj = frmf_findPopup("SMMNR00900"); //활성화된 간호 TPR 화면 object loading
  304. if(!utlf_isNull(curNurTprObj)){ //간호 TPR 화면 refresh
  305. curNurTprObj.fInitialize("init");
  306. curNurTprObj.fInitViewer();
  307. curNurTprObj.lf_emrSetTimer();
  308. } else {
  309. frmf_open("SMMNR00900", "SMMNR00900", null, null, null, null, null, null, null, null, null, null, "M");
  310. }
  311. }
  312. /**
  313. * @desc : 그리드 data 엑셀화일로 저장
  314. * @
  315. * @param :
  316. * @return :
  317. * @author : 오지훈
  318. * @---------------------------------------------------
  319. */
  320. function fSaveGridToExcel(){
  321. grdf_exportExcel(grd_inpatlist, "입원환자리스트", "입원");
  322. }
  323. /**
  324. * @desc : 입원환자 리스트 조회
  325. * @
  326. * @param :
  327. * @event : 조회버튼 EVENT
  328. * @return :
  329. * @author : 오지훈
  330. * @---------------------------------------------------
  331. */
  332. function fReqInPatList(){
  333. parent.parent.ds_cond_inpatlist.copyData(ds_cond);
  334. ds_cond.setColumn(0, "srchdd", ds_cond.getColumn(0, "indd"));
  335. ds_reqInPat.copyData(ds_cond);
  336. var compsrefcnts = ds_gridseq.getColumn(0, "compsrefcnts");
  337. var compssizecnts = ds_gridseq.getColumn(0, "compssizecnts");
  338. if(utlf_isNull(compsrefcnts)) compsrefcnts = "";
  339. if(utlf_isNull(compssizecnts)) compssizecnts = "";
  340. ds_reqInPat.addColumn("compsrefcnts", "string", 1024);
  341. ds_reqInPat.addColumn("compssizecnts", "string", 1024);
  342. ds_reqInPat.setColumn(0, "compsrefcnts", compsrefcnts);
  343. ds_reqInPat.setColumn(0, "compssizecnts", compssizecnts);
  344. //20190411 이돈희 : 본원 내과전체 조회 - orddeptcd를 allim으로 셋팅
  345. if(Div00.CheckBox_allim.value == true){
  346. ds_reqInPat.setColumn(0, "orddeptcd", "ALLIM");
  347. }
  348. var orddeptcd = ds_cond.getColumn(0, "orddeptcd");
  349. var medispclid = ds_cond.getColumn(0, "medispclid");
  350. var atdoctid = ds_cond.getColumn(0, "atdoctid");
  351. var wardcd = ds_cond.getColumn(0, "wardcd");
  352. dsf_createDs("ds_hardcd1900001012"); // 생활치료센터 부서코드 관리
  353. dsf_createDs("ds_hardcd1900001013"); // 생활치료과 부서코드 관리
  354. dsf_createDs("ds_hardcd1900001015"); // 예외적으로 생활치료센터 및 생활치료과 조회 가능한 과
  355. lf_getHardCDList("N", 1900001012, 0 , ds_hardcd1900001012);
  356. lf_getHardCDList("N", 1900001013, 0 , ds_hardcd1900001013);
  357. lf_getHardCDList("N", 1900001015, 0 , ds_hardcd1900001015);
  358. var strDutplcecdCdseqno = ds_hardcd1900001013.lookup("hardcd", sysf_getUserInfo("dutplcecd"), "cdseqno"); // 로그인 진료과의 cdseqno
  359. var strWardcdCdseqno = ds_hardcd1900001012.lookup("hardcd", wardcd, "cdseqno"); // 조회할 병동의 cdseqno
  360. //20200311 이돈희 : 생활치료과, 생활치료센터 조회가능한 예외 부서관리
  361. if(!lf_ContainsHardCD("1900001015", sysf_getUserInfo("dutplcecd"))){
  362. //20200303 이돈희 : 코로나 외부 병동은 관리하는 외부 진료과만 조회하도록 수정
  363. if(!lf_ContainsHardCD("1900001013", sysf_getUserInfo("dutplcecd")) && lf_ContainsHardCD("1900001013", orddeptcd)){
  364. sysf_messageBox("허용된 진료과 외에는 해당 진료과를 조회할 수 없습니다.", "I999");
  365. return;
  366. } else if(!lf_ContainsHardCD("1900001013", sysf_getUserInfo("dutplcecd")) && lf_ContainsHardCD("1900001012", wardcd)){
  367. sysf_messageBox("허용된 진료과 외에는 해당 병동을 조회할 수 없습니다.", "I999");
  368. return;
  369. }
  370. //20200308 이돈희 : 생활치료과 추가에 따라 본인의 생활치료과 외의 생활치료과는 조회 못하도록 수정
  371. else if(lf_ContainsHardCD("1900001013", sysf_getUserInfo("dutplcecd")) && lf_ContainsHardCD("1900001013", orddeptcd)
  372. && (sysf_getUserInfo("dutplcecd") != orddeptcd)){
  373. sysf_messageBox("허용된 진료과 외에는 해당 진료과를 조회할 수 없습니다.", "I999");
  374. return;
  375. }
  376. //20200308 이돈희 : 생활치료센터 및 과 추가에 따라 본인의 생활치료과와 연결된 생활치료센터 외에는 조회 못하도록 수정
  377. else if(lf_ContainsHardCD("1900001013", sysf_getUserInfo("dutplcecd")) && lf_ContainsHardCD("1900001012", wardcd)
  378. && strDutplcecdCdseqno != strWardcdCdseqno){
  379. sysf_messageBox("허용된 진료과 외에는 해당 병동을 조회할 수 없습니다.", "I999");
  380. return;
  381. }
  382. }
  383. //20190411 이돈희 : 내과전체 조회 - 내과전체인경우 조회조건이 전부로 조회 가능
  384. else if(Div00.CheckBox_allim.value == false && orddeptcd == "-" && medispclid == "-" && atdoctid == "-" && wardcd == "-"){
  385. sysf_messageBox("조회조건 전부가 전체가 될수는", "I004");
  386. return;
  387. }
  388. var oParam = {};
  389. oParam.id = "TRMMO04301";
  390. oParam.service = "prcpmngtapp.EtcPrcpMngt";
  391. oParam.method = "reqGetInPatList";
  392. oParam.inds = "req=" + "ds_reqInPat";
  393. oParam.outds = "ds_inpatlist=inpatlist";
  394. oParam.async = true;
  395. oParam.callback = "cf_TRMMO04301";
  396. tranf_submit(oParam);
  397. }
  398. function cf_TRMMO04301(sSvcId, nErrorCode, sErrorMsg) {
  399. var orderby = ds_cond.getColumn(0, "orderby");
  400. var sortcol = ds_cond.getColumn(0, "sortcol");
  401. if(!utlf_isNull(orderby) && !utlf_isNull(sortcol))
  402. ds_inpatlist.keystring.current = "S:" + orderby + sortcol;
  403. ds_cond.setColumn(0, "totcnt", ds_inpatlist.rowcount);
  404. var iTotalPat = ds_inpatlist.rowcount;
  405. var iJeonmunpat = ds_inpatlist.getCaseCount("drginfo=='전문'");
  406. var iIlbanPat = ds_inpatlist.getCaseCount("drginfo=='일반'");
  407. var iDansunPat = ds_inpatlist.getCaseCount("drginfo=='단순'");
  408. var iMibunryu = iTotalPat - iJeonmunpat - iIlbanPat - iDansunPat;
  409. if(iTotalPat > 0){
  410. var strResult = "[";
  411. strResult += "전문 : " + iJeonmunpat + "명(" + Math.round(iJeonmunpat/iTotalPat*100, 1) + "%), " ;
  412. strResult += "일반 : " + iIlbanPat + "명(" + Math.round(iIlbanPat/iTotalPat*100, 1) + "%), ";
  413. strResult += "단순 : " + iDansunPat + "명(" + Math.round(iDansunPat/iTotalPat*100, 1) + "%), ";
  414. strResult += "미분류 : " + iMibunryu + "명(" + Math.round(iMibunryu/iTotalPat*100, 1) + "%)";
  415. strResult += "]";
  416. stt_drginfo.text = strResult;
  417. }
  418. }
  419. /**
  420. * @desc : 환자 선택 후, 환자 정보 조회 및 기록지 화면 연동
  421. * @
  422. * @param :
  423. * @return :
  424. * @author : 오지훈
  425. * @---------------------------------------------------
  426. */
  427. function fSelectInPat(){
  428. var currow = ds_inpatlist.rowposition;
  429. if(currow < 0){
  430. return;
  431. }
  432. //처방, CP화면에 modal 또는 modaless가 뜬 경우, 환자 선택 불가
  433. if(fChkScrnDisable() == false){
  434. return;
  435. }
  436. var pid = ds_inpatlist.getColumn(currow, "pid");
  437. var orddd = ds_inpatlist.getColumn(currow, "indd");
  438. var cretno = ds_inpatlist.getColumn(currow, "cretno");
  439. var ordtype = ds_inpatlist.getColumn(currow, "ordtype");
  440. var orddeptcd = ds_inpatlist.getColumn(currow, "orddeptcd");
  441. frmf_setParameter("SPMMO016000_resnflag" , "P"); // 진료대상자에서 수술시 예방적 항생제를 띄울경우
  442. frmf_setParameter("SPMMO021100_resnflag" , "001"); // 진료대상자에서 정신과 차등수가제도 도입과 관련된 특정내역 팝업을 띄울경우
  443. frmf_setParameter("SPMMO016000_pid" , pid);
  444. frmf_setParameter("SPMMO016000_orddd" , orddd);
  445. frmf_setParameter("SPMMO016000_cretno" , cretno);
  446. frmf_setParameter("SPMMO016000_ordtype" , ordtype);
  447. frmf_setParameter("SPMMO016000_orddeptcd" , orddeptcd);
  448. var hngnm = ds_inpatlist.getColumn(currow, "hngnm");
  449. var reqptype = lf_getDsValue(ds_inpatlist, currow, "reqptype");
  450. var stnddd = ds_cond.getColumn(0, "indd");
  451. // 진행가능 여부 체크 2018.12.11 엄영만
  452. if(!fCheckBfSelectInPat()) { return; }
  453. //환자수술 여부 및 수술처방 확인, 수술처방이 없는 경우 처방화면을 blocking
  454. if(fChkPatOpPrcp(pid, stnddd, cretno)==false){
  455. var opcnfmdd = ds_opprcpinfo.getColumn(0, "opcnfmdd");
  456. //opcnfmdd = opcnfmdd.substring(0, 4) + "-" + opcnfmdd.substring(4, 6) + "-" + opcnfmdd.substring(6, 8);
  457. //messageBox("[" + hngnm + "]환자의 [" + opcnfmdd + "]일자 수술 처방을 수술탭에서", "C001");
  458. sysf_messageBox("수술 처방을 수술탭에서", "C001");
  459. }
  460. fChkPatDSCBook(pid, orddd, orddeptcd);
  461. var opstatcd = ds_opprcpinfo.getColumn(0, "opstatcd");
  462. if (opstatcd =="10") {
  463. sysf_messageBox("수술마취의뢰 내역에 환자 구분이 DSC로 되어 있습니다. \n\n 재원중인 경우 DSC 로 수술마취 확정이 불가합니다.\n\n 수술마취의뢰 정보를 확인하시기 바랍니다.", "");
  464. } else if (opstatcd =="20") {
  465. sysf_messageBox("수술마취의뢰 내역에 환자 구분이 DSC로 되어 있습니다. \n\n 수술 여부에 따라 변경 또는 취소 의뢰를 해야 합니다. \n\n 수술마취의뢰 정보를 확인하시기 바랍니다.", "");
  466. }
  467. //CP환자 여부 확인
  468. if(fChkCPPatValid(currow)==false){
  469. return;
  470. }
  471. // 진료기록에 수정된 사항이 있을 경우 저장할 것인지 묻는 함수 호출 : 2009. 07. 27 김영학
  472. var mainobj = frmf_getMainViewer();
  473. var mainscrnid = mainobj.frmf_getScreenID(); //메인화면의 기록지 ID
  474. if(mainscrnid == "SMMMR00100"){
  475. var prvIntRecPamInfRtn = mainobj.fPrevInitRecPamInfo();
  476. if(prvIntRecPamInfRtn == false){
  477. return;
  478. }// 기록지에 필수 입력사항을 입력하지 않았을 때 그냥 넘어가 버리는 오류 수정 20100305 LYJ
  479. }
  480. // 상단정보 설정 rev.70273 적용
  481. if(!fReqInPatPamInfo()) { return; }
  482. //20150717
  483. if (fChkOpDrugResn() == false) {
  484. return;
  485. }
  486. if (fChkNpDiffCalcScorResn() == false) {
  487. return;
  488. }
  489. parent.parent.frmf_setParameter("SMMMO04100_reqptype", reqptype);
  490. //20150717 /*
  491. var recflag = parent.parent.SMMMO04100_getDSMainCond("recflag");
  492. parent.parent.fOpenPrcpMainWnd(recflag); //처방화면 open
  493. //20150717 */
  494. //20150717
  495. /*
  496. //기록&처방화면 로딩
  497. this.parent.parent.lf_loadRecAndPrcpWnd();
  498. */
  499. }
  500. /**
  501. * @desc : 입원 환자 선택후 진행 가능여부 체크 및 메세지 창 팝업.
  502. * @
  503. * @param :
  504. * @return :
  505. * @author : 엄영만
  506. * @---------------------------------------------------
  507. */
  508. function fCheckBfSelectInPat() {
  509. var bRtn = true;
  510. var currow = ds_inpatlist.rowposition;
  511. if( sysf_getGlobalVariable("able_sel_patlist", "M") == "N" ) { // 환자 선택 가능 여부 체크 2012.09.03 엄영만
  512. sysf_messageBox("현재 로그인한 '"+ sysf_getUserInfo("dutplcenm") +"' 부서는 기록저장 및 처방발행이 불가능한 부서 입니다.\n\n다시 로그인 후 진행 하십시오.","E");
  513. return false;
  514. }
  515. dsf_createDsRow("ds_TRMMO04304", [{col:"pid", type:"string", size:256, val:ds_inpatlist.getColumn(currow, "pid")}
  516. ,{col:"orddd", type:"string", size:256, val:ds_inpatlist.getColumn(currow, "indd")}
  517. ,{col:"cretno", type:"string", size:256, val:ds_inpatlist.getColumn(currow, "cretno")}]);
  518. var oParam = {};
  519. oParam.id = "TRMMO04304";
  520. oParam.service = "prcpmngtapp.EtcPrcpMngt";
  521. oParam.method = "reqGetCheckBfSelectInPat";
  522. oParam.inds = "req=ds_TRMMO04304";
  523. oParam.outds = "ds_bfselectinpat=bfselectinpat";
  524. oParam.async = false;
  525. bRtn = tranf_submit(oParam);
  526. return bRtn;
  527. }
  528. /**
  529. * @desc : 전공의 등록
  530. * @
  531. * @param :
  532. * @event : 팝업창 내 환자 적용 EVENT
  533. * @return :
  534. * @author : 오지훈
  535. * @---------------------------------------------------
  536. */
  537. function fRgstCnclAtDoct(){
  538. var mypatinfo = "";
  539. var deptcd = ds_cond.getColumn(0, "orddeptcd");
  540. var userdeptcd = sysf_getUserInfo("dutplcecd");
  541. if (deptcd != userdeptcd) {
  542. sysf_messageBox("환자의 진료과가 다르면 담당의 적용을 할 수 없습니다.", "I");
  543. return;
  544. }
  545. var totrow = ds_inpatlist.rowcount;
  546. for(var currow = 0; currow < totrow ; currow++){
  547. if(ds_inpatlist.getSelect(currow)){
  548. var pid = ds_inpatlist.getColumn(currow, "pid");
  549. var indd = ds_inpatlist.getColumn(currow, "indd");
  550. var cretno = ds_inpatlist.getColumn(currow, "cretno");
  551. var seqno = ds_inpatlist.getColumn(currow, "seqno");
  552. var orddeptcd = ds_inpatlist.getColumn(currow, "orddeptcd");
  553. var tmpstr = "▦" + pid +
  554. "▦" + indd +
  555. "▦" + cretno +
  556. "▦" + seqno +
  557. "▦" + orddeptcd +
  558. "▩";
  559. mypatinfo += tmpstr;
  560. }
  561. }
  562. frmf_setParameter("apntflag" , "atdoct"); //화면 적용 구분을 전공의 등록으로 적용
  563. frmf_setParameter("mypatinfo", mypatinfo);
  564. frmf_modal("SPMMO16200", "SPMMO16200", null, null, null, null, null, null, null, null, null, null, "P");
  565. fReqInPatList();
  566. }
  567. /**
  568. * @desc : CP환자 여부 검사
  569. * @
  570. * @param :
  571. * @return :
  572. * @author : 오지훈
  573. * @---------------------------------------------------
  574. */
  575. function fChkCPPatValid(currow){
  576. var pid = ds_inpatlist.getColumn(currow, "pid");
  577. var orddd = ds_inpatlist.getColumn(currow, "indd");
  578. var cretno = ds_inpatlist.getColumn(currow, "cretno");
  579. var cpyn = ds_inpatlist.getColumn(currow, "cpyn");
  580. var hngnm = ds_inpatlist.getColumn(currow, "hngnm");
  581. var orddeptcd = ds_inpatlist.getColumn(currow, "orddeptcd");
  582. var ordtype = ds_inpatlist.getColumn(currow, "ordtype");
  583. if(utlf_isNull(orddeptcd)) orddeptcd = ds_cond.getColumn(0, "orddeptcd");
  584. if(utlf_isNull(ordtype)) ordtype = "I";
  585. ds_reqdata4.clearData();
  586. ds_reqdata4.addRow();
  587. ds_reqdata4.setColumn(0, "pid" , pid);
  588. ds_reqdata4.setColumn(0, "orddd" , orddd);
  589. ds_reqdata4.setColumn(0, "cretno" , cretno);
  590. ds_reqdata4.setColumn(0, "hngnm" , hngnm); //추가(2008.08.25)
  591. ds_reqdata4.setColumn(0, "prcpgenrflag", ordtype);
  592. ds_reqdata4.setColumn(0, "srchtabflag" , "I"); //대상자리스트탭(I/D):조회결과orddd,cretno는 외래이력의 수전정보임
  593. var oParam = {};
  594. oParam.id = "TRMMO04303";
  595. oParam.service = "prcpbaseapp.CpMngt";
  596. oParam.method = "reqGePattValidity";
  597. oParam.inds = "req=" + "ds_reqdata4";
  598. oParam.outds = "ds_rsltgetdata" + "=getdata";
  599. oParam.async = false;
  600. oParam.callback = "cf_TRMMO04303";
  601. tranf_submit(oParam);
  602. if(arErrorCode.pop("TRMMO04303") >= 0){
  603. if(ds_rsltgetdata.rowcount < 1){ //cp적용환자 tbl에 유효한 데이터가 없는 경우
  604. parent.parent.SMMMO04100_setDSRoot("cpflag", "N");
  605. return true;
  606. } else { //CP적용환자 tbl에 유효한 데이터가 있는 경우
  607. dsf_setDefaultVal(ds_rsltgetdata, "appyn:Y");
  608. var appstat = ds_rsltgetdata.getColumn(0, "appstat");
  609. var cpgnm = ds_rsltgetdata.getColumn(0, "cpgnm");
  610. var cpgappno = ds_rsltgetdata.getColumn(0, "cpgappno");
  611. var msgcnts = ds_rsltgetdata.getColumn(0, "msgcnts");
  612. var msgflag = ds_rsltgetdata.getColumn(0, "msgflag");
  613. var prtlflagcd = ds_rsltgetdata.getColumn(0, "prtlflagcd"); //01:CP,02:CPG
  614. if(appstat == 52){ //case52: 입원장 CP
  615. var rtnval = sysf_messageBox(msgcnts, msgflag);
  616. if(rtnval == 6){
  617. parent.parent.SMMMO04100_setDSRoot("cpflag", "X"); // CP Main open
  618. return true;
  619. } else {
  620. parent.parent.SMMMO04100_setDSRoot("cpflag", "N");
  621. if(fUpdtCPPatAppStatVal(41) != false && !utlf_isNull(ds_inpatlist.getColumn(currow, "cpyn"))){ //41 : CP 취소
  622. ds_inpatlist.setColumn(currow, "cpyn", "N");
  623. return;
  624. }else{
  625. return false;
  626. }
  627. }
  628. }else{
  629. if( prtlflagcd == "02" && utlf_isNull(appstat) && msgflag == "P" ){ //모니터링구분:대상자탐색 Case. CPG & 호출flag:Popup(appyn:평가용여부)
  630. //CPG적용대상자 알림 팝업 호출 (2009.05.04)
  631. frmf_setParameter("SMMMO041_hngnm" , hngnm);
  632. frmf_setParameter("SMMMO041_pid" , pid);
  633. frmf_setParameter("SMMMO041_cretno" , cretno);
  634. frmf_setParameter("SMMMO041_orddd" , orddd);
  635. frmf_setParameter("SMMMO041_ordtype" , ordtype);
  636. frmf_setParameter("SMMMO041_orddeptcd" , orddeptcd);
  637. frmf_setParameter("SMMMO041_slipnm" , ds_rsltgetdata.getColumn(0, "msgcnts")); //cpgno▦cpghistseq▦cpgnm▦slipno▦slipnm▦valusgeyn▦valunm▦guidedocucnts
  638. frmf_setParameter("SMMMO041_cpgmntrflag", appstat); //null, SPMMP03200화면에서 cpgmntrflag(M or S)으로 따짐
  639. frmf_setParameter("SMMMO041_cpgappno" , cpgappno); //적용중인 CP가 존재하면 값이 있음
  640. frmf_setParameter("SMMMO041_cpgnm" , cpgnm); //적용중인 CP가 존재하면 값이 있음
  641. frmf_modal("SPMMP03200", "SPMMP03200", null, null, null, null, null, null, null, null, null, null, "P"); //CP대상자 알람 팝업
  642. if( cpgappno > 0 && cpgappno != frmf_getParameter("SPMMP032_cpgappno") && !utlf_isNull(ds_inpatlist.getColumn(currow, "cpyn"))){ //진행중인 CP가 있는데 팝업에서 Drop한 경우 CP여부 N으로..
  643. ds_inpatlist.setColumn(currow, "cpyn", "N");
  644. }
  645. if( !utlf_isNull(frmf_getParameter("SPMMP032_cpgappno")) && frmf_getParameter("SPMMP032_cpgappno") > 0 ){
  646. parent.parent.SMMMO04100_setDSRoot("cpflag", "Y"); //CPG적용한 경우, MGPS 호출
  647. }else{
  648. parent.parent.SMMMO04100_setDSRoot("cpflag", "N"); //미적용 시 처방 화면 호출
  649. }
  650. frmf_clearParameter("SPMMP032_cpgappno");
  651. frmf_clearParameter("SMMMO041_hngnm");
  652. frmf_clearParameter("SMMMO041_pid");
  653. frmf_clearParameter("SMMMO041_cretno");
  654. frmf_clearParameter("SMMMO041_orddd");
  655. frmf_clearParameter("SMMMO041_ordtype");
  656. frmf_clearParameter("SMMMO041_orddeptcd");
  657. frmf_clearParameter("SMMMO041_slipnm");
  658. frmf_clearParameter("SMMMO041_cpgmntrflag");
  659. frmf_clearParameter("SMMMO041_cpgappno");
  660. frmf_clearParameter("SMMMO041_cpgnm");
  661. return true;
  662. } else{
  663. //case 12 : D0 ~ D1 CP
  664. //그외 case : (10 : 진행중...)
  665. if( !utlf_isNull(msgcnts) && !utlf_isNull(msgflag) ){
  666. //12: D0 처방일과 == 입원일 -> Drop 유도
  667. //그외: 오늘날짜 > CP퇴원예정일 -> Drop 유도
  668. sysf_messageBox(msgcnts, msgflag);
  669. frmf_setParameter("SMMMO043_cpgappno", cpgappno); //drop 팝업에서 인식할 수 있는 param
  670. frmf_setParameter("SMMMO043_drop" , "N"); //drop 팝업에서 인식할 수 있는 param
  671. frmf_modal("SPMMP02300", "SPMMP02300", null, null, null, null, null, null, null, null, null, null, "M"); //Drop 팝업 호출
  672. parent.parent.SMMMO04100_setDSRoot("cpflag", "N");
  673. if( frmf_getParameter("SMMMO043_drop") == "Y" ){
  674. ds_inpatlist.setColumn(currow, "cpyn", "N");
  675. }else{
  676. return false;
  677. }
  678. frmf_clearParameter("SMMMO043_cpgappno");
  679. frmf_clearParameter("SMMMO043_drop");
  680. return true;
  681. }
  682. parent.parent.SMMMO04100_setDSRoot("cpflag", "Y");
  683. return true;
  684. }
  685. }
  686. }
  687. } //end submit
  688. }
  689. function cf_TRMMO04303(sSvcId, nErrorCode, sErrorMsg) {
  690. arErrorCode.push(sSvcId, nErrorCode);
  691. }
  692. /**
  693. * @desc : 미수행처방관리 화면 Open
  694. * @
  695. * @param :
  696. * @return :
  697. * @author : 오지훈
  698. * @---------------------------------------------------
  699. */
  700. function fOpenInFinPrcp(){
  701. var currow = ds_inpatlist.rowposition;
  702. if(currow < 0){
  703. return;
  704. }
  705. var pid = ds_inpatlist.getColumn(currow, "pid");
  706. var orddeptcd = ds_inpatlist.getColumn(currow, "orddeptcd");
  707. var medispclid= ds_inpatlist.getColumn(currow, "medispclid");
  708. frmf_setParameter("SMMMO02800_pid" , pid);
  709. frmf_setParameter("SMMMO02800_ioflag" , "I");
  710. frmf_setParameter("SMMMO02800_orddeptcd", orddeptcd);
  711. frmf_setParameter("SMMMO02800_orddrid" , medispclid);
  712. frmf_open("SMMMO02800", "SMMMO02800", null, null, null, null, null, null, null, null, null, null, "M");
  713. }
  714. /**
  715. * @desc : 입원환자리스트 색상설정
  716. * : 내환자적용 환자는 color instance에 ffffff이외의 값이 들어옴
  717. * @param :
  718. * @return :
  719. * @author : 오지훈
  720. * @---------------------------------------------------
  721. */
  722. function fChngGrdCellColor(color){
  723. if(color == undefined || color == "" || color == "ffffff")
  724. color = "default";
  725. else
  726. color = "#" + color;
  727. return color;
  728. }
  729. //20190311 이돈희 : 글자 색상 추가 용
  730. // : 508응급병동 장기재원환자 이름 표시할 경우 사용
  731. function fChngGrdCharColor(color){
  732. if(color == undefined || color == "" || color == "ffffff")
  733. color = "default";
  734. else
  735. color = "#" + color;
  736. return color;
  737. }
  738. /**
  739. * @desc : 수술시 예방적 항생제 평가관련 사유를 입력
  740. * @param :
  741. * @return :
  742. * @author : 김영학
  743. * @---------------------------------------------------
  744. */
  745. function fChkOpDrugResn() {
  746. var currow = ds_inpatlist.rowposition;
  747. var orddeptcd = ds_inpatlist.getColumn(currow, "orddeptcd");
  748. var ordtype = ds_inpatlist.getColumn(currow, "ordtype");
  749. var hardcd = ds_opdrugresn.lookup("hardcd", orddeptcd, "hardcd");
  750. var cdseqno = ds_opdrugresn.lookup("hardcd", orddeptcd, "cdseqno");
  751. frmf_setParameter("SPMMO016000_seqno" , cdseqno);
  752. if (!utlf_isNull(hardcd)) {
  753. var resnyn = appf_getPatientInfoDetail("resnyn");
  754. if( ordtype == "I" && (utlf_isNull(resnyn) || resnyn == false) ) { // TF에서는 isNull(false) 가 true를 반환한다
  755. frmf_modal("SPMMO16000", "SPMMO16000", null, false, 1, 510, 427, null, null, "min=true,max=true,resize=true", null, null, "M");
  756. }
  757. }
  758. return true;
  759. }
  760. /**
  761. * @desc : 입원환자 선택시 입원일이후 DSC 수술의뢰 또는 확정이 되어 있는 경우 경고를 띄워줌
  762. * @param :
  763. * @return :
  764. * @author : 김영학
  765. * @---------------------------------------------------
  766. */
  767. function fChkPatDSCBook(pid, orddd, orddeptcd){
  768. ds_reqdata3.clearData();
  769. ds_reqdata3.addRow();
  770. ds_reqdata3.getColumn(0, "pid" , pid);
  771. ds_reqdata3.getColumn(0, "orddd" , orddd);
  772. ds_reqdata3.getColumn(0, "orddeptcd" , orddeptcd);
  773. var oParam = {};
  774. oParam.id = "TRMMO04309";
  775. oParam.service = "prcpmngtapp.EtcPrcpMngt";
  776. oParam.method = "reqGetChkPatDSCBook";
  777. oParam.inds = "req=" + "ds_reqdata3";
  778. oParam.outds = "ds_opprcpinfo" + "=opprcpinfo";
  779. oParam.async = false;
  780. tranf_submit(oParam);
  781. }
  782. function fPrtPatList() {
  783. if(utlf_isNull(ds_cond.getColumnInfo("orddeptnm"))) ds_cond.addColumn("orddeptnm", "string");
  784. if(utlf_isNull(ds_cond.getColumnInfo("medispclnm"))) ds_cond.addColumn("medispclnm", "string");
  785. if(utlf_isNull(ds_cond.getColumnInfo("atdocnm"))) ds_cond.addColumn("atdocnm", "string");
  786. ds_cond.setColumn(0, "orddeptnm", Div00.cmb_orddept.text);
  787. ds_cond.setColumn(0, "medispclnm", Div00.cmb_medispclid.text);
  788. ds_cond.setColumn(0, "atdocnm", Div00.cmb_atdoctid.text);
  789. var objDOM = rptf_createDOM(); // DOM 객체 설정
  790. rptf_setNodeListToDOM(objDOM, "/root/main/inpatinfo/inpatlist", ds_inpatlist); // 데이터셋 1
  791. rptf_setNodeListToDOM(objDOM, "/root/main/cond", ds_cond); // 데이터셋 2
  792. sysf_trace(objDOM.documentElement.source); // XML 내용출력
  793. var objParam = new Object();
  794. objParam.xml_data_XML1 = objDOM.documentElement.source; // 최상의노드 XML 스트링 추출
  795. var option = "open=1;save=1;directprint=0;print=1;zoom=0;";
  796. rptf_exeReportPreview30(["RPMMO04103"],[objParam], option);
  797. }
  798. /**
  799. * @desc : 정신과 의료급여 환자 환자수진별 입/퇴원 유형 입력 - 정신과 의료급여환자 차등수가제 관련 추가. 요청번호 :
  800. * @param :
  801. * @return :
  802. * @author : 김영학
  803. * @---------------------------------------------------
  804. */
  805. function fChkNpDiffCalcScorResn() {
  806. var currow = ds_inpatlist.rowposition;
  807. var orddeptcd = ds_inpatlist.getColumn(currow, "orddeptcd");
  808. var ordtype = ds_inpatlist.getColumn(currow, "ordtype");
  809. var insukind = ds_inpatlist.getColumn(currow, "insukind");
  810. var patdeptcd = ds_npdeptcd.lookup("hardcd", orddeptcd, "hardcd");
  811. var userdeptcd = ds_npdeptcd.lookup("hardcd", sysf_getUserInfo("dutplcecd"), "hardcd");
  812. if (!utlf_isNull(patdeptcd) && !utlf_isNull(userdeptcd)) {
  813. var resnyn = appf_getPatientInfoDetail("npresnyn");
  814. if(ordtype == "I" && resnyn == "000" && (insukind == "21" || insukind == "22")) {
  815. frmf_setParameter ( "SPMMO21100_title1" , "입원유형입력"); //정신과 의료급여 환자
  816. frmf_setParameter ( "SPMMO21100_title2" , "정신과 차등수가제도 특정내역"); //정신과 의료급여 환자
  817. frmf_setParameter ( "SPMMO21100_resnflag" , "001"); //입원유형사유입력
  818. frmf_setParameter ( "SPMMO21100_hardcdno" , "174"); //입원유형사유 HARDCODE 번호
  819. frmf_setParameter ( "SPMMO21100_pid" , ds_inpatlist.getColumn(currow, "pid"));
  820. frmf_setParameter ( "SPMMO21100_orddd" , ds_inpatlist.getColumn(currow, "indd"));
  821. frmf_setParameter ( "SPMMO21100_cretno" , ds_inpatlist.getColumn(currow, "cretno"));
  822. frmf_setParameter ( "SPMMO21100_orddeptcd" , orddeptcd);
  823. frmf_setParameter ( "SPMMO21100_ordtype" , ordtype);
  824. frmf_modal("SPMMO21100", "SPMMO21100", null, false, 1, 510, 427, null, null, "min=true,max=true,resize=true", null, null, "M");
  825. }
  826. }
  827. return true;
  828. }
  829. /**
  830. * @desc : 안전사고 보고
  831. * @param :
  832. * @return :
  833. * @author : 엄영만
  834. * @---------------------------------------------------
  835. */
  836. function fPatQi(){
  837. var currow = ds_inpatlist.rowposition;
  838. var pid = ds_inpatlist.getColumn(currow, "pid");
  839. var orddd = ds_inpatlist.getColumn(currow, "indd");
  840. var cretno = ds_inpatlist.getColumn(currow, "cretno");
  841. var ordtype = "I";
  842. var oprsrvno = "";
  843. frmf_setParameter("SMMQR00100_PARAM2", pid + "▦" + orddd + "▦" + cretno + "▦" + ordtype+"▦" + oprsrvno);
  844. frmf_modal("SMMQR00100", "SMMQR00100", null, null, null, null, null, null, null, null, null, null, "M");
  845. }
  846. /**
  847. * @desc : 환자라벨출력
  848. * @param :
  849. * @return :
  850. * @author : 엄영만
  851. * @---------------------------------------------------
  852. */
  853. function fPrintPatLabel(){
  854. var currow = ds_inpatlist.rowposition;
  855. var pid = ds_inpatlist.getColumn(currow, "pid");
  856. var patnm = ds_inpatlist.getColumn(currow, "hngnm");
  857. var sexage = ds_inpatlist.getColumn(currow, "sa");
  858. frmf_setParameter("SMMMB00100_scrnid" , "SMMMO04100");
  859. frmf_setParameter("SMMMB00100_pid" , pid);
  860. frmf_setParameter("SMMMB00100_patnm" , patnm);
  861. frmf_setParameter("SMMMB00100_sexage" , sexage);
  862. frmf_modal("SMMMB00100", "SMMMB00100", null, null, null, null, null, null, null, null, null, null, "M");
  863. }
  864. function fSendSmsInPat(){
  865. fSendSmsPatList(grd_inpatlist, ds_inpatlist);
  866. }
  867. /**
  868. * @desc : 중증응급 (마우스 오른쪽 버튼 이벤트 )
  869. * @param :
  870. * @return :
  871. * @author : 김영학
  872. * @---------------------------------------------------
  873. */
  874. function fErRecoverWardRgst() {
  875. var currow = ds_inpatlist.rowposition;
  876. var pid = ds_inpatlist.getColumn(currow, "pid");
  877. var indd = ds_inpatlist.getColumn(currow, "indd");
  878. var cretno = ds_inpatlist.getColumn(currow, "cretno");
  879. var hngnm = ds_inpatlist.getColumn(currow, "hngnm");
  880. var recovwardcd = ds_inpatlist.getColumn(currow, "recovwardcd");
  881. frmf_setParameter("SPMNE04600_pid" , pid);
  882. frmf_setParameter("SPMNE04600_indd" , indd);
  883. frmf_setParameter("SPMNE04600_cretno" , cretno);
  884. frmf_setParameter("SPMNE04600_hngnm" , hngnm);
  885. frmf_setParameter("SPMNE04600_recovwardcd" , recovwardcd);
  886. frmf_modal("SPMNE04600", "SPMNE04600", null, null, null, null, null, null, null, null, null, null, "M"); // 중증응급등록
  887. fReqInPatList(); // 대상자 리스트 재조회
  888. }
  889. /**
  890. * @desc : 중증응급 환자조회
  891. * @param :
  892. * @return :
  893. * @author : 엄영만 2015.05.22
  894. * @---------------------------------------------------
  895. */
  896. function fErRecoverWardSrch() {
  897. frmf_open("SPMNE04700", "SPMNE04700", null, null, null, null, null, null, null, null, null, null, "M"); // 중증응급 환자조회
  898. }
  899. //20190219 이돈희 : 빈병상예고 창 활성화
  900. function fNotiEmptyBed(){
  901. var iRow = ds_inpatlist.rowposition;
  902. var pid = ds_inpatlist.getColumn(iRow, "pid");
  903. var hngnm = ds_inpatlist.getColumn(iRow, "hngnm");
  904. var indd = ds_inpatlist.getColumn(iRow, "indd");
  905. var cretno = ds_inpatlist.getColumn(iRow, "cretno");
  906. frmf_setParameter("SMMMO04300_pid", pid);
  907. frmf_setParameter("SMMMO04300_indd", indd);
  908. frmf_setParameter("SMMMO04300_cretno", cretno);
  909. frmf_open("SPMMO00410", "SPMMO00410", null, null, null, null, null, null, null, null, null, null, "M");
  910. }
  911. //20190219 이돈희 : 전실예고 창 활성화
  912. function fNotiChangeRoom(){
  913. var iRow = ds_inpatlist.rowposition;
  914. var pid = ds_inpatlist.getColumn(iRow, "pid");
  915. var hngnm = ds_inpatlist.getColumn(iRow, "hngnm");
  916. var indd = ds_inpatlist.getColumn(iRow, "indd");
  917. var cretno = ds_inpatlist.getColumn(iRow, "cretno");
  918. frmf_setParameter("SMMMO04300_pid", pid);
  919. frmf_setParameter("SMMMO04300_indd", indd);
  920. frmf_setParameter("SMMMO04300_cretno", cretno);
  921. frmf_open("SPMMO00420", "SPMMO00420", null, null, null, null, null, null, null, null, null, null, "M");
  922. }
  923. //20190411 이돈희 : 내과전체 선택 처리
  924. function fSetAllIM(){
  925. Div00.CheckBox_allim.value = true;
  926. Div00.cmb_orddept.value = "-"; // 진료과 전체 설정
  927. }]]></Script>