SPMMO01900_복용방법.xrw 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
  3. <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
  4. <xhtml:head>
  5. <xhtml:title>복용방법</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <cond>
  11. <drugindependpackflag>N</drugindependpackflag>
  12. <exptmthdfact>-</exptmthdfact>
  13. <exptmthdfactflag>N</exptmthdfactflag>
  14. </cond>
  15. </main>
  16. <init>
  17. <mthdkind/>
  18. <M0478/>
  19. <mthdtimenm/>
  20. <trgtcd/>
  21. </init>
  22. <send>
  23. <cond1/>
  24. <cond2/>
  25. <mthdtime/>
  26. <mthdtimenm/>
  27. <hardcd/>
  28. </send>
  29. <rateprcpflag>N</rateprcpflag>
  30. <rateprcp>
  31. <rate1/>
  32. <rate2/>
  33. <rate3/>
  34. <rate4/>
  35. <rate5/>
  36. <rate6/>
  37. <rate7/>
  38. <rate8/>
  39. </rateprcp>
  40. <rateflag/>
  41. <tmedmthd>
  42. <tmedmthdlist>
  43. <status/>
  44. <abbrnm/>
  45. <mthdcnts/>
  46. <mthdcd/>
  47. <basecnt/>
  48. <adminpath/>
  49. <mealflag/>
  50. <drdirecyn/>
  51. </tmedmthdlist>
  52. </tmedmthd>
  53. </root>
  54. </instance>
  55. <script type="javascript">
  56. <![CDATA[
  57. var mthdKind = "";
  58. var openerrow = 0;
  59. ]]>
  60. </script>
  61. <script type="javascript" ev:event="xforms-model-construct-done">
  62. <![CDATA[
  63. grd_mthd.backcoloralternate = "transparent";
  64. opener.javascript.setParameter ( "SPMMO01900_prcptims", "" );
  65. opener.javascript.setParameter ( "SPMMO01900_rateprcpflag", "" );
  66. zbcfGetCodeList(new Array("A0017"),new Array("/root/init/mthdkind"), true, new Array("dispseq") ,new Array("asc")); //용법종류
  67. zbcfGetCodeList(new Array("M0478"),new Array("/root/init/M0478")); //용법시간
  68. addComboInstance("/root/init/M0478", "cdid^cdnm", "-^전체", "M0478"); //용법시간 전체항목 추가
  69. cmb_mthdtime.select(0);
  70. var srchRow = opener.javascript.getParameter ( "SPMMO01900_srchRow" );//복용방법이 없을 때 자동팝업
  71. if (isNull(srchRow)) {
  72. if ( opener.grd_prcplist.row == -1) {
  73. openerrow = 1;
  74. } else {
  75. openerrow = opener.grd_prcplist.row;
  76. }
  77. } else {
  78. openerrow = srchRow;
  79. document.title = document.title + "[" + opener.model.getValue( "/root/main/prcp/prcplist[" + openerrow +"]/prcpcd") + " : " + opener.model.getValue( "/root/main/prcp/prcplist[" + openerrow +"]/orgprcpnm") + "]";
  80. }
  81. var prcptims = opener.model.getValue( "/root/main/prcp/prcplist[" + openerrow +"]/prcptims");
  82. var tempcol2 = opener.model.getValue( "/root/main/prcp/prcplist[" + openerrow +"]/tempcol2");//수익분류
  83. if ( prcptims == 1 ) {
  84. checkbox1.disabled = true;
  85. }
  86. if ( isNull(prcptims)) prcptims = 1;
  87. var prcpclscd = opener.model.getValue( "/root/main/prcp/prcplist[" + openerrow +"]/prcpclscd");
  88. if ( prcpclscd == "A2" ) {
  89. mthdKind = "N";
  90. rdo_mthdkind.disabled = true;
  91. }
  92. if ( prcpclscd == "A4" ) {
  93. //비율은 내복약만 쓴다.
  94. rdo_baseqty.disabled = true;
  95. group1.visible = false;
  96. mthdKind = "Y"
  97. model.setValue("/root/send/hardcd",99);
  98. if(submit("TRMMB04103", false)) {
  99. if ( !isNull(model.getValue("/root/init/hardcd/hardcd[hardcd='" + tempcol2 + "']/hardcd"))) {
  100. mthdKind = "O";
  101. }
  102. model.removeNodeset ( "/root/init/hardcd/hardcd" );
  103. }
  104. }
  105. if ( prcpclscd == "A6" ) {
  106. mthdKind = "I"
  107. //비율은 내복약만 쓴다.
  108. group1.visible = false;
  109. //주사는 횟수가 무조건 1이다.
  110. prcptims = "1"
  111. rdo_baseqty.disabled = true;
  112. rdo_mthdkind.disabled = true;
  113. }
  114. model.setValue( "/root/send/cond1", mthdKind );
  115. if ( prcpclscd != "A2" ) {
  116. //경구약이 아닌경우에는 회수는 필요없다.
  117. model.setValue( "/root/send/cond2", "" );
  118. } else {
  119. model.setValue( "/root/send/cond2", prcptims );
  120. }
  121. //예외 용법 설정된 경우, 용법창에 표시
  122. //2008. 08. 06 오지훈
  123. var exptmthdfact = opener.model.getValue("/root/main/prcp/prcplist[" + openerrow + "]/exptmthdfact");
  124. if(exptmthdfact != "-" && exptmthdfact != ""){ //값이 default 또는 없는 경우
  125. ipt_exptmthdfact.disabled = false;
  126. model.setValue("/root/main/cond/exptmthdfact", exptmthdfact);
  127. bool1.value = "Y";
  128. }else{
  129. ipt_exptmthdfact.disabled = true;
  130. }
  131. //따로포장 값 설정된경우 표시되도록. by sonjy 20081112
  132. var drugindependpackflag = opener.model.getValue("/root/main/prcp/prcplist[" + openerrow + "]/drugindependpackflag");
  133. if( drugindependpackflag == "Y" ){
  134. model.setValue("/root/main/cond/drugindependpackflag" , drugindependpackflag);
  135. }
  136. var rateprcpflag = opener.model.getValue ( "/root/main/prcp/prcplist[" + openerrow + "]/rateprcpflag");
  137. if ( rateprcpflag == "N" || isNull(rateprcpflag)) {
  138. input1.disabled = true;
  139. input2.disabled = true;
  140. input3.disabled = true;
  141. input4.disabled = true;
  142. input5.disabled = true;
  143. input6.disabled = true;
  144. input7.disabled = true;
  145. input8.disabled = true;
  146. } else {
  147. model.setValue ( "/root/rateflag", "Y" );
  148. checkbox1.item(0).attribute("color") = "#ff0000";
  149. checkbox1.item(0).attribute("font-weight") = "bold";
  150. var drugrateqty = opener.model.getValue( "/root/main/prcp/prcplist[" + openerrow + "]/drugrateqty") + "^";
  151. var cnt = 0;
  152. var childCnt = group1.children.length;
  153. var childObj;
  154. for( var i = 0; i < childCnt; i++ ) {
  155. childOb = group1.children.item(i)
  156. if( childOb.elementName == "xforms:input") {
  157. if ( cnt < eval(prcptims)) {
  158. childOb.disabled = false;
  159. childOb.value = getArrayData (drugrateqty, 0, cnt, "^", "|" );
  160. } else {
  161. childOb.disabled = true;
  162. }
  163. cnt++;
  164. }
  165. }
  166. }
  167. model.setValue("/root/send/mthdtimenm", cmb_mthdtime.label);
  168. if(submit("TRMMO01901")){
  169. }
  170. var mthdcd = opener.model.getValue ( "/root/main/prcp/prcplist[" + openerrow + "]/drugmthdspccd" );
  171. for ( var i=1; i < grd_mthd.rows; i++ ) {
  172. if ( mthdcd == model.getValue ( "/root/tmedmthd/tmedmthdlist[" + i +"]/mthdcd")) {
  173. grd_mthd.row = i;
  174. grd_mthd.toprow = i;
  175. model.setValue ( "/root/tmedmthd/tmedmthdlist[" + i + "]/status", "Y" );
  176. }
  177. }
  178. model.setValue("/root/send/hardcd", 45);
  179. submit("TRMMB04103", false);
  180. ]]>
  181. </script>
  182. <submission id="TRZBC00101" mediatype="application/x-www-form-urlencoded" method="post"/>
  183. <submission id="TRMMO01901" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/tmedmthd"/>
  184. <submission id="TRZBC00102" mediatype="application/x-www-form-urlencoded" method="post" replace="instance"/>
  185. <submission id="TRMMB04103" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/init/trgtcd"/>
  186. </model>
  187. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  188. <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
  189. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  190. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  191. <script type="javascript" src="../../../emr/prcpmngtweb/js/MMO001.js"/>
  192. <script type="javascript" src="../../../emr/prcpmngtweb/js/SMMMO00100.js"/>
  193. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  194. </xhtml:head>
  195. <xhtml:body pagewidth="595" pageheight="620">
  196. <shape id="roundrect5" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:6px; top:5px; width:582px; height:90px; background-color:#fffbf2; border-color:#ffd799; "/>
  197. <select1 id="rdo_mthdkind" ref="/root/send/cond1" appearance="full" cols="5" rows="1" overflow="visible" style="left:117px; top:69px; width:460px; height:20px; border-style:none; ">
  198. <choices>
  199. <itemset nodeset="/root/init/mthdkind/A0017">
  200. <label ref="cdnm"/>
  201. <value ref="cdid"/>
  202. </itemset>
  203. </choices>
  204. <script type="javascript" ev:event="xforms-select">
  205. <![CDATA[
  206. var prcpclscd = opener.model.getValue( "/root/main/prcp/prcplist[" + openerrow +"]/prcpclscd");
  207. if ( prcpclscd == "A4" ) {
  208. bmthdKind = model.getValue( "/root/send/cond1" );
  209. if ( bmthdKind == "N" || bmthdKind == "I" ) {
  210. messageBox ( "선택할 수 없는 용법종류", "E008" );
  211. model.setValue( "/root/send/cond1", mthdKind );
  212. model.refresh();
  213. return;
  214. } else {
  215. //submit parameter로 용법시간명 추가 2008.06.09 오지훈
  216. model.setValue("/root/init/mthdtimenm", cmb_mthdtime.label);
  217. submit ( "TRMMO01901" );
  218. }
  219. }
  220. ]]>
  221. </script>
  222. </select1>
  223. <button id="button1" class="btn4_letter2" style="left:468px; top:568px; width:56px; height:22px; ">
  224. <caption>선택</caption>
  225. <script type="javascript" ev:event="DOMActivate">
  226. <![CDATA[
  227. var drugrateqty = "";
  228. var cnt = 0;
  229. if ( (!input1.disabled && isNull(input1.value)) ||
  230. (!input2.disabled && isNull(input2.value)) ||
  231. (!input3.disabled && isNull(input3.value)) ||
  232. (!input4.disabled && isNull(input4.value)) ||
  233. (!input5.disabled && isNull(input5.value)) ||
  234. (!input6.disabled && isNull(input6.value)) ||
  235. (!input7.disabled && isNull(input7.value)) ||
  236. (!input8.disabled && isNull(input8.value))) {
  237. messageBox ( "비율처방 값을 모두 입력해 주십시오.", "E" );
  238. return;
  239. }
  240. if ( !isNull(input1.value)) drugrateqty = drugrateqty + input1.value + "|";
  241. if ( !isNull(input2.value)) drugrateqty = drugrateqty + input2.value + "|";
  242. if ( !isNull(input3.value)) drugrateqty = drugrateqty + input3.value + "|";
  243. if ( !isNull(input4.value)) drugrateqty = drugrateqty + input4.value + "|";
  244. if ( !isNull(input5.value)) drugrateqty = drugrateqty + input5.value + "|";
  245. if ( !isNull(input6.value)) drugrateqty = drugrateqty + input6.value + "|";
  246. if ( !isNull(input7.value)) drugrateqty = drugrateqty + input7.value + "|";
  247. if ( !isNull(input8.value)) drugrateqty = drugrateqty + input8.value + "|";
  248. if (!isNull(drugrateqty)) {
  249. drugrateqty = drugrateqty.substring ( 0, drugrateqty.length -1 );
  250. opener.model.setValue ( "/root/main/prcp/prcplist[" + openerrow + "]/drugrateqty", drugrateqty );
  251. }
  252. var drugmthdspccdnm = "";
  253. var drugmthdspccd = "";
  254. var prcpvol = 0;
  255. var prcpqty = 0;
  256. var prcptims = 0;
  257. var bfprcpqty = 0;
  258. var bfprcptims = 0;
  259. var gridchkflag ;
  260. if ( grd_mthd.row < 1 && bool1.value != "Y") {
  261. messageBox ( "선택된 복용방법이", "I004" );
  262. return;
  263. }
  264. for ( var i = 1; i < grd_mthd.rows; i++ ) {
  265. if ( model.getValue ( "/root/tmedmthd/tmedmthdlist[" + i + "]/status") == "Y" ) {
  266. gridchkflag = "Y" ;
  267. //복용방법 중 안과용법이 선택된 경우, 시행부서를 특수조제실로 설정
  268. //2008. 08. 04 오지훈
  269. var mthdcd = model.getValue("/root/tmedmthd/tmedmthdlist[" + grd_mthd.row + "]/mthdcd");
  270. var hardcd = model.getValue("/root/init/hardcd/hardcd[hardcd='" + mthdcd + "']/hardcd");
  271. if(hardcd != ""){
  272. opener.model.setValue("/root/main/prcp/prcplist[" + openerrow + "]/prcpexecdeptcd", "3240807000");
  273. }
  274. drugmthdspccdnm = model.getValue ( "/root/tmedmthd/tmedmthdlist[" + grd_mthd.row + "]/abbrnm" );
  275. drugmthdspccd = model.getValue ( "/root/tmedmthd/tmedmthdlist[" + grd_mthd.row +"]/mthdcd" );
  276. exptmthdfact = model.getValue("/root/main/cond/exptmthdfact");
  277. drugindependpackflag = model.getValue("/root/main/cond/drugindependpackflag");
  278. //예외용법을 선택한 경우, 용법 코드에 예외용법코드(ZZZ)를 설정한다.
  279. if(bool1.value == "Y"){
  280. drugmthdspccd = "ZZZ";
  281. drugmthdspccdnm = ipt_exptmthdfact.currentText;
  282. }
  283. if (opener.model.getvalue ( "/root/main/prcp/prcplist[" + openerrow + "]/prcpclscd" ) == "A6" ) {
  284. opener.model.setValue ( "/root/main/prcp/prcplist[" + openerrow + "]/drugmthdspccdnm" , drugmthdspccdnm );
  285. opener.model.setValue ( "/root/main/prcp/prcplist[" + openerrow + "]/drugmthdspccd" , drugmthdspccd );
  286. window.close();
  287. return;
  288. }
  289. prcptims = eval(grd_mthd.valueMatrix(grd_mthd.row,3));
  290. var drugrateqty = opener.model.getValue( "/root/main/prcp/prcplist[" + openerrow + "]/drugrateqty") + "^";
  291. var drugcnt = 0;
  292. var childCnt = group1.children.length;
  293. var childObj;
  294. if ( model.getValue ( "/root/rateflag" ) == "Y" ) {
  295. prcpqty = 0;
  296. for( var j = 0; j < childCnt; j++ ) {
  297. childOb = group1.children.item(j)
  298. if( childOb.elementName == "xforms:input") {
  299. if (drugcnt < eval(prcptims)) {
  300. prcpqty = prcpqty + eval(childOb.value);
  301. }
  302. drugcnt++;
  303. }
  304. }
  305. //비율처방일 때는 수량, 용량을 setValue 한다.
  306. if ( isNull(model.getValue ( "/root/chkflag/drugmthdspccd" ))) { //일괄입력은 용량을 계산하지 않는다.
  307. prcpvol = eval(opener.model.getvalue ( "/root/main/prcp/prcplist[" + openerrow + "]/prcpvol" ));
  308. bfprcpqty = eval(opener.model.getvalue ( "/root/main/prcp/prcplist[" + openerrow + "]/prcpqty" ));
  309. bfprcptims = eval(opener.model.getvalue ( "/root/main/prcp/prcplist[" + openerrow + "]/prcptims" ));
  310. if ( bfprcpqty != prcpqty ) {
  311. if ( messageBox ( "입력한 비율처방 수량이 원래수량과 틀립니다." , "Q009" ) == 7 ) {
  312. return;
  313. }
  314. }
  315. var calcprcpvol = prcpqty / bfprcpqty * prcpvol ;
  316. if ( calcprcpvol.toString().indexOf(".") >= 0 ) {
  317. calcprcpvol = calcprcpvol * 1000;
  318. calcprcpvol = Math.round(calcprcpvol);
  319. calcprcpvol = calcprcpvol / 1000;
  320. }
  321. opener.model.setvalue ( "/root/main/prcp/prcplist[" + openerrow + "]/prcpvol", calcprcpvol );
  322. }
  323. opener.model.setValue ( "/root/main/prcp/prcplist[" + openerrow + "]/prcpqty" , prcpqty );
  324. } else {
  325. opener.model.setValue ( "/root/main/prcp/prcplist[" + openerrow + "]/drugrateqty" , "-" );
  326. }
  327. opener.model.setValue ( "/root/main/prcp/prcplist[" + openerrow + "]/prcptims" , prcptims );
  328. }
  329. }
  330. //예외용법을 선택한 경우, 용법 코드에 예외용법코드(ZZZ)를 설정한다.
  331. if(bool1.value == "Y"){
  332. gridchkflag = "Y" ;
  333. drugmthdspccd = "ZZZ";
  334. drugmthdspccdnm = ipt_exptmthdfact.currentText;
  335. }
  336. opener.model.setValue ( "/root/main/prcp/prcplist[" + openerrow + "]/drugmthdspccdnm" , drugmthdspccdnm );
  337. opener.model.setValue ( "/root/main/prcp/prcplist[" + openerrow + "]/drugmthdspccd" , drugmthdspccd );
  338. //예외용법 및 따로포장 설정, 2008. 06. 02 오지훈
  339. exptmthdfact = model.getValue("/root/main/cond/exptmthdfact");
  340. drugindependpackflag = model.getValue("/root/main/cond/drugindependpackflag");
  341. if(exptmthdfact != "-"){
  342. opener.model.setValue ( "/root/main/prcp/prcplist[" + openerrow + "]/exptmthdfact" , exptmthdfact);
  343. opener.model.setValue ( "/root/main/prcp/prcplist[" + openerrow + "]/drugmthdspccdnm" , exptmthdfact);
  344. }else{
  345. opener.model.setValue ( "/root/main/prcp/prcplist[" + openerrow + "]/exptmthdfact" , "-");
  346. }
  347. //if(drugindependpackflag != "N"){ by sonjy 막음처리 20081112 따로포장값이 선택한대로 보여지지 않고 설정되지 않는오류 처리
  348. opener.model.setValue ( "/root/main/prcp/prcplist[" + openerrow + "]/drugindependpackflag", drugindependpackflag);
  349. //}
  350. //약일괄입력을 위해 추가
  351. opener.javascript.setParameter ( "SPMMO01900_prcptims", "Y" );
  352. if ( model.getValue ( "/root/rateflag" ) == "Y" ) {
  353. opener.javascript.setParameter ( "SPMMO01900_rateprcpflag", "Y" );
  354. opener.model.setValue ( "/root/main/prcp/prcplist[" + openerrow + "]/rateprcpflag", "Y" );
  355. } else {
  356. opener.javascript.setParameter ( "SPMMO01900_rateprcpflag", "N" );
  357. opener.model.setValue ( "/root/main/prcp/prcplist[" + openerrow + "]/rateprcpflag", "N" );
  358. }
  359. if ( gridchkflag == "Y" || bool2.value == "Y") {
  360. gGridUpdateChk("per", openerrow, "child");
  361. }
  362. window.close();
  363. ]]>
  364. </script>
  365. </button>
  366. <button id="button2" class="btn4_letter2" style="left:527px; top:568px; width:56px; height:22px; ">
  367. <caption>취소</caption>
  368. <script type="javascript" ev:event="onclick">
  369. <![CDATA[
  370. //약일괄입력을 위해 추가
  371. opener.javascript.setParameter ( "SPMMO01900_prcptims", "N" );
  372. opener.javascript.setParameter ( "SPMMO01900_rateprcpflag", "N" );
  373. window.close();
  374. ]]>
  375. </script>
  376. </button>
  377. <caption id="caption3" class="tit_2" style="left:7px; top:99px; width:171px; height:13px; ">복용방법 List</caption>
  378. <line id="line7" class="line_1" style="x1:7px; y1:114px; x2:588px; y2:114px; "/>
  379. <select1 id="rdo_baseqty" ref="/root/send/cond2" appearance="full" cols="6" overflow="visible" style="left:117px; top:16px; width:275px; height:19px; border-style:none; ">
  380. <choices>
  381. <item>
  382. <label>1회</label>
  383. <value>1</value>
  384. </item>
  385. <item>
  386. <label>2회</label>
  387. <value>2</value>
  388. </item>
  389. <item>
  390. <label>3회</label>
  391. <value>3</value>
  392. </item>
  393. <item>
  394. <label>4회</label>
  395. <value>4</value>
  396. </item>
  397. <item>
  398. <label>5회이상</label>
  399. <value>5</value>
  400. </item>
  401. </choices>
  402. <script type="javascript" ev:event="xforms-select">
  403. <![CDATA[
  404. if ( rdo_baseqty.value == 1 ) {
  405. model.setValue ( "/root/rateflag", "" );
  406. //checkbox1.disabled = true;
  407. } else {
  408. //checkbox1.disabled = false;
  409. }
  410. //checkbox1.dispatch ( "xforms-value-changed" );
  411. //submit parameter로 용법시간명 추가 2008.06.09 오지훈
  412. model.setValue("/root/send/mthdtimenm", cmb_mthdtime.label);
  413. submit ( "TRMMO01901" );
  414. ]]>
  415. </script>
  416. </select1>
  417. <caption id="caption4" class="search_name" style="left:27px; top:15px; width:90px; height:17px; ">기본종류 :</caption>
  418. <caption id="caption5" class="search_name" style="left:27px; top:69px; width:86px; height:17px; ">용법종류 :</caption>
  419. <datagrid id="grd_mthd" nodeset="/root/tmedmthd/tmedmthdlist" caption="^복용방법코드^복용방법^횟수" colsep="^" colwidth="0, 100, 425, 40" ellipsis="true" extendlastcol="scroll" mergecellsfixedrows="bycolrec" rowsep="|" tooltip="true" style="left:7px; top:118px; width:581px; height:405px; ">
  420. <col checkvalue="Y,N" ref="status" type="checkbox">
  421. <script type="javascript" ev:event="xforms-value-changed">
  422. <![CDATA[
  423. /*if ( grd_mthd.valueMatrix ( grd_mthd.row,0 ) == "Y" ) {
  424. for ( var i = 1; i < grd_mthd.rows; i++ ) {
  425. if ( grd_mthd.valueMatrix ( i, 0 ) == "Y" && i != grd_mthd.row ) {
  426. grd_mthd.valueMatrix ( i, 0 ) = "N";
  427. }
  428. }
  429. if ( checkbox1.value == "Y" ) {
  430. var cnt = 0 ;
  431. var childCnt = group1.children.length;
  432. var disableCnt = grd_mthd.valueMatrix ( grd_mthd.row,3 );
  433. var childObj;
  434. for( var i = 0; i < childCnt; i++ ) {
  435. childOb = group1.children.item(i)
  436. if( childOb.elementName == "xforms:input") {
  437. if ( cnt < disableCnt )
  438. childOb.disabled = false;
  439. else {
  440. childOb.disabled = true;
  441. childOb.value = "";
  442. }
  443. cnt++;
  444. }
  445. }
  446. }
  447. }*/
  448. ]]>
  449. </script>
  450. </col>
  451. <col ref="mthdcd" style="text-align:left; "/>
  452. <col ref="abbrnm"/>
  453. <col ref="basecnt" style="text-align:center; "/>
  454. <script type="javascript" ev:event="ondblclick">
  455. <![CDATA[
  456. //if( grd_mthd.isCell(event.target) && grd_mthd.row >= grd_mthd.fixedRows ){
  457. //예외 용법이 선택된 경우, 일반용법을 선택할 수 없도록 처리
  458. //2008. 08. 06
  459. if(isDataCell()){
  460. if(bool1.value == "Y"){
  461. messageBox("예외 용법이 선택된 경우, 일반용법을 선택", "E001");
  462. return;
  463. }else{
  464. model.setValue ( "/root/tmedmthd/tmedmthdlist[" + grd_mthd.row + "]/status", "Y" );
  465. button1.dispatch ( "DOMActivate" );
  466. }
  467. }
  468. ]]>
  469. </script>
  470. <script type="javascript" ev:event="onclick">
  471. <![CDATA[
  472. if(isDataCell()){
  473. model.setValue ( "/root/tmedmthd/tmedmthdlist[" + grd_mthd.row + "]/status", "Y" );
  474. for ( var i = 1; i < grd_mthd.rows; i++ ) {
  475. var status = model.getValue ( "/root/tmedmthd/tmedmthdlist[" + i + "]/status" );
  476. if ( status == "Y" && i != grd_mthd.row ) {
  477. model.setValue ( "/root/tmedmthd/tmedmthdlist[" + i+ "]/status", "N" );
  478. }
  479. }
  480. if ( checkbox1.value == "Y" ) {
  481. var cnt = 0 ;
  482. var childCnt = group1.children.length;
  483. var disableCnt = model.getValue ( "/root/tmedmthd/tmedmthdlist[" + grd_mthd.row + "]/basecnt" );
  484. var childObj;
  485. for( var i = 0; i < childCnt; i++ ) {
  486. childOb = group1.children.item(i);
  487. if( childOb.elementName == "xforms:input") {
  488. if ( cnt < disableCnt ) {
  489. childOb.disabled = false;
  490. } else {
  491. childOb.disabled = true;
  492. childOb.value = "";
  493. }
  494. cnt++;
  495. }
  496. }
  497. }
  498. }
  499. model.refresh();
  500. ]]>
  501. </script>
  502. </datagrid>
  503. <group id="group1" visibility="hidden" style="left:5px; top:576px; width:390px; height:30px; ">
  504. <input id="input1" ref="/root/rateprcp/rate1" maxlength=".3" format="#.###" style="left:95px; top:5px; width:30px; height:19px; "/>
  505. <input id="input2" ref="/root/rateprcp/rate2" maxlength=".3" format="#.###" style="left:130px; top:5px; width:30px; height:19px; "/>
  506. <input id="input3" ref="/root/rateprcp/rate3" maxlength=".3" format="#.###" style="left:163px; top:5px; width:30px; height:19px; "/>
  507. <input id="input4" ref="/root/rateprcp/rate4" maxlength=".3" format="#.###" style="left:197px; top:5px; width:30px; height:19px; "/>
  508. <input id="input5" ref="/root/rateprcp/rate5" maxlength=".3" format="#.###" style="left:231px; top:5px; width:30px; height:19px; "/>
  509. <input id="input6" ref="/root/rateprcp/rate6" maxlength=".3" format="#.###" style="left:264px; top:5px; width:30px; height:19px; "/>
  510. <input id="input7" ref="/root/rateprcp/rate7" maxlength=".3" format="#.###" style="left:297px; top:5px; width:30px; height:19px; "/>
  511. <input id="input8" ref="/root/rateprcp/rate8" maxlength=".3" format="#.###" style="left:331px; top:5px; width:30px; height:19px; "/>
  512. <select id="checkbox1" ref="/root/rateflag" overflow="visible" appearance="full" style="left:13px; top:5px; width:72px; height:18px; vertical-align:middle; ">
  513. <choices>
  514. <item>
  515. <label>비율처방</label>
  516. <value>Y</value>
  517. </item>
  518. </choices>
  519. <script type="javascript" ev:event="xforms-value-changed">
  520. <![CDATA[
  521. if ( checkbox1.value == "Y" ) {
  522. var basecnt = model.getValue ( "/root/tmedmthd/tmedmthdlist[status='Y']/basecnt" );
  523. if ( grd_mthd.row < 1 ) {
  524. messageBox ( "복용방법을 선택하여 주십시오.", "E" );
  525. model.setValue("/root/rateflag", "");
  526. checkbox1.refresh();
  527. } else {
  528. checkbox1.item(checkbox1.focusIndex).attribute("color") = "#ff0000";
  529. checkbox1.item(checkbox1.focusIndex).attribute("font-weight") = "bold";
  530. checkbox1.attribute ( "font-weight" ) = "bold";
  531. var cnt = 0;
  532. var childCnt = group1.children.length;
  533. var childObj;
  534. for( var i = 0; i < childCnt; i++ ) {
  535. childOb = group1.children.item(i)
  536. if( childOb.elementName == "xforms:input") {
  537. if ( cnt < eval(basecnt) ) {
  538. childOb.disabled = false;
  539. }else {
  540. childOb.disabled = true;
  541. childOb.value = "";
  542. }
  543. cnt++;
  544. }
  545. }
  546. }
  547. } else {
  548. checkbox1.item(checkbox1.focusIndex).attribute("color") = "#000000";
  549. checkbox1.item(checkbox1.focusIndex).attribute("font-weight") = "normal";
  550. var childCnt = group1.children.length;
  551. var childObj;
  552. for( var i = 0; i < childCnt; i++ ) {
  553. childOb = group1.children.item(i)
  554. if( childOb.elementName == "xforms:input") {
  555. childOb.disabled = true;
  556. childOb.value = "";
  557. }
  558. }
  559. }
  560. ]]>
  561. </script>
  562. </select>
  563. <script type="javascript" ev:event="onkeyup">
  564. <![CDATA[
  565. if(event.keyCode == "13") {
  566. var childCnt = group1.children.length;
  567. var childObj;
  568. for( var i = 0; i < childCnt; i++ ) {
  569. if ( event.target == "input1" ) {
  570. model.setFocus ( "input2" );
  571. } else if ( event.target == "input2" ) {
  572. model.setFocus ( "input3" );
  573. } if ( event.target == "input3" ) {
  574. model.setFocus ( "input4" );
  575. } if ( event.target == "input4" ) {
  576. model.setFocus ( "input5" );
  577. } if ( event.target == "input5" ) {
  578. model.setFocus ( "input6" );
  579. } if ( event.target == "input6" ) {
  580. model.setFocus ( "input7" );
  581. } if ( event.target == "input7" ) {
  582. model.setFocus ( "input8" );
  583. }
  584. }
  585. }
  586. ]]>
  587. </script>
  588. </group>
  589. <bool id="bool1" checkvalue="Y,N" ref="/root/main/cond/exptmthdfactflag" style="left:0px; top:527px; width:35px; height:20px; ">
  590. <script type="javascript" ev:event="xforms-value-changed">
  591. <![CDATA[
  592. var exptmthdfactflag = model.getValue("/root/main/cond/exptmthdfactflag");
  593. if(exptmthdfactflag == "Y"){
  594. var sPrcpgenrFlag = opener.model.getValue( "/root/main/prcp/prcplist[" + openerrow + "]/prcpgenrflag") ;
  595. var sPrcpClscd = opener.model.getValue( "/root/main/prcp/prcplist[" + openerrow + "]/prcpclscd") ;
  596. var sPrcpKindcd = opener.model.getValue( "/root/main/prcp/prcplist[" + openerrow + "]/prcpkindcd") ;
  597. if( sPrcpgenrFlag != "O" && sPrcpgenrFlag != "S" && sPrcpKindcd != "50" && sPrcpKindcd != "50" && sPrcpKindcd != "50") {
  598. if(sPrcpClscd == "A2" || sPrcpClscd == "A4" || sPrcpClscd == "A6") {
  599. model.setValue("/root/main/cond/exptmthdfactflag", "N");
  600. model.setValue("/root/main/cond/exptmthdfact", "-");
  601. ipt_exptmthdfact.disabled = true;
  602. messageBox ( "입원 환자의 약품 처방은 병동 투약기록이 불가 하므로 예외용법을 적용 할 수 없습니다. \n '의사지시대로' 용법 선택 후 처방 전달사항으로 입력 하세요.", "E" );
  603. } else {
  604. ipt_exptmthdfact.disabled = false;
  605. }
  606. } else {
  607. ipt_exptmthdfact.disabled = false;
  608. }
  609. }else{
  610. model.setValue("/root/main/cond/exptmthdfact", "-");
  611. ipt_exptmthdfact.disabled = true;
  612. }
  613. model.refresh();
  614. ]]>
  615. </script>
  616. </bool>
  617. <bool id="bool2" checkvalue="Y,N" ref="/root/main/cond/drugindependpackflag" style="left:0px; top:549px; width:35px; height:20px; "/>
  618. <caption id="caption1" style="left:29px; top:528px; width:56px; height:20px; ">예외용법</caption>
  619. <caption id="caption2" style="left:29px; top:550px; width:56px; height:20px; ">따로포장</caption>
  620. <caption id="caption6" class="search_name" style="left:27px; top:42px; width:90px; height:17px; ">용법시간 :</caption>
  621. <input id="ipt_exptmthdfact" ref="/root/main/cond/exptmthdfact" style="left:86px; top:529px; width:501px; height:19px; "/>
  622. <select1 id="cmb_mthdtime" ref="/root/send/mthdtime" appearance="minimal" style="left:117px; top:42px; width:197px; height:19px; ">
  623. <choices>
  624. <itemset nodeset="/root/init/M0478/M0478">
  625. <label ref="cdnm"/>
  626. <value ref="cdid"/>
  627. </itemset>
  628. </choices>
  629. <script type="javascript" ev:event="xforms-value-changed">
  630. <![CDATA[
  631. model.setValue("/root/send/mthdtimenm", cmb_mthdtime.label);
  632. submit("TRMMO01901");
  633. ]]>
  634. </script>
  635. </select1>
  636. </xhtml:body>
  637. </xhtml:html>