AEZ0001.js 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392
  1. /**
  2. * 파일명 : AEZ0001.js
  3. * 작성일자 : 2007.5.18
  4. */
  5. /**
  6. * 세션 GET
  7. */
  8. function aezfSetSuppDeptcd() {
  9. var dutplcecd = getUserInfo("dutplcecd");
  10. //var dutplcenm = getUserInfo("dutplcenm");
  11. var selectplcecd = getScreenPrestDeptCd();
  12. //alert(dutplcecd + "/////" + selectplcecd);
  13. if ( selectplcecd == "" ) {
  14. selectplcecd = dutplcecd;
  15. //selectplcenm = dutplcenm;
  16. }
  17. model.setValue("/root/send/globalinstance/instance1", selectplcecd);
  18. //model.makeValue("/root/send/globalinstance/instance1nm", selectplcenm);
  19. }
  20. /**
  21. * 상단정보 Deleting=======================================================================================================================================
  22. */
  23. function aezfDelTopInfo() {
  24. // 상단정보 DataSet Clear
  25. delPatientInfos();
  26. // Main화면 상단정보 관련 DataSet Clear
  27. setGlobalVariable("paminfo", "");
  28. }
  29. /**
  30. * 상단정보 Setting=======================================================================================================================================
  31. * EXCU_PARAM1 : 처방일자
  32. * EXCU_PARAM2 : 실시처방유일번호
  33. */
  34. function aezfSetTopInfo() {
  35. var excuprcpdd = getParameter("EXCU_PARAM1");
  36. var excuuniqno = getParameter("EXCU_PARAM2");
  37. var excudutplcecd = getUserInfo("dutplcecd");
  38. var pat_info = "S▦"+ excuprcpdd +"▦"+ excuuniqno +"▦"+ excudutplcecd;
  39. setParameter("condparam", pat_info);
  40. modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  41. }
  42. /**
  43. * 수가내역 가져오기=======================================================================================================================================
  44. * SPAEB00201_PARAM1 : 검색구분(cd/nm)
  45. * SPAEB00201_PARAM2 : 검색조건(코드/명칭)
  46. * SPAEB00201_PARAM3 : multiyn
  47. * SPAEB00201_PARAM4 : multi선택 시 setting할 목적노드
  48. * SPAEB00201_PARAM5 : code값을 setting할 목적노드
  49. * SPAEB00201_PARAM6 : name값을 setting할 목적노드
  50. * SPAEB00201_PARAM7 : 수가를 setting할 목적노드
  51. */
  52. function fGetCalScorCd( vCond, vCdnm, bMultiyn , vMultiDestXPath, vCdDestXPath, vNmDestXPath, vAmtDestXPath){
  53. clearParameter("SPAEB00201_PARAM1");
  54. clearParameter("SPAEB00201_PARAM2");
  55. clearParameter("SPAEB00201_PARAM3");
  56. clearParameter("SPAEB00201_PARAM4");
  57. clearParameter("SPAEB00201_PARAM5");
  58. clearParameter("SPAEB00201_PARAM6");
  59. //clearParameter("SPAEB00201_PARAM7");
  60. setParameter ("SPAEB00201_PARAM1" , vCond);
  61. setParameter ("SPAEB00201_PARAM2" , vCdnm);
  62. setParameter ("SPAEB00201_PARAM3" , bMultiyn);
  63. setParameter ("SPAEB00201_PARAM4" , vMultiDestXPath);
  64. setParameter ("SPAEB00201_PARAM5" , vCdDestXPath );
  65. setParameter ("SPAEB00201_PARAM6" , vNmDestXPath);
  66. //setParameter ("SPAEB00201_PARAM7" , vAmtDestXPath);
  67. modal("SPAEB00201");
  68. }
  69. /**
  70. * 수가내역 대상그리드 set=======================================================================================================================================
  71. * vGrdObj : 대상그리드
  72. * vSrcXPath : 목적노드set
  73. * vDupCheckCo : dup check column no
  74. * vDupCheck : dup check yn
  75. * vCodeNode : 수가코드 목적 노드
  76. * vNameNode : 수가처방명 목적 노드
  77. * vHeaderAddRows : header row default값(1) 보다 큰 row수
  78. */
  79. function fSetOcd(vGrdObj, vSrcXPath, vDupCheckCol, vDupCheck, vCodeNode, vNameNode, vSessiondept, vHeaderAddRows ) {
  80. //alert(vGrdObj+' - '+vSrcXPath+' - '+vDupCheckCol+' - '+ vDupCheck+' - '+ vCodeNode+' - '+vNameNode+' - '+ vHeaderAddRows);
  81. if( vGrdObj == null ) return ;
  82. if( vSrcXPath == "" ) return ;
  83. if( model.getValue("/root/temp/okflag") != "ok" ) return ;
  84. var cnt = getNodesetCount(vSrcXPath);
  85. var grdcnt = vGrdObj.rows;
  86. //alert(grdcnt);
  87. if( vHeaderAddRows != "" ){
  88. grdcnt =parseInt( vGrdObj.rows) - parseInt( vHeaderAddRows ) ;
  89. }
  90. //alert(grdcnt+' - '+ cnt);
  91. var vDupCheckVal = "";
  92. var i = 0;
  93. if( cnt == 1 ) {
  94. vDupCheckVal = model.getValue(vSrcXPath + "/calcscorcd" );
  95. if( vDupCheck == "Y" ) {
  96. if( fCheckDup(vGrdObj , vDupCheckCol, vDupCheckVal ) == false ){
  97. if( messageBox("중복되는 수가코드[" + vDupCheckVal + "] 를 추가", "S001") != 6 ){
  98. return ;
  99. }
  100. }
  101. }
  102. vGrdObj.addRow();
  103. if( vCodeNode != "" ){
  104. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/" + vCodeNode , vDupCheckVal );
  105. }
  106. if( vNameNode != "" ){
  107. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/" + vNameNode , model.getValue(vSrcXPath + "/ordnm" ) );
  108. }
  109. model.makeNode(vGrdObj.nodeset + "[" + grdcnt + "]/excucd" );
  110. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/excucd" , vDupCheckVal );
  111. model.makeNode(vGrdObj.nodeset + "[" + grdcnt + "]/excucdnm" );
  112. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/excucdnm" , model.getValue(vSrcXPath + "/ordnm" ) );
  113. model.makeNode(vGrdObj.nodeset + "[" + grdcnt + "]/basesuppdeptcd" );
  114. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/basesuppdeptcd" , vSessiondept );
  115. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/excutodd" , '99991231' );
  116. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/prcpexecdeptcd" , model.getValue(vSrcXPath + "/prcpexecdeptcd" ) );
  117. model.makeValue(vGrdObj.nodeset + "[" + grdcnt + "]/prcpexecdeptcd1" , model.getValue(vSrcXPath + "/prcpexecdeptcd" ) );
  118. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/anotestyn" , "Y" );
  119. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/rsrvupdtcncllimdayno", "0" );
  120. // 2010.11.19 c y w 검사코드 추가시 기본값셋팅
  121. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/excuclscd", "-");
  122. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/eqmtifyn", "N");
  123. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/readdrid3nm", "-");
  124. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/rsltdispyn", "Y");
  125. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/rsltdispgbn", model.getValue(vSrcXPath + "/rsltdispgbn" ) );
  126. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/partcntstats", "1");
  127. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/phocntstats", "1");
  128. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/curetims", "1");
  129. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/rsrvexcupossyn", "Y");
  130. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/rsrvplceflag", "2");
  131. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/excutm", "0");
  132. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/rsrvmultitmplcd", "-");
  133. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/rsrvexmpcnt", "1");
  134. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/rsrvupdtcncllimdayno", "0");
  135. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/pacsnocretyn", "N");
  136. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/etceqmtifyn", "-");
  137. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/anotestyn", "Y");
  138. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/prcpexecdeptcd", model.getValue(vSrcXPath + "/prcpexecdeptcd" ) );
  139. model.makeValue(vGrdObj.nodeset + "[" + grdcnt + "]/prcpexecdeptcd1", model.getValue(vSrcXPath + "/prcpexecdeptcd" ) );
  140. }
  141. else {
  142. for( var i = 1 ; i <= cnt ; i++ ){
  143. vDupCheckVal = model.getValue(vSrcXPath + "[" + i + "]/calcscorcd" );
  144. if( vDupCheck == "Y" ) {
  145. if( fCheckDup(vGrdObj , vDupCheckCol, vDupCheckVal ) == false ){
  146. if( messageBox("중복되는 수가코드[" + vDupCheckVal + "] 를 추가", "S001") != 6 ){
  147. continue ;
  148. }
  149. }
  150. }
  151. vGrdObj.addRow();
  152. if( vCodeNode != "" ){
  153. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/" + vCodeNode , vDupCheckVal );
  154. }
  155. if( vNameNode != "" ){
  156. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/" + vNameNode , model.getValue(vSrcXPath + "[" + i + "]/ordnm" ) );
  157. }
  158. model.makeNode(vGrdObj.nodeset + "[" + grdcnt + "]/excucd" );
  159. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/excucd" , vDupCheckVal );
  160. model.makeNode(vGrdObj.nodeset + "[" + grdcnt + "]/excucdnm" );
  161. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/excucdnm" , model.getValue(vSrcXPath + "[" + i + "]/ordnm" ) );
  162. model.makeNode(vGrdObj.nodeset + "[" + grdcnt + "]/basesuppdeptcd" );
  163. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/basesuppdeptcd" , vSessiondept );
  164. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/excutodd" , '99991231' );
  165. model.makeValue(vGrdObj.nodeset + "[" + grdcnt + "]/prcpexecdeptcd" , model.getValue(vSrcXPath + "[" + i + "]/prcpexecdeptcd" ) );
  166. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/anotestyn" , "Y" );
  167. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/rsrvupdtcncllimdayno", "0" );
  168. // 2010.11.19 c y w 검사코드 추가시 기본값셋팅
  169. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/excuclscd", "-");
  170. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/eqmtifyn", "N");
  171. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/readdrid3nm", "-");
  172. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/rsltdispyn", "Y");
  173. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/rsltdispgbn", model.getValue(vSrcXPath + "/rsltdispgbn" ) );
  174. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/partcntstats", "1");
  175. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/phocntstats", "1");
  176. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/curetims", "1");
  177. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/rsrvexcupossyn", "Y");
  178. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/rsrvplceflag", "2");
  179. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/excutm", "0");
  180. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/rsrvmultitmplcd", "-");
  181. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/rsrvexmpcnt", "1");
  182. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/rsrvupdtcncllimdayno", "0");
  183. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/pacsnocretyn", "N");
  184. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/etceqmtifyn", "-");
  185. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/anotestyn", "Y");
  186. model.setValue(vGrdObj.nodeset + "[" + grdcnt + "]/prcpexecdeptcd", model.getValue(vSrcXPath + "/prcpexecdeptcd" ) );
  187. model.makeValue(vGrdObj.nodeset + "[" + grdcnt + "]/prcpexecdeptcd1", model.getValue(vSrcXPath + "/prcpexecdeptcd1" ) );
  188. grdcnt++;
  189. }
  190. }
  191. model.refresh();
  192. }
  193. /************************************************************************************************
  194. **fCheckDup
  195. @param :
  196. * vGrdObj : grid control
  197. * vCheckVal : dup check 대상 값
  198. desc : grid dup value check.
  199. *************************************************************************************************/
  200. function fCheckDup( vGrdObj, vCheckCol , vCheckVal ){
  201. var cnt = vGrdObj.rows ;
  202. for( var i = 1; i <= cnt ; i++) {
  203. //alert(vGrdObj.valueMatrix(i, vCheckCol));
  204. //alert(vCheckVal);
  205. if( vGrdObj.valueMatrix(i, vCheckCol) == vCheckVal ){
  206. return false;
  207. }
  208. }
  209. }
  210. /************************************************************************************************
  211. *
  212. * aezfAddPrcpMngt
  213. @param
  214. * vGrdObj : 목적그리드
  215. * vSrcXPath : 목적노드set
  216. * desc : Add PrcpMngt value check.
  217. *************************************************************************************************/
  218. function aezfAddPrcpMngt(vGrdObj, vSrcXPath) {
  219. if ( vGrdObj.row >= vGrdObj.fixedRows ) {
  220. var i = vGrdObj.row;
  221. var pid = model.getValue(vSrcXPath+"["+i+"]/pid");
  222. var orddd = model.getValue(vSrcXPath+"["+i+"]/orddd");
  223. var cretno = model.getValue(vSrcXPath+"["+i+"]/cretno");
  224. var instcd = getUserInfo("dutplceinstcd");
  225. var ioflag = model.getValue(vSrcXPath+"["+i+"]/prcpgenrflag");
  226. var issdept = model.getValue("/root/send/globalinstance/instance1");
  227. var menuparam = model.getValue("/root/properties/menu/menuparam");
  228. if ( ioflag == "O" || ioflag == "S" ) ioflag = "O";
  229. else ioflag = "I";
  230. //alert(ioflag);
  231. }
  232. //alert(vGrdObj.rows);
  233. //alert(vGrdObj.row);
  234. //alert(vSrcXPath);
  235. //alert("pid->"+pid+", "+"orddd->"+orddd+", "+"cretno->"+cretno+", "+"instcd->"+instcd+", "+"ioflag->"+ioflag);
  236. //return;
  237. setParameter ( "SMMMO00200_pid", pid );
  238. setParameter ( "SMMMO00200_orddd", orddd);// ( orddd: 입원:입원일, 외래:수진일)
  239. setParameter ( "SMMMO00200_cretno", cretno );
  240. setParameter ( "SMMMO00200_instcd", instcd);
  241. setParameter ( "SMMMO00200_ioflag", ioflag );
  242. //?????? ???? (2008.01.29_??? ??. ???? ???? ???.)
  243. // if(issdept == "2010302030" ) {
  244. // setParameter ("SMMMO00200_defdeptcd", issdept );
  245. // }else {
  246. setParameter ( "SMMMO00200_issdept", issdept );
  247. // }
  248. if(menuparam == "PAM"){
  249. setGlobalVariable("menuparam", "PAM");
  250. }
  251. //setParameter ( "SMMMO00200_pid", "14" );
  252. //setParameter ( "SMMMO00200_orddd", "20070521");// ( orddd: 입원:입원일, 외래:수진일)
  253. //setParameter ( "SMMMO00200_cretno", "3" );
  254. //setParameter ( "SMMMO00200_instcd", "012");
  255. //setParameter ( "SMMMO00200_ioflag", "I" );
  256. modal ( "SMMMO00200" );
  257. }
  258. /************************************************************************************************
  259. *
  260. * aezfSendMarkBuf
  261. @param
  262. * grdobj : 목적그리드
  263. * colobj : 목적ColRef
  264. * xpath : 목적노드set
  265. * desc : Buffering Send check.
  266. *************************************************************************************************/
  267. function aezfSendMarkBuf(grdobj, colobj, xpath) {
  268. var bufCnts = "";
  269. var rowidx;
  270. var colref_viewcnts = grdobj.colref(colobj);
  271. for (var i = 0; i < grdobj.selectedRows; i++)
  272. {
  273. rowidx = grdobj.selectedRow(i);
  274. bufCnts += grdobj.valueMatrix(rowidx, colref_viewcnts) + "\r\n";
  275. }
  276. window.clipBoardData = bufCnts;
  277. //alert(bufCnts);
  278. }
  279. /* @group : Popup 공통 1
  280. * @ver : 2007.06.14
  281. * @by : 장준원
  282. * @-----------------------------------
  283. * @type : function
  284. * @access : public
  285. * @desc : Popup Sample
  286. */
  287. function aezfPopUpModalessSample(displayid, maingridlistid, path, targetpath) {
  288. if ( maingridlistid.row == 0 ) return;
  289. var row = maingridlistid.row;
  290. open(displayid,"","","","",path+"[" + row + "]/pid", targetpath);
  291. }
  292. /* @group : Popup 공통 1
  293. * @ver : 2007.06.14
  294. * @by : 장준원
  295. * @-----------------------------------
  296. * @type : function
  297. * @access : public
  298. * @desc : Popup Sample
  299. */
  300. function aezfPopUpSample(displayid, maingridlistid, path, targetpath) {
  301. if ( maingridlistid.row == 0 ) return;
  302. var row = maingridlistid.row;
  303. modal(displayid,"","","","",path+"[" + row + "]/pid", targetpath);
  304. }
  305. function aezfPopUpRsrvSample(displayid, maingridlistid, path) {
  306. if ( maingridlistid.row == 0 ) return;
  307. var row = maingridlistid.row;
  308. var pid = model.getValue(path+"[" + row + "]/pid");
  309. var suppdeptcd = model.getValue("/root/send/globalinstance/instance1");
  310. var sflag = pid + "▦" + "A" + "▦" + suppdeptcd;
  311. //alert(sflag);
  312. setParameter("opener_parameter_id", sflag);
  313. //alert(getParameter("opener_parameter_id"));
  314. open(displayid, 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; min:hidden, max:hidden;");
  315. }
  316. /************************************************************************************************
  317. *
  318. * aezfGridSetColor
  319. @param
  320. * path : 목적그리드
  321. * chkcol : 목적ColRef
  322. * chkval : 비교value
  323. * imagename : ImageName
  324. * desc : Background Image check.
  325. *************************************************************************************************/
  326. function aezfGridSetColor(path, chkcol, chkval, imagename ) {
  327. //alert('IN');
  328. var srchLength1 = model.instances(0).selectNodes( path ).length;
  329. for ( var i = 1; i <= srchLength1; i++ ) {
  330. if ( model.getValue ( path+"["+ i +"]/"+chkcol ) == chkval ) {
  331. grd_subresultdetail1.rowstyle(i, "data", "background-image") = "../../../com/commonweb/images/"+imagename;
  332. grd_subresultdetail1.rowstyle(i, "data", "background-repeat") = "repeat-x";
  333. //grd_subresultdetail1.rowstyle(i, "data", "text-align") = "center";
  334. } else {
  335. grd_subresultdetail1.rowstyle(i, "data", "background-image") = "";
  336. //grd_subresultdetail1.rowstyle(i, "data", "text-align") = "left";
  337. }
  338. }
  339. }
  340. /************************************************************************************************
  341. 함수명 : setRowStyle ()
  342. 인자 :
  343. String gridID - 그리드 아이디
  344. String styleFlag - 컬러 인덱스
  345. String data - 데이터 값
  346. Srting colRef - 비교할 컬럼 Ref
  347. String [control] - 조건 smaller | smallerThen | equal | biggerThen | bigger
  348. 결과값 :
  349. 함수설명 : 그리드 특정 컬럼값을 비교하여 로우 백컬러 변경
  350. * 사용예) setRowStyle("datagrid1", "1", "1", "b", "bigger");
  351. ************************************************************************************************
  352. 작 성 자 : 어 승옥
  353. 작 성 일 : 2006. 12. 01
  354. ************************************************************************************************/
  355. function aezfSetRowStyle( gridID , styleFlag , data , colRef , control ) {
  356. var style = new Array("#fcd2c1" , "#ffe79d" , "#f3e1bf" , "#7BE6B7" , "#b9e5fb" , "#f7a08b" , "#fec34d" , "#dec6a4" , "#c8e67b" ,
  357. "#43c8f5" , "#ff9933" , "#3399ff" , "#9999cc" , "#FFC8C8" , "#fab7bf" , "#ffff00" , "#ccffcc" , "#FF9A00");
  358. var styleFlags = styleFlag.split("^");
  359. var datas = data.split("^");
  360. if( control == null || control == "" )
  361. control = "equal";
  362. var controls = control.split("^");
  363. gridObj = document.all(gridID);
  364. gridObj.backcoloralternate = "transparent";
  365. for( var j = 0 ; j < datas.length ; j++ ) {
  366. var dataValue = datas[j];
  367. var styleValue = style[styleFlags[j]];
  368. for( var i = gridObj.fixedRows ; i < gridObj.Rows ; i++ ) {
  369. if(controls[j] == null)
  370. controls[j] = "equal";
  371. switch( controls[j] ) {
  372. case "small":
  373. if( gridObj.labelMatrix(i , gridObj.colRef(colRef)) < dataValue ) {
  374. gridObj.rowstyle( i , "data" , "background-color" ) = styleValue;
  375. }
  376. break;
  377. case "smallThen":
  378. if( gridObj.labelMatrix(i , gridObj.colRef(colRef)) <= dataValue ) {
  379. gridObj.rowstyle( i , "data" , "background-color" ) = styleValue;
  380. }
  381. break;
  382. case "bigger":
  383. if( gridObj.labelMatrix(i , gridObj.colRef(colRef)) > dataValue ) {
  384. gridObj.rowstyle( i , "data" , "background-color" ) = styleValue;
  385. }
  386. break;
  387. case "biggerThen":
  388. if( gridObj.labelMatrix(i , gridObj.colRef(colRef)) >= dataValue ) {
  389. gridObj.rowstyle( i , "data" , "background-color" ) = styleValue;
  390. }
  391. break;
  392. /*
  393. case "notEqual":
  394. if( gridObj.labelMatrix(i , gridObj.colRef(colRef)) != dataValue ) {
  395. gridObj.rowstyle( i , "data" , "background-color" ) = styleValue;
  396. }
  397. break;
  398. */
  399. case "equal":
  400. if( gridObj.labelMatrix(i , gridObj.colRef(colRef)) == dataValue ) {
  401. gridObj.rowstyle( i , "data" , "background-color" ) = styleValue;
  402. }
  403. break;
  404. }
  405. }
  406. }
  407. }
  408. /************************************************************************************************
  409. 함수명 : aezfSetCellStyle ()
  410. 인자 :
  411. String gridID - 그리드 아이디
  412. String styleFlag - 컬러 인덱스
  413. String data - 데이터 값
  414. Srting colRef - 비교할 컬럼 Ref
  415. String setColRef - 변경할 컬럼 Ref
  416. String fillflag - 변경할 항목 구분(B: background, F: font)
  417. 결과값 :
  418. 함수설명 : 그리드 특정 컬럼값을 비교하여 셀 백컬러 변경
  419. * 사용예) aezfSetCellStyle("grd_mainordlist5" , "9^8^7" , "V^P^A" , "aftrcptinfo", "calcscorcd");
  420. ************************************************************************************************
  421. 작 성 자 : 어 승옥
  422. 작 성 일 : 2006. 12. 01
  423. ************************************************************************************************/
  424. function aezfSetCellStyle( gridID , styleFlag , data , colRef , setColRef, fillflag ) {
  425. /*
  426. var style = new Array("#fcd2c1" , "#ffe79d" , "#f3e1bf" , "#7BE6B7" , "#b9e5fb" , "#f7a08b" , "#fec34d" , "#dec6a4" , "#c8e67b" , "#43c8f5" ,
  427. "#ff9933" , "#3399ff" , "#9999cc" , "#FFC8C8");
  428. */
  429. var fillStyle = "";
  430. var style;
  431. if ( fillflag == "B" ) {
  432. fillStyle = "background-color";
  433. style = new Array("#ffff00", "#ccffcc", "#FF9A00");
  434. } else if ( fillflag == "F" ) {
  435. fillStyle = "color";
  436. style = new Array("#ffff00", "#ccffcc", "#FF9A00");
  437. }
  438. var styleFlags = styleFlag.split("^");
  439. var datas = data.split("^");
  440. gridObj = document.all(gridID);
  441. gridObj.backcoloralternate = "transparent";
  442. for( var i = gridObj.fixedRows ; i < gridObj.Rows ; i++ ) {
  443. gridObj.cellstyle(fillStyle, i, gridObj.colRef(setColRef)) = "#000000";
  444. gridObj.cellstyle("font-weight", i, gridObj.colRef(setColRef)) = "normal";
  445. }
  446. for( var j = 0 ; j < datas.length ; j++ ) {
  447. var dataValue = datas[j];
  448. var styleValue = style[styleFlags[j]];
  449. for( var i = gridObj.fixedRows ; i < gridObj.Rows ; i++ ) {
  450. if( gridObj.labelMatrix(i , gridObj.colRef(colRef)) == dataValue ) {
  451. gridObj.cellstyle(fillStyle, i, gridObj.colRef(setColRef)) = styleValue;
  452. gridObj.cellstyle("font-weight", i, gridObj.colRef(setColRef)) = "bold";
  453. }
  454. }
  455. }
  456. }
  457. function aezfSetFontRowStyle( gridID , styleFlag , data , colRef , control ) {
  458. var style = new Array("#fcd2c1" , "#ffe79d" , "#f3e1bf" , "#7BE6B7" , "#b9e5fb" , "#f7a08b" , "#fec34d" ,
  459. "blue" ,
  460. "#c8e67b" ,
  461. "green" ,
  462. "#ff9933" ,
  463. "red" ,
  464. "#9999cc",
  465. "#5A5A5A",
  466. "#000000"
  467. );
  468. var styleFlags = styleFlag.split("^");
  469. var datas = data.split("^");
  470. if( control == null || control == "" )
  471. control = "equal";
  472. var controls = control.split("^");
  473. gridObj = document.all(gridID);
  474. gridObj.backcoloralternate = "transparent";
  475. for( var j = 0 ; j < datas.length ; j++ ) {
  476. var dataValue = datas[j];
  477. var styleValue = style[styleFlags[j]];
  478. for( var i = gridObj.fixedRows ; i < gridObj.Rows ; i++ ) {
  479. if(controls[j] == null)
  480. controls[j] = "equal";
  481. switch( controls[j] ) {
  482. case "small":
  483. if( gridObj.labelMatrix(i , gridObj.colRef(colRef)) < dataValue ) {
  484. gridObj.rowstyle( i , "data" , "color" ) = styleValue;
  485. // gridObj.rowstyle( i , "data" , "font-weight" ) = "bold";
  486. }
  487. break;
  488. case "smallThen":
  489. if( gridObj.labelMatrix(i , gridObj.colRef(colRef)) <= dataValue ) {
  490. gridObj.rowstyle( i , "data" , "color" ) = styleValue;
  491. // gridObj.rowstyle( i , "data" , "font-weight" ) = "bold";
  492. }
  493. break;
  494. case "bigger":
  495. if( gridObj.labelMatrix(i , gridObj.colRef(colRef)) > dataValue ) {
  496. gridObj.rowstyle( i , "data" , "color" ) = styleValue;
  497. // gridObj.rowstyle( i , "data" , "font-weight" ) = "bold";
  498. }
  499. break;
  500. case "biggerThen":
  501. if( gridObj.labelMatrix(i , gridObj.colRef(colRef)) >= dataValue ) {
  502. gridObj.rowstyle( i , "data" , "color" ) = styleValue;
  503. // gridObj.rowstyle( i , "data" , "font-weight" ) = "bold";
  504. }
  505. break;
  506. /*
  507. case "notEqual":
  508. if( gridObj.labelMatrix(i , gridObj.colRef(colRef)) != dataValue ) {
  509. gridObj.rowstyle( i , "data" , "background-color" ) = styleValue;
  510. }
  511. break;
  512. */
  513. case "equalBold":
  514. if( gridObj.labelMatrix(i , gridObj.colRef(colRef)) == dataValue ) {
  515. gridObj.rowstyle( i , "data" , "color" ) = styleValue;
  516. gridObj.rowstyle( i , "data" , "font-weight" ) = "bold";
  517. }
  518. case "equal":
  519. if( gridObj.labelMatrix(i , gridObj.colRef(colRef)) == dataValue ) {
  520. gridObj.rowstyle( i , "data" , "color" ) = styleValue;
  521. // gridObj.rowstyle( i , "data" , "font-weight" ) = "bold";
  522. }
  523. break;
  524. }
  525. }
  526. }
  527. }
  528. /************************************************************************************************
  529. *
  530. * aezfTrim
  531. @param
  532. * code1 : 목적ColRef
  533. * value : charcode
  534. * desc : Ascii Code의 Trim check.
  535. *************************************************************************************************/
  536. function aezfTrim(code1, value) {
  537. var startPoint = 0; // subString 하기 위한 시작 포인트
  538. var endPoint = code1.length; // subString 하기 위한 끝 포인트
  539. //문자열앞에 공백문자가 들어 있는 Index 추출
  540. while( (startPoint < endPoint) && (code1.charCodeAt(startPoint) == value) )
  541. {
  542. startPoint++;
  543. }
  544. //문자열뒤에 공백문자가 들어 있는 Index 추출
  545. while( (startPoint < endPoint) && (code1.charCodeAt(endPoint-1) == value) )
  546. {
  547. endPoint--;
  548. }
  549. // 공백을 제거했으면 subString하여 결과문자열을 리턴하고 제거한 내용이 없으면 그대로 리턴
  550. return ( (startPoint > 0) || (endPoint < code1.length) ) ? code1.substring(startPoint, endPoint) : code1;
  551. }
  552. /************************************************************************************************
  553. * @group :
  554. * @ver : 2007.11.09
  555. * @by : 이상준
  556. * @---------------------------------------------------
  557. * @type : function
  558. * @access : public
  559. * @desc : 지정된 인스턴스를 삽입
  560. * @return :
  561. *************************************************************************************************/
  562. function aezfInsertInstance(cdGroupID, codeName, codeID, targetXpath) {
  563. //model.refresh();
  564. model.copyNode("/root/hidden/comcd",targetXpath);
  565. var nodelist = instance1.selectNodes("/root/hidden/comcd/"+cdGroupID);
  566. var newNode = instance1.createNode("element", cdGroupID, "");
  567. var childnode1 = instance1.createNode("element", "cdnm", "");
  568. var childnode2 = instance1.createNode("element", "cdid", "");
  569. newNode.appendChild(childnode1);
  570. newNode.appendChild(childnode2);
  571. if (nodelist.length > 0)
  572. {
  573. var currNode = root.hidden.comcd.insertBefore(newNode, nodelist.item(0));
  574. model.setValue("/root/hidden/comcd/"+cdGroupID+"[1]/cdnm", codeName);
  575. model.setValue("/root/hidden/comcd/"+cdGroupID+"[1]/cdid", codeID);
  576. }
  577. }
  578. /************************************************************************************************
  579. * @group :
  580. * @ver : 2007.11.09
  581. * @by : 장준원
  582. * @---------------------------------------------------
  583. * @type : function
  584. * @access : public
  585. * @desc : 지정된 인스턴스를 원하고자 하는 인스턴스에 삽입(aezfInsertInstance를 화면에서 다중으로 사용할 때)
  586. * @return :
  587. *************************************************************************************************/
  588. function aezfInsertInstance2(baseXpath, cdGroupID, codeName, codeID, targetXpath) {
  589. //model.refresh();
  590. model.copyNode(baseXpath,targetXpath);
  591. var nodelist = instance1.selectNodes(baseXpath+"/"+cdGroupID);
  592. var newNode = instance1.createNode("element", cdGroupID, "");
  593. var childnode1 = instance1.createNode("element", "cdnm", "");
  594. var childnode2 = instance1.createNode("element", "cdid", "");
  595. newNode.appendChild(childnode1);
  596. newNode.appendChild(childnode2);
  597. if (nodelist.length > 0)
  598. {
  599. var currNode = root.hidden.comcd.insertBefore(newNode, nodelist.item(0));
  600. model.setValue(baseXpath+"/"+cdGroupID+"[1]/cdnm", codeName);
  601. model.setValue(baseXpath+"/"+cdGroupID+"[1]/cdid", codeID);
  602. }
  603. }
  604. /************************************************************************************************
  605. * @group :
  606. * @ver : 2007.12.12
  607. * @by : 장준원
  608. * @---------------------------------------------------
  609. * @type : function
  610. * @access : public
  611. * @desc : OCR출력 과 출력 리스트 조회
  612. * @return :
  613. *************************************************************************************************/
  614. function aezfOcrListPrint(xpath, row1, colid1, colid2, colid3, colid4, colid5, colid6, colid7, colid8, colid9, colid10, colid11, colid12) {
  615. model.removeNodeset("/root/temp/para");
  616. model.makeValue("/root/temp/para/pid", model.getValue(xpath+"[" + row1 + "]/" + colid1 ) );
  617. model.makeValue("/root/temp/para/orddd", model.getValue(xpath+"[" + row1 + "]/" + colid2 ) );
  618. model.makeValue("/root/temp/para/orddeptcd", model.getValue(xpath+"[" + row1 + "]/" + colid3 ) );
  619. model.makeValue("/root/temp/para/orddeptnm", model.getValue(xpath+"[" + row1 + "]/" + colid4 ) );
  620. model.makeValue("/root/temp/para/orddrid", model.getValue(xpath+"[" + row1 + "]/" + colid5 ) );
  621. model.makeValue("/root/temp/para/drnm", model.getValue(xpath+"[" + row1 + "]/" + colid6 ) );
  622. // I/ O /E만 받는다.
  623. if ( colid7 == "S" ) colid7 = "O";
  624. else if( colid7 == "D" ) colid7 = "I";
  625. else colid7 = colid7;
  626. model.makeValue("/root/temp/para/ordtype", model.getValue(xpath+"[" + row1 + "]/" + colid7 ) );
  627. model.makeValue("/root/temp/para/patnm", model.getValue(xpath+"[" + row1 + "]/" + colid8 ) );
  628. model.makeValue("/root/temp/para/inroomcd", model.getValue(xpath+"[" + row1 + "]/" + colid9 ).getTrim() );
  629. model.makeValue("/root/temp/para/rrgstno1", model.getValue(xpath+"[" + row1 + "]/" + colid10 ) );
  630. model.makeValue("/root/temp/para/rrgstno2", model.getValue(xpath+"[" + row1 + "]/" + colid11 ) );
  631. model.makeValue("/root/temp/para/cretno", model.getValue(xpath+"[" + row1 + "]/" + colid12 ) );
  632. model.refresh();
  633. modal("SMMRF02300", "", "200", "200", "SMMRF02300","/root/temp/para","/root/temp/para");
  634. }
  635. /**
  636. * TOPMOST 호출=======================================================================================================================================
  637. */
  638. function aezfTopMost(id,monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos,onCloseEvent) {
  639. var rtn = "";
  640. //body.disabled = true;
  641. if (userProp == null) {
  642. userProp = "min:hidden;max:hidden;";
  643. } else {
  644. userProp = "min:hidden;max:hidden;" + userProp;
  645. }
  646. ///model.makeValue(gvMyCBOnClosePath,onCloseEvent);
  647. rtn = openInternal("modeless_topmost",id,"scn",monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos);
  648. //body.disabled = false;
  649. return rtn;
  650. }
  651. /**
  652. * Age Calculation =======================================================================================================================================
  653. */
  654. function aezfgetFullAge(pResidentNo, pDate, pPosition)
  655. {
  656. if(isNaN(pResidentNo)) return -1;
  657. var pivotYY = "";
  658. var pivotMM = "";
  659. var pivotDD = "";
  660. var regYY = "";
  661. var regMM = "";
  662. var regDD = "";
  663. if(typeof(pDate) == "undefined" || pDate == "" || pDate == null) {
  664. var today = new Date();
  665. pivotYY = today.getYear();
  666. pivotMM = today.getMonth() + 1;
  667. pivotDD = today.getDate();
  668. } else {
  669. pivotYY = pDate.getYear();
  670. pivotMM = pDate.getMonth() + 1;
  671. pivotDD = pDate.getDate();
  672. }
  673. if(pResidentNo.length == 13 ){
  674. gender = pResidentNo.substr(6, 1);
  675. regYY = eval(pResidentNo.substr(0, 2));
  676. regMM = eval(pResidentNo.substr(2, 2));
  677. regDD = eval(pResidentNo.substr(4, 2));
  678. if(gender == '3' || gender == '4' || gender == '7' || gender == '8') {
  679. regYY += 2000;
  680. } else if(gender == '0' || gender == '9') {
  681. regYY += 1800;
  682. } else {
  683. regYY += 1900;
  684. }
  685. }else if(pResidentNo.length == 8 && isValidDateTime(pResidentNo, "YYYYMMDD")){
  686. regYY = eval(pResidentNo.substr(0, 4));
  687. regMM = eval(pResidentNo.substr(4, 2));
  688. regDD = eval(pResidentNo.substr(6, 2));
  689. }else{
  690. return -1;
  691. }
  692. var age = pivotYY - regYY;
  693. if(age > 0) {
  694. if(pivotMM == regMM) {
  695. if(pivotDD < regDD) {
  696. age -= 1;
  697. }
  698. } else if(pivotMM < regMM) {
  699. age -= 1;
  700. }
  701. }
  702. if ( pPosition == "M")
  703. {
  704. //12개월이하일때 계산
  705. if(age <= 0){
  706. if(pivotYY > regYY) {
  707. pivotMM += 12;
  708. }
  709. age = pivotMM - regMM ;
  710. if(pivotDD < regDD) {
  711. age -= 1;
  712. }
  713. age = "0."+age;
  714. }
  715. }
  716. return age;
  717. }
  718. /************************************************************************************************
  719. * @group :
  720. * @ver : 2007.12.12
  721. * @by : 장준원
  722. * @---------------------------------------------------
  723. * @type : function
  724. * @access : public
  725. * @param
  726. * baseXpath : Return Instance (deptcd)
  727. * baseXpath2 : Return Instance (deptnm, 등등)
  728. * @desc : 부서코드 팝업창 호출 후 조회
  729. * @return :
  730. *************************************************************************************************/
  731. function aezfCommDeptCodeList(baseXpath, baseXpath2) {
  732. var dept_deptcd = model.getValue(baseXpath);
  733. if (dept_deptcd == null || dept_deptcd == "" || dept_deptcd == " ") {
  734. messageBox("부서코드가 입력되지","E007");
  735. model.setValue( baseXpath, "");
  736. model.setValue( baseXpath2, "");
  737. model.refresh();
  738. return false;
  739. }else {
  740. model.makeValue("/root/temp/prestdeptcd","");
  741. model.makeValue("/root/temp/prestdeptnm","");
  742. var search_condition = "deptnm";
  743. var search_term = "";
  744. var receive_deptcd_path = "/root/temp/prestdeptcd";
  745. var receive_deptnm_path = "/root/temp/prestdeptnm";
  746. model.setValue(receive_deptcd_path, "");
  747. model.setValue(receive_deptnm_path, "");
  748. var standard_yn = null;
  749. var ord_deptflag = null;
  750. zbcfOpenInstDeptCodeList(
  751. search_condition,
  752. search_term,
  753. receive_deptcd_path,
  754. receive_deptnm_path,
  755. standard_yn,
  756. ord_deptflag,
  757. new Array("deptcd", "depthngnm")
  758. );
  759. model.setValue(baseXpath, model.getValue("/root/temp/prestdeptcd"));
  760. model.setValue(baseXpath2, model.getValue("/root/temp/prestdeptnm"));
  761. model.refresh();
  762. }
  763. }
  764. /************************************************************************************************
  765. * @group :
  766. * @ver : 2007.12.12
  767. * @by : 장준원
  768. * @---------------------------------------------------
  769. * @type : function
  770. * @access : public
  771. * @param
  772. * baseXpath : Return Instance (PID)
  773. * baseXpath2 : Return Instance (Patnm+Sex+age, 등등)
  774. * @desc : 환자정보 팝업창 호출
  775. * @return :
  776. *************************************************************************************************/
  777. function aezfCommPatInfoList(baseXpath, baseXpath2) {
  778. var ptbs_pid = model.getValue(baseXpath);
  779. if (ptbs_pid == null || ptbs_pid == "" || ptbs_pid == " ") {
  780. messageBox("환자번호가 입력되지","E007");
  781. model.setValue( baseXpath, "");
  782. model.setValue( baseXpath2, "");
  783. model.refresh();
  784. return false;
  785. } else {
  786. modal("SPPMC02500", "", "200", "200", "SPPMC02500", baseXpath, "/root/send");
  787. model.setValue( baseXpath, model.getValue("/root/main/patinfo/patinfolist/pid") );
  788. model.setValue( baseXpath2, model.getValue("/root/main/patinfo/patinfolist/hngnm")+" ["+model.getValue("/root/main/patinfo/patinfolist/sex")+'/'+model.getValue("/root/main/patinfo/patinfolist/age")+"]" );
  789. model.refresh();
  790. }
  791. }
  792. /************************************************************************************************
  793. * @group :
  794. * @ver : 2007.12.12
  795. * @by : 장준원
  796. * @---------------------------------------------------
  797. * @type : function
  798. * @access : public
  799. * @param
  800. * baseXpath : Send Instance (검색조건)
  801. * rtnXpath : Return Instance (Userid+Usernm, 등등)
  802. * copyXpath : Return Copy Instance (Userid)
  803. * copyXpath2 : Return Copy Instance (Usernm, 등등)
  804. * @desc : 사용자정보 팝업창 호출
  805. * @return :
  806. *************************************************************************************************/
  807. function aezfCommUserInfoList(baseXpath, rtnXpath, copyXpath, copyXpath2) {
  808. var usrb_usrid = model.getValue(copyXpath);
  809. if (usrb_usrid == null || usrb_usrid == "" || usrb_usrid == " ") {
  810. messageBox("사용자번호가 입력되지","E007");
  811. model.setValue( copyXpath, "");
  812. model.setValue( copyXpath2, "");
  813. model.refresh();
  814. return false;
  815. }else {
  816. model.resetInstanceNode(baseXpath); // Instance 초기화
  817. model.removeNodeset(rtnXpath+"/list"); // Instance 초기화
  818. model.setValue(baseXpath+"/param", "_OneS"); // 사용자 한 명만을 검색하기 위한 파라미터 설정
  819. modal("SPZSU10103", "", "200", "200", "SPZSU10103", baseXpath, "/root/main/temp");
  820. var iParam = getParameter("SPZSU10103_");
  821. setCSVToNode(rtnXpath, iParam);
  822. clearParameter("SPZSU10103_");
  823. model.setValue( copyXpath, model.getValue(rtnXpath+"/list/userid") ); // 사용자 ID
  824. model.setValue( copyXpath2, model.getValue(rtnXpath+"/list/usernm") ); // 사용자 이름+등등
  825. model.refresh();
  826. }
  827. }
  828. function aezfGetSrchPatInfo(cond1, cond2, cond3, cond99, rtnXpath) {
  829. model.makeValue ( "/root/send/cond1", cond1 );
  830. model.makeValue ( "/root/send/cond2", cond2 );
  831. model.makeValue ( "/root/send/cond3", cond3 );
  832. model.makeValue ( "/root/send/cond99", cond99 );
  833. if (!submit ( "TRMMO02501",false )) {
  834. model.resetInstanceNode (rtnXpath );
  835. model.refresh();
  836. return "0";
  837. }else {
  838. return "1";
  839. }
  840. }
  841. /************************************************************************************************
  842. * 간호일지 II 호출
  843. * 비처방기준
  844. * 20080923 , 장준원
  845. *************************************************************************************************/
  846. function aezfGetNurseRecII(Xpath, Row, Gbn) {
  847. // Gbn : 1 (Angio) , 2 (심도자) , 3 (CT)
  848. var orddd = model.getValue(Xpath+"[" + Row + "]/orddd");
  849. var cretno = model.getValue(Xpath+"[" + Row + "]/cretno");
  850. var instcd = getUserInfo("dutplceinstcd");
  851. var orddeptcd = model.getValue(Xpath+"[" + Row + "]/orddeptcd");
  852. var orddrid = model.getValue(Xpath+"[" + Row + "]/orddrid")
  853. var pid = model.getValue(Xpath+"[" + Row + "]/pid");
  854. var hngnm = model.getValue(Xpath+"[" + Row + "]/patnm");
  855. // var age = model.getValue(Xpath+"[" + Row + "]/age");
  856. var rrgstno1 = model.getValue(Xpath+"["+Row+"]/rrgstno1");
  857. var rrgstno2 = model.getValue(Xpath+"["+Row+"]/rrgstno2");
  858. var age = aezfgetFullAge(rrgstno1+rrgstno2);
  859. //alert('1 age->'+age);
  860. if ( age == "" ) age = model.getValue(Xpath+"[" + Row + "]/age");
  861. //alert('2 age->'+age);
  862. var ioflag = model.getValue(Xpath+"[" + Row + "]/prcpgenrflag");
  863. if ( Gbn == "1" ) var Baseparam = "recflag▦dutplaccd▦reclnkkey▩N▦019▦" + pid + "," + orddd + "," + cretno +"," + instcd + "," + orddeptcd + "▩";
  864. if ( Gbn == "2" ) var Baseparam = "recflag▦dutplaccd▦reclnkkey▩Q▦020▦" + pid + "," + orddd + "," + cretno +"," + instcd + "," + orddeptcd + "▩";
  865. if ( Gbn == "3" ) var Baseparam = "recflag▦dutplaccd▦reclnkkey▩N▦025▦" + pid + "," + orddd + "," + cretno +"," + instcd + "," + orddeptcd + "▩";
  866. // var Baseparam = "recflag▦dutplaccd▦reclnkkey▩N▦019▦" + pid + "," + orddd + "," + cretno +"," + instcd + "," + orddeptcd + "▩";
  867. var ASTparam = "pid ▦ instcd ▦ hngnm ▦ age ▦ orddd ▦ cretno ▦ ioflag ▦ orddeptcd ▦ orddrid ▩" + pid + "▦" + instcd + "▦" + hngnm + "▦" + age + "▦" + orddd + "▦" + cretno+ "▦" + ioflag + "▦" + orddeptcd + "▦" + orddrid + "▩";
  868. //alert('Baseparam->'+Baseparam);
  869. //alert('ASTparam->'+ASTparam);
  870. setParameter("SMMNR03400_ParamBase", Baseparam);
  871. setParameter("SMMNR03400_AST", ASTparam );
  872. // modal("SMMNR03400");
  873. if(window.children.item("SMMNR03400") == null)
  874. {
  875. var xpt = 300;
  876. var ypt = 0;
  877. aezfTopMost("SMMNR03400",1,xpt,ypt,"SMMNR03400","","","",0,0);
  878. }else {
  879. window.children.item("SMMNR03400").model.refresh();
  880. window.children.item("SMMNR03400").model.dispatch("xforms-ready");
  881. }
  882. }
  883. /************************************************************************************************
  884. * ???? SATO ??? ??
  885. *************************************************************************************************/
  886. function fBarcdPrtSato(grd, orddeptnm,roomcd,prcpgenrflag,portyn,precureprcpflag) {
  887. var barcdRef = "/root/main/barcdprntsetup/prntsetupinfo/setupinfo";
  888. var sPrntKind = model.getValue(barcdRef + "[1]/prntkind");
  889. var portOpenCheck = "";
  890. var LCount = 0;
  891. var iXPos = 0;
  892. var iYPos = 0;
  893. var sSndMsg = "";
  894. if (sPrntKind == 0) return;
  895. var sCommKind = model.getValue(barcdRef + "[1]/commkind");
  896. var sLeftBank = model.getValue(barcdRef + "[1]/blank/left");
  897. var sTopBank = model.getValue(barcdRef + "[1]/blank/top");
  898. if (sLeftBank == "" || sLeftBank == "-") sLeftBank = 0;
  899. if (sTopBank == "" || sTopBank == "-") sTopBank = 0;
  900. var orddeptnm = orddeptnm;
  901. var roomcd = roomcd;
  902. var prcpgenrflag = prcpgenrflag;
  903. var portyn = portyn;
  904. var precureprcpflag = precureprcpflag;
  905. var sSndMsg = "";
  906. var sBcNo = "";
  907. var iprintcnt = 0;
  908. var pid = model.getValue("/root/main/patrem/selectpat/pid");
  909. var hngnm = model.getValue("/root/main/patrem/selectpat/hngnm");
  910. var sna = model.getValue("/root/main/patrem/selectpat/sna");
  911. var rrgstno = model.getValue("/root/main/patrem/selectpat/rrgstno");
  912. var styleFlags = model.getValue("/root/main/patrem/prcpdeliveinfo/prcpdelivefact").split("]");
  913. var cmt = styleFlags[0];
  914. //포터블 및 선처치 여부 ( 진료:Y, 간호:P )
  915. //간호포터블접수만 표시
  916. if( portyn == "P" && precureprcpflag == "N") {
  917. portyn = "P";
  918. }
  919. else if(portyn == "N" && precureprcpflag == "Y" ) {
  920. portyn ="?";
  921. }
  922. else if(portyn == "N" && precureprcpflag == "N" ) {
  923. portyn ="";
  924. }
  925. else if(portyn == "P" && precureprcpflag == "Y") {
  926. portyn ="P?";
  927. }
  928. sSndMsg = "AA103500500"; // 시작위치 셋팅
  929. // ????
  930. iXPos = Number(sLeftBank) + 5;
  931. iYPos = Number(sTopBank) + 5;
  932. //sSndMsg += "V" + iXPos + "H" + iYPos + "S" + pid;
  933. //sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), pid, 1.5, 1);
  934. sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), pid + " [" + rrgstno.substring(0,6) + "]", 1.5, 1);
  935. // ??? + ????
  936. iXPos = Number(sLeftBank) + 5;
  937. iYPos = Number(sTopBank) + 35;
  938. //sSndMsg += CommAX.PrtImgOut(iYPos, iXPos, hngnm+" "+ sna);
  939. sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), sna+" "+ hngnm, 1.5, 1);
  940. // ??? (??)
  941. if(prcpgenrflag =="I" || prcpgenrflag =="E" ) {
  942. iXPos = Number(sLeftBank) + 5;
  943. iYPos = Number(sTopBank) + 65;
  944. //sSndMsg += CommAX.PrtImgOut(iYPos, iXPos, orddeptnm + "("+ roomcd + ")" );
  945. sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), orddeptnm + "("+ roomcd + ")", 1.5, 1);
  946. }
  947. else{
  948. iXPos = Number(sLeftBank) + 5;
  949. iYPos = Number(sTopBank) + 65;
  950. //sSndMsg += CommAX.PrtImgOut(iYPos, iXPos, orddeptnm );
  951. sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), orddeptnm, 1.5, 1);
  952. }
  953. // ??? ? ?????
  954. iXPos = Number(sLeftBank) + 5;
  955. iYPos = Number(sTopBank) + 95;
  956. //sSndMsg += CommAX.PrtImgOut(iYPos, iXPos, portyn );
  957. sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), portyn, 1.5, 1);
  958. //Routine ? LongStream
  959. iXPos = Number(sLeftBank) + 60;
  960. iYPos = Number(sTopBank) + 95;
  961. //sSndMsg += "V" + iYPos + "H" + iXPos + "S" +cmt +"]";
  962. sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), cmt +"]", 1.5, 1);
  963. //???
  964. iXPos = Number(sLeftBank) +125 ;
  965. iYPos = Number(sTopBank) + 15;
  966. sSndMsg += "V" + iXPos + "H" + iYPos + "BG02100" + pid; // ???
  967. //???????
  968. iXPos = Number(sLeftBank) +50 ;
  969. iYPos = Number(sTopBank) + 240;
  970. //sSndMsg += "V" + iXPos + "H" + iYPos + "S" + "*" + pid + "*";
  971. sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), "*" + pid + "*", 0.5 , 0.5);
  972. //??(??)
  973. sSndMsg += "Q" + "1" + "Z";
  974. CommAX.SendMsg(sSndMsg);
  975. }
  976. //=====================================================================================================================================================================================
  977. // @ SATO BarCode Print 설정
  978. //=====================================================================================================================================================================================
  979. function fBarcdLbPrtSato(pid, patnm, gbn, rrgstno1, rrgstno2, barpid, excugrp, currentdate, sex, age)
  980. {
  981. var barcdRef = "/root/main/barcdprntsetup/prntsetupinfo/setupinfo";
  982. var sPrntKind = model.getValue(barcdRef + "[1]/prntkind");
  983. var portOpenCheck = "";
  984. var LCount = 0;
  985. var iXPos = 0;
  986. var iYPos = 0;
  987. var sSndMsg = "";
  988. //alert("sPrntKind : " + sPrntKind);
  989. if (sPrntKind == 0) return;
  990. var sCommKind = model.getValue(barcdRef + "[1]/commkind");
  991. var sLeftBank = model.getValue(barcdRef + "[1]/blank/left");
  992. var sTopBank = model.getValue(barcdRef + "[1]/blank/top");
  993. if (sLeftBank == "" || sLeftBank == "-") sLeftBank = 0;
  994. if (sTopBank == "" || sTopBank == "-") sTopBank = 0;
  995. var sSndMsg = "";
  996. var sBcNo = "";
  997. var iprintcnt = 0;
  998. var styleFlags = model.getValue("/root/main/patrem/prcpdeliveinfo/prcpdelivefact").split("]");
  999. var cmt = styleFlags[0];
  1000. sSndMsg = "AA103500500"; // 시작위치 셋팅
  1001. iXPos = Number(sLeftBank) + 20;
  1002. iYPos = Number(sTopBank) + 75;
  1003. sSndMsg += "V" + iXPos + "H" + iYPos + "BG02100" + "*"+pid+' '+excugrp+"*";
  1004. // 등록번호 + 그룹코드
  1005. iXPos = Number(sLeftBank) + 140;
  1006. iYPos = Number(sTopBank) + 130;
  1007. sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), "*"+pid+' '+excugrp+"*", 0.5, 1);
  1008. // 등록번호
  1009. iXPos = Number(sLeftBank) + 30;
  1010. iYPos = Number(sTopBank) + 180;
  1011. sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), pid, 2.5, 1);
  1012. // 그룹코드
  1013. iXPos = Number(sLeftBank) + 380;
  1014. iYPos = Number(sTopBank) + 180;
  1015. sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), excugrp, 2.5, 1);
  1016. // 환자명
  1017. iXPos = Number(sLeftBank) + 30;
  1018. iYPos = Number(sTopBank) + 230;
  1019. sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), patnm, 2.5, 1);
  1020. // 성별
  1021. iXPos = Number(sLeftBank) + 260;
  1022. iYPos = Number(sTopBank) + 230;
  1023. sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), sex, 2.5, 1);
  1024. //나이
  1025. iXPos = Number(sLeftBank) + 380;
  1026. iYPos = Number(sTopBank) + 230;
  1027. sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), age, 2.5, 1);
  1028. //주민번호
  1029. iXPos = Number(sLeftBank) + 280;
  1030. iYPos = Number(sTopBank) + 300;
  1031. sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), rrgstno1+"-"+gbn, 1.5 , 0.5);
  1032. sSndMsg += "Q" + "1" + "Z";
  1033. CommAX.SendMsg(sSndMsg);
  1034. }
  1035. //=====================================================================================================================================================================================
  1036. // @ 촬영실 배정관리 SATO BarCode Print 설정
  1037. //=====================================================================================================================================================================================
  1038. function fBarcdPhoLbPrtSato(pid, patnm, sna, roomcd, excupartcd, prcpdelivefact, deptengabbr, erprcpflag, prcpnm, barpid)
  1039. {
  1040. var barcdRef = "/root/main/barcdprntsetup/prntsetupinfo/setupinfo";
  1041. var sPrntKind = model.getValue(barcdRef + "[1]/prntkind");
  1042. var portOpenCheck = "";
  1043. var LCount = 0;
  1044. var iXPos = 0;
  1045. var iYPos = 0;
  1046. var sSndMsg = "";
  1047. //alert("sPrntKind : " + sPrntKind);
  1048. if (sPrntKind == 0) return;
  1049. var sCommKind = model.getValue(barcdRef + "[1]/commkind");
  1050. var sLeftBank = model.getValue(barcdRef + "[1]/blank/left");
  1051. var sTopBank = model.getValue(barcdRef + "[1]/blank/top");
  1052. if (sLeftBank == "" || sLeftBank == "-") sLeftBank = 0;
  1053. if (sTopBank == "" || sTopBank == "-") sTopBank = 0;
  1054. var sSndMsg = "";
  1055. var sBcNo = "";
  1056. var iprintcnt = 0;
  1057. var styleFlags = model.getValue("/root/main/patrem/prcpdeliveinfo/prcpdelivefact").split("]");
  1058. var cmt = styleFlags[0];
  1059. sSndMsg = "AA103500500"; // 시작위치 셋팅
  1060. //바코드
  1061. iXPos = Number(sLeftBank) + 140;
  1062. iYPos = Number(sTopBank) + 10;
  1063. sSndMsg += "V" + iYPos + "H" + iXPos + "BG02100" + barpid; // 바코드
  1064. // 등록번호
  1065. iXPos = Number(sLeftBank) + 0;
  1066. iYPos = Number(sTopBank) + 125;
  1067. //sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), pid, 3.0, 1);
  1068. sSndMsg += "V" + iYPos + "H" + iXPos + "L0203U" + pid + "L0101";;
  1069. //%2M
  1070. // 환자명
  1071. iXPos = Number(sLeftBank) + 250;
  1072. iYPos = Number(sTopBank) + 125;
  1073. sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), patnm, 2.0, 1);
  1074. //sSndMsg += "V" + iYPos + "H" + iXPos + "L0203U" + patnm + "L0101";
  1075. // 병실코드
  1076. iXPos = Number(sLeftBank) + 0;
  1077. iYPos = Number(sTopBank) + 170;
  1078. //sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), roomcd, 3.0, 1);
  1079. sSndMsg += "V" + iYPos + "H" + iXPos + "L0203U" + roomcd + "L0101";;
  1080. // 진료과
  1081. iXPos = Number(sLeftBank) + 260;
  1082. iYPos = Number(sTopBank) + 170;
  1083. //sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), deptengabbr, 3.0, 1);
  1084. sSndMsg += "V" + iYPos + "H" + iXPos + "L0203U" + deptengabbr + "L0101";;
  1085. // 성별나이
  1086. iXPos = Number(sLeftBank) + 400;
  1087. iYPos = Number(sTopBank) + 170;
  1088. //sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), sna, 3.0, 1);
  1089. sSndMsg += "V" + iYPos + "H" + iXPos + "L0203U" + sna + "L0101";;
  1090. // 처방명
  1091. iXPos = Number(sLeftBank) + 0;
  1092. iYPos = Number(sTopBank) + 210;
  1093. //sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), prcpnm, 3.0, 1);
  1094. //sSndMsg += "V" + iYPos + "H" + iXPos + "L0203U" + prcpnm + "L0101";
  1095. sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), prcpnm, 2, 1);
  1096. // 처방전달사항
  1097. iXPos = Number(sLeftBank) + 0;
  1098. iYPos = Number(sTopBank) + 250;
  1099. sSndMsg += CommAX.PrtImgOut(parseInt(iYPos), parseInt(iXPos), prcpdelivefact, 1,1);
  1100. //sSndMsg += "V" + iYPos + "H" + iXPos + "L0203U" + prcpdelivefact + "L0101";;
  1101. sSndMsg += "Q" + "1" + "Z";
  1102. CommAX.SendMsg(sSndMsg);
  1103. }
  1104. // 검사실용 동명이인 체크실시
  1105. function aezfCheckNameConflict(pid, suppdeptcd, excuroomcdid, excuroomgrpcdid) {
  1106. // 필수체크
  1107. if ( pid == '' || pid == null) {
  1108. messageBox("차트번호가 입력되지 않았습니다.\r\n 차트번호를", "I007");
  1109. return;
  1110. } else {
  1111. model.makeValue("/root/send/nameconflict/pid", pid);
  1112. model.makeValue("/root/send/nameconflict/suppdeptcd", suppdeptcd);
  1113. model.makeValue("/root/send/nameconflict/excuroomcdid", excuroomcdid);
  1114. model.makeValue("/root/send/nameconflict/excuroomgrpcdid", excuroomgrpcdid);
  1115. model.makeValue("/root/temp/nameconflict/conflictyn", "");
  1116. submit("TRAER00209");
  1117. if (model.getValue("/root/temp/nameconflict/conflictyn") == "Y") {
  1118. messageBox("현재 환자와 성명이 동일한 환자가 존재합니다.\r\n" +
  1119. " 주의하여 작업하시기 바랍니다.", "I000");
  1120. return false;
  1121. } else {
  1122. return true;
  1123. }
  1124. }
  1125. }