SMMNB03000.js 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662
  1. /*
  2. 카덱스관리(SMMNB03000_카덱스관리_KNU.xrw - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var ePID = "";
  7. var eINDD = "";
  8. var eCRETNO = "";
  9. //20110208_SMY추가
  10. var eORDTYPE = "";
  11. var eINSTCD = "";
  12. //20110211_SMY추가
  13. var eERDEPTCD = "";
  14. var eERFLAG = "";
  15. var ePRCPDD = "";
  16. var prcpstat="1";
  17. var xPathPatDetlInfo = "/root/main/kardexinfo/patdetlinfo";//환자상세정보
  18. var xPathPatList = "/root/main/kardexinfo/ompatlist";
  19. var xPathHiddenPatList = "/root/hidden/kardexinfo/ompatlist";
  20. var xPathTodayScheduleList = "/root/main/kardexinfo/todayschedulelist";//오늘스케쥴
  21. var xPathTomorrowScheduleList = "/root/main/kardexinfo/tomorrowschedulelist";//내일스케쥴
  22. var xPathAssessInfo = "/root/main/kardexinfo/assessinfo";//최근Assess
  23. var xPathTodayList1 = "/root/main/kardexinfo/todaylist1";//욕창
  24. var xPathTodayList2 = "/root/main/kardexinfo/todaylist2";//통증
  25. var xPathTodayList3 = "/root/main/kardexinfo/todaylist3";//유지기구
  26. var xPathHiddenTodayList3 = "/root/hidden/kardexinfo/todaylist3";//유지기구
  27. var xPathCardexSetList = "/root/main/kardexinfo/cardexsetlist";//카덱스set정보
  28. var xPathHidCardexSetList = "/root/hidden/kardexinfo/cardexsetlist";//카덱스set정보
  29. var xPathMemoList = "/root/main/kardexinfo/memolist";
  30. var xPathHidMemoList = "/root/hidden/kardexinfo/memolist";
  31. var xPathConsultInfo = "/root/main/kardexinfo/consultinfo"
  32. var xPathNarcInfo = "/root/main/kardexinfo/narclist"
  33. var xPathHiddenNarcInfo = "/root/hidden/kardexinfo/narclist"
  34. var xPathHiddenCatheterList = "/root/hidden/kardexinfo/catheterlist";//조회시 hidden검사관리정보
  35. var xPathCatheterList = "/root/main/kardexinfo/catheterlist";//Catheter정보
  36. var xPathMedrMemoInfo = "/root/main/kardexinfo/medrmemoinfo";
  37. var xPathHidMedrMemoInfo = "/root/hidden/kardexinfo/medrmemoinfo";
  38. var xPathMedrList = "/root/main/kardexinfo/medrlist";
  39. var xPathMedrPrcpddList = "/root/main/kardexinfo/medrprcpdd";
  40. var xPathMedrPrcpList = "/root/main/kardexinfo/medrprcplist";
  41. var xPathHiddenTestList = "/root/hidden/kardexinfo/testlist";//조회시 hidden검사관리정보
  42. var xPathTestList = "/root/main/kardexinfo/testlist";//실제 보이는 검사관리정보
  43. var openx = 'N';
  44. /**
  45. * @group :
  46. * @ver : 2007.10.08
  47. * @by : 최경용
  48. * @---------------------------------------------------
  49. * @type : function
  50. * @access : public
  51. * @desc : 초기값 조회
  52. * @param :
  53. * @param :
  54. * @return :
  55. * @---------------------------------------------------
  56. */
  57. function fInitialize(){
  58. //fClearExceptPatList();
  59. //------------(20101019) 경북대
  60. //응급의료센터 부서코드 추출
  61. model.makeValue("/root/send/cdgrupid", "'002', 'U31'");
  62. model.makeValue("/root/send/srchdd" , getCurrentDate()); // 조회기준일자
  63. if(submit("TRMNW00001", false)){
  64. eERDEPTCD = model.getvalue("/root/code/codeinfo/codelist[cdgrupid='002']/cdid");
  65. }
  66. btn_today.selected = true;
  67. model.makeValue(xPathPatDetlInfo + "/roomcd", "병실");
  68. model.makeValue(xPathPatDetlInfo + "/pid" , "등록번호");
  69. model.makeValue(xPathPatDetlInfo + "/patnm" , "환자명");
  70. model.makeValue(xPathPatDetlInfo + "/sexage", "S/A");
  71. //오늘 날짜로 초기화 하는 부분.(진료일자를 default로 오늘 날짜로 선택함)
  72. model.setValue("/root/main/cond/settingrnid", "");
  73. model.setValue("/root/main/cond/userid" , getUserId());
  74. model.setValue("/root/main/cond/usernm" , getUserName());
  75. model.setValue("/root/main/cond/orddd" , getCurrentDate());
  76. // 정렬순서 초기화 칠곡:병상순, 본원:환자명순
  77. if(openx == 'N'){
  78. if(getUserInfo("dutplceinstcd") == "032") {
  79. model.makeValue("/root/main/cond/sortflag", "2");
  80. rdo_sortflag.refresh();
  81. } else {
  82. model.makeValue("/root/main/cond/sortflag", "1");
  83. rdo_sortflag.refresh();
  84. }
  85. }
  86. openx = 'Y';
  87. // 환자정보 조회
  88. model.removenodeSet("/root/main/paminfo");
  89. model.makeNode("/root/main/paminfo");
  90. var sPamInfo = getGlobalVariable("paminfo");
  91. setCSVToNode("/root/main/paminfo",sPamInfo,"pamlist");
  92. ePID = model.getValue("/root/main/paminfo/pamlist/pid");
  93. eINDD = model.getValue("/root/main/paminfo/pamlist/indd");
  94. eCRETNO = model.getValue("/root/main/paminfo/pamlist/cretno");
  95. var sWardCd = model.getValue("/root/main/paminfo/pamlist/wardcd");
  96. if( !isNull(sWardCd)){
  97. model.setValue("/root/main/cond/wardcd", sWardCd);
  98. }else{
  99. model.setValue("/root/main/cond/wardcd", getUserInfo("dutplcecd"));
  100. }
  101. // 투약관리 화면 그리드명 변경_160512_AYS_칠곡인증평가관련_혼동주의 고위험약 문구제거
  102. if(getUserInfo("dutplceinstcd") == '032') {
  103. grd_medi2.caption = "구분^처방코드^처방명^1일\n용량^1회\n용량^단\n위^1일\n수량^1회\n수량^단\n위^1일\n횟수^기간^용법";
  104. }
  105. //공통함수로 수정_20110211_ SMY
  106. fGetWardChngInfo();
  107. //응급실 구역정보 셋팅추가_20110216_SMY
  108. var sSectionCd = model.getValue("/root/main/paminfo/pamlist/sectioncd");
  109. if( !isNull(sSectionCd)){
  110. model.setValue("/root/main/cond/zonecd", sSectionCd);
  111. }
  112. //환자리스트 조회
  113. if ( isNull(ePID) ){
  114. fGetMedSpccdList("pat");
  115. } else {
  116. fGetMedSpccdList("all");
  117. }
  118. }
  119. /**
  120. * @group :
  121. * @ver : 2011.02.11
  122. * @by : 성미연
  123. * @---------------------------------------------------
  124. * @type : function
  125. * @access : public
  126. * @desc : 병동, 내환자, 구역정보(응급실인 경우) 조회
  127. * @param :
  128. * @param :
  129. * @return :
  130. * @---------------------------------------------------
  131. */
  132. function fGetWardChngInfo(){
  133. if ( model.getValue("/root/main/cond/wardcd") == eERDEPTCD) {
  134. eERFLAG = "Y";
  135. }else{
  136. eERFLAG = "";
  137. }
  138. model.removeNodeset("/root/send/reqdata");
  139. model.makeNode("/root/send/reqdata");
  140. model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
  141. submit("TRMNW00101");
  142. model.setValue("/root/main/cond/settingrnid", "");
  143. for(i=1; i <= getNodesetCount("/root/init/settingrn"); i++ ) {
  144. if (model.getValue("/root/main/cond/userid") == model.getValue("/root/init/settingrn["+ i +"]/settingrnid")) {
  145. model.setValue("/root/main/cond/settingrnid", model.getValue("/root/main/cond/userid"));
  146. }
  147. }
  148. //응급실인 경우 구역정보 추가조회
  149. if(eERFLAG == "Y"){
  150. fGetZoneList();
  151. cap_zone.visible = "true";
  152. cmb_zone.visible = "true";
  153. //cap_settingrnid.attribute("text") = "구 역:";
  154. //btn_settingrnid.visible = "false";
  155. cap_settingrnid.attribute("left") = 398;
  156. cap_settingrnid.attribute("top") = 10;
  157. cmb_settingrnid.attribute("left") = 473;
  158. cmb_settingrnid.attribute("top") = 8;
  159. button20.attribute("left") = 538;
  160. button20.attribute("top") = 7;
  161. caption20.attribute("left") = 630;
  162. caption20.attribute("top") = 10;
  163. ipt_orddd.attribute("left") = 716;
  164. ipt_orddd.attribute("top") = 8;
  165. caption34.attribute("left") = 818;
  166. caption34.attribute("top") = 10;
  167. rdo_sortflag.attribute("left") = 900;
  168. rdo_sortflag.attribute("top") = 10;
  169. model.setValue("/root/main/cond/zonecd", "-");
  170. }else{
  171. cap_zone.visible = "false";
  172. cmb_zone.visible = "false";
  173. //cap_settingrnid.attribute("text") = "내환자:"
  174. //btn_settingrnid.visible = "true";
  175. model.setValue("/root/main/cond/zonecd", "");
  176. cap_settingrnid.attribute("left") = 245;
  177. cap_settingrnid.attribute("top") = 10;
  178. cmb_settingrnid.attribute("left") = 320;
  179. cmb_settingrnid.attribute("top") = 8;
  180. button20.attribute("left") = 387;
  181. button20.attribute("top") = 7;
  182. caption20.attribute("left") = 485;
  183. caption20.attribute("top") = 10;
  184. ipt_orddd.attribute("left") = 568;
  185. ipt_orddd.attribute("top") = 8;
  186. caption34.attribute("left") = 675;
  187. caption34.attribute("top") = 10;
  188. rdo_sortflag.attribute("left") = 760;
  189. rdo_sortflag.attribute("top") = 10;
  190. }
  191. model.refresh();
  192. }
  193. /**
  194. * @group :
  195. * @ver : 2007.10.08
  196. * @by : 김홍점
  197. * @---------------------------------------------------
  198. * @type : function
  199. * @access : public
  200. * @desc : 환자리스트 클릭시 환자 상세정보 셋팅
  201. * @param :
  202. * @param :
  203. * @return :
  204. * @---------------------------------------------------
  205. */
  206. function fSettingPatDetlInfo(rowNo) {
  207. //상단 환자 정보 셋팅
  208. model.makeValue(xPathPatDetlInfo + "/roomcd", model.getValue(xPathPatList + "[" + rowNo + "]/roomcd"));
  209. model.makeValue(xPathPatDetlInfo + "/pid", model.getValue(xPathPatList + "[" + rowNo + "]/pid"));
  210. model.makeValue(xPathPatDetlInfo + "/patnm", model.getValue(xPathPatList + "[" + rowNo + "]/patnm"));
  211. model.makeValue(xPathPatDetlInfo + "/sexage", model.getValue(xPathPatList + "[" + rowNo + "]/sexage"));
  212. model.makeValue(xPathPatDetlInfo + "/vipyn", model.getValue(xPathPatList + "[" + rowNo + "]/vipyn"));
  213. model.makeValue(xPathPatDetlInfo + "/rqstyn", model.getValue(xPathPatList + "[" + rowNo + "]/rqstyn"));
  214. model.makeValue(xPathPatDetlInfo + "/spcffactyn", model.getValue(xPathPatList + "[" + rowNo + "]/spcffactyn"));
  215. model.makeValue(xPathPatDetlInfo + "/clincstdyyn", model.getValue(xPathPatList + "[" + rowNo + "]/clincstdyyn"));
  216. model.makeValue(xPathPatDetlInfo + "/cpyn", model.getValue(xPathPatList + "[" + rowNo + "]/cpyn"));
  217. model.makeValue(xPathPatDetlInfo + "/indschstat", model.getValue(xPathPatList + "[" + rowNo + "]/indschstat"));
  218. model.makeValue(xPathPatDetlInfo + "/serdiag", model.getValue(xPathPatList + "[" + rowNo + "]/serdiag"));
  219. model.makeValue(xPathPatDetlInfo + "/rarediag", model.getValue(xPathPatList + "[" + rowNo + "]/rarediag"));
  220. model.makeValue(xPathPatDetlInfo + "/chngroomstat", model.getValue(xPathPatList + "[" + rowNo + "]/chngroomstat"));
  221. if(model.getValue(xPathPatDetlInfo + "/vipyn") !="" ){cap_vipyn.attribute('background-color') = '#ffff99';}
  222. else{ cap_vipyn.attribute('background-color') = '#ffffff';}
  223. if(model.getValue(xPathPatDetlInfo + "/rqstyn") !="" ){opt_rqstyn.attribute('background-color') = '#ffff99';}
  224. else{ opt_rqstyn.attribute('background-color') = '#ffffff';}
  225. if(model.getValue(xPathPatDetlInfo + "/spcffactyn") !="" ){opt_spcffactyn.attribute('background-color') = '#ffff99';}
  226. else{ opt_spcffactyn.attribute('background-color') = '#ffffff';}
  227. if(model.getValue(xPathPatDetlInfo + "/clincstdyyn") !="" ){cap_clincstdyyn.attribute('background-color') = '#ffff99';}
  228. else{ cap_clincstdyyn.attribute('background-color') = '#ffffff';}
  229. if(model.getValue(xPathPatDetlInfo + "/cpyn") !="" ){opt_cpyn.attribute('background-color') = '#ffff99';}
  230. else{ opt_cpyn.attribute('background-color') = '#ffffff';}
  231. if(model.getValue(xPathPatDetlInfo + "/blodprepyn") !="" ){opt_blodprepyn.attribute('background-color') = '#ffff99';}
  232. else{ opt_blodprepyn.attribute('background-color') = '#ffffff';}
  233. if(model.getValue(xPathPatDetlInfo + "/chngroomstat")!="" ){opt_chngroomstat.attribute('background-color') = '#ffff99';}
  234. else{ opt_chngroomstat.attribute('background-color') = '#ffffff';}
  235. if(model.getValue(xPathPatDetlInfo + "/indschstat") !="" ){opt_indschstat.attribute('background-color') = '#ffff99';}
  236. else{ opt_indschstat.attribute('background-color') = '#ffffff';}
  237. var blodprep = model.getValue(xPathPatList + "[" + rowNo + "]/blodprepyn");
  238. if (blodprep == "Y") {
  239. opt_blodprepyn.attribute("background-image") = "../../../emr/commonweb/images/blood.gif";
  240. } else {
  241. opt_blodprepyn.attribute("background-image") = "";
  242. }
  243. model.refresh();
  244. }
  245. /**
  246. * @group :
  247. * @ver : 2007.10.08
  248. * @by : 김홍점
  249. * @---------------------------------------------------
  250. * @type : function
  251. * @access : public
  252. * @desc : 환자리스트 클릭시
  253. * @param :
  254. * @param :
  255. * @return :
  256. * @---------------------------------------------------
  257. */
  258. function fClickPatList() {
  259. var deptcd = cmb_wardcd.value;
  260. var userdept = getUserInfo("dutplcecd");
  261. var spiritdept = model.getValue("/root/code/codeinfo/codelist[cdgrupid ='U31']/cdid");
  262. if(deptcd == spiritdept) {
  263. if(userdept != spiritdept) {
  264. messageBox("환자 개인정보 보호를 위해 해당병동 사용자외엔 조회를 제한합니다", "E");
  265. return;
  266. }
  267. }
  268. ePID = model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid");
  269. if(ePID == "3292911") { // 메르스 확정환자
  270. if (!fContainsHardCD("5703", getUserInfo("userid"))) {
  271. messageBox("환자번호 : " + ePID + "\n개인정보보호 관리대상 환자로 접근권한을 제한 합니다.\n\n진료지원실장 양동헌", "E999");
  272. return ;
  273. }
  274. }
  275. if (grd_patlist.row > 0 ) {
  276. //응급실 상단추가----------(20101018) 경북대
  277. if ( model.getValue("/root/main/cond/wardcd") != eERDEPTCD ) {
  278. //입원
  279. ePID = model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid");
  280. eINDD = model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd");
  281. eCRETNO = model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno");
  282. ePATNM = model.getValue(xPathPatList + "[" + grd_patlist.row + "]/patnm");
  283. eSIGNINFOCNT = model.getValue(xPathPatList + "[" + grd_patlist.row + "]/signinfocnt"); // 간호정보조사지 인증저장건수
  284. if(eSIGNINFOCNT == 0){
  285. messageBox("인증저장 되지 않은 간호정보조사지가 있습니다.\n확인하시기 바랍니다.","I");
  286. }
  287. //fSettingPatDetlInfo( grd_patlist.row );
  288. // 상단 세팅을 위한 파라미터
  289. condparam = "I"+ "▦" + model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid")
  290. + "▦" + model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd")
  291. + "▦" + model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno")
  292. + "▦" + model.getValue(xPathPatList + "[" + grd_patlist.row + "]/instcd")
  293. + "▦" + model.getValue("/root/main/cond/orddd");
  294. setParameter("condparam", condparam);
  295. //상단 세팅 화면 사이즈 작게 띄움
  296. modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  297. } else {
  298. //응급
  299. eORDTYPE = model.getValue(xPathPatList + "[" + grd_patlist.row + "]/ordtype" );
  300. ePID = model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid" );
  301. eINDD = model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd" );
  302. eCRETNO = model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno" );
  303. eINSTCD = model.getValue(xPathPatList + "[" + grd_patlist.row + "]/instcd" );
  304. var param = "E" + "▦"
  305. + ePID + "▦"
  306. + eINDD + "▦"
  307. + eCRETNO + "▦"
  308. + eINSTCD + "▦" ;
  309. setParameter("condparam", param);
  310. modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  311. }
  312. fGetMedSpccdList("clickpat");
  313. }
  314. //메인에 보여지는 화면 오브젝트를 가져온다.
  315. var mainObj = getMainViewer();
  316. if(mainObj != null) {
  317. scrid = mainObj.javascript.getScreenID();
  318. if(scrid == "SMMNW00100") {
  319. mainObj.javascript.fInqurySelectedPrgm();
  320. } else if(scrid == "SMMNE00100"){
  321. mainObj.javascript.fSeletedSrcTool();
  322. }
  323. }
  324. }
  325. function fActivitySave(pDelFlag){
  326. model.removeNodeset("/root/send/savedata");
  327. var savecnt = 1;
  328. var stat;
  329. var itemnm;
  330. for( var idx = 1; idx <= grd_cadexset.rows - grd_cadexset.fixedRows; idx++ ){
  331. stat = model.getValue(xPathCardexSetList + "["+idx+"]/status"); //각각 행에 대한 수정정보를 가져온다.
  332. itemnm = grd_cadexset.labelMatrix( idx , grd_cadexset.colRef("itemnm"));
  333. if( pDelFlag != "delete" && (stat == "i" || stat == "u") ){ //저장이나 수정일 경우
  334. if ( isNull(model.getValue(xPathCardexSetList + "["+idx+"]/itemcnts")) ){
  335. messageBox("저장할 내용을 ", "C001");//입력하십시요
  336. return;
  337. }
  338. if(itemnm == "Activity"){
  339. model.makeValue("/root/send/savedata["+ savecnt +"]/status" , model.getValue(xPathCardexSetList + "["+idx+"]/status"));
  340. model.makeValue("/root/send/savedata["+ savecnt +"]/pid" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid"));
  341. model.makeValue("/root/send/savedata["+ savecnt +"]/indd" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd"));
  342. model.makeValue("/root/send/savedata["+ savecnt +"]/cretno" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno"));
  343. model.makeValue("/root/send/savedata["+ savecnt +"]/orddd" , model.getValue("/root/main/cond/orddd"));
  344. model.makeValue("/root/send/savedata["+ savecnt +"]/apntflag" , "C");
  345. model.makeValue("/root/send/savedata["+ savecnt +"]/prcpcd" , "-");
  346. model.makeValue("/root/send/savedata["+ savecnt +"]/bizspec" , model.getValue(xPathCardexSetList + "["+idx+"]/itemcnts"));
  347. model.makeValue("/root/send/savedata["+ savecnt +"]/itemcd" , "test");
  348. model.makeValue("/root/send/savedata["+ savecnt +"]/apntseqno" , model.getValue(xPathCardexSetList + "["+idx+"]/flag"));
  349. model.makeValue("/root/send/savedata["+ savecnt +"]/memocnts" , model.getValue(xPathCardexSetList + "["+idx+"]/itemcnts"));
  350. model.makeValue("/root/send/savedata["+ savecnt +"]/memoitemflag", "07");
  351. model.makeValue("/root/send/savedata["+ savecnt +"]/seqno" , model.getValue(xPathCardexSetList + "["+idx+"]/flag"));
  352. model.makeValue("/root/send/savedata["+ savecnt +"]/recdd_b" , model.getValue(xPathCardexSetList + "["+idx+"]/recdd").substring(0,8));//특이사항은 일시가 조회되어넘어옴.
  353. model.makeValue("/root/send/savedata["+ savecnt +"]/rectm_b" , model.getValue(xPathCardexSetList + "["+idx+"]/recdd").substring(8));
  354. } else if(itemnm == "입원동기") {
  355. model.makeValue("/root/send/savedata["+ savecnt +"]/status" , model.getValue(xPathCardexSetList + "["+idx+"]/status"));
  356. model.makeValue("/root/send/savedata["+ savecnt +"]/pid" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid"));
  357. model.makeValue("/root/send/savedata["+ savecnt +"]/indd" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd"));
  358. model.makeValue("/root/send/savedata["+ savecnt +"]/cretno" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno"));
  359. model.makeValue("/root/send/savedata["+ savecnt +"]/orddd" , model.getValue("/root/main/cond/orddd"));
  360. model.makeValue("/root/send/savedata["+ savecnt +"]/apntflag" , "입원동기");
  361. model.makeValue("/root/send/savedata["+ savecnt +"]/prcpcd" , "-");
  362. model.makeValue("/root/send/savedata["+ savecnt +"]/bizspec" , model.getValue(xPathCardexSetList + "["+idx+"]/itemcnts"));
  363. model.makeValue("/root/send/savedata["+ savecnt +"]/itemcd" , "test");
  364. model.makeValue("/root/send/savedata["+ savecnt +"]/apntseqno" , model.getValue(xPathCardexSetList + "["+idx+"]/flag"));
  365. model.makeValue("/root/send/savedata["+ savecnt +"]/memocnts" , model.getValue(xPathCardexSetList + "["+idx+"]/itemcnts"));
  366. model.makeValue("/root/send/savedata["+ savecnt +"]/memoitemflag", "10");
  367. model.makeValue("/root/send/savedata["+ savecnt +"]/seqno" , model.getValue(xPathCardexSetList + "["+idx+"]/flag"));
  368. model.makeValue("/root/send/savedata["+ savecnt +"]/recdd_b" , model.getValue(xPathCardexSetList + "["+idx+"]/recdd").substring(0,8));//특이사항은 일시가 조회되어넘어옴.
  369. model.makeValue("/root/send/savedata["+ savecnt +"]/rectm_b" , model.getValue(xPathCardexSetList + "["+idx+"]/recdd").substring(8));
  370. } else if(itemnm == "과거병력") {
  371. model.makeValue("/root/send/savedata["+ savecnt +"]/status" , model.getValue(xPathCardexSetList + "["+idx+"]/status"));
  372. model.makeValue("/root/send/savedata["+ savecnt +"]/pid" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid"));
  373. model.makeValue("/root/send/savedata["+ savecnt +"]/indd" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd"));
  374. model.makeValue("/root/send/savedata["+ savecnt +"]/cretno" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno"));
  375. model.makeValue("/root/send/savedata["+ savecnt +"]/orddd" , model.getValue("/root/main/cond/orddd"));
  376. model.makeValue("/root/send/savedata["+ savecnt +"]/apntflag" , "과거병력");
  377. model.makeValue("/root/send/savedata["+ savecnt +"]/prcpcd" , "-");
  378. model.makeValue("/root/send/savedata["+ savecnt +"]/bizspec" , model.getValue(xPathCardexSetList + "["+idx+"]/itemcnts"));
  379. model.makeValue("/root/send/savedata["+ savecnt +"]/itemcd" , "test");
  380. model.makeValue("/root/send/savedata["+ savecnt +"]/apntseqno" , model.getValue(xPathCardexSetList + "["+idx+"]/flag"));
  381. model.makeValue("/root/send/savedata["+ savecnt +"]/memocnts" , model.getValue(xPathCardexSetList + "["+idx+"]/itemcnts"));
  382. model.makeValue("/root/send/savedata["+ savecnt +"]/memoitemflag", "11");
  383. model.makeValue("/root/send/savedata["+ savecnt +"]/seqno" , model.getValue(xPathCardexSetList + "["+idx+"]/flag"));
  384. model.makeValue("/root/send/savedata["+ savecnt +"]/recdd_b" , model.getValue(xPathCardexSetList + "["+idx+"]/recdd").substring(0,8));//특이사항은 일시가 조회되어넘어옴.
  385. model.makeValue("/root/send/savedata["+ savecnt +"]/rectm_b" , model.getValue(xPathCardexSetList + "["+idx+"]/recdd").substring(8));
  386. }else {
  387. model.makeValue("/root/send/savedata["+ savecnt +"]/status" , model.getValue(xPathCardexSetList + "["+idx+"]/status"));
  388. model.makeValue("/root/send/savedata["+ savecnt +"]/pid" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid"));
  389. model.makeValue("/root/send/savedata["+ savecnt +"]/indd" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd"));
  390. model.makeValue("/root/send/savedata["+ savecnt +"]/cretno" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno"));
  391. model.makeValue("/root/send/savedata["+ savecnt +"]/orddd" , model.getValue("/root/main/cond/orddd"));
  392. model.makeValue("/root/send/savedata["+ savecnt +"]/apntflag" , "특이");
  393. model.makeValue("/root/send/savedata["+ savecnt +"]/prcpcd" , "-");
  394. model.makeValue("/root/send/savedata["+ savecnt +"]/bizspec" , model.getValue(xPathCardexSetList + "["+idx+"]/itemcnts"));
  395. model.makeValue("/root/send/savedata["+ savecnt +"]/itemcd" , "test");
  396. model.makeValue("/root/send/savedata["+ savecnt +"]/apntseqno" , model.getValue(xPathCardexSetList + "["+idx+"]/flag"));
  397. model.makeValue("/root/send/savedata["+ savecnt +"]/memocnts" , model.getValue(xPathCardexSetList + "["+idx+"]/itemcnts"));
  398. model.makeValue("/root/send/savedata["+ savecnt +"]/memoitemflag", "07");
  399. model.makeValue("/root/send/savedata["+ savecnt +"]/seqno" , model.getValue(xPathCardexSetList + "["+idx+"]/flag"));
  400. model.makeValue("/root/send/savedata["+ savecnt +"]/recdd_b" , model.getValue(xPathCardexSetList + "["+idx+"]/recdd").substring(0,8));//특이사항은 일시가 조회되어넘어옴.
  401. model.makeValue("/root/send/savedata["+ savecnt +"]/rectm_b" , model.getValue(xPathCardexSetList + "["+idx+"]/recdd").substring(8));
  402. }
  403. }else if ( pDelFlag == "delete"
  404. && model.getValue(xPathCardexSetList + "["+idx+"]/status") == "d"){
  405. if(itemnm == "Activity"){
  406. model.makeValue("/root/send/savedata["+ savecnt +"]/status" , "d");
  407. model.makeValue("/root/send/savedata["+ savecnt +"]/apntflag" , "C");
  408. model.makeValue("/root/send/savedata["+ savecnt +"]/apntseqno" , model.getValue(xPathCardexSetList + "["+idx+"]/flag"));
  409. model.makeValue("/root/send/savedata["+ savecnt +"]/pid" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid"));
  410. model.makeValue("/root/send/savedata["+ savecnt +"]/indd" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd"));
  411. model.makeValue("/root/send/savedata["+ savecnt +"]/cretno" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno"));
  412. model.makeValue("/root/send/savedata["+ savecnt +"]/orddd" , model.getValue("/root/main/cond/orddd"));
  413. model.makeValue("/root/send/savedata["+ savecnt +"]/memoitemflag", "07");
  414. model.makeValue("/root/send/savedata["+ savecnt +"]/seqno" , model.getValue(xPathCardexSetList + "["+idx+"]/flag"));
  415. model.makeValue("/root/send/savedata["+ savecnt +"]/recdd_b" , model.getValue(xPathCardexSetList + "["+idx+"]/recdd").substring(0,8));//특이사항은 일시가 조회되어넘어옴.
  416. model.makeValue("/root/send/savedata["+ savecnt +"]/rectm_b" , model.getValue(xPathCardexSetList + "["+idx+"]/recdd").substring(8));
  417. } else if(itemnm == "입원동기") {
  418. model.makeValue("/root/send/savedata["+ savecnt +"]/status" , "d");
  419. model.makeValue("/root/send/savedata["+ savecnt +"]/apntflag" , "입원동기");
  420. model.makeValue("/root/send/savedata["+ savecnt +"]/apntseqno" , model.getValue(xPathCardexSetList + "["+idx+"]/flag"));
  421. model.makeValue("/root/send/savedata["+ savecnt +"]/pid" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid"));
  422. model.makeValue("/root/send/savedata["+ savecnt +"]/indd" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd"));
  423. model.makeValue("/root/send/savedata["+ savecnt +"]/cretno" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno"));
  424. model.makeValue("/root/send/savedata["+ savecnt +"]/orddd" , model.getValue("/root/main/cond/orddd"));
  425. model.makeValue("/root/send/savedata["+ savecnt +"]/memoitemflag", "10");
  426. model.makeValue("/root/send/savedata["+ savecnt +"]/seqno" , model.getValue(xPathCardexSetList + "["+idx+"]/flag"));
  427. model.makeValue("/root/send/savedata["+ savecnt +"]/recdd_b" , model.getValue(xPathCardexSetList + "["+idx+"]/recdd").substring(0,8));//특이사항은 일시가 조회되어넘어옴.
  428. model.makeValue("/root/send/savedata["+ savecnt +"]/rectm_b" , model.getValue(xPathCardexSetList + "["+idx+"]/recdd").substring(8));
  429. } else if(itemnm == "과거병력") {
  430. model.makeValue("/root/send/savedata["+ savecnt +"]/status" , "d");
  431. model.makeValue("/root/send/savedata["+ savecnt +"]/apntflag" , "과거병력");
  432. model.makeValue("/root/send/savedata["+ savecnt +"]/apntseqno" , model.getValue(xPathCardexSetList + "["+idx+"]/flag"));
  433. model.makeValue("/root/send/savedata["+ savecnt +"]/pid" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid"));
  434. model.makeValue("/root/send/savedata["+ savecnt +"]/indd" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd"));
  435. model.makeValue("/root/send/savedata["+ savecnt +"]/cretno" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno"));
  436. model.makeValue("/root/send/savedata["+ savecnt +"]/orddd" , model.getValue("/root/main/cond/orddd"));
  437. model.makeValue("/root/send/savedata["+ savecnt +"]/memoitemflag", "11");
  438. model.makeValue("/root/send/savedata["+ savecnt +"]/seqno" , model.getValue(xPathCardexSetList + "["+idx+"]/flag"));
  439. model.makeValue("/root/send/savedata["+ savecnt +"]/recdd_b" , model.getValue(xPathCardexSetList + "["+idx+"]/recdd").substring(0,8));//특이사항은 일시가 조회되어넘어옴.
  440. model.makeValue("/root/send/savedata["+ savecnt +"]/rectm_b" , model.getValue(xPathCardexSetList + "["+idx+"]/recdd").substring(8));
  441. } else {
  442. model.makeValue("/root/send/savedata["+ savecnt +"]/status" , "d");
  443. model.makeValue("/root/send/savedata["+ savecnt +"]/apntflag" , "특이");
  444. model.makeValue("/root/send/savedata["+ savecnt +"]/apntseqno" , model.getValue(xPathCardexSetList + "["+idx+"]/flag"));
  445. model.makeValue("/root/send/savedata["+ savecnt +"]/pid" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid"));
  446. model.makeValue("/root/send/savedata["+ savecnt +"]/indd" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd"));
  447. model.makeValue("/root/send/savedata["+ savecnt +"]/cretno" , model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno"));
  448. model.makeValue("/root/send/savedata["+ savecnt +"]/orddd" , model.getValue("/root/main/cond/orddd"));
  449. model.makeValue("/root/send/savedata["+ savecnt +"]/memoitemflag", "07");
  450. model.makeValue("/root/send/savedata["+ savecnt +"]/seqno" , model.getValue(xPathCardexSetList + "["+idx+"]/flag"));
  451. model.makeValue("/root/send/savedata["+ savecnt +"]/recdd_b" , model.getValue(xPathCardexSetList + "["+idx+"]/recdd").substring(0,8));//특이사항은 일시가 조회되어넘어옴.
  452. model.makeValue("/root/send/savedata["+ savecnt +"]/rectm_b" , model.getValue(xPathCardexSetList + "["+idx+"]/recdd").substring(8));
  453. }
  454. }
  455. savecnt++;
  456. }
  457. if ( getNodesetCount("/root/send/savedata") <= 0 ){
  458. return;
  459. }
  460. model.removeNodeSet(xPathCardexSetList);
  461. if(submit("TXMNB00204","false")){
  462. //카덱스 정보 Setting
  463. if(getNodesetCount(xPathHidCardexSetList) > 0 ){
  464. model.makeNode(xPathCardexSetList);
  465. copyNodesetType(xPathCardexSetList, xPathHidCardexSetList, "replace", model, model); //tfHelper.js뒤에 경로 노드셋을 앞에 경로 노드셋에 복사.
  466. }
  467. }
  468. model.refresh();
  469. }
  470. /**
  471. * @group :
  472. * @ver : 2007.10.08
  473. * @by : 김홍점
  474. * @---------------------------------------------------
  475. * @type : function
  476. * @access : public
  477. * @desc : 환자번호가 없거나 내환자, 업무일자 value change시 환자리스트에
  478. * 전역변수에 환자정보와 일치하는 값이 존재할경우 all 이고 아니면 pat으로 조회
  479. * @param :
  480. * @param :
  481. * @return :
  482. * @---------------------------------------------------
  483. */
  484. function fGetKardexInfo() {
  485. }
  486. /**
  487. * @group :
  488. * @ver : 2007.10.08
  489. * @by : 최경용
  490. * @---------------------------------------------------
  491. * @type : function
  492. * @access : public
  493. * @desc : 투약, 검사관리 조회
  494. * @param :srchflag : cardex(카덱스 저장버튼 클릭 및 팝업화면에서 값 수정시 )
  495. , med(투약관리 저장클릭시)
  496. , test(검사관리의 조회버튼 클릭시)
  497. , all (환자리스트를 포함한 모든정보 조회할경우 )
  498. , pat (환자리스트만 조회)
  499. , clickpat (환자리스트를 클릭했을때 조회)
  500. , today (기구관리기록 화면닫을경우)
  501. * @param :
  502. * @return :
  503. * @---------------------------------------------------
  504. */
  505. function fGetMedSpccdList(srchflag){
  506. var deptcd = cmb_wardcd.value;
  507. var userdept = getUserInfo("dutplcecd");
  508. var spiritdept = model.getValue("/root/code/codeinfo/codelist[cdgrupid ='U31']/cdid");
  509. if(deptcd == spiritdept) {
  510. if(userdept != spiritdept) {
  511. messageBox("환자 개인정보 보호를 위해 해당병동 사용자외엔 조회를 제한합니다", "E");
  512. return;
  513. }
  514. }
  515. var medrcnt = 0;
  516. var prcpdd = "";
  517. var preprcpdd = "";
  518. var nodecnt = 1;
  519. var orddd = model.getValue("/root/main/cond/orddd");
  520. var srcNodePath="";
  521. var destNodePath="";
  522. var destobj;
  523. //메모리스트 조회 조건 추가 20081216 김홍점
  524. model.removeNodeset("/root/send/reqdata");
  525. model.makeNode("/root/send/reqdata");
  526. model.makeValue("/root/send/reqdata/wardcd" , model.getValue("/root/main/cond/wardcd"));
  527. model.makeValue("/root/send/reqdata/orddd" , orddd);
  528. model.makeValue("/root/send/reqdata/orddd_1", getDateAddc(orddd, 1));
  529. //검사관리용 조건
  530. model.makeValue("/root/send/reqdata/twodaypreorddd" , getDateAddc(orddd, -1));
  531. model.makeValue("/root/send/reqdata/twoweekpreorddd", getDateAddc(orddd, -14));
  532. model.makeValue("/root/send/reqdata/testprcpflag", model.getValue("/root/main/cond/testprcpflag"));
  533. model.makeValue("/root/send/reqdata/execflag" , model.getValue("/root/main/cond/execflag"));
  534. //model.makeValue("/root/send/reqdata/srchflag", srchflag);
  535. model.makeValue("/root/send/reqdata/pid" , ePID );
  536. model.makeValue("/root/send/reqdata/indd" , eINDD );
  537. model.makeValue("/root/send/reqdata/cretno" , eCRETNO );
  538. model.makeValue("/root/send/reqdata/settingrnid", model.getValue("/root/main/cond/settingrnid"));
  539. //응급실정보 추가_20110211_SMY
  540. model.makeValue("/root/send/reqdata/erflag", eERFLAG);
  541. model.makeValue("/root/send/reqdata/zonecd", model.getValue("/root/main/cond/zonecd"));
  542. setParameter("SPMNR11100_pid", grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("pid")));
  543. setParameter("SPMNR11100_indd", grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("indd")));
  544. setParameter("SPMNR11100_cretno", grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("cretno")));
  545. setParameter("SPMNR11100_wardcd", model.getValue(cmb_wardcd.attribute("ref")));
  546. setParameter("SPMNR11100_orddd", model.getValue(ipt_orddd.attribute("ref")));
  547. //환자리스트 쿼리 변경된걸로 조회
  548. model.makeValue("/root/send/reqdata/newflag", "Y");
  549. //환자리스트 정렬 순서
  550. model.makeValue("/root/send/reqdata/sortflag", model.getValue("/root/main/cond/sortflag"));
  551. if ( srchflag =="all" || srchflag =="clickpat" || srchflag == "pat" ){
  552. model.makeValue("/root/send/reqdata/srchflag", srchflag);
  553. if(submit("TRMNB00203")){
  554. if(model.getValue("/root/main/kardexinfo/consultinfo/sysdatereqcnt") > 0){
  555. output1.attribute("color") = "#ff0000";
  556. }else{
  557. output1.attribute("color") = "#000000";
  558. }
  559. if(model.getValue("/root/main/kardexinfo/consultinfo/sysdaterepcnt") > 0){
  560. output2.attribute("color") = "#0000ff";
  561. }else{
  562. output2.attribute("color") = "#000000";
  563. }
  564. output1.refresh();
  565. output2.refresh();
  566. fSettingCardexDetlInfo();
  567. fCheckNacrCnt();
  568. }
  569. }else {
  570. model.makeValue("/root/send/reqdata/srchflag", srchflag);
  571. destNodePath="";
  572. srcNodePath="";
  573. if( srchflag == "test" ){
  574. model.removeNodeSet(xPathTestList);
  575. srcNodePath = xPathHiddenTestList;
  576. destNodePath = xPathTestList;
  577. destobj = grd_test;
  578. }else if ( srchflag == "cath" ){
  579. model.removeNodeSet(xPathCatheterList);
  580. srcNodePath = xPathHiddenCatheterList;
  581. destNodePath = xPathCatheterList;
  582. destobj = grd_catheter;
  583. }else if ( srchflag == "today" ){
  584. model.removeNodeSet(xPathTodayList3);
  585. srcNodePath = xPathHiddenTodayList3;
  586. destNodePath = xPathTodayList3;
  587. destobj = grd_today3;
  588. }else if ( srchflag == "narc" ){
  589. model.removeNodeSet(xPathNarcInfo);
  590. srcNodePath = xPathHiddenNarcInfo;
  591. destNodePath = xPathNarcInfo;
  592. destobj = grd_today3;
  593. }
  594. if(submit("TRMNB00201", false)){
  595. if ( getNodesetCount(srcNodePath) > 0 ){
  596. model.makeNode(destNodePath);
  597. copyNodesetType(destNodePath, srcNodePath, "replace", model, model);
  598. }
  599. destobj.rebuild();
  600. fCheckNacrCnt();
  601. }
  602. }
  603. fSettingGridColor();
  604. }
  605. /**
  606. * @group :
  607. * @ver : 2007.10.08
  608. * @by : 김홍점
  609. * @---------------------------------------------------
  610. * @type : function
  611. * @access : public
  612. * @desc : 환자리스트에 환자정보 존재하는지 체크
  613. * @param :
  614. * @param :
  615. * @return :
  616. * @---------------------------------------------------
  617. */
  618. function fCheckExistPid() {
  619. if( !isNull(ePID) ){
  620. for(var i = 1; i <= getNodesetCount(xPathPatList); i++){
  621. if(model.getValue(xPathPatList+"[" + i + "]/pid") == ePID){
  622. model.setFocus("grd_patlist");
  623. grd_patlist.row = i;
  624. break;
  625. }
  626. }
  627. }
  628. }
  629. /**
  630. * @group :
  631. * @ver : 2007.10.08
  632. * @by : 김홍점
  633. * @---------------------------------------------------
  634. * @type : function
  635. * @access : public
  636. * @desc : 환자의 카덱스 정보 조회후 세팅
  637. * @param :
  638. * @param :
  639. * @return :
  640. * @---------------------------------------------------
  641. */
  642. function fSettingCardexDetlInfo() {
  643. fCheckExistPid();
  644. if ( grd_patlist.row > 0 ){
  645. grd_patlist.dispatch("onentercell");
  646. fSettingPatDetlInfo(grd_patlist.row);
  647. grd_patlist.refresh();
  648. }
  649. cap_today.text = getNodesetCount(xPathTodayScheduleList);
  650. cap_tomorrow.text = getNodesetCount(xPathTomorrowScheduleList);
  651. // 제증명신청건수/사본발급건수 가 있을경우 환자정보 리스트에 파란색으로 표시
  652. for (var i=1;i<=getNodesetCount(xPathPatList);i++) {
  653. var pGrdCertValue = model.getValue("/root/main/kardexinfo/ompatlist[" + i + "]/certcount"); // 제증명신청건수
  654. var pGrdCpapValue = model.getValue("/root/main/kardexinfo/ompatlist[" + i + "]/cpapcount"); // 사본발급건수
  655. if(pGrdCertValue > 0 || pGrdCpapValue > 0){
  656. grd_patlist.cellStyle("color",i, grd_patlist.colRef("patnm")) = "#0000ff";
  657. }else{
  658. grd_patlist.cellStyle("color",i, grd_patlist.colRef("patnm")) = "#000000";
  659. }
  660. }
  661. grd_patlist.refresh();
  662. var meprcpdd = getNodesetCount(xPathMedrPrcpddList);
  663. if (meprcpdd > 0) {
  664. grd_medi1.row = grd_medi1.findRow(model.getValue("/root/main/cond/orddd"), 1, 0);
  665. grd_medi1.topRow = grd_medi1.row-1;
  666. fDBClickMedr();
  667. }
  668. }
  669. /**
  670. * @group :
  671. * @ver : 2007.10.08
  672. * @by : 김홍점
  673. * @---------------------------------------------------
  674. * @type : function
  675. * @access : public
  676. * @desc : 환자리스트를 제외한 환자 상세정보 값 clear
  677. * @param :
  678. * @param :
  679. * @return :
  680. * @---------------------------------------------------
  681. */
  682. function fCheckNacrCnt() {
  683. //마약 미정리건 블러킹 20090504 김홍점
  684. if ( model.getValue(xPathNarcInfo + "/cnt") > "0" ){
  685. messageBox("정리되지 않은 마약이 존재합니다.","I007");
  686. model.setAttribute("Narc_Menu_Param", "");
  687. var sParam = "I,op";
  688. model.setAttribute("Narc_Menu_Param", sParam);
  689. model.setAttribute("SMADT30400_Fromdd", model.getValue(xPathNarcInfo+"/prcpdd"));
  690. modal("SMADT30400","1","15","128");
  691. model.setAttribute("SMADT30400_Fromdd", "");
  692. fGetMedSpccdList("narc");
  693. }
  694. }
  695. /**
  696. * @group :
  697. * @ver : 2007.10.08
  698. * @by : 김홍점
  699. * @---------------------------------------------------
  700. * @type : function
  701. * @access : public
  702. * @desc : 환자리스트를 제외한 환자 상세정보 값 clear
  703. * @param :
  704. * @param :
  705. * @return :
  706. * @---------------------------------------------------
  707. */
  708. function fClearExceptPatList() {
  709. model.resetInstanceNode(xPathConsultInfo);
  710. model.resetInstanceNode(xPathAssessInfo);
  711. model.resetInstanceNode(xPathMedrMemoInfo);
  712. model.resetInstanceNode(xPathPatDetlInfo);
  713. opt_blodprepyn.attribute("background-image") = "";
  714. model.setValue(xPathPatDetlInfo + "/roomcd", "병실");
  715. model.setValue(xPathPatDetlInfo + "/pid", "등록번호");
  716. model.setValue(xPathPatDetlInfo + "/patnm", "환자명");
  717. model.setValue(xPathPatDetlInfo + "/sexage", "S/A");
  718. model.removeNodeSet(xPathMemoList);
  719. model.removeNodeSet(xPathTodayScheduleList);
  720. model.removeNodeSet(xPathTomorrowScheduleList);
  721. model.removeNodeSet(xPathTodayList1);
  722. model.removeNodeSet(xPathTodayList2);
  723. model.removeNodeSet(xPathTodayList3);
  724. model.removeNodeSet(xPathCardexSetList);
  725. model.removeNodeSet(xPathHiddenCatheterList);
  726. model.removeNodeSet(xPathCatheterList);
  727. model.removeNodeSet(xPathMedrList);
  728. model.removeNodeSet(xPathMedrPrcpddList);
  729. model.removeNodeSet(xPathMedrPrcpList);
  730. model.removeNodeSet(xPathHiddenTestList);
  731. model.removeNodeSet(xPathTestList);
  732. }
  733. /**
  734. * @group :
  735. * @ver : 2007.10.08
  736. * @by : 최경용
  737. * @---------------------------------------------------
  738. * @type : function
  739. * @access : public
  740. * @desc : 투약관리 처방적용일 더블클릭시
  741. * @param :
  742. * @param :
  743. * @return :
  744. * @---------------------------------------------------
  745. */
  746. function fDBClickMedr(){
  747. var row = grd_medi1.row;
  748. var medrcnt = getNodesetCount(xPathMedrList);
  749. var prcpdd = model.getValue(xPathMedrPrcpddList + "[" + row + "]/prcpdd");
  750. ePRCPDD = prcpdd;
  751. var hngnm = "";
  752. var prcpvol = "";
  753. var prcpvolunitflag = "";
  754. var prcpqty = "";
  755. var prcpqtyunitflag = "";
  756. var prcptims = "";
  757. var abbrnm = "";
  758. var drugmthdspccd = "";
  759. var prcpnm = "";
  760. var prcpstatnm = "";
  761. var count = 1;
  762. var icnt = 1;
  763. if(medrcnt > 0){
  764. model.removeNodeSet(xPathMedrPrcpList);
  765. model.makeNode(xPathMedrPrcpList);
  766. copyNodesetType(xPathMedrPrcpList, xPathMedrList + "[prcpdd = '" + prcpdd + "']", "replace", model, model);
  767. }
  768. grd_medi2.rebuild();
  769. }
  770. /**
  771. * @group :
  772. * @ver : 2007.10.08
  773. * @by : 최경용
  774. * 김홍점 20081216 사용안함 fGetMedSpccdList("all")에서 모두 조회 하는걸로 수정
  775. * @---------------------------------------------------
  776. * @type : function
  777. * @access : public
  778. * @desc : 메모리스트 조회
  779. * @param :
  780. * @param :
  781. * @return :
  782. * @---------------------------------------------------
  783. */
  784. function fGetMemoList(){
  785. //메모리스트 조회
  786. model.removeNodeset("/root/send/reqdata");
  787. model.makeNode("/root/send/reqdata");
  788. model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
  789. model.makeValue("/root/send/reqdata/orddd", model.getValue("/root/main/cond/orddd"));
  790. model.makeValue("/root/send/reqdata/pid", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid"));
  791. model.makeValue("/root/send/reqdata/indd", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd"));
  792. model.makeValue("/root/send/reqdata/cretno", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno"));
  793. model.makeValue("/root/send/reqdata/memoitemflag", '05');
  794. model.removeNodeset("/root/main/memoinfo");
  795. model.makeNode("/root/main/memoinfo");
  796. submit("TRMNB00202");
  797. }
  798. /**
  799. * @group :
  800. * @ver : 2007.10.08
  801. * @by : 최경용
  802. * @---------------------------------------------------
  803. * @type : function
  804. * @access : public
  805. * @desc : 투약관리 메모 조회
  806. * @param :
  807. * @param :
  808. * @return :
  809. * @---------------------------------------------------
  810. */
  811. function fDBClickMemo(){
  812. //메모리스트 조회
  813. model.removeNodeset("/root/send/reqdata");
  814. model.makeNode("/root/send/reqdata");
  815. model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
  816. //model.makeValue("/root/send/reqdata/orddd", ePRCPDD);
  817. model.makeValue("/root/send/reqdata/pid", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid"));
  818. model.makeValue("/root/send/reqdata/indd", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd"));
  819. model.makeValue("/root/send/reqdata/cretno", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno"));
  820. model.makeValue("/root/send/reqdata/memoitemflag", '06');
  821. submit("TRMNB00204");
  822. model.setValue(xPathMedrMemoInfo + "/memocnts", model.getValue("/root/hidden/memoinfo/memolist/memocnts"));
  823. model.setValue(xPathMedrMemoInfo + "/recdd_b", model.getValue("/root/hidden/memoinfo/memolist/recdd"));
  824. model.setValue(xPathMedrMemoInfo + "/rectm_b", model.getValue("/root/hidden/memoinfo/memolist/rectm"));
  825. model.setValue(xPathMedrMemoInfo + "/seqno", model.getValue("/root/hidden/memoinfo/memolist/seqno"));
  826. if( !isNull(model.getValue("/root/hidden/memoinfo/memolist/recdd"))){
  827. model.setValue(xPathMedrMemoInfo + "/status", "u")
  828. }
  829. model.refresh();
  830. }
  831. /**
  832. * @group :
  833. * @ver : 2007.10.08
  834. * @by : 최경용
  835. * 20081216 김홍점 not use 요구사항에 의해 사용안함.
  836. * @---------------------------------------------------
  837. * @type : function
  838. * @access : public
  839. * @desc : to-do 리스트 조회
  840. * @param :
  841. * @param :
  842. * @return :
  843. * @---------------------------------------------------
  844. */
  845. function fGetTodoList() {
  846. model.removeNodeset("/root/main_todo/todoinfo/todopatlist"); // 교육대상자리스트 Clear
  847. grd_todolist.refresh();
  848. model.removenode("/root/send");
  849. model.makeValue("/root/send/wardcd", model.getValue("/root/main/cond/wardcd"));
  850. model.makeValue("/root/send/orddd", model.getValue("/root/main/cond/orddd"));
  851. model.makeValue("/root/send/orddd_t", (model.getValue("/root/main/cond/orddd")).toDate().getAddDate(+1, "D").getDateFormat());
  852. model.makeValue("/root/send/settingrnid", model.getValue("/root/main/cond/settingrnid"));
  853. model.makeValue("/root/send/memoitemflag", '04');
  854. model.makeValue("/root/send/status", '01');
  855. model.makeValue("/root/send/patinfoyn", 'Y');
  856. grd_todolist.allStyle("data", "background-image") = "";
  857. model.makeValue("/root/send/pid", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid"));
  858. model.makeValue("/root/send/indd", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd"));
  859. model.makeValue("/root/send/cretno", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno"));
  860. for(var i = 1 ; i < grd_todolist.rows ; i++){
  861. for(var j = 17 ; j < 100 ;){
  862. grd_todolist.cellStyle("background-color", i, j, i,j) = "#FFFFFF";
  863. j = j+3;
  864. }
  865. }
  866. if (submit("TRMNW00401")) {
  867. for(var i = 1 ; i < grd_todolist.rows ; i++){
  868. var blodprep = model.getValue("/root/main_todo/todoinfo/todopatlist[" + i + "]/blodprepyn");
  869. if (blodprep == "Y") {
  870. model.setValue("/root/main_todo/todoinfo/todopatlist[" + i + "]/blodprepyn", "");
  871. grd_todolist.cellstyle("background-image", i , 7) = "../../../emr/commonweb/images/blood.gif";
  872. } else {
  873. grd_todolist.cellstyle("background-image", i , 7) = "";
  874. }
  875. for(var j = 17 ; j < 100 ;){
  876. if(grd_todolist.valueMatrix(i,j) == "MEMO"){
  877. grd_todolist.cellstyle("background-image", i, j+1) = "../../../com/commonweb/images/icon_list.gif";
  878. }
  879. j = j+3;
  880. }
  881. for(var j = 19 ; j < 100 ;){
  882. var execyn = (grd_todolist.valueMatrix(i,j)).substring(18,19);
  883. if( execyn == "Y"){
  884. grd_todolist.cellStyle("background-color", i, j-1, i,j-1) = "#F08080";
  885. }else{
  886. grd_todolist.cellStyle("background-color", i, j-1, i,j-1) = grd_todolist.cellStyle("background-color", i, j+1, i,j+1);
  887. }
  888. j = j+3;
  889. }
  890. }
  891. }//submit
  892. }
  893. /**
  894. * @group :
  895. * @ver : 2008.10.05
  896. * @by : 김홍점
  897. * @---------------------------------------------------
  898. * @type : function
  899. * @access : public
  900. * @desc : 특이사항 Activity 삭제
  901. * @param :
  902. * @param :
  903. * @return :
  904. * @---------------------------------------------------
  905. */
  906. function fDelCardexSet(){
  907. for ( var idx = 0 ; idx < grd_cadexset.selectedRows ; idx++){
  908. if( model.getValue(xPathCardexSetList + "["+grd_cadexset.selectedRow(idx)+"]/flag") != "0" ){
  909. model.makeValue(xPathCardexSetList + "["+grd_cadexset.selectedRow(idx)+"]/status", "d");
  910. }
  911. }
  912. fActivitySave("delete");
  913. }
  914. /**
  915. * @group :
  916. * @ver : 2007.10.08
  917. * @by : 최경용
  918. * @---------------------------------------------------
  919. * @type : function
  920. * @access : public
  921. * @desc : 메모리스트 저장
  922. * @param :
  923. * @param :
  924. * @return :
  925. * @---------------------------------------------------
  926. */
  927. function fExeMomoList() {
  928. if ( grd_patlist.row == -1) {
  929. messageBox("해당 환자가 선택되지", "E007");
  930. return;
  931. } else {
  932. var memocnts = grd_memo.getUpdateData();
  933. for( var cnt = 1 ; cnt < memocnts.split("▩").length-1 ; cnt++ ){
  934. if ( getArrayData(memocnts,cnt,2) == "" ){
  935. messageBox("저장할 메모를", "C001");//" 입력하십시오."
  936. return;
  937. }
  938. }
  939. model.removeNodeset("/root/send/savedata");
  940. model.makeNode("/root/send/savedata");
  941. //그리드 저장조건
  942. for (var i = 1; i < grd_memo.rows; i++) {
  943. model.setValue(xPathMemoList+"[" + i + "]/memoitemflag", '05');
  944. model.setValue(xPathMemoList + "[" + i + "]/recdd", model.getValue("/root/main/cond/orddd"));
  945. model.setValue(xPathMemoList + "[" + i + "]/rectm", getCurrentTime().substr(0, 4));
  946. model.setValue(xPathMemoList + "[" + i + "]/pid", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid"));
  947. model.setValue(xPathMemoList + "[" + i + "]/indd", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd"));
  948. model.setValue(xPathMemoList + "[" + i + "]/cretno", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno"));
  949. }
  950. model.makeValue("/root/send/savedata/memoinfo", grd_memo.getUpdateData());
  951. //조회조건
  952. model.makeValue("/root/send/savedata/condinfo/wardcd", model.getValue("/root/main/cond/wardcd"));
  953. model.makeValue("/root/send/savedata/condinfo/pid", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid"));
  954. model.makeValue("/root/send/savedata/condinfo/indd", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd"));
  955. model.makeValue("/root/send/savedata/condinfo/cretno", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno"));
  956. model.makeValue("/root/send/savedata/condinfo/orddd", model.getValue("/root/main/cond/orddd"));
  957. model.makeValue("/root/send/savedata/condinfo/memoitemflag", '05');
  958. model.removeNodeSet(xPathMemoList);
  959. if(submit("TXMNB00203",false)){
  960. if ( getNodesetCount(xPathHidMemoList) > 0 ){
  961. model.makeNode(xPathMemoList);
  962. copyNodesetType(xPathMemoList, xPathHidMemoList, "replace", model, model);
  963. }
  964. messageBox("성공적으로", "I001");
  965. }
  966. grd_memo.rebuild();
  967. }
  968. }
  969. /**
  970. * @group :
  971. * @ver : 2007.10.08
  972. * @by : 최경용
  973. * @---------------------------------------------------
  974. * @type : function
  975. * @access : public
  976. * @desc : 투약관리 메모 저장
  977. * @param :pFlag:"D" 삭제
  978. * @param :
  979. * @return :
  980. * @---------------------------------------------------
  981. */
  982. function fMedrMomoSave(pFlag){
  983. var saveHearder = "m▦memocnts▦pid▦memoitemflag▦seqno▦recdd_b▦rectm_b▦indd▦cretno▩";
  984. var saveData = "";
  985. var status = "";
  986. if ( grd_patlist.row == -1) {
  987. messageBox("해당 환자가 선택되지", "E007");
  988. return;
  989. } else {
  990. if( pFlag =="D"){
  991. saveData = "d" + "▦"
  992. + "" + "▦"
  993. + model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid") + "▦"
  994. + "06" + "▦"
  995. + model.getValue(xPathMedrMemoInfo + "/seqno") + "▦"
  996. + model.getValue(xPathMedrMemoInfo + "/recdd_b") + "▦"
  997. + model.getValue(xPathMedrMemoInfo + "/rectm_b") + "▦"
  998. + model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd") + "▦"
  999. + model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno") + "▩";
  1000. model.makeValue("/root/send/savedata/memoinfo",saveHearder+saveData);
  1001. model.makeValue("/root/send/savedata/condinfo/wardcd", model.getValue("/root/main/cond/wardcd"));
  1002. model.makeValue("/root/send/savedata/condinfo/pid", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid"));
  1003. model.makeValue("/root/send/savedata/condinfo/indd", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd"));
  1004. model.makeValue("/root/send/savedata/condinfo/cretno", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno"));
  1005. model.makeValue("/root/send/savedata/condinfo/orddd", model.getValue("/root/main/cond/orddd"));
  1006. model.makeValue("/root/send/savedata/condinfo/memoitemflag", "06");
  1007. model.resetInstanceNode(xPathMedrMemoInfo);
  1008. if(submit("TXMNB00203","false")){
  1009. model.setValue(xPathMedrMemoInfo + "/memocnts", model.getValue(xPathHidMedrMemoInfo + "/memocnts"));
  1010. model.setValue(xPathMedrMemoInfo + "/recdd_b", model.getValue(xPathHidMedrMemoInfo + "/recdd_b"));
  1011. model.setValue(xPathMedrMemoInfo + "/rectm_b", model.getValue(xPathHidMedrMemoInfo + "/rectm_b"));
  1012. model.setValue(xPathMedrMemoInfo + "/seqno", model.getValue(xPathHidMedrMemoInfo + "/seqno"));
  1013. if( !isNull(model.getValue(xPathMedrMemoInfo + "/recdd_b")) ){
  1014. model.setValue(xPathMedrMemoInfo + "/status", "i")
  1015. }else{
  1016. model.setValue(xPathMedrMemoInfo + "/status", "")
  1017. }
  1018. messageBox("성공적으로", "I001");
  1019. }
  1020. }else{
  1021. if ( isNull(model.getValue(xPathMedrMemoInfo + "/memocnts")) ){
  1022. messageBox("저장할 투약관리 메모를", "C001");//" 입력하십시오."
  1023. return;
  1024. }
  1025. model.removeNodeset("/root/send/savedata");
  1026. model.makeNode("/root/send/savedata");
  1027. //그리드 저장조건
  1028. // model.makeValue("/root/send/savedata/memoinfo/pid", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid"));
  1029. // model.makeValue("/root/send/savedata/memoinfo/indd", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd"));
  1030. // model.makeValue("/root/send/savedata/memoinfo/cretno", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno"));
  1031. // model.makeValue("/root/send/savedata/memoinfo/seqno", model.getValue(xPathMedrMemoInfo+"/seqno"));
  1032. // model.makeValue("/root/send/savedata/memoinfo/memoitemflag", "06");
  1033. // model.makeValue("/root/send/savedata/memoinfo/memocnts", model.getValue(xPathMedrMemoInfo+"/memocnts"));
  1034. // model.makeValue("/root/send/savedata/memoinfo/recdd", getCurrentDate());
  1035. // model.makeValue("/root/send/savedata/memoinfo/rectm", getCurrentTime().substr(0, 4));
  1036. // model.makeValue("/root/send/savedata/memoinfo/recdd_b", model.getValue(xPathMedrMemoInfo+"/recdd_b"));
  1037. // model.makeValue("/root/send/savedata/memoinfo/rectm_b", model.getValue(xPathMedrMemoInfo+"/rectm_b"));
  1038. // model.makeValue("/root/send/savedata/memoinfo/wardcd", model.getValue("/root/main/cond/wardcd"));
  1039. // model.makeValue("/root/send/savedata/memoinfo/orddd", model.getValue("/root/main/cond/orddd"));
  1040. // if(isNull(model.getValue(xPathMedrMemoInfo+"/status"))){
  1041. // model.makeValue("/root/send/savedata/memoinfo/status", "i");
  1042. // }else{
  1043. // model.makeValue("/root/send/savedata/memoinfo/status", "u");
  1044. // }
  1045. //
  1046. if(isNull(model.getValue(xPathMedrMemoInfo+"/status"))){
  1047. status="i";
  1048. }else{
  1049. status="u";
  1050. }
  1051. saveData = status + "▦"
  1052. + model.getValue(xPathMedrMemoInfo+"/memocnts") + "▦"
  1053. + model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid") + "▦"
  1054. + "06" + "▦"
  1055. + model.getValue(xPathMedrMemoInfo + "/seqno") + "▦"
  1056. + model.getValue(xPathMedrMemoInfo + "/recdd_b") + "▦"
  1057. + model.getValue(xPathMedrMemoInfo + "/rectm_b") + "▦"
  1058. + model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd") + "▦"
  1059. + model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno") + "▩";
  1060. model.makeValue("/root/send/savedata/memoinfo",saveHearder+saveData);
  1061. model.makeValue("/root/send/savedata/condinfo/wardcd", model.getValue("/root/main/cond/wardcd"));
  1062. model.makeValue("/root/send/savedata/condinfo/pid", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/pid"));
  1063. model.makeValue("/root/send/savedata/condinfo/indd", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/indd"));
  1064. model.makeValue("/root/send/savedata/condinfo/cretno", model.getValue(xPathPatList + "[" + grd_patlist.row + "]/cretno"));
  1065. model.makeValue("/root/send/savedata/condinfo/orddd", model.getValue("/root/main/cond/orddd"));
  1066. model.makeValue("/root/send/savedata/condinfo/memoitemflag", "06");
  1067. model.resetInstanceNode(xPathMedrMemoInfo);
  1068. if(submit("TXMNB00203","false")){
  1069. if ( getNodesetCount(xPathHidMedrMemoInfo) > 0 ){
  1070. copyNodesetType(xPathMedrMemoInfo, xPathHidMedrMemoInfo, "replace", model, model);
  1071. }
  1072. messageBox("성공적으로", "I001");
  1073. }
  1074. }
  1075. tar_remk1.refresh();
  1076. }
  1077. }
  1078. /**
  1079. * @group :
  1080. * @ver : 2007.10.08
  1081. * @by : 최경용
  1082. * @---------------------------------------------------
  1083. * @type : function
  1084. * @access : public
  1085. * @desc : 내환자 셋팅
  1086. * @param :
  1087. * @param :
  1088. * @return :
  1089. * @---------------------------------------------------
  1090. */
  1091. function fChangePidSetting(){
  1092. setParameter("wardcd", model.getValue("/root/main/cond/wardcd"));
  1093. setParameter("userid", model.getValue("/root/main/cond/userid"));
  1094. setParameter("usernm", model.getValue("/root/main/cond/usernm"));
  1095. modal("SMMNB00400","1" ,"868", "128");
  1096. //공통함수로 수정_20110211_ SMY
  1097. fGetWardChngInfo();
  1098. /*
  1099. model.removenode("/root/send");
  1100. model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
  1101. submit("TRMNW00101");
  1102. for(i = 1; i <= getNodesetCount("/root/init/settingrn"); i++ ) {
  1103. if (model.getValue("/root/main/cond/userid") == model.getValue("/root/init/settingrn["+ i +"]/settingrnid")) {
  1104. model.setValue("/root/main/cond/settingrnid", model.getValue("/root/main/cond/userid"));
  1105. }
  1106. }
  1107. */
  1108. fGetMedSpccdList("pat");
  1109. }
  1110. function fShowPopupMenu(gridID, menuPath)
  1111. {
  1112. var gridObj = document.controls.item(gridID);
  1113. if(event.button == 3) {
  1114. if(gridObj.isCell(event.target) && gridObj.mouseRow >= gridObj.fixedrows){
  1115. window.setPopupMenu(true, menuPath, "name", "func", false);
  1116. }else{
  1117. window.setPopupMenu(false);
  1118. }
  1119. }
  1120. }
  1121. //환자정보 오픈
  1122. //서브메뉴를 이용한 오픈은 기본으로 상단정보를 올리도록 적용.
  1123. function fOpenPrcpSpec()
  1124. {
  1125. fClickPatList();
  1126. var pid = model.getValue("/root/main/kardexinfo/ompatlist[" + grd_patlist.row + "]/pid");
  1127. var indd = model.getValue("/root/main/kardexinfo/ompatlist[" + grd_patlist.row + "]/indd");
  1128. var orddd = model.getValue("/root/main/cond/orddd");
  1129. var param = pid + "▩" + "I" + "▩" + indd + "▩" + orddd;
  1130. setParameter("SMMMO02500_pid", pid);
  1131. open("SMMMO02500","1","20","128");
  1132. }
  1133. //환자라벨출력
  1134. function fOpenLabelPrint(){
  1135. //fClickPatList();
  1136. model.setValue("/root/main/printcnt","1");
  1137. group4.attribute("left") = event.ScreenX-window.screenleft-10;
  1138. group4.attribute("top") = event.ScreenY-window.screenTop-50;
  1139. model.setFocus("ipt_patcntctel");
  1140. model.refresh();
  1141. group4.visible = true;
  1142. }
  1143. //간호일지 오픈
  1144. function fOpenNursingRecord()
  1145. {
  1146. fClickPatList();
  1147. open("SMMNR00700","1","20","128");
  1148. }
  1149. function fPopupSearchRecDataInitParam() {
  1150. }
  1151. //전실신청 오픈
  1152. function fOpenChngRoom()
  1153. {
  1154. fClickPatList();
  1155. open("SMPMI01700","1","20","128");
  1156. }
  1157. //투약기록 오픈
  1158. function fOpenMediRecord()
  1159. {
  1160. fClickPatList();
  1161. open("SMMNR00600","1","20","128");
  1162. }
  1163. //간호처방 오픈
  1164. function fOpenCarePrcp()
  1165. {
  1166. fClickPatList();
  1167. open("SMMNW10900","1","20","128");
  1168. }
  1169. //바코드관리 오픈
  1170. function fOpenBarcodeMngt()
  1171. {
  1172. fClickPatList();
  1173. open("SMLLC00200","1","20","128");
  1174. }
  1175. //검사결과조회 오픈
  1176. function fOpenTestRslt()
  1177. {
  1178. fClickPatList();
  1179. open("SMAER00800","1","20","128");
  1180. }
  1181. //임상관찰기록 오픈
  1182. function fOpenTPR()
  1183. {
  1184. fClickPatList();
  1185. open("SMMNR00900","1","20","128");
  1186. }
  1187. //퇴원정리 오픈
  1188. function fOpenDschArngnm()
  1189. {
  1190. fClickPatList();
  1191. open("SMMNW01200","1","20","128");
  1192. }
  1193. // 약품인계내역조회추가
  1194. function fOpenDrugList(){
  1195. fClickPatList();
  1196. setParameter("SPMNW12400_PARAM1", model.getValue("/root/main/kardexinfo/ompatlist[" + grd_patlist.row + "]/pid"));
  1197. setParameter("SPMNW12400_PARAM2", model.getValue("/root/main/kardexinfo/ompatlist[" + grd_patlist.row + "]/indd"));
  1198. open("SPMNW12400","1","20","128");
  1199. }
  1200. //2011.1.12, 주희경
  1201. //내환자 메모 출력
  1202. function fGetMypatMemo()
  1203. {
  1204. //var wardcd = model.getValue("/root/main/cond/wardcd");
  1205. if ( cmb_wardcd.label == "" )
  1206. {
  1207. messageBox("병동이 선택되지", "E007");
  1208. return;
  1209. }
  1210. //응급실인 경우 구역정보로 처리되도록 수정_20110214_SMY
  1211. if(eERFLAG == "Y"){
  1212. var zonecd = model.getValue("/root/main/cond/zonecd");
  1213. if ( zonecd == "-" || zonecd == "" )
  1214. {
  1215. messageBox("구역정보가 선택되지", "E007");
  1216. return;
  1217. }
  1218. }else{
  1219. var nursid = model.getValue("/root/main/cond/settingrnid");
  1220. if ( nursid == "-" || nursid == "" )
  1221. {
  1222. messageBox("내환자가 선택되지", "E007");
  1223. return;
  1224. }
  1225. }
  1226. model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
  1227. model.makeValue("/root/send/reqdata/nursid", model.getValue("/root/main/cond/settingrnid"));
  1228. model.makeValue("/root/send/reqdata/orddd", model.getValue("/root/main/cond/orddd"));
  1229. model.removeNodeset("/root/main/memoinfo");
  1230. model.makeNode("/root/main/mypatmemoinfo");
  1231. //응급실정보 추가_20110214_SMY
  1232. model.makeValue("/root/send/reqdata/erflag", eERFLAG);
  1233. model.makeValue("/root/send/reqdata/zonecd", model.getValue("/root/main/cond/zonecd"));
  1234. if ( submit("TRMNB00205") )
  1235. {
  1236. //debugger;
  1237. model.removeNodeSet("/root/main/rex_memolist");
  1238. var memolist = instance1.selectNodes("/root/main/mypatmemoinfo/memolist");
  1239. var sdeptcd = getUserInfo("dutplcecd");
  1240. //alert("sdeptcd : " + sdeptcd);
  1241. //alert(instance1.selectNodesXml("/root/main/mypatmemoinfo/memolist"));
  1242. var pid = "";
  1243. var groupid = 0;
  1244. var arr = 0;
  1245. var memo = "";
  1246. var memolistcnt = 1;
  1247. var next_pid = "";
  1248. for(i=0; i<memolist.length; i++)
  1249. {
  1250. var new_pid = memolist.item(i).selectSingleNode("pid").value;
  1251. if ( i != memolist.length-1)
  1252. {
  1253. next_pid = memolist.item(i+1).selectSingleNode("pid").value;
  1254. }
  1255. else
  1256. next_pid = "0";
  1257. if ( pid != new_pid )
  1258. {
  1259. groupid++;
  1260. if ( groupid > 3 )
  1261. {
  1262. groupid = 1;
  1263. }
  1264. if ( groupid == 1 )
  1265. {
  1266. arr++;
  1267. model.makeNode("/root/main/rex_memolist/group["+arr+"]");
  1268. }
  1269. model.makeNode("/root/main/rex_memolist/group["+arr+"]/s_group"+groupid);
  1270. pid = new_pid;
  1271. memolistcnt = 1;
  1272. }
  1273. if ( memolistcnt == 1 )
  1274. {
  1275. var tarNode = instance1.selectSingleNode("/root/main/rex_memolist/group["+arr+"]/s_group"+groupid);
  1276. tarNode.appendChild( memolist.item(i).selectSingleNode("roomcd").cloneNode( false ));
  1277. tarNode.appendChild( memolist.item(i).selectSingleNode("pid").cloneNode( false ));
  1278. tarNode.appendChild( memolist.item(i).selectSingleNode("patnm").cloneNode( false ));
  1279. tarNode.appendChild( memolist.item(i).selectSingleNode("sa").cloneNode( false ));
  1280. tarNode.appendChild( memolist.item(i).selectSingleNode("medispclnm").cloneNode( false ));
  1281. tarNode.appendChild( memolist.item(i).selectSingleNode("atdoctnm").cloneNode( false ));
  1282. tarNode.appendChild( memolist.item(i).selectSingleNode("nzoneno").cloneNode( false ));
  1283. tarNode.appendChild( memolist.item(i).selectSingleNode("specldesc").cloneNode( false ));
  1284. tarNode.appendChild( memolist.item(i).selectSingleNode("activity").cloneNode( false ));
  1285. tarNode.appendChild( memolist.item(i).selectSingleNode("inmotive").cloneNode( false ));
  1286. tarNode.appendChild( memolist.item(i).selectSingleNode("past").cloneNode( false ));
  1287. tarNode.appendChild( memolist.item(i).selectSingleNode("diagengnm").cloneNode( false ));
  1288. tarNode.appendChild( memolist.item(i).selectSingleNode("rectermnm").cloneNode( false ));
  1289. tarNode.appendChild( memolist.item(i).selectSingleNode("diet").cloneNode( false ));
  1290. tarNode.appendChild( memolist.item(i).selectSingleNode("vs").cloneNode( false ));
  1291. tarNode.appendChild( memolist.item(i).selectSingleNode("vsnm").cloneNode( false ));
  1292. // '15.08.04 - 추가
  1293. tarNode.appendChild( memolist.item(i).selectSingleNode("gesage").cloneNode( false ));
  1294. memo = "";
  1295. }
  1296. var recdt = memolist.item(i).selectSingleNode("recdt").value;
  1297. recdt = recdt.substr(0,4) + "/" + recdt.substr(4,2) + "/" + recdt.substr(6,2) + " " + recdt.substr(8,2) + ":" + recdt.substr(10,2);
  1298. // memo = memo + "[" + memolist.item(i).selectSingleNode("writ").value + "] | " + recdt + "\n"+ memolist.item(i).selectSingleNode("memocnts").value + "\n\n";
  1299. memo = memo + memolist.item(i).selectSingleNode("memocnts").value + "\n";
  1300. memolistcnt++;
  1301. if ( new_pid != next_pid )
  1302. {
  1303. model.makeNode("/root/main/rex_memolist/group["+arr+"]/s_group"+groupid+"/memo");
  1304. model.setValue("/root/main/rex_memolist/group["+arr+"]/s_group"+groupid+"/memo", memo, true);
  1305. }
  1306. }
  1307. //alert(instance1.selectNodesXml("/root/main/rex_memolist/group"));
  1308. //model.removeNodeset("/root/main/mypatmemoinfo");
  1309. if(sdeptcd == '2100300000' || sdeptcd == '2110200000') {
  1310. exeReportPreview("RPMNB00205", "XMLSTR", "", "", "false", "", "", "", "", "false", "", "", "", "","","","","","","/root/main/rex_memolist/group");
  1311. } else {
  1312. exeReportPreview("RPMNB00200", "XMLSTR", "", "", "false", "", "", "", "", "false", "", "", "", "","","","","","","/root/main/rex_memolist/group");
  1313. }
  1314. }
  1315. }
  1316. /**
  1317. * @group :
  1318. * @ver : 2011.09.08
  1319. * @by : 김병국
  1320. * @---------------------------------------------------
  1321. * @type : function
  1322. * @access : public
  1323. * @desc : 검사관리 일자별 구분선
  1324. * @param :
  1325. * @param :
  1326. * @return :
  1327. * @---------------------------------------------------
  1328. */
  1329. function fSettingGridColor() {
  1330. var firstdd="";
  1331. var prcpdd ="";
  1332. if(grd_test.rows > grd_test.fixedRows) {
  1333. firstdd = grd_test.valueMatrix(1, grd_test.colRef("prcpdd"));
  1334. }
  1335. for(var i = grd_test.fixedRows; i < grd_test.rows; i++){
  1336. execyn = grd_test.valueMatrix(i, grd_test.colRef("execyn"));
  1337. prcpdd = grd_test.valueMatrix(i, grd_test.colRef("prcpdd"));
  1338. if(firstdd != prcpdd) {
  1339. firstdd = prcpdd;
  1340. //grd_test
  1341. grd_test.rowStyle(i-1, "all", "border-bottom-color") = "#ff0000";
  1342. grd_test.rowStyle(i-1, "all", "border-top-width") = "3";
  1343. } else {
  1344. grd_test.rowStyle(i-1, "all", "border-bottom-color") = "#b0b0b0";
  1345. grd_test.rowStyle(i-1, "all", "border-top-width") = "3";
  1346. }
  1347. if(execyn == "Y") {
  1348. grd_test.rowstyle(i, "data", "background-color") = "#ffffff";
  1349. } else {
  1350. grd_test.rowstyle(i, "data", "background-color") = "#fff000";
  1351. }
  1352. }
  1353. grd_test.refresh();
  1354. }
  1355. /**
  1356. * @group :
  1357. * @ver : 2011.09.19
  1358. * @by : 김병국
  1359. * @---------------------------------------------------
  1360. * @type : function
  1361. * @access : public
  1362. * @desc : IO조회 저장
  1363. * @param :
  1364. * @param :
  1365. * @return :
  1366. * @---------------------------------------------------
  1367. */
  1368. function fSetIoInfo() {
  1369. model.makeValue("/root/send/savedata/pid", grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("pid")) );
  1370. model.makeValue("/root/send/savedata/indd",grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("indd")));
  1371. model.makeValue("/root/send/savedata/cretno",grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("cretno")));
  1372. model.makeValue("/root/send/savedata/ioyn",model.getValue("/root/main/kardexinfo/ioinfo/ioyn"));
  1373. model.makeValue("/root/send/savedata/bstyn",model.getValue("/root/main/kardexinfo/ioinfo/bstyn"));
  1374. model.makeValue("/root/send/savedata/bwyn",model.getValue("/root/main/kardexinfo/ioinfo/bwyn"));
  1375. model.makeValue("/root/send/savedata/acyn",model.getValue("/root/main/kardexinfo/ioinfo/acyn"));
  1376. model.makeValue("/root/send/savedata/iokindcd",model.getValue("/root/main/kardexinfo/ioinfo/iokindcd"));
  1377. model.makeValue("/root/send/savedata/bstkindcd",model.getValue("/root/main/kardexinfo/ioinfo/bstkindcd"));
  1378. submit("TXMNB00212");
  1379. }
  1380. /**
  1381. * @group :
  1382. * @ver : 2012.01.20
  1383. * @by : 김병국
  1384. * @---------------------------------------------------
  1385. * @type : function
  1386. * @access : public
  1387. * @desc : PRN관리 조회
  1388. * @param :
  1389. * @param :
  1390. * @return :
  1391. * @---------------------------------------------------
  1392. */
  1393. function fGetPrcpList() {
  1394. if(prcpstat == "1") {
  1395. prcpstat = "2";
  1396. btn_prn.text = "투약관리";
  1397. cap_prcpstat.text = "PRN관리";
  1398. grd_prcplist.visible= true;
  1399. } else {
  1400. prcpstat = "1";
  1401. btn_prn.text = "PRN관리";
  1402. cap_prcpstat.text = "투약관리";
  1403. grd_prcplist.visible= false;
  1404. }
  1405. if(grd_patlist.row > 0) {
  1406. model.makeValue("/root/send/reqdata/prnstat" , "1");
  1407. model.makeValue("/root/send/reqdata/prcpdd" , model.getValue("/root/main/cond/orddd"));
  1408. model.makeValue("/root/send/reqdata/cnfmyn" , "Y");
  1409. model.makeValue("/root/send/reqdata/unitflag" , "ward");
  1410. model.makeValue("/root/send/reqdata/opprcpcond" , "1");
  1411. model.makeValue("/root/send/reqdata/pid" , grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("pid")));
  1412. model.makeValue("/root/send/reqdata/indd" , grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("indd")));
  1413. model.makeValue("/root/send/reqdata/cretno" , grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("cretno")));
  1414. model.removeNodeset("/root/main/kardexinfo/prcpinfo/prcplist");
  1415. model.makeNode("/root/man/kardexinfo/prcpinfo");
  1416. submit("TRMNW00303");
  1417. }
  1418. }