SMMNW10900.js 137 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393
  1. /*
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 간호처방 ( SMMNW10900_간호처방.xrw - JScript )
  4. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  5. */
  6. var sPATINFO_PATH = "/root/main/patinfocond/patinfo"; //환자정보
  7. var sLRGSETLIST_PATH = "/root/main/prcplistinfo/anolrgsetinfo/lrgsetlist"; //대분류 그리드
  8. var sSMLSETLIST_PATH = "/root/main/prcplistinfo/anosmlsetinfo/smlsetlist"; //소분류 그리드
  9. var sPRCPSETLIST_PATH = "/root/main/prcpset/prcplist"; //간호약속 처방
  10. var sTEMPPRCPLIST_PATH = "/root/main/tempprcp/prcplist"; //임시처방
  11. var sBFPRCPLIST_PATH = "/root/main/bfprcp/prcplist"; //전처방
  12. var sPRCPLIST_PATH = "/root/main/prcp/prcplist"; //간호처방
  13. var sSIGNDATA_PATH = "/root/main/signdata/signprcplist"; //인증데이터
  14. var sSIGNTEMPDATA_PATH = "/root/main/signdata/signtempprcplist"; //인증데이터(임시처방)
  15. var homecarecenterdeptcd, homecareteamdeptcd;
  16. var signtime = "";
  17. var vsettime = "";
  18. var vsetdate = "";
  19. var spcldept = "";
  20. /**
  21. * @desc : 화면 초기화
  22. * @
  23. * @param :
  24. * @return :
  25. * @author : 성미연
  26. * @---------------------------------------------------
  27. */
  28. function fInit(){
  29. //간호처방 도움말 기능 칠곡만 보이도록 2013.07.15 KJS
  30. var sInstcd = getUserInfo("dutplceinstcd");
  31. var sDutplcecd = getUserInfo("dutplcecd");
  32. if (sInstcd == "032" || sDutplcecd == "3050135000") {
  33. btn_help.visible = true;
  34. } else {
  35. btn_help.visible = false;
  36. }
  37. if (sInstcd == "031" && sDutplcecd == "3050135000") {
  38. btn_crrt.visible = true;
  39. } else {
  40. btn_crrt.visible = false;
  41. }
  42. var settingnurid=""; //내환자 setting변수
  43. zesfInitSign(); //인증 모듈 초기화
  44. // 간호하드코딩 테이블 조회_20090416(ByJA)
  45. //----------(20110118) 경북대
  46. //var pCode = "'047', '048','002','195','207'"; // 조회할 CdGrupID 코드정보 002 : 응급의료센터 추가 (야간가산은 응급의료센터만 세팅)20091214 김홍점
  47. var pCode = "'003', '047', '048','002','195','207','016','T84','202','I09'"; //마취회복실추가 '046':영상의학과 추가. 'T84':인증저장팝업.
  48. var machideptcd = "";
  49. //----------(20110118) 경북대
  50. var pDate = getCurrentDate(); // 조회기준일자
  51. fGetNursHardCdInfo(pCode, pDate);
  52. for(var i=1; i<=getNodesetCount("/root/code/codeinfo/codelist"); i++){
  53. switch (model.getValue("/root/code/codeinfo/codelist["+i+"]/cdgrupid")){
  54. case "202": //대차여부
  55. cartcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
  56. break;
  57. case "047": // 가정간호센터
  58. homecarecenterdeptcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
  59. break;
  60. case "048": // 가정간호팀
  61. homecareteamdeptcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
  62. break;
  63. case "016": // 마취회복실
  64. machideptcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
  65. break;
  66. case "T84":
  67. signtime = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
  68. break;
  69. }
  70. }
  71. spcldept = model.getValue("/root/code/codeinfo/codelist[cdgrupid='003']/cdid");
  72. if(cartcd != 'Y'){
  73. grd_prcpposlist.colHidden(grd_prcpposlist.colRef("drprcpetc10")) = true;
  74. grd_bfprcplist.colHidden(grd_bfprcplist.colRef("drprcpetc10")) = true;
  75. }
  76. // 응급실 24시간 이내 환자 응급 가산을 위해 주석 처리 2016.01.01 엄영만
  77. //if(getUserInfo("dutplceinstcd") == "031") {
  78. // grd_prcpposlist.colHidden(grd_prcpposlist.colRef("erprcpflag")) = true;
  79. //}
  80. model.removeNodeset(sLRGSETLIST_PATH);
  81. model.removeNodeset(sSMLSETLIST_PATH);
  82. model.removeNodeset(sPRCPSETLIST_PATH);
  83. model.removeNodeset(sTEMPPRCPLIST_PATH);
  84. model.removeNodeset(sBFPRCPLIST_PATH);
  85. model.removeNodeset(sPRCPLIST_PATH);
  86. //콤보리스트 셋팅(급비, 처방분류)
  87. zbcfGetCodeList(new Array("M0029", "M0005", "M0007", "P0506"), new Array("/root/init/comcodelist/payflag_cmblist", "/root/init/comcodelist/clscd_cmblist", "/root/init/comcodelist/opflag_cmblist" ,"/root/init/drgacptflag"), true);
  88. addComboItem("cmb_listclscd", "전체", "ALL", "above" );
  89. model.setValue("/root/main/srchcond/srchclscd", "ALL");
  90. model.setValue("/root/main/bfprcpinfo/bfcond/srchclscd", "ALL");
  91. model.setValue("/root/main/tempprcpinfo/tempcond/srchclscd", "ALL");
  92. //초기 셋팅값
  93. model.setValue("/root/main/cond/prcpdd", getCurrentDate()); //처방일
  94. model.setValue("/root/main/bfprcpinfo/bfcond/prcpfromdd", model.getValue("/root/main/cond/prcpdd").toDate().getAddDate(-7, "D").getDateFormat()); //전처방
  95. model.setValue("/root/main/bfprcpinfo/bfcond/prcptodd", model.getValue("/root/main/cond/prcpdd"));
  96. // 간호환경설정 테이블 조회_20110215
  97. // var pCode = "'002'"; // 조회할 CdGrupID 코드정보
  98. // var pDate = getCurrentDate(); //조회기준일자
  99. // fGetNursHardCdInfo(pCode, pDate);
  100. //설정된 상단정보를 불러옴
  101. model.makeNode("/root/main/paminfo");
  102. var node = getGlobalVariable("paminfo");
  103. setCSVToNode("/root/main/paminfo", node);
  104. if (model.getValue("/root/main/paminfo/list/pid") != "") { //상단정보에 환자가 셋팅되어 있을 경우
  105. model.makeValue("/root/main/cond/upinfoyn", "Y");
  106. //patinfo 정보 셋팅
  107. if (model.getValue("/root/main/paminfo/list/ioflag") == 'O') {
  108. var centcd = model.getValue("/root/main/paminfo/list/centcd");
  109. if(centcd == "-" || centcd == "") {
  110. model.setValue("/root/main/cond/wardcd" , model.getValue("/root/main/paminfo/list/orddeptcd"));
  111. } else {
  112. model.setValue("/root/main/cond/wardcd" , centcd);
  113. }
  114. // model.setValue("/root/main/cond/wardcd" , model.getValue("/root/main/paminfo/list/orddeptcd"));
  115. model.setValue(sPATINFO_PATH + "/wardcd" , model.getValue("/root/main/paminfo/list/orddeptcd"));
  116. model.setValue(sPATINFO_PATH + "/orddd" , model.getValue("/root/main/paminfo/list/orddd"));
  117. model.setValue(sPATINFO_PATH + "/acptseqno" , model.getValue("/root/main/paminfo/list/acptseqno"));
  118. model.setValue(sPATINFO_PATH + "/orddrid" , model.getValue("/root/main/paminfo/list/orddrid"));
  119. model.setValue(sPATINFO_PATH + "/clincstdyflag", model.getValue("/root/main/paminfo/list/clincstdyacptflag"));
  120. model.setValue(sPATINFO_PATH + "/clincstdycd" , model.getValue("/root/main/paminfo/list/clincstdyno"));
  121. model.makeValue(sPATINFO_PATH + "/dschnotiyn" , "N"); // 간호사퇴원확정여부_20080807추가(ByJA)
  122. model.makeValue(sPATINFO_PATH + "/careinrmyn" , "Y"); // 입실확인여부 체크 외래는 비교대상이 아니므로 무조건 Y 20090908 khj
  123. } else {
  124. model.setValue("/root/main/cond/wardcd" , model.getValue("/root/main/paminfo/list/wardcd"));
  125. model.setValue(sPATINFO_PATH + "/wardcd" , model.getValue("/root/main/paminfo/list/wardcd"));
  126. model.setValue(sPATINFO_PATH + "/roomcd" , model.getValue("/root/main/paminfo/list/roomcd"));
  127. model.setValue(sPATINFO_PATH + "/indd" , model.getValue("/root/main/paminfo/list/indd"));
  128. model.setValue(sPATINFO_PATH + "/orddrid" , model.getValue("/root/main/paminfo/list/medispclid"));
  129. model.setValue(sPATINFO_PATH + "/clincstdyflag", model.getValue("/root/main/paminfo/list/clincstdyyn"));
  130. model.setValue(sPATINFO_PATH + "/clincstdycd" , model.getValue("/root/main/paminfo/list/clincstdycd"));
  131. model.makeValue(sPATINFO_PATH + "/dschnotiyn" , model.getValue("/root/main/paminfo/list/dschnotiyn")); // 간호사퇴원확정여부_20080807추가(ByJA)
  132. if ( model.getValue("/root/main/paminfo/list/ioflag") == 'E' && model.getValue("/root/main/paminfo/list/calcdd") != '-' ){
  133. model.makeValue(sPATINFO_PATH + "/careinrmyn" ,'Y');// 입실확인여부 체크 20090908 khj
  134. } else if ( model.getValue("/root/main/paminfo/list/ioflag") != 'E' && model.getValue("/root/main/paminfo/list/careinrmdd") != '-' ){
  135. model.makeValue(sPATINFO_PATH + "/careinrmyn" ,'Y');// 입실확인여부 체크 20090908 khj
  136. } else {
  137. model.makeValue(sPATINFO_PATH + "/careinrmyn" ,'N');// 입실확인여부 체크 20090908 khj
  138. }
  139. }
  140. model.setValue(sPATINFO_PATH + "/pid" , model.getValue("/root/main/paminfo/list/pid"));
  141. model.setValue(sPATINFO_PATH + "/patnm" , model.getValue("/root/main/paminfo/list/hngnm"));
  142. model.setValue(sPATINFO_PATH + "/cretno" , model.getValue("/root/main/paminfo/list/cretno"));
  143. model.setValue(sPATINFO_PATH + "/orddeptcd", model.getValue("/root/main/paminfo/list/orddeptcd"));
  144. model.setValue(sPATINFO_PATH + "/ordtype" , model.getValue("/root/main/paminfo/list/ioflag"));
  145. model.setValue(sPATINFO_PATH + "/sexage" , model.getValue("/root/main/paminfo/list/sex") + "/" + model.getValue("/root/main/paminfo/list/age"));
  146. model.setValue(sPATINFO_PATH + "/insukind" , model.getValue("/root/main/paminfo/list/insukind"));
  147. model.setValue(sPATINFO_PATH + "/specordyn", model.getValue("/root/main/paminfo/list/specordyn"));
  148. model.setValue(sPATINFO_PATH + "/instcd" , model.getValue("/root/main/paminfo/list/instcd"));
  149. ////20110828_KNUH_Start 내환자setting정보 조회.
  150. fGetSettringInfoRef();
  151. //내환자셋팅정보가 있으면 set,없으면 그냥 null
  152. settingnurid = model.getValue("/root/init/settinginfo/settingrn[settingrnid='" + getUserInfo("userid") +"']/settingrnid");
  153. if(settingnurid == null || settingnurid == "") {
  154. } else {
  155. model.setValue(cmb_settingrn.attribute("ref"), getUserInfo("userid"));
  156. cmb_settingrn.refresh();
  157. }
  158. //20110828_KNUH_End
  159. } else {
  160. // chk_clincstdy.disabled = true;
  161. // model.setValue("/root/main/cond/clincstdyflag", "N");
  162. model.setValue("/root/main/cond/wardcd", getUserInfo("dutplcecd")); //상단정보가 없을 경우 간호사 소속부서
  163. //20110828_KNUH_Start 환자setting정보 조회
  164. fGetSettringInfoRef();
  165. settingnurid = model.getValue("/root/init/settinginfo/settingrn[settingrnid='" + getUserInfo("userid") +"']/settingrnid");
  166. //내환자셋팅정보가 있으면 set,없으면 그냥 null
  167. if(settingnurid == null || settingnurid == "") {
  168. } else {
  169. model.setValue(cmb_settingrn.attribute("ref"), getUserInfo("userid"));
  170. cmb_settingrn.refresh();
  171. }
  172. //20110828_KNUH_End
  173. }
  174. submit("TRMNW11001", false); //부서콤보 조회
  175. if(getScreenMenuParameter() == "SMMNH" || opener.javascript.getParameter("screenParam") == "SMMNH"){
  176. model.setValue("/root/main/cond/homecareyn", "Y");
  177. }
  178. //20110215 이선경 : 경북대 - 응급실일 경우 구역정보를 조회
  179. fGetZoneList();
  180. fnZoneDisp();
  181. fRoomInfoRef("init"); //해당병동의 해당병실조회
  182. if(settingnurid == null || settingnurid=="") {
  183. cmb_room.disabled = false;
  184. } else {
  185. cmb_room.disabled = true;
  186. fPatInfoRef("I");
  187. }
  188. cmb_userpos.disabled = true;
  189. fChkClincstdy(); //임상연구 체크 20100727 환자정보 최종 카피되고 나서 세팅해야하므로 위치 옮기면 안됌.
  190. //가정간호처방일 경우 방문일자 셋팅
  191. if(getScreenMenuParameter() == "SMMNH" || opener.javascript.getParameter("screenParam") == "SMMNH"){
  192. model.setValue("/root/main/prcpposinfo/cond/poscd" , "2"); // 처방위치_2:User위치
  193. model.setValue("/root/main/prcpposinfo/cond/deptcd", homecarecenterdeptcd); // User위치코드_2361000000:가정간호센터_강남성모,서울성모병원
  194. if(cmb_userpos.label == ""){
  195. model.setValue("/root/main/prcpposinfo/cond/deptcd", homecareteamdeptcd); // User위치코드_3090100000:가정간호팀_강남성모,서울성모병원
  196. }
  197. cmb_userpos.disabled = false;
  198. fSearchHomePatInfo(); // 방문일자 조회_추가(20090331_ByJA)
  199. } else if(getScreenMenuParameter() == "SMMND"){ //인공신장일 경우 처방위치 user위치로_20081015(byJA_소경화ITC요청)
  200. model.setValue("/root/main/prcpposinfo/cond/poscd" , "2"); // 처방위지_2:User위치
  201. model.setValue("/root/main/prcpposinfo/cond/deptcd", getUserInfo("dutplcecd")); //소속부서
  202. cmb_userpos.disabled = false;
  203. } else if(getScreenMenuParameter() == "SMAEA" || opener.javascript.getParameter("screenParam") == "SMAEA"){ //간호기능파트(내시경실, 부정맥검사실, 간크리닉, 기관지경실, 심장초음파실) 경우 처방위치 user위치로_20081208(ByJA)
  204. model.setValue("/root/main/prcpposinfo/cond/poscd" , "2"); // 처방위지_2:User위치
  205. model.setValue("/root/main/prcpposinfo/cond/deptcd", getUserInfo("dutplcecd")); //소속부서
  206. cmb_userpos.disabled = false;
  207. } else if(machideptcd == getUserInfo("dutplcecd") ){ //-------------(20110118) 경북대 간호기능파트(마취회복실) 경우 처방위치 user위치
  208. model.setValue("/root/main/prcpposinfo/cond/poscd" , "2"); // 처방위지_2:User위치
  209. model.setValue("/root/main/prcpposinfo/cond/deptcd", getUserInfo("dutplcecd")); //소속부서
  210. cmb_userpos.disabled = false;
  211. } //-------------(20110118) 경북대
  212. cmb_userpos.refresh();
  213. if (model.getValue("/root/main/cond/homecareyn") == "Y"){
  214. cap_visitdd.visible = true;
  215. cmb_visitdd.visible = true;
  216. grd_prcpposlist.valueMatrix(0, grd_prcpposlist.colRef("prcpdelivefact")) = "방문일자";
  217. grd_bfprcplist.valueMatrix(0, grd_prcpposlist.colRef("prcpdelivefact")) = "방문일자";
  218. cmb_bfcond.choices.itemset.attribute("nodeset") = "/root/init/homebfcondinfo/homebfcond";
  219. }else{
  220. cap_visitdd.visible = false;
  221. cmb_visitdd.visible = false;
  222. grd_prcpposlist.valueMatrix(0, grd_prcpposlist.colRef("prcpdelivefact")) = "적용일자";
  223. grd_bfprcplist.valueMatrix(0, grd_prcpposlist.colRef("prcpdelivefact")) = "적용일자";
  224. cmb_bfcond.choices.itemset.attribute("nodeset") = "/root/init/bfcondinfo/bfcond";
  225. }
  226. //*** 처방목록
  227. model.makeValue("/root/send/reqdata/comnrefflag", 'Y');
  228. submit("TRMNW10901", false); //set부서콤보 조회(공통 포함)
  229. if(getScreenMenuParameter() == "SMMNH" || opener.javascript.getParameter("screenParam") == "SMMNH"){
  230. model.setValue("/root/main/prcplistinfo/setcond/settrgtcd", homecarecenterdeptcd); // User위치코드_2361000000:가정간호센터_강남성모,서울성모병원
  231. if(cmb_dept.label == ""){
  232. model.setValue("/root/main/prcplistinfo/setcond/settrgtcd", homecareteamdeptcd); // User위치코드_3090100000:가정간호팀_강남성모,서울성모병원
  233. }
  234. }else{
  235. model.setValue("/root/main/prcplistinfo/setcond/settrgtcd", getUserInfo("dutplcecd")); //소속부서
  236. }
  237. cmb_dept.refresh();
  238. if (model.getValue("/root/init/deptinfo/deptlist[deptcd = '"+ model.getValue("/root/main/prcplistinfo/setcond/settrgtcd") + "']/deptcd") == "") {
  239. model.setValue("/root/main/prcplistinfo/setcond/settrgtcd", 'ALL'); //소속부서 없을 경우 공통으로 셋팅
  240. }
  241. model.setValue("/root/main/prcplistinfo/setcond/setclscd", 'W');
  242. model.setValue("/root/main/prcplistinfo/setcond/settypecd", 'P');
  243. model.setValue("/root/main/prcplistinfo/setcond/setkindcd", 'D');
  244. fLrgSetRef(); //대분류 set조회
  245. // fReqBfNursPrcpInfo(); //전처방 조회
  246. // fReqTempNursPrcpInfo(); //임시처방 조회
  247. var pid = model.getValue("/root/main/cond/pid");
  248. if(pid != ""){
  249. fprtlnm(pid);
  250. }
  251. }
  252. /**
  253. * @desc : 부서조건에 따른 병실 조회
  254. * @
  255. * @param :initflag ="init" 초기화
  256. * @return :
  257. * @author : 성미연
  258. * @---------------------------------------------------
  259. */
  260. function fRoomInfoRef(initflag) {
  261. model.removeNodeset("/root/init/roominfo/room/roomcd");
  262. model.resetInstanceNode("/root/main/cond/patnm");
  263. model.resetInstanceNode("/root/main/cond/pid");
  264. model.removeNodeset(sPRCPLIST_PATH);
  265. model.removeNodeset(sTEMPPRCPLIST_PATH);
  266. model.removeNodeset(sBFPRCPLIST_PATH);
  267. var settingrnid = model.getValue("/root/main/cond/settingrnid");
  268. var deptflag = model.getValue("/root/init/deptinfo/deptlist[deptcd = '" + model.getValue("/root/main/cond/wardcd") + "']/deptflag");
  269. if (deptflag == 'I') { //해당병동의 해당병실조회
  270. cmb_room.disabled = false;
  271. model.removeNodeset("/root/send/reqdata");
  272. model.makeNode("/root/send/reqdata");
  273. model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
  274. model.makeValue("/root/send/reqdata/settingrnid", model.getValue("/root/main/cond/settingrnid"));
  275. if (submit("TRMNW10902", false)) {
  276. if (model.getValue("/root/main/cond/upinfoyn") == "Y") { //상단정보에 환자가 셋팅되어 있을 경우
  277. //20110828_KNUH_Start
  278. if(settingrnid == null || settingrnid == "") {
  279. model.setValue("/root/main/cond/roomcd", model.getValue("/root/main/paminfo/list/roomcd"));
  280. } else {
  281. model.setValue("/root/main/cond/roomcd", "-");
  282. }
  283. //20110828_KNUH_End
  284. fPatInfoRef("I",initflag);
  285. } else {
  286. model.setValue("/root/main/cond/roomcd", "-");
  287. model.removeNodeset("/root/init/patinfo/patlist");
  288. }
  289. }
  290. } else { //외래과 환자 조회
  291. cmb_room.disabled = true;
  292. fPatInfoRef("O", initflag);//병동은 상관없고 외래인경우 내시경실의 경우 상단정보대로 처방발생20100409 변경협의체결과 나오기전까지 임시 khj ->16040 요청번호에 의해 당일수진에만 처방발생하도록 함. 20100715 김홍점
  293. }
  294. model.refresh();
  295. }
  296. //20110828_KNUH_Start 환자setting정보 조회
  297. function fGetSettringInfoRef() {
  298. model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd") );
  299. submit("TRMNW10910");
  300. cmb_settingrn.refresh();
  301. }
  302. /**
  303. * @desc : 병실별 환자리스트 조회, 부서별 환자리스트 조회
  304. * @
  305. * @param :
  306. * @return :
  307. * @author : 성미연
  308. * @---------------------------------------------------
  309. */
  310. function fPatInfoRef(deptflag, initflag) {
  311. var settingnurid="";
  312. settingnurid = model.getValue("/root/main/cond/settingrnid");
  313. model.resetInstanceNode("/root/main/cond/pid");
  314. model.resetInstanceNode("/root/main/cond/patnm");
  315. model.removeNodeset(sPRCPLIST_PATH);
  316. model.removeNodeset(sTEMPPRCPLIST_PATH);
  317. model.removeNodeset(sBFPRCPLIST_PATH);
  318. model.removeNodeset("/root/send/reqdata");
  319. model.makeNode("/root/send/reqdata");
  320. model.makeValue("/root/send/reqdata/orddd", model.getValue("/root/main/cond/prcpdd"));
  321. model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
  322. var centcd = model.getValue("/root/main/paminfo/list/centcd");
  323. if(centcd != "-" && centcd != "") {
  324. model.makeValue("/root/send/reqdata/centflag", "Y");
  325. }
  326. model.makeValue("/root/send/reqdata/settingrnid", model.getValue("/root/main/cond/settingrnid"));
  327. if (deptflag == "I") { //병실별 환자조회
  328. //20110828_KNUH_Start
  329. if(settingnurid == null || settingnurid == "") {
  330. model.makeValue("/root/send/reqdata/roomcd", model.getValue("/root/main/cond/roomcd"));
  331. } else {
  332. model.makeValue("/root/send/reqdata/roomcd", "-");
  333. }
  334. //20110828_KNUH_End
  335. model.makeValue("/root/send/reqdata/refflag", "room");
  336. model.makeValue("/root/send/reqdata/ordtype", "I");
  337. model.makeValue("/root/send/reqdata/zonecd", model.getValue("/root/main/cond/zonecd"));
  338. model.makeValue("/root/send/reqdata/settingrnid", model.getValue("/root/main/cond/settingrnid"));
  339. } else { //외래부서 환자조회
  340. model.makeValue("/root/send/reqdata/refflag", "dept");
  341. model.makeValue("/root/send/reqdata/ordtype", "O");
  342. model.makeValue("/root/send/reqdata/homecareyn", model.getValue("/root/main/cond/homecareyn"));
  343. }
  344. if(spcldept == model.getValue("/root/main/cond/wardcd")) {
  345. model.makeValue("/root/send/reqdata/spcldeptyn", "Y");
  346. } else {
  347. model.makeValue("/root/send/reqdata/spcldeptyn", "");
  348. }
  349. if (submit("TRMNW10903", false)) {
  350. if (model.getValue("/root/main/cond/upinfoyn") == "Y") { //상단정보에 환자가 셋팅되어 있을 경우
  351. model.setValue("/root/main/cond/patnm", model.getValue("/root/main/paminfo/list/pid"));
  352. model.setValue("/root/main/cond/pid", model.getValue("/root/main/paminfo/list/pid"));
  353. //가정간호 환자인 경우 방문일자 조회
  354. if(model.getValue("/root/main/cond/homecareyn") == "Y") {
  355. fSearchHomePatInfo();
  356. }
  357. } else {
  358. model.setValue("/root/main/cond/patnm", "");
  359. model.setValue("/root/main/cond/pid", "");
  360. }
  361. }
  362. var pid=model.getValue("/root/main/cond/pid");
  363. //병동은 상관없고 외래인경우 내시경실의 경우 상단정보대로 처방발생20100409 변경협의체결과 나오기전까지 임시 khj
  364. //->16040 요청번호에 의해 당일수진에만 처방발생하도록 함. 20100715 김홍점
  365. // if ( (getScreenMenuParameter() == "SMAEA" || opener.javascript.getScreenID() == "SMAEA01500" )
  366. // && deptflag == "O"
  367. // && initflag == "init"
  368. // || deptflag == "I"){////병동은 퇴원환자도 전처방은 조회되어야 함.
  369. if ( initflag == "init" && deptflag == "I"){////병동은 퇴원환자도 전처방은 조회되어야 함.
  370. if ( !isNull(model.getValue("/root/init/patinfo/patlist[pid = '" + pid + "']/pid"))) {
  371. //환자정보조건 셋팅
  372. model.copyNode("/root/main/patinfocond/patinfo", "/root/init/patinfo/patlist[pid = '" + pid + "']");
  373. }
  374. fReqBfNursPrcpInfo(); //전처방 조회
  375. fReqTempNursPrcpInfo(); //임시처방 조회
  376. }else{
  377. fChgPatnm(deptflag, model.getValue("/root/main/cond/prcpdd"),initflag);
  378. }
  379. model.refresh();
  380. }
  381. /**
  382. * @desc : 환자아이디로 해당부서, 병실, 환자명 조회
  383. * @
  384. * @param :
  385. * @return :
  386. * @author : 성미연
  387. * @---------------------------------------------------
  388. */
  389. function fSearchPatInfo() {
  390. if(event.keycode == "13"){
  391. model.setFocus("btn_ref");
  392. //그리드 초기화
  393. model.removeNodeset(sPRCPLIST_PATH);
  394. model.removeNodeset(sTEMPPRCPLIST_PATH);
  395. model.removeNodeset(sBFPRCPLIST_PATH);
  396. //환자아이디로 현재 상태 조회
  397. var pid = model.getValue("/root/main/cond/pid");
  398. model.removeNodeset("/root/send/reqdata");
  399. model.makeNode("/root/send/reqdata");
  400. model.makeValue("/root/send/reqdata/orddd", model.getValue("/root/main/cond/prcpdd"));
  401. model.makeValue("/root/send/reqdata/pid", model.getValue("/root/main/cond/pid"));
  402. model.makeValue("/root/send/reqdata/refflag", "pat");
  403. model.makeValue("/root/send/reqdata/homecareyn", model.getValue("/root/main/cond/homecareyn"));
  404. if (submit("TRMNW10904")) {
  405. if (model.getValue("/root/main/patinfocond/patinfo/wardcd") == 'err') {
  406. messageBox("해당 환자 정보가 존재하지 않습니다.", "I");
  407. model.setValue("/root/main/cond/patnm", model.getValue("/root/init/patinfo/patlist/pid"));
  408. model.setFocus("ipt_pid");
  409. model.refresh();
  410. return;
  411. } else {
  412. btn_signsave.disabled = false;
  413. //해당 부서 셋팅
  414. if (getNodesetCount("/root/main/patinfocond/patinfo") > 1 ) {
  415. modal("SPMNW11800", 1, 100, 100, "SPMNW11800", "/root/main/patinfocond", "/root/main/patinfocond");
  416. }
  417. model.setValue("/root/main/cond/wardcd", model.getValue("/root/main/patinfocond/patinfo/wardcd"));
  418. if (model.getValue("/root/main/patinfocond/patinfo/ordtype") == 'I' || model.getValue("/root/main/patinfocond/patinfo/ordtype") == 'D' || model.getValue("/root/main/patinfocond/patinfo/ordtype") == 'E') {
  419. cmb_room.disabled = false;
  420. //해당 병동의 병실 조회
  421. model.removeNodeset("/root/send/reqdata");
  422. model.makeNode("/root/send/reqdata");
  423. model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
  424. submit("TRMNW10902", false);
  425. model.setValue("/root/main/cond/roomcd", model.getValue("/root/main/patinfocond/patinfo/roomcd")); //해당 병실 셋팅
  426. //해당 병실의 환자 조회
  427. model.removeNodeset("/root/send/reqdata");
  428. model.makeNode("/root/send/reqdata");
  429. model.makeValue("/root/send/reqdata/orddd", model.getValue("/root/main/cond/prcpdd"));
  430. model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
  431. model.makeValue("/root/send/reqdata/roomcd", model.getValue("/root/main/cond/roomcd"));
  432. model.makeValue("/root/send/reqdata/refflag", "room");
  433. model.makeValue("/root/send/reqdata/ordtype", "I");
  434. model.makeValue("/root/send/reqdata/settingrnid", model.getValue("/root/main/cond/settingrnid"));
  435. if(spcldept == model.getValue("/root/main/cond/wardcd")) {
  436. model.makeValue("/root/send/reqdata/spcldeptyn", "Y");
  437. } else {
  438. model.makeValue("/root/send/reqdata/spcldeptyn", "");
  439. }
  440. submit("TRMNW10903", false);
  441. //20110216 경북대 : 응급실 구역 매핑
  442. model.makeValue("/root/main/cond/zonecd", model.getValue("/root/main/patinfocond/patinfo/zonecd"));
  443. } else {
  444. model.removeNodeset("/root/init/roominfo/room/roomcd");
  445. cmb_room.disabled = true;
  446. //해당 부서(진료과)의 환자 조회
  447. model.removeNodeset("/root/send/reqdata");
  448. model.makeNode("/root/send/reqdata");
  449. model.makeValue("/root/send/reqdata/orddd", model.getValue("/root/main/cond/prcpdd"));
  450. model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
  451. model.makeValue("/root/send/reqdata/refflag", "dept");
  452. model.makeValue("/root/send/reqdata/ordtype", "O");
  453. model.makeValue("/root/send/reqdata/homecareyn", model.getValue("/root/main/cond/homecareyn"));
  454. if(spcldept == model.getValue("/root/main/cond/wardcd")) {
  455. model.makeValue("/root/send/reqdata/spcldeptyn", "Y");
  456. } else {
  457. model.makeValue("/root/send/reqdata/spcldeptyn", "");
  458. }
  459. submit("TRMNW10903", false);
  460. //가정간호 환자인 경우 방문일자 조회
  461. if(model.getValue("/root/main/cond/homecareyn") == "Y") {
  462. fSearchHomePatInfo();
  463. }
  464. }
  465. //환자정보조건 셋팅
  466. model.copyNode("/root/main/patinfocond/patinfo", "/root/init/patinfo/patlist[pid = '" + pid + "']");
  467. model.setValue("/root/main/cond/patnm", model.getValue("/root/main/patinfocond/patinfo/pid")); //해당 환자명 셋팅
  468. fChkClincstdy(); //임상연구 체크
  469. fReqBfNursPrcpInfo(); //전처방 조회
  470. fReqTempNursPrcpInfo(); //임시처방 조회
  471. }
  472. }
  473. }
  474. }
  475. /**
  476. * @desc : 조회조건 환자명 변경시
  477. * @
  478. * @param :
  479. * @return :
  480. * @author : 성미연
  481. * @---------------------------------------------------
  482. */
  483. function fChgPatnm(deptflag, prcpdd, initflag) {
  484. btn_signsave.disabled = false;
  485. model.removeNodeset(sPRCPSETLIST_PATH); //SET처방 조회하는 시점에 spynpy1를 조회하기 위한 insukind를 넘겨줘야 함(환자별로 다름)
  486. model.removeNodeset(sPRCPLIST_PATH);
  487. var pid = model.getValue("/root/main/cond/patnm");
  488. model.setValue("/root/main/cond/pid", pid);
  489. if ( isNull(model.getValue("/root/init/patinfo/patlist[pid = '" + pid + "']/pid"))) {
  490. if (initflag =="init"
  491. && deptflag == "O"
  492. && model.getValue(sPATINFO_PATH + "/orddd") != prcpdd
  493. && model.getValue("/root/main/cond/upinfoyn") =="Y" ) { //화면오픈시 외래수진일자와 처방일자가 다를경우 블러킹메시지.20100727 김홍점 김숙인itc요청
  494. messageBox("진료일["+model.getValue(sPATINFO_PATH + "/orddd")+"]과 처방일자가 달라 처방발행이 불가능합니다", "I");
  495. btn_signsave.disabled = true;
  496. if ( !isNull(model.getValue("/root/main/cond/patnm")) ) {
  497. fReqBfNursPrcpInfo(); //전처방 조회
  498. fReqTempNursPrcpInfo(); //임시처방 조회
  499. }
  500. return;
  501. }else {
  502. model.resetInstanceNode("/root/main/cond/pid");
  503. }
  504. }
  505. ipt_pid.refresh();
  506. if (model.getValue("/root/init/patinfo/patlist[pid = '" + pid + "']/elbulbodstat") == '0') { //M0062 전광판상태
  507. messageBox("해당 과에 간호접수되지 않은 환자입니다.", "I");
  508. }
  509. //환자정보조건 셋팅
  510. model.copyNode(sPATINFO_PATH, "/root/init/patinfo/patlist[pid = '" + pid + "']");
  511. //가정간호 환자인 경우 방문일자 조회
  512. if(model.getValue("/root/main/cond/homecareyn") == "Y") {
  513. fSearchHomePatInfo();
  514. }
  515. fChkClincstdy(); //임상연구 체크
  516. if ( !isNull(model.getValue("/root/main/cond/patnm")) && !isNull(model.getValue("/root/main/cond/pid")) ) {
  517. fReqBfNursPrcpInfo(); //전처방 조회
  518. fReqTempNursPrcpInfo(); //임시처방 조회
  519. }
  520. // 항암프로토콜명 조회
  521. if(pid != ""){
  522. fprtlnm(pid);
  523. }
  524. }
  525. /**
  526. * @desc : 가정간호 환자의 소속 정보 조회(방문일자 포함)
  527. * @
  528. * @param :
  529. * @return :
  530. * @author : 성미연
  531. * @---------------------------------------------------
  532. */
  533. function fSearchHomePatInfo() {
  534. //해당 환자의 방문일자 조회 : 방문일자에 따라 원무정보가 달라짐
  535. model.removeNodeset("/root/send/reqdata");
  536. model.makeNode("/root/send/reqdata");
  537. model.makeValue("/root/send/reqdata/pid", model.getValue("/root/main/cond/pid"));
  538. submit("TRMNW10909");
  539. }
  540. /**
  541. * @desc : 방문일자 변경시 환자정보 셋팅
  542. * @
  543. * @param :
  544. * @return :
  545. * @author : 성미연
  546. * @---------------------------------------------------
  547. */
  548. function fChgVisitDD() {
  549. var visitdd = model.getValue("/root/main/cond/visitdd");
  550. var prcpvisitdd = model.getValue(sPRCPLIST_PATH + "/prcpdelivefact");
  551. if(prcpvisitdd != ""){
  552. if(visitdd != prcpvisitdd){
  553. messageBox("방문일이 동일한 처방에 대해서만 일괄 저장이 가능합니다.", "C");
  554. model.setValue("/root/main/cond/visitdd", prcpvisitdd);
  555. cmb_visitdd.refresh();
  556. return;
  557. }
  558. }
  559. //model.copyNode("/root/main/patinfocond/patinfo", "/root/init/homepatinfo/patlist[orddd = '" + visitdd + "']");
  560. model.refresh();
  561. }
  562. /**
  563. * @desc : 환자에 따른 임상연구 체크
  564. * @
  565. * @param :
  566. * @return :
  567. * @author : 성미연
  568. * @---------------------------------------------------
  569. */
  570. function fChkClincstdy() {
  571. //clincstdyacptflag : otpt(N:임상시험접수아님, P:사람임상 A:동물임상), inpt(임상연구여부)
  572. if( !isNull(model.getValue(sPATINFO_PATH + "/clincstdyflag"))
  573. && model.getValue(sPATINFO_PATH + "/clincstdyflag") != "N"){
  574. chk_clincstdy.disabled = false;
  575. model.setValue("/root/main/cond/clincstdyflag", "Y");
  576. }else{
  577. chk_clincstdy.disabled = true;
  578. model.setValue("/root/main/cond/clincstdyflag", "N");
  579. }
  580. }
  581. /**
  582. * @desc : 대분류 SET 조회
  583. * @
  584. * @param :
  585. * @return :
  586. * @author : 성미연
  587. * @---------------------------------------------------
  588. */
  589. function fLrgSetRef() {
  590. if (model.getValue("/root/main/prcplistinfo/setcond/settrgtcd") != "") {
  591. if (model.getValue("/root/main/prcplistinfo/setcond/settrgtcd") == 'ALL') { //공통일 경우
  592. model.setValue("/root/main/prcplistinfo/setcond/setclscd", 'N');
  593. } else { //부서일 경우
  594. model.setValue("/root/main/prcplistinfo/setcond/setclscd", 'W');
  595. }
  596. model.removeNodeset("/root/send/reqdata");
  597. model.makeNode("/root/send/reqdata");
  598. model.copyNode("/root/send/reqdata", "/root/main/prcplistinfo/setcond");
  599. model.makeValue("/root/send/reqdata/clsflag", 'lrg');
  600. submit("TRMNW11601"); //대분류명 조회
  601. model.removeNodeset(sSMLSETLIST_PATH);
  602. model.removeNodeset(sPRCPSETLIST_PATH);
  603. model.refresh();
  604. }
  605. }
  606. /**
  607. * @desc : 소분류 SET 조회
  608. * @
  609. * @param :
  610. * @return :
  611. * @author : 성미연
  612. * @---------------------------------------------------
  613. */
  614. function fSmlSetRef() {
  615. if (isDataCell()) {
  616. model.removeNodeset("/root/send/reqdata");
  617. model.makeNode("/root/send/reqdata");
  618. model.copyNode("/root/send/reqdata", "/root/main/prcplistinfo/setcond");
  619. model.makeValue("/root/send/reqdata/clsflag", 'sml');
  620. model.makeValue("/root/send/reqdata/setno", model.getValue("/root/main/prcplistinfo/anolrgsetinfo/lrgsetlist[" + grd_lrgsetlist.row + "]/setno"));
  621. submit("TRMNW11602"); //소분류명 조회
  622. model.removeNodeset(sPRCPSETLIST_PATH);
  623. model.refresh();
  624. }
  625. }
  626. /**
  627. * @desc : 간호약속처방SET 조회 (처방상세)
  628. * @
  629. * @param :
  630. * @return :
  631. * @author : 성미연
  632. : - 오지훈 2007.12.27 수정
  633. * @---------------------------------------------------
  634. */
  635. function fReqNursPrmsSet(){
  636. if(isDataCell()){
  637. var setno = model.getValue(sSMLSETLIST_PATH + "[" + grd_smlsetlist.row + "]/setno");
  638. var settypecd = "P";
  639. model.removeNodeset("/root/send/reqdata");
  640. model.makeValue("/root/send/reqdata/setno" , setno);
  641. model.makeValue("/root/send/reqdata/settypecd", settypecd);
  642. model.makeValue("/root/send/reqdata/insukind" , model.getValue("/root/main/patinfocond/patinfo/insukind"));
  643. model.makeValue("/root/send/reqdata/deptcd", model.getValue("/root/main/cond/wardcd"));
  644. grd_prcplist.rebuildStyle();
  645. if(submit("TRMNW11003")) {
  646. //SET 처방리스트에서 청구주기가 월일 경우 파란색
  647. for ( i = 1; i<= getNodesetCount(sPRCPSETLIST_PATH); i++) {
  648. var tempcol10 = model.getValue(sPRCPSETLIST_PATH + "[" + i + "]/tempcol10");
  649. if (tempcol10 == "4")
  650. grd_prcplist.rowStyle(i, "data", "color") = "#0000ff";
  651. }
  652. grd_prcplist.refresh();
  653. }
  654. }
  655. }
  656. /**
  657. * @desc : 보험정보 조회
  658. * @
  659. * @param : calcscorcd 수가코드
  660. * @return :
  661. * @author : 성미연
  662. : - 오지훈 2007.12.27 수정
  663. * @---------------------------------------------------
  664. */
  665. function fInsuMsgInfoRef(calcscorcd) {
  666. model.removeNodeset("/root/send/reqdata");
  667. model.makeValue("/root/send/reqdata/calcscorcd", calcscorcd);
  668. if(submit("TRMNW10907")){
  669. }
  670. }
  671. /**
  672. * @desc : 약품편람 조회
  673. * @
  674. * @param :
  675. * @return :
  676. * @author : 성미연
  677. * @---------------------------------------------------
  678. */
  679. function fDrugHbook() {
  680. var prcpclscd = model.getValue(sPRCPSETLIST_PATH +"[" + grd_prcplist.row + "]/prcpclscd");
  681. if("A2" == prcpclscd || "A4" == prcpclscd || "A6" == prcpclscd) {
  682. model.makeValue("/root/temp/setparma/prcpcd", model.getValue(sPRCPSETLIST_PATH +"[" + grd_prcplist.row + "]/prcpcd"));
  683. modal("SMADB01900", "1", "0", "0", "","/root/temp/setparma/prcpcd", "/root/hidden/receivedata/srchdrugcd");
  684. model.removenode("/root/temp/setparma/prcpcd");
  685. } else {
  686. messageBox("약/주사 처방이 아닙니다.", "I");
  687. }
  688. }
  689. /**
  690. * @desc : 수가편람 조회
  691. * @
  692. * @param :
  693. * @return :
  694. * @author : 성미연
  695. * @---------------------------------------------------
  696. */
  697. function fCalcScorHbook(flag) {
  698. var prcpcd;
  699. if(flag == 'prcp'){
  700. prcpcd = model.getValue(sPRCPSETLIST_PATH +"[" + grd_prcplist.row + "]/prcpcd")
  701. model.makeValue("/root/temp/setparma/prcpcd", prcpcd);
  702. modal("SMPIC00200", "1", "400", "400", "", "/root/temp/setparma/prcpcd" , "/root/temp");
  703. if(prcpcd == model.getValue("/root/temp/picmmech/picmmech_calcscorcd") ) {
  704. if (grd_prcplist.row > 0 ){
  705. if (model.getValue("/root/main/cond/patnm") == "") {
  706. messageBox("해당 환자를", "C002");
  707. return;
  708. }
  709. //처방 main grid로 약속처방 copy
  710. mnwAddNursPrcp(sPRCPSETLIST_PATH, "/root/main/prcp", grd_prcplist.row, "");
  711. var prcplist = model.instances(0).selectNodes("/root/main/prcp/prcplist");
  712. fSetNursPrcpDefault(model.instances(0).selectNodes("/root/main/prcp/prcplist").length);
  713. fSetPrcpInfo();
  714. //신규처방은 반환컬럼 disable
  715. grd_prcpposlist.isReadOnly(model.instances(0).selectNodes("/root/main/prcp/prcplist").length, grd_prcpposlist.colRef("tempcol8")) = true;
  716. if ( model.getValue(sPRCPLIST_PATH + "[" + model.instances(0).selectNodes("/root/main/prcp/prcplist").length + "]/estmcls")!= "Y" ){
  717. grd_prcpposlist.isReadOnly(model.instances(0).selectNodes("/root/main/prcp/prcplist").length, grd_prcpposlist.colRef("nigtprcpflag") ) = true;
  718. }
  719. //수가 보험정보 조회
  720. var calcscormastspec = model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/calcscormastspec");
  721. var calcscorcd = calcscormastspec.split("|");
  722. fInsuMsgInfoRef(calcscorcd[3]);
  723. }
  724. }
  725. model.removenode("/root/temp/picmmech");
  726. model.removenode("/root/temp/setparma");
  727. }else if(flag == 'prcppos'){
  728. prcpcd = model.getValue(sPRCPLIST_PATH +"[" + grd_prcpposlist.row + "]/prcpcd")
  729. model.makeValue("/root/temp/setparma/prcpcd", prcpcd);
  730. modal("SMPIC00200", "1", "400", "400", "", "/root/temp/setparma/prcpcd" , "/root/temp");
  731. }else if(flag == 'bf'){
  732. prcpcd = model.getValue(sBFPRCPLIST_PATH +"[" + grd_bfprcplist.row + "]/prcpcd")
  733. model.makeValue("/root/temp/setparma/prcpcd", prcpcd);
  734. modal("SMPIC00200", "1", "400", "400", "", "/root/temp/setparma/prcpcd" , "/root/temp");
  735. }
  736. }
  737. /**
  738. * @desc : 물류편람 조회
  739. * @
  740. * @param :
  741. * @return :
  742. * @author : 성미연
  743. * @---------------------------------------------------
  744. */
  745. function fGoodHbook() {
  746. modal("SMRSC00600", "1", "0", "0");
  747. }
  748. /**
  749. * @desc : 간호처방 추가
  750. * @
  751. * @param : srcnode 원본노드
  752. * : trgtnode 목적지노드
  753. * : currow row값
  754. * : pflag 처리구분 popup에서 opener로 처리되는 경우, opener으로 설정
  755. * : status 상태구분(I:신규, U:수정, D:D/C)
  756. *
  757. * @return :
  758. * @author : 오지훈 2007.12.27
  759. * @---------------------------------------------------
  760. */
  761. function mnwAddNursPrcp(srcnode, trgtnode, currow, pflag){
  762. //목적지 노드에 처방instance를 copy한다.
  763. var node = model.instances(0).selectSingleNode(srcnode + "[" + currow + "]");
  764. if(pflag == "popup"){
  765. var desnode = opener.model.instances(0).selectSingleNode(trgtnode);
  766. var desnodelist = opener.model.instances(0).selectNodes(trgtnode);
  767. }else{
  768. var desnode = model.instances(0).selectSingleNode(trgtnode);
  769. var desnodelist = model.instances(0).selectNodes(trgtnode);
  770. }
  771. desnode.appendChild(node.cloneNode(true));
  772. }
  773. /**
  774. * @desc : 한/영 여부 검사
  775. * @
  776. * @param : param 한영구분할 문자열
  777. * @return : "H" 한글
  778. * : "E" 영문
  779. * @author : 오지훈 2007.12.28
  780. * @---------------------------------------------------
  781. */
  782. function fIsHng(param){
  783. //parameter의 첫번째 글자의 문자코드 값이 255보다 크면 한글, 작으면 영문
  784. if(param.charCodeAt(0) > 255){
  785. return "H";
  786. } else{
  787. return "E";
  788. }
  789. }
  790. /**
  791. * @desc : 처방data(명, 코드)검색
  792. * @
  793. * @param :
  794. * @return :
  795. * @author : 성미연
  796. * : - 오지훈 2007.12.27 수정
  797. * @---------------------------------------------------
  798. */
  799. function fReqSrchPrcpData(){
  800. if (model.getValue("/root/main/srchcond/srchdata").length < 2 ){
  801. messageBox("검색어는 2자 이상","C001");
  802. model.setFocus("ipt_listsrchdata");
  803. return;
  804. }
  805. var prcpclscd = model.getValue("/root/main/srchcond/srchclscd");
  806. model.removeNodeset("/root/send/reqdata");
  807. model.makeValue("/root/send/reqdata/prcpdd" , model.getValue("/root/main/cond/prcpdd"));
  808. model.makeValue("/root/send/reqdata/srchflag", model.getValue("/root/main/srchcond/srchflag"));
  809. model.makeValue("/root/send/reqdata/srchclscd", model.getValue("/root/main/srchcond/srchclscd"));
  810. model.makeValue("/root/send/reqdata/srchdata", model.getValue("/root/main/srchcond/srchdata"));
  811. model.makeValue("/root/send/reqdata/langflag", fIsHng(model.getValue("/root/main/prcpsetcond/srchdata")));
  812. model.makeValue("/root/send/reqdata/insukind", model.getValue("/root/main/patinfocond/patinfo/insukind"));
  813. //model.makeValue("/root/send/reqdata/srchallflag", "srchALL"); //srchALL일 경우는 검색조건에 재료/처치/수술/기타 여부 필요
  814. //model.makeValue("/root/send/reqdata/srchcond", "srchPRCD"); //공통SET내 검색
  815. model.makeValue("/root/send/reqdata/srchcond", "srchSET"); //공통SET내 검색
  816. model.makeValue("/root/send/reqdata/deptcd", model.getValue("/root/main/cond/wardcd"));
  817. /*
  818. if(prcpclscd == "ALL") {
  819. model.makeValue("/root/send/reqdata/srchcond", "ALL");
  820. }else {
  821. if(prcpclscd == "M2" || prcpclscd == "H4" || prcpclscd == "H2" || prcpclscd == "Z0"){
  822. model.makeValue("/root/send/reqdata/srchcond", "PRCD");
  823. }else{
  824. model.makeValue("/root/send/reqdata/srchcond", "SET");
  825. }
  826. }
  827. */
  828. if(submit("TRMNW11101")){
  829. //-------------경북대 (20101213)
  830. var prcplist = model.instances(0).selectNodes("/root/main/prcpsrch/prcplist");
  831. //-------------경북대 (20101213)
  832. if(prcplist.length > 0){
  833. open("SPMNW10600", 1, "", "", "SPMNW10600", "/root/main/prcpsrch", "/root/main/prcpsrch");
  834. model.removeNodeset("/root/main/prcpsrch"); //처방검색 결과 후, 조회결과 node를 삭제
  835. }else{
  836. messageBox("검색 결과가", "I004");
  837. model.setFocus("ipt_listsrchdata");
  838. return;
  839. }
  840. }
  841. model.refresh();
  842. }
  843. /**
  844. * @desc : SET처방 리스트 용법 클릭시 팝업
  845. * @
  846. * @param :
  847. * @return :
  848. * @author : 성미연
  849. * @---------------------------------------------------
  850. */
  851. function fClickSavePrcpDrugMthd(){
  852. var currow = grd_prcpposlist.mouseRow;
  853. if(currow < 1){
  854. return;
  855. }
  856. var prcpclscd = model.getValue(sPRCPLIST_PATH + "[" + currow + "]/prcpclscd");
  857. if((prcpclscd == "A2" || prcpclscd == "A4" || prcpclscd == "A6") && grd_prcpposlist.col == grd_prcpposlist.colRef("drugmthdspccdnm")){
  858. setParameter("srchRow", grd_prcpposlist.row);
  859. setParameter("GridPath", sPRCPLIST_PATH);
  860. modal("SPMNW11200");
  861. }else if (grd_prcpposlist.col < 4 ) {
  862. //수가 보험정보 조회
  863. var calcscormastspec = model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/calcscormastspec");
  864. var calcscorcd = calcscormastspec.split("|");
  865. fInsuMsgInfoRef(calcscorcd[3]);
  866. }
  867. }
  868. /**
  869. * @desc : 간호처방 SignData 조회
  870. * @
  871. * @param :
  872. * @return :
  873. * @author : 오지훈 2008. 1. 2
  874. * @---------------------------------------------------
  875. */
  876. function fReqNursPrcpSignData(){
  877. if (model.getValue("/root/main/cond/pid") == "" || model.getValue("/root/main/cond/patnm") == "") {
  878. messageBox("환자가 지정되지", "E007");
  879. return;
  880. }
  881. //20110422_KNUH_Start 잠시 주석처리.
  882. //20110420_KNUH_Start
  883. var cnt = 0;
  884. var str = "";
  885. var drprcpetc7;
  886. var drprcpetc8;
  887. var prcpclscd;
  888. var prcpcd;
  889. //20110626_KNUH_Start 보조유형이 미용성형일 경우, 처방을 보조유형으로 발행하도록 하는 로직 추가
  890. var anamneflag; //기왕력 유무(Y/N9
  891. var anamnecnt = 0;
  892. var subcretno = ""; //보조유형생성번호(subcretno)
  893. var flag;
  894. var tempcol8;
  895. var str1 = "";
  896. var str2 = "";
  897. var stoccnt = 0;
  898. var stoccnt2 = 0;
  899. var safestocqty;
  900. var idxinfo = "";
  901. var idxinfo2= "";
  902. var actregyn = "";
  903. for (var i=grd_prcpposlist.fixedRows; i < grd_prcpposlist.rows; i++) {
  904. drprcpetc7 = grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("drprcpetc7"));
  905. drprcpetc8 = grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("drprcpetc8"));
  906. prcpclscd = grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("prcpclscd"));
  907. prcpcd = grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("prcpcd"));
  908. prcpnm = grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("orgprcpnm"));
  909. flag = grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("flag"));
  910. tempcol8 = grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("tempcol8"));
  911. safestocqty = parseInt(grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("safestocqty")));
  912. qty = parseInt(grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("drprcpetc8")));
  913. actregyn = grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("actregyn"));
  914. stocyn = grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("stocyn"));
  915. if(prcpclscd == "M2") {
  916. if(tempcol8 == "Y") {
  917. } else {
  918. if(stocyn == "Y") {
  919. if(safestocqty == 0) {
  920. if(actregyn == "Y") {
  921. } else {
  922. if(stoccnt == 0) {
  923. str1 += " " + prcpnm;
  924. idxinfo += i;
  925. } else {
  926. str1 += "\n, " + prcpnm;
  927. idxinfo+= "," + i;
  928. }
  929. stoccnt++;
  930. }
  931. } else {
  932. if(qty > safestocqty) {
  933. if(stoccnt2 == 0) {
  934. str2 += " " + prcpnm;
  935. idxinfo2 += i;
  936. } else {
  937. str2 += "\n, " + prcpnm;
  938. idxinfo2 += "," + i;
  939. }
  940. stoccnt2++;
  941. }
  942. }
  943. }
  944. }
  945. }
  946. if(flag == "N" && (tempcol8 == "N" || tempcol8 == "" || tempcol8 == null)) {
  947. messageBox("[" + prcpcd + "]처방은 수가가 종료되어 반환만 가능합니다.", "E");
  948. grd_prcpposlist.row = i;
  949. return;
  950. }
  951. //영상처방인 경우 1회만 처방가능하도록 blocking
  952. if (prcpclscd == 'C2') {
  953. if (drprcpetc7 != 1 || drprcpetc8 != 1) {
  954. messageBox("영상처방은 1회만 처방 가능합니다.", "E");
  955. return;
  956. }
  957. }
  958. if (prcpcd == 'E40300003-3' || prcpcd == 'E40300003-6') {
  959. if ((drprcpetc8 % 3) != 0 ) {
  960. messageBox("Gauze Vaseline 처방은 수량을 3배수로만 처방 가능합니다.", "E");
  961. return;
  962. }
  963. }
  964. //20110626_KNUH_Start 보조유형이 미용성형일 경우, 처방을 보조유형으로 발행하도록 하는 로직 추가
  965. anamneflag = grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("anamneflag"));
  966. if(anamneflag == "Y") {
  967. if(anamnecnt == 0) {
  968. var flag = fCheckSubKindCd();
  969. if(flag == "false") {
  970. return;
  971. }
  972. subcretno = model.getValue("/root/temp/prcpinfo/subcretno");
  973. if(subcretno == "0" || subcretno == "" || subcretno == null) {
  974. messageBox ( "환자의 부유형이 없거나 또는 선택되지 않았습니다.\n\n기왕증 체크를 해제 합니다.", "I999" );
  975. subcretno = "0";
  976. }
  977. }
  978. anamnecnt++;
  979. if(subcretno != "0") {
  980. grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("subcretno")) = subcretno;
  981. } else {
  982. grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("anamneflag")) = "N";
  983. grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("subcretno")) = "0";
  984. }
  985. } else {
  986. grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("anamneflag")) = "N";
  987. grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("subcretno")) = "0";
  988. }
  989. //20110626_KNUH_End
  990. if( drprcpetc7 != drprcpetc8 || drprcpetc7 == "Y" || drprcpetc8 == "Y" || drprcpetc7 == "N" || drprcpetc8 == "N") {
  991. if(prcpclscd == "A6" || prcpclscd == "A4" || prcpclscd == "A2") {
  992. continue;
  993. } else {
  994. grd_prcpposlist.cellstyle("background-color", i, 1, i, grd_prcpposlist.cols-1) = "#FFF000";
  995. if(cnt != 0) {
  996. str += ",";
  997. }
  998. str += i;
  999. cnt++;
  1000. }
  1001. } else {
  1002. grd_prcpposlist.cellstyle("background-color", i, 1, i, grd_prcpposlist.cols-1) = "#FFFFFF";
  1003. }
  1004. }
  1005. if(cnt > 0) {
  1006. messageBox(str + "번째 처방이 잘못 발생되었습니다. 우측마우스를 눌러 삭제후 다시 입력하십시오.", "E");
  1007. return;
  1008. }
  1009. var msg = "";
  1010. //칠곡만 적용
  1011. if(getUserInfo("dutplceinstcd") == "032") {
  1012. if(stoccnt > 0 || stoccnt2 > 0) {
  1013. if(stoccnt > 0 && stoccnt2 > 0) {
  1014. msg = "* 안전재고보다 초과된 물품\n" + str2 + "\n\n" + "* 미등록된 물품\n" + str1 + "\n";
  1015. } else if(stoccnt > 0 && stoccnt2 == 0) {
  1016. msg = "* 미등록된 물품\n" + str1 + "\n";
  1017. } else if(stoccnt == 0 & stoccnt2 > 0) {
  1018. msg = "* 안전재고보다 초과된 물품\n" + str2 + "\n";
  1019. }
  1020. var rtn = messageBox(msg, "I");
  1021. }
  1022. }
  1023. //20090908 khj
  1024. if (( model.getValue(sPATINFO_PATH + "/ordtype") == "I" || model.getValue(sPATINFO_PATH + "/ordtype") == "D" )) {
  1025. model.removeNodeset("/root/send/reqdata");
  1026. model.makeNode("/root/send/reqdata");
  1027. model.makeValue("/root/send/reqdata/orddd", model.getValue("/root/main/cond/prcpdd"));
  1028. model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
  1029. model.makeValue("/root/send/reqdata/roomcd", model.getValue("/root/main/cond/roomcd"));
  1030. model.makeValue("/root/send/reqdata/refflag", "room");
  1031. model.makeValue("/root/send/reqdata/ordtype", "I");
  1032. model.makeValue("/root/send/reqdata/settingrnid", model.getValue("/root/main/cond/settingrnid"));
  1033. if(spcldept == model.getValue("/root/main/cond/wardcd")) {
  1034. model.makeValue("/root/send/reqdata/spcldeptyn", "Y");
  1035. } else {
  1036. model.makeValue("/root/send/reqdata/spcldeptyn", "");
  1037. }
  1038. submit("TRMNW10903");
  1039. var pid = model.getValue("/root/main/cond/pid");
  1040. model.copyNode("/root/main/patinfocond/patinfo", "/root/init/patinfo/patlist[pid = '" + pid + "']");
  1041. if ( model.getValue(sPATINFO_PATH + "/careinrmyn") != "Y" ){
  1042. messageBox("입실체크를 하기 전 또는 퇴원환자는 처방 저장을 하실 수 ", "I004");
  1043. return;
  1044. }
  1045. }
  1046. if (model.getValue(sPRCPLIST_PATH + "/prcpcd") == "") {
  1047. messageBox("저장할 처방내역이", "I004");
  1048. return;
  1049. }
  1050. // 간호사퇴원통보가 되어있는 경우_20080807(ByJA)
  1051. /*
  1052. if(model.getValue("/root/main/patinfocond/patinfo/dschnotiyn") == "Y"){
  1053. messageBox( "[" + model.getValue("/root/main/patinfocond/patinfo/pid")
  1054. +" " + model.getValue("/root/main/patinfocond/patinfo/patnm")
  1055. +"]\n 이미 퇴원통보가 되어 처방을 저장", "E001");
  1056. return;
  1057. }
  1058. */
  1059. var posdept = model.getValue("/root/main/prcpposinfo/cond/deptcd");
  1060. if (model.getValue("/root/main/prcpposinfo/cond/poscd") == '2' && model.getValue("/root/init/deptinfo/deptlist[deptcd = '"+ posdept + "']/deptcd") == "") {
  1061. messageBox("User위치가 지정되지", "E007");
  1062. return;
  1063. }
  1064. model.removeNodeset("/root/send/reqdata");
  1065. model.makeNode("root/err/result");
  1066. model.makeNode("/root/endinfo/result");
  1067. //상단정보가 아닌, 환자검색정보 설정인 경우
  1068. var ioflag = model.getValue("/root/main/patinfocond/patinfo/ordtype");
  1069. var orddeptcd = model.getValue("/root/main/patinfocond/patinfo/orddeptcd");
  1070. var orddeptnm = model.getValue("/root/main/patinfocond/patinfo/orddeptnm");
  1071. var orddrid = model.getValue("/root/main/patinfocond/patinfo/orddrid");
  1072. var orddrnm = model.getValue("/root/main/patinfocond/patinfo/orddrnm");
  1073. var pid = model.getValue("/root/main/patinfocond/patinfo/pid");
  1074. var hngnm = model.getValue("/root/main/patinfocond/patinfo/patnm");
  1075. var cretno = model.getValue("/root/main/patinfocond/patinfo/cretno");
  1076. var instcd = model.getValue("/root/main/patinfocond/patinfo/instcd");
  1077. var sa = model.getValue("/root/main/patinfocond/patinfo/sexage");
  1078. var userkindcd = model.getValue("/root/main/patinfocond/patinfo/userkindcd");
  1079. var aftcertdrid = "";
  1080. var orddd = "";
  1081. var pamflag = "";
  1082. var chkprcpclscd ="";
  1083. var chkaftcertyn ="";
  1084. if(ioflag == "O" || ioflag == "S"){
  1085. orddd = model.getValue("/root/main/patinfocond/patinfo/orddd");
  1086. if ( userkindcd == "97" ){
  1087. for (var i=1; i < grd_prcpposlist.rows; i++) {
  1088. chkprcpclscd = model.getValue(sPRCPLIST_PATH + "[" + i + "]/prcpclscd");
  1089. if (!isNull( model.getValue("/root/code/codeinfo/codelist[cdgrupid ='207' and cdid = '"+chkprcpclscd+"']/cdid") )) {
  1090. chkaftcertyn = "Y";
  1091. break;
  1092. }
  1093. }
  1094. if ( chkaftcertyn == "Y" ){
  1095. setParameter("SPMMB04100_orddrid", orddrid);
  1096. setParameter("SPMMB04100_defdeptcd", orddeptcd);
  1097. modal("SPMMB04100");
  1098. var useyn = getParameter("SPMMB04100_useyn");
  1099. if (useyn != "Y") {
  1100. return false;
  1101. }else if(useyn == "Y"){ //후인증 선택의사로 설정
  1102. aftcertdrid = getParameter("SPMMB04100_orddrid");
  1103. }
  1104. }
  1105. }
  1106. }else{
  1107. orddd = model.getValue("/root/main/patinfocond/patinfo/indd");
  1108. }
  1109. var bedcd = model.getValue(cmb_Zone.attribute("ref"));
  1110. var er ="";
  1111. var grupcd = "";
  1112. if(ioflag == "O"){ //외래인 경우, 원무정보 처리
  1113. pamflag = "Y";
  1114. }
  1115. var deptcd="";
  1116. var deptnm="";
  1117. if (model.getValue("/root/main/prcpposinfo/cond/poscd") == '1') { //환자위치
  1118. if ( !isNull(model.getValue("/root/code/codeinfo/codelist[cdgrupid ='002' and cdid ='"+combo1.value+"']/cdid")) ) {
  1119. deptcd = model.getValue("/root/init/patinfo/patlist[pid='" + pid + "']/grupcd");
  1120. deptnm = model.getValue("/root/init/deptinfo/deptlist[deptcd = '" + model.getValue("/root/init/patinfo/patlist[pid='" + pid + "']/grupcd") + "']/depthngnm");
  1121. } else {
  1122. deptcd = model.getValue("/root/main/cond/wardcd");
  1123. deptnm = model.getValue("/root/init/deptinfo/deptlist[deptcd = '" + model.getValue("/root/main/cond/wardcd") + "']/depthngnm");
  1124. }
  1125. } else { //User위치
  1126. deptcd = model.getValue("/root/main/prcpposinfo/cond/deptcd");
  1127. deptnm = model.getValue("/root/init/deptinfo/deptlist[deptcd = '" + model.getValue("/root/main/prcpposinfo/cond/deptcd") + "']/depthngnm");
  1128. }
  1129. model.makeValue("/root/temp/saveflaginfo/savedataflag", "2"); //저장자료구분(2:처방)
  1130. model.makeValue("/root/temp/saveflaginfo/saveflag" , ioflag); //저장구분 O:외래, I:입원, E:응급, S:건진, D:DSC
  1131. model.makeValue("/root/temp/saveflaginfo/prcpflag" , "2"); //처방구분 (M0035 처방권한에 대한 구분종류 : 간호 추가처방)
  1132. model.makeValue("/root/temp/saveflaginfo/inptflag" , "09"); //처방입력구분 (M0034 처방입력에 대한 구분종류 : 간호처방)
  1133. model.makeValue("/root/temp/saveflaginfo/pamflag" , pamflag);//원무정보 처리구분(외래만 Y)
  1134. model.makeValue("/root/temp/saveflaginfo/prcperrflag" , "Y"); //처방오류구분
  1135. model.makeValue("/root/temp/saveflaginfo/deptcd" , deptcd); //부서코드
  1136. model.makeValue("/root/temp/saveflaginfo/deptnm" , deptnm); //부서명
  1137. model.makeValue("/root/temp/saveflaginfo/userid" , getUserInfo("userid")); //사용자ID
  1138. model.makeValue("/root/temp/saveflaginfo/usernm" , getUserInfo("usernm")); //사용자명
  1139. model.makeValue("/root/temp/saveflaginfo/signyn" , "Y"); //전자서명여부
  1140. model.makeValue("/root/temp/saveflaginfo/prcpdd" , model.getValue("/root/main/cond/prcpdd")); //처방일
  1141. var saveflaginfolist = getNodeListCSV(model.instances(0).selectNodes("/root/temp/saveflaginfo"));
  1142. model.makeValue("/root/send/reqdata/saveflaginfo", saveflaginfolist);
  1143. model.makeValue("/root/temp/savergstinfo/pid" , pid); //등록번호
  1144. model.makeValue("/root/temp/savergstinfo/indd" , orddd); //진료일자
  1145. model.makeValue("/root/temp/savergstinfo/orddd" , orddd); //진료일자
  1146. model.makeValue("/root/temp/savergstinfo/cretno" , cretno); //생성번호
  1147. model.makeValue("/root/temp/savergstinfo/instcd" , instcd); //기관코드
  1148. model.makeValue("/root/temp/savergstinfo/orddeptcd" , orddeptcd); //진료과
  1149. model.makeValue("/root/temp/savergstinfo/orddeptnm" , orddeptnm); //진료과명
  1150. model.makeValue("/root/temp/savergstinfo/orddrid" , orddrid); //진료의
  1151. model.makeValue("/root/temp/savergstinfo/orddrnm" , orddrnm); //진료의명
  1152. model.makeValue("/root/temp/savergstinfo/hngnm" , hngnm); //환자명
  1153. model.makeValue("/root/temp/savergstinfo/sa" , sa); //성별나이
  1154. model.makeValue("/root/temp/savergstinfo/ordtype" , ioflag); //외래입원구분
  1155. model.makeValue("/root/temp/savergstinfo/aftcertdrid" , aftcertdrid); //외래 일반의사의 경우 후인증 대상의사는 지정한다.
  1156. var savergstinfolist = getNodeListCSV(model.instances(0).selectNodes("/root/temp/savergstinfo"));
  1157. model.makeValue("/root/send/reqdata/savergstinfo", savergstinfolist);
  1158. for(var i = 1; i < grd_prcpposlist.rows; i++){
  1159. var prcpclscd = model.getValue(sPRCPLIST_PATH + "[" + i + "]/prcpclscd");
  1160. var drugmthdspccd = model.getValue(sPRCPLIST_PATH + "[" + i + "]/drugmthdspccd");
  1161. var drugmthdspccdnm = model.getValue(sPRCPLIST_PATH + "[" + i + "]/drugmthdspccdnm");
  1162. var prcpno = model.getValue(sPRCPLIST_PATH + "[" + i + "]/prcprefseq");
  1163. var prcpcd = model.getValue(sPRCPLIST_PATH + "[" + i + "]/prcpcd");
  1164. var prcpnm = model.getValue(sPRCPLIST_PATH + "[" + i + "]/prcpnm");
  1165. var rtnflag = model.getValue(sPRCPLIST_PATH + "[" + i + "]/tempcol8"); //반환체크
  1166. var enddd = model.getValue(sPRCPLIST_PATH + "[" + i + "]/tempcol10");
  1167. var prcppkspec = (model.getValue(sPRCPLIST_PATH + "[" + i + "]/prcppkspec")).split("|");
  1168. //20091021 khj 간호처방에서 야간(18:00~익일08:00)에 발생하는 처방 중 수가에서 야간 가산을 받을 수 있는 처방의 경우 간호처방 시 가산여부 “Y”로 자동세팅
  1169. if ( ( ( model.getValue("/root/code/codeinfo/codelist[cdgrupid='002']/cdid") == model.getValue("/root/main/cond/wardcd"))
  1170. //&& model.getValue(sPRCPLIST_PATH + "[" + i + "]/nigtprcpflag") == "N"
  1171. || ( model.getValue("/root/code/codeinfo/codelist[cdgrupid='002']/cdid") != model.getValue("/root/main/cond/wardcd")
  1172. && model.getValue(sPRCPLIST_PATH + "[" + i + "]/nigtprcpflag") == "Y") )
  1173. && model.getValue("/root/main/cond/prcpdd")== getCurrentDate()
  1174. && ( getCurrentTime().substring(0,2)< "08" || getCurrentTime().substring(0,2)>= "18")
  1175. && model.getValue(sPRCPLIST_PATH + "[" + i + "]/estmcls")== "Y"
  1176. ){
  1177. model.setValue(sPRCPLIST_PATH + "[" + i + "]/nigtprcpflag" , "Y"); //야간처방구분
  1178. }else {
  1179. model.setValue(sPRCPLIST_PATH + "[" + i + "]/nigtprcpflag" , "N"); //야간처방구분
  1180. }
  1181. //약,주사 처방 중에 용법이 없을 경우 에러리스트
  1182. if("A2" == prcpclscd || "A4" == prcpclscd || "A6" == prcpclscd){
  1183. if(drugmthdspccd == "-" || drugmthdspccdnm == "-" || drugmthdspccdnm == " " || drugmthdspccdnm == "") {
  1184. model.makeValue("/root/err/errresult/prcperrlist/prcpno", prcpno);
  1185. model.makeValue("/root/err/errresult/prcperrlist/prcpcd", prcpcd);
  1186. model.makeValue("/root/err/errresult/prcperrlist/prcpnm", prcpnm);
  1187. model.makeValue("/root/err/errresult/prcperrlist/prcperr", "용법이 존재하지 않습니다.");
  1188. model.makeValue("/root/err/errresult/prcperrlist/prcplineno", i);
  1189. model.duplicate("/root/err/result","/root/err/errresult/prcperrlist");
  1190. }
  1191. }
  1192. var prcpvol = model.getValue(sPRCPLIST_PATH + "[" + i + "]/prcpvol");
  1193. var prcpqty = model.getValue(sPRCPLIST_PATH + "[" + i + "]/prcpqty");
  1194. //수량이 0보다 적을 경우 에러리스트
  1195. if(prcpvol <= 0 || prcpqty <= 0 ) {
  1196. model.makeValue("/root/err/errresult/prcperrlist/prcpno", prcpno);
  1197. model.makeValue("/root/err/errresult/prcperrlist/prcpcd", prcpcd);
  1198. model.makeValue("/root/err/errresult/prcperrlist/prcpnm", prcpnm);
  1199. model.makeValue("/root/err/errresult/prcperrlist/prcperr", "처방 수량을 확인하세요");
  1200. model.makeValue("/root/err/errresult/prcperrlist/prcplineno", i);
  1201. model.duplicate("/root/err/result","/root/err/errresult/prcperrlist");
  1202. }
  1203. //********************************************
  1204. //임상연구 환자체크
  1205. if(model.getValue("root/main/cond/clincstdyflag") == "Y"){
  1206. model.setValue(sPRCPLIST_PATH + "[" + i + "]/clincstdyflag", "Y");
  1207. model.setValue(sPRCPLIST_PATH + "[" + i + "]/clincstdycd", model.getValue(sPATINFO_PATH + "/clincstdycd"));
  1208. }
  1209. //*********************************************/
  1210. //마감 이후에 반환일 경우 반환사유 입력 팝업
  1211. //enddd default값 변경으로 수정_20080715
  1212. if(rtnflag == "Y" && enddd.substr(0,8) != '99991231' && enddd != ''){
  1213. model.makeValue("/root/endinfo/endinforesult/list/prcpdd", prcppkspec[0]);
  1214. model.makeValue("/root/endinfo/endinforesult/list/prcpno", prcppkspec[1]);
  1215. model.makeValue("/root/endinfo/endinforesult/list/prcphistno", prcppkspec[2]);
  1216. model.makeValue("/root/endinfo/endinforesult/list/execprcpno", "");
  1217. model.makeValue("/root/endinfo/endinforesult/list/instcd", prcppkspec[3]);
  1218. model.makeValue("/root/endinfo/endinforesult/list/ioflag", ioflag);
  1219. model.duplicate("/root/endinfo/result","/root/endinfo/endinforesult/list");
  1220. }
  1221. }
  1222. var saveprcplist = getNodeListCSV(model.instances(0).selectNodes("/root/main/prcp/prcplist"));
  1223. model.makeValue("/root/send/reqdata/saveprcpinfo", saveprcplist);
  1224. if (getNodesetCount ("/root/err/result/prcperrlist") > 0 ) {
  1225. var xpt = window.screenleft + 100;
  1226. var ypt = window.screenTop + 50;
  1227. var coord = getRelativeCoordinate ( xpt, ypt );
  1228. var mon = coord[0];
  1229. xpt = coord[1];
  1230. ypt = coord[2];
  1231. open( "SPMNW11000", mon, xpt, ypt, "prcpdetl", "/root/err/result", "/root/result", "", false );
  1232. //오류목록 생성후 오류난 처방을 붉은 색으로 표시
  1233. fDestDisplayErrlist("/root/err/result/prcperrlist", "grd_prcpposlist");
  1234. model.removeNodeset("/root/err");
  1235. } else {
  1236. //인증데이터 처리
  1237. if(submit("TRMNW10906")){
  1238. //** 간호사퇴원통보가 되어있는 경우 **//
  1239. var dschnotiyn = model.getValue(sSIGNDATA_PATH + "/dschnotiyn"); // 간호사퇴원확정여부_20080923(ByJA)
  1240. if(dschnotiyn == "Y"){
  1241. messageBox( "[" + model.getValue("/root/main/patinfocond/patinfo/pid")
  1242. +" " + model.getValue("/root/main/patinfocond/patinfo/patnm")
  1243. +"]\n 이미 퇴원통보가 되어 처방을 저장", "E001");
  1244. return;
  1245. }
  1246. //** 간호사퇴원통보가 되어있는 경우 **//
  1247. var signbfcnts = model.getValue(sSIGNDATA_PATH + "/signbfcnts");
  1248. var userid = getUserInfo("userid");
  1249. //운영서버는 인증모듈 타고 그외서버는 인증모듈제외
  1250. var signinfo = "";
  1251. if(vsettime == "") { //인증저장한시간.
  1252. signinfo = fMakeSignData(signbfcnts, userid, true); // 항상 인증서 비밀번호 확인 설정(true)_20080909(ByJA)
  1253. } else {
  1254. var res2 = getTimeInterval(vsettime, getCurrentTime(), 'hhmmss');
  1255. if(res2 > signtime* 60 || res2 < 0) {
  1256. signinfo = fMakeSignData(signbfcnts, userid, true); // 항상 인증서 비밀번호 확인 설정(true)_20080909(ByJA)
  1257. } else {
  1258. signinfo = fMakeSignData(signbfcnts, userid, false); // 항상 인증서 비밀번호 확인 설정안함(false)_20080909(ByJA)
  1259. }
  1260. }
  1261. // -----------------------(2010.08.18 센터)start--------------------
  1262. if(signinfo == "" || signinfo == "-"){ //인증저장 취소
  1263. return;
  1264. }else{
  1265. //처방반환사유 팝업
  1266. vsetdate = getCurrentDate();
  1267. vsettime = getCurrentTime();
  1268. if (getNodesetCount ("/root/endinfo/result/list") > 0 ) {
  1269. modal("SPPAS03000", "2", "100", "100", "SPPAS03000", "/root/endinfo/result", "root/target", "left:100; top:100; width:400; height:400; sysmenu:hidden; min:visible; max:hidden; :hidden; resize:true; caption:visible;", false);
  1270. model.removeNodeset("/root/endinfo");
  1271. }
  1272. //** 귀가유치물품 관련 데이터(여부,수량) 입력값 체크_20090206(ByJA) **//
  1273. for(var i=1;i<grd_prcpposlist.rows;i++){
  1274. fChkHomeMatr(i);
  1275. }
  1276. model.setValue(sSIGNDATA_PATH + "/signaftcnts", signinfo); //true : 처방저장할 때마다 인증저장 태움
  1277. var savesignlist = getNodeListCSV(model.instances(0).selectNodes(sSIGNDATA_PATH));
  1278. model.makeValue("/root/send/savedata/saveflaginfo", saveflaginfolist);
  1279. model.makeValue("/root/send/savedata/savergstinfo", savergstinfolist);
  1280. model.makeValue("/root/send/savedata/saveprcpinfo", saveprcplist);
  1281. model.makeValue("/root/send/savedata/savesigninfo", savesignlist);
  1282. fSavePrcp(); //처방저장
  1283. }
  1284. }
  1285. }
  1286. }
  1287. /**
  1288. * @desc : 간호처방 SignData 생성
  1289. * @
  1290. * @param : signbfcnts - 인증 전 데이터
  1291. * : signuserid - 인증자ID
  1292. * : signcnfmflag - 인증확인여부
  1293. * @return :
  1294. * @author : 오지훈 2008. 1. 3
  1295. * @---------------------------------------------------
  1296. */
  1297. function fMakeSignData(signbfcnts, userid, signcnfmflag){
  1298. return zesfSignData(signbfcnts, userid, signcnfmflag);
  1299. }
  1300. /**
  1301. * @desc : 간호 전처방 조회
  1302. * @
  1303. * @param :
  1304. * @return :
  1305. * @author : 오지훈 2008. 1. 3
  1306. * @---------------------------------------------------
  1307. */
  1308. function fReqBfNursPrcpInfo(){
  1309. if (model.getValue("/root/main/cond/patnm") == "" && model.getValue("/root/main/paminfo/list/pid") != "") {
  1310. model.resetInstanceNode("/root/main/cond/pid");
  1311. ipt_pid.refresh();
  1312. messageBox("환자를 먼저 지정하십시오!", "C");
  1313. return;
  1314. }
  1315. var ordtype = model.getValue("/root/main/patinfocond/patinfo/ordtype");
  1316. var pid = model.getValue("/root/main/patinfocond/patinfo/pid");
  1317. var cretno = model.getValue("/root/main/patinfocond/patinfo/cretno");
  1318. var insukind = model.getValue("/root/main/patinfocond/patinfo/insukind");
  1319. var prcpfromdd = model.getValue("/root/main/bfprcpinfo/bfcond/prcpfromdd");
  1320. var prcptodd = model.getValue("/root/main/bfprcpinfo/bfcond/prcptodd");
  1321. var srchflag = model.getValue("/root/main/bfprcpinfo/bfcond/srchflag");
  1322. var srchclscd = model.getValue("/root/main/bfprcpinfo/bfcond/srchclscd");
  1323. var srchdata = model.getValue("/root/main/bfprcpinfo/bfcond/srchdata");
  1324. var srchdayflag = model.getValue("/root/main/bfprcpinfo/bfcond/srchdayflag");
  1325. var ordercond = model.getValue("/root/main/bfprcpinfo/bfcond/ordercond");
  1326. var ordercond2 = model.getValue("/root/main/bfprcpinfo/bfcond/ordercond2");
  1327. //가정간호 여부(가정간호 환자인 경우는 전처방 조회시 원무정보 조건을 걸지 않음)
  1328. var homecareyn = model.getValue("/root/main/cond/homecareyn");
  1329. var deptcd = model.getValue("/root/main/cond/wardcd");
  1330. if(ordtype == "O" || ordtype == "S"){
  1331. var orddd = model.getValue("/root/main/patinfocond/patinfo/orddd");
  1332. }else{
  1333. var orddd = model.getValue("/root/main/patinfocond/patinfo/indd");
  1334. }
  1335. model.removeNodeset("/root/send/reqdata");
  1336. model.makeValue("/root/send/reqdata/pid" , pid);
  1337. model.makeValue("/root/send/reqdata/orddd" , orddd);
  1338. model.makeValue("/root/send/reqdata/cretno" , cretno);
  1339. model.makeValue("/root/send/reqdata/insukind" , insukind);
  1340. model.makeValue("/root/send/reqdata/prcpfromdd" , prcpfromdd);
  1341. model.makeValue("/root/send/reqdata/prcptodd" , prcptodd);
  1342. model.makeValue("/root/send/reqdata/ordtype" , ordtype);
  1343. model.makeValue("/root/send/reqdata/srchflag" , srchflag);
  1344. model.makeValue("/root/send/reqdata/srchclscd" , srchclscd);
  1345. model.makeValue("/root/send/reqdata/srchdata" , srchdata);
  1346. model.makeValue("/root/send/reqdata/srchdayflag", srchdayflag);
  1347. model.makeValue("/root/send/reqdata/homecareyn" , homecareyn);
  1348. model.makeValue("/root/send/reqdata/ordercond" , ordercond);
  1349. model.makeValue("/root/send/reqdata/ordercond2" , ordercond2);
  1350. model.makeValue("/root/send/reqdata/deptcd" , model.getValue("/root/main/cond/wardcd"));
  1351. model.makeValue("/root/send/reqdata/prcpinptflag" , "09"); // 처방입력에 대한 구분종류 ('09':간호처방, '38':간호 미확인 구두처방, , '39':간호 확인 구두처방)
  1352. grd_bfprcplist.rebuildStyle();
  1353. if(submit("TRMNW10905")){
  1354. // 처방일자로 구분선 표시(기준자료에 등록된 부서만)
  1355. if( deptcd == model.getValue("/root/code/codeinfo/codelist[cdgrupid='I09' and cdid ='"+deptcd+"']/cdid")){
  1356. var pGrdCnt = getNodesetCount(sBFPRCPLIST_PATH);
  1357. if (pGrdCnt != 0 ) {
  1358. var rgstdt1 = "";
  1359. var rgstdt2 = "";
  1360. for (var i = grd_bfprcplist.fixedRows; i <= grd_bfprcplist.rows; i++) {
  1361. rgstdt1 = model.getValue(sBFPRCPLIST_PATH + "[" + i + "]/rgstdt");
  1362. rgstdt2 = model.getValue(sBFPRCPLIST_PATH + "[" + (i+1) + "]/rgstdt");
  1363. if (rgstdt1.substring(0,8) == rgstdt2.substring(0,8)){
  1364. }else{
  1365. if(i != 0){
  1366. grd_bfprcplist.rowStyle(i, "all", "border-bottom-color") = "#ff0000";
  1367. grd_bfprcplist.rowStyle(i, "all", "border-top-width") = "1";
  1368. }
  1369. }
  1370. }
  1371. grd_bfprcplist.refresh();
  1372. }
  1373. }
  1374. }
  1375. //전처방 검색 후 검색창 초기화
  1376. model.resetInstanceNode("/root/main/bfprcpinfo/bfcond/srchdata");
  1377. model.setFocus("ipt_bfsrchdata");
  1378. ipt_bfsrchdata.refresh();
  1379. //전처방 리스트에서 반납일 경우 텍스트 빨간색
  1380. for ( i = 1; i<= getNodesetCount(sBFPRCPLIST_PATH); i++) {
  1381. var prcphistcd = model.getValue(sBFPRCPLIST_PATH + "[" + i + "]/prcphistcd");
  1382. if (prcphistcd == "L" || prcphistcd == "D" ) {
  1383. grd_bfprcplist.rowStyle(i, "data", "color") = "#FF0000";
  1384. }
  1385. }
  1386. model.refresh();
  1387. }
  1388. /**
  1389. * @desc : 간호 임시처방 조회
  1390. * @
  1391. * @param :
  1392. * @return :
  1393. * @author : 성미연 2008. 5. 15
  1394. * @---------------------------------------------------
  1395. */
  1396. function fReqTempNursPrcpInfo(){
  1397. if (model.getValue("/root/main/cond/patnm") == "" && model.getValue("/root/main/paminfo/list/pid") != "") {
  1398. model.resetInstanceNode("/root/main/cond/pid");
  1399. ipt_pid.refresh();
  1400. messageBox("환자를 먼저 지정하십시오!", "C");
  1401. return;
  1402. }
  1403. if (model.getValue("/root/main/tempprcpinfo/tempcond/srchdata").length == 1 ){
  1404. messageBox("검색어는 2자 이상","C001");
  1405. model.setFocus("ipt_tempsrchdata");
  1406. return;
  1407. }
  1408. var ordtype = model.getValue("/root/main/patinfocond/patinfo/ordtype");
  1409. var pid = model.getValue("/root/main/patinfocond/patinfo/pid");
  1410. var cretno = model.getValue("/root/main/patinfocond/patinfo/cretno");
  1411. var insukind = model.getValue("/root/main/patinfocond/patinfo/insukind");
  1412. var srchflag = model.getValue("/root/main/tempprcpinfo/tempcond/srchflag");
  1413. var srchclscd = model.getValue("/root/main/tempprcpinfo/tempcond/srchclscd");
  1414. var srchdata = model.getValue("/root/main/tempprcpinfo/tempcond/srchdata");
  1415. if(ordtype == "O" || ordtype == "S"){ //외래환자는 임시처방 발생하지 않음
  1416. return;
  1417. }else{
  1418. var orddd = model.getValue("/root/main/patinfocond/patinfo/indd");
  1419. }
  1420. model.removeNodeset("/root/send/reqdata");
  1421. model.makeValue("/root/send/reqdata/pid" , pid);
  1422. model.makeValue("/root/send/reqdata/orddd" , orddd);
  1423. model.makeValue("/root/send/reqdata/cretno" , cretno);
  1424. model.makeValue("/root/send/reqdata/insukind" , insukind);
  1425. model.makeValue("/root/send/reqdata/ordtype" , ordtype);
  1426. model.makeValue("/root/send/reqdata/srchflag" , srchflag);
  1427. model.makeValue("/root/send/reqdata/srchclscd" , srchclscd);
  1428. model.makeValue("/root/send/reqdata/srchdata" , srchdata);
  1429. grd_tempprcplist.rebuildStyle();
  1430. if(submit("TRMNW10908")){
  1431. //임시처방리스트에서 청구주기가 월일 경우 파란색
  1432. for ( i = 1; i<= getNodesetCount(sTEMPPRCPLIST_PATH); i++) {
  1433. var tempcol10 = model.getValue(sTEMPPRCPLIST_PATH + "[" + i + "]/tempcol10");
  1434. if (tempcol10 == "4")
  1435. grd_tempprcplist.rowStyle(i, "data", "color") = "#0000ff";
  1436. }
  1437. grd_tempprcplist.refresh();
  1438. }
  1439. //임시처방 검색 후 검색창 초기화
  1440. model.resetInstanceNode("/root/main/tempprcpinfo/tempcond/srchdata");
  1441. model.setFocus("ipt_tempsrchdata");
  1442. ipt_tempsrchdata.refresh();
  1443. model.refresh();
  1444. }
  1445. /**
  1446. * @desc : 간호처방 기본값 설정
  1447. * @
  1448. * @param : desrow 목적지 노드의 row위치
  1449. * @return :
  1450. * @author : 오지훈 2008. 1. 4
  1451. * @---------------------------------------------------
  1452. */
  1453. function fSetNursPrcpDefault(desrow){
  1454. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/status" , "I"); //처방상태(신규)
  1455. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpkindcd" , "20"); //처방분류코드(간호처방은 모두 추가)
  1456. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpstatcd" , "000"); //처방상태코드
  1457. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpauthflag" , 2); //처방권한구분, 의사와 공유하지 않음
  1458. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpinptflag" , "09"); //처방입력구분, 간호:09
  1459. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcphopedd" , model.getValue("/root/main/cond/prcpdd")); //처방희망일
  1460. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpmixno" , 0); //Mix번호
  1461. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prnprcpflag" , "N"); //PRN처방구분
  1462. // model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/precureprcpflag" , "N"); //선처치처방구분_기준자료에서 설정한 값으로 설정_임미정ITC요청_20081208(ByJA)
  1463. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/drprcpetc10" , "N"); //대차구분
  1464. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/drgacptflag" , "-"); //DRG인정
  1465. if ( model.getValue(sPRCPLIST_PATH + "[" + desrow + "]/able_erprcpflag") == "Y" // 응급가산 가능 처방
  1466. && model.getValue("/root/main/paminfo/list/orgordtype") == "E" // 응급실 경유 환자
  1467. && model.getValue("/root/main/paminfo/list/indd")+model.getValue("/root/main/paminfo/list/intm") >= getNewDate().getAddDate(-1,"D").getDateFormat("YYYYMMDDhhmm") // 내원 24시간 이내 환자 이면
  1468. ) {
  1469. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/erprcpflag" , "Y"); //응급처방구분
  1470. } else {
  1471. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/erprcpflag" , "N"); //응급처방구분
  1472. }
  1473. //20091021 khj 간호처방에서 야간(18:00~익일08:00)에 발생하는 처방 중 수가에서 야간 가산을 받을 수 있는 처방의 경우 간호처방 시 가산여부 “Y”로 자동세팅
  1474. if (model.getValue("/root/code/codeinfo/codelist[cdgrupid='002']/cdid") == model.getValue("/root/main/cond/wardcd")
  1475. && model.getValue("/root/main/cond/prcpdd")== getCurrentDate()
  1476. && ( getCurrentTime().substring(0,2)< "08" || getCurrentTime().substring(0,2)>= "18")
  1477. && model.getValue(sPRCPLIST_PATH + "[" + desrow + "]/estmcls")== "Y"
  1478. ){
  1479. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/nigtprcpflag" , "Y"); //야간처방구분
  1480. }else {
  1481. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/nigtprcpflag" , "N"); //야간처방구분
  1482. }
  1483. if ( model.getValue(sPRCPLIST_PATH + "[" + desrow + "]/estmcls")!= "Y" ){
  1484. grd_prcpposlist.isReadOnly(desrow, grd_prcpposlist.colRef("nigtprcpflag") ) = true;
  1485. }
  1486. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/portprcpflag" , "N"); //포터블처방구분
  1487. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/fixprcpflag" , "N"); //정액처방구분
  1488. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/choiordflag" , "-"); //원무기준으로 처리하기 위해, '-' 설정
  1489. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/anamneflag" , "N"); //기왕증구분
  1490. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/angioflagcd" , "-"); //Angio구분
  1491. model.makeValue(sPRCPLIST_PATH + "[" + desrow + "]/homematrflag" , "N"); //귀가유치를 위한 물품여부
  1492. model.makeValue(sPRCPLIST_PATH + "[" + desrow + "]/homematrqty" , "0"); //귀가유치를 위한 물품수량
  1493. if( model.getValue(sPRCPLIST_PATH + "[" + desrow + "]/opansflagcd") == "") {
  1494. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/opansflagcd" , "-"); //수술마취구분
  1495. }
  1496. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/offictourhealexamflag", "N"); //출장검진구분
  1497. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpdayno" , 1); //처방횟수(일자)
  1498. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpgenrflag" , model.getValue("/root/main/patinfocond/patinfo/ordtype"));
  1499. model.setvalue(sPRCPLIST_PATH + "[" + desrow + "]/prcpsignflag" , ""); //전처방에서 2로 copy되어 ""로 초기화
  1500. //환자 급비유형(수정이전 정보 : insukind, 수정이후 정보 : payflagcd)에 들어감)
  1501. //model.setvalue(sPRCPLIST_PATH + "[" + desrow + "]/spynpy1" , model.getValue("/root/main/patinfocond/patinfo/insukind"));
  1502. //처방수량단위 설정, 약품일 경우 '3', 그 이외는 '-'로 설정
  1503. var prcpclscd = model.getValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpclscd");
  1504. if(prcpclscd == "A2" || prcpclscd == "A4" || prcpclscd == "A6"){
  1505. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpqtyunitflag", "3");
  1506. }else{
  1507. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpqtyunitflag", "-");
  1508. }
  1509. //가정간호 환자인 경우 처방적용일에 방문일자 셋팅
  1510. if(model.getValue("/root/main/cond/homecareyn") == "Y") {
  1511. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpdelivefact", model.getValue("/root/main/cond/visitdd")); //방문일자
  1512. }else{
  1513. model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpdelivefact", model.getValue("/root/main/cond/prcpdd")); //적용일자
  1514. }
  1515. model.makeValue(sPRCPLIST_PATH + "[" + desrow + "]/fstrgstrnm", "");
  1516. model.makeValue(sPRCPLIST_PATH + "[" + desrow + "]/resncnts", "");
  1517. model.makeValue(sPRCPLIST_PATH + "[" + desrow + "]/confirmdrnm", "");
  1518. model.makeValue(sPRCPLIST_PATH + "[" + desrow + "]/confirmdt", "");
  1519. }
  1520. /**
  1521. * @desc : 간호처방 저장
  1522. * @
  1523. * @param :
  1524. * @return :
  1525. * @author : 오지훈 2008. 1. 4
  1526. * @---------------------------------------------------
  1527. */
  1528. function fSavePrcp(){
  1529. if(submit("TXMNW10901")){
  1530. //오류팝업
  1531. var prcpErrList = model.instances(0).selectNodes( "/root/temp/result/prcperrlist" );
  1532. if ( prcpErrList.length > 0 ) {
  1533. if ( !isNull(model.getValue ("/root/temp/result/prcperrlist/prcpcd"))){
  1534. var xpt = window.screenleft + 100;
  1535. var ypt = window.screenTop + 50;
  1536. var coord = getRelativeCoordinate ( xpt, ypt );
  1537. var mon = coord[0];
  1538. xpt = coord[1];
  1539. ypt = coord[2];
  1540. open ( "SPMMO00600", mon, xpt, ypt, "prcpdetl", "/root/temp/result", "/root/result", "", false );
  1541. model.removeNodeset("/root/temp/result/prcperrlist");
  1542. model.refresh();
  1543. }
  1544. } else {
  1545. model.toggle("case_bf"); //전처방 화면으로 변경
  1546. btn_bf.dispatch("onclick");
  1547. //처방 저장 후 전처방 조회시 저장된 처방이 보이도록 스크롤을 가장 위로 함
  1548. grd_bfprcplist.topRow = 1;
  1549. model.removeNodeset(sPRCPLIST_PATH);
  1550. model.resetInstanceNode("/root/main/insumsginfo/insuinfo/limmsg");
  1551. fReqBfNursPrcpInfo(); // 전처방 조회
  1552. fReqTempNursPrcpInfo(); // 임시처방 조회
  1553. if(getScreenMenuParameter() == "SMMNH" || opener.javascript.getParameter("screenParam") == "SMMNH"){
  1554. fSearchHomePatInfo(); // 방문일자 조회_20090330(ByJA)
  1555. }
  1556. }
  1557. }
  1558. }
  1559. /**
  1560. * @desc : 처방저장 오류내역표시
  1561. * @
  1562. * @param :
  1563. * @return :
  1564. * @author : 성미연 2008. 2. 23
  1565. * @---------------------------------------------------
  1566. */
  1567. function fDestDisplayErrlist(errListPath, gridID ){
  1568. var gridObj = document.controls.item(gridID);
  1569. gridObj.rebuildStyle();
  1570. //전처방 리스트에서 반납일 경우 텍스트 빨간색
  1571. for (var i = 1; i<= getNodesetCount(errListPath); i++) {
  1572. var prcplineno = model.getValue(errListPath + "[" + i + "]/prcplineno");
  1573. for (var j = 1; j< gridObj.rows; j++) {
  1574. if (prcplineno == j ) {
  1575. gridObj.rowStyle(j, "data", "color") = "#FF0000";
  1576. }
  1577. }
  1578. }
  1579. }
  1580. /**
  1581. * @desc : 처방 SET 그리드 클릭시
  1582. * @
  1583. * @param :
  1584. * @return :
  1585. * @author : 성미연 2008. 1. 9
  1586. * @---------------------------------------------------
  1587. */
  1588. function fClickSetPrcp(mthdflag){
  1589. if(isNull(mthdflag)) mthdflag = "dblclick"; //복사 버튼은 btnclick
  1590. if ( !isDataCell() && mthdflag != "btnclick" ) {
  1591. return;
  1592. }
  1593. if (grd_prcplist.row > 0 ){
  1594. if (model.getValue("/root/main/cond/patnm") == "") {
  1595. messageBox("해당 환자를", "C002");
  1596. return;
  1597. }
  1598. if (grp_prcpapp.visible == true){
  1599. messageBox("처방적용일을 확인 후 진행하세요.", "C");
  1600. return;
  1601. }
  1602. if (model.getValue("/root/main/cond/homecareyn") == "Y" && model.getValue("/root/main/cond/visitdd") == "") {
  1603. // 방문일자를 선택하지 않은 경우 안내 메시지와 함께 방문일자가 처방당일로 자동 설정 되도록 요청에 의해 수정_김숙인ITC요청_20081215수정(ByJA)
  1604. var rtnval = messageBox("방문일을 선택하지 않으셨습니다. 방문일을 처방일과 동일하게 계속 진행하시겠습니까?", "S"); // return : yes=6, no=7
  1605. if(rtnval == "6"){ // yes
  1606. model.makeValue("/root/main/cond/visitdd", model.getValue("/root/main/cond/prcpdd"));
  1607. cmb_visitdd.refresh();
  1608. }else{
  1609. return;
  1610. }
  1611. /* 원본_20081215
  1612. // messageBox("방문일자를", "C002");
  1613. // return;
  1614. */
  1615. }
  1616. //ALL SIZE 처방 처리
  1617. if(model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/prcpclscd") == "M2"
  1618. && model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/matrallsizespecid") == "ALL") {
  1619. var grupsnglflag = model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/grupsnglflag");
  1620. //** prcpinptflag || '|' ||matrsetflag || '|' ||matrsizeflag || '|' ||calcscorcd AS calcscormastspec
  1621. var calcscormastspec = (model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/calcscormastspec")).split("|");
  1622. var matrsizeflag = calcscormastspec[2];
  1623. var matrallsizespecid = model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/matrallsizespecid");
  1624. var xpt = window.screenleft + 100;
  1625. var ypt = window.screenTop + 50;
  1626. var coord = getRelativeCoordinate ( xpt, ypt );
  1627. var mon = coord[0];
  1628. xpt = coord[1];
  1629. ypt = coord[2];
  1630. setParameter("scrnflag", "nursprcp");
  1631. setParameter("grupsnglflag", 'S');
  1632. setParameter("calcscorcd", calcscormastspec[3]);
  1633. setParameter("matrallsizespecid", matrallsizespecid);
  1634. setParameter("currow", grd_prcplist.row);
  1635. setParameter("targetpath", "/root/main/prcp/prcplist");
  1636. //setParameter("targetgridid", "grd_prcpposlist");
  1637. modal("SPMNW11500", mon, xpt, ypt);
  1638. }else{
  1639. //처방 main grid로 약속처방 copy
  1640. mnwAddNursPrcp(sPRCPSETLIST_PATH, "/root/main/prcp", grd_prcplist.row, "");
  1641. fSetNursPrcpDefault(model.instances(0).selectNodes("/root/main/prcp/prcplist").length);
  1642. model.setValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.rows + "]/status", "I"); //처방상태 : 신규
  1643. }
  1644. // 16.10.10_심사팀 요청에 의한 추가
  1645. var sprcpcd = model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/prcpcd");
  1646. model.makeValue("/root/send/reqdata/prcpcd", sprcpcd);
  1647. //alert("시작 : " + sprcpcd );
  1648. //alert(instance1.selectNodesXml("/root/send/reqdata"));
  1649. submit("TRMNW10923", false); //부서콤보 조회
  1650. if (model.getValue("/root/temp/insulinfo/insulinfo/insulinfo") == "Y") {
  1651. messageBox("선별급여 품목이오니 보험기준 확인 후 저장바랍니다.", "E999");
  1652. }
  1653. /*
  1654. // 16.09.27_심사팀 요청에 의한 추가_AYS
  1655. if(model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/insulinfoyn") == "Y") {
  1656. messageBox("선별급여 품목이오니 보험기준 확인 후 저장바랍니다.", "E999");
  1657. }
  1658. */
  1659. fSetPrcpInfo();
  1660. //신규처방은 반환컬럼 disable
  1661. grd_prcpposlist.isReadOnly(model.instances(0).selectNodes("/root/main/prcp/prcplist").length, grd_prcpposlist.colRef("tempcol8")) = true;
  1662. if ( model.getValue(sPRCPLIST_PATH + "[" + model.instances(0).selectNodes("/root/main/prcp/prcplist").length + "]/estmcls")!= "Y" ){
  1663. grd_prcpposlist.isReadOnly(model.instances(0).selectNodes("/root/main/prcp/prcplist").length, grd_prcpposlist.colRef("nigtprcpflag") ) = true;
  1664. }
  1665. //수가 보험정보 조회
  1666. var calcscormastspec = model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/calcscormastspec");
  1667. var calcscorcd = calcscormastspec.split("|");
  1668. fInsuMsgInfoRef(calcscorcd[3]);
  1669. //20110328 이선경(경북대) : 물품코드일 경우 응급처방여부 체크 가능하고 물품이 아니면 체크불가
  1670. /*
  1671. var prcpclscd = model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/prcpclscd");
  1672. var idx = model.instances(0).selectNodes("/root/main/prcp/prcplist").length;
  1673. if(prcpclscd == "M2" || prcpclscd == "H4") {
  1674. model.setvalue(sPRCPLIST_PATH + "[" + idx + "]/erprcpflag" , "N");
  1675. } else {
  1676. grd_prcpposlist.isReadOnly(idx, grd_prcpposlist.colRef("erprcpflag")) = true;
  1677. }
  1678. */
  1679. }
  1680. }
  1681. /**
  1682. * @desc : 전처방 그리드 클릭시
  1683. * @
  1684. * @param :
  1685. * @return :
  1686. * @author : 성미연 2008. 1. 9
  1687. * @---------------------------------------------------
  1688. */
  1689. function fClickBfPrcp(mthdflag){
  1690. if(isNull(mthdflag)) mthdflag = "dblclick"; //복사 버튼은 btnclick
  1691. if ( !isDataCell() && mthdflag != "btnclick" ) {
  1692. return;
  1693. }
  1694. if (grd_bfprcplist.row > 0 ){
  1695. if (model.getValue("/root/main/cond/patnm") == "") {
  1696. messageBox("해당 환자를", "C002");
  1697. return;
  1698. }
  1699. if (grp_prcpapp.visible == true){
  1700. messageBox("처방적용일을 확인 후 진행하세요.", "C");
  1701. return;
  1702. }
  1703. var prcphistcd = model.getValue(sBFPRCPLIST_PATH + "[" + grd_bfprcplist.row + "]/prcphistcd");
  1704. var flag = model.getValue(sBFPRCPLIST_PATH + "[" + grd_bfprcplist.row + "]/flag");
  1705. var prcpcd = model.getValue(sBFPRCPLIST_PATH + "[" + grd_bfprcplist.row + "]/prcpcd");
  1706. if(flag == "N") {
  1707. messageBox("[" + prcpcd + "]처방은 수가가 종료되어 반환만 가능합니다.", "E");
  1708. }
  1709. if (prcphistcd == "L" || prcphistcd == "D" ) {
  1710. return;
  1711. }else{
  1712. //가정간호
  1713. if (model.getValue("/root/main/cond/homecareyn") == "Y"){
  1714. if (model.getValue("/root/main/cond/visitdd") == ""){
  1715. var rtnval = messageBox("방문일을 선택하지 않으셨습니다. 방문일을 처방일과 동일하게 계속 진행하시겠습니까?", "S"); // return : yes=6, no=7
  1716. if(rtnval == "6"){ // yes
  1717. model.makeValue("/root/main/cond/visitdd", model.getValue("/root/main/cond/prcpdd"));
  1718. cmb_visitdd.refresh();
  1719. }else{
  1720. return;
  1721. }
  1722. /* 원본_20090122
  1723. messageBox("방문일자를", "C002");
  1724. return;
  1725. */
  1726. }
  1727. //방문일자와 다른 방문일의 처방 클릭시 blocking
  1728. if (model.getValue("/root/main/cond/visitdd") != model.getValue(sBFPRCPLIST_PATH + "[" + grd_bfprcplist.row + "]/prcpdelivefact")){
  1729. messageBox("방문일이 동일한 처방에 대해서만 일괄 저장이 가능합니다.", "C");
  1730. return;
  1731. }
  1732. }
  1733. mnwAddNursPrcp(sBFPRCPLIST_PATH, "/root/main/prcp", grd_bfprcplist.row, "");
  1734. fSetNursPrcpDefault(model.instances(0).selectNodes("/root/main/prcp/prcplist").length);
  1735. model.setValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.rows + "]/status", "B"); //처방상태[전]
  1736. }
  1737. fSetPrcpInfo();
  1738. if ( model.getValue(sPRCPLIST_PATH + "[" + model.instances(0).selectNodes("/root/main/prcp/prcplist").length + "]/estmcls")!= "Y" ){
  1739. grd_prcpposlist.isReadOnly(model.instances(0).selectNodes("/root/main/prcp/prcplist").length, grd_prcpposlist.colRef("nigtprcpflag") ) = true;
  1740. }
  1741. //수가 보험정보 조회
  1742. var calcscormastspec = model.getValue(sBFPRCPLIST_PATH + "[" + grd_bfprcplist.row + "]/calcscormastspec");
  1743. var calcscorcd = calcscormastspec.split("|");
  1744. fInsuMsgInfoRef(calcscorcd[3]);
  1745. //20110328 이선경(경북대) : 물품코드일 경우 응급처방여부 체크 가능하고 물품이 아니면 체크불가
  1746. /*
  1747. var prcpclscd = model.getValue(sBFPRCPLIST_PATH + "[" + grd_bfprcplist.row + "]/prcpclscd");
  1748. var idx = model.instances(0).selectNodes("/root/main/prcp/prcplist").length;
  1749. if(prcpclscd == "M2") {
  1750. model.setvalue(sPRCPLIST_PATH + "[" + idx + "]/erprcpflag" , "N");
  1751. } else {
  1752. grd_prcpposlist.isReadOnly(idx, grd_prcpposlist.colRef("erprcpflag")) = true;
  1753. }
  1754. */
  1755. }
  1756. }
  1757. /**
  1758. * @desc : 임시처방 그리드 클릭시
  1759. * @
  1760. * @param :
  1761. * @return :
  1762. * @author : 성미연 2008. 1. 9
  1763. * @---------------------------------------------------
  1764. */
  1765. function fClickTempPrcp(){
  1766. if (isDataCell()) {
  1767. if (grd_tempprcplist.row > 0 ){
  1768. if (model.getValue("/root/main/cond/patnm") == "") {
  1769. messageBox("해당 환자를", "C002");
  1770. return;
  1771. }
  1772. if (grp_prcpapp.visible == true){
  1773. messageBox("처방적용일을 확인 후 진행하세요.", "C");
  1774. return;
  1775. }
  1776. if (model.getValue("/root/main/cond/homecareyn") == "Y" && model.getValue("/root/main/cond/visitdd") == "") {
  1777. messageBox("방문일자를", "C002");
  1778. return;
  1779. }
  1780. if (grd_prcpposlist.findRow(model.getValue(sTEMPPRCPLIST_PATH + "[" + grd_tempprcplist.row + "]/tempcol21"), 1, grd_prcpposlist.colRef("tempcol21")) != -1) { //없으면 -1, 있으면 해당 row 리턴
  1781. messageBox("처방이", "E006");
  1782. return;
  1783. }
  1784. var prcpclscd = model.getValue(sTEMPPRCPLIST_PATH + "[" + grd_tempprcplist.row + "]/prcpclscd");
  1785. var grupsnglflag = model.getValue(sTEMPPRCPLIST_PATH + "[" + grd_tempprcplist.row + "]/grupsnglflag");
  1786. //** prcpinptflag || '|' ||matrsetflag || '|' ||matrsizeflag || '|' ||calcscorcd AS calcscormastspec
  1787. var calcscormastspec = (model.getValue(sTEMPPRCPLIST_PATH + "[" + grd_tempprcplist.row + "]/calcscormastspec")).split("|");
  1788. var matrsizeflag = calcscormastspec[2];
  1789. var matrallsizespecid = model.getValue(sTEMPPRCPLIST_PATH + "[" + grd_tempprcplist.row + "]/matrallsizespecid"); //""
  1790. //ALL SIZE 처방 처리(임시처방에서 처방발행시 활동진술문 중 규격이 매핑되어 있지 않은 경우)
  1791. if(prcpclscd == "M2" && grupsnglflag == "S" && matrsizeflag == "Y" && (matrallsizespecid == "" || matrallsizespecid == "-")){
  1792. var xpt = window.screenleft + 100;
  1793. var ypt = window.screenTop + 50;
  1794. var coord = getRelativeCoordinate ( xpt, ypt );
  1795. var mon = coord[0];
  1796. xpt = coord[1];
  1797. ypt = coord[2];
  1798. setParameter("scrnflag", "tempprcp");
  1799. setParameter("grupsnglflag", 'S');
  1800. setParameter("calcscorcd", calcscormastspec[3]);
  1801. setParameter("matrallsizespecid", matrallsizespecid);
  1802. setParameter("currow", grd_tempprcplist.row);
  1803. setParameter("targetpath", "/root/main/prcp/prcplist");
  1804. //setParameter("targetgridid", "grd_prcpposlist");
  1805. modal("SPMNW11500", mon, xpt, ypt);
  1806. }else{
  1807. //처방 main grid로 임시처방 copy
  1808. mnwAddNursPrcp(sTEMPPRCPLIST_PATH, "/root/main/prcp", grd_tempprcplist.row, "");
  1809. fSetNursPrcpDefault(model.instances(0).selectNodes("/root/main/prcp/prcplist").length);
  1810. model.setValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.rows + "]/status", "T"); //처방상태[임]
  1811. }
  1812. fSetPrcpInfo();
  1813. //임시처방은 반환컬럼 disable
  1814. grd_prcpposlist.isReadOnly(model.instances(0).selectNodes("/root/main/prcp/prcplist").length, grd_prcpposlist.colRef("tempcol8")) = true;
  1815. if ( model.getValue(sPRCPLIST_PATH + "[" + model.instances(0).selectNodes("/root/main/prcp/prcplist").length + "]/estmcls")!= "Y" ){
  1816. grd_prcpposlist.isReadOnly(model.instances(0).selectNodes("/root/main/prcp/prcplist").length, grd_prcpposlist.colRef("nigtprcpflag") ) = true;
  1817. }
  1818. //수가 보험정보 조회
  1819. var calcscormastspec = model.getValue(sTEMPPRCPLIST_PATH + "[" + grd_tempprcplist.row + "]/calcscormastspec");
  1820. var calcscorcd = calcscormastspec.split("|");
  1821. fInsuMsgInfoRef(calcscorcd[3]);
  1822. //20110328 이선경(경북대) : 물품코드일 경우 응급처방여부 체크 가능하고 물품이 아니면 체크불가
  1823. /*
  1824. var idx = model.instances(0).selectNodes("/root/main/prcp/prcplist").length;
  1825. if(prcpclscd == "M2") {
  1826. model.setvalue(sPRCPLIST_PATH + "[" + idx + "]/erprcpflag" , "N");
  1827. } else {
  1828. grd_prcpposlist.isReadOnly(idx, grd_prcpposlist.colRef("erprcpflag")) = true;
  1829. }
  1830. */
  1831. }
  1832. }
  1833. }
  1834. /**
  1835. * @desc : 처방저장 그리드 저장 이전 셋팅
  1836. * @
  1837. * @param :
  1838. * @return :
  1839. * @author : 성미연 2008. 1. 9
  1840. * @---------------------------------------------------
  1841. */
  1842. function fSetPrcpInfo(refYN){
  1843. //KNUH, 처방복사 버튼 클릭하여 선택된 처방 리스트를 복사하는 기능을 위해 refYN 인자 추가 (2011.02.16 JJE)
  1844. if( isNull(refYN) ) refYN = "Y";
  1845. //환자상태가 병동, 응급의료센터일 경우 선처치 비활성화
  1846. var ordtype = model.getValue("/root/main/patinfocond/patinfo/ordtype");
  1847. if (ordtype == 'I' || ordtype == 'E') {
  1848. grd_prcpposlist.colDisabled(grd_prcpposlist.colRef("precureprcpflag")) = true;
  1849. } else {
  1850. grd_prcpposlist.colDisabled(grd_prcpposlist.colRef("precureprcpflag")) = false;
  1851. }
  1852. //KNUH, 처방복사 버튼 클릭하여 선택된 처방 리스트를 복사하는 기능을 위해 refYN 값에 따라 refresh 처리 분기 (2011.02.16 JJE)
  1853. if(refYN == "Y") grd_prcpposlist.refresh();
  1854. //수술처방이 아닐 경우 수술유형 콤보 비활성화
  1855. /*
  1856. if (model.getValue("/root/main/prcp/prcplist[" + grd_prcpposlist.rows + "]/prcpclscd") != "H2"){
  1857. grd_prcpposlist.colDisabled(grd_prcpposlist.colRef("opansflagcd")) = true;
  1858. }
  1859. */
  1860. }
  1861. /**
  1862. * @desc : 처방저장 그리드에서 처방 삭제(드래그하여 delete key이용)
  1863. * @
  1864. * @param :
  1865. * @return :
  1866. * @author : 성미연 2008. 1. 9
  1867. * @---------------------------------------------------
  1868. */
  1869. function fDragDelPrcp() {
  1870. if (event.keyCode == "46") {
  1871. for (i = 0; i < grd_prcpposlist.selectedRows; i++) {
  1872. model.setValue("/root/main/prcp/prcplist[" + grd_prcpposlist.selectedRow(i) + "]/status", 'D');
  1873. }
  1874. for (i = 1; i <= getNodesetCount("/root/main/prcp/prcplist"); i++) {
  1875. if (model.getValue("/root/main/prcp/prcplist[" + i + "]/status") == 'D') {
  1876. grd_prcpposlist.deleteRow(i, false);
  1877. i--;
  1878. }
  1879. }
  1880. model.refresh();
  1881. }
  1882. }
  1883. /**
  1884. * @desc : 처방저장 그리드에서 반환컬럼 클릭시(물품 팝업, 수량, 총용량 변경)
  1885. * @
  1886. * @param :
  1887. * @return :
  1888. * @author : 성미연 2008. 1. 9
  1889. * @---------------------------------------------------
  1890. */
  1891. function fClickRtn() {
  1892. var iRow = grd_prcpposlist.row;
  1893. var prcppkspec = model.getValue("/root/main/prcp/prcplist[" + iRow + "]/prcppkspec");
  1894. var deptcd = "";
  1895. var pid = model.getValue("/root/main/cond/pid");
  1896. var indd = model.getValue("/root/main/paminfo/list/indd");
  1897. if ( !isNull(model.getValue("/root/code/codeinfo/codelist[cdgrupid ='002' and cdid ='"+combo1.value+"']/cdid")) ) {
  1898. deptcd = model.getValue("/root/init/patinfo/patlist[pid='" + pid + "']/grupcd");
  1899. } else {
  1900. deptcd = model.getValue("/root/main/cond/wardcd");
  1901. }
  1902. /*
  1903. if(grd_prcpposlist.col == grd_prcpposlist.colRef("anamneflag")){
  1904. var clincstdyflag = model.getValue("/root/main/cond/clincstdyflag");
  1905. var anamneflag = model.getValue("/root/main/prcp/prcplist[" + iRow + "]/anamneflag");
  1906. if(clincstdyflag == "Y") {
  1907. messageBox ( "기왕증은 임상연구와 동시에 선택 할 수", "I004" );
  1908. model.setValue("/root/main/prcp/prcplist[" + iRow + "]/anamneflag", "N");
  1909. } else {
  1910. if(anamneflag == "Y"){ //기왕증이 Y로 처리된 경우에만 보조유형선택 팝업 open
  1911. var subcretno = fGetSubcretno(pid, indd, "anamneflag");
  1912. if(subcretno == "0"){
  1913. messageBox ( "환자의 부유형이 없거나 또는 선택되지 않았습니다.", "I999" );
  1914. model.setValue("/root/main/prcp/prcplist[" + iRow + "]/anamneflag", "N");
  1915. model.setValue("/root/main/prcp/prcplist[" + iRow + "]/subcretno", "0");
  1916. } else {
  1917. model.setValue("/root/main/prcp/prcplist[" + iRow + "]/subcretno", subcretno);
  1918. }
  1919. }else{ //기왕증이 N로 처리된 경우에는 subcretno 0로 처리
  1920. model.setValue("/root/main/prcp/prcplist[" + iRow + "]/subcretno", "0");
  1921. }
  1922. }
  1923. } else */
  1924. if(grd_prcpposlist.col == grd_prcpposlist.colRef("tempcol8")){
  1925. //전처방에서 복사된 처방일 경우([전])
  1926. if(model.getValue("/root/main/prcp/prcplist[" + iRow + "]/status") == "B") {
  1927. //전처방을 여러개 이동하고 반환시 두개이상 체크할 경우 alert(한개만 삭제 요청하도록)
  1928. if (getNodesetCount(sPRCPLIST_PATH + "[prcppkspec = '"+ prcppkspec + "' and tempcol8 = 'Y']/tempcol8") > 1) {
  1929. messageBox("반환요청이", "E006");
  1930. model.setValue("/root/main/prcp/prcplist[" + iRow + "]/tempcol8", "N");
  1931. grd_prcpposlist.refresh();
  1932. return;
  1933. }
  1934. //물품반납부서 선택 팝업(재료인 경우)
  1935. if (model.getValue("/root/main/prcp/prcplist[" + iRow + "]/tempcol8") == "Y"
  1936. && model.getValue("/root/main/prcp/prcplist[" + iRow + "]/prcpclscd") == "M2"
  1937. && model.getValue("/root/main/prcp/prcplist[" + iRow + "]/issdeptcd") != deptcd ) {
  1938. fPopGoodRtn("/root/main/prcp/prcplist[" + iRow + "]", iRow);
  1939. }
  1940. //set처방, 검색 처방일 경우(신규 - row 삭제), 임시처방도 삭제
  1941. }else{
  1942. model.removeNode(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]");
  1943. }
  1944. } else if(grd_prcpposlist.col == grd_prcpposlist.colRef("prcpvol")){ //수량, 총용량 변경시
  1945. if(!isNaN(model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/prcpvol"))) {
  1946. DrugCalc ("prcpvol" , grd_prcpposlist.row);
  1947. } else {
  1948. model.setValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/prcpvol",model.getValue("/root/drugcalc/prcpvol"));
  1949. }
  1950. } else if(grd_prcpposlist.col == grd_prcpposlist.colRef("prcpqty")) {
  1951. if(!isNaN(model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/prcpqty"))) {
  1952. DrugCalc ("prcpqty" , grd_prcpposlist.row);
  1953. } else {
  1954. model.setValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/prcpqty",model.getValue("/root/drugcalc/prcpqty"));
  1955. }
  1956. } else if(grd_prcpposlist.col == grd_prcpposlist.colRef("drprcpetc7")) {
  1957. if(!isNaN(model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/drprcpetc7"))) {
  1958. DrugCalc ("drprcpetc7" , grd_prcpposlist.row);
  1959. } else {
  1960. model.setValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/drprcpetc7",model.getValue("/root/drugcalc/drprcpetc7"));
  1961. }
  1962. } else if(grd_prcpposlist.col == grd_prcpposlist.colRef("drprcpetc8")) {
  1963. if(!isNaN(model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/drprcpetc8"))) {
  1964. DrugCalc ("drprcpetc8" , grd_prcpposlist.row);
  1965. } else {
  1966. model.setValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/drprcpetc8",model.getValue("/root/drugcalc/drprcpetc8"));
  1967. }
  1968. } else if(grd_prcpposlist.col == grd_prcpposlist.colRef("prcptims")) {
  1969. if(!isNaN(model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/prcptims"))) {
  1970. DrugCalc ("prcptims" , grd_prcpposlist.row);
  1971. } else {
  1972. model.setValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/prcptims",model.getValue("/root/drugcalc/prcptims"));
  1973. }
  1974. } else if(grd_prcpposlist.col == grd_prcpposlist.colRef("drgacptflag")) {
  1975. if(model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/drgacptflag") == "A") { // PCA용 약제
  1976. messageBox ( "급여구분이 '본인부담'으로 변경 됩니다.", "I" );
  1977. model.setValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/payflagcd", "1");
  1978. } else if(model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/drgacptflag") == "B") { // 미용성형
  1979. messageBox ( "급여구분이 '비급여'으로 변경 됩니다.", "I" );
  1980. model.setValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/payflagcd", "2");
  1981. }
  1982. }
  1983. model.refresh();
  1984. }
  1985. /**
  1986. * @desc : 귀가유치물품 관련 데이터(여부,수량) 입력값 체크
  1987. * @
  1988. * @param : iRow-체크대상 행번호
  1989. * @return :
  1990. * @author : 김진아 2009.02.06
  1991. * @---------------------------------------------------
  1992. */
  1993. function fChkHomeMatr(iRow){
  1994. var ordtype = model.getValue("/root/main/patinfocond/patinfo/ordtype");
  1995. var prcpclscd = model.getValue("/root/main/prcp/prcplist[" + iRow + "]/prcpclscd");
  1996. var homematrflag = model.getValue("/root/main/prcp/prcplist[" + iRow + "]/homematrflag");
  1997. var homematrqty = model.getValue("/root/main/prcp/prcplist[" + iRow + "]/homematrqty");
  1998. var prcpqty = model.getValue("/root/main/prcp/prcplist[" + iRow + "]/prcpqty");
  1999. if( (model.getValue("/root/main/prcp/prcplist[" + iRow + "]/homematrflag")=="Y")
  2000. ||(model.getValue("/root/main/prcp/prcplist[" + iRow + "]/homematrqty") !="0")){
  2001. if(ordtype!="O"){
  2002. messageBox("귀가유치물품을 지정할 수 없는 환자입니다.", "I", "(외래환자만 지정가능)");
  2003. model.makeValue("/root/main/prcp/prcplist[" + iRow + "]/homematrflag", "N");
  2004. model.makeValue("/root/main/prcp/prcplist[" + iRow + "]/homematrqty" , "0");
  2005. return ;
  2006. } else if(prcpclscd!="M2"){
  2007. messageBox("귀가유치물품을 지정할 수 없는 처방입니다.", "I", "(재료처방만 지정가능)");
  2008. model.makeValue("/root/main/prcp/prcplist[" + iRow + "]/homematrflag", "N");
  2009. model.makeValue("/root/main/prcp/prcplist[" + iRow + "]/homematrqty" , "0");
  2010. return ;
  2011. } else if(Number(prcpqty) < Number(homematrqty)){
  2012. messageBox("처방수량보다 귀가유치물품수량이 더 많을 수 없습니다.", "I", "처방수량 확인 후 다시 지정하십시오.");
  2013. model.makeValue("/root/main/prcp/prcplist[" + iRow + "]/homematrqty" , "0");
  2014. return ;
  2015. }
  2016. }
  2017. }
  2018. /**
  2019. * @desc : 총용량, 수량의 수정전 값을 instance에 넣어둔다.
  2020. * @
  2021. * @param :
  2022. * @return :
  2023. * @author : 성미연 2008. 3. 17
  2024. * @---------------------------------------------------
  2025. */
  2026. function fSetPrcpVolQty() {
  2027. var curCol = grd_prcpposlist.col;
  2028. if(curCol == grd_prcpposlist.colRef("prcpvol")){
  2029. model.setValue("/root/drugcalc/prcpvol", model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/prcpvol"));
  2030. } else if(curCol == grd_prcpposlist.colRef("prcpqty")){
  2031. model.setValue("/root/drugcalc/prcpqty", model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/prcpqty"));
  2032. } else if(curCol == grd_prcpposlist.colRef("prcptims")){
  2033. model.setValue("/root/drugcalc/prcptims", model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/prcptims"));
  2034. } else if(curCol == grd_prcpposlist.colRef("drprcpetc7")){
  2035. model.setValue("/root/drugcalc/drprcpetc7", model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/drprcpetc7"));
  2036. } else if(curCol == grd_prcpposlist.colRef("drprcpetc8")){
  2037. model.setValue("/root/drugcalc/drprcpetc8", model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/drprcpetc8"));
  2038. }
  2039. }
  2040. /**
  2041. * @desc : 용량, 수량, 횟수를 수정했을 때 값계산
  2042. * @
  2043. * @param : flag : 용량, 수량, 횟수 변경 구분
  2044. curRow : 수정할 현재 row
  2045. * @return : void
  2046. * @author : 마정민 2007. 4. 30
  2047. * 소스카피 by cha
  2048. * @---------------------------------------------------
  2049. */
  2050. /*
  2051. function DrugCalc ( flag, curRow ) {
  2052. var PrcpVol = model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol" );
  2053. if ( isNull(PrcpVol) || PrcpVol == 0 ) {
  2054. PrcpVol = "1";
  2055. }
  2056. var PrcpQty = model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty" );
  2057. if ( isNull(PrcpQty) || PrcpQty == 0 ){
  2058. PrcpQty = "1";
  2059. }
  2060. var bfPrcpVol = model.getValue ( "/root/drugcalc/prcpvol" );
  2061. if ( isNull(bfPrcpVol) || bfPrcpVol == 0 ) {
  2062. bfPrcpVol = "1";
  2063. }
  2064. var bfPrcpQty = model.getValue ( "/root/drugcalc/prcpqty" );
  2065. if ( isNull(bfPrcpQty) || bfPrcpQty == 0 ) {
  2066. bfPrcpQty = "1";
  2067. }
  2068. var calcPrcpVol = 0;
  2069. var calcPrcpQty = 0;
  2070. // if ( flag == "prcpvol" && bfPrcpVol != PrcpVol ) { // 용량을 수정했을 때: 수량 자동계산
  2071. // calcPrcpQty = eval(PrcpVol) / eval(bfPrcpVol) * eval(PrcpQty)*1000;
  2072. // calcPrcpQty = Math.round(calcPrcpQty)/1000;
  2073. // model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty", calcPrcpQty );
  2074. //
  2075. // } else if ( flag == "prcpqty" && bfPrcpQty != PrcpQty ) { // 수량을 수정했을 때: 용량 자동계산
  2076. // calcPrcpVol = eval(PrcpQty) / eval(bfPrcpQty) * eval(PrcpVol)*1000;
  2077. // calcPrcpVol = Math.round(calcPrcpVol)/1000;
  2078. // model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", calcPrcpVol );
  2079. // }20100514 khj
  2080. //20090820 마정민 수정. 약인 경우는 최초의 용량 수량 비율로 계산하는 것으로 수정
  2081. var baseQty = getArrayData ( model.getValue ( "/root/main/prcp/prcplist[" + curRow + "]/drugmastspec" ) + "^", 0, 31 , "^", "|" );
  2082. var baseVol = getArrayData ( model.getValue ( "/root/main/prcp/prcplist[" + curRow + "]/drugmastspec" ) + "^", 0, 32 , "^", "|" );
  2083. if (model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpclscd" ).substring ( 0, 1 ) == "A" && !isNull(baseQty) && !isNull(baseVol)) {
  2084. var baseQty = getArrayData ( model.getValue ( "/root/main/prcp/prcplist[" + curRow + "]/drugmastspec" ) + "^", 0, 31 , "^", "|" );
  2085. var baseVol = getArrayData ( model.getValue ( "/root/main/prcp/prcplist[" + curRow + "]/drugmastspec" ) + "^", 0, 32 , "^", "|" );
  2086. if ( flag == "prcpvol" && bfPrcpVol != PrcpVol ) { // 용량을 수정했을 때: 수량 자동계산
  2087. calcPrcpQty = parseFloat(PrcpVol) / parseFloat(baseVol) * parseFloat(baseQty)*1000;
  2088. calcPrcpQty = Math.round(calcPrcpQty)/1000;
  2089. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty", calcPrcpQty );
  2090. } else if ( flag == "prcpqty" && bfPrcpQty != PrcpQty ) { // 수량을 수정했을 때: 용량 자동계산
  2091. var prcpclscd = model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpclscd" );
  2092. calcPrcpVol = parseFloat(PrcpQty) / parseFloat(baseQty) * parseFloat(baseVol)*1000;
  2093. calcPrcpVol = Math.round(calcPrcpVol)/1000;
  2094. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", calcPrcpVol );
  2095. }
  2096. } else {
  2097. if ( flag == "prcpvol" ) { // 용량을 수정했을 때: 수량 자동계산
  2098. calcPrcpQty = eval(PrcpVol) / eval(bfPrcpVol) * eval(PrcpQty)*1000;
  2099. calcPrcpQty = Math.round(calcPrcpQty)/1000;
  2100. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty", calcPrcpQty );
  2101. } else if ( flag == "prcpqty" ) { // 수량을 수정했을 때: 용량 자동계산
  2102. calcPrcpVol = eval(PrcpQty) / eval(bfPrcpQty) * eval(PrcpVol)*1000;
  2103. calcPrcpVol = Math.round(calcPrcpVol)/1000;
  2104. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", calcPrcpVol );
  2105. }
  2106. }
  2107. }
  2108. */
  2109. function DrugCalc ( flag, curRow ) {
  2110. var PrcpVol = model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol" );
  2111. if ( isNull(PrcpVol) || PrcpVol == 0 ) {
  2112. PrcpVol = "1";
  2113. }
  2114. var PrcpQty = model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty" );
  2115. if ( isNull(PrcpQty) || PrcpQty == 0 ){
  2116. PrcpQty = "1";
  2117. }
  2118. var PrcpTims = model.getValue (sPRCPLIST_PATH + "[" + curRow + "]/prcptims" );
  2119. if ( isNull(PrcpTims) || PrcpTims == 0 ) {
  2120. PrcpTims = "1";
  2121. }
  2122. var drprcpetc7 = model.getValue (sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7" );
  2123. var drprcpetc7_2 = model.getValue (sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7" );
  2124. if ( isNull(drprcpetc7) || drprcpetc7 == 0 || drprcpetc7 == "-") {
  2125. drprcpetc7 = "1";
  2126. }
  2127. var drprcpetc8 = model.getValue (sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8" );
  2128. var drprcpetc8_2 = model.getValue (sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8" );
  2129. if ( isNull(drprcpetc8) || drprcpetc8 == 0 || drprcpetc8 == "-") {
  2130. drprcpetc8 = "1";
  2131. }
  2132. var bfPrcpVol = model.getValue ( "/root/drugcalc/prcpvol" );
  2133. if ( isNull(bfPrcpVol) || bfPrcpVol == 0 ) {
  2134. bfPrcpVol = "1";
  2135. }
  2136. var bfPrcpQty = model.getValue ( "/root/drugcalc/prcpqty" );
  2137. if ( isNull(bfPrcpQty) || bfPrcpQty == 0 ) {
  2138. bfPrcpQty = "1";
  2139. }
  2140. var bfprcpTims = model.getValue ( "/root/drugcalc/prcptims" );
  2141. if ( isNull(bfprcpTims) || bfprcpTims == 0 ) {
  2142. bfprcpTims = "1";
  2143. }
  2144. var bfdrprcpetc7 = model.getValue ( "/root/drugcalc/drprcpetc7" );
  2145. if ( isNull(bfdrprcpetc7) || bfdrprcpetc7 == 0 ) {
  2146. bfdrprcpetc7 = "1";
  2147. }
  2148. var bfdrprcpetc8 = model.getValue ( "/root/drugcalc/drprcpetc8" );
  2149. if ( isNull(bfdrprcpetc8) || bfdrprcpetc8 == 0 ) {
  2150. bfdrprcpetc8 = "1";
  2151. }
  2152. var calcPrcpVol = 0;
  2153. var calcPrcpQty = 0;
  2154. var calcPrcpTimeVol = 0;
  2155. var calcPrcpTimeQty = 0;
  2156. //20090820 마정민 수정. 약인 경우는 최초의 용량 수량 비율로 계산하는 것으로 수정
  2157. var baseQty = getArrayData ( model.getValue ( "/root/main/prcp/prcplist[" + curRow + "]/drugmastspec" ) + "^", 0, 31 , "^", "|" );
  2158. var baseVol = getArrayData ( model.getValue ( "/root/main/prcp/prcplist[" + curRow + "]/drugmastspec" ) + "^", 0, 32 , "^", "|" );
  2159. var drugcntsvol = getArrayData ( model.getValue ( "/root/main/prcp/prcplist[" + curRow + "]/drugmastspec" ) + "^", 0, 1 , "^", "|" );
  2160. var drugstndvol = getArrayData ( model.getValue ( "/root/main/prcp/prcplist[" + curRow + "]/drugmastspec" ) + "^", 0, 3 , "^", "|" );
  2161. var drugpackvol = getArrayData ( model.getValue ( "/root/main/prcp/prcplist[" + curRow + "]/drugmastspec" ) + "^", 0, 5 , "^", "|" );
  2162. var drugbasevol = getArrayData ( model.getValue ( "/root/main/prcp/prcplist[" + curRow + "]/drugmastspec" ) + "^", 0, 7 , "^", "|" );
  2163. var baseTimeVol = drugcntsvol * drugbasevol / drugpackvol;
  2164. var baseTimeQty = drugbasevol;
  2165. if (model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpclscd" ).substring ( 0, 1 ) == "A" && !isNull(baseQty) && !isNull(baseVol)) {
  2166. if ( flag == "prcpvol" && bfPrcpVol != PrcpVol ) { // 용량을 수정했을 때: 수량 자동계산
  2167. calcPrcpQty = parseFloat(PrcpVol) / parseFloat(baseVol) * parseFloat(baseQty)*1000;
  2168. calcPrcpQty = Math.round(calcPrcpQty)/1000;
  2169. calcPrcpTimeQty = parseFloat(PrcpVol) / parseFloat(baseVol) * parseFloat(baseTimeQty)*1000;
  2170. calcPrcpTimeQty = Math.round(calcPrcpTimeQty)/1000;
  2171. calcPrcpTimeVol = parseFloat(PrcpVol) / parseFloat(baseVol) * parseFloat(baseTimeVol)*1000;
  2172. calcPrcpTimeVol = Math.round(calcPrcpTimeVol)/1000;
  2173. //start: 요청번호 9851, 인슐린주사제 변경 alert (2010.01.28 JJE)
  2174. var cnclInptTxt = model.getValue(sPRCPLIST_PATH + "[" + curRow + "]/prcpcd");
  2175. var prcpcdEndTxt = cnclInptTxt.substring(cnclInptTxt.length-1, cnclInptTxt.length);
  2176. if(model.getValue(sPRCPLIST_PATH + "[" + curRow + "]/tempcol2") == "05|04|09" && (prcpcdEndTxt == "J" || prcpcdEndTxt == "P") && calcPrcpQty < 1){
  2177. messageBox(cnclInptTxt + "\n\n소량 처방을 원하시는 경우에는\nUNIT 단위 코드(원 처방의 끝자리 J나 P를 뺀 코드)로 변경 처방하여 주시기 바랍니다.", "I");
  2178. //model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", bfPrcpVol );
  2179. //return;
  2180. } //end
  2181. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty", calcPrcpQty );
  2182. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7", calcPrcpTimeVol );
  2183. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8", calcPrcpTimeQty );
  2184. } else if ( flag == "prcpqty" && bfPrcpQty != PrcpQty ) { // 수량을 수정했을 때: 용량 자동계산
  2185. var prcpclscd = model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpclscd" );
  2186. calcPrcpVol = parseFloat(PrcpQty) / parseFloat(baseQty) * parseFloat(baseVol)*1000;
  2187. calcPrcpVol = Math.round(calcPrcpVol)/1000;
  2188. calcPrcpTimeQty = parseFloat(PrcpQty) / parseFloat(baseQty) * parseFloat(baseTimeQty)*1000;
  2189. calcPrcpTimeQty = Math.round(calcPrcpTimeQty)/1000;
  2190. calcPrcpTimeVol = parseFloat(PrcpQty) / parseFloat(baseQty) * parseFloat(baseTimeVol)*1000;
  2191. calcPrcpTimeVol = Math.round(calcPrcpTimeVol)/1000;
  2192. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", calcPrcpVol );
  2193. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7", calcPrcpTimeVol );
  2194. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8", calcPrcpTimeQty );
  2195. } else if ( flag == "drprcpetc7" && bfdrprcpetc7 != drprcpetc7 ) { // 용량을 수정했을 때: 수량 자동계산
  2196. calcPrcpQty = parseFloat(drprcpetc7) / parseFloat(baseTimeVol) * parseFloat(baseQty)*1000;
  2197. calcPrcpQty = Math.round(calcPrcpQty)/1000;
  2198. calcPrcpTimeQty = parseFloat(drprcpetc7) / parseFloat(baseTimeVol) * parseFloat(baseTimeQty)*1000;
  2199. calcPrcpTimeQty = Math.round(calcPrcpTimeQty)/1000;
  2200. calcPrcpVol = parseFloat(drprcpetc7) / parseFloat(baseTimeVol) * parseFloat(baseVol)*1000;
  2201. calcPrcpVol = Math.round(calcPrcpVol)/1000;
  2202. //start: 요청번호 9851, 인슐린주사제 변경 alert (2010.01.28 JJE)
  2203. var cnclInptTxt = model.getValue(sPRCPLIST_PATH + "[" + curRow + "]/prcpcd");
  2204. var prcpcdEndTxt = cnclInptTxt.substring(cnclInptTxt.length-1, cnclInptTxt.length);
  2205. if(model.getValue(sPRCPLIST_PATH + "[" + curRow + "]/tempcol2") == "05|04|09" && (prcpcdEndTxt == "J" || prcpcdEndTxt == "P") && calcPrcpQty < 1){
  2206. messageBox(cnclInptTxt + "\n\n소량 처방을 원하시는 경우에는\nUNIT 단위 코드(원 처방의 끝자리 J나 P를 뺀 코드)로 변경 처방하여 주시기 바랍니다.", "I");
  2207. //model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", bfPrcpVol );
  2208. //return;
  2209. } //end
  2210. if(drprcpetc7.substr(0,1) == "0") {
  2211. calcPrcpQty = "1";
  2212. calcPrcpVol = "1";
  2213. calcPrcpTimeQty = "1";
  2214. }
  2215. if(drprcpetc8.substr(0,1) == "0") {
  2216. calcPrcpQty = "1";
  2217. calcPrcpVol = "1";
  2218. calcPrcpTimeQty = "1";
  2219. }
  2220. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty", calcPrcpQty );
  2221. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", calcPrcpVol );
  2222. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8", calcPrcpTimeQty );
  2223. } else if ( flag == "drprcpetc8" && bfdrprcpetc8 != drprcpetc8 ) { // 수량을 수정했을 때: 용량 자동계산
  2224. calcPrcpVol = parseFloat(drprcpetc8) / parseFloat(baseTimeQty) * parseFloat(baseVol)*1000;
  2225. calcPrcpVol = Math.round(calcPrcpVol)/1000;
  2226. calcPrcpTimeVol = parseFloat(drprcpetc8) / parseFloat(baseTimeQty) * parseFloat(baseTimeVol)*1000;
  2227. calcPrcpTimeVol = Math.round(calcPrcpTimeVol)/1000;
  2228. calcPrcpQty = parseFloat(drprcpetc8) / parseFloat(baseTimeQty) * parseFloat(baseQty)*1000;
  2229. calcPrcpQty = Math.round(calcPrcpQty)/1000;
  2230. if(drprcpetc7.substr(0,1) == "0") {
  2231. calcPrcpQty = "1";
  2232. calcPrcpVol = "1";
  2233. calcPrcpTimeQty = "1";
  2234. }
  2235. if(drprcpetc8.substr(0,1) == "0") {
  2236. calcPrcpQty = "1";
  2237. calcPrcpVol = "1";
  2238. calcPrcpTimeQty = "1";
  2239. }
  2240. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", calcPrcpVol );
  2241. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty", calcPrcpQty );
  2242. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7", calcPrcpTimeVol );
  2243. var prcpclscd = model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpclscd" );
  2244. }
  2245. } else {
  2246. if ( flag == "prcpvol" ) { // 용량을 수정했을 때: 수량 자동계산
  2247. calcPrcpQty = eval(PrcpVol) / eval(bfPrcpVol) * eval(PrcpQty)*1000;
  2248. calcPrcpQty = Math.round(calcPrcpQty)/1000;
  2249. calcPrcpTimeVol = eval(PrcpVol) / eval(bfPrcpVol) * eval(drprcpetc7)*1000;
  2250. calcPrcpTimeVol = Math.round(calcPrcpTimeVol)/1000;
  2251. calcPrcpTimeQty = eval(PrcpVol) / eval(bfPrcpVol) * eval(drprcpetc8)*1000;
  2252. calcPrcpTimeQty = Math.round(calcPrcpTimeQty)/1000;
  2253. //start: 요청번호 9851, 인슐린주사제 변경 alert (2010.01.28 JJE)
  2254. var cnclInptTxt = model.getValue(sPRCPLIST_PATH + "[" + curRow + "]/prcpcd");
  2255. var prcpcdEndTxt = cnclInptTxt.substring(cnclInptTxt.length-1, cnclInptTxt.length);
  2256. if(model.getValue(sPRCPLIST_PATH + "[" + curRow + "]/tempcol2") == "05|04|09" && (prcpcdEndTxt == "J" || prcpcdEndTxt == "P") && calcPrcpQty < 1){
  2257. messageBox(cnclInptTxt + "\n\n소량 처방을 원하시는 경우에는\nUNIT 단위 코드(원 처방의 끝자리 J나 P를 뺀 코드)로 변경 처방하여 주시기 바랍니다.", "I");
  2258. //model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", bfPrcpVol );
  2259. //return;
  2260. } //end
  2261. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty", calcPrcpQty );
  2262. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7", calcPrcpTimeVol );
  2263. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8", calcPrcpTimeQty );
  2264. } else if ( flag == "prcpqty" ) { // 수량을 수정했을 때: 용량 자동계산
  2265. var prcpclscd = model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpclscd" );
  2266. calcPrcpVol = eval(PrcpQty) / eval(bfPrcpQty) * eval(PrcpVol)*1000;
  2267. calcPrcpVol = Math.round(calcPrcpVol)/1000;
  2268. calcPrcpTimeVol = eval(PrcpQty) / eval(bfPrcpQty) * eval(drprcpetc7)*1000;
  2269. calcPrcpTimeVol = Math.round(calcPrcpTimeVol)/1000;
  2270. calcPrcpTimeQty = eval(PrcpQty) / eval(bfPrcpQty) * eval(drprcpetc8)*1000;
  2271. calcPrcpTimeQty = Math.round(calcPrcpTimeQty)/1000;
  2272. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", calcPrcpVol );
  2273. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7", calcPrcpTimeVol );
  2274. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8", calcPrcpTimeQty );
  2275. if ( prcpclscd == "M2" ) {
  2276. //20090330 마정민수정. 귀가유치용 물품처방은 의사처방 수량을 수정하면 귀가유치용물품수량컬럼에 같이 반영한다.
  2277. if (!isNull(model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc4")) && model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc4")!= "-" && model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc4" )>0){
  2278. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc4", PrcpQty );
  2279. }
  2280. }
  2281. } else if ( flag == "drprcpetc7" && bfdrprcpetc7 != drprcpetc7 ) { // 용량을 수정했을 때: 수량 자동계산
  2282. calcPrcpTimeQty = eval(drprcpetc7) / eval(bfdrprcpetc7) * eval(drprcpetc8)*1000;
  2283. calcPrcpTimeQty = Math.round(calcPrcpTimeQty)/1000;
  2284. calcPrcpVol = eval(drprcpetc7) / eval(bfdrprcpetc7) * eval(PrcpVol)*1000;
  2285. calcPrcpVol = Math.round(calcPrcpVol)/1000;
  2286. calcPrcpQty = eval(drprcpetc7) / eval(bfdrprcpetc7) * eval(PrcpQty)*1000;
  2287. calcPrcpQty = Math.round(calcPrcpQty)/1000;
  2288. //start: 요청번호 9851, 인슐린주사제 변경 alert (2010.01.28 JJE)
  2289. var cnclInptTxt = model.getValue(sPRCPLIST_PATH + "[" + curRow + "]/prcpcd");
  2290. var prcpcdEndTxt = cnclInptTxt.substring(cnclInptTxt.length-1, cnclInptTxt.length);
  2291. if(model.getValue(sPRCPLIST_PATH + "[" + curRow + "]/tempcol2") == "05|04|09" && (prcpcdEndTxt == "J" || prcpcdEndTxt == "P") && calcPrcpQty < 1){
  2292. messageBox(cnclInptTxt + "\n\n소량 처방을 원하시는 경우에는\nUNIT 단위 코드(원 처방의 끝자리 J나 P를 뺀 코드)로 변경 처방하여 주시기 바랍니다.", "I");
  2293. //model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", bfPrcpVol );
  2294. //return;
  2295. } //end
  2296. if(drprcpetc7.substr(0,1) == "0" && drprcpetc7.substr(1,1) != ".") {
  2297. calcPrcpQty = "1";
  2298. calcPrcpVol = "1";
  2299. calcPrcpTimeQty = "1";
  2300. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7", "1");
  2301. }
  2302. if(drprcpetc8.substr(0,1) == "0" && drprcpetc8.substr(1,1) != ".") {
  2303. calcPrcpQty = "1";
  2304. calcPrcpVol = "1";
  2305. calcPrcpTimeQty = "1";
  2306. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7", "1");
  2307. }
  2308. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty", calcPrcpQty );
  2309. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", calcPrcpVol );
  2310. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8", calcPrcpTimeQty );
  2311. if ( isNull(drprcpetc7_2) || drprcpetc7_2 == 0 || drprcpetc7_2 == "-") {
  2312. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7", "1");
  2313. }
  2314. } else if ( flag == "drprcpetc8" && bfdrprcpetc8 != drprcpetc8 ) { // 수량을 수정했을 때: 용량 자동계산
  2315. calcPrcpTimeVol = eval(drprcpetc8) / eval(bfdrprcpetc8) * eval(drprcpetc7)*1000;
  2316. calcPrcpTimeVol = Math.round(calcPrcpTimeVol)/1000;
  2317. calcPrcpVol = eval(drprcpetc8) / eval(bfdrprcpetc8) * eval(PrcpVol)*1000;
  2318. calcPrcpVol = Math.round(calcPrcpVol)/1000;
  2319. calcPrcpQty = eval(drprcpetc8) / eval(bfdrprcpetc8) * eval(PrcpQty)*1000;
  2320. calcPrcpQty = Math.round(calcPrcpQty)/1000;
  2321. if(drprcpetc7.substr(0,1) == "0" && drprcpetc7.substr(1,1) != ".") {
  2322. calcPrcpQty = "1";
  2323. calcPrcpVol = "1";
  2324. calcPrcpTimeVol = "1";
  2325. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8", "1");
  2326. }
  2327. if(drprcpetc8.substr(0,1) == "0" && drprcpetc8.substr(1,1) != ".") {
  2328. calcPrcpQty = "1";
  2329. calcPrcpVol = "1";
  2330. calcPrcpTimeVol = "1";
  2331. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8", "1");
  2332. }
  2333. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", calcPrcpVol );
  2334. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty", calcPrcpQty );
  2335. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7", calcPrcpTimeVol );
  2336. if ( isNull(drprcpetc8_2) || drprcpetc8_2 == 0 || drprcpetc8_2 == "-") {
  2337. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8", "1");
  2338. }
  2339. var prcpclscd = model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpclscd" );
  2340. if ( prcpclscd == "M2" ) {
  2341. //20090330 마정민수정. 귀가유치용 물품처방은 의사처방 수량을 수정하면 귀가유치용물품수량컬럼에 같이 반영한다.
  2342. if (!isNull(model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc4")) && model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc4")!= "-" && model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc4" )>0){
  2343. model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc4", PrcpQty );
  2344. }
  2345. }
  2346. }
  2347. }
  2348. }
  2349. /**
  2350. * @desc : 처방저장 그리드 오른쪽 마우스 클릭시(적용일자 팝업, 반납부서 팝업)
  2351. * @
  2352. * @param :
  2353. * @return :
  2354. * @author : 성미연 2008. 1. 9
  2355. * @---------------------------------------------------
  2356. */
  2357. function fClickBkPrcp(){
  2358. if (grd_prcpposlist.colRef("orgprcpnm") == grd_prcpposlist.mouseCol ||grd_prcpposlist.colRef("prcpcd") == grd_prcpposlist.mouseCol
  2359. ||grd_prcpposlist.colRef("drugmthdspccdnm") == grd_prcpposlist.mouseCol ||grd_prcpposlist.colRef("goodmodel") == grd_prcpposlist.mouseCol
  2360. ||grd_prcpposlist.colRef("matrallsizespecid") == grd_prcpposlist.mouseCol ) {
  2361. //tf서브메뉴 띄우지 않음
  2362. window.showPopupMenu(true);
  2363. if (event.button == 3) {
  2364. window.setPopupMenu(true, "/root/main/popupmenu/prcpposlist/item", "name", "func", false);
  2365. model.refresh();
  2366. }
  2367. else{
  2368. // window.setPopupMenu(false);
  2369. return;
  2370. }
  2371. }else{
  2372. grd_prcpposlist.row = grd_prcpposlist.mouseRow;
  2373. if (event.button == 3 && isDataCell() == true ) {
  2374. //적용일자 팝업(가정간호일 경우는 사용하지 않음)
  2375. if (model.getValue("/root/main/cond/homecareyn") == "" && grd_prcpposlist.mouseCol == grd_prcpposlist.colRef("prcpdelivefact")){
  2376. //tf서브메뉴 띄우지 않음
  2377. window.showPopupMenu(false);
  2378. var yPos = event.y;
  2379. if (yPos < 425) {
  2380. grp_prcpapp.attribute("left") = "955px";
  2381. grp_prcpapp.attribute("top") = (yPos + 80)+"px";
  2382. } else {
  2383. grp_prcpapp.attribute("left") = "955px";
  2384. grp_prcpapp.attribute("top") = "506px";
  2385. }
  2386. grp_prcpapp.visible = true;
  2387. model.setValue("/root/main/prcpposinfo/cond/prcpappdd", model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.mouseRow + "]/prcpdelivefact"));
  2388. //물품반납부서선택 팝업(재료인 경우)
  2389. } else if(model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.mouseRow + "]/prcpclscd") == "M2"){
  2390. if (grd_prcpposlist.isReadOnly(grd_prcpposlist.mouseRow, grd_prcpposlist.colRef("tempcol8")) == false &&
  2391. grd_prcpposlist.valueMatrix(grd_prcpposlist.mouseRow, grd_prcpposlist.colRef("tempcol8")) == "Y" ) {
  2392. //tf서브메뉴 띄우지 않음
  2393. window.showPopupMenu(false);
  2394. fPopGoodRtn(sPRCPLIST_PATH + "[" + grd_prcpposlist.mouseRow + "]", grd_prcpposlist.mouseRow);
  2395. }
  2396. }
  2397. model.refresh();
  2398. //window.showPopupMenu(true);
  2399. }
  2400. }
  2401. }
  2402. /**
  2403. * @desc : 물품부서 팝업
  2404. * @
  2405. * @param :
  2406. * @return :
  2407. * @author : 성미연 2008. 1. 9
  2408. * @---------------------------------------------------
  2409. */
  2410. function fPopGoodRtn(GridPath, iRow) {
  2411. var rtndeptcd = fGetPrcpPos();
  2412. setParameter("rtndeptcd", rtndeptcd);
  2413. open("SPMNW11400","1","300","500", "SPMNW11400", GridPath, "/root/main/prcp/prcplist");
  2414. /*
  2415. if (model.getValue("/root/main/prcpposinfo/cond/goodrtnyn") != 'Y') { //물품반납부서 지정 버튼을 누르지 않았을 경우 반환 해지
  2416. model.setValue("/root/main/prcpposinfo/prcpinfo/prcplist[" + iRow + "]/return", "false");
  2417. // model.setValue("/root/main/prcpposinfo/cond/dcdeptcd", model.getValue("/root/main/prcpposinfo/cond/dcdeptcd"));
  2418. model.refresh();
  2419. }
  2420. */
  2421. }
  2422. /**
  2423. * @desc : 처방위치 return
  2424. * @
  2425. * @param :
  2426. * @return :
  2427. * @author : 성미연 2008. 1. 9
  2428. * @---------------------------------------------------
  2429. */
  2430. function fGetPrcpPos() {
  2431. var PrcpPosCD = "";
  2432. var pid=model.getValue("/root/main/cond/pid");
  2433. if (model.getValue("/root/main/prcpposinfo/cond/poscd") == '1') { //환자위치
  2434. if ( !isNull(model.getValue("/root/code/codeinfo/codelist[cdgrupid ='002' and cdid ='"+combo1.value+"']/cdid")) ) {
  2435. PrcpPosCD = model.getValue("/root/init/patinfo/patlist[pid='" + pid + "']/grupcd");
  2436. } else {
  2437. PrcpPosCD = model.getValue("/root/main/cond/wardcd");
  2438. }
  2439. } else { //User위치
  2440. PrcpPosCD = model.getValue("/root/main/prcpposinfo/cond/deptcd");
  2441. }
  2442. return PrcpPosCD;
  2443. }
  2444. /**
  2445. * @desc : 실제처방 적용일 팝업 확인 클릭시
  2446. * @
  2447. * @param :
  2448. * @return :
  2449. * @author : 성미연 2008. 1. 9
  2450. * @---------------------------------------------------
  2451. */
  2452. function fPrcpAppDDInfo(){
  2453. //적용일자 미래입력 불가능
  2454. var prcpappdd = model.getValue("/root/main/prcpposinfo/cond/prcpappdd");
  2455. //** 입원환자의 경우 입원일 이전으로 처방입력 불가 추가_20080822(ByJA) **//
  2456. var ordtype = model.getValue("/root/main/patinfocond/patinfo/ordtype");
  2457. var indd = model.getValue("/root/main/patinfocond/patinfo/indd");
  2458. var orddd = model.getValue("/root/main/patinfocond/patinfo/orddd");
  2459. if(ordtype == "I"){
  2460. if(indd > prcpappdd){
  2461. messageBox("입원일자["+indd.substr(0,4)+"-"+indd.substr(4,2)+"-"+indd.substr(6,2)+"] 이전으로 입력할 수", "I004");
  2462. model.setFocus("ipt_prcpappdd");
  2463. return;
  2464. }
  2465. }else if(ordtype == "O"){
  2466. if(orddd > prcpappdd){
  2467. messageBox("진료일자["+orddd.substr(0,4)+"-"+orddd.substr(4,2)+"-"+orddd.substr(6,2)+"] 이전으로 입력할 수", "I004");
  2468. model.setFocus("ipt_prcpappdd");
  2469. return;
  2470. }
  2471. }
  2472. if (prcpappdd <= getCurrentDate()) {
  2473. model.setValue(sPRCPLIST_PATH+ "[" + grd_prcpposlist.row + "]/prcpdelivefact", prcpappdd);
  2474. } else {
  2475. messageBox("미래일자는 입력할 수", "I004");
  2476. model.setFocus("ipt_prcpappdd");
  2477. return;
  2478. }
  2479. grp_prcpapp.visible = false;
  2480. //tf서브메뉴 사용
  2481. window.showPopupMenu(true);
  2482. model.refresh();
  2483. }
  2484. /**
  2485. * @desc : 처방목록 그리드 확대/축소
  2486. * @
  2487. * @param : state - true : 확대, false : 축소
  2488. * @return :
  2489. * @author : 성미연 2008. 2. 5
  2490. * @---------------------------------------------------
  2491. */
  2492. function fprcpsetzoomToggle(state){
  2493. if(state) {
  2494. btn_zoom.attribute("text") = "축소";
  2495. switch1.attribute("width")= "900";
  2496. grd_prcplist.attribute("width") = "753";
  2497. grd_prcplist.colWidth(grd_prcplist.colRef("orgprcpnm")) = 290;
  2498. } else {
  2499. btn_zoom.attribute("text") = "확대";
  2500. switch1.attribute("width")= "500";
  2501. grd_prcplist.attribute("width") = "350";
  2502. grd_prcplist.colWidth(grd_prcplist.colRef("orgprcpnm")) = 211;
  2503. }
  2504. }
  2505. /**
  2506. * @desc : 전처방 그리드 확대/축소
  2507. * @
  2508. * @param : state - true : 확대, false : 축소
  2509. * @return :
  2510. * @author : 성미연 2008. 2. 5
  2511. * @---------------------------------------------------
  2512. */
  2513. function fbfzoomToggle(state){
  2514. if(state) {
  2515. btn_bfzoom.attribute("text") = "축소";
  2516. switch1.attribute("width")= "1165";
  2517. grd_bfprcplist.attribute("width") = "1155";
  2518. grd_bfprcplist.colWidth(grd_bfprcplist.colRef("prcpnm")) = 233;
  2519. } else {
  2520. btn_bfzoom.attribute("text") = "확대";
  2521. switch1.attribute("width")= "500";
  2522. grd_bfprcplist.attribute("width") = "489";
  2523. grd_bfprcplist.colWidth(grd_bfprcplist.colRef("prcpnm")) = 117;
  2524. }
  2525. }
  2526. /**
  2527. * @desc : 임시처방 그리드 확대/축소
  2528. * @
  2529. * @param : state - true : 확대, false : 축소
  2530. * @return :
  2531. * @author : 성미연 2008. 6. 17
  2532. * @---------------------------------------------------
  2533. */
  2534. function ftempzoomToggle(state){
  2535. if(state) {
  2536. btn_tempzoom.attribute("text") = "축소";
  2537. switch1.attribute("width")= "692";
  2538. grd_tempprcplist.attribute("width") = "690";
  2539. grd_tempprcplist.colWidth(grd_tempprcplist.colRef("drugmthdspccdnm")) = 150;
  2540. } else {
  2541. btn_tempzoom.attribute("text") = "확대";
  2542. switch1.attribute("width")= "500";
  2543. grd_tempprcplist.attribute("width") = "493";
  2544. grd_tempprcplist.colWidth(grd_tempprcplist.colRef("prcpnm")) = 230;
  2545. grd_tempprcplist.colWidth(grd_tempprcplist.colRef("drugmthdspccdnm")) = 95;
  2546. }
  2547. }
  2548. function fDelPrcp() {
  2549. for (i = 0; i < grd_prcpposlist.selectedRows; i++) {
  2550. model.setValue("/root/main/prcp/prcplist[" + grd_prcpposlist.selectedRow(i) + "]/status", 'D');
  2551. }
  2552. for (i = 1; i <= getNodesetCount("/root/main/prcp/prcplist"); i++) {
  2553. if (model.getValue("/root/main/prcp/prcplist[" + i + "]/status") == 'D') {
  2554. grd_prcpposlist.deleteRow(i, false);
  2555. i--;
  2556. }
  2557. }
  2558. model.refresh();
  2559. }
  2560. function fnZoneDisp() {
  2561. //응급의료센터(2280200000)인 경우
  2562. //병동정보대신에 구역정보가 보임)(20080620)
  2563. if ( !isNull(model.getValue("/root/code/codeinfo/codelist[cdgrupid ='002' and cdid ='"+combo1.value+"']/cdid")) ) {
  2564. caption15.visible = false;
  2565. cmb_room.visible = false;
  2566. cap_Zone.visible = true;
  2567. cmb_Zone.visible = true;
  2568. //20110830_KNUH_Start
  2569. //cmb_settingrn.visible = false;
  2570. //cap_settingrn.visible = false;
  2571. //20110830_KNUH_End
  2572. cmb_room.value = "-";
  2573. var zonecd = model.getValue("/root/main/paminfo/list/sectioncd");
  2574. if( !isNull(zonecd) && zonecd != "-" ){
  2575. cmb_Zone.value = model.getValue("/root/main/paminfo/list/sectioncd");
  2576. } else {
  2577. cmb_Zone.value = "-";
  2578. }
  2579. //cmb_settingrn.visible = false;
  2580. } else {
  2581. caption15.visible = true;
  2582. cmb_room.visible = true;
  2583. //cmb_settingrn.visible =true;
  2584. cap_Zone.visible = false;
  2585. cmb_Zone.visible = false;
  2586. cmb_Zone.value = "";
  2587. //20110830_KNUH_Start
  2588. //cmb_settingrn.visible = true;
  2589. //cap_settingrn.visible = true;
  2590. //20110830_KNUH_End
  2591. }
  2592. model.refresh();
  2593. }
  2594. /**
  2595. * @desc : KNUH, 처방복사 버튼 클릭하여 선택된 처방 리스트를 복사하는 기능
  2596. * @
  2597. * @param :
  2598. * @return :
  2599. * @author : JJE 2011. 2. 16
  2600. * @---------------------------------------------------
  2601. */
  2602. function fClickSetPrcpRows(){
  2603. var selectedRows = grd_prcplist.selectedRows;
  2604. var prcpPosListRows = grd_prcpposlist.rows;
  2605. var str = "";
  2606. if(selectedRows == 1 ){
  2607. fClickSetPrcp("btnclick");
  2608. return;
  2609. }
  2610. if (selectedRows > 0 ){
  2611. if (model.getValue("/root/main/cond/patnm") == ""){
  2612. messageBox("해당 환자를", "C002");
  2613. return;
  2614. }
  2615. if (grp_prcpapp.visible == true){
  2616. messageBox("처방적용일을 확인 후 진행하세요.", "C");
  2617. return;
  2618. }
  2619. if (model.getValue("/root/main/cond/homecareyn") == "Y" && model.getValue("/root/main/cond/visitdd") == "") {
  2620. // 방문일자를 선택하지 않은 경우 안내 메시지와 함께 방문일자가 처방당일로 자동 설정 되도록 요청에 의해 수정_김숙인ITC요청_20081215수정(ByJA)
  2621. var rtnval = messageBox("방문일을 선택하지 않으셨습니다. 방문일을 처방일과 동일하게 계속 진행하시겠습니까?", "S"); // return : yes=6, no=7
  2622. if(rtnval == "6"){ // yes
  2623. model.makeValue("/root/main/cond/visitdd", model.getValue("/root/main/cond/prcpdd"));
  2624. cmb_visitdd.refresh();
  2625. }else{
  2626. return;
  2627. }
  2628. }
  2629. for (i=0; i<selectedRows; i++){
  2630. var iRow = grd_prcplist.selectedrow(i);
  2631. //ALL SIZE 처방 처리
  2632. if(model.getValue(sPRCPSETLIST_PATH + "[" + iRow + "]/prcpclscd") == "M2" && model.getValue(sPRCPSETLIST_PATH + "[" + iRow + "]/matrallsizespecid") == "ALL") {
  2633. var grupsnglflag = model.getValue(sPRCPSETLIST_PATH + "[" + iRow + "]/grupsnglflag");
  2634. var calcscormastspec = (model.getValue(sPRCPSETLIST_PATH + "[" + iRow + "]/calcscormastspec")).split("|");
  2635. var matrsizeflag = calcscormastspec[2];
  2636. var matrallsizespecid = model.getValue(sPRCPSETLIST_PATH + "[" + iRow + "]/matrallsizespecid");
  2637. var xpt = window.screenleft + 100;
  2638. var ypt = window.screenTop + 50;
  2639. var coord = getRelativeCoordinate ( xpt, ypt );
  2640. var mon = coord[0];
  2641. xpt = coord[1];
  2642. ypt = coord[2];
  2643. setParameter("scrnflag", "nursprcp");
  2644. setParameter("grupsnglflag", 'S');
  2645. setParameter("calcscorcd", calcscormastspec[3]);
  2646. setParameter("matrallsizespecid", matrallsizespecid);
  2647. setParameter("currow", iRow);
  2648. setParameter("targetpath", "/root/main/prcp/prcplist");
  2649. //setParameter("targetgridid", "grd_prcpposlist");
  2650. modal("SPMNW11500", mon, xpt, ypt);
  2651. }else{
  2652. //처방 main grid로 약속처방 copy
  2653. mnwAddNursPrcp(sPRCPSETLIST_PATH, "/root/main/prcp", iRow, "");
  2654. fSetNursPrcpDefault(model.instances(0).selectNodes("/root/main/prcp/prcplist").length);
  2655. model.setValue(sPRCPLIST_PATH + "[" + prcpPosListRows + "]/status", "I"); //처방상태 : 신규
  2656. prcpPosListRows++;
  2657. }
  2658. fSetPrcpInfo("N");
  2659. // 16.10.10_심사팀 요청에 의한 추가
  2660. var sprcpcd = model.getValue(sPRCPSETLIST_PATH + "[" + iRow + "]/prcpcd");
  2661. model.makeValue("/root/send/reqdata/prcpcd", sprcpcd);
  2662. submit("TRMNW10923", false);
  2663. if (model.getValue("/root/temp/insulinfo/insulinfo/insulinfo") == "Y") {
  2664. str = str + sprcpcd + "," ;
  2665. }
  2666. // 16.09.27_심사팀 요청에 의한 추가_AYS
  2667. //if(model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/insulinfoyn") == "Y") {
  2668. // str = str + model.getValue(sPRCPSETLIST_PATH + "[" + iRow + "]/prcpcd") + ",";
  2669. //}
  2670. //신규처방은 반환컬럼 disable
  2671. /*grd_prcpposlist.isReadOnly(model.instances(0).selectNodes("/root/main/prcp/prcplist").length, grd_prcpposlist.colRef("tempcol8")) = true;
  2672. if ( model.getValue(sPRCPLIST_PATH + "[" + model.instances(0).selectNodes("/root/main/prcp/prcplist").length + "]/estmcls")!= "Y" ){
  2673. grd_prcpposlist.isReadOnly(model.instances(0).selectNodes("/root/main/prcp/prcplist").length, grd_prcpposlist.colRef("nigtprcpflag") ) = true;
  2674. }*/
  2675. } //end for
  2676. // 16.09.27_심사팀 요청에 의한 추가_AYS
  2677. if (str.length > 1) {
  2678. str = str.substr(0, str.length - 1);
  2679. messageBox("처방코드 " + str + "는 선별급여 품목이오니 보험기준 확인 후 저장바랍니다.", "E999");
  2680. }
  2681. model.refresh();
  2682. }
  2683. }
  2684. /**
  2685. * @desc : KNUH, 전처방복사 버튼 클릭하여 선택된 처방 리스트를 복사하는 기능
  2686. * @
  2687. * @param :
  2688. * @return :
  2689. * @author : JJE 2011. 2. 17
  2690. * @---------------------------------------------------
  2691. */
  2692. function fClickBfPrcpRows(){
  2693. var selectedRows = grd_bfprcplist.selectedRows;
  2694. var errRtnMsg = "";
  2695. var prcpPosListRows = grd_prcpposlist.rows;
  2696. if(selectedRows == 1 ){
  2697. fClickBfPrcp("btnclick");
  2698. return;
  2699. }
  2700. if (selectedRows > 0 ){
  2701. if (model.getValue("/root/main/cond/patnm") == "") {
  2702. messageBox("해당 환자를", "C002");
  2703. return;
  2704. }
  2705. if (grp_prcpapp.visible == true){
  2706. messageBox("처방적용일을 확인 후 진행하세요.", "C");
  2707. return;
  2708. }
  2709. //가정간호
  2710. if (model.getValue("/root/main/cond/homecareyn") == "Y"){
  2711. if (model.getValue("/root/main/cond/visitdd") == ""){
  2712. var rtnval = messageBox("방문일을 선택하지 않으셨습니다. 방문일을 처방일과 동일하게 계속 진행하시겠습니까?", "S"); // return : yes=6, no=7
  2713. if(rtnval == "6"){ // yes
  2714. model.makeValue("/root/main/cond/visitdd", model.getValue("/root/main/cond/prcpdd"));
  2715. cmb_visitdd.refresh();
  2716. }else{
  2717. return;
  2718. }
  2719. }
  2720. }
  2721. var cnt = 0;
  2722. var str = "";
  2723. for (i=0; i<selectedRows; i++){
  2724. var iRow = grd_bfprcplist.selectedrow(i);
  2725. var flag = model.getValue(sBFPRCPLIST_PATH + "[" + iRow + "]/flag");
  2726. var prcpcd = model.getValue(sBFPRCPLIST_PATH + "[" + iRow + "]/prcpcd");
  2727. if(flag == "N") {
  2728. if(cnt == 0) {
  2729. str = prcpcd
  2730. } else {
  2731. str +=", " + prcpcd;
  2732. }
  2733. cnt++;
  2734. }
  2735. var prcphistcd = model.getValue(sBFPRCPLIST_PATH + "[" + iRow + "]/prcphistcd");
  2736. if (prcphistcd == "L" || prcphistcd == "D" ) {
  2737. continue;
  2738. }else{
  2739. //방문일자와 다른 방문일의 처방 클릭시 blocking
  2740. if (model.getValue("/root/main/cond/homecareyn") == "Y"){
  2741. if (model.getValue("/root/main/cond/visitdd") == ""){
  2742. if (model.getValue("/root/main/cond/visitdd") != model.getValue(sBFPRCPLIST_PATH + "[" + iRow + "]/prcpdelivefact")){
  2743. //messageBox("방문일이 동일한 처방에 대해서만 일괄 저장이 가능합니다.", "C");
  2744. //return;
  2745. if(errRtnMsg != "") errRtnMsg = errRtnMsg + ", ";
  2746. errRtnMsg = errRtnMsg + model.getValue(sBFPRCPLIST_PATH + "[" + iRow + "]/prcpcd");
  2747. continue;
  2748. }
  2749. }
  2750. }
  2751. mnwAddNursPrcp(sBFPRCPLIST_PATH, "/root/main/prcp", iRow, "");
  2752. fSetNursPrcpDefault(model.instances(0).selectNodes("/root/main/prcp/prcplist").length);
  2753. model.setValue(sPRCPLIST_PATH + "[" + prcpPosListRows + "]/status", "B"); //처방상태[전]
  2754. prcpPosListRows++;
  2755. }
  2756. fSetPrcpInfo("N");
  2757. if ( model.getValue(sPRCPLIST_PATH + "[" + model.instances(0).selectNodes("/root/main/prcp/prcplist").length + "]/estmcls")!= "Y" ){
  2758. grd_prcpposlist.isReadOnly(model.instances(0).selectNodes("/root/main/prcp/prcplist").length, grd_prcpposlist.colRef("nigtprcpflag") ) = true;
  2759. }
  2760. } // end for
  2761. if(cnt > 0) {
  2762. messageBox("[" + str + "]처방은 수가가 종료되어 반환만 가능합니다.", "E");
  2763. }
  2764. model.refresh();
  2765. if(errRtnMsg != ""){
  2766. messageBox("방문일이 동일한 처방에 대해서만 일괄 저장이 가능합니다.\n" + errRtnMsg + "처방은 방문일이 동일하지 않습니다.", "C");
  2767. }
  2768. }
  2769. }
  2770. /**
  2771. * @desc : 20110626_KNUH 보조유형 체크하는 로직
  2772. * @
  2773. * @param :
  2774. * @return :
  2775. * @author : dark9258 2011. 6. 26
  2776. * @---------------------------------------------------
  2777. */
  2778. function fCheckSubKindCd() {
  2779. var prcpgenrflag = model.getValue("/root/main/patinfocond/patinfo/ordtype");
  2780. var pid = model.getValue("/root/main/paminfo/list/pid");
  2781. var indd = model.getValue("/root/main/paminfo/list/indd");
  2782. model.makeValue("/root/temp/send/pid", pid);
  2783. model.makeValue("/root/temp/send/indd", indd);
  2784. if(submit("TRMMO15701")){
  2785. var nodelist = model.instances(0).selectNodes("/root/temp/patsupkind/patsupkind");
  2786. if(nodelist != null) {
  2787. if(nodelist.length > 1){
  2788. clearParameter("SPMMO15700_subcretno");
  2789. modal("SPMMO15700", "", "", "", "SPMMO15700", "/root/temp/patsupkind", "/root/main/patsupkind");
  2790. var subcretno = getParameter("SPMMO15700_subcretno");
  2791. if(subcretno == "0") {
  2792. var rtn = messageBox("주유형으로 처방을 발행하시겠습니까?", "Q");
  2793. if(rtn != "6") {
  2794. return "false";
  2795. }
  2796. }
  2797. if(subcretno == null || subcretno == "") {
  2798. messageBox("유형을 선택하세요.", "E");
  2799. return "false";
  2800. }
  2801. model.makeValue("/root/temp/prcpinfo/subcretno", subcretno);
  2802. } else {
  2803. model.makeValue("/root/temp/prcpinfo/subcretno", "0");
  2804. }
  2805. } else {
  2806. model.makeValue("/root/temp/prcpinfo/subcretno", "0");
  2807. }
  2808. }
  2809. return "true";
  2810. }
  2811. //20110828_KNUH_Start
  2812. function fGetPatInfo() {
  2813. var settingnurid = model.getValue("/root/main/cond/settingrnid");
  2814. if(settingnurid == null || settingnurid == "") {
  2815. cmb_room.disabled = false;
  2816. } else {
  2817. cmb_room.disabled = true;
  2818. }
  2819. model.removeNodeset("/root/send/reqdata");
  2820. model.makeNode("/root/send/reqdata");
  2821. model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
  2822. model.makeValue("/root/send/reqdata/settingrnid", model.getValue("/root/main/cond/settingrnid"));
  2823. submit("TRMNW10902", false);
  2824. model.setValue("/root/main/cond/roomcd", "-"); //해당 병실 셋팅
  2825. cmb_room.refresh();
  2826. //해당 병실의 환자 조회
  2827. model.removeNodeset("/root/send/reqdata");
  2828. model.makeNode("/root/send/reqdata");
  2829. model.makeValue("/root/send/reqdata/orddd", model.getValue("/root/main/cond/prcpdd"));
  2830. model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
  2831. model.makeValue("/root/send/reqdata/roomcd", model.getValue("/root/main/cond/roomcd"));
  2832. model.makeValue("/root/send/reqdata/refflag", "room");
  2833. model.makeValue("/root/send/reqdata/ordtype", "I");
  2834. model.makeValue("/root/send/reqdata/settingrnid", model.getValue("/root/main/cond/settingrnid"));
  2835. if(spcldept == model.getValue("/root/main/cond/wardcd")) {
  2836. model.makeValue("/root/send/reqdata/spcldeptyn", "Y");
  2837. } else {
  2838. model.makeValue("/root/send/reqdata/spcldeptyn", "");
  2839. }
  2840. submit("TRMNW10903", false);
  2841. model.setValue("/root/main/cond/patnm", "");
  2842. model.setValue("/root/main/cond/pid", "");
  2843. cmb_patnm.refresh();
  2844. ipt_pid.refresh();
  2845. cap_prtlnm.refresh();
  2846. }
  2847. function fCalcScorHbookPrcp(){
  2848. fCalcScorHbook('prcp');
  2849. }
  2850. function fCalcScorHbookPrcppos(){
  2851. fCalcScorHbook('prcppos');
  2852. }
  2853. function fCalcScorHbookPrcpbf(){
  2854. fCalcScorHbook('bf');
  2855. }
  2856. function fClickEr(){
  2857. if(grd_prcpposlist.colRef("erprcpflag") == grd_prcpposlist.mouseCol){
  2858. if(grd_prcpposlist.valuematrix(grd_prcpposlist.row, grd_prcpposlist.colRef("erprcpflag")) == 'Y'){
  2859. grd_prcpposlist.valuematrix(grd_prcpposlist.row, grd_prcpposlist.colRef("drprcpetc10"))='Y';
  2860. }else{
  2861. grd_prcpposlist.valuematrix(grd_prcpposlist.row, grd_prcpposlist.colRef("drprcpetc10"))='N';
  2862. }
  2863. }
  2864. }
  2865. function fprtlnm(pid){
  2866. model.makeValue("/root/send/reqdata/pid", pid);
  2867. submit("TRMNW10911");
  2868. }
  2869. //20110828_KNUH_End
  2870. /**
  2871. * @desc : 보험기준 조회
  2872. * @
  2873. * @param :
  2874. * @return :
  2875. * @author : AYS_16.09.26_본원 심사과 요청
  2876. * @---------------------------------------------------
  2877. */
  2878. function fOpenInsuInfo() {
  2879. prcpcd = model.getValue(sPRCPSETLIST_PATH +"[" + grd_prcplist.row + "]/prcpcd")
  2880. model.makeValue("/root/temp/setparma/prcpcd", prcpcd);
  2881. modal("SPPIZ01600", "1", "400", "400", "", "/root/temp/setparma/prcpcd" , "/root/send/item3/calcscorcd");
  2882. model.removenode("/root/temp/picmmech");
  2883. model.removenode("/root/temp/setparma");
  2884. }