SMPID20600.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. /* ================================================================================================
  2. - File Name : SMPID20600.js
  3. - Description : 명세서관리
  4. - Create : 2008.08.29 김상진
  5. ================================================================================================== */
  6. /* --------------------------------------------------------------------------------------------------
  7. Fucntion Name || Description
  8. -----------------------------------------------------------------------------------------------------
  9. - fInitialize : 화면 초기화
  10. -------------------------------------------------------------------------------------------------- */
  11. var gToday = new Date();
  12. var gBaseyear = gToday.getDateFormat("YYYY"); // (dateHelper.js)에서 제공하는 함수를 사용하여 해당 년를 구한다.
  13. var gBasemonth = gToday.getDateFormat("MM");
  14. var gBaseday = gToday.getDateFormat("DD");
  15. var gCurrentdd = gBaseyear + gBasemonth + gBaseday;
  16. var gCurrentym = gBaseyear + gBasemonth;
  17. // -----------------------
  18. // ▶ 화면초기화
  19. // -----------------------
  20. function fInitialize() {
  21. // ---------------------------------------------------------------
  22. // 공통코드를 조회한다.
  23. // (ZBC001.js) com.ZBCMCODE 에서 기초코드 값 Get
  24. // ---------------------------------------------------------------
  25. zbcfGetCodeList(
  26. new Array("P0008" // 보험유형
  27. ,"P0010" // 보조유형
  28. ,"P0291" // 진료분야
  29. ,"P0155" // 청구구분
  30. ),
  31. new Array("/root/init/P0008list"
  32. ,"/root/init/P0010list"
  33. ,"/root/init/P0291list"
  34. ,"/root/init/P0155list"
  35. ) );
  36. /*
  37. // ---------------------------------------------------------------
  38. // 청구과, 심사자, 진료과, 주치의, 청구차수, 삼시자선택 초기화
  39. // ---------------------------------------------------------------
  40. var clamym = model.getValue("/root/send/item1/clamym");
  41. model.setValue("/root/send/item1/clamym", "");
  42. submit("TRPID20201",false);
  43. model.removeNodeset("root/init/judgrid");
  44. model.removeNodeset("root/init/suppkind");
  45. model.removeNodeset("root/init/orddrid");
  46. model.removeNodeset("root/init/clamdept");
  47. model.removeNodeset("root/init/orddeptcd");
  48. model.removeNodeset("root/init/item3");
  49. model.removeNodeset("root/init/clamdg");
  50. model.makeNode("root/init/judgrid");
  51. model.makeNode("root/init/suppkind");
  52. model.makeNode("root/init/orddrid");
  53. model.makeNode("root/init/clamdept");
  54. model.makeNode("root/init/orddeptcd");
  55. model.makeNode("root/init/item3");
  56. model.makeNode("root/init/clamdg");
  57. model.copyNode("root/init/judgrid", "root/init/tmp/judgrid");
  58. model.copyNode("root/init/suppkind", "root/init/tmp/suppkind");
  59. model.copyNode("root/init/orddrid", "root/init/tmp/orddrid");
  60. model.copyNode("root/init/clamdept", "root/init/tmp/clamdept");
  61. model.copyNode("root/init/orddeptcd", "root/init/tmp/orddeptcd");
  62. model.copyNode("root/init/item3", "root/init/tmp/item3");
  63. model.copyNode("root/init/clamdg", "root/init/tmp/clamdg");
  64. model.removeNodeset("root/init/tmp/judgrid");
  65. model.removeNodeset("root/init/tmp/suppkind");
  66. model.removeNodeset("root/init/tmp/orddrid");
  67. model.removeNodeset("root/init/tmp/clamdept");
  68. model.removeNodeset("root/init/tmp/orddeptcd");
  69. model.removeNodeset("root/init/tmp/item3");
  70. model.removeNodeset("root/init/tmp/clamdg");
  71. */
  72. // ---------------------------------------------------------------
  73. // 진료과 주치의 초기화
  74. // ---------------------------------------------------------------
  75. submit("TRPID20309", false);
  76. model.makeNode("root/hidden/tmp/orddeptcd");
  77. model.makeNode("root/hidden/tmp/orddeptcd2");
  78. model.makeNode("root/hidden/tmp/orddrid");
  79. model.makeNode("root/hidden/tmp/orddrid2");
  80. model.removeNodeset("root/init/orddeptcd");
  81. model.removeNodeset("root/init/orddeptcd2");
  82. model.removeNodeset("root/init/orddrid");
  83. model.removeNodeset("root/init/orddrid2");
  84. model.makeNode("root/init/orddeptcd");
  85. model.makeNode("root/init/orddeptcd2");
  86. model.makeNode("root/init/orddrid");
  87. model.makeNode("root/init/orddrid2");
  88. model.copyNode("root/init/orddeptcd", "root/hidden/tmp/orddeptcd");
  89. model.copyNode("root/init/orddeptcd2", "root/hidden/tmp/orddeptcd2");
  90. model.copyNode("root/init/orddrid", "root/hidden/tmp/orddrid");
  91. model.copyNode("root/init/orddrid2", "root/hidden/tmp/orddrid2");
  92. model.removeNodeset("root/hidden/tmp/orddeptcd");
  93. model.removeNodeset("root/hidden/tmp/orddeptcd2");
  94. model.removeNodeset("root/hidden/tmp/orddrid");
  95. model.removeNodeset("root/hidden/tmp/orddrid2");
  96. model.refreshpart("/root/send/item1/orddeptcd");
  97. model.refreshpart("/root/send/item1/orddeptcd2");
  98. model.refreshpart("/root/send/item1/orddrid");
  99. model.refreshpart("/root/send/item1/orddrid2");
  100. // 청구월 셋팅
  101. if (model.getValue("/root/send/item1/clamym") == "") {
  102. var lv_date = gCurrentym.toDate("YYYYMM" + "01");
  103. lv_date = lv_date.getAddDate(-1, "M")
  104. gCurrentym = lv_date.getDateFormat("YYYYMM")
  105. model.setValue("/root/send/item1/clamym", gCurrentym);
  106. }
  107. model.refresh();
  108. }
  109. // ----------------------------------------------------------------------
  110. // ▶ 명세서관리 대상조회
  111. // ----------------------------------------------------------------------
  112. function fGetDocuList() {
  113. // -----------------------------------
  114. // 작업구분에 따른 초기정보 ValidCheck
  115. // -----------------------------------
  116. var makeflag = model.getValue("/root/send/item1/makeflag");
  117. //합철, 복사, 이동, 자격수정, Donor일때는 등록번호는 필수입력조건
  118. if (makeflag != "4") {
  119. if (model.getValue("/root/send/item1/pid") == "") {
  120. messageBox("등록번호는", "I003"); ///I003=등록번호는 필수입력입니다.
  121. model.dispatch("ipt_patunitsrch");
  122. return;
  123. }
  124. }
  125. //대상자 조회
  126. if (submit("TRPID20601")) {
  127. // 추가청구일경우 최종청구차수 가져온다.
  128. fGetMaxClamdg();
  129. var nodeList = instance1.selectNodes("/root/main/list1/clbs");
  130. if (nodeList.length == 1) {
  131. model.setValue("/root/main/list1/clbs[1]/fromchk", "Y");
  132. grd_clbsmast.refresh();
  133. grd_clbsmast.row = 1;
  134. g_from_cnt = 1;
  135. }
  136. }
  137. }
  138. // ----------------------------------------------------------------------
  139. // ▶ 명세서관리 자료생성
  140. // ----------------------------------------------------------------------
  141. function fSetDocuMake() {
  142. // 자료생성전 체크
  143. var rslt = fValidcheck();
  144. if (rslt != false) {
  145. model.resetInstanceNode("root/send/list1/clbs");
  146. var makeflag = model.getValue("root/send/item1/makeflag");
  147. var fromchk="";
  148. var iCnt=0;
  149. // 1. 합철
  150. if (makeflag == "1") {
  151. for (var i = 1; i < grd_clbsmast.rows; i++) {
  152. fromchk = model.getValue("/root/main/list1/clbs[" + i + "]/fromchk");
  153. tochk = model.getValue("/root/main/list1/clbs[" + i + "]/tochk");
  154. if (fromchk == "Y" || tochk == "Y") {
  155. iCnt++;
  156. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/makeflag", model.getValue("/root/send/item1/makeflag"));
  157. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/ioflag", model.getValue("/root/send/item1/ioflag"));
  158. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/fromchk", model.getValue("/root/main/list1/clbs[" + i + "]/fromchk"));
  159. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/tochk", model.getValue("/root/main/list1/clbs[" + i + "]/tochk"));
  160. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/clamym", model.getValue("/root/main/list1/clbs[" + i + "]/clamym"));
  161. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/clamdg", model.getValue("/root/main/list1/clbs[" + i + "]/clamdg"));
  162. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/pid", model.getValue("/root/main/list1/clbs[" + i + "]/pid"));
  163. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/pidsn", model.getValue("/root/main/list1/clbs[" + i + "]/pidsn"));
  164. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/workflag", model.getValue("/root/main/list1/clbs[" + i + "]/workflag"));
  165. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/clamkey", model.getValue("/root/main/list1/clbs[" + i + "]/clamkey"));
  166. }
  167. }
  168. }
  169. // 2:복사, 3:이동
  170. else if (makeflag == "2" || makeflag == "3") {
  171. for (var i = 1; i < grd_clbsmast.rows; i++) {
  172. fromchk = model.getValue("/root/main/list1/clbs[" + i + "]/fromchk");
  173. if (fromchk == "Y") {
  174. iCnt++;
  175. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/makeflag", model.getValue("/root/send/item1/makeflag"));
  176. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/copyflag", model.getValue("/root/send/item1/copyflag"));
  177. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/clamym", model.getValue("/root/main/list1/clbs[" + i + "]/clamym"));
  178. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/clamdg", model.getValue("/root/main/list1/clbs[" + i + "]/clamdg"));
  179. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/pid", model.getValue("/root/main/list1/clbs[" + i + "]/pid"));
  180. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/pidsn", model.getValue("/root/main/list1/clbs[" + i + "]/pidsn"));
  181. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/workflag", model.getValue("/root/main/list1/clbs[" + i + "]/workflag"));
  182. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/clamkey", model.getValue("/root/main/list1/clbs[" + i + "]/clamkey"));
  183. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/t_clamym", model.getValue("/root/send/item1/t_clamym"));
  184. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/t_clamdg", model.getValue("/root/send/item1/t_clamdg"));
  185. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/t_clamflagcd", model.getValue("/root/send/item1/t_clamflagcd"));
  186. }
  187. }
  188. }
  189. // 4:추가청구
  190. else if (makeflag == "4") {
  191. for (var i = 1; i < grd_clbsmast.rows; i++) {
  192. fromchk = model.getValue("/root/main/list1/clbs[" + i + "]/fromchk");
  193. if (fromchk == "Y") {
  194. iCnt++;
  195. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/makeflag", model.getValue("/root/send/item1/makeflag"));
  196. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/ioflag", model.getValue("/root/send/item1/ioflag"));
  197. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/clamym", model.getValue("/root/main/list1/clbs[" + i + "]/clamym"));
  198. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/clamdg", model.getValue("/root/main/list1/clbs[" + i + "]/clamdg"));
  199. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/pid", model.getValue("/root/main/list1/clbs[" + i + "]/pid"));
  200. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/pidsn", model.getValue("/root/main/list1/clbs[" + i + "]/pidsn"));
  201. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/workflag", model.getValue("/root/main/list1/clbs[" + i + "]/workflag"));
  202. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/clamkey", model.getValue("/root/main/list1/clbs[" + i + "]/clamkey"));
  203. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/t_clamym", model.getValue("/root/send/item1/t_clamym"));
  204. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/t_clamdg", model.getValue("/root/send/item1/t_clamdg"));
  205. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/t_clamflagcd", model.getValue("/root/send/item1/t_clamflagcd"));
  206. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/acptno", model.getValue("/root/main/list1/clbs[" + i + "]/acptno"));
  207. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/acptdd", model.getValue("/root/main/list1/clbs[" + i + "]/acptdd"));
  208. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/docuseqno", model.getValue("/root/main/list1/clbs[" + i + "]/docuseqno"));
  209. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/adjtresncd", model.getValue("/root/main/list1/clbs[" + i + "]/adjtresncd"));
  210. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/ms010", model.getValue("/root/send/item1/ms010"));
  211. }
  212. }
  213. }
  214. // 5:자격수정
  215. else if (makeflag == "5") {
  216. for (var i = 1; i < grd_clbsmast.rows; i++) {
  217. fromchk = model.getValue("/root/main/list1/clbs[" + i + "]/fromchk");
  218. if (fromchk == "Y") {
  219. iCnt++;
  220. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/makeflag", model.getValue("/root/send/item1/makeflag"));
  221. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/ioflag", model.getValue("/root/send/item1/ioflag"));
  222. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/clamym", model.getValue("/root/main/list1/clbs[" + i + "]/clamym"));
  223. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/clamdg", model.getValue("/root/main/list1/clbs[" + i + "]/clamdg"));
  224. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/pid", model.getValue("/root/main/list1/clbs[" + i + "]/pid"));
  225. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/pidsn", model.getValue("/root/main/list1/clbs[" + i + "]/pidsn"));
  226. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/workflag", model.getValue("/root/main/list1/clbs[" + i + "]/workflag"));
  227. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/clamkey", model.getValue("/root/main/list1/clbs[" + i + "]/clamkey"));
  228. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/insukind", model.getValue("/root/main/list1/clbs[" + i + "]/insukind"));
  229. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/suppkind", model.getValue("/root/main/list1/clbs[" + i + "]/suppkind"));
  230. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/t_clamym", model.getValue("/root/send/item1/t_clamym"));
  231. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/t_clamdg", model.getValue("/root/send/item1/t_clamdg"));
  232. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/t_clamflagcd", model.getValue("/root/send/item1/t_clamflagcd"));
  233. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/t_insukind", model.getValue("/root/main/list1/clbs[" + i + "]/t_insukind"));
  234. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/t_suppkind", model.getValue("/root/main/list1/clbs[" + i + "]/t_suppkind"));
  235. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/insuno", model.getValue("/root/main/list1/clbs[" + i + "]/insuno"));
  236. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/certno", model.getValue("/root/main/list1/clbs[" + i + "]/certno"));
  237. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/insdnm", model.getValue("/root/main/list1/clbs[" + i + "]/insdnm"));
  238. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/acddd", model.getValue("/root/main/list1/clbs[" + i + "]/acddd"));
  239. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/acdacptno", model.getValue("/root/main/list1/clbs[" + i + "]/acdacptno"));
  240. model.makeValue("/root/send/list1/clbs[" + iCnt + "]/insucd", model.getValue("/root/main/list1/clbs[" + i + "]/insucd"));
  241. }
  242. }
  243. }
  244. // 자료생성...
  245. if (submit("TXPID20601")) {
  246. // 2:복사, 3:이동, 4:추가청구이면 변경된 명세서를 조회한다.
  247. if (makeflag == "2" || makeflag =="3" || makeflag == "4") {
  248. model.setValue("/root/send/item1/clamym", model.getValue("/root/send/item1/t_clamym"));
  249. model.setValue("/root/send/item1/clamdg", model.getValue("/root/send/item1/t_clamdg"));
  250. // model.setValue("/root/send/item1/clamflagcd", model.getValue("/root/send/item1/t_clamflagcd"));
  251. var clamym = model.getValue("/root/send/item1/clamym");
  252. var t_clamym = model.getValue("/root/send/item1/t_clamym");
  253. model.setValue("/root/send/item1/clamdg", model.getValue("/root/send/item1/t_clamdg"));
  254. var clamdg = model.getValue("/root/send/item1/t_clamdg");
  255. if (clamym == t_clamym) {
  256. addComboItem("cmb_clamdg", clamdg, clamdg, "above");
  257. } else {
  258. addComboItem("cmb_clamdg", clamdg, clamdg, "init");
  259. }
  260. model.refreshpart("/root/send/item1/clamym");
  261. model.refreshpart("/root/send/item1/clamdg");
  262. // model.refreshpart("/root/send/item1/clamflagcd");
  263. }
  264. btn_select.dispatch("DOMActivate"); // 자료생성 후 바로 조회...
  265. }
  266. }
  267. }
  268. // ----------------------------------------------------------------------
  269. // ▶ 자료생성전 체크
  270. // ----------------------------------------------------------------------
  271. function fValidcheck() {
  272. var makeflag = model.getValue("root/send/item1/makeflag");
  273. // 생성할 명세서 선택되었는지 체크
  274. if (makeflag == "1") {
  275. if (g_from_cnt == 0) {
  276. messageBox("송신(FROM) 명세서가", "I004"); //송신(FROM) 명세서가 없습니다.
  277. return false;
  278. }
  279. if (g_to_cnt == 0) {
  280. messageBox("수신(FROM) 명세서가", "I004"); //수신(FROM) 명세서가 없습니다.
  281. return false;
  282. }
  283. } else {
  284. if (g_from_cnt == 0) {
  285. messageBox("자료생성할 명세서가", "I004"); //I004: 없습니다.
  286. return false;
  287. }
  288. }
  289. // 복사인 경우
  290. if (makeflag == "2") {
  291. var clamym = model.getValue("/root/send/item1/clamym");
  292. var clamdg = model.getValue("/root/send/item1/clamdg");
  293. var clamflagcd = model.getValue("/root/send/item1/clamflagcd");
  294. var t_clamym = model.getValue("/root/send/item1/t_clamym");
  295. var t_clamdg = model.getValue("/root/send/item1/t_clamdg");
  296. var t_clamflagcd = model.getValue("/root/send/item1/t_clamflagcd");
  297. if (t_clamym == "") {
  298. messageBox("생성 청구년월이", "I004"); //I004: 없습니다.
  299. return false;
  300. }
  301. else if (t_clamdg == "") {
  302. messageBox("생성 청구차수가", "I004"); //I004: 없습니다.
  303. return false;
  304. }
  305. else if (t_clamflagcd == "") {
  306. messageBox("생성 청구구분이", "I004"); //I004: 없습니다.
  307. return false;
  308. }
  309. else if (model.getValue("/root/send/item1/copyflag") == "") {
  310. messageBox("생성조건이", "I004"); //I004: 없습니다.
  311. return false;
  312. }
  313. else {
  314. if ( clamym + clamdg + clamflagcd == t_clamym + t_clamdg + t_clamflagcd ) {
  315. messageBox(" 생성 청구년월, 청구차수, 청구구분중 하나도 변경되지", "E007"); //E007=않았습니다.
  316. model.setFocus("ipt_toclamym");
  317. return false;
  318. }
  319. }
  320. }
  321. // 이동인 경우
  322. else if (makeflag == "3") {
  323. var clamym = model.getValue("/root/send/item1/clamym");
  324. var clamdg = model.getValue("/root/send/item1/clamdg");
  325. var t_clamym = model.getValue("/root/send/item1/t_clamym");
  326. var t_clamdg = model.getValue("/root/send/item1/t_clamdg");
  327. if (t_clamym == "") {
  328. messageBox("생성 청구년월이", "I004"); //I004: 없습니다.
  329. return false;
  330. }
  331. else if (t_clamdg == "") {
  332. messageBox("생성 청구차수가", "I004"); //I004: 없습니다.
  333. return false;
  334. }
  335. /*
  336. else if (model.getValue("/root/send/item1/t_clamflagcd") == "") {
  337. messageBox("생성 청구구분이", "I004"); //I004: 없습니다.
  338. }
  339. */
  340. else {
  341. if ( clamym + clamdg == t_clamym + t_clamdg ) {
  342. messageBox(" 생성 청구년월 또는 청구차수가 변경되지", "E007"); //E007=않았습니다.
  343. model.setFocus("ipt_toclamym");
  344. return false;
  345. }
  346. }
  347. }
  348. // 추가청구인 경우
  349. else if (makeflag == "4") {
  350. var clamym = model.getValue("/root/send/item1/clamym");
  351. var clamdg = model.getValue("/root/send/item1/clamdg");
  352. var t_clamym = model.getValue("/root/send/item1/t_clamym");
  353. var t_clamdg = model.getValue("/root/send/item1/t_clamdg");
  354. if (t_clamym == "") {
  355. messageBox("생성 청구년월이", "I004"); //I004: 없습니다.
  356. return false;
  357. }
  358. else if (t_clamdg == "") {
  359. messageBox("생성 청구차수가", "I004"); //I004: 없습니다.
  360. return false;
  361. }
  362. else {
  363. if ( clamym + clamdg == t_clamym + t_clamdg ) {
  364. messageBox(" 생성 청구년월 또는 청구차수가 변경되지", "E007"); //E007=않았습니다.
  365. model.setFocus("ipt_toclamym");
  366. return false;
  367. }
  368. }
  369. }
  370. // 자격수정 인 경우
  371. else if (makeflag == "5") {
  372. var fromchkyn;
  373. var insukind;
  374. var suppkind;
  375. var t_insukind;
  376. var t_suppkind;
  377. var nodeList = instance1.selectNodes("/root/main/list1/clbs");
  378. for ( i = 1; i <= nodeList.length; i++) {
  379. fromchkyn = model.getValue("/root/main/list1/clbs[ " + i + "]/fromchk");
  380. if (fromchkyn == "Y") {
  381. insukind = model.getValue("/root/main/list1/clbs[ " + i + "]/insukind");
  382. suppkind = model.getValue("/root/main/list1/clbs[ " + i + "]/suppkind");
  383. t_insukind = model.getValue("/root/main/list1/clbs[ " + i + "]/t_insukind");
  384. t_suppkind = model.getValue("/root/main/list1/clbs[ " + i + "]/t_suppkind");
  385. insuno = model.getValue("/root/main/list1/clbs[ " + i + "]/insuno");
  386. certno = model.getValue("/root/main/list1/clbs[ " + i + "]/certno");
  387. insdnm = model.getValue("/root/main/list1/clbs[ " + i + "]/insdnm");
  388. acddd = model.getValue("/root/main/list1/clbs[ " + i + "]/acddd");
  389. acdacptno = model.getValue("/root/main/list1/clbs[ " + i + "]/acdacptno");
  390. insucd = model.getValue("/root/main/list1/clbs[ " + i + "]/insucd");
  391. if (t_insukind == "") {
  392. messageBox("변경 보험유형이", "I004"); //I004: 없습니다.
  393. return false;
  394. }
  395. else if (t_suppkind == "") {
  396. messageBox("변경 보조유형이", "I004"); //I004: 없습니다.
  397. return false;
  398. }
  399. else {
  400. if ( insukind + suppkind == t_insukind + t_suppkind ) {
  401. messageBox("보험유형 또는 보조유형이 변경되지", "E007"); //E007=않았습니다.
  402. model.setFocus("ipt_toclamym");
  403. return false;
  404. }
  405. }
  406. if (t_insukind == "11" || t_insukind == "21" || t_insukind == "22") {
  407. if (insuno == "") {
  408. messageBox("사업장기호가", "I004"); //I004: 없습니다.
  409. return false;
  410. } else if (certno == "") {
  411. messageBox("증번호가", "I004"); //I004: 없습니다.
  412. return false;
  413. } if (insuno == "") {
  414. messageBox("피보험자가", "I004"); //I004: 없습니다.
  415. return false;
  416. }
  417. } else if (t_insukind == "31") {
  418. if (acddd == "") {
  419. messageBox("사고일자가", "I004"); //I004: 없습니다.
  420. return false;
  421. } else if (acdacptno == "") {
  422. messageBox("접수번호가", "I004"); //I004: 없습니다.
  423. return false;
  424. } if (insucd == "") {
  425. messageBox("보험회사가", "I004"); //I004: 없습니다.
  426. return false;
  427. }
  428. } else if (t_insukind == "41" || t_insukind == "42") {
  429. if (acdacptno == "") {
  430. messageBox("산재관리번호가", "I004"); //I004: 없습니다.
  431. return false;
  432. } if (insucd == "") {
  433. messageBox("산재지사가", "I004"); //I004: 없습니다.
  434. return false;
  435. }
  436. }
  437. }
  438. }
  439. }
  440. }
  441. // ----------------------------------------------------------------------
  442. // ▶ 환자조회
  443. // ----------------------------------------------------------------------
  444. function fGetSrchPid() {
  445. var ipt_pid = model.getValue("/root/send/item1/pid");
  446. if (ipt_pid.charCodeAt(0) > 255) {
  447. model.setValue("/root/hidden/sppmc02500/cond/srchcond", "2"); // 검색조건 : 환자명으로 설정
  448. model.setValue("/root/hidden/sppmc02500/cond/hngnm", ipt_pid);
  449. } else {
  450. model.setValue("/root/hidden/sppmc02500/cond/srchcond", "1"); // 검색조건 : 등록번호로 설정
  451. model.setValue("/root/hidden/sppmc02500/cond/pid", ipt_pid);
  452. }
  453. // pam/commonweb/xrw/SPPMC02500_환자조회.xrw
  454. modal("SPPMC02500", "1", "150", "150", "SPPMC02500", "/root/hidden/sppmc02500/cond", "/root/send", "", ""); // SPPMC02500_환자조회.xrw
  455. var srch_pid = model.getValue("/root/main/patinfo/patinfolist/pid");
  456. if (srch_pid) { // SPPMC02500_환자조회 화면에서 조회한 경우임
  457. model.removeNodeset("/root/main/patinfo/patinfolist"); // patinfolist가 제거됨 (resetInstanceNode의 경우 값은 지우고 노드는 남아있음)
  458. model.makeNode("/root/main/patinfo/patinfolist"); // SPPMC02500_환자조회 팝업을 다시 조회할 경우를 위해 다시 노드를 추가함
  459. model.setValue("/root/send/item1/pid", srch_pid);
  460. }
  461. model.refresh();
  462. }
  463. // ----------------------------------
  464. // ▶추가청구일때만 청구차수를 조회
  465. // ----------------------------------
  466. function fGetClamdg() {
  467. var makeflag = model.getValue("/root/send/item1/makeflag");
  468. if (makeflag == "4") {
  469. //pidfGetClamdg();
  470. }
  471. }
  472. // ----------------------------------
  473. // ▶추가청구시 그리드 전체선택,해제
  474. // ----------------------------------
  475. function fChkAll(chkflag) {
  476. var i=0;
  477. var nodeList = instance1.selectNodes("/root/main/list1/clbs");
  478. g_from_cnt = 0;
  479. for ( i = 1; i <= nodeList.length; i++) {
  480. if (chkflag == "Y") {
  481. model.setValue("/root/main/list1/clbs[" + i + "]/fromchk", "Y");
  482. g_from_cnt++;
  483. } else {
  484. model.setValue("/root/main/list1/clbs[" + i + "]/fromchk", "N");
  485. }
  486. }
  487. grd_clbsmast.refresh();
  488. }
  489. // ----------------------------------
  490. // ▶추가청구시 추가청구 max차수 조회
  491. // ----------------------------------
  492. function fGetMaxClamdg() {
  493. var makeflag = model.getValue("/root/send/item1/makeflag");
  494. // "추가청구"일경우에는 최종 청구차수를 조회한다.
  495. if (makeflag == "4") {
  496. model.makeValue("/root/send/item1/clamflag", "2");
  497. if (submit("TRPID20602")) {
  498. model.setValue("/root/send/item1/t_clamdg", model.getValue("/root/hidden/item1/maxclamdg"));
  499. model.refreshpart("/root/send/item1/t_clamdg");
  500. }
  501. }
  502. }