SMMNH029.js 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818
  1. /*
  2. 호스피스 환자관리(SMMNH02900.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var currentdate = getCurrentDate();//현재일자
  7. var sdate = ((currentdate.toDate()).getAddDate(-1, "M")).getDateFormat(); //보름전
  8. /**
  9. * @group :
  10. * @ver : 2007.04.10
  11. * @by : 하재륜
  12. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  13. * @type : function
  14. * @access : public
  15. * @desc : 호스피스 환자관리 조회
  16. * 조회조건 (조회시작,종료일, 환자구분) 필수
  17. * @param :
  18. * @param :
  19. * @return :
  20. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  21. */
  22. function fSearch(){
  23. var gubun;
  24. //xpath
  25. var xHospiceListPath = '/root/main/hospice/hospicelist';
  26. if(model.getValue("/root/temp/pamcgubun")==''){
  27. messageBox("환자구분을 ","C002");
  28. return;
  29. }
  30. //상세내역 영역 초기화
  31. model.resetInstanceNode("/root/main/hospiceinfo/hospicedetl");
  32. grp_buttom.refresh();
  33. //조회조건 set
  34. model.removenodeset(xHospiceListPath);
  35. model.removenode("/root/send");
  36. model.makeValue("/root/send/fbrthdd", model.getValue("/root/main/cond/fbrthdd"));
  37. model.makeValue("/root/send/lbrthdd", model.getValue("/root/main/cond/lbrthdd"));
  38. //일반 산재 구분
  39. if((model.getValue("/root/temp/hospicegubun") == "1 2")||(model.getValue("/root/temp/hospicegubun") == "2 1")){
  40. gubun = "3"
  41. }else if(model.getValue("/root/temp/hospicegubun") == ""){
  42. gubun = "0";
  43. }else {
  44. gubun = model.getValue("/root/temp/hospicegubun");
  45. }
  46. model.makeValue("/root/send/hospicegubun", gubun);
  47. model.makeValue("/root/send/pamcgubun", model.getValue("/root/temp/pamcgubun"));
  48. //환자구분이 제외(O)이면 제외사유 조회조건 추가
  49. if(model.getValue("/root/temp/pamcgubun")=="O"){
  50. model.makeValue("/root/send/M0066list",model.getValue("/root/init/M0066list"));
  51. }
  52. model.makeValue("/root/send/pid", model.getValue("/root/temp/pid"));
  53. model.removenode('/root/main/hospice');
  54. if(submit("TRMNH02901")){
  55. var RowCnt = grd_hospicelist.rows - grd_hospicelist.fixedRows;
  56. if(RowCnt < 1){
  57. model.removeNodeset("/root/main/hospiceinfo/hospicedetl");
  58. messageBox("조회된 자료가 ","I004");
  59. }
  60. //종결처리 되지않은 임종환자에 대한 메세지를 출력한다.
  61. var dethMsg = '';//임종환자메세지변수
  62. var dethNm, dethPid, dethDt; //임종환자 이름, 등록번호, 임종일 변수
  63. for(var i = 1; i <= RowCnt ; i++){
  64. //DETHYN이 Y(AGONALDD는 null이고 DETHDT가 있을때)
  65. if(model.getValue(xHospiceListPath + "[" + i + "]/dethyn") == 'Y'){
  66. dethPid = model.getValue(xHospiceListPath + "[" + i + "]/pid");
  67. dethNm = model.getValue(xHospiceListPath + "[" + i + "]/hngnm");
  68. dethDt = model.getValue(xHospiceListPath + "[" + i + "]/dethdt");
  69. dethDt = dethDt.substring(0, 4) + '/' + dethDt.substring(4, 6) + '/' + dethDt.substring(6,8);
  70. dethMsg += dethPid + ' ' + dethNm+ '님 임종. 임종일:' + dethDt + '\r\n';
  71. }
  72. }
  73. if(dethMsg != ''){
  74. //alert(dethMsg);
  75. if(messageBox("사망등록현황"+ '\r\n'+dethMsg+ '\r\n'+"사망처리 하시겠습니까?","Q") != 6) return;
  76. fAgonalUpdate();
  77. fSearch();
  78. }
  79. //입실대기자수를 조회한다.
  80. // fCntSearch();
  81. }else{
  82. messageBox('조회를', 'E009');
  83. return false;
  84. }
  85. }
  86. /**
  87. * @group :
  88. * @ver : 2008.05.22
  89. * @by : 하재륜
  90. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  91. * @type : function
  92. * @access : public
  93. * @desc : 사망등록 처리가 된 환자를 호스피스 테이블에 사망등록을업데이트 한다.
  94. * @param :
  95. * @param :
  96. * @return :
  97. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  98. */
  99. function fAgonalUpdate(){
  100. var RowCnt = grd_hospicelist.rows - grd_hospicelist.fixedRows;
  101. var xHospiceListPath = '/root/main/hospice/hospicelist';
  102. var sDethData =
  103. "pid" //01 등록번호
  104. + "▦cretdt" //02 생성일자
  105. + "▦reqdeptcd" //03 의뢰과
  106. + "▦reqdd" //04 의뢰일
  107. + "▦instcd" //05 병원기관코드
  108. + "▦stat" //06 호스피스상태
  109. + "▦dethdt" //07 사망시간
  110. + "▦exptresn" //08 제외사유
  111. + "▦dschtype" //09 퇴원사유
  112. + "▩" ;
  113. for(var i = 1; i <= RowCnt ; i++){
  114. //DETHYN이 Y(AGONALDD는 null이고 DETHDT가 있을때)
  115. if(model.getValue(xHospiceListPath + "[" + i + "]/dethyn") == 'Y'){
  116. // 제외사유(exptresn)가 임종(03)
  117. // 퇴실사유(dschtype)가 병원임종(01)
  118. sDethData +=
  119. model.getValue(xHospiceListPath + "[" + i + "]/pid") //01 등록번호
  120. + "▦" + model.getValue(xHospiceListPath + "[" + i + "]/cretdt") //02 생성일자
  121. + "▦" + model.getValue(xHospiceListPath + "[" + i + "]/reqdeptcd") //03 의뢰과
  122. + "▦" + model.getValue(xHospiceListPath + "[" + i + "]/reqdd") //04 의뢰일
  123. + "▦" + model.getValue(xHospiceListPath + "[" + i + "]/instcd") //05 병원기관코드
  124. + "▦" + model.getValue(xHospiceListPath + "[" + i + "]/stat") //06 호스피스상태
  125. + "▦" + (model.getValue(xHospiceListPath + "[" + i + "]/dethdt")).substring(0, 8) //07 사망시간
  126. + "▦" + "03" //08 제외사유
  127. + "▦" + "01" //09 퇴원사유
  128. + "▩" ;
  129. }
  130. }
  131. model.removenode("/root/send");
  132. model.makeNode("/root/send");
  133. model.makeValue("/root/send/sDethData" ,sDethData );
  134. submit('TXMNH02906');
  135. }
  136. /**
  137. * @group :
  138. * @ver : 2007.04.10
  139. * @by : 하재륜
  140. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  141. * @type : function
  142. * @access : public
  143. * @desc : 그리드 클릭시..환자상세정보 조회
  144. * @param :
  145. * @return :
  146. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  147. */
  148. function fClicedGrid(){
  149. if(grd_hospicelist.row == 0){
  150. return;
  151. }
  152. model.resetInstanceNode("/root/main/hospiceinfo/hospicedetl");
  153. model.refresh();
  154. var iRow = -1;
  155. iRow = grd_hospicelist.row;
  156. var RowCnt = grd_hospicelist.rows - grd_hospicelist.fixedRows;
  157. if(RowCnt < 1){
  158. grd_hospicelist.row = 1;
  159. return;
  160. }
  161. model.removenode("/root/send");
  162. model.makeValue("/root/send/pid", model.getValue("/root/main/hospice/hospicelist"+"["+iRow+"]/pid"));
  163. model.makeValue("/root/send/indd", model.getValue("/root/main/hospice/hospicelist"+"["+iRow+"]/indd"));
  164. model.makeValue("/root/send/cretno", model.getValue("/root/main/hospice/hospicelist"+"["+iRow+"]/cretno"));
  165. model.makeValue("/root/send/cretdt", model.getValue("/root/main/hospice/hospicelist"+"["+iRow+"]/cretdt"));
  166. model.makeValue("/root/send/reqformrecseq", model.getValue("/root/main/hospice/hospicelist"+"["+iRow+"]/reqformrecseq"));
  167. model.makeValue("/root/send/pamcgubun", model.getValue("/root/main/hospice/hospicelist"+"["+iRow+"]/stat"));
  168. model.makeValue("/root/send/reqdeptcd", model.getValue("/root/main/hospice/hospicelist"+"["+iRow+"]/reqdeptcd"));
  169. model.makeValue("/root/send/reqdd", model.getValue("/root/main/hospice/hospicelist"+"["+iRow+"]/reqdd"));
  170. if(submit("TRMNH02902")){
  171. //진단명
  172. cmb_diagcd1.dispatch("xforms-value-changed");
  173. /*
  174. var indd = model.getValue('/root/main/hospiceinfo/hospicedetl/indd');
  175. if(indd == '00000000'){
  176. cmb_exptresn.disabled = false;
  177. cmb_dschtype.disabled = true;
  178. }else{
  179. cmb_exptresn.disabled = true;
  180. cmb_dschtype.disabled = false;
  181. }
  182. */
  183. //본원타원
  184. if(cmb_reqtypeflag.value=="1"){
  185. cmb_reqhospnm.disabled=true;
  186. }else if(cmb_reqtypeflag.value=="2"){
  187. cmb_reqhospnm.disabled=false;
  188. }
  189. if(ipt_intvdd.value == ""){
  190. ipt_intvdd.value = getCurrentDate();
  191. }
  192. }else{
  193. messageBox('조회를', 'E009');
  194. return false;
  195. }
  196. model.refresh();
  197. }
  198. /**
  199. * @group :
  200. * @ver : 2007.04.10
  201. * @by : 하재륜
  202. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  203. * @type : function
  204. * @access : public
  205. * @desc : 화면 로드시
  206. * @param : 7일
  207. * @return : 현재날짜에서 -7일한 날짜
  208. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  209. */
  210. function getAddDay(addend){
  211. var backDate ="";
  212. var Now = new Date();
  213. // (오늘날짜의 Time - (하루 * 7))
  214. Now.setTime(Now.getTime()-(86400000*addend));
  215. NowYear = Now.getYear();// 년
  216. NowMonth = Now.getMonth()+1;// 월
  217. NowDay = Now.getDate(); // 일
  218. backDate += NowYear ; //년도
  219. if (NowMonth < 10 ) backDate += "0" + NowMonth ;
  220. else backDate += (Now.getMonth() + 1);
  221. if (NowDay < 10 ) backDate += "0" + NowDay ;
  222. else backDate += (Now.getDate());
  223. return backDate ;
  224. }
  225. /**
  226. * @group :
  227. * @ver : 2007.04.10
  228. * @by : 하재륜
  229. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  230. * @type : function
  231. * @access : public
  232. * @desc : 호스피스 환자관리 저장
  233. * @param :
  234. * @param :
  235. * @return :
  236. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  237. */
  238. var xDetlPath = '/root/main/hospiceinfo/hospicedetl';
  239. function fSave(waitstat){
  240. if(fIsValid(waitstat)){
  241. model.removenode("/root/send");
  242. model.makeNode("/root/send");
  243. model.copyNode("/root/send", xDetlPath);
  244. if(submit("TXMNH02903")){
  245. var RowCnt = grd_hospicelist.rows - grd_hospicelist.fixedRows;
  246. if(RowCnt < 1){
  247. return;
  248. }
  249. }
  250. fSearch();
  251. }
  252. }
  253. /**
  254. * @group :
  255. * @ver : 2007.11.19
  256. * @by : dhkim
  257. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  258. * @type : function
  259. * @access : public
  260. * @param : saveWaitStat(환자관리내역저장구분 : S, 대기자전환구분 : W)
  261. * @param :
  262. * @return :
  263. * @desc : 호스피스 환자관리내역을 저장하기 전 유효성 체크를 실행한다.
  264. * R (의뢰) : 면담일이(intvdd)입력된상태
  265. * W (대기) : 대기자로 저장 버튼 클릭해서 들어온 경우 (의뢰컨설트로 들어온 환자인경우나 외래입원예약을 하여 입원해 있는 환자의 경우)
  266. * 대기일자(waitdt)는 현재일자, 입실일자(inrmdt), 퇴실(제외)일(enddd), 제외사유(exptresn), 퇴실사유(dschtype), 임종일자(agonaldd)를 null로 넘긴다.
  267. * I (입실) : 입실일자(inrmdt)가 입력되어있는 상태, 실제입원되어 있는 환자중 호스피스 병동(병동코드 : '3050136000')이 아닐때 입실일자가 입력되면 경고메세지를 출력한다.
  268. * L (퇴실) : 퇴실(제외)일이 입력되고, 퇴원사유가 입력된 상태..
  269. * O (제외) : 제외사유가 입력되고 퇴실(제외)일이 입력된 상태...
  270. *
  271. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  272. */
  273. function fIsValid(saveWaitStat){
  274. var agonaldd = model.getValue(xDetlPath + "/agonaldd"); //임종일 체크
  275. var enddd = model.getValue(xDetlPath + "/enddd"); //종결일
  276. var status = model.getValue(xDetlPath + "/status"); //상태(컨설트의뢰O, 입원예약만I, 입원예약해서 재원S)
  277. var dschtype = model.getValue(xDetlPath + "/dschtype"); //퇴원사유
  278. var exptresn = model.getValue(xDetlPath + "/exptresn"); //제외사유
  279. var inrmdt = model.getValue(xDetlPath + "/inrmdt"); //입실일자
  280. var inrmtm = model.getValue(xDetlPath + "/inrmtm"); //입실시간
  281. if((inrmdt == "")||(inrmdt == null)){
  282. model.setValue(xDetlPath + "/inrmtm", ""); //입실시간
  283. }else{
  284. model.setValue(xDetlPath + "/inrmtm", getCurrentTime().substr(0,4)); //입실시간
  285. }
  286. var intvdd = model.getValue(xDetlPath + "/intvdd"); //면담일자
  287. var wardcd = model.getValue(xDetlPath + "/wardcd"); //병실코드
  288. var waitstat = model.getValue(xDetlPath + "/waitstat"); //대기상태(의뢰R, 대기W, 입실I, 퇴실L, 제외O)
  289. if(model.getValue("/root/main/hospiceinfo/hospicedetl/pid") == ""){
  290. messageBox("저장할 환자를 ","C002");
  291. return false;
  292. }
  293. //대기자저장
  294. if(saveWaitStat == "W"){
  295. if(model.getValue(xDetlPath + "/waitstat") == "W") {
  296. messageBox("대기자인 환자입니다.","E");
  297. return;
  298. }
  299. if(messageBox("대기자로 전환하시겠습니까?","Q") != 6) return;
  300. //대기상태 일때 의뢰컨설트, 입원예약+입원환자의 경우
  301. //대기상태는 W, 대기일자는 currentDate,
  302. //면담일, 종결일, 제외사유, 퇴원사유, 임종일, 임종장소 null처리
  303. model.setValue(xDetlPath + "/waitstat", "W");
  304. model.setValue(xDetlPath + "/waitdt", getCurrentDate());
  305. model.setValue(xDetlPath + "/inrmdt", "");
  306. model.setValue(xDetlPath + "/inrmtm", "");
  307. model.setValue(xDetlPath + "/enddd", "");
  308. model.setValue(xDetlPath + "/exptresn", "");
  309. model.setValue(xDetlPath + "/dschtype", "");
  310. model.setValue(xDetlPath + "/agonaldd", "");
  311. model.setValue(xDetlPath + "/agonaldd", "");
  312. }
  313. //saveWaitStat가 W(대기)상태 빼고는 전부 S임....(면담, 입원, 종결 , 퇴실)
  314. else if(saveWaitStat == "S"){
  315. if(messageBox("","Q002") != 6) return;
  316. //면담일자가 입력되면 waitstat는 R(의뢰)
  317. if(intvdd != "" && waitstat != "W"){
  318. model.setValue(xDetlPath + "/waitstat", "R");
  319. model.setValue(xDetlPath + "/waitdt", "");
  320. }
  321. //입실일자 있으면 waitstat는 I(입실),
  322. //종결일이 입력되어있지 않으면 제외사유, 퇴원사유, 임종일 null처리
  323. if(inrmdt!=""){
  324. //실제입원되어 있는 환자중 호스피스 병동(병동코드 : '3050136000')이 아닐때 입실일자가 입력되면 경고메세지를 출력한다.
  325. if(wardcd == '3050136000'){
  326. model.setValue(xDetlPath + "/waitstat","I") ;
  327. }else{
  328. messageBox('호스피스병동에 입원한 환자가 아니므로 입실일을 입력', 'E001');
  329. model.setValue(xDetlPath + "/inrmdt", "");
  330. model.setValue(xDetlPath + "/inrmtm", "");
  331. return false;
  332. }
  333. }
  334. //제외일(enddd)이 입력되어 있으면 제외사유(exptresn)나 퇴원사유(dschtype)중 하나가 반드시 입력되어야한다.
  335. //제외일(enddd)이 입력되어 있을때 제외사유(exptresn)가 임종(03)이면 agonaldd에 enddd넣어줌..
  336. //제외일(enddd)이 입력되어 있을때 퇴실사유(dschtype)가 병원임종(01)이면 agonaldd에 enddd넣어줌..
  337. if(enddd==""){
  338. model.setValue(xDetlPath + "/exptresn","")
  339. model.setValue(xDetlPath + "/dschtype","")
  340. model.setValue(xDetlPath + "/agonaldd","")
  341. }else if(enddd!=""){
  342. //퇴실일
  343. if(dschtype!=""){
  344. if(dschtype == '01'){
  345. model.setValue(xDetlPath + "/agonaldd", enddd);
  346. }
  347. model.setValue(xDetlPath + "/waitstat","O");
  348. }
  349. //제외일
  350. if(exptresn!=""){
  351. if(exptresn == '03'){
  352. model.setValue(xDetlPath + "/agonaldd", enddd);
  353. }
  354. model.setValue(xDetlPath + "/waitstat","O");
  355. }
  356. if(dschtype == '' && exptresn == ''){//퇴실일,제외일이 널일때)
  357. messageBox("제외사유나 퇴원사유를 ","C001");
  358. return false;
  359. }
  360. }
  361. }
  362. return true;
  363. }
  364. /**
  365. * @group :
  366. * @ver : 2007.05.14
  367. * @by : 하재륜
  368. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  369. * @type : function
  370. * @access : public
  371. * @desc : popup 기록지등록화면을 호출한다.
  372. * inpt에 등록되어 있는 환자만 (status : O, S) 기록지를 호출 할 수 있다.
  373. * @param :
  374. * @return :
  375. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  376. */
  377. function fhospice_popmenu(){
  378. var hngnm = model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/hngnm");
  379. if(model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/status") == "I"){
  380. messageBox(hngnm +" 환자는 입실환자가 아니므로 기록지를 열 수","I004");
  381. return;
  382. }else if(model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/stat") == "R" ){
  383. messageBox(hngnm +" 환자는 대기(입실)환자가 아니므로 기록지를 열 수","I004");
  384. return;
  385. }
  386. var RowCnt = grd_hospicelist.rows - grd_hospicelist.fixedRows;
  387. if(RowCnt < 1){
  388. grd_hospicelist.row = 1;
  389. return;
  390. }
  391. //호스피스 기록지를 띄울때 pid, cretdt가 필요함...
  392. setParameter("pid", model.getValue("/root/main/hospice/hospicelist"+"["+(grd_hospicelist.row)+"]/pid"));
  393. setParameter("cretdt", model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/cretdt"));
  394. setParameter("reqdeptcd", model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/reqdeptcd"));
  395. setParameter("reqdd", model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/reqdd"));
  396. setParameter("wardcd", model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/wardcd"));
  397. modal("SMMNH01500",1,50,50); //호스피스기록지
  398. }
  399. /**
  400. * @group :
  401. * @ver : 2007.05.14
  402. * @by : 하재륜
  403. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  404. * @type : function
  405. * @access : public
  406. * @desc : 환자구분에따라 인풋박스활성화 여부
  407. * @param :
  408. * @return :
  409. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  410. */
  411. function fPamcChange() {
  412. var idx = model.getValue("/root/temp/pamcgubun");
  413. if(idx=="A"){//전체
  414. caption26.visible = false;
  415. cmb_expt.visible = false; //제외사유
  416. caption30.visible = false;
  417. ipt_pid.visible = false; //등록번호
  418. cmb_exptresn.disabled = false;
  419. cmb_dschtype.disabled = true;
  420. }else if(idx=="R"){//의뢰
  421. caption26.visible = false;
  422. cmb_expt.visible = false; //제외사유
  423. caption30.visible = false;
  424. ipt_pid.visible = false; //등록번호
  425. cmb_exptresn.disabled = false;
  426. cmb_dschtype.disabled = true;
  427. }else if(idx=="W"){//대기
  428. caption26.visible = false;
  429. cmb_expt.visible = false; //제외사유
  430. caption30.visible = false;
  431. ipt_pid.visible = false; //등록번호
  432. cmb_exptresn.disabled = false;
  433. cmb_dschtype.disabled = true;
  434. }else if(idx=="I"){//입실
  435. caption26.visible = false;
  436. cmb_expt.visible = false; //제외사유
  437. caption30.visible = false;
  438. ipt_pid.visible = false; //등록번호
  439. cmb_exptresn.disabled = true;
  440. cmb_dschtype.disabled = false;
  441. }else if(idx=="L"){//퇴실
  442. caption26.visible = false;
  443. cmb_expt.visible = false; //제외사유
  444. caption30.visible = true;
  445. ipt_pid.visible = true; //등록번호
  446. cmb_exptresn.disabled = true;
  447. cmb_dschtype.disabled = false;
  448. }else if(idx=="O"){//제외
  449. caption26.visible = true;
  450. cmb_expt.visible = true; //제외사유
  451. caption30.visible = false;
  452. ipt_pid.visible = false; //등록번호
  453. cmb_exptresn.disabled = false;
  454. cmb_dschtype.disabled = true;
  455. }
  456. model.removenodeset("/root/main/hospice/hospicelist");
  457. model.resetInstanceNode("/root/main/hospiceinfo/hospicedetl");
  458. model.refresh();
  459. }
  460. /**
  461. * @group :
  462. * @ver : 2007.11.19
  463. * @by : dhkim
  464. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  465. * @type :
  466. * @access : public
  467. * @desc : 제외사유입력시 퇴원사유입력불가처리,
  468. * 퇴원사유입려시 제외사유입력불가처리
  469. * @param :
  470. * @return :
  471. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  472. */
  473. function fIsExptresnDisabledYn(){
  474. //제외사유
  475. var exptresn = model.getValue('/root/main/hospiceinfo/hospicedetl/exptresn');
  476. if(exptresn != ''){
  477. model.setValue('/root/main/hospiceinfo/hospicedetl/dschtype', '');
  478. model.setValue('/root/main/hospiceinfo/hospicedetl/enddd', currentdate);
  479. cmb_dschtype.disabled = false;
  480. cmb_exptresn.disabled = true;
  481. }else{
  482. cmb_dschtype.disabled = true;
  483. cmb_exptresn.disabled = false;
  484. }
  485. //퇴원사유
  486. var dschtype = model.getValue('/root/main/hospiceinfo/hospicedetl/dschtype');
  487. if(dschtype != ''){
  488. model.setValue('/root/main/hospiceinfo/hospicedetl/exptresn', '');
  489. model.setValue('/root/main/hospiceinfo/hospicedetl/enddd', currentdate);
  490. cmb_exptresn.disabled = false;
  491. cmb_dschtype.disabled = true;
  492. }else{
  493. cmb_exptresn.disabled = true;
  494. cmb_dschtype.disabled = false;
  495. }
  496. model.refresh();
  497. }
  498. /**
  499. * @group :
  500. * @ver : 2007.06.29
  501. * @by : 하재륜
  502. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  503. * @type : function
  504. * @access : public
  505. * @desc : Hospice follow up sheet
  506. * @param :
  507. * @return :
  508. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  509. */
  510. function fhospice_follow(){
  511. var hngnm = model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/hngnm");
  512. if( model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/inrmdt") == ""
  513. && model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/waitdt") == "" ){
  514. messageBox(hngnm +" 환자는 대기(입실) 이력이 없으므로 Hospice follow up sheet를 열 수","I004");
  515. return;
  516. }
  517. var RowCnt = grd_hospicelist.rows - grd_hospicelist.fixedRows;
  518. if(RowCnt < 1){
  519. grd_hospicelist.row = 1;
  520. return;
  521. }
  522. var pid = setParameter("pid",model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/pid"));
  523. var cretno = setParameter("cretno",model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/cretno"));
  524. var cretdt = setParameter("cretdt",model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/cretdt"));
  525. var indd = setParameter("indd",model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/indd"));
  526. modal("SMMNH01400",1,50,50);
  527. }
  528. /**
  529. * @group :
  530. * @ver : 2007.06.29
  531. * @by : 하재륜
  532. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  533. * @type : function
  534. * @access : public
  535. * @desc : 사별가족 관리
  536. * @param :
  537. * @return :
  538. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  539. */
  540. function fhospice_agonal(){
  541. var RowCnt = grd_hospicelist.rows - grd_hospicelist.fixedRows;
  542. if(RowCnt < 1){
  543. grd_hospicelist.row = 1;
  544. return;
  545. }
  546. modal("SMMNH00700",1,50,50);
  547. }
  548. /**
  549. * @group :
  550. * @ver : 2007.06.29
  551. * @by : 하재륜
  552. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  553. * @type : function
  554. * @access : public
  555. * @desc : 환자가족 등록
  556. * @param :
  557. * @return :
  558. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  559. */
  560. function fhospice_famy(){
  561. var pid = model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/pid");
  562. var hngnm = model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/hngnm");
  563. var sexage = model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/sexage");
  564. var rrgstno = model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/rrgstno");
  565. var RowCnt = grd_hospicelist.rows - grd_hospicelist.fixedRows;
  566. if(RowCnt < 1){
  567. grd_hospicelist.row = 1;
  568. return;
  569. }
  570. setParameter("pid", pid);
  571. setParameter("hngnm", hngnm);
  572. setParameter("sexage", sexage);
  573. setParameter("rrgstno", rrgstno);
  574. modal("SMMNH03500",1,50,50);
  575. }
  576. /**
  577. * @group :
  578. * @ver : 2007.06.29
  579. * @by : 하재륜
  580. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  581. * @type : function
  582. * @access : public
  583. * @desc : 호스피스 회신기록
  584. * @param :
  585. * @return :
  586. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  587. */
  588. function fhospice_rec(){
  589. var hngnm = model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/hngnm");
  590. var status = model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/status");
  591. var reqformrecseq = model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/reqformrecseq");
  592. if(status != "O" ){
  593. messageBox(hngnm +" 환자는 컨설트 의뢰환자가 아니므로 회신기록 화면을 볼 수 ","I004");
  594. return;
  595. }
  596. //setParameter("openmode", "recform");
  597. //setParameter("formrecseq", reqformrecseq);
  598. setParameter("openmode", "reccnstform");
  599. setParameter("formrecseq", reqformrecseq); //서식기록테이블의 formrecseq(기록순번)
  600. setParameter("userdeptcd", "2390000000");
  601. modal("../../../emr/medirecweb/xrw/SSMMR01100_서식로더.xrw", 1, 0, 0 ,"", "", "");
  602. }
  603. /**
  604. * @group :
  605. * @ver : 2007.07.19
  606. * @by : 하재륜
  607. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  608. * @type : function
  609. * @access : public
  610. * @desc : 호스피스 입실대기 환자수를 조회
  611. * 입실대기자수를 조회하여 입실대기자수필드에 카운트시킨다.
  612. * 입실대기자수는 대기자명단중에 입실 병동이 호스피스인 것만 카운트 시킨다.
  613. * 입실대기자수가 1보다 작으면 입실등록버튼을 비활성화하고 0보다크면 활성화 시킨다.
  614. * @param :
  615. * @param :
  616. * @return :
  617. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  618. */
  619. function fCntSearch(){
  620. if((model.getValue("/root/main/cond/fbrthdd")=='')||(model.getValue("/root/main/cond/lbrthdd")=='')){
  621. messageBox("조회기간의 날짜를 ","C001");
  622. return;
  623. }
  624. model.removenode("/root/send");
  625. model.removenode("/root/hidden");
  626. model.makeValue("/root/send/fbrthdd", model.getValue("/root/main/cond/fbrthdd"));
  627. model.makeValue("/root/send/lbrthdd", model.getValue("/root/main/cond/lbrthdd"));
  628. if(!submit("TRMNH02904")){
  629. messageBox('조회를', 'E009');
  630. return false;
  631. }else{
  632. model.makeValue("/root/hidden/cnt", model.getValue("/root/temp/htfa/htfacnt/rownum"));
  633. opt_cnt.refresh();
  634. fromdd = model.getValue("/root/main/cond/fbrthdd");
  635. todd = model.getValue("/root/main/cond/lbrthdd");
  636. var cnt = opt_cnt.value;
  637. if(Number(cnt) > 0)
  638. btn_ipt.disabled = false;
  639. else
  640. btn_ipt.disabled = true;
  641. }
  642. }
  643. /**
  644. * @group :
  645. * @ver : 2007.12.16
  646. * @by : dhkim
  647. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  648. * @type : function
  649. * @access : public
  650. * @desc : 입실대기자가 있을때 입실등록버튼을 클릭하면 호출된다.<b>
  651. * 입실대기자수는 따로 조회를 해 와서 입실등록 버튼을 누르면 해당 대기환자들 정보를 가지고 있다가
  652. * 입실상태 waitstat : I, 입실일을 등록일자로 바꿔준다.
  653. * 입실대기자수가 1보다 작으면 입실등록버튼을 비활성화하고 0보다크면 활성화 시킨다.
  654. * @param :
  655. * @param :
  656. * @return :
  657. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  658. */
  659. function fWaitPsnInRoom(){
  660. model.removenode('/root/send');
  661. model.makeValue('/root/send/htfacnt', grd_htfawaitInfo.getUpdateDataAll('u'));
  662. if(!submit('TXMNH02905')){
  663. messageBox('조회를', 'E009');
  664. return false;
  665. }
  666. }