SMMNR08400.js 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419
  1. /*
  2. 통증관리기록(SMMNR00900.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var sCondPath = "/root/main/cond";
  7. var xChartHeaderListPath = "/root/main/chartheaderlist";
  8. var xTMSettingListPath = "/root/temp/clincobsrecinfo/tmsettinglist";
  9. var xPamInfoPath = "/root/main/paminfo/pamlist"; // 환자정보
  10. var xPrcpInfoPath1 = "/root/main/searchinfo/prcplist1"; // 처방정보(fromdd)
  11. var xPrcpInfoPath2 = "/root/main/searchinfo/prcplist2"; // 처방정보(fromdd+1)
  12. var xPrcpInfoPath3 = "/root/main/searchinfo/prcplist3"; // 처방정보(fromdd+2)
  13. var xPrcpInfoPath4 = "/root/main/searchinfo/prcplist4"; // 처방정보(fromdd+3)--> srchdd
  14. var xPainInfoPath1 = "/root/main/searchinfo/painlist1"; //통증정보(fromdd)
  15. var xPainInfoPath2 = "/root/main/searchinfo/painlist2"; //통증정보(fromdd+1)
  16. var xPainInfoPath3 = "/root/main/searchinfo/painlist3"; //통증정보(fromdd+2)
  17. var xPainInfoPath4 = "/root/main/searchinfo/painlist4"; //통증정보(fromdd+3)--> srchdd
  18. var xTotPainInfoPath = "/root/main/searchinfo/totpainlist"; //통증조회(그래프를 그리기 위한 4일간의 모든 통증기록)
  19. var xTPRInfoPath = "/root/main/searchinfo/tprlist"; //TPR vs조회
  20. var xChkObsPartInfoPath = "/root/main/searchinfo/obspartlist"; //통증부위--> 그래프 체크박스에 나타낼 통증부위
  21. var xPainCountInfoPath = "/root/main/searchinfo/paincount"; //점수가7점이상이 3회이상인경우
  22. var sHeader = new Array();
  23. var sFormerHeader = new Array();
  24. var sPid = ""; // 환자번호
  25. var sIndd = ""; // 입원일자
  26. var sCretNo = ""; // 환자 일자별 일련번호
  27. var sInstcd = ""; // 기관코드
  28. var sIOFlag = ""; // 입원/외래 구분
  29. var sWardCD = ""; // 병동코드
  30. var sRoomCD = ""; // 병실코드
  31. var sJobKindCD = ""; // 직급코드
  32. var sIndschacptstat = "";
  33. var sDschdd = "";
  34. var sChartItem = new Array();
  35. var sLineColor = new Array();
  36. //var sLineColor = new Array(0xcc88dd , 0xff0000 , 0x00ff00 , 0x0000ff , 0x4400cc , 0x6688ff , 0x888822 , 0xff8822 , 0xffff00, 0x88ffff, 0xe5f3c2, 0x6699ff );
  37. var sCheckColor = new Array("#cc88dd" , "#ffff00" , "#6688ff", "#88ffff" , "#00ff00" , "#ff0000" , "#ff88bb" , "#888822" , "#ff8822" ,"#777777", "#aa3399" , "#ccff44","#ccffbb");
  38. var sPatNm = "";
  39. var sSexAge = "";
  40. var sDutplcecd = "";
  41. var sOrdDeptcd = "";
  42. var sMedispclid = "";
  43. var sUserFlag = "";
  44. var sUserDeptCd = "";
  45. var sUserId = "";
  46. //var sSpParamInfo = "";
  47. //var sParamInfo = "";
  48. //var sChartNum = 1;
  49. //응급의료센터 관련 변수_경북대 (2011.05.03 Ahn)
  50. var eERDEPTCD = "";
  51. var eERFLAG = "";
  52. var eSECTIONCD = "";
  53. var sSectioncd ="";
  54. /**
  55. * @group :
  56. * @ver : 2007.06.27
  57. * @by : 이은영
  58. * @---------------------------------------------------
  59. * @type : function
  60. * @access : public
  61. * @desc : 화면 초기화
  62. * @param :
  63. * @return :
  64. * @---------------------------------------------------
  65. */
  66. function fInitialize(pFlag){
  67. for( var idx = 0 ; idx < sCheckColor.length ; idx++){
  68. sLineColor[idx] = RgbToGraph(sCheckColor[idx]);
  69. }
  70. var sPamInfo = "";
  71. //var sParamInfo = "";
  72. //var sSpParamInfo = "";
  73. if(pFlag == "init" || pFlag == "reset"){
  74. //fMakeChart("init24hours");
  75. fMakeChart("init4days");
  76. }
  77. if(pFlag == "init"){
  78. //사용자 직급구분에 따른 화면 제어 플래그 설정
  79. sJobKindCD = getUserInfo("jobkindcd"); // 직급코드
  80. sUserDeptCd = getUserInfo("dutplcecd");
  81. sUserId = getUserInfo("userid");
  82. //---------(20101204) 경북대
  83. //추가
  84. var ssflag = "";
  85. if(getUserInfo("dutplceinstcd") != '032' && getUserInfo("dutplceinstcd") != '031') {
  86. //경북대가 아니면
  87. if( sJobKindCD == "0330" || sJobKindCD == "0310"){
  88. ssflag = "Y";
  89. }else{
  90. ssflag = "N";
  91. }
  92. } else if(getUserInfo("dutplceinstcd") == '032' || getUserInfo("dutplceinstcd") == '031') {
  93. //경북대이면 03%로 체크한다.
  94. if( sJobKindCD.substring(0, 2) == "03"){
  95. ssflag = "Y";
  96. }else{
  97. ssflag = "N";
  98. }
  99. }
  100. //----------------------------
  101. //응급의료센터 부서코드 추출_ 경북대 (2011.05.03 Ahn)
  102. model.makeValue("/root/send/cdgrupid", "'002'");
  103. model.makeValue("/root/send/srchdd" , getCurrentDate()); // 조회기준일자
  104. if(submit("TRMNW00001", false)){
  105. eERDEPTCD = model.getvalue("/root/code/codeinfo/codelist[cdgrupid='002']/cdid");
  106. }
  107. //원본:의사의 경우만
  108. //if(sJobKindCD == "0330" || sJobKindCD == "0310" || sUserId=="20700469"){//20700469 는 테스트용 김홍점
  109. if(ssflag=="Y") {
  110. //---------(20101204) 경북대
  111. sUserFlag = "2";
  112. }else{
  113. sUserFlag = "1";
  114. }
  115. model.setValue(sCondPath+"/srchflag", sUserFlag);
  116. }else{
  117. // sParamInfo = "";
  118. }
  119. // model.setValue(sCondPath+"/cmbstatusx", "0");
  120. // model.setValue(sCondPath+"/cmbstatusy", "0");
  121. model.setValue(sCondPath+"/vwctrl_button","4days");
  122. //상단정보 존재 여부 체크
  123. // 환자정보 조회
  124. sPamInfo = getGlobalVariable("paminfo");
  125. model.removenodeset("/root/main/paminfo/pamlist");
  126. setCSVToNode("/root/main/paminfo",sPamInfo,"pamlist");
  127. if(sPamInfo == ""){
  128. //2008-05-14
  129. fChkTgtPatInfo("disable");
  130. // model.toggle("case_4daysstnd");
  131. fSettingPamInfo(sUserFlag);
  132. model.refresh();
  133. //messageBox("환자를 선택하십시요","I");
  134. return;
  135. }else{
  136. fChkTgtPatInfo("able");
  137. model.refresh();
  138. }
  139. sPid = model.getValue(xPamInfoPath+"/pid"); // 환자번호
  140. sCretNo = model.getValue(xPamInfoPath+"/cretno"); // 환자 일자별 일련번호
  141. sInstcd = model.getValue(xPamInfoPath+"/instcd"); // 기관코드
  142. sIOFlag = model.getValue(xPamInfoPath+"/ioflag"); // 입원/외래 구분
  143. sWardCD = model.getValue(xPamInfoPath+"/wardcd"); // 병동코드
  144. sRoomCD = model.getValue(xPamInfoPath+"/roomcd"); // 병실코드
  145. sIndschacptstat = model.getValue(xPamInfoPath+"/indschacptstat"); //입퇴원구분코드
  146. sDschdd = model.getValue(xPamInfoPath+"/dschdd"); // 퇴원일자
  147. sPatNm = model.getValue(xPamInfoPath+"/hngnm"); // 환자명
  148. sSexAge = model.getValue(xPamInfoPath+"/sex") +"/"+ model.getValue(xPamInfoPath+"/age"); // 성별
  149. sOrdDeptcd = model.getValue(xPamInfoPath+"/orddeptcd");
  150. sMedispclid = model.getValue(xPamInfoPath+"/medispclid");
  151. sSectioncd = model.getValue(xPamInfoPath+"/sectioncd"); // 응급실 구역정보 추가(2011.05.04 ahn)
  152. if(sIOFlag == "O"){
  153. sIndd = model.getValue(xPamInfoPath+"/orddd"); // 진료일자
  154. }else{
  155. sIndd = model.getValue(xPamInfoPath+"/indd"); // 입원일자
  156. }
  157. model.setValue(sCondPath+"/pid", sPid);
  158. model.setValue("/root/main/patinfo/pid", sPid);
  159. model.setValue("/root/main/patinfo/indd", sIndd);
  160. model.setValue("/root/main/patinfo/cretno", sCretNo);
  161. model.setValue("/root/main/patinfo/ordtype", sIOFlag);
  162. model.setValue("/root/main/patinfo/indschacptstat", sIndschacptstat);
  163. model.setValue("/root/main/patinfo/dschdd", sDschdd);
  164. model.setValue("/root/main/patinfo/wardcd", sWardCD);
  165. model.setValue("/root/main/patinfo/roomcd", sRoomCD);
  166. model.setValue("/root/main/patinfo/patnm", sPatNm);
  167. model.setValue("/root/main/patinfo/sexage", sSexAge);
  168. model.setValue("/root/main/patinfo/orddeptcd", sOrdDeptcd);
  169. model.setValue("/root/main/patinfo/medispclid", sMedispclid);
  170. model.setValue("/root/main/patinfo/sectioncd", sSectioncd); // 응급실 구역정보 추가(2011.05.04 ahn)
  171. //퇴원/입원 환자 구분에 따른 화면 제어
  172. if(sIndschacptstat == "D"){
  173. rdo_srchflag.visible = false; //퇴원환자 조회구분 숨기기
  174. grp_oderinpatinfo.visible = false;
  175. grp_inpatinfo.visible = false;
  176. grp_outpatinfo.visible = true;
  177. model.setValue(sCondPath+"/recdd",sDschdd);
  178. }else{
  179. if(pFlag == "init" || pFlag == "reset"){
  180. fSettingUserTypeSrch(sUserFlag);
  181. }
  182. var sRecdate = "";
  183. // var sRectime = "";
  184. if(getCurrentTime().substr(0,4) < "0700"){
  185. sRecdate = getDateCalc(getCurrentDate(),1,"-");
  186. }else{
  187. sRecdate = getCurrentDate();
  188. }
  189. model.setValue(sCondPath+"/recdd",sRecdate);
  190. model.refresh();
  191. if(pFlag == "init"){
  192. if( sUserFlag == "2"){
  193. //진료과 정보 조회
  194. mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/temp/cond/deptgrup/deptgruplist" , "D"); //부서코드 콤보
  195. } else {
  196. //병동코드 조회
  197. fGetCareComWardList();
  198. //내환자 조회
  199. fGetSettingPatientList();
  200. }
  201. }
  202. if(pFlag == "reset" || pFlag == "init"){
  203. if(sUserFlag == "2"){
  204. mmbfGetUserComboList("/root/send/reqdata", "/root/temp/cond/doctlist/medispcl" , sOrdDeptcd, "0330", "", "M");
  205. mmbfGetUserComboList("/root/send/reqdata", "/root/temp/cond/doctlist/atdoct", sOrdDeptcd, "0330", "", "A");
  206. addComboInstance("/root/temp/cond/doctlist/medispcl", "userid^usernm", "-^전체", "usercombo"); //의사콤보 전체항목 추가
  207. addComboInstance("/root/temp/cond/doctlist/atdoct", "userid^usernm", "-^전체", "usercombo");//의사콤보 전체항목 추가
  208. //model.setValue("/root/temp/cond/doctlist/atdoct", "-");
  209. fGetCareComDeptPatList(sOrdDeptcd, sMedispclid , '-', model.getValue("/root/init/mypatsrchflag"));
  210. cmb_deptlist.value = sOrdDeptcd;
  211. cmb_medispcllist.value = sMedispclid;
  212. cmb_atdoctlist.value = "-";
  213. cmb_oderpatlist.value = sPid;
  214. ipt_orderpid.value = sPid;
  215. }else{
  216. // 응급실일 경우 (2011.05.04 Ahn)
  217. //alert(sectioncd);
  218. fGetWardChngInfo("Y", sWardCD, sSectioncd);
  219. fGetCareComRoomList(sWardCD);
  220. if(eERFLAG == "Y"){ // 응급실 환자 조회 (2011.05.04 Ahn)
  221. fGetCareComPatList(sWardCD, sRoomCD, cmb_zone.value);
  222. }else{
  223. fGetCareComPatList(sWardCD, sRoomCD);
  224. }
  225. cmb_wardlist.value = sWardCD;
  226. cmb_roomlist.value = sRoomCD;
  227. cmb_patlist.value = sPid;
  228. ipt_pid.value = sPid;
  229. cmb_mypatlist.value = sPid;
  230. if(eERFLAG == "Y"){
  231. cmb_erpat.value = sPid; // 응급실 환자 지정 (2011.05.04 Ahn)
  232. }
  233. }
  234. }else if(pFlag == "patinit"){
  235. cmb_mypatlist.value = sPid;
  236. if(eERFLAG == "Y"){
  237. cmb_erpat.value = sPid; // 응급실 환자 지정 (2011.05.04 Ahn)
  238. }
  239. }
  240. }
  241. fSearch("4days");
  242. var vsinfo = model.getValue(xTPRInfoPath+ "/bodyinfo") + "\n" + model.getValue(xTPRInfoPath+ "/vsinfo");
  243. model.setValue("/root/temp/vsinfo", vsinfo);
  244. cpt_vsinfo.refresh();
  245. }
  246. /**
  247. * @group :
  248. * @ver : 2008.10.14
  249. * @by : 양천덕
  250. * @---------------------------------------------------
  251. * @type : function
  252. * @access : public
  253. * @desc : 사용자별 조회 조건 변경
  254. * @param :
  255. * @return :
  256. * @---------------------------------------------------
  257. */
  258. function fSettingUserTypeSrch(pFlag){
  259. if( pFlag == "1"){
  260. grp_outpatinfo.visible = false;
  261. grp_oderinpatinfo.visible = false;
  262. grp_inpatinfo.visible = true;
  263. }else{
  264. grp_outpatinfo.visible = false;
  265. grp_oderinpatinfo.visible = true;
  266. grp_inpatinfo.visible = false;
  267. }
  268. }
  269. /**
  270. * @group :
  271. * @ver : 2008.10.14
  272. * @by : 양천덕
  273. * @---------------------------------------------------
  274. * @type : function
  275. * @access : public
  276. * @desc : 사용자별 조회 조건 변경
  277. * @param :
  278. * @return :
  279. * @---------------------------------------------------
  280. */
  281. function fChangUserTypeSrch(pFlag){
  282. fTPRviewInit();
  283. fSettingUserTypeSrch(pFlag);
  284. var sSettingId1 = "-";
  285. var sSettingId2 = "-";
  286. if( pFlag == "1"){
  287. fGetWardChngInfo("Y", "", ""); // 병동 조회조건으로 초기화
  288. //병동코드 조회
  289. fGetCareComWardList();
  290. //내환자 조회
  291. fGetSettingPatientList();
  292. fGetCareComRoomList(sUserDeptCd);
  293. model.setValue("/root/temp/cond/wardcdgrup/wardcdgruplist", sUserDeptCd);
  294. cmb_wardlist.refresh();
  295. }else{
  296. //진료과 정보 조회
  297. mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/temp/cond/deptgrup/deptgruplist" , "D"); //부서코드 콤보
  298. //---------(20101204) 경북대
  299. //추가
  300. var ssflag = "";
  301. if(getUserInfo("dutplceinstcd") != '032' && getUserInfo("dutplceinstcd") != '031') {
  302. //경북대가 아니면
  303. if( sJobKindCD == "0330" || sJobKindCD == "0310"){
  304. ssflag = "Y";
  305. }else{
  306. ssflag = "N";
  307. }
  308. } else if(getUserInfo("dutplceinstcd") == '032' || getUserInfo("dutplceinstcd") == '031') {
  309. //경북대이면 03%로 체크한다.
  310. if( sJobKindCD.substring(0, 2) == "03"){
  311. ssflag = "Y";
  312. }else{
  313. ssflag = "N";
  314. }
  315. }
  316. //원본:의사의 경우만
  317. //if(sJobKindCD == "0330" || sJobKindCD == "0310"){
  318. if(ssflag=="Y") {
  319. //---------(20101204) 경북대
  320. mmbfGetUserComboList("/root/send/reqdata", "/root/temp/cond/doctlist/medispcl" , sUserDeptCd, "0330", "", "M");
  321. mmbfGetUserComboList("/root/send/reqdata", "/root/temp/cond/doctlist/atdoct", sUserDeptCd, "0330", "", "A");
  322. addComboInstance("/root/temp/cond/doctlist/medispcl", "userid^usernm", "-^전체", "usercombo"); //의사콤보 전체항목 추가
  323. addComboInstance("/root/temp/cond/doctlist/atdoct", "userid^usernm", "-^전체", "usercombo");//의사콤보 전체항목 추가
  324. if(model.getValue("/root/temp/cond/doctlist/medispcl/usercombo[ userid='"+ sUserId+"']/userid") != ""){
  325. sSettingId1 = sUserId
  326. }
  327. if(model.getValue("/root/temp/cond/doctlist/atdoct/usercombo[ userid='"+ sUserId+"']/userid") != ""){
  328. sSettingId2 = sUserId
  329. }
  330. fGetCareComDeptPatList(sUserDeptCd, sSettingId1 , sSettingId2, model.getValue("/root/init/mypatsrchflag"));
  331. model.setValue("/root/temp/cond/deptgrup/deptgruplist/dept", sUserDeptCd);
  332. model.setValue("/root/temp/cond/doctlist/medispcl/usercombo", sSettingId1);
  333. model.setValue("/root/temp/cond/doctlist/atdoct/usercombo", sSettingId2);
  334. cmb_deptlist.refresh();
  335. cmb_medispcllist.refresh();
  336. cmb_atdoctlist.refresh();
  337. }else{
  338. model.setValue("/root/temp/cond/deptgrup/deptgruplist/dept", "-");
  339. model.removenodeset("/root/temp/cond/doctlist/medispcl/usercombo");
  340. model.removenodeset("/root/temp/cond/doctlist/atdoct/usercombo");
  341. }
  342. }
  343. }
  344. /**
  345. * @group :
  346. * @ver : 2008.09.01
  347. * @by : 양천덕
  348. * @---------------------------------------------------
  349. * @type : function
  350. * @access : public
  351. * @desc : 초기 param 존재 하지 않을 경우 환자 선택화면 설정
  352. * @param :
  353. * @return :
  354. * @---------------------------------------------------
  355. */
  356. function fSettingPamInfo(pFlag){
  357. model.setValue(sCondPath+"/recdd",getCurrentDate());
  358. fChangUserTypeSrch(pFlag);
  359. }
  360. /**
  361. * @group :
  362. * @ver : 2007.07.11
  363. * @by : 이은영
  364. * @---------------------------------------------------
  365. * @type : function
  366. * @access : public
  367. * @desc : 이전/이후 날짜 Setting
  368. * @param :
  369. * @return :
  370. * @---------------------------------------------------
  371. */
  372. function fDateCalc(pFlag, pVWFlag, pTerm){
  373. switch(pVWFlag){
  374. case "24hours" :
  375. model.setValue(sCondPath+"/recdd",getDateCalc(model.getValue(sCondPath+"/recdd"),1,pFlag));
  376. break;
  377. case "4days" :
  378. model.setValue(sCondPath+"/recdd",getDateCalc(model.getValue(sCondPath+"/recdd"),4,pFlag));
  379. break;
  380. }
  381. ipt_4daysrecdd.refresh();
  382. }
  383. /**
  384. * @group :
  385. * @ver : 2007.07.11
  386. * @by : 이은영
  387. * @---------------------------------------------------
  388. * @type : function
  389. * @access : public
  390. * @desc : 화면 전환
  391. * @param :
  392. * @return :
  393. * @---------------------------------------------------
  394. */
  395. function fChageView(pFlag){
  396. model.setValue(sCondPath+"/vwctrl_button", pFlag);
  397. switch(pFlag){
  398. // case "24hours" :
  399. // model.toggle("case_24hoursstnd");
  400. // //그래프 체크박스 숨김,보임 설정
  401. // if(model.getValue(sCondPath+"/vwctrl_24hours") == "A"){
  402. // grp_chkbox.visible = true;
  403. // }else{
  404. // grp_chkbox.visible = false;
  405. // }
  406. //
  407. // chk_hourschartinfo.visible = true;
  408. // chk_dayschartinfo.visible = false;
  409. // obj_4dayschart.visible = false;
  410. // obj_24hourschart.visible = true;
  411. // btn_4daysvw.visible = true;
  412. // btn_24hoursvw.visible = false;
  413. // grd_timelist24hours.visible = true;
  414. // grd_timelist.visible = false;
  415. // grp_hide.visible = true;
  416. // model.setValue(sCondPath+"/hourschartinfo","1 2 3 4");
  417. // break;
  418. case "4days" :
  419. // model.toggle("case_4daysstnd");
  420. //그래프 체크박스 숨김,보임 설정
  421. // if(model.getValue(sCondPath+"/vwctrl_4days") == "A"){
  422. // grp_chkbox.visible = true;
  423. // }else{
  424. // grp_chkbox.visible = false;
  425. // }
  426. // chk_hourschartinfo.visible = false;
  427. // chk_dayschartinfo.visible = true;
  428. obj_4dayschart.visible = true;
  429. // obj_24hourschart.visible = false;
  430. // btn_4daysvw.visible = false;
  431. // btn_24hoursvw.visible = true;
  432. // grd_timelist24hours.visible = false;
  433. grd_timelist.visible = true;
  434. // grp_hide.visible = false;
  435. // model.setValue(sCondPath+"/dayschartinfo","1 2 3 4");
  436. break;
  437. }
  438. }
  439. /**
  440. * @group :
  441. * @ver : 2008.07.30
  442. * @by : 양천덕
  443. * @---------------------------------------------------
  444. * @type : function
  445. * @access : public
  446. * @desc :
  447. * @param : 화면 초기화
  448. * @return :
  449. * @---------------------------------------------------
  450. */
  451. function fTPRviewInit(){
  452. if(getNodesetCount("/root/temp/cond/patientgrup") < 1){
  453. return;
  454. }
  455. fInitTopInfo();
  456. model.removenode("/root/main/searchinfo");
  457. model.removeNode("/root/temp/cond/patientgrup");
  458. grd_timelist.caption = "";
  459. cpt_vsinfo.value = "";
  460. //fMakeChart("init24hours");
  461. fMakeChart("init4days");
  462. if(getNodesetCount("/root/main/patinfo") > 0){
  463. model.setValue("/root/main/patinfo/pid", "");
  464. model.setValue("/root/main/patinfo/indd", "");
  465. model.setValue("/root/main/patinfo/cretno", "");
  466. model.setValue("/root/main/patinfo/ordtype", "");
  467. model.setValue("/root/main/patinfo/indschacptstat", "");
  468. model.setValue("/root/main/patinfo/dschdd", "");
  469. model.setValue("/root/main/patinfo/eroutdd", "");
  470. model.setValue("/root/main/patinfo/patnm", "");
  471. model.setValue("/root/main/patinfo/sexage", "");
  472. model.setValue("/root/main/patinfo/wardcd", "");
  473. model.setValue("/root/main/patinfo/roomcd", "");
  474. }
  475. sPid == "";
  476. sIndd == "";
  477. sCretNo == "";
  478. sInstcd == "";
  479. sIOFlag == "";
  480. sWardCD == "";
  481. sRoomCD == "";
  482. sIndschacptstat == "";
  483. sDschdd == "";
  484. sOrdDeptcd == "";
  485. sMedispclid == "";
  486. model.setValue(sCondPath+"/pid", "");
  487. fChkTgtPatInfo("disable");
  488. }
  489. /**
  490. * @group :
  491. * @ver : 2008.07.02
  492. * @by : 양천덕
  493. * @---------------------------------------------------
  494. * @type : function
  495. * @access : public
  496. * @desc :
  497. * @param : 환자 선택 여부확인
  498. * @return :
  499. * @---------------------------------------------------
  500. */
  501. function fChkTgtPatInfo(pFlag){
  502. switch(pFlag){
  503. case "disable":
  504. btn_4dayrefresh.disabled = true;
  505. btn_4daysvwctrl.disabled = true;
  506. // btn_24hoursvw.disabled = true;
  507. btn_4daybefore.disabled = true;
  508. btn_4dayafter.disabled = true;
  509. break;
  510. case "able":
  511. btn_4dayrefresh.disabled = false;
  512. btn_4daysvwctrl.disabled = false;
  513. // btn_24hoursvw.disabled = false;
  514. btn_4daybefore.disabled = false;
  515. btn_4dayafter.disabled = false;
  516. break;
  517. }
  518. }
  519. /**
  520. * @group :
  521. * @ver : 2008.04.28
  522. * @by : 양천덕
  523. * @---------------------------------------------------
  524. * @type : function
  525. * @access : public
  526. * @desc : 환자 선택시 상단정보 변경
  527. * @param :
  528. * @return :
  529. * @---------------------------------------------------
  530. */
  531. function fSetParam(pFlag, pIndex){
  532. if(getNodesetCount("/root/main/paminfo/pamlist") > 0){
  533. model.removenodeset("root/main/paminfo/pamlist");
  534. }
  535. var sOrdtype = "";
  536. var sPid = "";
  537. var sIndd = "";
  538. var sCretno = "";
  539. var sInstcd = "";
  540. var param = "";
  541. if(pFlag == "SrchPat"){
  542. sOrdtype = model.getValue("/root/temp/cond/patientgrup/patientgruplist["+ pIndex +"]/ordtype" );
  543. sPid = model.getValue("/root/temp/cond/patientgrup/patientgruplist["+ pIndex +"]/pid" );
  544. sIndd = model.getValue("/root/temp/cond/patientgrup/patientgruplist["+ pIndex +"]/indd" );
  545. sCretno = model.getValue("/root/temp/cond/patientgrup/patientgruplist["+ pIndex +"]/cretno" );
  546. sInstcd = model.getValue("/root/temp/cond/patientgrup/patientgruplist["+ pIndex +"]/instcd" );
  547. cmb_mypatlist.value = "";
  548. }else if(pFlag == "SettingPat"){
  549. sOrdtype = model.getValue("/root/temp/cond/settingpatient/settingpatientlist["+ pIndex +"]/ordtype" );
  550. sPid = model.getValue("/root/temp/cond/settingpatient/settingpatientlist["+ pIndex +"]/pid" );
  551. sIndd = model.getValue("/root/temp/cond/settingpatient/settingpatientlist["+ pIndex +"]/indd" );
  552. sCretno = model.getValue("/root/temp/cond/settingpatient/settingpatientlist["+ pIndex +"]/cretno" );
  553. sInstcd = model.getValue("/root/temp/cond/settingpatient/settingpatientlist["+ pIndex +"]/instcd" );
  554. }
  555. param = sOrdtype + "▦"
  556. + sPid + "▦"
  557. + sIndd + "▦"
  558. + sCretno + "▦"
  559. + sInstcd + "▦"
  560. + "▦" ;
  561. setParameter("condparam", param);
  562. modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  563. if(pFlag == "SrchPat"){
  564. fInitialize("patinit");
  565. }else if(pFlag == "SettingPat"){
  566. fInitialize("reset");
  567. }
  568. }
  569. /**
  570. * @group :
  571. * @ver : 2007.07.11
  572. * @by : 이은영
  573. * @---------------------------------------------------
  574. * @type : function
  575. * @access : public
  576. * @desc : 시작일자 계산
  577. * @param :
  578. * @return :
  579. * @---------------------------------------------------
  580. */
  581. function fCalStartDate(pDate, pTimeFlag){
  582. var sStartDT = pDate.toDate("YYYYMMDDhhmmss");
  583. var sTime = "";
  584. var sRemainder = 0;
  585. if(pTimeFlag != 1 ){
  586. sRemainder = eval(pDate.substr(10,2))%pTimeFlag;
  587. }
  588. sStartDT.setMinutes(sStartDT.getMinutes()-sRemainder);
  589. return sStartDT;
  590. }
  591. /**
  592. * @group :
  593. * @ver : 2007.07.11
  594. * @by : 이은영
  595. * @---------------------------------------------------
  596. * @type : function
  597. * @access : public
  598. * @desc : 그리드 크기 조절(펼치기/ 접기)
  599. * @param :
  600. * @return :
  601. * @---------------------------------------------------
  602. */
  603. function fControlGridSize(pFlag){
  604. switch(pFlag){
  605. // case "24hours" : // 24시간 화면
  606. // if(model.getValue(sCondPath+"/vwctrl_24hours") == "A"){ // 펼치기
  607. // btn_24hoursvwctrl.value = "접기";
  608. // model.setValue(sCondPath+"/vwctrl_24hours","I");
  609. // document.all.item("obj_24hourschart").visible = false;
  610. // document.all.item("obj_24hourschart").refresh();
  611. // //grd_24hoursheader.visible = false;
  612. //
  613. // grp_chkbox.visible = false;
  614. // chk_hourschartinfo.visible = false;
  615. // chk_dayschartinfo.visible = false;
  616. //
  617. //
  618. // }else{
  619. // btn_24hoursvwctrl.value = "펼치기";
  620. // model.setValue(sCondPath+"/vwctrl_24hours","A");
  621. // document.all.item("obj_24hourschart").visible = true;
  622. // document.all.item("obj_24hourschart").refresh();
  623. // //grd_24hoursheader.visible = true;
  624. // chk_hourschartinfo.visible = true;
  625. //
  626. // grp_chkbox.visible = true;
  627. // chk_hourschartinfo.visible = true;
  628. // chk_dayschartinfo.visible = false;
  629. //
  630. // }
  631. // btn_24hoursvwctrl.refresh();
  632. // //fCreateHeader(pFlag);
  633. // break;
  634. case "4days" : // 4일기준 화면
  635. if(model.getValue(sCondPath+"/vwctrl_4days") == "A"){ // 펼치기
  636. btn_4daysvwctrl.value = "접기";
  637. model.setValue(sCondPath+"/vwctrl_4days","I");
  638. document.all.item("obj_4dayschart").visible = false;
  639. document.all.item("obj_4dayschart").refresh();
  640. //grd_4dayschartheader.visible = false;
  641. // grp_chkbox.visible = false;
  642. // chk_hourschartinfo.visible = false;
  643. // chk_dayschartinfo.visible = false;
  644. }else{
  645. btn_4daysvwctrl.value = "펼치기";
  646. model.setValue(sCondPath+"/vwctrl_4days","A");
  647. document.all.item("obj_4dayschart").visible = true;
  648. document.all.item("obj_4dayschart").refresh();
  649. //grd_4dayschartheader.visible = true;
  650. chk_dayschartinfo.visible = true;
  651. // grp_chkbox.visible = true;
  652. // chk_hourschartinfo.visible = false;
  653. // chk_dayschartinfo.visible = true;
  654. }
  655. btn_4daysvwctrl.refresh();
  656. //fCreateHeader(pFlag);
  657. break;
  658. }
  659. }
  660. /**
  661. * @group :
  662. * @ver : 2007.08.14
  663. * @by : 이은영
  664. * @---------------------------------------------------
  665. * @type : function
  666. * @access : public
  667. * @desc : 차트 생성
  668. * @param :
  669. * @return :
  670. * @---------------------------------------------------
  671. */
  672. function fMakeChart(pFlag){
  673. var Obj_Chart = null;
  674. var Obj_CheckBox = null;
  675. var sColCnt = 0;
  676. var sRecRslt = "";
  677. var sRecRslt1 = "";
  678. var sChartInfo = "";
  679. var sRecDD = "";
  680. var sRecTM = "";
  681. var sRecTM4 = "";
  682. var sRecRsltArr = new Array();
  683. var sRecRslt1Arr = new Array();
  684. var iArrSize = 0;
  685. var iChartPos = 0;
  686. var idx=0;
  687. var grdRecTM1="";
  688. var grdRecTM2="";
  689. var grdRecDD="";
  690. var iArrSize = 0;
  691. var iSeriCnt = 0;
  692. var iToolsCnt=0;
  693. var sRecRsltHint = "";
  694. switch(pFlag){
  695. // case "24hours" :
  696. // obj_24hourschart.ClearChart();
  697. // sChartInfo = model.getValue(sCondPath+"/hourschartinfo").split(" ");
  698. // //obj_24hourschart.RemoveAllSeries();
  699. // //obj_24hourschart.Axis.RemoveAllCustom();
  700. //
  701. // //margin 값 정하기
  702. // //obj_24hourschart.Panel.MarginTop = 1;
  703. // obj_24hourschart.Panel.MarginTop = 2;
  704. // obj_24hourschart.Panel.MarginLeft = 1.5;
  705. // obj_24hourschart.Panel.MarginRight = 0;
  706. // obj_24hourschart.Panel.MarginBottom = -6;
  707. //
  708. // //하단축 칸 수 정하기와 눈금 없애기
  709. // obj_24hourschart.Axis.Bottom.SetMinMax (0, 24); //하루 동안 좌표를 표현
  710. // obj_24hourschart.Axis.Bottom.Increment = 1;
  711. // obj_24hourschart.Axis.Bottom.MinorTickCount = 1;
  712. // Obj_Chart = obj_24hourschart;
  713. // Obj_CheckBox = chk_hourschartinfo;
  714. // sColCnt = 24;
  715. // iArrSize = 60;
  716. // break;
  717. case "4days" :
  718. Obj_Chart = obj_4dayschart;
  719. Obj_CheckBox = chk_dayschartinfo;
  720. obj_4dayschart.ClearChart();
  721. sChartInfo = model.getValue(sCondPath+"/dayschartinfo").split(" ");
  722. //obj_4dayschart.RemoveAllSeries();
  723. //obj_4dayschart.Axis.RemoveAllCustom();
  724. //margin 값 정하기
  725. obj_4dayschart.Panel.MarginTop = 2;
  726. obj_4dayschart.Panel.MarginLeft = 1.5;
  727. obj_4dayschart.Panel.MarginRight = 0;
  728. obj_4dayschart.Panel.MarginBottom = -6;
  729. // obj_4dayschart.Axis.Bottom.TickLength = 16;
  730. //하단축 칸 수 정하기와 눈금 없애기
  731. obj_4dayschart.Axis.Bottom.SetMinMax (0,16); //4일 동안 좌표를 표현 (하루는 DivPerDay만큼 나눠짐)
  732. obj_4dayschart.Axis.Bottom.Increment = 1;
  733. obj_4dayschart.Axis.Bottom.MinorTickCount = 5;
  734. sColCnt = 16;
  735. iArrSize = 6;
  736. break;
  737. // case "init24hours" :
  738. // sChartInfo = model.getValue(sCondPath+"/hourschartinfo").split(" ");
  739. // obj_24hourschart.RemoveAllSeries();
  740. // obj_24hourschart.Axis.RemoveAllCustom();
  741. //
  742. // //margin 값 정하기
  743. // //obj_24hourschart.Panel.MarginTop = 1;
  744. // obj_24hourschart.Panel.MarginTop = 2;
  745. // obj_24hourschart.Panel.MarginLeft = 1.5;
  746. // obj_24hourschart.Panel.MarginRight = 0;
  747. // obj_24hourschart.Panel.MarginBottom = -6;
  748. // //obj_24hourschart.Axis.Bottom.TickLength = -5;
  749. //
  750. // //하단축 칸 수 정하기와 눈금 없애기
  751. // obj_24hourschart.Axis.Bottom.SetMinMax (0, 24); //하루 동안 좌표를 표현
  752. // obj_24hourschart.Axis.Bottom.Increment = 1;
  753. // obj_24hourschart.Axis.Bottom.MinorTickCount = 1;
  754. // Obj_Chart = obj_24hourschart;
  755. // Obj_CheckBox = chk_hourschartinfo;
  756. // sColCnt = 24;
  757. // iArrSize = 60;
  758. // break;
  759. case "init4days" :
  760. sChartInfo = model.getValue(sCondPath+"/dayschartinfo").split(" ");
  761. obj_4dayschart.RemoveAllSeries();
  762. obj_4dayschart.Axis.RemoveAllCustom();
  763. //margin 값 정하기
  764. obj_4dayschart.Panel.MarginTop = 2;
  765. obj_4dayschart.Panel.MarginLeft = 1.5;
  766. obj_4dayschart.Panel.MarginRight = 0;
  767. obj_4dayschart.Panel.MarginBottom = -6;
  768. //obj_4dayschart.Axis.Bottom.TickLength = 0;
  769. // obj_4dayschart.Axis.Bottom.Labels.MultiLine = True
  770. obj_4dayschart.Axis.Bottom.SetMinMax (0,16); //4일 동안 좌표를 표현 (하루는 DivPerDay만큼 나눠짐)
  771. obj_4dayschart.Axis.Bottom.Increment = 1;
  772. obj_4dayschart.Axis.Bottom.MinorTickCount = 5;
  773. Obj_Chart = obj_4dayschart;
  774. Obj_CheckBox = chk_dayschartinfo;
  775. sColCnt = 16;
  776. iArrSize = 6;
  777. break;
  778. }
  779. Obj_Chart.Axis.Bottom.AxisPen.Color = 0x000000;
  780. Obj_Chart.Axis.Bottom.Labels.Font.Color = 0xffffff; //Obj_Chart.Panel.Color; //하단 축 눈금 명칭 색을 바탕색으로 하여 보이지 않게 처리
  781. Obj_Chart.Header.Visible = false;
  782. Obj_Chart.Aspect.View3D = 0; //2d 로 표현하기
  783. Obj_Chart.Zoom.Enable = false; // zoom 사용하지 않기
  784. Obj_Chart.Scroll.Enable = false; // scroll 사용하지 않기
  785. Obj_Chart.Legend.Visible = false; // 그래프 참조 박스 띄우지 않기
  786. Obj_Chart.Panel.Gradient.Visible = true; // 페널에 그라디언트 적용
  787. Obj_Chart.Panel.Gradient.StartColor = 0xffffff;
  788. Obj_Chart.Panel.Gradient.EndColor=0xffffff;
  789. Obj_Chart.Environment.MouseWheelScroll = false;
  790. var cus_axis1 = Obj_Chart.Axis.AddCustom(false);
  791. Obj_Chart.Axis.Custom(0).AxisPen.Color = 0x0000ff;
  792. Obj_Chart.Axis.Custom(0).Title.Font.Size = 8;
  793. Obj_Chart.Axis.Custom(0).Title.Font.Bold = true;
  794. Obj_Chart.Axis.Custom(0).Title.Angle = 90;
  795. Obj_Chart.Axis.Custom(0).PositionPercent = 0;
  796. Obj_Chart.Axis.Custom(0).StartPosition = 0;
  797. Obj_Chart.Axis.Custom(0).EndPosition = 100;
  798. Obj_Chart.Axis.Custom(0).Automatic = false;
  799. Obj_Chart.Axis.Custom(0).Maximum = 10;
  800. Obj_Chart.Axis.Custom(0).Minimum = 0;
  801. Obj_Chart.Axis.Custom(0).Increment = 1;
  802. iSeriCnt = Obj_CheckBox.length;
  803. //시간구분선이 생기도록 임의의 널값을 그래프 X축에 세팅
  804. Obj_Chart.AddSeries(0);//포인트 - Series 4
  805. Obj_Chart.Series(0).asLine.ClickableLine = 0;//라인을 지나갈때 tool이 먹히게 할지(1) 말지(0)
  806. Obj_Chart.Series(0).Depth = 1;
  807. Obj_Chart.Series(0).VerticalAxisCustom = cus_axis1;
  808. for( var cnt = 0 ; cnt < sColCnt ; cnt++){
  809. Obj_Chart.Series(0).AddNull("null");
  810. }
  811. for(var i = 1 ; i <= Obj_CheckBox.length && !isNull(model.getValue(xChkObsPartInfoPath+"[1]/obspartid")) ; i++){
  812. sChartItem[i-1] = model.getValue(xChkObsPartInfoPath+"[" + i + "]/obspartid");
  813. Obj_CheckBox.item(i-1).attribute("background-color") = sCheckColor[i-1];
  814. Obj_Chart.AddSeries(0);//포인트 - Series 4
  815. Obj_Chart.Series(i).VerticalAxisCustom = cus_axis1;
  816. Obj_Chart.Series(i).Color = sLineColor[i-1];
  817. // alert(Obj_Chart.Series(i).Color+"-------------------"+sLineColor[i]);
  818. Obj_Chart.Series(i).asLine.LinePen.Width = 2;
  819. Obj_Chart.Series(i).asLine.Pointer.Visible = true;
  820. Obj_Chart.Series(i).asLine.Pointer.Style = 1;
  821. Obj_Chart.Series(i).asLine.Pointer.VerticalSize = 5;
  822. Obj_Chart.Series(i).asLine.Pointer.HorizontalSize = 5;
  823. Obj_Chart.Series(i).asLine.ClickableLine = 0;//라인을 지나갈때 tool이 먹히게 할지(1) 말지(0)
  824. Obj_Chart.Series(i).Depth = i+1;
  825. if ( Obj_Chart.Tools.Count == 0 ){
  826. Obj_Chart.Tools.Add(8);
  827. Obj_Chart.Tools.Items(0).asMarksTip.MouseAction = 0;
  828. Obj_Chart.Tools.Items(0).asMarksTip.Style = 2;//9:y값 x값 0:x값 2:Label
  829. Obj_Chart.Tools.Items(0).asMarksTip.Delay = 10;
  830. Obj_Chart.Tools.Items(0).asMarksTip.Series = 4;
  831. }
  832. if ( Obj_CheckBox.item(i-1).selected ){
  833. switch(pFlag){
  834. case "4days" :
  835. for( var idx = 1 ; idx <= getNodesetCount(xTotPainInfoPath) ; idx++ ){
  836. if ( sChartItem[i-1] == model.getValue(xTotPainInfoPath+"["+idx+"]/obspartid") && model.getValue(xTotPainInfoPath+"["+idx+"]/paingbid")!="92"){
  837. sRecRslt = model.getValue(xTotPainInfoPath+"["+ idx +"]/pnt");
  838. sRecDD = model.getValue(xTotPainInfoPath+"["+ idx +"]/recdd");
  839. sRecTM = model.getValue(xTotPainInfoPath+"["+ idx +"]/rectm").substring(0,2);
  840. //sRecTM4 = model.getValue(xTotPainInfoPath+"["+ idx +"]/rectm").substring(0,2)+":"+model.getValue(xTotPainInfoPath+"["+ idx +"]/rectm").substring(2,4);
  841. for( var iCol = 0 ; iCol < sColCnt ; iCol++ ){
  842. if ( iCol < (sColCnt-1) ){
  843. grdRecTM1 = getArrayData(grd_timelist.caption,0,iCol,"|","^").substring(0,2);
  844. grdRecTM2 = getArrayData(grd_timelist.caption,0,iCol+1,"|","^").substring(0,2);
  845. } else {
  846. grdRecTM1 = getArrayData(grd_timelist.caption,0,iCol,"|","^").substring(0,2);
  847. grdRecTM2 = "07";
  848. }
  849. // alert(sHeader[1][iCol]+grdRecTM1+"<="+ sRecDD+sRecTM+"<="+sHeader[1][iCol+1]+grdRecTM2+"icol="+iCol );
  850. if ( sRecDD+sRecTM >= sHeader[1][iCol]+ grdRecTM1
  851. && sRecDD+sRecTM < sHeader[1][iCol+1]+ grdRecTM2 ){
  852. if( !isNull(sRecRslt) && fIsNumber(sRecRslt) == true){
  853. var pos= eval(iCol) + (eval(eval(sRecTM)-eval(grdRecTM1))/iArrSize);
  854. // sRecRsltHint = model.getValue(xTotPainInfoPath+"["+ idx +"]/obspartnm")+" : "+ model.getValue(xTotPainInfoPath+"["+ idx +"]/valu")
  855. Obj_Chart.Series(i).AddXY ( pos, eval(sRecRslt), "", sLineColor[i-1]);
  856. }
  857. }
  858. }
  859. }
  860. }//end of for getNodesetCount(xTotPainInfoPath)
  861. break;
  862. // case "24hours" :
  863. // sRecDD = model.getValue(sCondPath+"/recdd");
  864. //
  865. // for( var idx = 1 ; idx <= getNodesetCount(xPainInfoPath4) ; idx++ ){
  866. //
  867. // if ( sChartItem[i-1] == model.getValue(xPainInfoPath4+"["+idx+"]/obspartid")&& model.getValue(xPainInfoPath4+"["+idx+"]/causeid")!="23"){
  868. // sRecRslt = model.getValue(xPainInfoPath4+"["+ idx +"]/pnt");
  869. // sRecDD = model.getValue(xPainInfoPath4+"["+ idx +"]/recdd");
  870. // sRecTM = model.getValue(xPainInfoPath4+"["+ idx +"]/rectm");
  871. // //sRecTM4 = model.getValue(xTotPainInfoPath+"["+ idx +"]/rectm").substring(0,2)+":"+model.getValue(xTotPainInfoPath+"["+ idx +"]/rectm").substring(2,4);
  872. //
  873. // for( var iCol = 0 ; iCol < sColCnt ; iCol++ ){
  874. // if ( iCol == 0 ){
  875. // grdRecTM1 = "0700";
  876. // grdRecTM2 = getArrayData(grd_timelist24hours.caption,0,0,"|","^").setReplaceWord(":","");
  877. // } else {
  878. // grdRecTM1 = getArrayData(grd_timelist24hours.caption,0,iCol-1,"|","^").setReplaceWord(":","");
  879. // grdRecTM2 = getArrayData(grd_timelist24hours.caption,0,iCol,"|","^").setReplaceWord(":","");
  880. // }
  881. //// alert(sHeader[1][iCol]+grdRecTM1+"<="+ sRecDD+sRecTM+"<"+sHeader[1][iCol]+grdRecTM2+"icol="+iCol );
  882. // if ( sRecDD+sRecTM >= sHeader[1][iCol]+ grdRecTM1
  883. // && sRecDD+sRecTM < sHeader[1][iCol+1]+ grdRecTM2 ){
  884. // if( !isNull(sRecRslt) && fIsNumber(sRecRslt) == true){
  885. // var pos= eval(iCol) + ( eval(eval(sRecTM)-eval(grdRecTM1))/iArrSize);
  886. // Obj_Chart.Series(i).AddXY (pos, eval(sRecRslt), "", sLineColor[i-1]);
  887. //
  888. // }
  889. //
  890. // }
  891. // }
  892. // }
  893. // }//end of for getNodesetCount(xTotPainInfoPath)
  894. //
  895. // break;
  896. }
  897. }
  898. }//end of for getNodesetCount(xChkObsPartInfoPath)
  899. for(var i = 1 ; i <= Obj_CheckBox.length && !isNull(model.getValue(xChkObsPartInfoPath+"[1]/obspartid")) ; i++){
  900. Obj_Chart.AddSeries(4);//포인트 - Series 4
  901. Obj_Chart.Series(i+iSeriCnt).Marks.Visible = false;
  902. Obj_Chart.Series(i+iSeriCnt).VerticalAxisCustom = cus_axis1;
  903. Obj_Chart.Series(i+iSeriCnt).Color = sLineColor[i-1];
  904. Obj_Chart.Series(i+iSeriCnt).Depth = i+iSeriCnt;
  905. Obj_Chart.Series(i+iSeriCnt).Cursor =2020;
  906. if ( Obj_CheckBox.item(i-1).selected ){
  907. switch(pFlag){
  908. case "4days" :
  909. for( var idx = 1 ; idx <= getNodesetCount(xTotPainInfoPath) ; idx++ ){
  910. if ( sChartItem[i-1] == model.getValue(xTotPainInfoPath+"["+idx+"]/obspartid") && model.getValue(xTotPainInfoPath+"["+idx+"]/paingbid")=="92"){
  911. sRecRslt = model.getValue(xTotPainInfoPath+"["+ idx +"]/pnt");
  912. sRecDD = model.getValue(xTotPainInfoPath+"["+ idx +"]/recdd");
  913. sRecTM = model.getValue(xTotPainInfoPath+"["+ idx +"]/rectm").substring(0,2);
  914. //sRecTM4 = model.getValue(xTotPainInfoPath+"["+ idx +"]/rectm").substring(0,2)+":"+model.getValue(xTotPainInfoPath+"["+ idx +"]/rectm").substring(2,4);
  915. for( var iCol = 0 ; iCol < sColCnt ; iCol++ ){
  916. if ( iCol < (sColCnt-1) ){
  917. grdRecTM1 = getArrayData(grd_timelist.caption,0,iCol,"|","^").substring(0,2);
  918. grdRecTM2 = getArrayData(grd_timelist.caption,0,iCol+1,"|","^").substring(0,2);
  919. } else {
  920. grdRecTM1 = getArrayData(grd_timelist.caption,0,iCol,"|","^").substring(0,2);
  921. grdRecTM2 = "07";
  922. }
  923. // alert(sHeader[1][iCol]+grdRecTM1+"<="+ sRecDD+sRecTM+"<="+sHeader[1][iCol]+grdRecTM2+"icol="+iCol );
  924. if ( sRecDD+sRecTM >= sHeader[1][iCol]+ grdRecTM1
  925. && sRecDD+sRecTM < sHeader[1][iCol+1]+ grdRecTM2 ){
  926. if( !isNull(sRecRslt) && fIsNumber(sRecRslt) == true){
  927. sRecTM4 = model.getValue(xTotPainInfoPath+"["+ idx +"]/rectm").substring(2,4);
  928. var pos= eval(iCol) + (eval(eval(sRecTM)-eval(grdRecTM1))/iArrSize) + (eval(eval(sRecTM4)-eval("00"))/(iArrSize*60)) ;
  929. sRecRsltHint = model.getValue(xTotPainInfoPath+"["+ idx +"]/obspartnm")
  930. + "("+ model.getValue(xTotPainInfoPath+"["+ idx +"]/direcnm") +")"
  931. +"\n\n환자반응평가 : "+ model.getValue(xTotPainInfoPath+"["+ idx +"]/valu")
  932. +"\n약물 및 비약물 중재 : "+ model.getValue(xTotPainInfoPath+"["+ idx +"]/arbitration");
  933. Obj_Chart.Series(i+iSeriCnt).AddXY (pos, eval(sRecRslt), sRecRsltHint, sLineColor[i-1]);
  934. }
  935. }
  936. }
  937. }
  938. }//end of for getNodesetCount(xTotPainInfoPath)
  939. // alert(Obj_Chart.Tools.Count);
  940. break;
  941. // case "24hours" :
  942. // sRecDD = model.getValue(sCondPath+"/recdd");
  943. //
  944. // for( var idx = 1 ; idx <= getNodesetCount(xPainInfoPath4) ; idx++ ){
  945. //
  946. // if ( sChartItem[i-1] == model.getValue(xPainInfoPath4+"["+idx+"]/obspartid")&& model.getValue(xPainInfoPath4+"["+idx+"]/causeid")=="23"){
  947. // sRecRslt = model.getValue(xPainInfoPath4+"["+ idx +"]/pnt");
  948. // sRecDD = model.getValue(xPainInfoPath4+"["+ idx +"]/recdd");
  949. // sRecTM = model.getValue(xPainInfoPath4+"["+ idx +"]/rectm");
  950. // //sRecTM4 = model.getValue(xTotPainInfoPath+"["+ idx +"]/rectm").substring(0,2)+":"+model.getValue(xTotPainInfoPath+"["+ idx +"]/rectm").substring(2,4);
  951. //
  952. // for( var iCol = 0 ; iCol < sColCnt ; iCol++ ){
  953. // if ( iCol == 0 ){
  954. // grdRecTM1 = "0000";
  955. // grdRecTM2 = getArrayData(grd_timelist24hours.caption,0,0,"|","^").setReplaceWord(":","");
  956. // } else {
  957. // grdRecTM1 = getArrayData(grd_timelist24hours.caption,0,iCol-1,"|","^").setReplaceWord(":","");
  958. // grdRecTM2 = getArrayData(grd_timelist24hours.caption,0,iCol,"|","^").setReplaceWord(":","");
  959. // }
  960. //// alert(sHeader[1][iCol]+grdRecTM1+"<="+ sRecDD+sRecTM+"<"+sHeader[1][iCol]+grdRecTM2+"icol="+iCol );
  961. // if ( sRecDD+sRecTM >= sHeader[1][iCol]+ grdRecTM1
  962. // && sRecDD+sRecTM < sHeader[1][iCol]+ grdRecTM2 ){
  963. // if( !isNull(sRecRslt) && fIsNumber(sRecRslt) == true){
  964. // var pos= eval(iCol) + ( eval(eval(sRecTM)-eval(grdRecTM1))/iArrSize);
  965. // Obj_Chart.Series(i-1+iSeriCnt).AddXY (pos, eval(sRecRslt), "", sLineColor[i-1]);
  966. //
  967. // }
  968. // }
  969. // }
  970. // }
  971. // }//end of for getNodesetCount(xTotPainInfoPath)
  972. // break;
  973. }
  974. }
  975. }//end of for getNodesetCount(xChkObsPartInfoPath)
  976. }
  977. /**
  978. * @group :
  979. * @ver : 2007.07.21
  980. * @by : 양천덕
  981. * @---------------------------------------------------
  982. * @type : function
  983. * @access : public
  984. * @desc : 문자여부 확인
  985. * @param : str : 값
  986. * @return : true / false
  987. * @---------------------------------------------------
  988. */
  989. function fIsNumber(str) {
  990. str += ''; // 문자열로 변환
  991. str = str.replace(/^\s*|\s*$/g, ''); // 좌우 공백 제거
  992. if (str == '' || isNaN(str)) return false;
  993. return true;
  994. }
  995. /**
  996. * @group :
  997. * @ver : 2007.08.16
  998. * @by : 이은영
  999. * @---------------------------------------------------
  1000. * @type : function
  1001. * @access : public
  1002. * @desc : 그리드 Header 생성
  1003. * @param :
  1004. * @return :
  1005. * @---------------------------------------------------
  1006. */
  1007. function fCreateHeader(pFlag){
  1008. var sRecDD = "";
  1009. //var sChartCapNm = "";
  1010. var sGridCapNm = "";
  1011. var sTimeFlag = 0;
  1012. var sCDay = new Array();
  1013. var sDayInfo = "";
  1014. var iDayRow = 0;
  1015. var sDayCountInfo = "";
  1016. var sDateList = "";
  1017. var idx=0;
  1018. sHeader[1] = new Array();
  1019. var sCaption = "07:00^13:00^19:00^01:00^07:00^13:00^19:00^01:00^07:00^13:00^19:00^01:00^07:00^13:00^19:00^01:00";
  1020. var sCaption24="07:00^08:00^09:00^10:00^11:00^12:00^13:00^14:00^15:00^16:00^17:00^18:00^19:00^20:00^21:00^22:00^23:00^24:00^01:00^02:00^03:00^04:00^05:00^06:00";
  1021. switch(pFlag){
  1022. case "4days" :
  1023. var sStartDD = getDateCalc(model.getValue(sCondPath+"/recdd"),3,"-");
  1024. for( idx = 1 ; idx <= grd_timelist.cols ; idx++ ){
  1025. sRecDD = getDateCalc(sStartDD,idx/4,"+");
  1026. sHeader[1][idx-1] = sRecDD;
  1027. }
  1028. sHeader[1][idx]=getDateCalc(model.getValue(sCondPath+"/recdd"),1,"+")
  1029. for(var iRow=1; iRow<=1; iRow++){
  1030. for(var iCol=0; iCol<grd_timelist.cols; iCol++){
  1031. if(iRow == 1){
  1032. sGridCapNm += sHeader[iRow][iCol].toDate("YYYYMMDD").getDateFormat("YYYY년 MM월 DD일")+
  1033. " ("+sHeader[iRow][iCol].toDate("YYYYMMDD").getDayOfWeek("k")+")";
  1034. }
  1035. if(iCol != grd_timelist.cols){
  1036. sGridCapNm += "^";
  1037. }
  1038. }
  1039. }
  1040. grd_timelist.caption = sCaption + "|" + sGridCapNm;
  1041. break;
  1042. case "24hours" :
  1043. var sStartDD = model.getValue(sCondPath+"/recdd");
  1044. for( var idx = 0 ; idx < grd_timelist24hours.cols ; idx++ ){
  1045. sHeader[1][idx] = sStartDD;
  1046. }
  1047. for(var iRow=1; iRow<=1; iRow++){
  1048. for(var iCol=0; iCol<grd_timelist24hours.cols; iCol++){
  1049. if(iRow == 1){
  1050. sGridCapNm += sHeader[iRow][iCol].toDate("YYYYMMDD").getDateFormat("YYYY년 MM월 DD일")+
  1051. " ("+sHeader[iRow][iCol].toDate("YYYYMMDD").getDayOfWeek("k")+")";
  1052. }
  1053. if(iCol != grd_timelist24hours.cols){
  1054. sGridCapNm += "^";
  1055. }
  1056. }
  1057. }
  1058. grd_timelist24hours.caption = sCaption24 + "|" + sGridCapNm;
  1059. break; }
  1060. }
  1061. /**
  1062. * @group :
  1063. * @ver : 2007.08.16
  1064. * @by : 이은영
  1065. * @---------------------------------------------------
  1066. * @type : function
  1067. * @access : public
  1068. * @desc : 임상관찰 기록 조회
  1069. * @param :
  1070. * @return :
  1071. * @---------------------------------------------------
  1072. */
  1073. function fSearch(pFlag){
  1074. if(model.getValue("/root/main/patinfo/pid") == ""){
  1075. messageBox("환자를 선택하십시요","I");
  1076. return;
  1077. }
  1078. model.setValue(sCondPath+"/vwctrl_button",pFlag)
  1079. model.removenode("/root/send");
  1080. model.makeValue("/root/send/pid", sPid);
  1081. model.makeValue("/root/send/indd", sIndd);
  1082. model.makeValue("/root/send/cretno", sCretNo);
  1083. model.makeValue("/root/send/instcd", sInstcd);
  1084. model.makeValue("/root/send/ioflag", sIOFlag);
  1085. model.makeValue("/root/send/srchdd", model.getValue(sCondPath+"/recdd") );
  1086. model.makeValue("/root/send/fromdd", getDateCalc(model.getValue(sCondPath+"/recdd"),3,'-') );
  1087. model.makeValue("/root/send/todd", model.getValue(sCondPath+"/recdd") );
  1088. model.makeValue("/root/send/vwctrl_button", model.getValue(sCondPath+"/vwctrl_button") );
  1089. // submit("TRMNR08401");
  1090. if(submit("TRMNR08401")){
  1091. fCreateHeader(pFlag);
  1092. fSettingCheckBox(pFlag);
  1093. fMakeChart(pFlag);
  1094. fChageView(pFlag);
  1095. if ( getSystemCd().substring(0,3) == "DEV" ){
  1096. fMessageAlert(xPainCountInfoPath);
  1097. }
  1098. }
  1099. model.refresh();
  1100. }
  1101. /**
  1102. * @group :
  1103. * @ver : 2007.08.16
  1104. * @by :
  1105. * @---------------------------------------------------
  1106. * @type : function
  1107. * @access : public
  1108. * @desc : 점수가7점이상이 3회이상인경우 메시지 팝업
  1109. * @param :
  1110. model.makeValue("/root/send/pid", sPid);
  1111. model.makeValue("/root/send/indd", sIndd);
  1112. model.makeValue("/root/send/cretno", sCretNo);
  1113. model.makeValue("/root/send/vwctrl_button", "dr" );
  1114. * @return :
  1115. * @---------------------------------------------------
  1116. */
  1117. function fMessageAlert(destPath){
  1118. if ( model.getValue(destPath+"/cntpnt") == "Y" ){
  1119. var rtnmsg = messageBox("7점이상의 통증이 3회이상 존재합니다 " ,"Q011");
  1120. if ( rtnmsg == 6 ){
  1121. submit("TXMNR08401");//메시지팝업 확인일시 업데이트
  1122. }
  1123. }
  1124. }
  1125. /**
  1126. * @group :
  1127. * @ver : 2007.08.16
  1128. * @by : 이은영
  1129. * @---------------------------------------------------
  1130. * @type : function
  1131. * @access : public
  1132. * @desc : 임상관찰 기록 조회
  1133. * @param :
  1134. * @return :
  1135. * @---------------------------------------------------
  1136. */
  1137. function fSettingCheckBox(pFlag){
  1138. switch(pFlag){
  1139. case "4days" :
  1140. var sDaysChart = "";
  1141. for( var idx = 0 ; idx < chk_dayschartinfo.length ; idx++){
  1142. if ( idx == 0 ) {
  1143. sDaysChart = chk_dayschartinfo.item(0).value;
  1144. } else {
  1145. sDaysChart += " " + chk_dayschartinfo.item(idx).value;
  1146. }
  1147. }
  1148. model.setValue(sCondPath+"/dayschartinfo",sDaysChart);
  1149. chk_dayschartinfo.refresh();
  1150. break;
  1151. case "24hours" :
  1152. var s24HoursChart = "";
  1153. for( var idx = 0 ; idx < chk_hourschartinfo.length ; idx++){
  1154. if ( idx == 0 ) {
  1155. s24HoursChart = chk_hourschartinfo.item(0).value;
  1156. } else {
  1157. s24HoursChart += " " + chk_hourschartinfo.item(idx).value;
  1158. }
  1159. }
  1160. model.setValue(sCondPath+"/hourschartinfo",s24HoursChart);
  1161. chk_hourschartinfo.refresh();
  1162. break; }
  1163. }
  1164. /**
  1165. * @group :
  1166. * @ver : 2011.03.16
  1167. * @by : 안도영
  1168. * @---------------------------------------------------
  1169. * @type : function
  1170. * @access : public
  1171. * @desc : 구역정보 조회 (응급실인 경우)
  1172. * @param :
  1173. * @param :
  1174. * @return :
  1175. * @---------------------------------------------------
  1176. */
  1177. function fGetWardChngInfo(initFlag, wardCd, sectionCd){
  1178. if(initFlag=="Y") {
  1179. var sWardCD = wardCd;
  1180. }
  1181. else{
  1182. //var sWardCD = model.getValue("/root/cond/wardcd");
  1183. var sWardCD = cmb_wardlist.value;
  1184. }
  1185. if ( sWardCD == eERDEPTCD) {
  1186. eERFLAG = "Y";
  1187. }else{
  1188. eERFLAG = "";
  1189. }
  1190. //응급실인 경우 구역정보 추가조회
  1191. if(eERFLAG == "Y"){ // 응급실
  1192. fGetZoneList();
  1193. //copyNodeset("/root/temp2/zoneinfo", "/root/temp/zoneinfo");
  1194. caption7.attribute("text") = "구 역 :";
  1195. cmb_roomlist.visible = "false";
  1196. cmb_erpat.visible = "true";
  1197. cmb_patlist.visible = "false";
  1198. cmb_zone.visible = "true";
  1199. //ipt_pid.attribute("left") = 539; // 위치 변경
  1200. //ipt_pid.attribute("top") = 40;
  1201. //btn_patSearch.attribute("left") = 617; // 위치 변경
  1202. //btn_patSearch.attribute("top") = 41; // 위치 변경
  1203. caption9.visible = "false";
  1204. cmb_mypatlist.visible = "false";
  1205. if(initFlag=="Y"){ // 처음 상단 정보로 화면 열릴 때
  1206. model.setValue("/root/main/cond/zonecd", (sectionCd == "") ? "-" : sectionCd);
  1207. }else{
  1208. model.setValue("/root/main/cond/zonecd", "-"); // 'All'로 default
  1209. }
  1210. }else{
  1211. caption7.attribute("text") = "병 실 :";
  1212. cmb_roomlist.visible = "true";
  1213. cmb_erpat.visible = "false";
  1214. cmb_patlist.visible = "true"
  1215. cmb_zone.visible = "false";
  1216. //ipt_pid.attribute("left") = 669; // 기존 위치
  1217. //ipt_pid.attribute("top") = 15;
  1218. //btn_patSearch.attribute("left") = 747; // 기존 위치
  1219. //btn_patSearch.attribute("top") = 16;
  1220. caption9.visible = "true";
  1221. cmb_mypatlist.visible = "true";
  1222. model.setValue("/root/main/cond/zonecd", "");
  1223. }
  1224. //ctn_room.refresh();
  1225. cmb_zone.refresh();
  1226. cmb_roomlist.refresh();
  1227. cmb_erpat.refresh();
  1228. cmb_patlist.refresh();
  1229. }
  1230. function RgbToGraph(h) { return window.rgb(HexToR(h),HexToG(h),HexToB(h)) }
  1231. function HexToR(h) { return parseInt((cutHex(h)).substring(0,2),16) }
  1232. function HexToG(h) { return parseInt((cutHex(h)).substring(2,4),16) }
  1233. function HexToB(h) { return parseInt((cutHex(h)).substring(4,6),16) }
  1234. function cutHex(h) { return (h.charAt(0)=="#") ? h.substring(1,7) : h}