SMMND01300.js 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161
  1. /*
  2. 혈액투석도관기록(SMMND01300.xrw - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. //**전역변수**//
  7. var coduitrecinfoRow = "";
  8. var hdmatnpatRow = "";
  9. var XmlInstNm = "hmdlspipeinfolist" + " " // 혈액투석 도관관리 정보
  10. + "avfinfolist" + " " // 동정맥루 정보
  11. + "oprtinfolist" ; // 시술과 중재 정보
  12. /**
  13. * @group :
  14. * @ver : 2007.06.12
  15. * @by : 김진아
  16. * @---------------------------------------------------
  17. * @type : function
  18. * @access : public
  19. * @desc : 화면 초기화
  20. * @param :
  21. * @return :
  22. * @---------------------------------------------------
  23. */
  24. function fDone(){
  25. //**그리드 초기화**//
  26. model.removeNodeset("/root/main/hdmatnpatlist/hdmatnpatinfo"); // 혈액투석 유지환자 리스트
  27. model.removeNodeset("/root/main/coduitreclist/coduitrecinfo"); // 혈액투석 도관기록 리스트
  28. model.removeNodeset("/root/main/reclist/recinfo/hmdlspipeinfolist/hmdlspipeinfo"); // 혈액투석 도관관리
  29. model.removeNodeset("/root/main/reclist/recinfo/avfinfolist/avfinfo"); // 동정맥루 관리
  30. model.removeNodeset("/root/main/reclist/recinfo/oprtinfolist/oprtinfo"); // 시술과 중재
  31. model.removeNodeset("/root/main/reclist/recinfo/bvipinfolist/bvipinfo"); // 혈관내압측정비 20120330 by kya
  32. model.refresh();
  33. //**공통코드 가져오기**//
  34. zbcfGetCodeList( new Array ( "M0133" // 도관관리 부위
  35. , "M0134" // 도관관리 종류1
  36. , "M0135" // 도관관리 종류2
  37. , "M0136" // 혈액투석도관 제거이유
  38. , "M0137" // 동정맥루 관리 종류
  39. , "M0138" // 동정맥루 관리 부위
  40. , "M0139" // 동정맥루 사용혈관
  41. , "M0140" // 시술종류
  42. , "M0141" // 시술원인
  43. , "M0133" // 부위방향(기타부분을 추가해야함으로 추가)-20091022-kys
  44. , "M0628" // 발적, 멍, 혈종 -20120327 kya
  45. , "M0629" // 고정 (Fix suture) -20120327 kya
  46. , "M0630" // Locking Heparin -20120327 kya
  47. , "M0758" // 청진소견1 -20150818 kya
  48. , "M0759" // 청진소견2 -20150818 kya
  49. )
  50. , new Array ( "/root/init/M0133list" // 도관관리 부위
  51. , "/root/init/M0134list" // 도관관리 종류1
  52. , "/root/init/M0135list" // 도관관리 종류2
  53. , "/root/init/M0136list" // 혈액투석도관 제거이유
  54. , "/root/init/M0137list" // 도관관리 종류1
  55. , "/root/init/M0138list" // 도관관리 종류2
  56. , "/root/init/M0139list" // 혈액투석도관 제거이유
  57. , "/root/init/M0140list" // 시술종류
  58. , "/root/init/M0141list" // 시술원인
  59. , "/root/init/M0999list" // 부위방향임의로 설정-20091022-kys
  60. , "/root/init/M0628list" // 발적, 멍, 혈종 -20120327 kya
  61. , "/root/init/M0629list" // 고정 (Fix suture) -20120327 kya
  62. , "/root/init/M0630list" // Locking Heparin -20120327 kya
  63. , "/root/init/M0758list" // 청진소견1 -20150818 kya
  64. , "/root/init/M0759list" // 청진소견2 -20150818 kya
  65. )
  66. );
  67. //셀병합하지 않는다
  68. /*
  69. grd_hmdlspipeinfo.mergeCol(0) = false;
  70. grd_hmdlspipeinfo.mergeCol(1) = true;
  71. grd_hmdlspipeinfo.mergeCol(2) = true;
  72. grd_hmdlspipeinfo.mergeCol(3) = true;
  73. grd_hmdlspipeinfo.mergeCol(4) = false;
  74. grd_hmdlspipeinfo.mergeCol(5) = false;
  75. grd_hmdlspipeinfo.mergeCol(6) = false;
  76. grd_hmdlspipeinfo.mergeCol(7) = false;
  77. grd_hmdlspipeinfo.mergeCol(8) = false;
  78. */
  79. //20091022 부위방향에 기타 추가-kys,
  80. addComboInstance("/root/init/M0999list", "cdid^cdnm", "03^기타", "M0133", "I"); //부위방향 콤보 기타추가
  81. // 20150818 kya 막음 addComboInstance("/root/init/M0138list", "cdid^cdnm", "03^기타", "M0138[3]", "D"); //부위 콤보 기타삭제
  82. //** 상단환자 화면설정 **//
  83. var node = getGlobalVariable("paminfo");
  84. setCSVToNode("/root/temp/paminfo", node);
  85. if(getNodesetCount("/root/temp/paminfo/list") > 0) {
  86. var sSelPid = model.getValue("/root/temp/paminfo/list/pid"); // 등록번호
  87. var sMaintePatRgstDD = model.getValue("/root/temp/paminfo/list/maintepatrgstdd"); // 유지환자등록일자
  88. hdmatnpatRow = 1;
  89. model.setValue("/root/main/condition/pid", sSelPid);
  90. fSrchHDPatList(); // 혈액투석 유지환자 리스트 조회
  91. fSetHDPipeInfo(1); // 혈액투석 유지환자리스트에서 환자 선택 시 도관기록 리스트 및 누적조회, 환자정보를 설정
  92. }else{
  93. fSrchHDPatList(); // 혈액투석 유지환자 리스트 조회
  94. }
  95. }
  96. /**
  97. * @group :
  98. * @ver : 2007.06.12
  99. * @by : 김진아
  100. * @---------------------------------------------------
  101. * @type : function
  102. * @access : public
  103. * @desc : 혈액투석 유지환자 리스트 조회
  104. * @param :
  105. * @return :
  106. * @---------------------------------------------------
  107. */
  108. function fSrchHDMatnPatList(){
  109. model.removenode ("/root/send");
  110. model.makeNode ("/root/send");
  111. model.makeValue ("/root/send/reqdata/pid" , model.getValue("/root/main/condition/pid"));
  112. model.makeValue ("/root/send/reqdata/dialflag" , "H" ); // 투석구분 (H:혈액)
  113. //20090109 dhkim
  114. //내환자 추가
  115. model.makeValue("/root/send/reqdata/mypid",model.getValue("/root/main/condition/mypid"));
  116. //20130520 kya
  117. //혈액적성성평가 wardcd
  118. model.makeValue("/root/send/reqdata/wardcd",model.getValue("/root/main/condition/wardcd"));
  119. model.removeNodeset("/root/main/hdmatnpatlist");
  120. // 20130603 수정 TRMND01301 -> TRMN01305 로 변경함
  121. // 대상자를 혈액투석유지환자에서 당일 접수환자로 변경, 인증저장을 위해서
  122. submit("TRMND01301");
  123. //2008-08-19 양천덕 삭제 처리
  124. // if(model.getValue("/root/main/condition/pid") != "") {
  125. // grd_hdmatnpatinfo.cellstyle("background-color", 1, 1, 1, 3) = "#ffd9ff"; // 혈액투석 유지환자리스트 셀 색상 지정
  126. // for(var i=1; i<=grd_coduitrecinfo.rows; i++) {
  127. // grd_coduitrecinfo.cellstyle("background-color", i, 1, i, 3) = "white"; //fSaveHDPipeInfo 환자별 도관기록 리스트 셀 색상 초기화 (white)
  128. // }
  129. // fGetPatInfo(model.getValue("/root/main/hdmatnpatlist/hdmatnpatinfo[1]/pid"), model.getValue("/root/main/hdmatnpatlist/hdmatnpatinfo[1]/maintepatrgstdd")); // 혈액투석 유지환자 정보 설정
  130. // fSrchCoduitrecList(); // 환자별 도관기록 리스트 조회
  131. //}
  132. //model.refresh();
  133. }
  134. /**
  135. * @group :
  136. * @ver : 2013.06.02
  137. * @by : 권영애
  138. * @---------------------------------------------------
  139. * @type : function
  140. * @access : public
  141. * @desc : 혈액투석 당일 스케줄 환자 조회
  142. * @param :
  143. * @return :
  144. * @---------------------------------------------------
  145. */
  146. function fSrchHDPatList(){
  147. model.removenode ("/root/send");
  148. model.makeNode ("/root/send");
  149. model.makeValue ("/root/send/reqdata/pid" , model.getValue("/root/main/condition/pid"));
  150. model.makeValue ("/root/send/reqdata/dialflag" , "H" ); // 투석구분 (H:혈액)
  151. //20131007 kya 예약일자 추가
  152. model.makeValue ("/root/send/reqdata/rsrvdd" , model.getValue("/root/main/condition/rsrvdd"));
  153. //20090109 dhkim
  154. //내환자 추가
  155. model.makeValue("/root/send/reqdata/mypid",model.getValue("/root/main/condition/mypid"));
  156. //20130520 kya
  157. //혈액적성성평가 wardcd
  158. model.makeValue("/root/send/reqdata/wardcd",model.getValue("/root/main/condition/wardcd"));
  159. model.removeNodeset("/root/main/hdmatnpatlist");
  160. // 20130603 수정 TRMND01301 -> TRMN01305 로 변경함
  161. // 대상자를 혈액투석유지환자에서 당일 접수환자로 변경, 인증저장을 위해서
  162. submit("TRMND01305");
  163. //2008-08-19 양천덕 삭제 처리
  164. // if(model.getValue("/root/main/condition/pid") != "") {
  165. // grd_hdmatnpatinfo.cellstyle("background-color", 1, 1, 1, 3) = "#ffd9ff"; // 혈액투석 유지환자리스트 셀 색상 지정
  166. // for(var i=1; i<=grd_coduitrecinfo.rows; i++) {
  167. // grd_coduitrecinfo.cellstyle("background-color", i, 1, i, 3) = "white"; //fSaveHDPipeInfo 환자별 도관기록 리스트 셀 색상 초기화 (white)
  168. // }
  169. // fGetPatInfo(model.getValue("/root/main/hdmatnpatlist/hdmatnpatinfo[1]/pid"), model.getValue("/root/main/hdmatnpatlist/hdmatnpatinfo[1]/maintepatrgstdd")); // 혈액투석 유지환자 정보 설정
  170. // fSrchCoduitrecList(); // 환자별 도관기록 리스트 조회
  171. //}
  172. //model.refresh();
  173. }
  174. /**
  175. * @group :
  176. * @ver : 2007.06.12
  177. * @by : 김진아
  178. * @---------------------------------------------------
  179. * @type : function
  180. * @access : public
  181. * @desc : 혈액투석 유지환자 정보 설정
  182. * (혈액투석 유지환자 리스트 더블 클릭 시)
  183. * @param :
  184. * @return :
  185. * @---------------------------------------------------
  186. */
  187. function fGetPatInfo(sSelPid, sMaintePatRgstDD) {
  188. // 초기화
  189. model.removeNodeset("/root/main/reclist/recinfolists"); // 혈액투석도관기록
  190. model.removeNodeset("/root/main/reclist/recinfo/hmdlspipeinfolist/hmdlspipeinfo"); // 혈액투석 도관관리
  191. model.removeNodeset("/root/main/reclist/recinfo/avfinfolist/avfinfo" ); // 동정맥루 관리
  192. model.removeNodeset("/root/main/reclist/recinfo/oprtinfolist/oprtinfo" ); // 시술과 중재
  193. //기록자 정보 설정
  194. model.makeValue("/root/main/reclist/recinfolists/recid", getUserId()); // 현재 로그인한 사용자 ID
  195. model.makeValue("/root/main/reclist/recinfolists/recnm", getUserName()); // 현재 로그인한 사용자명
  196. // 기록일시 설정
  197. model.makeValue("/root/main/reclist/recinfolists/recdd", getCurrentDate()); // 기록일자
  198. model.makeValue("/root/main/reclist/recinfolists/rectm", getCurrentTime().substr(0,4)); // 기록시간
  199. // 환자 정보 설정
  200. model.makeValue("/root/main/reclist/recinfolists/pid", sSelPid);
  201. model.makeValue("/root/main/reclist/recinfolists/maintepatrgstdd", sMaintePatRgstDD);
  202. }
  203. /**
  204. * @group :
  205. * @ver : 2007.06.12
  206. * @by : 김진아
  207. * @---------------------------------------------------
  208. * @type : function
  209. * @access : public
  210. * @desc : 혈액투석도관정보 저장
  211. * @param : pFlag (T:임시저장, C:인증저장)
  212. * @return :
  213. * @---------------------------------------------------
  214. */
  215. function fSaveHDPipeInfo(pFlag){
  216. var sRecDD = model.getValue("/root/main/reclist/recinfolists/recdd"); // recdd
  217. var sRecTM = model.getValue("/root/main/reclist/recinfolists/rectm"); // rectm
  218. /*****start
  219. for(var i=1; i<grd_hmdlspipeinfo.rows; i++) {
  220. model.setValue("/root/main/reclist/recinfo/hmdlspipeinfolist/hmdlspipeinfo[" + i + "]/recdd", sRecDD);
  221. model.setValue("/root/main/reclist/recinfo/hmdlspipeinfolist/hmdlspipeinfo[" + i + "]/rectm", sRecTM);
  222. }
  223. for(var i=1; i<grd_bvipinfo.rows; i++) {
  224. model.setValue("/root/main/reclist/recinfo/bvipinfolist/bvipinfo[" + i + "]/recdd", sRecDD);
  225. model.setValue("/root/main/reclist/recinfo/bvipinfolist/bvipinfo[" + i + "]/rectm", sRecTM);
  226. }
  227. for(var i=1; i<grd_avfinfo.rows; i++) {
  228. model.setValue("/root/main/reclist/recinfo/avfinfolist/avfinfo[" + i + "]/recdd", sRecDD);
  229. model.setValue("/root/main/reclist/recinfo/avfinfolist/avfinfo[" + i + "]/rectm", sRecTM);
  230. }
  231. for(var i=1; i<grd_oprtinfo.rows; i++) {
  232. model.setValue("/root/main/reclist/recinfo/oprtinfolist/oprtinfo[" + i + "]/recdd", sRecDD);
  233. model.setValue("/root/main/reclist/recinfo/oprtinfolist/oprtinfo[" + i + "]/rectm", sRecTM);
  234. }
  235. end *******/
  236. //** 저장 데이터 없을 경우 **//
  237. if( getNodesetCount("/root/main/reclist/recinfo/hmdlspipeinfolist/hmdlspipeinfo") == 0
  238. && getNodesetCount("/root/main/reclist/recinfo/avfinfolist/avfinfo ") == 0
  239. && getNodesetCount("/root/main/reclist/recinfo/oprtinfolist/oprtinfo ") == 0
  240. && getNodesetCount("/root/main/reclist/recinfo/bvipinfolist/bvipinfo ") == 0) {
  241. messageBox("저장할 데이터가 ", "I004", "");
  242. return;
  243. }
  244. // 기록일시
  245. if(model.getValue("/root/main/reclist/recinfolists/recdd")=="") {
  246. messageBox("기록일자는", "I003", "");
  247. model.setFocus("ipt_recdd");
  248. return;
  249. }
  250. if(model.getValue("/root/main/reclist/recinfolists/rectm")=="") {
  251. messageBox("기록시간는", "I003", "");
  252. model.setFocus("ipt_rectm");
  253. return;
  254. }
  255. // 혈액투석 도관관리
  256. for(var i=1; i<=getNodesetCount("/root/main/reclist/recinfo/hmdlspipeinfolist/hmdlspipeinfo"); i++) {
  257. var sPart = model.getValue("/root/main/reclist/recinfo/hmdlspipeinfolist/hmdlspipeinfo["+i+"]/partflag" ); // 부위
  258. var sKind1 = model.getValue("/root/main/reclist/recinfo/hmdlspipeinfolist/hmdlspipeinfo["+i+"]/kindflag1"); // 종류1
  259. var sKind2 = model.getValue("/root/main/reclist/recinfo/hmdlspipeinfolist/hmdlspipeinfo["+i+"]/kindflag2"); // 종류2
  260. if(sPart == "" || sKind1 == "" || sKind2 == ""){
  261. messageBox("혈액투석 도관관리의 부위, 종류1, 종류2는", "I003", "");
  262. return;
  263. }
  264. }
  265. // 동정맥루 관리
  266. for(var i=1; i<=getNodesetCount("/root/main/reclist/recinfo/avfinfolist/avfinfo"); i++) {
  267. var sPart = model.getValue("/root/main/reclist/recinfo/avfinfolist/avfinfo["+i+"]/partflag"); // 부위
  268. var sPartdirection = model.getValue("/root/main/reclist/recinfo/avfinfolist/avfinfo["+i+"]/partdirection"); //기존null인 데이터로인해블럭킹 불가.
  269. var sKind = model.getValue("/root/main/reclist/recinfo/avfinfolist/avfinfo["+i+"]/kindflag"); // 종류
  270. if(sPart == "" || sKind == ""){
  271. messageBox("동정맥루 관리 부위, 종류는", "I003", "");
  272. return;
  273. }
  274. if(sPartdirection == "01" || sPartdirection == "02"){ //부위방향이 기타인경우에만 부위에 text가 입력되도록..-20091023-kys
  275. if(sPart != "01" && sPart != "02"){
  276. messageBox("부위방향이 기타가 아닌경우에는 arm 혹은 leg를 선택 하셔야 합니다.", "I", "");
  277. return;
  278. }
  279. }
  280. /* if(sPartdirection == "03"){ //부위방향이 기타인경우 부위의 값을 비우고 remark로 저장한다-20091023-kys
  281. model.makeValue("/root/main/reclist/recinfo/avfinfolist/avfinfo["+i+"]/remark", sPart); // remark
  282. model.makeValue("/root/main/reclist/recinfo/avfinfolist/avfinfo["+i+"]/partflag", ""); // partflag
  283. }*/
  284. }
  285. // 시술과 중재
  286. for(var i=1; i<=getNodesetCount("/root/main/reclist/recinfo/oprtinfolist/oprtinfo"); i++) {
  287. var sPart = model.getValue("/root/main/reclist/recinfo/oprtinfolist/oprtinfo["+i+"]/oprtkindflag" ); // 시술종류
  288. if(sPart == ""){
  289. messageBox("시술과 중재의 시술종류는", "I003", "");
  290. return;
  291. }
  292. }
  293. //동정맥루 관리-부위(기타일경우처리)
  294. for(var i=1; i<=getNodesetCount("/root/main/reclist/recinfo/avfinfolist/avfinfo"); i++) {
  295. var sPart = model.getValue("/root/main/reclist/recinfo/avfinfolist/avfinfo["+i+"]/partflag"); // 부위
  296. var sPartdirection = model.getValue("/root/main/reclist/recinfo/avfinfolist/avfinfo["+i+"]/partdirection"); //부위방향.
  297. if(sPartdirection == "03"){ //부위방향이 기타인경우 부위의 값을 비우고 remark로 저장한다-20091023-kys
  298. model.makeValue("/root/main/reclist/recinfo/avfinfolist/avfinfo["+i+"]/remark", sPart); // remark
  299. model.makeValue("/root/main/reclist/recinfo/avfinfolist/avfinfo["+i+"]/partflag", ""); // partflag
  300. }
  301. }
  302. /* 처음부터 막힘
  303. // 신규등록일 경우 동일기록일자 도관기록 존재 확인 //
  304. alert("신규 ==="+ model.getValue("/root/main/chklist/chkinfo/cretfalg");
  305. if(model.getValue("/root/main/chklist/chkinfo/cretfalg") == "Y") {
  306. model.removenode("/root/send");
  307. model.makeNode ("/root/send");
  308. model.makeValue ("/root/send/reqdata/pid" , model.getValue("/root/main/reclist/recinfolists/pid") );
  309. model.makeValue ("/root/send/reqdata/recdd", model.getValue("/root/main/reclist/recinfolists/recdd"));
  310. model.makeValue ("/root/send/reqdata/rectm", model.getValue("/root/main/reclist/recinfolists/rectm"));
  311. model.removeNodeset("/root/main/chklist");
  312. submit("TRMND01404");
  313. // 동일기록일자에 도관기록 존재 할 경우
  314. if(model.getValue("/root/main/chklist/chkinfo/pid") != "") {
  315. messageBox("동일일자에 도관기록이 존재합니다.", "E");
  316. // 기록일시 설정
  317. model.makeValue("/root/main/reclist/recinfolists/recdd", getCurrentDate()); // 기록일자
  318. model.makeValue("/root/main/reclist/recinfolists/rectm", getCurrentTime().substr(0,4)); // 기록시간
  319. model.refresh();
  320. return;
  321. }
  322. }
  323. */
  324. //** 저장실행 **//
  325. model.makeValue("/root/send/savedata/baseinfo/pid" , model.getValue("/root/main/reclist/recinfolists/pid"));
  326. //시작
  327. //20131022 kya 기록일자를 수진일자로 대체하도록 수정함. 과거일자 등록을 위해
  328. // model.makeValue("/root/send/savedata/baseinfo/recdd" , getCurrentDate());
  329. model.makeValue("/root/send/savedata/baseinfo/recdd" , model.getValue("/root/main/reclist/recinfolists/orddd"));
  330. //종료
  331. model.makeValue("/root/send/savedata/baseinfo/rectm" , getCurrentTime().substr(0,4));
  332. model.makeValue("/root/send/savedata/baseinfo/maintepatrgstdd", model.getValue("/root/main/reclist/recinfolists/maintepatrgstdd"));
  333. model.makeValue("/root/send/savedata/baseinfo/recid" , getUserId());
  334. model.makeValue("/root/send/savedata/baseinfo/recnm" , getUserName());
  335. model.makeValue("/root/send/savedata/baseinfo/dialflag" , "H");
  336. model.makeValue("/root/send/savedata/baseinfo/certflag" , pFlag); // 인증여부( T : 임시저장, C : 인증저장)
  337. doReplaceLtGt("/root/main/reclist/recinfo/avfinfolist/avfinfo"); // 특수문자 변환
  338. /*** 20130612 수정전
  339. model.makeValue("/root/send/savedata/hmdlspipeinfo", grd_hmdlspipeinfo.getupdatedataAll("i") );
  340. model.makeValue("/root/send/savedata/avfinfo" , grd_avfinfo.getupdatedataAll("i") );
  341. model.makeValue("/root/send/savedata/oprtinfo" , grd_oprtinfo.getupdatedataAll("i") );
  342. //20120330 by kya
  343. //model.makeValue("/root/send/savedata/bvipinfo" , grd_bvipinfo.getupdatedataAll("i") );
  344. ****/
  345. /** 20130612 추가 : 인증전에 "d"인 데이타 삭제 **/
  346. for(var i= grd_hmdlspipeinfo.fixedRows ; i< grd_hmdlspipeinfo.rows ; i++) {
  347. // var sStatusflag = model.getValue("/root/main/reclist/recinfo/hmdlspipeinfolist/hmdlspipeinfo["+i+"]/status");
  348. var sStatusflag = grd_hmdlspipeinfo.valueMatrix(i , grd_hmdlspipeinfo.colRef("status"));
  349. if ( sStatusflag == "d") {
  350. grd_hmdlspipeinfo.deleteRow(i);
  351. }
  352. }
  353. for(var i=1; i<grd_bvipinfo.rows; i++) {
  354. var sStatusflag = model.getValue("/root/main/reclist/recinfo/bvipinfolist/bvipinfo["+i+"]/status");
  355. if ( sStatusflag == "d") {
  356. grd_bvipinfo.deleteRow(i);
  357. }
  358. }
  359. for(var i=1; i<grd_avfinfo.rows; i++) {
  360. var sStatusflag = model.getValue("/root/main/reclist/recinfo/avfinfolist/avfinfo["+i+"]/status");
  361. if ( sStatusflag == "d") {
  362. grd_avfinfo.deleteRow(i);
  363. }
  364. }
  365. for(var i=1; i<grd_oprtinfo.rows; i++) {
  366. var sStatusflag = model.getValue("/root/main/reclist/recinfo/oprtinfolist/oprtinfo["+i+"]/status");
  367. if ( sStatusflag == "d") {
  368. grd_oprtinfo.deleteRow(i);
  369. }
  370. }
  371. /**** 20130612 수정후 kya ***/
  372. model.makeValue("/root/send/savedata/hmdlspipeinfo", getGridUpdateData(grd_hmdlspipeinfo) );
  373. model.makeValue("/root/send/savedata/avfinfo" , getGridUpdateData(grd_avfinfo) );
  374. model.makeValue("/root/send/savedata/oprtinfo" , getGridUpdateData(grd_oprtinfo) );
  375. model.makeValue("/root/send/savedata/bvipinfo" , getGridUpdateData(grd_bvipinfo) );
  376. // 인증저장일 경우
  377. if(pFlag == "C"){
  378. // 인증 로직 호출
  379. if(Sign.signprocess() == true){
  380. model.removeNodeset("/root/send/savedata/signinfo");
  381. model.makeValue("/root/send/savedata/signinfo/pid" , model.getValue("/root/main/reclist/recinfolists/pid") ); // 등록번호
  382. model.makeValue("/root/send/savedata/signinfo/orddd" , model.getValue("/root/main/reclist/recinfolists/orddd") ); // 진료일자
  383. model.makeValue("/root/send/savedata/signinfo/signno" , model.getValue("/root/main/reclist/recinfolists/signno") ); // 서명번호
  384. model.makeValue("/root/send/savedata/signinfo/cretno" , model.getValue("/root/main/reclist/recinfolists/cretno") ); // 생성번호
  385. model.makeValue("/root/send/savedata/signinfo/recdd" , model.getValue("/root/main/reclist/recinfolists/recdd") ); //기록일자
  386. model.makeValue("/root/send/savedata/signinfo/rectm" , getCurrentTime().substr(0,4) ); // 실제 기록이 이루어진 기록시간(통합기록에서 보여짐)
  387. model.makeValue("/root/send/savedata/signinfo/recsaveflag" , "Y" ); // 전자서명 인적정보 변경여부(기록일시 변경되는 경우: Y, 그외: N)
  388. model.makeValue("/root/send/savedata/signinfo/signflag" , "02"); // 서명자료구분(01 : 진료, 02 : 간호)
  389. model.makeValue("/root/send/savedata/signinfo/signgenrflag", model.getValue("/root/main/reclist/recinfolists/histstat")); // 서명발생구분 (코드정의서 M0010 참조)
  390. model.makeValue("/root/send/savedata/signinfo/formcd" , "0000002497"); // 각 기록지별 서식코드
  391. model.makeValue("/root/send/savedata/signinfo/orddeptcd" , model.getValue("/root/main/reclist/recinfolists/orddeptcd")); // 진료부서코드
  392. model.makeValue("/root/send/savedata/signinfo/orddrid" , model.getValue("/root/main/reclist/recinfolists/orddrid") ); // 진료의사ID
  393. model.makeValue("/root/send/savedata/signinfo/signbfcnts" , Sign.signedInfos[1]); // 인증할 데이터 정보(미기록 노드 제거된 정보)
  394. model.makeValue("/root/send/savedata/signinfo/signaftcnts" , Sign.signedInfos[2]); // 공인인증 처리후 데이터
  395. }else{
  396. messageBox("인증저장이 완료되지", "I001", "");
  397. return;
  398. // return false;
  399. }
  400. }
  401. submit("TXMND01301");
  402. fSrchCoduitrecList(hdmatnpatRow); // 환자별 도관기록 리스트 조회
  403. //fSrchHDPipeInfo("X"); // 혈액투석 도관기록 조회
  404. fSrchHDPipeInfo(); // 혈액투석 도관기록 조회
  405. }
  406. /* ------------------------------------------------- */
  407. /* desc : 인증데이터 만들기 */
  408. /* param : pModel - Model */
  409. /* tNode - Target Node */
  410. /* sNode - Source Node */
  411. /* return : */
  412. /* -------------------------------------------------- */
  413. function fMake_SignData(){
  414. Sign.addnode("/root/main/reclist/recinfo"); //기록 관련 인스턴스 전체를 copy
  415. // 인스턴스 copy 후에 콤보나 체크박스 같은 경우 코드값은 명칭으로 변경
  416. var xRecinfoPath = Sign.XPATH_SIGNINFO+"/recinfo";
  417. //** 혈액투석 도관관리 **//
  418. var xHmdlsPipePath = xRecinfoPath + "/hmdlspipeinfolist/hmdlspipeinfo";
  419. for(var i=1;i<grd_hmdlspipeinfo.rows;i++){
  420. // 부위
  421. var sPartFlag = model.getValue(xHmdlsPipePath +"["+i+"]/partflag");
  422. if(sPartFlag != ""){
  423. model.makeValue(xHmdlsPipePath+"["+i+"]/partflag", model.getValue("/root/init/M0133list/M0133[cdid='"+sPartFlag+"']/cdnm"));
  424. }
  425. // 종류1
  426. var sKindFlag1 = model.getValue(xHmdlsPipePath +"["+i+"]/kindflag1");
  427. if(sKindFlag1 != ""){
  428. model.makeValue(xHmdlsPipePath+"["+i+"]/kindflag1", model.getValue("/root/init/M0134list/M0134[cdid='"+sKindFlag1+"']/cdnm"));
  429. }
  430. // 종류2
  431. var sKindFlag2 = model.getValue(xHmdlsPipePath +"["+i+"]/kindflag2");
  432. if(sKindFlag2 != ""){
  433. model.makeValue(xHmdlsPipePath+"["+i+"]/kindflag2", model.getValue("/root/init/M0135list/M0135[cdid='"+sKindFlag2+"']/cdnm"));
  434. }
  435. // 발적 20120403 by kya
  436. var sRedness= model.getValue(xHmdlsPipePath +"["+i+"]/redness");
  437. if(sRedness != ""){
  438. model.makeValue(xHmdlsPipePath+"["+i+"]/redness", model.getValue("/root/init/M0628list/M0628[cdid='"+sRedness+"']/cdnm"));
  439. }
  440. // 멍 20120403 by kya
  441. var sBruise= model.getValue(xHmdlsPipePath +"["+i+"]/bruise");
  442. if(sBruise != ""){
  443. model.makeValue(xHmdlsPipePath+"["+i+"]/bruise", model.getValue("/root/init/M0628list/M0628[cdid='"+sBruise+"']/cdnm"));
  444. }
  445. // 고정 20120403 by kya
  446. var sFixsuture= model.getValue(xHmdlsPipePath +"["+i+"]/fixsuture");
  447. if(sFixsuture != ""){
  448. model.makeValue(xHmdlsPipePath+"["+i+"]/fixsuture", model.getValue("/root/init/M0629list/M0629[cdid='"+sFixsuture+"']/cdnm"));
  449. }
  450. // 혈종 20120403 by kya
  451. var sHematoma= model.getValue(xHmdlsPipePath +"["+i+"]/hematoma");
  452. if(sHematoma != ""){
  453. model.makeValue(xHmdlsPipePath+"["+i+"]/hematoma", model.getValue("/root/init/M0135list/M0628[cdid='"+sHematoma+"']/cdnm"));
  454. }
  455. // A Locking Heparin 20120403 by kya
  456. var sALH= model.getValue(xHmdlsPipePath +"["+i+"]/alh");
  457. if(sALH != ""){
  458. model.makeValue(xHmdlsPipePath+"["+i+"]/alh", model.getValue("/root/init/M0630list/M0630[cdid='"+sALH+"']/cdnm"));
  459. }
  460. // V Locking Heparin 20120403 by kya
  461. var sVLH= model.getValue(xHmdlsPipePath +"["+i+"]/vlh");
  462. if(sVLH != ""){
  463. model.makeValue(xHmdlsPipePath+"["+i+"]/vlh", model.getValue("/root/init/M0630list/M0630[cdid='"+sVLH+"']/cdnm"));
  464. }
  465. // 상태
  466. var sStatusflag = model.getValue(xHmdlsPipePath +"["+i+"]/statusflag");
  467. if(sStatusflag == "1"){
  468. model.makeValue(xHmdlsPipePath+"["+i+"]/statusflag", "삽입");
  469. }else if(sStatusflag == "2"){
  470. model.makeValue(xHmdlsPipePath+"["+i+"]/statusflag", "제거");
  471. }else if(sStatusflag == "3"){
  472. model.makeValue(xHmdlsPipePath+"["+i+"]/statusflag", "유지");
  473. }
  474. // 제거이유
  475. var sElmnResnFlag = model.getValue(xHmdlsPipePath +"["+i+"]/elmnresnflag");
  476. if(sElmnResnFlag != ""){
  477. model.makeValue(xHmdlsPipePath+"["+i+"]/elmnresnflag", model.getValue("/root/init/M0136list/M0136[cdid='"+sElmnResnFlag+"']/cdnm"));
  478. }
  479. }
  480. //** 동정맥루 관리 **//
  481. var xAvfInfoPath = xRecinfoPath + "/avfinfolist/avfinfo";
  482. for(var i=1;i<grd_avfinfo.rows;i++){
  483. // 부위
  484. var sPartFlag = model.getValue(xAvfInfoPath +"["+i+"]/partflag");
  485. if(sPartFlag != ""){
  486. model.makeValue(xAvfInfoPath+"["+i+"]/partflag", model.getValue("/root/init/M0138list/M0138[cdid='"+sPartFlag+"']/cdnm"));
  487. }
  488. // 방향-20091016-kys
  489. var sPartDirection = model.getValue(xAvfInfoPath +"["+i+"]/partdirection");
  490. if(sPartDirection != ""){
  491. model.makeValue(xAvfInfoPath+"["+i+"]/partdirection", model.getValue("/root/init/M0999list/M0133[cdid='"+sPartDirection+"']/cdnm"));
  492. }
  493. // 종류
  494. var sKindFlag = model.getValue(xAvfInfoPath +"["+i+"]/kindflag");
  495. if(sKindFlag != ""){
  496. model.makeValue(xAvfInfoPath+"["+i+"]/kindflag", model.getValue("/root/init/M0137list/M0137[cdid='"+sKindFlag+"']/cdnm"));
  497. }
  498. // 사용혈관
  499. var sUseveslFlag = model.getValue(xAvfInfoPath +"["+i+"]/useveslflag");
  500. if(sUseveslFlag != ""){
  501. model.makeValue(xAvfInfoPath+"["+i+"]/useveslflag", model.getValue("/root/init/M0139list/M0139[cdid='"+sUseveslFlag+"']/cdnm"));
  502. }
  503. // 발적 20150820 by kya
  504. var sRedness= model.getValue(xAvfInfoPath +"["+i+"]/redness");
  505. if(sRedness != ""){
  506. model.makeValue(xAvfInfoPath+"["+i+"]/redness", model.getValue("/root/init/M0628list/M0628[cdid='"+sRedness+"']/cdnm"));
  507. }
  508. // 멍 20150820 by kya
  509. var sBruise= model.getValue(xAvfInfoPath +"["+i+"]/bruise");
  510. if(sBruise != ""){
  511. model.makeValue(xAvfInfoPath+"["+i+"]/bruise", model.getValue("/root/init/M0628list/M0628[cdid='"+sBruise+"']/cdnm"));
  512. }
  513. // 떨림 20150820 by kya
  514. var sThrill= model.getValue(xAvfInfoPath +"["+i+"]/thrill");
  515. if(sThrill != ""){
  516. model.makeValue(xAvfInfoPath+"["+i+"]/thrill", model.getValue("/root/init/M0628list/M0628[cdid='"+sThrill+"']/cdnm"));
  517. }
  518. // 청진소견1 20150820 by kya
  519. var sBruit1= model.getValue(xAvfInfoPath +"["+i+"]/bruit1");
  520. if(sBruit1 != ""){
  521. model.makeValue(xAvfInfoPath+"["+i+"]/bruit1", model.getValue("/root/init/M0758list/M0758[cdid='"+sBruit1+"']/cdnm"));
  522. }
  523. // 청진소견2 20150820 by kya
  524. var sBruit2= model.getValue(xAvfInfoPath +"["+i+"]/bruit2");
  525. if(sBruit2 != ""){
  526. model.makeValue(xAvfInfoPath+"["+i+"]/bruit2", model.getValue("/root/init/M0759list/M0759[cdid='"+sBruit2+"']/cdnm"));
  527. }
  528. }
  529. //** 시술과 중재 **//
  530. var xOprtInfoPath = xRecinfoPath + "/oprtinfolist/oprtinfo";
  531. for(var i=1;i<grd_oprtinfo.rows;i++){
  532. // 시술종류
  533. var sOprtKindFlag = model.getValue(xOprtInfoPath +"["+i+"]/oprtkindflag");
  534. if(sOprtKindFlag != ""){
  535. model.makeValue(xOprtInfoPath+"["+i+"]/oprtkindflag", model.getValue("/root/init/M0140list/M0140[cdid='"+sOprtKindFlag+"']/cdnm"));
  536. }
  537. // 시술원인
  538. var sOprtCasFlag = model.getValue(xOprtInfoPath +"["+i+"]/oprtcasflag");
  539. if(sOprtCasFlag != ""){
  540. model.makeValue(xOprtInfoPath+"["+i+"]/oprtcasflag", model.getValue("/root/init/M0141list/M0141[cdid='"+sOprtCasFlag+"']/cdnm"));
  541. }
  542. }
  543. }
  544. /**
  545. * @group :
  546. * @ver : 2007.06.12
  547. * @by : 김진아
  548. * @---------------------------------------------------
  549. * @type : function
  550. * @access : public
  551. * @desc : 환자별 도관기록 리스트 조회
  552. * (혈액투석 유지환자 리스트 더블 클릭 시)
  553. * @param :
  554. * @return :
  555. * @---------------------------------------------------
  556. */
  557. function fSrchCoduitrecList(iRow){
  558. // 환자별 도관기록 리스트 셀 색상 초기화 (white)
  559. for(var i=1; i<=grd_coduitrecinfo.rows; i++) {
  560. grd_coduitrecinfo.cellstyle("background-color", i, 1, i, 4) = "white";
  561. }
  562. if(iRow==""){
  563. iRow=1;
  564. }
  565. model.removenode ("/root/send");
  566. model.makeNode ("/root/send");
  567. model.makeValue ("/root/send/reqdata/pid", model.getValue("/root/main/hdmatnpatlist/hdmatnpatinfo[" + iRow + "]/pid"));
  568. model.makeValue ("/root/send/reqdata/dialflag", "H"); // 투석구분 ( "H":혈액투석 )
  569. model.removeNodeset("/root/main/coduitreclist");
  570. // 20130603 막음
  571. // model.removeNodeset("/root/main/signinfo");
  572. submit("TRMND01302");
  573. // 인증저장 정보 설정
  574. /*
  575. model.makeValue("/root/main/hdmatnpatlist/hdmatnpatinfo["+iRow+"]/orddd" , model.getValue("/root/main/signinfo/orddd" ));
  576. model.makeValue("/root/main/hdmatnpatlist/hdmatnpatinfo["+iRow+"]/cretno" , model.getValue("/root/main/signinfo/cretno" ));
  577. model.makeValue("/root/main/hdmatnpatlist/hdmatnpatinfo["+iRow+"]/histstat" , model.getValue("/root/main/signinfo/histstat" ));
  578. model.makeValue("/root/main/hdmatnpatlist/hdmatnpatinfo["+iRow+"]/orddeptcd", model.getValue("/root/main/signinfo/orddeptcd"));
  579. model.makeValue("/root/main/hdmatnpatlist/hdmatnpatinfo["+iRow+"]/orddrid" , model.getValue("/root/main/signinfo/orddrid" ));
  580. grd_hdmatnpatinfo.refresh();
  581. */
  582. }
  583. /**
  584. * @group :
  585. * @ver : 2007.08.23
  586. * @by : 김진아
  587. * @---------------------------------------------------
  588. * @type : function
  589. * @access : public
  590. * @desc : 혈액투석 도관기록 조회
  591. * (환자별 도관기록 리스트 더블 클릭 시 또는 누적조회 시)
  592. * @param :
  593. * @return :
  594. * @---------------------------------------------------
  595. */
  596. function fSrchHDPipeInfo(srchFlag){
  597. // 신규등록 Flag
  598. model.makeValue("/root/main/chklist/chkinfo/cretfalg", "N");
  599. grp_hdpipeinfo.disabled = false; // 혈액투석도관관리 그룹 활성화
  600. if(srchFlag == "X"){ // 전체 내역 조회
  601. coduitrecinfoRow = -1;
  602. // grp_hdpipeinfo.disabled = true; // 혈액투석도관관리 그룹 비활성화
  603. // 버튼 비활성화
  604. btn_tempsavehdpipeinfo.disabled = true;
  605. btn_certsavehdpipeinfo.disabled = true;
  606. btn_addhmdlspipeinfo.disabled = true;
  607. btn_delhmdlspipeinfo.disabled = true;
  608. btn_addavfinfo.disabled = true;
  609. btn_delavfinfo.disabled = true;
  610. btn_addoprtinfo.disabled = true;
  611. btn_deloprtinfo.disabled = true;
  612. } else {
  613. coduitrecinfoRow = grd_coduitrecinfo.row;
  614. }
  615. //start
  616. // 인증저장 된 기록인지 체크
  617. if(model.getValue("/root/main/coduitreclist/coduitrecinfo[" + coduitrecinfoRow + "]/signno")!= ""){
  618. btn_tempsavehdpipeinfo.disabled = true;
  619. }
  620. var sRecDD = model.getValue("/root/main/coduitreclist/coduitrecinfo[" + coduitrecinfoRow + "]/recdd"); // 기록일자
  621. var sRecTM = model.getValue("/root/main/coduitreclist/coduitrecinfo[" + coduitrecinfoRow + "]/rectm"); // 기록시간
  622. var sRecNM = model.getValue("/root/main/coduitreclist/coduitrecinfo[" + coduitrecinfoRow + "]/recnm"); // 기록자명
  623. var sMaintepatrgstdd = model.getValue("/root/main/coduitreclist/coduitrecinfo[" + coduitrecinfoRow + "]/maintepatrgstdd");
  624. //end
  625. // 혈액투석 도관기록 리스트 셀 색상 초기화 (white)
  626. for(var i=grd_coduitrecinfo.fixedRows; i<=grd_coduitrecinfo.rows; i++) {
  627. grd_coduitrecinfo.cellstyle("background-color", i, 1, i, 3) = "white";
  628. }
  629. // i u d 아이콘 초기화
  630. for(i=grd_hmdlspipeinfo.fixedRows ; i < grd_hmdlspipeinfo.rows ; i++){
  631. grd_hmdlspipeinfo.cellStyle("background-image", + i , grd_hmdlspipeinfo.colRef("stu")) = "../../../com/commonweb/images/icon_n.gif";
  632. }
  633. for(i=grd_avfinfo.fixedRows ; i < grd_avfinfo.rows ; i++){
  634. grd_avfinfo.cellStyle("background-image", + i , grd_avfinfo.colRef("stu")) = "../../../com/commonweb/images/icon_n.gif"; //방향추가로 10->11로변경-20091016-kys
  635. }
  636. for(i=grd_oprtinfo.fixedRows ; i < grd_oprtinfo.rows ; i++){
  637. grd_oprtinfo.cellStyle("background-image", + i , grd_oprtinfo.colRef("stu")) = "../../../com/commonweb/images/icon_n.gif"; //비고추가로 6->7로변경-20091021-kys
  638. }
  639. //20120329 by kya
  640. for(i=grd_bvipinfo.fixedRows ; i < grd_bvipinfo.rows ; i++){
  641. grd_bvipinfo.cellStyle("background-image", + i , grd_bvipinfo.colRef("stu")) = "../../../com/commonweb/images/icon_n.gif"; //방향추가로 10->11로변경-20091016-kys
  642. }
  643. // 선택 행 셀 색상 지정
  644. grd_coduitrecinfo.cellstyle("background-color", coduitrecinfoRow, 1, coduitrecinfoRow, 3) = "#ffd9ff";
  645. model.removenode("/root/send");
  646. model.makeNode ("/root/send");
  647. // model.makeValue ("/root/send/reqdata/pid" , model.getValue("/root/main/hdmatnpatlist/hdmatnpatinfo["+grd_hdmatnpatinfo.row+"]/pid"));
  648. // model.makeValue ("/root/send/reqdata/maintepatrgstdd" , model.getValue("/root/main/hdmatnpatlist/hdmatnpatinfo["+grd_hdmatnpatinfo.row+"]/maintepatrgstdd"));
  649. model.makeValue("/root/send/reqdata/pid" , model.getValue("/root/main/reclist/recinfolists/pid"));
  650. model.makeValue("/root/send/reqdata/maintepatrgstdd", model.getValue("/root/main/reclist/recinfolists/maintepatrgstdd"));
  651. /*
  652. model.makeValue ("/root/send/reqdata/recdd", sRecDD);
  653. model.makeValue ("/root/send/reqdata/rectm", sRecTM);
  654. model.makeValue ("/root/send/reqdata/maintepatrgstdd", sMaintepatrgstdd);
  655. */
  656. model.removeNodeset("/root/main/reclist/recinfo/hmdlspipeinfolist");
  657. model.removeNodeset("/root/main/reclist/recinfo/avfinfolist" );
  658. model.removeNodeset("/root/main/reclist/recinfo/oprtinfolist" );
  659. //20120329 by kya
  660. model.removeNodeset("/root/main/reclist/recinfo/bvipinfolist" );
  661. submit("TRMND01303");
  662. for(i=grd_hmdlspipeinfo.fixedRows ; i < grd_hmdlspipeinfo.rows ; i++){
  663. grd_hmdlspipeinfo.isReadOnly(i, grd_hmdlspipeinfo.colRef("partflag")) = true;
  664. grd_hmdlspipeinfo.isReadOnly(i, grd_hmdlspipeinfo.colRef("kindflag2")) = true;
  665. grd_hmdlspipeinfo.isReadOnly(i, grd_hmdlspipeinfo.colRef("kindflag3")) = true;
  666. grd_hmdlspipeinfo.isReadOnly(i, grd_hmdlspipeinfo.colRef("redness")) = true;
  667. if(grd_hmdlspipeinfo.valueMatrix(i,grd_hmdlspipeinfo.colRef("statusflag")) == "2"){ // 상태 제거시 제거이유 활성화
  668. grd_hmdlspipeinfo.isReadOnly(i, grd_hmdlspipeinfo.colRef("elmnresnflag")) = false;
  669. }else{
  670. grd_hmdlspipeinfo.isReadOnly(i, grd_hmdlspipeinfo.colRef("elmnresnflag")) = true;
  671. }
  672. }
  673. /*
  674. // 기록정보 설정
  675. if(grd_coduitrecinfo.rows > 1) {
  676. model.makeValue("/root/main/reclist/recinfolists/recdd" , model.getValue("/root/main/coduitreclist/coduitrecinfo[" + coduitrecinfoRow + "]/recdd"));
  677. model.makeValue("/root/main/reclist/recinfolists/rectm" , model.getValue("/root/main/coduitreclist/coduitrecinfo[" + coduitrecinfoRow + "]/rectm"));
  678. model.makeValue("/root/main/reclist/recinfolists/maintepatrgstdd", model.getValue("/root/main/coduitreclist/coduitrecinfo[" + coduitrecinfoRow + "]/maintepatrgstdd"));
  679. model.makeValue("/root/main/reclist/recinfolists/signno" , model.getValue("/root/main/coduitreclist/coduitrecinfo[" + coduitrecinfoRow + "]/signno"));
  680. model.refresh();
  681. }
  682. */
  683. }
  684. /**
  685. * @group :
  686. * @ver : 2007.06.22
  687. * @by : 김진아
  688. * @---------------------------------------------------
  689. * @type : function
  690. * @access : public
  691. * @desc : 신규등록버튼 클릭 시
  692. * @param :
  693. * @return :
  694. * @---------------------------------------------------
  695. */
  696. function fSetNewRecInfo(){
  697. if(model.getValue("/root/main/reclist/recinfolists/pid") == "") {
  698. messageBox("혈액투석 유지환자를 선택한 후", "I", "신규등록을 할 수 있습니다.");
  699. return;
  700. }
  701. grp_hdpipeinfo.disabled = false; // 혈액투석 도관관리 그룹 활성화
  702. // 기록일시 설정
  703. model.makeValue("/root/main/reclist/recinfolists/recdd", getCurrentDate()); // 기록일자
  704. model.makeValue("/root/main/reclist/recinfolists/rectm", getCurrentTime().substr(0,4)); // 기록시간
  705. model.refresh();
  706. // 환자별 도관기록 리스트 행 추가
  707. grd_coduitrecinfo.addItem(); // 행 추가
  708. grd_coduitrecinfo.textmatrix((grd_coduitrecinfo.rows-1), 1) = model.getValue("/root/main/reclist/recinfolists/recdd");
  709. grd_coduitrecinfo.textmatrix((grd_coduitrecinfo.rows-1), 2) = model.getValue("/root/main/reclist/recinfolists/rectm");
  710. grd_coduitrecinfo.textmatrix((grd_coduitrecinfo.rows-1), 3) = model.getValue("/root/main/reclist/recinfolists/recnm");
  711. grd_coduitrecinfo.textmatrix((grd_coduitrecinfo.rows-1), 4) = model.getValue("/root/main/reclist/recinfolists/pid");
  712. grd_coduitrecinfo.textmatrix((grd_coduitrecinfo.rows-1), 5) = model.getValue("/root/main/reclist/recinfolists/maintepatrgstdd");
  713. // 초기화
  714. for(var i=1; i<=grd_coduitrecinfo.rows; i++) {
  715. grd_coduitrecinfo.cellstyle("background-color", i, 1, i, 3) = "white"; // 환자별 도관기록 리스트 셀 색상 초기화 (white)
  716. }
  717. model.removeNodeset("/root/main/reclist/recinfo/hmdlspipeinfolist/hmdlspipeinfo"); // 혈액투석 도관관리
  718. model.removeNodeset("/root/main/reclist/recinfo/avfinfolist/avfinfo"); // 동정맥루 관리
  719. model.removeNodeset("/root/main/reclist/recinfo/oprtinfolist/oprtinfo"); // 시술과 중재
  720. // 신규등록 flag
  721. model.makeValue("/root/main/chklist/chkinfo/cretfalg", "Y");
  722. model.refresh();
  723. }
  724. /**
  725. * @group :
  726. * @ver : 2007.07.18
  727. * @by : 김진아
  728. * @---------------------------------------------------
  729. * @type : function
  730. * @access : public
  731. * @desc : 투석도관기록 마스터정보 삭제
  732. * @param :
  733. * @return :
  734. * @---------------------------------------------------
  735. */
  736. function fDelPipeMasterInfo(){
  737. //** 데이터 모두 삭제 되어 해당일시에 기록정보 없을 경우 **//
  738. if( getNodesetCount("/root/main/reclist/recinfo/hmdlspipeinfolist/hmdlspipeinfo") == 0
  739. && getNodesetCount("/root/main/reclist/recinfo/avfinfolist/avfinfo") == 0
  740. && getNodesetCount("/root/main/reclist/recinfo/oprtinfolist/oprtinfo") == 0) {
  741. messageBox("해당일시에 데이터가 존재하지 않습니다", "I", "마스터 정보를 삭제합니다.");
  742. model.makeValue("/root/send/savedata/pid" , model.getValue("/root/main/reclist/recinfolists/pid"));
  743. model.makeValue("/root/send/savedata/recdd" , model.getValue("/root/main/reclist/recinfolists/recdd"));
  744. model.makeValue("/root/send/savedata/rectm" , model.getValue("/root/main/reclist/recinfolists/rectm"));
  745. model.makeValue("/root/send/savedata/maintepatrgstdd", model.getValue("/root/main/reclist/recinfolists/maintepatrgstdd"));
  746. model.makeValue("/root/send/savedata/dialflag" , "H");
  747. submit("TXMND01302");
  748. fSrchCoduitrecList(); // 환자별 도관기록 리스트 조회
  749. }
  750. }
  751. /**
  752. * @group :
  753. * @ver : 2008.05.16
  754. * @by : 김진아
  755. * @---------------------------------------------------
  756. * @type : function
  757. * @access : public
  758. * @desc : 혈액투석 유지환자리스트에서 환자 선택 시
  759. 도관기록 리스트 및 누적조회, 환자정보를 설정.
  760. * @param :
  761. * @return :
  762. * @---------------------------------------------------
  763. */
  764. function fSetHDPipeInfo(iRow){
  765. // hdmatnpatRow = grd_hdmatnpatinfo.row;
  766. var sSelPid = model.getValue("/root/main/hdmatnpatlist/hdmatnpatinfo["+iRow+"]/pid"); // 선택환자 등록번호
  767. var sMaintePatRgstDD = model.getValue("/root/main/hdmatnpatlist/hdmatnpatinfo["+iRow+"]/maintepatrgstdd"); // 선택환자 유지환자등록일자
  768. var sOrddd = model.getValue("/root/main/hdmatnpatlist/hdmatnpatinfo[" +iRow+ "]/orddd");
  769. var sCretno = model.getValue("/root/main/hdmatnpatlist/hdmatnpatinfo[" +iRow+ "]/cretno");
  770. var sHiststat = model.getValue("/root/main/hdmatnpatlist/hdmatnpatinfo[" +iRow+ "]/histstat");
  771. var sOrddeptcd = model.getValue("/root/main/hdmatnpatlist/hdmatnpatinfo[" +iRow+ "]/orddeptcd");
  772. var sOrddrid = model.getValue("/root/main/hdmatnpatlist/hdmatnpatinfo[" +iRow+ "]/orddrid");
  773. model.makeValue("/root/main/reclist/recinfolists/pid",sSelPid);
  774. model.makeValue("/root/main/reclist/recinfolists/maintepatrgstdd",sMaintePatRgstDD);
  775. model.makeValue("/root/main/reclist/recinfolists/orddd",sOrddd);
  776. model.makeValue("/root/main/reclist/recinfolists/cretno",sCretno);
  777. model.makeValue("/root/main/reclist/recinfolists/histstat",sHiststat);
  778. model.makeValue("/root/main/reclist/recinfolists/orddeptcd",sOrddeptcd);
  779. model.makeValue("/root/main/reclist/recinfolists/orddrid",sOrddrid);
  780. // btn_srchccmlinfo.disabled = false; // 누적조회버튼 활성화
  781. // 유지환자 리스트 셀 색상 초기화 (white)
  782. for(var i=grd_hdmatnpatinfo.fixedRows; i<=grd_hdmatnpatinfo.rows; i++) {
  783. grd_hdmatnpatinfo.cellstyle("background-color", i, 1, i, 4) = "white";
  784. }
  785. // 선택 행 셀 색상 지정
  786. grd_hdmatnpatinfo.cellstyle("background-color", iRow, 1, iRow, 4) = "#ffd9ff";
  787. //**** fGetPatInfo(sSelPid, sMaintePatRgstDD); // 혈액투석 유지환자 정보 설정
  788. fSrchCoduitrecList(iRow); // 당일 혈관 접근로 리스트 조회
  789. //////fSrchHDPipeInfo("X"); // 혈액투석 도관기록 조회
  790. fSrchHDPipeInfo(); // 혈액투석 도관기록 조회
  791. /*
  792. // 환자별 도관기록 등록번호, 유지환자 등록일자 설정
  793. if(getNodesetCount("/root/main/coduitreclist/coduitrecinfo")>0) {
  794. model.makeValue("/root/main/coduitreclist/coduitrecinfo[1]/pid" , sSelPid);
  795. model.makeValue("/root/main/coduitreclist/coduitrecinfo[1]/maintepatrgstdd", sMaintePatRgstDD);
  796. }
  797. model.makeValue("/root/main/reclist/recinfolists/maintepatrgstdd", sMaintePatRgstDD); // 유지환자등록일자설정
  798. */
  799. /*20130306 kya 환자별 도관기록 기록번호 가장 최근값으로 설정*/
  800. /*20130531 kya 수정 : 일자별 등록을 위해 */
  801. var sSignn = "";
  802. if(getNodesetCount("/root/main/coduitreclist/coduitrecinfo")>0) {
  803. sSignno = model.getValue("/root/main/coduitreclist/coduitrecinfo[1]/signno")
  804. model.makeValue("/root/main/reclist/recinfolists/signno",sSignno);
  805. }
  806. //기록자 정보 설정
  807. model.makeValue("/root/main/reclist/recinfolists/recid", getUserId()); // 현재 로그인한 사용자 ID
  808. model.makeValue("/root/main/reclist/recinfolists/recnm", getUserName()); // 현재 로그인한 사용자명
  809. // 기록일시 설정
  810. //20131011 kya 기록일자를 수진일자로 일치시킴
  811. //수정전
  812. //model.makeValue("/root/main/reclist/recinfolists/recdd", getCurrentDate()); // 기록일자
  813. //수정후
  814. model.makeValue("/root/main/reclist/recinfolists/recdd", sOrddd);
  815. model.makeValue("/root/main/reclist/recinfolists/rectm", getCurrentTime().substr(0,4)); // 기록시간
  816. model.refresh();
  817. }
  818. /* ------------------------------------------------- */
  819. /* desc : Instance NodeCopy 하기 (SMMNP007.js 참조) */
  820. /* param : pModel - Model */
  821. /* tNode - Target Node */
  822. /* sNode - Source Node */
  823. /* return : */
  824. /* -------------------------------------------------- */
  825. function InstanceNodeCopy(pModel, tNode, sNode) {
  826. pModel.copyNode(tNode, sNode );
  827. }
  828. /* ------------------------------------------------- */
  829. /* desc : Instance NodeCopy 하기(SMMNP007.js 참조) */
  830. /* param : pModel - Model */
  831. /* tNode - Target Node */
  832. /* sNode - Source Node */
  833. /* return : */
  834. /* -------------------------------------------------- */
  835. function XmlDataCheck(XmlInstNm) {
  836. XmlInstNm = XmlInstNm.split(" ");
  837. var tNode = "";
  838. var sNode = "";
  839. for (var i=0; i < XmlInstNm.length; i++){
  840. tNode = "/root/main/reclist/recinfo/" + XmlInstNm[i];
  841. if (instance1.selectSingleNode(tNode).childNodes.length < 1) {
  842. sNode = "/root/main/xmlformatlist/" + XmlInstNm[i];
  843. InstanceNodeCopy(model, tNode, sNode);
  844. }
  845. }
  846. }
  847. /* ------------------------------------------------- */
  848. /* desc : 해당 경로의 >,< 문자 를 &lt;,&gt;로 변환 */
  849. /* param : path - 대상경로 */
  850. /* return : */
  851. /* -------------------------------------------------- */
  852. function doReplaceLtGt(path)
  853. {
  854. var nodelist = model.instances(0).selectNodes(path + "/shapeimgedata");
  855. var shape = "";
  856. for (var i=0; i<nodelist.length; i++){
  857. shape = nodelist.item(i).text.replace(/</gi, "&lt;");
  858. nodelist.item(i).text = shape.replace(/>/gi, "&gt;");
  859. }
  860. }
  861. /**
  862. * creat : 20090108
  863. * author : dhkim
  864. * desc : 내환자세팅된 간호사 load
  865. */
  866. function fLoadMyPatSetting(){
  867. model.removenode('/root/send');
  868. model.makeValue('/root/send/wardcd', getUserInfo('dutplcecd'));
  869. //submit 호출
  870. if(!submit('TRMND03402')){
  871. messageBox('조회를 실패하였습니다.', 'E999');
  872. return;
  873. }
  874. }
  875. /**
  876. * @desc : 콤보박스에 원하는 instance node와 value를 설정
  877. * @
  878. * @param :20091022에 추가-kys
  879. * @event :
  880. * @return :
  881. * @---------------------------------------------------
  882. */
  883. function addComboInstance(combopath, nodename, nodeval, parentnode, appdelyn){
  884. nodename = nodename.split("^");
  885. nodeval = nodeval.split("^");
  886. if(nodename.length != nodeval.length){
  887. return;
  888. }
  889. var label = model.instances(0).createElement(nodename[0]);
  890. var val = model.instances(0).createElement(nodename[1]);
  891. var combo = model.instances(0).createElement(parentnode);
  892. label.value = "" + nodeval[0] + "";
  893. val.value = "" + nodeval[1] + "";
  894. combo.appendChild(label);
  895. combo.appendChild(val);
  896. chkNode = model.instances(0).selectSingleNode(combopath);
  897. if(chkNode == null){
  898. model.makeNode(combopath);
  899. srcNode = model.instances(0).selectSingleNode(combopath);
  900. }else{
  901. srcNode = model.instances(0).selectSingleNode(combopath);
  902. }
  903. desNode = model.instances(0).selectSingleNode(combopath + "/" + parentnode);
  904. //srcNode.insertBefore(combo, desNode); 젤상단에 붙히기
  905. //srcNode.insertAfter(combo, desNode); //2번째 붙히기
  906. if(appdelyn == "I"){
  907. srcNode.appendChild(combo); //마지막에 붙히기
  908. }else if(appdelyn == "D"){
  909. srcNode.removeChild(desNode); //삭제
  910. }
  911. model.refresh();
  912. }
  913. /**
  914. * @group :
  915. * @ver : 2007.06.01
  916. * @by : 김진아
  917. * @---------------------------------------------------
  918. * @type : function
  919. * @access : public
  920. * @desc : 특이사항 리스트 수정시 상태값 설정
  921. * @param :
  922. * @return :
  923. * @---------------------------------------------------
  924. */
  925. function fSetSpcfFactList(vGrdObj){
  926. var iRow = vGrdObj.row;
  927. if(vGrdObj.textmatrix(iRow, vGrdObj.colRef("stu")) == "s") { // 선택 행이 조회된 행(DB에 존재) 일때 (상태값 :s)
  928. vGrdObj.textmatrix(iRow, vGrdObj.colRef("stu")) = "u"; // 상태값 지정 (update)
  929. }
  930. }
  931. /**
  932. * @group :
  933. * @ver : 2007.05.31
  934. * @vGrdObj : 그리드명
  935. * @by : 김진아
  936. * @---------------------------------------------------
  937. * @type : function
  938. * @access : public
  939. * @desc : 특이사항 리스트 행추가 화면 설정
  940. * @param :
  941. * @return :
  942. * @---------------------------------------------------
  943. */
  944. function fAddRowSpcfFact(vGrdObj){
  945. if (vGrdObj == null) return;
  946. if (vGrdObj.rows == 1){
  947. vGrdObj.addItem();
  948. }else{
  949. vGrdObj.insertItem(1);
  950. }
  951. var sCurrentDate = getCurrentDate();
  952. var iRow = 1;
  953. var xPath = "/root/main/reclist/recinfo/bvipinfolist/bvipinfo";
  954. var itemflag = "09"; //혈관내압측정비
  955. var sSelPid = model.getValue("/root/main/reclist/recinfolists/pid"); // 등록번호
  956. var sRecId = model.getValue("/root/main/reclist/recinfolists/recid"); // 기록자 아이디
  957. var sBvipvalue = model.getValue("/root/main/condition/bvipvalue"); // Access Flow(ml/min) OR SIAPR
  958. vGrdObj.cellStyle("background-image", + vGrdObj.row, vGrdObj.colRef("stu")) = "../../../com/commonweb/images/icon_i.gif"; //insert 상태값이미지-방향추가로 10->11로 변경-20091016-kys
  959. model.makeValue( xPath +"[" + iRow + "]/pid" , sSelPid);
  960. model.makeValue( xPath +"[" + iRow + "]/recid", sRecId );
  961. if(iRow == 1){
  962. model.makeValue(xPath + "[" + iRow + "]/seqno", 1);
  963. } else{
  964. model.makeValue(xPath +"[" + iRow + "]/seqno", Number(model.getValue( xPath +"[" + (iRow-1) + "]/seqno"))+1);
  965. }
  966. // alert(" iRow = " + iRow);
  967. model.makeValue(xPath +"[" + iRow + "]/recdd" , getCurrentDate() ); // 기록일자 지정(현재일자)
  968. model.makeValue(xPath +"[" + iRow + "]/rectm" , getCurrentTime().substr(0,4)); // 기록시간 지정(현재시간)
  969. model.makeValue(xPath +"[" + iRow + "]/status", "i" ); // 상태값 지정 (i)
  970. model.makeValue(xPath +"[" + iRow + "]/itemflag", itemflag ); // 상태값 지정 (i)
  971. model.makeValue(xPath +"[" + iRow + "]/spcffact", sBvipvalue ); // 특이사항 (i)
  972. }
  973. /**
  974. * @desc : 그리드 콤보박스 input으로변환
  975. * @
  976. * @param :20091022에 추가-kys
  977. * @event :
  978. * @return :
  979. * @---------------------------------------------------
  980. */
  981. function fCellchgnged()
  982. {
  983. if(grd_avfinfo.row >= grd_avfinfo.fixedRows){
  984. var combopath = "";
  985. if(grd_avfinfo.col == 2){ //종류
  986. combopath = "/root/init/M0137list/M0137";
  987. }else if(grd_avfinfo.col == 1){ //부위(팔,다리)
  988. combopath = "/root/init/M0138list/M0138";
  989. }else if(grd_avfinfo.col == 3){ //동정맥루 사용혈관
  990. combopath = "/root/init/M0139list/M0139";
  991. }else if(grd_avfinfo.col == 0){ //부위방향(왼쪽,오른쪽,기타)
  992. combopath = "/root/init/M0999list/M0133";
  993. }
  994. var idx = grd_avfinfo.valueMatrix(grd_avfinfo.row,0);
  995. if ( idx == "03" && grd_avfinfo.col == 1){ //부위방향(왼쪽,오른쪽)이 기타이고 부위(팔,다리)컬럼이면
  996. grd_avfinfo.combo.button.visible = false;
  997. grd_avfinfo.combo.input.attribute("width") = grd_avfinfo.colWidth(grd_avfinfo.col);
  998. }else{
  999. grd_avfinfo.combo.button.visible = true;
  1000. grd_avfinfo.combo.input.attribute("width") = grd_avfinfo.colWidth(grd_avfinfo.col) - 20;
  1001. grd_avfinfo.cellComboNodeset(grd_avfinfo.row, grd_avfinfo.col) = combopath;
  1002. }
  1003. }
  1004. }