SMLBD00800.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758
  1. /*
  2. APU 스케쥴 관리
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. // --------------------------------------------------
  7. // 화면 read
  8. // --------------------------------------------------
  9. function finit() {
  10. //그리드 초기화
  11. fInitGrid();
  12. //오늘 날짜로 초기화 하는 부분.(진료일자를 default로 오늘 날짜로 선택함)
  13. var dt = getCurrentDate();
  14. //model.setValue(xPathMainCond + "/prcpdd", dt);
  15. //공통코드
  16. zbcfGetCodeList(new Array( "L0089","L0089" ), new Array("/root/init/L00891list1", "/root/init/L00891list2"), true);
  17. //병동콤보
  18. submit("TRLBD00811");
  19. //스케쥴일자 설정
  20. fCalendarDisplay(); //스케쥴일자(from~to)설정
  21. var tempdate = fcalendarmake();
  22. model.setValue("/root/main/cond1/orddd", tempdate);
  23. //진료과콤보
  24. var instcd = getUserInfo("dutplceinstcd");
  25. var standard_yn = "orduseyn";
  26. var ord_deptflag = ''; //D:외래진료실만,'W':병동,X:기타
  27. var rslt_ref = "/root/main/cond/orddeptlist";
  28. zbcfGetDeptCodeList(instcd, standard_yn, ord_deptflag, rslt_ref,'asc');
  29. //초기시에 자동조회
  30. fPrcpflagCount(); //처방구분별 건수 조회
  31. fMemoQuery(); //메모 조회
  32. fScheInti();
  33. model.refresh();
  34. //화면open 시 미확정스케쥴 조회되도록
  35. fNoScheQuery();
  36. }
  37. function fInitGrid() {
  38. datagrid1.frozenCols = datagrid1.colRef("ioflag");
  39. datagrid2.frozenCols = datagrid2.colRef("hngnm");
  40. model.removeNodeset("/root/main/scheinfosave/schelist"); //초기화시 그리드 1번째 row 삭제
  41. model.removeNodeset("/root/main/direcprcp/direcprcpinfo"); //초기화시 그리드 1번째 row 삭제
  42. model.removeNodeset("/root/main/memoinfo/memolist"); //초기화시 그리드 1번째 row 삭제
  43. model.refresh();
  44. }
  45. //---------------------------------
  46. // 처방구분별 건수 조회
  47. //---------------------------------
  48. function fPrcpflagCount() {
  49. //초기화
  50. var xPathSendReqdata = "/root/send/reqdata";
  51. model.removeNodeset(xPathSendReqdata);
  52. model.makeNode(xPathSendReqdata);
  53. var instcd = getUserInfo("dutplceinstcd");
  54. var schedd = fcalendarmake();
  55. //값설정
  56. model.makeValue(xPathSendReqdata + "/instcd", instcd); //병원코드
  57. model.makeValue(xPathSendReqdata + "/schedd", schedd); //스케쥴일자
  58. //조회
  59. if ( submit("TRLBD00810") ) {
  60. } else {
  61. model.setValue("/root/main/etcinfo/etclist/cnt1","0");
  62. model.setValue("/root/main/etcinfo/etclist/cnt2","0");
  63. model.setValue("/root/main/etcinfo/etclist/cnt3","0");
  64. model.setValue("/root/main/etcinfo/etclist/cnt4","0");
  65. };
  66. model.refresh();
  67. }
  68. //---------------------------------
  69. // 메모정보 조회
  70. //---------------------------------
  71. function fMemoQuery() {
  72. //초기화
  73. var xPathSendReqdata = "/root/send/reqdata";
  74. model.removeNodeset(xPathSendReqdata);
  75. model.makeNode(xPathSendReqdata);
  76. var instcd = getUserInfo("dutplceinstcd");
  77. var memodd = ""; //fcalendarmake();
  78. //값설정
  79. model.makeValue(xPathSendReqdata + "/instcd", instcd); //병원코드
  80. model.makeValue(xPathSendReqdata + "/memodd", memodd); //스케쥴일자
  81. //조회
  82. submit("TRLBD00802");
  83. model.refresh();
  84. }
  85. //---------------------------------
  86. // 달력클릭시 일자변경
  87. //---------------------------------
  88. function fCalendarDisplay() {
  89. var tempdate = fcalendarmake();
  90. //var tempdateADD = tempdate.toDate().getAddDate(1,"D").getDateFormat("YYYYMMDD");
  91. var tempdateADD = fcalendarmake();
  92. model.setValue("/root/main/cond/ischefrdd", tempdate);
  93. model.setValue("/root/main/cond/ischetodd", tempdateADD);
  94. model.refresh();
  95. //model.setValue("/root/main/cond1/orddd", tempdate);
  96. //model.refresh();
  97. }
  98. /* --------------------------------------------------*/
  99. /* type : function */
  100. /* access : public */
  101. /* desc : 환자정보 가져오기 */
  102. /* param : 검색구분 */
  103. /* return : */
  104. /* --------------------------------------------------*/
  105. function fSearchPatInfo(qryflag) {
  106. modal("../../../pam/patinfomngtweb/xrw/SPPMC02500", qryflag,"150", "150", "SPPMC02500", "/root/source", "/root/send");
  107. var popupendflag = model.getValue("/root/main/popupendflag");
  108. if (popupendflag == "ok"){
  109. model.setValue("/root/main/cond/ipid",model.getValue("/root/main/patinfo/patinfolist/pid"));
  110. model.setValue("/root/main/cond/ihngnm",model.getValue("/root/main/patinfo/patinfolist/hngnm"));
  111. // model.setValue("/root/main/cond/igndrage",model.getValue("/root/main/patinfo/patinfolist/pid"));
  112. model.setValue("/root/main/cond/irrgstno", model.getValue("/root/main/patinfo/patinfolist/rrgstno1") + "-" +
  113. model.getValue("/root/main/patinfo/patinfolist/rrgstno2") );
  114. model.refresh();
  115. // var pid = model.getValue("/root/main/patinfo/patinfolist/pid");
  116. // if (pid != null && pid != "" && pid != " " && pid != "-"){
  117. // fpidref();
  118. // }
  119. }
  120. }
  121. //------------------------------------------
  122. // 스케쥴 입력란으로 자료 이동
  123. //------------------------------------------
  124. function fScheMove(flag) {
  125. var pGrd ;
  126. var xPathFr = "";
  127. var xPathTo = "/root/main/scheinfo/schelist";
  128. //fScheInti(); //값초기화
  129. if (flag == "Y") { // 확정스케쥴 더블 클릭시 스케쥴 입력란으로 자료 이동
  130. pGrd = datagrid1;
  131. xPathFr = "/root/main/scheinfosave/schelist[" + pGrd.row + "]";
  132. if (pGrd.rows <= 1 || pGrd.row <= 0) return;
  133. model.setValue(xPathTo + "/tnsrpid", model.getValue(xPathFr + "/tnsrpid"));
  134. model.setValue(xPathTo + "/hngnm", model.getValue(xPathFr + "/hngnm"));
  135. model.setValue(xPathTo + "/age", model.getValue(xPathFr + "/sex") + "/" + model.getValue(xPathFr + "/age"));
  136. model.setValue(xPathTo + "/ptbsrrgstno", model.getValue(xPathFr + "/ptbsrrgstno"));
  137. model.setValue(xPathTo + "/ioflag", model.getValue(xPathFr + "/ioflag"));
  138. model.setValue(xPathTo + "/orddeptcd", model.getValue(xPathFr + "/orddeptcd"));
  139. cbo_orddeptcd.dispatch("xforms-value-changed");
  140. model.setValue(xPathTo + "/orddrid", model.getValue(xPathFr + "/orddrid"));
  141. model.setValue(xPathTo + "/indd", model.getValue(xPathFr + "/indd"));
  142. model.setValue(xPathTo + "/scheprcpkindcd", model.getValue(xPathFr + "/scheprcpkindcd"));
  143. model.setValue(xPathTo + "/scheprcpflag", model.getValue(xPathFr + "/scheprcpflag"));
  144. model.setValue(xPathTo + "/scheerflag", model.getValue(xPathFr + "/scheerflag"));
  145. model.setValue(xPathTo + "/wardcd", model.getValue(xPathFr + "/wardcd"));
  146. model.setValue(xPathTo + "/roomcd", model.getValue(xPathFr + "/roomcd"));
  147. model.setValue(xPathTo + "/schehopedd", model.getValue(xPathFr + "/schehopedd"));
  148. model.setValue(xPathTo + "/schehopetm", model.getValue(xPathFr + "/schehopetm"));
  149. model.setValue(xPathTo + "/schecmfmdd", model.getValue(xPathFr + "/schecmfmdd"));
  150. model.setValue(xPathTo + "/schecmfmtm", model.getValue(xPathFr + "/schecmfmtm"));
  151. model.setValue(xPathTo + "/remark", model.getValue(xPathFr + "/remark"));
  152. model.setValue(xPathTo + "/dnornm", model.getValue(xPathFr + "/dnornm"));
  153. model.setValue(xPathTo + "/dnorrrgstno", model.getValue(xPathFr + "/dnorrrgstno"));
  154. model.setValue(xPathTo + "/instcd", model.getValue(xPathFr + "/instcd"));
  155. model.setValue(xPathTo + "/schedd", model.getValue(xPathFr + "/schedd"));
  156. model.setValue(xPathTo + "/scheseqno", model.getValue(xPathFr + "/scheseqno"));
  157. fSearchDnorno(); //공여자콤보설정
  158. model.setValue(xPathTo + "/dnorno", model.getValue(xPathFr + "/dnorno"));
  159. model.setValue(xPathTo + "/delyn", model.getValue(xPathFr + "/delyn"));
  160. model.setValue(xPathTo + "/prcpdd", model.getValue(xPathFr + "/prcpdd"));
  161. model.setValue(xPathTo + "/prcpno", model.getValue(xPathFr + "/prcpno"));
  162. }
  163. else {
  164. pGrd = datagrid2;
  165. xPathFr = "/root/main/direcprcp/direcprcpinfo[" + pGrd.row + "]";
  166. if (pGrd.rows <= 1 || pGrd.row <= 0) return;
  167. model.setValue(xPathTo + "/tnsrpid", model.getValue(xPathFr + "/pid"));
  168. model.setValue(xPathTo + "/hngnm", model.getValue(xPathFr + "/hngnm"));
  169. model.setValue(xPathTo + "/age", model.getValue(xPathFr + "/sex") + "/" + model.getValue(xPathFr + "/age"));
  170. model.setValue(xPathTo + "/ptbsrrgstno", model.getValue(xPathFr + "/ptbsrrgstno"));
  171. model.setValue(xPathTo + "/ioflag", model.getValue(xPathFr + "/iogb"));
  172. model.setValue(xPathTo + "/orddeptcd", model.getValue(xPathFr + "/orddeptcd"));
  173. cbo_orddeptcd.dispatch("xforms-value-changed");
  174. model.setValue(xPathTo + "/orddrid", model.getValue(xPathFr + "/orddrid"));
  175. model.setValue(xPathTo + "/indd", model.getValue(xPathFr + "/indd"));
  176. model.setValue(xPathTo + "/scheprcpkindcd", "");
  177. model.setValue(xPathTo + "/scheprcpflag", "");
  178. model.setValue(xPathTo + "/scheerflag", "N");
  179. model.setValue(xPathTo + "/wardcd", model.getValue(xPathFr + "/wardcd"));
  180. model.setValue(xPathTo + "/roomcd", model.getValue(xPathFr + "/roomcd"));
  181. model.setValue(xPathTo + "/schehopedd", model.getValue(xPathFr + "/prcphopedd"));
  182. model.setValue(xPathTo + "/schehopetm", "0000");
  183. model.setValue(xPathTo + "/schecmfmdd", "");
  184. model.setValue(xPathTo + "/schecmfmtm", "");
  185. model.setValue(xPathTo + "/remark", "");
  186. model.setValue(xPathTo + "/dnornm", "");
  187. model.setValue(xPathTo + "/dnorrrgstno", "");
  188. model.setValue(xPathTo + "/instcd", model.getValue(xPathFr + "/instcd"));
  189. model.setValue(xPathTo + "/schedd", "");
  190. model.setValue(xPathTo + "/scheseqno", "");
  191. model.setValue(xPathTo + "/dnorno", "");
  192. model.setValue(xPathTo + "/delyn", 'N');
  193. model.setValue(xPathTo + "/prcpdd", model.getValue(xPathFr + "/prcpdd"));
  194. model.setValue(xPathTo + "/prcpno", model.getValue(xPathFr + "/prcpno"));
  195. }
  196. model.refresh();
  197. //등록번호입력불가능하도록
  198. ipt_tnsrpid.disabled = true;
  199. btn_pid1.disabled = true;
  200. }
  201. // --------------------------------------------------
  202. // 행추가
  203. // --------------------------------------------------
  204. function fMemoAdd() {
  205. //체크기능없음
  206. // var sinsertChk = finsertCheck();
  207. // if ( sinsertChk == false ) return;
  208. var xPathData = "/root/main/memoinfo/memolist";
  209. var pGrd = datagrid3;
  210. pGrd.addRow();
  211. var iRow = pGrd.rows-1;
  212. //기본값설정
  213. model.setValue(xPathData + "[" + iRow + "]/memodd" ,fcalendarmake() ); //메모일자
  214. model.setValue(xPathData + "[" + iRow + "]/memotm" ,getCurrentTime().substring(0,4) ); //메모일시
  215. model.setValue(xPathData + "[" + iRow + "]/savenm" ,getUserName() ); //메모기록자명
  216. model.setValue(xPathData + "[" + iRow + "]/saveid" ,getUserId() ); //메모기록자id
  217. model.setValue(xPathData + "[" + iRow + "]/delyn" , 'N' ); //삭제여부
  218. model.setValue(xPathData + "[" + iRow + "]/memosavedd" ,fcalendarmake() ); //메모저장일자
  219. }
  220. //-------------------------------------------------
  221. //처방구분변동에 따른 처방종류
  222. //-------------------------------------------------
  223. function fPrcpKindComboMake(flag) {
  224. //초기화
  225. var xPathSendReqdata = "/root/send/reqdata";
  226. model.removeNodeset(xPathSendReqdata);
  227. model.makeNode(xPathSendReqdata);
  228. var Instcd = "";
  229. var cdgrupid = "";
  230. if (flag == "1") {
  231. Instcd = getUserInfo("dutplceinstcd");
  232. cdgrupid = model.getValue("/root/main/cond/iprcpflag");
  233. } else {
  234. Instcd = getUserInfo("dutplceinstcd");
  235. cdgrupid = model.getValue("/root/main/scheinfo/schelist/scheprcpflag");
  236. }
  237. switch (cdgrupid) {
  238. case "1": cdgrupid = "L0091"; break;
  239. case "2": cdgrupid = "L0090"; break;
  240. case "3": cdgrupid = "L0092"; break;
  241. default : cdgrupid = "L0091"; break;
  242. }
  243. model.makeValue(xPathSendReqdata + "/instcd", Instcd); //병원코드
  244. model.makeValue(xPathSendReqdata + "/cdgrupid", cdgrupid); //그룹코드
  245. //조회
  246. if (flag == "1")
  247. submit("TRLBD00804");
  248. else
  249. submit("TRLBD00805");
  250. model.refresh();
  251. }
  252. // --------------------------------------------------
  253. // 확정 스케쥴 조회
  254. // --------------------------------------------------
  255. function fScheQuery() {
  256. //초기화
  257. var xPathSendReqdata = "/root/send/reqdata";
  258. model.removeNodeset(xPathSendReqdata);
  259. model.makeNode(xPathSendReqdata);
  260. var instcd = getUserInfo("dutplceinstcd");
  261. var ioflag = model.getValue("/root/main/cond/ijob");
  262. var prcpflag = model.getValue("/root/main/cond/iprcpflag");
  263. var prcpkindcd = model.getValue("/root/main/cond/iprcpkindcd");
  264. var pid = model.getValue("/root/main/cond/ipid");
  265. var scheddfr = model.getValue("/root/main/cond/ischefrdd");
  266. var scheddto = model.getValue("/root/main/cond/ischetodd");
  267. var schedd = "";
  268. var scheseqno = "";
  269. //값설정
  270. model.makeValue(xPathSendReqdata + "/instcd", instcd); //병원코드
  271. model.makeValue(xPathSendReqdata + "/ioflag", ioflag); //입원외래
  272. model.makeValue(xPathSendReqdata + "/prcpflag", prcpflag); //처방구분
  273. model.makeValue(xPathSendReqdata + "/prcpkindcd", prcpkindcd); //처방종류
  274. model.makeValue(xPathSendReqdata + "/pid", pid); //환자id
  275. model.makeValue(xPathSendReqdata + "/scheddfr", scheddfr); //확정스케쥴일자
  276. model.makeValue(xPathSendReqdata + "/scheddto", scheddto); //확정스케쥴일자
  277. model.makeValue(xPathSendReqdata + "/schedd", schedd); //스케쥴일자(pk)
  278. model.makeValue(xPathSendReqdata + "/scheseqno", scheseqno); //스케쥴순번(pk)
  279. //조회
  280. submit("TRLBD00801");
  281. model.refresh();
  282. // if (grd_chemo.rows > 1) { //자료가 존재하면 acting에 반영한다.
  283. // if (row < grd_chemo.rows && row > 1 ) {
  284. // grd_chemo.row = row;
  285. // } else {
  286. // grd_chemo.row= 1;
  287. // }
  288. // fGrdChemoRowChange();
  289. // }
  290. }
  291. //-------------------------------
  292. // 메모 저장
  293. //-------------------------------
  294. function fMemoSave() {
  295. //체크
  296. // var sinsertChk = finsertCheck();
  297. // if ( sinsertChk == false ) return;
  298. var pGrd = datagrid3;
  299. var xPathSendReqdata = "/root/send/reqdata";
  300. model.removeNodeset(xPathSendReqdata);
  301. model.makeNode(xPathSendReqdata);
  302. var instcd = getUserInfo("dutplceinstcd");
  303. var memodd = fcalendarmake();
  304. //값설정
  305. model.makeValue(xPathSendReqdata + "/instcd", instcd); //병원코드
  306. model.makeValue(xPathSendReqdata + "/memodd", memodd); //스케쥴일자
  307. var xPathData = "/root/main/memoinfo/memolist";
  308. var xSendSaveData = "/root/send/savedata";
  309. model.removeNodeset(xSendSaveData);
  310. model.makeNode(xSendSaveData);
  311. model.setValue(xSendSaveData,pGrd.getUpdateData()); //존재하는 값에 값을 변경
  312. //model.copyNode(xSendReqData,xCondData); //element와 값을 복사(기존것 제거)
  313. //node에 해당하는 노드 하나만 남기고, 같은 node Name 을 갖는 노드들은 삭제시켜준다.
  314. //다른 노드들을 삭제시키고 남겨진 노드의 속성이나 value 값은공백으로 세팅이 된다
  315. //model.resetInstanceNode(xPathData);
  316. if (submit("TXLBD00801")) {
  317. }; //저장(신규,수정)
  318. model.refresh();
  319. // if( model.getValue(xErrMsg) == "정상적으로 처리되었습니다." ) {
  320. // messageBox("저장이", "I002");
  321. // }
  322. }
  323. //---------------------------------------------------
  324. // Memo 삭제
  325. //---------------------------------------------------
  326. function fMemoDelete() {
  327. //체크
  328. // var sinsertChk = finsertCheck();
  329. // if ( sinsertChk == false ) return;
  330. var pGrd = datagrid3;
  331. var xPathData = "/root/main/memoinfo/memolist";
  332. var xSendSaveData = "/root/send/savedata";
  333. iRows = pGrd.rows;
  334. var DelList = "m▦rownum▦memodd▦memotm▦memodetail▦savenm▦saveid▦delyn▦instcd▦memosavedd▦memoseqno";
  335. DelList = DelList + "▩" + "d"
  336. + "▦" + pGrd.row
  337. + "▦" + model.getValue(xPathData +"[" + pGrd.row + "]/memodd")
  338. + "▦" + model.getValue(xPathData +"[" + pGrd.row + "]/memotm")
  339. + "▦" + model.getValue(xPathData +"[" + pGrd.row + "]/memodetail")
  340. + "▦" + model.getValue(xPathData +"[" + pGrd.row + "]/savenm")
  341. + "▦" + model.getValue(xPathData +"[" + pGrd.row + "]/saveid")
  342. + "▦" + model.getValue(xPathData +"[" + pGrd.row + "]/delyn")
  343. + "▦" + model.getValue(xPathData +"[" + pGrd.row + "]/instcd")
  344. + "▦" + model.getValue(xPathData +"[" + pGrd.row + "]/memosavedd")
  345. + "▦" + model.getValue(xPathData +"[" + pGrd.row + "]/memoseqno");
  346. model.removeNodeset(xSendSaveData);
  347. model.makeNode(xSendSaveData);
  348. model.setValue(xSendSaveData, DelList);
  349. if (submit("TXLBD00801")) {
  350. //model.refresh();
  351. }
  352. model.refresh();
  353. // if( model.getValue(xErrMsg) == "정상적으로 처리되었습니다." ) {
  354. // messageBox("삭제가", "I002");
  355. // }
  356. }
  357. //---------------------------------------
  358. // 등록번호로 환자의 상세정보 추출
  359. //---------------------------------------
  360. function fPatInfo() {
  361. //초기화
  362. var xPathSendReqdata = "/root/send/reqdata";
  363. model.removeNodeset(xPathSendReqdata);
  364. model.makeNode(xPathSendReqdata);
  365. var Instcd = getUserInfo("dutplceinstcd");
  366. var pid = model.getValue("/root/main/scheinfo/schelist/pid");
  367. model.makeValue(xPathSendReqdata + "/instcd", Instcd); //병원코드
  368. model.makeValue(xPathSendReqdata + "/pid", pid); //환자id
  369. //조회
  370. //submit("TRLBD00806");
  371. var xPathFr = "/root/main/patinfo/patinfolist";
  372. var xPathTo = "/root/main/scheinfo/schelist";
  373. model.setValue(xPathTo + "/tnsrpid", model.getValue(xPathFr + "/pid"));
  374. model.setValue(xPathTo + "/hngnm", model.getValue(xPathFr + "/hngnm"));
  375. model.setValue(xPathTo + "/age", model.getValue(xPathFr + "/sex") + "/" + model.getValue(xPathFr + "/age"));
  376. model.setValue(xPathTo + "/ptbsrrgstno", model.getValue(xPathFr + "/rrgstno1") + "/" + model.getValue(xPathFr + "/rrgstno2"));
  377. // model.setValue(xPathTo + "/patnm",model.getValue(xPathFr + "/hngnm"));
  378. // model.setValue(xPathTo + "/patnm",model.getValue(xPathFr + "/hngnm"));
  379. // model.setValue(xPathTo + "/patnm",model.getValue(xPathFr + "/hngnm"));
  380. // model.setValue(xPathTo + "/patnm",model.getValue(xPathFr + "/hngnm"));
  381. // model.setValue(xPathTo + "/patnm",model.getValue(xPathFr + "/hngnm"));
  382. // model.setValue(xPathTo + "/patnm",model.getValue(xPathFr + "/hngnm"));
  383. model.refresh();
  384. }
  385. //---------------------------------------
  386. // 등록번호로 공여자 찾기
  387. //---------------------------------------
  388. function fSearchDnorno() {
  389. //초기화
  390. var xPathSendReqdata = "/root/send/reqdata";
  391. model.removeNodeset(xPathSendReqdata);
  392. model.makeNode(xPathSendReqdata);
  393. var Instcd = getUserInfo("dutplceinstcd");
  394. var pid = model.getValue("/root/main/scheinfo/schelist/tnsrpid");
  395. model.makeValue(xPathSendReqdata + "/instcd", Instcd); //병원코드
  396. model.makeValue(xPathSendReqdata + "/pid", pid); //환자id
  397. //조회
  398. submit("TRLBD00803");
  399. model.refresh();
  400. }
  401. //-----------------------------------------
  402. // 스케쥴 확정 입력란 clear
  403. //-----------------------------------------
  404. function fScheInti() {
  405. var xPathSchelist = "/root/main/scheinfo/schelist";
  406. model.setValue(xPathSchelist + "/tnsrpid", "");
  407. model.setValue(xPathSchelist + "/hngnm", "");
  408. model.setValue(xPathSchelist + "/age", "");
  409. model.setValue(xPathSchelist + "/ptbsrrgstno", "");
  410. model.setValue(xPathSchelist + "/ioflag", "");
  411. model.setValue(xPathSchelist + "/orddeptcd", "");
  412. model.setValue(xPathSchelist + "/orddrid", "");
  413. model.setValue(xPathSchelist + "/indd", "");
  414. model.setValue(xPathSchelist + "/scheprcpflag", cbo_scheprcpflag.item(0).value);
  415. model.setValue(xPathSchelist + "/scheprcpkindcd", cbo_scheprcpkindcd .item(0).value);
  416. model.setValue(xPathSchelist + "/scheerflag", cbo_scheerflag.item(0).value);
  417. model.setValue(xPathSchelist + "/wardcd", "");
  418. model.setValue(xPathSchelist + "/roomcd", "");
  419. model.setValue(xPathSchelist + "/schehopedd", "");
  420. model.setValue(xPathSchelist + "/schehopetm", "");
  421. model.setValue(xPathSchelist + "/schecmfmdd", "");
  422. model.setValue(xPathSchelist + "/schecmfmtm", "");
  423. model.setValue(xPathSchelist + "/remark", "매핑없이 스케쥴저장");
  424. model.setValue(xPathSchelist + "/dnorrrgstno", "");
  425. model.setValue(xPathSchelist + "/instcd", getUserInfo("dutplceinstcd"));
  426. model.setValue(xPathSchelist + "/schedd", fcalendarmake()); //없어도 괼것 같음(확인사항)
  427. model.setValue(xPathSchelist + "/scheseqno", "");
  428. model.setValue(xPathSchelist + "/dnorno", "");
  429. model.setValue(xPathSchelist + "/delyn", "N");
  430. model.refresh();
  431. }
  432. //---------------------------------
  433. // 달력 날짜를 yyyy-mm-dd로 변경
  434. //---------------------------------
  435. function fcalendarmake() {
  436. var pcalendar = calendar1;
  437. var tdate = pcalendar.year;
  438. var temp = pcalendar.month;
  439. if ( temp.length == 1 )
  440. tdate += "0" + temp;
  441. else
  442. tdate += temp;
  443. temp = pcalendar.day;
  444. if ( temp.length == 1 )
  445. tdate += "0" + temp;
  446. else
  447. tdate += temp;
  448. return tdate;
  449. }
  450. //-----------------------------------------------------
  451. // 스케쥴저장하기(신규,수정,삭제)
  452. //-----------------------------------------------------
  453. function fScheSave(saveflag) {
  454. //체크
  455. // var sinsertChk = finsertCheck();
  456. // if ( sinsertChk == false ) return;
  457. if (model.getValue("/root/main/scheinfo/schelist/schecmfmdd") == "") {
  458. messageBox("확정일자가 존재하지 않습니다.", "E999", "");
  459. model.setFocus("ipt_schecmfmdd");
  460. return;
  461. }
  462. if (model.getValue("/root/main/scheinfo/schelist/schecmfmtm") == "") {
  463. messageBox("확정일시가 존재하지 않습니다.", "E999", "");
  464. model.setFocus("ipt_schecmfmtm");
  465. return;
  466. }
  467. //--------------------------------------------------------
  468. //저장DATA
  469. //--------------------------------------------------------
  470. var xPathData = "/root/main/scheinfo/schelist";
  471. var xSendSaveData = "/root/send/savedata";
  472. if (saveflag != "d" && model.getValue(xPathData +"/scheseqno") != "")
  473. saveflag = "u"; //수정
  474. else if (saveflag != "d" && model.getValue(xPathData +"/scheseqno") == "")
  475. saveflag = "i"; //신규
  476. var saveList1 = "m"
  477. + "▦rownum"
  478. + "▦instcd"
  479. + "▦schedd"
  480. + "▦scheseqno"
  481. + "▦tnsrpid"
  482. + "▦dnorno"
  483. + "▦ioflag"
  484. + "▦scheprcpflag"
  485. + "▦scheprcpkindcd"
  486. + "▦scheerflag"
  487. + "▦orddeptcd"
  488. + "▦orddrid"
  489. + "▦schehopedd"
  490. + "▦schehopetm"
  491. + "▦schecmfmdd"
  492. + "▦schecmfmtm"
  493. + "▦wardcd"
  494. + "▦roomcd"
  495. + "▦indd"
  496. + "▦remark"
  497. + "▦delyn"
  498. + "▦prcpdd"
  499. + "▦prcpno";
  500. var saveList2 = "▩" + saveflag
  501. + "▦" + "1"
  502. + "▦" + model.getValue(xPathData + "/instcd")
  503. + "▦" + fcalendarmake()
  504. + "▦" + model.getValue(xPathData + "/scheseqno")
  505. + "▦" + model.getValue(xPathData + "/tnsrpid")
  506. + "▦" + model.getValue(xPathData + "/dnorno")
  507. + "▦" + model.getValue(xPathData + "/ioflag")
  508. + "▦" + model.getValue(xPathData + "/scheprcpflag")
  509. + "▦" + model.getValue(xPathData + "/scheprcpkindcd")
  510. + "▦" + model.getValue(xPathData + "/scheerflag")
  511. + "▦" + model.getValue(xPathData + "/orddeptcd")
  512. + "▦" + model.getValue(xPathData + "/orddrid")
  513. + "▦" + model.getValue(xPathData + "/schehopedd")
  514. + "▦" + model.getValue(xPathData + "/schehopetm")
  515. + "▦" + model.getValue(xPathData + "/schecmfmdd")
  516. + "▦" + model.getValue(xPathData + "/schecmfmtm")
  517. + "▦" + model.getValue(xPathData + "/wardcd")
  518. + "▦" + model.getValue(xPathData + "/roomcd")
  519. + "▦" + model.getValue(xPathData + "/indd")
  520. + "▦" + model.getValue(xPathData + "/remark")
  521. + "▦" + model.getValue(xPathData + "/delyn")
  522. + "▦" + model.getValue(xPathData + "/prcpdd")
  523. + "▦" + model.getValue(xPathData + "/prcpno");
  524. model.removeNodeset(xSendSaveData);
  525. model.makeNode(xSendSaveData);
  526. model.setValue(xSendSaveData, saveList1+saveList2);
  527. if (submit("TXLBD00802")) {
  528. fScheInti(); //확정스케쥴입력란 정리
  529. fScheQuery(); //확정스케쥴조회
  530. fNoScheQuery(); //미확정스케쥴조회
  531. model.refresh();
  532. }
  533. model.refresh();
  534. // if( model.getValue(xErrMsg) == "정상적으로 처리되었습니다." ) {
  535. // messageBox("삭제가", "I002");
  536. // }
  537. }
  538. // --------------------------------------------------
  539. // 확정 스케쥴 조회
  540. // --------------------------------------------------
  541. function fScheQuery() {
  542. //초기화
  543. var xPathSendReqdata = "/root/send/reqdata";
  544. model.removeNodeset(xPathSendReqdata);
  545. model.makeNode(xPathSendReqdata);
  546. var instcd = getUserInfo("dutplceinstcd");
  547. var ioflag = model.getValue("/root/main/cond/ijob");
  548. var wardcd = model.getValue("/root/main/cond/iwardcd");
  549. var prcpflag = model.getValue("/root/main/cond/iprcpflag");
  550. var prcpkindcd = model.getValue("/root/main/cond/iprcpkindcd");
  551. var pid = model.getValue("/root/main/cond/ipid");
  552. var scheddfr = model.getValue("/root/main/cond/ischefrdd");
  553. var scheddto = model.getValue("/root/main/cond/ischetodd");
  554. //값설정
  555. model.makeValue(xPathSendReqdata + "/instcd", instcd); //병원코드
  556. model.makeValue(xPathSendReqdata + "/ioflag", ioflag); //입원외래
  557. model.makeValue(xPathSendReqdata + "/wardcd", wardcd); //병동
  558. model.makeValue(xPathSendReqdata + "/prcpflag", prcpflag); //처방구분
  559. model.makeValue(xPathSendReqdata + "/prcpkindcd", prcpkindcd); //처방종류
  560. model.makeValue(xPathSendReqdata + "/pid", pid); //환자id
  561. model.makeValue(xPathSendReqdata + "/scheddfr", scheddfr); //확정스케쥴일자
  562. model.makeValue(xPathSendReqdata + "/scheddto", scheddto); //확정스케쥴일자
  563. //조회
  564. submit("TRLBD00801");
  565. model.refresh();
  566. // if (grd_chemo.rows > 1) { //자료가 존재하면 acting에 반영한다.
  567. // if (row < grd_chemo.rows && row > 1 ) {
  568. // grd_chemo.row = row;
  569. // } else {
  570. // grd_chemo.row= 1;
  571. // }
  572. // fGrdChemoRowChange();
  573. // }
  574. }
  575. //-------------------------------------------------
  576. // 스케줄이 잡히지 않은 bmt 지시처방 모든 내역
  577. //-------------------------------------------------
  578. function fNoScheQuery() {
  579. //초기화
  580. var xPathSendReqdata = "/root/send/reqdata";
  581. model.removeNodeset(xPathSendReqdata);
  582. model.makeNode(xPathSendReqdata);
  583. var Instcd = getUserInfo("dutplceinstcd");
  584. var ioflag = model.getValue("/root/main/cond1/ioflag");
  585. var wardcd = model.getValue("/root/main/cond1/wardcd");
  586. var prcpdd = model.getValue("/root/main/cond1/orddd");
  587. //값설정
  588. model.makeValue(xPathSendReqdata + "/instcd", Instcd); //병원코드
  589. model.makeValue(xPathSendReqdata + "/ioflag", ioflag); //입원외래구분
  590. model.makeValue(xPathSendReqdata + "/wardcd", wardcd); //병동
  591. model.makeValue(xPathSendReqdata + "/prcpdd", prcpdd); //처방일
  592. //조회
  593. submit("TRLBD00809");
  594. model.refresh();
  595. //model.refresh();
  596. // if (grd_chemo.rows > 1) { //자료가 존재하면 acting에 반영한다.
  597. // if (row < grd_chemo.rows && row > 1 ) {
  598. // grd_chemo.row = row;
  599. // } else {
  600. // grd_chemo.row= 1;
  601. // }
  602. // fGrdChemoRowChange();
  603. // }
  604. }
  605. //-------------------------------------------------
  606. // 등록번호기준으로 공여자콤보 찾기
  607. //-------------------------------------------------
  608. function fPatinfoPop() {
  609. //팝업조건설정
  610. model.removenode("/root/temp/pid");
  611. model.makeValue("/root/temp/pid", ipt_tnsrpid.value);
  612. //팝업호출
  613. modal("SPPMC02500", "1","150", "150", "SPPMC02500", "/root/temp", "/root/send");
  614. //리턴값
  615. if (model.getValue("/root/main/popupendflag") == "ok") {
  616. fPatInfo();
  617. model.refresh();
  618. fSearchDnorno();
  619. }
  620. }