PMO001.js 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793
  1. /* =================================================================================================
  2. - 외래등록 PMO001.js
  3. - 작성자 : 유정란
  4. - 작성시작일자 : 2007.03.13
  5. ================================================================================================== */
  6. var gs_olnw = "O" ; //구환 'O' 신환 'N'
  7. var gs_fdrc = "R" ; //신환 'F' 초진 'D' 재진 'R'
  8. var gs_rgtp = "OO"; //접수구분 + 진료형태(외래[O],응급[E])
  9. var gs_prcs = "0" ; //처리단계
  10. var init_ptbs;
  11. var init_otpt;
  12. var init_ptin;
  13. //var init_ptdc;
  14. var init_opmi;
  15. var init_oscl;
  16. var grid_init_h_ptsp;
  17. var grid_init_h_otpt;
  18. var grid_init_h_unco;
  19. var grid_init_h_card;
  20. var grid_init_h_dcgm;
  21. var grid_init_h_dcgm2;
  22. var grid_init_h_cnst;
  23. var grid_init_h_inbs;
  24. var grid_init_h_hndc;
  25. var grid_init_h_cash;
  26. var grid_init_h_onln;
  27. var grid_init_m_ptin;
  28. //var grid_init_m_ptdc;
  29. var grid_init_m_otpt;
  30. var grid_init_m_opmi;
  31. var grid_init_m_oscl;
  32. var grid_init_m_card;
  33. var grid_init_m_cash;
  34. var grid_init_m_dcgm;
  35. var grid_init_c_otpt;
  36. var grid_init_t_otpt;
  37. /**---------------------------------------------------
  38. * @desc : 단일구조 인스턴스 초기화
  39. * @---------------------------------------------------
  40. */
  41. function fOneInstanceReset(gubn){
  42. if (gubn == "ptbs") {
  43. model.resetInstanceNode("/root/main/ptbs");
  44. model.resetInstanceNode("/root/main/patinfo");
  45. }
  46. else if (gubn == "ptin") model.resetInstanceNode("/root/main/ptin");
  47. //else if (gubn == "ptdc") model.resetInstanceNode("/root/main/ptdc");
  48. else if (gubn == "otpt") model.resetInstanceNode("/root/main/otpt");
  49. else if (gubn == "opmi") model.resetInstanceNode("/root/main/opmi");
  50. else if (gubn == "all"){
  51. model.resetInstanceNode("/root/main/ptbs");
  52. model.resetInstanceNode("/root/main/patinfo");
  53. model.resetInstanceNode("/root/main/ptin");
  54. //model.resetInstanceNode("/root/main/ptdc");
  55. model.resetInstanceNode("/root/main/otpt");
  56. model.resetInstanceNode("/root/main/otpt_old");
  57. model.resetInstanceNode("/root/main/opmi");
  58. model.resetInstanceNode("/root/main/aipm");
  59. model.resetInstanceNode("/root/main/icpm");
  60. model.resetInstanceNode("/root/hidden/com");
  61. model.resetInstanceNode("/root/hidden/flag");
  62. //2015/05/07 이정택 추가
  63. model.resetInstanceNode("/root/main/oscl");
  64. model.resetInstanceNode("/root/main/bogj");
  65. model.resetInstanceNode("/root/main/h_chrt");
  66. model.resetInstanceNode("/root/send");
  67. model.resetInstanceNode("/root/temp");
  68. model.resetInstanceNode("/root/cmp");
  69. model.resetInstanceNode("/root/hidden/temp");
  70. model.resetInstanceNode("/root/hidden/rcv");
  71. model.resetInstanceNode("/root/send2");
  72. model.resetInstanceNode("/root/jinchalryotemp");
  73. model.resetInstanceNode("/root/hidden/rcv");
  74. model.resetInstanceNode("/root/checkdrscheSend");
  75. //2015/05/07 이정택 추가
  76. }
  77. //각종 버튼 color 초기화, 콤보박스 활성화 여부, 버튼 활성화 여부
  78. //선택진료여부 버튼 활성화
  79. rdo_specordyn.disabled = false;
  80. //특이환자여부 버튼색 초기화
  81. btn_patspcfyn.attribute("background-color") = "#c0c0c0";
  82. }
  83. /**---------------------------------------------------
  84. * @desc : 멀티구조 인스턴스 초기화
  85. * @---------------------------------------------------
  86. */
  87. function fMultiInstanceReset(){
  88. model.removeNodeset("/root/main/h_otpt/otpt");
  89. model.removeNodeset("/root/main/h_unco/unco"); //error
  90. model.removeNodeset("/root/main/h_card/card"); //error
  91. model.removeNodeset("/root/main/h_dcgm/dcgm"); //error
  92. model.removeNodeset("/root/main/h_dcgm2/dcgm");
  93. model.removeNodeset("/root/main/h_cash/cash"); //error
  94. model.removeNodeset("/root/main/h_onln/onln");
  95. model.removeNodeset("/root/main/h_ptsp/ptsp");
  96. model.removeNodeset("/root/main/h_cnst/cnst"); //error
  97. model.removeNodeset("/root/main/h_srdg/srdg");
  98. //model.removeNodeset("/root/main/h_inbs/inbs");
  99. //model.removeNodeset("/root/main/h_jabo/jabo");
  100. model.removeNodeset("/root/main/h_hndc/hndc");
  101. model.removeNodeset("/root/main/m_ptin/ptin");
  102. //model.removeNodeset("/root/main/m_ptdc/ptdc");
  103. model.removeNodeset("/root/main/m_otpt/otpt");
  104. model.removeNodeset("/root/main/m_opmi/opmi");
  105. model.removeNodeset("/root/main/m_oscl/oscl");
  106. model.removeNodeset("/root/main/m_card/card");
  107. model.removeNodeset("/root/main/m_cash/cash");
  108. model.removeNodeset("/root/main/m_dcgm/dcgm");
  109. model.removeNodeset("/root/main/c_otpt/otpt");
  110. model.removeNodeset("/root/main/t_otpt/otpt");
  111. }
  112. /**---------------------------------------------------
  113. * @desc : 단일 인스턴스 backup
  114. * @---------------------------------------------------
  115. */
  116. function fOneInstanceBackUp(){
  117. init_ptbs = instance1.selectSingleNode("/root/main/ptbs").xml;
  118. init_otpt = instance1.selectSingleNode("/root/main/otpt").xml;
  119. init_ptin = instance1.selectSingleNode("/root/main/ptin").xml;
  120. //init_ptdc = instance1.selectSingleNode("/root/main/ptdc").xml;
  121. init_opmi = instance1.selectSingleNode("/root/main/opmi").xml;
  122. init_oscl = instance1.selectSingleNode("/root/main/oscl").xml;
  123. }
  124. /**---------------------------------------------------
  125. * @desc : 멀티 인스턴스 backup
  126. * @---------------------------------------------------
  127. */
  128. function fMultiInstanceBackUp(){
  129. grid_init_h_otpt = instance1.selectSingleNode("/root/main/h_otpt");
  130. grid_init_h_unco = instance1.selectSingleNode("/root/main/h_unco");
  131. grid_init_h_card = instance1.selectSingleNode("/root/main/h_card");
  132. grid_init_h_dcgm = instance1.selectSingleNode("/root/main/h_dcgm");
  133. grid_init_h_dcgm2 = instance1.selectSingleNode("/root/main/h_dcgm2");
  134. grid_init_h_cash = instance1.selectSingleNode("/root/main/h_cash");
  135. grid_init_h_onln = instance1.selectSingleNode("/root/main/h_onln");
  136. grid_init_h_ptsp = instance1.selectSingleNode("/root/main/h_ptsp");
  137. grid_init_h_cnst = instance1.selectSingleNode("/root/main/h_cnst");
  138. grid_init_h_srdg = instance1.selectSingleNode("/root/main/h_srdg");
  139. grid_init_m_ptin = instance1.selectSingleNode("/root/main/m_ptin");
  140. //grid_init_m_ptdc = instance1.selectSingleNode("/root/main/m_ptdc");
  141. grid_init_m_otpt = instance1.selectSingleNode("/root/main/m_otpt");
  142. grid_init_m_opmi = instance1.selectSingleNode("/root/main/m_opmi");
  143. grid_init_m_oscl = instance1.selectSingleNode("/root/main/m_oscl");
  144. grid_init_m_card = instance1.selectSingleNode("/root/main/m_card");
  145. grid_init_m_cash = instance1.selectSingleNode("/root/main/m_cash");
  146. grid_init_m_dcgm = instance1.selectSingleNode("/root/main/m_dcgm");
  147. grid_init_c_otpt = instance1.selectSingleNode("/root/main/c_otpt");
  148. grid_init_t_otpt = instance1.selectSingleNode("/root/main/t_otpt");
  149. }
  150. /**---------------------------------------------------
  151. * @desc : 멀티 인스턴스 Copy
  152. * @---------------------------------------------------
  153. */
  154. function fMultiInstanceCopy(){
  155. var curNode_otpt = instance1.selectSingleNode("/root/main/h_otpt");
  156. if(curNode_otpt != null)
  157. model.removeNodeset("/root/main/h_otpt/otpt");
  158. //grid1.rebuild();
  159. var curNode_unco = instance1.selectSingleNode("/root/main/h_unco");
  160. if(curNode_unco != null)
  161. model.removeNodeset("/root/main/h_unco/unco");
  162. var curNode_card = instance1.selectSingleNode("/root/main/h_card");
  163. if(curNode_card != null)
  164. model.removeNodeset("/root/main/h_card/card");
  165. var curNode_dcgm = instance1.selectSingleNode("/root/main/h_dcgm");
  166. if(curNode_dcgm != null)
  167. model.removeNodeset("/root/main/h_dcgm/dcgm");
  168. var curNode_dcgm2 = instance1.selectSingleNode("/root/main/h_dcgm2");
  169. if(curNode_dcgm2 != null)
  170. model.removeNodeset("/root/main/h_dcgm2/dcgm");
  171. var curNode_cash = instance1.selectSingleNode("/root/main/h_cash");
  172. if(curNode_cash != null)
  173. model.removeNodeset("/root/main/h_cash/cash");
  174. var curNode_onln = instance1.selectSingleNode("/root/main/h_onln");
  175. if(curNode_onln != null)
  176. model.removeNodeset("/root/main/h_onln/onln");
  177. var curNode_cnst = instance1.selectSingleNode("/root/main/h_cnst");
  178. if(curNode_cnst != null)
  179. model.removeNodeset("/root/main/h_cnst/cnst");
  180. //var curNode_inbs = instance1.selectSingleNode("/root/main/h_inbs");
  181. //if(curNode_inbs != null)
  182. // model.removeNodeset("/root/main/h_inbs/inbs");
  183. var curNode_srdg = instance1.selectSingleNode("/root/main/h_srdg");
  184. if(curNode_srdg != null)
  185. model.removeNodeset("/root/main/h_srdg/srdg");
  186. //var curNode_jabo = instance1.selectSingleNode("/root/main/h_jabo");
  187. //if(curNode_jabo != null)
  188. // model.removeNodeset("/root/main/h_jabo/jabo");
  189. //grid2.Rebuild();
  190. var curNode_hndc = instance1.selectSingleNode("/root/main/h_hndc");
  191. if(curNode_hndc != null)
  192. model.removeNodeset("/root/main/h_hndc/hndc");
  193. var curNode_ptsp = instance1.selectSingleNode("/root/main/h_ptsp");
  194. if(curNode_ptsp != null)
  195. model.removeNodeset("/root/main/h_ptsp/ptsp");
  196. //model.removeNodeset("/root/main/h_inpt");
  197. //model.removeNodeset("/root/main/h_inpt2");
  198. var curNode_m_ptin = instance1.selectSingleNode("/root/main/m_ptin");
  199. if(curNode_m_ptin != null)
  200. model.removeNodeset("/root/main/m_ptin/ptin");
  201. //var curNode_m_ptdc = instance1.selectSingleNode("/root/main/m_ptdc");
  202. // if(curNode_m_ptdc != null)
  203. // model.removeNodeset("/root/main/m_ptdc/ptdc");
  204. var curNode_m_otpt = instance1.selectSingleNode("/root/main/m_otpt");
  205. if(curNode_m_otpt != null)
  206. model.removeNodeset("/root/main/m_otpt/otpt");
  207. var curNode_m_opmi = instance1.selectSingleNode("/root/main/m_opmi");
  208. if(curNode_m_opmi != null)
  209. model.removeNodeset("/root/main/m_opmi/opmi");
  210. var curNode_m_oscl = instance1.selectSingleNode("/root/main/m_oscl");
  211. if(curNode_m_oscl != null)
  212. model.removeNodeset("/root/main/m_oscl/oscl");
  213. var curNode_m_card = instance1.selectSingleNode("/root/main/m_card");
  214. if(curNode_m_card != null)
  215. model.removeNodeset("/root/main/m_card/card");
  216. var curNode_m_cash = instance1.selectSingleNode("/root/main/m_cash");
  217. if(curNode_m_cash != null)
  218. model.removeNodeset("/root/main/m_cash/cash");
  219. var curNode_m_dcgm = instance1.selectSingleNode("/root/main/m_dcgm");
  220. if(curNode_m_dcgm != null)
  221. model.removeNodeset("/root/main/m_dcgm/dcgm");
  222. var curNode_c_otpt = instance1.selectSingleNode("/root/main/c_otpt");
  223. if(curNode_c_otpt != null)
  224. model.removeNodeset("/root/main/c_otpt/otpt");
  225. //2008-01-10 이동식 추가 - 당일접수내역 초기화
  226. var curNode_t_otpt = instance1.selectSingleNode("/root/main/t_otpt");
  227. if(curNode_t_otpt != null)
  228. model.removeNodeset("/root/main/t_otpt/otpt");
  229. }
  230. /**---------------------------------------------------
  231. * @desc : 기본 데이터 초기화
  232. * : 각 단위별로 초기화 가능하도록 함수 분리
  233. * @---------------------------------------------------
  234. */
  235. function fBaseDataInit(gubn){
  236. gs_olnw = "O" ; //구환 'O' 신환 'N'
  237. gs_fdrc = "R" ; //신환 'F' 초진 'D' 재진 'R'
  238. gs_rgtp = "OO"; //접수구분 + 진료형태(외래[O],응급[E])
  239. gs_prcs = "0" ; //처리단계
  240. //com, ptbs, otpt, ptin, ptdc, opmi
  241. if (gubn == "com") fBaseDataInitCom();
  242. else if (gubn == "ptbs") fBaseDataInitPtbs();
  243. else if (gubn == "otpt") fBaseDataInitOtpt();
  244. else if (gubn == "ptin") fBaseDataInitPtin();
  245. //else if (gubn == "ptdc") fBaseDataInitPtdc();
  246. else if (gubn == "opmi") fBaseDataInitOpmi();
  247. else if (gubn == "all"){
  248. fBaseDataInitCom();
  249. fBaseDataInitPtbs();
  250. fBaseDataInitOtpt();
  251. fBaseDataInitPtin();
  252. //fBaseDataInitPtdc();
  253. if (instance1.selectSingleNode("/root/main/opmi/opmi_payamt") != null) fBaseDataInitOpmi();
  254. cmb_suppkind.disabled = true;
  255. cmb_suppkindresn.disabled = true;
  256. cmb_medamtfreeresn.disabled = true;
  257. cmb_fsexamflag.disabled = true;
  258. btn_calcscorcalc.disabled = false;
  259. btn_save.disabled = true;
  260. btn_updt.disabled = true;
  261. btn_cncl.disabled = false;
  262. btn_stat.attribute("background-color") = "#c0c0c0";
  263. //btn_otpt.selected = false;
  264. //btn_m_otpt.selected = true;
  265. //btn_c_otpt.selected = false;
  266. //model.toggle("case6");
  267. //2016/07/18 치과 화면 초기화시 카드가 선택되도록 요청함에 따라서 기준자료로 체크하도록 수정(이정택)
  268. var chk_value= model.getValue("/root/paminit/P6587list/P6587[cdid='01']/cdnm");
  269. if(isNull(chk_value)){
  270. model.makeValue("/root/hidden/com/cardcashflag" , "C"); //Y-카드, N-현금영수증, C-현금
  271. }else{
  272. model.makeValue("/root/hidden/com/cardcashflag" , chk_value); //Y-카드, N-현금영수증, C-현금
  273. }
  274. //model.setValue("/root/hidden/com/cardcashflag" , "C"); //Y-카드, N-현금영수증, C-현금
  275. model.setValue("/root/hidden/com/cash_indinstflag" , "00"); //00-소득공제, 01-지출증비, 02-미승인
  276. //20100401 현금영수증 의무화
  277. //rdo_indyn.disabled = true;
  278. model.setFocus("ipt_pid");
  279. //필요에 따라 추가
  280. }
  281. }
  282. function fBaseDataInitCom(){
  283. //그대로 사용할지 미정 FInit_detail0()
  284. //진료시간 세팅
  285. model.setValue("/root/main/otpt/otpt_ordtm",(getCurrentTime()).substring(0,4));
  286. model.setValue("/root/hidden/com/menu_erflag","");
  287. //2009-06-06 이동식 수정 - 환자카드발행 구분을 원무공통코드 'P0022' 에 넣고 관리함.
  288. if( model.getValue("/root/init/P0022/P0022list[cd = '110']/nm") != 'N' ){
  289. model.setValue("/root/hidden/com/idcard","Y");
  290. }
  291. model.setValue("/root/hidden/com/rcptpapr","Y");
  292. model.setValue("/root/hidden/com/engrcptpapr","");
  293. model.setValue("/root/hidden/com/orgflag","N"); //영수증 원본이 디폴트
  294. model.setValue("/root/hidden/com/histstat","R");
  295. //2008-11-27 이동식추가
  296. //자격조회 유무
  297. //2009-07-27 이동식 수정 - 자격조회여부를 원무공통코드 'P0022' 에 넣고 관리함.
  298. if( model.getValue("/root/init/P0022/P0022list[cd = '150']/nm") != 'N' ){
  299. model.setValue("/root/hidden/com/searchInsuInfoYN", 'Y');
  300. }
  301. model.setValue("/root/hidden/com/rsrvdesc","당일접수");
  302. //임의감면, 미수액 코드 초기화.
  303. model.resetInstanceNode("/root/hidden/m_etc");
  304. //현금영수증 자동승인 여부
  305. if( model.getValue("/root/init/P0022/P0022list[cd = '160' ]/nm") == 'Y'){
  306. model.setValue("/root/hidden/com/autocashyn", model.getvalue("/root/init/P0022/P0022list[cd = '160' ]/nm"));
  307. }
  308. }
  309. function fBaseDataInitPtbs(){
  310. model.setValue("/root/main/ptbs/ptbs_engnm","-");
  311. model.setValue("/root/main/ptbs/ptbs_chinm","-");
  312. model.setValue("/root/main/ptbs/ptbs_btype","-");
  313. model.setValue("/root/main/ptbs/ptbs_rh","-");
  314. model.setValue("/root/main/ptbs/ptbs_hometel","-");
  315. model.setValue("/root/main/ptbs/ptbs_mpphontel","-");
  316. model.setValue("/root/main/ptbs/ptbs_etctel1","-");
  317. model.setValue("/root/main/ptbs/ptbs_etctel2","-");
  318. model.setValue("/root/main/ptbs/ptbs_zipcd1","000");
  319. model.setValue("/root/main/ptbs/ptbs_zipcd2","00");
  320. model.setValue("/root/main/ptbs/ptbs_zipcdseq","1");
  321. model.setValue("/root/main/ptbs/ptbs_highaddr","-");
  322. model.setValue("/root/main/ptbs/ptbs_detladdr","-");
  323. model.setValue("/root/main/ptbs/ptbs_recmerrela","-");
  324. model.setValue("/root/main/ptbs/ptbs_viprem","-");
  325. model.setValue("/root/main/ptbs/ptbs_inhospyn","N");
  326. model.setValue("/root/hidden/flag/ptbs_flag","-");
  327. }
  328. function fBaseDataInitOtpt(){
  329. model.setValue("/root/main/otpt/otpt_orddeptcd","-"); //진료과
  330. model.setValue("/root/main/otpt/otpt_orddrid","-"); //진료의사
  331. model.setValue("/root/main/otpt/otpt_orddd",PMO001_TODAY); //진료일자
  332. model.setValue("/root/main/otpt/otpt_ordtype","O"); //진료형태 =>공통코드 참조
  333. model.setValue("/root/main/otpt/otpt_specordyn","N"); //선택진료여부
  334. model.setValue("/root/main/otpt/otpt_mskind","M"); //주부유형
  335. model.setValue("/root/main/otpt/otpt_insucd","-"); //보험자기호
  336. model.setValue("/root/main/otpt/otpt_insukind","-"); //보험유형
  337. model.setValue("/root/main/otpt/otpt_suppkind","00"); //보조유형
  338. model.setValue("/root/main/otpt/otpt_suppkindresn","-"); //보조유형사유
  339. model.setValue("/root/main/otpt/otpt_medamtestmyn","Y"); //진찰료산정여부
  340. model.setValue("/root/main/otpt/otpt_medamtfreeresn","00"); //진찰료미산정사유
  341. model.setValue("/root/main/otpt/otpt_medamtpostyn","N"); //진찰료선후불 => 확인필요 N 선불, Y 후불
  342. //2015/08/17 이정택 주석처리(멀티 입력추가 후 재진으로 초재진 돌아가는 현상 수정)
  343. //model.setValue("/root/main/otpt/otpt_fsexamflag","R"); //초재진
  344. //2015/08/17 이정택 주석처리
  345. model.setValue("/root/main/otpt/otpt_hosoutexptresncd","00"); //분업예외
  346. model.setValue("/root/main/otpt/otpt_updtcnclresn","-"); //변경취소사유
  347. model.setValue("/root/main/otpt/otpt_disccd","-"); //할인
  348. model.setValue("/root/main/otpt/otpt_etcordflag","-"); //연속/기타구분
  349. model.setValue("/root/main/otpt/otpt_calcmthdflag","N"); //수가계산형태 : 개별
  350. model.setValue("/root/main/otpt/otpt_calcbaseflag",""); //계산기준 : 진료일자, 실시일자 => 확인필요
  351. model.setValue("/root/main/otpt/otpt_clincstdyacptflag","N"); //임상시험(연구용)
  352. //2007.07.28 이동식 추가
  353. model.setValue("/root/main/otpt/otpt_chrtlendyn","Y"); //차트대출여부
  354. model.setValue("/root/hidden/flag/otpt_flag","-");
  355. model.setValue("/root/main/otpt/otpt_handicaprbookpossnyn","N");
  356. model.setValue("/root/main/otpt/otpt_outercdrgstyn","N");
  357. //2007-10-18 이동식 추가
  358. model.setValue("/root/main/otpt/otpt_ordreqformflag", "-"); //수급절차 - '-'
  359. }
  360. function fBaseDataInitPtin(){
  361. model.setValue("/root/main/ptin/ptin_insukind","-");
  362. model.setValue("/root/main/ptin/ptin_insucd","-");
  363. model.setValue("/root/main/ptin/ptin_insunm","-");
  364. model.setValue("/root/main/ptin/ptin_insuno","-");
  365. model.setValue("/root/main/ptin/ptin_insdnm","-");
  366. model.setValue("/root/main/ptin/ptin_insdrrgstno1","-");
  367. model.setValue("/root/main/ptin/ptin_insdrrgstno2","-");
  368. model.setValue("/root/main/ptin/ptin_insdrela","-");
  369. model.setValue("/root/main/ptin/ptin_fromdd",PMO001_TODAY);
  370. model.setValue("/root/main/ptin/ptin_todd",PMO001_MAXDATE);
  371. model.setValue("/root/hidden/flag/ptin_flag","-");
  372. }
  373. //function fBaseDataInitPtdc(){
  374. // model.setValue("/root/main/ptdc/ptdc_disccd","-"); //할인코드
  375. // //model.setValue("/root/main/ptdc/ptdc_disccd2","-"); //할인코드2 : 코드입력값
  376. // model.setValue("/root/main/ptdc/ptdc_discflag","D"); //할인구분 : 공통코드 확인후 세팅 필요
  377. // model.setValue("/root/main/ptdc/ptdc_disccls","-"); //할인분류구분 : 공통코드 확인후 세팅 필요
  378. // model.setValue("/root/main/ptdc/ptdc_fromdd",PMO001_TODAY); //시작일자
  379. // model.setValue("/root/main/ptdc/ptdc_todd",PMO001_MAXDATE); //종료일자
  380. // model.setValue("/root/main/ptdc/ptdc_empid","-"); //직원사번
  381. // model.setValue("/root/main/ptdc/ptdc_emprela","-"); //직원과의 관계
  382. // model.setValue("/root/main/ptdc/ptdc_discappacptyn","N"); //할인신청서접수여부
  383. // model.setValue("/root/main/ptdc/ptdc_profacptyn","N"); //증명서접수여부
  384. // model.setValue("/root/main/ptdc/ptdc_profacptdd","-"); //증명서접수일자
  385. // model.setValue("/root/main/ptdc/ptdc_remfact","-"); //참고사항
  386. // model.setValue("/root/hidden/flag/ptdc_flag","-");
  387. //}
  388. function fBaseDataInitOpmi(){
  389. model.setValue("/root/main/opmi/opmi_payamt","0");
  390. model.setValue("/root/main/opmi/opmi_payownbamt","0");
  391. model.setValue("/root/main/opmi/opmi_payinsubamt","0");
  392. model.setValue("/root/main/opmi/opmi_handcapfund","0");
  393. model.setValue("/root/main/opmi/opmi_procsubtamt","0");
  394. model.setValue("/root/main/opmi/opmi_ersubtamt","0");
  395. model.setValue("/root/main/opmi/opmi_nopyamt","0");
  396. model.setValue("/root/main/opmi/opmi_specamt","0");
  397. model.setValue("/root/main/opmi/opmi_discamt","0");
  398. model.setValue("/root/main/opmi/opmi_reduamt","0");
  399. model.setValue("/root/main/opmi/opmi_bloddiscamt","0");
  400. model.setValue("/root/main/opmi/opmi_totownbamt","0");
  401. model.setValue("/root/main/opmi/opmi_precardamt","0");
  402. model.setValue("/root/main/opmi/opmi_precashamt","0");
  403. model.setValue("/root/main/opmi/opmi_preonlineamt","0");
  404. model.setValue("/root/main/opmi/opmi_mdlrcptamt","0");
  405. model.setValue("/root/main/opmi/opmi_premdlrcptamt","0");
  406. model.setValue("/root/main/opmi/opmi_uncoamt","0");
  407. model.setValue("/root/main/opmi/opmi_cashamt","0");
  408. model.setValue("/root/main/opmi/opmi_cardamt","0");
  409. model.setValue("/root/main/opmi/opmi_onlineamt","0");
  410. model.setValue("/root/main/opmi/opmi_restamt","0");
  411. model.setValue("/root/main/opmi/opmi_paydepoamt","0"); //납입금
  412. model.setValue("/root/main/opmi/opmi_totamt","0");
  413. model.setValue("/root/main/opmi/opmi_totnopyamt","0");
  414. model.setValue("/root/main/opmi/opmi_subtamt","0");
  415. model.setValue("/root/main/opmi/opmi_totreduamt","0");
  416. model.setValue("/root/main/opmi/opmi_pregdmndamt","0");
  417. model.setValue("/root/main/opmi/opmi_prepregdmndamt","0");
  418. model.setValue("/root/main/opmi/opmi_suppamt","0");
  419. model.setValue("/root/main/opmi/opmi_heallifeamtclamamt","0");
  420. //20090701 1.단수처리 고시적용
  421. model.setValue("/root/main/opmi/opmi_payinsurestamt","0");
  422. model.setValue("/root/main/opmi/opmi_payownbamt100","0");
  423. model.setValue("/root/main/opmi/opmi_payinsubamt100","0");
  424. model.setValue("/root/main/opmi/opmi_totownbamt100","0");
  425. // 20110701 미용목적성형 부가가치세 적용
  426. model.setValue("/root/main/opmi/opmi_taxamt","0");
  427. if (instance1.selectSingleNode("/root/main/opmi/opmi_targetamt") == null)
  428. {
  429. model.makeNode("/root/main/opmi/opmi_targetamt");
  430. }
  431. model.setValue("/root/main/opmi/opmi_targetamt","0");
  432. model.setValue("/root/main/opmi/opmi_paypsnflag","1"); //납부자 세팅 : 본인
  433. model.setValue("/root/hidden/flag/opmi_flag","-");
  434. }
  435. //재원환자인지 체크합니다.2007/05/22 조영상
  436. function fInhospynCheck()
  437. {
  438. if (model.getValue("/root/main/ptbs/ptbs_inhospyn") == "M"){
  439. //보험유형이 일반인 경우에는 메세지로 확인 후 접수 가능하게 한다.
  440. if( model.getValue("/root/main/otpt/otpt_insukind") == gsInsu_IlBan){
  441. messageBox("확인! " + model.getValue("/root/main/ptbs/ptbs_hngnm") + " 환자는 입원수납할 내역이 있습니다. \n입원수납 후 진행하세요!","I999","");
  442. /*
  443. var retValue = messageBox("확인! " + model.getValue("/root/main/ptbs/ptbs_hngnm") + " 환자는 입원수납할 내역이 있습니다. \n입원수납 후 진행하세요! 계속 진행 하시겠습니까?","Q999","");
  444. if( retValue != '6' ){
  445. return false;
  446. }
  447. */
  448. }else{
  449. messageBox("확인! " + model.getValue("/root/main/ptbs/ptbs_hngnm") + " 환자는 입원수납할 내역이 있습니다. \n입원수납 후 진행하세요!","E999","");
  450. //return false;
  451. }
  452. }else if (model.getValue("/root/main/ptbs/ptbs_inhospyn") == "I")
  453. {
  454. //보험유형이 일반인 경우에는 메세지로 확인 후 접수 가능하게 한다.
  455. if( model.getValue("/root/main/otpt/otpt_insukind") == gsInsu_IlBan){
  456. messageBox("확인! " + model.getValue("/root/main/ptbs/ptbs_hngnm") + " 환자는 현재 재원 중입니다!","I999","");
  457. /*
  458. var retValue = messageBox("확인! " + model.getValue("/root/main/ptbs/ptbs_hngnm") + " 환자는 현재 재원 중입니다! 계속 진행 하시겠습니까?","Q999","");
  459. if( retValue != '6' ){
  460. return false;
  461. }
  462. */
  463. }else{
  464. messageBox("확인! " + model.getValue("/root/main/ptbs/ptbs_hngnm") + " 환자는 현재 재원 중입니다!","E999","");
  465. //return false;
  466. }
  467. }else if (model.getValue("/root/main/ptbs/ptbs_inhospyn") == "D")
  468. {
  469. if( model.getValue("/root/main/otpt/otpt_insukind") == gsInsu_IlBan){
  470. messageBox("확인! " + model.getValue("/root/main/ptbs/ptbs_hngnm") + " 환자는 당일 DSC/CHEMO 환자입니다!","I999","");
  471. /*
  472. var retValue = messageBox("확인! " + model.getValue("/root/main/ptbs/ptbs_hngnm") + " 환자는 당일 DSC/CHEMO 환자입니다! 계속 진행 하시겠습니까?","Q999","");
  473. if( retValue != '6' ){
  474. return false;
  475. }
  476. */
  477. }else{
  478. messageBox("확인! " + model.getValue("/root/main/ptbs/ptbs_hngnm") + " 환자는 당일 DSC/CHEMO 환자입니다! 입원수납에서 수납하세요!","E999","");
  479. //return false;
  480. }
  481. }else if (model.getValue("/root/main/ptbs/ptbs_inhospyn") == "E")
  482. {
  483. if( model.getValue("/root/main/otpt/otpt_insukind") == gsInsu_IlBan){
  484. messageBox("확인! " + model.getValue("/root/main/ptbs/ptbs_hngnm") + " 환자는 응급 환자입니다!","I999","");
  485. /*
  486. var retValue = messageBox("확인! " + model.getValue("/root/main/ptbs/ptbs_hngnm") + " 환자는 응급 환자입니다! 계속 진행 하시겠습니까?","Q999","");
  487. if( retValue != '6' ){
  488. return false;
  489. }
  490. */
  491. }else{
  492. messageBox("확인! " + model.getValue("/root/main/ptbs/ptbs_hngnm") + " 환자는 응급 환자입니다!","E999","");
  493. //return false;
  494. }
  495. //2009-06-26 이동식 추가
  496. //가퇴원환자 메세지
  497. }else if (model.getValue("/root/main/ptbs/ptbs_inhospyn") == "T"){
  498. messageBox("확인! " + model.getValue("/root/main/ptbs/ptbs_hngnm") + " 환자는 가퇴원 환자(퇴원심사 미완료) 입니다!","E999","");
  499. //return false;
  500. }else if (model.getValue("/root/main/ptbs/ptbs_inhospyn") == "R"){
  501. messageBox("확인! " + model.getValue("/root/main/ptbs/ptbs_hngnm") + " 환자는 가퇴원 환자(퇴원심사 완료) 입니다!","E999","");
  502. //return false;
  503. //2008-08-22 이동식 추가 - 외료요율 퇴원환자인 경우 체크 제외
  504. }else if(model.getValue("/root/main/ptbs/ptbs_tdaydsch") == "I" && model.getValue("/root/main/otpt/otpt_orddd") == getCurrentDate() ){
  505. //가정간호 당일 퇴원환자 가접수가능
  506. //20080624 이동식 수정 - 김숙인 선생님 변경 요청 '당일 퇴원 환자' 접수 기능 삭제
  507. //if( model.getValue("/root/main/otpt/otpt_etcordflag") != 'N' ){
  508. if( model.getValue("/root/main/otpt/otpt_insukind") == gsInsu_IlBan){
  509. messageBox("확인! " + model.getValue("/root/main/ptbs/ptbs_hngnm") + " 환자는 당일퇴원환자입니다!","I999","");
  510. /*
  511. var retValue = messageBox("확인! " + model.getValue("/root/main/ptbs/ptbs_hngnm") + " 환자는 당일퇴원환자입니다! 계속 진행 하시겠습니까?","Q999","");
  512. if( retValue != '6' ){
  513. return false;
  514. }
  515. */
  516. }else{
  517. messageBox("확인! " + model.getValue("/root/main/ptbs/ptbs_hngnm") + " 환자는 당일퇴원환자입니다!","E999","");
  518. //return false;
  519. }
  520. //}
  521. }
  522. return true;
  523. }
  524. //function fDiscCDSelect()
  525. //{
  526. // //할인 적용했다가 해제하는 경우 : disccd 체크
  527. // var ptdc_disccd = model.getValue("/root/main/ptdc/ptdc_disccd");
  528. //
  529. // //model.setValue("/root/main/ptdc/ptdc_disccd2",ptdc_disccd);
  530. // model.refresh();
  531. //
  532. // if (gs_olnw == "O")
  533. // {
  534. // var ptbs_pid = model.getValue("/root/main/ptbs/ptbs_pid");
  535. //
  536. // if (ptdc_disccd != "" && ptdc_disccd != " " && ptdc_disccd != null && ptdc_disccd != "-")
  537. // {
  538. // fDiscCDRef(ptbs_pid,ptdc_disccd,"D");
  539. // model.setValue("/root/main/otpt/otpt_disccd",model.getValue("/root/main/ptdc/ptdc_disccd"));
  540. // model.setValue("/root/main/ptdc/ptdc_disccls","D");
  541. //
  542. // }
  543. // else
  544. // {
  545. // model.setValue("/root/main/otpt/otpt_disccd",model.getValue("/root/main/ptdc/ptdc_disccd"));
  546. // model.setValue("/root/main/ptdc/ptdc_empid","-");
  547. // //model.setValue("/root/main/ptdc/ptdc_empnm","-"); //2007-09-21 이동식 수정 - 존재하지 않는 노드!!!
  548. // //직원근무부서삭제
  549. // model.setValue("/root/main/ptdc/ptdc_emprela","-");
  550. // //model.setValue("/root/main/ptdc/ptdc_empexstflag","-"); //재직여부
  551. // model.setValue("/root/main/ptdc/ptdc_fromdd",PMO001_TODAY);
  552. // model.setValue("/root/main/ptdc/ptdc_todd",PMO001_MAXDATE);
  553. // model.setValue("/root/main/ptdc/ptdc_discappacptyn","N");
  554. // model.setValue("/root/main/ptdc/ptdc_profacptyn","N");
  555. // }
  556. // }
  557. // else
  558. // {
  559. // if (ptdc_disccd != "" && ptdc_disccd != " " && ptdc_disccd != null && ptdc_disccd != "-")
  560. // {
  561. // model.setValue("/root/main/otpt/otpt_disccd",model.getValue("/root/main/ptdc/ptdc_disccd"));
  562. // }
  563. // else
  564. // {
  565. // model.setValue("/root/main/otpt/otpt_disccd",model.getValue("/root/main/ptdc/ptdc_disccd"));
  566. // model.setValue("/root/main/ptdc/ptdc_empid","-");
  567. // model.setValue("/root/main/ptdc/ptdc_empnm","-");
  568. // //직원근무부서삭제
  569. // model.setValue("/root/main/ptdc/ptdc_emprela","-");
  570. // //model.setValue("/root/main/ptdc/ptdc_empexstflag","-"); //재직여부
  571. // }
  572. // }
  573. //
  574. // model.refresh();
  575. //}
  576. function fSuppKindSelect(){
  577. var otpt_insukind = model.getValue("/root/main/otpt/otpt_insukind");
  578. var otpt_suppkind = model.getValue("/root/main/otpt/otpt_suppkind");
  579. if(otpt_suppkind != supp_BASE){
  580. cmb_suppkindresn.disabled = false;
  581. }else{
  582. cmb_suppkindresn.disabled = true;
  583. //2017/12/18 이정택 추가
  584. cmb_suppkindresn.value = "-";
  585. //2017/12/18 이정택 추가
  586. }
  587. if(otpt_suppkind == supp_JABH && (otpt_insukind != gsSanJae && otpt_insukind != gsJaboKind)){
  588. messageBox("전액 보험자부담은 산재/자보인 경우에만 해당합니다!", "E999", "");
  589. model.setValue("/root/main/otpt/otpt_suppkind", supp_BASE);
  590. model.refresh();
  591. }
  592. /* supp_HANDI = "71" 설정되어있음(PMOCOM.js) 경북대병원 설정값 틀림 임상시험(71)
  593. if(otpt_insukind == supp_HANDI && otpt_insukind != gsBoHo2){
  594. messageBox("장애인은 의료급여2종인 경우에만 해당합니다!", "E999", "");
  595. model.setValue("/root/main/otpt/otpt_suppkind", supp_BASE);
  596. model.refresh();
  597. }
  598. */
  599. }
  600. /**
  601. * 대구 장애인구강진료센터 접수관련 개발
  602. */
  603. /*
  604. function fClinicCheck_Test(){
  605. fClinicCheck_Test("A", "/root/main/ptbs", "/root/main/otpt", "/root/main/h_hndc/hndc", "/root/init");
  606. return;
  607. var otpt_pid = model.getValue("/root/main/ptbs/ptbs_pid");
  608. var otpt_orddeptcd = model.getValue("/root/main/otpt/otpt_orddeptcd");
  609. var hndc_bslvflag = model.getValue("/root/main/h_hndc/hndc/hndc_bslvflag"); // 기초생활수급자
  610. var hndc_slflag = model.getValue("/root/main/h_hndc/hndc/hndc_slflag"); // 경증 및 중증 플래그
  611. var uncocd = model.getValue("/root/main/otpt/otpt_uncocd");
  612. var insukind = model.getValue("/root/main/otpt/otpt_insukind");
  613. if(!(insukind=="11" || insukind=="21" || insukind=="22")){ // 건보, 의료급여 1, 2종에 대해서만 체크하도록 함
  614. if(uncocd == "A43" || uncocd == "A44" || uncocd == "A45"){
  615. model.makeValue("/root/hidden/m_etc/uncocd", "");
  616. model.makeValue("/root/main/otpt/otpt_uncocd", "");
  617. model.refresh();
  618. }
  619. return true;
  620. }
  621. if(isNull(otpt_pid)){
  622. messageBox("환자번호가 입력되지 않았습니다.", "E");
  623. return false;
  624. }
  625. if(isNull(otpt_orddeptcd)){
  626. messageBox("진료과가 선택되지 않았습니다.", "E");
  627. return false;
  628. }
  629. if(otpt_orddeptcd=="2242400000"){ // 대구장애인구강센터
  630. // 세개의 미수코드가 종료되었다면 사업이 종료된걸로 판단
  631. if(getNodesetCount("/root/init/uncocd[cd='A43']")==0 && // 국민기초생활자장애인_50%
  632. getNodesetCount("/root/init/uncocd[cd='A44']")==0 && // 치과영역중증장애인_30%
  633. getNodesetCount("/root/init/uncocd[cd='A45']")==0){ // 치과영역경증장애인_10%
  634. return true;
  635. }else{
  636. if(getNodesetCount("/root/main/h_hndc/hndc")==0){
  637. messageBox("해당 환자는 장애인 등록이 되어 있지 않습니다.\n장애인 등록 후 진행부탁드립니다.", "E");
  638. btn_hndc.dispatch("DOMActivate");
  639. if(getNodesetCount("/root/temp/handcappat/handcappatlist[gubun='2']")>0){
  640. hndc_bslvflag = model.getValue("/root/temp/handcappat/handcappatlist[gubun='2']/hndc_bslvflag");
  641. hndc_slflag = model.getValue("/root/temp/handcappat/handcappatlist[gubun='2']/hndc_slflag");
  642. if(hndc_bslvflag == "Y" && insukind=="11"){
  643. messageBox("건강보험 환자는 기초생활 수급자 장애인으로 등록될 수 없습니다.\n장애인 등록정보를 확인 부탁드립니다.", "E");
  644. return false;
  645. }else if(hndc_bslvflag == "Y" && (insukind=="21" || insukind=="22")){
  646. model.makeValue("/root/hidden/m_etc/uncocd", "A43"); //미수 50%
  647. model.makeValue("/root/main/otpt/otpt_uncocd", "A43");
  648. model.refresh();
  649. return true;
  650. }else if(hndc_slflag=="S"){ // 중증
  651. model.makeValue("/root/hidden/m_etc/uncocd", "A44"); //미수 30%
  652. model.makeValue("/root/main/otpt/otpt_uncocd", "A44");
  653. model.refresh();
  654. return true;
  655. }else if(hndc_slflag=="L"){ // 경증
  656. model.makeValue("/root/hidden/m_etc/uncocd", "A45"); //미수 10%
  657. model.makeValue("/root/main/otpt/otpt_uncocd", "A45");
  658. model.refresh();
  659. return true;
  660. }else{
  661. return true;
  662. }
  663. }else{
  664. messageBox("해당 환자는 장애인 등록이 되어 있지 않습니다.\n장애인 등록 후 진행부탁드립니다.", "E");
  665. return false;
  666. }
  667. }else if(getNodesetCount("/root/main/h_hndc/hndc")>=1){
  668. if(hndc_bslvflag == "Y" && insukind=="11"){
  669. messageBox("건강보험 환자는 기초생활 수급자 장애인으로 등록될 수 없습니다.\n장애인 등록정보를 확인 부탁드립니다.", "E");
  670. return false;
  671. }else if(hndc_bslvflag == "Y" && (insukind=="21" || insukind=="22")){
  672. model.makeValue("/root/hidden/m_etc/uncocd", "A43"); //미수 50%
  673. model.makeValue("/root/main/otpt/otpt_uncocd", "A43");
  674. model.refresh();
  675. return true;
  676. }else if(hndc_slflag=="S"){ // 중증
  677. model.makeValue("/root/hidden/m_etc/uncocd", "A44"); //미수 30%
  678. model.makeValue("/root/main/otpt/otpt_uncocd", "A44");
  679. model.refresh();
  680. return true;
  681. }else if(hndc_slflag=="L"){ // 경증
  682. model.makeValue("/root/hidden/m_etc/uncocd", "A45"); //미수 10%
  683. model.makeValue("/root/main/otpt/otpt_uncocd", "A45");
  684. model.refresh();
  685. return true;
  686. }else{
  687. return true;
  688. }
  689. }
  690. }
  691. }else{
  692. return true;
  693. }
  694. }
  695. */