SPMMO21900_미처방사유입력.xrw 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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. <send>
  10. <cond1/>
  11. </send>
  12. <hardcd>
  13. <hardcd>
  14. <status/>
  15. <hardcd/>
  16. <hardcdnm/>
  17. <resncmt/>
  18. </hardcd>
  19. </hardcd>
  20. <selectedresn>
  21. <code/>
  22. <resn/>
  23. </selectedresn>
  24. </root>
  25. </instance>
  26. <script type="javascript" ev:event="xforms-ready">
  27. <![CDATA[
  28. var sPara = opener.javascript.getParameter("SPMMO21900_hardcdno");
  29. model.setValue ( "/root/send/cond1", opener.javascript.getParameter("SPMMO21900_hardcdno"));
  30. caption1.attribute("text")= opener.javascript.getParameter("SPMMO21900_title");
  31. submit("TRMMB16401" );
  32. ]]>
  33. </script>
  34. <submission id="TRMMB16401" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/hardcd"/>
  35. </model>
  36. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  37. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  38. <script type="javascript" src="../../../emr/prcpmngtweb/js/MMO001.js"/>
  39. <script type="javascript">
  40. <![CDATA[
  41. //===============================================================================================
  42. // getNodesValue
  43. //===============================================================================================
  44. function getNodesValue(oNodeList, nIndex, sName) {
  45. var sRtn = "";
  46. if (Object.prototype.toString.call(oNodeList.item(nIndex)) == "[object Object]") {
  47. for (var i=0; i < oNodeList.item(nIndex).childNodes.length; i++) {
  48. if (Object.prototype.toString.call(oNodeList.item(nIndex).childNodes.item(i).nodeName) == "[object String]") {
  49. if (oNodeList.item(nIndex).childNodes.item(i).nodeName == sName){
  50. sRtn = oNodeList.item(nIndex).childNodes.item(i).nodeValue;
  51. break;
  52. }
  53. }
  54. }
  55. }
  56. return sRtn;
  57. }
  58. function fSelectResn() {
  59. var currow = grd_resnlist.row;
  60. var srchLength = model.instances(0).selectNodes( "/root/hardcd/hardcd" ).length;
  61. if ( grd_resnlist.col != grd_resnlist.colref("status")) {
  62. if ( model.getValue ( "/root/hardcd/hardcd[" + currow + "]/status" ) == "N" ) {
  63. model.setValue ( "/root/hardcd/hardcd[" + currow + "]/status", "Y" )
  64. } else {
  65. model.setValue ( "/root/hardcd/hardcd[" + currow + "]/status", "N" )
  66. return;
  67. }
  68. }
  69. if ( model.getValue ( "/root/hardcd/hardcd[" + currow + "]/status" ) == "Y" ) {
  70. for ( var i = 1; i < grd_resnlist.rows; i++ ) {
  71. if ( i != currow ) {
  72. model.setValue ( "/root/hardcd/hardcd[" + i + "]/status", "N" )
  73. }
  74. }
  75. for ( var i =1; i <= srchLength ; i ++ ) {
  76. if ( model.getValue ( "/root/result/spclhdrugprcplist[" + i + "]/status" ) == "Y" ) {
  77. model.setValue ( "/root/result/spclhdrugprcplist[" + i + "]/resncd", model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcd" ));
  78. var resncnts = "instcd|pid|orddd|cretno|ordtype|orddeptcd|prcpdd|prcpno|prcphistno|resnflag|resncd|resncnts|payflagcd^" ;
  79. var pid = opener.model.getValue( "/root/paminfo/list/pid");
  80. var prcpgenrflag = opener.model.getValue ( "/root/patflag/list/prcpgenrflag" );
  81. var orddd = "";
  82. if ( prcpgenrflag == "O" ) {
  83. orddd = opener.model.getValue( "/root/paminfo/list/orddd");
  84. } else {
  85. orddd = opener.model.getValue( "/root/paminfo/list/indd");
  86. }
  87. var cretno = opener.model.getValue( "/root/paminfo/list/cretno");
  88. var orddeptcd = opener.model.getValue( "/root/paminfo/list/orddeptcd");
  89. var chkresncnts = '-'
  90. var chkresncd = model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcd" );
  91. var instcd = getUserInfo("dutplceinstcd") ;
  92. resncnts = resncnts + instcd + "|" + pid + "|" + orddd + "|" + cretno + "|" + prcpgenrflag + "|" + orddeptcd + "|-|0|0|010|" + chkresncd + "|" + model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcdnm" ) + "^";
  93. model.setValue ( "/root/result/spclhdrugprcplist[" + i + "]/saveresncnt", resncnts );
  94. model.setValue ( "/root/result/spclhdrugprcplist[" + i + "]/resncnt", model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcdnm" ));
  95. }
  96. }
  97. } else {
  98. for ( var i =1; i <= srchLength; i ++ ) {
  99. if ( model.getValue ( "/root/result/spclhdrugprcplist[" + i + "]/status" ) == "Y" ) {
  100. model.setValue ( "/root/result/spclhdrugprcplist[" + i + "]/resncd", "-");
  101. var resncnts = "instcd|pid|orddd|cretno|ordtype|orddeptcd|prcpdd|prcpno|prcphistno|resnflag|resncd|resncnts|payflagcd^" ;
  102. var pid = opener.model.getValue( "/root/paminfo/list/pid");
  103. var prcpgenrflag = opener.model.getValue ( "/root/patflag/list/prcpgenrflag" );
  104. var orddd = "";
  105. if ( prcpgenrflag == "O" ) {
  106. orddd = opener.model.getValue( "/root/paminfo/list/orddd");
  107. } else {
  108. orddd = opener.model.getValue( "/root/paminfo/list/indd");
  109. }
  110. var cretno = opener.model.getValue( "/root/paminfo/list/cretno");
  111. var orddeptcd = opener.model.getValue( "/root/paminfo/list/orddeptcd");
  112. var chkresncnts = '-'
  113. var chkresncd = model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcd" );
  114. var instcd = getUserInfo("dutplceinstcd") ;
  115. resncnts = resncnts + instcd + "|" + pid + "|" + orddd + "|" + cretno + "|" + prcpgenrflag + "|" + orddeptcd + "|-|0|0|010|" + chkresncd + "|" + model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcdnm" ) + "^";
  116. model.setValue ( "/root/result/spclhdrugprcplist[" + i + "]/saveresncnt", "-" );
  117. model.setValue ( "/root/result/spclhdrugprcplist[" + i + "]/resncnt", "-" );
  118. }
  119. }
  120. }
  121. grd_prcperrlist.refresh();
  122. model.recalculate();
  123. //}
  124. }
  125. ]]>
  126. </script>
  127. </xhtml:head>
  128. <xhtml:body pagewidth="730" pageheight="340" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  129. <button id="btn_save" class="btn4_letter4" style="left:549px; top:306px; width:80px; height:22px; ">
  130. <caption>계속저장</caption>
  131. <script type="javascript" ev:event="DOMActivate">
  132. <![CDATA[
  133. var sSelHardCd = "";
  134. var sSelResnCmt = "";
  135. var oSelNode = model.instances(0).selectNodes( "/root/hardcd/hardcd[status='Y']" );
  136. if( oSelNode.length == 1 ) {
  137. sSelHardCd = getNodesValue(oSelNode, 0, "hardcd");
  138. if (sSelHardCd == "999") { // 기타 선택시
  139. if (getNodesValue(oSelNode, 0, "resncmt") == "") {
  140. messageBox ( "기타사유 선택시 상세사유을 입력", "I008" );
  141. return;
  142. }
  143. sSelResnCmt = getNodesValue(oSelNode, 0, "hardcdnm") + ":" + getNodesValue(oSelNode, 0, "resncmt");
  144. } else {
  145. sSelResnCmt = getNodesValue(oSelNode, 0, "hardcdnm");
  146. }
  147. opener.javascript.setParameter ( "SPMMO21900_resncode", sSelHardCd );
  148. opener.javascript.setParameter ( "SPMMO21900_resncmt", sSelResnCmt );
  149. } else {
  150. messageBox ( "미처방 사유는 하나만 선택", "I006" );
  151. return;
  152. }
  153. opener.javascript.setParameter ( "SPMMO21900_rtn1", "Y" );
  154. window.close();
  155. ]]>
  156. </script>
  157. </button>
  158. <caption id="caption1" class="tit_2" style="left:5px; top:2px; width:302px; height:14px; ">미처방 사유 선택</caption>
  159. <line id="line7" class="line_1" style="x1:3px; y1:18px; x2:710px; y2:17px; "/>
  160. <caption id="caption2" style="left:285px; top:308px; width:260px; height:20px; color:#ff0000; ">* 누락된 처방이 있습니다. 저장하시겠습니까 ?</caption>
  161. <button id="button2" class="btn4_letter4" style="left:633px; top:306px; width:80px; height:22px; ">
  162. <caption>처방취소</caption>
  163. <script type="javascript" ev:event="DOMActivate">
  164. <![CDATA[
  165. opener.javascript.setParameter ( "SPMMO21900_rtn1", "N" );
  166. window.close();
  167. ]]>
  168. </script>
  169. </button>
  170. <datagrid id="grd_resnlist" nodeset="/root/hardcd/hardcd" autoresize="true" caption="선택^코드^사유^상세사유" colsep="^" colwidth="30, 50, 403, 202" dataheight="23" ellipsis="true" rowheight="23" rowsep="|" tooltip="true" style="left:3px; top:21px; width:707px; height:278px; ">
  171. <col checkvalue="Y,N" ref="status" type="checkbox"/>
  172. <col ref="hardcd" style="text-align:center; "/>
  173. <col ref="hardcdnm"/>
  174. <col imemode="hangul" ref="resncmt" type="input"/>
  175. <script type="javascript" ev:event="onclick">
  176. <![CDATA[
  177. var currow = grd_resnlist.row;
  178. if (currow >= grd_resnlist.fixedRows && grd_resnlist.col != grd_resnlist.colref("status")) {
  179. if ( model.getValue ( "/root/hardcd/hardcd[" + currow + "]/status" ) == "Y" ) {
  180. model.setValue ( "/root/hardcd/hardcd[" + currow + "]/status", "N" );
  181. } else {
  182. model.setValue ( "/root/hardcd/hardcd[" + currow + "]/status", "Y" );
  183. }
  184. grd_resnlist.refresh();
  185. }
  186. // 기타 선택시만 상세 내용 입력 하도록
  187. if (grd_resnlist.colref("resncmt") != -1 && model.getValue("/root/hardcd/hardcd[" + currow + "]/hardcd")=="999"){
  188. if ( model.getValue ( "/root/hardcd/hardcd[" + currow + "]/status" ) == "Y" ) {
  189. grd_resnlist.col = grd_resnlist.colref("resncmt");
  190. grd_resnlist.editCell();
  191. } else {
  192. model.setValue ( "/root/hardcd/hardcd[" + currow + "]/resncmt", "" );
  193. }
  194. }
  195. ]]>
  196. </script>
  197. </datagrid>
  198. </xhtml:body>
  199. </xhtml:html>