SMMNE00200.js 135 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292
  1. /*
  2. 응급실 퇴실정리(SMMNE00200.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var xPathInddPationList = "/root/main/inddpatlist/inddpatinfo";
  7. var xPathMainCondNode = "/root/main/condition";
  8. function fInit(){
  9. zbcfGetCodeList( new Array("M0011", "M0535"), new Array("/root/init/M0011list", "/root/init/M0535list") );
  10. //16.01.04_간호하드코드 추가
  11. fGetNursHardCdInfo("'E27'", getCurrentDate());
  12. fInitialize();
  13. }
  14. /**
  15. * @group :
  16. * @ver : 2007.06.07
  17. * @by : 양천덕
  18. * @---------------------------------------------------
  19. * @type : function
  20. * @access : public
  21. * @desc : 초기 화면 설정(기초 정보 설정)
  22. * @param :
  23. * @return :
  24. * @---------------------------------------------------
  25. */
  26. function fInitialize(){
  27. if(getUserInfo("userid") == "ENR") {
  28. button6.visible = true;
  29. } else {
  30. button6.visible = false;
  31. }
  32. //16.10.19_칠곡 지역센터 승격으로 본원/칠곡 동시 적용
  33. /*
  34. //15.12.28_AYS 최종진료구역 본원만 활성화
  35. if(getUserInfo("dutplceinstcd") == "031") {
  36. caption23.visible = true;
  37. cmb_outarea.visible = true;
  38. } else {
  39. caption23.visible = false;
  40. cmb_outarea.visible = false;
  41. }
  42. */
  43. //15.12.28_AYS 최종진료구역 본원만 활성화
  44. //16.10.19_칠곡 지역센터 승격으로 본원/칠곡 동시 적용
  45. fInotSetNode();
  46. model.removenode("/root/send");
  47. model.makeValue("/root/send/searchitem", "outrm");
  48. model.setValue("/root/main/condition/outrmdd", getCurrentDate() );
  49. model.setValue("/root/main/condition/outrmtm", fTimeSetting() );
  50. model.setValue("/root/main/condition/researchflag", "N");
  51. grd_patlist.rebuildStyle();
  52. submit("TRMNE00203");
  53. fGetPatList();
  54. }
  55. /**
  56. * @group :
  57. * @ver : 2007.06.07
  58. * @by : 양천덕
  59. * @---------------------------------------------------
  60. * @type : function
  61. * @access : public
  62. * @desc : 현재 시간 설정
  63. * @param :
  64. * @return :
  65. * @---------------------------------------------------
  66. */
  67. function fTimeSetting(){
  68. var d, s= "" ,t;
  69. d = new Date();
  70. if( d.getMinutes() >= 10 ) {
  71. if(d.getHours() >= 10 ) {
  72. t = d.getHours() + "" + d.getMinutes();
  73. } else {
  74. t = "0" + d.getHours() + "" + d.getMinutes();
  75. }
  76. } else {
  77. if(d.getHours() >= 10 ) {
  78. t = d.getHours() + "0" + d.getMinutes();
  79. } else {
  80. t = "0" + d.getHours() + "0" + d.getMinutes();
  81. }
  82. }
  83. return t;
  84. //model.setValue("/root/main/condition/outrmtm", t );
  85. }
  86. /**
  87. * @group :
  88. * @ver : 2007.06.07
  89. * @by : 양천덕
  90. * @---------------------------------------------------
  91. * @type : function
  92. * @access : public
  93. * @desc : 재원 환자 조회 부분
  94. * @param :
  95. * @return :
  96. * @---------------------------------------------------
  97. */
  98. function fGetPatList(){
  99. var sSrchData = "";
  100. var sSrchHeader = "section▩";
  101. var sSrchData = model.getValue("/root/main/condition/section")+"▩";
  102. model.removenode("/root/send");
  103. model.makeValue("/root/send/searchinfo", sSrchHeader + sSrchData);
  104. grd_patlist.allstyle("all", "background-color") = "white";
  105. submit("TXMNE00201");
  106. var tRow = grd_patlist.rows;
  107. for(i= 0 ; i < tRow ; i ++ ){
  108. if(model.getValue("/root/main/inddpatlist/inddpatinfo["+i+"]/dschdclrtyn") == "Y"){
  109. //퇴원예고 환자에 대해 셀 색상 지정
  110. grd_patlist.cellstyle("background-color", i, 0, i, 4) = "#ffd3ff";
  111. }
  112. }
  113. fGetParamSetting();
  114. fChangeFocusColor();
  115. //model.refresh();
  116. }
  117. /**
  118. * @group :
  119. * @ver : 2007.07.07
  120. * @by : 양천덕
  121. * @---------------------------------------------------
  122. * @type : function
  123. * @access : public
  124. * @desc : 노드 초기화
  125. * @param :
  126. * @return :
  127. * @---------------------------------------------------
  128. */
  129. function fInotSetNode(){
  130. //model.removeNodeset("/root/main/inddpatlist/inddpatinfo");
  131. model.removeNodeset("/root/main/incplist/testinfo" );
  132. model.removeNodeset("/root/main/incplist/inginfo" );
  133. }
  134. /**
  135. * @group :
  136. * @ver : 2007.07.07
  137. * @by : 양천덕
  138. * @---------------------------------------------------
  139. * @type : function
  140. * @access : public
  141. * @desc : 상단 퇴실 조건 초기화
  142. * @param :
  143. * @return :
  144. * @---------------------------------------------------
  145. */
  146. function fInitSettingTop(flag){
  147. if(flag =="A"){
  148. model.setValue("/root/main/condition/section", "-");
  149. }
  150. //top 환자정보 초기화
  151. model.setValue("/root/main/condition/t_patinfo" , "");
  152. model.setValue("/root/main/condition/t_chosdt" , "");
  153. model.setValue("/root/main/condition/t_outrmdt" , "");
  154. model.setValue("/root/main/condition/t_calctm" , "");
  155. model.setValue("/root/main/condition/t_assgroom" , "");
  156. model.setValue("/root/main/condition/t_fstexamorddd" , "");
  157. //퇴원조건 부분 초기화
  158. model.setValue("/root/main/condition/outrmtp" , "");
  159. model.setValue("/root/main/condition/chnghospnm" , "");
  160. model.setValue("/root/main/condition/outrmcd" , "");
  161. model.setValue("/root/main/condition/dethdd" , "");
  162. model.setValue("/root/main/condition/dethtm" , "");
  163. model.setValue("/root/main/condition/pid" , "");
  164. model.setValue("/root/main/condition/healcaretgdyn" , "");
  165. model.setValue("/root/main/condition/proceraprvyn" , "");
  166. caption1.attribute("visibility") = "hidden"; // 마약 - 검사
  167. caption2.attribute("visibility") = "hidden"; // 전원병원
  168. //caption2.attribute("text") = "세부사항";
  169. caption4.attribute("visibility") = "hidden"; // 사망일시
  170. caption6.attribute("visibility") = "hidden"; // 퇴실정리
  171. ipt_chnghosnm.attribute("visibility") = "hidden";
  172. ipt_dethtm.attribute("visibility") = "hidden";
  173. ipt_dethdd.attribute("visibility") = "hidden";
  174. cmb_outrmcd.attribute("visibility") = "hidden";
  175. cmb_etc.attribute("visibility") = "hidden";
  176. chk_proceraprvyn.attribute("visibility") = "hidden";
  177. chk_healcaretgdyn.attribute("visibility") = "hidden";
  178. ipt_outrmetc.attribute("visibility") = "hidden";
  179. ipt_chnghospchoi.attribute("visibility") = "hidden";
  180. caption20.attribute("visibility") = "hidden";
  181. cmb_dschhosptype.attribute("visibility")= "hidden";
  182. model.makeValue("/root/main/condition/chnghospchoi", "");
  183. model.setValue("/root/main/condition/outrmtm", fTimeSetting() );
  184. }
  185. /**
  186. * @group :
  187. * @ver : 2007.07.07
  188. * @by : 양천덕
  189. * @---------------------------------------------------
  190. * @type : function
  191. * @access : public
  192. * @desc : 응급실 처방 조회 key설정
  193. * @param :
  194. * @return :
  195. * @---------------------------------------------------
  196. */
  197. function fSetPatInfo(){
  198. var iRow = grd_patlist.row;
  199. var sSrchData = "";
  200. var sSrchHeader = "pid▦indd▦cretno▦instcd▦dschdclrdt▩";
  201. var sSrchData = model.getValue(xPathInddPationList+"["+iRow+"]/pid" )+"▦"
  202. + model.getValue(xPathInddPationList+"["+iRow+"]/indd" )+"▦"
  203. + model.getValue(xPathInddPationList+"["+iRow+"]/cretno")+"▦"
  204. + model.getValue(xPathInddPationList+"["+iRow+"]/instcd")+"▦"
  205. + model.getValue(xPathInddPationList+"["+iRow+"]/dschdclrdt")+"▩";
  206. model.removeNodeset("/root/send");
  207. return sSrchHeader + sSrchData;
  208. }
  209. /**
  210. * @group :
  211. * @ver : 2007.07.07
  212. * @by : 양천덕
  213. * @---------------------------------------------------
  214. * @type : function
  215. * @access : public
  216. * @desc : 응급실 재원환자 선택 검사/약,주사 처방 조회&
  217. * 투약저장 정보 조회
  218. * @param :
  219. * @return :
  220. * @---------------------------------------------------
  221. */
  222. function fSelectInddPatList(pFlag){
  223. // 검사, 약/주사 처방 조회
  224. if(pFlag == "S"){
  225. model.makeValue("/root/send/searchpat", fSetPatInfo() );
  226. model.setValue("/root/main/condition/researchflag", "N");
  227. }
  228. // 투약저장 정보 조회
  229. if(pFlag == "R"){
  230. if(model.getValue("/root/main/condition/researchflag") == "N"){
  231. model.makeValue("/root/send/researchpat",sSrchHeader+sSrchData );
  232. model.setValue("/root/main/condition/researchflag", "I");
  233. } else {
  234. model.makeValue("/root/send/searchpat", sSrchHeader+sSrchData );
  235. model.setValue("/root/main/condition/researchflag", "N");
  236. }
  237. }
  238. //grd_inglist.allstyle("all", "background-color") = "white";
  239. submit("TXMNE00202");
  240. grd_inglist.rebuildStyle();
  241. var tRow = grd_inglist.rows;
  242. for(i= 0 ; i < tRow ; i ++ ){
  243. if(model.getValue("/root/main/incplist/inginfo["+i+"]/prcpkindcdyn") == "Y"){
  244. //퇴원약 약 확인
  245. grd_inglist.cellstyle("background-color", i, 0, i, 21) = "#ccffff";
  246. }
  247. }
  248. //model.refresh();
  249. }
  250. /**
  251. * @group :
  252. * @ver : 2007.07.07
  253. * @by : 양천덕
  254. * @---------------------------------------------------
  255. * @type : function
  256. * @access : public
  257. * @desc : 응급실퇴실정리 화면 콤포 설정
  258. * @param :
  259. * @return :
  260. * @---------------------------------------------------
  261. */
  262. function fSelctionOutRmCombo(pFlag){
  263. model.removeNodeset("/root/hidden/item");
  264. for(i=1; i <= getNodesetCount("/root/init/erbaselist/outrminfo");i++ ) {
  265. if(model.getValue("/root/init/erbaselist/outrminfo["+i+"]/supbasetypecd") == pFlag ){
  266. model.makeValue("/root/hidden/item["+i+"]/label", model.getValue("/root/init/erbaselist/outrminfo["+i+"]/typenm"));
  267. model.makeValue("/root/hidden/item["+i+"]/value", model.getValue("/root/init/erbaselist/outrminfo["+i+"]/basetypecd"));
  268. }
  269. }
  270. cmb_outrmcd.refresh();
  271. }
  272. function fSelctionInRmCombo(pFlag){
  273. model.removeNodeset("/root/hidden2/item");
  274. for(i=1; i <= getNodesetCount("/root/codeinfo/codeinfo/codelist");i++ ) {
  275. if(model.getValue("/root/codeinfo/codeinfo/codelist["+i+"]/supcdid") == pFlag ){
  276. model.makeValue("/root/hidden2/item["+i+"]/label", model.getValue("/root/codeinfo/codeinfo/codelist["+i+"]/cdnm"));
  277. model.makeValue("/root/hidden2/item["+i+"]/value", model.getValue("/root/codeinfo/codeinfo/codelist["+i+"]/cdid"));
  278. }
  279. }
  280. cmb_outhsrt.refresh();
  281. }
  282. /**
  283. * @group :
  284. * @ver : 2007.07.07
  285. * @by : 양천덕
  286. * @---------------------------------------------------
  287. * @type : function
  288. * @access : public
  289. * @desc : 화면상단정보설정
  290. * @param :
  291. * @return :
  292. * @---------------------------------------------------
  293. */
  294. function fSetParam(){
  295. // 응급환자 화면상단정보 설정
  296. if(grd_patlist.row < 1){
  297. return;
  298. } else {
  299. var sPid = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/pid" );
  300. var sIndd = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/indd" );
  301. var sCretno = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/cretno" );
  302. var sInstcd = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/instcd" );
  303. var param = "E▦"
  304. + sPid + "▦"
  305. + sIndd + "▦"
  306. + sCretno + "▦"
  307. + sInstcd + "▦"
  308. + "▦" ;
  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. }
  313. /**
  314. * @group :
  315. * @ver : 2007.06.21
  316. * @by : 양천덕
  317. * @---------------------------------------------------
  318. * @type : function
  319. * @access : public
  320. * @desc : 응급실 퇴실처리
  321. * @param :
  322. * @return :
  323. * @---------------------------------------------------
  324. */
  325. function fOutRmTret(){
  326. var flag = model.getValue(rdo_outrmflag.attribute("ref"));
  327. //var iRow = grd_patlist.row;
  328. var iRow = grd_patlist.findRow(model.getValue("/root/main/condition/pid"), 1, grd_patlist.colRef("pid"), false, true);
  329. // 환자 선택 여부 체크
  330. if(model.getValue("/root/main/condition/pid") == "" ) {
  331. messageBox("환자가 선택되지", "E007");
  332. model.setFocus("grd_patlist");
  333. return;
  334. }
  335. // 입원으로 인한 퇴원 배정 병실 체크
  336. if(model.getValue("/root/main/condition/outrmtp") =="2" &&
  337. model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/assgroom") == ""){
  338. messageBox("입원 병실 배정이 되지 않았습니다.","E");
  339. return;
  340. }
  341. // 환자 퇴원예고 상태 체크
  342. if(( model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/dschdclrtyn") == "N" ||
  343. model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/dschdclrtyn") == "" ) &&
  344. model.getValue("/root/main/condition/outrmtp") != "2" ){
  345. messageBox("퇴원예고 환자가 아닙니다.", "E");
  346. model.setFocus("grd_patlist");
  347. return;
  348. }
  349. // P-Pneumonia 환자의 간호정보조사지 산소포화도 입력 여부 확인
  350. if( model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/oxyconcen") == "-" &&
  351. model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/recovwardcd") == "05" ) {
  352. messageBox("폐렴 대상자 입니다. 응급간호정보조사의 산소포화도를 기록하십시오 ","E");
  353. fSetParam("nm");
  354. modal("SMMNE04300","1","15","128");
  355. fGetPatList();
  356. fSelectPatList();
  357. return;
  358. }
  359. // 미확인 처방 체크 (2008.10.16)
  360. //if ((model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/uncnfmcnt") != "0")) {
  361. // messageBox("미확인 처방이 있습니다. Order Manage에서 처리하시기 바랍니다.", "E");
  362. // model.setFocus("grd_patlist");
  363. // return;
  364. //}
  365. // 퇴실일시 입력 체크
  366. if(model.getValue("/root/main/condition/outrmdd") == "" ||
  367. model.getValue("/root/main/condition/outrmtm")== ""){
  368. messageBox("퇴실일시를 입력하십시요.", "E");
  369. model.setFocus("ipt_outrddd");
  370. return;
  371. }
  372. // 퇴실일시 내원일시 비교 체크
  373. var eroutdt = model.getValue("/root/main/condition/outrmdd")
  374. + model.getValue("/root/main/condition/outrmtm");
  375. if(model.getValue("/root/main/condition/t_chosdt") > eroutdt ) {
  376. //messageBox("내원/퇴원 일시를 확인하십시요", "E");
  377. messageBox("퇴실일시는 내원일시 이후로 지정해야합니다.", "E");
  378. model.setFocus("ipt_outrdtm");
  379. return;
  380. }
  381. // 퇴실일시 초진진료일시 비교 체크 ('15.10.26 추가)
  382. if(model.getValue("/root/main/condition/t_fstexamorddd") > eroutdt ) {
  383. messageBox("퇴실일시는 초진진료일시 이후로 지정해야합니다.", "E");
  384. return;
  385. }
  386. // 퇴실일시 관련 제어
  387. var nowDate = fTimeSetting();
  388. var dd = getCurrentDate();
  389. var currentdt = dd + nowDate;
  390. if (eroutdt > currentdt) {
  391. messageBox("퇴실일시가 미래일시 입니다.", "E");
  392. model.setFocus("ipt_outrdtm");
  393. return;
  394. }
  395. // 퇴실구분 입력 체크
  396. if(model.getValue("/root/main/condition/outrmtp") == ""){
  397. messageBox("퇴실구분을 선택하십시요.", "E");
  398. model.setFocus("rdo_outrmflag");
  399. return;
  400. }
  401. // 세부사항 입력 체크
  402. if(model.getValue("/root/main/condition/outrmcd") == ""){
  403. messageBox("세부사항을 입력하십시요.", "E");
  404. model.setFocus("cmb_outrmcd");
  405. return;
  406. }
  407. // 사망일시 입력 체크
  408. if(model.getValue("/root/main/condition/outrmtp") == 6){
  409. if(model.getValue("/root/main/condition/dethdd") == "" ||
  410. model.getValue("/root/main/condition/dethtm") == "" ){
  411. messageBox("사망일시를 입력하십시요.", "E");
  412. model.setFocus("ipt_dethdd");
  413. return;
  414. }
  415. }
  416. // 161019_칠곡 센터승격으로 인한 수정_AYS
  417. // 최종진료 구역 체크('15.12.22 - AYS 추가)
  418. if(model.getValue("/root/main/condition/outarea") == ""){
  419. //if(model.getValue("/root/main/condition/outarea") == "" && model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/instcd") == "031"){
  420. messageBox("최종진료구역을 입력하십시요.", "E");
  421. model.setFocus("cmb_outarea");
  422. return;
  423. }
  424. // 161019_칠곡 센터승격으로 인한 수정_AYS
  425. // 입원세부 사항 체크('15.12.22 - AYS 추가)
  426. if(model.getValue("/root/main/condition/outrmtp") == 2){
  427. //if(model.getValue("/root/main/condition/outrmtp") == 2 && model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/instcd") == "031"){
  428. if(model.getValue("/root/main/condition/outhsrt") == ""){
  429. messageBox("입원세부 사항을 입력하십시요.", "E");
  430. model.setFocus("cmb_outhsrt");
  431. return;
  432. }
  433. }
  434. //퇴실구분(전원), 세부사항(기타다른사유로전원)일때 기타사유값 유무체크
  435. if(model.getValue("/root/main/condition/outrmtp") == 3){
  436. if(model.getValue("/root/main/condition/outrmcd") == "28") {
  437. if(model.getValue("/root/main/condition/chnghospchoi") =="") {
  438. messageBox("기타사유를 입력하십시요.", "E");
  439. model.setFocus("ipt_chnghospchoi");
  440. return;
  441. }
  442. }
  443. //전원병원구분 입력값 체크 추가
  444. if(model.getValue("/root/main/condition/dschhosptype") =="") {
  445. messageBox("전원병원 구분을 입력하십시요.", "E");
  446. model.setFocus("cmb_dschhosptype");
  447. return;
  448. }
  449. //응급당직의 SMS 발송
  450. fTransferSMS();
  451. }
  452. // 퇴실구분:귀가 and 세부사항: 기타다른상태로 귀가시 ==> 기타사유 입력 체크
  453. if( (model.getValue("/root/main/condition/outrmtp") == 1) && (model.getValue("/root/main/condition/outrmcd") == 18) ){
  454. if(model.getValue("/root/main/condition/outrmetc") == "" ){
  455. messageBox("기타사유를 입력하십시요.", "E");
  456. model.setFocus("ipt_outrmetc");
  457. return;
  458. }
  459. }
  460. //미시행 검사 처방 존재 여부 체크
  461. // var chktest = "Y";
  462. // for(i=1; i <= getNodesetCount("/root/init/erbaselist/outrminfo");i++ ) {
  463. // if(model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "N" ){
  464. // chktest = "N";
  465. // }
  466. // }
  467. //
  468. // if( chktest == "N" ){
  469. // if ( model.getValue("/root/main/condition/outrmtp") == "2" ) {
  470. // var vbYes = messageBox("미시행 검사 처방이 존재합니다.","Q003");
  471. // if( vbYes != 6 ){
  472. // return;
  473. // }
  474. // }else{
  475. // messageBox("미시행 검사처방이 존재합니다.", "E");
  476. // model.setFocus("grd_testlist");
  477. // return;
  478. // }
  479. // }
  480. //미시행 약,주사 처방 존재 여부 체크
  481. var chking = "";
  482. for(i=1; i <= getNodesetCount("/root/main/incplist/inginfo"); i++ ) {
  483. if(model.getValue("/root/main/incplist/inginfo["+i+"]/execyn") == "N" ){
  484. if(model.getValue("/root/main/incplist/inginfo["+i+"]/prcpkindcdyn") == "Y"){
  485. chking = "OUT";
  486. }else{
  487. chking = "N";
  488. }
  489. }else if(model.getValue("/root/main/incplist/inginfo["+i+"]/execyn") == "DC"){
  490. chking = "DC";
  491. }
  492. }
  493. if(chking == "OUT"){
  494. messageBox("퇴원약확인을 하지 않은 퇴원처방이 존재하여 퇴실처리를 할 수 없습니다.", "E");
  495. model.setFocus("btn_drugsave");
  496. return;
  497. }
  498. if(chking == "N"){
  499. messageBox("미시행 약/주사 처방이 존재하여 퇴실처리를 할 수 없습니다.", "E");
  500. model.setFocus("grd_inglist");
  501. return;
  502. }
  503. if(chking == "DC"){
  504. messageBox("반환요청 약/주사 처방이 존재하여 퇴실처리를 할 수 없습니다.", "E");
  505. model.setFocus("grd_inglist");
  506. return;
  507. }
  508. //퇴원후 외래 처방 체크 & 미시행 검사처방 체크
  509. var sOutPrcp = "";
  510. var sDefineCnt = 0;
  511. for(i=1 ; i < grd_testlist.rows ; i++){
  512. if(model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "OUT" ){
  513. if(sOutPrcp == ""){
  514. sOutPrcp = "퇴원 후 외래 처방이 존재합니다.";
  515. }
  516. sOutPrcp += "\n" + model.getValue("/root/main/incplist/testinfo["+i+"]/prcpnm") ;
  517. }else{
  518. if(model.getValue("/root/main/incplist/testinfo["+i+"]/viewstat") == "-"){
  519. sDefineCnt++;
  520. }
  521. }
  522. }
  523. if(sDefineCnt > 0){
  524. if(model.getValue("/root/main/condition/outrmtp") == "2"){
  525. messageBox(sDefineCnt+" 건의 상태 미설정 데이터가 존재합니다.\n미정설 데이터는 병동이관 됩니다.", "I");
  526. }else{
  527. messageBox("미시행 검사처방이 존재합니다.", "E");
  528. model.setFocus("grd_testlist");
  529. return;
  530. }
  531. }
  532. /* 2013.03.18 KJS 정보위원회 요청에 의해 수술료 체크 로직 삭제
  533. //-----------(20110228) 경북대
  534. // 수술료체크
  535. // * @desc : 체크기능(병동퇴실/응급실퇴실/dsc퇴실)
  536. // 환자정보 조회
  537. //model.removeNodeSet(xPatInfoPath);
  538. //var sPamInfo = getGlobalVariable("paminfo");
  539. //setCSVToNode("/root/main/paminfo",sPamInfo,"pamlist"); //환자정보내리기
  540. //내려받기
  541. model.removenode("/root/main/paminfo");
  542. model.makeNode("/root/main/paminfo");
  543. var node = getGlobalVariable("paminfo");
  544. setCSVToNode("/root/main/paminfo", node);
  545. //체크
  546. var sschk = model.getValue("/root/main/paminfo/list/opfeechkyn"); //수술료체크여부
  547. var sspid = model.getValue("/root/main/paminfo/list/pid");
  548. var ssindd = model.getValue("/root/main/paminfo/list/indd");
  549. var ssdschdd = model.getValue("/root/main/condition/outrmdd"); //퇴원예정일
  550. //alert(sschk + "/" +sspid + "/" + ssindd + "/" + ssdschdd);
  551. if (sschk != "Y") {
  552. messageBox("다음팝업창에서 수술료여부 항목의 'N' 인 경우에 대한 수술료 입력을 의료진에 요청하십시오.", "E");
  553. setParameter("SPMMO21600_param", sspid + "|" + ssindd + "|" + ssdschdd )
  554. modal("SPMMO21600");
  555. clearParameter("SPMMO21600_param");
  556. return ;
  557. }
  558. //-----------(20110228) 경북대
  559. */
  560. var vbYes = messageBox("퇴실처리를 ", "Q004");
  561. if(vbYes == 6){
  562. clearParameter("SMMNE09300_pid");
  563. clearParameter("SMMNE09300_orddd");
  564. clearParameter("SMMNE09300_cretno");
  565. clearParameter("SMMNE09300_outrmcd");
  566. clearParameter("SMMNE09300_outrmdt");
  567. setParameter("SMMNE09300_pid", grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("pid")) );
  568. setParameter("SMMNE09300_orddd", grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("indd")) );
  569. setParameter("SMMNE09300_cretno", grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("cretno")) );
  570. setParameter("SMMNE09300_outrmcd", cmb_outrmcd.label );
  571. setParameter("SMMNE09300_outrmdt", model.getValue("/root/main/condition/outrmdd") + model.getValue("/root/main/condition/outrmtm") );
  572. if (cmb_outrmcd.label == "") {
  573. messageBox("퇴실구분을 입력하세요", "E999");
  574. return;
  575. }
  576. if (model.getValue("/root/main/condition/outrmdd") == "" || model.getValue("/root/main/condition/outrmtm") == "") {
  577. messageBox("퇴실구분을 입력하세요", "E999");
  578. return;
  579. }
  580. //2013.11.27 KJS 응급간호요약지
  581. //modal("SMMNE09300");
  582. //응급관리료 체크
  583. if(model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/g3existyn") == "N"){
  584. var vbNo = messageBox("응급의학료 관리료 처방이 없습니다. 계속 퇴원진행을 ", "Q004");
  585. if(vbNo == 7){
  586. return;
  587. }
  588. }
  589. //퇴원후 외래 처방 확인 메시지
  590. if(sOutPrcp != ""){
  591. messageBox(sOutPrcp, "I");
  592. }
  593. //퇴원결정일시 셋팅(입원 : 입원결정일시 , 기타 : 퇴원예고일시)
  594. var dschdclrdt = "";
  595. if(rdo_outrmflag.value == "2"){
  596. dschdclrdt = model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/inrsrvacptdt");
  597. }else{
  598. dschdclrdt = model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/dschdclrdt");
  599. }
  600. // 2009-05-21 YCD TRIAGE 입력 데이터 검증 부분 추가
  601. var chktrnValue = fChkTriageData(iRow);
  602. if( chktrnValue == "false" || chktrnValue == "" ){
  603. return;
  604. }
  605. fChkOcrPrntList(iRow);
  606. //정상 퇴실시 type2 기록 parameter 설정
  607. var sTar_pid = model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/pid" );
  608. var sTar_indd = model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/indd" );
  609. var sTar_cretno = model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/cretno" );
  610. var sTar_instcd = model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/instcd" );
  611. var sChnghospnm = model.getValue("/root/main/condition/chnghospnm");
  612. var sChnghospcd = model.getValue("/root/main/condition/chnghospcd");
  613. var sChnghospnmetc = model.getValue("/root/main/condition/chnghospnmetc");
  614. if (sChnghospnm == "기타" && sChnghospnmetc != "") {
  615. sChnghospnm = sChnghospnmetc;
  616. /*if (sChnghospcd == "") {
  617. sChnghospcd = "H900000" + model.getValue("/root/main/condition/dschhosptype");
  618. }*/
  619. }
  620. var sSrchData = "";
  621. var sSrchHeader = "pid▦indd▦cretno▦visitno▦outrmdd▦outrmtm▦outrmcd▦chnghospnm▦chnghospcd▦dethdd▦dethtm▦dethyn▦healcaretgdyn▦proceraprvyn▦chnghospchoi▦eroutdt▦instcd▦dschdclrdt▦outrmtp▦outrmetc▦dschhosptype▦outarea▦outhsrt▩";
  622. var sSrchData = model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/pid" )+"▦"
  623. + model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/indd" )+"▦"
  624. + model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/cretno" )+"▦"
  625. + model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/visitno" )+"▦"
  626. + model.getValue("/root/main/condition/outrmdd" )+"▦"
  627. + model.getValue("/root/main/condition/outrmtm" )+"▦"
  628. + model.getValue("/root/main/condition/outrmcd" )+"▦"
  629. + sChnghospnm +"▦"
  630. + sChnghospcd +"▦"
  631. + model.getValue("/root/main/condition/dethdd" )+"▦"
  632. + model.getValue("/root/main/condition/dethtm" )+"▦"
  633. + model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/dethyn" )+"▦"
  634. + model.getValue("/root/main/condition/healcaretgdyn" )+"▦"
  635. + model.getValue("/root/main/condition/proceraprvyn" )+"▦"
  636. + model.getValue("/root/main/condition/chnghospchoi" )+"▦"
  637. + eroutdt +"▦"
  638. + model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/instcd" )+"▦"
  639. + dschdclrdt +"▦"
  640. + model.getValue("/root/main/condition/outrmtp" )+"▦"
  641. + model.getValue("/root/main/condition/outrmetc" )+"▦"
  642. + model.getValue("/root/main/condition/dschhosptype" )+"▦"
  643. + model.getValue("/root/main/condition/outarea" )+"▦"
  644. + model.getValue("/root/main/condition/outhsrt" )+"▩";
  645. //+ "er"+
  646. model.removenode("/root/send");
  647. model.makeValue("/root/send/outrmtret", sSrchHeader + sSrchData);
  648. var sSrchData = "";
  649. var sSrchHeader = "section▩";
  650. var sSrchData = model.getValue("/root/main/condition/section")+"▩";
  651. model.makeValue("/root/send/searchinfo", sSrchHeader + sSrchData);
  652. //선택 행 셀 색상 초기화
  653. //grd_patlist.allstyle("all", "background-color") = "white";
  654. model.makeValue("/root/temp/printinfo/erordeptnm" , grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("erordeptnm" )));
  655. model.makeValue("/root/temp/printinfo/patnm" , grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("patnm" )));
  656. model.makeValue("/root/temp/printinfo/pid" , grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("pid" )));
  657. model.makeValue("/root/temp/printinfo/chosdt" , grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("chosdt" )));
  658. model.makeValue("/root/temp/printinfo/dschdclrdt" , grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("dschdclrdt" )));
  659. model.makeValue("/root/temp/printinfo/outdt" , ipt_outrddd.value + ipt_outrmtm.value);
  660. model.makeValue("/root/temp/printinfo/ermedispclnm", grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("ermedispclnm")));
  661. model.makeValue("/root/temp/printinfo/nursnm" , grd_patlist.valueMatrix(grd_patlist.row, grd_patlist.colRef("nursnm" )));
  662. model.makeValue("/root/temp/printinfo/curdd" , getCurrentDate());
  663. var instcd = getUserInfo("dutplceinstcd");
  664. var pid = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/pid");
  665. var indd = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/indd");
  666. var cretno = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/cretno");
  667. var prewardcd = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/prewardcd");
  668. var chngwardcd = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/wardcd");
  669. //alert(pid);
  670. if(submit("TXMNE00201", false)== true){
  671. //퇴실결과가 입원인 경우 타부서 미수행 진료재료 이관 2013.12.18 KJS
  672. if (model.getValue("/root/main/condition/outrmtp") == "2") {
  673. model.removenode("/root/send/prcpinfo");
  674. model.makeValue("/root/send/prcpinfo/instcd", instcd);
  675. model.makeValue("/root/send/prcpinfo/pid", pid);
  676. model.makeValue("/root/send/prcpinfo/indd", indd);
  677. model.makeValue("/root/send/prcpinfo/cretno", cretno);
  678. model.makeValue("/root/send/prcpinfo/prewardcd", prewardcd);
  679. submit("TRMNW01307");
  680. if(model.getValue("/root/main/prcpinfo/prcpyn") == "Y"){ // 부서이관 할 처방이 있는경우
  681. setParameter("PARAM1", instcd);
  682. setParameter("PARAM2", pid);
  683. setParameter("PARAM3", indd);
  684. setParameter("PARAM4", cretno);
  685. setParameter("PARAM5", prewardcd);
  686. setParameter("PARAM6", chngwardcd);
  687. open("SPMNW19001","1", "900", "450");
  688. }
  689. }
  690. if(flag != "2") {
  691. //model.copyNode("/root/temp/printinfo/rsrvinfo", model.getValue("/root/main/rsrvinfo"));
  692. model.makeNode("/root/temp/printinfo/rsrvinfo");
  693. copyNodesetType("/root/temp/printinfo/rsrvinfo", "/root/main/rsrvinfo");
  694. exeReportPreview("RPMNE00120","XMLSTR","/root/temp/printinfo", "", "true", "", "", "", "", "true", "", "", "", "");
  695. }
  696. TextStmtInfo = "";
  697. //20111208_KNUH_Start 간호일지 내역 부분 수정.
  698. //Type2 저장 부분
  699. if(model.getValue("/root/main/condition/outrmtp") == "1"){
  700. TextStmtInfo = model.getValue("/root/init/erbaselist/outrminfo[basetypecd='"+cmb_outrmcd.value+"']/typedetl");
  701. if(cmb_outrmcd.value == "18"){
  702. TextStmtInfo = cmb_outrmcd.label + "(" + model.getValue("/root/main/condition/outrmetc") + ")" ;
  703. }
  704. TextStmtInfo += ". 응급실 퇴실함.";
  705. }else if(model.getValue("/root/main/condition/outrmtp") == "3"){
  706. TextStmtInfo = model.getValue("/root/init/erbaselist/outrminfo[basetypecd='"+cmb_outrmcd.value+"']/typedetl");
  707. if(cmb_outrmcd.value == "28"){
  708. TextStmtInfo += "(" + ipt_chnghospchoi.value + ")" ;
  709. }
  710. TextStmtInfo += ". 응급실 퇴실함.";
  711. if(cmb_dschhosptype.label != ""){
  712. TextStmtInfo += "\n병원구분 : " + cmb_dschhosptype.label;
  713. }
  714. if(ipt_chnghosnm.value != ""){
  715. TextStmtInfo += " 병원명 : " + ipt_chnghosnm.value;
  716. }
  717. }else if(model.getValue("/root/main/condition/outrmtp") == "9"){
  718. TextStmtInfo = model.getValue("/root/init/erbaselist/outrminfo[basetypecd='"+cmb_outrmcd.value+"']/typedetl") + ". 응급실 퇴실함.";
  719. }else if (model.getValue("/root/main/condition/outrmtp") == "8"){
  720. TextStmtInfo = ipt_chnghospchoi2.value + ". 응급실 퇴실함.";
  721. }else if (model.getValue("/root/main/condition/outrmtp") == "6"){
  722. TextStmtInfo = model.getValue("/root/init/erbaselist/outrminfo[basetypecd='"+cmb_outrmcd.value+"']/typedetl") + ". 응급실 퇴실함.";
  723. } else{
  724. TextStmtInfo = model.getValue("/root/init/erbaselist/outrminfo[basetypecd='"+cmb_outrmcd.value+"']/typedetl") + ". 응급실 퇴실함.";
  725. }
  726. //20111208_KNUH_End 간호일지 내역 부분 수정.
  727. setParameter("SMMNR03400_ParamBase", "recflag▦dutplaccd▦reclnkkey▩E▦010▦"+ sTar_pid + "," + sTar_indd + "," + sTar_cretno + "," + sTar_instcd+"▩");
  728. setParameter("SMMNR03400_ParamSaveText", "S▦A▦"+ipt_outrddd.value+ipt_outrmtm.value+"▦"+TextStmtInfo+"▩");
  729. modal("SMMNR03400");
  730. grd_patlist.rebuildStyle();
  731. ipt_chnghospchoi2.visible = false;
  732. fInitSettingTop();
  733. sTar_pid = "";
  734. sTar_indd = "";
  735. sTar_cretno = "";
  736. sTar_instcd = "";
  737. fInotSetNode();
  738. }else {
  739. //model.removeNodeset("/root/main/inddpatlist/inddpatinfo");
  740. //fGetPatList();
  741. //grd_patlist.rebuildStyle();
  742. fInotSetNode();
  743. }
  744. //var tRow = grd_patlist.rows;
  745. //for(i= 0 ; i < tRow ; i ++ ){
  746. // if(model.getValue("/root/main/inddpatlist/inddpatinfo["+i+"]/dschdclrtyn") == "Y"){
  747. // //퇴원예고 환자에 대해 셀 색상 지정
  748. // grd_patlist.cellstyle("background-color", i, 0, i, 4) = "#ffd3ff";
  749. // }
  750. //}
  751. fGetPatList();
  752. fSelectPatList();
  753. if(sTar_pid != ""){
  754. grd_patlist.row = grd_patlist.findRow(sTar_pid, 0, grd_patlist.colRef("pid"));
  755. grd_patlist.topRow = grd_patlist.row;
  756. }
  757. }else{
  758. return;
  759. }
  760. }
  761. /**
  762. * @group :
  763. * @ver : 2009.07.02
  764. * @by : 양천덕
  765. * @---------------------------------------------------
  766. * @type : function
  767. * @access : public
  768. * @desc : 응급실 퇴실환자 재증명 조회
  769. * @param :
  770. * @return :
  771. * @---------------------------------------------------
  772. */
  773. function fChkOcrPrntList(iRow){
  774. var ErOcrChkRtnValue = "true";
  775. model.removenode("/root/send");
  776. model.makeValue("/root/send/reqdata/pid" , model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/pid" ));
  777. model.makeValue("/root/send/reqdata/orddd" , model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/indd" ));
  778. model.makeValue("/root/send/reqdata/cretno" , model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/cretno" ));
  779. submit("TRMNE00205", false);
  780. mesgcnt = 0 ;
  781. var sMsgCmmt = "";
  782. if(getNodesetCount("/root/init/ocrchkinfo/ocrchklist") > 0 ){
  783. for(var i = 1 ; i <= getNodesetCount("/root/init/ocrchkinfo/ocrchklist") ; i++){
  784. if(model.getValue("/root/init/ocrchkinfo/ocrchklist[" + i + "]/eroutchkocr") == "Y"){
  785. mesgcnt++;
  786. }
  787. sMsgCmmt = model.getValue("/root/init/ocrchkinfo/ocrchklist[" + i + "]/ocrfromrecdeptnm") + "에서 작성한 "
  788. + model.getValue("/root/init/ocrchkinfo/ocrchklist[" + i + "]/ocrformnm") + "가(이) 있습니다. 확인하십시오.\n\n"
  789. }
  790. }
  791. if(rdo_outrmflag.value == "3" && mesgcnt == 0){
  792. messageBox("전원소견서 작성 내역이 존재하지 않습니다. 확인하십시요!" , "C000");
  793. }
  794. if(sMsgCmmt != ""){
  795. messageBox(sMsgCmmt , "I000");
  796. }
  797. }
  798. /**
  799. * @group :
  800. * @ver : 2009.05.21
  801. * @by : 양천덕
  802. * @---------------------------------------------------
  803. * @type : function
  804. * @access : public
  805. * @desc : TRIAGE 입력 데이터 검증 부분 추가
  806. * @param :
  807. * @return :
  808. * @---------------------------------------------------
  809. */
  810. function fChkTriageData(iRow){
  811. var ErOutChkRtnValue = "true";
  812. model.removenode("/root/send");
  813. model.makeValue("/root/send/reqdata/pid" , model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/pid" ));
  814. model.makeValue("/root/send/reqdata/orddd" , model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/indd" ));
  815. model.makeValue("/root/send/reqdata/cretno" , model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/cretno" ));
  816. model.makeValue("/root/send/reqdata/chosdt" , model.getValue("/root/main/inddpatlist/inddpatinfo" +"["+iRow+"]/chosdt" ));
  817. model.makeValue("/root/send/reqdata/eroutdt" , ipt_outrddd.value + ipt_outrmtm.value + "00");
  818. model.makeValue("/root/send/reqdata/queryflag" , "K");
  819. /*
  820. model.makeValue("/root/send/reqdata/pid" , "19509091");
  821. model.makeValue("/root/send/reqdata/orddd" , "20081003");
  822. model.makeValue("/root/send/reqdata/cretno" , "1");
  823. model.makeValue("/root/send/reqdata/queryflag" , "K");
  824. */
  825. submit("TRMNE04403", false);
  826. if(getNodesetCount("/root/main/ertriage/ertriage") < 1 ){
  827. messageBox("TRIAGE 기록이 존재하지 않습니다.", "E");
  828. return "false";
  829. }
  830. var ce_chosdt = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/chosdt" ); //내원일시
  831. var ce_pid = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/pid" ); //환자번호
  832. var ce_indd = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/indd" ); //입원일자
  833. var ce_cretno = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/cretno" ); //생성번호
  834. var ce_instcd = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/instcd" ); //기관코드
  835. var ce_outrmcd = model.getValue("/root/main/condition/outrmtp" ); //퇴실구분
  836. var ce_outrmdt = model.getValue("/root/main/condition/outrmdd" ) //퇴실일자
  837. + model.getValue("/root/main/condition/outrmtm" ); //퇴실시간
  838. var tr_chkflag = model.getValue("/root/main/ertriage/ertriage/chkflag" ); //D : DOA 체크로직, E : 진료외 방문 체크로직, X : 기본 체크로직
  839. var tr_age = model.getValue("/root/main/ertriage/ertriage/age" ); //나이
  840. var tr_sex = model.getValue("/root/main/ertriage/ertriage/sex" ); //성별
  841. var tr_serdiagflag = model.getValue("/root/main/ertriage/ertriage/serdiagflag" ); //중증도구분
  842. var tr_mainsympcd = model.getValue("/root/main/ertriage/ertriage/mainsympcd" ); //주증상코드
  843. var tr_attackdd = model.getValue("/root/main/ertriage/ertriage/attackdd" ); //발병일자
  844. var tr_attacktm = model.getValue("/root/main/ertriage/ertriage/attacktm" ); //발병시간
  845. var tr_cscsflag = model.getValue("/root/main/ertriage/ertriage/cscsflag" ); //의식구분
  846. var tr_painflag = model.getValue("/root/main/ertriage/ertriage/painflag" ); //통증구분
  847. var tr_chospathflag = model.getValue("/root/main/ertriage/ertriage/chospathflag" ); //내원경로구분
  848. var tr_choswayflag = model.getValue("/root/main/ertriage/ertriage/choswayflag" ); //내원수단구분
  849. var tr_chosresnflag = model.getValue("/root/main/ertriage/ertriage/chosresnflag" ); //내원사유구분
  850. var tr_intenflag = model.getValue("/root/main/ertriage/ertriage/intenflag" ); //의도성구분
  851. var tr_injmechflag = model.getValue("/root/main/ertriage/ertriage/injmechflag" ); //손상기전구분
  852. var tr_acdownflag = model.getValue("/root/main/ertriage/ertriage/acdownflag" ); //사고본인구분
  853. var tr_highbp = model.getValue("/root/main/ertriage/ertriage/highbp" ); //수축기혈압
  854. var tr_lowbp = model.getValue("/root/main/ertriage/ertriage/lowbp" ); //이완기혈압
  855. var tr_mntpulsecnt = model.getValue("/root/main/ertriage/ertriage/mntpulsecnt" ); //분당맥박수
  856. var tr_mntbrethcnt = model.getValue("/root/main/ertriage/ertriage/mntbrethcnt" ); //분당호흡수
  857. var tr_chosbdtp = model.getValue("/root/main/ertriage/ertriage/chosbdtp" ); //내원시체온
  858. var tr_oxyconcen = model.getValue("/root/main/ertriage/ertriage/oxyconcen" ); //산소포화도
  859. var tr_algyflag = model.getValue("/root/main/ertriage/ertriage/algyflag" ); //알러지구분
  860. var tr_pasthistflag = model.getValue("/root/main/ertriage/ertriage/pasthistflag" ); //과거력구분
  861. var tr_proceqmtflag = model.getValue("/root/main/ertriage/ertriage/proceqmtflag" ); //보호장구구분
  862. var tr_patnm = model.getValue("/root/main/ertriage/ertriage/patnm" ); //환자성명
  863. var tr_algyetccnts = model.getValue("/root/main/ertriage/ertriage/algyetccnts" ); //알러지기타내용
  864. var tr_pasthistetccnts = model.getValue("/root/main/ertriage/ertriage/pasthistetccnts" ); //과거력기타내용
  865. var tr_fstexamorddd = model.getValue("/root/main/ertriage/ertriage/fstexamorddd" ); //초진진료일자
  866. var tr_fstexamordtm = model.getValue("/root/main/ertriage/ertriage/fstexamordtm" ); //초진진료시간
  867. var tr_mainsympcd1 = model.getValue("/root/main/ertriage/ertriage/mainsympcd1" ); //주증상코드
  868. var tr_mainsympcdno1 = model.getValue("/root/main/ertriage/ertriage/mainsympcdno1" ); //주중상코드번호
  869. var tr_mainsympnm1 = model.getValue("/root/main/ertriage/ertriage/mainsympnm1" ); //주증상명
  870. var tr_mainsympcd2 = model.getValue("/root/main/ertriage/ertriage/mainsympcd2" ); //주증상코드
  871. var tr_mainsympcdno2 = model.getValue("/root/main/ertriage/ertriage/mainsympcdno2" ); //주중상코드번호
  872. var tr_mainsympnm2 = model.getValue("/root/main/ertriage/ertriage/mainsympnm2" ); //주증상명
  873. var tr_etcsymp = model.getValue("/root/main/ertriage/ertriage/etcsymp" ); //기타증상
  874. var tr_acdowndetailflag = model.getValue("/root/main/ertriage/ertriage/acdowndetailflag" ); //교통사고 당사자상세구분
  875. var tr_inhosptype = model.getValue("/root/main/ertriage/ertriage/inhosptype" ); //전원보낸의료기관의유형
  876. var tr_dsid = model.getValue("/root/main/ertriage/ertriage/dsid" ); //재난번호
  877. var tr_reid = model.getValue("/root/main/ertriage/ertriage/reid" ); //구급활동일지일련번호
  878. if( (tr_highbp == "" || tr_lowbp == "" || tr_mntpulsecnt == "" || tr_mntbrethcnt == "" || tr_chosbdtp == "") && (tr_mainsympcd !="D0000001") ){
  879. messageBox("TRIAGE 기록 오류 : V/S 누락정보가 존재 합니다.","E");
  880. return "false";
  881. }
  882. if (tr_mainsympcd !="D0000001" ) // 신종플루 환자는 트리아제를 체크 하지 않는다...
  883. {
  884. switch(tr_chkflag){
  885. case "X" : //기본 체크 로직
  886. // V/S 간호사(15세 이상이며 사망환자가 아닐경우)
  887. if( tr_age >= 15 && ce_outrmcd != "4" ){
  888. if( tr_highbp == "" || (( tr_highbp > 300 || tr_highbp < 0 ) && tr_highbp != -1 && tr_highbp != 999 )) {
  889. messageBox("TRIAGE 기록 오류 : 수축기혈압은 0~300이어야 합니다.","E");
  890. return "false";
  891. }
  892. if( tr_lowbp == "" || (( tr_lowbp > 300 || tr_lowbp < 0 ) && tr_lowbp != -1 && tr_lowbp != 999 )) {
  893. messageBox("TRIAGE 기록 오류 : 이완기혈압은 0~300이어야 합니다.","E");
  894. return "false";
  895. }
  896. if( tr_mntpulsecnt == "" || (( tr_mntpulsecnt > 300 || tr_mntpulsecnt < 0 ) && tr_mntpulsecnt != -1 && tr_mntpulsecnt != 999 )) {
  897. messageBox("TRIAGE 기록 오류 : 분당맥박수는 0~300이어야 합니다.","E");
  898. return "false";
  899. }
  900. if( tr_mntbrethcnt == "" || (( tr_mntbrethcnt > 99 || tr_mntbrethcnt < 0 ) && tr_mntbrethcnt != -1 && tr_mntbrethcnt != 999 )) {
  901. messageBox("TRIAGE 기록 오류 : 분당호흡수는 0~99이어야 합니다.","E");
  902. return "false";
  903. }
  904. if( tr_chosbdtp == "" || (( tr_chosbdtp > 45 || tr_chosbdtp < 20 ) && tr_chosbdtp != -1 && tr_chosbdtp != 99.9 )) {
  905. messageBox("TRIAGE 기록 오류 : 내원시체온은 20.0~45.0이어야 합니다.","E");
  906. return "false";
  907. }
  908. // 15.12.23 - AYS 추가
  909. if( tr_oxyconcen == "" || (( tr_oxyconcen > 100 || tr_oxyconcen < 0 ) && tr_oxyconcen != -1 && tr_oxyconcen != 999 )) {
  910. messageBox("TRIAGE 기록 오류 : 산소포화도는 0~100이어야 합니다.","E");
  911. return "false";
  912. }
  913. //의사
  914. if( tr_cscsflag == "A" && tr_lowbp != -1 && tr_lowbp != 999 && tr_mntbrethcnt != -1 && tr_mntbrethcnt != 999 && ( tr_highbp <= 30 || tr_mntbrethcnt <= 6 ) ){
  915. messageBox("TRIAGE 기록 오류 : 의식구분이 Alert일 경우 수축기 혈압은 > 30 이여야 하며 호흡수는 > 6 이여야 합니다.","E");
  916. return "false";
  917. }
  918. }
  919. if( eval(tr_highbp) < eval(tr_lowbp) ){
  920. messageBox("TRIAGE 기록 오류 : 수축기 혈압이 이완기 혈압보다 낮게 기록되었습니다.","E");
  921. return "false";
  922. }
  923. if( ce_chosdt > getCurrentDate() + getCurrentTime() ){
  924. messageBox("내원 일시가 현재 일시보다 늦게 입력되었습니다.","E");
  925. return "false";
  926. }
  927. if ( tr_attackdd == "11111111" && tr_attacktm != "1111" ){
  928. messageBox("TRIAGE 기록 오류 : 발병 일자가 '11111111' 경우 발병 시간은 '1111'로 입력 되어야 합니다.","E");
  929. return "false";
  930. }
  931. if( tr_attackdd + tr_attacktm > getCurrentDate() + getCurrentTime() ){
  932. messageBox("TRIAGE 기록 오류 : 발병 일시가 현재 일시보다 늦게 입력되었습니다.","E");
  933. return "false";
  934. }
  935. if ( tr_attackdd + tr_attacktm > ce_chosdt ){
  936. messageBox("TRIAGE 기록 오류 : 발병 일시가 내원 일시보다 늦게 입력되었습니다.","E");
  937. return "false";
  938. }
  939. if( ce_chosdt > ce_outrmdt ){
  940. messageBox("내원 일시가 퇴원 일시보다 늦게 입력되었습니다.","E");
  941. return "false";
  942. }
  943. if( tr_mainsympcd == "" ){
  944. messageBox("TRIAGE 기록 오류 : 주증상 정보가 미입력되었습니다.", "E");
  945. return "false";
  946. }
  947. //발병일시 체크
  948. if( (tr_attackdd + tr_attacktm).length < 12 || tr_attackdd + tr_attacktm > ce_chosdt ) {
  949. messageBox("TRIAGE 기록 오류 : 발병일시를 확인하십시요.", "E");
  950. return "false";
  951. }
  952. if( tr_age <= 5 && tr_intenflag == "2" ){
  953. messageBox("TRIAGE 기록 오류 : 연령이 5세 이하인 경우 의도성 여부는 자살, 자해로 입력할 수 없습니다.", "E");
  954. return "false";
  955. }
  956. if( tr_cscsflag == "-" || tr_cscsflag == "" ){
  957. messageBox("TRIAGE 기록 오류 : 의식구분이 입력되지 않았습니다.", "E");
  958. return "false";
  959. }
  960. if( tr_choswayflag == "-" || tr_choswayflag == "" ){
  961. messageBox("TRIAGE 기록 오류 : 내원수단이 입력되지 않았습니다.", "E");
  962. return "false";
  963. }
  964. if( tr_chosresnflag == "-" || tr_chosresnflag == "" ){
  965. messageBox("TRIAGE 기록 오류 : 내원사유가 입력되지 않았습니다.", "E");
  966. return "false";
  967. }
  968. if( tr_chospathflag == "-" || tr_chospathflag == "" ){
  969. messageBox("TRIAGE 기록 오류 : 내원경로가 입력되지 않았습니다.", "E");
  970. return "false";
  971. }
  972. if( (tr_injmechflag == "01" || tr_injmechflag == "02" || tr_injmechflag == "03" || tr_injmechflag == "04" ||
  973. tr_injmechflag == "05" || tr_injmechflag == "06" || tr_injmechflag == "07" || tr_injmechflag == "08" ||
  974. tr_injmechflag == "09" ) && ( tr_acdowndetailflag == "" || tr_proceqmtflag == "" )){
  975. messageBox("TRIAGE 기록 오류 : 교통사고인 경우 교통사고 손상당사자 항목이 입력되어야 하고 \n또한 보호장구항목도 하나이상 입력되어야 합니다.","E");
  976. return "false";
  977. }
  978. if( tr_chosresnflag == "2" && ( tr_intenflag == "" || tr_intenflag == "-" || tr_injmechflag == "" || tr_injmechflag == "-" )){
  979. messageBox("TRIAGE 기록 오류 : 내원사유가 질병외인 경우 의도성, 손상기전 값은 모두 입력되어야 합니다.", "E");
  980. return "false";
  981. }
  982. if( tr_chospathflag == "2" && ( tr_inhosptype == "" || tr_inhosptype == "-" ) ){
  983. messageBox("TRIAGE 기록 오류 : 내원경로가 외부에서 전원일 경우 전원 보낸 의료기관 종류를 입력해야 합니다.","E");
  984. return "false";
  985. }
  986. if ( tr_choswayflag == "1" && ( tr_dsid == "" || tr_reid == "" ) ){
  987. messageBox("TRIAGE 기록 오류 : 내원수단이 119구급차일 경우 재난번호와 구급활동일지인련번호를 입력해야 합니다.","E");
  988. return "false";
  989. }
  990. break;
  991. case "E" : //진료외 방문 체크 로직
  992. if(tr_chosresnflag != "3"){
  993. messageBox("TRIAGE 기록 오류 : 내원사유를 진료외 방문으로 입력하십시오.", "E");
  994. return false;
  995. }
  996. break;
  997. case "D" : // DOA 환자 체크로직
  998. // V/S 간호사
  999. if( tr_chosbdtp == "" || (( tr_chosbdtp > 45 || tr_chosbdtp < 0 ) && tr_chosbdtp != -1 && tr_chosbdtp != 99.9 )) {
  1000. messageBox("TRIAGE 기록 오류 : 내원시체온 정보 확인 하십시오.","E");
  1001. return "false";
  1002. }
  1003. if( eval(tr_highbp) < eval(tr_lowbp) ){
  1004. messageBox("TRIAGE 기록 오류 : 수축기 혈압이 이완기 혈압보다 낮게 기록되었습니다.","E");
  1005. return "false";
  1006. }
  1007. // 의사
  1008. if( tr_cscsflag != "U" ){
  1009. messageBox("TRIAGE 기록 오류 : DOA환자일 경우 내원시 반응은 Unresponsive 이여야 합니다.","E");
  1010. return "false";
  1011. }
  1012. if( ce_chosdt > getCurrentDate() + getCurrentTime() ){
  1013. messageBox("내원 일시가 현재 일시보다 늦게 입력되었습니다.","E");
  1014. return "false";
  1015. }
  1016. if ( tr_attackdd == "11111111" && tr_attacktm != "1111" ){
  1017. messageBox("TRIAGE 기록 오류 : 발병 일자가 '11111111' 경우 발병 시간은 '1111'로 입력 되어야 합니다.","E");
  1018. return "false";
  1019. }
  1020. if( tr_attackdd + tr_attacktm > getCurrentDate() + getCurrentTime() ){
  1021. messageBox("TRIAGE 기록 오류 : 발병 일시가 현재 일시보다 늦게 입력되었습니다.","E");
  1022. return "false";
  1023. }
  1024. if ( tr_attackdd + tr_attacktm > ce_chosdt ){
  1025. messageBox("TRIAGE 기록 오류 : 발병 일시가 내원 일시보다 늦게 입력되었습니다.","E");
  1026. return "false";
  1027. }
  1028. if( ce_chosdt > ce_outrmdt ){
  1029. messageBox("내원 일시가 퇴원 일시보다 늦게 입력되었습니다.","E");
  1030. return "false";
  1031. }
  1032. if( tr_mainsympcd == "" ){
  1033. messageBox("TRIAGE 기록 오류 : 주증상 정보가 미입력되었습니다.", "E");
  1034. return "false";
  1035. }
  1036. //발병일시 체크
  1037. if( (tr_attackdd + tr_attacktm).length < 12 || tr_attackdd + tr_attacktm > ce_chosdt ) {
  1038. messageBox("TRIAGE 기록 오류 : 발병일시를 확인하십시요.", "E");
  1039. return "false";
  1040. }
  1041. if( tr_age <= 5 && tr_intenflag == "2"){
  1042. messageBox("TRIAGE 기록 오류 : 연령이 5세 이하인 경우 의도성 여부는 자살, 자해로 입력할 수 없습니다.", "E");
  1043. return "false";
  1044. }
  1045. if( tr_cscsflag == "-" || tr_cscsflag == "" ){
  1046. messageBox("TRIAGE 기록 오류 : 의식구분이 입력되지 않았습니다.", "E");
  1047. return "false";
  1048. }
  1049. if( tr_choswayflag == "-" || tr_choswayflag == "" ){
  1050. messageBox("TRIAGE 기록 오류 : 내원수단이 입력되지 않았습니다.", "E");
  1051. return "false";
  1052. }
  1053. if( tr_chosresnflag == "-" || tr_chosresnflag == "" ){
  1054. messageBox("TRIAGE 기록 오류 : 내원사유가 입력되지 않았습니다.", "E");
  1055. return "false";
  1056. }
  1057. if( tr_chospathflag == "-" || tr_chospathflag == "" ){
  1058. messageBox("TRIAGE 기록 오류 : 내원경로가 입력되지 않았습니다.", "E");
  1059. return "false";
  1060. }
  1061. if( (tr_injmechflag == "01" || tr_injmechflag == "02" || tr_injmechflag == "03" || tr_injmechflag == "04" ||
  1062. tr_injmechflag == "05" || tr_injmechflag == "06" || tr_injmechflag == "07" || tr_injmechflag == "08" ||
  1063. tr_injmechflag == "09" ) && ( tr_acdowndetailflag == "" || tr_proceqmtflag == "" ) ){
  1064. messageBox("TRIAGE 기록 오류 : 교통사고인 경우 교통사고 손상당사자 항목이 입력되어야 하고 \n또한 보호장구항목도 하나이상 입력되어야 합니다.","E");
  1065. return "false";
  1066. }
  1067. if(tr_chosresnflag == "2" && ( tr_intenflag == "" || tr_intenflag == "-" || tr_injmechflag == "" || tr_injmechflag == "-" )){
  1068. messageBox("TRIAGE 기록 오류 : 내원사유가 질병외인 경우 의도성, 손상기전 값은 모두 입력되어야 합니다.", "E");
  1069. return "false";
  1070. }
  1071. if( tr_chospathflag == "2" && ( tr_inhosptype == "" || tr_inhosptype == "-" ) ){
  1072. messageBox("TRIAGE 기록 오류 : 내원경로가 외부에서 전원일 경우 전원 보낸 의료기관 종류를 입력해야 합니다.","E");
  1073. return "false";
  1074. }
  1075. if ( tr_choswayflag == "1" && ( tr_dsid == "" || tr_reid == "" ) ){
  1076. messageBox("TRIAGE 기록 오류 : 내원수단이 119구급차일 경우 재난번호와 구급활동일지인련번호를 입력해야 합니다.","E");
  1077. return "false";
  1078. }
  1079. break;
  1080. }
  1081. }
  1082. return ErOutChkRtnValue;
  1083. }
  1084. /**
  1085. * @group :
  1086. * @ver : 2007.06.21
  1087. * @by : 양천덕
  1088. * @---------------------------------------------------
  1089. * @type : function
  1090. * @access : public
  1091. * @desc : 그리드 선택 컨트롤
  1092. * @param :
  1093. * @return :
  1094. * @---------------------------------------------------
  1095. */
  1096. function fSelectGridRowCtrl(pPath, pFlag){
  1097. //선택row 초기화
  1098. var iRow = "";
  1099. var iRow = "";
  1100. var sRow = "";
  1101. var tRow = "";
  1102. var chkNode1 = "";
  1103. var chkNode2 = "";
  1104. //검사 그리드 선택 시 발생
  1105. if(pFlag == "T"){
  1106. iRow = grd_testlist.row;
  1107. sRow = grd_testlist.selectedRows;
  1108. eRow = grd_testlist.selectedRow(0);
  1109. tRow = grd_testlist.rows;
  1110. chkNode1 = "/selectyn";
  1111. chkNode2 = "/testtp";
  1112. //약,주사 그리드 선택 시 발생
  1113. }else if(pFlag == "I"){
  1114. //grd_inglist.setfocus
  1115. // model.setfocus("grd_inglist", true);
  1116. iRow = grd_inglist.row;
  1117. sRow = grd_inglist.selectedRows;
  1118. eRow = grd_inglist.selectedRow(0);
  1119. tRow = grd_inglist.rows;
  1120. chkNode1 = "/selectyn";
  1121. chkNode2 = "/prcpkindcdyn";
  1122. //alert(sRow);
  1123. }
  1124. if(eRow < "0"){
  1125. return;
  1126. } else {
  1127. if(pFlag == "T"){
  1128. if(tRow != "1"){
  1129. // ctrl키 누른 상태에서 그리드 클릭시 선택된 모든 행 상태값 변경
  1130. if(event.ctrlKey == 1){
  1131. if(model.getValue(pPath+"["+iRow+"]"+chkNode1) != "Y" ){
  1132. //&& model.getValue(pPath+"["+iRow+"]"+chkNode2)== "Y" ) {
  1133. model.setValue(pPath+"["+iRow+"]"+chkNode1, "Y");
  1134. } else {
  1135. model.setValue(pPath+"["+iRow+"]"+chkNode1, "");
  1136. }
  1137. }
  1138. // shift키 누른 상태에서 선택행과 마지막 선택행 사이의 그리드 상태값 변경
  1139. else if(event.shiftKey == 1){
  1140. for(i =1 ; i < tRow ; i++){
  1141. model.setValue(pPath+"["+i+"]"+chkNode1, "");
  1142. }
  1143. if(iRow == eRow){
  1144. for(i = iRow ; i < iRow+sRow ; i++) {
  1145. if(model.getValue(pPath+"["+i+"]"+chkNode1) != "Y" ){
  1146. // && model.getValue(pPath+"["+iRow+"]"+chkNode2)== "Y" ) {
  1147. model.setValue(pPath+"["+i+"]"+chkNode1, "Y");
  1148. }
  1149. }
  1150. }else{
  1151. for(i = eRow; i <= iRow ; i ++ ){
  1152. if(model.getValue(pPath+"["+i+"]"+chkNode1) != "Y" ){
  1153. // && model.getValue(pPath+"["+iRow+"]"+chkNode2)== "Y" ) {
  1154. model.setValue(pPath+"["+i+"]"+chkNode1, "Y");
  1155. }
  1156. }
  1157. }
  1158. }
  1159. // 마우스 드래그를 하여 그리드의 로우 선택시 상태값 변경
  1160. else {
  1161. for(i =1 ; i < tRow ; i++){
  1162. model.setValue(pPath+"["+i+"]"+chkNode1, "");
  1163. }
  1164. if((sRow == "1")&& (iRow != "0")){
  1165. if(model.getValue(pPath+"["+eRow+"]"+chkNode1) != "Y" ){
  1166. if(tRow ==1){
  1167. return;
  1168. }else{
  1169. model.setValue(pPath+"["+eRow+"]"+chkNode1, "Y"); /////에러나는줄1
  1170. }
  1171. } else {
  1172. model.setValue(pPath+"["+eRow+"]"+chkNode1, "");
  1173. }
  1174. } else {
  1175. if (iRow != "0") {
  1176. if(iRow == eRow){
  1177. for(i = iRow ; i < iRow+sRow ; i++) {
  1178. if(model.getValue(pPath+"["+i+"]"+chkNode1) != "Y" ){
  1179. model.setValue(pPath+"["+i+"]"+chkNode1, "Y");
  1180. }
  1181. }
  1182. }else{
  1183. for(i = eRow; i <= iRow ; i ++ ){
  1184. if(model.getValue(pPath+"["+i+"]"+chkNode1) != "Y" ){
  1185. model.setValue(pPath+"["+i+"]"+chkNode1, "Y");
  1186. }
  1187. }
  1188. }
  1189. }// if irow end
  1190. }
  1191. }
  1192. }
  1193. }else if(pFlag == "I"){
  1194. if(tRow != "1"){
  1195. // ctrl키 누른 상태에서 그리드 클릭시 선택된 모든 행 상태값 변경
  1196. if(event.ctrlKey == 1){
  1197. if(model.getValue(pPath+"["+iRow+"]"+chkNode1) != "Y" ) {
  1198. model.setValue(pPath+"["+iRow+"]"+chkNode1, "Y");
  1199. } else {
  1200. model.setValue(pPath+"["+iRow+"]"+chkNode1, "");
  1201. }
  1202. }
  1203. // shift키 누른 상태에서 선택행과 마지막 선택행 사이의 그리드 상태값 변경
  1204. else if(event.shiftKey == 1){
  1205. for(i =1 ; i < tRow ; i++){
  1206. model.setValue(pPath+"["+i+"]"+chkNode1, "");
  1207. }
  1208. if(iRow == eRow){
  1209. for(i = iRow ; i < iRow+sRow ; i++) {
  1210. if(model.getValue(pPath+"["+i+"]"+chkNode1) != "Y" ) {
  1211. model.setValue(pPath+"["+i+"]"+chkNode1, "Y");
  1212. }
  1213. }
  1214. }else{
  1215. for(i = eRow; i <= iRow ; i ++ ){
  1216. if(model.getValue(pPath+"["+i+"]"+chkNode1) != "Y" ) {
  1217. model.setValue(pPath+"["+i+"]"+chkNode1, "Y");
  1218. }
  1219. }
  1220. }
  1221. }
  1222. // 마우스 드래그를 하여 그리드의 로우 선택시 상태값 변경
  1223. else {
  1224. for(i =1 ; i < tRow ; i++){
  1225. model.setValue(pPath+"["+i+"]"+chkNode1, "")
  1226. //alert("2-"+chkNode1);;
  1227. }
  1228. //alert(sRow+'/'+iRow);
  1229. if((sRow == "1") && (iRow != "0")){
  1230. if(model.getValue(pPath+"["+eRow+"]"+chkNode1) != "Y" ) {
  1231. if(tRow ==1){
  1232. return;
  1233. }else{
  1234. model.setValue(pPath+"["+eRow+"]"+chkNode1, "Y"); ///////에러나는 줄2
  1235. }
  1236. } else {
  1237. model.setValue(pPath+"["+eRow+"]"+chkNode1, "");
  1238. }
  1239. } else {
  1240. if (iRow != "0") {
  1241. if (iRow == eRow){
  1242. for(i = iRow ; i < iRow+sRow ; i++) {
  1243. if(model.getValue(pPath+"["+i+"]"+chkNode1) != "Y" ) {
  1244. model.setValue(pPath+"["+i+"]"+chkNode1, "Y");
  1245. }
  1246. }
  1247. }else{
  1248. for(i = eRow; i <= iRow ; i ++ ){
  1249. if(model.getValue(pPath+"["+i+"]"+chkNode1) != "Y" ) {
  1250. model.setValue(pPath+"["+i+"]"+chkNode1, "Y");
  1251. }
  1252. }
  1253. }
  1254. } // if irow end
  1255. }
  1256. }
  1257. }
  1258. }
  1259. }
  1260. }
  1261. /**
  1262. * @group :
  1263. * @ver : 2007.06.21
  1264. * @by : 양천덕
  1265. * @---------------------------------------------------
  1266. * @type : function
  1267. * @access : public
  1268. * @desc : 투약저장 이밴트 처리
  1269. * @param :
  1270. * @return :
  1271. * @---------------------------------------------------
  1272. */
  1273. function fSaveDrugTret(){
  1274. var pid = model.getValue("/root/hidden1/incplist/pid");
  1275. var patnm = model.getValue("/root/hidden1/incplist/patnm");
  1276. var sexage = model.getValue("/root/hidden1/incplist/sexage");
  1277. var drugno = model.getValue("/root/main/incplist/inginfo["+1+"]/drugno");
  1278. //** 응급실에서 퇴원약확인시 투약번호라벨 출력 추가_20090218(ByCY) **//
  1279. for(var i=1; i<grd_inglist.rows;i++) {
  1280. if(model.getValue("/root/main/incplist/inginfo["+i+"]/spcldrug") =="M") { //마약여부 확인
  1281. var narcyn = "(마)";
  1282. break;
  1283. }
  1284. else{
  1285. var narcyn ="NONO";
  1286. }
  1287. }
  1288. //alert("pid:"+pid+", patnm:"+patnm+", sexage:"+sexage+", drugno"+drugno+", narcyn"+narcyn);
  1289. //** 응급실에서 퇴원약확인시 투약번호라벨 출력 추가_20090218(ByCY) **//
  1290. //미정의(사용하지 않음)
  1291. if(model.getValue("/root/main/condition/researchflag") == "I"){
  1292. fSelectInddPatList("S");
  1293. }
  1294. var datacheck2 = "N";
  1295. var datacheck3 = "N";
  1296. //퇴원약이면서 약국으로 전송하여 집계하지 않는 처방 검증
  1297. //alert(grd_inglist.rows);
  1298. for(i= 1 ; i < grd_inglist.rows; i++ ) {
  1299. //alert(i);
  1300. if(model.getvalue("/root/main/incplist/inginfo["+i+"]/prcpkindcdyn") == "Y" &&
  1301. model.getvalue("/root/main/incplist/inginfo["+i+"]/execyn") == "N" ){
  1302. datacheck2 = "Y";
  1303. }
  1304. if(model.getvalue("/root/main/incplist/inginfo["+i+"]/prcpstatcd") == "000"){
  1305. datacheck2 = "C";
  1306. }
  1307. if(model.getvalue("/root/main/incplist/inginfo["+i+"]/prcpkindcdyn") == "Y"){
  1308. datacheck3 = "Y";
  1309. }
  1310. }
  1311. //if(datacheck3 == "Y"){
  1312. // var chkpid = "";
  1313. // if(model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/dschdclrtyn") != "Y"){
  1314. // fGetPatList();
  1315. // }
  1316. //}
  1317. if(datacheck2 == "N" || grd_inglist.rows == "1" ){
  1318. messageBox("미시행 퇴실처방이 존재하지", "E007");
  1319. model.setFocus("btn_outsave");
  1320. return;
  1321. }else if(datacheck2 == "C"){
  1322. messageBox("간호확인을 하지 않은 퇴원약이 존재합니다.", "E");
  1323. return;
  1324. }else{
  1325. model.removenodeset("/root/send");
  1326. model.makeValue("/root/send/searchpat", fSetPatInfo() );
  1327. model.makeValue("/root/send/drugsaveinfo", grd_inglist.getUpdateDataAll("i"));
  1328. model.removeNodeset("/root/main/incplist");
  1329. submit("TXMNE00202", false);
  1330. //messageBox("약국으로 퇴원약 전송 완료했습니다.","I");
  1331. //** 응급실에서 퇴원약확인시 투약번호라벨 출력 추가_20090218(ByCY) **//
  1332. if(model.getValue("/root/main/incplist/inginfo["+i+"]/drugno") != null) {
  1333. var pid = model.getValue("/root/hidden1/incplist/pid");
  1334. var patnm = model.getValue("/root/hidden1/incplist/patnm");
  1335. var sexage = model.getValue("/root/hidden1/incplist/sexage");
  1336. var drugno = model.getValue("/root/main/incplist/inginfo["+1+"]/drugno");
  1337. for(var i=1; i<grd_inglist.rows;i++) {
  1338. if(model.getValue("/root/main/incplist/inginfo["+i+"]/spcldrug") =="M") { //마약여부 확인
  1339. var narcyn = "(마)";
  1340. break;
  1341. }
  1342. else{
  1343. var narcyn ="";
  1344. }
  1345. }
  1346. //-----(20110422) 막음
  1347. //fERCareDrugNoLabel2(pid, patnm, sexage, drugno, narcyn, "(약국)", "(간호)");//투약번호표출력
  1348. //-----(20110422) 막음
  1349. fGetPatList();
  1350. //model.refresh();
  1351. }
  1352. //** 응급실에서 퇴원약확인시 투약번호라벨 출력 추가_20090218(ByCY) **//
  1353. }
  1354. }
  1355. /**
  1356. * @group :
  1357. * @ver : 2007.06.21
  1358. * @by : 양천덕
  1359. * @---------------------------------------------------
  1360. * @type : function
  1361. * @access : public
  1362. * @desc : 퇴실구분 선택 및 콤보 옵션 설정
  1363. * @param :
  1364. * @return :
  1365. * @---------------------------------------------------
  1366. */
  1367. function fSelectOutRmCnts(){
  1368. //퇴실구분 초기화
  1369. model.setValue("/root/main/condition/outrmcd", "");
  1370. var iRow = grd_patlist.findRow(model.getValue("/root/main/condition/pid"), 1, grd_patlist.colRef("pid"), false, false);
  1371. ipt_outrmetc.attribute("left") = "490"; // 기타사유 창 위치변경]
  1372. ipt_outrmetc.attribute("top") = "56"; // 기타사유 창 위치변경]
  1373. ipt_outrmetc.visible = false;
  1374. //20111202_KNUH_Start
  1375. cmb_etc.attribute("left") = "490"; // 기타사유 창 위치변경]
  1376. cmb_etc.attribute("top") = "56"; // 기타사유 창 위치변경]
  1377. cmb_etc.visible = false;
  1378. //20111202_KNUH_End
  1379. // 귀가
  1380. if(rdo_outrmflag.value == 1) {
  1381. fSelctionOutRmCombo("BT1");
  1382. }
  1383. // 입원
  1384. if(rdo_outrmflag.value == 2) {
  1385. fSelctionOutRmCombo("BT3");
  1386. //16.10.19_칠곡 센터승격으로 인한 수정
  1387. caption24.visible = "visible"; // 입원경로 캡션
  1388. cmb_outhsrt.visible = "visible"; // 입원경로 콤보박스
  1389. //if(getUserInfo("dutplceinstcd") == "031"){
  1390. // caption24.visible = "visible"; // 입원경로 캡션
  1391. // cmb_outhsrt.visible = "visible"; // 입원경로 콤보박스
  1392. //}
  1393. //16.10.19_칠곡 센터승격으로 인한 수정
  1394. } else {
  1395. //16.10.19_칠곡 센터승격으로 인한 수정
  1396. caption24.visible = false; // 입원경로 캡션
  1397. cmb_outhsrt.visible = false; // 입원경로 콤보박스
  1398. model.setValue("/root/main/condition/outhsrt", ""); // 입원경로 콤보박스 초기화
  1399. //if(getUserInfo("dutplceinstcd") == "031"){
  1400. // caption24.visible = false; // 입원경로 캡션
  1401. // cmb_outhsrt.visible = false; // 입원경로 콤보박스
  1402. // model.setValue("/root/main/condition/outhsrt", ""); // 입원경로 콤보박스 초기화
  1403. //}
  1404. //16.10.19_칠곡 센터승격으로 인한 수정
  1405. }
  1406. // 전원
  1407. if(rdo_outrmflag.value==3){
  1408. caption2.visible = "visible";
  1409. caption1.visible="visible";
  1410. caption20.visible = "visible";
  1411. ipt_chnghosnm.visible="visible";
  1412. chk_proceraprvyn.visible="visible";
  1413. chk_healcaretgdyn.visible="visible";
  1414. cmb_dschhosptype.visible = "visible";
  1415. btn_hossear.visible = "visible"
  1416. chk_proceraprvyn.value = "Y";
  1417. chk_healcaretgdyn.value = "Y";
  1418. fSelctionOutRmCombo("BT2");
  1419. } else {
  1420. caption2.visible = false;
  1421. caption1.visible = false;
  1422. ipt_chnghosnm.visible = false;
  1423. ipt_chnghosnmetc.visible = false;
  1424. chk_proceraprvyn.visible = false;
  1425. chk_healcaretgdyn.visible = false;
  1426. ipt_chnghospchoi.visible = false;
  1427. caption20.visible = false;
  1428. cmb_dschhosptype.visible = false;
  1429. btn_hossear.visible = false;
  1430. model.makeValue("/root/main/condition/chnghospchoi", "");
  1431. model.setValue("/root/main/condition/chnghospnm", "");
  1432. model.setValue("/root/main/condition/dschhosptype", "");
  1433. model.refresh();
  1434. }
  1435. // 사망
  1436. if(rdo_outrmflag.value == 6) {
  1437. fSelctionOutRmCombo("BT4");
  1438. ipt_dethtm.visible = "visible";
  1439. ipt_dethdd.visible = "visible";
  1440. caption4.visible = "visible";
  1441. if(model.getValue("/root/main/inddpatlist/inddpatinfo["+ iRow +"]/dethyn") == "Y"){
  1442. model.setValue("/root/main/condition/dethdd", model.getValue("/root/main/inddpatlist/inddpatinfo["+ iRow +"]/dethdd") );
  1443. model.setValue("/root/main/condition/dethtm", model.getValue("/root/main/inddpatlist/inddpatinfo["+ iRow +"]/dethtm") );
  1444. ipt_dethdd.refresh();
  1445. ipt_dethtm.refresh();
  1446. messageBox("사망 기록 내역이 존재합니다.", "I");
  1447. }
  1448. } else {
  1449. model.setValue("/root/main/condition/dethdd", "");
  1450. model.setValue("/root/main/condition/dethtm", "");
  1451. ipt_dethtm.visible = false;
  1452. caption4.visible = false;
  1453. ipt_dethdd.visible = false;
  1454. }
  1455. // 기타, 미상
  1456. if(rdo_outrmflag.value == 8 || rdo_outrmflag.value == 9 ){
  1457. caption2.visible= false;
  1458. cmb_outrmcd.visible= false;
  1459. ipt_outrmetc.visible = false; // 기타사유
  1460. cmb_etc.visible = false;
  1461. caption20.visible = false;
  1462. cmb_dschhosptype.visible = false;
  1463. model.setValue("/root/main/condition/dschhosptype", "");
  1464. if(rdo_outrmflag.value == 8){
  1465. model.setValue("/root/main/condition/outrmcd", "88");
  1466. // ipt_chnghospchoi.visible = false;
  1467. ipt_chnghospchoi2.visible = true;
  1468. ipt_chnghospchoi2.disabled = true;
  1469. caption3.visible = true;
  1470. model.setValue("/root/main/condition/chnghospchoi", "탈원");
  1471. ipt_chnghospchoi.disabled = true;
  1472. caption3.visible = true;
  1473. model.refresh();
  1474. //ipt_outrmetc.visible = "visible"; // 기타사유
  1475. //caption2.visible= true;
  1476. //caption2.attribute("text") = "기타사유";
  1477. } else if (rdo_outrmflag.value == 9 ){
  1478. model.setValue("/root/main/condition/outrmcd", "99");
  1479. // ipt_chnghospchoi.visible = false;
  1480. ipt_chnghospchoi2.visible = false;
  1481. caption3.visible = false;
  1482. model.setValue("/root/main/condition/chnghospchoi", "");
  1483. ipt_chnghospchoi.disabled = false;
  1484. ipt_chnghospchoi2.disabled = true;
  1485. //ipt_outrmetc.visible = false; // 기타사유
  1486. //caption2.visible= false;
  1487. //caption2.attribute("text") = "세부사항";
  1488. }
  1489. } else {
  1490. caption3.visible= true;
  1491. //caption2.attribute("text") = "세부사항";
  1492. cmb_outrmcd.visible= true;
  1493. ipt_chnghospchoi2.visible = false;
  1494. ipt_chnghospchoi2.disabled = false;
  1495. ipt_chnghospchoi.visible = false;
  1496. ipt_chnghospchoi.disabled = false; // 기타사유
  1497. model.setValue("/root/main/condition/chnghospchoi", "");
  1498. }
  1499. }
  1500. function fChangeOutRm(sFlag){
  1501. if(sFlag != 2){
  1502. for(var i= 1 ; i <= getNodesetCount("/root/main/incplist/testinfo") ; i++){
  1503. if(model.getValue("/root/main/incplist/testinfo["+i+"]/viewstat") == "3"){
  1504. model.setValue("/root/main/incplist/testinfo["+i+"]/viewstat", "-");
  1505. }
  1506. }
  1507. }
  1508. }
  1509. /**
  1510. * @group :
  1511. * @ver : 2007.07.07
  1512. * @by : 양천덕
  1513. * @---------------------------------------------------
  1514. * @type : function
  1515. * @access : public
  1516. * @desc : 왼쪽 마우스 클릭 메뉴
  1517. * @param :
  1518. * @return :
  1519. * @---------------------------------------------------
  1520. */
  1521. function fPopupMenuInfo(pFlag){
  1522. //마우스 오른쪽 버튼 클릭시 이밴트 발생
  1523. if(event.button == 3){
  1524. //검사탭에서 마우스 클릭시 발생
  1525. if(pFlag == "T"){
  1526. //선택없이 마우스 오른쪽 클릭으로 선택 이밴트
  1527. // alert(grd_testlist.row +" : "+ grd_testlist.mouseRow +" : "+ grd_testlist.selectedRow(0) +" : "+grd_testlist.selectedRows);
  1528. // alert(grd_testlist.selectedRow(0) +" : "+ grd_testlist.mouseRow);
  1529. // alert((grd_testlist.row + grd_testlist.selectedRow(0) -1) +" : "+ grd_testlist.mouseRow);
  1530. if(grd_testlist.selectedRows == 1 || (( grd_testlist.selectedRow(0) > grd_testlist.mouseRow) || ((grd_testlist.row + grd_testlist.selectedRows -1) < grd_testlist.mouseRow ))){
  1531. for(var i = 1 ; i < grd_testlist.rows ; i++){
  1532. model.setValue("/root/main/incplist/testinfo["+i+"]/selectyn", "");
  1533. }
  1534. grd_testlist.row = grd_testlist.mouseRow;
  1535. }
  1536. //선택행 선택 플래그 변경 후 DC팝업창 활성화
  1537. if(grd_testlist.isCell(event.target) && grd_testlist.mouseRow >= grd_testlist.fixedrows){
  1538. model.setValue("/root/main/incplist/testinfo["+grd_testlist.row+"]/selectyn", "Y");
  1539. //퇴실구분에 따른 팝업목록 선택
  1540. if( model.getValue("/root/main/condition/outrmtp") == ""){
  1541. //window.setPopupMenu( true, "/root/codedata/popupmenu/grid00/item", "name", "func", true); //퇴원구분 미선택
  1542. }else if(model.getValue("/root/main/condition/outrmtp") == "2"){
  1543. window.setPopupMenu( true, "/root/codedata/popupmenu/grid01/item", "name", "func", true); //퇴원구분 입원 선택
  1544. }else{
  1545. window.setPopupMenu( true, "/root/codedata/popupmenu/grid02/item", "name", "func", true); //퇴원구분 선택(입원제외)
  1546. }
  1547. }else{
  1548. window.setPopupMenu(false);
  1549. }
  1550. //약,주사탭에서 마우스 클릭시 발생
  1551. }else{
  1552. //선택없이 마우스 오른쪽 클릭으로 선택 이밴트
  1553. if(grd_inglist.selectedRows == 1 || (( grd_inglist.selectedRow(0) > grd_inglist.mouseRow) || ((grd_inglist.row + grd_inglist.selectedRows -1) < grd_inglist.mouseRow ))){
  1554. for(var i = 1 ; i < grd_inglist.rows ; i++){
  1555. model.setValue("/root/main/incplist/inginfo["+i+"]/selectyn", "");
  1556. }
  1557. grd_inglist.row = grd_inglist.mouseRow;
  1558. }
  1559. //선택행 선택 플래그 변경 후 DC팝업창 활성화
  1560. if(grd_inglist.isCell(event.target) && grd_inglist.mouseRow >= grd_inglist.fixedrows){
  1561. model.setValue("/root/main/incplist/inginfo["+grd_inglist.row+"]/selectyn", "Y");
  1562. window.setPopupMenu( true, "/root/codedata/popupmenu/grid10/item", "name", "func", true); //퇴원구분 미선택
  1563. }else{
  1564. window.setPopupMenu(false);
  1565. }
  1566. }
  1567. }
  1568. }
  1569. /**
  1570. * @group :
  1571. * @ver : 2007.06.21
  1572. * @by : 양천덕
  1573. * @---------------------------------------------------
  1574. * @type : function
  1575. * @access : public
  1576. * @desc : 검사, 약주사 오른쪽 팝업 메뉴 선택에 따른 처리
  1577. * @param :
  1578. * @return :
  1579. * @---------------------------------------------------
  1580. */
  1581. function fChagnePrcpStat(pFlag){
  1582. if(pFlag == ""){
  1583. pFlag == "StatInit";
  1584. }
  1585. var sStatFlag = ""; // 1: DC, 2: Action, 3: 병동이관, -: 초기화
  1586. var sTargetGrid = ""; // All : 검사, 약 전체 초기화, Test: 검사 초기화, Ing: 약주사 초기화
  1587. var sExecFlag = "";
  1588. //Param에 따른 상태값 설정
  1589. if(pFlag == "StatInit"){
  1590. sStatFlag = "-";
  1591. sTargetGrid = "ALL";
  1592. sExecFlag = "N";
  1593. }else if(pFlag == "DefTestDC"){
  1594. sStatFlag = "1";
  1595. sTargetGrid = "Test";
  1596. sExecFlag = "Y";
  1597. }else if(pFlag == "DefTestAct"){
  1598. sStatFlag = "2";
  1599. sTargetGrid = "Test";
  1600. sExecFlag = "Y";
  1601. }else if(pFlag == "ChosTestInit"){
  1602. sStatFlag = "-";
  1603. sTargetGrid = "Test";
  1604. sExecFlag = "N";
  1605. }else if(pFlag == "ChosTestWard"){
  1606. sStatFlag = "3";
  1607. sTargetGrid = "Test";
  1608. sExecFlag = "N";
  1609. }else if(pFlag == "ChosTestDC"){
  1610. sStatFlag = "1";
  1611. sTargetGrid = "Test";
  1612. sExecFlag = "N";
  1613. }else if(pFlag == "ChosTestAct"){ // 검사 Acting
  1614. sStatFlag = "2";
  1615. sTargetGrid = "Test";
  1616. sExecFlag = "N";
  1617. }else if(pFlag == "DefIngDC"){
  1618. sStatFlag = "1";
  1619. sTargetGrid = "Ing";
  1620. sExecFlag = "Y";
  1621. }else if(pFlag == "ChosIngInit"){
  1622. sStatFlag = "-";
  1623. sTargetGrid = "Ing";
  1624. sExecFlag = "N";
  1625. }else if(pFlag == "ChosIngDC"){
  1626. sStatFlag = "1";
  1627. sTargetGrid = "Ing";
  1628. sExecFlag = "N";
  1629. }
  1630. // alert(sExecFlag +" : "+ sTargetGrid +" : "+ sStatFlag );
  1631. // 상태 변경및 실행 function 호출 부분
  1632. if(sExecFlag != "" && sTargetGrid != "" && sStatFlag != ""){
  1633. // 선택 바로 실시( Acting, D/C )
  1634. if(sExecFlag == "Y"){
  1635. if(sStatFlag == "1"){ // D/C
  1636. fPrcpDC(sTargetGrid);
  1637. }else if(sStatFlag == "2"){ // Action
  1638. fSaveTestPrcp();
  1639. }else if(sStatFlag == "3" || sStatFlag == "-" ){
  1640. return;
  1641. }
  1642. // 상태 변경
  1643. }else{
  1644. fChangeStatCode(sStatFlag, sTargetGrid);
  1645. }
  1646. }
  1647. }
  1648. function fChangeStatCode(pStat, pTarget){
  1649. //alert(pStat+'/'+pTarget);
  1650. if(pTarget == "Test" ){
  1651. for(var i= 1 ; i <= getNodesetCount("/root/main/incplist/testinfo") ; i++){
  1652. var chkprcp = model.getValue("/root/main/incplist/testinfo["+i+"]/prcpnm");
  1653. //var selectchk = model.getValue("/root/main/incplist/testinfo["+i+"]/selectyn");
  1654. //alert(chkprcp+'/'+selectchk);
  1655. if(model.getValue("/root/main/incplist/testinfo["+i+"]/selectyn")=="Y"){ // 선택된 처방
  1656. if(model.getValue("/root/main/incplist/testinfo["+i+"]/testtp") == "Y" ||
  1657. (model.getValue("/root/main/incplist/testinfo["+i+"]/testtp") == "N" && (pStat == "3" || pStat == "-"))){ // 혈액처방이 아닌것 || 혈액처방이면서 병동이관
  1658. if(model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "N"){ // 미수행 처방 선택
  1659. if((model.getValue("/root/main/incplist/testinfo["+i+"]/grupsnglflag") == "M" && (pStat == "3" || pStat == "-") ) ||
  1660. model.getValue("/root/main/incplist/testinfo["+i+"]/grupsnglflag") != "M" ){ // MSet처방
  1661. if(model.getValue("/root/main/incplist/testinfo["+i+"]/c2check") == "N" ||
  1662. model.getValue("/root/main/incplist/testinfo["+i+"]/c2check") == "Y" && (pStat == "1" ||pStat == "3" || pStat == "-")){ //단순영상 처방
  1663. model.setValue("/root/main/incplist/testinfo["+i+"]/viewstat", pStat);
  1664. }else{
  1665. messageBox(chkprcp+" 처방은 강제 Acting 할 수 없는 단순 영상 처방입니다.","E");
  1666. }
  1667. }else{
  1668. messageBox(chkprcp+" 처방은 MSet 처방입니다.\nD/C, 강제 Acting 할 수 없습니다.","E");
  1669. }
  1670. }else if(model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "OUT"){
  1671. messageBox(chkprcp+" 처방은 퇴원 후 외래 검사 처방입니다.\n병동이관, D/C, 강제 Acting 할 수 없습니다.","E");
  1672. }else{
  1673. messageBox(chkprcp+" 처방은 시행된 검사 처방입니다.\n병동이관, D/C, 강제 Acting 할 수 없습니다.","E");
  1674. }
  1675. }else{
  1676. if ((pStat == "1") && (model.getValue("/root/main/incplist/testinfo["+i+"]/dcyn")=="N")) {
  1677. messageBox(chkprcp+" 처방은 혈액처방입니다.\n 처방상태가 처방/간호확인이 아니면 D/C할 수 없습니다..", "E");
  1678. }
  1679. else if ((pStat == "1") && (model.getValue("/root/main/incplist/testinfo["+i+"]/dcyn")=="Y")) {
  1680. model.setValue("/root/main/incplist/testinfo["+i+"]/viewstat", pStat);
  1681. }
  1682. else if (pStat == "2") {
  1683. messageBox(chkprcp+" 처방은 혈액처방입니다.\n강제 Acting 할 수 없습니다.", "E");
  1684. }
  1685. else {
  1686. //messageBox(chkprcp+" 처방은 혈액처방입니다.\n강제 Acting 할 수 없습니다.", "E");
  1687. }
  1688. }
  1689. // 진검 B2 처방인 경우 바코드출력상태(400)이후만 강제Acting되도록
  1690. //alert("ddd");
  1691. if(model.getValue("/root/main/incplist/testinfo["+i+"]/prcpclscd") == "B2" ){
  1692. if((model.getValue("/root/main/incplist/testinfo["+i+"]/prcpstatcd") < "400" )&& (pStat == "2")){
  1693. messageBox(chkprcp+"처방은 진검 처방입니다.\n바코드 발행 후 강제 Acting 하십시오.","E");
  1694. model.setValue("/root/main/incplist/testinfo["+i+"]/viewstat", "-");
  1695. }else {
  1696. //messageBox(chkprcp+"ddddddd처방은 진검 처방입니다.\n바코드 발행 후 강제 Acting 하십시오.","E");
  1697. model.setValue("/root/main/incplist/testinfo["+i+"]/viewstat", pStat);
  1698. }
  1699. }
  1700. } // selectyn = 'Y' end
  1701. } // for end
  1702. } else if(pTarget == "Ing"){
  1703. for(var i= 0 ; i <= getNodesetCount("/root/main/incplist/inginfo") ; i++){
  1704. if(model.getValue("/root/main/incplist/inginfo["+i+"]/selectyn")=="Y"){
  1705. model.setValue("/root/main/incplist/inginfo["+i+"]/viewstat", pStat);
  1706. }
  1707. }
  1708. } else if(pTarget == "All"){
  1709. for(var i= 1 ; i <= getNodesetCount("/root/main/incplist/testinfo") ; i++){
  1710. model.setValue("/root/main/incplist/testinfo["+i+"]/viewstat", pStat);
  1711. }
  1712. for(var i= 0 ; i <= getNodesetCount("/root/main/incplist/inginfo") ; i++){
  1713. model.setValue("/root/main/incplist/inginfo["+i+"]/viewstat", pStat);
  1714. }
  1715. }
  1716. } // function end
  1717. /**
  1718. * @group :
  1719. * @ver : 2007.06.21
  1720. * @by : 양천덕
  1721. * @---------------------------------------------------
  1722. * @type : function
  1723. * @access : public
  1724. * @desc : 검사, 약주사 DC 구현 부분
  1725. * @param :
  1726. * @return :
  1727. * @---------------------------------------------------
  1728. */
  1729. function fPrcpDC(pFlag){
  1730. //------------------------------------------------------------------------------------------------------
  1731. // 간호 확인 약처방을 의사가 D/C(반납)를 하였을 경우에 투약기록지로 가서 해결하라는 메세지를 보여준다
  1732. // sdm
  1733. //------------------------------------------------------------------------------------------------------
  1734. var prcpddprcpno = ""; //------------(20080917)김보성
  1735. if(messageBox ( "DC 처리를 ", "Q003" ) == "6"){
  1736. var iRow = grd_patlist.findRow(model.getValue("/root/main/condition/pid"), 1, grd_patlist.colRef("pid"), false, false);
  1737. var sHeaderData = "status▦prcpdd▦prcpno▦prcphistno▦instcd▩";
  1738. var dcPrcpInfo = "";
  1739. var dcMediPrcpInfo = "";
  1740. var dcPrcpCnt = 0;
  1741. if(pFlag == "Test"){
  1742. //DC할 검사처방 확인
  1743. var tRow = grd_testlist.rows;
  1744. for(i=1 ; i < tRow ; i ++){
  1745. var chkprcp = "";
  1746. var chkprcp = model.getValue("/root/main/incplist/testinfo["+i+"]/prcpnm");
  1747. // 그리드에서 선택된 처방 선택
  1748. if(model.getValue("/root/main/incplist/testinfo["+i+"]/selectyn") == "Y" ){
  1749. //선택된 처방 중 혈액 처방 제외
  1750. if( model.getValue("/root/main/incplist/testinfo["+i+"]/testtp") == "Y"){
  1751. //미수행 처방 선택
  1752. if( model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "N"){
  1753. if(model.getValue("/root/main/incplist/testinfo["+i+"]/grupsnglflag") != "M"){
  1754. dcPrcpInfo += "C▦"
  1755. + model.getValue("/root/main/incplist/testinfo["+i+"]/prcpdd" ) + "▦"
  1756. + model.getValue("/root/main/incplist/testinfo["+i+"]/prcpno" ) + "▦"
  1757. + model.getValue("/root/main/incplist/testinfo["+i+"]/prcphistno" ) + "▦"
  1758. + model.getValue("/root/main/incplist/testinfo["+i+"]/instcd" ) + "▩";
  1759. dcPrcpCnt++;
  1760. }else{
  1761. messageBox(chkprcp+" 는 Mset 처방입니다.","E");
  1762. }
  1763. }else if(model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "OUT"){
  1764. messageBox(chkprcp+"는 퇴원 후 외래 검사 처방입니다.","E");
  1765. }else{
  1766. messageBox(chkprcp+"는 이미 시행된 검사 처방입니다.","E");
  1767. }
  1768. }else{
  1769. messageBox(chkprcp+"는 혈액 처방입니다.","E");
  1770. }
  1771. }
  1772. }
  1773. }else{
  1774. //DC할 약/주사 처방 확인
  1775. //------------------------------------------------------
  1776. // var tRowChk = grd_inglist.rows ;
  1777. // var chkDC="" ;
  1778. // var chkYn="";
  1779. // for (i=1 ; i< tRowChk ; i ++) {
  1780. // if(model.getValue("/root/main/incplist/inginfo["+i+"]/selectyn") == "Y" ){
  1781. // var chk_execprcphistcd = model.getValue("/root/main/incplist/inginfo["+i+"]/execprcphistcd");
  1782. // if (chk_execprcphistcd=="E") {
  1783. // chkDC=chkDC + " "+chk_execprcphistcd;
  1784. // chkYn="A";
  1785. // }
  1786. // }
  1787. // }
  1788. // if (chkYn=="A") {
  1789. //
  1790. // if (messageBox("간호 확인 후 의사 반환 처방이 있습니다-투약기록지 작성을 ","Q003")=="6") {
  1791. // modal("SMMNR00600","1","15","128");
  1792. // fGetPatList();
  1793. // fSelectPatList();
  1794. // return;
  1795. // }
  1796. // }else{
  1797. //-------------------------------------------------------
  1798. var tRow = grd_inglist.rows;
  1799. var prcpno = "";
  1800. var dcstatus = "";
  1801. for(i=1 ; i < tRow ; i ++){
  1802. var chkprcp = model.getValue("/root/main/incplist/inginfo["+i+"]/prcpnm");
  1803. // 그리드에서 선택된 처방 선택
  1804. if(model.getValue("/root/main/incplist/inginfo["+i+"]/selectyn") == "Y" ){
  1805. //미수행 처방 선택 ( Actiong 완료, 퇴원약 약국전송 건 제외)
  1806. if(model.getValue("/root/main/incplist/inginfo["+i+"]/prcpkindcdyn") == "Y" ){
  1807. messageBox(chkprcp + "는 퇴원약 처방입니다.\n퇴원 처방은 간호사가 D/C할 수 없습니다.","E");
  1808. }else{
  1809. if( model.getValue("/root/main/incplist/inginfo["+i+"]/execyn") == "N"
  1810. || model.getValue("/root/main/incplist/inginfo["+i+"]/execyn") == "E" ){
  1811. //약,주사 경우는 3개로 풀릴 수 있으므로 한개의 처방 번호만 넘기도록 함
  1812. //if(prcpno != model.getValue("/root/main/incplist/inginfo["+i+"]/prcpno"))
  1813. //dcstatus E 이면 의사 후인증을 안타도록 "MEDI", N이면 후인증타도록 "CERT"
  1814. dcstatus = ( model.getValue("/root/main/incplist/inginfo["+i+"]/execyn") == "N" ? "CERT" : "MEDI");
  1815. switch( model.getValue("/root/main/incplist/inginfo["+i+"]/execyn") ){
  1816. case "N" : //정상처방인것이고 처방 인터페이스를 타면 의사 처방반환요청 상태인 "E"로 변경됨.
  1817. // prcpno = model.getValue("/root/main/incplist/inginfo["+i+"]/prcpno");
  1818. dcPrcpInfo += "C▦"
  1819. + model.getValue("/root/main/incplist/inginfo["+i+"]/prcpdd" ) + "▦"
  1820. + model.getValue("/root/main/incplist/inginfo["+i+"]/prcpno" ) + "▦"
  1821. + model.getValue("/root/main/incplist/inginfo["+i+"]/prcphistno" ) + "▦"
  1822. + model.getValue("/root/main/incplist/inginfo["+i+"]/instcd" ) + "▩";
  1823. // dcPrcpCnt++;
  1824. // //-----------------(20080926) 김보성
  1825. // if (model.getValue("/root/main/incplist/inginfo["+i+"]/prcpstatcd") >= "000" ) {
  1826. // prcpddprcpno += "'" +
  1827. // model.getValue("/root/main/incplist/inginfo["+i+"]/prcpdd") +
  1828. // model.getValue("/root/main/incplist/inginfo["+i+"]/prcpno") + "',";
  1829. // }
  1830. case "E" :
  1831. /*의사반환요청들어온 처방이고 투약기록에서 DC최종 정리를 하고 후인증처리대상이 안됨.dcstatus "CERT"인것은 후인증관리에도 조회가 되어야한다.
  1832. 투약기록을 태우기위한 파라미터 정의이므로 case "N" 에는 break가 없는게 정상임. 20100108 김홍점
  1833. */
  1834. prcpno = model.getValue("/root/main/incplist/inginfo["+i+"]/prcpno");
  1835. dcMediPrcpInfo += dcstatus + "▦"
  1836. + model.getValue("/root/main/incplist/inginfo["+i+"]/prcpdd" ) + "▦"
  1837. + model.getValue("/root/main/incplist/inginfo["+i+"]/prcpno" ) + "▦"
  1838. + model.getValue("/root/main/incplist/inginfo["+i+"]/prcphistno" ) + "▦"
  1839. + model.getValue("/root/main/incplist/inginfo["+i+"]/instcd" ) + "▩";
  1840. dcPrcpCnt++;
  1841. //-----------------(20080926) 김보성
  1842. if (model.getValue("/root/main/incplist/inginfo["+i+"]/prcpstatcd") >= "000" ) {
  1843. prcpddprcpno += "'" +
  1844. model.getValue("/root/main/incplist/inginfo["+i+"]/prcpdd") +
  1845. model.getValue("/root/main/incplist/inginfo["+i+"]/prcpno") + "',";
  1846. }
  1847. break;
  1848. }
  1849. }else if(model.getValue("/root/main/incplist/inginfo["+i+"]/execyn") == "DC"){
  1850. messageBox(chkprcp+"는 반환요청된 처방입니다.","E");
  1851. // }else if(model.getValue("/root/main/incplist/inginfo["+i+"]/execyn") == "PRE"){
  1852. //
  1853. // messageBox(chkprcp+"는 \n\n 간호에서 '선'지정한 처방으로 투약기록이 안된 처방입니다","E");
  1854. }else{
  1855. messageBox(chkprcp+"는 이미 시행된 처방입니다.","E");
  1856. }
  1857. }
  1858. }
  1859. }
  1860. }
  1861. model.makeValue("/root/send/cond3" , sHeaderData+dcPrcpInfo );
  1862. model.makeValue("/root/send/cond5" , sHeaderData+dcMediPrcpInfo );
  1863. //저장구분정보(saveFlagInfo)
  1864. model.setValue ( "/root/save/saveflaginfo/savedataflag" , "2" ); //저장자료구분 0:진단 및 처방, 1:진단, 2:처방, 4:임시저장
  1865. model.setValue ( "/root/save/saveflaginfo/saveflag" , "E" ); //저장구분 O:외래, I:입원, E:응급, S:건진
  1866. model.setValue ( "/root/save/saveflaginfo/prcpflag" , "0" ); //처방구분 0:의사처방, 2:간호, 3:지원부서, 5:Admission, 6:CP, 7:항암프로토콜, 8:임시처방
  1867. model.setValue ( "/root/save/saveflaginfo/inptflag" , "3" ); //입력구분 (11:건진처방, 12:LIS장비IF, 13:기타LIS, 14:병리, 15:EMR기록, 16:원무)
  1868. model.setValue ( "/root/save/saveflaginfo/pamflag" , "Y" ); //원무정보 처리구분 (Y/N) -> N일 경우 check하지 않음.
  1869. model.setValue ( "/root/save/saveflaginfo/diagflag" , "Y" ); //진단정보 처리구분 (Y/N) -> N일 경우 check하지 않음. ('Y'이면 진단없이 처방 저장이 안됨)
  1870. model.setValue ( "/root/save/saveflaginfo/prcperrflag" , "Y" ); //처방오류구분(Y/N) -> Y일 경우 의사처방과 동일하게 오류리스트를 반환, N이면 오류를 확인하지 않음
  1871. model.setValue ( "/root/save/saveflaginfo/deptcd" , getUserInfo("dutplcecd") ); //부서코드
  1872. model.setValue ( "/root/save/saveflaginfo/deptnm" , getUserInfo("dutplcenm") ); //부서명
  1873. model.setValue ( "/root/save/saveflaginfo/userid" , getUserInfo("userid") ); //사용자ID
  1874. model.setValue ( "/root/save/saveflaginfo/usernm" , getUserInfo("usernm") ); //사용자명
  1875. model.setValue ( "/root/save/saveflaginfo/signyn" , "N" ); //전자서명여부
  1876. var saveFlagInfoNodeList = model.instances(0).selectNodes( "/root/save/saveflaginfo" );
  1877. model.makeValue ( "/root/send/cond1", getNodeListCSV(saveFlagInfoNodeList));
  1878. //저장등록정보(saveRgstInfo)
  1879. model.setValue ( "/root/save/savergstinfo/pid" , model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/pid") ); // 등록번호(원무Key)
  1880. model.setValue ( "/root/save/savergstinfo/orddd" , "-" ); // 진료일자(원무Key) - 입원일경우는 '-'
  1881. model.setValue ( "/root/save/savergstinfo/indd" , model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/indd") ); // 입원일자(원무Key)
  1882. model.setValue ( "/root/save/savergstinfo/cretno" , model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/cretno") ); // 생성번호(원무Key)
  1883. model.setValue ( "/root/save/savergstinfo/orddeptcd" , model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/orddeptcd") ); // 진료과(원무)
  1884. model.setValue ( "/root/save/savergstinfo/orddrid" , model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/orddrid") ); // 진료의ID(원무)
  1885. model.setValue ( "/root/save/savergstinfo/instcd" , model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/instcd") ); // 기관코드
  1886. var saveRgstInfo = model.instances(0).selectNodes( "/root/save/savergstinfo" );
  1887. model.makeValue ( "/root/send/cond2", getNodeListCSV(saveRgstInfo));
  1888. // D/C할 처방이 없을 경우 return처리
  1889. //alert( "d/c" + pFlag + "/" + dcPrcpCnt);
  1890. if( dcPrcpCnt > 0 ){
  1891. //-----------------------(20080917)김보성
  1892. //약 D/C인 경우만
  1893. if(pFlag != "Test") {
  1894. //1. 인증을 위한 자료 추출
  1895. prcpddprcpno = prcpddprcpno.substr(0,prcpddprcpno.length-1);
  1896. //alert("prcpddprcpno:" + prcpddprcpno);
  1897. fnSignSaveCall("30",prcpddprcpno);
  1898. //----------------(20090923)
  1899. if (getNodesetCount("/root/signinfo/signsave/signdata") > 0 ) {
  1900. //2. 자료에 대해서 인증하기
  1901. if ( fnSignSaveWork() == true) {
  1902. //3. 인증자료를 묶음submit("TXMNP06013")
  1903. var signsave = model.instances(0).selectNodes( "/root/signinfo/signsave/signdata" );
  1904. model.makeValue ( "/root/send/cond4", getNodeListCSV(signsave));
  1905. } else {
  1906. return ; //---(20080922)
  1907. }
  1908. }
  1909. //----------------(20090923)
  1910. }
  1911. //-----------------------(20080917)
  1912. if(submit("TXMNE00203") == true ){
  1913. if(getNodesetCount("/root/temp/errlist") > 0){
  1914. var iNode = "/root/srcdata/list/patlist";
  1915. fShowModal("SPMNE00200");
  1916. }
  1917. fSelectInddPatList("S");
  1918. //-----------------------(20080917):김보성
  1919. //약 D/C인 경우만
  1920. if(pFlag != "Test") {
  1921. //1. 일자별 인증을 위한 일자 추출
  1922. var signDates = new Array;
  1923. var signDateCnt = 0;
  1924. var signdispdd = "";
  1925. var sPathsignsave = "/root/signinfo/signsave/signdata";
  1926. var rows = getNodesetCount(sPathsignsave);
  1927. if (rows <= 0 ) return;
  1928. for (var i=1;i<= rows ;i++) { //---(0922)
  1929. signdispdd = model.getValue(sPathsignsave + "[" + i + "]/execdd");
  1930. //alert( "전체loop:" + signdispdd + "/"+ medrexecdd + "/" + currentdd);
  1931. if ( signDates.length == 0) {
  1932. signDateCnt =0;
  1933. signDates[signDateCnt] = "";
  1934. }
  1935. if (signdayFind(signDates,signdispdd) == true ) { //------(투약일자)
  1936. signDateCnt ++;
  1937. signDates[signDateCnt] = signdispdd;
  1938. //alert("b:" + signDates[signDateCnt] +"/" + medrexecdd);
  1939. }
  1940. }
  1941. //2. 투약기록을 일자별로 XLST를 만들기 위해서
  1942. fnWorkddSign(signDates);
  1943. }
  1944. //-----------------------(20080917)
  1945. }
  1946. }
  1947. }
  1948. }
  1949. function fShowModal(pProgID) {
  1950. var xpos = event.screenX-300;
  1951. var ypos = event.screenY-400;
  1952. modal(pProgID, 1, xpos, ypos, pProgID, "/root/temp", "/root/result");
  1953. var iProperties = getParameter("SendData");
  1954. return iProperties
  1955. }
  1956. /**
  1957. * @group :
  1958. * @ver : 2007.06.21
  1959. * @by : 양천덕
  1960. * @---------------------------------------------------
  1961. * @type : function
  1962. * @access : public
  1963. * @desc : 퇴실일시 확인 부분
  1964. * @param :
  1965. * @return :
  1966. * @---------------------------------------------------
  1967. */
  1968. function fChkOutrmdd(){
  1969. var iRow = grd_patlist.findRow(model.getValue("/root/main/condition/pid"), 1, grd_patlist.colRef("pid"), false, false);
  1970. var nowDate = fTimeSetting(); //현재 시간 셋팅
  1971. var checktime = model.getValue("/root/main/condition/outrmdd") + model.getValue("/root/main/condition/outrmtm") ; //체크할 시간 셋팅(퇴원일시)
  1972. var dd = getCurrentDate();
  1973. var currentdt = dd + nowDate;
  1974. //내원시간, 퇴원시간 체크
  1975. if(model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/chosdt") > checktime ){
  1976. // model.setValue("/root/main/condition/outrmdd", getCurrentDate() );
  1977. // model.setValue("/root/main/condition/outrmtm", nowDate );
  1978. // ipt_outrddd.refresh();
  1979. // ipt_outrmtm.refresh();
  1980. messageBox("선택일시가 내원일시보다 이전입니다.", "E");
  1981. } else if(model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/fstexamorddd") > checktime) {
  1982. messageBox("선택일시가 초진진료일시 보다 이전입니다.", "E");
  1983. } else if(currentdt < checktime){
  1984. // model.setValue("/root/main/condition/outrmdd", getCurrentDate() );
  1985. // model.setValue("/root/main/condition/outrmtm", nowDate );
  1986. // ipt_outrddd.refresh();
  1987. // ipt_outrmtm.refresh();
  1988. messageBox("선택일시가 미래일시 입니다.", "E");
  1989. }else {
  1990. model.setValue("/root/main/condition/t_outrmdt", model.getValue("/root/main/condition/outrmdd") + model.getValue("/root/main/condition/outrmtm") );
  1991. }
  1992. output3.refresh();
  1993. }
  1994. /**
  1995. * @group :
  1996. * @ver : 2007.06.21
  1997. * @by : 양천덕
  1998. * @---------------------------------------------------
  1999. * @type : function
  2000. * @access : public
  2001. * @desc : 환자 기본 정보 설정 부분
  2002. * @param :
  2003. * @return :
  2004. * @---------------------------------------------------
  2005. */
  2006. function fCalcChosOut(){
  2007. var iRow = grd_patlist.row;
  2008. if(model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/chosdt") == "" ||
  2009. model.getValue("/root/main/condition/outrmdd") == ""){
  2010. return;
  2011. }
  2012. //퇴실일시 확인 부분
  2013. fChkOutrmdd();
  2014. var CalcDate = "";
  2015. //내원시간 세팅
  2016. var chosyy = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/chosdt").substr(0,4);
  2017. var chosmm = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/chosdt").substr(4,2);
  2018. var chosdd = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/chosdt").substr(6,2);
  2019. var choshh = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/chosdt").substr(8,2);
  2020. var chosnn = model.getValue("/root/main/inddpatlist/inddpatinfo["+iRow+"]/chosdt").substr(10,2);
  2021. //퇴실시간 세팅
  2022. var outrmyy = model.getValue("/root/main/condition/outrmdd").substr(0,4);
  2023. var outrmmm = model.getValue("/root/main/condition/outrmdd").substr(4,2);
  2024. var outrmdd = model.getValue("/root/main/condition/outrmdd").substr(6,2);
  2025. var outrmhh = model.getValue("/root/main/condition/outrmtm").substr(0,2);
  2026. var outrmnn = model.getValue("/root/main/condition/outrmtm").substr(2,2);
  2027. //재실 시간 계산을 위하여 시간, 분 단위로 차이를 계산
  2028. var rstFromTime = new Date(chosyy,chosmm-1,chosdd,choshh,chosnn,0);
  2029. var rstEndTime = new Date(outrmyy, outrmmm-1,outrmdd,outrmhh,outrmnn,0);
  2030. var diffnn = ((rstEndTime - rstFromTime) / (60*1000)) ;
  2031. var diffhh = Math.ceil( (rstEndTime - rstFromTime) / ( 60*60*1000) ) ;
  2032. //시간 : 분 구하기
  2033. if(chosnn != outrmnn){
  2034. calcdiffhh = diffhh -1;
  2035. calcdiffnn = (diffnn - ((diffhh-1) * 60 ));
  2036. //분이 정각일 경우
  2037. }else{
  2038. calcdiffhh = diffhh;
  2039. calcdiffnn = "00"
  2040. }
  2041. //환자 기본정보 문장 생성
  2042. CalcDate = calcdiffhh + "시간 "+ calcdiffnn + "분" ;
  2043. return CalcDate;
  2044. }
  2045. /**
  2046. * @group :
  2047. * @ver : 2007.06.21
  2048. * @by : 양천덕
  2049. * @---------------------------------------------------
  2050. * @type : function
  2051. * @access : public
  2052. * @desc : 검사 처방 강제 Action 처리 부분
  2053. * @param :
  2054. * @return :
  2055. * @---------------------------------------------------
  2056. */
  2057. function fSaveTestPrcp(){
  2058. //acting저장
  2059. var datacheck2 = "N";
  2060. var tRow = grd_testlist.rows;
  2061. var vbYes = messageBox("선택된 처방 Acting","Q004");
  2062. if( vbYes == 6 ){
  2063. //마우스 드래그시 실시 검사 처방 여부 확인
  2064. for(i= 1 ; i <tRow; i++ ) {
  2065. if( model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "N" ){
  2066. var datacheck2 = "Y";
  2067. }
  2068. }
  2069. if(datacheck2 == "N" || grd_testlist.rows == "1"){
  2070. messageBox("미시행 검사 처방이 존재하지", "E007");
  2071. model.setFocus("button3");
  2072. return;
  2073. }else{
  2074. for(i=1 ; i < tRow ; i ++){
  2075. var chkprcp = model.getValue("/root/main/incplist/testinfo["+i+"]/prcpnm");
  2076. if(model.getValue("/root/main/incplist/testinfo["+i+"]/selectyn") == "Y" ){ // 드래그 선택여부 체크
  2077. if( model.getValue("/root/main/incplist/testinfo["+i+"]/testtp") == "Y"){ //
  2078. if( model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "N"){ // Acting여부 체크
  2079. if(model.getValue("/root/main/incplist/testinfo["+i+"]/grupsnglflag") != "M" ){ // MSet처방
  2080. model.setValue("/root/main/incplist/testinfo["+i+"]/viewstat" , "2");
  2081. }else{
  2082. messageBox(chkprcp+"처방은 MSet 처방입니다.\n강제 Acting할 수 없습니다.","E");
  2083. }
  2084. }else if(model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "OUT"){
  2085. messageBox(chkprcp+"는 퇴원 후 외래 처방입니다.\n강제 Acting 할 수 없습니다.","E");
  2086. }else{
  2087. messageBox(chkprcp+"는 이미 시행된 처방입니다.\n강제 Acting 할 수 없습니다.","E");
  2088. }
  2089. }else{
  2090. messageBox(chkprcp+" 은 혈액처방 입니다.\n강제 Acting 할 수 없습니다.","E");
  2091. }
  2092. }
  2093. } // for end
  2094. model.removenodeset("/root/send");
  2095. model.makeValue("/root/send/searchpat", fSetPatInfo() );
  2096. model.makeValue("/root/send/prcplist", grd_testlist.getUpdateDataAll("i"));
  2097. model.removeNodeset("/root/main/incplist");
  2098. submit("TXMNE00204");
  2099. model.refresh();
  2100. }
  2101. }
  2102. }
  2103. /**
  2104. * @group :
  2105. * @ver : 2007.06.07
  2106. * @by : 양천덕
  2107. * @---------------------------------------------------
  2108. * @type : function
  2109. * @access : public
  2110. * @desc : 상단 정보 이용 환자 선택
  2111. * @param :
  2112. * @return :
  2113. * @---------------------------------------------------
  2114. */
  2115. function fGetParamSetting(){
  2116. var chkPid = getPatientInfo("pid");
  2117. var iTgPatRow = 0;
  2118. if(chkPid != ""){
  2119. var tRow = grd_patlist.rows;
  2120. if(tRow == "1"){
  2121. return;
  2122. }else{
  2123. for( i =0 ; i < tRow ; i++ ){
  2124. iTgPatRow = grd_patlist.findRow(chkPid ,1, 3,true,true);
  2125. }
  2126. }
  2127. }
  2128. if(iTgPatRow > 0){
  2129. grd_patlist.row = iTgPatRow;
  2130. grd_patlist.topRow = iTgPatRow;
  2131. fSelectPatList();
  2132. }
  2133. }
  2134. /**
  2135. * @group :
  2136. * @ver : 2007.06.07
  2137. * @by : 양천덕
  2138. * @---------------------------------------------------
  2139. * @type : function
  2140. * @access : public
  2141. * @desc : 환자 선택 검사/약,주사 처방조회
  2142. * @param :
  2143. * @return :
  2144. * @---------------------------------------------------
  2145. */
  2146. function fSelectPatList(){
  2147. if(grd_patlist.row < 1){
  2148. return;
  2149. }
  2150. fResrchPatList(); //환자 재조회
  2151. fSetParam(); //상단정보설정
  2152. fSelectInddPatList("S"); //검사, 약주사, 마약 조회
  2153. //** 마약Tab 활성화 기준설정_20090213(ByCY) **//
  2154. model.refresh();
  2155. if(btn_ingmv.selected == true) {
  2156. btn_ingmv.dispatch("DOMActivate");
  2157. }
  2158. if(btn_testmv.selected == true) {
  2159. btn_testmv.dispatch("DOMActivate");
  2160. }
  2161. //** 마약Tab 활성화 기준설정_20090213(ByCY) **//
  2162. fInitSettingTop(); //퇴실처리 환자기본정보 초기화
  2163. model.setValue("/root/main/condition/pid",model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/pid"));
  2164. var tRow = grd_testlist.rows;
  2165. var iRow = grd_inglist.rows;
  2166. var maxDate = "";
  2167. var minDate = "";
  2168. for(i = 1 ; i < tRow ; i++){
  2169. if(maxDate != ""){
  2170. if(maxDate < model.getValue("/root/main/incplist/testinfo["+i+"]/prcpdd") ){
  2171. maxDate = model.getValue("/root/main/incplist/testinfo["+i+"]/prcpdd");
  2172. }
  2173. }else{
  2174. maxDate = model.getValue("/root/main/incplist/testinfo["+i+"]/prcpdd");
  2175. }
  2176. if(minDate != ""){
  2177. if(minDate >= model.getValue("/root/main/incplist/testinfo["+i+"]/prcpdd") ){
  2178. minDate = model.getValue("/root/main/incplist/testinfo["+i+"]/prcpdd");
  2179. }
  2180. }else {
  2181. minDate = model.getValue("/root/main/incplist/testinfo["+i+"]/prcpdd");
  2182. }
  2183. }
  2184. model.setValue("/root/main/condition/outrmdd", getCurrentDate() );
  2185. model.setValue("/root/main/condition/outrmtm", fTimeSetting() );
  2186. var t_patinfo = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/pid")+" "
  2187. + model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/patnm")+" "
  2188. + model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/sexage");
  2189. var t_chosdt = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/chosdt");
  2190. var t_outrmdt = model.getValue("/root/main/condition/outrmdd")
  2191. + model.getValue("/root/main/condition/outrmtm");
  2192. var t_calctm = fCalcChosOut();
  2193. var t_assgroom = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/assgroom");
  2194. // 15.10.26 - 초진진료일자 추가
  2195. var t_fstexamorddd = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/fstexamorddd");
  2196. // 15.10.26 - 초진진료일자 추가
  2197. model.setValue("/root/main/condition/t_patinfo" , t_patinfo );
  2198. model.setValue("/root/main/condition/t_chosdt" , t_chosdt );
  2199. model.setValue("/root/main/condition/t_outrmdt" , t_outrmdt );
  2200. model.setValue("/root/main/condition/t_calctm" , t_calctm );
  2201. model.setValue("/root/main/condition/t_assgroom" , t_assgroom );
  2202. // 15.10.26 - 초진진료일자 추가
  2203. model.setValue("/root/main/condition/t_fstexamorddd" , t_fstexamorddd );
  2204. // 15.10.26 - 초진진료일자 추가
  2205. ipt_chnghospchoi.visible = false;
  2206. ipt_chnghospchoi2.visible = false;
  2207. caption2.visible = false;
  2208. caption3.visible = false;
  2209. caption20.visible = false;
  2210. cmb_dschhosptype.visible = false;
  2211. model.makeValue("/root/main/condition/chnghospchoi","");
  2212. model.setValue("/root/main/condition/dschhosptype", "");
  2213. var fselectRow = grd_patlist.row;
  2214. model.copyNode("/root/hidden1/incplist","/root/main/inddpatlist/inddpatinfo["+fselectRow+"]");
  2215. if(model.getValue("/root/temp/patinforesrch/bloodinfo/bloodcomment") !='') { //임시저장한 수혈기록 존재여부
  2216. button5.visible = true;
  2217. output12.visible = true;
  2218. } else {
  2219. button5.visible = false;
  2220. output12.visible = false;
  2221. }
  2222. model.refresh();
  2223. var pid = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/pid");
  2224. var indd = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/indd");
  2225. var cretno = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/cretno");
  2226. var instcd = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/instcd");
  2227. var orddeptcd = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/orddeptcd");
  2228. model.removeNodeset("/root/send/req");
  2229. model.makeValue("/root/send/req/pid", pid);
  2230. model.makeValue("/root/send/req/indd", indd);
  2231. model.makeValue("/root/send/req/cretno", cretno);
  2232. model.makeValue("/root/send/req/orddeptcd", orddeptcd);
  2233. model.makeValue("/root/send/req/instcd", instcd);
  2234. model.makeValue("/root/send/req/dschdclrdt", model.getValue("/root/main/condition/outrmdd")); //예약정보 조회시 사용
  2235. model.makeValue("/root/send/req/recflag", "01");
  2236. //submit("TRMNW03601");
  2237. submit("TRMNW10001");
  2238. }
  2239. /**
  2240. * @group :
  2241. * @ver : 2007.06.21
  2242. * @by : 양천덕
  2243. * @---------------------------------------------------
  2244. * @type : function
  2245. * @access : public
  2246. * @desc : 검사 일괄 DC 구현 부분(상태값으로 D/C 결정 된 처방 일괄 D/C)
  2247. * @param :
  2248. * @return :
  2249. * @---------------------------------------------------
  2250. */
  2251. function fPrcpDCSave(pFlag, pCnt){
  2252. var sHeaderData = "status▦prcpdd▦prcpno▦prcphistno▦instcd▩";
  2253. var dcPrcpInfo = "";
  2254. var dcPrcpCnt = 0;
  2255. //DC할 검사처방 확인
  2256. var tRow = grd_testlist.rows;
  2257. for(i=1 ; i < tRow ; i ++){
  2258. // 그리드에서 선택된 처방 선택
  2259. if(model.getValue("/root/main/incplist/testinfo["+i+"]/viewstat") == "1" ){
  2260. dcPrcpInfo += "C▦"
  2261. + model.getValue("/root/main/incplist/testinfo["+i+"]/prcpdd" ) + "▦"
  2262. + model.getValue("/root/main/incplist/testinfo["+i+"]/prcpno" ) + "▦"
  2263. + model.getValue("/root/main/incplist/testinfo["+i+"]/prcphistno") + "▦"
  2264. + model.getValue("/root/main/incplist/testinfo["+i+"]/instcd" ) + "▩";
  2265. dcPrcpCnt++;
  2266. }
  2267. }
  2268. //alert(dcPrcpInfo);
  2269. model.removenodeset("/root/send");
  2270. model.makeValue("/root/send/cond3" , sHeaderData+dcPrcpInfo );
  2271. //저장구분정보(saveFlagInfo)
  2272. model.setValue ( "/root/save/saveflaginfo/savedataflag" , "2" ); //저장자료구분 0:진단 및 처방, 1:진단, 2:처방, 4:임시저장
  2273. model.setValue ( "/root/save/saveflaginfo/saveflag" , "E" ); //저장구분 O:외래, I:입원, E:응급, S:건진
  2274. model.setValue ( "/root/save/saveflaginfo/prcpflag" , "0" ); //처방구분 0:의사처방, 2:간호, 3:지원부서, 5:Admission, 6:CP, 7:항암프로토콜, 8:임시처방
  2275. model.setValue ( "/root/save/saveflaginfo/inptflag" , "3" ); //입력구분 (11:건진처방, 12:LIS장비IF, 13:기타LIS, 14:병리, 15:EMR기록, 16:원무)
  2276. model.setValue ( "/root/save/saveflaginfo/pamflag" , "Y" ); //원무정보 처리구분 (Y/N) -> N일 경우 check하지 않음.
  2277. model.setValue ( "/root/save/saveflaginfo/diagflag" , "Y" ); //진단정보 처리구분 (Y/N) -> N일 경우 check하지 않음. ('Y'이면 진단없이 처방 저장이 안됨)
  2278. model.setValue ( "/root/save/saveflaginfo/prcperrflag" , "Y" ); //처방오류구분(Y/N) -> Y일 경우 의사처방과 동일하게 오류리스트를 반환, N이면 오류를 확인하지 않음
  2279. model.setValue ( "/root/save/saveflaginfo/deptcd" , getUserInfo("dutplcecd") ); //부서코드
  2280. model.setValue ( "/root/save/saveflaginfo/deptnm" , getUserInfo("dutplcenm") ); //부서명
  2281. model.setValue ( "/root/save/saveflaginfo/userid" , getUserInfo("userid") ); //사용자ID
  2282. model.setValue ( "/root/save/saveflaginfo/usernm" , getUserInfo("usernm") ); //사용자명
  2283. model.setValue ( "/root/save/saveflaginfo/signyn" , "N" ); //전자서명여부
  2284. var saveFlagInfoNodeList = model.instances(0).selectNodes( "/root/save/saveflaginfo" );
  2285. model.makeValue ( "/root/send/cond1", getNodeListCSV(saveFlagInfoNodeList));
  2286. //저장등록정보(saveRgstInfo)
  2287. model.setValue ( "/root/save/savergstinfo/pid" , model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/pid") ); // 등록번호(원무Key)
  2288. model.setValue ( "/root/save/savergstinfo/orddd" , "-" ); // 진료일자(원무Key) - 입원일경우는 '-'
  2289. model.setValue ( "/root/save/savergstinfo/indd" , model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/indd") ); // 입원일자(원무Key)
  2290. model.setValue ( "/root/save/savergstinfo/cretno" , model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/cretno") ); // 생성번호(원무Key)
  2291. model.setValue ( "/root/save/savergstinfo/orddeptcd" , model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/orddeptcd") ); // 진료과(원무)
  2292. model.setValue ( "/root/save/savergstinfo/orddrid" , model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/orddrid") ); // 진료의ID(원무)
  2293. model.setValue ( "/root/save/savergstinfo/instcd" , model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/instcd") ); // 기관코드
  2294. var saveRgstInfo = model.instances(0).selectNodes( "/root/save/savergstinfo" );
  2295. model.makeValue ( "/root/send/cond2", getNodeListCSV(saveRgstInfo));
  2296. // D/C할 처방이 없을 경우 return처리
  2297. if( dcPrcpCnt > 0 ){
  2298. if(submit("TXMNE00203") == true ){
  2299. if(getNodesetCount("/root/temp/errlist") > 0){
  2300. var iNode = "/root/srcdata/list/patlist";
  2301. fShowModal("SPMNE00200");
  2302. }
  2303. if(pCnt < 1){
  2304. fSelectInddPatList("S");
  2305. }
  2306. }
  2307. }
  2308. }
  2309. /**
  2310. * @group :
  2311. * @ver : 2007.06.21
  2312. * @by : 양천덕
  2313. * @---------------------------------------------------
  2314. * @type : function
  2315. * @access : public
  2316. * @desc : 검사 처방 강제 Action 처리 부분(Acting상태값 처방 일괄 Acting)
  2317. * @param :
  2318. * @return :
  2319. * @---------------------------------------------------
  2320. */
  2321. function fSaveTestPrcpSave(){
  2322. // 상태값 설저으로 인하여 Acting 조건 체크 로직 삭제 : 2008-01-21
  2323. // var datacheck2 = "N";
  2324. // var tRow = grd_testlist.rows;
  2325. //
  2326. // //마우스 드래그시 실시 검사 처방 여부 확인
  2327. // for(i= 1 ; i <tRow; i++ ) {
  2328. // if( model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "N" ){
  2329. // var datacheck2 = "Y";
  2330. // }
  2331. // }
  2332. //
  2333. // if(datacheck2 == "N" || grd_testlist.rows == "1"){
  2334. // messageBox("미시행 검사 처방이 존재하지", "E007");
  2335. // model.setFocus("button3");
  2336. // return;
  2337. // }else{
  2338. // for(i=1 ; i < tRow ; i ++){
  2339. // var chkprcp = model.getValue("/root/main/incplist/testinfo["+i+"]/prcpnm");
  2340. // if(model.getValue("/root/main/incplist/testinfo["+i+"]/viewstat") == "2" ){
  2341. // if( model.getValue("/root/main/incplist/testinfo["+i+"]/testtp") == "Y"){
  2342. // if( model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "Y"){
  2343. // messageBox(chkprcp+"는 이미 시행된 검사입니다.\n강제 Acting 할 수 없습니다.","I");
  2344. // return;
  2345. // }else if(model.getValue("/root/main/incplist/testinfo["+i+"]/execyn") == "OUT"){
  2346. // messageBox(chkprcp+"는 퇴원 후 외래 처방입니다.\n강제 Acting 할 수 없습니다.","I");
  2347. // return;
  2348. // }
  2349. // }else{
  2350. // messageBox(chkprcp +" 은 혈액처방 입니다.\n강제 Acting 할 수 없습니다.","E");
  2351. // return;
  2352. // }
  2353. // }
  2354. // }
  2355. model.removenodeset("/root/send");
  2356. model.makeValue("/root/send/searchpat", fSetPatInfo() );
  2357. model.makeValue("/root/send/prcplist", grd_testlist.getUpdateDataAll("i"));
  2358. model.removeNodeset("/root/main/incplist");
  2359. submit("TXMNE00204");
  2360. }
  2361. /**
  2362. * @group :
  2363. * @ver : 2008.01.17
  2364. * @by : 양천덕
  2365. * @---------------------------------------------------
  2366. * @type : function
  2367. * @access : public
  2368. * @desc : 검사처방 일괄 처리
  2369. * @param :
  2370. * @return :
  2371. * @---------------------------------------------------
  2372. */
  2373. function fSaveTestPrcpAll(){
  2374. model.removeNodeset("/root/testprcp/tmp");
  2375. var tRow = grd_testlist.rows;
  2376. var cntDC = 0;
  2377. var cntACT = 0;
  2378. var cntWard = 0 ;
  2379. //상태 설정값 저장(병동이관)
  2380. for(var i = 1 ; i<tRow ; i++){
  2381. if(model.getValue("/root/main/incplist/testinfo["+i+"]/viewstat") == "1"){
  2382. cntDC++;
  2383. }
  2384. if(model.getValue("/root/main/incplist/testinfo["+i+"]/viewstat") == "2"){
  2385. cntACT++;
  2386. }
  2387. if(model.getValue("/root/main/incplist/testinfo["+i+"]/viewstat") == "3"){
  2388. cntWard++;
  2389. model.makeValue("/root/testprcp/tmp["+cntWard+"]/prcpno" , model.getValue("/root/main/incplist/testinfo["+i+"]/prcpno"));
  2390. model.makeValue("/root/testprcp/tmp["+cntWard+"]/prcphistno" , model.getValue("/root/main/incplist/testinfo["+i+"]/prcphistno"));
  2391. model.makeValue("/root/testprcp/tmp["+cntWard+"]/prcpdd" , model.getValue("/root/main/incplist/testinfo["+i+"]/prcpdd"));
  2392. }
  2393. }
  2394. if(cntDC < 1 && cntACT < 1){
  2395. messageBox("DC & Acting 할 처방이 존재하지 않습니다.", "I");
  2396. return;
  2397. }
  2398. var vbYes = messageBox("DC : "+cntDC+" 건 Acting : "+cntACT+" 건 입니다.","Q004");
  2399. if( vbYes == 6 ){
  2400. if(cntDC > 0){ //DC 설정 스크립트 호출
  2401. fPrcpDCSave("Test", cntACT);
  2402. }
  2403. if(cntACT > 0){ //Acting 설정 스크립트 호출
  2404. fSaveTestPrcpSave();
  2405. }
  2406. //임시 저장된 상태 설정값 세팅(병동이관)
  2407. for(var i = 1 ; i <= getNodesetCount("/root/main/incplist/testinfo") ; i++ ){
  2408. for(var j = 1 ; j <= getNodesetCount("/root/testprcp/tmp") ; j++ ){
  2409. if(model.getValue("/root/main/incplist/testinfo["+i+"]/prcpno") == model.getValue("/root/testprcp/tmp["+j+"]/prcpno") ){
  2410. model.setValue("/root/main/incplist/testinfo["+i+"]/viewstat", "3");
  2411. }
  2412. }
  2413. }
  2414. model.refresh();
  2415. }
  2416. }
  2417. /**
  2418. * @group :
  2419. * @ver : 2008.01.17
  2420. * @by : 양천덕
  2421. * @---------------------------------------------------
  2422. * @type : function
  2423. * @access : public
  2424. * @desc : 퇴원예고 환자 Cellstyle 변경 및 포커스 컬러 변경
  2425. * @param :
  2426. * @return :
  2427. * @---------------------------------------------------
  2428. */
  2429. function fChangeFocusColor(){
  2430. //var color = grd_patlist.cellstyle("background-color", grd_patlist.row, grd_patlist.col, grd_patlist.row, grd_patlist.col);
  2431. //if(color == "#ffd3ff"){
  2432. if(model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/dschdclrtyn") == "Y"){
  2433. grd_patlist.cellstyle("background-color", grd_patlist.row, 0, grd_patlist.row, 4) = "#ffd3ff";
  2434. grd_patlist.attribute("focuscolor") = "#00cc66";
  2435. grd_patlist.refresh();
  2436. }
  2437. }
  2438. /**
  2439. * @group :
  2440. * @ver : 2008.01.17
  2441. * @by : 양천덕
  2442. * @---------------------------------------------------
  2443. * @type : function
  2444. * @access : public
  2445. * @desc : 환자 클릭시 상대값 재조회(퇴원예고, 예정병실)
  2446. * @param :
  2447. * @return :
  2448. * @---------------------------------------------------
  2449. */
  2450. function fResrchPatList(){
  2451. var sRow = grd_patlist.row;
  2452. var sSrchHeader = "pid▦indd▦cretno▩";
  2453. var sSrchData = model.getValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/pid" ) +"▦"
  2454. + model.getValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/indd" ) +"▦"
  2455. + model.getValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/cretno") +"▩";
  2456. model.removenode("/root/send");
  2457. model.makeValue("/root/send/reqcond", sSrchHeader + sSrchData);
  2458. if(submit("TRMNE00201", false) == true){
  2459. model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/bedposcnts" , model.getValue("/root/temp/patinforesrch/patinfo/bedposcnts") );
  2460. model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/dschdclrtyn" , model.getValue("/root/temp/patinforesrch/patinfo/dschdclrtyn") );
  2461. model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/chosdt" , model.getValue("/root/temp/patinforesrch/patinfo/chosdt") );
  2462. model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/dschdclrdt" , model.getValue("/root/temp/patinforesrch/patinfo/dschdclrdt") );
  2463. model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/orddrid" , model.getValue("/root/temp/patinforesrch/patinfo/orddrid") );
  2464. model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/roomcd" , model.getValue("/root/temp/patinforesrch/patinfo/roomcd") );
  2465. model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/medispclid" , model.getValue("/root/temp/patinforesrch/patinfo/medispclid") );
  2466. model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/assgroom" , model.getValue("/root/temp/patinforesrch/patinfo/assgroom") );
  2467. model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/wardcd" , model.getValue("/root/temp/patinforesrch/patinfo/wardcd") );
  2468. model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/prewardcd" , model.getValue("/root/temp/patinforesrch/patinfo/prewardcd") );
  2469. model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/ordtype" , model.getValue("/root/temp/patinforesrch/patinfo/ordtype") );
  2470. model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/dethdd" , model.getValue("/root/temp/patinforesrch/patinfo/dethdd") );
  2471. model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/dethtm" , model.getValue("/root/temp/patinforesrch/patinfo/dethtm") );
  2472. model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/dethyn" , model.getValue("/root/temp/patinforesrch/patinfo/dethyn") );
  2473. model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/g3existyn" , model.getValue("/root/temp/patinforesrch/patinfo/g3existyn") );
  2474. model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/inrsrvacptdt" , model.getValue("/root/temp/patinforesrch/patinfo/inrsrvacptdt") );
  2475. //sdm
  2476. model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/oxyconcen" , model.getValue("/root/temp/patinforesrch/patinfo/oxyconcen") );
  2477. //model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/uncnfmcnt" , model.getValue("/root/temp/patinforesrch/patinfo/uncnfmcnt") );
  2478. // 15.10.26 - 추가 AYS
  2479. model.setValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/fstexamorddd" , model.getValue("/root/temp/patinforesrch/patinfo/fstexamorddd") );
  2480. // 15.10.26 - 추가 AYS
  2481. model.removeNodeset("/root/temp/patinforesrch/patinfo");
  2482. }
  2483. if( model.getValue("/root/main/inddpatlist/inddpatinfo["+ sRow +"]/dschdclrtyn") == "Y" ){
  2484. fChangeFocusColor();
  2485. //grd_patlist.cellstyle("background-color", sRow, 0, sRow, 4) = "#ffd3ff";
  2486. //grd_patlist.attribute("focuscolor") = "#00cc66";
  2487. }
  2488. }
  2489. //=====================================================================================
  2490. // 아래는 약 D/C 시 투약기록에 반영및 투약기록 일자별 XSLT 생성하기(20080917) 김보성
  2491. //=====================================================================================
  2492. // 투약기록 통합기록을 위한 자료 추출질의문
  2493. // prcpddprcpno으로 n개의 iprc에 대한 exip단위의 정보를 추출한다.
  2494. function fnSignSaveCall(workflag, prcpddprcpno) {
  2495. var sPathSign = "/root/signinfo";
  2496. model.resetInstanceNode(sPathSign + "/reqsigncond");
  2497. var pGrd = grd_patlist;
  2498. var spid = model.getValue("/root/main/inddpatlist/inddpatinfo["+ pGrd.row + "]/pid"); //등록번호(필수)
  2499. var sinstcd = getUserInfo("dutplceinstcd"); //기관코드(사용X)
  2500. var sindd = model.getValue("/root/main/inddpatlist/inddpatinfo["+ pGrd.row +"]/indd"); //입원일자(필수)
  2501. var scretno = ""; //생성번호(사용X)
  2502. var sprcpdd = ""; //처방일자(PRN시 필수)
  2503. var sprcpno = ""; //처방번호(확인사항)
  2504. var sworkdd = ""; //투약일(일자그룹일때만 (필수))
  2505. var slistflag = workflag; //작업구분(필수)
  2506. var snursnm = getUserName(); //간호사명추가(필수)
  2507. var shngnm = model.getValue("/root/main/inddpatlist/inddpatinfo["+ pGrd.row +"]/patnm"); //환자명추가 (필수)
  2508. var smedrexecdd = ""; //화면에서저장할투약일자(사용X)
  2509. var smedrexectm = ""; //화면에서저장할투약시간(사용X)
  2510. var sprcpddprcpno = prcpddprcpno; //n개의 iprc
  2511. model.setValue(sPathSign + "/reqsigncond/pid" ,spid ); //desc="등록번호"
  2512. model.setValue(sPathSign + "/reqsigncond/instcd" ,sinstcd ); //desc="기관코드"
  2513. model.setValue(sPathSign + "/reqsigncond/indd" ,sindd ); //desc="입원일자"
  2514. model.setValue(sPathSign + "/reqsigncond/cretno" ,scretno ); //desc="생성번호"
  2515. model.setValue(sPathSign + "/reqsigncond/prcpdd" ,sprcpdd ); //desc="처방일자"
  2516. model.setValue(sPathSign + "/reqsigncond/prcpno" ,sprcpno ); //desc="처방번호"
  2517. model.setValue(sPathSign + "/reqsigncond/workdd" ,sworkdd ); //desc="투약일"
  2518. model.setValue(sPathSign + "/reqsigncond/listflag" ,slistflag ); //desc="작업구분"
  2519. model.setValue(sPathSign + "/reqsigncond/nursnm" ,snursnm ); //desc="간호사명추가"
  2520. model.setValue(sPathSign + "/reqsigncond/hngnm" ,shngnm ); //desc="환자명추가"
  2521. model.setValue(sPathSign + "/reqsigncond/medrexecdd" ,smedrexecdd); //desc="화면에서저장할투약일자"
  2522. model.setValue(sPathSign + "/reqsigncond/medrexectm" ,smedrexectm); //desc="화면에서저장할투약시간"
  2523. model.setValue(sPathSign + "/reqsigncond/prcpddprcpno" ,sprcpddprcpno); //desc=""
  2524. var sPathSign = "/root/signinfo";
  2525. model.removenode(sPathSign + "/signsave/signdata");
  2526. submit("TRMNR00608");
  2527. }
  2528. /**
  2529. * @group :
  2530. * @ver : 2008.08.31
  2531. * @by : 김보성
  2532. * @---------------------------------------------------
  2533. * @type : function
  2534. * @access : public
  2535. * @desc : 투약기록 관련 인증저장(interface제공한 web에서 사용)(iprc단위 1개 처리용)
  2536. * : 따라서 여러개의 iprc이면 n번 호출해야한다.
  2537. * @param :
  2538. * @return :
  2539. * @---------------------------------------------------
  2540. */
  2541. function fnSignSaveWork() {
  2542. var sSignPath = "/root/signinfo/signsave/signdata";
  2543. var sSignPathCount = getNodesetCount(sSignPath);
  2544. var sPathSignSave = "/root/signinfo/signsave/signdata";
  2545. if ( sSignPathCount <= 0 ) {
  2546. messageBox("자료가 존재하지 않습니다. ","E999");
  2547. return false;
  2548. }
  2549. Sign.certreload = true ; // 전자서명 호출시 인증저장 버튼을 누늘때마다 인증서가 뜨도록 처리(20080922)
  2550. model.removenode("/root/send/savedata");
  2551. for(var j = 1; j <= getNodesetCount(sSignPath); j++){
  2552. //alert("loop:"+j);
  2553. sSignRow= j; //전역변수(프로그램내)
  2554. if(Sign.signprocess() == false){//인증저장 데이터 생성fMake_SignData 호출
  2555. Sign.certreload = false ; // 전자서명 호출시 인증저장 버튼을 누늘때마다 인증서가 안뜨도록 처리(20080922)
  2556. return false;
  2557. }
  2558. Sign.certreload = false ; // 전자서명 호출시 인증저장 버튼을 누늘때마다 인증서가 안뜨도록 처리(20080922)
  2559. model.setValue(sPathSignSave + "[" + j + "]/recdd", getCurrentDate()); //실제기록이 이루어진 기록일자
  2560. model.setValue(sPathSignSave + "[" + j + "]/rectm", getCurrentTime()); //실제기록이 이루어진 기록시간
  2561. model.setValue(sPathSignSave + "[" + j + "]/recsaveflag", "Y"); //전자서명인적정보변경여부
  2562. model.setValue(sPathSignSave + "[" + j + "]/signflag", "02"); //서명자료구분(02:간호)
  2563. model.setValue(sPathSignSave + "[" + j + "]/signgenrflag", "E"); //외래/입원구분
  2564. model.setValue(sPathSignSave + "[" + j + "]/formcd", "0000002476"); //투약기록 서식번호
  2565. model.setValue(sPathSignSave + "[" + j + "]/signbfcnts", Sign.signedInfos[1]); //인증할 데이터 정보(미기록 노드 제거된 정보)
  2566. model.setValue(sPathSignSave + "[" + j + "]/signaftcnts", Sign.signedInfos[2]); //공인인증 처리후 데이터
  2567. model.setValue(sPathSignSave + "[" + j + "]/signflagyn", "Y"); //비공식적으로 인증되지않도록 제어할수 있는기능
  2568. //--------------------------(20080921)
  2569. //건별인증은 통합기록조회에서 보이지 않고 일자별을 보이기 위해서
  2570. //건별인증은 dispyn ='N'
  2571. //하단의 일자별인 경우만 보임
  2572. model.setValue(sPathSignSave + "[" + j + "]/dispyn", "N");
  2573. //--------------------------(20080921)
  2574. }
  2575. return true;
  2576. }
  2577. //인증정보 말기
  2578. function fMake_SignData(){
  2579. //alert("fMake_SignData---------시작");
  2580. /*
  2581. <signinfo>
  2582. <signdata>
  2583. <pid>29953</pid>
  2584. <hngnm>T입0820</hngnm>
  2585. <prcpdd>20080821</prcpdd>
  2586. <execdd>20080821</execdd>
  2587. <prcpkindnm/>
  2588. <prcpmixno/>
  2589. <prcpcd>DSSL500</prcpcd>
  2590. <prcpnm>Disal tab. 500mg (Salsalate)</prcpnm>
  2591. <prcpvolnm>1500mg</prcpvolnm>
  2592. <prcpqtynm>3T</prcpqtynm>
  2593. <abbrnm>PO</abbrnm>
  2594. <exectm>130000</exectm>
  2595. <nursnm>김보성</nursnm>
  2596. <execcarestatnm>정상투약</execcarestatnm>
  2597. <carecfactnm> </carecfactnm>
  2598. <orddrnm>김만수</orddrnm>
  2599. </signdata>
  2600. </signinfo>
  2601. */
  2602. var ssigndruglist = "/root/signinfo/signsave/signdata";
  2603. var spid = model.getValue(ssigndruglist + "[" + sSignRow + "]/pid");
  2604. var shngnm = model.getValue(ssigndruglist + "[" + sSignRow + "]/hngnm");
  2605. var sprcpdd = model.getValue(ssigndruglist + "[" + sSignRow + "]/prcpdd");
  2606. var sexecdd = model.getValue(ssigndruglist + "[" + sSignRow + "]/execdd");
  2607. /*
  2608. ,CASE WHEN a.careprnexecflag = 'P' THEN 'PRN' ELSE '' END || ' ' ||
  2609. CASE WHEN a.anticncrprtlno <> 0 THEN '항암' ELSE '' END || ' ' ||
  2610. CASE WHEN a.dccountyn = 'Y' AND a.selfdrugflag = 'Y' THEN 'self D/C'
  2611. WHEN a.dccountyn = 'Y' then 'D/C'
  2612. WHEN a.selfdrugflag = 'Y' then 'self'
  2613. END prcpkindnm
  2614. //처방종류명 (다른업무에서 투약기록관련인증정보를 생성시 어려운 항목
  2615. */
  2616. var sprcpkindnm = model.getValue(ssigndruglist + "[" + sSignRow + "]/prcpkindnm");
  2617. var sprcpmixno = model.getValue(ssigndruglist + "[" + sSignRow + "]/prcpmixno");
  2618. var sprcpcd = model.getValue(ssigndruglist + "[" + sSignRow + "]/prcpcd");
  2619. var sprcpnm = model.getValue(ssigndruglist + "[" + sSignRow + "]/prcpnm");
  2620. var sprcpvolnm = model.getValue(ssigndruglist + "[" + sSignRow + "]/prcpvolnm");
  2621. var sprcpqtynm = model.getValue(ssigndruglist + "[" + sSignRow + "]/prcpqtynm");
  2622. var sabbrnm = model.getValue(ssigndruglist + "[" + sSignRow + "]/abbrnm");
  2623. var sexectm = model.getValue(ssigndruglist + "[" + sSignRow + "]/exectm");
  2624. var snursnm = model.getValue(ssigndruglist + "[" + sSignRow + "]/nursnm");
  2625. var sexeccarestatnm = model.getValue(ssigndruglist + "[" + sSignRow + "]/execcarestatnm");
  2626. var scarecfactnm = model.getValue(ssigndruglist + "[" + sSignRow + "]/carecfactnm");
  2627. var sorddrnm = model.getValue(ssigndruglist + "[" + sSignRow + "]/orddrnm");
  2628. model.resetInstanceNode("/root/send/signinfo/signdata");
  2629. model.makeValue("/root/send/signinfo/signdata/pid", spid );
  2630. model.makeValue("/root/send/signinfo/signdata/hngnm", shngnm );
  2631. model.makeValue("/root/send/signinfo/signdata/prcpdd", sprcpdd ); //처방일자
  2632. if(sexecdd == "00000000"){ //투약일자
  2633. model.makeValue("/root/send/signinfo/signdata/execdd", "");
  2634. }else{
  2635. model.makeValue("/root/send/signinfo/signdata/execdd", sexecdd);
  2636. }
  2637. model.makeValue("/root/send/signinfo/signdata/prcpkindnm", sprcpkindnm );
  2638. model.makeValue("/root/send/signinfo/signdata/prcpmixno", sprcpmixno ); //MIXNO
  2639. model.makeValue("/root/send/signinfo/signdata/prcpcd", sprcpcd ); //처방코드
  2640. model.makeValue("/root/send/signinfo/signdata/prcpnm", sprcpnm ); //처방명
  2641. model.makeValue("/root/send/signinfo/signdata/prcpvolnm", sprcpvolnm ); //용량단위명칭(용량+용량단위명칭)
  2642. model.makeValue("/root/send/signinfo/signdata/prcpqtynm", sprcpqtynm ); //수량단위명칭(수량+수량단위명칭)
  2643. //투여방법약어명(다른업무에서 투약기록관련인증정보를 생성시 어려운 항목)
  2644. model.makeValue("/root/send/signinfo/signdata/abbrnm", sabbrnm );
  2645. if(sexectm == "000000"){ //투약시간
  2646. model.makeValue("/root/send/signinfo/signdata/exectm", "");
  2647. }else{
  2648. model.makeValue("/root/send/signinfo/signdata/exectm", sexectm);
  2649. }
  2650. model.makeValue("/root/send/signinfo/signdata/nursnm", snursnm); //간호사명칭
  2651. if(sexeccarestatnm == "") sexeccarestatnm = "N";
  2652. //미확인,정상투약,투약X-반환가능,투약X-반환불가,퇴원당일남은약
  2653. //(다른업무에서 투약기록관련인증정보를 생성시 정상투약,)
  2654. model.makeValue("/root/send/signinfo/signdata/execcarestatnm", sexeccarestatnm);
  2655. //간호사REMARK CODE에 대한 REMARK 명칭((다른업무에서 투약기록관련인증정보를 생성시 공백)
  2656. model.makeValue("/root/send/signinfo/signdata/carecfactnm", scarecfactnm);
  2657. //진료의명(다른업무에서 투약기록관련인증정보를 생성시 어려운 항목)
  2658. model.makeValue("/root/send/signinfo/signdata/orddrnm", sorddrnm);
  2659. Sign.addnode("/root/send/signinfo/signdata");
  2660. //alert("fMake_SignData---------종료");
  2661. //Sign.signedInfos[1] 는 없음
  2662. //alert("fmake_signdata"+ Sign.signedInfos[1] );
  2663. }
  2664. //일자별 XSLT 생성작업
  2665. function fnWorkddSign(signDates) {
  2666. //-----------------------------------------------)
  2667. // 투약기록을 일자별로 XLST를 만들기 위해서
  2668. //-----------------------------------------------
  2669. var sPathSign = "/root/signinfo";
  2670. var pGrd = grd_patlist;
  2671. var signDate = "";
  2672. //alert(signDates.length);
  2673. for (var i=0;i<signDates.length;i++) {
  2674. signDate = "" + signDates[i];
  2675. //alert("1:" + signDate);
  2676. if ( signDate != "") {
  2677. model.resetInstanceNode(sPathSign + "/reqsigncond");
  2678. signDate = signDate.replace("-","");
  2679. //alert("2:" + signDate);
  2680. var spid = model.getValue("/root/main/inddpatlist/inddpatinfo[" + pGrd.row + "]/pid"); //등록번호 (필수)
  2681. var sinstcd = "";//model.getValue("/root/main/inddpatlist/inddpatinfo/instcd"); //기관코드 (사용X)
  2682. var sindd = model.getValue("/root/main/inddpatlist/inddpatinfo[" + pGrd.row + "]/indd"); //입원일자 (필수)
  2683. var scretno = model.getValue("/root/main/inddpatlist/inddpatinfo[" + pGrd.row + "]/cretno");//생성번호 (사용X)
  2684. var sprcpdd = ""; //처방일자 (PRN시 필수)
  2685. var sprcpno = ""; //처방번호 (확인사항)
  2686. var sworkdd = signDate; //model.getValue("/root/main/cond/orddd"); //투약일(일자그룹일때만 (필수)
  2687. var slistflag = "90"; //작업구분 (필수)
  2688. var snursnm = getUserName(); //간호사명추가 (필수)
  2689. var shngnm = model.getValue("/root/main/inddpatlist/inddpatinfo[" + pGrd.row + "]/patnm") //환자명추가 (필수)
  2690. var smedrexecdd = ""; //화면에서저장할투약일자(사용X)
  2691. var smedrexectm = ""; //화면에서저장할투약시간(사용X)
  2692. model.setValue(sPathSign + "/reqsigncond/pid" ,spid ); //desc="등록번호"
  2693. model.setValue(sPathSign + "/reqsigncond/instcd" ,sinstcd ); //desc="기관코드"
  2694. model.setValue(sPathSign + "/reqsigncond/indd" ,sindd ); //desc="입원일자"
  2695. model.setValue(sPathSign + "/reqsigncond/cretno" ,scretno ); //desc="생성번호"
  2696. model.setValue(sPathSign + "/reqsigncond/prcpdd" ,sprcpdd ); //desc="처방일자"
  2697. model.setValue(sPathSign + "/reqsigncond/prcpno" ,sprcpno ); //desc="처방번호"
  2698. model.setValue(sPathSign + "/reqsigncond/workdd" ,sworkdd ); //desc="투약일"
  2699. model.setValue(sPathSign + "/reqsigncond/listflag" ,slistflag ); //desc="작업구분"
  2700. model.setValue(sPathSign + "/reqsigncond/nursnm" ,snursnm ); //desc="간호사명추가"
  2701. model.setValue(sPathSign + "/reqsigncond/hngnm" ,shngnm ); //desc="환자명추가"
  2702. model.setValue(sPathSign + "/reqsigncond/medrexecdd" ,smedrexecdd); //desc="화면에서저장할투약일자"
  2703. model.setValue(sPathSign + "/reqsigncond/medrexectm" ,smedrexectm); //desc="화면에서저장할투약시간"
  2704. var pFlag = "Drug"; //저장구분 (Drug : 투약기록)
  2705. var pNode1 = ""; //조회할 조건 PATH(의미없음)
  2706. var pNode2 = "/root/signinfo/signdruginfo/signdruglist"; //Return 리스트 PATH
  2707. //alert("signDate:" + i + "/" + signDate);
  2708. //임시로 막음(test)
  2709. fCare_SignNode(pFlag, pNode1, pNode2,spid,sindd,scretno,"E"); //-----(20080917)수정
  2710. //fCare_SignNode(pFlag, pNode1, pNode2, pPid, pIndd, pCretno, pIoflag){
  2711. }
  2712. }
  2713. }
  2714. //일자별 인증정보를 묶을 일자를 찾는다
  2715. //넣어야 할지는 판단한다.
  2716. function signdayFind(signDates,findDate) {
  2717. var sreturn = false;
  2718. if (findDate == "00000000" || findDate == "") {
  2719. } else {
  2720. //alert("signDates.length:"+ signDates.length);
  2721. for (var i=0;i<signDates.length;i++) {
  2722. //alert("비교:" + signDates[i] + "/" + findDate);
  2723. sreturn = true;
  2724. if ( signDates[i] == findDate) {
  2725. sreturn = false;
  2726. break;
  2727. }
  2728. }
  2729. }
  2730. return sreturn;
  2731. }
  2732. //=====================================================================================
  2733. //** 응급실에서 투약신청, 즉시불출신청시 투약번호라벨 출력 수정_20090522(ByJA) **//
  2734. function fERCareDrugNoLabel2(pid, patnm, sexage, drugno, narcyn, fstcmd, scndcmd){
  2735. //1. 바코드 라벨 설정값 조회
  2736. var scrnid = "SMMNR00600";
  2737. model.removeNodeset("/root/main/barcdprntsetup");
  2738. fGetBarCodeInfo(scrnid); // CareCom.js
  2739. lzzfMakeBrcdPrntObjHanDo("CommAX");
  2740. //2. 바코드 라벨 환경설정
  2741. var barcdRef = "/root/main/barcdprntsetup/prntsetupinfo/setupinfo";
  2742. var portOpenTF = fSetNursBarcdInfo(barcdRef); // CareCom.js 바코드프린터별 환경설정(Zebra,SATO)
  2743. //3. 투약번호라벨 출력
  2744. fPrtERCareDrugNoLabel("erdsch", barcdRef, pid, patnm, sexage, drugno, getCurrentDateTime(), fstcmd, scndcmd, narcyn, portOpenTF);
  2745. /* 원본_20090522(ByJA)
  2746. // 바코드OCX 생성
  2747. if(document.all("CommAX") == null){
  2748. lzzfMakeBrcdPrntObjHanDo("CommAX");
  2749. }
  2750. // 바코드 라벨 초기 설정값 조회
  2751. var scrnid = "SMMNR00600";
  2752. // fGetBarCodeInfo(scrnid); // CareCom.js
  2753. model.removeNodeset("/root/main/barcdprntsetup");
  2754. model.resetInstanceNode("/root/send/reqdata");
  2755. model.makeValue("/root/send/scrnid", scrnid);
  2756. submit("TRLLC90101");
  2757. // 바코드 라벨 환경설정
  2758. var sSndMsg = "";
  2759. var portOpenTF = ""; //오픈 성공 여부
  2760. var barcdRef = "/root/main/barcdprntsetup/prntsetupinfo/setupinfo";
  2761. // fSettingBarCode(barcdRef); // CareCom.js
  2762. var sPrntKind = model.getValue(barcdRef + "[1]/prntkind");
  2763. var sCommKind = model.getValue(barcdRef + "[1]/commkind");
  2764. if(sCommKind == "01") {
  2765. var sSetUpVal = model.getValue(barcdRef + "[1]/comm01/setupval");
  2766. }else if(sCommKind == "02") {
  2767. var sComm = model.getValue(barcdRef + "[1]/comm02/comm");
  2768. var sDataBit = model.getValue(barcdRef + "[1]/comm02/databit");
  2769. var sStopBit = model.getValue(barcdRef + "[1]/comm02/stopbit");
  2770. var sBaudRate = model.getValue(barcdRef + "[1]/comm02/baudrate");
  2771. var sParity = model.getValue(barcdRef + "[1]/comm02/parity");
  2772. var sSetUpVal = model.getValue(barcdRef + "[1]/comm02/setupval"); // 20080802추가(ByJA)
  2773. CommAX.CommPort = sComm;
  2774. CommAX.Settings = sBaudRate + "," + sParity + "," + sDataBit + "," + sStopBit;
  2775. portOpenTF = CommAX.PortOpen(true);
  2776. }else if(sCommKind == "03") {
  2777. var sSetUpVal = model.getValue(barcdRef + "[1]/comm03/setupval");
  2778. }
  2779. if(portOpenTF == "TRUE"){
  2780. var iLeft = model.getValue(barcdRef + "/blank/left");
  2781. var iTop = model.getValue(barcdRef + "/blank/top");
  2782. if(iLeft == "" || iLeft == "-"){
  2783. iLeft = 0;
  2784. }
  2785. if(iTop == "" || iTop == "-"){
  2786. iTop = 0;
  2787. }
  2788. // BP_StartFormat
  2789. var sData = "^XA^LH0,20";
  2790. var sFstData, sScndData;
  2791. var prtdt = getCurrentDateTime().substr(0,4) + "/";
  2792. prtdt += getCurrentDateTime().substr(4,2) + "/";
  2793. prtdt += getCurrentDateTime().substr(6,2) + " ";
  2794. prtdt += getCurrentDateTime().substr(9,2) + ":";
  2795. prtdt += getCurrentDateTime().substr(11,2);
  2796. sData += fCarePrintOutA (iLeft+ 50, iTop+10, 3, "N", pid, "");
  2797. sData += fCarePrintOutH2 (iLeft+ 45, iTop+60, 3, "N", patnm, "");
  2798. sData += fCarePrintOutA (iLeft+245, iTop+75, 4, "N", sexage, "");
  2799. sData += fCarePrintOutA (iLeft+120, iTop+130, 5, "N", drugno, "");
  2800. sData += fCarePrintOutH2 (iLeft+320, iTop+130, 4, "N", narcyn, "");
  2801. sData += fCarePrintOutA (iLeft+ 60, iTop+205, 3, "N", prtdt, "");
  2802. // (약국)
  2803. sFstData = sData + fCarePrintOutH (iLeft+ 350, iTop+10, 3, "Y", fstcmd, "");
  2804. sFstData += fCareBP_EndFormat("1");
  2805. CommAX.SendMessage(sFstData);
  2806. // (간호)
  2807. sScndData = sData + fCarePrintOutH (iLeft+350, iTop+10, 3, "Y", scndcmd, "");
  2808. sScndData += fCareBP_EndFormat("1");
  2809. CommAX.SendMessage(sScndData);
  2810. CommAX.PortOpen("false");
  2811. } else {
  2812. messageBox("투약번호표를 출력하지 못했습니다. 아래 사항을 확인하십시오."
  2813. + " \n 1.프린트설정 화면에서 통신유형을 com 으로 선택한 경우 port 번호 확인"
  2814. + " \n 2.케이블 연결 확인"
  2815. + " \n 3.먼저 출력중인 바코드 확인(모두 출력된 후 출력가능)", "I", "");
  2816. return;
  2817. }
  2818. */
  2819. }
  2820. //** 응급실에서 투약신청, 즉시불출신청시 투약번호라벨 출력 추가_20081230(ByJA) **//
  2821. function fTransferSMS(){
  2822. var userid = getUserInfo("userid");
  2823. var usernm = getUserInfo("usernm");
  2824. var patnm = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/patnm");
  2825. var bedposcnts = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/bedposcnts");
  2826. var pid = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/pid");
  2827. var indd = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/indd");
  2828. var cretno = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/cretno");
  2829. var orddept = getPatientInfo("orddept");
  2830. var instcd = model.getValue("/root/main/inddpatlist/inddpatinfo["+grd_patlist.row+"]/instcd");
  2831. var msg = orddept + " " + pid + " " + patnm + "(" + bedposcnts + ")님 전원퇴실입니다."
  2832. var rtn = messageBox(msg + "\n\n응급당직교수에게 SMS를 전송하시겠습니까?", "Q999");
  2833. if (rtn == 6) {
  2834. model.removeNodeset("/root/main/callno");
  2835. submit("TRMNE00206");
  2836. var callno = model.getValue("/root/main/callno/callno");
  2837. model.removeNodeset("/root/main/smsyn");
  2838. model.makeValue("/root/send/smsmsg/log/pid", pid);
  2839. model.makeValue("/root/send/smsmsg/log/indd", indd);
  2840. model.makeValue("/root/send/smsmsg/log/cretno", cretno);
  2841. submit("TRMNE00207");
  2842. var smsyn = model.getValue("/root/main/smsyn/smsyn");
  2843. if (smsyn == 'Y') {
  2844. var rtn1 = messageBox("이미 응급당직교수에게 전원 퇴실에 대한 SMS가 발송된 환자입니다.\n\n다시한번 SMS를 전송하시겠습니까?", "Q999");
  2845. }
  2846. if (smsyn == 'N' || rtn1 == '6') {
  2847. // 응급실 코디네이터 문자 추가 송부 관련 수정_AYS_16.06.16
  2848. for(var i= 1 ; i <= getNodesetCount("/root/main/callno") ; i++){
  2849. //alert("for callno : " + i + );
  2850. model.makeValue("/root/send/smsmsg/recvr["+i+"]/usernm", usernm);
  2851. model.makeValue("/root/send/smsmsg/recvr["+i+"]/userid", userid);
  2852. model.makeValue("/root/send/smsmsg/recvr["+i+"]/mpphonno", model.getValue("/root/main/callno["+i+"]/callno"));
  2853. model.makeValue("/root/send/smsmsg/recvr["+i+"]/usernm", "응급의료센터");
  2854. }
  2855. // model.makeValue("/root/send/smsmsg/recvr/usernm", usernm);
  2856. // model.makeValue("/root/send/smsmsg/recvr/userid", userid);
  2857. // model.makeValue("/root/send/smsmsg/recvr/mpphonno", callno);
  2858. // model.makeValue("/root/send/smsmsg/recvr/usernm", "응급의료센터");
  2859. model.makeValue("/root/send/smsmsg/req/calltype", "call");
  2860. model.makeValue("/root/send/smsmsg/req/msgcnts", msg);
  2861. if (instcd == "031") {
  2862. model.makeValue("/root/send/smsmsg/req/calltelno", "0532005100");
  2863. }
  2864. else {
  2865. model.makeValue("/root/send/smsmsg/req/calltelno", "0532002100");
  2866. }
  2867. model.makeValue("/root/send/smsmsg/info/pid", pid);
  2868. model.makeValue("/root/send/smsmsg/info/indd", indd);
  2869. model.makeValue("/root/send/smsmsg/info/userid", userid);
  2870. model.makeValue("/root/send/smsmsg/info/cretno", cretno);
  2871. if (submit("TXMNE00205") ) {
  2872. messageBox("메시지 전송이 ", "I002");
  2873. }
  2874. }
  2875. }
  2876. }