SMMNH02900.js 92 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139
  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. var top_pid = "";
  9. /**
  10. * @group :
  11. * @ver : 2007.04.10
  12. * @by : 하재륜
  13. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  14. * @type : function
  15. * @access : public
  16. * @desc : 호스피스 환자관리 조회
  17. * 조회조건 (조회시작,종료일, 환자구분) 필수
  18. * @param :
  19. * @param :
  20. * @return :
  21. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  22. */
  23. function fSearch(){
  24. //20090819 dhkim 신환등록버튼 의뢰선택시에만 visible
  25. var pamcgubun = model.getValue("/root/temp/pamcgubun");
  26. fShowNewPatient(false);
  27. if(pamcgubun == 'R'){
  28. btn_newpat.attribute('visibility') = 'visible';
  29. }else{
  30. btn_newpat.attribute('visibility') = 'hidden';
  31. }
  32. //fPamcChange();//구분에 따른 그리드 컬럼 정의
  33. var gubun = "";
  34. //xpath
  35. var xHospiceListPath = '/root/main/hospice/hospicelist';
  36. if(model.getValue("/root/temp/pamcgubun") == ""){
  37. messageBox("환자구분을 ","C002");
  38. return;
  39. }
  40. //상세내역 영역 초기화
  41. model.resetInstanceNode("/root/main/hospiceinfo/hospicedetl");
  42. grp_buttom.refresh();
  43. //조회조건 set
  44. model.removenodeset(xHospiceListPath);
  45. model.removenode("/root/send");
  46. model.makeValue("/root/send/fbrthdd", model.getValue("/root/main/cond/fbrthdd"));
  47. model.makeValue("/root/send/lbrthdd", model.getValue("/root/main/cond/lbrthdd"));
  48. //일반 산재 구분
  49. if((model.getValue("/root/temp/hospicegubun") == "1 2")||(model.getValue("/root/temp/hospicegubun") == "2 1")){
  50. gubun = "3"
  51. }else if(model.getValue("/root/temp/hospicegubun") == ""){
  52. gubun = "0";
  53. }else {
  54. gubun = model.getValue("/root/temp/hospicegubun");
  55. }
  56. //2017.08.21 자문형 호스피스 서비스 추가
  57. if( model.getValue("/root/temp/hospicestsgb") != "1" && model.getValue("/root/temp/hospicestsgb") != "2"){
  58. model.setValue("/root/temp/hospicestsgb", "");
  59. }
  60. model.makeValue("/root/send/hospicegubun", gubun);
  61. model.makeValue("/root/send/pamcgubun", model.getValue("/root/temp/pamcgubun"));
  62. model.makeValue("/root/send/hospicestsgb", model.getValue("/root/temp/hospicestsgb"));
  63. model.makeValue("/root/send/resncd", model.getValue("/root/temp/resncd"));
  64. model.makeValue("/root/send/refflag", model.getValue("/root/temp/refflag"));
  65. model.makeValue("/root/send/refnm", model.getValue("/root/temp/refnm"));
  66. model.removenode("/root/main/hospice");
  67. if(submit("TRMNH02901")){
  68. var RowCnt = grd_hospicelist.rows - grd_hospicelist.fixedRows;
  69. if(RowCnt < 1){
  70. model.resetInstanceNode("/root/main/hospiceinfo/hospicedetl");
  71. messageBox("조회된 자료가 ","I004");
  72. }
  73. //20090925 dhkim 호스피스환자 consult취소시 취소현황알림 팝업창 생성 (변경요청 itc김숙인)
  74. var cstCancelMsg = "";//컨설트취소환자메세지변수
  75. var cstCancelCnt = 0;
  76. var cstpid, cstNm, cstDt;
  77. //종결처리 되지않은 임종환자에 대한 메세지를 출력한다.
  78. var dethMsg = '';//임종환자메세지변수
  79. var dethNm, dethPid, dethDt; //임종환자 이름, 등록번호, 임종일 변수
  80. for(var i = 1; i <= RowCnt ; i++){
  81. //서비스종료,대기종료,퇴실은 사망프로세스 안태운다.
  82. //if( (model.getValue(xHospiceListPath + "[" + i + "]/enddd") != "") ||
  83. // (model.getValue(xHospiceListPath + "[" + i + "]/waitenddd") != "") ||
  84. // (model.getValue(xHospiceListPath + "[" + i + "]/dschdd") != "") )
  85. //{
  86. // continue;
  87. //}
  88. //DETHYN이 Y(AGONALDD는 null이고 DETHDT가 있을때)
  89. if( pamcgubun == "R"|| pamcgubun == "W" || pamcgubun == "D"|| pamcgubun == "I") {//의뢰, 대기, 분산, 입실
  90. if(model.getValue(xHospiceListPath + "[" + i + "]/dethyn") == "Y"){
  91. dethPid = model.getValue(xHospiceListPath + "[" + i + "]/pid");
  92. dethNm = model.getValue(xHospiceListPath + "[" + i + "]/hngnm");
  93. dethDt = model.getValue(xHospiceListPath + "[" + i + "]/dethdt");
  94. dethDt = dethDt.substring(0, 4) + '/' + dethDt.substring(4, 6) + '/' + dethDt.substring(6,8);
  95. dethMsg += dethPid + ' ' + dethNm+ '님 임종. 임종일:' + dethDt + '\r\n';
  96. }
  97. }
  98. //20090925 dhkim 호스피스환자 consult취소시 취소현황알림 팝업창 생성 (변경요청 itc김숙인)
  99. //의뢰/대기/분산/입실 조회시에만 알릴것
  100. cstCancelCnt = model.getValue(xHospiceListPath + "[" + i + "]/cstcancel");
  101. if(pamcgubun == "R" || pamcgubun == "W" || pamcgubun == "D" || pamcgubun == "I"){//의뢰, 대기, 분산, 입실
  102. if(cstCancelCnt > 0){
  103. cstpid = model.getValue(xHospiceListPath + "[" + i + "]/pid");
  104. cstNm = model.getValue(xHospiceListPath + "[" + i + "]/hngnm");
  105. cstDt = model.getValue(xHospiceListPath + "[" + i + "]/cstcanceldt");
  106. cstCancelMsg += cstpid + ' ' + cstNm+ '님 취소. 취소일:' + cstDt + '\r\n';
  107. }
  108. }
  109. }
  110. //var nodeCnt = parseInt(getNodesetCount("/root/main/hospice/reqcncllist"))+1;
  111. //if( nodeCnt > 1 ) {
  112. // var reqcnclMsg = "", pid, hngnm, cncldd;
  113. // for( var j = 1; j < nodeCnt; j++ ) {
  114. // pid = model.getValue("/root/main/hospice/reqcncllist[" + j + "]/pid");
  115. // hngnm = model.getValue("/root/main/hospice/reqcncllist[" + j + "]/hngnm");
  116. // cncldd = model.getValue("/root/main/hospice/reqcncllist[" + j + "]/cncldd");
  117. //
  118. // reqcnclMsg += pid + " " + hngnm + "님 의뢰취소일 : " + cncldd.substring(0,4) + "/" + cncldd.substring(4,6) + "/" + cncldd.substring(6,8) + "\r\n";
  119. // }
  120. //}
  121. if( dethMsg != "" ) {
  122. messageBox("사망등록현황\r\n" + dethMsg, "I000");
  123. }
  124. //20090925 dhkim 호스피스환자 consult취소시 취소현황알림 팝업창 생성 (변경요청 itc김숙인)
  125. if( cstCancelMsg != "" ) {
  126. messageBox("의뢰취소현황\r\n" + cstCancelMsg, "I000");
  127. }
  128. //if( reqcnclMsg != "" ) {
  129. // messageBox("의뢰취소현황\r\n" + reqcnclMsg, "I000");
  130. //}
  131. //2009.02.11 메세지창만 보이고 개별적으로 퇴실, 대기종료, 서비스종료 처리함
  132. //if(dethMsg != ''){
  133. // if(messageBox("사망등록현황"+ '\r\n'+dethMsg+ '\r\n'+"사망처리 하시겠습니까?","Q") != 6) return;
  134. // fAgonalUpdate();
  135. // fSearch();
  136. // }
  137. //입실대기자수를 조회한다.
  138. fCntSearch();
  139. }else{
  140. messageBox('조회를', 'E009');
  141. return false;
  142. }
  143. }
  144. /**
  145. * @group :
  146. * @ver : 2008.05.22
  147. * @by : 하재륜
  148. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  149. * @type : function
  150. * @access : public
  151. * @desc : 사망등록 처리가 된 환자를 호스피스 테이블에 사망등록을업데이트 한다.
  152. * @param :
  153. * @param :
  154. * @return :
  155. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  156. */
  157. function fAgonalUpdate(){
  158. var RowCnt = grd_hospicelist.rows - grd_hospicelist.fixedRows;
  159. var xHospiceListPath = '/root/main/hospice/hospicelist';
  160. var sDethData =
  161. "pid" //01 등록번호
  162. + "▦cretdd" //02 생성일자
  163. + "▦crettm" //03 생성시간
  164. + "▦instcd" //04 병원기관코드
  165. + "▦waitstat" //05 호스피스상태
  166. + "▦status" //05_1 입원경로
  167. + "▦dethdt" //06 사망시간
  168. + "▦exptresn" //07 서비스종료사유
  169. + "▦waitendresn" //08 대기종료사유
  170. + "▦dschtype" //09 퇴실형태
  171. + "▦dschresn" //10 퇴실사유
  172. + "▦cretno" //11 생성번호
  173. + "▦indd" //12 입원일
  174. + "▦reqdeptcd" //13 의뢰과
  175. + "▦reqdd" //14 의뢰일
  176. + "▦atdoctid" //15 주치의ID
  177. + "▦atdoctnm" //16 주치의명
  178. + "▦reqtypeflags" //17 의뢰형태
  179. + "▩" ;
  180. for(var i = 1; i <= RowCnt ; i++){
  181. //DETHYN이 Y(AGONALDD는 null이고 DETHDT가 있을때)
  182. if(model.getValue(xHospiceListPath + "[" + i + "]/dethyn") == 'Y'){
  183. // 서비스종료사유(exptresn) 가 임종(03)
  184. // 대기종료사유 (waitendresn)가 병원임종(04)
  185. // 퇴실형태 (dschtype) 가 병원임종(02)
  186. // 퇴실사유 (dschresn") 가 병원임종(02)
  187. sDethData +=
  188. model.getValue(xHospiceListPath + "[" + i + "]/pid") //01 등록번호
  189. + "▦" + model.getValue(xHospiceListPath + "[" + i + "]/cretdd") //02 생성일자
  190. + "▦" + model.getValue(xHospiceListPath + "[" + i + "]/crettm") //03 생성시간
  191. + "▦" + model.getValue(xHospiceListPath + "[" + i + "]/instcd") //04 병원기관코드
  192. + "▦" + model.getValue("/root/temp/pamcgubun") //05 호스피스상태
  193. + "▦" + model.getValue(xHospiceListPath + "[" + i + "]/status") //05_1 입원경로
  194. + "▦" + (model.getValue(xHospiceListPath + "[" + i + "]/dethdt")).substring(0, 8) //06 사망시간
  195. + "▦" + "03" //07 서비스종료사유
  196. + "▦" + "04" //08 대기종료사유
  197. + "▦" + "02" //09 퇴실형태
  198. + "▦" + "02" //10 퇴원사유
  199. + "▦" + model.getValue(xHospiceListPath + "[" + i + "]/cretno") //11 퇴실사유
  200. + "▦" + model.getValue(xHospiceListPath + "[" + i + "]/indd") //12 입원일
  201. + "▦" + model.getValue(xHospiceListPath + "[" + i + "]/reqdeptcd") //13 의뢰과
  202. + "▦" + model.getValue(xHospiceListPath + "[" + i + "]/reqdd") //14 의뢰일
  203. + "▦" + model.getValue(xHospiceListPath + "[" + i + "]/atdoctid") //15 주치의ID
  204. + "▦" + model.getValue(xHospiceListPath + "[" + i + "]/atdoctnm") //16 주치의명
  205. + "▦" + model.getValue(xHospiceListPath + "[" + i + "]/reqtypeflags") //17 의뢰형태
  206. + "▩" ;
  207. }
  208. }
  209. model.removenode("/root/send");
  210. model.makeNode("/root/send");
  211. model.makeValue("/root/send/sDethData" ,sDethData );
  212. submit("TXMNH02906");
  213. }
  214. /**
  215. * @group :
  216. * @ver : 2007.04.10
  217. * @by : 하재륜
  218. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  219. * @type : function
  220. * @access : public
  221. * @desc : 그리드 클릭시..환자상세정보 조회
  222. * @param :
  223. * @return :
  224. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  225. */
  226. function fClicedGrid(){
  227. var pamcgubn = model.getValue("/root/temp/pamcgubun");//구분
  228. var nsgbn = model.getValue("/root/main/hospice/hospicelist[" + grd_hospicelist.row + "]/nsgbn");//의뢰경로
  229. var roomcd = model.getValue("/root/main/hospice/hospicelist[" + grd_hospicelist.row + "]/roomcd");//의뢰경로
  230. if( pamcgubn == "R"||pamcgubn == "W"||pamcgubn == "I" ) {
  231. if( nsgbn == "외래" ) {//외래환자의 경우 대기로만 할수있음 분산자전환 버튼 비활성화
  232. if( roomcd == "" ) {//현병실이 없으면
  233. btn_districhg.disabled = true; //분산자전환
  234. }else {
  235. btn_districhg.disabled = false; //분산자전환
  236. }
  237. }else {
  238. btn_districhg.disabled = false;//분산자전환
  239. }
  240. }else if( pamcgubn == "D" ){//2009.01.21 분산자이면 대기자전환 활성화
  241. btn_waitchg.disabled = true;//대기자전환
  242. }
  243. if(grd_hospicelist.row == 0){
  244. return;
  245. }
  246. model.resetInstanceNode("/root/main/hospiceinfo/hospicedetl");
  247. //model.refresh();
  248. var iRow = -1;
  249. iRow = grd_hospicelist.row;
  250. var RowCnt = grd_hospicelist.rows - grd_hospicelist.fixedRows;
  251. if(RowCnt < 1){
  252. grd_hospicelist.row = 1;
  253. return;
  254. }
  255. model.removenode("/root/send");
  256. model.makeValue("/root/send/pid", model.getValue("/root/main/hospice/hospicelist"+"["+iRow+"]/pid"));
  257. model.makeValue("/root/send/indd", model.getValue("/root/main/hospice/hospicelist"+"["+iRow+"]/indd"));
  258. model.makeValue("/root/send/cretno", model.getValue("/root/main/hospice/hospicelist"+"["+iRow+"]/cretno"));
  259. model.makeValue("/root/send/cretdd", model.getValue("/root/main/hospice/hospicelist"+"["+iRow+"]/cretdd"));
  260. model.makeValue("/root/send/crettm", model.getValue("/root/main/hospice/hospicelist"+"["+iRow+"]/crettm"));
  261. //model.makeValue("/root/send/reqformrecseq", model.getValue("/root/main/hospice/hospicelist"+"["+iRow+"]/reqformrecseq"));
  262. model.makeValue("/root/send/pamcgubun", model.getValue("/root/temp/pamcgubun"));
  263. model.makeValue("/root/send/reqdeptcd", model.getValue("/root/main/hospice/hospicelist"+"["+iRow+"]/reqdeptcd"));
  264. model.makeValue("/root/send/reqdd", model.getValue("/root/main/hospice/hospicelist"+"["+iRow+"]/reqdd"));
  265. model.makeValue("/root/send/refflag", model.getValue("/root/temp/refflag"));
  266. model.makeValue("/root/send/refnm", model.getValue("/root/temp/refnm"));
  267. model.makeValue("/root/send/refflag", "1");//상위 진단 조회
  268. submit("TRMNH02905", false);
  269. // if(submit("TRMNH02902")){
  270. submit("TRMNH02902", false);
  271. var status = model.getValue("/root/main/hospiceinfo/hospicedetl/status");
  272. var reqdd = model.getValue("/root/main/hospiceinfo/hospicedetl/reqdd");
  273. var waitdd = model.getValue("/root/main/hospiceinfo/hospicedetl/waitdd");
  274. var inrmdd = model.getValue("/root/main/hospiceinfo/hospicedetl/inrmdd");
  275. var enddd = model.getValue("/root/main/hospiceinfo/hospicedetl/enddd");
  276. var waitenddd = model.getValue("/root/main/hospiceinfo/hospicedetl/waitenddd");
  277. var dschdd = model.getValue("/root/main/hospiceinfo/hospicedetl/dschdd");
  278. //종교 가톨릭시 세레명 활성화
  279. if ( cmb_religncd.value == "1" ){
  280. ipt_baptnm.disabled = false;
  281. }else{
  282. ipt_baptnm.disabled = true;
  283. }
  284. //의뢰사유 기타선택시 기타사유명입력칸활성화
  285. if ( cmb_reqresnflag.value == "99" ){
  286. ipt_reqresnetc.disabled = false;
  287. }else{
  288. ipt_reqresnetc.disabled = true;
  289. }
  290. //관리현황 의뢰와 대기시만 활성화
  291. if (( pamcgubn == "R" )||( pamcgubn == "W" )){
  292. cmb_mngtprescd.disabled = false;
  293. }else{
  294. cmb_mngtprescd.disabled = true;
  295. }
  296. //본원타원
  297. if( cmb_reqtypeflag.value == "01" ){//본원
  298. cmb_reqhospnm.visible = false;//타 병원 리스트
  299. cmb_reqdeptnm.visible = true;//본원 진료과 리스트
  300. model.removenode("/root/send");
  301. model.makeValue("/root/send/orddeptcd", model.getValue("/root/main/hospiceinfo/hospicedetl/reqtypespec"));
  302. submit("TRMNH02903");
  303. cmb_drlist.visible = true;//의사리스트
  304. opt_reqtypespec.visible = false;
  305. }else if( cmb_reqtypeflag.value == "02"){
  306. cmb_reqhospnm.visible = true;
  307. cmb_reqdeptnm.visible = false;//본원 진료과 리스트
  308. cmb_drlist.visible = false;//의사리스트
  309. opt_reqtypespec.visible = false;
  310. }else if( cmb_reqtypeflag.value == "03"){
  311. cmb_reqhospnm.visible = false;//타 병원 리스트
  312. cmb_reqdeptnm.visible = true;//본원 진료과 리스트
  313. model.removenode("/root/send");
  314. model.makeValue("/root/send/orddeptcd", model.getValue("/root/main/hospiceinfo/hospicedetl/reqhospnm"));
  315. submit("TRMNH02903");
  316. cmb_drlist.visible = true;//의사리스트
  317. opt_reqtypespec.visible = false;
  318. }
  319. var diagcd1 = model.getValue("/root/main/hospiceinfo/hospicedetl/diagcd1");
  320. model.removenode("/root/send");
  321. model.makeValue("/root/send/diagcd1", diagcd1);
  322. model.makeValue("/root/send/refflag", "2");//하위 진단 조회
  323. submit("TRMNH02906", false);
  324. cmb_calcscoryn.disabled = true;//수가대상
  325. if( pamcgubn == "R" ) {//의뢰
  326. if(ipt_intvdd.value == ""){//면담일
  327. ipt_intvdd.value = getCurrentDate();
  328. }
  329. ipt_inrmdd.disabled = true;//입실일
  330. ipt_waitdd.disabled = false;//대기전환일
  331. ipt_waitenddd.disabled = true;//대기 종료일
  332. cmb_waitendresn.disabled = true;//대기 종료 사유
  333. ipt_waitendresnetc.disabled = true;//기타 사유
  334. ipt_enddd.disabled = true;//서비스 종료
  335. model.setValue("/root/main/hospiceinfo/hospicedetl/enddd","");
  336. cmb_exptresn.disabled = true;
  337. model.setValue("/root/main/hospiceinfo/hospicedetl/exptresn","");
  338. ipt_exptresnetc.disabled = true;
  339. model.setValue("/root/main/hospiceinfo/hospicedetl/exptresnetc","");
  340. ipt_dschdd.disabled = true;
  341. model.setValue("/root/main/hospiceinfo/hospicedetl/dschdd","");
  342. cmb_dschresn.disabled = true;
  343. model.setValue("/root/main/hospiceinfo/hospicedetl/dschresn","");
  344. ipt_dschresnetc.disabled = true;
  345. model.setValue("/root/main/hospiceinfo/hospicedetl/dschresnetc","");
  346. cmb_dschtype.disabled = true;
  347. model.setValue("/root/main/hospiceinfo/hospicedetl/dschtype","");
  348. cmb_dschlnk.disabled = true;
  349. model.setValue("/root/main/hospiceinfo/hospicedetl/dschlnk","");
  350. ipt_dschlnketc.disabled = true;
  351. model.setValue("/root/main/hospiceinfo/hospicedetl/dschlnketc","");
  352. }else if( pamcgubn == "W" ) {//대기
  353. /*
  354. if( nsgbn == "외래" ) {
  355. ipt_waitenddd.disabled = false;//대기종료일
  356. cmb_waitendresn.disabled = false;
  357. if(cmb_waitendresn.value == "99"){//대기종료사유
  358. ipt_waitendresnetc.disabled = false;
  359. }else{
  360. ipt_waitendresnetc.value = "";
  361. ipt_waitendresnetc.disabled = true;
  362. }
  363. ipt_enddd.disabled = true;//서비스 종료일
  364. cmb_exptresn.disabled = true;
  365. ipt_exptresnetc.disabled = true;
  366. }else if( nsgbn == "입원" ) {
  367. ipt_waitenddd.disabled = false;
  368. cmb_waitendresn.disabled = false;
  369. if(cmb_waitendresn.value == "99"){//대기종료사유
  370. ipt_waitendresnetc.disabled = true;
  371. }else{
  372. ipt_waitendresnetc.disabled = false;
  373. }
  374. ipt_enddd.disabled = false;//서비스 종료일
  375. cmb_exptresn.disabled = false;
  376. if(cmb_exptresn.value == "99"){
  377. ipt_exptresnetc.disabled = false;
  378. }else{
  379. ipt_exptresnetc.disabled = true;
  380. }
  381. }
  382. */
  383. ipt_waitenddd.disabled = true;//대기종료일
  384. cmb_waitendresn.disabled = true;
  385. ipt_waitendresnetc.disabled = true;
  386. ipt_enddd.disabled = false;//서비스 종료일
  387. cmb_exptresn.disabled = false;
  388. if(cmb_exptresn.value == "99"){
  389. ipt_exptresnetc.disabled = false;
  390. }else{
  391. ipt_exptresnetc.disabled = true;
  392. }
  393. if( model.getValue("/root/main/hospice/hospicelist[" + grd_hospicelist.row + "]/inrmflag") == "Y" ) {//호스피스 병동 입원
  394. ipt_inrmdd.disabled = false;
  395. }else {
  396. ipt_inrmdd.disabled = true;
  397. }
  398. ipt_dschdd.disabled = true;
  399. model.setValue("/root/main/hospiceinfo/hospicedetl/dschdd","");
  400. cmb_dschresn.disabled = true;
  401. model.setValue("/root/main/hospiceinfo/hospicedetl/dschresn","");
  402. ipt_dschresnetc.disabled = true;
  403. model.setValue("/root/main/hospiceinfo/hospicedetl/dschresnetc","");
  404. cmb_dschtype.disabled = true;
  405. model.setValue("/root/main/hospiceinfo/hospicedetl/dschtype","");
  406. cmb_dschlnk.disabled = true;
  407. model.setValue("/root/main/hospiceinfo/hospicedetl/dschlnk","");
  408. ipt_dschlnketc.disabled = true;
  409. model.setValue("/root/main/hospiceinfo/hospicedetl/dschlnketc","");
  410. }else if( pamcgubn == "D" ) {//분산 -> 자문
  411. ipt_waitenddd.disabled = false;
  412. cmb_waitendresn.disabled = false;
  413. if(cmb_waitendresn.value == "99"){
  414. ipt_waitendresnetc.disabled = false;
  415. }else{
  416. ipt_waitendresnetc.disabled = true;
  417. }
  418. ipt_enddd.disabled = true;//서비스 종료일
  419. cmb_exptresn.disabled = true;
  420. ipt_exptresnetc.disabled = true;
  421. /*
  422. if(cmb_exptresn.value == "99"){
  423. ipt_exptresnetc.disabled = false;
  424. }else{
  425. ipt_exptresnetc.disabled = true;
  426. }
  427. */
  428. if( model.getValue("/root/main/hospice/hospicelist[" + grd_hospicelist.row + "]/inrmflag") == "Y" ) {//호스피스 병동 입원
  429. ipt_inrmdd.disabled = false;
  430. }else {
  431. ipt_inrmdd.disabled = true;
  432. }
  433. ipt_dschdd.disabled = true;
  434. model.setValue("/root/main/hospiceinfo/hospicedetl/dschdd","");
  435. cmb_dschresn.disabled = true;
  436. model.setValue("/root/main/hospiceinfo/hospicedetl/dschresn","");
  437. ipt_dschresnetc.disabled = true;
  438. model.setValue("/root/main/hospiceinfo/hospicedetl/dschresnetc","");
  439. cmb_dschtype.disabled = true;
  440. model.setValue("/root/main/hospiceinfo/hospicedetl/dschtype","");
  441. cmb_dschlnk.disabled = true;
  442. model.setValue("/root/main/hospiceinfo/hospicedetl/dschlnk","");
  443. ipt_dschlnketc.disabled = true;
  444. model.setValue("/root/main/hospiceinfo/hospicedetl/dschlnketc","");
  445. btn_waitchg.disabled = false;//대기자로 전환
  446. }else if( pamcgubn == "I" ) {//입실
  447. cmb_waitendresn.disabled = true;
  448. ipt_waitenddd.disabled = true;
  449. ipt_waitendresnetc.disabled = true;
  450. ipt_enddd.disabled = true;//서비스 종료일
  451. cmb_exptresn.disabled = true;
  452. ipt_exptresnetc.disabled = true;
  453. ipt_dschdd.disabled = false;//퇴실일
  454. cmb_dschresn.disabled = false;//퇴실사유
  455. cmb_dschtype.disabled = false;//퇴실형태
  456. cmb_dschlnk.disabled = false;//퇴실 후 연계
  457. cmb_calcscoryn.disabled = false;//수가대상
  458. if(model.getValue("/root/main/hospiceinfo/hospicedetl/status") == 'D'){
  459. btn_waitchg.disabled = true;//대기자로 전환
  460. }else{
  461. btn_waitchg.disabled = false;//대기자로 전환
  462. }
  463. }else if( pamcgubn == "L" ) {//퇴실
  464. cmb_waitendresn.disabled = true;
  465. ipt_waitenddd.disabled = true;//대기 종료
  466. ipt_waitendresnetc.disabled = true;
  467. ipt_enddd.disabled = true;//서비스 종료일
  468. cmb_exptresn.disabled = true;
  469. ipt_exptresnetc.disabled = true;
  470. }else if( pamcgubn == "O" ) {//서비스종료
  471. cmb_waitendresn.disabled = true;
  472. ipt_waitenddd.disabled = true;//대기 종료
  473. ipt_waitendresnetc.disabled = true;
  474. }else if( pamcgubn == "P" ) {//대기종료
  475. ipt_waitenddd.disabled = false;//대기종료일
  476. cmb_waitendresn.disabled = false;
  477. if(cmb_waitendresn.value == "99"){//대기종료사유
  478. ipt_waitendresnetc.disabled = false;
  479. }else{
  480. ipt_waitendresnetc.value = "";
  481. ipt_waitendresnetc.disabled = true;
  482. }
  483. ipt_enddd.disabled = true;//서비스 종료일
  484. cmb_exptresn.disabled = true;
  485. ipt_exptresnetc.disabled = true;
  486. }
  487. if(cmb_exptresn.value == "99") {
  488. ipt_exptresnetc.disabled = false;
  489. }
  490. model.refresh();
  491. }
  492. /**
  493. * @group :
  494. * @ver : 2007.04.10
  495. * @by : 하재륜
  496. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  497. * @type : function
  498. * @access : public
  499. * @desc : 화면 로드시
  500. * @param : 7일
  501. * @return : 현재날짜에서 -7일한 날짜
  502. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  503. */
  504. function getAddDay(addend){
  505. var backDate ="";
  506. var Now = new Date();
  507. // (오늘날짜의 Time - (하루 * 7))
  508. Now.setTime(Now.getTime()-(86400000*addend));
  509. NowYear = Now.getYear();// 년
  510. NowMonth = Now.getMonth()+1;// 월
  511. NowDay = Now.getDate(); // 일
  512. backDate += NowYear ; //년도
  513. if (NowMonth < 10 ) backDate += "0" + NowMonth ;
  514. else backDate += (Now.getMonth() + 1);
  515. if (NowDay < 10 ) backDate += "0" + NowDay ;
  516. else backDate += (Now.getDate());
  517. return backDate ;
  518. }
  519. /**
  520. * @group :
  521. * @ver : 2007.04.10
  522. * @by : 하재륜
  523. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  524. * @type : function
  525. * @access : public
  526. * @desc : 호스피스 환자관리 저장
  527. * @param : endSaveStat(20091009 dhkim 종료버튼별저장구분추가)- true이면 해당 메세지 없이 저장한다.
  528. * @param :
  529. * @return :
  530. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  531. */
  532. var xDetlPath = '/root/main/hospiceinfo/hospicedetl';
  533. function fSave(waitstat, endSaveStat){
  534. var calcscoryn = model.getValue("/root/main/hospiceinfo/hospicedetl/calcscoryn_tmp");
  535. var dschdd = model.getValue("/root/main/hospiceinfo/hospicedetl/dschdd");
  536. var pamcgubn = model.getValue("/root/temp/pamcgubun");//구분
  537. if ( calcscoryn == "Y" && dschdd != "" ) {
  538. messageBox('수가대상 적용환자입니다.', 'E');
  539. return ;
  540. }
  541. //2017.08.21 자문형 호스피스 서비스 추가
  542. if(waitstat == "D"){
  543. model.setValue("/root/main/hospiceinfo/hospicedetl/status", "E");
  544. }
  545. //자문에서 대기자 전환 시 :둘다 WAITDD 현재일자 , status 대기자 D, 자문형 : E
  546. iRow = grd_hospicelist.row;
  547. var rowChk = model.getValue("/root/main/hospice/hospicelist"+"["+iRow+"]/status");
  548. /*
  549. if(pamcgubn == 'I'){
  550. if(waitstat == "W"){
  551. if(rowChk == "E"){
  552. model.setValue("/root/main/hospiceinfo/hospicedetl/status", "D");
  553. }
  554. }
  555. }
  556. */
  557. if(waitstat == "W"){
  558. if(rowChk == "E"){
  559. model.setValue("/root/main/hospiceinfo/hospicedetl/status", "D");
  560. }
  561. }
  562. //
  563. if(fIsValid(waitstat, endSaveStat)){
  564. model.removenode("/root/send");
  565. model.makeNode("/root/send");
  566. model.copyNode("/root/send", xDetlPath);
  567. if( submit("TXMNH02903") ){
  568. var RowCnt = grd_hospicelist.rows - grd_hospicelist.fixedRows;
  569. if(RowCnt < 1) return;
  570. }
  571. fSearch();
  572. }
  573. }
  574. /**
  575. * @group :
  576. * @ver : 2007.11.19
  577. * @by : dhkim, 하재륜
  578. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  579. * @type : function
  580. * @access : public
  581. * @param : saveWaitStat(환자관리내역저장구분 : S, 대기자전환구분 : W)
  582. * @param : endSaveStat(20091009 dhkim 종료버튼별저장구분추가)- true이면 해당 메세지 없이 저장한다.
  583. * @return :
  584. * @desc : 호스피스 환자관리내역을 저장하기 전 유효성 체크를 실행한다.
  585. * R (의뢰) : 면담일이(intvdd)입력된상태
  586. * W (대기) : 대기자로 저장 버튼 클릭해서 들어온 경우 (의뢰컨설트로 들어온 환자인경우나 외래입원예약을 하여 입원해 있는 환자의 경우)
  587. * I (입실) : 입실일자(inrmdd)가 입력되어있는 상태, 실제입원되어 있는 환자중 호스피스 병동(병동코드 : '3050136000')이 아닐때 입실일자가 입력되면 경고메세지를 출력한다.
  588. * L (퇴실) : 퇴실일이 입력되고, 퇴실사유가 입력된 상태..
  589. * O (서비스종료) : 서비스종료가 입력되고 서비스종료일이 입력된 상태...
  590. * P (대기종료) : 대기종료가 입력되고 대기종료일이 입력된 상태...
  591. *
  592. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  593. */
  594. function fIsValid(saveWaitStat, endSaveStat){
  595. var status = model.getValue(xDetlPath + "/status"); //상태(컨설트의뢰O, 입원예약만I, 입원예약해서 재원S)
  596. var enddd = model.getValue(xDetlPath + "/enddd"); //서비스종료일
  597. var waitdd = model.getValue(xDetlPath + "/waitdd"); //대기일
  598. var waitdd2 = model.getValue(xDetlPath + "/waitdd2"); //대기일
  599. var exptresn = model.getValue(xDetlPath + "/exptresn"); //서비스종료사유
  600. var waitenddd = model.getValue(xDetlPath + "/waitenddd"); //대기종료일
  601. var waitendresn = model.getValue(xDetlPath + "/waitendresn"); //대기종료사유
  602. var dschdd = model.getValue(xDetlPath + "/dschdd"); //퇴실일
  603. var dschresn = model.getValue(xDetlPath + "/dschresn"); //퇴실사유
  604. var inrmdd = model.getValue(xDetlPath + "/inrmdd"); //입실일자
  605. var inrmtm = model.getValue(xDetlPath + "/inrmtm"); //입실시간
  606. if((inrmdd == "")||(inrmdd == null)){
  607. model.setValue(xDetlPath + "/inrmtm", ""); //입실시간
  608. }else{
  609. if((inrmtm == "")||(inrmtm == null)){
  610. model.setValue(xDetlPath + "/inrmtm", getCurrentTime().substr(0,4)); //입실시간
  611. }
  612. }
  613. var intvdd = model.getValue(xDetlPath + "/intvdd"); //면담일자
  614. var waitdd = model.getValue(xDetlPath + "/waitdd"); //대기일자
  615. var wardcd = model.getValue(xDetlPath + "/wardcd"); //병실코드
  616. //var waitstat = model.getValue(xDetlPath + "/waitstat"); //대기상태(의뢰R, 대기W, 입실I, 퇴실L, 서비스종료O,대기종료P)
  617. if(model.getValue("/root/main/hospiceinfo/hospicedetl/pid") == ""){
  618. messageBox("저장할 환자를 ","C002");
  619. return;
  620. }
  621. //대기자저장
  622. if(saveWaitStat == "W"){
  623. if( model.getValue("/root/temp/pamcgubun") == "I" ) {//입실에서 대기자전환일때
  624. if( messageBox("대기자로 전환하시겠습니까?","Q" ) != 6) return;
  625. model.setValue(xDetlPath + "/waitstat","IW");
  626. }else if( model.getValue("/root/temp/pamcgubun") == "D" ) {//분산에서 대기자전환일때
  627. if( messageBox("대기자로 전환하시겠습니까?","Q" ) != 6) return;
  628. model.setValue(xDetlPath + "/waitstat","W");
  629. model.setValue(xDetlPath + "/waitdd", getCurrentDate());
  630. }else {//의뢰에서 대기자전환
  631. if( waitdd != "" ) {
  632. messageBox("대기자인 환자입니다.","E");
  633. return;
  634. }
  635. if( messageBox("대기자로 전환하시겠습니까?","Q" ) != 6) return;
  636. model.setValue(xDetlPath + "/waitstat", "W");
  637. model.setValue(xDetlPath + "/waitdd", getCurrentDate());
  638. model.setValue(xDetlPath + "/inrmdd", "");
  639. model.setValue(xDetlPath + "/inrmtm", "");
  640. model.setValue(xDetlPath + "/enddd", "");
  641. model.setValue(xDetlPath + "/exptresn", "");
  642. model.setValue(xDetlPath + "/exptresnetc", "");
  643. model.setValue(xDetlPath + "/waitenddd", "");
  644. model.setValue(xDetlPath + "/waitendresn", "");
  645. model.setValue(xDetlPath + "/waitendresnetc", "");
  646. model.setValue(xDetlPath + "/dschdd", "");
  647. model.setValue(xDetlPath + "/dschtype", "");
  648. model.setValue(xDetlPath + "/dschresn", "");
  649. model.setValue(xDetlPath + "/dschresnetc", "");
  650. model.setValue(xDetlPath + "/dschlnk", "");
  651. model.setValue(xDetlPath + "/dschlnketc", "");
  652. model.setValue(xDetlPath + "/agonaldd", "");
  653. model.setValue(xDetlPath + "/agonalplcecd", "");
  654. }
  655. }else if(saveWaitStat == "S"){//환자관리내역저장구분 //saveWaitStat가 W(대기)상태 빼고는 전부 S임....(면담, 입원, 종결 , 퇴실)
  656. //20091009 dhkim 저장구분메세지 변경 (대기종료, 서비스종료, 퇴실등록 버튼을 이용하여 들어올 경우 메세지 제외)
  657. if(endSaveStat == false){
  658. if(messageBox("","Q002") != 6) return;
  659. }
  660. //면담일자가 입력되면 waitstat는 R(의뢰)
  661. if(intvdd != ""){
  662. model.setValue(xDetlPath + "/waitstat", "R");
  663. }
  664. //대기일자가 입력되면 waitstat는 W(대기)
  665. if(waitdd != ""){
  666. model.setValue(xDetlPath + "/waitstat", "W");
  667. }
  668. //입실일자 있으면 waitstat는 I(입실)
  669. if(inrmdd == ""){
  670. model.setValue(xDetlPath + "/inrmdd", "");
  671. model.setValue(xDetlPath + "/inrmtm", "");
  672. }else if(inrmdd != ""){
  673. model.setValue(xDetlPath + "/waitstat","I");
  674. //실제입원되어 있는 환자중 호스피스 병동(병동코드 : '3050136000')이 아닐때 입실일자가 입력되면 경고메세지를 출력한다.
  675. //if(wardcd == '3050136000'){
  676. // model.setValue(xDetlPath + "/waitstat","I");
  677. //}else{
  678. // messageBox('호스피스병동에 입원한 환자가 아니므로 입실일을 입력', 'E001');
  679. // model.setValue(xDetlPath + "/inrmdd", "");
  680. // model.setValue(xDetlPath + "/inrmtm", "");
  681. // return;
  682. //}
  683. }
  684. //서비스종료일자 있으면 waitstat는 O(서비스종료)
  685. if( enddd == "" ){
  686. model.setValue(xDetlPath + "/exptresn","")
  687. model.setValue(xDetlPath + "/exptresnetc","")
  688. }else if( enddd != "" ){
  689. if( exptresn != "" ){
  690. if(exptresn == '03'){
  691. model.setValue(xDetlPath + "/agonaldd", enddd);
  692. }else{
  693. model.setValue(xDetlPath + "/agonaldd","")
  694. model.setValue(xDetlPath + "/agonalplcecd","")
  695. }
  696. model.setValue(xDetlPath + "/waitstat","O");
  697. }
  698. if(exptresn == ''){
  699. messageBox("서비스종료사유를 ","C001");
  700. return false;
  701. }
  702. }
  703. //대기종료일자 있으면 waitstat는 P(대기종료)
  704. if( waitenddd == "" ){
  705. model.setValue(xDetlPath + "/waitendresn","")
  706. model.setValue(xDetlPath + "/waitendresnetc","")
  707. }else if(waitenddd != ""){
  708. if(waitendresn!=""){
  709. if(waitendresn == '04'){
  710. model.setValue(xDetlPath + "/agonaldd", waitenddd);
  711. }else{
  712. model.setValue(xDetlPath + "/agonaldd","")
  713. model.setValue(xDetlPath + "/agonalplcecd","")
  714. }
  715. model.setValue(xDetlPath + "/waitstat","P");
  716. }
  717. /*
  718. if(waitendresn == ''){
  719. messageBox("대기종료사유를 ","C001");
  720. return false;
  721. }
  722. */
  723. }
  724. //퇴실일자 있으면 waitstat는 L(퇴실)
  725. if(dschdd == ""){
  726. model.setValue(xDetlPath + "/dschtype","")
  727. model.setValue(xDetlPath + "/dschresn","")
  728. model.setValue(xDetlPath + "/dschresnetc","")
  729. model.setValue(xDetlPath + "/dschlnk","")
  730. model.setValue(xDetlPath + "/dschlnketc","")
  731. }else if(dschdd != ""){
  732. if(dschresn!=""){
  733. if(dschresn == '02'){
  734. model.setValue(xDetlPath + "/agonaldd", dschdd);
  735. }else{
  736. model.setValue(xDetlPath + "/agonaldd","")
  737. model.setValue(xDetlPath + "/agonalplcecd","")
  738. }
  739. model.setValue(xDetlPath + "/waitstat","L");
  740. }
  741. if(dschresn == ''){
  742. messageBox("퇴실사유를 ","C001");
  743. return false;
  744. }
  745. }
  746. }
  747. if( saveWaitStat == "D" ) {//분산전환
  748. //2017.08.21 자문형 호스피스 서비스 추가
  749. if( messageBox("자문등록으로 전환하시겠습니까?","Q") != 6 ) return;
  750. if( model.getValue("/root/temp/pamcgubun") == "I" ) {//입실에서 분산자전환일때
  751. model.setValue(xDetlPath + "/waitstat","ID");
  752. }else {//대기에서 분산자전환일때
  753. model.setValue(xDetlPath + "/waitstat","D");
  754. model.setValue(xDetlPath + "/waitdd", getCurrentDate());
  755. model.setValue(xDetlPath + "/inrmdd", "");
  756. model.setValue(xDetlPath + "/inrmtm", "");
  757. model.setValue(xDetlPath + "/enddd", "");
  758. model.setValue(xDetlPath + "/exptresn", "");
  759. model.setValue(xDetlPath + "/exptresnetc", "");
  760. model.setValue(xDetlPath + "/waitenddd", "");
  761. model.setValue(xDetlPath + "/waitendresn", "");
  762. model.setValue(xDetlPath + "/waitendresnetc", "");
  763. model.setValue(xDetlPath + "/dschdd", "");
  764. model.setValue(xDetlPath + "/dschtype", "");
  765. model.setValue(xDetlPath + "/dschresn", "");
  766. model.setValue(xDetlPath + "/dschresnetc", "");
  767. model.setValue(xDetlPath + "/dschlnk", "");
  768. model.setValue(xDetlPath + "/dschlnketc", "");
  769. model.setValue(xDetlPath + "/agonaldd", "");
  770. model.setValue(xDetlPath + "/agonalplcecd", "");
  771. }
  772. }
  773. return true;
  774. }
  775. /**
  776. * @group :
  777. * @ver : 2007.05.14
  778. * @by : 하재륜
  779. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  780. * @type : function
  781. * @access : public
  782. * @desc : popup 기록지등록화면을 호출한다.
  783. * inpt에 등록되어 있는 환자만 (status : O, S) 기록지를 호출 할 수 있다.
  784. * @param :
  785. * @return :
  786. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  787. */
  788. function fhospice_popmenu(){
  789. var hngnm = model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/hngnm");
  790. //if(model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/status") == "I"){
  791. // messageBox(hngnm +" 환자는 입실환자가 아니므로 기록지를 열 수","I004");
  792. // return;
  793. //}//else if(model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/stat") == "R" ){
  794. // messageBox(hngnm +" 환자는 대기(입실)환자가 아니므로 기록지를 열 수","I004");
  795. // return;
  796. // }
  797. var RowCnt = grd_hospicelist.rows - grd_hospicelist.fixedRows;
  798. if(RowCnt < 1){
  799. grd_hospicelist.row = 1;
  800. return;
  801. }
  802. //호스피스 기록지를 띄울때 pid, cretdt가 필요함...
  803. setParameter("pid", model.getValue("/root/main/hospice/hospicelist"+"["+(grd_hospicelist.row)+"]/pid")); //환자번호
  804. setParameter("cretdd", model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/cretdd")); //생성일자
  805. setParameter("crettm", model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/crettm")); //생성시간
  806. setParameter("reqdeptcd", model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/reqdeptcd")); //의뢰과
  807. setParameter("reqdd", model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/reqdd"));//의뢰일
  808. setParameter("wardcd", model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/wardcd"));//
  809. //사용자 테스트 버젼
  810. //if(model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/reqdd") > currentdate){
  811. if(model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/inrmdd") > '20160726'){
  812. modal("SMMNH01501",1,50,50); //호스피스기록지
  813. }else{
  814. modal("SMMNH01500",1,50,50); //호스피스기록지
  815. }
  816. }
  817. /**
  818. * @group :
  819. * @ver : 2009.05.25
  820. * @by : K. J. M
  821. * @-------------------------------------------------------------------------------------
  822. * @type : function
  823. * @access : public
  824. * @desc : 상태복원
  825. * @param :
  826. * @return :
  827. * @-------------------------------------------------------------------------------------
  828. */
  829. function fStatRecvr() {
  830. var chkcnfm = "false";
  831. var pamcgubun = model.getValue("/root/temp/pamcgubun");//조회구분
  832. var pid = model.getValue("/root/main/hospiceinfo/hospicedetl/pid");
  833. var cretdd = model.getValue("/root/main/hospiceinfo/hospicedetl/cretdd");
  834. var crettm = model.getValue("/root/main/hospiceinfo/hospicedetl/crettm");
  835. var status = model.getValue("/root/main/hospiceinfo/hospicedetl/status");
  836. if( pid == "" ) {
  837. pid = model.getValue("/root/main/hospice/hospicelist[" + grd_hospicelist.row + "]/pid");
  838. cretdd = model.getValue("/root/main/hospice/hospicelist[" + grd_hospicelist.row + "]/cretdd");
  839. crettm = model.getValue("/root/main/hospice/hospicelist[" + grd_hospicelist.row + "]/crettm");
  840. status = model.getValue("/root/main/hospice/hospicelist[" + grd_hospicelist.row + "]/status");
  841. }
  842. model.removenode("/root/send");
  843. model.makeValue("/root/send/reqdata/pid", pid);
  844. model.makeValue("/root/send/reqdata/cretdd", cretdd);
  845. model.makeValue("/root/send/reqdata/crettm", crettm);
  846. model.makeValue("/root/send/reqdata/pamcgubun", pamcgubun);
  847. switch(pamcgubun) {
  848. case "L" : //퇴실
  849. if( messageBox("입실자로 대상자를 이동하시겠습니까?","Q000") != 6 ) return;
  850. chkcnfm = "true";
  851. break;
  852. case "O" : //서비스종료
  853. if( status == "O"||status == "S"||status == "I" ) {
  854. if( messageBox("대기자로 대상자를 이동하시겠습니까?","Q000") != 6 ) return;
  855. chkcnfm = "true";
  856. }else {
  857. if( messageBox("자문형으로 대상자를 이동하시겠습니까?","Q000") != 6 ) return;
  858. chkcnfm = "true";
  859. }
  860. break;
  861. case "P" : //대기종료
  862. if(status == 'E'){
  863. if( messageBox("자문형으로 대상자를 이동하시겠습니까?","Q000") != 6 ) return;
  864. }else{
  865. if( messageBox("대기자로 대상자를 이동하시겠습니까?","Q000") != 6 ) return;
  866. }
  867. chkcnfm = "true";
  868. break;
  869. }
  870. if( chkcnfm == "true" ) {
  871. submit("TXMNH02901", false);
  872. fSearch();
  873. }
  874. }
  875. /**
  876. * @group :
  877. * @ver : 2007.05.14
  878. * @by : 하재륜
  879. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  880. * @type : function
  881. * @access : public
  882. * @desc : 환자구분에따라 인풋박스활성화 여부
  883. * @param :
  884. * @return :
  885. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  886. */
  887. function fPamcChange() {
  888. if (model.getValue("/root/temp/pamcgubun") == "R") { //의뢰
  889. grd_hospicelist.colhidden(1) = false; //의뢰경로
  890. grd_hospicelist.colhidden(3) = false; //등록번호
  891. grd_hospicelist.colhidden(4) = false; //환자명
  892. grd_hospicelist.colhidden(5) = false; //S/A
  893. grd_hospicelist.colhidden(6) = false; //진단명
  894. grd_hospicelist.colhidden(7) = false; //의뢰일
  895. grd_hospicelist.colhidden(8) = false; //의뢰형태
  896. grd_hospicelist.colhidden(9) = false; //의뢰과의뢰병원
  897. grd_hospicelist.colhidden(10) = false; //의뢰의사
  898. grd_hospicelist.colhidden(11) = false; //면담일
  899. grd_hospicelist.colhidden(12) = false; //의뢰사유
  900. grd_hospicelist.colhidden(13) = false; //관리현황
  901. grd_hospicelist.colhidden(14) = true; //대기전환일
  902. grd_hospicelist.colhidden(15) = true; //분산전환일
  903. grd_hospicelist.colhidden(16) = true; //현병실
  904. grd_hospicelist.colhidden(17) = true; //입실일자
  905. grd_hospicelist.colhidden(18) = true; //서비스종료일
  906. grd_hospicelist.colhidden(19) = true; //서비스종료사유
  907. grd_hospicelist.colhidden(20) = true; //대기종료일
  908. grd_hospicelist.colhidden(21) = true; //대기종료사유
  909. grd_hospicelist.colhidden(22) = true; //퇴실일
  910. grd_hospicelist.colhidden(23) = true; //퇴실형태
  911. grd_hospicelist.colhidden(24) = true; //퇴실사유
  912. grd_hospicelist.colhidden(25) = true; //퇴실후연계
  913. grd_hospicelist.colhidden(26) = true; //입원일자
  914. grd_hospicelist.colhidden(27) = true; //생성번호
  915. grd_hospicelist.colhidden(28) = true; //기관코드
  916. grd_hospicelist.colhidden(29) = true; //생성일자
  917. grd_hospicelist.colhidden(30) = true; //생성시간
  918. grd_hospicelist.colhidden(31) = true; //환자구분
  919. grd_hospicelist.colhidden(32) = true; //입실경로
  920. grd_hospicelist.colhidden(33) = true; //컨설트입원예약키
  921. grd_hospicelist.colhidden(34) = true; //주민번호
  922. grd_hospicelist.colhidden(35) = false; //사망여부
  923. grd_hospicelist.colhidden(36) = true; //사망일시
  924. grd_hospicelist.colhidden(37) = true; //의뢰과
  925. grd_hospicelist.colhidden(38) = true; //주치의ID
  926. grd_hospicelist.colhidden(39) = true; //의뢰형태
  927. grd_hospicelist.colhidden(40) = true; //병동코드
  928. grd_hospicelist.colhidden(41) = true; //상위진단코드
  929. grd_hospicelist.colhidden(42) = true; //하위진단코드
  930. grd_hospicelist.colhidden(43) = true; //입실여부
  931. btn_recvr.disabled = true; //복원버튼
  932. caption5.visible = false; // 조회기간
  933. ipt_fbrthdd.visible = false;
  934. caption2.visible = false;
  935. ipt_lbrthdd.visible = false;
  936. caption21.value = "대기/분산전환일";
  937. btn_districhg.disabled = true;//분산자전환
  938. btn_waitchg.disabled = false;//대기자전환
  939. lb_resncd.visible = false; //제외사유
  940. cmb_resncd.visible = false;
  941. ipt_inrmdd.disabled = true;
  942. ipt_enddd.disabled = true; //서비스종료일
  943. cmb_exptresn.disabled = true; // 서비스종료사유
  944. }else if (model.getValue("/root/temp/pamcgubun") == "W") { //대기
  945. var nsgbn = model.getValue("/root/main/hospice/hospicelist[" + grd_hospicelist.row + "]/nsgbn");//의뢰경로
  946. grd_hospicelist.colhidden(1) = false; //의뢰경로
  947. grd_hospicelist.colhidden(3) = false; //등록번호
  948. grd_hospicelist.colhidden(4) = false; //환자명
  949. grd_hospicelist.colhidden(5) = false; //S/A
  950. grd_hospicelist.colhidden(6) = false; //진단명
  951. grd_hospicelist.colhidden(7) = false; //의뢰일
  952. grd_hospicelist.colhidden(8) = false; //의뢰형태
  953. grd_hospicelist.colhidden(9) = false; //의뢰과의뢰병원
  954. grd_hospicelist.colhidden(10) = false; //의뢰의사
  955. grd_hospicelist.colhidden(11) = false; //면담일
  956. grd_hospicelist.colhidden(12) = false; //의뢰사유
  957. grd_hospicelist.colhidden(13) = false; //관리현황
  958. grd_hospicelist.colhidden(14) = false; //대기전환일
  959. grd_hospicelist.colhidden(15) = true; //분산전환일
  960. grd_hospicelist.colhidden(16) = false; //현병실
  961. grd_hospicelist.colhidden(17) = true; //입실일자
  962. grd_hospicelist.colhidden(18) = true; //서비스종료일
  963. grd_hospicelist.colhidden(19) = true; //서비스종료사유
  964. grd_hospicelist.colhidden(20) = true; //대기종료일
  965. grd_hospicelist.colhidden(21) = true; //대기종료사유
  966. grd_hospicelist.colhidden(22) = true; //퇴실일
  967. grd_hospicelist.colhidden(23) = true; //퇴실형태
  968. grd_hospicelist.colhidden(24) = true; //퇴실사유
  969. grd_hospicelist.colhidden(25) = true; //퇴실후연계
  970. grd_hospicelist.colhidden(26) = true; //입원일자
  971. grd_hospicelist.colhidden(27) = true; //생성번호
  972. grd_hospicelist.colhidden(28) = true; //기관코드
  973. grd_hospicelist.colhidden(29) = true; //생성일자
  974. grd_hospicelist.colhidden(30) = true; //생성시간
  975. grd_hospicelist.colhidden(31) = true; //환자구분
  976. grd_hospicelist.colhidden(32) = true; //입실경로
  977. grd_hospicelist.colhidden(33) = true; //컨설트입원예약키
  978. grd_hospicelist.colhidden(34) = true; //주민번호
  979. grd_hospicelist.colhidden(35) = false; //사망여부
  980. grd_hospicelist.colhidden(36) = true; //사망일시
  981. grd_hospicelist.colhidden(37) = true; //의뢰과
  982. grd_hospicelist.colhidden(38) = true; //주치의ID
  983. grd_hospicelist.colhidden(39) = true; //의뢰형태
  984. grd_hospicelist.colhidden(40) = true; //병동코드
  985. grd_hospicelist.colhidden(41) = true; //상위진단코드
  986. grd_hospicelist.colhidden(42) = true; //하위진단코드
  987. grd_hospicelist.colhidden(43) = true; //입실여부
  988. btn_recvr.disabled = true; //복원버튼
  989. caption5.visible = false; // 조회기간
  990. ipt_fbrthdd.visible = false;
  991. caption2.visible = false;
  992. ipt_lbrthdd.visible = false;
  993. lb_resncd.visible = false; //제외사유
  994. caption21.value = "대기전환일";
  995. cmb_resncd.visible = false;
  996. ipt_inrmdd.disabled = false;
  997. btn_districhg.disabled = true;//분산자전환
  998. btn_waitchg.disabled = true;//대기자전환
  999. if( nsgbn == "입원" ) {//입원일경우 서비스 종료
  1000. ipt_waitenddd.disabled = true;//대기종료일
  1001. cmb_waitendresn.disabled = true//대기종료사유
  1002. ipt_enddd.disabled = false; //서비스종료일
  1003. cmb_exptresn.disabled = false; // 서비스종료사유
  1004. }else {
  1005. ipt_waitenddd.disabled = false;//대기종료일
  1006. cmb_waitendresn.disabled = false//대기종료사유
  1007. ipt_enddd.disabled = true; //서비스종료일
  1008. cmb_exptresn.disabled = true; // 서비스종료사유
  1009. }
  1010. }else if (model.getValue("/root/temp/pamcgubun") == "D") { //분산 //20170821 - 자문형 호스피스 개편에 따른 분산->자문으로 변경
  1011. var nsgbn = model.getValue("/root/main/hospice/hospicelist[" + grd_hospicelist.row + "]/nsgbn");//의뢰경로
  1012. grd_hospicelist.colhidden(1) = false; //의뢰경로
  1013. grd_hospicelist.colhidden(3) = false; //등록번호
  1014. grd_hospicelist.colhidden(4) = false; //환자명
  1015. grd_hospicelist.colhidden(5) = false; //S/A
  1016. grd_hospicelist.colhidden(6) = false; //진단명
  1017. grd_hospicelist.colhidden(7) = false; //의뢰일
  1018. grd_hospicelist.colhidden(8) = false; //의뢰형태
  1019. grd_hospicelist.colhidden(9) = false; //의뢰과의뢰병원
  1020. grd_hospicelist.colhidden(10) = false; //의뢰의사
  1021. grd_hospicelist.colhidden(11) = false; //면담일
  1022. grd_hospicelist.colhidden(12) = false; //의뢰사유
  1023. grd_hospicelist.colhidden(13) = false; //관리현황
  1024. grd_hospicelist.colhidden(14) = true; //대기전환일
  1025. grd_hospicelist.colhidden(15) = false; //분산전환일
  1026. grd_hospicelist.colhidden(16) = false; //현병실
  1027. grd_hospicelist.colhidden(17) = true; //입실일자
  1028. grd_hospicelist.colhidden(18) = true; //서비스종료일
  1029. grd_hospicelist.colhidden(19) = true; //서비스종료사유
  1030. grd_hospicelist.colhidden(20) = true; //대기종료일
  1031. grd_hospicelist.colhidden(21) = true; //대기종료사유
  1032. grd_hospicelist.colhidden(22) = true; //퇴실일
  1033. grd_hospicelist.colhidden(23) = true; //퇴실형태
  1034. grd_hospicelist.colhidden(24) = true; //퇴실사유
  1035. grd_hospicelist.colhidden(25) = true; //퇴실후연계
  1036. grd_hospicelist.colhidden(26) = true; //입원일자
  1037. grd_hospicelist.colhidden(27) = true; //생성번호
  1038. grd_hospicelist.colhidden(28) = true; //기관코드
  1039. grd_hospicelist.colhidden(29) = true; //생성일자
  1040. grd_hospicelist.colhidden(30) = true; //생성시간
  1041. grd_hospicelist.colhidden(31) = true; //환자구분
  1042. grd_hospicelist.colhidden(32) = true; //입실경로
  1043. grd_hospicelist.colhidden(33) = true; //컨설트입원예약키
  1044. grd_hospicelist.colhidden(34) = true; //주민번호
  1045. grd_hospicelist.colhidden(35) = false; //사망여부
  1046. grd_hospicelist.colhidden(36) = true; //사망일시
  1047. grd_hospicelist.colhidden(37) = true; //의뢰과
  1048. grd_hospicelist.colhidden(38) = true; //주치의ID
  1049. grd_hospicelist.colhidden(39) = true; //의뢰형태
  1050. grd_hospicelist.colhidden(40) = true; //병동코드
  1051. grd_hospicelist.colhidden(41) = true; //상위진단코드
  1052. grd_hospicelist.colhidden(42) = true; //하위진단코드
  1053. grd_hospicelist.colhidden(43) = true; //입실여부
  1054. btn_recvr.disabled = true; //복원버튼
  1055. caption5.visible = false; // 조회기간
  1056. ipt_fbrthdd.visible = false;
  1057. caption2.visible = false;
  1058. ipt_lbrthdd.visible = false;
  1059. caption21.value = "분산전환일";
  1060. lb_resncd.visible = false; //제외사유
  1061. cmb_resncd.visible = false;
  1062. ipt_inrmdd.disabled = false;
  1063. ipt_enddd.disabled = false; //서비스종료일
  1064. cmb_exptresn.disabled = false; //서비스종료사유
  1065. btn_districhg.disabled = true;//분산자전환 //자문등록 활성화
  1066. btn_waitchg.disabled = true;//대기자전환
  1067. btn_waitend.disabled = false;//자문종료
  1068. }else if (model.getValue("/root/temp/pamcgubun") == "I") {//입실
  1069. grd_hospicelist.colhidden(1) = false; //의뢰경로
  1070. grd_hospicelist.colhidden(3) = false; //등록번호
  1071. grd_hospicelist.colhidden(4) = false; //환자명
  1072. grd_hospicelist.colhidden(5) = false; //S/A
  1073. grd_hospicelist.colhidden(6) = false; //진단명
  1074. grd_hospicelist.colhidden(7) = false; //의뢰일
  1075. grd_hospicelist.colhidden(8) = false; //의뢰형태
  1076. grd_hospicelist.colhidden(9) = false; //의뢰과의뢰병원
  1077. grd_hospicelist.colhidden(10) = false; //의뢰의사
  1078. grd_hospicelist.colhidden(11) = false; //면담일
  1079. grd_hospicelist.colhidden(12) = false; //의뢰사유
  1080. grd_hospicelist.colhidden(13) = false; //관리현황
  1081. grd_hospicelist.colhidden(14) = true; //대기전환일
  1082. grd_hospicelist.colhidden(15) = true; //분산전환일
  1083. grd_hospicelist.colhidden(16) = false; //현병실
  1084. grd_hospicelist.colhidden(17) = false; //입실일자
  1085. grd_hospicelist.colhidden(18) = true; //서비스종료일
  1086. grd_hospicelist.colhidden(19) = true; //서비스종료사유
  1087. grd_hospicelist.colhidden(20) = true; //대기종료일
  1088. grd_hospicelist.colhidden(21) = true; //대기종료사유
  1089. grd_hospicelist.colhidden(22) = true; //퇴실일
  1090. grd_hospicelist.colhidden(23) = true; //퇴실형태
  1091. grd_hospicelist.colhidden(24) = true; //퇴실사유
  1092. grd_hospicelist.colhidden(25) = true; //퇴실후연계
  1093. grd_hospicelist.colhidden(26) = true; //입원일자
  1094. grd_hospicelist.colhidden(27) = true; //생성번호
  1095. grd_hospicelist.colhidden(28) = true; //기관코드
  1096. grd_hospicelist.colhidden(29) = true; //생성일자
  1097. grd_hospicelist.colhidden(30) = true; //생성시간
  1098. grd_hospicelist.colhidden(31) = true; //환자구분
  1099. grd_hospicelist.colhidden(32) = true; //입실경로
  1100. grd_hospicelist.colhidden(33) = true; //컨설트입원예약키
  1101. grd_hospicelist.colhidden(34) = true; //주민번호
  1102. grd_hospicelist.colhidden(35) = false; //사망여부
  1103. grd_hospicelist.colhidden(36) = true; //사망일시
  1104. grd_hospicelist.colhidden(37) = true; //의뢰과
  1105. grd_hospicelist.colhidden(38) = true; //주치의ID
  1106. grd_hospicelist.colhidden(39) = true; //의뢰형태
  1107. grd_hospicelist.colhidden(40) = true; //병동코드
  1108. grd_hospicelist.colhidden(41) = true; //상위진단코드
  1109. grd_hospicelist.colhidden(42) = true; //하위진단코드
  1110. grd_hospicelist.colhidden(43) = true; //입실여부
  1111. btn_recvr.disabled = true; //복원버튼
  1112. caption5.visible = false; // 조회기간
  1113. ipt_fbrthdd.visible = false;
  1114. caption2.visible = false;
  1115. ipt_lbrthdd.visible = false;
  1116. caption21.value = "대기전환일";
  1117. lb_resncd.visible = false; //제외사유
  1118. cmb_resncd.visible = false;
  1119. ipt_inrmdd.disabled = false;
  1120. ipt_enddd.disabled = true; //서비스종료일
  1121. cmb_exptresn.disabled = true; // 서비스종료사유
  1122. btn_districhg.disabled = false;//분산자전환
  1123. btn_waitchg.disabled = false;//대기자전환
  1124. }else if (model.getValue("/root/temp/pamcgubun") == "L") {//퇴실
  1125. grd_hospicelist.colhidden(1) = false; //의뢰경로
  1126. grd_hospicelist.colhidden(3) = false; //등록번호
  1127. grd_hospicelist.colhidden(4) = false; //환자명
  1128. grd_hospicelist.colhidden(5) = false; //S/A
  1129. grd_hospicelist.colhidden(6) = false; //진단명
  1130. grd_hospicelist.colhidden(7) = false; //의뢰일
  1131. grd_hospicelist.colhidden(8) = false; //의뢰형태
  1132. grd_hospicelist.colhidden(9) = false; //의뢰과의뢰병원
  1133. grd_hospicelist.colhidden(10) = false; //의뢰의사
  1134. grd_hospicelist.colhidden(11) = false; //면담일
  1135. grd_hospicelist.colhidden(12) = false; //의뢰사유
  1136. grd_hospicelist.colhidden(13) = false; //관리현황
  1137. grd_hospicelist.colhidden(14) = true; //대기전환일
  1138. grd_hospicelist.colhidden(15) = true; //분산전환일
  1139. grd_hospicelist.colhidden(16) = true; //현병실
  1140. grd_hospicelist.colhidden(17) = true; //입실일자
  1141. grd_hospicelist.colhidden(18) = true; //서비스종료일
  1142. grd_hospicelist.colhidden(19) = true; //서비스종료사유
  1143. grd_hospicelist.colhidden(20) = true; //대기종료일
  1144. grd_hospicelist.colhidden(21) = true; //대기종료사유
  1145. grd_hospicelist.colhidden(22) = false; //퇴실일
  1146. grd_hospicelist.colhidden(23) = false; //퇴실형태
  1147. grd_hospicelist.colhidden(24) = false; //퇴실사유
  1148. grd_hospicelist.colhidden(25) = false; //퇴실후연계
  1149. grd_hospicelist.colhidden(26) = true; //입원일자
  1150. grd_hospicelist.colhidden(27) = true; //생성번호
  1151. grd_hospicelist.colhidden(28) = true; //기관코드
  1152. grd_hospicelist.colhidden(29) = true; //생성일자
  1153. grd_hospicelist.colhidden(30) = true; //생성시간
  1154. grd_hospicelist.colhidden(31) = true; //환자구분
  1155. grd_hospicelist.colhidden(32) = true; //입실경로
  1156. grd_hospicelist.colhidden(33) = true; //컨설트입원예약키
  1157. grd_hospicelist.colhidden(34) = true; //주민번호
  1158. grd_hospicelist.colhidden(35) = false; //사망여부
  1159. grd_hospicelist.colhidden(36) = true; //사망일시
  1160. grd_hospicelist.colhidden(37) = true; //의뢰과
  1161. grd_hospicelist.colhidden(38) = true; //주치의ID
  1162. grd_hospicelist.colhidden(39) = true; //의뢰형태
  1163. grd_hospicelist.colhidden(40) = true; //병동코드
  1164. grd_hospicelist.colhidden(41) = true; //상위진단코드
  1165. grd_hospicelist.colhidden(42) = true; //하위진단코드
  1166. grd_hospicelist.colhidden(43) = true; //입실여부
  1167. btn_recvr.disabled = false; //복원버튼
  1168. caption5.visible = true; // 조회기간
  1169. ipt_fbrthdd.visible = true;
  1170. caption2.visible = true;
  1171. ipt_lbrthdd.visible = true;
  1172. caption21.value = "대기전환일";
  1173. lb_resncd.visible = false; //제외사유
  1174. cmb_resncd.visible = false;
  1175. ipt_inrmdd.disabled = false;
  1176. ipt_enddd.disabled = true; //서비스종료일
  1177. cmb_exptresn.disabled = true; // 서비스종료사유
  1178. btn_districhg.disabled = true;//분산자전환
  1179. btn_waitchg.disabled = true;//대기자전환
  1180. }else if (model.getValue("/root/temp/pamcgubun") == "O") {//서비스종료
  1181. model.setValue("/root/temp/resncd", "");
  1182. grd_hospicelist.colhidden(1) = false; //의뢰경로
  1183. grd_hospicelist.colhidden(3) = false; //등록번호
  1184. grd_hospicelist.colhidden(4) = false; //환자명
  1185. grd_hospicelist.colhidden(5) = false; //S/A
  1186. grd_hospicelist.colhidden(6) = false; //진단명
  1187. grd_hospicelist.colhidden(7) = false; //의뢰일
  1188. grd_hospicelist.colhidden(8) = false; //의뢰형태
  1189. grd_hospicelist.colhidden(9) = false; //의뢰과의뢰병원
  1190. grd_hospicelist.colhidden(10) = false; //의뢰의사
  1191. grd_hospicelist.colhidden(11) = false; //면담일
  1192. grd_hospicelist.colhidden(12) = false; //의뢰사유
  1193. grd_hospicelist.colhidden(13) = false; //관리현황
  1194. grd_hospicelist.colhidden(14) = true; //대기전환일
  1195. grd_hospicelist.colhidden(15) = true; //분산전환일
  1196. grd_hospicelist.colhidden(16) = true; //현병실
  1197. grd_hospicelist.colhidden(17) = true; //입실일자
  1198. grd_hospicelist.colhidden(18) = false; //서비스종료일
  1199. grd_hospicelist.colhidden(19) = false; //서비스종료사유
  1200. grd_hospicelist.colhidden(20) = true; //대기종료일
  1201. grd_hospicelist.colhidden(21) = true; //대기종료사유
  1202. grd_hospicelist.colhidden(22) = true; //퇴실일
  1203. grd_hospicelist.colhidden(23) = true; //퇴실형태
  1204. grd_hospicelist.colhidden(24) = true; //퇴실사유
  1205. grd_hospicelist.colhidden(25) = true; //퇴실후연계
  1206. grd_hospicelist.colhidden(26) = true; //입원일자
  1207. grd_hospicelist.colhidden(27) = true; //생성번호
  1208. grd_hospicelist.colhidden(28) = true; //기관코드
  1209. grd_hospicelist.colhidden(29) = true; //생성일자
  1210. grd_hospicelist.colhidden(30) = true; //생성시간
  1211. grd_hospicelist.colhidden(31) = true; //환자구분
  1212. grd_hospicelist.colhidden(32) = true; //입실경로
  1213. grd_hospicelist.colhidden(33) = true; //컨설트입원예약키
  1214. grd_hospicelist.colhidden(34) = true; //주민번호
  1215. grd_hospicelist.colhidden(35) = false; //사망여부
  1216. grd_hospicelist.colhidden(36) = true; //사망일시
  1217. grd_hospicelist.colhidden(37) = true; //의뢰과
  1218. grd_hospicelist.colhidden(38) = true; //주치의ID
  1219. grd_hospicelist.colhidden(39) = true; //의뢰형태
  1220. grd_hospicelist.colhidden(40) = true; //병동코드
  1221. grd_hospicelist.colhidden(41) = true; //상위진단코드
  1222. grd_hospicelist.colhidden(42) = true; //하위진단코드
  1223. grd_hospicelist.colhidden(43) = true; //입실여부
  1224. btn_recvr.disabled = false; //복원버튼
  1225. caption5.visible = true; // 조회기간
  1226. ipt_fbrthdd.visible = true;
  1227. caption2.visible = true;
  1228. ipt_lbrthdd.visible = true;
  1229. caption21.value = "대기전환일";
  1230. lb_resncd.visible = true;
  1231. cmb_resncd.visible = true;
  1232. ipt_inrmdd.disabled = true; //입실일
  1233. ipt_enddd.disabled = false; //서비스종료일
  1234. cmb_exptresn.disabled = false; // 서비스종료사유
  1235. btn_districhg.disabled = true;//분산자전환
  1236. btn_waitchg.disabled = true;//대기자전환
  1237. lb_resncd.attribute("text") = "종료사유 : ";
  1238. cmb_resncd.choices.itemset.attribute("nodeset") = "/root/init/M0469detl/M0469"; // 서비스종료사유
  1239. }else if (model.getValue("/root/temp/pamcgubun") == "P") {//대기종료
  1240. model.setValue("/root/temp/resncd", "");
  1241. grd_hospicelist.colhidden(1) = false; //의뢰경로
  1242. grd_hospicelist.colhidden(3) = false; //등록번호
  1243. grd_hospicelist.colhidden(4) = false; //환자명
  1244. grd_hospicelist.colhidden(5) = false; //S/A
  1245. grd_hospicelist.colhidden(6) = false; //진단명
  1246. grd_hospicelist.colhidden(7) = false; //의뢰일
  1247. grd_hospicelist.colhidden(8) = false; //의뢰형태
  1248. grd_hospicelist.colhidden(9) = false; //의뢰과의뢰병원
  1249. grd_hospicelist.colhidden(10) = false; //의뢰의사
  1250. grd_hospicelist.colhidden(11) = false; //면담일
  1251. grd_hospicelist.colhidden(12) = false; //의뢰사유
  1252. grd_hospicelist.colhidden(13) = false; //관리현황
  1253. grd_hospicelist.colhidden(14) = true; //대기전환일
  1254. grd_hospicelist.colhidden(15) = true; //분산전환일
  1255. grd_hospicelist.colhidden(16) = true; //현병실
  1256. grd_hospicelist.colhidden(17) = true; //입실일자
  1257. grd_hospicelist.colhidden(18) = true; //서비스종료일
  1258. grd_hospicelist.colhidden(19) = true; //서비스종료사유
  1259. grd_hospicelist.colhidden(20) = false; //대기종료일
  1260. grd_hospicelist.colhidden(21) = false; //대기종료사유
  1261. grd_hospicelist.colhidden(22) = true; //퇴실일
  1262. grd_hospicelist.colhidden(23) = true; //퇴실형태
  1263. grd_hospicelist.colhidden(24) = true; //퇴실사유
  1264. grd_hospicelist.colhidden(25) = true; //퇴실후연계
  1265. grd_hospicelist.colhidden(26) = true; //입원일자
  1266. grd_hospicelist.colhidden(27) = true; //생성번호
  1267. grd_hospicelist.colhidden(28) = true; //기관코드
  1268. grd_hospicelist.colhidden(29) = true; //생성일자
  1269. grd_hospicelist.colhidden(30) = true; //생성시간
  1270. grd_hospicelist.colhidden(31) = true; //환자구분
  1271. grd_hospicelist.colhidden(32) = true; //입실경로
  1272. grd_hospicelist.colhidden(33) = true; //컨설트입원예약키
  1273. grd_hospicelist.colhidden(34) = true; //주민번호
  1274. grd_hospicelist.colhidden(35) = false; //사망여부
  1275. grd_hospicelist.colhidden(36) = true; //사망일시
  1276. grd_hospicelist.colhidden(37) = true; //의뢰과
  1277. grd_hospicelist.colhidden(38) = true; //주치의ID
  1278. grd_hospicelist.colhidden(39) = true; //의뢰형태
  1279. grd_hospicelist.colhidden(40) = true; //병동코드
  1280. grd_hospicelist.colhidden(41) = true; //상위진단코드
  1281. grd_hospicelist.colhidden(42) = true; //하위진단코드
  1282. grd_hospicelist.colhidden(43) = true; //입실여부
  1283. btn_recvr.disabled = false; //복원버튼
  1284. caption5.visible = true; // 조회기간
  1285. ipt_fbrthdd.visible = true;
  1286. caption2.visible = true;
  1287. ipt_lbrthdd.visible = true;
  1288. caption21.value = "대기전환일";
  1289. lb_resncd.visible = true;
  1290. cmb_resncd.visible = true;
  1291. ipt_inrmdd.disabled = true;
  1292. ipt_enddd.disabled = true; //서비스종료일
  1293. cmb_exptresn.disabled = true; // 서비스종료사유
  1294. btn_districhg.disabled = true;//분산자전환
  1295. btn_waitchg.disabled = true;//대기자전환
  1296. lb_resncd.attribute("text") = "종료사유 : ";
  1297. cmb_resncd.choices.itemset.attribute("nodeset") = "/root/init/M0470detl/M0470"; // 대기종료사유
  1298. }
  1299. //cmb_resncd.value = "";
  1300. //model.refresh();
  1301. }
  1302. /**
  1303. * @group :
  1304. * @ver : 2007.11.19
  1305. * @by : dhkim
  1306. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1307. * @type :
  1308. * @access : public
  1309. * @desc : 제외사유입력시 퇴원사유입력불가처리,
  1310. * 퇴원사유입려시 제외사유입력불가처리
  1311. * @param :
  1312. * @return :
  1313. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1314. */
  1315. function fIsExptresnDisabledYn(){
  1316. //제외사유
  1317. var exptresn = model.getValue('/root/main/hospiceinfo/hospicedetl/exptresn');
  1318. if(exptresn != ''){
  1319. model.setValue('/root/main/hospiceinfo/hospicedetl/dschtype', '');
  1320. model.setValue('/root/main/hospiceinfo/hospicedetl/enddd', currentdate);
  1321. cmb_dschtype.disabled = false;
  1322. cmb_exptresn.disabled = true;
  1323. }else{
  1324. cmb_dschtype.disabled = true;
  1325. cmb_exptresn.disabled = false;
  1326. }
  1327. //퇴원사유
  1328. var dschtype = model.getValue('/root/main/hospiceinfo/hospicedetl/dschtype');
  1329. if(dschtype != ''){
  1330. model.setValue('/root/main/hospiceinfo/hospicedetl/exptresn', '');
  1331. model.setValue('/root/main/hospiceinfo/hospicedetl/enddd', currentdate);
  1332. cmb_exptresn.disabled = false;
  1333. cmb_dschtype.disabled = true;
  1334. }else{
  1335. cmb_exptresn.disabled = true;
  1336. cmb_dschtype.disabled = false;
  1337. }
  1338. model.refresh();
  1339. }
  1340. /**
  1341. * @group :
  1342. * @ver : 2007.06.29
  1343. * @by : 하재륜
  1344. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1345. * @type : function
  1346. * @access : public
  1347. * @desc : Hospice follow up sheet
  1348. * @param :
  1349. * @return :
  1350. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1351. */
  1352. function fhospice_follow(){
  1353. var hngnm = model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/hngnm");
  1354. if( model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/inrmdd") == ""
  1355. && model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/waitdd") == "" ){
  1356. messageBox(hngnm +" 환자는 대기(입실) 이력이 없으므로 Hospice follow up sheet를 열 수","I004");
  1357. return;
  1358. }
  1359. var RowCnt = grd_hospicelist.rows - grd_hospicelist.fixedRows;
  1360. if(RowCnt < 1){
  1361. grd_hospicelist.row = 1;
  1362. return;
  1363. }
  1364. var pid = setParameter("pid",model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/pid"));
  1365. var cretno = setParameter("cretno",model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/cretno"));
  1366. var cretdd = setParameter("cretdt",model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/cretdd"));
  1367. var crettm = setParameter("cretdt",model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/crettm"));
  1368. var indd = setParameter("indd",model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/indd"));
  1369. modal("SMMNH01400",1,50,50);
  1370. }
  1371. /*
  1372. * @group :
  1373. * @ver : 2007.06.29
  1374. * @by : 하재륜
  1375. * @---------------------------------------------------------------------------
  1376. * @type : function
  1377. * @access : public
  1378. * @desc : 사별가족 관리
  1379. * @param :
  1380. * @return :
  1381. * @---------------------------------------------------------------------------
  1382. */
  1383. function fhospice_agonal(){
  1384. var RowCnt = grd_hospicelist.rows - grd_hospicelist.fixedRows;
  1385. if(RowCnt < 1){
  1386. grd_hospicelist.row = 1;
  1387. return;
  1388. }
  1389. modal("SMMNH00700",1,50,50);
  1390. }
  1391. /*
  1392. * @group :
  1393. * @ver : 2007.06.29
  1394. * @by : 하재륜
  1395. * @----------------------------------------------------------------------------
  1396. * @type : function
  1397. * @access : public
  1398. * @desc : 환자가족 등록
  1399. * @param :
  1400. * @return :
  1401. * @----------------------------------------------------------------------------
  1402. */
  1403. function fhospice_famy(){
  1404. var pid = model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/pid");
  1405. var hngnm = model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/hngnm");
  1406. var sexage = model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/sexage");
  1407. var rrgstno = model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/rrgstno");
  1408. var indd = model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/indd");
  1409. var cretno = model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/cretno");
  1410. var RowCnt = grd_hospicelist.rows - grd_hospicelist.fixedRows;
  1411. if(RowCnt < 1){
  1412. grd_hospicelist.row = 1;
  1413. return;
  1414. }
  1415. setParameter("pid", pid);
  1416. setParameter("hngnm", hngnm);
  1417. setParameter("sexage", sexage);
  1418. setParameter("rrgstno", rrgstno);
  1419. setParameter("cretno", cretno);
  1420. setParameter("indd", indd);
  1421. modal("SMMNH03500",1,50,50);
  1422. }
  1423. /**
  1424. * @group :
  1425. * @ver : 2007.06.29
  1426. * @by : 하재륜
  1427. * @-----------------------------------------------------------------------------
  1428. * @type : function
  1429. * @access : public
  1430. * @desc : 호스피스 회신기록
  1431. * @param :
  1432. * @return :
  1433. * @-----------------------------------------------------------------------------
  1434. */
  1435. function fhospice_rec(){
  1436. var hngnm = model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/hngnm");
  1437. var status = model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/status");
  1438. var reqformrecseq = model.getValue("/root/main/hospice/hospicelist["+ grd_hospicelist.row + "]/reqformrecseq");
  1439. if( (status == "B")||(status == "C")||(status == "I")||(status == "S") ){
  1440. messageBox(hngnm +" 환자는 컨설트 의뢰환자가 아니므로 회신기록 화면을 볼 수 ","I004");
  1441. return;
  1442. }
  1443. setParameter("openmode", "reccnstform");
  1444. setParameter("formrecseq", reqformrecseq); //서식기록테이블의 formrecseq(기록순번)
  1445. setParameter("userdeptcd", "3050312000");
  1446. setParameter("btndisableyn", "Y"); //버튼 비활성화 매개변수
  1447. modal("../../../emr/medirecweb/xrw/SSMMR01100_서식로더.xrw", 1, 0, 0 ,"", "", "");
  1448. }
  1449. /**
  1450. * @group :
  1451. * @ver : 2007.07.19
  1452. * @by : 하재륜
  1453. * @-------------------------------------------------------------------------------------------------
  1454. * @type : function
  1455. * @access : public
  1456. * @desc : 호스피스 입실대기 환자수를 조회
  1457. * 입실대기자수를 조회하여 입실대기자수필드에 카운트시킨다.
  1458. * 입실대기자수는 대기자명단중에 입실 병동이 호스피스인 것만 카운트 시킨다.
  1459. * 입실대기자수가 1보다 작으면 입실등록버튼을 비활성화하고 0보다크면 활성화 시킨다.
  1460. * @param :
  1461. * @param :
  1462. * @return :
  1463. * @-------------------------------------------------------------------------------------------------
  1464. */
  1465. function fCntSearch(){
  1466. if((model.getValue("/root/main/cond/fbrthdd")=='')||(model.getValue("/root/main/cond/lbrthdd")=='')){
  1467. messageBox("조회기간의 날짜를 ","C001");
  1468. return;
  1469. }
  1470. model.removenode("/root/send");
  1471. model.makeValue("/root/send/fbrthdd", model.getValue("/root/main/cond/fbrthdd"));
  1472. model.makeValue("/root/send/lbrthdd", model.getValue("/root/main/cond/lbrthdd"));
  1473. model.makeValue("/root/send/pamcgubun", model.getValue("/root/temp/pamcgubun"));
  1474. if(!submit("TRMNH02904")){
  1475. messageBox('조회를', 'E009');
  1476. return false;
  1477. }else{
  1478. model.makeValue("/root/hidden/cnt", model.getValue("/root/temp/htfa/htfacnt/inwaitcnt"));
  1479. opt_cnt.refresh();
  1480. fromdd = model.getValue("/root/main/cond/fbrthdd");
  1481. todd = model.getValue("/root/main/cond/lbrthdd");
  1482. var cnt = opt_cnt.value;
  1483. if(parseInt(cnt) > 0) {
  1484. if( model.getValue("/root/temp/pamcgubun") == "R" ) {//의뢰일 경우 입실자가 있어도 입실등록버튼 비활성화
  1485. btn_ipt.disabled = true;
  1486. }else {
  1487. btn_ipt.disabled = false;
  1488. }
  1489. }else {
  1490. btn_ipt.disabled = true;
  1491. }
  1492. }
  1493. }
  1494. /**
  1495. * @group :
  1496. * @ver : 2007.12.16
  1497. * @by : dhkim
  1498. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1499. * @type : function
  1500. * @access : public
  1501. * @desc : 입실대기자가 있을때 입실등록버튼을 클릭하면 호출된다.<b>
  1502. * 입실대기자수는 따로 조회를 해 와서 입실등록 버튼을 누르면 해당 대기환자들 정보를 가지고 있다가
  1503. * 입실상태 waitstat : I, 입실일을 등록일자로 바꿔준다.
  1504. * 입실대기자수가 1보다 작으면 입실등록버튼을 비활성화하고 0보다크면 활성화 시킨다.
  1505. * @param :
  1506. * @param :
  1507. * @return :
  1508. * @--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1509. */
  1510. function fWaitPsnInRoom(){
  1511. //model.removenode('/root/send');
  1512. //model.makeValue('/root/send/htfacnt', grd_htfawaitInfo.getUpdateDataAll('u'));
  1513. //
  1514. //if(!submit('TXMNH02905')){
  1515. // messageBox('조회를', 'E009');
  1516. // return false;
  1517. //}
  1518. setParameter("fbrthdd", model.getValue("/root/main/cond/fbrthdd"));
  1519. setParameter("fbrthdd", model.getValue("/root/main/cond/lbrthdd"));
  1520. setParameter("pamcgubun", model.getValue("/root/temp/pamcgubun"));
  1521. modal("SPMNH02900", "1", event.screenX, event.screenY-300);
  1522. }
  1523. /**
  1524. * 20090819 dhkim
  1525. * 신규환자등록화면을 보여준다
  1526. */
  1527. function fShowNewPatient(isShow){
  1528. //노드 재구성
  1529. model.removenode('/root/main/newpatientinfo');
  1530. model.makenode('/root/main/newpatientinfo/newpatinfo');
  1531. if(isShow){
  1532. grp_newpatientinput.visible = true;
  1533. }else{
  1534. grp_newpatientinput.visible = false;
  1535. }
  1536. model.refresh();
  1537. }
  1538. /**
  1539. * 20090821 dhkim
  1540. * 환자조회팝업을 띄운다
  1541. */
  1542. function fPopPat(pid){
  1543. model.makeNode("/root/main/patinfo/patinfolist");
  1544. //원무팀의 환자명을 받아오는 팝업창을 띄운다.
  1545. if(pid != null && pid != ''){
  1546. //환자정보 조회팝업에 기본 정보 넘겨준다.
  1547. model.makeValue("/root/tmp/pid", pid);
  1548. model.makeValue("/root/tmp/srchcond","1");
  1549. model.makeValue("/root/tmp/autoflag","Y"); // 1건인경우 자동으로닫힘
  1550. }
  1551. modal("SPPMC02500", 1, 10, 10, "SPPMC02500", "/root/tmp", "/root/send");
  1552. //input박스에 데이타를 받아온다.
  1553. var popupendflag = model.getValue("/root/main/popupendflag");
  1554. if (popupendflag == "ok"){
  1555. var pid = model.getValue("/root/main/patinfo/patinfolist/pid") ;
  1556. //해당환자가 호스피스의뢰 등록가능한 환자인지 조회한다.
  1557. model.removenode('/root/send');
  1558. model.makeValue('/root/send/pid', pid);
  1559. model.removenode('/root/main/newpatientinfo/newpatinfo');
  1560. model.makenode('/root/main/newpatientinfo/newpatinfo');
  1561. if(submit('TRMNH02907')){
  1562. //등록가능여부 체크
  1563. var cnt = getNodesetCount('/root/main/newpatientinfo/newpatinfo');
  1564. if(cnt > 0){
  1565. fIsValidRgstNewPat();
  1566. }else{
  1567. messageBox('해당환자는 재원중이 아니므로 호스피스 환자로 신환등록 할 수 없습니다.', 'I');
  1568. return;
  1569. }
  1570. }else{
  1571. messageBox('호스피스의뢰 등록가능한지 여부 조회를', 'E009');
  1572. return;
  1573. }
  1574. } else {
  1575. model.resetInstanceNode("/root/main/newpatientinfo/patinfo");
  1576. }
  1577. model.refresh();
  1578. }
  1579. /**
  1580. * 20090825 dhkim
  1581. * 신규환자를등록한다
  1582. */
  1583. function fRgstNewPat(){
  1584. if(fIsValidRgstNewPat()){
  1585. model.removenode('/root/send');
  1586. model.makeValue('/root/send/pid', model.getValue('/root/main/newpatientinfo/newpatinfo/pid'));
  1587. model.makeValue('/root/send/indd', model.getValue('/root/main/newpatientinfo/newpatinfo/indd'));
  1588. model.makeValue('/root/send/cretno', model.getValue('/root/main/newpatientinfo/newpatinfo/cretno'));
  1589. model.makeValue('/root/send/orddrid', model.getValue('/root/main/newpatientinfo/newpatinfo/orddrid'));
  1590. model.makeValue('/root/send/orddrnm', model.getValue('/root/main/newpatientinfo/newpatinfo/orddrnm'));
  1591. model.makeValue('/root/send/orddeptcd', model.getValue('/root/main/newpatientinfo/newpatinfo/orddeptcd'));
  1592. if(submit('TXMNH02907')){
  1593. messageBox('의뢰환자로 등록되었습니다.', 'I');
  1594. fSearch();
  1595. }else{
  1596. messageBox('신환등록을 실패하였습니다.', 'E');
  1597. return false;
  1598. }
  1599. }
  1600. }
  1601. /**
  1602. * 20090825 dhkim
  1603. * 신규환자등록유효성을 체크한다
  1604. */
  1605. function fIsValidRgstNewPat(){
  1606. var pid, dschdd, dschtype, enddd, exptresn, orddeptcd, orddrid;
  1607. var indschacptstat, status, inrmdd, reqdd, waitdd;
  1608. var hngnm;
  1609. for(var i = 1; i <= getNodesetCount('/root/main/newpatientinfo/newpatinfo'); i++){
  1610. pid = model.getValue('/root/main/newpatientinfo/newpatinfo[' + i + ']/pid');
  1611. dschdd = model.getValue('/root/main/newpatientinfo/newpatinfo[' + i + ']/dschdd');
  1612. enddd = model.getValue('/root/main/newpatientinfo/newpatinfo[' + i + ']/enddd');
  1613. waitenddd = model.getValue('/root/main/newpatientinfo/newpatinfo[' + i + ']/waitenddd');
  1614. orddeptcd = model.getValue('/root/main/newpatientinfo/newpatinfo[' + i + ']/orddeptcd');
  1615. orddrid = model.getValue('/root/main/newpatientinfo/newpatinfo[' + i + ']/orddrid');
  1616. indschacptstat = model.getValue('/root/main/newpatientinfo/newpatinfo[' + i + ']/indschacptstat');
  1617. inrmdd = model.getValue('/root/main/newpatientinfo/newpatinfo[' + i + ']/inrmdd');
  1618. status = model.getValue('/root/main/newpatientinfo/newpatinfo[' + i + ']/status');
  1619. reqdd = model.getValue('/root/main/newpatientinfo/newpatinfo[' + i + ']/reqdd');
  1620. waitdd = model.getValue('/root/main/newpatientinfo/newpatinfo[' + i + ']/waitdd');
  1621. hngnm = model.getValue('/root/main/newpatientinfo/newpatinfo[' + i + ']/hngnm');
  1622. //확인
  1623. if(indschacptstat != 'A'){
  1624. messageBox('현재 병동에 재원중인 환자가 아닌경우 신환등록을 할 수 없습니다.', 'I');
  1625. return false;
  1626. }
  1627. if(pid == null || pid == ''){
  1628. messageBox('신환등록을 위한 등록번호 정보가 존재하지 않습니다.', 'I');
  1629. return false;
  1630. }
  1631. if(orddeptcd == null || orddeptcd == ''){
  1632. messageBox('신환등록을 위한 진료과 정보가 존재하지 않습니다.', 'I');
  1633. return false;
  1634. }
  1635. if(orddrid == null || orddrid == ''){
  1636. messageBox('신환등록을 위한 진료의 정보가 존재하지 않습니다.', 'I');
  1637. return false;
  1638. }
  1639. //저장
  1640. if(dschdd == '-' && enddd == '-' && waitenddd == '-'){
  1641. return true;
  1642. }
  1643. //호스피스관리중인 환자(의뢰/대기/분산/입실 상태)와 현재 재원중이 아닌 환자는 등록불가
  1644. if(dschdd == '19000101' && enddd == '19000101' && waitenddd == '19000101'){
  1645. //확인
  1646. if(inrmdd != '19000101'){
  1647. messageBox('(' + hngnm + ') 환자는 이미 호스피스 입실상태로 관리중인 환자이므로 신환등록을 할 수 없습니다.', 'I');
  1648. return false;
  1649. }else{
  1650. //확인
  1651. if(waitdd == '19000101' && reqdd != '19000101'){
  1652. messageBox('(' + hngnm + ') 환자는 이미 호스피스 의뢰상태로 관리중인 환자이므로 신환등록을 할 수 없습니다.', 'I');
  1653. return false;
  1654. }
  1655. if(waitdd != '19000101'){
  1656. //확인
  1657. if(status == 'O' || status == 'S' || status == 'I'){
  1658. messageBox('(' + hngnm + ') 환자는 이미 호스피스 대기상태로 관리중인 환자이므로 신환등록을 할 수 없습니다.', 'I');
  1659. return false;
  1660. }
  1661. //확인
  1662. else if(status == 'A' || status == 'B' || status == 'C'){
  1663. messageBox('(' + hngnm + ') 환자는 이미 호스피스 분산상태로 관리중인 환자이므로 신환등록을 할 수 없습니다.', 'I');
  1664. return false;
  1665. }
  1666. }
  1667. }
  1668. }
  1669. }
  1670. return true;
  1671. }
  1672. /**
  1673. * date : 2009.10.09
  1674. * author : dhkim
  1675. * desc : 호스피스 환자관리 프로그램 종료사유 상태별 종료입력
  1676. * param : state-(W:대기종료, S:서비스종료, D:퇴실등록)
  1677. *
  1678. */
  1679. function fEndSave(state){
  1680. var resn;
  1681. var saveStr;
  1682. //state에 따라서 사유 미입력시 저장 blocking
  1683. if(state == 'W'){
  1684. resn = model.getValue('/root/main/hospiceinfo/hospicedetl/waitendresn');
  1685. saveStr = '자문종료 하시겠습니까?';
  1686. model.setValue('/root/main/hospiceinfo/hospicedetl/waitenddd',getCurrentDate());
  1687. /*
  1688. if(resn == ''){
  1689. messageBox('대기종료 사유를 입력하십시요.', 'E');
  1690. return ;
  1691. }
  1692. */
  1693. } else
  1694. if (state == 'S'){
  1695. resn = model.getValue('/root/main/hospiceinfo/hospicedetl/exptresn');
  1696. saveStr = '서비스종료 하시겠습니까?';
  1697. if(resn == ''){
  1698. messageBox('서비스종료 사유를 입력하십시요.', 'E');
  1699. return ;
  1700. }
  1701. } else if (state == 'D'){
  1702. var calcscoryn = model.getValue("/root/main/hospiceinfo/hospicedetl/calcscoryn_tmp");
  1703. if ( calcscoryn == "Y" ) {
  1704. messageBox('수가대상 적용환자입니다.', 'E');
  1705. return ;
  1706. }
  1707. resn = model.getValue('/root/main/hospiceinfo/hospicedetl/dschresn');
  1708. saveStr = '퇴실등록 하시겠습니까?';
  1709. if(resn == ''){
  1710. messageBox('퇴실등록 사유를 입력하십시요.', 'E');
  1711. return ;
  1712. }
  1713. }
  1714. if( messageBox(saveStr, "Q000") != 6 ) return;
  1715. fSave('S', true);
  1716. }
  1717. /**
  1718. * date : 2009.10.09
  1719. * author : dhkim
  1720. * desc : 종료버튼들 상태값 초기화 (비활성화)
  1721. *
  1722. */
  1723. function fInitEndBtn_kdg(chkFlag){
  1724. if(chkFlag == "DC"){
  1725. var pamcgubn = model.getValue("/root/main/hospiceinfo/hospicedetl/status");//구분
  1726. }else{
  1727. var pamcgubn = model.getValue("/root/temp/pamcgubun");//구분
  1728. }
  1729. if(pamcgubn == 'D'){
  1730. btn_waitend.disabled = false;
  1731. btn_svcend.disabled = true;
  1732. btn_dschend.disabled = true;
  1733. }else{
  1734. btn_waitend.disabled = true;
  1735. btn_svcend.disabled = true;
  1736. btn_dschend.disabled = true;
  1737. }
  1738. }
  1739. function fInitEndBtn(){
  1740. /*var iRow = -1;
  1741. iRow = grd_hospicelist.row;
  1742. var rowChk = model.getValue("/root/main/hospice/hospicelist"+"["+iRow+"]/status");
  1743. if(rowChk == 'E'){
  1744. btn_waitend.disabled = false;
  1745. btn_waitchg.disabled = false;
  1746. btn_svcend.disabled = true;
  1747. btn_dschend.disabled = true;
  1748. }else{
  1749. btn_waitend.disabled = true;
  1750. btn_svcend.disabled = true;
  1751. btn_dschend.disabled = true;
  1752. }
  1753. */
  1754. btn_waitend.disabled = true;
  1755. btn_svcend.disabled = true;
  1756. btn_dschend.disabled = true;
  1757. }
  1758. /**
  1759. * date : 2009.10.13
  1760. * author : dhkim
  1761. * desc : 일자가 입력됨에 따른 버튼 활성화및 비활성화 처리
  1762. *
  1763. */
  1764. function fChangeDisabledEndBtn(state){
  1765. if(state == 'W'){//대기종료버튼활성화
  1766. if( model.getValue("/root/main/hospiceinfo/hospicedetl/waitenddd") != "" ) {
  1767. cmb_waitendresn.disabled = "false";
  1768. btn_waitend.disabled = "false";
  1769. btn_svcend.disabled = true;
  1770. btn_dschend.disabled = true;
  1771. }else {
  1772. cmb_waitendresn.disabled = "true";
  1773. btn_waitend.disabled = "true";
  1774. btn_svcend.disabled = true;
  1775. btn_dschend.disabled = true;
  1776. }
  1777. } else if (state == 'S'){//서비스종료버튼활성화
  1778. //20091009 dhkim
  1779. if(model.getValue("/root/main/hospiceinfo/hospicedetl/enddd") != ""){
  1780. btn_svcend.disabled = "false";
  1781. btn_waitend.disabled = true;
  1782. btn_dschend.disabled = true;
  1783. }else{
  1784. btn_svcend.disabled = "true";
  1785. btn_waitend.disabled = true;
  1786. btn_dschend.disabled = true;
  1787. }
  1788. } else if (state == 'D'){//퇴실등록버튼활성화
  1789. //20091009 dhkim 퇴실일 입력시 퇴실등록버튼 활성화
  1790. if(model.getValue("/root/main/hospiceinfo/hospicedetl/dschdd") != ""){
  1791. btn_dschend.disabled = "false";
  1792. btn_svcend.disabled = true;
  1793. btn_waitend.disabled = true;
  1794. }else{
  1795. btn_dschend.disabled = "true";
  1796. btn_svcend.disabled = true;
  1797. btn_waitend.disabled = true;
  1798. }
  1799. } else {
  1800. fInitEndBtn();//종료버튼들 비활성화처리
  1801. }
  1802. }
  1803. function fhospice_agonalrec() {
  1804. //호스피스 기록지를 띄울때 pid, cretdt가 필요함...
  1805. setParameter("pid", model.getValue("/root/main/hospice/hospicelist"+"["+(grd_hospicelist.row)+"]/pid"));
  1806. setParameter("cretdd", model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/cretdd"));
  1807. setParameter("crettm", model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/crettm"));
  1808. setParameter("reqdeptcd", model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/reqdeptcd"));
  1809. setParameter("reqdd", model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/reqdd"));
  1810. setParameter("wardcd", model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/wardcd"));
  1811. modal("SMMNH06700");
  1812. }
  1813. //호스피스 가족상담 화면 호출
  1814. function fhospice_famyconsult() {
  1815. //indd, cretdd 정보는 필수로 넘김
  1816. setParameter("pid", model.getValue("/root/main/hospice/hospicelist"+"["+(grd_hospicelist.row)+"]/pid"));
  1817. setParameter("indd", model.getValue("/root/main/hospice/hospicelist"+"["+(grd_hospicelist.row)+"]/indd"));
  1818. setParameter("hngnm", model.getValue("/root/main/hospice/hospicelist"+"["+(grd_hospicelist.row)+"]/hngnm"));
  1819. setParameter("sexage", model.getValue("/root/main/hospice/hospicelist"+"["+(grd_hospicelist.row)+"]/sexage"));
  1820. setParameter("cretdd", model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/cretdd"));
  1821. setParameter("crettm", model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/crettm"));
  1822. setParameter("cretno", model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/cretno"));
  1823. setParameter("wardcd", model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/wardcd"));
  1824. setParameter("atdoctid", model.getValue("/root/main/hospice/hospicelist"+"["+grd_hospicelist.row+"]/atdoctid"));
  1825. modal("SMMNH01600");
  1826. }
  1827. //상단정보셋팅
  1828. function fSetPatInfo(pid, indd, cretno, instcd, orddd, ordtype){
  1829. condparam = "I" + "▦" + pid
  1830. + "▦" + indd
  1831. + "▦" + cretno
  1832. + "▦" + instcd
  1833. + "▦" + orddd;
  1834. setParameter("condparam", condparam);
  1835. //상단 세팅 화면 사이즈 작게 띄움
  1836. //----------------------(20080618이전버젼)
  1837. //modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  1838. //top_pid = pid;
  1839. //----------------------(20080618이후버젼)
  1840. modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  1841. var useyn = getParameter("SPMMO08900_rtn_useyn"); // 입원,외래 원무환자정보 존재 "Y" / 존재하지 않을 경우 "N"
  1842. //---------------------
  1843. }