SMMNE09400_응급실재방문환자관리.xrw 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
  3. <xhtml:html xmlns:ex="http://www.comsquare.co.kr/xforms/excel" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ms="urn:schemas-microsoft-com:xslt" xmlns:my="http://www.comsquare.co.kr/example" 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" xmlns:cs="http://www.comsquare.co.kr/xforms">
  4. <xhtml:head>
  5. <xhtml:title>응급실 재방문 환자 관리</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <patlist/>
  11. </main>
  12. <cond>
  13. <workdd/>
  14. <status>1</status>
  15. <pid/>
  16. </cond>
  17. <send>
  18. <patlist/>
  19. </send>
  20. <temp/>
  21. <init/>
  22. </root>
  23. </instance>
  24. <script type="javascript" ev:event="xforms-ready">
  25. <![CDATA[
  26. fInit();
  27. ]]>
  28. </script>
  29. <submission id="TRMNE09401" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/srchdata" resultref="/root/main/patlist"/>
  30. <submission id="TRMNE09402" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/srchdata" resultref="/root/temp/authinfo"/>
  31. <submission id="TRMNE09403" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/smsinfo" resultref="/root/temp/drinfo"/>
  32. <submission id="TXMNE09401" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/savedata" resultref="/root/temp"/>
  33. <submission id="TXMNE00205" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/smsmsg" replace="instance" resultref="/root/temp"/>
  34. </model>
  35. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  36. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  37. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  38. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  39. <script type="javascript" src="../../../emr/carecomweb/js/CareCom.js"/>
  40. <script type="javascript" src="../../../emr/carecomweb/js/ENRSignEngine.js"/>
  41. <script type="javascript">
  42. <![CDATA[
  43. function fInit() {
  44. var workdd = getCurrentDate();
  45. model.setValue("/root/cond/workdd", workdd);
  46. fBtnStatus();
  47. model.refresh();
  48. }
  49. function fSearch() {
  50. //grd_patlist.rebuild();
  51. model.removeNodeset("/root/send/srchdata");
  52. model.makeValue("/root/send/srchdata/workdd", model.getValue("/root/cond/workdd"));
  53. model.makeValue("/root/send/srchdata/status", model.getValue("/root/cond/status"));
  54. model.makeValue("/root/send/srchdata/pid", model.getValue("/root/cond/pid"));
  55. submit("TRMNE09401");
  56. model.refresh();
  57. }
  58. function fSave(param) {
  59. if (param == "save") {
  60. var rtnval = messageBox("지정한 입실일시 이후 마감 전인 모든 식사 처방이 D/C처리 됩니다\r\n\r\n입실 처리 하시겠습니까?", "Q999");
  61. if (rtnval != "6") {
  62. return;
  63. }
  64. }
  65. model.removeNodeset("/root/send/savedata");
  66. var cnt = getNodesetCnt(model, "/root/main/patlist");
  67. var sHeader = "gbn▦pid▦hngnm▦indd▦cretno▦appdd▦todd▦instcd▦chosdd▦chostm▩";
  68. var sData = "";
  69. var pid, hngnm, chosdd, chostm;
  70. for(var i = 1; i <= cnt; i++) {
  71. if (model.getValue("/root/main/patlist[" + i + "]/chk") == "Y") {
  72. pid = model.getValue("/root/main/patlist[" + i + "]/pid");
  73. hngnm = model.getValue("/root/main/patlist[" + i + "]/hngnm");
  74. indd = model.getValue("/root/main/patlist[" + i + "]/indd");
  75. cretno = model.getValue("/root/main/patlist[" + i + "]/cretno");
  76. appdd = model.getValue("/root/main/patlist[" + i + "]/appdd");
  77. todd = "99991231";
  78. chosdd = model.getValue("/root/main/patlist[" + i + "]/chosdd");
  79. chostm = model.getValue("/root/main/patlist[" + i + "]/chostm");
  80. orddeptcd = model.getValue("/root/main/patlist[" + i + "]/orddeptcd");
  81. if (param == "save" && (chosdd == "" || chostm == "")) {
  82. messageBox("[" + pid + " " + hngnm + "] 환자의 입실일시가 없습니다.", "E999");
  83. return;
  84. }
  85. sData += param + "▦"
  86. + pid + "▦"
  87. + hngnm + "▦"
  88. + indd + "▦"
  89. + cretno + "▦"
  90. + appdd + "▦"
  91. + todd + "▦"
  92. + getUserInfo("dutplceinstcd") + "▦"
  93. + chosdd + "▦"
  94. + chostm + "▦"
  95. + orddeptcd + "▩";
  96. // 응급의학과 승인하면 퇴원시 주치의에게 SMS 전송 2014.01.13
  97. if (param == "acpt") {
  98. fSendSMS(i);
  99. }
  100. }
  101. }
  102. model.makeValue("/root/send/savedata", sHeader + sData);
  103. if (submit("TXMNE09401")) {
  104. fSearch();
  105. fBtnStatus();
  106. }
  107. }
  108. function fBtnStatus() {
  109. var drflag = "", nrflag="";
  110. model.removeNodeset("/root/send/srchdata");
  111. model.makeValue("/root/send/srchdata/workdd", model.getValue("/root/cond/workdd"));
  112. if ( submit("TRMNE09402") ) {
  113. drflag = model.getValue("/root/temp/authinfo/drflag");
  114. nrflag = model.getValue("/root/temp/authinfo/nrflag");
  115. }
  116. if (getUserInfo("userid") == "ENR") {
  117. drflag = 'Y';
  118. }
  119. var status = model.getValue("/root/cond/status");
  120. if (status == "3") {
  121. btn_acpt.disabled = true;
  122. btn_cncl.disabled = true;
  123. btn_save.disabled = true;
  124. } else if (status == "2") {
  125. btn_acpt.disabled = true;
  126. if (drflag == "Y") {
  127. btn_cncl.disabled = false;
  128. } else {
  129. btn_cncl.disabled = true;
  130. }
  131. if (nrflag == "Y") {
  132. btn_save.disabled = false;
  133. } else {
  134. btn_save.disabled = true;
  135. }
  136. } else {
  137. if (drflag == "Y") {
  138. btn_acpt.disabled = false;
  139. btn_cncl.disabled = false;
  140. } else {
  141. btn_acpt.disabled = true;
  142. btn_cncl.disabled = true;
  143. }
  144. if (nrflag == "Y") {
  145. btn_save.disabled = false;
  146. } else {
  147. btn_save.disabled = true;
  148. }
  149. }
  150. fSearch();
  151. }
  152. function fSendSMS(pRow) {
  153. if ( pRow > 0 ) {
  154. var pid = model.getValue("/root/main/patlist[" + pRow + "]/pid");
  155. var hngnm = model.getValue("/root/main/patlist[" + pRow + "]/hngnm");
  156. var indd = model.getValue("/root/main/patlist[" + pRow + "]/indd");
  157. var cretno = model.getValue("/root/main/patlist[" + pRow + "]/cretno");
  158. var drid = model.getValue("/root/main/patlist[" + pRow + "]/outdrid");
  159. var drnm = model.getValue("/root/main/patlist[" + pRow + "]/outdrnm");
  160. var phonno = model.getValue("/root/main/patlist[" + pRow + "]/outdrphone");
  161. var deptnm = model.getValue("/root/main/patlist[" + pRow + "]/orddeptnm");
  162. var userid = getUserInfo("userid");
  163. if (drnm != "" && phonno != "") {
  164. var msg = "금일 퇴원한 [" + deptnm + " " + pid + " " + hngnm + "] 환자 응급실 재방문";
  165. var erno = "";
  166. if (getUserInfo("dutplceinstcd") == "031") {
  167. erno = "86100";
  168. } else {
  169. erno = "0532002100";
  170. }
  171. var rtnMsg = messageBox("환자의 퇴원 당시 주치의인 " + deptnm + " " + drnm + " 선생님에게\r\n"
  172. + "환자 재방문 관련 SMS를 발송하시겠습니까?\r\n\r\n"
  173. + "※ 내용: " + msg + "\r\n"
  174. + " 회신번호: " + erno, "Q999");
  175. if (rtnMsg == "6") {
  176. model.makeValue("/root/send/smsmsg/recvr/usernm", drnm);
  177. model.makeValue("/root/send/smsmsg/recvr/userid", drid);
  178. model.makeValue("/root/send/smsmsg/recvr/mpphonno", phonno);
  179. model.makeValue("/root/send/smsmsg/recvr/usernm", "응급의료센터");
  180. model.makeValue("/root/send/smsmsg/req/calltype", "call");
  181. model.makeValue("/root/send/smsmsg/req/msgcnts", msg);
  182. model.makeValue("/root/send/smsmsg/req/calltelno", erno);
  183. model.makeValue("/root/send/smsmsg/info/pid", pid);
  184. model.makeValue("/root/send/smsmsg/info/indd", indd);
  185. model.makeValue("/root/send/smsmsg/info/cretno", cretno);
  186. model.makeValue("/root/send/smsmsg/info/userid", userid);
  187. if (submit("TXMNE00205") ) {
  188. messageBox("메시지 전송이 ", "I002");
  189. }
  190. }
  191. }
  192. }
  193. }
  194. ]]>
  195. </script>
  196. </xhtml:head>
  197. <xhtml:body pagewidth="1025" pageheight="800" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  198. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:200px; height:15px; ">응급실 재방문 환자 관리</caption>
  199. <group id="group1" style="left:0px; top:62px; width:1005px; height:700px; ">
  200. <datagrid id="grd_patlist" nodeset="/root/main/patlist" class="datagrid2" caption="^환자번호^이름^성별/나이^진료과^진료교수^주치의^퇴원시 주치의 전화번호^퇴원시 주치의 전화번호^신청병동^신청일^입실일시^입실일시^방문횟수^caption1^진료과^진료의^신청병동^indd^cretno" colsep="^" colwidth="30, 60, 60, 60, 100, 60, 60, 90, 65, 120, 80, 79, 60, 60, 0, 0, 0, 0, 0, 0" mergecellsfixedrows="bycolrec" rowsep="|" style="left:0px; top:0px; width:1005px; height:700px; ">
  201. <col checkvalue="Y,N" ref="chk" type="checkbox"/>
  202. <col ref="pid"/>
  203. <col ref="hngnm"/>
  204. <col ref="sa" style="text-align:center; "/>
  205. <col ref="orddeptnm"/>
  206. <col ref="orddrnm"/>
  207. <col ref="outdrnm"/>
  208. <col ref="outdrphone"/>
  209. <col ref="outdrnzone"/>
  210. <col ref="prestwardnm"/>
  211. <col ref="appdd" format="yyyy-mm-dd" style="text-align:center; "/>
  212. <col ref="chosdd" type="input" format="yyyy-mm-dd" style="text-align:center; "/>
  213. <col ref="chostm" type="inputbutton" format="hh:nn"/>
  214. <col ref="visitno" style="text-align:center; "/>
  215. <col ref="outdrid"/>
  216. <col ref="orddeptcd"/>
  217. <col ref="orddrid"/>
  218. <col ref="prestwardcd"/>
  219. <col ref="indd"/>
  220. <col ref="cretno"/>
  221. <script type="javascript" ev:event="onbuttonclick">
  222. <![CDATA[
  223. var row = grd_patlist.mouseRow;
  224. var curdate = getCurrentDate();
  225. var curtime = getCurrentTime().substr(0, 4)
  226. if (row >= grd_patlist.fixedRows) {
  227. grd_patlist.valueMatrix(row, grd_patlist.colRef("chk")) = "Y";
  228. grd_patlist.valueMatrix(row, grd_patlist.colRef("chosdd")) = curdate;
  229. grd_patlist.valueMatrix(row, grd_patlist.colRef("chostm")) = curtime;
  230. grd_patlist.rowStatus(row) = 2;
  231. }
  232. grd_patlist.refresh();
  233. ]]>
  234. </script>
  235. </datagrid>
  236. </group>
  237. <group id="group3" style="left:0px; top:20px; width:1005px; height:35px; ">
  238. <shape id="roundrect1" class="roundrect_search" appearance="roundrect" style="left:0px; top:0px; width:1005px; height:35px; "/>
  239. <button id="btn_srchindxcd" class="btn1_letter2" navindex="5" style="left:714px; top:7px; width:56px; height:22px; ">
  240. <caption>조회</caption>
  241. <script type="javascript" ev:event="DOMActivate">
  242. <![CDATA[
  243. fSearch();
  244. ]]>
  245. </script>
  246. </button>
  247. <caption id="caption40" class="search_name" visibility="hidden" style="left:504px; top:10px; width:86px; height:17px; vertical-align:middle; ">등록번호 :</caption>
  248. <input id="ipt_pid" ref="/root/cond/pid" class="input_s_essential" navindex="1" visibility="hidden" style="left:595px; top:10px; width:80px; height:19px; font-weight:bold; ">
  249. <script type="javascript" ev:event="onkeydown">
  250. <![CDATA[
  251. if(event.keyCode == "13") {
  252. setInputNodeCurText();
  253. fSearch();
  254. }
  255. ]]>
  256. </script>
  257. </input>
  258. <line id="line27" class="line_4" style="x1:701px; y1:7px; x2:701px; y2:29px; "/>
  259. <caption id="caption1" class="search_name" style="left:19px; top:8px; width:86px; height:17px; vertical-align:middle; ">업무일자:</caption>
  260. <input id="input1" ref="/root/cond/workdd" class="input_s_essential" navindex="1" inputtype="date" style="left:110px; top:9px; width:105px; height:19px; font-weight:bold; text-align:center; "/>
  261. <caption id="caption3" class="search_name" style="left:248px; top:8px; width:86px; height:17px; vertical-align:middle; ">상 태:</caption>
  262. <select1 id="radio1" ref="/root/cond/status" appearance="full" cellspacing="10" cols="3" overflow="visible" style="left:313px; top:10px; width:167px; height:20px; border-style:none; ">
  263. <choices>
  264. <item>
  265. <label>신청</label>
  266. <value>1</value>
  267. </item>
  268. <item>
  269. <label>승인</label>
  270. <value>2</value>
  271. </item>
  272. <item>
  273. <label>완료</label>
  274. <value>3</value>
  275. </item>
  276. </choices>
  277. <script type="javascript" ev:event="xforms-value-changed">
  278. <![CDATA[
  279. fBtnStatus();
  280. ]]>
  281. </script>
  282. </select1>
  283. <button id="btn_acpt" class="btn1_letter2" navindex="5" style="left:770px; top:7px; width:56px; height:22px; ">
  284. <caption>승인</caption>
  285. <script type="javascript" ev:event="DOMActivate">
  286. <![CDATA[
  287. fSave("acpt");
  288. ]]>
  289. </script>
  290. </button>
  291. <button id="btn_save" class="btn1_letter4" style="left:906px; top:7px; width:80px; height:22px; ">
  292. <caption>입실확인</caption>
  293. <script type="javascript" ev:event="DOMActivate">
  294. <![CDATA[
  295. fSave("save");
  296. ]]>
  297. </script>
  298. </button>
  299. <button id="btn_cncl" class="btn1_letter4" navindex="5" style="left:826px; top:7px; width:80px; height:22px; ">
  300. <caption>승인취소</caption>
  301. <script type="javascript" ev:event="DOMActivate">
  302. <![CDATA[
  303. fSave("cancel");
  304. ]]>
  305. </script>
  306. </button>
  307. </group>
  308. <line id="line13" class="line_1" style="x1:0px; y1:57px; x2:1005px; y2:57px; "/>
  309. <caption id="caption2" style="left:960px; top:765px; width:45px; height:20px; text-align:right; ">[표]</caption>
  310. </xhtml:body>
  311. </xhtml:html>