SMMNS00100.js 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924
  1. /************************************************************************************************************************************************************
  2. * 전문간호 메인 (SMMNS00100.xrw - JScript )
  3. * - Version :
  4. * 1) : Ver.1.00.01
  5. * 2) : Ver.2.00
  6. ************************************************************************************************************************************************************/
  7. var xEdupatlistPath = '/root/main/edupatinfo/edupatlist'; //교육환자리스트
  8. var xIninfolistPath = '/root/main/ininfo/ininfolist'; //환자예약정보리스트
  9. var xItemPath = '/root/main/item/patinfo'; //환자상세정보
  10. var suppdeptcd = '';//메뉴그룹에 등록된 사용부서코드
  11. var suppdeptnm = '';//메뉴그룹에 등록된 사용부서명
  12. // emr.mnwmcode
  13. // cdgrupid 022, 023, 024
  14. // 022 : 전문분야리스트 (grupdetldesc : R <- 의뢰데이터구분)
  15. // 023 : 전문간호팀코드
  16. // 024 : 전문간호겸업부서 (상처/장요루)
  17. /***********************************************************************************************************************************************************
  18. * @author : dhkim
  19. * @desc : 화면초기화
  20. ***********************************************************************************************************************************************************/
  21. function fInit(){
  22. //20090205 dhkim
  23. //전문간호/BMT전문간호 로 나눠지게 되면서 사용부서에 해당하는 분야로 각각 등록됨.
  24. suppdeptcd = aezfSetSuppDeptcd();//메뉴그룹에 등록된 사용부서코드
  25. //20090522 dhkim 메뉴사용처명 조회
  26. suppdeptnm = getMenuDeptnm('/root/send/deptcd', suppdeptcd, 'TRMNI02031', '/root/temp/menudeptinfo/deptnm');
  27. fSpclCareSearch(suppdeptcd); //전문분야를 조회한다.
  28. fSetSearchDate(); //조회 기준일자 setting
  29. fSpclNursDeptSearch();//간호에 등록된 전문분야 정보를 임시노드에 조회해 온다.
  30. fSpcltemCodeSearch(); //간호에 등록된 전문간호팀코드 정보를 임시노드에 조회해 온다.
  31. fSpclSideJobSearch(); //간호에 등록된 전문간호겸업부서 정보를 임시노드에 조회해 온다.
  32. cmb_spcl.select(0); //전문분야의 콤보 제일 첫번째로 선택된 상태
  33. }
  34. //초기정보조회(전문분야, 공통코드)
  35. /***********************************************************************************************************************************************************
  36. * @author : dhkim
  37. * @desc : 전문분야 코드및 명칭을 조회한다.
  38. ***********************************************************************************************************************************************************/
  39. function fSpclCareSearch(suppdeptcd){
  40. //20090205 dhkim
  41. //전문간호/BMT전문간호 로 나눠지게 되면서 사용부서에 해당하는 분야로 각각 등록됨.
  42. model.removenode('/root/send');
  43. model.makeValue('/root/send/suppdeptcd', suppdeptcd);
  44. model.removenode('root/hidden/spclcarefildflaginfo');
  45. model.makenode('root/hidden/spclcarefildflaginfo');
  46. if(!submit('TRMNS00107')){
  47. messageBox('전문분야기준자료 조회를 실패하였습니다.', 'E999');
  48. return false;
  49. }
  50. }
  51. /***********************************************************************************************************************************************************
  52. * @author : dhkim
  53. * @desc : 간호에 등록된 전문분야 정보
  54. ***********************************************************************************************************************************************************/
  55. function fSpclNursDeptSearch(){
  56. //20090116 dhkim
  57. //간호에 등록된 전문분야 정보를 임시노드에 조회해 온다.
  58. //간호 테이블에 등록된 조회정보
  59. //전문분야코드 : 022, 전문간호팀코드 : 023
  60. model.removenode('/root/send');
  61. model.makeValue('/root/send/cdgrupid', '022');
  62. model.removenode('/root/hidden/nursdeptinfo');
  63. model.makenode('/root/hidden/nursdeptinfo');
  64. if(!submit('TRMNS00108')){
  65. messageBox('간호에 등록된 전문분야정보를 조회를 실패하였습니다.', 'E999');
  66. return false;
  67. }
  68. }
  69. /***********************************************************************************************************************************************************
  70. * @author : dhkim
  71. * @desc : 전문간호팀코드 정보
  72. ***********************************************************************************************************************************************************/
  73. function fSpcltemCodeSearch(){
  74. //20090119 dhkim
  75. //간호에 등록된 전문간호팀코드 정보를 임시노드에 조회해 온다.
  76. //간호 테이블에 등록된 조회정보
  77. //전문분야코드 : 022, 전문간호팀코드 : 023
  78. model.removenode('/root/send');
  79. model.makeValue('/root/send/cdgrupid', '023');
  80. model.removenode('/root/hidden/spclteaminfo');
  81. model.makenode('/root/hidden/spclteaminfo');
  82. if(!submit('TRMNS00109')){
  83. messageBox('간호에 등록된 전문분야정보를 조회를 실패하였습니다.', 'E999');
  84. return false;
  85. }
  86. }
  87. /***********************************************************************************************************************************************************
  88. * @author : dhkim
  89. * @desc : 전문간호겸업부서 정보
  90. ***********************************************************************************************************************************************************/
  91. function fSpclSideJobSearch(){
  92. //20090128 dhkim
  93. //간호에 등록된 전문간호겸업부서 정보를 임시노드에 조회해 온다.
  94. //간호 테이블에 등록된 조회정보
  95. //전문분야코드 : 022, 전문간호팀코드 : 023, 전문간호겸업부서코드 : 024
  96. model.removenode('/root/send');
  97. model.makeValue('/root/send/cdgrupid', '024');
  98. model.removenode('/root/hidden/spclsideinfo');
  99. model.makenode('/root/hidden/spclsideinfo');
  100. if(!submit('TRMNS00110')){
  101. messageBox('간호에 등록된 전문분야겸업부서정보 조회를 실패하였습니다.', 'E999');
  102. return false;
  103. }
  104. }
  105. /***********************************************************************************************************************************************************
  106. * @group :
  107. * @ver : 2007.05.16
  108. * @by : 정경화
  109. * @---------------------------------------------------------------------------------------------------------------------------------------------------------
  110. * @type : function
  111. * @access : public
  112. * @desc : 조회일자 Setting
  113. * @param :
  114. * @return :
  115. ***********************************************************************************************************************************************************/
  116. function fSetSearchDate(){
  117. //var sdate = curdate.toDate('YYYYMMDD').getAddDate(-7, "D").getDateFormat('YYYYMMDD');//일주일전..dateHelper.js참고
  118. //20090521 dhkim 변경요청 전일~당일로
  119. ipt_Fromdd.value = getCurrentDate().toDate('YYYYMMDD').getAddDate(-1, "D").getDateFormat('YYYYMMDD');//하루전
  120. //ipt_Fromdd.value = getCurrentDate();
  121. ipt_Enddd.value = getCurrentDate();
  122. }
  123. /***********************************************************************************************************************************************************
  124. * 환자정보에 대한 인풋 컴포넌트를 disabled 시킨다.
  125. * 신규등록시에만 예약사유, remark를 수정상태로 변경
  126. * 20090522 dhkim
  127. * remark는 수정가능함. (변경개발요청 itc김숙인)
  128. ************************************************************************************************************************************************************/
  129. function fPatInfoAreaDisabled(isNew){
  130. //isNew가 true 경우에만 입력가능상태로 만들어준다.
  131. if(isNew){
  132. ipt_reqdd.disabled = false;//의뢰일자
  133. tar_remark.disabled = false;//Remark
  134. ipt_reqresn.disabled = false;//예약사유
  135. btn_PSave.disabled = false;//환자정보조회저장버튼
  136. cmb_glytype.disabled = false;//당뇨유형
  137. ipt_rervdd.disabled = false;//예약일자
  138. ipt_rervtm.disabled = false;//예약시간
  139. }else{
  140. ipt_reqdd.disabled = true;//의뢰일자
  141. //remark는 수정가능함. (변경개발요청 itc김숙인)
  142. //tar_remark.disabled = true;//Remark
  143. tar_remark.disabled = false;//Remark
  144. ipt_reqresn.disabled = true;//예약사유
  145. //remark는 수정가능함. (변경개발요청 itc김숙인)
  146. //btn_PSave.disabled = true;//환자정보조회저장버튼
  147. btn_PSave.disabled = false;//환자정보조회저장버튼
  148. cmb_glytype.disabled = true;//당뇨유형
  149. ipt_rervdd.disabled = true;//예약일자
  150. ipt_rervtm.disabled = true;//예약시간
  151. }
  152. model.refresh();
  153. }
  154. //메인조회(메인, 예약정보, 상세정보)
  155. /***********************************************************************************************************************************************************
  156. * @group :
  157. * @ver : 2007.05.08
  158. * @by : 정경화
  159. * @---------------------------------------------------------------------------------------------------------------------------------------------------------
  160. * @type : function
  161. * @access : public
  162. * @desc : 전문간호메인 환자리스트조회(의뢰일)
  163. * @param :
  164. * @return :
  165. ************************************************************************************************************************************************************/
  166. function fSearchMainList(){
  167. var sdate = ipt_Fromdd.value;
  168. var edate = ipt_Enddd.value;
  169. if(sdate == '' || !isValidDateTime(sdate)){
  170. sdate = getCurrentDate();
  171. }
  172. if(edate == '' || !isValidDateTime(edate)){
  173. edate = getCurrentDate();
  174. }
  175. ipt_Fromdd.value= sdate;
  176. ipt_Enddd.value = edate;
  177. var spcl = model.getValue("/root/cond/spcl");
  178. var rgstflag = '';
  179. var deptflag = '';
  180. var deptcd = '';
  181. var reqyn = 'f';
  182. var nodesetCnt = getNodesetCount('/root/hidden/nursdeptinfo/nursdeptlist');
  183. for(var i = 1; i <= nodesetCnt; i++){
  184. deptflag = model.getValue('/root/hidden/nursdeptinfo/nursdeptlist[' + i + ']/deptflag');
  185. deptcd = model.getValue('/root/hidden/nursdeptinfo/nursdeptlist[' + i + ']/deptcd');
  186. if(deptflag == 'R' && deptcd == spcl){
  187. reqyn = 't';
  188. break;
  189. }
  190. }
  191. if(reqyn == 't'){
  192. rgstflag = 'R';
  193. }else{
  194. rgstflag = 'E';
  195. }
  196. //20090128 전문분야중 겸업인 부서를 찾는다.
  197. spcl = fMakeSpclSideQuery(spcl);
  198. model.removeNodeset(xEdupatlistPath); //메인그리드
  199. model.removeNodeset(xItemPath); //환자상세정보
  200. model.removeNodeset(xIninfolistPath); //환자예약정보
  201. model.removenode("/root/send");
  202. model.makeNode("/root/send");
  203. model.makeValue("/root/send/spcl", spcl);
  204. model.makeValue("/root/send/ddflag", model.getValue("/root/cond/ddflag"));
  205. model.makeValue("/root/send/fromdd", model.getValue("/root/cond/fromdd"));
  206. model.makeValue("/root/send/enddd", model.getValue("/root/cond/enddd"));
  207. model.makeValue("/root/send/stat", model.getValue("/root/cond/stat"));
  208. model.makeValue("/root/send/patfg", model.getValue("/root/cond/patfg"));
  209. model.makeValue("/root/send/pid", model.getValue("/root/cond/pid"));
  210. model.makeValue("/root/send/patnm", model.getValue("/root/cond/patnm"));
  211. model.makeValue("/root/send/rgstflag", rgstflag);
  212. //20090121 dhkim
  213. //전문간호팀 코드
  214. //model.makeValue("/root/send/spclteamcd", model.getValue("/root/hidden/spclteaminfo/spclteamlist/deptcd"));
  215. //20090205 dhkim
  216. //전문간호/BMT전문간호 로 나눠지게 되면서 사용부서에 해당하는 분야로 각각 등록됨.
  217. model.makeValue("/root/send/spclteamcd", suppdeptcd);
  218. if(!submit("TRMNS00101")){
  219. messageBox('전문간호환자 조회를', 'E009');
  220. return false;
  221. }else{
  222. //그리드의 일자구분을 조회구간에 맞게 캡션을 변경
  223. if(rdo_ddflag.value == "R"){
  224. grd_edupatlist.valueMatrix(0,7)="의뢰일";
  225. }else if(rdo_ddflag.value == "O"){
  226. grd_edupatlist.valueMatrix(0,7)="처방일";
  227. }else if(rdo_ddflag.value == "S"){
  228. grd_edupatlist.valueMatrix(0,7)="처방/의뢰일";
  229. }else if(rdo_ddflag.value == "A"){
  230. grd_edupatlist.valueMatrix(0,7)="수행일";
  231. }
  232. //검사처방데이터(O)는 확인,수행 수정 할 수 없다.
  233. //수행,확인은 당뇨, 신경과, 유방센터 전문간호사의 경우 (검사처방데이터) 기능검사화면에서 실시체크 하므로 막아줄것..
  234. //(rgstflag) -> R :의뢰 , O :검사처방, N :신규, E : 교육처방
  235. for(var i = 1 ; i <= grd_edupatlist.rows ; i++ ){
  236. //alert('i=' + i + ' rgstflag =' + model.getValue(xEdupatlistPath + '[' + i + ']/rgstflag'));
  237. rgstflag = model.getValue(xEdupatlistPath + '[' + i + ']/rgstflag');
  238. if(rgstflag == 'O'){
  239. grd_edupatlist.isReadOnly(i, 14) = true;
  240. grd_edupatlist.isReadOnly(i, 15) = true;
  241. }else{
  242. grd_edupatlist.isReadOnly(i, 14) = false;
  243. grd_edupatlist.isReadOnly(i, 15) = false;
  244. }
  245. }
  246. //환자정보조회 영역 disabled처리
  247. model.resetInstanceNode(xItemPath);
  248. fPatInfoAreaDisabled();
  249. }
  250. }
  251. /***********************************************************************************************************************************************************
  252. * @group :
  253. * @ver : 2007.05.22
  254. * @by : 정경화
  255. * @---------------------------------------------------------------------------------------------------------------------------------------------------------
  256. * @type : function
  257. * @access : public
  258. * @desc : 전문간호 환자별 예약정보 조회
  259. * @param :
  260. * @return :
  261. ************************************************************************************************************************************************************/
  262. function fSearchReserv(){
  263. model.removeNodeset(xIninfolistPath);
  264. var iRow = grd_edupatlist.row;
  265. var iCol = grd_edupatlist.col;
  266. //20090128 dhkim
  267. //전문간호 겸업부서 코딩 수정
  268. var spcl = model.getValue('/root/cond/spcl');
  269. spcl = fMakeSpclSideQuery(spcl);
  270. model.makeValue("/root/send/inpid/pid", model.getValue(xEdupatlistPath + '[' + iRow + ']/pid'));
  271. model.makeValue("/root/send/inpid/reqdd", model.getValue(xEdupatlistPath + '[' + iRow + ']/reqdd'));
  272. model.makeValue('/root/send/inpid/spcl', spcl);
  273. if(!submit("TRMNS00103")){
  274. messageBox('전문간호환자 예약정보조회를', 'E009');
  275. return false;
  276. }else{
  277. model.refresh();
  278. }
  279. //확인, 수행된 데이터는 예약일시를 바꿀수 없다.
  280. for(var i = 1 ; i < grd_InPidList.rows ; i++ ){
  281. if((grd_InPidList.valueMatrix(i,1) == "미수행")||(grd_InPidList.valueMatrix(i,1) == "수행")){
  282. grd_InPidList.isReadOnly(i, 4) = true;
  283. grd_InPidList.isReadOnly(i, 5) = true;
  284. }
  285. }
  286. }
  287. /***********************************************************************************************************************************************************
  288. * @group :
  289. * @ver : 2008.04.22
  290. * @by : dhkim
  291. * @---------------------------------------------------------------------------------------------------------------------------------------------------------
  292. * @type : function
  293. * @access : public
  294. * @desc : 대상자리스트 그리드의 확인여부에 따라 예약정보의 행추가/ 행삭제 버튼을 활성화 또는 비활성화 처리한다.
  295. * @param :
  296. * @return :
  297. ************************************************************************************************************************************************************/
  298. function fControlRsrvButton(){
  299. var iRow = grd_edupatlist.row;
  300. if(model.getValue(xEdupatlistPath + '[' + iRow + ']/comdd') == 'true'){
  301. btn_addrow.disabled = false;
  302. btn_delrow.disabled = false;
  303. btn_rsrvsave.disabled = false;
  304. }else{
  305. btn_addrow.disabled = true;
  306. btn_delrow.disabled = true;
  307. btn_rsrvsave.disabled = true;
  308. }
  309. model.refresh();
  310. }
  311. /***********************************************************************************************************************************************************
  312. * @group :
  313. * @ver : 2007.05.16
  314. * @by : 정경화
  315. * @---------------------------------------------------------------------------------------------------------------------------------------------------------
  316. * @type : function
  317. * @access : public
  318. * @desc : 전문간호 환자상세정보 조회
  319. * @param :
  320. * @return :
  321. ************************************************************************************************************************************************************/
  322. function fSearchPatDetail(){
  323. iRow = grd_edupatlist.row;
  324. model.removeNodeset("/root/send");
  325. model.removeNodeset(xItemPath);
  326. model.makeValue("/root/send/pid", model.getValue(xEdupatlistPath + '[' + iRow + ']/pid'));//등록번호
  327. model.makeValue("/root/send/spcl", model.getValue(xEdupatlistPath + '[' + iRow + ']/reqdetlflag'));//전문분야
  328. model.makeValue("/root/send/rervdd", model.getValue(xEdupatlistPath + '[' + iRow + ']/prerervdd'));//예약일자
  329. model.makeValue("/root/send/formrecseq",model.getValue(xEdupatlistPath + '[' + iRow + ']/formrecseq'));//서식기록순번
  330. model.makeValue("/root/send/prcpdd", model.getValue(xEdupatlistPath + '[' + iRow + ']/prcpdd'));//처방일자
  331. model.makeValue("/root/send/prcpno", model.getValue(xEdupatlistPath + '[' + iRow + ']/prcpno'));//처방일련번호
  332. model.makeValue("/root/send/prcphistno",model.getValue(xEdupatlistPath + '[' + iRow + ']/prcphistno'));//처방이력번호
  333. model.makeValue("/root/send/seqno", model.getValue(xEdupatlistPath + '[' + iRow + ']/seqno'));//순번
  334. model.makeValue("/root/send/ddflag", model.getValue("/root/cond/ddflag"));
  335. model.makeValue("/root/send/fromdd", model.getValue("/root/cond/fromdd"));
  336. model.makeValue("/root/send/enddd", model.getValue("/root/cond/enddd"));
  337. model.makeValue("/root/send/reqdd", model.getValue(xEdupatlistPath + '[' + iRow + ']/reqdd'));
  338. model.makeValue("/root/send/rervtm", model.getValue(xEdupatlistPath + '[' + iRow + ']/rervtmyn'));
  339. model.makeValue("/root/send/reqdrid", model.getValue(xEdupatlistPath + '[' + iRow + ']/reqdrid'));
  340. model.makeValue("/root/send/reqnursid", model.getValue(xEdupatlistPath + '[' + iRow + ']/reqnursid'));
  341. model.makeValue("/root/send/reqdrnm", model.getValue(xEdupatlistPath + '[' + iRow + ']/reqdrnm'));
  342. model.makeValue("/root/send/reqnursnm", model.getValue(xEdupatlistPath + '[' + iRow + ']/reqnursnm'));
  343. model.makeValue("/root/send/reqdeptcd", model.getValue(xEdupatlistPath + '[' + iRow + ']/reqdeptcd'));
  344. model.makeValue("/root/send/reqdeptnm", model.getValue(xEdupatlistPath + '[' + iRow + ']/reqdeptnm'));
  345. //20090522 dhkim 등록구분추가
  346. model.makeValue("/root/send/rgstflag", model.getValue(xEdupatlistPath + '[' + iRow + ']/rgstflag'));
  347. if(!submit("TRMNS00102")){
  348. messageBox('환자 상세정보조회를', 'E009');
  349. return false;
  350. }else{
  351. fPatInfoAreaDisabled();
  352. }
  353. }
  354. /***********************************************************************************************************************************************************
  355. * @group :
  356. * @ver : 2008.02.28
  357. * @by : dhkim
  358. * @---------------------------------------------------------------------------------------------------------------------------------------------------------
  359. * @type : function
  360. * @access : public
  361. * @desc : 메인의 확인,수행처리
  362. * @param :
  363. * @return :
  364. ************************************************************************************************************************************************************/
  365. function fSaveMainList(){
  366. model.removenode("/root/send/savedata");
  367. model.makeNode("/root/send/savedata");
  368. var savedata = grd_edupatlist.getUpdateDataAll('i');
  369. model.setValue('/root/send/savedata', savedata);
  370. if(submit("TXMNS00101")){
  371. btn_select.dispatch("DOMActivate");//저장 후 재조회
  372. }else{
  373. messageBox('확인 및 수행처리를', 'E009');
  374. return false;
  375. }
  376. }
  377. /***********************************************************************************************************************************************************
  378. * @group :
  379. * @ver : 2008.02.28
  380. * @by : dhkim
  381. * @---------------------------------------------------------------------------------------------------------------------------------------------------------
  382. * @type : function
  383. * @access : public
  384. * @desc : 환자 추가예약 grid 행추가 버튼 클릭시 호출.
  385. * 메인리스트의 선택한 환자정보를 그리드 행추가시 예약정보에 반영
  386. * @param :
  387. * @return :
  388. ************************************************************************************************************************************************************/
  389. function fAddRowReservGrid(){
  390. aRow = grd_edupatlist.row;
  391. if(model.getValue(xEdupatlistPath + "[" + aRow + "]/pid") == ""){
  392. messageBox("예약추가할 환자를 ","C002");
  393. return false;
  394. }else{
  395. var cnt = grd_InPidList.row;
  396. var seqno = 0;
  397. //행추가 했을때 grd_InPidList에 count가 없으면 맨 첫번째값은 grd_edupatlist의 seqno를 대입
  398. if(cnt < 1){
  399. seqno = model.getValue(xEdupatlistPath + '[' + aRow + ']/seqno');
  400. }
  401. //예약정보그리드 행추가
  402. grd_InPidList.addItem();
  403. //대상자리스트의 정보를 예약정보그리드에 반영
  404. //model.setValue(xIninfolistPath + '[' + grd_InPidList.row + ']/stat', model.getValue(xEdupatlistPath + '[' + aRow + ']/stat'));
  405. model.setValue(xIninfolistPath + '[' + grd_InPidList.row + ']/pid', model.getValue(xEdupatlistPath + '[' + aRow + ']/pid'));
  406. model.setValue(xIninfolistPath + '[' + grd_InPidList.row + ']/reqdd', model.getValue(xEdupatlistPath + '[' + aRow + ']/reqdd'));
  407. model.setValue(xIninfolistPath + '[' + grd_InPidList.row + ']/reqdetlflag', model.getValue(xEdupatlistPath + '[' + aRow + ']/reqdetlflag'));
  408. model.setValue(xIninfolistPath + '[' + grd_InPidList.row + ']/seqno', seqno);
  409. model.setValue(xIninfolistPath + '[' + grd_InPidList.row + ']/patfg', model.getValue(xEdupatlistPath + '[' + aRow + ']/patfg'));
  410. model.setValue(xIninfolistPath + '[' + grd_InPidList.row + ']/rgstflag', model.getValue(xEdupatlistPath + '[' + aRow + ']/rgstflag'));
  411. model.setValue(xIninfolistPath + '[' + grd_InPidList.row + ']/reqdeptcd', model.getValue(xEdupatlistPath + '[' + aRow + ']/reqdeptcd'));
  412. model.setValue(xIninfolistPath + '[' + grd_InPidList.row + ']/reqdrid', model.getValue(xEdupatlistPath + '[' + aRow + ']/reqdrid'));
  413. model.setValue(xIninfolistPath + '[' + grd_InPidList.row + ']/reqnursid', model.getValue(xEdupatlistPath + '[' + aRow + ']/reqnursid'));
  414. model.setValue(xIninfolistPath + '[' + grd_InPidList.row + ']/orddd', model.getValue(xEdupatlistPath + '[' + aRow + ']/orddd'));
  415. model.setValue(xIninfolistPath + '[' + grd_InPidList.row + ']/cretno', model.getValue(xEdupatlistPath + '[' + aRow + ']/cretno'));
  416. model.setValue(xIninfolistPath + '[' + grd_InPidList.row + ']/prerervdd', model.getValue(xEdupatlistPath + '[' + aRow + ']/prerervdd'));
  417. model.setValue(xIninfolistPath + '[' + grd_InPidList.row + ']/formrecseq', model.getValue(xEdupatlistPath + '[' + aRow + ']/formrecseq'));
  418. model.setValue(xIninfolistPath + '[' + grd_InPidList.row + ']/prcpdd', model.getValue(xEdupatlistPath + '[' + aRow + ']/prcpdd'));
  419. model.setValue(xIninfolistPath + '[' + grd_InPidList.row + ']/prcpno', model.getValue(xEdupatlistPath + '[' + aRow + ']/prcpno'));
  420. model.setValue(xIninfolistPath + '[' + grd_InPidList.row + ']/prcphistno', model.getValue(xEdupatlistPath + '[' + aRow + ']/prcphistno'));
  421. model.refresh();
  422. }
  423. }
  424. /***********************************************************************************************************************************************************
  425. * @group :
  426. * @ver : 2008.02.28
  427. * @by : dhkim
  428. * @---------------------------------------------------------------------------------------------------------------------------------------------------------
  429. * @type : function
  430. * @access : public
  431. * @desc : 환자 추가예약 grid 행삭제 버튼 클릭시 호출.
  432. * 예약정보그리드의 삭제할 행을 선택함에 따라 row가 신규상태(i)면 그리드에서 삭제,
  433. * row가 수정상태(u)면 그리드에 D상태로 표시.
  434. * @param :
  435. * @return :
  436. ************************************************************************************************************************************************************/
  437. function fDeleteRowReservGrid(){
  438. var curRow = grd_InPidList.row;
  439. if(curRow > -1){
  440. if(grd_InPidList.rows < 2){
  441. return false;
  442. }
  443. if((grd_InPidList.valueMatrix(curRow,1) == "수행")){
  444. messageBox("수행상태인 예약은 삭제 ","E001");
  445. return;
  446. }
  447. if(grd_InPidList.rowStatus(curRow) == 1){
  448. grd_InPidList.deleteItem(curRow);
  449. }else if(grd_InPidList.rowStatus(curRow) == 0){
  450. grd_InPidList.addStatus(curRow, "delete");
  451. }
  452. }
  453. }
  454. /************************************************************************************************************************************************************
  455. * @group :
  456. * @ver : 2008.02.28
  457. * @by : dhkim
  458. * @---------------------------------------------------------------------------------------------------------------------------------------------------------
  459. * @type : function
  460. * @access : public
  461. * @desc : 전문간호 환자예약 입력/수정/삭제 처리
  462. * @param :
  463. * @return :
  464. ************************************************************************************************************************************************************/
  465. function fSaveReserv(){
  466. model.removenode("/root/send/savedata");
  467. model.makeNode("/root/send/savedata");
  468. for(var i = 1 ; i < grd_InPidList.rows ; i++ ){
  469. if(grd_InPidList.rowStatus(i) == 1){
  470. if(model.getValue(xIninfolistPath +'[' + i + ']/rervdd').length != 8){
  471. messageBox("환자예약정보의 예약일자는 ","I003");
  472. return false;
  473. }
  474. if(model.getValue(xIninfolistPath +'[' + i + ']/rervtm').length != 4){
  475. messageBox("환자예약정보의 예약시간은 ","I003");
  476. return false;
  477. }
  478. }
  479. }
  480. var savedata = grd_InPidList.getUpdateData();
  481. model.setValue('/root/send/savedata', savedata);
  482. if(submit("TXMNS00102")){
  483. btn_select.dispatch("DOMActivate");//저장 후 재조회
  484. }else{
  485. messageBox('환자예약정보의 저장을', 'E009');
  486. return false;
  487. }
  488. }
  489. /*************************************************************************************************************************************************************
  490. * @group :
  491. * @ver : 2007.09.10
  492. * @by : 하재륜
  493. * @---------------------------------------------------------------------------------------------------------------------------------------------------------
  494. * @type : function
  495. * @access : public
  496. * @desc : 전문간호 환자 신규등록/예약 저장
  497. * //20090522 dhkim remark수정가능(변경요청 itc김숙인)
  498. * @param :
  499. * @return :
  500. ************************************************************************************************************************************************************/
  501. function fSaveNewPatient(){
  502. var rgstflag = model.getValue('/root/main/item/patinfo/rgstflag');
  503. //if(rgstflag != 'R' && (ipt_rervdd.value.length != 8 || ipt_rervtm.value.length != 4)){
  504. //messageBox("예약일자/시간은 ","I003");
  505. //return false;
  506. //}else{
  507. model.removenode("/root/send");
  508. model.makeValue("/root/send/stat", "입력");
  509. model.makeValue("/root/send/pid", model.getValue(xItemPath +"/pid")); // 등록번호
  510. var patfg = model.getValue(xItemPath +"/patfg");
  511. if(patfg == "입원"){
  512. patfg = "I";
  513. }else if(patfg=="외래"){
  514. patfg = "O";
  515. }
  516. var cretno = model.getValue(xItemPath + "/cretno");
  517. if(cretno != null){
  518. cretno = 0;
  519. }
  520. model.makeValue("/root/send/patfg" , patfg); //구분
  521. model.makeValue("/root/send/reqdd" , getCurrentDate()); //의뢰일자
  522. model.makeValue("/root/send/glutype" , model.getValue(xItemPath + "/glutype")); //당뇨유형
  523. model.makeValue("/root/send/rervdd" , model.getValue(xItemPath + "/rervdd")); //예약일자
  524. model.makeValue("/root/send/rervtm" , model.getValue(xItemPath + "/rervtm")); //예약시간
  525. //20090522 dhkim 하드코딩수정
  526. //model.makeValue("/root/send/reqdeptcd" , '3043900000'); //의뢰과(전문간호팀)
  527. model.makeValue("/root/send/reqdeptcd" , suppdeptcd); //의뢰과(전문간호팀)
  528. model.makeValue("/root/send/reqnursid" , getUserId()); //의뢰과(전문간호팀)
  529. model.makeValue("/root/send/reqdetlflag" , model.getValue("/root/cond/spcl")); //전문분야구분
  530. model.makeValue("/root/send/reqresn" , model.getValue(xItemPath + "/reqresn")); //의뢰사유
  531. model.makeValue("/root/send/remark" , model.getValue(xItemPath + "/remark")); //remark
  532. model.makeValue("/root/send/rgstflag" , "N"); //등록구분(신규)
  533. model.makeValue("/root/send/orddd" , model.getValue(xItemPath + "/indd")); //입원진료일자
  534. model.makeValue("/root/send/cretno" , cretno); //생성번호
  535. //20090522 dhkim remark수정가능(변경요청 itc김숙인)
  536. model.makeValue("/root/send/fromdd" , model.getValue(xItemPath + "/fromdd")); //관리시작일
  537. if(submit("TXMNS00104")){
  538. btn_select.dispatch("DOMActivate");//저장 후 재조회
  539. }else{
  540. //messageBox('신규환자등록을', 'E009');
  541. //20090522 dhkim remark수정추가로 메세지변경
  542. messageBox('환자상세정보 저장을', 'E009');
  543. return false;
  544. }
  545. //}
  546. }
  547. /***********************************************************************************************************************************************************
  548. * @group :
  549. * @ver : 2008.02.28
  550. * @by : dhkim
  551. * @---------------------------------------------------------------------------------------------------------------------------------------------------------
  552. * @type : function
  553. * @access : public
  554. * @desc : 전문간호 환자 신규등록을 위한 팝업을 띄워 환자를 선택한 결과를 환자 상세 정보에 세팅한다.
  555. * @param :
  556. * @return :
  557. ************************************************************************************************************************************************************/
  558. function fChoicePopNewPatient(){
  559. var pid = model.getValue("/root/main/item/patinfo/pid");
  560. var fromdd = model.getValue("/root/cond/fromdd");
  561. var enddd = model.getValue("/root/cond/enddd");
  562. //인스턴스 초기화
  563. model.removenode('/root/main/item');
  564. model.makeNode(xItemPath + '/newyn');
  565. model.makeNode(xItemPath + '/pid');
  566. model.makeNode(xItemPath + '/pidnm');
  567. model.makeNode(xItemPath + '/age');
  568. model.makeNode(xItemPath + '/resno');
  569. model.makeNode(xItemPath + '/telno1');
  570. model.makeNode(xItemPath + '/telno2');
  571. model.makeNode(xItemPath + '/addr1');
  572. model.makeNode(xItemPath + '/addr2');
  573. model.makeNode(xItemPath + '/reqdd');
  574. model.makeNode(xItemPath + '/rervdd');
  575. model.makeNode(xItemPath + '/rervtm');
  576. model.makeNode(xItemPath + '/edudd');
  577. model.makeNode(xItemPath + '/lastedudd');
  578. model.makeNode(xItemPath + '/patfg');
  579. model.makeNode(xItemPath + '/wardno');
  580. model.makeNode(xItemPath + '/reqdeptcd');
  581. model.makeNode(xItemPath + '/reqdrid');
  582. model.makeNode(xItemPath + '/reqnursid');
  583. model.makeNode(xItemPath + '/reqdeptnm');
  584. model.makeNode(xItemPath + '/reqdrnm');
  585. model.makeNode(xItemPath + '/reqnursnm');
  586. model.makeNode(xItemPath + '/glutype');
  587. model.makeNode(xItemPath + '/ordnm');
  588. model.makeNode(xItemPath + '/reqresn');
  589. model.makeNode(xItemPath + '/remark');
  590. model.makeNode(xItemPath + '/actyn');
  591. model.makeNode(xItemPath + '/rsrvpidyn');
  592. model.makeNode(xItemPath + '/cretno');
  593. model.makeNode(xItemPath + '/indd');
  594. // 환자등록 및 조회 Clear
  595. model.resetInstanceNode(xItemPath);
  596. fPatInfoAreaDisabled(true);
  597. model.refresh();
  598. // 환자정보 조회 팝업 호출
  599. fPopPatient("2", xItemPath, pid, fromdd, enddd);
  600. //2007.12.10 의뢰과는 전문간호팀(3043900000)으로, 의뢰간호사는 세션정보의 사용자 아이디, 사용자명을 insert한다.
  601. var userid = getUserInfo("userid");
  602. var usernm = getUserInfo("usernm");
  603. //20090522 dhkim 하드코딩수정 suppdeptcd, suppdeptnm
  604. //model.setValue(xItemPath + '/reqdeptcd', '3043900000'); //의뢰과코드
  605. //model.setValue(xItemPath + '/reqdeptnm', '전문간호팀'); //의뢰과명
  606. model.setValue(xItemPath + '/reqdeptcd', suppdeptcd); //의뢰과코드
  607. model.setValue(xItemPath + '/reqdeptnm', suppdeptnm); //의뢰과명
  608. model.setValue(xItemPath + '/reqnursid', userid); //의뢰간호사코드
  609. model.setValue(xItemPath + '/reqnursnm', usernm); //의뢰간호사명
  610. model.setValue(xItemPath + '/reqdd"', getCurrentDate());
  611. if(model.getValue("/root/main/item/patinfo/pid")==""){
  612. model.resetInstanceNode(xItemPath);
  613. fPatInfoAreaDisabled();
  614. }
  615. model.refresh();
  616. }
  617. //부가기능(협진링크, 기능검사메인링크, 환자 조회팝업링크, 엑셀, 등록대상자)
  618. /***********************************************************************************************************************************************************
  619. * @author : dhkim
  620. * @desc : 협진관리 링크
  621. * rgstflag = R인 것만 → 전문간호구분(의뢰:R, 신규:N, 교육처방:E, 검사처방:O)
  622. * 정맥/상처/장루 분야의 경우 환자 오른쪽 마우스 기능에 협진관리추가하여 팝업창을 띄운다.
  623. ***********************************************************************************************************************************************************/
  624. function fConsultLink(){
  625. var curRow = grd_edupatlist.row;
  626. var rgstflag = model.getValue(xEdupatlistPath + '[' + curRow + ']/rgstflag');
  627. var reqdetlflag = model.getValue(xEdupatlistPath + '[' + curRow + ']/reqdetlflag');
  628. //20090708 dhkim 환자정보파라미터추가
  629. var pid = model.getValue(xEdupatlistPath + '[' + curRow + ']/pid');
  630. var patnm = model.getValue(xEdupatlistPath + '[' + curRow + ']/pidnm');
  631. var sexage = model.getValue(xEdupatlistPath + '[' + curRow + ']/age');
  632. var orddeptnm = model.getValue(xEdupatlistPath + '[' + curRow + ']/dept');
  633. var roomcd = model.getValue(xEdupatlistPath + '[' + curRow + ']/roomcd');
  634. var patParamStr = pid + "▦" + patnm + "▦" + sexage + "▦" + orddeptnm + "▦" + roomcd;
  635. //if(rgstflag == 'R' || reqdetlflag == '0000000773' || reqdetlflag == '0000000774' || reqdetlflag == '0000000767'){
  636. //20090522 dhkim 하드코딩수정
  637. if(rgstflag == 'R'){
  638. var formrecseq = model.getValue(xEdupatlistPath + '[' + curRow + ']/formrecseq');
  639. setParameter("openmode", "reccnstform");
  640. setParameter("formrecseq", formrecseq); //서식기록테이블의 formrecseq(기록순번)
  641. //20090522 dhkim 하드코딩수정 suppdeptcd, suppdeptnm
  642. //setParameter("userdeptcd", "3043900000");
  643. setParameter("userdeptcd", suppdeptcd);
  644. //20090708 dhkim 환자정보파라미터추가
  645. //setParameter("disppatinfo", "pid▦patnm▦F/A▦orddeptnm▦roomcd");
  646. setParameter("disppatinfo", patParamStr);
  647. //modal("../../../emr/medirecweb/xrw/SSMMR01100_서식로더.xrw", 1, 0, 0 ,"", "", "");
  648. modal("SSMMR01100", 1, 0, 0 ,"", "", "");
  649. //}else{
  650. //messageBox("정맥주사/상처/장요루 전문간호사가 아니면 협진관리 화면을 열 수","I004");
  651. //return false;
  652. }
  653. }
  654. /***********************************************************************************************************************************************************
  655. * @author : dhkim
  656. * @desc : 전문간호 조회결과를 엑셀로 저장
  657. ***********************************************************************************************************************************************************/
  658. function fStoreExcel(){
  659. var iRow = grd_edupatlist.rows;
  660. if(iRow < 2){
  661. messageBox("Excel로 저장할 환자가 ","I004");
  662. return;
  663. }
  664. file = window.fileDialog("save","","true","","xls","All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  665. if(file != "") {
  666. grd_edupatlist.saveExcel(file);
  667. }
  668. }
  669. /***********************************************************************************************************************************************************
  670. * @author : dhkim
  671. * @create : 20090119
  672. * @desc : 전문분야콤보 change event
  673. ***********************************************************************************************************************************************************/
  674. function fSpclComboChanged(){
  675. //전문분야에 해당하는 default 조회구간을 설정한다.
  676. //정맥, 상처, 장요루 default : 의뢰일기준
  677. //신경, 유방센터 default : 처방일기준
  678. var spcl = model.getValue("/root/cond/spcl");
  679. var deptflag = '';
  680. var deptcd = '';
  681. var reqyn = 'f';
  682. var nodesetCnt = getNodesetCount('/root/hidden/nursdeptinfo/nursdeptlist');
  683. for(var i = 1; i <= nodesetCnt; i++){
  684. deptflag = model.getValue('/root/hidden/nursdeptinfo/nursdeptlist[' + i + ']/deptflag');
  685. deptcd = model.getValue('/root/hidden/nursdeptinfo/nursdeptlist[' + i + ']/deptcd');
  686. //alert('deptflag '+deptflag + ' deptcd ' + deptcd + ' spcl ' + spcl);
  687. if(deptflag == 'R' && deptcd == spcl){
  688. reqyn = 't';
  689. break;
  690. }
  691. }
  692. //alert('reqyn ' + reqyn);
  693. if(reqyn == 't'){//의뢰
  694. grd_edupatlist.colWidth(8) = 0;
  695. grd_edupatlist.colWidth(11) = 100;
  696. grd_edupatlist.colWidth(5) = 90;
  697. model.setValue("/root/cond/ddflag","R");
  698. grd_edupatlist.valueMatrix(0,7)="의뢰일";
  699. grd_edupatlist.valueMatrix(0,9)="의뢰명";
  700. }else{
  701. grd_edupatlist.colWidth(8) = 71;
  702. grd_edupatlist.colWidth(11) = 79;
  703. grd_edupatlist.colWidth(5) = 56;
  704. model.setValue("/root/cond/ddflag","O");
  705. grd_edupatlist.valueMatrix(0,7)="처방일";
  706. grd_edupatlist.valueMatrix(0,9)="처방명";
  707. }
  708. rdo_ddflag.refresh();
  709. }
  710. /***********************************************************************************************************************************************************
  711. * @author : dhkim
  712. * @create : 20090128
  713. * @desc : 상처/장요루 분야의 경우 상처, 장요루 코드를 함께 조회하도록 쿼리를 만들어서 조회한다.
  714. ***********************************************************************************************************************************************************/
  715. function fMakeSpclSideQuery(spclFildCd){
  716. var nodesetCnt = getNodesetCount("/root/hidden/spclsideinfo/spclsidelist");
  717. var deptcd = "";
  718. var qryStr = "";
  719. var sideYn = "f";
  720. var retSpclCd = '';
  721. for(var i = 1; i <= nodesetCnt; i++){
  722. deptcd = model.getValue("/root/hidden/spclsideinfo/spclsidelist[" + i + "]/deptcd");
  723. if(i == nodesetCnt){
  724. qryStr += deptcd;
  725. }else{
  726. qryStr += deptcd + "|";
  727. }
  728. if(spclFildCd == deptcd){
  729. sideYn = "t";
  730. break;
  731. }
  732. }
  733. if(sideYn == "t"){
  734. retSpclCd = qryStr;
  735. }else{
  736. retSpclCd = spclFildCd;
  737. }
  738. //alert(retSpclCd);
  739. return retSpclCd;
  740. }
  741. /***********************************************************************************************************************************************************
  742. * @author : smy
  743. * @create : 20100218
  744. * @desc : 통합기록조회 링크
  745. *
  746. ***********************************************************************************************************************************************************/
  747. function fSytsRecLink(){
  748. var pid = model.getValue(xEdupatlistPath + '[' + grd_edupatlist.row + ']/pid');
  749. setParameter("SMMRI00400_param_pid", pid);
  750. modal("SMMRI00400", 1, 0, 0 ,"", "", "");
  751. }