SMMNI00500.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. /*
  2. 주사실 기타 처치등록 관리(SMMNI00500.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var xBizExecInfoListPath = "/root/main/execinfo/execinfolist";
  7. //20090512 dhkim 사용자부서정보
  8. var userdeptcd = getUserInfo("dutplcecd");
  9. //20090512 dhkim 주사실코드
  10. var injdeptcd;
  11. /**
  12. * 20090506 dhkim
  13. * 초기화펑션추가
  14. */
  15. function fInit(){
  16. //20090512 dhkim 주사실코드 가져오기
  17. if(!submit("TRMNI00504")){
  18. messageBox("주사실코드조회를", "E009");
  19. return false;
  20. }
  21. injdeptcd = model.getValue("/root/hidden/injcdinfo/injdeptcd");
  22. //시행부서조건추가 (20090506 현재 육아상담실, 소아청소년과, 중앙주사실)
  23. model.removenode('/root/send');
  24. model.makeValue('/root/send/cdgrupid', '075');
  25. if(!submit('TRMNI01302')){
  26. messageBox('시행부서 초기화를', 'E009');
  27. return false;
  28. }
  29. //20090512 dhkim 사용자정보가 주사실일 경우는 주사실만 보여지고 주사실이 아니면 주사실만 빼고 보여줌.
  30. //노드에서 제거
  31. fSetNodeExecUserDept();
  32. // model.setValue('/root/main/rgst/execdeptcd', userdeptcd);
  33. model.refresh();
  34. model.removeNodeset("/root/main/execinfo/execinfolist");
  35. model.removeNodeset("/root/main/execinfo/statsinfolist");
  36. ipt_ordd.value = getCurrentDate();// 조회구간에 현재날짜(디폴트)
  37. ipt_fromdd.value = getCurrentDate();// 조회구간에 현재날짜(디폴트)
  38. ipt_todd.value = getCurrentDate();// 조회구간에 현재날짜(디폴트)
  39. var param = opener.javascript.getParameter("SMMNI00500_pid");
  40. if (isNull(param)) {
  41. var node = getGlobalVariable("paminfo");
  42. setCSVToNode("/root/main/paminfo", node);
  43. var uppid = model.getValue("/root/main/paminfo/list/pid");
  44. if(uppid != ""){
  45. ipt_pid.value = model.getValue("/root/main/paminfo/list/pid");
  46. fpidref();//등록번호에 따른 환자정보 검색
  47. }
  48. } else {
  49. ipt_pid.value = param;
  50. fpidref();//등록번호에 따른 환자정보 검색
  51. }
  52. fdetlcd();//처치 내역에따른 처치명 조회
  53. fEtcCureList();// 시행리스트, 통계 조회
  54. }
  55. /*************************************************************************************************************
  56. * 20090512 dhkim
  57. * 전체노드중 주사실사용자는 주사실노드만 재구성,
  58. * 소아청소년과/육아상담실은 주사실제외후 재구성
  59. *------------------------------------------------------------------------------------------------------------
  60. * 20090603 dhkim
  61. * supcdid파라미터 구성 배열로 변경
  62. * supcdid[0]예방주사비활성화여부(Y:비활성, N:활성)
  63. * supcdid[1]겸직사용자여부 (Y:겸직, N:비겸직)
  64. *************************************************************************************************************/
  65. function fSetNodeExecUserDept(){
  66. //노드초기화
  67. model.removenodeset('/root/init');
  68. model.makeNode('/root/init/execinfo/execinfolist');
  69. copyNodesetType('/root/init/execinfo/execinfolist', '/root/hidden/execinfo/execinfolist');
  70. addComboItem("cmb_execdeptcd", "전체", "ALL");
  71. cmb_execdeptcd.select(0);
  72. for ( var nCnt = 0; nCnt < cmb_execdeptcd.length; nCnt++ ) {
  73. if ( cmb_execdeptcd.item(nCnt).value == userdeptcd ) {
  74. cmb_execdeptcd.select(nCnt);
  75. break;
  76. }
  77. }
  78. /*
  79. var nodeCnt = getNodesetCount("/root/hidden/execinfo/execinfolist");
  80. var basecd, basenm, supcdid;
  81. //20090604 dhkim bmt주사실의 추가로 노드구성을 변경함
  82. //supcdid를 배열로 만들어 [0]번에 기타처치등록가능여부, [1]번에 콤보노드구성 (로그인부서2개이상여부) 체크함
  83. //ex) supcdid = Y|Y 또는 N|Y , Y|N, N|N 등으로 입력됨
  84. // supcdid[0] = Y: 기타처치,예방주사 모두등록가능
  85. // supcdid[0] = N: 기타처치만 등록가능함
  86. // supcdid[1] = Y: 사용자의 부서가 여러개가 올수있음 (예 : 소아청소년과, 육아상담실 겸직)
  87. // supcdid[1] = N: 사용자의 부서가 단일과로 구성됨. (예 : 중앙주사실, BMT주사실)
  88. var supcdidSplit, isMultiDept;
  89. var newNodeCnt = 0;
  90. for(var i = 1; i <= nodeCnt; i++){
  91. basecd = model.getValue("/root/hidden/execinfo/execinfolist[" + i + "]/basecd");
  92. supcdid = model.getValue("/root/hidden/execinfo/execinfolist[" + i + "]/supcdid");
  93. supcdidSplit = supcdid.split("|");//20090604 dhkim 배열로 분리
  94. if(basecd == userdeptcd){
  95. isMultiDept = supcdidSplit[1];//겸직여부를 찾는다.
  96. }
  97. }
  98. for(var i = 1; i <= nodeCnt; i++){
  99. basecd = model.getValue("/root/hidden/execinfo/execinfolist[" + i + "]/basecd");
  100. basenm = model.getValue("/root/hidden/execinfo/execinfolist[" + i + "]/basenm");
  101. supcdid = model.getValue("/root/hidden/execinfo/execinfolist[" + i + "]/supcdid");
  102. //20090604 dhkim 배열로 분리
  103. supcdidSplit = supcdid.split("|");
  104. supcdid = supcdidSplit[1];
  105. if(isMultiDept == 'Y'){
  106. if(supcdid == 'Y'){
  107. newNodeCnt++;
  108. model.makeValue('/root/init/execinfo/execinfolist[' + newNodeCnt + ']/basecd', basecd);
  109. model.makeValue('/root/init/execinfo/execinfolist[' + newNodeCnt + ']/basenm', basenm);
  110. }
  111. }else if(isMultiDept == 'N'){
  112. if(basecd == userdeptcd){
  113. newNodeCnt++;
  114. model.makeValue('/root/init/execinfo/execinfolist[' + newNodeCnt + ']/basecd', basecd);
  115. model.makeValue('/root/init/execinfo/execinfolist[' + newNodeCnt + ']/basenm', basenm);
  116. return;
  117. }
  118. }
  119. }
  120. /*
  121. for(var i = 1; i <= nodeCnt; i++){
  122. basecd = model.getValue("/root/hidden/execinfo/execinfolist[" + i + "]/basecd");
  123. basenm = model.getValue("/root/hidden/execinfo/execinfolist[" + i + "]/basenm");
  124. supcdid = model.getValue("/root/hidden/execinfo/execinfolist[" + i + "]/supcdid");
  125. //사용자부서가 주사실이면 주사실노드만 만들것
  126. if(injdeptcd == userdeptcd){
  127. if(supcdid == "N"){
  128. newNodeCnt++;
  129. model.makeValue('/root/init/execinfo/execinfolist[' + newNodeCnt + ']/basecd', basecd);
  130. model.makeValue('/root/init/execinfo/execinfolist[' + newNodeCnt + ']/basenm', basenm);
  131. }
  132. }else{
  133. if(supcdid == "Y"){
  134. newNodeCnt++;
  135. model.makeValue('/root/init/execinfo/execinfolist[' + newNodeCnt + ']/basecd', basecd);
  136. model.makeValue('/root/init/execinfo/execinfolist[' + newNodeCnt + ']/basenm', basenm);
  137. }
  138. }
  139. }
  140. */
  141. }
  142. /**
  143. * @group :
  144. * @ver : 2007.08.01
  145. * @by : 신혁춘
  146. * @---------------------------------------------------
  147. * @type : function
  148. * @access : public
  149. * @desc : 처치 내역에따른 처치명 조회
  150. * @param :
  151. * @return :
  152. * @---------------------------------------------------
  153. */
  154. function fdetlcd(){
  155. var cdclslist = model.getValue("/root/main/rgst/recflag")
  156. var baseclsflag = cdclslist.substring(0,1);
  157. var cdcls = cdclslist.substring(0,2);
  158. model.makeValue("/root/send/baseclsflag",baseclsflag);
  159. model.makeValue("/root/send/cdcls",cdcls);
  160. model.makeValue("/root/send/supbasetypecd",model.getValue("/root/main/rgst/recflag"));
  161. //20090511 dhkim 시행부서조건추가
  162. model.makeValue("/root/send/execdeptcd",model.getValue("/root/main/rgst/execdeptcd"));
  163. if(submit("TRMNI00503")){
  164. }
  165. }
  166. /**
  167. * @group :
  168. * @ver : 2007.06.01
  169. * @by : 신혁춘
  170. * @---------------------------------------------------
  171. * @type : function
  172. * @access : public
  173. * @desc : 등록번호에 따른 환자정보 검색
  174. * @param :
  175. * @return :
  176. * @---------------------------------------------------
  177. */
  178. function fpidref(){
  179. model.removeNodeset("/root/send");
  180. var pid = ipt_pid.value
  181. model.makeValue("/root/send/pid",pid);
  182. if(submit("TRMNI00501")){
  183. var hngnm=model.getValue("/root/main/rgst/rgstrinfo/rgstlist/hngnm");
  184. //데이타가 없을시 이전 출력 내용 삭제.
  185. if(hngnm==""){
  186. opt_hngnm.value="";
  187. opt_gndrage.value="";
  188. opt_hngnm.refresh();
  189. opt_gndrage.refresh();
  190. model.makeValue("/root/main/rghtref/rghtreflist/pid","");
  191. }
  192. }
  193. }
  194. /**
  195. * @group :
  196. * @ver : 2007.06.01
  197. * @by : 신혁춘
  198. * @---------------------------------------------------
  199. * @type : function
  200. * @access : public
  201. * @desc : 환자번호 조회 돋보기 클릭시
  202. * @param :
  203. * @return :
  204. * @---------------------------------------------------
  205. */
  206. function fPatSrch(){
  207. modal("SPPMC02500", "1","150", "150", "SPPMC02500", "/root/source", "/root/send");
  208. //환자번호 copy
  209. var popupendflag = model.getValue("/root/main/popupendflag");
  210. if (popupendflag == "ok"){
  211. model.setValue("/root/main/rgst/rgstrinfo/rgstlist/pid", model.getValue("/root/main/patinfo/patinfolist/pid"));
  212. model.refresh();
  213. var pid = "/root/main/rgst/rghtinfo/rghtlist/pid";
  214. if (pid != null && pid != "" && pid != " " && pid != "-"){
  215. fpidref("new");
  216. }
  217. }
  218. }
  219. /**
  220. * @group :
  221. * @ver : 2007.06.04
  222. * @by : 신혁춘
  223. * @---------------------------------------------------
  224. * @type : function
  225. * @access : public
  226. * @desc : 기타 처치등록 실시
  227. * @param :
  228. * @return :
  229. * @---------------------------------------------------
  230. */
  231. function fEtcCureSave(){
  232. var hngnm = model.getValue("/root/main/rgst/rgstrinfo/rgstlist/hngnm");
  233. var detlcd = model.getValue("/root/main/rgst/detlcd");
  234. var execdd = model.getValue("/root/main/rgst/execdd");
  235. //20090512 dhkim 시행부서추가
  236. var execdeptcd = model.getValue("/root/main/rgst/execdeptcd");
  237. if(execdeptcd == "ALL"){
  238. messageBox("시행부서가 선택되지", "E007");
  239. return;
  240. }
  241. if(hngnm==""){
  242. messageBox("환자가 선택되지", "E007");
  243. return;
  244. }
  245. if(detlcd=="1"){
  246. messageBox("처치 내역이 선택되지", "E007");
  247. return;
  248. }
  249. model.removeNodeset("/root/send");
  250. model.makeValue("/root/send/execdd", model.getValue("/root/main/rgst/execdd"));
  251. model.makeValue("/root/send/pid", model.getValue("/root/main/rgst/rgstrinfo/rgstlist/pid"));
  252. model.makeValue("/root/send/recflag", model.getValue("/root/main/rgst/recflag"));
  253. model.makeValue("/root/send/detlcd", model.getValue("/root/main/rgst/detlcd"));
  254. //20090512 dhkim 시행부서추가
  255. model.makeValue("/root/send/execdeptcd", model.getValue("/root/main/rgst/execdeptcd"));
  256. if(submit("TXMNI00501")){
  257. messageBox("저장이", "I002");
  258. ipt_fromdd.value = execdd;
  259. ipt_todd.value = execdd;
  260. fEtcCureList();//기타 처치시행 리스트 조회
  261. }
  262. }
  263. /**
  264. * @group :
  265. * @ver : 2007.06.04
  266. * @by : 신혁춘
  267. * @---------------------------------------------------
  268. * @type : function
  269. * @access : public
  270. * @desc : 기타 처치시행 리스트 조회
  271. * @param :
  272. * @return :
  273. * @---------------------------------------------------
  274. */
  275. function fEtcCureList(){
  276. model.removeNodeset("/root/send");
  277. model.makeValue("/root/send/fromdd", model.getValue("/root/main/refexec/fromdd"));
  278. model.makeValue("/root/send/todd", model.getValue("/root/main/refexec/todd"));
  279. model.makeValue("/root/send/recflag", model.getValue("/root/main/refexec/recflag"));
  280. //20090512 dhkim 시행부서추가
  281. model.makeValue("/root/send/execdeptcd", model.getValue("/root/main/rgst/execdeptcd"));
  282. if(submit("TRMNI00502")){
  283. }
  284. }
  285. /**
  286. * @group :
  287. * @ver : 2007.06.05
  288. * @by : 신혁춘
  289. * @---------------------------------------------------
  290. * @type : function
  291. * @access : public
  292. * @desc : 기타 처치시행 리스트 삭제
  293. * @param :
  294. * @return :
  295. * @---------------------------------------------------
  296. */
  297. function fEtcCuredel(){
  298. var Row = grd_execinfo.rows;
  299. var chek = 0;
  300. for (i=1; i<Row; i++){
  301. chek = chek + grd_execinfo.textmatrix(i,1);
  302. }
  303. if(chek==0){
  304. messageBox("하나 이상의 내역을", "C002")
  305. return;
  306. }
  307. model.removeNodeset("/root/send");
  308. model.makeValue("/root/send/execinfo",grd_execinfo.getupdatedataAll("i"));
  309. if(submit("TXMNI00502")){
  310. fEtcCureList();
  311. }
  312. }
  313. function fSelectExecdeptcd() {
  314. var val = cmb_execdeptcd.value;
  315. btn_save.disabled = !( val == userdeptcd );
  316. }