SMMNW18000.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873
  1. var xInlvListPath = "/root/main/inlvinfo/inlvlist"; //입원방문관리
  2. var xDschlvListPath = "/root/main/dschlvinfo/dschlvlist"; //퇴원방문관리
  3. var xTestlvListPath = "/root/main/testlvinfo/testlvlist"; //검사대기방문관리
  4. var xMedilvListPath = "/root/main/medilvinfo/medilvlist"; //진료대기방문관리
  5. // 초기화
  6. function fInitialize(){
  7. zbcfGetCodeList(new Array("M0375",'M0376','P0341','P0008','P0010'), new Array("/root/comcodelist/bdtppartcd_cmblist","/root/comcodelist/bdbtype_cmblist","/root/comcodelist/rsrvflag_cmblist","/root/comcodelist/insukind_cmblist","/root/comcodelist/suppkind_cmblist"), true);
  8. fGetNursHardCdInfo("'R2'", getCurrentDate());
  9. model.removeNodeset("/root/main/inlvinfo/inlvlist");
  10. model.resetInstanceNode("/root/send");
  11. model.setValue("/root/main/cond/fromdd",getCurrentDate());
  12. model.setValue("/root/main/cond/todd",getCurrentDate());
  13. ipt_fromdd.refresh();
  14. ipt_todd.refresh();
  15. submit("TRPMI00106");
  16. var instcd = getUserInfo("dutplceinstcd");
  17. model.makeValue("/root/send/data1/sess_posinstcd",instcd);
  18. submit("TRPMI00405");
  19. model.toggle("inlv");
  20. cap_ddnm.attribute("left") = "20";
  21. cap_ddnm.attribute("width") = "90";
  22. cap_ddnm.text = "입원일자 :";
  23. model.setValue("/root/main/cond/menuflag", "inlv");
  24. model.refresh();
  25. fSearch();
  26. }
  27. // 방문조회
  28. function fSearch(){
  29. var fromdd = model.getValue("/root/main/cond/fromdd");
  30. var todd = model.getValue("/root/main/cond/todd");
  31. switch(model.getValue("/root/main/cond/menuflag")) {
  32. case "inlv" :
  33. if(getDateInterval(fromdd, todd) > 2){
  34. messageBox("조회기간은 3일 이상을 넘을 수", "I004");
  35. model.setFocus("ipt_todd");
  36. return;
  37. }
  38. fSearchinlv();
  39. break;
  40. case "dschlv" :
  41. if(getDateInterval(fromdd, todd) > 2){
  42. messageBox("조회기간은 3일 이상을 넘을 수", "I004");
  43. model.setFocus("ipt_todd");
  44. return;
  45. }
  46. fSearchdschlv();
  47. break;
  48. case "testlv" :
  49. if(getDateInterval(fromdd, todd) > 0){
  50. messageBox("조회기간은 1일 이상을 넘을 수", "I004");
  51. model.setFocus("ipt_todd");
  52. return;
  53. }
  54. fSearchtestlv();
  55. break;
  56. case "medilv" :
  57. if(getDateInterval(fromdd, todd) > 2){
  58. messageBox("조회기간은 3일 이상을 넘을 수", "I004");
  59. model.setFocus("ipt_todd");
  60. return;
  61. }
  62. fSearchmedilv();
  63. break;
  64. default :
  65. if(getDateInterval(fromdd, todd) > 2){
  66. messageBox("조회기간은 3일 이상을 넘을 수", "I004");
  67. model.setFocus("ipt_todd");
  68. return;
  69. }
  70. fSearchinlv();
  71. break;
  72. }
  73. }
  74. // 입원방문조회
  75. function fSearchinlv(){
  76. model.removeNodeset("/root/main/inlvinfo/inlvlist");
  77. model.copyNode("/root/send","/root/main/cond");
  78. submit("TRMNW18000");
  79. model.refresh();
  80. }
  81. // 퇴원방문조회
  82. function fSearchdschlv(){
  83. model.removeNodeset("/root/main/dschlvinfo/dschlvlist");
  84. model.copyNode("/root/send","/root/main/cond");
  85. submit("TRMNW18010");
  86. model.refresh();
  87. }
  88. // 검사대기 방문조회
  89. function fSearchtestlv(){
  90. model.removeNodeset("/root/main/testlvinfo/testlvlist");
  91. model.copyNode("/root/send","/root/main/cond");
  92. submit("TRMNW18020");
  93. model.refresh();
  94. }
  95. // 진료대기 방문조회
  96. function fSearchmedilv(){
  97. model.removeNodeset("/root/main/medilvinfo/medilvlist");
  98. model.copyNode("/root/send","/root/main/cond");
  99. submit("TRMNW18030");
  100. model.refresh();
  101. }
  102. // 방문저장
  103. function fSave(){
  104. switch(model.getValue("/root/main/cond/menuflag")) {
  105. case "inlv" :
  106. fSaveinlv()
  107. break;
  108. case "dschlv" :
  109. fSavedschlv();
  110. break;
  111. case "testlv" :
  112. fSavetestlv();
  113. break;
  114. case "medilv" :
  115. fSavemedilv();
  116. break;
  117. default :
  118. fSaveinlv();
  119. break;
  120. }
  121. }
  122. // 입원방문저장
  123. function fSaveinlv(){
  124. var inlvinfoHeader = "check▦instcd▦pid▦indd▦cretno▦inrecdd▦inrectm▦wardcd▦bedcd▦roomcd▦roomgrdecd▦orddeptcd▦medispclid▩";
  125. var inlvinfoData = "";
  126. var inrecddcnt = 0;
  127. var inrectmcnt = 0;
  128. var userdeptcd = getUserInfo("dutplcecd");
  129. for(var i = 0 ; i < grd_inlvlist.rows; i++) {
  130. if(model.getValue(xInlvListPath + "[" + i + "]/check") == "Y"){
  131. var check = model.getValue(xInlvListPath+"[" + i + "]/check");
  132. var instcd = model.getValue(xInlvListPath+"[" + i + "]/instcd");
  133. var pid = model.getValue(xInlvListPath+"[" + i + "]/pid");
  134. var indd = model.getValue(xInlvListPath+"[" + i + "]/indd");
  135. var cretno = model.getValue(xInlvListPath+"[" + i + "]/cretno");
  136. var inrecdd = model.getValue(xInlvListPath+"[" + i + "]/inrecdd");
  137. var inrectm = model.getValue(xInlvListPath+"[" + i + "]/inrectm");
  138. var wardcd = model.getValue(xInlvListPath+"[" + i + "]/wardcd");
  139. var bedcd = model.getValue(xInlvListPath+"[" + i + "]/bedcd");
  140. var roomcd = model.getValue(xInlvListPath+"[" + i + "]/roomcd");
  141. var roomgrdecd = model.getValue(xInlvListPath+"[" + i + "]/roomgrdecd");
  142. var orddeptcd = model.getValue(xInlvListPath+"[" + i + "]/orddeptcd");
  143. var medispclid = model.getValue(xInlvListPath+"[" + i + "]/medispclid");
  144. if(inrecdd == ""){
  145. inrecddcnt++;
  146. }
  147. if(inrectm == ""){
  148. inrectmcnt++;
  149. }
  150. inlvinfoData += check +"▦"
  151. + instcd +"▦"
  152. + pid +"▦"
  153. + indd +"▦"
  154. + cretno +"▦"
  155. + inrecdd +"▦"
  156. + inrectm +"▦"
  157. + wardcd +"▦"
  158. + bedcd +"▦"
  159. + roomcd +"▦"
  160. + roomgrdecd +"▦"
  161. + orddeptcd +"▦"
  162. + medispclid +"▩";
  163. }
  164. }
  165. if(inlvinfoData == "") {
  166. messageBox("선택된 내역이", "I004");
  167. return;
  168. }else if(inrecddcnt > 0 || inrectmcnt > 0 ){
  169. messageBox("방문저장일시를 입력하십시오.","C");
  170. }else{
  171. model.makeValue("/root/send/savedata", inlvinfoHeader+inlvinfoData);
  172. submit("TXMNW18000");
  173. fSearch() ;
  174. }
  175. }
  176. // 퇴원방문저장
  177. function fSavedschlv(){
  178. var dschlvinfoHeader = "check▦instcd▦pid▦indd▦cretno▦inrecdd▦inrectm▦wardcd▦bedcd▦roomcd▦roomgrdecd▦orddeptcd▦medispclid▩";
  179. var dschlvinfoData = "";
  180. var inrecddcnt = 0;
  181. var inrectmcnt = 0;
  182. var userdeptcd = getUserInfo("dutplcecd");
  183. for(var i = 0 ; i < grd_dschlvlist.rows; i++) {
  184. if(model.getValue(xDschlvListPath + "[" + i + "]/check") == "Y"){
  185. var check = model.getValue(xDschlvListPath+"[" + i + "]/check");
  186. var instcd = model.getValue(xDschlvListPath+"[" + i + "]/instcd");
  187. var pid = model.getValue(xDschlvListPath+"[" + i + "]/pid");
  188. var indd = model.getValue(xDschlvListPath+"[" + i + "]/indd");
  189. var cretno = model.getValue(xDschlvListPath+"[" + i + "]/cretno");
  190. var inrecdd = model.getValue(xDschlvListPath+"[" + i + "]/inrecdd");
  191. var inrectm = model.getValue(xDschlvListPath+"[" + i + "]/inrectm");
  192. var wardcd = model.getValue(xDschlvListPath+"[" + i + "]/wardcd");
  193. var bedcd = model.getValue(xDschlvListPath+"[" + i + "]/bedcd");
  194. var roomcd = model.getValue(xDschlvListPath+"[" + i + "]/roomcd");
  195. var roomgrdecd = model.getValue(xDschlvListPath+"[" + i + "]/roomgrdecd");
  196. var orddeptcd = model.getValue(xDschlvListPath+"[" + i + "]/orddeptcd");
  197. var medispclid = model.getValue(xDschlvListPath+"[" + i + "]/medispclid");
  198. if(inrecdd == ""){
  199. inrecddcnt++;
  200. }
  201. if(inrectm == ""){
  202. inrectmcnt++;
  203. }
  204. dschlvinfoData += check +"▦"
  205. + instcd +"▦"
  206. + pid +"▦"
  207. + indd +"▦"
  208. + cretno +"▦"
  209. + inrecdd +"▦"
  210. + inrectm +"▦"
  211. + wardcd +"▦"
  212. + bedcd +"▦"
  213. + roomcd +"▦"
  214. + roomgrdecd +"▦"
  215. + orddeptcd +"▦"
  216. + medispclid +"▩";
  217. }
  218. }
  219. if(dschlvinfoData == "") {
  220. messageBox("선택된 내역이", "I004");
  221. return;
  222. }else if(inrecddcnt > 0 || inrectmcnt > 0 ){
  223. messageBox("방문저장일시를 입력하십시오.","C");
  224. }else{
  225. model.makeValue("/root/send/savedata", dschlvinfoHeader+dschlvinfoData);
  226. submit("TXMNW18010");
  227. fSearch() ;
  228. }
  229. }
  230. // 검사대기 방문저장
  231. function fSavetestlv(){
  232. var testlvinfoHeader = "check▦instcd▦pid▦orddd▦cretno▦prcpdd▦prcpno▦inrecdd▦inrectm▦orddeptcd▦centcd▦orddrid▩";
  233. var testlvinfoData = "";
  234. var inrecddcnt = 0;
  235. var inrectmcnt = 0;
  236. var userdeptcd = getUserInfo("dutplcecd");
  237. for(var i = 0 ; i < grd_testlvlist.rows; i++) {
  238. if(model.getValue(xTestlvListPath + "[" + i + "]/check") == "Y"){
  239. var check = model.getValue(xTestlvListPath+"[" + i + "]/check");
  240. var instcd = model.getValue(xTestlvListPath+"[" + i + "]/instcd");
  241. var pid = model.getValue(xTestlvListPath+"[" + i + "]/pid");
  242. var orddd = model.getValue(xTestlvListPath+"[" + i + "]/orddd");
  243. var cretno = model.getValue(xTestlvListPath+"[" + i + "]/cretno");
  244. var prcpdd = model.getValue(xTestlvListPath+"[" + i + "]/prcpdd");
  245. var prcpno = model.getValue(xTestlvListPath+"[" + i + "]/prcpno");
  246. var inrecdd = model.getValue(xTestlvListPath+"[" + i + "]/inrecdd");
  247. var inrectm = model.getValue(xTestlvListPath+"[" + i + "]/inrectm");
  248. var orddeptcd = model.getValue(xTestlvListPath+"[" + i + "]/orddeptcd");
  249. var centcd = model.getValue(xTestlvListPath+"[" + i + "]/centcd");
  250. var orddrid = model.getValue(xTestlvListPath+"[" + i + "]/orddrid");
  251. if(inrecdd == ""){
  252. inrecddcnt++;
  253. }
  254. if(inrectm == ""){
  255. inrectmcnt++;
  256. }
  257. testlvinfoData += check +"▦"
  258. + instcd +"▦"
  259. + pid +"▦"
  260. + orddd +"▦"
  261. + cretno +"▦"
  262. + prcpdd +"▦"
  263. + prcpno +"▦"
  264. + inrecdd +"▦"
  265. + inrectm +"▦"
  266. + orddeptcd +"▦"
  267. + centcd +"▦"
  268. + orddrid +"▩";
  269. }
  270. }
  271. if(testlvinfoData == "") {
  272. messageBox("선택된 내역이", "I004");
  273. return;
  274. }else if(inrecddcnt > 0 || inrectmcnt > 0 ){
  275. messageBox("방문저장일시를 입력하십시오.","C");
  276. }else{
  277. model.makeValue("/root/send/savedata", testlvinfoHeader+testlvinfoData);
  278. submit("TXMNW18020");
  279. fSearch() ;
  280. }
  281. }
  282. // 진료대기 방문저장
  283. function fSavemedilv(){
  284. var medilvinfoHeader = "check▦instcd▦pid▦orddd▦cretno▦inrecdd▦inrectm▦orddeptcd▦centcd▦orddrid▩";
  285. var medilvinfoData = "";
  286. var inrecddcnt = 0;
  287. var inrectmcnt = 0;
  288. var userdeptcd = getUserInfo("dutplcecd");
  289. for(var i = 0 ; i < grd_medilvlist.rows; i++) {
  290. if(model.getValue(xMedilvListPath + "[" + i + "]/check") == "Y"){
  291. var check = model.getValue(xMedilvListPath+"[" + i + "]/check");
  292. var instcd = model.getValue(xMedilvListPath+"[" + i + "]/instcd");
  293. var pid = model.getValue(xMedilvListPath+"[" + i + "]/pid");
  294. var orddd = model.getValue(xMedilvListPath+"[" + i + "]/orddd");
  295. var cretno = model.getValue(xMedilvListPath+"[" + i + "]/cretno");
  296. var inrecdd = model.getValue(xMedilvListPath+"[" + i + "]/inrecdd");
  297. var inrectm = model.getValue(xMedilvListPath+"[" + i + "]/inrectm");
  298. var orddeptcd = model.getValue(xMedilvListPath+"[" + i + "]/orddeptcd");
  299. var centcd = model.getValue(xMedilvListPath+"[" + i + "]/centcd");
  300. var orddrid = model.getValue(xMedilvListPath+"[" + i + "]/orddrid");
  301. if(inrecdd == ""){
  302. inrecddcnt++;
  303. }
  304. if(inrectm == ""){
  305. inrectmcnt++;
  306. }
  307. medilvinfoData += check +"▦"
  308. + instcd +"▦"
  309. + pid +"▦"
  310. + orddd +"▦"
  311. + cretno +"▦"
  312. + inrecdd +"▦"
  313. + inrectm +"▦"
  314. + orddeptcd +"▦"
  315. + centcd +"▦"
  316. + orddrid +"▩";
  317. }
  318. }
  319. if(medilvinfoData == "") {
  320. messageBox("선택된 내역이", "I004");
  321. return;
  322. }else if(inrecddcnt > 0 || inrectmcnt > 0 ){
  323. messageBox("방문저장일시를 입력하십시오.","C");
  324. }else{
  325. model.makeValue("/root/send/savedata", medilvinfoHeader+medilvinfoData);
  326. submit("TXMNW18030");
  327. fSearch() ;
  328. }
  329. }
  330. // 방문저장취소
  331. function fDel(){
  332. switch(model.getValue("/root/main/cond/menuflag")) {
  333. case "inlv" :
  334. fDelinlv();
  335. break;
  336. case "dschlv" :
  337. fDeldschlv();
  338. break;
  339. case "testlv" :
  340. fDeltestlv();
  341. break;
  342. case "medilv" :
  343. fDelmedilv();
  344. break;
  345. default :
  346. fDelinlv();
  347. break;
  348. }
  349. }
  350. // 입원방문저장취소
  351. function fDelinlv(){
  352. var inlvinfoHeader = "check▦instcd▦pid▦indd▦cretno▩";
  353. var inlvinfoData = "";
  354. var inreccnt = 0;
  355. var userdeptcd = getUserInfo("dutplcecd");
  356. for(var i = 0 ; i < grd_inlvlist.rows; i++) {
  357. if(model.getValue(xInlvListPath + "[" + i + "]/check") == "Y"){
  358. var check = model.getValue(xInlvListPath+"[" + i + "]/check");
  359. var instcd = model.getValue(xInlvListPath+"[" + i + "]/instcd");
  360. var pid = model.getValue(xInlvListPath+"[" + i + "]/pid");
  361. var indd = model.getValue(xInlvListPath+"[" + i + "]/indd");
  362. var cretno = model.getValue(xInlvListPath+"[" + i + "]/cretno");
  363. var inrecyn = model.getValue(xInlvListPath+"[" + i + "]/inrecyn");
  364. inlvinfoData += check +"▦"
  365. + instcd +"▦"
  366. + pid +"▦"
  367. + indd +"▦"
  368. + cretno +"▩";
  369. if(inrecyn == "N"){
  370. inreccnt ++ ;
  371. }
  372. }
  373. }
  374. if(inlvinfoData == "") {
  375. messageBox("선택된 내역이", "I004");
  376. return;
  377. }else if(inreccnt > 0 ){
  378. messageBox("방문저장된 건만 방문저장취소가 가능합니다.","C");
  379. }else{
  380. model.makeValue("/root/send/savedata", inlvinfoHeader+inlvinfoData);
  381. submit("TXMNW18001");
  382. fSearch() ;
  383. }
  384. }
  385. // 퇴원방문저장취소
  386. function fDeldschlv(){
  387. var dschvinfoHeader = "check▦instcd▦pid▦indd▦cretno▩";
  388. var dschlvinfoData = "";
  389. var inreccnt = 0;
  390. var userdeptcd = getUserInfo("dutplcecd");
  391. for(var i = 0 ; i < grd_dschlvlist.rows; i++) {
  392. if(model.getValue(xDschlvListPath + "[" + i + "]/check") == "Y"){
  393. var check = model.getValue(xDschlvListPath+"[" + i + "]/check");
  394. var instcd = model.getValue(xDschlvListPath+"[" + i + "]/instcd");
  395. var pid = model.getValue(xDschlvListPath+"[" + i + "]/pid");
  396. var indd = model.getValue(xDschlvListPath+"[" + i + "]/indd");
  397. var cretno = model.getValue(xDschlvListPath+"[" + i + "]/cretno");
  398. var inrecyn = model.getValue(xDschlvListPath+"[" + i + "]/inrecyn");
  399. dschlvinfoData += check +"▦"
  400. + instcd +"▦"
  401. + pid +"▦"
  402. + indd +"▦"
  403. + cretno +"▩";
  404. if(inrecyn == "N"){
  405. inreccnt ++ ;
  406. }
  407. }
  408. }
  409. if(dschlvinfoData == "") {
  410. messageBox("선택된 내역이", "I004");
  411. return;
  412. }else if(inreccnt > 0 ){
  413. messageBox("방문저장된 건만 방문저장취소가 가능합니다.","C");
  414. }else{
  415. model.makeValue("/root/send/savedata", dschvinfoHeader+dschlvinfoData);
  416. submit("TXMNW18011");
  417. fSearch() ;
  418. }
  419. }
  420. // 검사대기 방문저장취소
  421. function fDeltestlv(){
  422. var testvinfoHeader = "check▦instcd▦pid▦orddd▦cretno▦prcpdd▦prcpno▩";
  423. var testlvinfoData = "";
  424. var inreccnt = 0;
  425. var userdeptcd = getUserInfo("dutplcecd");
  426. for(var i = 0 ; i < grd_testlvlist.rows; i++) {
  427. if(model.getValue(xTestlvListPath + "[" + i + "]/check") == "Y"){
  428. var check = model.getValue(xTestlvListPath+"[" + i + "]/check");
  429. var instcd = model.getValue(xTestlvListPath+"[" + i + "]/instcd");
  430. var pid = model.getValue(xTestlvListPath+"[" + i + "]/pid");
  431. var orddd = model.getValue(xTestlvListPath+"[" + i + "]/orddd");
  432. var cretno = model.getValue(xTestlvListPath+"[" + i + "]/cretno");
  433. var prcpdd = model.getValue(xTestlvListPath+"[" + i + "]/prcpdd");
  434. var prcpno = model.getValue(xTestlvListPath+"[" + i + "]/prcpno");
  435. var inrecyn = model.getValue(xTestlvListPath+"[" + i + "]/inrecyn");
  436. testlvinfoData += check +"▦"
  437. + instcd +"▦"
  438. + pid +"▦"
  439. + orddd +"▦"
  440. + cretno +"▦"
  441. + prcpdd +"▦"
  442. + prcpno +"▩";
  443. if(inrecyn == "N"){
  444. inreccnt ++ ;
  445. }
  446. }
  447. }
  448. if(testlvinfoData == "") {
  449. messageBox("선택된 내역이", "I004");
  450. return;
  451. }else if(inreccnt > 0 ){
  452. messageBox("방문저장된 건만 방문저장취소가 가능합니다.","C");
  453. }else{
  454. model.makeValue("/root/send/savedata", testvinfoHeader+testlvinfoData);
  455. submit("TXMNW18021");
  456. fSearch() ;
  457. }
  458. }
  459. // 진료대기 방문저장취소
  460. function fDelmedilv(){
  461. var medivinfoHeader = "check▦instcd▦pid▦orddd▦cretno▩";
  462. var medilvinfoData = "";
  463. var inreccnt = 0;
  464. var userdeptcd = getUserInfo("dutplcecd");
  465. for(var i = 0 ; i < grd_medilvlist.rows; i++) {
  466. if(model.getValue(xMedilvListPath + "[" + i + "]/check") == "Y"){
  467. var check = model.getValue(xMedilvListPath+"[" + i + "]/check");
  468. var instcd = model.getValue(xMedilvListPath+"[" + i + "]/instcd");
  469. var pid = model.getValue(xMedilvListPath+"[" + i + "]/pid");
  470. var orddd = model.getValue(xMedilvListPath+"[" + i + "]/orddd");
  471. var cretno = model.getValue(xMedilvListPath+"[" + i + "]/cretno");
  472. var inrecyn = model.getValue(xMedilvListPath+"[" + i + "]/inrecyn");
  473. medilvinfoData += check +"▦"
  474. + instcd +"▦"
  475. + pid +"▦"
  476. + orddd +"▦"
  477. + cretno +"▩";
  478. if(inrecyn == "N"){
  479. inreccnt ++ ;
  480. }
  481. }
  482. }
  483. if(medilvinfoData == "") {
  484. messageBox("선택된 내역이", "I004");
  485. return;
  486. }else if(inreccnt > 0 ){
  487. messageBox("방문저장된 건만 방문저장취소가 가능합니다.","C");
  488. }else{
  489. model.makeValue("/root/send/savedata", medivinfoHeader+medilvinfoData);
  490. submit("TXMNW18031");
  491. fSearch() ;
  492. }
  493. }
  494. function fExcel(){
  495. switch(model.getValue("/root/main/cond/menuflag")) {
  496. case "inlv" :
  497. fExcelinlv();
  498. break;
  499. case "dschlv" :
  500. fExceldschlv();
  501. break;
  502. case "testlv" :
  503. fExceltestlv();
  504. break;
  505. case "medilv" :
  506. fExcelmedilv();
  507. break;
  508. default :
  509. fExcelinlv();
  510. break;
  511. }
  512. }
  513. // 입원방문 엑셀저장
  514. function fExcelinlv(){
  515. var fileName = window.fileDialog("save", ",", false, "입원방문관리_" + getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  516. var col1 = grd_inlvlist.colRef("wardcd");
  517. var col2 = grd_inlvlist.colRef("bedcd");
  518. var col3 = grd_inlvlist.colRef("roomcd");
  519. var col4 = grd_inlvlist.colRef("roomgrdecd");
  520. var col5 = grd_inlvlist.colRef("bdtppartcd");
  521. var col6 = grd_inlvlist.colRef("bdbtype");
  522. if (fileName != ""){
  523. grd_inlvlist.saveExcel(fileName, "SheetName;exportfalsecols:1;col_"+col1+":label;col_"+col2+":label;col_"+col3+":label;col_"+col4+":label;col_"+col5+":label;col_"+col6+":label;", true, false, "", "", false);
  524. }
  525. }
  526. // 퇴원방문 엑셀저장
  527. function fExceldschlv(){
  528. var fileName = window.fileDialog("save", ",", false, "퇴원방문관리_" + getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  529. var col1 = grd_dschlvlist.colRef("wardcd");
  530. var col2 = grd_dschlvlist.colRef("bedcd");
  531. var col3 = grd_dschlvlist.colRef("roomcd");
  532. var col4 = grd_dschlvlist.colRef("roomgrdecd");
  533. if (fileName != ""){
  534. grd_dschlvlist.saveExcel(fileName, "SheetName;exportfalsecols:1;col_"+col1+":label;col_"+col2+":label;col_"+col3+":label;col_"+col4+":label;", true, false, "", "", false);
  535. }
  536. }
  537. // 검사대기방문 엑셀저장
  538. function fExceltestlv(){
  539. var fileName = window.fileDialog("save", ",", false, "검사대기방문관리_" + getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  540. var col1 = grd_testlvlist.colRef("centcd");
  541. if (fileName != ""){
  542. grd_testlvlist.saveExcel(fileName, "SheetName;exportfalsecols:1;col_"+col1+":label;col_", true, false, "", "", false);
  543. }
  544. }
  545. // 진료대기방문 엑셀저장
  546. function fExcelmedilv(){
  547. var fileName = window.fileDialog("save", ",", false, "진료대기방문관리_" + getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  548. var col1 = grd_medilvlist.colRef("centcd");
  549. var col2 = grd_medilvlist.colRef("rsrvflag");
  550. var col3 = grd_medilvlist.colRef("insukind");
  551. var col4 = grd_medilvlist.colRef("suppkind");
  552. if (fileName != ""){
  553. grd_medilvlist.saveExcel(fileName, "SheetName;exportfalsecols:1;col_"+col1+":label;col_"+col2+":label;col_"+col3+":label;col_"+col4+":label;", true, false, "", "", false);
  554. }
  555. }
  556. // 간호정보조사 임시저장
  557. function fNrInfoSave(){
  558. var nrinfoHeader = "check▦instcd▦pid▦indd▦cretno▦recflag▦highbp▦lowbp▦pulse▦breth▦bdtp▦bdtppartcd▦bdht▦bdwt▦spo2▦bdbtype▩";
  559. var nrinfoData = "";
  560. var recflagcnt = 0;
  561. var signinfoyncnt = 0;
  562. var userdeptcd = getUserInfo("dutplcecd");
  563. for(var i = 0 ; i < grd_inlvlist.rows; i++) {
  564. if(model.getValue(xInlvListPath + "[" + i + "]/check") == "Y"){
  565. var check = model.getValue(xInlvListPath+"[" + i + "]/check");
  566. var instcd = model.getValue(xInlvListPath+"[" + i + "]/instcd");
  567. var pid = model.getValue(xInlvListPath+"[" + i + "]/pid");
  568. var indd = model.getValue(xInlvListPath+"[" + i + "]/indd");
  569. var cretno = model.getValue(xInlvListPath+"[" + i + "]/cretno");
  570. var recflag = model.getValue(xInlvListPath+"[" + i + "]/recflag");
  571. var highbp = model.getValue(xInlvListPath+"[" + i + "]/highbp");
  572. var lowbp = model.getValue(xInlvListPath+"[" + i + "]/lowbp");
  573. var pulse = model.getValue(xInlvListPath+"[" + i + "]/pulse");
  574. var breth = model.getValue(xInlvListPath+"[" + i + "]/breth");
  575. var bdtp = model.getValue(xInlvListPath+"[" + i + "]/bdtp");
  576. var bdtppartcd = model.getValue(xInlvListPath+"[" + i + "]/bdtppartcd");
  577. var bdht = model.getValue(xInlvListPath+"[" + i + "]/bdht");
  578. var bdwt = model.getValue(xInlvListPath+"[" + i + "]/bdwt");
  579. var spo2 = model.getValue(xInlvListPath+"[" + i + "]/spo2");
  580. var bdbtype = model.getValue(xInlvListPath+"[" + i + "]/bdbtype");
  581. var signinfoyn = model.getValue(xInlvListPath+"[" + i + "]/signinfoyn");
  582. if(recflag == ""){
  583. recflagcnt++;
  584. }
  585. if(signinfoyn == "Y"){
  586. signinfoyncnt++;
  587. }
  588. nrinfoData += check +"▦"
  589. + instcd +"▦"
  590. + pid +"▦"
  591. + indd +"▦"
  592. + cretno +"▦"
  593. + recflag +"▦"
  594. + highbp +"▦"
  595. + lowbp +"▦"
  596. + pulse +"▦"
  597. + breth +"▦"
  598. + bdtp +"▦"
  599. + bdtppartcd +"▦"
  600. + bdht +"▦"
  601. + bdwt +"▦"
  602. + spo2 +"▦"
  603. + bdbtype +"▩";
  604. }
  605. }
  606. if(nrinfoData == "") {
  607. messageBox("선택된 내역이", "I004");
  608. return;
  609. }else if(signinfoyncnt > 0 ){
  610. messageBox("이미 인증저장된 건은 저장 또는 수정이 불가 합니다.","E");
  611. }else if(recflagcnt > 0 ){
  612. messageBox("간호정보조사지 종류를 선택하십시오.","C");
  613. }else{
  614. model.makeValue("/root/send/savedata", nrinfoHeader+nrinfoData);
  615. submit("TXMNW18002");
  616. fSearch() ;
  617. }
  618. }
  619. // 입실저장
  620. function fSaveInroom(){
  621. var inroominfoHeader = "check▦stat▦inrmcnfmflag▦saveId▦chngdeptroomflag▦instcd▦pid▦indd▦cretno▦wardcd▦bedcd▦roomcd▦roomgrdecd▦orddeptcd▦ordtype▦patnm▦sexage▦toward▦toroom▦chngorddeptcd▦chngatdoctid▦atdoctnm▦atdoctidphonno▦medispclid▦orddrnm▦medispclphonno▦tocntctel▦curdd▦curtm▦userid▦usernm▩";
  622. var inroominfoData = "";
  623. var careinrmddcnt = 0 ;
  624. var inddcnt = 0;
  625. var checkcnt = 0;
  626. var userdeptcd = getUserInfo("dutplcecd");
  627. for(var i = 0 ; i < grd_inlvlist.rows; i++) {
  628. if(model.getValue(xInlvListPath + "[" + i + "]/check") == "Y"){
  629. checkcnt++;
  630. if(checkcnt > 1) {
  631. messageBox("입실저장은 1건만 가능합니다.","E");
  632. return;
  633. }
  634. var check = model.getValue(xInlvListPath+"[" + i + "]/check");
  635. var instcd = model.getValue(xInlvListPath+"[" + i + "]/instcd");
  636. var pid = model.getValue(xInlvListPath+"[" + i + "]/pid");
  637. var indd = model.getValue(xInlvListPath+"[" + i + "]/indd");
  638. var cretno = model.getValue(xInlvListPath+"[" + i + "]/cretno");
  639. var wardcd = model.getValue(xInlvListPath+"[" + i + "]/wardcd");
  640. var bedcd = model.getValue(xInlvListPath+"[" + i + "]/bedcd");
  641. var roomcd = model.getValue(xInlvListPath+"[" + i + "]/roomcd");
  642. var roomgrdecd = model.getValue(xInlvListPath+"[" + i + "]/roomgrdecd");
  643. var orddeptcd = model.getValue(xInlvListPath+"[" + i + "]/orddeptcd");
  644. var ordtype = model.getValue(xInlvListPath+"[" + i + "]/ordtype");
  645. var patnm = model.getValue(xInlvListPath+"[" + i + "]/hngnm");
  646. var careinrmdd = model.getValue(xInlvListPath+"[" + i + "]/careinrmdd");
  647. var toward = grd_inlvlist.labelMatrix(grd_inlvlist.row, grd_inlvlist.colRef("wardcd"));
  648. var toroom = grd_inlvlist.labelMatrix(grd_inlvlist.row, grd_inlvlist.colRef("roomcd"));
  649. var chngorddeptcd= model.getValue(xInlvListPath+"[" + i + "]/wardcd");
  650. var chngatdoctid = model.getValue(xInlvListPath+"[" + i + "]/atdoctid");
  651. var atdoctnm = model.getValue(xInlvListPath+"[" + i + "]/atdoctnm");
  652. var atdoctidphonno = model.getValue(xInlvListPath+"[" + i + "]/atdoctidphonno");
  653. var medispclid = model.getValue(xInlvListPath+"[" + i + "]/medispclid");
  654. var orddrnm = model.getValue(xInlvListPath+"[" + i + "]/orddrnm");
  655. var medispclphonno = model.getValue(xInlvListPath+"[" + i + "]/medispclphonno");
  656. var tocntctel = model.getValue(xInlvListPath+"[" + i + "]/tocntctel");
  657. var stat = "u";
  658. var chngdeptroomflag = "01";
  659. var saveId = "SMMNW18000";
  660. var sexage = model.getValue(xInlvListPath+"[" + i + "]/sex") + "/" + model.getValue(xInlvListPath+"[" + i + "]/age");
  661. var curdd = getCurrentDate();
  662. var curtm = getCurrentTime().substr(0,4);
  663. var userid = getUserId();
  664. var usernm = getUserName();
  665. var ordflag = "01";
  666. var inrmcnfmflag = "U";
  667. if(careinrmdd != "-"){
  668. careinrmddcnt++;
  669. }
  670. if(indd != getCurrentDate()){
  671. inddcnt++;
  672. }
  673. inroominfoData += check +"▦"
  674. + stat +"▦"
  675. + inrmcnfmflag +"▦"
  676. + saveId +"▦"
  677. + chngdeptroomflag +"▦"
  678. + instcd +"▦"
  679. + pid +"▦"
  680. + indd +"▦"
  681. + cretno +"▦"
  682. + wardcd +"▦"
  683. + bedcd +"▦"
  684. + roomcd +"▦"
  685. + roomgrdecd +"▦"
  686. + orddeptcd +"▦"
  687. + ordtype +"▦"
  688. + patnm +"▦"
  689. + sexage +"▦"
  690. + toward +"▦"
  691. + toroom +"▦"
  692. + chngorddeptcd +"▦"
  693. + chngatdoctid +"▦"
  694. + atdoctnm +"▦"
  695. + atdoctidphonno +"▦"
  696. + medispclid +"▦"
  697. + orddrnm +"▦"
  698. + medispclphonno +"▦"
  699. + tocntctel +"▦"
  700. + curdd +"▦"
  701. + curtm +"▦"
  702. + userid +"▦"
  703. + usernm +"▩";
  704. }
  705. }
  706. if(inroominfoData == "") {
  707. messageBox("선택된 내역이", "I004");
  708. return;
  709. }else if(careinrmddcnt > 0 ){
  710. messageBox("이미 입실저장된 건은 저장이 불가합니다.","E");
  711. }else if(inddcnt > 0 ){
  712. messageBox("당일 입원환자에 대해서만 입실저장이", "I006","\입원일자를 확인하십시오.","E");
  713. }else{
  714. model.makeValue("/root/send/savedata", inroominfoHeader+inroominfoData);
  715. model.removenode("/root/main/rtninfo");
  716. if(submit("TXMNW18003")== true){
  717. var sMessage = "";
  718. sMessage = model.getValue("/root/main/rtninfo/patinfolist/pid") + " "
  719. + model.getValue("/root/main/rtninfo/patinfolist/patnm") + " "
  720. + model.getValue("/root/main/rtninfo/patinfolist/sexage") + " "
  721. + "입실등록되었습니다." ;
  722. if(model.getValue("/root/main/rtninfo/rtnmsg/resultflag") == "2") {
  723. sMessage += "\n\n입원전 검사실에서 미액팅된 검사가 존재합니다.\n입원전 검사실에 확인하십시오!!";
  724. }
  725. messageBox(sMessage, "I");
  726. }
  727. fSearch() ;
  728. }
  729. }