SMMNP01601.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. /* ---------------------------------------------------------------------
  2. 처방(물품)찾기(SMMNP01601.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. : Create By Francis Choi
  6. : 2015.05.02
  7. ---------------------------------------------------------------------- */
  8. var CondPath = "/root/main/cond";
  9. var SendPtah = "/root/send/reqdata";
  10. /* ------------------------------------------------- */
  11. /* SMMNP01601_처방(물품)찾기 */
  12. /* On Load 시 Call */
  13. /* ------------------------------------------------- */
  14. /* group : EMR 간호 수술마취 */
  15. /* ver : 2015.05.15 */
  16. /* by : 최학록 */
  17. /* --------------------------------------------------*/
  18. /* type : function */
  19. /* access : public */
  20. /* desc : xforms-ready시 수행한다 */
  21. /* return : */
  22. /* --------------------------------------------------*/
  23. function fFormInit() {
  24. model.removeNodeset("/root/main/goodlist");
  25. model.removeNodeset("/root/main/prcplist");
  26. submit("TRMNP04462");
  27. if (checkOpener() ) {
  28. var refnm = opener.javascript.getParameter("refnm");
  29. var refflag = opener.javascript.getParameter("refflag");
  30. var goodflag = opener.javascript.getParameter("goodflag");
  31. model.setValue(CondPath + "/refnm" , refnm );
  32. model.setValue(CondPath + "/refflag" , refflag );
  33. model.setValue(CondPath + "/goodflag", goodflag);
  34. model.refresh();
  35. if (( refnm == "" )||
  36. ( refflag == "" )||
  37. ( goodflag == "" ) ) {//물품구분, 조회조건, 조회구분이 없으면 리턴
  38. if (refflag == "" ) {
  39. model.setValue(CondPath + "/refflag", '1');
  40. model.refresh();
  41. }
  42. return;
  43. }else {
  44. var currentText = ipt_refcond.currentText;
  45. currentText = currentText.toUpperCase();
  46. model.setValue(CondPath + "/refnm", currentText);
  47. ipt_refcond.refresh();//대문자로 변경
  48. model.copyNode("/root/send/reqdata", CondPath);
  49. submit("TRMNP04461");
  50. }
  51. }
  52. }
  53. // --------------------------------------
  54. // P:처방분류선택, G:물품구분선택
  55. // --------------------------------------
  56. function fComboListChange(pDataCls) {
  57. model.removeNodeset("/root/init/lrglist");
  58. model.removeNodeset("/root/init/mdllist");
  59. model.removeNodeset("/root/init/smllist");
  60. model.setValue(CondPath + "/lrgcd", "");
  61. model.setValue(CondPath + "/mdlcd", "");
  62. model.setValue(CondPath + "/smlcd", "");
  63. model.copyNode("/root/send/reqdata", "/root/main/cond");
  64. if (pDataCls == "P") {
  65. submit("TRMNP04467"); // 처방분류선택
  66. return;
  67. }
  68. submit("TRMNP04463");
  69. var currentText = ipt_refcond.currentText;
  70. currentText = currentText.toUpperCase();
  71. model.setValue(CondPath + "/refnm", currentText);
  72. ipt_refcond.refresh();//대문자로 변경
  73. var refnm = model.getValue(CondPath + "/refnm");
  74. if (refnm != "" ) { //메인화면에서 검색어를 치고 들어온 경우 물품구분 선택시 자동 조회
  75. if( (model.getValue(CondPath + "/goodflag") == "" )||
  76. (model.getValue(CondPath + "/lrgcd" ) == "" )||
  77. (model.getValue(CondPath + "/mdlcd" ) == "" ) ) {
  78. if (model.getValue(CondPath + "/refflag") == "" ) {
  79. messageBox("조회구분을 선택 하지", "E007");
  80. return;
  81. }
  82. }
  83. model.copyNode("/root/send/reqdata", "/root/main/cond");
  84. submit("TRMNP04461");
  85. model.resetInstanceNode("/root/send/reqdata");
  86. }
  87. }
  88. // --------------------------------------
  89. // P:처방분류선택, G:물품구분선택
  90. // --------------------------------------
  91. function fDataQuery() {
  92. var currentText = ipt_refcond.currentText;
  93. currentText = currentText.toUpperCase();
  94. model.setValue(CondPath + "/refnm", currentText);
  95. ipt_refcond.refresh(); //대문자로 변경
  96. if( (model.getValue(CondPath + "/goodflag") == "" )||
  97. (model.getValue(CondPath + "/lrgcd" ) == "" )||
  98. (model.getValue(CondPath + "/mdlcd" ) == "" ) ) {
  99. if (model.getValue(CondPath + "/refflag") == "" ) {
  100. messageBox("조회구분을 선택 하지", "E007");
  101. return;
  102. }
  103. }
  104. model.copyNode("/root/send/reqdata", CondPath);
  105. var xNode = instance1.selectSingleNode(SendPtah);
  106. if (xNode == null) {
  107. model.makeNode(SendPtah);
  108. }
  109. model.copyNode(SendPtah, CondPath);
  110. if ( rdo_reftrgt.value == "PRC" ) {
  111. model.removeNodeset("/root/main/prcplist");
  112. submit("TRMNP04467");
  113. }else {
  114. model.removeNodeset("/root/main/goodlist");
  115. submit("TRMNP04461");
  116. }
  117. model.resetInstanceNode("/root/send/reqdata");
  118. }
  119. // --------------------------------------
  120. // Grid Data Click
  121. // --------------------------------------
  122. function fGridDataClick(pGrid, pName) {
  123. var iRow = pGrid.row;
  124. var pPath = "/root/main/"+ pName +"[" + pGrid.row + "]/chkflag";
  125. if (pGrid.rows < 1 || pGrid.row == 0){
  126. return;
  127. }
  128. else if (pGrid.col == 1) {
  129. return;
  130. }else {
  131. var sFlag = model.getValue(pPath);
  132. model.setValue(pPath, ((sFlag == "true") ? "false" :"true"));
  133. }
  134. model.refresh();
  135. }
  136. // --------------------------------------
  137. // Query Condition Select 조회 조건 선택
  138. // --------------------------------------
  139. function fQueryCondSelect(pGrid, pName) {
  140. var sLogical = "true";
  141. var sVisible1 = "visible";
  142. var sVisible2 = "hidden" ;
  143. model.setValue(CondPath + "/goodflag", "");
  144. model.setValue(CondPath + "/lrgcd" , "");
  145. model.setValue(CondPath + "/mdlcd" , "");
  146. model.setValue(CondPath + "/smlcd" , "");
  147. model.copyNode("/root/send/reqdata", CondPath);
  148. if (rdo_reftrgt.value == "PRC" ) {
  149. submit("TRMNP04463"); //처방분류 조회
  150. }else {
  151. submit("TRMNP04462");
  152. sLogical = "false" ;
  153. sVisible1 = "hidden" ;
  154. sVisible2 = "visible" ;
  155. }
  156. // ipt_refcond.disabled = sLogical;
  157. ipt_cmpycond.disabled = sLogical;
  158. ipt_custcond.disabled = sLogical;
  159. cmb_goodflag.disabled = sLogical;
  160. grd_prcplist.attribute("visibility") = sVisible1;
  161. grd_goodlist.attribute("visibility") = sVisible2;
  162. model.refresh();
  163. }
  164. // --------------------------------------
  165. // Query Condition Select 조회 조건 선택
  166. // --------------------------------------
  167. function fChoiceData() {
  168. var iParamList = "";
  169. var wCnt = 0 ;
  170. var wIDx = 0 ;
  171. var wCode = "goodcd";
  172. var wName = "goodnm";
  173. var iNode = "/root/main/goodlist";
  174. if (model.getValue(CondPath + "/tabflag") == "PRC" ) {
  175. wIDx = 1 ;
  176. wCode = "prcpcd";
  177. wName = "prcpnm";
  178. iNode = "/root/main/prcplist";
  179. }
  180. var wChk = "";
  181. var iRows = getNodesetCount(iNode);
  182. for( var i= 1; i <= iRows; i++ ) {
  183. wChk = model.getValue(iNode + "[" + i + "]/chkflag");
  184. if (wChk == "true") {
  185. iParamList += model.getValue(iNode + "[" + i + "]/" + wCode ) + "|" // 00 처방코드
  186. + model.getValue(iNode + "[" + i + "]/" + wName ) + "|" // 01 처방명
  187. + model.getValue(iNode + "[" + i + "]/allsizespecid") + "|" // 02 사이즈
  188. + model.getValue(iNode + "[" + i + "]/prodcmpynm" ) + "|" // 03 제조회사명
  189. + model.getValue(iNode + "[" + i + "]/cureflag" ) + "|" // 04 처치구분
  190. + model.getValue(iNode + "[" + i + "]/goodspec" ) + "|" // 05 물품규격
  191. + model.getValue(iNode + "[" + i + "]/goodmodel" ) + "|" // 06 물품모델
  192. + "" + "▩"; // 07 처방단위 model.getValue(iNode + "[" + i + "]/prcpunit" ))
  193. wCnt += 1;
  194. }
  195. }
  196. //
  197. // if (cnt < 1 ) {
  198. // messageBox("선택한 것이", "I004");
  199. // }else {
  200. if (checkOpener() ) {
  201. opener.javascript.setParameter("SendData", iParamList);
  202. window.close();
  203. }
  204. else {
  205. model.removenode("/root/send");
  206. model.makeValue("/root/send/SendData" , iParamList); // 기관코드
  207. }
  208. // }
  209. }
  210. /* ------------------------------------------------- */
  211. /* ------End Of List ------------------------------- */
  212. /* -------------------------------------------------- */