MMR05800.js 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433
  1. /*
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 마취환자기록 ( SSMMR05800_마취환자기록마스터.xrw - JScript )
  4. - Version :
  5. 1) : Ver.1.00.01 2008-06-23
  6. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  7. */
  8. var instcd = "012";
  9. var anstrecno = "";
  10. var currentdate = "";
  11. var prcpmast_load = "";
  12. var prcpset_load = "";
  13. /**
  14. 수술환자 parameter 구조 : mmohoprs수술예약정보 tbl의 정보를 기본으로 함
  15. var param = 구분자'T' + "▦" +
  16. 등록번호 :=pid + "▦" +
  17. 수술확정일자 :=opcnfmdd + "▦" +
  18. (생성번호) :=cretno + "▦" +
  19. 기관코드 :=instcd + "▦" +
  20. 집도과코드 :=perfdeptcd + "▦" +
  21. 집도의 :=perfdrid + "▦" +
  22. 환자구분 :=patflag + "▦" + ==> 외래(I), 입원(O), DSC(D), 응급(E)
  23. 처리구분'F' + "▦" +
  24. 수술예약번호 :=oprsrvno + "▦" +
  25. 수술이력번호 :=ophistno + "▦" +
  26. 조회일자;
  27. */
  28. /**
  29. * @desc : 폼초기화 ( 마취환자 기록셋 & 기록항목 조회 )
  30. * @
  31. * @param :
  32. * @return :
  33. * @---------------------------------------------------
  34. */
  35. function fFormInit()
  36. {
  37. anstrecno = window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/anstrecno");
  38. // 기록 : default tab 처리
  39. btn_anstrec.dispatch("onclick");
  40. // 현재일시
  41. currentdate = getCurrentDate() + getCurrentTime();
  42. model.setValue("/root/send/reqdata/currentdate" , currentdate);
  43. // 기록 Set 목록
  44. model.setValue("/root/send/reqdata/settype", "R");
  45. submit("TRMMR04204","","/root/send/reqdata", "/root/init/recsetlist/item");
  46. // 기록 Set Code
  47. var recsetcd = window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/recsetcd");
  48. if (recsetcd == "0") { recsetcd = "-1"; }
  49. model.setValue("/root/send/reqdata/recsetcd", recsetcd);
  50. if (recsetcd == "-1") {
  51. // 마취기록 마스터 정보 조회
  52. submit("TRMMR04201");
  53. } else {
  54. model.setValue("/root/send/setinfo/instcd" , instcd);
  55. model.setValue("/root/send/setinfo/settype", "R");
  56. model.setValue("/root/send/setinfo/setcd" , recsetcd);
  57. // 현재일시
  58. currentdate = getCurrentDate() + getCurrentTime();
  59. model.setValue("/root/send/setinfo/currentdate" , currentdate);
  60. // 마취기록 SET 아이템 조회하기..
  61. submit("TRMMR04205");
  62. }
  63. // 그리드를 트리형태로 보여주기..
  64. setTree(grd_recmast , grd_recmast.colref("depth"), grd_recmast.colref("rec"), false);
  65. if (anstrecno != "0")
  66. {
  67. // 마취기록번호
  68. model.setValue("/root/send/reqdata/anstrecno", anstrecno);
  69. // 마취환자 기록 조회
  70. submit("TRMMR03704");
  71. // 마취환자 기록 체킹해주기
  72. fAnstRecChecked("/root/main/anstrec/item", grd_recmast, "recitem", "checked", "rec", "rectype", "recnm", "subrec");
  73. }
  74. }
  75. /**
  76. * @desc : 처방 SET 조회
  77. * @
  78. * @param :
  79. * @return :
  80. * @---------------------------------------------------
  81. */
  82. function fPrcpSetLoad()
  83. {
  84. sw_left1.visible = true;
  85. if (prcpset_load != "Y") {
  86. // 전체 선택을 위한 그리드 셋..
  87. // grd_agent01.fixedcellcheckbox(0,0) = true;
  88. grd_prcpset.fixedcellcheckbox(0,0) = true;
  89. var setclscd = model.getValue("/root/send/reqdata/setclscd");
  90. if (setclscd == "") {
  91. model.setValue("/root/send/reqdata/setclscd","1");
  92. model.refresh();
  93. // 그리드 초기화
  94. if (grd_prcpset.rows> 1) {
  95. grd_prcpset.removeRow();
  96. grd_prcpset.refresh();
  97. }
  98. // 처방 SET 수술별 조회
  99. fComboSetlist();
  100. }
  101. prcpset_load = "Y";
  102. }
  103. }
  104. /**
  105. * @desc : 처방 마스터 조회
  106. * @
  107. * @param :
  108. * @return :
  109. * @---------------------------------------------------
  110. */
  111. function fPrcpMastLoad()
  112. {
  113. sw_left1.visible = true;
  114. if (prcpmast_load != "Y") {
  115. // 용법조회 (주사약)
  116. model.setValue ( "/root/send/req/cond1" , "I");
  117. model.setValue ( "/root/send/req/cond2" , 1);
  118. model.setValue ( "/root/send/req/cond3" , "");
  119. submit("TRMMR03710");
  120. //공통코드 가져오기...
  121. //M0287:drug 소분류
  122. zbcfGetCodeList(new Array("M0287"), new Array("/root/init/M0287"));
  123. // Agent 시작일시, 종료일시 적용을 위한 기본 셋
  124. model.setValue("/root/hidden/agentfromdd", window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/anstfromdd"));
  125. model.setValue("/root/hidden/agentfromtm", window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/anstfromtm"));
  126. model.setValue("/root/hidden/agenttodd" , window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/ansttodd"));
  127. model.setValue("/root/hidden/agenttotm" , window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/ansttotm"));
  128. // 처방마스터 정보 조회
  129. model.setValue("/root/send/reqdata/clscd","");
  130. model.setValue("/root/send/reqdata/prcptype","");
  131. submit("TRMMR04202","","/root/send/reqdata","/root/main/prcpmast/item");
  132. copyNodeset("/root/main/agent/item" , "/root/main/prcpmast/item[prcptype = 'A']");
  133. copyNodeset("/root/main/drug/item" , "/root/main/prcpmast/item[prcptype = 'D']");
  134. copyNodeset("/root/main/fluid/item" , "/root/main/prcpmast/item[prcptype = 'F']");
  135. copyNodeset("/root/main/blod/item" , "/root/main/prcpmast/item[prcptype = 'H']");
  136. copyNodeset("/root/main/proc/item" , "/root/main/prcpmast/item[prcptype = 'P']");
  137. copyNodeset("/root/main/agent01/item", "/root/main/agent/item[clscd = '01']");
  138. copyNodeset("/root/main/agent02/item", "/root/main/agent/item[clscd = '02']");
  139. copyNodeset("/root/main/agent03/item", "/root/main/agent/item[clscd = '03']");
  140. copyNodeset("/root/main/agent04/item", "/root/main/agent/item[clscd = '04']");
  141. // 2008.01.04. drug... 소분류는 "많이쓰는약" 으로 디폴트 처리한다..
  142. model.setValue("/root/send/reqdata/clscd", "01");
  143. model.setValue("/root/send/reqdata/prcptype","D");
  144. submit("TRMMR04202","","/root/send/reqdata","/root/main/drug/item");
  145. // Inhalational Agent : 별도로 (그룹싱글) 조회하여 트리형태로 서브항목을 보여줌
  146. // submit("TRMMR04208","","/root/send/reqdata","/root/main/agent01/item");
  147. // Inhalational Agent : 별도로 Display (항목 선택해 주고, 시작일시, 종료일시 다시 보여주기)
  148. fDisplayAgent01();
  149. // 혈액리스트 조회
  150. fGetBlodList();
  151. prcpmast_load = "Y";
  152. model.refresh();
  153. }
  154. //20131106 Start 처방 검색 후 DRUG가 세팅 안되는 오류 수정
  155. model.resetInstanceNode("/root/send/reqdata/data");
  156. model.resetInstanceNode("/root/main/prcpsearch/item");
  157. model.refresh();
  158. //20131106 End
  159. }
  160. /**
  161. * @desc : Inhalational Agent 인 경우 시작일시, 종료일시 셋해주기
  162. * @
  163. * @param :
  164. * @return :
  165. * @author :
  166. * @---------------------------------------------------
  167. */
  168. function fSetTimeAgent01()
  169. {
  170. model.setValue("/root/hidden/agentfromdd", window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/anstfromdd"));
  171. model.setValue("/root/hidden/agentfromtm", window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/anstfromtm"));
  172. model.setValue("/root/hidden/agenttodd" , window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/ansttodd"));
  173. model.setValue("/root/hidden/agenttotm" , window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/ansttotm"));
  174. model.refresh();
  175. }
  176. /**
  177. * @desc : Inhalational Agent : 별도로 Display (항목 선택해 주고, 시작일시, 종료일시 다시 보여주기)
  178. * @
  179. * @param :
  180. * @return :
  181. * @author :
  182. * @---------------------------------------------------
  183. */
  184. function fDisplayAgent01()
  185. {
  186. var gridObj = grd_agent01;
  187. var dataRef = "/root/main/agent01/item";
  188. // Inhalational Agent 인 경우 시작일시, 종료일시 셋해주기
  189. var agentfromdd = model.getValue("/root/hidden/agentfromdd");
  190. var agentfromtm = model.getValue("/root/hidden/agentfromtm");
  191. var agenttodd = model.getValue("/root/hidden/agenttodd");
  192. var agenttotm = model.getValue("/root/hidden/agenttotm");
  193. var dataCnt = getNodesetCnt(model, dataRef);
  194. for (var i=1 ; i <= dataCnt ; i++) {
  195. gridObj.textMatrix(i,gridObj.colref("drugfromdd")) = agentfromdd;
  196. gridObj.textMatrix(i,gridObj.colref("drugfromtm")) = agentfromtm;
  197. gridObj.textMatrix(i,gridObj.colref("drugtodd")) = agenttodd;
  198. gridObj.textMatrix(i,gridObj.colref("drugtotm")) = agenttotm;
  199. }
  200. var prcpRef = "/root/main/anstprcp/item";
  201. var prcpCnt = getNodesetCnt(window.parent.iv_anstprcp.model, prcpRef);
  202. // 전체 처방목록 중 Agent 의 소분류 01 (Inhalational Agent) 체킹해 주기
  203. if (anstrecno != "0") {
  204. for (var i=1 ; i <= prcpCnt ; i++) {
  205. var prcptype = window.parent.iv_anstprcp.model.getValue(prcpRef+"["+ i +"]/prcptype");
  206. var clscd = window.parent.iv_anstprcp.model.getValue(prcpRef+"["+ i +"]/clscd");
  207. if (prcptype == "A" && clscd == "01") {
  208. var prcpcd = window.parent.iv_anstprcp.model.getValue(prcpRef+"["+ i +"]/prcpcd");
  209. // 처방코드가 있는가?
  210. var dataCnt = getNodesetCnt(model, dataRef+"[prcpcd = '"+ prcpcd +"']");
  211. if (dataCnt > 0) {
  212. model.setValue(dataRef+"[prcpcd = '"+ prcpcd +"']/checked", "true");
  213. var remark = window.parent.iv_anstprcp.model.getValue(prcpRef+"[prcpcd = '"+ prcpcd +"']/remark");
  214. var tmpString = remark.split(".");
  215. if (tmpString.length == 4) {
  216. if (tmpString[0].length != 0) {
  217. window.parent.iv_anstprcp.model.setValue(prcpRef+"[prcpcd = '"+ prcpcd +"']/drugfromdd",tmpString[0].replace(".",""));
  218. }
  219. if (tmpString[1].length != 0) {
  220. window.parent.iv_anstprcp.model.setValue(prcpRef+"[prcpcd = '"+ prcpcd +"']/drugfromtm",tmpString[1].replace(".",""));
  221. }
  222. if (tmpString[2].length != 0) {
  223. window.parent.iv_anstprcp.model.setValue(prcpRef+"[prcpcd = '"+ prcpcd +"']/drugtodd" ,tmpString[2].replace(".",""));
  224. }
  225. if (tmpString[3].length != 0) {
  226. window.parent.iv_anstprcp.model.setValue(prcpRef+"[prcpcd = '"+ prcpcd +"']/drugtotm" ,tmpString[3].replace(".",""));
  227. }
  228. }
  229. }
  230. }
  231. }
  232. }
  233. gridObj.refresh();
  234. model.refresh();
  235. }
  236. /**
  237. * @desc : 저장된 기록 정보를 그리드 트리뷰 에 체킹 표시하고 기록명칭의 추가기록도 보여준다
  238. * @
  239. * @param :
  240. * @
  241. * @return :
  242. * @author :
  243. * @---------------------------------------------------
  244. */
  245. function fAnstRecChecked(dataPath, gridObj, levlColNm, checkedColNm, recColNm, rectypeColNm, recnmColNm, subrecColNm)
  246. {
  247. gridObj.allstyle( "all", "font-weight" ) = "normal";
  248. gridObj.allstyle( "all", "color" ) = "#000000";
  249. for (var i=1 ; i < gridObj.rows ; i++) {
  250. gridObj.textmatrix(i, gridObj.colref(checkedColNm)) = "false";
  251. gridObj.textmatrix(i, gridObj.colref(subrecColNm)) = "";
  252. }
  253. var dataCnt = getNodesetCnt(model, dataPath);
  254. var levlCol = gridObj.colref(levlColNm);
  255. var checkedCol = gridObj.colref(checkedColNm);
  256. var recCol = gridObj.colref(recColNm);
  257. var rectypeCol = gridObj.colref(rectypeColNm);
  258. var recnmCol = gridObj.colref(recnmColNm);
  259. var subrecCol = gridObj.colref(subrecColNm);
  260. //그리드 트리뷰 에 체킹 표시
  261. for (var i = 1 ; i <= dataCnt ; i++) {
  262. var recitem = model.getValue(dataPath + "["+ i + "]/" + levlColNm);
  263. var rectype = model.getValue(dataPath + "["+ i + "]/" + rectypeColNm);
  264. var recnm = model.getValue(dataPath + "["+ i + "]/" + recnmColNm);
  265. var subrec = model.getValue(dataPath + "["+ i + "]/" + subrecColNm);
  266. for (var j=1 ; j < gridObj.rows ; j++) {
  267. var tmplevl = gridObj.textmatrix(j, levlCol);
  268. if (tmplevl == recitem) {
  269. fSetCheckedStyle(gridObj, j, checkedCol, "true");
  270. if (rectype == "R" || rectype == "P") {
  271. if (subrec.length > 0) {
  272. gridObj.textmatrix(j, recCol) = fDisplayRec(recnm, subrec);
  273. gridObj.textmatrix(j, subrecCol) = subrec;
  274. }
  275. }
  276. break;
  277. }
  278. }
  279. }
  280. }
  281. /**
  282. * @desc : 추가기록 정보 보여주기
  283. * @
  284. * @param :
  285. * @
  286. * @return :
  287. * @author :
  288. * @---------------------------------------------------
  289. */
  290. function fDisplayRec(recnm, subrec)
  291. {
  292. var recnmdata = recnm.split("_");
  293. if (recnmdata.length == 2) {
  294. recnm = recnmdata[0].replace("_","") + subrec + recnmdata[1].replace("_","");
  295. } else {
  296. recnm = recnm + " " + subrec;
  297. }
  298. return recnm;
  299. }
  300. /**
  301. * @desc : 저장된 처방 정보를 그리드 에 체킹 표시
  302. * @
  303. * @param :
  304. * @
  305. * @return :
  306. * @author :
  307. * @---------------------------------------------------
  308. */
  309. function fAnstPrcpChecked(dataPath, targetPath, prcpcdColNm, checkedColNm)
  310. {
  311. var dataCnt = getNodesetCnt(model, dataPath)
  312. var targetCnt = getNodesetCnt(model, targetPath)
  313. //그리드 에 체킹 표시
  314. for (var i = 1 ; i <= dataCnt ; i++) {
  315. var prcpcd = model.getValue(dataPath + "["+ i +"]/" + prcpcdColNm);
  316. for (var j=1 ; j < targetCnt ; j++) {
  317. var tmpprcpcd = model.getValue(targetPath + "["+ j +"]/" + prcpcdColNm);
  318. if (tmpprcpcd == prcpcd) {
  319. model.setValue(targetPath + "["+ j +"]/" + checkedColNm, "true");
  320. break;
  321. }
  322. }
  323. }
  324. }
  325. /**
  326. * @desc : 그리드 트리뷰 더블 클릭시 체킹 표시
  327. * @
  328. * @param :
  329. * @
  330. * @return :
  331. * @author :
  332. * @---------------------------------------------------
  333. */
  334. function fRecDbClick(gridObj)
  335. {
  336. // 그리드 트리뷰 더블 클릭시 체킹 토글
  337. var getChecked = model.getValue("/root/main/recmast/item[" + gridObj.row + "]/checked");
  338. if (getChecked == "true") {
  339. getChecked = "false";
  340. } else {
  341. getChecked = "true";
  342. }
  343. model.setValue("/root/main/recmast/item[" + gridObj.row + "]/checked", getChecked);
  344. // 그리드 트리뷰 더블 클릭시 체킹 표시
  345. fSetChecked(gridObj, "depth", "recitem", "suprecitem", "checked");
  346. // 기록 마스터의 체크된 정보를 마취환자 기록 인스턴스에 카피노드 하기..
  347. copyNodeset("/root/main/anstrec/item", "/root/main/recmast/item[checked = 'true']");
  348. // checked "true" 이고 rectype 이 기록(R), 처방(P) 인 경우에만 팝업처리
  349. // checked 가 "true" 인가?
  350. var checked = gridObj.textMatrix(gridObj.row, gridObj.colref("checked"));
  351. if (checked == "true") {
  352. // rectype 이 기록(R), 처방(P) 인가?
  353. var rectype = gridObj.textMatrix(gridObj.row, gridObj.colref("rectype"));
  354. if (rectype == "R") {
  355. // recnm 에 구분자 "_" 가 있는가? 있는 경우에만 추가기록 팝업 보여주기...
  356. var recnm = gridObj.textMatrix(gridObj.row, gridObj.colref("recnm"));
  357. var recnmdata = recnm.split("_");
  358. if (recnmdata.length > 1) {
  359. fAddSubRec();
  360. }
  361. } else if (rectype == "P") {
  362. fOpenRecPrcp();
  363. }
  364. }
  365. }
  366. /**
  367. * @desc : 추가기록 (예 : 몰핀 @ 수량 @ mg. -> 몰핀 45 mg. )
  368. * @
  369. * @param :
  370. * @return :
  371. * @---------------------------------------------------
  372. */
  373. function fAddSubRec()
  374. {
  375. var gridObj = grd_recmast;
  376. // 기록마스터
  377. var ref = "/root/main/recmast/item";
  378. // 선택 Row
  379. var selectedRow = gridObj.row;
  380. model.setValue("/root/hidden/selectedrec", selectedRow);
  381. // checked 가 "true" 인가?
  382. var checked = model.getValue(ref+"["+ selectedRow +"]/checked");
  383. if (checked == "true") {
  384. // subrec (추가기록정보가 있으면 input box에 적어주기
  385. var subrec = model.getValue(ref+"["+ selectedRow +"]/subrec");
  386. model.setValue("/root/hidden/subrec", subrec);
  387. model.refresh();
  388. // 팝업으로 보여주자!!!
  389. fShowWndIptBox("subrec");
  390. } else {
  391. model.setValue("/root/hidden/subrec", "");
  392. model.refresh();
  393. }
  394. }
  395. /**
  396. * @desc : 그리드 트리뷰인 경우 선택에 의해 선택항목 체킹하여 bold체로 표현한다.
  397. * @ checked 가 true 이면 상위항목도 checked 를 true 로 한다.
  398. * @ checked 가 false 이면 하위항목도 checked 를 false 로 한다.
  399. * @param :
  400. * @ gridObj : grid 객체
  401. * @ depthColNm : depth 컬럼 참조
  402. * @ levlColNm : 레벨 컬럼 참조
  403. * @ suplevlColNm : 상위레벨 컬럼 참조
  404. * @ checkedCol : checked 컬럼 참조
  405. * @return :
  406. * @author :
  407. * @---------------------------------------------------
  408. */
  409. function fSetChecked(gridObj, depthColNm, levlColNm, suplevlColNm, checkedColNm)
  410. {
  411. // 선택된 로우에 대한 처리
  412. var depth = gridObj.textmatrix(gridObj.row, gridObj.colref(depthColNm));
  413. var levl = gridObj.textmatrix(gridObj.row, gridObj.colref(levlColNm));
  414. var suplevl = gridObj.textmatrix(gridObj.row, gridObj.colref(suplevlColNm));
  415. var checked = gridObj.textmatrix(gridObj.row, gridObj.colref(checkedColNm));
  416. var checkedCol = gridObj.colref(checkedColNm);
  417. // 선택항목 처리
  418. fSetCheckedStyle(gridObj, gridObj.row, checkedCol, checked);
  419. if (checked == "true") {
  420. for (var i = gridObj.row -1 ; i > 0 ; i--) {
  421. var tmpdepth = gridObj.textmatrix(i, gridObj.colref(depthColNm));
  422. var tmplevl = gridObj.textmatrix(i, gridObj.colref(levlColNm));
  423. var tmpsuplevl = gridObj.textmatrix(i, gridObj.colref(suplevlColNm));
  424. var tmpchecked = gridObj.textmatrix(i, gridObj.colref(checkedColNm));
  425. if (tmpdepth < 1) {
  426. break;
  427. }
  428. if (tmplevl == suplevl) {
  429. if (tmpchecked == checked) {
  430. break;
  431. }
  432. fSetCheckedStyle(gridObj, i, checkedCol, checked);
  433. suplevl = tmpsuplevl;
  434. }
  435. }
  436. } else {
  437. for (var i = gridObj.row+1; i < gridObj.rows; i++) {
  438. var tmpdepth = gridObj.textmatrix(i, gridObj.colref(depthColNm));
  439. var tmplevl = gridObj.textmatrix(i, gridObj.colref(levlColNm));
  440. var tmpsuplevl = gridObj.textmatrix(i, gridObj.colref(suplevlColNm));
  441. if (tmpdepth <= depth) {
  442. break;
  443. }
  444. fSetCheckedStyle(gridObj, i, checkedCol, checked);
  445. }
  446. }
  447. gridObj.refresh();
  448. }
  449. /**
  450. * @desc : 그리드 트리뷰인 경우 선택상태값(true/false)와 표현(bold/normal)을 한다.
  451. * @param :
  452. * @ gridObj : grid 객체
  453. * @ checkedRow : 선택 로우
  454. * @ checkedCol : 선택 컬럼
  455. * @ checked : 선택 상태
  456. * @return :
  457. * @author :
  458. * @---------------------------------------------------
  459. */
  460. function fSetCheckedStyle(gridObj, checkedRow, checkedCol, checked)
  461. {
  462. gridObj.textmatrix(checkedRow, checkedCol) = checked;
  463. if (checked == "true") {
  464. gridObj.rowStyle(checkedRow, "data", "font-weight") = "bold";
  465. gridObj.rowStyle(checkedRow, "data", "color") = "#0000ff";
  466. } else {
  467. gridObj.rowStyle(checkedRow, "data", "font-weight") = "normal";
  468. gridObj.rowStyle(checkedRow, "data", "color") = "#000000";
  469. }
  470. }
  471. /**
  472. * @desc : 처방마스터의 처방코드/처방명 검색
  473. * @param :
  474. * @
  475. * @return :
  476. * @author :
  477. * @---------------------------------------------------
  478. */
  479. function fGetPrcpDrugClscd()
  480. {
  481. var clscd = model.getValue("/root/send/reqdata/clscd");
  482. model.setValue("/root/send/reqdata/clscd", clscd);
  483. model.setValue("/root/send/reqdata/prcptype","D");
  484. submit("TRMMR04202","","/root/send/reqdata","/root/main/drug/item");
  485. }
  486. /**
  487. * @desc : 처방마스터의 처방코드/처방명 검색
  488. * @param :
  489. * @
  490. * @return :
  491. * @author :
  492. * @---------------------------------------------------
  493. */
  494. function fSearchPrcpMast()
  495. {
  496. currentdate = getCurrentDate() + getCurrentTime();
  497. model.setValue("/root/send/reqdata/currentdate", currentdate);
  498. model.setValue("/root/send/reqdata/prcptype", "");
  499. //20131106 이정택 주석처리
  500. //model.setValue("/root/send/reqdata/clscd", "");
  501. var data = model.getValue("/root/send/reqdata/data");
  502. model.setValue("/root/send/reqdata/data", data.toUpperCase());
  503. submit("TRMMR04202", "", "/root/send/reqdata", "/root/main/prcpsearch/item");
  504. model.refresh();
  505. }
  506. /**
  507. * @desc : Agent, Drug, Fluid, Blood, Proc 에서의 처방추가 버튼 클릭
  508. * @param :
  509. * @
  510. * @return :
  511. * @author :
  512. * @---------------------------------------------------
  513. */
  514. function fAddBtnClick(prcptype, clscd)
  515. {
  516. if (prcptype == "A") {
  517. if (clscd == "02") {
  518. fAddAnstPrcp(grd_agent02,"/root/main/agent02/item");
  519. copyNodeset("/root/main/agent02/item", "/root/main/agent/item[clscd = '02']");
  520. } else if (clscd == "03") {
  521. fAddAnstPrcp(grd_agent03,"/root/main/agent03/item");
  522. copyNodeset("/root/main/agent03/item", "/root/main/agent/item[clscd = '03']");
  523. } else if (clscd == "04") {
  524. fAddAnstPrcp(grd_agent04,"/root/main/agent04/item");
  525. copyNodeset("/root/main/agent04/item", "/root/main/agent/item[clscd = '04']");
  526. }
  527. } else if (prcptype == "D") {
  528. fAddAnstPrcp(grd_drug,"/root/main/drug/item");
  529. copyNodeset("/root/main/drug/item" , "/root/main/prcpmast/item[prcptype = 'D']");
  530. // 2008.01.04. drug... 선택한 소분류로 다시 조회하기..
  531. model.setValue("/root/send/reqdata/prcptype","D");
  532. submit("TRMMR04202","","/root/send/reqdata","/root/main/drug/item");
  533. } else if (prcptype == "F") {
  534. fAddAnstPrcp(grd_fluid,"/root/main/fluid/item");
  535. copyNodeset("/root/main/fluid/item" , "/root/main/prcpmast/item[prcptype = 'F']");
  536. } else if (prcptype == "H") {
  537. fAddAnstPrcp(grd_fluid,"/root/main/blod/item");
  538. copyNodeset("/root/main/blod/item" , "/root/main/prcpmast/item[prcptype = 'H']");
  539. } else if (prcptype == "P") {
  540. fAddAnstPrcp(grd_proc,"/root/main/proc/item");
  541. copyNodeset("/root/main/proc/item" , "/root/main/prcpmast/item[prcptype = 'P']");
  542. } else if (prcptype == "S") {
  543. fAddAnstPrcp(grd_prcpset,"/root/main/prcpsetitem/item");
  544. copyNodeset("/root/main/prcpsetitem/item", "/root/main/prcpset/item");
  545. } else if (prcptype == "Z") {
  546. fAddAnstPrcp(grd_search,"/root/main/prcpsearch/item");
  547. //2014/01/03
  548. grd_search.valueMatrix(grd_search.row, grd_search.colRef("checked"))="false";
  549. //2014/01/03
  550. }
  551. model.refresh();
  552. }
  553. /**
  554. * @desc : 처방추가 버튼 클릭시 처방목록에 추가한다.
  555. * @param :
  556. * @
  557. * @return :
  558. * @author :
  559. * @---------------------------------------------------
  560. */
  561. function fAddAnstPrcp(gridObj, ref)
  562. {
  563. // 처방목록 노드
  564. var AddRef = "/root/main/anstprcp/item";
  565. // 노드 갯수를 가져온후 노드 하나를 추가한다.
  566. var dataCnt = getNodesetCnt(window.parent.iv_anstprcp.model, AddRef);
  567. // agent, drug, fluid, blood, prog
  568. for (var i=1 ; i < gridObj.rows ; i++) {
  569. var checked = model.getValue(ref+"[" + i + "]/checked");
  570. if (checked == "true") {
  571. var prcpcd = model.getValue(ref+"[" + i + "]/prcpcd");
  572. if (prcpcd != "" && prcpcd != null) {
  573. var prcpcd = model.getValue(ref+"[" + i + "]/prcpcd");
  574. var prcptype = model.getValue(ref+"[" + i + "]/prcptype");
  575. var clscd = model.getValue(ref+"[" + i + "]/clscd");
  576. var prcpnm = model.getValue(ref+"[" + i + "]/prcpnm");
  577. var abbrnm = model.getValue(ref+"[" + i + "]/abbrnm");
  578. var prcpvol = model.getValue(ref+"[" + i + "]/prcpvol");
  579. var prcpvolunitnm = model.getValue(ref+"[" + i + "]/prcpvolunitnm");
  580. var drugmthdcd = model.getValue(ref+"[" + i + "]/drugmthdcd");
  581. var prcpappyn = model.getValue(ref+"[" + i + "]/prcpappyn");
  582. var totvolyn = model.getValue(ref+"[" + i + "]/totvolyn");
  583. var sortno = model.getValue(ref+"[" + i + "]/sortno");
  584. // 처방목록에 처방코드가 있는가?
  585. var cntprcpcd = getNodesetCnt(window.parent.iv_anstprcp.model, AddRef+"[prcpcd = '" + prcpcd + "']");
  586. if (cntprcpcd > 0 && prcptype != "F") {
  587. messageBox("이미 추가되었습니다. - [" + prcpnm+ "]", "E");
  588. /** 처방은 한번만 한다..................................2007.10.09.
  589. // 처방코드가 있다면 용량만 더하자..
  590. for (var j=1 ; j <= dataCnt ; j++) {
  591. var tmpprcpcd = model.getValue(AddRef+"[" + j + "]/prcpcd");
  592. if (prcpcd == tmpprcpcd) {
  593. var tmpprcpvol = model.getValue(AddRef+"["+ j +"]/prcpvol");
  594. prcpvol = Number(prcpvol) + Number(tmpprcpvol);
  595. model.setValue(AddRef+"["+ j +"]/prcpvol", prcpvol);
  596. break;
  597. }
  598. }
  599. */
  600. } else {
  601. // 처방코드가 없다면 추가하자..
  602. var checkValue = window.parent.iv_anstprcp.model.getValue(AddRef+"["+dataCnt+"]/prcpnm");
  603. if (checkValue != "" || dataCnt == "0") {
  604. dataCnt = dataCnt + 1;
  605. }
  606. // 2008.09.23. 어렵다..
  607. var prcpseqno = 0;
  608. for (var j=1 ; j <= dataCnt ; j++) {
  609. var tmp = window.parent.iv_anstprcp.model.getValue(AddRef+"["+ j +"]/prcpcd");
  610. if (tmp == prcpcd) {
  611. prcpseqno = window.parent.iv_anstprcp.model.getValue(AddRef+"["+ j +"]/prcpseqno");
  612. }
  613. }
  614. prcpseqno = parseInt(prcpseqno) + 1;
  615. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpcd" , prcpcd);
  616. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcptype" , prcptype);
  617. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpvol" , "");
  618. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpvolunitnm" , prcpvolunitnm);
  619. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpvolunitnm2", prcpvolunitnm);
  620. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpnm" , prcpnm);
  621. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/abbrnm" , abbrnm);
  622. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/drugmthdcd" , drugmthdcd);
  623. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/recvol" , "");
  624. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/remark" , "");
  625. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/clscd" , clscd);
  626. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpappyn" , prcpappyn);
  627. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/totvolyn" , totvolyn);
  628. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/sortno" , sortno);
  629. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/pcaflag" , "N");
  630. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/checked" , checked);
  631. // 2008.09.23. 2개이상 처방코드 추가 기록하기.. (fluid일때)
  632. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpseqno" , prcpseqno);
  633. window.parent.iv_anstprcp.model.refresh();
  634. window.parent.javascript.fAddRow(prcptype, prcpcd, sortno, prcpseqno);
  635. }
  636. }
  637. }
  638. }
  639. // 그리드 정렬후 노드셋 정렬
  640. window.parent.iv_anstprcp.window.javascript.fSetAnstPrcp();
  641. // 메인 그리드 정렬
  642. //2014/05/16 이정택 수정
  643. window.parent.javascript.fGridSort();
  644. //2014/05/16 이정택 수정
  645. //2012/12/26 Start 기록 & 처방에서 입력했을시에 오른쪽에 줄 반영
  646. window.parent.javascript.fSetGrdColor();
  647. //2012/12/26 end
  648. }
  649. /**
  650. * @desc : 노드셋 갯수 구하기
  651. * @
  652. * @param :
  653. * @
  654. * @return :
  655. * @author :
  656. * @---------------------------------------------------
  657. */
  658. function getNodeList(strPath) {
  659. var node = instance1.selectNodes(strPath);
  660. if(node == null)
  661. return 0;
  662. return node;
  663. }
  664. /**
  665. * @desc : 마우스 오른쪽 버튼 팝업창
  666. * @
  667. * @param :
  668. * @return :
  669. * @---------------------------------------------------
  670. *
  671. */
  672. function fMouseRghtBtnPopup(gridObj, job)
  673. {
  674. if (event.button == 3) {
  675. if (gridObj.isCell(event.target)) {
  676. if (job == "subrec") {
  677. // checked "true" 이고 rectype 이 기록(R) 인 경우에만 팝업처리
  678. // checked 가 "true" 인가?
  679. var checked = gridObj.textMatrix(gridObj.row, gridObj.colref("checked"));
  680. if (checked == "true") {
  681. // rectype 이 기록(R) 인가?
  682. var rectype = gridObj.textMatrix(gridObj.row, gridObj.colref("rectype"));
  683. if (rectype == "R") {
  684. window.setPopupMenu(true, "/root/hidden/menu2/menu", "label", "func", false);
  685. } else {
  686. window.setPopupMenu(false);
  687. }
  688. } else {
  689. window.setPopupMenu(false);
  690. }
  691. } else if (job == "search") {
  692. // 처방 에서 우클릭시 약품편람 팝업
  693. if (gridObj.row > 0) {
  694. window.setPopupMenu(true, "/root/hidden/menu7/menu", "label", "func", false);
  695. } else {
  696. window.setPopupMenu(false);
  697. }
  698. } else {
  699. window.setPopupMenu(false);
  700. }
  701. } else {
  702. window.setPopupMenu(false);
  703. }
  704. } else {
  705. window.setPopupMenu(false);
  706. }
  707. }
  708. /**
  709. * @desc :마취기록 추가기록의 팝업
  710. * @
  711. * @param :
  712. * @return :
  713. * @---------------------------------------------------
  714. */
  715. function fShowWndIptBox(job)
  716. {
  717. grup_subrec.visible = "false";
  718. if (job == "subrec") {
  719. if (event.clientY < 700) {
  720. grup_subrec.attribute("top") = event.clientY-70;
  721. } else {
  722. grup_subrec.attribute("top") = event.clientY-150;
  723. }
  724. grup_subrec.visible = "true";
  725. }
  726. }
  727. /**
  728. * @desc : 추가기록 내용 마취기록에 적용하기..
  729. * @
  730. * @param :
  731. * @return :
  732. * @---------------------------------------------------
  733. *
  734. */
  735. function fSendSubRec()
  736. {
  737. var gridObj = grd_recmast;
  738. // 기록마스터
  739. var ref = "/root/main/recmast/item";
  740. // 선택 Row
  741. var selectedRow = model.getValue("/root/hidden/selectedrec");
  742. if (selectedRow > 0) {
  743. // checked 가 "true" 인가?
  744. var checked = model.getValue(ref+"["+ selectedRow + "]/checked");
  745. if (checked == "true") {
  746. // rectype 이 기록(R), 처방(P) 인가?
  747. var rectype = model.getValue(ref+"["+ selectedRow + "]/rectype");
  748. if (rectype == "R" || rectype == "P") {
  749. var recnm = gridObj.textmatrix(selectedRow, gridObj.colref("recnm"));
  750. var subrec = model.getValue("/root/hidden/subrec");
  751. gridObj.textmatrix(selectedRow, gridObj.colref("rec")) = fDisplayRec(recnm, subrec);
  752. gridObj.textmatrix(selectedRow, gridObj.colref("subrec")) = subrec;
  753. }
  754. }
  755. }
  756. grup_subrec.visible = "false";
  757. // 기록 마스터의 체크된 정보를 마취환자 기록 인스턴스에 카피노드 하기..
  758. copyNodeset("/root/main/anstrec/item", "/root/main/recmast/item[checked = 'true']");
  759. // 마취기록 체킹해주기
  760. fAnstRecChecked("/root/main/anstrec/item", grd_recmast, "recitem", "checked", "rec", "rectype", "recnm", "subrec");
  761. }
  762. /**
  763. * @group : SET 버튼 클릭시 SET 목록 조회하여 콤보 초기화 or 리셋
  764. * @ver : 2007-08-24
  765. * @by : 이은영
  766. * @---------------------------------------------------
  767. * @type : function
  768. * @access : public
  769. * @desc :
  770. * @---------------------------------------------------
  771. */
  772. function fComboSetlist()
  773. {
  774. var dataCnt = getNodesetCnt(model, "/root/init/setlist/item");
  775. if (dataCnt < 2) {
  776. model.setValue("/root/send/reqdata/settype","P");
  777. submit("TRMMR04204","","/root/send/reqdata","/root/init/setlist/item");
  778. }
  779. // SET 목록 콤보 리셋하기..
  780. var clscd = model.getValue("/root/send/reqdata/setclscd");
  781. model.refresh();
  782. cbo_setlist.choices.itemset.attribute("nodeset") = "/root/init/setlist/item[clscd = '"+ clscd +"']";
  783. cbo_setlist.refresh();
  784. // 콤보에 셋코드를 선택해주기...
  785. model.setValue("/root/send/setinfo/setcd",model.getValue("/root/hidden/prcpsetcd"));
  786. model.refresh();
  787. }
  788. /**
  789. * @group : SET 목록 조회 선택시 SET 아이템 보여주기
  790. * @ver : 2007-08-24
  791. * @by : 이은영
  792. * @---------------------------------------------------
  793. * @type : function
  794. * @access : public
  795. * @desc :
  796. * @---------------------------------------------------
  797. */
  798. function fRecSetItemDisplay()
  799. {
  800. var recsetcd = cbo_recsetlist.value;
  801. window.parent.iv_anstinfo.model.makeValue("/root/main/anstinfo/recsetcd" , model.getValue("/root/send/reqdata/recsetcd"));
  802. model.setValue("/root/send/setinfo/instcd" , instcd);
  803. model.setValue("/root/send/setinfo/settype", "R");
  804. model.setValue("/root/send/setinfo/setcd" , recsetcd);
  805. // 현재일시
  806. currentdate = getCurrentDate() + getCurrentTime();
  807. model.setValue("/root/send/setinfo/currentdate" , currentdate);
  808. if (cbo_recsetlist.value != "-1")
  809. {
  810. // 마취기록 SET 아이템 조회하기..
  811. submit("TRMMR04205");
  812. } else {
  813. // 마취기록 마스터 정보 조회
  814. submit("TRMMR04201");
  815. }
  816. // 그리드를 트리형태로 보여주기..
  817. setTree(grd_recmast , grd_recmast.colref("depth"), grd_recmast.colref("rec"), false);
  818. // 마취환자 기록 체킹해주기
  819. fAnstRecChecked("/root/main/anstrec/item", grd_recmast, "recitem", "checked", "rec", "rectype", "recnm", "subrec");
  820. }
  821. /**
  822. * @group : SET 목록 조회 선택시 SET 아이템 보여주기
  823. * @ver : 2007-08-24
  824. * @by : 이은영
  825. * @---------------------------------------------------
  826. * @type : function
  827. * @access : public
  828. * @desc :
  829. * @---------------------------------------------------
  830. */
  831. function fPrcpSetItemDisplay()
  832. {
  833. model.setValue("/root/send/setinfo/instcd",instcd);
  834. model.setValue("/root/send/setinfo/settype","P");
  835. model.setValue("/root/send/setinfo/setcd",cbo_setlist.value);
  836. // 현재일시
  837. currentdate = getCurrentDate() + getCurrentTime();
  838. model.setValue("/root/send/setinfo/currentdate" , currentdate);
  839. // 마취처방 SET 아이템 조회하기..
  840. submit("TRMMR04206");
  841. //
  842. copyNodeset("/root/main/prcpsetitem/item", "/root/main/prcpset/item");
  843. model.refresh();
  844. }
  845. /**
  846. * @desc : 종료일시 적용 (선택된 Inhalational Agent)
  847. * @
  848. * @param :
  849. * @return :
  850. * @---------------------------------------------------
  851. */
  852. function fSetAnstToDt()
  853. {
  854. // 2007.12.13. 마취시작시간을 확인한다.. 마취시작시간이랑 선택할 시작시간이 같으면 선택시간 변경한다..
  855. var anstfromdt = window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/anstfromdd") + window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/anstfromtm");
  856. //20111103 수정시작
  857. //var agenttodd = window.parent.iv_anstinfo.model.getValue("/root/hidden/agenttodd");
  858. //var agenttotm = window.parent.iv_anstinfo.model.getValue("/root/hidden/agenttotm");
  859. var agenttodd =window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/ansttodd");
  860. var agenttotm =window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/ansttotm");
  861. var todt = agenttodd + agenttotm;
  862. //20111103 수정종료
  863. if (anstfromdt > todt)
  864. {
  865. alert("종료일시가 마취시작일시 보다 작습니다.");
  866. return;
  867. }
  868. // Inhalational Agent
  869. var ref = "/root/main/agent01/item";
  870. var gridObj = grd_agent01;
  871. for (var i=1 ; i < gridObj.rows ; i++) {
  872. var checked = model.getValue(ref +"[" + i + "]/checked");
  873. var depth = model.getValue(ref +"[" + i + "]/depth");
  874. if (checked == "true" && depth == "1") {
  875. gridObj.textMatrix(i, gridObj.colref("drugtodd")) = agenttodd;
  876. gridObj.textMatrix(i, gridObj.colref("drugtotm")) = agenttotm;
  877. }
  878. }
  879. gridObj.rebuild();
  880. model.refresh();
  881. }
  882. /**
  883. * @desc : col = checked : 처방 목록 체크박스 클릭시 처방목록에서 추가/삭제 하고 메인 그리드에서 추가/삭제한다.
  884. * @
  885. * @param :
  886. * @return :
  887. * @---------------------------------------------------
  888. */
  889. function fCheckedPrcpA01(gridObj, ref, row)
  890. {
  891. if (gridObj.col == gridObj.colref("checked")) {
  892. var checked = model.getValue(ref+"["+ row +"]/checked");
  893. var depth = model.getValue(ref+"["+ row +"]/depth");
  894. if (checked == "false" && depth == "1") {
  895. // 처방목록에서 삭제 하시겠습니까?
  896. var result = window.alert("처방목록에서 삭제 하시겠습니까?", "", 4 | 32 | 256);
  897. if (result == 6) { // yes
  898. // 삭제해주자
  899. fDelAnstPrcpA01(gridObj, ref, row);
  900. } else {
  901. model.setValue(ref+"["+ row +"]/checked", "true");
  902. model.refresh();
  903. }
  904. } else if (checked == "true") {
  905. // 추가해주자
  906. fAddAnstPrcpA01(gridObj, ref, row);
  907. }
  908. }
  909. }
  910. /**
  911. * @desc : Agent 마스터 그리드 선택시 전체 처방 목록에 추가한다.
  912. * @ - Agent 의 소분류 01 (Inhalational Agent)
  913. * @ - 전체 처방목록에 있으면 skip
  914. * @param :
  915. * @
  916. * @return :
  917. * @author :
  918. * @---------------------------------------------------
  919. */
  920. function fAddAnstPrcpA01(gridObj, ref, row)
  921. {
  922. var prcpcd = model.getValue(ref+"[" + row + "]/prcpcd");
  923. var prcptype = model.getValue(ref+"[" + row + "]/prcptype");
  924. var clscd = model.getValue(ref+"[" + row + "]/clscd");
  925. var prcpnm = model.getValue(ref+"[" + row + "]/prcpnm");
  926. var abbrnm = model.getValue(ref+"[" + row + "]/abbrnm");
  927. var prcpvol = model.getValue(ref+"[" + row + "]/prcpvol");
  928. var prcpvolunitnm = model.getValue(ref+"[" + row + "]/prcpvolunitnm");
  929. var drugmthdcd = model.getValue(ref+"[" + row + "]/drugmthdcd");
  930. var prcpappyn = model.getValue(ref+"[" + row + "]/prcpappyn");
  931. var totvolyn = model.getValue(ref+"[" + row + "]/totvolyn");
  932. var sortno = model.getValue(ref+"[" + row + "]/sortno");
  933. // 처방목록 노드
  934. var AddRef = "/root/main/anstprcp/item";
  935. // 처방목록에 처방코드가 있는가?
  936. var cntprcpcd = getNodesetCnt(window.parent.iv_anstprcp.model, AddRef+"[prcpcd = '" + prcpcd + "']");
  937. // 처방목록에 처방코드가 없는가? add
  938. if ( cntprcpcd > 0 ) {
  939. alert("이미 추가되었습니다. - [" + prcpnm+ "]");
  940. return;
  941. } else {
  942. // 노드 갯수를 가져온후 노드 하나를 추가한다.
  943. var dataCnt = getNodesetCnt(window.parent.iv_anstprcp.model, AddRef);
  944. var checkValue = window.parent.iv_anstprcp.model.getValue(AddRef+"["+dataCnt+"]/prcpnm");
  945. if (checkValue != "" || dataCnt == "0") {
  946. dataCnt = dataCnt + 1;
  947. }
  948. // 2008.09.23. 어렵다..
  949. var prcpseqno = 0;
  950. for (var j=1 ; j <= dataCnt ; j++) {
  951. var tmp = window.parent.iv_anstprcp.model.getValue(AddRef+"["+ j +"]/prcpcd");
  952. if (tmp == prcpcd) {
  953. prcpseqno = window.parent.iv_anstprcp.model.getValue(AddRef+"["+ j +"]/prcpseqno");
  954. }
  955. }
  956. prcpseqno = parseInt(prcpseqno) + 1;
  957. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpcd" , prcpcd);
  958. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcptype" , prcptype);
  959. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpvol" , "");
  960. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpvolunitnm" , prcpvolunitnm);
  961. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpvolunitnm2", prcpvolunitnm);
  962. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpnm" , prcpnm);
  963. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/abbrnm" , abbrnm);
  964. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/drugmthdcd" , drugmthdcd);
  965. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/recvol" , "");
  966. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/remark" , "");
  967. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/clscd" , clscd);
  968. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpappyn" , prcpappyn);
  969. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/totvolyn" , totvolyn);
  970. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/sortno" , sortno);
  971. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/pcaflag" , "N");
  972. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/checked" , "true");
  973. // 2008.09.23. 2개이상 처방코드 추가 기록하기.. (fluid일때)
  974. window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpseqno" , prcpseqno);
  975. window.parent.iv_anstprcp.model.refresh();
  976. // 그리드 정렬후 노드셋 정렬
  977. window.parent.iv_anstprcp.window.javascript.fSetAnstPrcp();
  978. window.parent.javascript.fAddRow(prcptype, prcpcd, sortno, prcpseqno);
  979. // 메인 그리드 정렬
  980. window.parent.javascript.fGridSort();
  981. // 2008.10.03. 검색에서 찾은 처방코드를 선택해 주자~~
  982. model.setValue("/root/main/agent01/item[prcpcd='" + prcpcd + "']/checked", "true");
  983. }
  984. }
  985. /**
  986. * @desc : Agent 마스터 그리드 선택 취소시 전체 처방 목록에 삭제한다.
  987. * @ - Agent 의 소분류 01 (Inhalational Agent)
  988. * @ - 전체 처방목록에서 del
  989. * @param :
  990. * @
  991. * @return :
  992. * @author :
  993. * @---------------------------------------------------
  994. */
  995. function fDelAnstPrcpA01(gridObj, ref, row)
  996. {
  997. // 처방목록 노드
  998. var DelRef = "/root/main/anstprcp/item";
  999. // 노드 갯수를 가져오기
  1000. var dataCnt = getNodesetCnt(window.parent.iv_anstprcp.model, DelRef);
  1001. var prcpcd = model.getValue(ref+"[" + row + "]/prcpcd");
  1002. // 2008.09.23. 2개이상 처방코드 추가 기록하기.. (fluid일때)
  1003. var prcpseqno = model.getValue(ref+"[" + row + "]/prcpseqno");
  1004. // 처방목록에 처방코드가 있는가? 삭제
  1005. for (var j=1 ; j <= dataCnt ; j++) {
  1006. var tmpprcptype = window.parent.iv_anstprcp.model.getValue(DelRef+"[" + j + "]/prcptype");
  1007. var tmpclscd = window.parent.iv_anstprcp.model.getValue(DelRef+"[" + j + "]/clscd");
  1008. var tmpprcpcd = window.parent.iv_anstprcp.model.getValue(DelRef+"[" + j + "]/prcpcd");
  1009. var tmpprcpseqno= window.parent.iv_anstprcp.model.getValue(DelRef+"[" + j + "]/prcpseqno");
  1010. if (tmpprcptype == "A" && tmpclscd == "01" && tmpprcpcd == prcpcd && tmpprcpseqno == prcpseqno) {
  1011. // 전체 처방목록의 항목 삭제
  1012. window.parent.iv_anstprcp.model.destroy(DelRef+"["+ j +"]");
  1013. window.parent.iv_anstprcp.model.refresh();
  1014. // 투여일시 인스턴스도 삭제
  1015. window.parent.fDestroyAnstItem("root/main/anstitem/item", prcpcd, prcpseqno);
  1016. // 그리드 정렬후 노드셋 정렬
  1017. window.parent.iv_anstprcp.window.javascript.fSetAnstPrcp();
  1018. break;
  1019. }
  1020. }
  1021. }
  1022. /**
  1023. * @desc : Agent 의 소분류 01 (Inhalational Agent) 처방적용유무 "N" 인 경우
  1024. * @ - 그리드 전체선택 (처방목록 add) / 전체선택취소 (처방목록 del)
  1025. * @ - >> 사라진 업무 기능 2007.10.10
  1026. * @param :
  1027. * @
  1028. * @return :
  1029. * @author :
  1030. * @---------------------------------------------------
  1031. */
  1032. function fCheckedAgent01n(flag)
  1033. {
  1034. var gridObj = grd_agent01n;
  1035. var ref = "/root/main/agent01n/item";
  1036. if (flag == "true") {
  1037. for (var i = 1 ; i < gridObj.rows ; i++) {
  1038. var prcpcd = model.getValue(ref+"[" + i + "]/prcpcd");
  1039. // 처방목록 노드
  1040. var AddRef = "/root/main/anstprcp/item";
  1041. // 처방목록에 처방코드가 있는가?
  1042. var cntprcpcd = getNodesetCnt(model, AddRef+"[prcpcd = '" + prcpcd + "']");
  1043. if (cntprcpcd == 0) {
  1044. fAddAnstPrcpA01(gridObj, ref, i);
  1045. }
  1046. }
  1047. }
  1048. if (flag == "false") {
  1049. for (var i = 1 ; i < gridObj.rows ; i++) {
  1050. fDelAnstPrcpA01(gridObj, ref, i);
  1051. }
  1052. }
  1053. }
  1054. /**
  1055. * @group : 혈액리스트 조회
  1056. * @ver : 2007-11-23
  1057. * @by : 이은영
  1058. * @---------------------------------------------------
  1059. * @type : function
  1060. * @access : public
  1061. * @desc :
  1062. * @---------------------------------------------------
  1063. */
  1064. function fGetBlodList()
  1065. {
  1066. //pid = "12158831";
  1067. //ioflag = "o";
  1068. model.makeValue("/root/send/reqdata/pid" , window.parent.iv_anstinfo.window.javascript.pid);
  1069. model.makeValue("/root/send/reqdata/ioflag" , window.parent.iv_anstinfo.window.javascript.ioflag);
  1070. // prcpfromdd, prcptodd (수술예약등록일자, 수술확정일자)
  1071. var prcpfromdd = window.parent.iv_anstinfo.model.getValue("/root/main/oprsrvinfo/rgstdd");
  1072. var prcptodd = window.parent.iv_anstinfo.model.getValue("/root/main/oprsrvinfo/opcnfmdd");
  1073. var ansttodd = window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/ansttodd");
  1074. model.makeValue("/root/send/reqdata/prcpfromdd" ,prcpfromdd);
  1075. model.makeValue("/root/send/reqdata/prcptodd" ,prcptodd);
  1076. model.makeValue("/root/send/reqdata/ansttodd" ,ansttodd);
  1077. // 혈액리스트 조회하기..
  1078. submit("TRMMR03713");
  1079. }
  1080. /**
  1081. * @group : 약품편람 팝업처리
  1082. * @ver : 2007-12-13
  1083. * @by : 이은영
  1084. * @---------------------------------------------------
  1085. * @type : function
  1086. * @access : public
  1087. * @desc :
  1088. * @---------------------------------------------------
  1089. */
  1090. function fDrugInfo() {
  1091. // model.setValue ( "/root/hidden/receivedata/srchdrugcd", "prcpcd" ));
  1092. modal ( "SMADB01900" );
  1093. }
  1094. /**
  1095. * @group : 혈액리스트 더블클릭시 혈액관련 처방항목 체크하여 항목추가한다.
  1096. * @ver : 2007-12-13
  1097. * @by : 이은영
  1098. * @---------------------------------------------------
  1099. * @type : function
  1100. * @access : public
  1101. * @desc :
  1102. * @---------------------------------------------------
  1103. */
  1104. function fSetBlodChecked() {
  1105. if (grd_blodlist.row < 1) {
  1106. return;
  1107. }
  1108. // 혈액리스트에서 선택된 혈액 처방코드를 읽는다.
  1109. var prcpcd = model.getValue("/root/main/blodlist/item[" + grd_blodlist.row + "]/prcpcd");
  1110. // Blood 처방항목리스트
  1111. var ref = "/root/main/blod/item";
  1112. var gridObj = grd_blod;
  1113. for (var i=1 ; i < gridObj.rows ; i++) {
  1114. var tempprcpcd = model.getValue(ref +"[" + i + "]/prcpcd");
  1115. if (tempprcpcd == prcpcd) {
  1116. model.setValue(ref +"[" + i + "]/checked", "true");
  1117. model.refresh();
  1118. break;
  1119. }
  1120. }
  1121. if (i < gridObj.rows) {
  1122. btn_addblod.dispatch("DOMActivate");
  1123. } else {
  1124. alert("마스터에 등록된 혈액종류가 아닙니다.");
  1125. }
  1126. }
  1127. /**
  1128. * @group : 혈액리스트 마우스 우클릭 후 혈액번호 복사 버튼 클릭 시 복사할 대상 행을 체크 할 수 있도록 UI visible
  1129. * @ver : 2010-03-15
  1130. * @by : 주희경
  1131. * @---------------------------------------------------
  1132. * @type : function
  1133. * @access : public
  1134. * @desc :
  1135. * @---------------------------------------------------
  1136. */
  1137. function fSetBlodno()
  1138. {
  1139. model.removeNodeset("/root/temp/blodcopy");
  1140. var rows = parent.grd_prog.rows;
  1141. for(i=1; i<rows; i++)
  1142. {
  1143. model.makeNode("/root/temp/blodcopy["+i+"]/chk");
  1144. model.makeValue("/root/temp/blodcopy["+i+"]/seq", i);
  1145. }
  1146. grd_blodcopylist.rebuild();
  1147. grup_blodcopyform.attribute("visibility") = "visible";
  1148. }
  1149. /**
  1150. * @group : 복사할 대상 행을 체크 하고 확인 버튼을 누르면 progress에 대상 혈액번호를 copy해준다.(single, multi)
  1151. * @ver : 2010-03-15
  1152. * @by : 주희경
  1153. * @---------------------------------------------------
  1154. * @type : function
  1155. * @access : public
  1156. * @desc :
  1157. * @---------------------------------------------------
  1158. */
  1159. function fCopyBlodno()
  1160. {
  1161. grup_blodcopyform.attribute("visibility") = "hidden";
  1162. var seq = model.getValue("/root/temp/blodcopy[chk='true']/seq");
  1163. var blodno = "";
  1164. if (grd_blodlist.selectedRows > 1)
  1165. {
  1166. for(i=0; i<grd_blodlist.selectedRows; i++ )
  1167. {
  1168. blodno = blodno + grd_blodlist.valueMatrix(grd_blodlist.selectedRow(i), grd_blodlist.colref("prepblodseqno")) + ", "
  1169. }
  1170. }
  1171. else
  1172. {
  1173. blodno = grd_blodlist.valueMatrix(grd_blodlist.row, grd_blodlist.colref("prepblodseqno")) + ", ";
  1174. }
  1175. var predata = parent.grd_prog.valueMatrix(seq, parent.grd_prog.colref("progrec"));
  1176. if (predata != "")
  1177. {
  1178. predata = predata + ", ";
  1179. }
  1180. parent.grd_prog.valueMatrix(seq, parent.grd_prog.colref("progrec")) = predata + blodno.substr(0, blodno.length-2);
  1181. parent.grd_prog.resizeCells();
  1182. }