SPMMO08000_권역외상의사호출.xrw 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/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. <trcallinfo>
  11. <trcalllist/>
  12. </trcallinfo>
  13. <cond>
  14. <maindeptcd/>
  15. <patinfo>
  16. <pid/>
  17. <nm/>
  18. <indd/>
  19. <intm/>
  20. <cretno/>
  21. <visitno/>
  22. </patinfo>
  23. </cond>
  24. </main>
  25. <init>
  26. <userlist/>
  27. <residentinfo/>
  28. </init>
  29. </root>
  30. </instance>
  31. <submission id="TRMMO08001" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/trcallinfo"/>
  32. <submission id="TRMMO06703" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/reqdata" resultref="/root/main/patinfo"/>
  33. <submission id="TXMNE05204" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/reqdata/inscallinfo" resultref="/root/tmp/result"/>
  34. <submission id="TXMNE05202" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/tmp2" resultref="/root"/>
  35. <submission id="TRMNE05203" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/reqchk" resultref="/root/tmp/calling"/>
  36. <submission id="TRMMB04102" mediatype="application/x-www-form-urlencoded" method="post"/>
  37. <submission id="TRMMO08002" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/resinfo" resultref="/root/init/userlist"/>
  38. </model>
  39. <script type="javascript" ev:event="xforms-ready">
  40. <![CDATA[
  41. fInit();
  42. ]]>
  43. </script>
  44. <script type="javascript">
  45. <![CDATA[
  46. var xSaveSetInfoPath = "/root/main/trcallinfo/trcalllist";
  47. function fInit() {
  48. // model.setValue("/root/main/cond/patinfo/pid", '3145797');
  49. // model.setValue("/root/main/cond/patinfo/nm", '김응급');
  50. // model.setValue("/root/main/cond/patinfo/indd", '20130314');
  51. // model.setValue("/root/main/cond/patinfo/intm", '1442');
  52. // model.setValue("/root/main/cond/patinfo/cretno", 1);
  53. // model.setValue("/root/main/cond/patinfo/visitno", 0);
  54. var param = opener.javascript.getParameter("SPMMO08000_param");
  55. gPARAM = param.split("▦");
  56. model.makeValue("/root/main/cond/patinfo/pid" , gPARAM[0]);
  57. model.makeValue("/root/main/cond/patinfo/nm" , gPARAM[1]);
  58. model.makeValue("/root/main/cond/patinfo/indd" , gPARAM[2]);
  59. model.makeValue("/root/main/cond/patinfo/intm" , gPARAM[3]);
  60. model.makeValue("/root/main/cond/patinfo/cretno" , gPARAM[4]);
  61. model.makeValue("/root/main/cond/patinfo/visitno", gPARAM[5]);
  62. model.removeNodeset("/root/send/reqdata");
  63. model.makeValue("/root/send/reqdata/pid", model.getValue("/root/main/cond/patinfo/pid"));
  64. model.makeValue("/root/send/reqdata/indd", model.getValue("/root/main/cond/patinfo/indd"));
  65. model.makeValue("/root/send/reqdata/cretno", model.getValue("/root/main/cond/patinfo/cretno"));
  66. model.makeValue("/root/send/reqdata/visitno", model.getValue("/root/main/cond/patinfo/visitno"));
  67. submit("TRMMO06703");
  68. model.refresh();
  69. fGetTraDrCallList();
  70. }
  71. function fGetTraDrCallList() {
  72. submit("TRMMO08001");
  73. //grd_erdrcalllist.fixedcellcheckbox(0, grd_erdrcalllist.colRef("checked")) = true;
  74. }
  75. function fClkBtnCall() {
  76. var vSCnt = 0;
  77. var vMCnt = 0;
  78. var vRCnt = 0;
  79. var sDeptCd = "";
  80. for (var iRow = 1; iRow <= getNodesetCount(xSaveSetInfoPath); iRow++) {
  81. if (model.getValue(xSaveSetInfoPath+"["+iRow+"]/checked") == "Y") {
  82. if (model.getValue(xSaveSetInfoPath+"["+iRow+"]/mainyn") == "M") {
  83. model.makeValue("/root/main/cond/maindeptcd", model.getValue(xSaveSetInfoPath+"["+iRow+"]/deptcd"));
  84. vMCnt ++;
  85. }
  86. if (model.getValue(xSaveSetInfoPath+"["+iRow+"]/resid") == ""
  87. && model.getValue(xSaveSetInfoPath+"["+iRow+"]/deptcd") != "2090000000" // 마취통증의학과
  88. && model.getValue(xSaveSetInfoPath+"["+iRow+"]/deptcd") != "2280000000" // 응급의학과
  89. && model.getValue(xSaveSetInfoPath+"["+iRow+"]/gbn") == "당직") {
  90. sDeptCd = model.getValue(xSaveSetInfoPath+"["+iRow+"]/deptcd");
  91. var nNodeCnt = getNodesetCount( xSaveSetInfoPath + "[deptcd='" + sDeptCd + "' and resid != '']" );
  92. if(nNodeCnt == 0) {
  93. vRCnt ++;
  94. }
  95. }
  96. vSCnt ++;
  97. }
  98. }
  99. if (vSCnt == 0) {
  100. messageBox("선택된 정보가 없습니다", "I999");
  101. return;
  102. }
  103. if (vMCnt == 0) {
  104. messageBox("구분이 '주'인 진료과가 반드시 존재해야 합니다", "I999");
  105. return;
  106. } else if (vMCnt > 1) {
  107. messageBox("구분이 '주'인 진료과는 1개만 가능합니다", "I999");
  108. return;
  109. } else {
  110. }
  111. if (vRCnt > 0) {
  112. messageBox("함께 호출할 전공의를 반드시 선택하세요 (응급의학과, 마취통증의학과 제외)", "I999");
  113. return;
  114. }
  115. //환자정보
  116. var pid = model.getValue("/root/main/cond/patinfo/pid");
  117. var patnm = model.getValue("/root/main/cond/patinfo/nm");
  118. var indd = model.getValue("/root/main/cond/patinfo/indd");
  119. var intm = model.getValue("/root/main/cond/patinfo/intm");
  120. var cretno = model.getValue("/root/main/cond/patinfo/cretno");
  121. var visitno = model.getValue("/root/main/cond/patinfo/visitno");
  122. //응급의학과 전화번호
  123. var cntctel = "0532006166";
  124. //주진료과
  125. var maindeptcd = model.getValue("/root/main/cond/maindeptcd");
  126. //호출구분 :
  127. var grtype = "1";
  128. var grtypenm = "";
  129. //호출전 유효성체크
  130. var params = pid + '|' + indd + '|' + cretno + '|' + visitno + '|' + intm + '|' + grtype ;
  131. if(!fIsValidErCallDr(params)) return;
  132. //==========================================================================
  133. var sSrchData = "";
  134. var sSrchHeader = "pid" + "▦"
  135. + "patnm" + "▦"
  136. + "indd" + "▦"
  137. + "cretno" + "▦"
  138. + "visitno" + "▦"
  139. + "intm" + "▦"
  140. + "grtype" + "▦" //호출구분
  141. + "grtypenm" + "▦"
  142. + "cntctel" + "▦"
  143. + "mainyn" + "▦"
  144. + "orddeptcd" + "▦"
  145. + "drid" + "▦"
  146. + "drnm" + "▦"
  147. + "mpphone" + "▦"
  148. + "gbn" + "▦"
  149. + "callgbn" + "▩" ;
  150. //체크된 각 협진과에 환자정보 attach
  151. for (var iRow = 1; iRow <= getNodesetCount(xSaveSetInfoPath); iRow++) {
  152. if (model.getValue(xSaveSetInfoPath+"["+iRow+"]/checked") == "Y") {
  153. mainyn = model.getValue(xSaveSetInfoPath+"["+iRow+"]/mainyn") ;
  154. orddeptcd = model.getValue(xSaveSetInfoPath+"["+iRow+"]/deptcd") ;
  155. drid = model.getValue(xSaveSetInfoPath+"["+iRow+"]/drid") ;
  156. drnm = model.getValue(xSaveSetInfoPath+"["+iRow+"]/drnm") ;
  157. mpphone = model.getValue(xSaveSetInfoPath+"["+iRow+"]/mpphone") ;
  158. gbn = model.getValue(xSaveSetInfoPath+"["+iRow+"]/gbn") ;
  159. callgbn = "TT";
  160. sSrchData = sSrchData
  161. + pid + "▦"
  162. + patnm + "▦"
  163. + indd + "▦"
  164. + cretno + "▦"
  165. + visitno + "▦"
  166. + intm + "▦"
  167. + grtype + "▦"
  168. + grtypenm + "▦"
  169. + cntctel + "▦"
  170. + mainyn + "▦"
  171. + orddeptcd + "▦"
  172. + drid + "▦"
  173. + drnm + "▦"
  174. + mpphone + "▦"
  175. + gbn + "▦"
  176. + callgbn + "▩" ;
  177. }
  178. }
  179. //전공의 호출정보 추가
  180. for (var iRow = 1; iRow <= getNodesetCount(xSaveSetInfoPath); iRow++) {
  181. if (model.getValue(xSaveSetInfoPath+"["+iRow+"]/checked") == "Y"
  182. && model.getValue(xSaveSetInfoPath+"["+iRow+"]/deptcd") != "2090000000"
  183. && model.getValue(xSaveSetInfoPath+"["+iRow+"]/deptcd") != "2280000000"
  184. && !isNull(model.getValue(xSaveSetInfoPath+"["+iRow+"]/resid") )
  185. && model.getValue(xSaveSetInfoPath+"["+iRow+"]/gbn") == "당직") {
  186. mainyn = "S";
  187. orddeptcd = model.getValue(xSaveSetInfoPath+"["+iRow+"]/deptcd") ;
  188. drid = model.getValue(xSaveSetInfoPath+"["+iRow+"]/resid") ;
  189. drnm = model.getValue(xSaveSetInfoPath+"["+iRow+"]/resnm") ;
  190. mpphone = model.getValue(xSaveSetInfoPath+"["+iRow+"]/resno") ;
  191. gbn = model.getValue(xSaveSetInfoPath+"["+iRow+"]/gbn") ;
  192. callgbn = "TT";
  193. sSrchData = sSrchData
  194. + pid + "▦"
  195. + patnm + "▦"
  196. + indd + "▦"
  197. + cretno + "▦"
  198. + visitno + "▦"
  199. + intm + "▦"
  200. + grtype + "▦"
  201. + grtypenm + "▦"
  202. + cntctel + "▦"
  203. + mainyn + "▦"
  204. + orddeptcd + "▦"
  205. + drid + "▦"
  206. + drnm + "▦"
  207. + mpphone + "▦"
  208. + gbn + "▦"
  209. + callgbn + "▩" ;
  210. }
  211. }
  212. model.makeValue("/root/send/reqdata/inscallinfo", sSrchHeader + sSrchData);
  213. submit("TXMNE05204");
  214. fInit();
  215. }
  216. function fIsValidErCallDr (params) {
  217. var paramArr = params.split('|');
  218. var pid = paramArr[0];
  219. var indd = paramArr[1];
  220. var cretno = paramArr[2];
  221. var visitno = paramArr[3];
  222. var intm = paramArr[4];
  223. var grtype = paramArr[5];
  224. //환자정보가 존재하지 않으면 호출 되지 않게 blocking
  225. if(pid == '' || indd == '' || cretno == '' || visitno == '' || intm == ''){
  226. messageBox('환자정보가 존재하지 않아 호출 할 수 없습니다.', 'E');
  227. return false;
  228. }
  229. //호출구분선택
  230. if(grtype == ''){
  231. messageBox('호출구분을 선택하십시오.', 'E');
  232. return false;
  233. }
  234. //=========================================================================
  235. //호출진행중이면 호출이 되지않게 blocking-20090618
  236. var callingyn = "";
  237. model.makeValue("/root/send/reqchk/pid", pid);
  238. model.makeValue("/root/send/reqchk/indd", indd);
  239. model.makeValue("/root/send/reqchk/cretno", cretno);
  240. model.makeValue("/root/send/reqchk/visitno", visitno);
  241. model.makeValue("/root/send/reqchk/grtype", grtype);
  242. if(!submit("TRMNE05203")){
  243. messageBox('호출 중 체크를 실패하였습니다.', 'E999');
  244. return false;
  245. } else{
  246. callingyn = model.getValue("/root/tmp/calling/calling/callingyn");
  247. if(callingyn == "Y"){
  248. messageBox("호출이 진행중입니다.\n 잠시 후 다시 시도해 주시기 바랍니다.", "I");
  249. return false;
  250. }
  251. }
  252. return true;
  253. }
  254. ]]>
  255. </script>
  256. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  257. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  258. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  259. <script type="javascript" src="../../../emr/prcpmngtweb/js/MMO001.js"/>
  260. </xhtml:head>
  261. <xhtml:body pagewidth="840" pageheight="400" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  262. <datagrid id="grd_erdrcalllist" nodeset="/root/main/trcallinfo/trcalllist" allowselection="false" autoresize="true" backcoloralternate="#ffffff" caption="선택^구분^의사^의사^진료과^전화번호^근무형태^duty^당직일자^전공의^전공의^전공의|선택^구분^사번^이름^진료과^전화번호^근무형태^duty^당직일자^사번^이름^전화번호" colsep="^" colwidth="50, 45, 50, 65, 100, 80, 70, 60, 80, 50, 70, 80" mergecellsfixedrows="bycolrec" rowsep="|" navindex="5" style="left:0px; top:65px; width:820px; height:275px; ">
  263. <col checkvalue="Y,N" disabled="true" ref="checked" type="checkbox"/>
  264. <col checkvalue="M,S" ref="mainyn" type="combo" style="text-align:center; ">
  265. <choices>
  266. <item>
  267. <label>주</label>
  268. <value>M</value>
  269. </item>
  270. <item>
  271. <label>부</label>
  272. <value>S</value>
  273. </item>
  274. </choices>
  275. </col>
  276. <col ref="drid"/>
  277. <col ref="drnm"/>
  278. <col ref="deptnm"/>
  279. <col ref="mpphone"/>
  280. <col ref="gbn"/>
  281. <col ref="duty"/>
  282. <col ref="workdd" format="yyyy-mm-dd"/>
  283. <col ref="resid"/>
  284. <col ref="resnm" type="inputbutton"/>
  285. <col ref="resno"/>
  286. <script type="javascript" ev:event="xforms-value-changed">
  287. <![CDATA[
  288. for (var iRow = 1; iRow <= getNodesetCount(xSaveSetInfoPath); iRow++) {
  289. if (model.getValue(xSaveSetInfoPath+"["+iRow+"]/gbn") != "당직" && model.getValue(xSaveSetInfoPath+"["+iRow+"]/gbn") != "OnCall") {
  290. model.setValue(xSaveSetInfoPath+"["+iRow+"]/checked", "Y");
  291. model.setValue(xSaveSetInfoPath+"["+iRow+"]/mainyn", "S");
  292. }
  293. }
  294. ]]>
  295. </script>
  296. <script type="javascript" ev:event="onbuttonclick">
  297. <![CDATA[
  298. var row = grd_erdrcalllist.row - 1;
  299. var deptcd = model.getValue(xSaveSetInfoPath+"[" + row + "]/deptcd");
  300. var workdd = model.getValue(xSaveSetInfoPath+"[" + row + "]/workdd");
  301. var resid = model.getValue(xSaveSetInfoPath+"[" + row + "]/resid");
  302. var nNodeCnt = getNodesetCount( xSaveSetInfoPath + "[deptcd='" + deptcd + "' and resid != '']" );
  303. if(isNull(resid) && nNodeCnt > 0) {
  304. messageBox("해당과에 등록된 전공의가 존재 합니다.", "I999");
  305. return;
  306. }
  307. model.removeNodeset("/root/send/resinfo");
  308. model.makeValue("/root/send/resinfo/deptcd", deptcd);
  309. model.makeValue("/root/send/resinfo/workdd", workdd);
  310. submit("TRMMO08002");
  311. //mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist", deptcd, "0330", '', 'A');
  312. model.refresh();
  313. group1.visible = true;
  314. ]]>
  315. </script>
  316. </datagrid>
  317. <caption id="caption2" class="tit_2" style="left:0px; top:39px; width:290px; height:16px; vertical-align:middle; ">권역외상센터 당직 및 OnCall 의사 호출</caption>
  318. <line id="line5" class="line_1" style="x1:0px; y1:60px; x2:820px; y2:60px; "/>
  319. <button id="btn_call" class="btn5_letter2" navindex="4" style="left:778px; top:35px; width:42px; height:19px; ">
  320. <caption>호출</caption>
  321. <script type="javascript" ev:event="DOMActivate">
  322. <![CDATA[
  323. fClkBtnCall();
  324. ]]>
  325. </script>
  326. </button>
  327. <caption id="caption1" style="left:10px; top:350px; width:278px; height:20px; ">※ 구분이 '주'인 진료과가 반드시 존재해야 합니다.</caption>
  328. <caption id="cap_patinfo" ref="/root/main/patinfo/patinfo" style="left:0px; top:10px; width:730px; height:20px; font-size:12pt; font-weight:bold; color:#3366ff; vertical-align:middle; "/>
  329. <button id="button1" class="btn2_letter13" navindex="4" style="left:613px; top:35px; width:163px; height:19px; ">
  330. <caption>호출 현황 조회 및 도착 등록</caption>
  331. <script type="javascript" ev:event="DOMActivate">
  332. <![CDATA[
  333. var pid = model.getValue("/root/send/reqdata/pid" );
  334. var orddd = model.getValue("/root/send/reqdata/indd" );
  335. var cretno = model.getValue("/root/send/reqdata/cretno" );
  336. var visitno = model.getValue("/root/send/reqdata/visitno" );
  337. var param = pid + "▦" + orddd + "▦" + cretno + "▦" + visitno;
  338. setParameter("SPMMO06700_param", param);
  339. modal("SPMMO06700");
  340. ]]>
  341. </script>
  342. </button>
  343. <group id="group1" visibility="hidden" style="left:525px; top:135px; width:280px; height:40px; background-color:#ccffcc; border-color:#99cc00; border-style:solid; ">
  344. <select1 id="combo1" ref="/root/init/residentinfo" appearance="minimal" style="left:80px; top:10px; width:100px; height:19px; ">
  345. <choices>
  346. <itemset nodeset="/root/init/userlist">
  347. <label ref="drnm"/>
  348. <value ref="drid"/>
  349. </itemset>
  350. </choices>
  351. </select1>
  352. <caption id="caption3" class="tit_2" style="left:15px; top:10px; width:80px; height:20px; ">전공의</caption>
  353. <button id="button3" class="btn2_letter2" navindex="16" style="left:184px; top:10px; width:42px; height:19px; ">
  354. <caption>확인</caption>
  355. <script type="javascript" ev:event="DOMActivate">
  356. <![CDATA[
  357. var row = grd_erdrcalllist.row - 1;
  358. var drid = combo1.value;
  359. var drnm = model.getValue("/root/init/userlist[drid = " + drid + "]/drnm");
  360. var mpphonno = model.getValue("/root/init/userlist[drid = " + drid + "]/mpphonno");
  361. if (drnm == "") {
  362. model.makeValue(xSaveSetInfoPath+"[" + row + "]/resid", "");
  363. model.makeValue(xSaveSetInfoPath+"[" + row + "]/resnm", "");
  364. model.makeValue(xSaveSetInfoPath+"[" + row + "]/resno", "");
  365. } else {
  366. model.makeValue(xSaveSetInfoPath+"[" + row + "]/resid", drid);
  367. model.makeValue(xSaveSetInfoPath+"[" + row + "]/resnm", drnm);
  368. model.makeValue(xSaveSetInfoPath+"[" + row + "]/resno", mpphonno);
  369. }
  370. grd_erdrcalllist.refresh();
  371. group1.visible = false;
  372. ]]>
  373. </script>
  374. </button>
  375. <button id="button4" class="btn2_letter2" navindex="17" style="left:228px; top:10px; width:42px; height:19px; ">
  376. <caption>취소</caption>
  377. <script type="javascript" ev:event="DOMActivate">
  378. <![CDATA[
  379. group1.visible = false;
  380. ]]>
  381. </script>
  382. </button>
  383. </group>
  384. </xhtml:body>
  385. </xhtml:html>