SMLBP01900_혈액원NATFile결과전송.xrw 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <!--
  3. * 제 목 : SMLBP01900_혈액원NATFile결과전송.xrw
  4. * 설 명 : 혈액원NATFile결과전송
  5. * 설 계 자 : (주)에이씨케이 - 박정은
  6. * 작 성 자 : (주)에이씨케이 - 박정은
  7. * 작 성 일 : 2008. 02. 20
  8. * 수정이력 :
  9. * 기 타 :
  10. -->
  11. <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
  12. <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">
  13. <xhtml:head>
  14. <xhtml:title>혈액원NATFile결과전송</xhtml:title>
  15. <model id="model1">
  16. <instance id="instance1">
  17. <root>
  18. <main>
  19. <rsltlist>
  20. <no/>
  21. <dondt/>
  22. <rsltdt/>
  23. <blodno/>
  24. <dongbn/>
  25. <rsltgbn/>
  26. <hcvrslt/>
  27. <hcvdc/>
  28. <hivrslt/>
  29. <hivdc/>
  30. <htlvrslt/>
  31. <htlvdc/>
  32. <bcno/>
  33. <n01/>
  34. <n02/>
  35. <n03/>
  36. <Q/>
  37. <R/>
  38. </rsltlist>
  39. <drv/>
  40. <folder/>
  41. <getUsernm/>
  42. <bcnolist>
  43. <bcno/>
  44. <natno/>
  45. <n01/>
  46. <n02/>
  47. <n03/>
  48. </bcnolist>
  49. <!--
  50. <rslt>
  51. <resultyn>
  52. <bcnoall/>
  53. </resultyn>
  54. </rslt>
  55. -->
  56. <rslt>
  57. <resultyn>
  58. <bcnoall>G28BY00A0|</bcnoall>
  59. </resultyn>
  60. </rslt>
  61. </main>
  62. <send>
  63. <natlist/>
  64. <grddata/>
  65. <userid/>
  66. </send>
  67. <init>
  68. </init>
  69. <hidden>
  70. <userid/>
  71. <usernm/>
  72. <drive/>
  73. <filename/>
  74. </hidden>
  75. </root>
  76. </instance>
  77. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  78. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  79. <script type="javascript" ev:event="xforms-ready">
  80. <![CDATA[
  81. //초기화
  82. fSetInit();
  83. ]]>
  84. </script>
  85. <submission id="TRLZZ00104" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/main/getUsernm"/>
  86. <submission id="TRLBP01901" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/main/bcnolist"/>
  87. <submission id="TXLBP01901" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/main/rslt"/>
  88. </model>
  89. <script type="javascript">
  90. <![CDATA[
  91. //초기화
  92. function fSetInit() {
  93. model.resetInstanceNode("/root/hidden");
  94. model.removeNodeset("/root/main/rsltlist");
  95. grd_natrslt.rebuild();
  96. model.setFocus("ipt_userid");
  97. model.refresh();
  98. }
  99. // 존재하는 drives 안씀
  100. function fGetDrive(){
  101. var fso, s, n, e, x;
  102. var i = 0;
  103. fso = new ActiveXObject("Scripting.FileSystemObject");
  104. e = new Enumerator(fso.Drives);
  105. s = "";
  106. for (; !e.atEnd(); e.moveNext()){
  107. x = e.item();
  108. i++;
  109. s = x.DriveLetter;
  110. model.makeValue("/root/main/drv/drvlist["+i+"]/nm" , x);
  111. model.makeValue("/root/main/drv/drvlist["+i+"]/cd" , s);
  112. }
  113. return(s);
  114. }
  115. // folder 가져오기 안씀
  116. function fGetFolderList(folderspec){
  117. var folderspec = folderspec + ":";
  118. var fso, f, fc, s;
  119. fso = new ActiveXObject("Scripting.FileSystemObject");
  120. f = fso.GetFolder(folderspec);
  121. fc = new Enumerator(f.SubFolders);
  122. s = "";
  123. for (; !fc.atEnd(); fc.moveNext())
  124. {
  125. }
  126. return(s);
  127. }
  128. //키이벤트 엔터키 입력시
  129. function fKeyEvent(){
  130. if(event.keyCode == "13"){
  131. // 등록번호 바코드 리딩시
  132. if(event.target == "ipt_userid"){
  133. model.setvalue("/root/hidden/userid", (ipt_userid.currentText).substr(0,8));
  134. // 입력자 정보
  135. fGetUserInfo();
  136. ipt_userid.selBegin = 0;
  137. ipt_userid.selEnd = ipt_userid.currentText.length;
  138. }
  139. }
  140. }
  141. // 입력자 정보
  142. function fGetUserInfo(){
  143. if(model.getvalue("/root/hidden/userid") != ""){
  144. model.makeValue("/root/send/userid" , model.getvalue("/root/hidden/userid"));
  145. submit("TRLZZ00104");
  146. model.setValue("/root/hidden/usernm", model.getValue("/root/main/getUsernm/usernm"));
  147. opt_usernm.refresh();
  148. }
  149. }
  150. // 파일 가져오기
  151. function fGetFileName(){
  152. if(model.getvalue("/root/hidden/usernm") == ""){
  153. messageBox("입력자 ID 를 입력하세요!!", "E");
  154. model.setFocus("ipt_userid");
  155. return;
  156. }
  157. var fileName = window.fileDialog("open", ",", false, "", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls|CSV Files(*.csv)|*.csv|Excel Files(*.xlsx)|*.xlsx");
  158. if (fileName == "" || fileName == null) {
  159. messageBox("입고할 파일을 선택하세요", "I");
  160. return;
  161. }
  162. model.setValue("/root/hidden/filename", fileName);
  163. ipt_filename.refresh();
  164. model.resetInstanceNode("/root/main/rsltlist");
  165. var sStr = fileName.substring(fileName.length - 4);
  166. if(sStr.toLowerCase() == ".csv"){ //csv파일일때
  167. fileName = fileName.substring(0, fileName.length - 4) + sStr.toLowerCase();
  168. grd_natrslt.loadText(fileName);
  169. }else if(sStr.toLowerCase() == ".xls" || sStr.toLowerCase() == "xlsx"){ //excel파일일때
  170. fileName = fileName.substring(0, fileName.length - 4) + sStr.toLowerCase();
  171. grd_natrslt.loadExcel(fileName);
  172. }else{
  173. messageBox("Excel파일을 선택하세요", "E");
  174. return;
  175. }
  176. if(model.getValue("/root/main/rsltlist[" + 1 + "]/R") == "ALT"){ //ALT 일때는 HTLV결과임
  177. for(i = 1; i < (grd_natrslt.rows-1); i++){
  178. model.setValue("/root/main/rsltlist[" + i + "]/dongbn" , model.getValue("/root/main/rsltlist[" + i + "]/blodno" )); //혈액번호에 들어가있는 헌혈종류
  179. model.setValue("/root/main/rsltlist[" + i + "]/blodno" , model.getValue("/root/main/rsltlist[" + i + "]/rsltdt" )); //최종검사일에 들어가있는 혈액번호
  180. model.setValue("/root/main/rsltlist[" + i + "]/rsltdt" , "-");
  181. model.setValue("/root/main/rsltlist[" + i + "]/rsltgbn" , "완료");
  182. model.setValue("/root/main/rsltlist[" + i + "]/hcvrslt" , "");
  183. model.setValue("/root/main/rsltlist[" + i + "]/hcvdc" , "");
  184. model.setValue("/root/main/rsltlist[" + i + "]/hivrslt" , "");
  185. model.setValue("/root/main/rsltlist[" + i + "]/hivdc" , "");
  186. model.setValue("/root/main/rsltlist[" + i + "]/htlvrslt" , model.getValue("/root/main/rsltlist[" + i + "]/Q" )); //엑셀 Q컬럼에 있는 HTLV결과
  187. model.setValue("/root/main/rsltlist[" + i + "]/htlvdc" , "-");
  188. model.setValue("/root/main/rsltlist[" + i + "]/bcno" , "");
  189. model.setValue("/root/main/rsltlist[" + i + "]/n01" , "");
  190. model.setValue("/root/main/rsltlist[" + i + "]/n02" , "");
  191. model.setValue("/root/main/rsltlist[" + i + "]/n03" , "");
  192. }
  193. grd_natrslt.deleteRow(2); //제목 저장시 iud : d로 해서 넘어감
  194. }else{ //NAT결과일때
  195. //NAT일때는 deleteRow 2번만 함 - 제목이 두줄
  196. grd_natrslt.deleteRow(2); //제목
  197. grd_natrslt.deleteRow(2); //제목 지우기
  198. }
  199. //혈액번호로 바코드번호 및 해당 결과 조회
  200. fGetNatnoBcno();
  201. }
  202. // 저장
  203. function fExeNatRslt(){
  204. //alert("개발중");
  205. var grddata = grd_natrslt.getUpdateData();
  206. model.setValue("/root/send/grddata", grddata);
  207. model.setValue("/root/send/userid", model.getValue("/root/hidden/userid"));
  208. submit("TXLBP01901");
  209. // 결과저장된 bcno 표시바꾸기
  210. fSetRsltYnBcno();
  211. }
  212. // 결과저장된 bcno 표시바꾸기
  213. function fSetRsltYnBcno(){
  214. var bcnoall = model.getValue("/root/main/rslt/resultyn/bcnoall"); // ex : G28BY0010|G28BY0020|
  215. var bcno1 = bcnoall.split("|");
  216. for(i=0; i<(bcno1.length-1); i++){
  217. //alert("aaa= " + bcno1[i]);
  218. setRowStyle("grd_natrslt", "0", bcno1[i], "bcno", "");
  219. }
  220. grd_natrslt.rebuild();
  221. }
  222. // 엑셀로딩후 natno에 맞는 bcno 가져오기
  223. function fGetNatnoBcno(){
  224. var natlist = "";
  225. if(grd_natrslt.rows < 2){
  226. return;
  227. }
  228. for(i=1; i<(grd_natrslt.rows-1); i++){
  229. natlist += "'" + model.getValue("/root/main/rsltlist["+i+"]/blodno") + "'"; // $natlist$
  230. if(i < (grd_natrslt.rows-2)){
  231. natlist += ",";
  232. }
  233. }
  234. //alert("natlist= " + natlist);
  235. model.setValue("/root/send/natlist", natlist);
  236. // natno에 맞는 bcno 조회
  237. if(submit("TRLBP01901")){
  238. var row2 = 1;
  239. var count = getNodesetCount("/root/main/bcnolist") ;
  240. for(j=1; j<(grd_natrslt.rows-1); j++){
  241. for(z=0; z<count; z++){
  242. if(model.getValue("/root/main/rsltlist["+j+"]/blodno") == model.getValue("/root/main/bcnolist["+(z+1)+"]/natno")){
  243. model.setValue("/root/main/rsltlist["+j+"]/bcno", model.getValue("/root/main/bcnolist["+(z+1)+"]/bcno"));
  244. //일부 항목 등록 후 나머지 항목 등록시 이미 들어간 항목도 같이 보고 되어 수정보고되므로 이를 방지하기 위해 결과 등록시 app단에서 비교하여 등록하기 위해 조회함 20090417 승현
  245. model.setValue("/root/main/rsltlist["+j+"]/n01", model.getValue("/root/main/bcnolist["+(z+1)+"]/n01")); //등록된 LBD10101 결과
  246. model.setValue("/root/main/rsltlist["+j+"]/n02", model.getValue("/root/main/bcnolist["+(z+1)+"]/n02")); //등록된 LBD10102
  247. model.setValue("/root/main/rsltlist["+j+"]/n03", model.getValue("/root/main/bcnolist["+(z+1)+"]/n03")); //등록된 LBD10103
  248. }
  249. }
  250. //row2++;
  251. }
  252. for(k=1; k<grd_natrslt.rows; k++){
  253. grd_natrslt.rowStatus(k) = 1;
  254. }
  255. }
  256. }
  257. ]]>
  258. </script>
  259. </xhtml:head>
  260. <xhtml:body style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  261. <group id="group3" style="left:0px; top:13px; width:1195px; height:27px; ">
  262. <button id="btn_cle" class="btn4_letter3" style="left:1127px; top:3px; width:68px; height:22px; ">
  263. <caption>초기화</caption>
  264. <script type="javascript" ev:event="DOMActivate">
  265. <![CDATA[
  266. //초기화
  267. fSetInit();
  268. ]]>
  269. </script>
  270. </button>
  271. <line id="line1" class="line_6" style="x1:0px; y1:25px; x2:1195px; y2:25px; "/>
  272. <button id="button42" class="btn4_letter2" style="left:1068px; top:3px; width:56px; height:22px; ">
  273. <caption>저장</caption>
  274. <script type="javascript" ev:event="DOMActivate">
  275. <![CDATA[
  276. //저장
  277. fExeNatRslt();
  278. ]]>
  279. </script>
  280. </button>
  281. </group>
  282. <group id="group4" style="left:0px; top:40px; width:1195px; height:744px; ">
  283. <caption id="caption11" class="tit_2" style="left:5px; top:10px; width:94px; height:14px; ">입력자 정보</caption>
  284. <line id="line7" class="line_1" style="x1:0px; y1:25px; x2:250px; y2:25px; "/>
  285. <caption id="caption3" class="tit_2" style="left:260px; top:10px; width:109px; height:13px; ">결과목록</caption>
  286. <line id="line2" class="line_1" style="x1:255px; y1:25px; x2:1194px; y2:25px; "/>
  287. <caption id="caption6" class="cell_1" style="left:0px; top:54px; width:100px; height:23px; vertical-align:middle; ">입력자 이름</caption>
  288. <line id="line8" class="line_3" style="x1:0px; y1:76px; x2:250px; y2:76px; "/>
  289. <caption id="caption1" class="tit_2" style="left:5px; top:86px; width:94px; height:13px; ">파일 선택</caption>
  290. <line id="line3" class="line_1" style="x1:0px; y1:101px; x2:250px; y2:101px; "/>
  291. <button id="button16" class="btn2_letter7" visibility="hidden" style="left:153px; top:725px; width:97px; height:19px; ">
  292. <caption>NAT File 변환</caption>
  293. </button>
  294. <line id="line14" class="line_2" style="x1:0px; y1:52px; x2:250px; y2:52px; "/>
  295. <line id="line4" class="line_3" style="x1:0px; y1:128px; x2:250px; y2:128px; "/>
  296. <caption id="caption12" class="cell_1" style="left:0px; top:30px; width:100px; height:23px; vertical-align:middle; ">입력자 ID</caption>
  297. <input id="ipt_userid" ref="/root/hidden/userid" accesskey="f1" class="input_s_essential" appearance="input" style="left:103px; top:31px; width:147px; height:19px; ">
  298. <script type="javascript" ev:event="onkeypress">
  299. <![CDATA[
  300. fKeyEvent();
  301. ]]>
  302. </script>
  303. </input>
  304. <output id="opt_usernm" ref="/root/hidden/usernm" class="output_fix" style="left:103px; top:55px; width:147px; height:19px; "/>
  305. <button id="img1" class="icon_search" appearance="button" style="left:232px; top:108px; width:16px; height:16px; ">
  306. <script type="javascript" ev:event="DOMActivate">
  307. <![CDATA[
  308. //결과 파일명 가져오기
  309. fGetFileName();
  310. ]]>
  311. </script>
  312. <caption/>
  313. </button>
  314. <datagrid id="grd_natrslt" nodeset="/root/main/rsltlist" caption="No^채혈일^최종검사일^혈액번호^헌혈종류^검사단계^HCV^HCV^HIV^HIV^HTLV^HTLV^바코드|No^채혈일^최종검사일^혈액번호^헌혈종류^검사단계^결과^D/C^결과^D/C^결과^D/C^바코드^LBD10101^LBD10102^LBD10103" colsep="^" colwidth="30, 85, 85, 90, 0, 70, 90, 60, 90, 60, 90, 60, 100, 100, 100, 100" dataheight="23" mergecellsfixedrows="bycolrec" rowheader="update" rowheight="23" rowsep="|" fixed.background-image="../../../com/commonweb/images/grid_bg.gif" style="left:255px; top:30px; width:939px; height:714px; ">
  315. <col ref="no"/>
  316. <col ref="dondt"/>
  317. <col ref="rsltdt"/>
  318. <col ref="blodno"/>
  319. <col ref="dongbn"/>
  320. <col ref="rsltgbn"/>
  321. <col disabled="true" ref="hcvrslt" type="combo">
  322. <choices>
  323. <item>
  324. <label>Negative</label>
  325. <value>-</value>
  326. </item>
  327. <item>
  328. <label>Positive</label>
  329. <value>+</value>
  330. </item>
  331. <item>
  332. <label/>
  333. <value/>
  334. </item>
  335. </choices>
  336. </col>
  337. <col ref="hcvdc"/>
  338. <col disabled="true" ref="hivrslt" type="combo">
  339. <choices>
  340. <item>
  341. <label>Negative</label>
  342. <value>-</value>
  343. </item>
  344. <item>
  345. <label>Positive</label>
  346. <value>+</value>
  347. </item>
  348. <item>
  349. <label/>
  350. <value/>
  351. </item>
  352. </choices>
  353. </col>
  354. <col ref="hivdc"/>
  355. <col disabled="true" ref="htlvrslt" type="combo">
  356. <choices>
  357. <item>
  358. <label>Negative</label>
  359. <value>-</value>
  360. </item>
  361. <item>
  362. <label>Positive</label>
  363. <value>+</value>
  364. </item>
  365. <item>
  366. <label/>
  367. <value/>
  368. </item>
  369. </choices>
  370. </col>
  371. <col ref="htlvdc"/>
  372. <col ref="bcno"/>
  373. <col ref="n01" visibility="hidden"/>
  374. <col ref="n02" visibility="hidden"/>
  375. <col ref="n03" visibility="hidden"/>
  376. <col ref="Q" visibility="hidden"/>
  377. <col ref="R" visibility="hidden"/>
  378. </datagrid>
  379. <input id="ipt_filename" ref="/root/hidden/filename" style="left:0px; top:107px; width:230px; height:19px; "/>
  380. <button id="button1" class="btn2_letter2" visibility="hidden" style="left:1140px; top:5px; width:42px; height:19px; ">
  381. <caption>test</caption>
  382. <script type="javascript" ev:event="DOMActivate">
  383. <![CDATA[
  384. //fGetNatnoBcno();
  385. fSetRsltYnBcno();
  386. ]]>
  387. </script>
  388. </button>
  389. </group>
  390. <group id="grp_tle" style="left:0px; top:0px; width:1195px; height:13px; ">
  391. <caption id="caption5" class="tit_1" style="left:0px; top:0px; width:186px; height:13px; ">혈액원 NAT File 결과 전송</caption>
  392. </group>
  393. </xhtml:body>
  394. </xhtml:html>