SPMMO50100_처방사유입력.xfdl 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SPMMO50100" position="absolute 0 0 843 532" titletext="처방사유 입력" oninit="SPMMO50100_oninit" onload="SPMMO50100_onload">
  5. <Layouts>
  6. <Layout>
  7. <Static text="처방 사유 입력" position="absolute 0 0 118 20" id="caption1" class="tit_2"/>
  8. <Button position="absolute 638 512 718 532" id="button3" class="btn4" text="계속저장" onclick="button3_onclick"/>
  9. <Button position="absolute 727 512 843 532" id="btn_cncl" class="btn3" text="처방변경(닫기)" onclick="btn_cncl_onclick"/>
  10. <Static text="아래의 처방은 사유를 선택 또는 입력 하셔야 발행이 가능 합니다. 처방을 선택하면 구분에 맞는 사유가 조회 됩니다." position="absolute 130 0 837 20" id="caption4"/>
  11. <Grid id="grd_prcpresnlist" taborder="1" binddataset="ds_result_checkprcpresn" useinputpanel="false" position="absolute 0 21 843 291" oncellclick="grd_prcpresnlist_oncellclick" autofittype="col">
  12. <Formats>
  13. <Format id="default">
  14. <Columns>
  15. <Column size="137"/>
  16. <Column size="70"/>
  17. <Column size="136"/>
  18. <Column size="339"/>
  19. <Column size="30"/>
  20. <Column size="111"/>
  21. </Columns>
  22. <Rows>
  23. <Row size="24" band="head"/>
  24. <Row size="24"/>
  25. </Rows>
  26. <Band id="head">
  27. <Cell text="구분"/>
  28. <Cell col="1" text="처방코드"/>
  29. <Cell col="2" text="처방명"/>
  30. <Cell col="3" text="내용"/>
  31. <Cell col="4" text="코드"/>
  32. <Cell col="5" text="상세사유"/>
  33. </Band>
  34. <Band id="body">
  35. <Cell displaytype="combo" edittype="combo" text="bind:resnflag" combodataset="ds_resnflag" combocodecol="value" combodatacol="label"/>
  36. <Cell col="1" style="align:left middle;" text="bind:prcpcd"/>
  37. <Cell col="2" style="align:left middle;" text="bind:prcpnm" wordwrap="word"/>
  38. <Cell col="3" style="align:left middle;" text="bind:resndesc" wordwrap="word"/>
  39. <Cell col="4" text="bind:resncd"/>
  40. <Cell col="5" style="align:left middle;" text="bind:resncnts" wordwrap="word"/>
  41. </Band>
  42. </Format>
  43. </Formats>
  44. </Grid>
  45. <Static id="caption6" text="사유선택" class="tit_2" position="absolute 0 300 171 320"/>
  46. <Grid id="grd_resnlist" taborder="2" binddataset="ds_hardcd" useinputpanel="false" position="absolute 0 321 843 507" oncellclick="grd_resnlist_oncellclick" oncelldblclick="grd_resnlist_oncelldblclick" autofittype="col">
  47. <Formats>
  48. <Format id="default">
  49. <Columns>
  50. <Column size="35"/>
  51. <Column size="787"/>
  52. </Columns>
  53. <Rows>
  54. <Row size="24" band="head"/>
  55. <Row size="24"/>
  56. </Rows>
  57. <Band id="head">
  58. <Cell text="코드"/>
  59. <Cell col="1" text="상세사유"/>
  60. </Band>
  61. <Band id="body">
  62. <Cell text="bind:hardcd"/>
  63. <Cell col="1" displaytype="text" edittype="text" text="bind:hardcdnm" wordwrap="word" enable="true"/>
  64. </Band>
  65. </Format>
  66. </Formats>
  67. </Grid>
  68. <Button id="button1" taborder="3" text="사유적용" class="btn2" position="absolute 779 298 843 317" onclick="button1_onclick"/>
  69. <CheckBox id="bool_cond1" taborder="4" position="absolute 700 298 770 318" text="일괄적용" falsevalue="N" truevalue="Y"/>
  70. <Static id="caption7" text="아래의 항목에서 사유를 선택 하세요. 일괄적용 체크 되면 사유구분이 같은 항목에 대해 한번에 적용 됩니다." position="absolute 85 298 695 318"/>
  71. </Layout>
  72. </Layouts>
  73. <Objects>
  74. <Dataset id="ds_resnflag" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  75. <ColumnInfo>
  76. <Column id="label" type="STRING" size="256"/>
  77. <Column id="value" type="STRING" size="256"/>
  78. </ColumnInfo>
  79. <Rows>
  80. <Row>
  81. <Col id="label">사유</Col>
  82. <Col id="value"/>
  83. </Row>
  84. <Row>
  85. <Col id="label">처방전내병용금기</Col>
  86. <Col id="value">00</Col>
  87. </Row>
  88. <Row>
  89. <Col id="label">처방전내연령금기</Col>
  90. <Col id="value">01</Col>
  91. </Row>
  92. <Row>
  93. <Col id="label">처방전내안전성</Col>
  94. <Col id="value">02</Col>
  95. </Row>
  96. <Row>
  97. <Col id="label">처방전내최대용량</Col>
  98. <Col id="value">03</Col>
  99. </Row>
  100. <Row>
  101. <Col id="label">처방전내최대기간</Col>
  102. <Col id="value">04</Col>
  103. </Row>
  104. <Row>
  105. <Col id="label">처방전내저함량</Col>
  106. <Col id="value">05</Col>
  107. </Row>
  108. <Row>
  109. <Col id="label">처방전내임부금기</Col>
  110. <Col id="value">06</Col>
  111. </Row>
  112. <Row>
  113. <Col id="label">처방전간 병용금기</Col>
  114. <Col id="value">07</Col>
  115. </Row>
  116. <Row>
  117. <Col id="label">처방전간 성분별 중복처방</Col>
  118. <Col id="value">08</Col>
  119. </Row>
  120. <Row>
  121. <Col id="label">처방전내 치료중복</Col>
  122. <Col id="value">20</Col>
  123. </Row>
  124. <Row>
  125. <Col id="label">처방전간 치료중복</Col>
  126. <Col id="value">40</Col>
  127. </Row>
  128. <Row>
  129. <Col id="label">처방전내 2주 병용금기</Col>
  130. <Col id="value">21</Col>
  131. </Row>
  132. <Row>
  133. <Col id="label">처방전간 2주 병용금기</Col>
  134. <Col id="value">41</Col>
  135. </Row>
  136. <Row>
  137. <Col id="label">처방전내 1성분병용기간금기</Col>
  138. <Col id="value">22</Col>
  139. </Row>
  140. <Row>
  141. <Col id="label">처방전간 1성분병용기간금기</Col>
  142. <Col id="value">42</Col>
  143. </Row>
  144. <Row>
  145. <Col id="label">처방전내 병용연령성별제한</Col>
  146. <Col id="value">23</Col>
  147. </Row>
  148. <Row>
  149. <Col id="label">처방전간 병용연령성별제한</Col>
  150. <Col id="value">43</Col>
  151. </Row>
  152. <Row>
  153. <Col id="label">시럽제 처방</Col>
  154. <Col id="value">007</Col>
  155. </Row>
  156. <Row>
  157. <Col id="label">ADR(약물유해반응) 처방</Col>
  158. <Col id="value">008</Col>
  159. </Row>
  160. <Row>
  161. <Col id="label">수술예방적 항생제</Col>
  162. <Col id="value">011</Col>
  163. </Row>
  164. <Row>
  165. <Col id="label">수술예방적 항생제</Col>
  166. <Col id="value">012</Col>
  167. </Row>
  168. <Row>
  169. <Col id="label">약제 및 진료재료 적정성 심의</Col>
  170. <Col id="value">013</Col>
  171. </Row>
  172. </Rows>
  173. </Dataset>
  174. <Dataset id="ds_result_checkprcpresn" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false" oncolumnchanged="ds_result_checkprcpresn_oncolumnchanged">
  175. <ColumnInfo>
  176. <Column id="resndd" type="STRING" size="256"/>
  177. <Column id="pid" type="STRING" size="256"/>
  178. <Column id="orddd" type="STRING" size="256"/>
  179. <Column id="cretno" type="STRING" size="256"/>
  180. <Column id="orddeptcd" type="STRING" size="256"/>
  181. <Column id="ordtype" type="STRING" size="256"/>
  182. <Column id="prcpdd" type="STRING" size="256"/>
  183. <Column id="prcpno" type="STRING" size="256"/>
  184. <Column id="prcphistno" type="STRING" size="256"/>
  185. <Column id="resnflag" type="STRING" size="256"/>
  186. <Column id="prcpcd" type="STRING" size="256"/>
  187. <Column id="prcpnm" type="STRING" size="256"/>
  188. <Column id="resndesc" type="STRING" size="256"/>
  189. <Column id="delflag" type="STRING" size="256"/>
  190. <Column id="resncd" type="STRING" size="256"/>
  191. <Column id="resncnts" type="STRING" size="256"/>
  192. </ColumnInfo>
  193. </Dataset>
  194. <Dataset id="ds_send" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  195. <ColumnInfo>
  196. <Column id="hardcd" type="STRING" size="256"/>
  197. </ColumnInfo>
  198. <Rows>
  199. <Row/>
  200. </Rows>
  201. </Dataset>
  202. <Dataset id="ds_hardcd" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false" oncolumnchanged="ds_hardcd_oncolumnchanged">
  203. <ColumnInfo>
  204. <Column id="status" type="STRING" size="256" sumtext="상태값"/>
  205. <Column id="hardcd" type="STRING" size="256" sumtext="하드코드"/>
  206. <Column id="hardcdnm" type="STRING" size="256" sumtext="하드코드명"/>
  207. <Column id="resncmt" type="STRING" size="256" sumtext="상세사유"/>
  208. </ColumnInfo>
  209. </Dataset>
  210. <Dataset id="ds_init" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  211. <ColumnInfo>
  212. <Column id="cond1" type="STRING" size="256"/>
  213. </ColumnInfo>
  214. <Rows>
  215. <Row>
  216. <Col id="cond1">Y</Col>
  217. </Row>
  218. </Rows>
  219. </Dataset>
  220. </Objects>
  221. <Bind>
  222. <BindItem id="item0" compid="bool_cond1" propid="value" datasetid="ds_init" columnid="cond1"/>
  223. </Bind>
  224. <Script type="xscript4.0"><![CDATA[/***************************************************************************************
  225. * System Name :
  226. * Job Name :
  227. * Creator :
  228. * Make Date : 2014-12-10
  229. * Description :
  230. *---------------------------------------------------------------------------------------
  231. * Modify Date Modifier Modify Description
  232. *---------------------------------------------------------------------------------------
  233. * 2014-12-10 Live Converter TF->XP
  234. *
  235. *---------------------------------------------------------------------------------------
  236. ****************************************************************************************/
  237. include "com_commonxp::comm_main.xjs";
  238. function SPMMO50100_oninit(obj:Form, e:InitEventInfo)
  239. {
  240. frmf_initForm(obj);
  241. try {
  242. ds_result_checkprcpresn.copyData(arg_ds_result_checkprcpresn);
  243. } catch(e) {}
  244. }
  245. function SPMMO50100_onload(obj:Form, e:LoadEventInfo)
  246. {
  247. grdf_setToolTipBind(grd_prcpresnlist);
  248. grdf_setToolTipBind(grd_resnlist);
  249. }
  250. function ds_result_checkprcpresn_oncolumnchanged(obj:Dataset, e:DSColChangeEventInfo)
  251. {
  252. if ( e.columnid == "delflag" ) {
  253. var currow = e.row;
  254. obj.setColumn(currow, "resncd", "") ;
  255. obj.setColumn(currow, "resncnts", "") ;
  256. }
  257. }
  258. function grd_prcpresnlist_oncellclick(obj:Grid, e:GridClickEventInfo)
  259. {
  260. if ( e.col == obj.getBindCellIndex("body", "delflag") ) {
  261. return;
  262. }
  263. var resnFlag = ds_result_checkprcpresn.getColumn(e.row, "resnflag");
  264. if( resnFlag == "007") { //12세 이상 시럽제 처방 사유
  265. ds_send.setColumn(0, "hardcd", "320" );
  266. } else if ( resnFlag == "008") { //ADR(약품유해반응) 처방 사유
  267. ds_send.setColumn(0, "hardcd", "329" );
  268. } else if ( resnFlag == "011") { //수술예방적 항생제 처방사유(재원)
  269. ds_send.setColumn(0, "hardcd", "330" );
  270. } else if ( resnFlag == "012") { //수술예방적 항생제 처방사유(퇴원)
  271. ds_send.setColumn(0, "hardcd", "331" );
  272. }else if ( resnFlag == "013") { //약제 및 진료재료 적정성 심의(칠곡)
  273. ds_send.setColumn(0, "hardcd", "5609" );
  274. }else {
  275. alert("관련된 사유 정보가 존재 하지 않습니다.\n전산실(6598)로 문의 하세요.");
  276. return;
  277. }
  278. var oParam = {};
  279. oParam.id = "TRMMB16401";
  280. oParam.service = "prcpbaseapp.EnvInfoMngt";
  281. oParam.method = "reqGetHardCodeCD";
  282. oParam.inds = "req=ds_send";
  283. oParam.outds = "ds_hardcd=hardcd";
  284. oParam.async = true;
  285. oParam.callback = "cf_TRMMB16401";
  286. tranf_submit(oParam);
  287. }
  288. function cf_TRMMB16401(sSvcId, nErrorCode, sErrorMsg) {
  289. if(nErrorCode < 0) return;
  290. dsf_setDefaultVal(ds_hardcd, "status:N");
  291. }
  292. function grd_resnlist_oncellclick(obj:Grid, e:GridClickEventInfo)
  293. {
  294. var col = grd_resnlist.getBindCellIndex("body", "hardcdnm");
  295. if(e.col == col) {
  296. var currow = e.row;
  297. if ( ds_hardcd.getColumn(currow, "hardcdnm") == "(이곳에 사유입력을 하세요)"
  298. || ds_hardcd.getColumn(currow, "hardcdnm") == "기타사유 (직접입력)" ) {
  299. grd_resnlist.setCellPos(col);
  300. grd_resnlist.setCellProperty("body", col, "edittype", "text");
  301. grd_resnlist.showEditor(true);
  302. } else {
  303. grd_resnlist.setCellProperty("body", col, "edittype", "none");
  304. }
  305. }
  306. }
  307. function ds_hardcd_oncolumnchanged(obj:Dataset, e:DSColChangeEventInfo)
  308. {
  309. if(grd_resnlist.getEditText() != undefined) {
  310. var currow = e.row;
  311. if ( obj.getColumn(currow, "hardcdnm") != "(이곳에 사유입력을 하세요)"
  312. && obj.getColumn(currow, "hardcdnm") != "기타사유 (직접입력)" ) {
  313. fSelectResn();
  314. }
  315. }
  316. }
  317. function grd_resnlist_oncelldblclick(obj:Grid, e:GridClickEventInfo)
  318. {
  319. if(e.row < 0 || e.col < 0) return;
  320. fSelectResn();
  321. }
  322. function button1_onclick(obj:Button, e:ClickEventInfo)
  323. {
  324. if(ds_hardcd.rowcount != -1) {
  325. fSelectResn();
  326. }else{
  327. sysf_messageBox ( "선택된 사유가 없습니다." , "I" );
  328. }
  329. }
  330. function button3_onclick(obj:Button, e:ClickEventInfo)
  331. {
  332. var checkLength = ds_result_checkprcpresn.rowcount;
  333. var resnCnt = 0;
  334. if ( checkLength > 0 ) {
  335. for ( var i = 0; i < checkLength; i++ ) {
  336. if ( utlf_isNull(ds_result_checkprcpresn.getColumn(i, "resncd")) || utlf_isNull(ds_result_checkprcpresn.getColumn(i, "resncnts")) ) {
  337. resnCnt++;
  338. }
  339. }
  340. if (resnCnt > 0) {
  341. sysf_messageBox ( "처방사유 선택되지 않은 처방이", "I010" );
  342. return;
  343. }
  344. // 사유 정보 셋팅.
  345. for (var i = 0; i < checkLength; i++) {
  346. var row = opener.ds_result_savesujinresn.addRow();
  347. opener.ds_result_savesujinresn.setColumn(row, "resndd" , ds_result_checkprcpresn.getColumn(i, "resndd"));
  348. opener.ds_result_savesujinresn.setColumn(row, "pid" , ds_result_checkprcpresn.getColumn(i, "pid"));
  349. opener.ds_result_savesujinresn.setColumn(row, "orddd" , ds_result_checkprcpresn.getColumn(i, "orddd"));
  350. opener.ds_result_savesujinresn.setColumn(row, "cretno" , ds_result_checkprcpresn.getColumn(i, "cretno"));
  351. opener.ds_result_savesujinresn.setColumn(row, "orddeptcd" , ds_result_checkprcpresn.getColumn(i, "orddeptcd"));
  352. opener.ds_result_savesujinresn.setColumn(row, "ordtype" , ds_result_checkprcpresn.getColumn(i, "ordtype"));
  353. opener.ds_result_savesujinresn.setColumn(row, "prcpdd" , ds_result_checkprcpresn.getColumn(i, "prcpdd"));
  354. opener.ds_result_savesujinresn.setColumn(row, "prcpno" , ds_result_checkprcpresn.getColumn(i, "prcpno"));
  355. opener.ds_result_savesujinresn.setColumn(row, "prcphistno" , ds_result_checkprcpresn.getColumn(i, "prcphistno"));
  356. opener.ds_result_savesujinresn.setColumn(row, "resnflag" , ds_result_checkprcpresn.getColumn(i, "resnflag"));
  357. opener.ds_result_savesujinresn.setColumn(row, "resncd" , ds_result_checkprcpresn.getColumn(i, "resncd"));
  358. opener.ds_result_savesujinresn.setColumn(row, "resncnts" , ds_result_checkprcpresn.getColumn(i, "resncnts"));
  359. }
  360. opener.frmf_setParameter ( "SPMMO50100_rtn1", "Y" );
  361. }
  362. close();
  363. }
  364. function btn_cncl_onclick(obj:Button, e:ClickEventInfo)
  365. {
  366. opener.frmf_setParameter ( "SPMMO50100_rtn1", "N" );
  367. close();
  368. }
  369. function fSelectResn() {
  370. var resnRow = ds_hardcd.rowposition;
  371. var prcpRow = ds_result_checkprcpresn.rowposition;
  372. if (resnRow != -1 && prcpRow != -1) {
  373. var resncd = ds_hardcd.getColumn(resnRow, "hardcd") // 선택된 사유 코드
  374. var resncnts = ds_hardcd.getColumn(resnRow, "hardcdnm") // 선택된 사유 상세
  375. if(resncnts == "(이곳에 사유입력을 하세요)" || resncnts == "기타사유 (직접입력)") {
  376. var col = grd_resnlist.getBindCellIndex("body", "hardcdnm");
  377. grd_resnlist.setCellPos(col);
  378. grd_resnlist.setCellProperty("body", col, "edittype", "text");
  379. grd_resnlist.showEditor(true);
  380. } else {
  381. if(ds_init.getColumn(0, "cond1") == "Y") { // 일괄 적용이면
  382. var checkLength = ds_result_checkprcpresn.rowcount;
  383. var selectResnFlag = ds_result_checkprcpresn.getColumn(prcpRow, "resnflag"); // 처방사유구분
  384. var checkResnFlag = "";
  385. for ( var i = 0; i <checkLength; i++ ) {
  386. checkResnFlag = ds_result_checkprcpresn.getColumn(i, "resnflag" );
  387. if(selectResnFlag == checkResnFlag) {
  388. ds_result_checkprcpresn.setColumn(i, "resncd", resncd);
  389. ds_result_checkprcpresn.setColumn(i, "resncnts", resncnts);
  390. }
  391. }
  392. } else {
  393. ds_result_checkprcpresn.setColumn(prcpRow, "resncd", resncd);
  394. ds_result_checkprcpresn.setColumn(prcpRow, "resncnts", resncnts);
  395. }
  396. }
  397. }
  398. }]]></Script>
  399. </Form>
  400. </FDL>