SMMNO04000.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. /*
  2. 산부인과 자궁경부 암결과입력(SMMNO04000.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var uijeongbuinstcd="", buchuninstcd="", vincentinstcd="", yeuidoinstcd=""; // 의정부성모,부천성가, 성빈센트병원기관코드
  7. var seoulinstcd=""; //서울성모기관코드
  8. var OBGYdeptcd = "";
  9. /**
  10. * @desc : 화면 초기화
  11. * @
  12. * @param :
  13. * @event :
  14. * @return :
  15. * @---------------------------------------------------
  16. */
  17. function fInit(){
  18. //오늘 날짜로 초기화 하는 부분.(진료일자를 default로 오늘 날짜로 선택함)
  19. var dt = getCurrentDate();
  20. model.setValue("/root/main/cond/fromdd", dt);
  21. model.setValue("/root/main/cond/todd", dt);
  22. grd_obgypatlist.fixedcellcheckbox(0,1) = true;
  23. cmb_base.select(2); //결과일자를 처음 setting
  24. model.setValue("/root/main/cond/srchobgy", "Y");
  25. model.setValue("/root/main/cond/srchetc", "N");
  26. // 간호 환경설정테이블 조회
  27. var pCode = "'069','077'"; // 조회할 CdGrupID 코드정보
  28. var pDate = getCurrentDate(); //조회기준일자
  29. fGetNursHardCdInfo(pCode, pDate);
  30. for(var i=1; i<=getNodesetCount("/root/code/codeinfo/codelist"); i++){
  31. switch (model.getValue("/root/code/codeinfo/codelist["+i+"]/cdgrupid")){
  32. case "069": // 산부인과
  33. OBGYdeptcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
  34. break;
  35. case "077": // 의정부성모병원기관코드_20090606
  36. switch(model.getValue("/root/code/codeinfo/codelist["+i+"]/supcdid")){
  37. case "01": // (01:서울성모,02:의정부성모,03:부천성가, 04:성빈센트)-20090811
  38. seoulinstcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
  39. break;
  40. case "02": // (01:서울성모,02:의정부성모,03:부천성가, 04:성빈센트)
  41. uijeongbuinstcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
  42. break;
  43. case "03": // (01:서울성모,02:의정부성모,03:부천성가, 04:성빈센트)
  44. sunggainstcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
  45. break;
  46. case "04": // (01:서울성모,02:의정부성모,03:부천성가, 04:성빈센트)
  47. vincentinstcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
  48. break;
  49. case "05": // (01:서울성모,02:의정부성모,03:부천성가, 04:성빈센트, 05:여의도성모)
  50. yeuidoinstcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
  51. break;
  52. }
  53. }
  54. }
  55. fDeptTelNo(); //산부인과 외래전화번호를 조회.
  56. model.refresh();
  57. }
  58. /**
  59. * @group :
  60. * @ver : 2010.03.08
  61. * @by : kys
  62. * @---------------------------------------------------
  63. * @type : function
  64. * @access : public
  65. * @desc : 산부인과 외래전화번호를 조회
  66. * @param :
  67. * @return :
  68. * @---------------------------------------------------
  69. */
  70. function fDeptTelNo(){
  71. model.removeNodeset("/root/send");
  72. model.makeNode("/root/send");
  73. model.makeValue("/root/send/fromdd" , model.getValue("/root/main/cond/fromdd"));
  74. model.makeValue("/root/send/todd" , model.getValue("/root/main/cond/todd"));
  75. model.makeValue("/root/send/basedd" , model.getValue("/root/main/cond/basedd"));
  76. model.makeValue("/root/send/pid" , model.getValue("/root/main/cond/pid"));
  77. model.removenode("/root/temp/depttel");
  78. if(!submit("TRMNO04004")){
  79. messageBox("조회를 실패하였습니다.", "E");
  80. return;
  81. }else{
  82. }
  83. }
  84. /**
  85. * @group :
  86. * @ver : 2010.02.25
  87. * @by : kys
  88. * @---------------------------------------------------
  89. * @type : function
  90. * @access : public
  91. * @desc : 자궁경부환자 조회
  92. * @param :
  93. * @return :
  94. * @---------------------------------------------------
  95. */
  96. function fSearch(){
  97. var condobgyyn = "";
  98. if(model.getValue("/root/main/cond/pid") == ""){ //등록번호로 조회시에는 Pass
  99. var fromDate = model.getValue("/root/main/cond/fromdd"); // fromdd
  100. var toDate = model.getValue("/root/main/cond/todd"); // todd
  101. var sdaycnt = getDateInterval(fromDate, toDate); // todd - fromdd 일수계산
  102. if(parseInt(sdaycnt) + 1 > 31){
  103. messageBox("31일이상은 조회 하실수 없습니다.", "I");
  104. return;
  105. }
  106. }
  107. grd_obgypatlist.fixedcellischeck(0,1) = false; //fixedcell 체크박스 풀기
  108. //20100426-kys-조회조건 추가
  109. if(model.getValue("/root/main/cond/srchobgy") == "N" && model.getValue("/root/main/cond/srchetc") == "N"){
  110. messageBox("진료과를 선택하셔야 합니다.", "I");
  111. return;
  112. }
  113. if(model.getValue("/root/main/cond/srchobgy") == "Y"){
  114. condobgyyn = "O"; //산부인과
  115. }
  116. if(model.getValue("/root/main/cond/srchetc") == "Y"){
  117. condobgyyn = "E"; //그외 진료과
  118. }
  119. if(model.getValue("/root/main/cond/srchobgy") == "Y" && model.getValue("/root/main/cond/srchetc") == "Y"){
  120. condobgyyn = ""; //산부인과 및 그외 진료과
  121. }
  122. model.removeNodeset("/root/send");
  123. model.makeNode("/root/send");
  124. model.makeValue("/root/send/fromdd" , model.getValue("/root/main/cond/fromdd"));
  125. model.makeValue("/root/send/todd" , model.getValue("/root/main/cond/todd"));
  126. model.makeValue("/root/send/basedd" , model.getValue("/root/main/cond/basedd"));
  127. model.makeValue("/root/send/pid" , model.getValue("/root/main/cond/pid"));
  128. model.makeValue("/root/send/condobgyyn" , condobgyyn);
  129. model.removenode("/root/main/obgypatlist");
  130. if(!submit("TRMNO04001")){
  131. messageBox("조회를 실패하였습니다.", "E");
  132. return;
  133. }else{
  134. if(model.getValue("/root/main/cond/basedd") == "1"){
  135. grd_obgypatlist.caption = "^수납일자^등록번호^성명^센터^진료과^하위부서^주치의^결과^출력^상태^다음예약1^다음예약2^전화번호1^전화번호2^SMS^전송^입원예정일^입원일^수술예정일^우편번호^주소^비고^기관코드^진료일^cretno^특이사항존재여부^msgkey^status";
  136. }else if(model.getValue("/root/main/cond/basedd") == "2"){
  137. grd_obgypatlist.caption = "^처방일자^등록번호^성명^센터^진료과^하위부서^주치의^결과^출력^상태^다음예약1^다음예약2^전화번호1^전화번호2^SMS^전송^입원예정일^입원일^수술예정일^우편번호^주소^비고^기관코드^진료일^cretno^특이사항존재여부^msgkey^status";
  138. }else{
  139. grd_obgypatlist.caption = "^결과일자^등록번호^성명^센터^진료과^하위부서^주치의^결과^출력^상태^다음예약1^다음예약2^전화번호1^전화번호2^SMS^전송^입원예정일^입원일^수술예정일^우편번호^주소^비고^기관코드^진료일^cretno^특이사항존재여부^msgkey^status";
  140. }
  141. //결과가 정상일경우(1) 글씨색 표시(빨강)
  142. for(var i=1;i<=getNodesetCount("/root/main/obgypatlist/obgypatlistinfo");i++){
  143. var status = model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/status");
  144. var examrslt = model.getValue("/root/main/obgypatlist/obgypatlistinfo["+i+"]/examrslt")
  145. if(examrslt == "1" && status == "i"){
  146. grd_obgypatlist.rowstyle(i, "data", "color") = "#ff0000"; //빨강
  147. }else{
  148. grd_obgypatlist.rowstyle(i, "data", "color") = "#000000"; //검정
  149. }
  150. }
  151. }
  152. button4.value = "□ 특이사항";
  153. fInitExamRslt(""); //셋팅된 값 클리어
  154. model.refresh();
  155. }
  156. /**
  157. * @group :
  158. * @ver : 2010.02.26
  159. * @by : kys
  160. * @---------------------------------------------------
  161. * @type : function
  162. * @access : public
  163. * @desc : 환자의 가장 최근 병리검사 조회
  164. * @param :
  165. * @return :
  166. * @---------------------------------------------------
  167. */
  168. function fPatExamRsltSrch(){
  169. model.removeNodeset("/root/send");
  170. model.makeNode("/root/send");
  171. model.makeValue("/root/send/pid" , model.getValue("/root/temp/pid"));
  172. model.makeValue("/root/send/histsrchyn" , "N");
  173. model.removenode("/root/temp/examrsltlist");
  174. if(!submit("TRMNO04002")){
  175. messageBox("조회를 실패하였습니다.", "E");
  176. return;
  177. }else{
  178. //alert("getNodesetCount(/root/temp/examrsltlist) : " + getNodesetCount("/root/temp/examrsltlist/examrsltlistinfo"));
  179. if(getNodesetCount("/root/temp/examrsltlist/examrsltlistinfo") > 0){
  180. model.makeValue("/root/temp/examrslttxt",model.getValue("/root/temp/examrsltlist/examrsltlistinfo/rsltcnts")); //병리검사결과
  181. model.makeValue("/root/temp/ptno", "★ Lab. No. " + model.getValue("/root/temp/examrsltlist/examrsltlistinfo/ptno")); //병리번호
  182. var prcpdd = model.getValue("/root/temp/examrsltlist/examrsltlistinfo/prcpdd"); //처방일
  183. var acptdt = model.getValue("/root/temp/examrsltlist/examrsltlistinfo/acptdt"); //접수시간
  184. model.makeValue("/root/temp/prcpdd", "☞ 처방시간 : " + prcpdd.toDate().getDateFormat("YYYY-MM-DD") + ", 접수시간 : " + acptdt.toDate("YYYYMMDDhhmmss").getDateFormat("YYYY-MM-DD hh:mm:ss"));
  185. }else{
  186. model.removeNode("/root/temp/examrslttxt");
  187. model.removeNode("/root/temp/ptno");
  188. model.removeNode("/root/temp/prcpdd");
  189. }
  190. tar_examrslt.refresh();
  191. output3.refresh();
  192. output4.refresh();
  193. }
  194. }
  195. /**
  196. * @group :
  197. * @ver : 2010.03.04
  198. * @by : kys
  199. * @---------------------------------------------------
  200. * @type : function
  201. * @access : public
  202. * @desc : 환자의 병리검사 이력조회
  203. * @param :
  204. * @return :
  205. * @---------------------------------------------------
  206. */
  207. function fPatExamHist(){
  208. model.removeNodeset("/root/send");
  209. model.makeNode("/root/send");
  210. model.makeValue("/root/send/pid" , model.getValue("/root/temp/pid"));
  211. model.makeValue("/root/send/histsrchyn" , "Y");
  212. model.removenode("/root/temp/patexamhistlist");
  213. if(!submit("TRMNO04003")){
  214. messageBox("조회를 실패하였습니다.", "E");
  215. return;
  216. }else{
  217. }
  218. grd_examhist.refresh();
  219. }
  220. /**
  221. * @group :
  222. * @ver : 2010.03.04
  223. * @by : kys
  224. * @---------------------------------------------------
  225. * @type : function
  226. * @access : public
  227. * @desc : 환자의 병리검사 이력 클릭
  228. * @param :
  229. * @return :
  230. * @---------------------------------------------------
  231. */
  232. function fPatExamHistClick(){
  233. model.removeNode("/root/temp/examrslttxt");
  234. model.removeNode("/root/temp/ptno");
  235. model.removeNode("/root/temp/prcpdd");
  236. model.makeValue("/root/temp/examrslttxt",model.getValue("/root/temp/patexamhistlist/patexamhistinfo["+ grd_examhist.row +"]/rsltcnts")); //병리검사결과
  237. model.makeValue("/root/temp/ptno", "★ Lab. No. " + model.getValue("/root/temp/patexamhistlist/patexamhistinfo["+ grd_examhist.row +"]/ptno")); //병리번호
  238. var prcpdd = model.getValue("/root/temp/patexamhistlist/patexamhistinfo["+ grd_examhist.row +"]/prcpdd"); //처방일
  239. var acptdt = model.getValue("/root/temp/patexamhistlist/patexamhistinfo["+ grd_examhist.row +"]/acptdt"); //접수시간
  240. model.makeValue("/root/temp/prcpdd", "☞ 처방시간 : " + prcpdd.toDate().getDateFormat("YYYY-MM-DD") + ", 접수시간 : " + acptdt.toDate("YYYYMMDDhhmmss").getDateFormat("YYYY-MM-DD hh:mm:ss"));
  241. group2.attribute("visibility") = "hidden";
  242. tar_examrslt.refresh();
  243. output3.refresh();
  244. output4.refresh();
  245. }
  246. /**
  247. * @group :
  248. * @ver : 2010.03.04
  249. * @by : kys
  250. * @---------------------------------------------------
  251. * @type : function
  252. * @access : public
  253. * @desc : 셋팅된 값 초기화
  254. * @param :
  255. * @return :
  256. * @---------------------------------------------------
  257. */
  258. function fInitExamRslt(flag){
  259. model.removeNode("/root/temp/examrslttxt");
  260. model.removeNode("/root/temp/ptno");
  261. model.removeNode("/root/temp/prcpdd");
  262. if(flag != "1"){ //조회버튼 클릭이 아니면..
  263. model.removeNode("/root/temp/smssendcnts");
  264. }
  265. model.removeNode("/root/temp/pid");
  266. model.removeNode("/root/temp/patnm");
  267. model.refresh();
  268. }
  269. /**
  270. * @group :
  271. * @ver : 2010.03.05
  272. * @by : kys
  273. * @---------------------------------------------------
  274. * @type : function
  275. * @access : public
  276. * @desc : 우편물 출력
  277. * @param :
  278. * @return :
  279. * @---------------------------------------------------
  280. */
  281. function fPrntPost(){
  282. var j = 1;
  283. var instnm = "";
  284. var smstestrslt = "";
  285. model.removenode("/root/temp/printdata");
  286. model.makeNode("/root/temp/printdata");
  287. //기관에 따른 명칭변경
  288. if(getUserInfo("dutplceinstcd") == seoulinstcd){
  289. instnm = "서울 성모산부인과(외래)"
  290. }else if(getUserInfo("dutplceinstcd") == yeuidoinstcd){
  291. instnm = "여의도 성모산부인과(외래)"
  292. }else if(getUserInfo("dutplceinstcd") == uijeongbuinstcd){
  293. instnm = "의정부 성모산부인과(외래)"
  294. }else if(getUserInfo("dutplceinstcd") == buchuninstcd){
  295. instnm = "부천 성모산부인과(외래)"
  296. }else if(getUserInfo("dutplceinstcd") == vincentinstcd){
  297. instnm = "성빈센트 산부인과(외래)"
  298. }
  299. for(var i=1;i<=getNodesetCount("/root/main/obgypatlist/obgypatlistinfo");i++){
  300. if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/chk") == "true"){
  301. model.makeValue("/root/temp/printdata/obgypatlist/obgypatlistinfo[" + j +"]/pid", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/pid"));
  302. model.makeValue("/root/temp/printdata/obgypatlist/obgypatlistinfo[" + j +"]/patnm", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/patnm"));
  303. if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt") == "1"){
  304. smstestrslt = "정상";
  305. }else if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt") == "2"){
  306. smstestrslt = "전화로 알림";
  307. }else if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt") == "3"){
  308. smstestrslt = "재검-SMS로 알림";
  309. }else if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt") == "4"){
  310. smstestrslt = "정상+염증성소견";
  311. }
  312. model.makeValue("/root/temp/printdata/obgypatlist/obgypatlistinfo[" + j +"]/smssendcnts", smstestrslt);
  313. var nextrsrv1 = model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/nextrsrv1");
  314. model.makeValue("/root/temp/printdata/obgypatlist/obgypatlistinfo[" + j +"]/nextrsrv1", nextrsrv1.toDate().getDateFormat("YYYY-MM-DD"));
  315. model.makeValue("/root/temp/printdata/obgypatlist/obgypatlistinfo[" + j +"]/orddepttel", model.getValue("/root/temp/depttellist/depttellistinfo/depttelno"));
  316. model.makeValue("/root/temp/printdata/obgypatlist/obgypatlistinfo[" + j +"]/instnm", instnm);
  317. model.makeValue("/root/temp/printdata/obgypatlist/obgypatlistinfo[" + j +"]/addr", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/addr"));
  318. model.makeValue("/root/temp/printdata/obgypatlist/obgypatlistinfo[" + j +"]/zipcd", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/zipcd"));
  319. j++;
  320. }
  321. }
  322. clearParameter("reportprintyn"); //20100520_미리보기창보임으로추가_kys
  323. exeReportPreview("RPMNO04000", "XMLSTR", "", "", "", "", "", "", "", "");//20100520_미리보기창보임으로수정_kys
  324. }
  325. /**
  326. * @group :
  327. * @ver : 2010.03.08
  328. * @by : kys
  329. * @---------------------------------------------------
  330. * @type : function
  331. * @access : public
  332. * @desc : 환자 Print정보 입력
  333. * @param :
  334. * @return :
  335. * @---------------------------------------------------
  336. */
  337. function fInsPrintInfo(){
  338. var j = 1;
  339. model.removenode("/root/send/reqinsdata");
  340. model.makeNode("/root/send/reqinsdata");
  341. for(var i=1;i<=getNodesetCount("/root/main/obgypatlist/obgypatlistinfo");i++){
  342. if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/chk") == "true"){
  343. //if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/prntstat") != "Y"){ //Y인경우 data가 있으므로 제외.
  344. //var prntstat = model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/prntstat");
  345. //var smssenddt = model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/smssenddt");
  346. if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/status") == "i"){
  347. model.makeValue("/root/send/reqinsdata[" + j +"]/status", "i");
  348. model.makeValue("/root/send/reqinsdata[" + j +"]/msgkey", "0");
  349. }else if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/status") == "u") {
  350. model.makeValue("/root/send/reqinsdata[" + j +"]/status", "u");
  351. model.makeValue("/root/send/reqinsdata[" + j +"]/msgkey", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/msgkey"));
  352. }
  353. model.makeValue("/root/send/reqinsdata[" + j +"]/pid", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/pid"));
  354. model.makeValue("/root/send/reqinsdata[" + j +"]/orddd", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/orddd"));
  355. model.makeValue("/root/send/reqinsdata[" + j +"]/cretno", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/cretno"));
  356. model.makeValue("/root/send/reqinsdata[" + j +"]/prntyn", "Y");
  357. model.makeValue("/root/send/reqinsdata[" + j +"]/examrslt", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt"));
  358. model.makeValue("/root/send/reqinsdata[" + j +"]/rem", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/rem"));
  359. model.makeValue("/root/send/reqinsdata[" + j +"]/saveflag", "P");
  360. j++;
  361. //}
  362. }
  363. }
  364. if(!submit("TXMNO04001")){
  365. messageBox("저장 실패하였습니다.", "E");
  366. return false;
  367. }else{
  368. return true;
  369. }
  370. }
  371. /**
  372. * @group :
  373. * @ver : 2010.03.08
  374. * @by : kys
  375. * @---------------------------------------------------
  376. * @type : function
  377. * @access : public
  378. * @desc : 환자 특이사항 조회.
  379. * @param :
  380. * @return :
  381. * @---------------------------------------------------
  382. */
  383. function fCmmtSrch(){
  384. model.removenode("/root/send/reqcmmtdata");
  385. model.makeNode("/root/send/reqcmmtdata");
  386. model.makeValue("/root/send/reqcmmtdata/pid", model.getValue("/root/temp/pidcmmt")); //등록번호 set
  387. if(!submit("TRMNO04005")){
  388. messageBox("특이사항 조회를 실패하였습니다.", "E");
  389. return;
  390. }else{
  391. model.makeValue("/root/temp/pidcmmt", model.getValue("/root/main/obgypatlist/obgypatlistinfo[" + grd_obgypatlist.row+ "]/pid")); //등록번호 set
  392. if(model.getValue("/root/temp/patcmmt/patcmmtstmtinfo/patcmmtstmt") == ""){ //가져온 값이 없다면 노드 생성.
  393. model.makeNode("/root/temp/patcmmt/patcmmtstmtinfo/patcmmtstmt");
  394. }
  395. inpt_cmmtpid.refresh();
  396. tar_cmmt.refresh();
  397. }
  398. }
  399. /**
  400. * @group :
  401. * @ver : 2010.03.08
  402. * @by : kys
  403. * @---------------------------------------------------
  404. * @type : function
  405. * @access : public
  406. * @desc : 환자 특이사항 저장.
  407. * @param :
  408. * @return :
  409. * @---------------------------------------------------
  410. */
  411. function fInsPatCmmt(){
  412. if(model.getValue("/root/temp/patcmmt/patcmmtstmtinfo/patcmmtstmt") == ""){
  413. messageBox("입력된 내용이 없습니다.", "E");
  414. return;
  415. }
  416. model.removenode("/root/send/reqinscmmtdata");
  417. model.makeNode("/root/send/reqinscmmtdata");
  418. model.makeValue("/root/send/reqinscmmtdata/pid", model.getValue("/root/temp/pidcmmt")); //등록번호 set
  419. model.makeValue("/root/send/reqinscmmtdata/patcmmtstmt", model.getValue("/root/temp/patcmmt/patcmmtstmtinfo/patcmmtstmt")); //등록번호 set
  420. if(!submit("TXMNO04002")){
  421. messageBox("특이사항 저장을 실패하였습니다.", "E");
  422. return;
  423. }else{
  424. fCmmtSrch(); //특이사항 조회.
  425. var cmmtyn = model.getValue("/root/main/obgypatlist/obgypatlistinfo[pid = '" + model.getValue("/root/temp/pidcmmt") + "']/cmmtyn");
  426. if(cmmtyn = "N"){
  427. model.makeValue("/root/main/obgypatlist/obgypatlistinfo[pid = '" + model.getValue("/root/temp/pidcmmt") + "']/cmmtyn", "Y");
  428. button4.value = "■ 특이사항";
  429. }
  430. }
  431. }
  432. /**
  433. * @group :
  434. * @ver : 2010.03.09
  435. * @by : kys
  436. * @---------------------------------------------------
  437. * @type : function
  438. * @access : public
  439. * @desc : 환자 SMS전송 입력
  440. * @param :
  441. * @return :
  442. * @---------------------------------------------------
  443. */
  444. function fSendSms(){
  445. var j = 1, k = 0;
  446. model.removenode("/root/send/reqsmsdata");
  447. model.makeNode("/root/send/reqsmsdata");
  448. for(var i=1;i<=getNodesetCount("/root/main/obgypatlist/obgypatlistinfo");i++){
  449. if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/chk") == "true"){
  450. if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt") == ""){
  451. messageBox("결과컬럼에 값을 입력하지 않은행이 존재합니다. [ " + i + " ]행", "E");
  452. return false;
  453. }
  454. //유효하지 않은값 체크-kys-20100405
  455. if(eval(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt")) > 4){
  456. messageBox("결과컬럼 값이 유효하지 않은 행이 존재합니다. [ " + i +" ]행", "E");
  457. return false;
  458. }
  459. if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/smssenddt") != ""){
  460. messageBox("SMS전송중이거나 전송된 행이 존재합니다. [ " + i +" ]행", "E");
  461. return false;
  462. }
  463. if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt") == "2"){
  464. messageBox("검사결과과 전화로 알림인 경우 SMS를 보낼수 없습니다.", "E");
  465. return false;
  466. }
  467. if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt") == "4"){
  468. messageBox("검사결과과 재검+염증성 소견일 경우 SMS를 보낼수 없습니다.", "E");
  469. return false;
  470. }
  471. if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/hpno") == "" || model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/hpno") == "-"){
  472. messageBox("전화번호2가 없는 행이 존재합니다. [" + i + "]행", "E");
  473. return false;
  474. }
  475. //var prntstat = model.getValue("/root/main/obgypatlist/obgypatlistinfo[" + i + "]/prntstat");
  476. //var smssenddt = model.getValue("/root/main/obgypatlist/obgypatlistinfo[" + i + "]/smssenddt");
  477. var depttelno = model.getValue("/root/temp/depttellist/depttellistinfo/depttelno");
  478. var patnm = model.getValue("/root/main/obgypatlist/obgypatlistinfo[" + i + "]/patnm");
  479. if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/status") == "i"){ //두개의 값이 없으면 insert(data의 존재여부를 판단)
  480. model.makeValue("/root/send/reqsmsdata[" + j +"]/status", "i");
  481. model.makeValue("/root/send/reqsmsdata[" + j +"]/prntyn", "N"); //print출력여부
  482. }else if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/status") == "u") {
  483. model.makeValue("/root/send/reqsmsdata[" + j +"]/status", "u");
  484. model.makeValue("/root/send/reqsmsdata[" + j +"]/prntyn", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/prntstat")); //print출력여부
  485. }
  486. model.makeValue("/root/send/reqsmsdata[" + j +"]/pid", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/pid")); //등록번호
  487. model.makeValue("/root/send/reqsmsdata[" + j +"]/orddd", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/orddd")); //진료일
  488. model.makeValue("/root/send/reqsmsdata[" + j +"]/cretno", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/cretno")); //cretno
  489. model.makeValue("/root/send/reqsmsdata[" + j +"]/examrslt", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt")); //검사결과
  490. model.makeValue("/root/send/reqsmsdata[" + j +"]/rem", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/rem")); //비고
  491. model.makeValue("/root/send/reqsmsdata[" + j +"]/mpphontel", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/hpno")); //환자핸드폰번호
  492. model.makeValue("/root/send/reqsmsdata[" + j +"]/cntctel", depttelno); //산부인과외래전화번호
  493. model.makeValue("/root/send/reqsmsdata[" + j +"]/hngnm", patnm); //환자명
  494. if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt") == "1"){ //암검사결과에 따른 SMS메시지 작성
  495. model.makeValue("/root/send/reqsmsdata[" + j +"]/msgparam", patnm + "님, 자궁경부암 결과가 정상입니다. 산부인과 외래전화번호(" + depttelno + ")");
  496. }else if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt") == "3"){
  497. model.makeValue("/root/send/reqsmsdata[" + j +"]/msgparam", patnm + "님, 자궁경부암 결과를 확인하십시오. 산부인과 외래전화번호(" + depttelno + ")");
  498. }
  499. j++;
  500. k++; //메세지박스 판단 변수.
  501. }
  502. }
  503. if(k == 1){ //체크한 data가 한개일 경우
  504. var rtnval = "";
  505. var examrslt = model.getValue("/root/send/reqsmsdata[1]/examrslt");
  506. if(examrslt == "1"){
  507. rtnval = messageBox("메시지를 전송하시겠습니까? " , "Q");
  508. if(rtnval == 7){ //취소 버튼을 클릭한 경우
  509. return false;
  510. }
  511. }else if(examrslt == "3"){
  512. rtnval = messageBox("재검, 메시지를 전송하시겠습니까?" , "Q");
  513. if(rtnval == 7){ //취소 버튼을 클릭한 경우
  514. return false;
  515. }
  516. }
  517. }else if(k > 1){ //체크한 data가 1개 이상일 경우 단일 메시지로....
  518. var rtnval = "";
  519. rtnval = messageBox("메시지를 전송하시겠습니까? " , "Q");
  520. if(rtnval == 7){ //취소 버튼을 클릭한 경우
  521. return false;
  522. }
  523. }
  524. if(!submit("TXMNO04003")){
  525. messageBox("저장 실패하였습니다.", "E");
  526. return false;
  527. }else{
  528. return true;
  529. }
  530. }
  531. /**
  532. * @group :
  533. * @ver : 2010.03.26
  534. * @by : kys
  535. * @---------------------------------------------------
  536. * @type : function
  537. * @access : public
  538. * @desc : 발송내용 선택시 저장.
  539. * @param :
  540. * @return :
  541. * @---------------------------------------------------
  542. */
  543. function fSaveNormal(){
  544. model.removenode("/root/send/reqinsdata");
  545. model.makeNode("/root/send/reqinsdata");
  546. if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ grd_obgypatlist.row +"]/status") == "i"){
  547. model.makeValue("/root/send/reqinsdata[1]/status", "i");
  548. model.makeValue("/root/send/reqinsdata[1]/msgkey", "0");
  549. model.makeValue("/root/send/reqinsdata[1]/prntyn", "N");
  550. }else if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ grd_obgypatlist.row +"]/status") == "u") {
  551. model.makeValue("/root/send/reqinsdata[1]/status", "u");
  552. model.makeValue("/root/send/reqinsdata[1]/msgkey", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ grd_obgypatlist.row +"]/msgkey"));
  553. model.makeValue("/root/send/reqinsdata[1]/prntyn", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ grd_obgypatlist.row +"]/prntstat"));
  554. }
  555. model.makeValue("/root/send/reqinsdata[1]/pid", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ grd_obgypatlist.row +"]/pid"));
  556. model.makeValue("/root/send/reqinsdata[1]/orddd", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ grd_obgypatlist.row +"]/orddd"));
  557. model.makeValue("/root/send/reqinsdata[1]/cretno", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ grd_obgypatlist.row +"]/cretno"));
  558. model.makeValue("/root/send/reqinsdata[1]/examrslt", model.getValue("/root/temp/smssendcnts"));
  559. model.makeValue("/root/send/reqinsdata[1]/rem", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ grd_obgypatlist.row +"]/rem"));
  560. model.makeValue("/root/send/reqinsdata[1]/saveflag", "R");
  561. if(!submit("TXMNO04001")){
  562. messageBox("저장 실패하였습니다.", "E");
  563. return false;
  564. }else{
  565. messageBox("저장 되었습니다.", "I");
  566. return true;
  567. }
  568. }