SMMNR076.js 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910
  1. /*
  2. (SMMNR07600_혈액미불출리스트조회.xrw - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var xTopAttributePath = "/root/main/topattribute";
  7. var xRecgrupListPath = "/root/main/recgrup/recgruplist";
  8. var xHIsgrupListPath = "/root/main/histgrup/histgruplist";
  9. var xRecHIstPntListPath = "/root/main/rechistpntgrup/rechistpntlist";
  10. var xClsListPath = "/root/main/detlgrup/detlgruplist"
  11. var xHIsgrupListBKPath = "/root/temp/histgrup/histgruplist";
  12. var xlrgListPath = "/root/main/lrggrup/lrggruplist"
  13. var xCondPath = "/root/main/cond";
  14. var xClsListBKPath = "/root/temp/main/detlgrup/detlgruplist";
  15. var xPopWndClsListBKPath = "/root/temp/main/cond/execpopwnddetlgrup/execpopwnddetlgruplist";
  16. var xExecDetlListPath = "/root/main/cond/execdetlgrup/execdetlgruplist";
  17. var xPopWndExecDetlListPath = "/root/main/cond/execpopwnddetlgrup/execpopwnddetlgruplist";
  18. var xDelDeliveExecPrcpListPath = "/root/main/cond/delivedetlgrup/delivedetlgruplist";
  19. var xBlodReturnReqGrupListPath = "/root/main/cond/blodreturnreqgrup/blodreturnreqgruplist";
  20. /**
  21. * @group :
  22. * @ver : 2007.06.18
  23. * @by : 정찬성
  24. * @---------------------------------------------------
  25. * @type : function
  26. * @access : public
  27. * @desc : 혈액미불출 리스트 조회
  28. * @param :
  29. * @return :
  30. * @---------------------------------------------------
  31. */
  32. function fGetBlodNoDeliveList(){
  33. if(radio1.value == "patient") {
  34. if (input3.value == ""){
  35. messageBox("등록번호를 ","C001");
  36. model.setfocus("input3");
  37. return;
  38. }
  39. }
  40. model.removenode("/root/send");
  41. model.makeValue("/root/send/prcpddfrom", input2.value);
  42. model.makeValue("/root/send/prcpddto", input11.value);
  43. model.makeValue("/root/send/wardcd", combo7.value);
  44. model.makeValue("/root/send/roomcd", combo2.value);
  45. model.makeValue("/root/send/hngnm", combo8.value);
  46. model.makeValue("/root/send/pid", input3.value);
  47. model.makeValue("/root/send/dateflag", combo1.value);
  48. model.makeValue("/root/send/wardpatientflag", radio1.value);
  49. model.makeValue("/root/send/deliveflag", radio2.value);
  50. if(submit("TRMNR07606")){
  51. }
  52. }
  53. /**
  54. * @group :
  55. * @ver : 2007.07.20
  56. * @by : 정찬성
  57. * @---------------------------------------------------
  58. * @type : function
  59. * @access : public
  60. * @desc : 혈액반납의뢰 저장
  61. * @param :
  62. * @return :
  63. * @---------------------------------------------------
  64. */
  65. function fBlodReturnSave(){
  66. var sRowCnt = datagrid1.rows-datagrid1.fixedrows;
  67. model.removenode("/root/send");
  68. model.makeValue("/root/send/detlgrup",datagrid1.getupdatedataAll("i"));
  69. var saveyn = 0 ;
  70. for(var i=1; i<= sRowCnt; i++){
  71. // ****************************** 반납사유 필수 로직 추가 ***************************************
  72. //alert(model.getValue(xBlodReturnReqGrupListPath+"["+i+"]/etcprcpresncd"));
  73. if(model.getValue(xBlodReturnReqGrupListPath+"["+i+"]/reqflag") == "-" || model.getValue(xBlodReturnReqGrupListPath+"["+i+"]/reqflag") == ""){//반납/폐기를 체크
  74. messageBox("반납/폐기를 ","C002");
  75. return;
  76. }
  77. if(model.getValue(xBlodReturnReqGrupListPath+"["+i+"]/returnabandondate") == "-" || model.getValue(xBlodReturnReqGrupListPath+"["+i+"]/returnabandondate") == ""){//반납/폐기일 체크
  78. messageBox("반납/폐기일을 ","C002");
  79. return;
  80. }
  81. if(model.getValue(xBlodReturnReqGrupListPath+"["+i+"]/etcprcpresncd") == "-" || model.getValue(xBlodReturnReqGrupListPath+"["+i+"]/etcprcpresncd") == ""){//반납사유 체크
  82. messageBox("반납/폐기 사유를 ","C002");
  83. return;
  84. }
  85. }
  86. if(submit("TXMNR07630")){
  87. model.copyNode("/root/hidden/main","/root/main");
  88. }
  89. }
  90. /**
  91. * @group :
  92. * @ver : 2007.07.16
  93. * @by : 정찬성
  94. * @---------------------------------------------------
  95. * @type : function
  96. * @access : public
  97. * @desc : 혈액불출 내역 조회 리스트
  98. * @param :
  99. * @return :
  100. * @---------------------------------------------------
  101. */
  102. function fBlodDeliveList(){
  103. var sRowCnt = datagrid5.rows-datagrid5.fixedrows;
  104. if( model.getValue("/root/main/cond/blodno") == "" ){
  105. messageBox("혈액번호를 ","C001");
  106. model.setfocus("input13");
  107. return;
  108. }
  109. for(var i=1; i<= sRowCnt; i++){ // 반납의뢰 혈액번호가 중복되었는지 체크
  110. if( input13.value == model.getValue("/root/main/cond/blodreturnreqgrup["+i+"]/blodreturnreqgruplist["+1+"]/blodno") ) {
  111. messageBox("이미 조회된 등록번호 ","E008");
  112. return;
  113. }
  114. }
  115. model.removenode("/root/send");
  116. model.refresh();
  117. model.makeValue("/root/send/blodno", input13.value );
  118. if(submit("TRMNR07620")){
  119. }
  120. model.setfocus("input13");
  121. }
  122. /**
  123. * @group :
  124. * @ver : 2007.07.09
  125. * @by : 정찬성
  126. * @---------------------------------------------------
  127. * @type : function
  128. * @access : public
  129. * @desc : 혈액불출 내역 선택 삭제
  130. * @param :
  131. * @return :
  132. * @---------------------------------------------------
  133. */
  134. function fDelDeliveExecPrcp(){
  135. var sRowCnt = datagrid7.rows-datagrid7.fixedrows;
  136. model.removenode("/root/send");
  137. model.makeValue("/root/send/detlgrup",datagrid7.getupdatedataAll("i"));
  138. //alert(datagrid7.getupdatedataAll("i"));
  139. var saveyn = 0 ;
  140. // for(var i=1; i<= sRowCnt; i++){
  141. //
  142. // if(model.getValue(xDelDeliveExecPrcpListPath+"["+i+"]/stat") != "-") {
  143. //
  144. // saveyn = 1 ;
  145. //
  146. // }
  147. //
  148. // if(model.getValue(xDelDeliveExecPrcpListPath+"["+i+"]/stat") != "-" && model.getValue(xDelDeliveExecPrcpListPath+"["+i+"]/appno") == ""){
  149. // messageBox("신청수량은 ","I003");
  150. // return;
  151. // }
  152. //
  153. // if( parseInt(model.getValue(xDelDeliveExecPrcpListPath+"["+i+"]/prcpqty")) < parseInt(model.getValue(xDelDeliveExecPrcpListPath+"["+i+"]/appno")) ) {
  154. //
  155. // messageBox("신청수량은 불출수량보다 크게 입력 ","E001");
  156. // return;
  157. // }
  158. //
  159. // }
  160. //
  161. // if(saveyn <= 0 ){
  162. // messageBox("수정사항이 없어 저장 ","E001");
  163. // return;
  164. // }
  165. //alert("result : " + saveyn);
  166. // if(saveyn <= 0 ){
  167. // messageBox("수정사항이 없어 저장 ","E001");
  168. // return;
  169. // }
  170. //alert(model.getValue("/root/main/cond/clsflag"));
  171. //alert(model.getValue("/root/main/cond/recflag"));
  172. //if(messageBox("","Q002") != 6) return;
  173. //alert(model.getValue("/root/main/cond/todd"));
  174. // model.makeValue("/root/send/lrggrupcd", model.getValue(xCondPath+"/lrggrupcd"));
  175. // model.makeValue("/root/send/clsflag", model.getValue("/root/main/cond/clsflag"));
  176. // model.makeValue("/root/send/recflag", model.getValue("/root/main/cond/recflag"))
  177. // model.makeValue("/root/send/todd2", model.getValue("/root/main/cond/todd"))
  178. //alert(model.getValue("/root/send/todd2"));
  179. if(submit("TXMNR07610")){
  180. model.copyNode("/root/hidden/main","/root/main");
  181. }
  182. }
  183. /**
  184. * @group :
  185. * @ver : 2007.06.18
  186. * @by : 정찬성
  187. * @---------------------------------------------------
  188. * @type : function
  189. * @access : public
  190. * @desc : 불출신청 내역 조회 리스트
  191. * @param :
  192. * @return :
  193. * @---------------------------------------------------
  194. */
  195. function fGettDeliveDetlList(){
  196. if( model.getValue("/root/main/cond/wardcdgrup/wardcdgruplist") == "" ){
  197. // messageBox("병동을 ","C002");
  198. // model.setfocus("combo7");
  199. // return;
  200. }
  201. model.removenode("/root/send");
  202. model.makeValue("/root/send/prcpddfrom", input2.value);
  203. model.makeValue("/root/send/prcpddto", input11.value);
  204. model.makeValue("/root/send/wardcd", combo7.value);
  205. model.makeValue("/root/send/roomcd", combo2.value);
  206. model.makeValue("/root/send/hngnm", combo8.value);
  207. model.makeValue("/root/send/pid", input3.value);
  208. if(submit("TRMNR07609")){
  209. }
  210. }
  211. /**
  212. * @group :
  213. * @ver : 2007.04.02
  214. * @by : 정찬성
  215. * @---------------------------------------------------
  216. * @type : function
  217. * @access : public
  218. * @desc : 수행처방 선택시 체크사항
  219. * @param :
  220. * @return :
  221. * @---------------------------------------------------
  222. */
  223. function fSelchange(){
  224. var iRow = datagrid5.row ;
  225. // alert(parseInt(model.getValue(xExecDetlListPath+"["+iRow+"]/prcpqty")));
  226. //
  227. // alert(parseInt(model.getValue(xExecDetlListPath+"["+iRow+"]/appno")));
  228. if( parseInt(model.getValue(xExecDetlListPath+"["+iRow+"]/prcpqty")) <= parseInt(model.getValue(xExecDetlListPath+"["+iRow+"]/appno")) ) {
  229. model.setValue(xExecDetlListPath+"["+iRow+"]/sel", "false" ) ;
  230. messageBox("신청수량이 처방수량보다 클 수 ","I004");
  231. return;
  232. }
  233. if( model.getValue(xExecDetlListPath+"["+iRow+"]/prcpstatcd") == "D/C") {
  234. model.setValue(xExecDetlListPath+"["+iRow+"]/sel", "false" ) ;
  235. messageBox("D/C 상태에서는 신청할 수 ","I004");
  236. return;
  237. } else if( model.getValue(xExecDetlListPath+"["+iRow+"]/prcpstatcd") == "의사") {
  238. model.setValue(xExecDetlListPath+"["+iRow+"]/sel", "false" ) ;
  239. messageBox("의사 상태에서는 신청할 수 ","I004");
  240. return;
  241. } else if( model.getValue(xExecDetlListPath+"["+iRow+"]/prcpstatcd") == "완료") {
  242. model.setValue(xExecDetlListPath+"["+iRow+"]/sel", "false" ) ;
  243. messageBox("완료 상태에서는 신청할 수 ","I004");
  244. return;
  245. }
  246. }
  247. /**
  248. * @group :
  249. * @ver : 2007.04.02
  250. * @by : 정찬성
  251. * @---------------------------------------------------
  252. * @type : function
  253. * @access : public
  254. * @desc : 그리드의 값이 변경되었을때, 상태값을 변경한다.
  255. * @param :
  256. * @return :
  257. * @---------------------------------------------------
  258. */
  259. function fChangedGridCol(){
  260. var sDetlGrupRow = datagrid5.row;
  261. var sDetlGrupBKRow=0;
  262. var num = model.getValue(xPopWndExecDetlListPath+"["+sDetlGrupRow+"]/num");
  263. for(var i=1; i<= getNodesetCount(xPopWndClsListBKPath); i++){
  264. if(model.getValue(xPopWndClsListBKPath+"["+i+"]/num") == num){
  265. sDetlGrupBKRow = i;
  266. break;
  267. }
  268. }
  269. if(event.keyCode == "32") {
  270. messageBox("신청수량에 스페이스를 넣을 수 ","I004");
  271. model.setValue(xPopWndExecDetlListPath+"["+sDetlGrupRow+"]/stat","-");
  272. model.setValue(xPopWndExecDetlListPath+"["+sDetlGrupRow+"]/appno","");
  273. datagrid5.refresh();
  274. return;
  275. }
  276. var irr = datagrid5.textmatrix(sDetlGrupRow,6) ;
  277. if(model.getValue(xPopWndExecDetlListPath+"["+sDetlGrupRow+"]/appno") == "0" || model.getValue(xPopWndExecDetlListPath+"["+sDetlGrupRow+"]/appno") == ""){
  278. model.setValue(xPopWndExecDetlListPath+"["+sDetlGrupRow+"]/stat","-");
  279. datagrid5.rebuild();
  280. //return;
  281. }
  282. // alert(instance1.selectSingleNode(xPopWndExecDetlListPath+"["+sDetlGrupRow+"]").xml);
  283. //
  284. // alert(instance1.selectSingleNode(xPopWndClsListBKPath+"["+sDetlGrupBKRow+"]").xml);
  285. if(instance1.selectSingleNode(xPopWndExecDetlListPath+"["+sDetlGrupRow+"]").xml != instance1.selectSingleNode(xPopWndClsListBKPath+"["+sDetlGrupBKRow+"]").xml){
  286. model.setValue(xPopWndExecDetlListPath+"["+sDetlGrupRow+"]/stat","I");
  287. datagrid5.rebuild();
  288. }
  289. }
  290. /**
  291. * @group :
  292. * @ver : 2007.07.20
  293. * @by : 정찬성
  294. * @---------------------------------------------------
  295. * @type : function
  296. * @access : public
  297. * @desc : 혈액불출관리 init
  298. * @param :
  299. * @return :
  300. * @---------------------------------------------------
  301. */
  302. function fPopWndSave(){
  303. var sRowCnt = datagrid5.rows-datagrid5.fixedrows;
  304. model.removenode("/root/send");
  305. model.makeValue("/root/send/detlgrup",datagrid5.getupdatedataAll("i"));
  306. var saveyn = 0 ;
  307. for(var i=1; i<= sRowCnt; i++){
  308. if(model.getValue(xPopWndExecDetlListPath+"["+i+"]/stat") != "-") {
  309. saveyn = 1 ;
  310. }
  311. if(model.getValue(xPopWndExecDetlListPath+"["+i+"]/stat") != "-" && model.getValue(xPopWndExecDetlListPath+"["+i+"]/appno") == ""){
  312. messageBox("신청수량은 ","I003");
  313. return;
  314. }
  315. // if( !isNumber(model.getValue(xPopWndExecDetlListPath+"["+i+"]/appno")) ) {
  316. //
  317. // messageBox("숫자형을 ","C001");
  318. // return;
  319. //
  320. // }
  321. if( parseInt(model.getValue(xPopWndExecDetlListPath+"["+i+"]/appno")) < 1 || parseInt(model.getValue(xPopWndExecDetlListPath+"["+i+"]/appno")) == " " ) {
  322. messageBox("신청수량은 1건 이하로 입력할 수 ","E001");
  323. return;
  324. }
  325. if( parseInt(model.getValue(xPopWndExecDetlListPath+"["+i+"]/delivepossno")) < parseInt(model.getValue(xPopWndExecDetlListPath+"["+i+"]/appno")) ) {
  326. messageBox("신청수량은 불출수량보다 크게 입력 ","E001");
  327. return;
  328. }
  329. // alert( model.getValue(xPopWndExecDetlListPath+"["+i+"]/prcphopedd") );
  330. // alert( model.getValue(xPopWndExecDetlListPath+"["+i+"]/prcphopetm") );
  331. if(model.getValue(xPopWndExecDetlListPath+"["+i+"]/prcphopedd") == "" || model.getValue(xPopWndExecDetlListPath+"["+i+"]/prcphopetm") == ""){
  332. messageBox("예약일자/예약시간은 ","I003");
  333. return;
  334. }
  335. }
  336. if(saveyn <= 0 ){
  337. messageBox("수정사항이 없어 저장 ","E001");
  338. return;
  339. }
  340. //alert("result : " + saveyn);
  341. // if(saveyn <= 0 ){
  342. // messageBox("수정사항이 없어 저장 ","E001");
  343. // return;
  344. // }
  345. //alert(model.getValue("/root/main/cond/clsflag"));
  346. //alert(model.getValue("/root/main/cond/recflag"));
  347. //if(messageBox("","Q002") != 6) return;
  348. //alert(model.getValue("/root/main/cond/todd"));
  349. // model.makeValue("/root/send/lrggrupcd", model.getValue(xCondPath+"/lrggrupcd"));
  350. // model.makeValue("/root/send/clsflag", model.getValue("/root/main/cond/clsflag"));
  351. // model.makeValue("/root/send/recflag", model.getValue("/root/main/cond/recflag"))
  352. // model.makeValue("/root/send/todd2", model.getValue("/root/main/cond/todd"))
  353. //alert(model.getValue("/root/send/todd2"));
  354. if(submit("TXMNR07608")){
  355. model.copyNode("/root/hidden/main","/root/main");
  356. }
  357. // grd_detlgrup.row = 1;
  358. window.close();
  359. }
  360. /**
  361. * @group :
  362. * @ver : 2007.07.20
  363. * @by : 정찬성
  364. * @---------------------------------------------------
  365. * @type : function
  366. * @access : public
  367. * @desc : 혈액불출관리 init
  368. * @param :
  369. * @return :
  370. * @---------------------------------------------------
  371. */
  372. function fPopWndInit(){
  373. model.makeValue("/root/send/prcpddfrom", opener.window.javascript.getParameter("prcpddfrom") );
  374. model.makeValue("/root/send/prcpddto", opener.window.javascript.getParameter("prcpddto") );
  375. model.makeValue("/root/send/wardcd", opener.window.javascript.getParameter("wardcd") );
  376. model.makeValue("/root/send/roomcd", opener.window.javascript.getParameter("roomcd") );
  377. model.makeValue("/root/send/pid", opener.window.javascript.getParameter("pid") );
  378. model.makeValue("/root/send/queryprcpdd", opener.window.javascript.getParameter("queryprcpdd") );
  379. model.makeValue("/root/send/queryprcpno", opener.window.javascript.getParameter("queryprcpno") );
  380. model.makeValue("/root/send/queryprcphistno", opener.window.javascript.getParameter("queryprcphistno") );
  381. //alert(prcpddfrom); alert(prcpddto); alert(wardcd); alert(roomcd); alert(pid);
  382. if(submit("TRMNR07607")){
  383. model.copyNode("/root/temp/main","/root/main");
  384. }
  385. }
  386. /**
  387. * @group :
  388. * @ver : 2007.06.18
  389. * @by : 정찬성
  390. * @---------------------------------------------------
  391. * @type : function
  392. * @access : public
  393. * @desc : 혈액불출신청 팝업
  394. * @param :
  395. * @return :
  396. * @---------------------------------------------------
  397. */
  398. function fPopWnd(){
  399. var iRows = datagrid5.rows;
  400. var queryprcpdd = "" ;
  401. var queryprcpno = "" ;
  402. var queryprcphistno = "" ;
  403. var checkcnt = 0 ;
  404. for(var i = 1 ; i < datagrid5.rows; i++ ) {// 전체를 돌면서 그룹에 값이 체크되어 있는것 초기화
  405. if( model.getValue(xExecDetlListPath+"["+ i +"]/sel") == "true" ) {
  406. // alert("111");
  407. queryprcpdd = queryprcpdd + "'" + model.getValue(xExecDetlListPath+"["+ i +"]/prcpdd2") + "'," ;
  408. queryprcpno = queryprcpno + "" + model.getValue(xExecDetlListPath+"["+ i +"]/prcpno") + "," ;
  409. // alert(model.getValue(xExecDetlListPath+"["+ i +"]/prcphistno"));
  410. queryprcphistno = queryprcphistno + "" + model.getValue(xExecDetlListPath+"["+ i +"]/prcphistno") + "," ;
  411. checkcnt++ ;
  412. } else {
  413. // alert("222");
  414. }
  415. }
  416. if( checkcnt <= 0 ) {
  417. messageBox("수행처방내역을 ","C002");
  418. return false;
  419. }
  420. queryprcpdd = queryprcpdd.replace(/-/g,"")
  421. // alert(queryprcpdd.replace(/-/g,""));
  422. // alert(queryprcpdd.substr(0,queryprcpdd.length-1));
  423. // alert(queryprcpno.substr(0,queryprcpno.length-1));
  424. // alert(queryprcphistno.substr(0,queryprcphistno.length-1));
  425. queryprcpdd = queryprcpdd.substr(0,queryprcpdd.length-1) ;
  426. queryprcpno = queryprcpno.substr(0,queryprcpno.length-1) ;
  427. queryprcphistno = queryprcphistno.substr(0,queryprcphistno.length-1) ;
  428. // for(var i = 0 ; i < data.length; i++ ) {
  429. //
  430. // queryprcpno = queryprcpno + data[i] ;
  431. //
  432. // }
  433. setParameter("prcpddfrom", input2.value);
  434. setParameter("prcpddto", input11.value);
  435. setParameter("wardcd", combo7.value);
  436. setParameter("roomcd", combo2.value);
  437. setParameter("pid", input3.value);
  438. setParameter("queryprcpdd", queryprcpdd);
  439. setParameter("queryprcpno", queryprcpno);
  440. setParameter("queryprcphistno", queryprcphistno);
  441. var left = event.screenX-1000;
  442. var top = event.screenY+50;
  443. modal("SMMNR07601",1,left,top);
  444. }
  445. /**
  446. * @group :
  447. * @ver : 2007.06.18
  448. * @by : 정찬성
  449. * @---------------------------------------------------
  450. * @type : function
  451. * @access : public
  452. * @desc : 환자 상세정보 조회 combo
  453. * @param :
  454. * @return :
  455. * @---------------------------------------------------
  456. */
  457. function fGetPatientInfo(){
  458. model.removenode("/root/send");
  459. model.makeValue("/root/send/wardcd", combo7.value);
  460. model.makeValue("/root/send/roomcd", combo2.value);
  461. if( input3.value != "" ){
  462. model.makeValue("/root/send/pid", input3.value);
  463. } else if( model.makeValue("/root/send/pid", combo8.value) != "" ){
  464. model.makeValue("/root/send/pid", combo8.value);
  465. }
  466. if(submit("TRMNR07605")){
  467. }
  468. model.setfocus("button3");
  469. }
  470. /**
  471. * @group :
  472. * @ver : 2007.06.18
  473. * @by : 정찬성
  474. * @---------------------------------------------------
  475. * @type : function
  476. * @access : public
  477. * @desc : 환자 정보 조회 combo
  478. * @param :
  479. * @return :
  480. * @---------------------------------------------------
  481. */
  482. function fGetPatientList(){
  483. model.removenode("/root/send");
  484. model.makeValue("/root/send/wardcd", combo7.value);
  485. model.makeValue("/root/send/roomcd", combo2.value);
  486. if(submit("TRMNR07604")){
  487. }
  488. model.setfocus("combo8");
  489. }
  490. /**
  491. * @group :
  492. * @ver : 2007.06.18
  493. * @by : 정찬성
  494. * @---------------------------------------------------
  495. * @type : function
  496. * @access : public
  497. * @desc : 병실 조회 combo
  498. * @param :
  499. * @return :
  500. * @---------------------------------------------------
  501. */
  502. function fGetRoomList(){
  503. model.removenode("/root/send");
  504. model.makeValue("/root/send/wardcd", combo7.value);
  505. //alert(cmb_wardcd.value);
  506. if(submit("TRMNR07603")){
  507. }
  508. model.setfocus("combo2");
  509. }
  510. /**
  511. * @group :
  512. * @ver : 2007.06.18
  513. * @by : 정찬성
  514. * @---------------------------------------------------
  515. * @type : function
  516. * @access : public
  517. * @desc : 병동 조회
  518. * @param :
  519. * @return :
  520. * @---------------------------------------------------
  521. */
  522. function fGetWardList(){
  523. model.removenode("/root/send");
  524. model.makeValue("/root/send/wardcd", model.getValue("/root/main/cond/wardcdgrup/wardcdgruplist/wardcd"));
  525. if(submit("TRMNR07602")){
  526. }
  527. model.setfocus("combo7");
  528. }
  529. /**
  530. * @group :
  531. * @ver : 2007.07.20
  532. * @by : 정찬성
  533. * @---------------------------------------------------
  534. * @type : function
  535. * @access : public
  536. * @desc : 혈액불출관리 init
  537. * @param :
  538. * @return :
  539. * @---------------------------------------------------
  540. */
  541. function fInit(){
  542. fGetWardList();// 병동코드 리스트
  543. }
  544. /**
  545. * @group :
  546. * @ver : 2007.07.20
  547. * @by : 정찬성
  548. * @---------------------------------------------------
  549. * @type : function
  550. * @access : public
  551. * @desc : 중증도 등록버튼 누를때, 최근값으로 상세내역 셋팅
  552. * @param :
  553. * @return :
  554. * @---------------------------------------------------
  555. */
  556. function fRecHistPntListInsert(){
  557. // alert();
  558. var iRow = datagrid2.row;
  559. model.removenode("/root/send");
  560. model.makeValue("/root/send/execdt", model.getvalue(xRecgrupListPath+"["+iRow+"]/execdt"));
  561. model.makeValue("/root/send/pid", model.getvalue("/root/main/recgrup/rectmaxvallist/pid"));
  562. model.makeValue("/root/send/clsflag", model.getvalue("/root/main/recgrup/rectmaxvallist/clsflag"));
  563. model.makeValue("/root/send/recflag", model.getvalue("/root/main/recgrup/rectmaxvallist/recflag"));
  564. model.makeValue("/root/send/grupcd", model.getvalue("/root/main/recgrup/rectmaxvallist/grupcd"));
  565. // model.setValue("/root/main/hiddengrup/grupcd",model.getValue("/root/main/recgrup/rectmaxvallist/grupcd"));// 등록시 grupcd 를 가지고 마지막 등록값을 가져온다.
  566. // model.setValue("/root/main/hiddengrup/pid",model.getValue("/root/main/recgrup/rectmaxvallist/pid"));// 등록시 pid 를 가지고 마지막 등록값을 가져온다.
  567. // model.setValue("/root/main/hiddengrup/clsflag",model.getValue("/root/main/recgrup/rectmaxvallist/clsflag"));// 등록시 clsflag 를 가지고 마지막 등록값을 가져온다.
  568. // model.setValue("/root/main/hiddengrup/recflag",model.getValue("/root/main/recgrup/rectmaxvallist/recflag"));// 등록시 recflag 를 가지고 마지막 등록값을 가져온다.
  569. if(submit("TRMNW04007")){
  570. var iRowNum = datagrid1.row;
  571. }
  572. var iRow = grd_histgrup.row;
  573. var iCol = grd_histgrup.col;
  574. /* 중증도 상세내역 구분 체크 시작 */
  575. var nodelist = bind1.nodeset;
  576. var cNt = nodelist.length;
  577. for(var ins = 1 ; ins <= cNt; ins++ ){// 체크된 값 전체를 돈다.
  578. for(var i = 1 ; i < grd_histgrup.rows; i++ ){// 전체를 돌면서 그룹에 값이 체크되어 있는것 초기화
  579. if(
  580. (model.getValue(xHIsgrupListPath+"["+ i +"]/supcd") == model.getValue("/root/main/rechistpntgrup/serdiaghislist["+ ins +"]/supcd")) &&
  581. (model.getValue(xHIsgrupListPath+"["+ i +"]/basepnt") == model.getValue("/root/main/rechistpntgrup/serdiaghislist["+ ins +"]/timsval"))
  582. ) {
  583. grd_histgrup.textmatrix(i,1) = "Y";
  584. grd_histgrup.textmatrix(i,0) = "I";
  585. }
  586. }
  587. }
  588. /* 중증도 상세내역 구분 체크 끝 */
  589. }
  590. /**
  591. * @group :
  592. * @ver : 2007.07.20
  593. * @by : 정찬성
  594. * @---------------------------------------------------
  595. * @type : function
  596. * @access : public
  597. * @desc : 중증도 저장/업데이트 후 리로딩
  598. * @param :
  599. * @return :
  600. * @---------------------------------------------------
  601. */
  602. function fReload(iRow){
  603. // alert(iRow);
  604. datagrid2.row = iRow ;
  605. for(var i = 1 ; i < datagrid2.rows; i++ ){// 전체를 돌면서 중증도 내역선택시 상태를 초기화
  606. datagrid2.textmatrix(i,1) = "-"; // 중증도 내역선택시 상태를 초기화
  607. }
  608. tar_desccnts.value = "" ; // 중증도 내역 선택시 설명 부분 클리어
  609. tar_desccnts.refresh();// 화면에 적용. 그리드는 rebuild()
  610. fFlag();// 중증도구분 / 낙상 구분 체크
  611. fHistList(); // 중증도 상세내역 리스트 04006
  612. fRecHistPntList();// 중증도 상세점수 내역 / 한글명 / 체크 점수 목록 04007
  613. fColLqidty();// 중증도 상세점수 display : true , false / 총점 중증도
  614. rdo_clsflaga.disabled = true ;// 중증도구분 비활성화 시킨다.
  615. rdo_clsflagb.disabled = true ;// 낙상구분 비활성화 시킨다.
  616. }
  617. /**
  618. * @group :
  619. * @ver : 2007.07.20
  620. * @by : 정찬성
  621. * @---------------------------------------------------
  622. * @type : function
  623. * @access : public
  624. * @desc : 중증도 상세내역 구분을 선택했을 때 동작
  625. * @param :
  626. * @return :
  627. * @---------------------------------------------------
  628. */
  629. function fGrupTest(){
  630. var iRow = grd_histgrup.row;
  631. var iCol = grd_histgrup.col;
  632. //alert(iCol);
  633. var sDetlGrupRow = grd_histgrup.row;
  634. var sDetlGrupBKRow=0;
  635. // alert( model.getValue(xHIsgrupListPath+"["+sDetlGrupRow+"]/supcd") );
  636. //
  637. // alert(grd_histgrup.textmatrix(iRow,1));
  638. if(model.getValue(xHIsgrupListPath+"["+sDetlGrupRow+"]/supcd") == "00000000"){// supcd 00000000 일때, 00000000을 초기화
  639. grd_histgrup.textmatrix(sDetlGrupRow,1) = "N";
  640. grd_histgrup.textmatrix(sDetlGrupRow,0) = "-";
  641. return;
  642. }
  643. //alert(model.getValue(xHIsgrupListPath+"["+sDetlGrupRow+"]/supcd"));
  644. var supcd = model.getValue(xHIsgrupListPath+"["+sDetlGrupRow+"]/supcd") ;
  645. for(var i = 1 ; i < grd_histgrup.rows; i++ ){// 전체를 돌면서 그룹에 값이 체크되어 있는것 초기화
  646. if(supcd == model.getValue(xHIsgrupListPath+"["+ i +"]/supcd") ) {
  647. // alert("supcd : " + supcd);
  648. // alert("grd_histgrup : " + model.getValue(xHIsgrupListPath+"["+i+"]/supcd"));
  649. grd_histgrup.textmatrix(i,1) = "N";
  650. grd_histgrup.textmatrix(i,0) = "-";
  651. }
  652. }
  653. grd_histgrup.textmatrix(sDetlGrupRow,1) = "Y"; // 현재 선택값 다시 체크
  654. var cNt = 0 ;
  655. // for(var i = 1 ; i < grd_histgrup.rows; i++ ){// 전체를 돌면서 값이 체크 값을 찾아 중증도 내역 총점에 합산한다.
  656. //
  657. // if(grd_histgrup.textmatrix(i,1) == "Y") {
  658. //
  659. // cNt = cNt + parseInt(model.getValue(xHIsgrupListPath+"["+i+"]/basepnt"));
  660. //
  661. // }
  662. //
  663. // }
  664. //
  665. // datagrid2.textmatrix(1,13) = cNt;
  666. // datagrid2.textmatrix(1,0) = "U";
  667. //
  668. //
  669. // alert(datagrid2.textmatrix(1,0));
  670. //
  671. // return ;
  672. if(iCol == 1){
  673. var sDetlGrupRow = grd_histgrup.row;
  674. var sDetlGrupBKRow=0;
  675. if(model.getValue(xHIsgrupListPath+"["+sDetlGrupRow+"]/stat") != "-"){
  676. return;
  677. }
  678. var grupcd = model.getValue(xHIsgrupListPath+"["+sDetlGrupRow+"]/grupcd");
  679. for(var i=1; i<= getNodesetCount(xHIsgrupListBKPath); i++){
  680. if(model.getValue(xHIsgrupListBKPath+"["+i+"]/grupcd") == grupcd){
  681. sDetlGrupBKRow = i;
  682. break;
  683. }
  684. }
  685. // alert(instance1.selectSingleNode(xHIsgrupListPath+"["+sDetlGrupRow+"]").xml);
  686. // alert(instance1.selectSingleNode(xHIsgrupListBKPath+"["+sDetlGrupBKRow+"]").xml);
  687. if(instance1.selectSingleNode(xHIsgrupListPath+"["+sDetlGrupRow+"]").xml != instance1.selectSingleNode(xHIsgrupListBKPath+"["+sDetlGrupBKRow+"]").xml){
  688. // if( model.getValue(xHIsgrupListPath+"["+sDetlGrupRow+"]/supcd") ){
  689. // }
  690. model.setValue(xHIsgrupListPath+"["+sDetlGrupRow+"]/stat","I");
  691. grd_histgrup.rebuild();
  692. fMakeTreeView();
  693. }
  694. }else{
  695. return ;
  696. }
  697. }
  698. /**
  699. * @group :
  700. * @ver : 2007.07.20
  701. * @by : 정찬성
  702. * @---------------------------------------------------
  703. * @type : function
  704. * @access : public
  705. * @desc : 중증도 / 낙상 선택시 중증도 상세내역 리스트 출력
  706. * @param :
  707. * @return :
  708. * @---------------------------------------------------
  709. */
  710. function fSerDiagChoi(arg){
  711. // var iRow = datagrid2.row;
  712. //
  713. // if( model.getValue(xRecgrupListPath+"["+"1"+"]/stat") != "I" ){
  714. //
  715. // messageBox("수정시 중증도/낙상을 변경","E001");
  716. // return;
  717. //
  718. // }
  719. var clsflag = "" ;
  720. var recflag = "" ;
  721. if( arg == "rdo_clsflaga" ){
  722. clsflag = model.getValue("/root/main/topattribute/clsflaga") ;
  723. recflag = '1';
  724. rdo_clsflagb.value = "" ;
  725. } else if ( arg == "rdo_clsflagb" ){
  726. clsflag = model.getValue("/root/main/topattribute/clsflagb") ;
  727. recflag = '2';
  728. rdo_clsflaga.value = "" ;
  729. }
  730. model.makeValue("/root/send/supcd", "00000000");
  731. model.makeValue("/root/send/clsflag", clsflag);
  732. model.makeValue("/root/send/recflag", recflag);
  733. if(submit("TRMNW04006")){
  734. model.copyNode("/root/temp","/root/main");
  735. fMakeTreeView();
  736. }
  737. }
  738. /**
  739. * @group :
  740. * @ver : 2007.03.30
  741. * @by : 정찬성
  742. * @---------------------------------------------------
  743. * @type : function
  744. * @access : public
  745. * @desc : 중증도 값을 저장한다.
  746. * @param :
  747. * @return :
  748. * @---------------------------------------------------
  749. */
  750. function fSave(){
  751. var iRowUpd = datagrid2.row ;
  752. var inpt = "" ;
  753. // alert(model.getValue(xRecgrupListPath+"["+"1"+"]/stat"));
  754. if( model.getValue(xRecgrupListPath+"["+"1"+"]/stat") == "I" ){
  755. inpt = "inpt"
  756. } else {
  757. inpt = "updt"
  758. }
  759. var fstrgstrid = model.getValue(xRecgrupListPath+"["+iRowUpd+"]/fstrgstrid") ;
  760. // alert(fstrgstrid);
  761. //
  762. // alert(inpt);
  763. /* 수정시 입력한 사람과 ID가 동일한지 체크 시작 */
  764. if(inpt == "updt" ){
  765. if( getUserId() == fstrgstrid ){
  766. //alert("1111");
  767. } else {
  768. //alert("222");
  769. //messageBox("등록자와 아이디가 ","E004");
  770. // return ; // 나중에 풀어야 함. 반드시 ****************************************************************************
  771. }
  772. }
  773. /* 수정시 입력한 사람과 ID가 동일한지 체크 끝 */
  774. // return ;
  775. var sRowCnt = datagrid2.rows-datagrid2.fixedrows;
  776. var iRows = datagrid1.rows ;
  777. var iRow = datagrid1.row ;
  778. var sRowCntHist = datagrid2.rows-grd_histgrup.fixedrows;
  779. // alert(iRows);
  780. if( iRows < 2 ){
  781. messageBox("환자정보가 없어 저장","E001");
  782. return;
  783. }
  784. model.removenode("/root/send");
  785. // alert(datagrid2.getupdatedataAll("i"));
  786. // alert(grd_histgrup.getupdatedataAll("i"));
  787. var saveyn = 0 ;
  788. if(inpt == "inpt"){// 등록시
  789. if(sRowCnt <= 0){
  790. messageBox("저장할 데이터를 입력하지 ","E007");
  791. return;
  792. }
  793. if(rdo_clsflaga.value == '' && rdo_clsflagb.value == ''){
  794. messageBox("중증도 구분 / 낙상이 선택되지 ","E007");
  795. return;
  796. }
  797. for(var i=1; i<= sRowCnt; i++){
  798. if(model.getValue(xRecgrupListPath+"["+i+"]/stat") != "-") {
  799. saveyn = 1 ;
  800. }
  801. }
  802. if(saveyn <= 0 ){
  803. messageBox("등록정보가 없어 저장 ","E001");
  804. return;
  805. }
  806. if(cmb_execkind.value == ""){
  807. messageBox("기록활 duty를 선택하지 ","E007");
  808. return;
  809. }
  810. } else if (inpt == "updt") {//수정시
  811. for(var i=1; i<= grd_histgrup.rows ; i++){
  812. //alert(model.getValue(xHIsgrupListPath+"["+i+"]/stat"));
  813. if(model.getValue(xHIsgrupListPath+"["+i+"]/stat") == "U") {
  814. saveyn = 1 ;
  815. }
  816. }
  817. if(saveyn <= 0 ){
  818. messageBox("수정정보가 없어 저장 ","E001");
  819. return;
  820. }
  821. }
  822. if(messageBox("","Q002") != 6) return;// 저장하시겠습니까?
  823. // alert(model.getValue("/root/main/topattribute/clsflaga"));
  824. // alert(model.getValue("/root/main/topattribute/clsflagb"));
  825. var clsflag = '';
  826. var recflag = '';
  827. if ( model.getValue("/root/main/topattribute/clsflagb") == "7" || model.getValue("/root/main/topattribute/clsflagb") == "8"){
  828. //alert("222");
  829. clsflag = model.getValue("/root/main/topattribute/clsflagb") ;
  830. recflag = '2';
  831. }else if( parseInt(model.getValue("/root/main/topattribute/clsflaga")) < 7){
  832. //alert("111");
  833. clsflag = model.getValue("/root/main/topattribute/clsflaga") ;
  834. recflag = '1';
  835. }
  836. //return ;
  837. var iRowCnt = datagrid2.row ;
  838. // alert(clsflag);
  839. // alert(model.getValue("/root/main/detlgrup/detlgruplist["+ iRow +"]/indd"));
  840. // alert(cmb_execkind.value);
  841. model.makeValue("/root/send/clsflag", clsflag);
  842. model.makeValue("/root/send/recflag", recflag);
  843. model.makeValue("/root/send/indd", model.getValue("/root/main/detlgrup/detlgruplist["+ iRow +"]/indd"));
  844. model.makeValue("/root/send/pid", model.getValue("/root/main/topattribute/pid"));
  845. model.makeValue("/root/send/cretno", "1");
  846. model.makeValue("/root/send/seqno", "1");
  847. model.makeValue("/root/send/certkey", "123456");
  848. model.makeValue("/root/send/execkind", cmb_execkind.value);
  849. // alert(cmb_wardcd.value);
  850. model.makeValue("/root/send/wardcd", combo7.value );
  851. model.makeValue("/root/send/roomcd", model.getValue("/root/main/topattribute/roomcd"));
  852. model.makeValue("/root/send/grupcdval", model.getValue("/root/main/recgrup/recgruplist["+ iRowCnt +"]/grupcd"));
  853. // alert(model.getValue("/root/main/topattribute/pid"));
  854. // alert(clsflag);
  855. // return ;
  856. var cNt = 0 ;
  857. if(inpt == "inpt"){// 등록시
  858. for(var i = 1 ; i < grd_histgrup.rows; i++ ){// 전체를 돌면서 값이 체크 값을 찾아 중증도 내역 총점에 합산한다.
  859. if(grd_histgrup.textmatrix(i,1) == "Y") {
  860. cNt = cNt + parseInt(model.getValue(xHIsgrupListPath+"["+i+"]/basepnt"));
  861. }
  862. }
  863. datagrid2.textmatrix(iRowCnt,13) = cNt;
  864. // alert(datagrid2.getupdatedataAll("i"));
  865. // alert(grd_histgrup.getupdatedataAll("i"));
  866. //
  867. // return ;
  868. model.makeValue("/root/send/recgrup",datagrid2.getupdatedataAll("i"));
  869. model.makeValue("/root/send/histgrup",grd_histgrup.getupdatedataAll("i"));
  870. if(submit("TXMNW04001")){
  871. model.copyNode("/root/temp","/root/main");
  872. datagrid2.row = 1;// 저장후 저장한 로우를 선택
  873. fReload(iRowCnt);// 업데이트후 화면값 리로딩
  874. }
  875. } else if (inpt == "updt") {//수정시
  876. for(var i = 1 ; i < grd_histgrup.rows; i++ ){// 전체를 돌면서 값이 체크 값을 찾아 중증도 내역 총점에 합산한다.
  877. if(grd_histgrup.textmatrix(i,1) == "Y") {
  878. cNt = cNt + parseInt(model.getValue(xHIsgrupListPath+"["+i+"]/basepnt"));
  879. }
  880. }
  881. // alert(cNt);
  882. datagrid2.textmatrix(iRowCnt,13) = cNt;
  883. model.makeValue("/root/send/recgrup",datagrid2.getupdatedataAll("i"));
  884. model.makeValue("/root/send/histgrup",grd_histgrup.getupdatedataAll("i"));
  885. // alert(model.getValue(xRecgrupListPath+"["+iRowCnt+"]/totpnt"));
  886. //
  887. // return ;
  888. if(submit("TXMNW04002")){
  889. model.copyNode("/root/temp","/root/main");
  890. fReload(iRowCnt);// 업데이트후 화면값 리로딩
  891. }
  892. }
  893. rdo_clsflaga.disabled = true ;// 중증도구분 비활성화 시킨다.
  894. rdo_clsflagb.disabled = true ;// 낙상구분 비활성화 시킨다.
  895. inpt = "" ;// 등록/수정 클리어
  896. }
  897. /**
  898. * @group :
  899. * @ver : 2007.07.20
  900. * @by : 정찬성
  901. * @---------------------------------------------------
  902. * @type : function
  903. * @access : public
  904. * @desc : 중증도 내역 삭제 버튼
  905. * @param :
  906. * @return :
  907. * @---------------------------------------------------
  908. */
  909. function fDel(){
  910. if(messageBox("신규정보를","Q001") != 6) return;
  911. model.removeNodeset("/root/main/rechistpntgrup/rechistpntlist");// 중증도 상세점수 클리어
  912. model.removeNodeset("/root/main/histgrup/histgruplist");// 중증도 상세내역 클리어
  913. datagrid3.refresh();
  914. grd_histgrup.refresh();
  915. model.removeNodeset("/root/main/recgrup/recgruplist");
  916. fSelect() ;// 중증도 내역 리스트
  917. datagrid2.rebuild();
  918. datagrid2.refresh();
  919. datagrid2.row = 1;
  920. }
  921. /**
  922. * @group :
  923. * @ver : 2007.07.20
  924. * @by : 정찬성
  925. * @---------------------------------------------------
  926. * @type : function
  927. * @access : public
  928. * @desc : 중증도 내역 등록 버튼
  929. * @param :
  930. * @return :
  931. * @---------------------------------------------------
  932. */
  933. function fAddInsertRow(){
  934. if(cmb_execkind.value == "" || cmb_execkind.value == "0"){
  935. messageBox("기록활 duty를 선택하지 ","E007");
  936. return;
  937. }
  938. var iRows = datagrid1.rows ;
  939. if( iRows < 2 ){
  940. messageBox("환자정보가 없어 등록","E001");
  941. return;
  942. }
  943. if( model.getValue(xRecgrupListPath+"["+"1"+"]/stat") == "I" ){
  944. messageBox("중증도 내역은 한번에 1건이상 저장할 수","E001");
  945. return;
  946. }
  947. fSelect();//등록버튼 클릭시 현재 최종값을 셋팅
  948. var iRow = datagrid2.rows;
  949. // alert(iRow);
  950. if(iRow < 2){
  951. iRow = 1 ;
  952. datagrid2.addRow(true, true);
  953. } else {
  954. datagrid2.insertRow("1", "above");
  955. // datagrid2.insertRow(datagrid2.row);
  956. }
  957. // alert(getUserName());
  958. rdo_clsflaga.value= "" ;// 중증도 구분 클리어
  959. rdo_clsflagb.value= "" ;//낙상 클리어
  960. model.removeNodeset("/root/main/rechistpntgrup/rechistpntlist");// 중증도 상세점수 클리어
  961. model.setValue(xRecgrupListPath+"["+"1"+"]/stat","I"); //
  962. model.setValue(xRecgrupListPath+"["+"1"+"]/execdt",ipt_execdt.value );
  963. model.setValue(xRecgrupListPath+"["+"1"+"]/exectm",input4.value); //
  964. model.setValue(xRecgrupListPath+"["+"1"+"]/clsgrupkind", ""); //
  965. model.setValue(xRecgrupListPath+"["+"1"+"]/totpnt", ""); //
  966. model.setValue(xRecgrupListPath+"["+"1"+"]/usernm", "테스트"); //
  967. datagrid2.rebuild();
  968. datagrid2.row = 1;
  969. model.makeValue("/root/send/supcd", "00000000");
  970. // model.makeValue("/root/send/clsflag", "1");
  971. // model.makeValue("/root/send/recflag", "1");
  972. /* 처음 등록시 일반병동/ 아니면 마지막 등록한 값 시작 */
  973. if(model.getvalue("/root/main/recgrup/rectmaxvallist/clsflag") == "" || model.getvalue("/root/main/recgrup/rectmaxvallist/recflag") == "" ){
  974. model.makeValue("/root/send/clsflag", "1");
  975. model.makeValue("/root/send/recflag", "1");
  976. rdo_clsflaga.value = "1" ;
  977. rdo_clsflagb.value = "1" ;
  978. } else {
  979. model.makeValue("/root/send/clsflag", model.getvalue("/root/main/recgrup/rectmaxvallist/clsflag"));
  980. model.makeValue("/root/send/recflag", model.getvalue("/root/main/recgrup/rectmaxvallist/recflag"));
  981. // alert(model.getvalue("/root/main/recgrup/rectmaxvallist/clsflag"));
  982. // alert(model.getvalue("/root/main/recgrup/rectmaxvallist/recflag"));
  983. var cLsflag = model.getvalue("/root/main/recgrup/rectmaxvallist/clsflag") ;
  984. /* 최종값을 가지고 중증도/낙상 체크 시작 */
  985. if( cLsflag < 7 ){
  986. if( cLsflag == 1 ){
  987. rdo_clsflaga.select(0);
  988. } else if ( cLsflag == 2 ){
  989. rdo_clsflaga.select(1);
  990. } else if ( cLsflag == 3 ){
  991. rdo_clsflaga.select(2);
  992. } else if ( cLsflag == 4 ){
  993. rdo_clsflaga.select(3);
  994. } else if ( cLsflag == 5 ){
  995. rdo_clsflaga.select(4);
  996. } else if ( cLsflag == 6 ){
  997. rdo_clsflaga.select(5);
  998. }
  999. } else if(cLsflag > 6 ) {
  1000. if ( cLsflag == 7 ){
  1001. rdo_clsflagb.select(0);
  1002. } else if ( cLsflag == 8 ){
  1003. rdo_clsflagb.select(1);
  1004. }
  1005. }
  1006. rdo_clsflaga.refresh();
  1007. rdo_clsflagb.refresh();
  1008. /* 최종값을 가지고 중증도/낙상 체크 끝 */
  1009. }
  1010. /* 처음 등록시 일반병동/ 아니면 마지막 등록한 값 끝 */
  1011. if(submit("TRMNW04006")){
  1012. model.copyNode("/root/temp","/root/main");
  1013. fMakeTreeView(); //
  1014. }
  1015. //rdo_clsflaga.value = "1" ;
  1016. rdo_clsflaga.disabled = false ;// 중증도구분 등록시 활성화 시킨다.
  1017. rdo_clsflagb.disabled = false ;// 낙상구분 등록시 활성화 시킨다.
  1018. model.makeValue("/root/main/rechistpntgrup/rechistpntlist/pid",model.getValue(xClsListPath+"["+iRow+"]/pid"));
  1019. model.makeValue("/root/main/rechistpntgrup/rechistpntlist/hngnm",model.getValue(xClsListPath+"["+iRow+"]/hngnm"));
  1020. fRecHistPntListInsert();//등록버튼 클릭시 마지막 입력한 값으로 셋팅
  1021. model.removeNodeset("/root/main/rechistpntgrup/rechistpntlist");// 중증도 상세점수 클리어
  1022. datagrid3.refresh();
  1023. }
  1024. /**
  1025. * @group :
  1026. * @ver : 2007.07.20
  1027. * @by : 정찬성
  1028. * @---------------------------------------------------
  1029. * @type : function
  1030. * @access : public
  1031. * @desc : 중증도 상세점수 display : true , false / 총점 중증도
  1032. * @param :
  1033. * @return :
  1034. * @---------------------------------------------------
  1035. */
  1036. function fColLqidty() {
  1037. var cNt = model.getValue("/root/main/rechistpntgrup/rechistpntlist/cnt")
  1038. if(cNt > 0 ){
  1039. var no = 1 ;
  1040. var notitl = 0 ;
  1041. for( var i = 0 ; i < cNt ; i++ ) {
  1042. no++ ;
  1043. notitl++ ;
  1044. datagrid3.colhidden(no) = false;
  1045. datagrid3.colwidth(no) = 50;
  1046. datagrid3.valuematrix(0,no) = model.getValue("/root/main/rechistpntgrup/pnttitlgruplist["+ notitl +"]/hngnm");
  1047. }
  1048. datagrid3.colhidden(42) = false;
  1049. datagrid3.colhidden(43) = false;
  1050. datagrid3.colwidth(42) = 50;
  1051. datagrid3.colwidth(43) = 50;
  1052. var iRow = datagrid1.row ;
  1053. datagrid3.valuematrix(1,0) = model.getValue("/root/main/detlgrup/detlgruplist["+ iRow +"]/pid");
  1054. datagrid3.valuematrix(1,1) = model.getValue("/root/main/detlgrup/detlgruplist["+ iRow +"]/hngnm");
  1055. datagrid3.refresh();
  1056. }
  1057. }
  1058. /**
  1059. * @group :
  1060. * @ver : 2007.07.20
  1061. * @by : 정찬성
  1062. * @---------------------------------------------------
  1063. * @type : function
  1064. * @access : public
  1065. * @desc : 중증도 상세점수 내역 / 한글명 / 체크 점수 목록
  1066. * @param :
  1067. * @return :
  1068. * @---------------------------------------------------
  1069. */
  1070. function fRecHistPntList(){
  1071. var iRow = datagrid2.row;
  1072. model.removenode("/root/send");
  1073. model.makeValue("/root/send/pid", model.getvalue(xRecgrupListPath+"["+iRow+"]/pid"));
  1074. model.makeValue("/root/send/execdt", model.getvalue(xRecgrupListPath+"["+iRow+"]/execdt"));
  1075. model.makeValue("/root/send/clsflag", model.getvalue(xRecgrupListPath+"["+iRow+"]/clsflag"));
  1076. model.makeValue("/root/send/recflag", model.getvalue(xRecgrupListPath+"["+iRow+"]/recflag"));
  1077. model.makeValue("/root/send/grupcd", model.getvalue(xRecgrupListPath+"["+iRow+"]/grupcd"));
  1078. if(submit("TRMNW04007")){
  1079. var iRowNum = datagrid1.row;
  1080. }
  1081. var iRow = grd_histgrup.row;
  1082. var iCol = grd_histgrup.col;
  1083. /* 중증도 상세내역 구분 체크 시작 */
  1084. var nodelist = bind1.nodeset;
  1085. var cNt = nodelist.length;
  1086. for(var ins = 1 ; ins <= cNt; ins++ ){// 체크된 값 전체를 돈다.
  1087. for(var i = 1 ; i < grd_histgrup.rows; i++ ){// 전체를 돌면서 그룹에 값이 체크되어 있는것 초기화
  1088. if(
  1089. (model.getValue(xHIsgrupListPath+"["+ i +"]/supcd") == model.getValue("/root/main/rechistpntgrup/serdiaghislist["+ ins +"]/supcd")) &&
  1090. (model.getValue(xHIsgrupListPath+"["+ i +"]/basepnt") == model.getValue("/root/main/rechistpntgrup/serdiaghislist["+ ins +"]/timsval"))
  1091. ) {
  1092. grd_histgrup.textmatrix(i,1) = "Y";
  1093. grd_histgrup.textmatrix(i,0) = "-";
  1094. }
  1095. }
  1096. }
  1097. /* 중증도 상세내역 구분 체크 끝 */
  1098. }
  1099. /**
  1100. * @group :
  1101. * @ver : 2007.03.27
  1102. * @by : 정찬성
  1103. * @---------------------------------------------------
  1104. * @type : function
  1105. * @access : public
  1106. * @desc : 중증도구분 낙상 구분 체크
  1107. * @param :
  1108. * @return :
  1109. * @---------------------------------------------------
  1110. */
  1111. function fFlag(){
  1112. var iRow = datagrid2.row;
  1113. //alert(iRow);
  1114. var cLsflag = model.getValue(xRecgrupListPath+"["+iRow+"]/clsflag") ;
  1115. //alert(cLsflag);
  1116. rdo_clsflaga.value = "" ;
  1117. rdo_clsflagb.value = "" ;
  1118. if( cLsflag < 7 ){
  1119. if( cLsflag == 1 ){
  1120. rdo_clsflaga.select(0);
  1121. } else if ( cLsflag == 2 ){
  1122. rdo_clsflaga.select(1);
  1123. } else if ( cLsflag == 3 ){
  1124. rdo_clsflaga.select(2);
  1125. } else if ( cLsflag == 4 ){
  1126. rdo_clsflaga.select(3);
  1127. } else if ( cLsflag == 5 ){
  1128. rdo_clsflaga.select(4);
  1129. } else if ( cLsflag == 6 ){
  1130. rdo_clsflaga.select(5);
  1131. }
  1132. } else if(cLsflag > 6 ) {
  1133. if ( cLsflag == 7 ){
  1134. rdo_clsflagb.select(0);
  1135. } else if ( cLsflag == 8 ){
  1136. rdo_clsflagb.select(1);
  1137. }
  1138. }
  1139. rdo_clsflaga.refresh();
  1140. rdo_clsflagb.refresh();
  1141. }
  1142. /**
  1143. * @group :
  1144. * @ver : 2007.03.27
  1145. * @by : 정찬성
  1146. * @---------------------------------------------------
  1147. * @type : function
  1148. * @access : public
  1149. * @desc : 중증도 상세내역의 설명을 조회한다.
  1150. * @param :
  1151. * @return :
  1152. * @---------------------------------------------------
  1153. */
  1154. function fHistDesc(){
  1155. var iRow = grd_histgrup.row;
  1156. tar_desccnts.value = model.getValue(xHIsgrupListPath+"["+iRow+"]/desccnts") ;
  1157. tar_desccnts.refresh();
  1158. }
  1159. /**
  1160. * @group :
  1161. * @ver : 2007.03.27
  1162. * @by : 정찬성
  1163. * @---------------------------------------------------
  1164. * @type : function
  1165. * @access : public
  1166. * @desc : 중증도 상세내역 트리구조로 변환
  1167. * @param :
  1168. * @return :
  1169. * @---------------------------------------------------
  1170. */
  1171. function fMakeTreeView(){
  1172. var sRowCnt = grd_histgrup.rows-grd_histgrup.fixedRows;
  1173. for(var i=1; i<= sRowCnt; i++){
  1174. grd_histgrup.IsSubtotal(i)=true;
  1175. grd_histgrup.outlinelevel(i)=model.getValue(xHIsgrupListPath+"["+i+"]/depth");
  1176. grd_histgrup.colDisabled(11) = true ;
  1177. }
  1178. grd_histgrup.OutlineCol = 3; //
  1179. grd_histgrup.OutlineBar = 4; //
  1180. grd_histgrup.TreeColor="gray";
  1181. model.refresh();
  1182. }
  1183. /**
  1184. * @group :
  1185. * @ver : 2007.04.30
  1186. * @by : 정찬성
  1187. * @---------------------------------------------------
  1188. * @type : function
  1189. * @access : public
  1190. * @desc : 중증도 상세내역 리스트 출력
  1191. * @param :
  1192. * @return :
  1193. * @---------------------------------------------------
  1194. */
  1195. function fHistList(){
  1196. var iRow = datagrid2.row;
  1197. model.removenode("/root/send");
  1198. model.makeValue("/root/send/supcd","00000000");
  1199. model.makeValue("/root/send/clsflag",model.getValue(xRecgrupListPath+"["+iRow+"]/clsflag"));
  1200. model.makeValue("/root/send/recflag",model.getValue(xRecgrupListPath+"["+iRow+"]/recflag"));
  1201. model.makeValue("/root/send/indd",model.getValue(xRecgrupListPath+"["+iRow+"]/indd"));
  1202. if(submit("TRMNW04006")){
  1203. model.copyNode("/root/temp","/root/main");
  1204. //model.copyNode("/root/temp/main","/root/main");
  1205. fMakeTreeView();
  1206. }
  1207. }
  1208. /**
  1209. * @group :
  1210. * @ver : 2007.03.27
  1211. * @by : 정찬성
  1212. * @---------------------------------------------------
  1213. * @type : function
  1214. * @access : public
  1215. * @desc : 설명
  1216. * @param :
  1217. * @return :
  1218. * @---------------------------------------------------
  1219. */
  1220. function fAddHist(){
  1221. datagrid2.insertRow(1);// 0 : 다음줄에 삽입 , 1 : 첫번째 줄에 삽입
  1222. datagrid2.rebuild();
  1223. }
  1224. /**
  1225. * @group :
  1226. * @ver : 2007.04.30
  1227. * @by : 정찬성
  1228. * @---------------------------------------------------
  1229. * @type : function
  1230. * @access : public
  1231. * @desc : 중증도 내역을 더블클릭했을때. 중증도 상세점수 / 중증도 상세내역 리스트를 출력
  1232. * @param :
  1233. * @return :
  1234. * @---------------------------------------------------
  1235. */
  1236. function fSelect(){
  1237. // alert();
  1238. var iRow = datagrid1.row;
  1239. if(iRow < 1) return;
  1240. opt_roomcd.value = model.getValue(xClsListPath+"["+iRow+"]/roomcd");
  1241. opt_pid.value = model.getValue(xClsListPath+"["+iRow+"]/pid");
  1242. opt_hngnm.value = model.getValue(xClsListPath+"["+iRow+"]/hngnm");
  1243. opt_pid.value = model.getValue(xClsListPath+"["+iRow+"]/pid"); // 중증도 상세점수 등록번호
  1244. opt_hngnm.value = model.getValue(xClsListPath+"["+iRow+"]/hngnm"); // 중증도 상세점수 환자명
  1245. //alert(model.getValue(xClsListPath+"["+iRow+"]/pid"));
  1246. // datagrid3.textmatrix(1,0) = model.getValue(xClsListPath+"["+iRow+"]/pid");
  1247. // datagrid3.textmatrix(1,1) = model.getValue(xClsListPath+"["+iRow+"]/hngnm");
  1248. model.makeValue("/root/main/rechistpntgrup/rechistpntlist/pid",model.getValue(xClsListPath+"["+iRow+"]/pid"));
  1249. model.makeValue("/root/main/rechistpntgrup/rechistpntlist/hngnm",model.getValue(xClsListPath+"["+iRow+"]/hngnm"));
  1250. // var no = 1 ;
  1251. //
  1252. // for( var i = 0 ; i < 43 ; i++ ) {
  1253. //
  1254. // no++ ;
  1255. //
  1256. // datagrid3.colhidden(no) = true;// 환자선택시 중증도 상세점수 필드 환자명 다음 컬럼부터 숨기기
  1257. //
  1258. // }
  1259. datagrid3.rebuild();
  1260. model.makeValue("/root/send/pid",model.getValue(xClsListPath+"["+iRow+"]/pid"));
  1261. model.makeValue("/root/send/execdt",ipt_execdt.value);
  1262. model.makeValue("/root/send/execkind",cmb_execkind.value);
  1263. model.makeValue("/root/send/wardcd", model.getValue("/root/temp/wardcd"));
  1264. model.makeValue("/root/send/srchym", model.getValue("/root/temp/srchym"));
  1265. // model.makeValue("/root/main/rechistpntgrup/rechistpntlist["+1+"]", model.getValue(xClsListPath+"["+iRow+"]/hngnm");
  1266. if(submit("TRMNW04005")){
  1267. }
  1268. ipt_execdtrect.value = model.getValue("/root/main/recgrup/rectmaxvallist/execdtrect") ;//최근 저장일을 화면에 표시
  1269. model.setValue("/root/main/hiddengrup/grupcd",model.getValue("/root/main/recgrup/rectmaxvallist/grupcd"));// 등록시 grupcd 를 가지고 마지막 등록값을 가져온다.
  1270. model.setValue("/root/main/hiddengrup/pid",model.getValue("/root/main/recgrup/rectmaxvallist/pid"));// 등록시 pid 를 가지고 마지막 등록값을 가져온다.
  1271. model.setValue("/root/main/hiddengrup/clsflag",model.getValue("/root/main/recgrup/rectmaxvallist/clsflag"));// 등록시 clsflag 를 가지고 마지막 등록값을 가져온다.
  1272. model.setValue("/root/main/hiddengrup/recflag",model.getValue("/root/main/recgrup/rectmaxvallist/recflag"));// 등록시 recflag 를 가지고 마지막 등록값을 가져온다.
  1273. //alert(model.getValue("/root/main/recgrup/rectmaxvallist/grupcd"));
  1274. datagrid2.row = 1;
  1275. rdo_clsflaga.disabled = true ;// 중증도구분 비활성화 시킨다.
  1276. rdo_clsflagb.disabled = true ;// 낙상구분 비활성화 시킨다.
  1277. }
  1278. /**
  1279. * @group :
  1280. * @ver : 2007.06.18
  1281. * @by : 정찬성
  1282. * @---------------------------------------------------
  1283. * @type : function
  1284. * @access : public
  1285. * @desc : 병동내 환자 정보를 조회한다.
  1286. * @param :
  1287. * @return :
  1288. * @---------------------------------------------------
  1289. */
  1290. function fPatientList(){
  1291. model.removenode("/root/send");
  1292. model.makeValue("/root/send/wardcd", model.getValue("/root/main/cond/wardcdgrup/wardcdgruplist/wardcd"));
  1293. model.makeValue("/root/send/srchym", model.getValue("/root/main/cond/srchym"));
  1294. model.removenode("/root/temp");
  1295. model.makeValue("/root/temp/wardcd", model.getValue("/root/main/cond/wardcdgrup/wardcdgruplist/wardcd"));
  1296. model.makeValue("/root/temp/srchym", model.getValue("/root/main/cond/srchym"));
  1297. if(submit("TRMNW04004")){
  1298. //model.copyNode("/root/temp/main", "/root/main");
  1299. //fMakeTreeView();
  1300. }
  1301. datagrid1.row = 1;
  1302. rdo_clsflaga.disabled = true ;// 중증도구분 비활성화 시킨다.
  1303. rdo_clsflagb.disabled = true ;// 낙상구분 비활성화 시킨다.
  1304. }