SPMMO21800_향정신성의약품사유입력.xfdl 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.4">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SPMMO21800" position="absolute 0 0 974 556" titletext="향정신성의약품 30일 초과 처방 리스트" oninit="SPMMO21800_oninit" onload="SPMMO21800_onload">
  5. <Layouts>
  6. <Layout>
  7. <Button position="absolute 810 536 890 556" id="btn_save" class="btn4" text="계속저장" onclick="btn_save_onclick"/>
  8. <Static text="향정신성의약품 사유 입력" position="absolute 0 0 182 20" id="caption1" class="tit_2"/>
  9. <Static text="* 향정신성의약품 30일 초과 처방이 있습니다. 저장하시겠습니까 ?" position="absolute 421 536 804 556" id="caption2" style="color:red;"/>
  10. <Grid position="absolute 0 20 974 220" id="grd_prcperrlist" binddataset="ds_result_spclhdrugprcplist" oncellclick="grd_prcperrlist_oncellclick">
  11. <Formats>
  12. <Format id="default">
  13. <Columns>
  14. <Column size="0"/>
  15. <Column size="30"/>
  16. <Column size="30"/>
  17. <Column size="80"/>
  18. <Column size="205"/>
  19. <Column size="479"/>
  20. </Columns>
  21. <Rows>
  22. <Row size="24" band="head"/>
  23. <Row size="24"/>
  24. </Rows>
  25. <Band id="head">
  26. <Cell text="prcpno"/>
  27. <Cell col="1" text="선택"/>
  28. <Cell col="2" text="사유"/>
  29. <Cell col="3" text="처방코드"/>
  30. <Cell col="4" text="처방명"/>
  31. <Cell col="5" text="상세사유"/>
  32. </Band>
  33. <Band id="body">
  34. <Cell text="bind:prcpno"/>
  35. <Cell col="1" displaytype="checkbox" edittype="checkbox" text="bind:status" expr="expr:(status == &quot;Y&quot; || status == 1) ? 1 : 0"/>
  36. <Cell col="2" text="bind:resncd"/>
  37. <Cell col="3" style="align:left middle;" text="bind:prcpcd"/>
  38. <Cell col="4" displaytype="normal" edittype="none" style="align:left middle;" text="bind:prcpnm"/>
  39. <Cell col="5" style="align:left middle;" text="bind:resncnt"/>
  40. </Band>
  41. </Format>
  42. </Formats>
  43. </Grid>
  44. <Button position="absolute 894 536 974 556" id="button2" class="btn4" text="처방취소" onclick="button2_onclick"/>
  45. <Grid position="absolute 0 246 974 524" id="grd_resnlist" binddataset="ds_hardcd" oncellclick="grd_resnlist_oncellclick">
  46. <Formats>
  47. <Format id="default">
  48. <Columns>
  49. <Column size="0"/>
  50. <Column size="35"/>
  51. <Column size="486"/>
  52. <Column size="398"/>
  53. </Columns>
  54. <Rows>
  55. <Row size="24" band="head"/>
  56. <Row size="24"/>
  57. </Rows>
  58. <Band id="head">
  59. <Cell text="선택"/>
  60. <Cell col="1" text="코드"/>
  61. <Cell col="2" text="사유"/>
  62. <Cell col="3" text="상세사유"/>
  63. </Band>
  64. <Band id="body">
  65. <Cell displaytype="checkbox" edittype="checkbox" text="bind:status"/>
  66. <Cell col="1" text="bind:hardcd"/>
  67. <Cell col="2" style="align:left middle;" text="bind:hardcdnm"/>
  68. <Cell col="3" displaytype="text" edittype="text" text="bind:resncmt" editautoselect="true"/>
  69. </Band>
  70. </Format>
  71. </Formats>
  72. </Grid>
  73. <Static text="사유선택" position="absolute 0 226 171 246" id="caption3" class="tit_2"/>
  74. <Shape position="absolute 3 243 985 249" linetype="vertical" id="line1" class="line_1"/>
  75. <Radio position="absolute 316 0 511 20" id="radio1" columncount="2" codecolumn="codecolumn" datacolumn="datacolumn" onitemchanged="radio1_onitemchanged">
  76. <Dataset id="innerdataset">
  77. <ColumnInfo>
  78. <Column id="codecolumn"/>
  79. <Column id="datacolumn"/>
  80. </ColumnInfo>
  81. <Rows>
  82. <Row>
  83. <Col id="codecolumn">1</Col>
  84. <Col id="datacolumn">일괄사유입력</Col>
  85. </Row>
  86. <Row>
  87. <Col id="codecolumn">2</Col>
  88. <Col id="datacolumn">개별사유입력</Col>
  89. </Row>
  90. </Rows>
  91. </Dataset>
  92. </Radio>
  93. </Layout>
  94. </Layouts>
  95. <Objects>
  96. <Dataset id="ds_result_spclhdrugprcplist" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false" oncolumnchanged="ds_result_spclhdrugprcplist_oncolumnchanged">
  97. <ColumnInfo>
  98. <Column id="status" type="STRING" size="256"/>
  99. <Column id="resncd" type="STRING" size="256"/>
  100. <Column id="comcls" type="STRING" size="256"/>
  101. <Column id="prcpcd" type="STRING" size="256"/>
  102. <Column id="prcpnm" type="STRING" size="256"/>
  103. <Column id="dupdays" type="STRING" size="256"/>
  104. <Column id="duplprcpcd" type="STRING" size="256"/>
  105. <Column id="duplprcpnm" type="STRING" size="256"/>
  106. <Column id="duplprcpdd" type="STRING" size="256"/>
  107. <Column id="orddeptnm" type="STRING" size="256"/>
  108. <Column id="orddrnm" type="STRING" size="256"/>
  109. <Column id="rgstrnm" type="STRING" size="256"/>
  110. <Column id="resncnt" type="STRING" size="256"/>
  111. <Column id="prcpdd" type="STRING" size="256"/>
  112. <Column id="prcpno" type="STRING" size="256"/>
  113. </ColumnInfo>
  114. </Dataset>
  115. <Dataset id="ds_send" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  116. <ColumnInfo>
  117. <Column id="hardcd" type="STRING" size="256"/>
  118. </ColumnInfo>
  119. <Rows>
  120. <Row/>
  121. </Rows>
  122. </Dataset>
  123. <Dataset id="ds_hardcd" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false" oncolumnchanged="ds_hardcd_oncolumnchanged">
  124. <ColumnInfo>
  125. <Column id="status" type="STRING" size="256" sumtext="상태값"/>
  126. <Column id="hardcd" type="STRING" size="256" sumtext="하드코드"/>
  127. <Column id="hardcdnm" type="STRING" size="256" sumtext="하드코드명"/>
  128. <Column id="resncmt" type="STRING" size="256" sumtext="상세사유"/>
  129. </ColumnInfo>
  130. </Dataset>
  131. <Dataset id="ds_init" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  132. <ColumnInfo>
  133. <Column id="selcond1" type="STRING" size="256"/>
  134. </ColumnInfo>
  135. <Rows>
  136. <Row>
  137. <Col id="selcond1">1</Col>
  138. </Row>
  139. </Rows>
  140. </Dataset>
  141. </Objects>
  142. <Bind>
  143. <BindItem id="item0" compid="radio1" propid="value" datasetid="ds_init" columnid="selcond1"/>
  144. </Bind>
  145. <Script type="xscript4.0"><![CDATA[/***************************************************************************************
  146. * System Name :
  147. * Job Name :
  148. * Creator :
  149. * Make Date : 2014-12-10
  150. * Description :
  151. *---------------------------------------------------------------------------------------
  152. * Modify Date Modifier Modify Description
  153. *---------------------------------------------------------------------------------------
  154. * 2014-12-10 Live Converter TF->XP
  155. *
  156. *---------------------------------------------------------------------------------------
  157. ****************************************************************************************/
  158. include "com_commonxp::comm_main.xjs";
  159. function SPMMO21800_oninit(obj:Form, e:InitEventInfo)
  160. {
  161. frmf_initForm(obj);
  162. try {
  163. ds_result_spclhdrugprcplist.copyData(arg_ds_result_spclhdrugprcplist);
  164. } catch(e) {}
  165. }
  166. function SPMMO21800_onload(obj:Form, e:LoadEventInfo)
  167. {
  168. grdf_setToolTipBind(grd_prcperrlist);
  169. grdf_setToolTipBind(grd_resnlist);
  170. for ( var i = 1; i < ds_result_spclhdrugprcplist.rowcount; i++ ) {
  171. ds_result_spclhdrugprcplist.setColumn(i, "status", "Y") ;
  172. }
  173. // 향정신성의약품 사유 조회
  174. ds_send.setColumn(0, "hardcd", "303");
  175. var oParam = {};
  176. oParam.id = "TRMMB16401";
  177. oParam.service = "prcpbaseapp.EnvInfoMngt";
  178. oParam.method = "reqGetHardCodeCD";
  179. oParam.inds = "req=ds_send";
  180. oParam.outds = "ds_hardcd=hardcd";
  181. oParam.async = true;
  182. oParam.callback = "cf_TRMMB16401";
  183. tranf_submit(oParam);
  184. }
  185. function cf_TRMMB16401(sSvcId, nErrorCode, sErrorMsg) {
  186. if(nErrorCode < 0) return;
  187. dsf_setDefaultVal(ds_hardcd, "status:N");
  188. }
  189. function ds_result_spclhdrugprcplist_oncolumnchanged(obj:Dataset, e:DSColChangeEventInfo)
  190. {
  191. // 그리드안의 checkbox 값 변경 용도
  192. if(e.columnid == "status") {
  193. obj.setColumn(e.row, e.columnid, (e.newvalue == "Y" || e.newvalue == 1) ? "Y" : "N");
  194. var currow = e.row;
  195. var status = obj.getColumn(e.row, "status");
  196. for ( var i = currow; i < obj.rowcount - 1; i++ ) {
  197. var j = i + 1;
  198. var currprcpno = obj.getColumn(i, "prcpno");
  199. var nextprcpno = obj.getColumn(j, "prcpno");
  200. if (currprcpno == nextprcpno) {
  201. obj.setColumn(j, "status", status);
  202. } else {
  203. break;
  204. }
  205. }
  206. }
  207. }
  208. function btn_save_onclick(obj:Button, e:ClickEventInfo)
  209. {
  210. var srchLength = ds_result_spclhdrugprcplist.rowcount;
  211. var srcNodeListMainLength = opener.ds_main_prcplist.rowcount;
  212. for ( var i = 0; i < srchLength; i++ ) {
  213. var resncd = ds_result_spclhdrugprcplist.getColumn(i, "resncd" );
  214. var prcpcd = ds_result_spclhdrugprcplist.getColumn(i, "prcpcd" );
  215. var resncnt = ds_result_spclhdrugprcplist.getColumn(i, "resncnt" );
  216. if ( resncd == "-" || utlf_isNull(resncd)) {
  217. sysf_messageBox ( "[" + prcpcd + "]"+ " 향정신성 의약품 처방 사유가", "I004" );
  218. return;
  219. } else if ( resncd == "03" && (utlf_isNull(resncnt) || resncnt == "기타 - " )) {
  220. sysf_messageBox ( "[" + prcpcd + "]"+ " 기타 사유가", "I004" );
  221. return;
  222. }
  223. }
  224. for ( var i = 0; i < srchLength; i++ ) {
  225. var saveresncnt = ds_result_spclhdrugprcplist.getColumn(i, "saveresncnt");
  226. var prcpno = ds_result_spclhdrugprcplist.getColumn(i, "prcpno");
  227. var resncd = ds_result_spclhdrugprcplist.getColumn(i, "esncd");
  228. for ( var j = 0; j < srcNodeListMainLength; j++ ) {
  229. if ( prcpno == opener.ds_result_savedrprcplist.getColumn(j, "prcpno")) {
  230. opener.ds_result_savedrprcplist.setColumn(j, "tempcol19", saveresncnt);
  231. }
  232. }
  233. }
  234. opener.frmf_setParameter ( "SPMMO21800_rtn1", "Y" );
  235. close();
  236. }
  237. function grd_prcperrlist_oncellclick(obj:Grid, e:GridClickEventInfo)
  238. {
  239. if(e.row < 0 || e.col < 0) return;
  240. var srchLength = ds_result_spclhdrugprcplist.rowcount;
  241. if ( e.col != obj.getBindCellIndex("body", "status")) {
  242. if ( ds_result_spclhdrugprcplist.getColumn(e.row, "status") == "Y" ) {
  243. ds_result_spclhdrugprcplist.setColumn(e.row, "status", "N");
  244. } else {
  245. ds_result_spclhdrugprcplist.setColumn(e.row, "status", "Y");
  246. }
  247. var status = ds_result_spclhdrugprcplist.getColumn(e.row, "status");
  248. var currprcpno = ds_result_spclhdrugprcplist.getColumn(e.row, "prcpno");
  249. for ( var i = 0; i < srchLength; i++ ) {
  250. var nextprcpno = ds_result_spclhdrugprcplist.getColumn(i, "prcpno");
  251. if (currprcpno == nextprcpno) {
  252. ds_result_spclhdrugprcplist.setColumn(i, "status", status);
  253. }
  254. }
  255. }
  256. }
  257. function button2_onclick(obj:Button, e:ClickEventInfo)
  258. {
  259. opener.frmf_setParameter ( "SPMMO21800_rtn1", "N" );
  260. close();
  261. }
  262. function grd_resnlist_oncellclick(obj:Grid, e:GridClickEventInfo)
  263. {
  264. if ( ds_hardcd.getColumn(e.row, "hardcd") == "03" ) {
  265. obj.setCellPos(obj.getBindCellIndex("body", "resncmt"));
  266. obj.showEditor(true);
  267. //fSelectResn();
  268. } else {
  269. fSelectResn();
  270. }
  271. }
  272. function ds_hardcd_oncolumnchanged(obj:Dataset, e:DSColChangeEventInfo)
  273. {
  274. if(grd_resnlist.getEditText() != undefined) {
  275. fSelectResn();
  276. }
  277. }
  278. function radio1_onitemchanged(obj:Radio, e:ItemChangeEventInfo)
  279. {
  280. if ( obj.value == 1 ) {
  281. for ( var i = 0; i < ds_result_spclhdrugprcplist.rowcount; i++ ) {
  282. ds_result_spclhdrugprcplist.setColumn(i, "status", "Y");
  283. }
  284. } else {
  285. for ( var i = 0; i < ds_result_spclhdrugprcplist.rowcount; i++ ) {
  286. ds_result_spclhdrugprcplist.setColumn(i, "status", "N");
  287. }
  288. }
  289. }
  290. function fSelectResn() {
  291. var currow = ds_hardcd.rowposition;
  292. var srchLength = ds_result_spclhdrugprcplist.rowcount;
  293. for ( var i = 0; i < srchLength; i ++ ) {
  294. if ( ds_result_spclhdrugprcplist.getColumn(i, "status" ) == "Y" ) {
  295. ds_result_spclhdrugprcplist.setColumn(i, "resncd", ds_hardcd.getColumn(currow, "hardcd"));
  296. var resncnts = "instcd|pid|orddd|cretno|ordtype|orddeptcd|prcpdd|prcpno|prcphistno|resnflag|resncd|resncnts|payflagcd^" ;
  297. var pid = opener.ds_paminfo.getColumn(0, "pid");
  298. var prcpgenrflag = opener.ds_patflag.getColumn(0, "prcpgenrflag");
  299. var orddd = "";
  300. if ( prcpgenrflag == "O" ) {
  301. orddd = opener.ds_paminfo.getColumn(0, "orddd");
  302. } else {
  303. orddd = opener.ds_paminfo.getColumn(0, "indd");
  304. }
  305. var cretno = opener.ds_paminfo.getColumn(0, "cretno");
  306. var orddeptcd = opener.ds_paminfo.getColumn(0, "orddeptcd");
  307. var chkresncnts = '-'
  308. var chkresncd = ds_hardcd.getColumn(currow, "hardcd");
  309. var instcd = sysf_getUserInfo("dutplceinstcd") ;
  310. if (ds_hardcd.getColumn(currow, "hardcd" ) == "03") {
  311. resncnts = resncnts + instcd + "|" + pid + "|" + orddd + "|" + cretno + "|" + prcpgenrflag + "|" + orddeptcd + "|-|0|0|010|" + chkresncd + "|" + "기타 - " + ds_hardcd.getColumn(currow, "resncmt") + "^";
  312. ds_result_spclhdrugprcplist.setColumn(i, "resncnt", "기타 - " + ds_hardcd.getColumn(currow, "resncmt"));
  313. } else {
  314. resncnts = resncnts + instcd + "|" + pid + "|" + orddd + "|" + cretno + "|" + prcpgenrflag + "|" + orddeptcd + "|-|0|0|010|" + chkresncd + "|" + ds_hardcd.getColumn(currow, "hardcdnm") + "^";
  315. ds_result_spclhdrugprcplist.setColumn(i, "resncnt", ds_hardcd.getColumn(currow, "hardcdnm"));
  316. }
  317. ds_result_spclhdrugprcplist.setColumn(i, "saveresncnt", resncnts );
  318. }
  319. }
  320. }]]></Script>
  321. </Form>
  322. </FDL>