SPMMO90200_처방전사유리스트.xrw 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  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. <saveflaginfo>
  11. <msgdd/>
  12. <msgno/>
  13. <histno/>
  14. <msgcls/>
  15. </saveflaginfo>
  16. <prcpmsglist>
  17. <instcd/>
  18. <msgdd/>
  19. <msgno/>
  20. <histno/>
  21. <msgseq/>
  22. <msgcls/>
  23. <prcpcd/>
  24. <prcpnm/>
  25. <errcd/>
  26. <errmsg/>
  27. <errdisc/>
  28. <cnfcd/>
  29. <cnfmsg/>
  30. </prcpmsglist>
  31. </result>
  32. <hardcd>
  33. <hardcd>
  34. <status/>
  35. <hardcd/>
  36. <hardcdnm/>
  37. </hardcd>
  38. </hardcd>
  39. <send>
  40. <cond1/>
  41. </send>
  42. <init>
  43. <cond1>Y</cond1>
  44. </init>
  45. </root>
  46. </instance>
  47. <submission id="TRZBC00101" mediatype="application/x-www-form-urlencoded" method="post"/>
  48. <submission id="TRMMB16401" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/hardcd"/>
  49. <submission id="TRMMO90101" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/result/saveflaginfo" resultref="/root/result/prcpmsglist"/>
  50. <submission id="TXMMO90101" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/result/prcpmsglist" resultref="/root/result"/>
  51. <bind id="bind1" ref="/root/hardcd/hardcd/hardcdnm" readonly="../hardcd != 'T'"/>
  52. <script type="javascript" ev:event="xforms-ready">
  53. <![CDATA[
  54. var msgno = model.getValue("/root/result/saveflaginfo/msgno");
  55. if(msgno == "0"){
  56. messageBox("메세지 정보가 정확하지 않습니다.", "E999");
  57. return;
  58. }
  59. model.makeValue("/root/result/saveflaginfo/msgcls", "R"); // 사유 조회(R) 로 설정
  60. submit("TRMMO90101");
  61. var sErrMsg = "";
  62. grd_prcpmsglist.rebuildStyle();
  63. for (var i=1; i<grd_prcpmsglist.rows; i++) {
  64. sErrMsg = model.getValue("/root/result/prcpmsglist["+i+"]/errmsg");
  65. if (isSearchString(sErrMsg, "주의! 마약") || isSearchString(sErrMsg, "향정신성의약품")){
  66. grd_prcpmsglist.cellstyle("background-color", i, grd_prcpmsglist.colRef("errmsg") ) = "#f3e1bf" ;
  67. }
  68. }
  69. ]]>
  70. </script>
  71. </model>
  72. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  73. <script type="javascript" src="../../../emr/prcpmngtweb/js/MMO001.js"/>
  74. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  75. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  76. <script type="javascript">
  77. <![CDATA[
  78. // 화면 전역변수
  79. var cRow = ""; // 사유입력리스트에서 선택된 행
  80. var cResnFlag = ""; // 사유입력리스트에서 선택된 사유구분
  81. // 화면 open, 저장시 초기화 기능을 수행한다.
  82. function fClose() {
  83. window.close();
  84. }
  85. function fSelectResn() {
  86. var resnRow = grd_resnlist.row;
  87. var prcpRow = grd_prcpmsglist.row;
  88. var sAllApply = model.getValue("/root/init/cond1"); // 일괄적용여부
  89. if (resnRow != -1 && prcpRow != -1) {
  90. var sStatus = model.getValue("/root/hardcd/hardcd[" + resnRow + "]/status"); // 선택된 사유 상태
  91. var sCnfCd = model.getValue("/root/hardcd/hardcd[" + resnRow + "]/hardcd"); // 선택된 사유 코드
  92. var sCnfMsg = model.getValue("/root/hardcd/hardcd[" + resnRow + "]/hardcdnm"); // 선택된 사유 상세
  93. if(sCnfMsg == "(이곳에 사유입력을 하세요)" || sCnfMsg == "기타사유 (직접입력)") {
  94. grd_resnlist.col = grd_resnlist.colRef("hardcdnm");
  95. grd_resnlist.colDisabled(grd_resnlist.col) = false;
  96. grd_resnlist.editCell();
  97. } else {
  98. var sMultiYn = model.getValue("/root/result/prcpmsglist[" +prcpRow+ "]/multiyn"); // 멀티선택 가능여부
  99. if(sMultiYn == "N") { // 단일 선택이면
  100. if(sStatus == "N") { // 현재 선택되지 않은 값이면 신규 선택
  101. var resnLength = model.instances(0).selectNodes( "/root/hardcd/hardcd" ).length;
  102. for ( var i= 1; i<=resnLength; i++ ) { // 사유항목별 for
  103. if( resnRow == i) {
  104. model.setValue("/root/hardcd/hardcd[" + i + "]/status", "Y"); // 선택 체크
  105. } else {
  106. model.setValue("/root/hardcd/hardcd[" + i + "]/status", "N"); // 선택 해제
  107. }
  108. } // end of 사유항목별 for
  109. } else { // 현재 선택된 값이면 선택취소
  110. model.setValue("/root/hardcd/hardcd[" + resnRow + "]/status", "N"); // 선택 해제
  111. sCnfCd = "-"; // 선택코드 초기화
  112. sCnfMsg = "-"; // 선택사유 초기화
  113. }
  114. } else { // 멀티 선택이면
  115. if(sStatus == "N") { // 현재 선택되지 않은 값이면 신규 선택
  116. model.setValue("/root/hardcd/hardcd[" + resnRow + "]/status", "Y"); // 선택 해제
  117. } else { // 현재 선택된 값이면 선택취소
  118. model.setValue("/root/hardcd/hardcd[" + resnRow + "]/status", "N"); // 선택 해제
  119. }
  120. sCnfCd = "-"; // 선택코드 초기화
  121. sCnfMsg = "-"; // 선택사유 초기화
  122. var resnLength = model.instances(0).selectNodes( "/root/hardcd/hardcd" ).length;
  123. for ( var i= 1; i<=resnLength; i++ ) { // 사유항목별 for
  124. if( model.getValue("/root/hardcd/hardcd[" + i + "]/status") == "Y") { // 선택되었으면
  125. if(sCnfCd == "-") { // 첫번째 선택의 경우
  126. sCnfCd = model.getValue("/root/hardcd/hardcd[" + i + "]/hardcd"); // 선택된 사유 코드
  127. sCnfMsg = model.getValue("/root/hardcd/hardcd[" + i + "]/hardcdnm"); // 선택된 사유 상세
  128. } else { // 첫번째 선택이 아닌경우
  129. sCnfCd = sCnfCd + "|" + model.getValue("/root/hardcd/hardcd[" + i + "]/hardcd"); // 선택된 사유 코드
  130. sCnfMsg = sCnfMsg + "|" + model.getValue("/root/hardcd/hardcd[" + i + "]/hardcdnm"); // 선택된 사유 상세
  131. }
  132. }
  133. } // end of 사유항목별 for
  134. }
  135. if(sAllApply == "Y") { // 일괄 적용이면
  136. var checkLength = model.instances(0).selectNodes( "/root/result/prcpmsglist" ).length;
  137. var sSelErrCd = model.getValue("/root/result/prcpmsglist[" +prcpRow+ "]/errcd"); // 오류 코드
  138. var sChkErrCd = "";
  139. for ( var i= 1; i<=checkLength; i++ ) {
  140. sChkErrCd = model.getValue ( "/root/result/prcpmsglist[" + i + "]/errcd" );
  141. if(sSelErrCd == sChkErrCd) {
  142. model.setValue("/root/result/prcpmsglist[" + i + "]/cnfcd", sCnfCd);
  143. model.setValue("/root/result/prcpmsglist[" + i + "]/cnfmsg", sCnfMsg);
  144. }
  145. }
  146. } else {
  147. model.setValue("/root/result/prcpmsglist[" + prcpRow + "]/cnfcd", sCnfCd);
  148. model.setValue("/root/result/prcpmsglist[" + prcpRow + "]/cnfmsg", sCnfMsg);
  149. }
  150. model.refresh();
  151. }
  152. }
  153. }
  154. ]]>
  155. </script>
  156. </xhtml:head>
  157. <xhtml:body pagewidth="865" pageheight="550" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  158. <caption id="caption1" class="tit_2" style="left:5px; top:2px; width:302px; height:13px; ">처방 사유 입력</caption>
  159. <switch id="switch1" style="left:2px; top:17px; width:843px; height:498px; ">
  160. <case id="case1" selected="true" style="left:0px; top:0px; width:843px; height:495px; ">
  161. <datagrid id="grd_prcpmsglist" nodeset="/root/result/prcpmsglist" autoresize="true" caption="사유구분^처방코드^처방명^사유코드^내용^코드^상세사유" colsep="^" colwidth="130, 70, 140, 55, 335, 30, 60" dataheight="23" ellipsis="true" extendlastcol="scroll" rowheight="23" rowsep="|" selectionmode="free" tooltip="true" style="left:0px; top:5px; width:843px; height:255px; ">
  162. <col ref="errdisc"/>
  163. <col ref="prcpcd"/>
  164. <col ref="prcpnm"/>
  165. <col ref="errcd" style="text-align:center; "/>
  166. <col ref="errmsg"/>
  167. <col ref="cnfcd" style="text-align:center; "/>
  168. <col ref="cnfmsg"/>
  169. <script type="javascript" ev:event="onclick">
  170. <![CDATA[
  171. if (isDataCell()) {
  172. var sResnListCd = model.getValue("/root/result/prcpmsglist[" +grd_prcpmsglist.row+ "]/resnlistcd"); // 사유입력시 사유리스트 하드코드
  173. var sMultiYn = model.getValue("/root/result/prcpmsglist[" +grd_prcpmsglist.row+ "]/multiyn"); // 멀티선택 가능여부
  174. if(sResnListCd == "0") {
  175. alert("관련된 사유 정보가 존재 하지 않습니다.\n전산실(6598)로 문의 하세요.");
  176. return;
  177. }
  178. if(sMultiYn == "N") { // 단일선택이면
  179. caption10.visible = false;
  180. } else {
  181. caption10.visible = true;
  182. }
  183. model.setValue ( "/root/send/cond1", sResnListCd );
  184. submit("TRMMB16401" );
  185. model.refresh();
  186. }
  187. ]]>
  188. </script>
  189. </datagrid>
  190. <caption id="caption6" class="tit_2" style="left:5px; top:266px; width:75px; height:14px; ">사유선택</caption>
  191. <line id="line4" class="line_1" style="x1:0px; y1:284px; x2:843px; y2:284px; "/>
  192. <datagrid id="grd_resnlist" nodeset="/root/hardcd/hardcd" autoresize="true" caption="선택^코드^상세사유" colsep="^" colwidth="35, 50, 737" dataheight="23" ellipsis="true" extendlastcol="scroll" rowheight="23" rowsep="|" tooltip="true" style="left:0px; top:290px; width:843px; height:205px; ">
  193. <col checkvalue="Y,N" ref="status" type="checkbox" style="focus-rect:visible; "/>
  194. <col ref="hardcd" style="text-align:center; "/>
  195. <col disabled="false" editable="true" imemode="hangul" ref="hardcdnm" type="input"/>
  196. <script type="javascript" ev:event="onclick">
  197. <![CDATA[
  198. if (isDataCell() ) {
  199. var currow = grd_resnlist.row;
  200. if ( grd_resnlist.col == grd_resnlist.colref("hardcdnm")) {
  201. if ( model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcdnm" ) == "(이곳에 사유입력을 하세요)"
  202. || model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcdnm" ) == "기타사유 (직접입력)" ) {
  203. grd_resnlist.col = grd_resnlist.colRef("hardcdnm");
  204. grd_resnlist.colDisabled(grd_resnlist.col) = false;
  205. grd_resnlist.editCell();
  206. } else {
  207. grd_resnlist.colDisabled(grd_resnlist.col) = true;
  208. }
  209. } else if ( grd_resnlist.col == grd_resnlist.colref("status")) {
  210. // fSelectResn() 함수에서 동일하게 처리하기위해 값을 변경한다. 2015.03.26 엄영만
  211. if(model.getValue ( "/root/hardcd/hardcd[" + currow + "]/status") == "Y") {
  212. model.setValue ( "/root/hardcd/hardcd[" + currow + "]/status" , "N");
  213. } else {
  214. model.setValue ( "/root/hardcd/hardcd[" + currow + "]/status" , "Y");
  215. }
  216. fSelectResn();
  217. }
  218. }
  219. ]]>
  220. </script>
  221. <script type="javascript" ev:event="onendedit">
  222. <![CDATA[
  223. var currow = grd_resnlist.row;
  224. if ( model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcdnm" ) != "(이곳에 사유입력을 하세요)"
  225. && model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcdnm" ) != "기타사유 (직접입력)" ) {
  226. fSelectResn();
  227. }
  228. ]]>
  229. </script>
  230. <script type="javascript" ev:event="ondblclick">
  231. <![CDATA[
  232. if (isDataCell() ) {
  233. fSelectResn();
  234. }
  235. ]]>
  236. </script>
  237. </datagrid>
  238. <line id="line1" class="line_1" style="x1:0px; y1:2px; x2:843; y2:2px; "/>
  239. <button id="button1" class="btn2_letter4" style="left:776px; top:263px; width:64px; height:19px; ">
  240. <caption>사유적용</caption>
  241. <script type="javascript" ev:event="DOMActivate">
  242. <![CDATA[
  243. if(grd_resnlist.row != -1) {
  244. fSelectResn();
  245. }else{
  246. messageBox ( "선택된 사유가 없습니다." , "I" );
  247. }
  248. ]]>
  249. </script>
  250. </button>
  251. <bool id="bool_cond1" checkvalue="Y,N" overflow="visible" appearance="full" ref="/root/init/cond1" style="left:700px; top:265px; width:20px; height:20px; border-style:none; "/>
  252. <caption id="caption3" style="left:720px; top:265px; width:50px; height:20px; ">일괄적용</caption>
  253. </case>
  254. </switch>
  255. <button id="button3" class="btn4_letter4" style="left:642px; top:520px; width:80px; height:22px; ">
  256. <caption>계속저장</caption>
  257. <script type="javascript" ev:event="DOMActivate">
  258. <![CDATA[
  259. var checkLength = model.instances(0).selectNodes( "/root/result/prcpmsglist" ).length;
  260. var resnCnt = 0;
  261. var sUserId = "";
  262. if ( checkLength > 0 ) {
  263. sUserId = getUserInfo("userid");
  264. for ( var i =1; i <= checkLength; i++ ) {
  265. model.makeValue ( "/root/result/prcpmsglist[" + i + "]/userid", sUserId);
  266. if ( isNull(model.getValue ( "/root/result/prcpmsglist[" + i + "]/cnfcd" ))
  267. || isNull(model.getValue ( "/root/result/prcpmsglist[" + i + "]/cnfmsg" ))
  268. || "-" == model.getValue ( "/root/result/prcpmsglist[" + i + "]/cnfcd" )
  269. || "-" == model.getValue ( "/root/result/prcpmsglist[" + i + "]/cnfmsg" ) ) {
  270. resnCnt++;
  271. }
  272. }
  273. if (resnCnt > 0) {
  274. messageBox ( "처방사유 선택되지 않은 처방이", "I010" );
  275. return;
  276. }
  277. model.makeValue("/root/result/saveflaginfo/cnfcd", "Y"); // 확인 코드를 'Y' 로 설정
  278. if(submit("TXMMO90101")){
  279. opener.javascript.setParameter ( "SPMMO90200_rtn", "Y" );
  280. }
  281. }
  282. window.close();
  283. ]]>
  284. </script>
  285. </button>
  286. <button id="btn_cncl" class="btn4_letter7" style="left:731px; top:520px; width:116px; height:22px; ">
  287. <caption>처방변경(닫기)</caption>
  288. <script type="javascript" ev:event="DOMActivate">
  289. <![CDATA[
  290. opener.javascript.setParameter ( "SPMMO90200_rtn", "N" );
  291. window.close();
  292. ]]>
  293. </script>
  294. </button>
  295. <caption id="caption4" style="left:110px; top:3px; width:715px; height:16px; ">아래의 처방은 사유를 선택 또는 입력 하셔야 발행이 가능 합니다. 처방을 선택하면 사유구분에 맞는 사유 항목이 조회 됩니다.</caption>
  296. <caption id="caption7" style="left:80px; top:285px; width:205px; height:16px; ">아래의 항목에서 사유를 선택 하세요.</caption>
  297. <caption id="caption10" visibility="hidden" style="left:282px; top:285px; width:90px; height:16px; color:#0000ff; ">(멀티선택가능)</caption>
  298. <caption id="caption9" style="left:380px; top:285px; width:320px; height:16px; ">일괄적용 체크 되면 동일한 사유구분은한번에 적용 됩니다.</caption>
  299. <group id="group2" scroll="auto" style="left:0px; top:520px; width:240px; height:27px; ">
  300. <shape id="roundrect4" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:5px; top:0px; width:230px; height:27px; background-color:transparent; border-color:#7cbbdd; border-style:solid; "/>
  301. <caption id="caption20" class="cell_2" style="left:10px; top:5px; width:50px; height:20px; ">범 례</caption>
  302. <caption id="caption5" class="color_7" style="left:65px; top:9px; width:15px; height:15px; vertical-align:middle; "/>
  303. <caption id="caption8" style="left:85px; top:10px; width:150px; height:13px; ">마약 또는 향정신성 의약품</caption>
  304. </group>
  305. </xhtml:body>
  306. </xhtml:html>