SMMNE02300.js 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048
  1. /*
  2. 심폐소생술(SMMNE02300.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. xPathCardArrPatInfo = "/root/main/patinfo";
  7. xPathCardArrResusList = "/root/main/resusinfo/resuslist";
  8. /**
  9. * @group :
  10. * @ver : 2007.12.04
  11. * @by : 양천덕
  12. * @---------------------------------------------------
  13. * @type : function
  14. * @access : public
  15. * @desc : 심폐소생술 보고서 초기 설정 부분
  16. * @param :
  17. * @return :
  18. * @---------------------------------------------------
  19. */
  20. function fInit(pFlag){
  21. //상단 환자 정보 가져오기
  22. var node = getGlobalVariable("paminfo");
  23. setCSVToNode("/root/main/paminfo", node);
  24. //현재 시간 세팅
  25. int_cardarrgenrdd.disabled = false;
  26. model.setValue(xPathCardArrPatInfo+"/cardarrgenrdd", getCurrentDate());
  27. model.setValue(xPathCardArrPatInfo+"/cardarrgenrtm", getCurrentTime());
  28. model.removeNode("/root/main/pathistinfo/pathistlist");
  29. var sJobKindCD = getUserInfo("jobkindcd"); // 직급코드
  30. var ssflag = "3";
  31. if(getUserInfo("dutplceinstcd") != '032' && getUserInfo("dutplceinstcd") != '031') { //경북대가 아니면
  32. if( sJobKindCD == "0330" || sJobKindCD == "0310"){
  33. ssflag = "1";
  34. }
  35. if( sJobKindCD == "1110" || sJobKindCD == "1140"){
  36. ssflag = "2";
  37. }
  38. } else if(getUserInfo("dutplceinstcd") == '032' || getUserInfo("dutplceinstcd") == '031') {
  39. //경북대이면 03%로 체크한다.
  40. if( sJobKindCD.substring(0, 2) == "03"){
  41. ssflag = "1";
  42. }
  43. if( sJobKindCD == "1140"){
  44. ssflag = "2";
  45. }
  46. }
  47. //의사, 간호사 직종 분류별 입력 창 제한 구분
  48. if(ssflag=="1"){ //의사
  49. model.setValue("/root/main/patinfo/nursdocflag", "D");
  50. group2.disabled = true ;
  51. } else if (ssflag=="2"){ //간호사
  52. model.setValue("/root/main/patinfo/nursdocflag", "N");
  53. fDateSetting("Init");
  54. } else { //기타
  55. group2.disabled = true ;
  56. chk_fstresusexecflag.disabled = true;
  57. int_fstresusexecetc.disabled = true;
  58. messageBox("심폐소생술보고서 작성 권한이 없습니다.","E");
  59. }
  60. submit("TRMNE02313");
  61. model.setValue("/root/send/wardcd", getUserInfo("dutplcecd") );
  62. submit("TRMNW00101");
  63. int_cardarrdiscvpsnetc.disabled = true;
  64. int_resusteamarvbfresusetc.disabled = true;
  65. int_resusteamfresusetc.disabled = true;
  66. int_resusendresnetc.disabled = true;
  67. cmb_cardarrgenrplcetestroom.disabled = true;
  68. int_cardarrgenrplceetcbigo.disabled = true;
  69. int_fstresusexecetc.disabled = true;
  70. int_cardarrgenrplcehosout.disabled = true;
  71. cmb_cardarrgenrplcehosin.disabled = true;
  72. cmb_cardarrgenrplceward.disabled = true;
  73. rdo_cardarrgenrplcewardflag.disabled = true;
  74. cmb_cardarrgenrplcehoscenter.disabled = true;
  75. int_dethdd.disabled = true;
  76. int_dethtm.disabled = true;
  77. button5.disabled = true;
  78. ipt_freairway1.disabled = true;
  79. ipt_freairway2.disabled = true;
  80. ipt_freairway3.disabled = true;
  81. ipt_freairway4.disabled = true;
  82. ipt_freairway5.disabled = true;
  83. ipt_freairway6.disabled = true;
  84. // 원외의 경우에만 병원 도착전 처치 활성화
  85. chk_hosparvbfresus.disabled = true;
  86. int_hosparvbfresusetc.disabled = true;
  87. bool_hosparvbfresusynflag.disabled = true;
  88. model.refresh();
  89. if(node != ""){
  90. model.setValue("/root/main/patinfo/pid", model.getValue("/root/main/paminfo/list/pid"));
  91. model.setValue("/root/main/patinfo/indd", model.getValue("/root/main/paminfo/list/indd"));
  92. model.setValue("/root/main/patinfo/cretno", model.getValue("/root/main/paminfo/list/cretno"));
  93. model.setValue("/root/main/patinfo/instcd", model.getValue("/root/main/paminfo/list/instcd"));
  94. model.makeValue("/root/main/patinfo/wardcd", model.getValue("/root/main/paminfo/list/wardcd"));
  95. model.makeValue("/root/main/patinfo/roomcd", model.getValue("/root/main/paminfo/list/roomcd"));
  96. model.makeValue("/root/main/patinfo/ordtype", model.getValue("/root/main/paminfo/list/ioflag"));
  97. model.makeValue("/root/main/patinfo/medispclid", model.getValue("/root/main/paminfo/list/medispclid"));
  98. model.makeValue("/root/main/patinfo/atdoctcd", model.getValue("/root/main/paminfo/list/atdoctid"));
  99. model.makeValue("/root/main/patinfo/orddrid", model.getValue("/root/main/paminfo/list/orddrnm"));
  100. model.makeValue("/root/main/patinfo/deptcd", model.getValue("/root/main/paminfo/list/orddeptcd"));
  101. model.makeValue("/root/main/patinfo/orddeptcd", model.getValue("/root/main/paminfo/list/orddeptcd"));
  102. model.makeValue("/root/main/patinfo/age", model.getValue("/root/main/paminfo/list/age"));
  103. model.makeValue("/root/main/patinfo/gender", model.getValue("/root/main/paminfo/list/sex"));
  104. model.makeValue("/root/main/patinfo/patnm", model.getValue("/root/main/paminfo/list/hngnm"));
  105. if(model.getValue("/root/main/paminfo/list/ioflag") == "E") {
  106. model.makeValue("/root/main/patinfo/issdeptcd", model.getValue("/root/main/paminfo/list/erissdeptcd"));
  107. } else {
  108. model.makeValue("/root/main/patinfo/issdeptcd", model.getValue("/root/main/paminfo/list/wardcd"));
  109. }
  110. //주민등록 번호 셋팅
  111. var rrgstno = "";
  112. if(model.getValue("/root/main/paminfo/list/sex") == "M"){
  113. var rrgstno = model.getValue("/root/main/paminfo/list/rrgstno1") + " - " + "1******";
  114. }else if(model.getValue("/root/main/paminfo/list/sex") == "F"){
  115. var rrgstno = model.getValue("/root/main/paminfo/list/rrgstno1") + " - " + "2******";
  116. }else {
  117. var rrgstno = model.getValue("/root/main/paminfo/list/rrgstno1") + " - " + "*******";
  118. }
  119. model.setValue("/root/main/patinfo/rrgstno", rrgstno);
  120. cmb_dept.dispatch("xforms-value-changed");
  121. //환자 정보 조회
  122. fSrchHistList(pFlag);
  123. //환자 정보 세팅
  124. model.setValue("/root/main/patinfo/patnm", model.getValue("/root/main/pathistinfo/patinfo/patnm" ));
  125. model.setValue("/root/main/patinfo/grdrage", model.getValue("/root/main/pathistinfo/patinfo/grdrage" ));
  126. model.setValue("/root/main/patinfo/cntctel", model.getValue("/root/main/pathistinfo/patinfo/cntctel" ));
  127. model.setValue("/root/main/patinfo/addr", model.getValue("/root/main/pathistinfo/patinfo/addr" ));
  128. model.setFocus("ipt_pid");
  129. model.refresh();
  130. }
  131. if( checkOpener() ){
  132. var param_pid = opener.javascript.getParameter("SMMNE04900_pid");
  133. var param_lastupdtdt = opener.javascript.getParameter("SMMNE04900_lastupdtdt");
  134. if(param_pid != ""){
  135. model.setValue("/root/main/patinfo/pid", param_pid);
  136. ipt_pid.refresh();
  137. event.keyCode = "13";
  138. ipt_pid.dispatch("onkeyup");
  139. for(i = 1; i < datagrid2.rows; i++){
  140. if( model.getValue("/root/main/pathistinfo/pathistlist["+i+"]/lastupdtdt") == param_lastupdtdt ){
  141. model.setValue("/root/main/patinfo/selectrow", i);
  142. datagrid2.row = i;
  143. int_cardarrgenrdd.disabled = true;
  144. model.setValue("/root/main/patinfo/indd", model.getValue("/root/main/pathistinfo/pathistlist["+i+"]/indd"));
  145. model.setValue("/root/main/patinfo/cretno", model.getValue("/root/main/pathistinfo/pathistlist["+i+"]/cretno"));
  146. model.setValue("/root/main/patinfo/instcd", model.getValue("/root/main/pathistinfo/pathistlist["+i+"]/instcd"));
  147. model.setValue("/root/main/patinfo/cardarrgenrdd", model.getValue("/root/main/pathistinfo/pathistlist["+i+"]/cardarrgenrdd"));
  148. model.setValue("/root/main/patinfo/cardarrgenrtm", model.getValue("/root/main/pathistinfo/pathistlist["+i+"]/cardarrgenrtm"));
  149. model.setValue("/root/main/patinfo/histno", model.getValue("/root/main/pathistinfo/pathistlist["+i+"]/histno"));
  150. fCardArrResusSrch(1);
  151. fInputBoxInit();
  152. }
  153. }
  154. button4.visible = false; // 저장버튼 숨김.
  155. button10.visible = true;
  156. button11.visible = true;
  157. }
  158. }
  159. }
  160. /**
  161. * @group :
  162. * @ver : 2007.07.07
  163. * @by : 양천덕
  164. * @---------------------------------------------------
  165. * @type : function
  166. * @access : public
  167. * @desc : 대상 환자에 대한 심폐소생술 보고서 내용 저장
  168. * @param :
  169. * @return :
  170. * @---------------------------------------------------
  171. */
  172. function fCardArrResusSave(pFlag, pFlag1, pStatus){
  173. var sRow = datagrid2.row;
  174. model.removeNode("/root/send");
  175. model.makeNode("/root/item/list");
  176. model.copyNode("/root/item/list", "/root/main/resusinfo");
  177. if(model.getValue("/root/main/patinfo/selectrow") == ""){
  178. if(pStatus == "U"){
  179. messageBox("수정할 데이터를 선택하지 않았습니다.","I");
  180. return;
  181. }
  182. if(pStatus == "D"){
  183. messageBox("삭제할 데이터를 선택하지 않았습니다.","I");
  184. return;
  185. }
  186. }
  187. // 저장/수정 제한 조건
  188. if(pFlag1 == "N" && pStatus != "D"){
  189. if( model.getValue(xPathCardArrResusList+"/cardarrgoalyn") == "" ){
  190. messageBox("심정지목격여부 항목이 입력되지 않았습니다.","E");
  191. return;
  192. }
  193. if( model.getValue(xPathCardArrResusList+"/cardarrdiscvpsn") == "" ){
  194. messageBox("심정지발견자 항목이 입력되지 않았습니다.","E");
  195. return;
  196. }
  197. // 병원내, 외 구분별 입력 수정 제한
  198. if(pFlag == 1){
  199. if( model.getValue("/root/main/resusinfo/resuslist/cardarrfinddd") == "" || model.getValue("/root/main/resusinfo/resuslist/cardarrfindtm") == "" ){
  200. messageBox("환자발견시간이 입력되지 않았습니다. 날짜와 시간을 확인해주십시오.","E");
  201. return;
  202. }
  203. if( model.getValue("/root/main/resusinfo/resuslist/cardarrgenrplceflag") == "" ){
  204. messageBox("심정지발생장소 항목이 입력되지 않았습니다.","E");
  205. return;
  206. }
  207. if( model.getValue("hidden/list/resusteamarvbfresus") == "0000000" ){
  208. messageBox("CPR팀 도착전소생술 항목이 입력되지 않았습니다.","E");
  209. return;
  210. }
  211. if( model.getValue("/root/main/resusinfo/resuslist/cardarrestmflag") !="Y" && (model.getValue("/root/main/resusinfo/resuslist/cardarrestmdd") == "" || model.getValue("/root/main/resusinfo/resuslist/cardarrestmtm" ) == "")){
  212. messageBox("심정지 추정시간이 입력되지 않았습니다. 날짜와 시간을 확인해주십시오.","E");
  213. return;
  214. }
  215. if( model.getValue("/root/main/resusinfo/resuslist/cardarrestmflag") =="Y" && (model.getValue("/root/main/resusinfo/resuslist/cardarrestmdd") != "" || model.getValue("/root/main/resusinfo/resuslist/cardarrestmtm" ) != "")){
  216. messageBox("심정지 추정시간을 추청불가로 입력하였습니다! 일시를 지워주십시오!","E");
  217. return;
  218. }
  219. if( model.getValue("/root/main/resusinfo/resuslist/resusteamcallflag") !="Y" && (model.getValue("/root/main/resusinfo/resuslist/resusteamcalldd") == "" || model.getValue("/root/main/resusinfo/resuslist/resusteamcalltm" ) == "")){
  220. messageBox("CPR팀 호출시간이 입력되지 않았습니다. 날짜와 시간을 확인해주십시오.","E");
  221. return;
  222. }
  223. if( model.getValue("/root/main/resusinfo/resuslist/resusteamcallflag") =="Y" && (model.getValue("/root/main/resusinfo/resuslist/resusteamcalldd") != "" || model.getValue("/root/main/resusinfo/resuslist/resusteamcalltm" ) != "")){
  224. messageBox("CPR팀 호출시간을 호출안함으로 입력하였습니다! 일시를 지워주십시오!","E");
  225. return;
  226. }
  227. if( model.getValue("/root/main/resusinfo/resuslist/resusteamcallflag") !="Y" && (model.getValue("/root/main/resusinfo/resuslist/resusteamarvtm") == "" || model.getValue("/root/main/resusinfo/resuslist/resusteamarvtm") == "" )){
  228. messageBox("CPR팀 도착시간이 입력되지 않았습니다.","E");
  229. return;
  230. }
  231. if( model.getValue("/root/main/resusinfo/resuslist/initrhythmcnfmdd" ) == "" || model.getValue("/root/main/resusinfo/resuslist/initrhythmcnfmtm") == "" ){
  232. messageBox("초기리듬 확인시간이 입력되지 않았습니다. 날짜와 시간을 확인해주십시오.","E");
  233. return;
  234. }
  235. if( model.getValue("/root/main/resusinfo/resuslist/resusteamfresusflag") !="Y" && ( model.getValue("/root/main/resusinfo/resuslist/resusfromdd") == "" || model.getValue("/root/main/resusinfo/resuslist/resusfromtm" ) == "" )){
  236. messageBox("CPR팀 소생술 시작시간이 입력되지 않았습니다. 날짜와 시간을 확인해주십시오.","E");
  237. return;
  238. }
  239. if( model.getValue("/root/main/resusinfo/resuslist/defibrflag") !="Y" && ( model.getValue("/root/main/resusinfo/resuslist/defibrstartdd") == "" || model.getValue("/root/main/resusinfo/resuslist/defibrstarttm" ) == "" )){
  240. messageBox("제세동 시작시간이 입력되지 않았습니다. 날짜와 시간을 확인해주십시오.","E");
  241. return;
  242. }
  243. if( model.getValue("/root/main/resusinfo/resuslist/resusteamfresusflag") !="Y" && ( model.getValue("/root/main/resusinfo/resuslist/resustodd") == "" || model.getValue("/root/main/resusinfo/resuslist/resustotm") == "" )){
  244. messageBox("소생술 종료시간이 입력되지 않았습니다. 날짜와 시간을 확인해주십시오.","E");
  245. return;
  246. }
  247. if( model.getValue("hidden/list/resusteamfresus") == "0000000" ){
  248. messageBox("CPR팀 소생술 항목이 입력되지 않았습니다.","E");
  249. return;
  250. }
  251. if( model.getValue("/root/main/resusinfo/resuslist/cardarrrslt") == "01" && (model.getValue("/root/main/resusinfo/resuslist/dschdethdd" ) == "" || model.getValue("/root/main/resusinfo/resuslist/dschdethtm" ) == "" )){
  252. messageBox("사망시간이 입력되지 않았습니다. 날짜와 시간을 확인해주십시오.","E");
  253. return;
  254. }
  255. if( model.getValue("/root/main/resusinfo/resuslist/fstresusstrtdd") == "" || model.getValue("/root/main/resusinfo/resuslist/fstresusstrttm") == ""){
  256. messageBox("처음 소생술 시작시간이 입력되지 않았습니다. 날짜와 시간을 확인해주십시오.","E");
  257. return;
  258. }
  259. // ----------------------------------------------------------------------------------------------------------------------
  260. var cardarrfinddd = model.getValue("/root/main/resusinfo/resuslist/cardarrfinddd"); //환자발견시간(일자)
  261. var cardarrfindtm = model.getValue("/root/main/resusinfo/resuslist/cardarrfindtm"); //환자발견시간(시간)
  262. var cardarrgenrdd = model.getValue("/root/main/patinfo/cardarrgenrdd"); // 소생술 시행일자
  263. var cardarrestmdd = model.getValue("/root/main/resusinfo/resuslist/cardarrestmdd"); // 심정지 추정시간
  264. var resusteamcalldd = model.getValue("/root/main/resusinfo/resuslist/resusteamcalldd" ); // CPR팀 호출시간
  265. var resusteamarvdd = model.getValue("/root/main/resusinfo/resuslist/resusteamarvdd" ); // CPR팀 도착시간
  266. var initrhythmcnfmdd = model.getValue("/root/main/resusinfo/resuslist/initrhythmcnfmdd" ); // 초기리듬확인시간
  267. var resusfromdd = model.getValue("/root/main/resusinfo/resuslist/resusfromdd" ); // 소생술 시작시간
  268. var defibrstartdd = model.getValue("/root/main/resusinfo/resuslist/defibrstartdd" ); // 제세동 시작시간
  269. var resustodd = model.getValue("/root/main/resusinfo/resuslist/resustodd" ); // 소생술 종료시간
  270. var dschdethdd = model.getValue("/root/main/resusinfo/resuslist/dschdethdd" ); // 사망일시
  271. var defibrflag = model.getValue("/root/main/resusinfo/resuslist/defibrflag"); //제세동 시작시간 시행안함 항목 (Y/N)
  272. var fstresusstrtdd = model.getValue("/root/main/resusinfo/resuslist/fstresusstrtdd"); //처음 소생술 시작시간 날짜
  273. var fstresusstrttm = model.getValue("/root/main/resusinfo/resuslist/fstresusstrttm"); //처음 소생술 시작시간
  274. var fromdd = cardarrgenrdd.toDate().getAddDate(-1,"D").getDateFormat();
  275. var todd = cardarrgenrdd.toDate().getAddDate(1,"D").getDateFormat();
  276. var resusteamcallflag = model.getValue("/root/main/resusinfo/resuslist/resusteamcallflag");
  277. if( resusteamcalldt != "" ){
  278. if( (cardarrgenrdd != resusteamcalldd && resusteamcallflag =="N") && todd != resusteamcalldd){
  279. messageBox("CPR팀 호출시간은 소생술 시행일자와 같아야 합니다.","E"); return;
  280. }
  281. }
  282. if( resusteamarvdt != "" ){
  283. if( cardarrgenrdd != resusteamarvdd && todd != resusteamarvdd ){
  284. messageBox("CPR팀 도착시간은 소생술 시행일자와 같아야 합니다.","E"); return;
  285. }
  286. }
  287. if( initrhythmcnfmdt != "" ){
  288. if( cardarrgenrdd != initrhythmcnfmdd && todd != initrhythmcnfmdd ){
  289. messageBox("초기리듬확인시간은 소생술 시행일자와 같아야 합니다.","E"); return;
  290. }
  291. }
  292. if( resusfromdt != "" ){
  293. if( cardarrgenrdd != resusfromdd && todd != resusfromdd ){
  294. messageBox("소생술 시작시간은 소생술 시행일자와 같아야 합니다.","E"); return;
  295. }
  296. }
  297. if( defibrstartdt != "" ){
  298. if( (cardarrgenrdd != defibrstartdd && defibrflag == "N") && todd != defibrstartdd) {
  299. messageBox("제세동 시작시간은 소생술 시행일자와 같아야 합니다.","E"); return;
  300. }
  301. }
  302. if( resustodt != "" ){
  303. if( cardarrgenrdd != resustodd && todd != resustodd ){
  304. messageBox("소생술 종료시간은 소생술 시행일자와 같거나 커야 합니다.","E"); return;
  305. }
  306. }
  307. // --심정지 추정시간은 모든시간보다 같거나 빨라야함---------------------------------------------------------------------------------
  308. if( model.getValue("/root/main/resusinfo/resuslist/cardarrestmflag" ) != "Y"){
  309. var defibrstartdt = defibrstartdd + model.getValue("/root/main/resusinfo/resuslist/defibrstarttm" ); // 제세동 시작시간
  310. var resustodt = resustodd + model.getValue("/root/main/resusinfo/resuslist/resustotm" ); // 소생술 종료시간
  311. var dschdethdt = dschdethdd + model.getValue("/root/main/resusinfo/resuslist/dschdethtm" ); // 사망일시
  312. var cardarrfinddt = cardarrfinddd + cardarrfindtm; // 환자발견시간
  313. var cardarrestmdt = cardarrestmdd + model.getValue("/root/main/resusinfo/resuslist/cardarrestmtm" ); // 심정지 추정일자
  314. var resusteamcalldt = resusteamcalldd + model.getValue("/root/main/resusinfo/resuslist/resusteamcalltm" ); // CPR팀 호출일자
  315. var fstresusstrtdt = fstresusstrtdd + fstresusstrttm; // 처음소생술시작일자
  316. var initrhythmcnfmdt = initrhythmcnfmdd + model.getValue("/root/main/resusinfo/resuslist/initrhythmcnfmtm" ); // 초기리듬확인일자
  317. var resusteamarvdt = resusteamarvdd + model.getValue("/root/main/resusinfo/resuslist/resusteamarvtm" ); // CPR팀 도착시간
  318. var resusfromdt = resusfromdd + model.getValue("/root/main/resusinfo/resuslist/resusfromtm" ); // CPR팀 소생술 시작시간
  319. var defibrstartdt = defibrstartdd + model.getValue("/root/main/resusinfo/resuslist/defibrstarttm" ); // 제세동 시작시간
  320. var resustodt = resustodd + model.getValue("/root/main/resusinfo/resuslist/resustotm" ); // 소생술 종료시간
  321. if( cardarrfinddt != "" && cardarrestmdt > cardarrfinddt ){
  322. messageBox("환자발견시간은 심정지 추정시간과 같거나 커야 합니다.","E"); return;
  323. }
  324. if( resusteamcalldt != "" && cardarrestmdt > resusteamcalldt ){
  325. messageBox("CPR팀 호출시간은 심정지 추정시간과 같거나 커야 합니다.","E"); return;
  326. }
  327. if( fstresusstrtdt != "" && cardarrestmdt > fstresusstrtdt ){
  328. messageBox("처음 소생술 시작시간은 심정지 추정시간과 같거나 커야 합니다.","E"); return;
  329. }
  330. if( initrhythmcnfmdt != "" && cardarrestmdt > initrhythmcnfmdt ){
  331. messageBox("초기리듬확인시간은 심정지 추정시간과 같거나 커야 합니다.","E"); return;
  332. }
  333. if( resusteamarvdt != "" && cardarrestmdt > resusteamarvdt ){
  334. messageBox("CPR팀 도착시간은 심정지 추정시간과 같거나 커야 합니다.","E"); return;
  335. }
  336. if( resusfromdt != "" && cardarrestmdt > resusfromdt ){
  337. messageBox("CPR팀 소생술 시작시간은 심정지 추정시간과 같거나 커야 합니다.","E"); return;
  338. }
  339. if( defibrstartdt != "" && cardarrestmdt > defibrstartdt ){
  340. messageBox("제세동 시작시간은 심정지 추정시간과 같거나 커야 합니다.","E"); return;
  341. }
  342. if( resustodt != "" && cardarrestmdt > resustodt ){
  343. messageBox("소생술 종료시간은 심정지 추정시간과 같거나 커야 합니다.","E"); return;
  344. }
  345. if( model.getValue("/root/main/resusinfo/resuslist/cardarrrslt") == "01" ){
  346. if( dschdethdt != "" ){
  347. if( cardarrestmdt > dschdethdt ){ messageBox("사망일시는 심정지 추정시간보다 이후 시간이여야 합니다.","E"); return; }
  348. }
  349. }
  350. }
  351. }
  352. }
  353. var sDocHeader = "hosinhosoutflag▦pid▦indd▦cretno▦histno▦cardarrgenrdt▦instcd";
  354. // 키값 설정부분
  355. var sCondData = pFlag +"▦"
  356. + model.getValue(xPathCardArrPatInfo+"/pid" )+"▦"
  357. + model.getValue(xPathCardArrPatInfo+"/indd" )+"▦"
  358. + model.getValue(xPathCardArrPatInfo+"/cretno")+"▦"
  359. + model.getValue(xPathCardArrPatInfo+"/histno")+"▦"
  360. +(model.getValue(xPathCardArrPatInfo+"/cardarrgenrdd") + model.getValue(xPathCardArrPatInfo+"/cardarrgenrtm"))+"▦"
  361. + model.getValue(xPathCardArrPatInfo+"/instcd");
  362. model.makeValue("/root/send/cond", sDocHeader+"▩"+sCondData+"▩" );
  363. // if(pFlag1 == "D"){
  364. // 심폐소생술보고서 주치의 입력
  365. sDocHeader += "▦"
  366. + "status▦"
  367. + "cardarrcas▦"
  368. + "initrhythm▦"
  369. + "resusendresn▦"
  370. + "resusendresnetc▦"
  371. + "cardarrrslt▦"
  372. + "cardarrrsltetc▦"
  373. + "dschdethdd▦"
  374. + "dschdethtm▦"
  375. + "fstrgstid▦"
  376. + "fstrgstdt▦"
  377. + "memo▦"
  378. + "dschneurologystat";
  379. // + "dschneurologystat▩";
  380. sCondData += "▦"
  381. + pStatus + "▦"
  382. + model.getValue(xPathCardArrResusList + "/cardarrcas") +"▦"
  383. + model.getValue(xPathCardArrResusList + "/initrhythm") +"▦"
  384. + model.getValue(xPathCardArrResusList + "/resusendresn") +"▦"
  385. + model.getValue(xPathCardArrResusList + "/resusendresnetc") +"▦"
  386. + model.getValue(xPathCardArrResusList + "/cardarrrslt") +"▦"
  387. + model.getValue(xPathCardArrResusList + "/cardarrrsltetc") +"▦"
  388. + model.getValue(xPathCardArrResusList + "/dschdethdd") +"▦"
  389. + model.getValue(xPathCardArrResusList + "/dschdethtm") +"▦"
  390. + model.getValue(xPathCardArrResusList + "/fstrgstid") +"▦"
  391. + model.getValue(xPathCardArrResusList + "/fstrgstdt") +"▦"
  392. + model.getValue(xPathCardArrResusList + "/memo") +"▦"
  393. + model.getValue(xPathCardArrResusList + "/dschneurologystat") ;
  394. // + model.getValue(xPathCardArrResusList + "/dschneurologystat") +"▩";
  395. // model.makeValue("/root/send/docrec", sDocHeader+sCondData );
  396. // }
  397. // if(pFlag1 == "N"){
  398. // 심폐소생술보고서 간호사 입력
  399. sDocHeader += "▦"
  400. + "status▦"
  401. + "cardarrgoalyn▦"
  402. + "cardarrdiscvpsn▦"
  403. + "cardarrdiscvpsnetc▦"
  404. + "cardarrgenrplceflag▦"
  405. + "cardarrgenrplcedept▦"
  406. + "cardarrgenrplceetc▦"
  407. + "resusteamarvbfresus▦"
  408. + "resusteamarvbfresusetc▦"
  409. + "resusteamfresus▦"
  410. + "resusteamfresusetc▦"
  411. + "resusteamfresusflag▦"
  412. + "ambulancearvbfresus▦"
  413. + "ambulancearvbfresusetc▦"
  414. + "ambulanceresus▦"
  415. + "ambulanceresusetc▦"
  416. + "ercentresus▦"
  417. + "ercentresusetc▦"
  418. + "cardarrestmdd▦"
  419. + "cardarrestmtm▦"
  420. + "cardarrestmflag▦"
  421. + "resusteamcalldd▦"
  422. + "resusteamcalltm▦"
  423. + "resusteamcallflag▦"
  424. + "resusteamarvdd▦"
  425. + "resusteamarvtm▦"
  426. + "initrhythmcnfmdd▦"
  427. + "initrhythmcnfmtm▦"
  428. + "resusfromdd▦"
  429. + "resusfromtm▦"
  430. + "resustodd▦"
  431. + "resustotm▦"
  432. + "gender▦"
  433. + "age▦"
  434. + "wardcd▦"
  435. + "atdoctcd▦"
  436. + "medispclid▦"
  437. + "orddeptcd▦"
  438. + "cardarrfinddd▦"
  439. + "cardarrfindtm▦"
  440. + "hosparvbfresus▦"
  441. + "hosparvbfresusetc▦"
  442. + "hosparvbfresusynflag▦"
  443. + "bluebirdalarmyn▦"
  444. + "cardarrgenrplceward▦"
  445. + "cardarrgenrplcewardflag▦"
  446. + "cardarrgenrplcehosin▦"
  447. + "cardarrgenrplcehoscenter▦"
  448. + "cardarrgenrplcetestroom▦"
  449. + "cardarrgenrplcehosout▦"
  450. + "cardarrgenrplceetcbigo▦"
  451. + "fstresusexecflag▦"
  452. + "fstresusexecetc▦"
  453. + "fstresusstrtdd▦"
  454. + "fstresusstrttm▦"
  455. + "initpatcscs▦"
  456. + "initpatbreth▦"
  457. + "initpatpulse▦"
  458. + "defibrflag▦"
  459. + "defibrstartdd▦"
  460. + "defibrstarttm▦"
  461. + "defibrjul2▦"
  462. + "defibrtims2▦"
  463. + "defibrjul▦"
  464. + "defibrtims▦"
  465. + "freeairway1▦"
  466. + "freeairway2▦"
  467. + "freeairway3▦"
  468. + "freeairway4▦"
  469. + "freeairway5▦"
  470. + "freeairway6▦"
  471. + "memo▩";
  472. if(pFlag == "1"){
  473. sCondData += "▦"
  474. + pStatus + "▦"
  475. + model.getValue(xPathCardArrResusList+"/cardarrgoalyn") +"▦"
  476. + model.getValue(xPathCardArrResusList+"/cardarrdiscvpsn") +"▦"
  477. + model.getValue(xPathCardArrResusList+"/cardarrdiscvpsnetc") +"▦"
  478. + model.getValue(xPathCardArrResusList+"/cardarrgenrplceflag") +"▦"
  479. + model.getValue(xPathCardArrResusList+"/cardarrgenrplcedept") +"▦"
  480. + "▦"
  481. + model.getValue("hidden/list/resusteamarvbfresus") +"▦"
  482. + model.getValue(xPathCardArrResusList+"/resusteamarvbfresusetc") +"▦"
  483. + model.getValue("hidden/list/resusteamfresus") +"▦"
  484. + model.getValue(xPathCardArrResusList+"/resusteamfresusetc") +"▦"
  485. + model.getValue(xPathCardArrResusList+"/resusteamfresusflag") +"▦"
  486. + "▦"
  487. + "▦"
  488. + "▦"
  489. + "▦"
  490. + "▦"
  491. + "▦"
  492. + model.getValue(xPathCardArrResusList+"/cardarrestmdd") +"▦"
  493. + model.getValue(xPathCardArrResusList+"/cardarrestmtm") +"▦"
  494. + model.getValue(xPathCardArrResusList+"/cardarrestmflag") +"▦"
  495. + model.getValue(xPathCardArrResusList+"/resusteamcalldd") +"▦"
  496. + model.getValue(xPathCardArrResusList+"/resusteamcalltm") +"▦"
  497. + model.getValue(xPathCardArrResusList+"/resusteamcallflag") +"▦"
  498. + model.getValue(xPathCardArrResusList+"/resusteamarvdd") +"▦"
  499. + model.getValue(xPathCardArrResusList+"/resusteamarvtm") +"▦"
  500. + model.getValue(xPathCardArrResusList+"/initrhythmcnfmdd") +"▦"
  501. + model.getValue(xPathCardArrResusList+"/initrhythmcnfmtm") +"▦"
  502. + model.getValue(xPathCardArrResusList+"/resusfromdd") +"▦"
  503. + model.getValue(xPathCardArrResusList+"/resusfromtm") +"▦"
  504. + model.getValue(xPathCardArrResusList+"/resustodd") +"▦"
  505. + model.getValue(xPathCardArrResusList+"/resustotm") +"▦"
  506. + model.getValue("/root/main/patinfo/gender") +"▦"
  507. + model.getValue("/root/main/patinfo/age") +"▦"
  508. + model.getValue("/root/main/patinfo/wardcd") +"▦"
  509. + model.getValue("/root/main/patinfo/atdoctcd") +"▦"
  510. + model.getValue("/root/main/patinfo/medispclid") +"▦"
  511. + model.getValue("/root/main/patinfo/orddeptcd") +"▦"
  512. + model.getValue(xPathCardArrResusList+"/cardarrfinddd") +"▦"
  513. + model.getValue(xPathCardArrResusList+"/cardarrfindtm") +"▦"
  514. + model.getValue(xPathCardArrResusList+"/hosparvbfresus") +"▦"
  515. + model.getValue(xPathCardArrResusList+"/hosparvbfresusetc") +"▦"
  516. + model.getValue(xPathCardArrResusList+"/hosparvbfresusynflag") +"▦"
  517. + model.getValue(xPathCardArrResusList+"/bluebirdalarmyn") +"▦"
  518. + model.getValue(xPathCardArrResusList+"/cardarrgenrplceward") +"▦"
  519. + model.getValue(xPathCardArrResusList+"/cardarrgenrplcewardflag") +"▦"
  520. + model.getValue(xPathCardArrResusList+"/cardarrgenrplcehosin") +"▦"
  521. + model.getValue(xPathCardArrResusList+"/cardarrgenrplcehoscenter") +"▦"
  522. + model.getValue(xPathCardArrResusList+"/cardarrgenrplcetestroom") +"▦"
  523. + model.getValue(xPathCardArrResusList+"/cardarrgenrplcehosout") +"▦"
  524. + model.getValue(xPathCardArrResusList+"/cardarrgenrplceetcbigo") +"▦"
  525. + model.getValue(xPathCardArrResusList+"/fstresusexecflag") +"▦"
  526. + model.getValue(xPathCardArrResusList+"/fstresusexecetc") +"▦"
  527. + model.getValue(xPathCardArrResusList+"/fstresusstrtdd") +"▦"
  528. + model.getValue(xPathCardArrResusList+"/fstresusstrttm") +"▦"
  529. + model.getValue(xPathCardArrResusList+"/initpatcscs") +"▦"
  530. + model.getValue(xPathCardArrResusList+"/initpatbreth") +"▦"
  531. + model.getValue(xPathCardArrResusList+"/initpatpulse") +"▦"
  532. + model.getValue(xPathCardArrResusList+"/defibrflag") +"▦"
  533. + model.getValue(xPathCardArrResusList+"/defibrstartdd") +"▦"
  534. + model.getValue(xPathCardArrResusList+"/defibrstarttm") +"▦"
  535. + model.getValue(xPathCardArrResusList+"/defibrjul2") +"▦"
  536. + model.getValue(xPathCardArrResusList+"/defibrtims2") +"▦"
  537. + model.getValue(xPathCardArrResusList+"/defibrjul") +"▦"
  538. + model.getValue(xPathCardArrResusList+"/defibrtims") +"▦"
  539. + model.getValue(xPathCardArrResusList+"/freeairway1") +"▦"
  540. + model.getValue(xPathCardArrResusList+"/freeairway2") +"▦"
  541. + model.getValue(xPathCardArrResusList+"/freeairway3") +"▦"
  542. + model.getValue(xPathCardArrResusList+"/freeairway4") +"▦"
  543. + model.getValue(xPathCardArrResusList+"/freeairway5") +"▦"
  544. + model.getValue(xPathCardArrResusList+"/freeairway6") +"▦"
  545. + model.getValue(xPathCardArrResusList+"/memo") +"▩";
  546. }
  547. model.makeValue("/root/send/recdata", sDocHeader+sCondData );
  548. if(submit("TXMNE02301") == true){
  549. // TextStmtInfo = "";
  550. // //20111208_KNUH_Start 간호일지 내역 부분 수정.
  551. // //Type2 저장 부분
  552. //
  553. // TextStmtInfo = "심폐소생술 보고서"
  554. // if(model.getValue(xPathCardArrResusList+"/cardarrestmflag") != "N"){
  555. // TextStmtInfo +="\n심정지 추정시간 : "+int_cardarrestmdd.label +" "+int_cardarrestmtm.label ;
  556. // }else{
  557. // TextStmtInfo +="\n심정지 추정시간 : 추정불가";
  558. // }
  559. //
  560. // TextStmtInfo += "\n초기환자상태";
  561. // if(rdo_initpatcscs.label != ""){
  562. // TextStmtInfo += "\n의 식 : " + rdo_initpatcscs.label;
  563. // }
  564. // if(rdo_initpatbreth.value != ""){
  565. // TextStmtInfo += ", 호 흡 : " + rdo_initpatbreth.value;
  566. // }
  567. // if(rdo_initpatpulse.value != ""){
  568. // TextStmtInfo += ", 맥 박 : " + rdo_initpatpulse.value;
  569. // }
  570. //
  571. //
  572. // if(model.getValue(xPathCardArrResusList+"/cardarrestmflag") != "N"){
  573. // TextStmtInfo += "\nCPR팀 호출시간"+ int_resusteamcalldd.label +" "+ int_resusteamcalltm.label;
  574. // }else{
  575. // TextStmtInfo += "\nCPR팀 호출시간 : 호출안함";
  576. // }
  577. //
  578. // TextStmtInfo += "\n처음 소생술 시작시간 : " + int_fstresusstrtdd.value+" "+ int_fstresusstrttm.value
  579. // + "\n초기리듬 확인시간 : " + int_initrhythmcnfmdd.value+" "+ int_initrhythmcnfmtm.value
  580. // + "\nCPR팀 도착시간 : " + int_resusteamarvdd.value+" "+ int_resusteamarvtm.value
  581. // + "\nCPR팀 소생술 시작시간 : " + int_resusfromdd.value+" "+ int_resusfromtm.value;
  582. //
  583. // if(model.getValue(xPathCardArrResusList+"/defibrflag") != "N"){
  584. // TextStmtInfo += "\n제세동 시작시간 : " + int_defibrstartdd.value+" "+int_defibrstarttm.value+" "
  585. // +ipt_defibrjul.value+"J "+ipt_defibrtims.value+"회 "
  586. // +ipt_defibrjul2.value+"J "+ipt_defibrtims2.value+"회";
  587. // }else{
  588. // TextStmtInfo += "\n제세동 시작시간 : 시행안함";
  589. // }
  590. //
  591. // TextStmtInfo += "\n소생술 종료시간 : " + rdo_initpatpulse.value+" "+ int_resustotm.value;
  592. //
  593. // if(model.getValue(xPathCardArrResusList+"/resusteamfresusflag") != "N"){
  594. // TextStmtInfo += "\nCPR팀 소생술 : ";
  595. // for(var i=0; i<7; i++){
  596. // if( chk_resusteamfresus.item(i).selected == true){
  597. // if( i == "0" ){
  598. // TextStmtInfo += "흉부압박";
  599. // }else if( i == "1"){
  600. // TextStmtInfo += "호흡보조";
  601. // }else if( i == "2"){
  602. // TextStmtInfo += "제세동";
  603. // }else if( i == "3"){
  604. // TextStmtInfo += "전문기도확보 : ("+ipt_freairway5.value+"Fr "+ipt_freairway6.value+"Cm 고정 )";
  605. // }else if( i == "4"){
  606. // TextStmtInfo += "정맥로확보";
  607. // }else if( i == "5"){
  608. // TextStmtInfo += "약물투여";
  609. // }else if( i == "6"){
  610. // TextStmtInfo += "기타 : "+int_resusteamfresusetc.value;
  611. // }
  612. // }
  613. // }
  614. // }else{
  615. // TextStmtInfo += "\nCPR팀 소생술 : 시도안함";
  616. // }
  617. //
  618. // TextStmtInfo += "\n소생술 종료사유 : " + rdo_initpatpulse.value+" "+ int_resusendresnetc.value
  619. // + "\n소생술 결과 : " + rdo_initpatpulse.value
  620. // + "\n사망일시 : " + rdo_initpatpulse.value+" "+ int_dethtm.value
  621. // + "\nText 입력 : " + model.getValue("/root/main/resusinfo/resuslist/memo");
  622. //
  623. // var pid = model.getValue(xPathCardArrPatInfo+"/pid");
  624. // var indd = model.getValue(xPathCardArrPatInfo+"/indd");
  625. // var cretno = model.getValue(xPathCardArrPatInfo+"/cretno");
  626. // var instcd = model.getValue(xPathCardArrPatInfo+"/instcd");
  627. //
  628. // alert("1");
  629. // setParameter("SMMNR03400_ParamBase", "recflag▦dutplaccd▦reclnkkey▩E▦010▦"+ pid + "," + indd + "," + cretno + "," + instcd+"▩");
  630. // setParameter("SMMNR03400_ParamSaveText", "S▦A▦"+getCurrentDate()+getCurrentTime()+"▦"+TextStmtInfo+"▩");
  631. // modal("SMMNR03400");
  632. //
  633. //
  634. model.copynode("/root/main/resusinfo","/root/resusbase");
  635. fSrchHistList(pFlag);
  636. fActionStatus(pFlag, pStatus, sRow);
  637. //
  638. // }
  639. model.removeNodeset("/root/item");
  640. model.refresh();
  641. }
  642. }
  643. /**
  644. * @group :
  645. * @ver : 2007.07.07
  646. * @by : 양천덕
  647. * @---------------------------------------------------
  648. * @type : function
  649. * @access : public
  650. * @desc : 저장, 수정, 삭제 구분에 따른 Action 설정
  651. * @param :
  652. * @return :
  653. * @---------------------------------------------------
  654. */
  655. function fActionStatus(pFlag, pStatus, row){
  656. if(pStatus == "I"){
  657. datagrid2.row = getNodesetCount("/root/main/pathistinfo/pathistlist");
  658. fSelectHistData(pFlag);
  659. }else if(pStatus == "U"){
  660. datagrid2.row = row;
  661. fSelectHistData(pFlag);
  662. }else if(pStatus == "D"){
  663. model.setValue("/root/main/patinfo/selectrow", "");
  664. int_cardarrgenrdd.disabled = false;
  665. model.setValue(xPathCardArrPatInfo+"/cardarrgenrdd", getCurrentDate());
  666. model.setValue(xPathCardArrPatInfo+"/cardarrgenrtm", getCurrentTime());
  667. int_cardarrgenrdd.refresh();
  668. }
  669. }
  670. /**
  671. * @group :
  672. * @ver : 2007.07.07
  673. * @by : 양천덕
  674. * @---------------------------------------------------
  675. * @type : function
  676. * @access : public
  677. * @desc : 이력 데이터 선택 조회 부분
  678. * @param :
  679. * @return :
  680. * @---------------------------------------------------
  681. */
  682. function fSelectHistData(pFlag){
  683. model.setValue("/root/main/patinfo/indd", model.getValue("/root/main/pathistinfo/pathistlist["+datagrid2.row+"]/indd"));
  684. model.setValue("/root/main/patinfo/cretno", model.getValue("/root/main/pathistinfo/pathistlist["+datagrid2.row+"]/cretno"));
  685. model.setValue("/root/main/patinfo/instcd", model.getValue("/root/main/pathistinfo/pathistlist["+datagrid2.row+"]/instcd"));
  686. model.setValue("/root/main/patinfo/cardarrgenrdd", model.getValue("/root/main/pathistinfo/pathistlist["+datagrid2.row+"]/cardarrgenrdd"));
  687. model.setValue("/root/main/patinfo/cardarrgenrtm", model.getValue("/root/main/pathistinfo/pathistlist["+datagrid2.row+"]/cardarrgenrtm"));
  688. model.setValue("/root/main/patinfo/histno", model.getValue("/root/main/pathistinfo/pathistlist["+datagrid2.row+"]/histno"));
  689. fCardArrResusSrch(pFlag);
  690. fInputBoxInit();
  691. }
  692. /**
  693. * @group :
  694. * @ver : 2007.07.07
  695. * @by : 양천덕
  696. * @---------------------------------------------------
  697. * @type : function
  698. * @access : public
  699. * @desc : 환자 이력 조회
  700. * @param :
  701. * @return :
  702. * @---------------------------------------------------
  703. */
  704. function fSrchHistList(pFlag){
  705. var sDocHeader = "hosinhosoutflag▦srchdate▦pid▩"
  706. var sCondData = pFlag +"▦"
  707. + model.getValue(xPathCardArrPatInfo+"/cardarrgenrdd") +"▦"
  708. + model.getValue(xPathCardArrPatInfo+"/pid" )+"▩" ;
  709. model.removeNodeset("/root/send");
  710. model.makeValue("/root/send/cond", sDocHeader+sCondData );
  711. //model.copyNode("/root/send/patcond", "root/send/cond") ;
  712. if( submit("TRMNE02301") == true ){
  713. // if(model.getValue("/root/main/patinfo/nursdocflag") == "N"){
  714. // fDateSetting();
  715. // }
  716. }
  717. }
  718. /**
  719. * @group :
  720. * @ver : 2007.07.07
  721. * @by : 양천덕
  722. * @---------------------------------------------------
  723. * @type : function
  724. * @access : public
  725. * @desc : 심폐소생술이력 조회 부분
  726. * @param :
  727. * @return :
  728. * @---------------------------------------------------
  729. */
  730. function fCardArrResusSrch(pFlag){
  731. model.removeNode("/root/send");
  732. var sDocHeader = "hosinhosoutflag▦pid▦indd▦cretno▦cardarrgenrdt▦histno▦instcd";
  733. // 키값 설정부분
  734. var sCondData = pFlag +"▦"
  735. + model.getValue(xPathCardArrPatInfo+"/pid" )+"▦"
  736. + model.getValue(xPathCardArrPatInfo+"/indd" )+"▦"
  737. + model.getValue(xPathCardArrPatInfo+"/cretno")+"▦"
  738. +(model.getValue(xPathCardArrPatInfo+"/cardarrgenrdd") + model.getValue(xPathCardArrPatInfo+"/cardarrgenrtm"))+"▦"
  739. + model.getValue(xPathCardArrPatInfo+"/histno")+"▦"
  740. + model.getValue(xPathCardArrPatInfo+"/instcd");
  741. model.makeValue("/root/send/cond", sDocHeader+"▩"+sCondData+"▩" );
  742. if(submit("TXMNE02301")){
  743. //대상자 정보
  744. if(model.getValue("/root/main/resusinfo/resuslist/gender" ) != "")
  745. model.setValue("/root/main/patinfo/gender" , model.getValue("/root/main/resusinfo/resuslist/gender" ));
  746. if(model.getValue("/root/main/resusinfo/resuslist/age" ) != "")
  747. model.setValue("/root/main/patinfo/age" , model.getValue("/root/main/resusinfo/resuslist/age" ));
  748. if(model.getValue("/root/main/resusinfo/resuslist/wardcd" ) != "")
  749. model.setValue("/root/main/patinfo/wardcd" , model.getValue("/root/main/resusinfo/resuslist/wardcd" ));
  750. if(model.getValue("/root/main/resusinfo/resuslist/orddeptcd" ) != ""){
  751. model.setValue("/root/main/patinfo/orddeptcd" , model.getValue("/root/main/resusinfo/resuslist/orddeptcd" ));
  752. }
  753. if(model.getValue("/root/main/resusinfo/resuslist/atdoctcd" ) != "")
  754. model.setValue("/root/main/patinfo/atdoctcd" , model.getValue("/root/main/resusinfo/resuslist/atdoctcd" ));
  755. if(model.getValue("/root/main/resusinfo/resuslist/medispclid" ) != "")
  756. model.setValue("/root/main/patinfo/medispclid" , model.getValue("/root/main/resusinfo/resuslist/medispclid" ));
  757. }
  758. }
  759. /**
  760. * @group :
  761. * @ver : 2007.07.07
  762. * @by : 양천덕
  763. * @---------------------------------------------------
  764. * @type : function
  765. * @access : public
  766. * @desc : 입력창 초기화 부분
  767. * @param :
  768. * @return :
  769. * @---------------------------------------------------
  770. */
  771. function fInputBoxInit(){
  772. //간호사 입력창 초기화
  773. if(model.getValue("/root/main/patinfo/nursdocflag") == "N"){
  774. if(model.getValue("/root/main/resusinfo/resuslist/cardarrdiscvpsnetc") == ""){
  775. int_cardarrdiscvpsnetc.disabled = true;
  776. }else{
  777. int_cardarrdiscvpsnetc.disabled = false;
  778. }
  779. }
  780. cmb_dept.dispatch("xforms-value-changed");
  781. //최초 발견자
  782. rdo_cardarrdiscvpsn.dispatch("xforms-value-changed");
  783. //최초 소생술 시행자
  784. chk_fstresusexecflag.dispatch("xforms-value-changed");
  785. //심정지 발생장소
  786. rdo_cardarrgenrplceflag.dispatch("xforms-value-changed");
  787. //병원도착전 처치
  788. var hosparvbfresus = model.getValue("/root/main/resusinfo/resuslist/hosparvbfresus");
  789. if( hosparvbfresus != "" ){
  790. chk_hosparvbfresus.dispatch("xforms-select");
  791. chk_hosparvbfresus.disabled = false;
  792. bool_hosparvbfresusynflag.disabled = false;
  793. }else{
  794. chk_hosparvbfresus.disabled = true;
  795. bool_hosparvbfresusynflag.disabled = true;
  796. }
  797. //CPR팀 도착전소생술
  798. var resusteamarvbfresus = model.getValue("/root/main/resusinfo/resuslist/resusteamarvbfresus");
  799. if( resusteamarvbfresus != "" ){
  800. chk_resusteamarvbfresus.dispatch("xforms-select");
  801. chk_resusteamarvbfresus.disabled = false;
  802. }else{
  803. chk_resusteamarvbfresus.disabled = true;
  804. }
  805. //심정지 추정시간-추정불가
  806. bool_cardarrestmflag.dispatch("xforms-value-changed");
  807. //제세동시작시간
  808. bool_defibrflag.dispatch("xforms-value-changed");
  809. //CPR팀 소생술
  810. var resusteamfresus = model.getValue("/root/main/resusinfo/resuslist/resusteamfresus");
  811. if( resusteamfresus != "" ){
  812. chk_resusteamfresus.dispatch("xforms-select");
  813. chk_resusteamfresus.disabled = false;
  814. }else{
  815. chk_resusteamfresus.disabled = true;
  816. }
  817. //CPR팀 소생술-시도안함
  818. bool_resusteamfresusflag.dispatch("xforms-value-changed");
  819. //소생술종료사유
  820. rdo_resusendresn.dispatch("xforms-value-changed");
  821. //소생술결과
  822. rdo_cardarrrslt.dispatch("xforms-value-changed");
  823. //CPR팀 호출시간-호출안함
  824. bool_resusteamcallflag.dispatch("xforms-value-changed");
  825. model.refresh();
  826. }
  827. /**
  828. * @group :
  829. * @ver : 2007.07.07
  830. * @by : 양천덕
  831. * @---------------------------------------------------
  832. * @type : function
  833. * @access : public
  834. * @desc : 날짜 세팅 부분
  835. * @param :
  836. * @return :
  837. * @---------------------------------------------------
  838. */
  839. function fDateSetting(pFlag){
  840. if(pFlag == "Init"){
  841. model.setValue("/root/main/resusinfo/resuslist/cardarrestmdd", getCurrentDate());
  842. model.setValue("/root/main/resusinfo/resuslist/resusteamcalldd", getCurrentDate());
  843. model.setValue("/root/main/resusinfo/resuslist/resusteamarvdd", getCurrentDate());
  844. model.setValue("/root/main/resusinfo/resuslist/initrhythmcnfmdd", getCurrentDate());
  845. model.setValue("/root/main/resusinfo/resuslist/resusfromdd", getCurrentDate());
  846. model.setValue("/root/main/resusinfo/resuslist/resustodd", getCurrentDate());
  847. model.setValue("/root/main/resusinfo/resuslist/fstresusstrtdd", getCurrentDate());
  848. model.setValue("/root/main/resusinfo/resuslist/defibrstartdd", getCurrentDate());
  849. } else if(pFlag == "Change") {
  850. model.setValue("/root/main/resusinfo/resuslist/cardarrestmdd", model.getValue("/root/main/patinfo/cardarrgenrdd") );
  851. model.setValue("/root/main/resusinfo/resuslist/resusteamcalldd", model.getValue("/root/main/patinfo/cardarrgenrdd") );
  852. model.setValue("/root/main/resusinfo/resuslist/resusteamarvdd", model.getValue("/root/main/patinfo/cardarrgenrdd") );
  853. model.setValue("/root/main/resusinfo/resuslist/initrhythmcnfmdd", model.getValue("/root/main/patinfo/cardarrgenrdd") );
  854. model.setValue("/root/main/resusinfo/resuslist/resusfromdd", model.getValue("/root/main/patinfo/cardarrgenrdd") );
  855. model.setValue("/root/main/resusinfo/resuslist/resustodd", model.getValue("/root/main/patinfo/cardarrgenrdd") );
  856. model.setValue("/root/main/resusinfo/resuslist/fstresusstrtdd", model.getValue("/root/main/patinfo/cardarrgenrdd") );
  857. model.setValue("/root/main/resusinfo/resuslist/defibrstartdd", model.getValue("/root/main/patinfo/cardarrgenrdd") );
  858. }
  859. model.refresh();
  860. }
  861. /**
  862. * @group :
  863. * @ver : 2007.12.04
  864. * @by : 양천덕
  865. * @---------------------------------------------------
  866. * @type : function
  867. * @access : public
  868. * @desc : 환자 정보 조회(환자번호)
  869. * @param :
  870. * @return :
  871. * @---------------------------------------------------
  872. */
  873. function fSrchPatListInput(pFlag){
  874. setInputNodeCurText(); // 현재 인풋값 노드 반영
  875. fSrchHistList(pFlag);
  876. if(getNodesetCount("/root/main/pathistinfo/patinfo") >= 1 ){
  877. var rrgstno = model.getValue("/root/main/pathistinfo/patinfo/rrgstno1") + " - " + model.getValue("/root/main/pathistinfo/patinfo/rrgstno2");
  878. model.setValue("/root/main/patinfo/indd", model.getValue("/root/main/pathistinfo/patinfo/indd" ) );
  879. model.setValue("/root/main/patinfo/cretno", model.getValue("/root/main/pathistinfo/patinfo/cretno" ) );
  880. model.setValue("/root/main/patinfo/instcd", model.getValue("/root/main/pathistinfo/patinfo/instcd" ) );
  881. model.setValue("/root/main/patinfo/patnm", model.getValue("/root/main/pathistinfo/patinfo/patnm" ) );
  882. model.setValue("/root/main/patinfo/gender", model.getValue("/root/main/pathistinfo/patinfo/gender" ) );
  883. model.setValue("/root/main/patinfo/age", model.getValue("/root/main/pathistinfo/patinfo/age" ) );
  884. model.setValue("/root/main/patinfo/cntctel", model.getValue("/root/main/pathistinfo/patinfo/cntctel" ) );
  885. model.setValue("/root/main/patinfo/addr", model.getValue("/root/main/pathistinfo/patinfo/addr" ) );
  886. model.makeValue("/root/main/patinfo/wardcd", model.getValue("/root/main/pathistinfo/patinfo/wardcd" ) );
  887. model.makeValue("/root/main/patinfo/wardnm", model.getValue("/root/main/pathistinfo/patinfo/wardnm" ) );
  888. model.makeValue("/root/main/patinfo/roomcd", model.getValue("/root/main/pathistinfo/patinfo/roomcd" ) );
  889. model.makeValue("/root/main/patinfo/medispclid", model.getValue("/root/main/pathistinfo/patinfo/medispclid" ) );
  890. model.makeValue("/root/main/patinfo/atdoctcd", model.getValue("/root/main/pathistinfo/patinfo/atdoctid" ) );
  891. model.makeValue("/root/main/patinfo/orddrid", model.getValue("/root/main/pathistinfo/patinfo/orddrid" ) );
  892. model.makeValue("/root/main/patinfo/deptcd", model.getValue("/root/main/pathistinfo/patinfo/deptcd" ) );
  893. model.makeValue("/root/main/patinfo/issdeptcd", model.getValue("/root/main/pathistinfo/patinfo/issdeptcd" ) );
  894. model.makeValue("/root/main/patinfo/orddeptcd", model.getValue("/root/main/pathistinfo/patinfo/deptcd" ) );
  895. cmb_dept.dispatch("xforms-value-changed");
  896. cmb_dept.refresh();
  897. if(model.getValue("/root/main/patinfo/nursdocflag") == "N"){
  898. fDateSetting("Init");
  899. }else{
  900. model.setValue("/root/main/patinfo/cardarrgenrdd", getCurrentDate());
  901. int_cardarrgenrdd.disabled = false;
  902. }
  903. if( model.getValue("/root/main/patinfo/cardarrgenrdd") == "" ){
  904. model.setValue("/root/main/patinfo/cardarrgenrdd", model.getValue("/root/main/pathistinfo/pathistlist/cardarrgenrdd" ));
  905. model.setValue("/root/main/patinfo/cardarrgenrtm", model.getValue("/root/main/pathistinfo/pathistlist/cardarrgenrtm" ));
  906. model.setValue("/root/main/patinfo/cardarrgenrdt", model.getValue("/root/main/pathistinfo/pathistlist/cardarrgenrtm" ));
  907. }
  908. fClearChildNode("/root/main/resusinfo/resuslist");
  909. fInputBoxInit();
  910. model.setValue(xPathCardArrPatInfo+"/rrgstno" , rrgstno);
  911. model.refresh();
  912. }else{
  913. messageBox("조회 결과가 없습니다.","I");
  914. fInitPatList();
  915. fInputBoxInit();
  916. return;
  917. }
  918. }
  919. /**
  920. * @group :
  921. * @ver : 2007.12.04
  922. * @by : 양천덕
  923. * @---------------------------------------------------
  924. * @type : function
  925. * @access : public
  926. * @desc : 심폐소생술 보고서 환자정보 초기화
  927. * @param :
  928. * @return :
  929. * @---------------------------------------------------
  930. */
  931. function fInitPatList(){
  932. model.setValue("/root/main/patinfo/pid" , "");
  933. model.setValue("/root/main/patinfo/rrgstno" , "");
  934. model.setValue("/root/main/patinfo/indd" , "");
  935. model.setValue("/root/main/patinfo/cretno" , "");
  936. model.setValue("/root/main/patinfo/instcd" , "");
  937. model.setValue("/root/main/patinfo/patnm" , "");
  938. model.setValue("/root/main/patinfo/grdrage" , "");
  939. model.setValue("/root/main/patinfo/cntctel" , "");
  940. model.setValue("/root/main/patinfo/addr" , "");
  941. model.setValue("/root/main/patinfo/ininfo" , "");
  942. model.refresh();
  943. }