SPMMO16400_성분중복처방체크.xrw 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  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. <result>
  10. <comduplprcplist>
  11. <status/>
  12. <resncd/>
  13. <comcls/>
  14. <prcpcd/>
  15. <prcpnm/>
  16. <dupdays/>
  17. <duplprcpcd/>
  18. <duplprcpnm/>
  19. <duplprcpdd/>
  20. <orddeptnm/>
  21. <orddrnm/>
  22. <rgstrnm/>
  23. <resncnt/>
  24. <prcpdd/>
  25. <prcpno/>
  26. </comduplprcplist>
  27. </result>
  28. <send>
  29. <cond1/>
  30. </send>
  31. <hardcd>
  32. <hardcd>
  33. <status/>
  34. <hardcd/>
  35. <hardcdnm/>
  36. </hardcd>
  37. </hardcd>
  38. <init>
  39. <selcond1>1</selcond1>
  40. </init>
  41. </root>
  42. </instance>
  43. <script type="javascript" ev:event="xforms-model-construct-done">
  44. <![CDATA[
  45. // 보건복지부 고시 제2009-72호. 별표8 제2호 JT012
  46. if ( model.getValue ( "/root/result/comduplprcplist[1]/prcpdd") >= "20090601" ) {
  47. model.setValue ( "/root/send/cond1", "96" );
  48. } else {
  49. model.setValue ( "/root/send/cond1", "58" );
  50. }
  51. submit("TRMMB16401" );
  52. ]]>
  53. </script>
  54. <submission id="TRZBC00101" mediatype="application/x-www-form-urlencoded" method="post"/>
  55. <submission id="TRMMB16401" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/hardcd"/>
  56. <bind id="bind1" ref="/root/hardcd/hardcd/hardcdnm" readonly="../hardcd != 'D7'"/>
  57. </model>
  58. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  59. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  60. <script type="javascript" src="../../../emr/prcpmngtweb/js/MMO001.js"/>
  61. <script type="javascript">
  62. <![CDATA[
  63. function fSelectResn() {
  64. var currow = grd_resnlist.row;
  65. var srchLength = model.instances(0).selectNodes( "/root/result/comduplprcplist" ).length;
  66. if ( grd_resnlist.col != grd_resnlist.colref("status")) {
  67. if ( model.getValue ( "/root/hardcd/hardcd[" + currow + "]/status" ) == "N" ) {
  68. model.setValue ( "/root/hardcd/hardcd[" + currow + "]/status", "Y" )
  69. } else {
  70. return;
  71. model.setValue ( "/root/hardcd/hardcd[" + currow + "]/status", "N" )
  72. }
  73. }
  74. // 보건복지부 고시 제2009-72호. 별표8 제2호 JT012
  75. if ( model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcd" ) == "A" ) {
  76. for ( var i =1; i <= srchLength ; i ++ ) {
  77. if ( model.getValue ( "/root/result/comduplprcplist[" + i + "]/status" ) == "Y" ) {
  78. if ( model.getValue ( "/root/result/comduplprcplist[" + i + "]/prcpdd") >= "20090601" && parseInt(model.getValue ( "/root/result/comduplprcplist[" + i + "]/dupdays")) >30 ) {
  79. messageBox("[A] 사유로는 최대 30일 까지만 중복처방이 허용됩니다. 총 중복일수는 "+model.getValue ( "/root/result/comduplprcplist[" + i + "]/dupdays")+"일 입니다.", "E");
  80. return;
  81. }
  82. }
  83. }
  84. }
  85. //if ( grd_rsrnlist.col == grd_resnlist.colref("status")) {
  86. if ( model.getValue ( "/root/hardcd/hardcd[" + currow + "]/status" ) == "Y" ) {
  87. for ( var i = 1; i < grd_resnlist.rows; i++ ) {
  88. if ( i != currow ) {
  89. model.setValue ( "/root/hardcd/hardcd[" + i + "]/status", "N" )
  90. }
  91. }
  92. for ( var i =1; i <= srchLength ; i ++ ) {
  93. if ( model.getValue ( "/root/result/comduplprcplist[" + i + "]/status" ) == "Y" ) {
  94. model.setValue ( "/root/result/comduplprcplist[" + i + "]/resncd", model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcd" ));
  95. var resncnts = "instcd|pid|orddd|cretno|ordtype|orddeptcd|prcpdd|prcpno|prcphistno|resnflag|resncd|resncnts|payflagcd^" ;
  96. var pid = opener.model.getValue( "/root/paminfo/list/pid");
  97. var prcpgenrflag = opener.model.getValue ( "/root/patflag/list/prcpgenrflag" );
  98. var orddd = "";
  99. if ( prcpgenrflag == "O" ) {
  100. orddd = opener.model.getValue( "/root/paminfo/list/orddd");
  101. } else {
  102. orddd = opener.model.getValue( "/root/paminfo/list/indd");
  103. }
  104. var cretno = opener.model.getValue( "/root/paminfo/list/cretno");
  105. var orddeptcd = opener.model.getValue( "/root/paminfo/list/orddeptcd");
  106. var chkresncnts = '-'
  107. var chkresncd = model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcd" );
  108. var instcd = getUserInfo("dutplceinstcd") ;
  109. resncnts = resncnts + instcd + "|" + pid + "|" + orddd + "|" + cretno + "|" + prcpgenrflag + "|" + orddeptcd + "|-|0|0|A|" + chkresncd + "|" + model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcdnm" ) + "^";
  110. model.setValue ( "/root/result/comduplprcplist[" + i + "]/saveresncnt", resncnts );
  111. model.setValue ( "/root/result/comduplprcplist[" + i + "]/resncnt", model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcdnm" ));
  112. }
  113. }
  114. } else {
  115. for ( var i =1; i <= srchLength; i ++ ) {
  116. if ( model.getValue ( "/root/result/comduplprcplist[" + i + "]/status" ) == "Y" ) {
  117. model.setValue ( "/root/result/comduplprcplist[" + i + "]/resncd", "-");
  118. var resncnts = "instcd|pid|orddd|cretno|ordtype|orddeptcd|prcpdd|prcpno|prcphistno|resnflag|resncd|resncnts|payflagcd^" ;
  119. var pid = opener.model.getValue( "/root/paminfo/list/pid");
  120. var prcpgenrflag = opener.model.getValue ( "/root/patflag/list/prcpgenrflag" );
  121. var orddd = "";
  122. if ( prcpgenrflag == "O" ) {
  123. orddd = opener.model.getValue( "/root/paminfo/list/orddd");
  124. } else {
  125. orddd = opener.model.getValue( "/root/paminfo/list/indd");
  126. }
  127. var cretno = opener.model.getValue( "/root/paminfo/list/cretno");
  128. var orddeptcd = opener.model.getValue( "/root/paminfo/list/orddeptcd");
  129. var chkresncnts = '-'
  130. var chkresncd = model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcd" );
  131. var instcd = getUserInfo("dutplceinstcd") ;
  132. resncnts = resncnts + instcd + "|" + pid + "|" + orddd + "|" + cretno + "|" + prcpgenrflag + "|" + orddeptcd + "|-|0|0|A|" + chkresncd + "|" + model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcdnm" ) + "^";
  133. model.setValue ( "/root/result/comduplprcplist[" + i + "]/saveresncnt", "-" );
  134. model.setValue ( "/root/result/comduplprcplist[" + i + "]/resncnt", "-" );
  135. }
  136. }
  137. }
  138. grd_prcperrlist.refresh();
  139. model.recalculate();
  140. //}
  141. }
  142. ]]>
  143. </script>
  144. </xhtml:head>
  145. <xhtml:body pagewidth="1002" pageheight="570" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  146. <button id="btn_save" class="btn4_letter4" style="left:819px; top:536px; width:80px; height:22px; ">
  147. <caption>계속저장</caption>
  148. <script type="javascript" ev:event="DOMActivate">
  149. <![CDATA[
  150. var srchLength = model.instances(0).selectNodes( "/root/result/comduplprcplist" ).length;
  151. var srcNodeListMainLength = opener.model.instances(0).selectNodes( "/root/main/prcp/prcplist" ).length;
  152. for ( var i = 1; i <= srchLength; i++ ) {
  153. var resncd = model.getvalue ( "/root/result/comduplprcplist[" + i + "]/resncd" );
  154. var prcpcd = model.getvalue ( "/root/result/comduplprcplist[" + i + "]/prcpcd" );
  155. var resncnt = model.getvalue ( "/root/result/comduplprcplist[" + i + "]/resncnt" );
  156. if ( resncd == "-" ) {
  157. messageBox ( "[" + prcpcd + "]"+ " 중복처방 사유가", "I004" );
  158. return;
  159. } else if ( resncd == "D7" && resncnt == "기타(직접입력)" ) {
  160. messageBox ( "[" + prcpcd + "]"+ " 기타 사유가", "I004" );
  161. return;
  162. }
  163. }
  164. for ( var i = 1; i <= srchLength; i++ ) {
  165. var saveresncnt = model.getvalue ( "/root/result/comduplprcplist[" + i + "]/saveresncnt" );
  166. var prcpno = model.getvalue ( "/root/result/comduplprcplist[" + i + "]/prcpno" );
  167. var resncd = model.getvalue ( "/root/result/comduplprcplist[" + i + "]/resncd" );
  168. for ( var j = 1; j <= srcNodeListMainLength; j++ ) {
  169. if ( prcpno == opener.model.getValue ( "/root/result/savedrprcplist[" + j + "]/prcpno" )) {
  170. opener.model.setValue ( "/root/result/savedrprcplist[" + j + "]/tempcol19", saveresncnt );
  171. // 보건복지부 고시 제2009-72호. 별표8 제2호 JT012
  172. if ( model.getValue ( "/root/result/comduplprcplist[" + i + "]/prcpdd") >= "20090601" && resncd == "E" ) {
  173. opener.model.setValue ( "/root/result/savedrprcplist[" + j + "]/payflagcd", "1" );
  174. }
  175. }
  176. }
  177. }
  178. opener.javascript.setParameter ( "SPMMO16400_rtn1", "Y" );
  179. window.close();
  180. ]]>
  181. </script>
  182. </button>
  183. <caption id="caption1" class="tit_2" style="left:5px; top:2px; width:302px; height:14px; ">이전처방과 일수가 중복된 동일성분 처방 리스트</caption>
  184. <line id="line7" class="line_1" style="x1:3px; y1:18px; x2:985px; y2:18px; "/>
  185. <caption id="caption2" style="left:535px; top:538px; width:278px; height:20px; color:#ff0000; ">* 성분 중복처방이 있습니다. 저장하시겠습니까 ?</caption>
  186. <datagrid id="grd_prcperrlist" nodeset="/root/result/comduplprcplist" caption="prcpno^선택^사유^성분코드^처방코드^처방명^중복일^중복처방코드^중복처방명^중복처방일^진료과^진료의" colsep="^" colwidth="30, 30, 30, 80, 80, 205, 45, 80, 205, 75, 85, 60" dataheight="23" ellipsis="true" extendlastcol="scroll" mergecells="byrestriccol" rowheight="23" rowsep="|" tooltip="true" style="left:3px; top:23px; width:982px; height:200px; ">
  187. <col ref="prcpno" visibility="hidden"/>
  188. <col checkvalue="Y,N" ref="status" type="checkbox"/>
  189. <col ref="resncd" style="text-align:center; "/>
  190. <col ref="comcls"/>
  191. <col ref="prcpcd"/>
  192. <col ref="prcpnm" type="output"/>
  193. <col ref="dupdays" style="text-align:center; "/>
  194. <col ref="duplprcpcd"/>
  195. <col ref="duplprcpnm"/>
  196. <col ref="duplprcpdd" format="yyyy-mm-dd" style="text-align:center; "/>
  197. <col ref="orddeptnm" style="text-align:center; "/>
  198. <col ref="orddrnm" style="text-align:center; "/>
  199. <script type="javascript" ev:event="xforms-value-changed">
  200. <![CDATA[
  201. if ( grd_prcperrlist.col == grd_prcperrlist.colRef ( "status" )) {
  202. var currow = grd_prcperrlist.row;
  203. var srcNodeList = model.instances(0).selectNodes( "/root/result/comduplprcplist" );
  204. var status = model.getValue ( "/root/result/comduplprcplist[" + currow + "]/status" );
  205. for ( var i= currow; i<=srcNodeList.length; i++ ) {
  206. var j = i + 1;
  207. var currprcpno = model.getValue ( "/root/result/comduplprcplist[" + i + "]/prcpno" );
  208. var nextprcpno = model.getValue ( "/root/result/comduplprcplist[" + j + "]/prcpno" );
  209. if (currprcpno == nextprcpno) {
  210. model.setValue("/root/result/comduplprcplist[" + j + "]/status", status) ;
  211. } else {
  212. break;
  213. }
  214. }
  215. }
  216. model.refresh();
  217. ]]>
  218. </script>
  219. <script type="javascript" ev:event="onclick">
  220. <![CDATA[
  221. var currow = grd_prcperrlist.row;
  222. if( currow > 0 && currow <= grd_resnlist.rows ){
  223. var srchLength = model.instances(0).selectNodes( "/root/result/comduplprcplist" ).length;
  224. if ( grd_prcperrlist.col != grd_prcperrlist.colRef ( "status" )) {
  225. if ( model.getValue ( "/root/result/comduplprcplist[" + currow + "]/status" ) == "Y" ) {
  226. model.setValue ( "/root/result/comduplprcplist[" + currow + "]/status", "N" )
  227. } else {
  228. model.setValue ( "/root/result/comduplprcplist[" + currow + "]/status", "Y" )
  229. }
  230. var status = model.getValue ( "/root/result/comduplprcplist[" + currow + "]/status" );
  231. var currprcpno = model.getValue ( "/root/result/comduplprcplist[" + currow + "]/prcpno" );
  232. for ( var i= 1; i<=srchLength; i++ ) {
  233. var nextprcpno = model.getValue ( "/root/result/comduplprcplist[" + i + "]/prcpno" );
  234. if (currprcpno == nextprcpno) {
  235. model.setValue("/root/result/comduplprcplist[" + i + "]/status", status) ;
  236. }
  237. }
  238. }
  239. model.refresh()
  240. }
  241. ]]>
  242. </script>
  243. </datagrid>
  244. <button id="button2" class="btn4_letter4" style="left:903px; top:536px; width:80px; height:22px; ">
  245. <caption>처방취소</caption>
  246. <script type="javascript" ev:event="DOMActivate">
  247. <![CDATA[
  248. opener.javascript.setParameter ( "SPMMO16400_rtn1", "N" );
  249. window.close();
  250. ]]>
  251. </script>
  252. </button>
  253. <datagrid id="grd_resnlist" nodeset="/root/hardcd/hardcd" caption="선택^코드^상세사유" colsep="^" colwidth="30, 35, 877" dataheight="23" ellipsis="true" extendlastcol="scroll" rowheight="23" rowsep="|" tooltip="true" style="left:3px; top:251px; width:982px; height:278px; ">
  254. <col checkvalue="Y,N" ref="status" type="checkbox" visibility="hidden"/>
  255. <col ref="hardcd" style="text-align:center; "/>
  256. <col ref="hardcdnm" type="input"/>
  257. <script type="javascript" ev:event="onclick">
  258. <![CDATA[
  259. if( grd_resnlist.row > 0 && grd_resnlist.row <= grd_resnlist.rows ){
  260. fSelectResn();
  261. }
  262. ]]>
  263. </script>
  264. <script type="javascript" ev:event="onendedit">
  265. <![CDATA[
  266. var currow = grd_resnlist.row;
  267. var srchLength = model.instances(0).selectNodes( "/root/result/comduplprcplist" ).length;
  268. if ( grd_resnlist.col == grd_resnlist.colref("hardcdnm")) {
  269. if ( model.getValue ( "/root/hardcd/hardcd[" + currow + "]/status" ) == "Y" ) {
  270. for ( var i = 1; i < grd_resnlist.rows; i++ ) {
  271. if ( i != currow ) {
  272. model.setValue ( "/root/hardcd/hardcd[" + i + "]/status", "N" )
  273. }
  274. }
  275. for ( var i =1; i <= srchLength ; i ++ ) {
  276. if ( model.getValue ( "/root/result/comduplprcplist[" + i + "]/status" ) == "Y" ) {
  277. model.setValue ( "/root/result/comduplprcplist[" + i + "]/resncd", model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcd" ));
  278. var resncnts = "instcd|pid|orddd|cretno|ordtype|orddeptcd|prcpdd|prcpno|prcphistno|resnflag|resncd|resncnts^" ;
  279. var pid = opener.model.getValue( "/root/paminfo/list/pid");
  280. var prcpgenrflag = opener.model.getValue ( "/root/patflag/list/prcpgenrflag" );
  281. var orddd = "";
  282. if ( prcpgenrflag == "O" ) {
  283. orddd = opener.model.getValue( "/root/paminfo/list/orddd");
  284. } else {
  285. orddd = opener.model.getValue( "/root/paminfo/list/indd");
  286. }
  287. var cretno = opener.model.getValue( "/root/paminfo/list/cretno");
  288. var orddeptcd = opener.model.getValue( "/root/paminfo/list/orddeptcd");
  289. var chkresncnts = '-'
  290. var chkresncd = model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcd" );
  291. var instcd = getUserInfo("dutplceinstcd") ;
  292. resncnts = resncnts + instcd + "|" + pid + "|" + orddd + "|" + cretno + "|" + prcpgenrflag + "|" + orddeptcd + "|-|0|0|A|" + chkresncd + "|" + model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcdnm" ) + "^" ;
  293. model.setValue ( "/root/result/comduplprcplist[" + i + "]/saveresncnt", resncnts );
  294. model.setValue ( "/root/result/comduplprcplist[" + i + "]/resncnt", model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcdnm" ));
  295. }
  296. }
  297. } else {
  298. for ( var i =1; i <= srchLength; i ++ ) {
  299. if ( model.getValue ( "/root/result/comduplprcplist[" + i + "]/status" ) == "Y" ) {
  300. model.setValue ( "/root/result/comduplprcplist[" + i + "]/resncd", "-");
  301. var resncnts = "instcd|pid|orddd|cretno|ordtype|orddeptcd|prcpdd|prcpno|prcphistno|resnflag|resncd|resncnts^" ;
  302. var pid = opener.model.getValue( "/root/paminfo/list/pid");
  303. var prcpgenrflag = opener.model.getValue ( "/root/patflag/list/prcpgenrflag" );
  304. var orddd = "";
  305. if ( prcpgenrflag == "O" ) {
  306. orddd = opener.model.getValue( "/root/paminfo/list/orddd");
  307. } else {
  308. orddd = opener.model.getValue( "/root/paminfo/list/indd");
  309. }
  310. var cretno = opener.model.getValue( "/root/paminfo/list/cretno");
  311. var orddeptcd = opener.model.getValue( "/root/paminfo/list/orddeptcd");
  312. var chkresncnts = '-'
  313. var chkresncd = model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcd" );
  314. var instcd = getUserInfo("dutplceinstcd") ;
  315. resncnts = resncnts + instcd + "|" + pid + "|" + orddd + "|" + cretno + "|" + prcpgenrflag + "|" + orddeptcd + "|-|0|0|A|" + chkresncd + "|" + model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcdnm" ) + "^" ;
  316. model.setValue ( "/root/result/comduplprcplist[" + i + "]/saveresncnt", "-" );
  317. model.setValue ( "/root/result/comduplprcplist[" + i + "]/resncnt", "-" );
  318. }
  319. }
  320. }
  321. grd_prcperrlist.refresh();
  322. model.recalculate();
  323. }
  324. ]]>
  325. </script>
  326. <script type="javascript" ev:event="onentercell">
  327. <![CDATA[
  328. var currow = grd_resnlist.row;
  329. if ( model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcd" ) == "D7" && grd_resnlist.col == grd_resnlist.colref("hardcdnm")) {
  330. model.setfocus( "grd_resnlist" );
  331. grd_resnlist.editCell();
  332. fSelectResn();
  333. }
  334. ]]>
  335. </script>
  336. <script type="javascript" ev:event="ondblclick">
  337. <![CDATA[
  338. //사유 클릭 하면 자동으로 팝업 창이 닫히도록 ONE CLICK 요청 -의정부 성모병원 소화기내과 (2009.06.15 JJE)
  339. if( grd_resnlist.row > 0 && grd_resnlist.row <= grd_resnlist.rows ){
  340. if( model.getValue("/root/init/selcond1") == "1" ) btn_save.dispatch("DOMActivate");
  341. }
  342. ]]>
  343. </script>
  344. </datagrid>
  345. <caption id="caption3" class="tit_2" style="left:5px; top:230px; width:171px; height:13px; ">사유선택</caption>
  346. <line id="line1" class="line_1" style="x1:3px; y1:246px; x2:985px; y2:246px; "/>
  347. <select1 id="radio1" ref="/root/init/selcond1" appearance="full" cols="2" overflow="visible" style="left:316px; top:0px; width:195px; height:20px; border-style:none; ">
  348. <choices>
  349. <item>
  350. <label>일괄사유입력</label>
  351. <value>1</value>
  352. </item>
  353. <item>
  354. <label>개별사유입력</label>
  355. <value>2</value>
  356. </item>
  357. </choices>
  358. <script type="javascript" ev:event="xforms-value-changed">
  359. <![CDATA[
  360. var srcNodeList = model.instances(0).selectNodes( "/root/result/comduplprcplist" );
  361. if ( model.getValue ( "/root/init/selcond1" ) == 1 ) {
  362. for ( var i= 1; i<=srcNodeList.length; i++ ) {
  363. model.setValue("/root/result/comduplprcplist[" + i + "]/status", "Y") ;
  364. }
  365. } else {
  366. for ( var i= 1; i<=srcNodeList.length; i++ ) {
  367. model.setValue("/root/result/comduplprcplist[" + i + "]/status", "N") ;
  368. }
  369. }
  370. model.refresh();
  371. ]]>
  372. </script>
  373. </select1>
  374. </xhtml:body>
  375. </xhtml:html>