123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393 |
- /*
- - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
- 간호처방 ( SMMNW10900_간호처방.xrw - JScript )
- - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
- */
- var sPATINFO_PATH = "/root/main/patinfocond/patinfo"; //환자정보
- var sLRGSETLIST_PATH = "/root/main/prcplistinfo/anolrgsetinfo/lrgsetlist"; //대분류 그리드
- var sSMLSETLIST_PATH = "/root/main/prcplistinfo/anosmlsetinfo/smlsetlist"; //소분류 그리드
- var sPRCPSETLIST_PATH = "/root/main/prcpset/prcplist"; //간호약속 처방
- var sTEMPPRCPLIST_PATH = "/root/main/tempprcp/prcplist"; //임시처방
- var sBFPRCPLIST_PATH = "/root/main/bfprcp/prcplist"; //전처방
- var sPRCPLIST_PATH = "/root/main/prcp/prcplist"; //간호처방
- var sSIGNDATA_PATH = "/root/main/signdata/signprcplist"; //인증데이터
- var sSIGNTEMPDATA_PATH = "/root/main/signdata/signtempprcplist"; //인증데이터(임시처방)
- var homecarecenterdeptcd, homecareteamdeptcd;
- var signtime = "";
- var vsettime = "";
- var vsetdate = "";
- var spcldept = "";
- /**
- * @desc : 화면 초기화
- * @
- * @param :
- * @return :
- * @author : 성미연
- * @---------------------------------------------------
- */
- function fInit(){
- //간호처방 도움말 기능 칠곡만 보이도록 2013.07.15 KJS
- var sInstcd = getUserInfo("dutplceinstcd");
- var sDutplcecd = getUserInfo("dutplcecd");
-
- if (sInstcd == "032" || sDutplcecd == "3050135000") {
- btn_help.visible = true;
- } else {
- btn_help.visible = false;
- }
-
- if (sInstcd == "031" && sDutplcecd == "3050135000") {
- btn_crrt.visible = true;
- } else {
- btn_crrt.visible = false;
- }
-
- var settingnurid=""; //내환자 setting변수
-
- zesfInitSign(); //인증 모듈 초기화
-
- // 간호하드코딩 테이블 조회_20090416(ByJA)
- //----------(20110118) 경북대
- //var pCode = "'047', '048','002','195','207'"; // 조회할 CdGrupID 코드정보 002 : 응급의료센터 추가 (야간가산은 응급의료센터만 세팅)20091214 김홍점
- var pCode = "'003', '047', '048','002','195','207','016','T84','202','I09'"; //마취회복실추가 '046':영상의학과 추가. 'T84':인증저장팝업.
- var machideptcd = "";
- //----------(20110118) 경북대
-
- var pDate = getCurrentDate(); // 조회기준일자
- fGetNursHardCdInfo(pCode, pDate);
-
- for(var i=1; i<=getNodesetCount("/root/code/codeinfo/codelist"); i++){
- switch (model.getValue("/root/code/codeinfo/codelist["+i+"]/cdgrupid")){
- case "202": //대차여부
- cartcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
- break;
- case "047": // 가정간호센터
- homecarecenterdeptcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
- break;
- case "048": // 가정간호팀
- homecareteamdeptcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
- break;
- case "016": // 마취회복실
- machideptcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
- break;
- case "T84":
- signtime = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
- break;
- }
- }
-
- spcldept = model.getValue("/root/code/codeinfo/codelist[cdgrupid='003']/cdid");
-
- if(cartcd != 'Y'){
- grd_prcpposlist.colHidden(grd_prcpposlist.colRef("drprcpetc10")) = true;
- grd_bfprcplist.colHidden(grd_bfprcplist.colRef("drprcpetc10")) = true;
- }
-
- // 응급실 24시간 이내 환자 응급 가산을 위해 주석 처리 2016.01.01 엄영만
- //if(getUserInfo("dutplceinstcd") == "031") {
- // grd_prcpposlist.colHidden(grd_prcpposlist.colRef("erprcpflag")) = true;
- //}
-
- model.removeNodeset(sLRGSETLIST_PATH);
- model.removeNodeset(sSMLSETLIST_PATH);
- model.removeNodeset(sPRCPSETLIST_PATH);
- model.removeNodeset(sTEMPPRCPLIST_PATH);
- model.removeNodeset(sBFPRCPLIST_PATH);
- model.removeNodeset(sPRCPLIST_PATH);
-
- //콤보리스트 셋팅(급비, 처방분류)
- 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);
- addComboItem("cmb_listclscd", "전체", "ALL", "above" );
- model.setValue("/root/main/srchcond/srchclscd", "ALL");
- model.setValue("/root/main/bfprcpinfo/bfcond/srchclscd", "ALL");
- model.setValue("/root/main/tempprcpinfo/tempcond/srchclscd", "ALL");
-
- //초기 셋팅값
- model.setValue("/root/main/cond/prcpdd", getCurrentDate()); //처방일
- model.setValue("/root/main/bfprcpinfo/bfcond/prcpfromdd", model.getValue("/root/main/cond/prcpdd").toDate().getAddDate(-7, "D").getDateFormat()); //전처방
- model.setValue("/root/main/bfprcpinfo/bfcond/prcptodd", model.getValue("/root/main/cond/prcpdd"));
-
- // 간호환경설정 테이블 조회_20110215
- // var pCode = "'002'"; // 조회할 CdGrupID 코드정보
- // var pDate = getCurrentDate(); //조회기준일자
- // fGetNursHardCdInfo(pCode, pDate);
- //설정된 상단정보를 불러옴
- model.makeNode("/root/main/paminfo");
- var node = getGlobalVariable("paminfo");
- setCSVToNode("/root/main/paminfo", node);
-
- if (model.getValue("/root/main/paminfo/list/pid") != "") { //상단정보에 환자가 셋팅되어 있을 경우
- model.makeValue("/root/main/cond/upinfoyn", "Y");
- //patinfo 정보 셋팅
- if (model.getValue("/root/main/paminfo/list/ioflag") == 'O') {
- var centcd = model.getValue("/root/main/paminfo/list/centcd");
-
- if(centcd == "-" || centcd == "") {
- model.setValue("/root/main/cond/wardcd" , model.getValue("/root/main/paminfo/list/orddeptcd"));
- } else {
- model.setValue("/root/main/cond/wardcd" , centcd);
- }
- // model.setValue("/root/main/cond/wardcd" , model.getValue("/root/main/paminfo/list/orddeptcd"));
- model.setValue(sPATINFO_PATH + "/wardcd" , model.getValue("/root/main/paminfo/list/orddeptcd"));
- model.setValue(sPATINFO_PATH + "/orddd" , model.getValue("/root/main/paminfo/list/orddd"));
- model.setValue(sPATINFO_PATH + "/acptseqno" , model.getValue("/root/main/paminfo/list/acptseqno"));
- model.setValue(sPATINFO_PATH + "/orddrid" , model.getValue("/root/main/paminfo/list/orddrid"));
- model.setValue(sPATINFO_PATH + "/clincstdyflag", model.getValue("/root/main/paminfo/list/clincstdyacptflag"));
- model.setValue(sPATINFO_PATH + "/clincstdycd" , model.getValue("/root/main/paminfo/list/clincstdyno"));
- model.makeValue(sPATINFO_PATH + "/dschnotiyn" , "N"); // 간호사퇴원확정여부_20080807추가(ByJA)
- model.makeValue(sPATINFO_PATH + "/careinrmyn" , "Y"); // 입실확인여부 체크 외래는 비교대상이 아니므로 무조건 Y 20090908 khj
- } else {
- model.setValue("/root/main/cond/wardcd" , model.getValue("/root/main/paminfo/list/wardcd"));
- model.setValue(sPATINFO_PATH + "/wardcd" , model.getValue("/root/main/paminfo/list/wardcd"));
- model.setValue(sPATINFO_PATH + "/roomcd" , model.getValue("/root/main/paminfo/list/roomcd"));
- model.setValue(sPATINFO_PATH + "/indd" , model.getValue("/root/main/paminfo/list/indd"));
- model.setValue(sPATINFO_PATH + "/orddrid" , model.getValue("/root/main/paminfo/list/medispclid"));
- model.setValue(sPATINFO_PATH + "/clincstdyflag", model.getValue("/root/main/paminfo/list/clincstdyyn"));
- model.setValue(sPATINFO_PATH + "/clincstdycd" , model.getValue("/root/main/paminfo/list/clincstdycd"));
- model.makeValue(sPATINFO_PATH + "/dschnotiyn" , model.getValue("/root/main/paminfo/list/dschnotiyn")); // 간호사퇴원확정여부_20080807추가(ByJA)
- if ( model.getValue("/root/main/paminfo/list/ioflag") == 'E' && model.getValue("/root/main/paminfo/list/calcdd") != '-' ){
- model.makeValue(sPATINFO_PATH + "/careinrmyn" ,'Y');// 입실확인여부 체크 20090908 khj
- } else if ( model.getValue("/root/main/paminfo/list/ioflag") != 'E' && model.getValue("/root/main/paminfo/list/careinrmdd") != '-' ){
- model.makeValue(sPATINFO_PATH + "/careinrmyn" ,'Y');// 입실확인여부 체크 20090908 khj
- } else {
- model.makeValue(sPATINFO_PATH + "/careinrmyn" ,'N');// 입실확인여부 체크 20090908 khj
- }
- }
-
- model.setValue(sPATINFO_PATH + "/pid" , model.getValue("/root/main/paminfo/list/pid"));
- model.setValue(sPATINFO_PATH + "/patnm" , model.getValue("/root/main/paminfo/list/hngnm"));
- model.setValue(sPATINFO_PATH + "/cretno" , model.getValue("/root/main/paminfo/list/cretno"));
- model.setValue(sPATINFO_PATH + "/orddeptcd", model.getValue("/root/main/paminfo/list/orddeptcd"));
- model.setValue(sPATINFO_PATH + "/ordtype" , model.getValue("/root/main/paminfo/list/ioflag"));
- model.setValue(sPATINFO_PATH + "/sexage" , model.getValue("/root/main/paminfo/list/sex") + "/" + model.getValue("/root/main/paminfo/list/age"));
- model.setValue(sPATINFO_PATH + "/insukind" , model.getValue("/root/main/paminfo/list/insukind"));
- model.setValue(sPATINFO_PATH + "/specordyn", model.getValue("/root/main/paminfo/list/specordyn"));
- model.setValue(sPATINFO_PATH + "/instcd" , model.getValue("/root/main/paminfo/list/instcd"));
-
- ////20110828_KNUH_Start 내환자setting정보 조회.
- fGetSettringInfoRef();
-
- //내환자셋팅정보가 있으면 set,없으면 그냥 null
- settingnurid = model.getValue("/root/init/settinginfo/settingrn[settingrnid='" + getUserInfo("userid") +"']/settingrnid");
-
- if(settingnurid == null || settingnurid == "") {
-
- } else {
- model.setValue(cmb_settingrn.attribute("ref"), getUserInfo("userid"));
- cmb_settingrn.refresh();
- }
- //20110828_KNUH_End
- } else {
- // chk_clincstdy.disabled = true;
- // model.setValue("/root/main/cond/clincstdyflag", "N");
- model.setValue("/root/main/cond/wardcd", getUserInfo("dutplcecd")); //상단정보가 없을 경우 간호사 소속부서
-
- //20110828_KNUH_Start 환자setting정보 조회
- fGetSettringInfoRef();
-
- settingnurid = model.getValue("/root/init/settinginfo/settingrn[settingrnid='" + getUserInfo("userid") +"']/settingrnid");
-
-
- //내환자셋팅정보가 있으면 set,없으면 그냥 null
- if(settingnurid == null || settingnurid == "") {
-
- } else {
- model.setValue(cmb_settingrn.attribute("ref"), getUserInfo("userid"));
- cmb_settingrn.refresh();
- }
- //20110828_KNUH_End
- }
-
- submit("TRMNW11001", false); //부서콤보 조회
- if(getScreenMenuParameter() == "SMMNH" || opener.javascript.getParameter("screenParam") == "SMMNH"){
- model.setValue("/root/main/cond/homecareyn", "Y");
- }
- //20110215 이선경 : 경북대 - 응급실일 경우 구역정보를 조회
- fGetZoneList();
- fnZoneDisp();
- fRoomInfoRef("init"); //해당병동의 해당병실조회
-
- if(settingnurid == null || settingnurid=="") {
- cmb_room.disabled = false;
- } else {
- cmb_room.disabled = true;
- fPatInfoRef("I");
- }
-
- cmb_userpos.disabled = true;
- fChkClincstdy(); //임상연구 체크 20100727 환자정보 최종 카피되고 나서 세팅해야하므로 위치 옮기면 안됌.
- //가정간호처방일 경우 방문일자 셋팅
- if(getScreenMenuParameter() == "SMMNH" || opener.javascript.getParameter("screenParam") == "SMMNH"){
- model.setValue("/root/main/prcpposinfo/cond/poscd" , "2"); // 처방위치_2:User위치
- model.setValue("/root/main/prcpposinfo/cond/deptcd", homecarecenterdeptcd); // User위치코드_2361000000:가정간호센터_강남성모,서울성모병원
- if(cmb_userpos.label == ""){
- model.setValue("/root/main/prcpposinfo/cond/deptcd", homecareteamdeptcd); // User위치코드_3090100000:가정간호팀_강남성모,서울성모병원
- }
- cmb_userpos.disabled = false;
- fSearchHomePatInfo(); // 방문일자 조회_추가(20090331_ByJA)
- } else if(getScreenMenuParameter() == "SMMND"){ //인공신장일 경우 처방위치 user위치로_20081015(byJA_소경화ITC요청)
- model.setValue("/root/main/prcpposinfo/cond/poscd" , "2"); // 처방위지_2:User위치
- model.setValue("/root/main/prcpposinfo/cond/deptcd", getUserInfo("dutplcecd")); //소속부서
- cmb_userpos.disabled = false;
- } else if(getScreenMenuParameter() == "SMAEA" || opener.javascript.getParameter("screenParam") == "SMAEA"){ //간호기능파트(내시경실, 부정맥검사실, 간크리닉, 기관지경실, 심장초음파실) 경우 처방위치 user위치로_20081208(ByJA)
- model.setValue("/root/main/prcpposinfo/cond/poscd" , "2"); // 처방위지_2:User위치
- model.setValue("/root/main/prcpposinfo/cond/deptcd", getUserInfo("dutplcecd")); //소속부서
- cmb_userpos.disabled = false;
- } else if(machideptcd == getUserInfo("dutplcecd") ){ //-------------(20110118) 경북대 간호기능파트(마취회복실) 경우 처방위치 user위치
- model.setValue("/root/main/prcpposinfo/cond/poscd" , "2"); // 처방위지_2:User위치
- model.setValue("/root/main/prcpposinfo/cond/deptcd", getUserInfo("dutplcecd")); //소속부서
- cmb_userpos.disabled = false;
- } //-------------(20110118) 경북대
- cmb_userpos.refresh();
-
- if (model.getValue("/root/main/cond/homecareyn") == "Y"){
- cap_visitdd.visible = true;
- cmb_visitdd.visible = true;
- grd_prcpposlist.valueMatrix(0, grd_prcpposlist.colRef("prcpdelivefact")) = "방문일자";
- grd_bfprcplist.valueMatrix(0, grd_prcpposlist.colRef("prcpdelivefact")) = "방문일자";
- cmb_bfcond.choices.itemset.attribute("nodeset") = "/root/init/homebfcondinfo/homebfcond";
- }else{
- cap_visitdd.visible = false;
- cmb_visitdd.visible = false;
- grd_prcpposlist.valueMatrix(0, grd_prcpposlist.colRef("prcpdelivefact")) = "적용일자";
- grd_bfprcplist.valueMatrix(0, grd_prcpposlist.colRef("prcpdelivefact")) = "적용일자";
- cmb_bfcond.choices.itemset.attribute("nodeset") = "/root/init/bfcondinfo/bfcond";
- }
-
- //*** 처방목록
- model.makeValue("/root/send/reqdata/comnrefflag", 'Y');
- submit("TRMNW10901", false); //set부서콤보 조회(공통 포함)
- if(getScreenMenuParameter() == "SMMNH" || opener.javascript.getParameter("screenParam") == "SMMNH"){
- model.setValue("/root/main/prcplistinfo/setcond/settrgtcd", homecarecenterdeptcd); // User위치코드_2361000000:가정간호센터_강남성모,서울성모병원
- if(cmb_dept.label == ""){
- model.setValue("/root/main/prcplistinfo/setcond/settrgtcd", homecareteamdeptcd); // User위치코드_3090100000:가정간호팀_강남성모,서울성모병원
- }
- }else{
- model.setValue("/root/main/prcplistinfo/setcond/settrgtcd", getUserInfo("dutplcecd")); //소속부서
- }
- cmb_dept.refresh();
-
- if (model.getValue("/root/init/deptinfo/deptlist[deptcd = '"+ model.getValue("/root/main/prcplistinfo/setcond/settrgtcd") + "']/deptcd") == "") {
- model.setValue("/root/main/prcplistinfo/setcond/settrgtcd", 'ALL'); //소속부서 없을 경우 공통으로 셋팅
- }
- model.setValue("/root/main/prcplistinfo/setcond/setclscd", 'W');
- model.setValue("/root/main/prcplistinfo/setcond/settypecd", 'P');
- model.setValue("/root/main/prcplistinfo/setcond/setkindcd", 'D');
-
- fLrgSetRef(); //대분류 set조회
- // fReqBfNursPrcpInfo(); //전처방 조회
- // fReqTempNursPrcpInfo(); //임시처방 조회
- var pid = model.getValue("/root/main/cond/pid");
- if(pid != ""){
- fprtlnm(pid);
- }
- }
- /**
- * @desc : 부서조건에 따른 병실 조회
- * @
- * @param :initflag ="init" 초기화
- * @return :
- * @author : 성미연
- * @---------------------------------------------------
- */
- function fRoomInfoRef(initflag) {
- model.removeNodeset("/root/init/roominfo/room/roomcd");
- model.resetInstanceNode("/root/main/cond/patnm");
- model.resetInstanceNode("/root/main/cond/pid");
-
- model.removeNodeset(sPRCPLIST_PATH);
- model.removeNodeset(sTEMPPRCPLIST_PATH);
- model.removeNodeset(sBFPRCPLIST_PATH);
-
- var settingrnid = model.getValue("/root/main/cond/settingrnid");
-
- var deptflag = model.getValue("/root/init/deptinfo/deptlist[deptcd = '" + model.getValue("/root/main/cond/wardcd") + "']/deptflag");
- if (deptflag == 'I') { //해당병동의 해당병실조회
- cmb_room.disabled = false;
- model.removeNodeset("/root/send/reqdata");
- model.makeNode("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
- model.makeValue("/root/send/reqdata/settingrnid", model.getValue("/root/main/cond/settingrnid"));
-
- if (submit("TRMNW10902", false)) {
- if (model.getValue("/root/main/cond/upinfoyn") == "Y") { //상단정보에 환자가 셋팅되어 있을 경우
-
- //20110828_KNUH_Start
- if(settingrnid == null || settingrnid == "") {
- model.setValue("/root/main/cond/roomcd", model.getValue("/root/main/paminfo/list/roomcd"));
- } else {
- model.setValue("/root/main/cond/roomcd", "-");
- }
- //20110828_KNUH_End
- fPatInfoRef("I",initflag);
- } else {
- model.setValue("/root/main/cond/roomcd", "-");
- model.removeNodeset("/root/init/patinfo/patlist");
-
- }
- }
- } else { //외래과 환자 조회
- cmb_room.disabled = true;
- fPatInfoRef("O", initflag);//병동은 상관없고 외래인경우 내시경실의 경우 상단정보대로 처방발생20100409 변경협의체결과 나오기전까지 임시 khj ->16040 요청번호에 의해 당일수진에만 처방발생하도록 함. 20100715 김홍점
- }
- model.refresh();
- }
- //20110828_KNUH_Start 환자setting정보 조회
- function fGetSettringInfoRef() {
- model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd") );
- submit("TRMNW10910");
-
- cmb_settingrn.refresh();
- }
- /**
- * @desc : 병실별 환자리스트 조회, 부서별 환자리스트 조회
- * @
- * @param :
- * @return :
- * @author : 성미연
- * @---------------------------------------------------
- */
- function fPatInfoRef(deptflag, initflag) {
-
- var settingnurid="";
-
- settingnurid = model.getValue("/root/main/cond/settingrnid");
-
- model.resetInstanceNode("/root/main/cond/pid");
- model.resetInstanceNode("/root/main/cond/patnm");
-
- model.removeNodeset(sPRCPLIST_PATH);
- model.removeNodeset(sTEMPPRCPLIST_PATH);
- model.removeNodeset(sBFPRCPLIST_PATH);
-
- model.removeNodeset("/root/send/reqdata");
- model.makeNode("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/orddd", model.getValue("/root/main/cond/prcpdd"));
- model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
-
- var centcd = model.getValue("/root/main/paminfo/list/centcd");
-
- if(centcd != "-" && centcd != "") {
- model.makeValue("/root/send/reqdata/centflag", "Y");
- }
-
- model.makeValue("/root/send/reqdata/settingrnid", model.getValue("/root/main/cond/settingrnid"));
-
- if (deptflag == "I") { //병실별 환자조회
-
- //20110828_KNUH_Start
- if(settingnurid == null || settingnurid == "") {
- model.makeValue("/root/send/reqdata/roomcd", model.getValue("/root/main/cond/roomcd"));
- } else {
- model.makeValue("/root/send/reqdata/roomcd", "-");
- }
- //20110828_KNUH_End
-
- model.makeValue("/root/send/reqdata/refflag", "room");
- model.makeValue("/root/send/reqdata/ordtype", "I");
- model.makeValue("/root/send/reqdata/zonecd", model.getValue("/root/main/cond/zonecd"));
- model.makeValue("/root/send/reqdata/settingrnid", model.getValue("/root/main/cond/settingrnid"));
-
- } else { //외래부서 환자조회
- model.makeValue("/root/send/reqdata/refflag", "dept");
- model.makeValue("/root/send/reqdata/ordtype", "O");
- model.makeValue("/root/send/reqdata/homecareyn", model.getValue("/root/main/cond/homecareyn"));
- }
-
- if(spcldept == model.getValue("/root/main/cond/wardcd")) {
- model.makeValue("/root/send/reqdata/spcldeptyn", "Y");
- } else {
- model.makeValue("/root/send/reqdata/spcldeptyn", "");
- }
-
- if (submit("TRMNW10903", false)) {
-
-
- if (model.getValue("/root/main/cond/upinfoyn") == "Y") { //상단정보에 환자가 셋팅되어 있을 경우
-
- model.setValue("/root/main/cond/patnm", model.getValue("/root/main/paminfo/list/pid"));
- model.setValue("/root/main/cond/pid", model.getValue("/root/main/paminfo/list/pid"));
-
- //가정간호 환자인 경우 방문일자 조회
- if(model.getValue("/root/main/cond/homecareyn") == "Y") {
- fSearchHomePatInfo();
- }
-
- } else {
- model.setValue("/root/main/cond/patnm", "");
- model.setValue("/root/main/cond/pid", "");
- }
- }
-
- var pid=model.getValue("/root/main/cond/pid");
- //병동은 상관없고 외래인경우 내시경실의 경우 상단정보대로 처방발생20100409 변경협의체결과 나오기전까지 임시 khj
- //->16040 요청번호에 의해 당일수진에만 처방발생하도록 함. 20100715 김홍점
- // if ( (getScreenMenuParameter() == "SMAEA" || opener.javascript.getScreenID() == "SMAEA01500" )
- // && deptflag == "O"
- // && initflag == "init"
- // || deptflag == "I"){////병동은 퇴원환자도 전처방은 조회되어야 함.
- if ( initflag == "init" && deptflag == "I"){////병동은 퇴원환자도 전처방은 조회되어야 함.
- if ( !isNull(model.getValue("/root/init/patinfo/patlist[pid = '" + pid + "']/pid"))) {
- //환자정보조건 셋팅
- model.copyNode("/root/main/patinfocond/patinfo", "/root/init/patinfo/patlist[pid = '" + pid + "']");
- }
- fReqBfNursPrcpInfo(); //전처방 조회
- fReqTempNursPrcpInfo(); //임시처방 조회
-
- }else{
- fChgPatnm(deptflag, model.getValue("/root/main/cond/prcpdd"),initflag);
- }
-
- model.refresh();
- }
- /**
- * @desc : 환자아이디로 해당부서, 병실, 환자명 조회
- * @
- * @param :
- * @return :
- * @author : 성미연
- * @---------------------------------------------------
- */
- function fSearchPatInfo() {
- if(event.keycode == "13"){
- model.setFocus("btn_ref");
-
- //그리드 초기화
- model.removeNodeset(sPRCPLIST_PATH);
- model.removeNodeset(sTEMPPRCPLIST_PATH);
- model.removeNodeset(sBFPRCPLIST_PATH);
-
- //환자아이디로 현재 상태 조회
- var pid = model.getValue("/root/main/cond/pid");
- model.removeNodeset("/root/send/reqdata");
- model.makeNode("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/orddd", model.getValue("/root/main/cond/prcpdd"));
- model.makeValue("/root/send/reqdata/pid", model.getValue("/root/main/cond/pid"));
- model.makeValue("/root/send/reqdata/refflag", "pat");
- model.makeValue("/root/send/reqdata/homecareyn", model.getValue("/root/main/cond/homecareyn"));
- if (submit("TRMNW10904")) {
- if (model.getValue("/root/main/patinfocond/patinfo/wardcd") == 'err') {
- messageBox("해당 환자 정보가 존재하지 않습니다.", "I");
- model.setValue("/root/main/cond/patnm", model.getValue("/root/init/patinfo/patlist/pid"));
- model.setFocus("ipt_pid");
- model.refresh();
- return;
-
- } else {
- btn_signsave.disabled = false;
- //해당 부서 셋팅
- if (getNodesetCount("/root/main/patinfocond/patinfo") > 1 ) {
- modal("SPMNW11800", 1, 100, 100, "SPMNW11800", "/root/main/patinfocond", "/root/main/patinfocond");
- }
- model.setValue("/root/main/cond/wardcd", model.getValue("/root/main/patinfocond/patinfo/wardcd"));
-
- 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') {
- cmb_room.disabled = false;
-
- //해당 병동의 병실 조회
- model.removeNodeset("/root/send/reqdata");
- model.makeNode("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
- submit("TRMNW10902", false);
- model.setValue("/root/main/cond/roomcd", model.getValue("/root/main/patinfocond/patinfo/roomcd")); //해당 병실 셋팅
-
- //해당 병실의 환자 조회
- model.removeNodeset("/root/send/reqdata");
- model.makeNode("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/orddd", model.getValue("/root/main/cond/prcpdd"));
- model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
- model.makeValue("/root/send/reqdata/roomcd", model.getValue("/root/main/cond/roomcd"));
- model.makeValue("/root/send/reqdata/refflag", "room");
- model.makeValue("/root/send/reqdata/ordtype", "I");
- model.makeValue("/root/send/reqdata/settingrnid", model.getValue("/root/main/cond/settingrnid"));
-
- if(spcldept == model.getValue("/root/main/cond/wardcd")) {
- model.makeValue("/root/send/reqdata/spcldeptyn", "Y");
- } else {
- model.makeValue("/root/send/reqdata/spcldeptyn", "");
- }
- submit("TRMNW10903", false);
-
- //20110216 경북대 : 응급실 구역 매핑
- model.makeValue("/root/main/cond/zonecd", model.getValue("/root/main/patinfocond/patinfo/zonecd"));
-
- } else {
- model.removeNodeset("/root/init/roominfo/room/roomcd");
- cmb_room.disabled = true;
-
- //해당 부서(진료과)의 환자 조회
- model.removeNodeset("/root/send/reqdata");
- model.makeNode("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/orddd", model.getValue("/root/main/cond/prcpdd"));
- model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
- model.makeValue("/root/send/reqdata/refflag", "dept");
- model.makeValue("/root/send/reqdata/ordtype", "O");
- model.makeValue("/root/send/reqdata/homecareyn", model.getValue("/root/main/cond/homecareyn"));
-
- if(spcldept == model.getValue("/root/main/cond/wardcd")) {
- model.makeValue("/root/send/reqdata/spcldeptyn", "Y");
- } else {
- model.makeValue("/root/send/reqdata/spcldeptyn", "");
- }
-
- submit("TRMNW10903", false);
-
- //가정간호 환자인 경우 방문일자 조회
- if(model.getValue("/root/main/cond/homecareyn") == "Y") {
- fSearchHomePatInfo();
- }
- }
- //환자정보조건 셋팅
- model.copyNode("/root/main/patinfocond/patinfo", "/root/init/patinfo/patlist[pid = '" + pid + "']");
- model.setValue("/root/main/cond/patnm", model.getValue("/root/main/patinfocond/patinfo/pid")); //해당 환자명 셋팅
-
-
- fChkClincstdy(); //임상연구 체크
- fReqBfNursPrcpInfo(); //전처방 조회
- fReqTempNursPrcpInfo(); //임시처방 조회
- }
- }
- }
- }
- /**
- * @desc : 조회조건 환자명 변경시
- * @
- * @param :
- * @return :
- * @author : 성미연
- * @---------------------------------------------------
- */
- function fChgPatnm(deptflag, prcpdd, initflag) {
- btn_signsave.disabled = false;
-
- model.removeNodeset(sPRCPSETLIST_PATH); //SET처방 조회하는 시점에 spynpy1를 조회하기 위한 insukind를 넘겨줘야 함(환자별로 다름)
- model.removeNodeset(sPRCPLIST_PATH);
- var pid = model.getValue("/root/main/cond/patnm");
- model.setValue("/root/main/cond/pid", pid);
-
- if ( isNull(model.getValue("/root/init/patinfo/patlist[pid = '" + pid + "']/pid"))) {
-
- if (initflag =="init"
- && deptflag == "O"
- && model.getValue(sPATINFO_PATH + "/orddd") != prcpdd
- && model.getValue("/root/main/cond/upinfoyn") =="Y" ) { //화면오픈시 외래수진일자와 처방일자가 다를경우 블러킹메시지.20100727 김홍점 김숙인itc요청
-
- messageBox("진료일["+model.getValue(sPATINFO_PATH + "/orddd")+"]과 처방일자가 달라 처방발행이 불가능합니다", "I");
- btn_signsave.disabled = true;
- if ( !isNull(model.getValue("/root/main/cond/patnm")) ) {
- fReqBfNursPrcpInfo(); //전처방 조회
- fReqTempNursPrcpInfo(); //임시처방 조회
- }
- return;
- }else {
- model.resetInstanceNode("/root/main/cond/pid");
- }
- }
- ipt_pid.refresh();
-
- if (model.getValue("/root/init/patinfo/patlist[pid = '" + pid + "']/elbulbodstat") == '0') { //M0062 전광판상태
- messageBox("해당 과에 간호접수되지 않은 환자입니다.", "I");
- }
- //환자정보조건 셋팅
- model.copyNode(sPATINFO_PATH, "/root/init/patinfo/patlist[pid = '" + pid + "']");
- //가정간호 환자인 경우 방문일자 조회
- if(model.getValue("/root/main/cond/homecareyn") == "Y") {
- fSearchHomePatInfo();
- }
-
-
-
- fChkClincstdy(); //임상연구 체크
- if ( !isNull(model.getValue("/root/main/cond/patnm")) && !isNull(model.getValue("/root/main/cond/pid")) ) {
- fReqBfNursPrcpInfo(); //전처방 조회
- fReqTempNursPrcpInfo(); //임시처방 조회
- }
-
- // 항암프로토콜명 조회
- if(pid != ""){
- fprtlnm(pid);
- }
- }
-
-
- /**
- * @desc : 가정간호 환자의 소속 정보 조회(방문일자 포함)
- * @
- * @param :
- * @return :
- * @author : 성미연
- * @---------------------------------------------------
- */
- function fSearchHomePatInfo() {
- //해당 환자의 방문일자 조회 : 방문일자에 따라 원무정보가 달라짐
- model.removeNodeset("/root/send/reqdata");
- model.makeNode("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/pid", model.getValue("/root/main/cond/pid"));
-
- submit("TRMNW10909");
-
- }
- /**
- * @desc : 방문일자 변경시 환자정보 셋팅
- * @
- * @param :
- * @return :
- * @author : 성미연
- * @---------------------------------------------------
- */
- function fChgVisitDD() {
- var visitdd = model.getValue("/root/main/cond/visitdd");
- var prcpvisitdd = model.getValue(sPRCPLIST_PATH + "/prcpdelivefact");
-
- if(prcpvisitdd != ""){
- if(visitdd != prcpvisitdd){
- messageBox("방문일이 동일한 처방에 대해서만 일괄 저장이 가능합니다.", "C");
- model.setValue("/root/main/cond/visitdd", prcpvisitdd);
- cmb_visitdd.refresh();
- return;
- }
- }
- //model.copyNode("/root/main/patinfocond/patinfo", "/root/init/homepatinfo/patlist[orddd = '" + visitdd + "']");
- model.refresh();
- }
- /**
- * @desc : 환자에 따른 임상연구 체크
- * @
- * @param :
- * @return :
- * @author : 성미연
- * @---------------------------------------------------
- */
- function fChkClincstdy() {
- //clincstdyacptflag : otpt(N:임상시험접수아님, P:사람임상 A:동물임상), inpt(임상연구여부)
-
- if( !isNull(model.getValue(sPATINFO_PATH + "/clincstdyflag"))
- && model.getValue(sPATINFO_PATH + "/clincstdyflag") != "N"){
- chk_clincstdy.disabled = false;
- model.setValue("/root/main/cond/clincstdyflag", "Y");
- }else{
- chk_clincstdy.disabled = true;
- model.setValue("/root/main/cond/clincstdyflag", "N");
- }
- }
-
- /**
- * @desc : 대분류 SET 조회
- * @
- * @param :
- * @return :
- * @author : 성미연
- * @---------------------------------------------------
- */
- function fLrgSetRef() {
- if (model.getValue("/root/main/prcplistinfo/setcond/settrgtcd") != "") {
- if (model.getValue("/root/main/prcplistinfo/setcond/settrgtcd") == 'ALL') { //공통일 경우
- model.setValue("/root/main/prcplistinfo/setcond/setclscd", 'N');
-
- } else { //부서일 경우
- model.setValue("/root/main/prcplistinfo/setcond/setclscd", 'W');
- }
-
- model.removeNodeset("/root/send/reqdata");
- model.makeNode("/root/send/reqdata");
- model.copyNode("/root/send/reqdata", "/root/main/prcplistinfo/setcond");
- model.makeValue("/root/send/reqdata/clsflag", 'lrg');
- submit("TRMNW11601"); //대분류명 조회
-
- model.removeNodeset(sSMLSETLIST_PATH);
- model.removeNodeset(sPRCPSETLIST_PATH);
- model.refresh();
- }
- }
-
- /**
- * @desc : 소분류 SET 조회
- * @
- * @param :
- * @return :
- * @author : 성미연
- * @---------------------------------------------------
- */
- function fSmlSetRef() {
- if (isDataCell()) {
- model.removeNodeset("/root/send/reqdata");
- model.makeNode("/root/send/reqdata");
- model.copyNode("/root/send/reqdata", "/root/main/prcplistinfo/setcond");
- model.makeValue("/root/send/reqdata/clsflag", 'sml');
- model.makeValue("/root/send/reqdata/setno", model.getValue("/root/main/prcplistinfo/anolrgsetinfo/lrgsetlist[" + grd_lrgsetlist.row + "]/setno"));
- submit("TRMNW11602"); //소분류명 조회
- model.removeNodeset(sPRCPSETLIST_PATH);
- model.refresh();
- }
- }
-
- /**
- * @desc : 간호약속처방SET 조회 (처방상세)
- * @
- * @param :
- * @return :
- * @author : 성미연
- : - 오지훈 2007.12.27 수정
- * @---------------------------------------------------
- */
- function fReqNursPrmsSet(){
- if(isDataCell()){
- var setno = model.getValue(sSMLSETLIST_PATH + "[" + grd_smlsetlist.row + "]/setno");
- var settypecd = "P";
- model.removeNodeset("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/setno" , setno);
- model.makeValue("/root/send/reqdata/settypecd", settypecd);
- model.makeValue("/root/send/reqdata/insukind" , model.getValue("/root/main/patinfocond/patinfo/insukind"));
- model.makeValue("/root/send/reqdata/deptcd", model.getValue("/root/main/cond/wardcd"));
- grd_prcplist.rebuildStyle();
-
- if(submit("TRMNW11003")) {
- //SET 처방리스트에서 청구주기가 월일 경우 파란색
- for ( i = 1; i<= getNodesetCount(sPRCPSETLIST_PATH); i++) {
- var tempcol10 = model.getValue(sPRCPSETLIST_PATH + "[" + i + "]/tempcol10");
- if (tempcol10 == "4")
- grd_prcplist.rowStyle(i, "data", "color") = "#0000ff";
- }
- grd_prcplist.refresh();
- }
- }
- }
- /**
- * @desc : 보험정보 조회
- * @
- * @param : calcscorcd 수가코드
- * @return :
- * @author : 성미연
- : - 오지훈 2007.12.27 수정
- * @---------------------------------------------------
- */
- function fInsuMsgInfoRef(calcscorcd) {
- model.removeNodeset("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/calcscorcd", calcscorcd);
- if(submit("TRMNW10907")){
- }
- }
- /**
- * @desc : 약품편람 조회
- * @
- * @param :
- * @return :
- * @author : 성미연
- * @---------------------------------------------------
- */
- function fDrugHbook() {
- var prcpclscd = model.getValue(sPRCPSETLIST_PATH +"[" + grd_prcplist.row + "]/prcpclscd");
-
- if("A2" == prcpclscd || "A4" == prcpclscd || "A6" == prcpclscd) {
- model.makeValue("/root/temp/setparma/prcpcd", model.getValue(sPRCPSETLIST_PATH +"[" + grd_prcplist.row + "]/prcpcd"));
- modal("SMADB01900", "1", "0", "0", "","/root/temp/setparma/prcpcd", "/root/hidden/receivedata/srchdrugcd");
- model.removenode("/root/temp/setparma/prcpcd");
- } else {
- messageBox("약/주사 처방이 아닙니다.", "I");
- }
- }
- /**
- * @desc : 수가편람 조회
- * @
- * @param :
- * @return :
- * @author : 성미연
- * @---------------------------------------------------
- */
- function fCalcScorHbook(flag) {
-
- var prcpcd;
-
- if(flag == 'prcp'){
-
- prcpcd = model.getValue(sPRCPSETLIST_PATH +"[" + grd_prcplist.row + "]/prcpcd")
- model.makeValue("/root/temp/setparma/prcpcd", prcpcd);
- modal("SMPIC00200", "1", "400", "400", "", "/root/temp/setparma/prcpcd" , "/root/temp");
-
- if(prcpcd == model.getValue("/root/temp/picmmech/picmmech_calcscorcd") ) {
- if (grd_prcplist.row > 0 ){
- if (model.getValue("/root/main/cond/patnm") == "") {
- messageBox("해당 환자를", "C002");
- return;
- }
-
- //처방 main grid로 약속처방 copy
- mnwAddNursPrcp(sPRCPSETLIST_PATH, "/root/main/prcp", grd_prcplist.row, "");
-
- var prcplist = model.instances(0).selectNodes("/root/main/prcp/prcplist");
- fSetNursPrcpDefault(model.instances(0).selectNodes("/root/main/prcp/prcplist").length);
-
- fSetPrcpInfo();
- //신규처방은 반환컬럼 disable
- grd_prcpposlist.isReadOnly(model.instances(0).selectNodes("/root/main/prcp/prcplist").length, grd_prcpposlist.colRef("tempcol8")) = true;
- if ( model.getValue(sPRCPLIST_PATH + "[" + model.instances(0).selectNodes("/root/main/prcp/prcplist").length + "]/estmcls")!= "Y" ){
- grd_prcpposlist.isReadOnly(model.instances(0).selectNodes("/root/main/prcp/prcplist").length, grd_prcpposlist.colRef("nigtprcpflag") ) = true;
- }
-
- //수가 보험정보 조회
- var calcscormastspec = model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/calcscormastspec");
- var calcscorcd = calcscormastspec.split("|");
- fInsuMsgInfoRef(calcscorcd[3]);
- }
- }
- model.removenode("/root/temp/picmmech");
- model.removenode("/root/temp/setparma");
-
- }else if(flag == 'prcppos'){
- prcpcd = model.getValue(sPRCPLIST_PATH +"[" + grd_prcpposlist.row + "]/prcpcd")
- model.makeValue("/root/temp/setparma/prcpcd", prcpcd);
- modal("SMPIC00200", "1", "400", "400", "", "/root/temp/setparma/prcpcd" , "/root/temp");
- }else if(flag == 'bf'){
- prcpcd = model.getValue(sBFPRCPLIST_PATH +"[" + grd_bfprcplist.row + "]/prcpcd")
- model.makeValue("/root/temp/setparma/prcpcd", prcpcd);
- modal("SMPIC00200", "1", "400", "400", "", "/root/temp/setparma/prcpcd" , "/root/temp");
- }
- }
- /**
- * @desc : 물류편람 조회
- * @
- * @param :
- * @return :
- * @author : 성미연
- * @---------------------------------------------------
- */
- function fGoodHbook() {
- modal("SMRSC00600", "1", "0", "0");
- }
-
- /**
- * @desc : 간호처방 추가
- * @
- * @param : srcnode 원본노드
- * : trgtnode 목적지노드
- * : currow row값
- * : pflag 처리구분 popup에서 opener로 처리되는 경우, opener으로 설정
- * : status 상태구분(I:신규, U:수정, D:D/C)
- *
- * @return :
- * @author : 오지훈 2007.12.27
- * @---------------------------------------------------
- */
- function mnwAddNursPrcp(srcnode, trgtnode, currow, pflag){
- //목적지 노드에 처방instance를 copy한다.
- var node = model.instances(0).selectSingleNode(srcnode + "[" + currow + "]");
- if(pflag == "popup"){
- var desnode = opener.model.instances(0).selectSingleNode(trgtnode);
- var desnodelist = opener.model.instances(0).selectNodes(trgtnode);
- }else{
- var desnode = model.instances(0).selectSingleNode(trgtnode);
- var desnodelist = model.instances(0).selectNodes(trgtnode);
- }
- desnode.appendChild(node.cloneNode(true));
- }
- /**
- * @desc : 한/영 여부 검사
- * @
- * @param : param 한영구분할 문자열
- * @return : "H" 한글
- * : "E" 영문
- * @author : 오지훈 2007.12.28
- * @---------------------------------------------------
- */
- function fIsHng(param){
- //parameter의 첫번째 글자의 문자코드 값이 255보다 크면 한글, 작으면 영문
- if(param.charCodeAt(0) > 255){
- return "H";
- } else{
- return "E";
- }
- }
- /**
- * @desc : 처방data(명, 코드)검색
- * @
- * @param :
- * @return :
- * @author : 성미연
- * : - 오지훈 2007.12.27 수정
- * @---------------------------------------------------
- */
- function fReqSrchPrcpData(){
- if (model.getValue("/root/main/srchcond/srchdata").length < 2 ){
- messageBox("검색어는 2자 이상","C001");
- model.setFocus("ipt_listsrchdata");
- return;
- }
- var prcpclscd = model.getValue("/root/main/srchcond/srchclscd");
-
- model.removeNodeset("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/prcpdd" , model.getValue("/root/main/cond/prcpdd"));
- model.makeValue("/root/send/reqdata/srchflag", model.getValue("/root/main/srchcond/srchflag"));
- model.makeValue("/root/send/reqdata/srchclscd", model.getValue("/root/main/srchcond/srchclscd"));
- model.makeValue("/root/send/reqdata/srchdata", model.getValue("/root/main/srchcond/srchdata"));
- model.makeValue("/root/send/reqdata/langflag", fIsHng(model.getValue("/root/main/prcpsetcond/srchdata")));
- model.makeValue("/root/send/reqdata/insukind", model.getValue("/root/main/patinfocond/patinfo/insukind"));
- //model.makeValue("/root/send/reqdata/srchallflag", "srchALL"); //srchALL일 경우는 검색조건에 재료/처치/수술/기타 여부 필요
-
- //model.makeValue("/root/send/reqdata/srchcond", "srchPRCD"); //공통SET내 검색
- model.makeValue("/root/send/reqdata/srchcond", "srchSET"); //공통SET내 검색
- model.makeValue("/root/send/reqdata/deptcd", model.getValue("/root/main/cond/wardcd"));
-
- /*
- if(prcpclscd == "ALL") {
- model.makeValue("/root/send/reqdata/srchcond", "ALL");
- }else {
- if(prcpclscd == "M2" || prcpclscd == "H4" || prcpclscd == "H2" || prcpclscd == "Z0"){
- model.makeValue("/root/send/reqdata/srchcond", "PRCD");
- }else{
- model.makeValue("/root/send/reqdata/srchcond", "SET");
- }
- }
- */
-
- if(submit("TRMNW11101")){
- //-------------경북대 (20101213)
- var prcplist = model.instances(0).selectNodes("/root/main/prcpsrch/prcplist");
- //-------------경북대 (20101213)
- if(prcplist.length > 0){
- open("SPMNW10600", 1, "", "", "SPMNW10600", "/root/main/prcpsrch", "/root/main/prcpsrch");
- model.removeNodeset("/root/main/prcpsrch"); //처방검색 결과 후, 조회결과 node를 삭제
- }else{
- messageBox("검색 결과가", "I004");
- model.setFocus("ipt_listsrchdata");
- return;
- }
- }
- model.refresh();
- }
- /**
- * @desc : SET처방 리스트 용법 클릭시 팝업
- * @
- * @param :
- * @return :
- * @author : 성미연
- * @---------------------------------------------------
- */
- function fClickSavePrcpDrugMthd(){
- var currow = grd_prcpposlist.mouseRow;
- if(currow < 1){
- return;
- }
- var prcpclscd = model.getValue(sPRCPLIST_PATH + "[" + currow + "]/prcpclscd");
- if((prcpclscd == "A2" || prcpclscd == "A4" || prcpclscd == "A6") && grd_prcpposlist.col == grd_prcpposlist.colRef("drugmthdspccdnm")){
- setParameter("srchRow", grd_prcpposlist.row);
- setParameter("GridPath", sPRCPLIST_PATH);
- modal("SPMNW11200");
- }else if (grd_prcpposlist.col < 4 ) {
- //수가 보험정보 조회
- var calcscormastspec = model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/calcscormastspec");
- var calcscorcd = calcscormastspec.split("|");
- fInsuMsgInfoRef(calcscorcd[3]);
- }
- }
- /**
- * @desc : 간호처방 SignData 조회
- * @
- * @param :
- * @return :
- * @author : 오지훈 2008. 1. 2
- * @---------------------------------------------------
- */
- function fReqNursPrcpSignData(){
- if (model.getValue("/root/main/cond/pid") == "" || model.getValue("/root/main/cond/patnm") == "") {
- messageBox("환자가 지정되지", "E007");
- return;
- }
- //20110422_KNUH_Start 잠시 주석처리.
- //20110420_KNUH_Start
- var cnt = 0;
- var str = "";
- var drprcpetc7;
- var drprcpetc8;
- var prcpclscd;
- var prcpcd;
-
- //20110626_KNUH_Start 보조유형이 미용성형일 경우, 처방을 보조유형으로 발행하도록 하는 로직 추가
- var anamneflag; //기왕력 유무(Y/N9
- var anamnecnt = 0;
- var subcretno = ""; //보조유형생성번호(subcretno)
-
- var flag;
- var tempcol8;
- var str1 = "";
- var str2 = "";
- var stoccnt = 0;
- var stoccnt2 = 0;
- var safestocqty;
- var idxinfo = "";
- var idxinfo2= "";
-
- var actregyn = "";
-
- for (var i=grd_prcpposlist.fixedRows; i < grd_prcpposlist.rows; i++) {
- drprcpetc7 = grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("drprcpetc7"));
- drprcpetc8 = grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("drprcpetc8"));
- prcpclscd = grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("prcpclscd"));
- prcpcd = grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("prcpcd"));
- prcpnm = grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("orgprcpnm"));
-
- flag = grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("flag"));
- tempcol8 = grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("tempcol8"));
-
- safestocqty = parseInt(grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("safestocqty")));
- qty = parseInt(grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("drprcpetc8")));
-
- actregyn = grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("actregyn"));
- stocyn = grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("stocyn"));
-
- if(prcpclscd == "M2") {
- if(tempcol8 == "Y") {
-
- } else {
- if(stocyn == "Y") {
- if(safestocqty == 0) {
-
- if(actregyn == "Y") {
-
- } else {
- if(stoccnt == 0) {
- str1 += " " + prcpnm;
- idxinfo += i;
- } else {
- str1 += "\n, " + prcpnm;
- idxinfo+= "," + i;
- }
- stoccnt++;
- }
- } else {
- if(qty > safestocqty) {
- if(stoccnt2 == 0) {
- str2 += " " + prcpnm;
- idxinfo2 += i;
- } else {
- str2 += "\n, " + prcpnm;
- idxinfo2 += "," + i;
- }
- stoccnt2++;
- }
- }
- }
- }
- }
-
- if(flag == "N" && (tempcol8 == "N" || tempcol8 == "" || tempcol8 == null)) {
- messageBox("[" + prcpcd + "]처방은 수가가 종료되어 반환만 가능합니다.", "E");
- grd_prcpposlist.row = i;
- return;
- }
-
- //영상처방인 경우 1회만 처방가능하도록 blocking
- if (prcpclscd == 'C2') {
- if (drprcpetc7 != 1 || drprcpetc8 != 1) {
- messageBox("영상처방은 1회만 처방 가능합니다.", "E");
- return;
- }
- }
-
- if (prcpcd == 'E40300003-3' || prcpcd == 'E40300003-6') {
- if ((drprcpetc8 % 3) != 0 ) {
- messageBox("Gauze Vaseline 처방은 수량을 3배수로만 처방 가능합니다.", "E");
- return;
- }
- }
-
- //20110626_KNUH_Start 보조유형이 미용성형일 경우, 처방을 보조유형으로 발행하도록 하는 로직 추가
- anamneflag = grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("anamneflag"));
- if(anamneflag == "Y") {
- if(anamnecnt == 0) {
- var flag = fCheckSubKindCd();
- if(flag == "false") {
- return;
- }
-
- subcretno = model.getValue("/root/temp/prcpinfo/subcretno");
- if(subcretno == "0" || subcretno == "" || subcretno == null) {
- messageBox ( "환자의 부유형이 없거나 또는 선택되지 않았습니다.\n\n기왕증 체크를 해제 합니다.", "I999" );
- subcretno = "0";
- }
- }
- anamnecnt++;
- if(subcretno != "0") {
- grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("subcretno")) = subcretno;
- } else {
- grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("anamneflag")) = "N";
- grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("subcretno")) = "0";
- }
- } else {
- grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("anamneflag")) = "N";
- grd_prcpposlist.valueMatrix(i,grd_prcpposlist.colRef("subcretno")) = "0";
- }
- //20110626_KNUH_End
-
- if( drprcpetc7 != drprcpetc8 || drprcpetc7 == "Y" || drprcpetc8 == "Y" || drprcpetc7 == "N" || drprcpetc8 == "N") {
- if(prcpclscd == "A6" || prcpclscd == "A4" || prcpclscd == "A2") {
- continue;
- } else {
- grd_prcpposlist.cellstyle("background-color", i, 1, i, grd_prcpposlist.cols-1) = "#FFF000";
- if(cnt != 0) {
- str += ",";
- }
- str += i;
- cnt++;
- }
- } else {
- grd_prcpposlist.cellstyle("background-color", i, 1, i, grd_prcpposlist.cols-1) = "#FFFFFF";
- }
- }
-
- if(cnt > 0) {
- messageBox(str + "번째 처방이 잘못 발생되었습니다. 우측마우스를 눌러 삭제후 다시 입력하십시오.", "E");
- return;
- }
-
- var msg = "";
- //칠곡만 적용
- if(getUserInfo("dutplceinstcd") == "032") {
- if(stoccnt > 0 || stoccnt2 > 0) {
- if(stoccnt > 0 && stoccnt2 > 0) {
- msg = "* 안전재고보다 초과된 물품\n" + str2 + "\n\n" + "* 미등록된 물품\n" + str1 + "\n";
- } else if(stoccnt > 0 && stoccnt2 == 0) {
- msg = "* 미등록된 물품\n" + str1 + "\n";
- } else if(stoccnt == 0 & stoccnt2 > 0) {
- msg = "* 안전재고보다 초과된 물품\n" + str2 + "\n";
- }
-
- var rtn = messageBox(msg, "I");
- }
- }
-
- //20090908 khj
- if (( model.getValue(sPATINFO_PATH + "/ordtype") == "I" || model.getValue(sPATINFO_PATH + "/ordtype") == "D" )) {
- model.removeNodeset("/root/send/reqdata");
- model.makeNode("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/orddd", model.getValue("/root/main/cond/prcpdd"));
- model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
-
- model.makeValue("/root/send/reqdata/roomcd", model.getValue("/root/main/cond/roomcd"));
- model.makeValue("/root/send/reqdata/refflag", "room");
- model.makeValue("/root/send/reqdata/ordtype", "I");
- model.makeValue("/root/send/reqdata/settingrnid", model.getValue("/root/main/cond/settingrnid"));
-
-
- if(spcldept == model.getValue("/root/main/cond/wardcd")) {
- model.makeValue("/root/send/reqdata/spcldeptyn", "Y");
- } else {
- model.makeValue("/root/send/reqdata/spcldeptyn", "");
- }
- submit("TRMNW10903");
-
- var pid = model.getValue("/root/main/cond/pid");
- model.copyNode("/root/main/patinfocond/patinfo", "/root/init/patinfo/patlist[pid = '" + pid + "']");
-
- if ( model.getValue(sPATINFO_PATH + "/careinrmyn") != "Y" ){
- messageBox("입실체크를 하기 전 또는 퇴원환자는 처방 저장을 하실 수 ", "I004");
- return;
- }
- }
-
-
- if (model.getValue(sPRCPLIST_PATH + "/prcpcd") == "") {
- messageBox("저장할 처방내역이", "I004");
- return;
- }
-
- // 간호사퇴원통보가 되어있는 경우_20080807(ByJA)
- /*
- if(model.getValue("/root/main/patinfocond/patinfo/dschnotiyn") == "Y"){
- messageBox( "[" + model.getValue("/root/main/patinfocond/patinfo/pid")
- +" " + model.getValue("/root/main/patinfocond/patinfo/patnm")
- +"]\n 이미 퇴원통보가 되어 처방을 저장", "E001");
- return;
- }
- */
-
- var posdept = model.getValue("/root/main/prcpposinfo/cond/deptcd");
- if (model.getValue("/root/main/prcpposinfo/cond/poscd") == '2' && model.getValue("/root/init/deptinfo/deptlist[deptcd = '"+ posdept + "']/deptcd") == "") {
- messageBox("User위치가 지정되지", "E007");
- return;
- }
- model.removeNodeset("/root/send/reqdata");
- model.makeNode("root/err/result");
- model.makeNode("/root/endinfo/result");
-
-
- //상단정보가 아닌, 환자검색정보 설정인 경우
- var ioflag = model.getValue("/root/main/patinfocond/patinfo/ordtype");
- var orddeptcd = model.getValue("/root/main/patinfocond/patinfo/orddeptcd");
- var orddeptnm = model.getValue("/root/main/patinfocond/patinfo/orddeptnm");
- var orddrid = model.getValue("/root/main/patinfocond/patinfo/orddrid");
- var orddrnm = model.getValue("/root/main/patinfocond/patinfo/orddrnm");
- var pid = model.getValue("/root/main/patinfocond/patinfo/pid");
- var hngnm = model.getValue("/root/main/patinfocond/patinfo/patnm");
- var cretno = model.getValue("/root/main/patinfocond/patinfo/cretno");
- var instcd = model.getValue("/root/main/patinfocond/patinfo/instcd");
- var sa = model.getValue("/root/main/patinfocond/patinfo/sexage");
- var userkindcd = model.getValue("/root/main/patinfocond/patinfo/userkindcd");
- var aftcertdrid = "";
- var orddd = "";
- var pamflag = "";
- var chkprcpclscd ="";
- var chkaftcertyn ="";
-
- if(ioflag == "O" || ioflag == "S"){
- orddd = model.getValue("/root/main/patinfocond/patinfo/orddd");
- if ( userkindcd == "97" ){
- for (var i=1; i < grd_prcpposlist.rows; i++) {
- chkprcpclscd = model.getValue(sPRCPLIST_PATH + "[" + i + "]/prcpclscd");
- if (!isNull( model.getValue("/root/code/codeinfo/codelist[cdgrupid ='207' and cdid = '"+chkprcpclscd+"']/cdid") )) {
- chkaftcertyn = "Y";
- break;
- }
- }
-
- if ( chkaftcertyn == "Y" ){
- setParameter("SPMMB04100_orddrid", orddrid);
- setParameter("SPMMB04100_defdeptcd", orddeptcd);
- modal("SPMMB04100");
- var useyn = getParameter("SPMMB04100_useyn");
- if (useyn != "Y") {
- return false;
- }else if(useyn == "Y"){ //후인증 선택의사로 설정
- aftcertdrid = getParameter("SPMMB04100_orddrid");
- }
- }
- }
- }else{
- orddd = model.getValue("/root/main/patinfocond/patinfo/indd");
- }
- var bedcd = model.getValue(cmb_Zone.attribute("ref"));
- var er ="";
- var grupcd = "";
-
- if(ioflag == "O"){ //외래인 경우, 원무정보 처리
- pamflag = "Y";
- }
- var deptcd="";
- var deptnm="";
-
- if (model.getValue("/root/main/prcpposinfo/cond/poscd") == '1') { //환자위치
- if ( !isNull(model.getValue("/root/code/codeinfo/codelist[cdgrupid ='002' and cdid ='"+combo1.value+"']/cdid")) ) {
- deptcd = model.getValue("/root/init/patinfo/patlist[pid='" + pid + "']/grupcd");
- deptnm = model.getValue("/root/init/deptinfo/deptlist[deptcd = '" + model.getValue("/root/init/patinfo/patlist[pid='" + pid + "']/grupcd") + "']/depthngnm");
- } else {
- deptcd = model.getValue("/root/main/cond/wardcd");
- deptnm = model.getValue("/root/init/deptinfo/deptlist[deptcd = '" + model.getValue("/root/main/cond/wardcd") + "']/depthngnm");
- }
- } else { //User위치
- deptcd = model.getValue("/root/main/prcpposinfo/cond/deptcd");
- deptnm = model.getValue("/root/init/deptinfo/deptlist[deptcd = '" + model.getValue("/root/main/prcpposinfo/cond/deptcd") + "']/depthngnm");
- }
-
-
- model.makeValue("/root/temp/saveflaginfo/savedataflag", "2"); //저장자료구분(2:처방)
- model.makeValue("/root/temp/saveflaginfo/saveflag" , ioflag); //저장구분 O:외래, I:입원, E:응급, S:건진, D:DSC
- model.makeValue("/root/temp/saveflaginfo/prcpflag" , "2"); //처방구분 (M0035 처방권한에 대한 구분종류 : 간호 추가처방)
- model.makeValue("/root/temp/saveflaginfo/inptflag" , "09"); //처방입력구분 (M0034 처방입력에 대한 구분종류 : 간호처방)
- model.makeValue("/root/temp/saveflaginfo/pamflag" , pamflag);//원무정보 처리구분(외래만 Y)
- model.makeValue("/root/temp/saveflaginfo/prcperrflag" , "Y"); //처방오류구분
- model.makeValue("/root/temp/saveflaginfo/deptcd" , deptcd); //부서코드
- model.makeValue("/root/temp/saveflaginfo/deptnm" , deptnm); //부서명
- model.makeValue("/root/temp/saveflaginfo/userid" , getUserInfo("userid")); //사용자ID
- model.makeValue("/root/temp/saveflaginfo/usernm" , getUserInfo("usernm")); //사용자명
- model.makeValue("/root/temp/saveflaginfo/signyn" , "Y"); //전자서명여부
- model.makeValue("/root/temp/saveflaginfo/prcpdd" , model.getValue("/root/main/cond/prcpdd")); //처방일
-
- var saveflaginfolist = getNodeListCSV(model.instances(0).selectNodes("/root/temp/saveflaginfo"));
- model.makeValue("/root/send/reqdata/saveflaginfo", saveflaginfolist);
-
- model.makeValue("/root/temp/savergstinfo/pid" , pid); //등록번호
- model.makeValue("/root/temp/savergstinfo/indd" , orddd); //진료일자
- model.makeValue("/root/temp/savergstinfo/orddd" , orddd); //진료일자
- model.makeValue("/root/temp/savergstinfo/cretno" , cretno); //생성번호
- model.makeValue("/root/temp/savergstinfo/instcd" , instcd); //기관코드
- model.makeValue("/root/temp/savergstinfo/orddeptcd" , orddeptcd); //진료과
- model.makeValue("/root/temp/savergstinfo/orddeptnm" , orddeptnm); //진료과명
- model.makeValue("/root/temp/savergstinfo/orddrid" , orddrid); //진료의
- model.makeValue("/root/temp/savergstinfo/orddrnm" , orddrnm); //진료의명
- model.makeValue("/root/temp/savergstinfo/hngnm" , hngnm); //환자명
- model.makeValue("/root/temp/savergstinfo/sa" , sa); //성별나이
- model.makeValue("/root/temp/savergstinfo/ordtype" , ioflag); //외래입원구분
- model.makeValue("/root/temp/savergstinfo/aftcertdrid" , aftcertdrid); //외래 일반의사의 경우 후인증 대상의사는 지정한다.
- var savergstinfolist = getNodeListCSV(model.instances(0).selectNodes("/root/temp/savergstinfo"));
- model.makeValue("/root/send/reqdata/savergstinfo", savergstinfolist);
- for(var i = 1; i < grd_prcpposlist.rows; i++){
- var prcpclscd = model.getValue(sPRCPLIST_PATH + "[" + i + "]/prcpclscd");
- var drugmthdspccd = model.getValue(sPRCPLIST_PATH + "[" + i + "]/drugmthdspccd");
- var drugmthdspccdnm = model.getValue(sPRCPLIST_PATH + "[" + i + "]/drugmthdspccdnm");
- var prcpno = model.getValue(sPRCPLIST_PATH + "[" + i + "]/prcprefseq");
- var prcpcd = model.getValue(sPRCPLIST_PATH + "[" + i + "]/prcpcd");
- var prcpnm = model.getValue(sPRCPLIST_PATH + "[" + i + "]/prcpnm");
- var rtnflag = model.getValue(sPRCPLIST_PATH + "[" + i + "]/tempcol8"); //반환체크
- var enddd = model.getValue(sPRCPLIST_PATH + "[" + i + "]/tempcol10");
- var prcppkspec = (model.getValue(sPRCPLIST_PATH + "[" + i + "]/prcppkspec")).split("|");
- //20091021 khj 간호처방에서 야간(18:00~익일08:00)에 발생하는 처방 중 수가에서 야간 가산을 받을 수 있는 처방의 경우 간호처방 시 가산여부 “Y”로 자동세팅
- if ( ( ( model.getValue("/root/code/codeinfo/codelist[cdgrupid='002']/cdid") == model.getValue("/root/main/cond/wardcd"))
- //&& model.getValue(sPRCPLIST_PATH + "[" + i + "]/nigtprcpflag") == "N"
- || ( model.getValue("/root/code/codeinfo/codelist[cdgrupid='002']/cdid") != model.getValue("/root/main/cond/wardcd")
- && model.getValue(sPRCPLIST_PATH + "[" + i + "]/nigtprcpflag") == "Y") )
- && model.getValue("/root/main/cond/prcpdd")== getCurrentDate()
- && ( getCurrentTime().substring(0,2)< "08" || getCurrentTime().substring(0,2)>= "18")
- && model.getValue(sPRCPLIST_PATH + "[" + i + "]/estmcls")== "Y"
- ){
- model.setValue(sPRCPLIST_PATH + "[" + i + "]/nigtprcpflag" , "Y"); //야간처방구분
- }else {
- model.setValue(sPRCPLIST_PATH + "[" + i + "]/nigtprcpflag" , "N"); //야간처방구분
- }
-
- //약,주사 처방 중에 용법이 없을 경우 에러리스트
- if("A2" == prcpclscd || "A4" == prcpclscd || "A6" == prcpclscd){
- if(drugmthdspccd == "-" || drugmthdspccdnm == "-" || drugmthdspccdnm == " " || drugmthdspccdnm == "") {
- model.makeValue("/root/err/errresult/prcperrlist/prcpno", prcpno);
- model.makeValue("/root/err/errresult/prcperrlist/prcpcd", prcpcd);
- model.makeValue("/root/err/errresult/prcperrlist/prcpnm", prcpnm);
- model.makeValue("/root/err/errresult/prcperrlist/prcperr", "용법이 존재하지 않습니다.");
- model.makeValue("/root/err/errresult/prcperrlist/prcplineno", i);
- model.duplicate("/root/err/result","/root/err/errresult/prcperrlist");
- }
- }
-
- var prcpvol = model.getValue(sPRCPLIST_PATH + "[" + i + "]/prcpvol");
- var prcpqty = model.getValue(sPRCPLIST_PATH + "[" + i + "]/prcpqty");
-
- //수량이 0보다 적을 경우 에러리스트
- if(prcpvol <= 0 || prcpqty <= 0 ) {
- model.makeValue("/root/err/errresult/prcperrlist/prcpno", prcpno);
- model.makeValue("/root/err/errresult/prcperrlist/prcpcd", prcpcd);
- model.makeValue("/root/err/errresult/prcperrlist/prcpnm", prcpnm);
- model.makeValue("/root/err/errresult/prcperrlist/prcperr", "처방 수량을 확인하세요");
- model.makeValue("/root/err/errresult/prcperrlist/prcplineno", i);
- model.duplicate("/root/err/result","/root/err/errresult/prcperrlist");
- }
-
- //********************************************
- //임상연구 환자체크
- if(model.getValue("root/main/cond/clincstdyflag") == "Y"){
- model.setValue(sPRCPLIST_PATH + "[" + i + "]/clincstdyflag", "Y");
- model.setValue(sPRCPLIST_PATH + "[" + i + "]/clincstdycd", model.getValue(sPATINFO_PATH + "/clincstdycd"));
- }
- //*********************************************/
-
- //마감 이후에 반환일 경우 반환사유 입력 팝업
- //enddd default값 변경으로 수정_20080715
- if(rtnflag == "Y" && enddd.substr(0,8) != '99991231' && enddd != ''){
- model.makeValue("/root/endinfo/endinforesult/list/prcpdd", prcppkspec[0]);
- model.makeValue("/root/endinfo/endinforesult/list/prcpno", prcppkspec[1]);
- model.makeValue("/root/endinfo/endinforesult/list/prcphistno", prcppkspec[2]);
- model.makeValue("/root/endinfo/endinforesult/list/execprcpno", "");
- model.makeValue("/root/endinfo/endinforesult/list/instcd", prcppkspec[3]);
- model.makeValue("/root/endinfo/endinforesult/list/ioflag", ioflag);
- model.duplicate("/root/endinfo/result","/root/endinfo/endinforesult/list");
- }
- }
- var saveprcplist = getNodeListCSV(model.instances(0).selectNodes("/root/main/prcp/prcplist"));
- model.makeValue("/root/send/reqdata/saveprcpinfo", saveprcplist);
-
- if (getNodesetCount ("/root/err/result/prcperrlist") > 0 ) {
- var xpt = window.screenleft + 100;
- var ypt = window.screenTop + 50;
- var coord = getRelativeCoordinate ( xpt, ypt );
- var mon = coord[0];
- xpt = coord[1];
- ypt = coord[2];
- open( "SPMNW11000", mon, xpt, ypt, "prcpdetl", "/root/err/result", "/root/result", "", false );
- //오류목록 생성후 오류난 처방을 붉은 색으로 표시
- fDestDisplayErrlist("/root/err/result/prcperrlist", "grd_prcpposlist");
- model.removeNodeset("/root/err");
- } else {
- //인증데이터 처리
- if(submit("TRMNW10906")){
- //** 간호사퇴원통보가 되어있는 경우 **//
- var dschnotiyn = model.getValue(sSIGNDATA_PATH + "/dschnotiyn"); // 간호사퇴원확정여부_20080923(ByJA)
- if(dschnotiyn == "Y"){
- messageBox( "[" + model.getValue("/root/main/patinfocond/patinfo/pid")
- +" " + model.getValue("/root/main/patinfocond/patinfo/patnm")
- +"]\n 이미 퇴원통보가 되어 처방을 저장", "E001");
- return;
- }
-
- //** 간호사퇴원통보가 되어있는 경우 **//
- var signbfcnts = model.getValue(sSIGNDATA_PATH + "/signbfcnts");
- var userid = getUserInfo("userid");
- //운영서버는 인증모듈 타고 그외서버는 인증모듈제외
- var signinfo = "";
- if(vsettime == "") { //인증저장한시간.
- signinfo = fMakeSignData(signbfcnts, userid, true); // 항상 인증서 비밀번호 확인 설정(true)_20080909(ByJA)
- } else {
- var res2 = getTimeInterval(vsettime, getCurrentTime(), 'hhmmss');
- if(res2 > signtime* 60 || res2 < 0) {
- signinfo = fMakeSignData(signbfcnts, userid, true); // 항상 인증서 비밀번호 확인 설정(true)_20080909(ByJA)
- } else {
- signinfo = fMakeSignData(signbfcnts, userid, false); // 항상 인증서 비밀번호 확인 설정안함(false)_20080909(ByJA)
- }
- }
- // -----------------------(2010.08.18 센터)start--------------------
- if(signinfo == "" || signinfo == "-"){ //인증저장 취소
- return;
- }else{
- //처방반환사유 팝업
- vsetdate = getCurrentDate();
- vsettime = getCurrentTime();
-
- if (getNodesetCount ("/root/endinfo/result/list") > 0 ) {
- 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);
- model.removeNodeset("/root/endinfo");
- }
-
- //** 귀가유치물품 관련 데이터(여부,수량) 입력값 체크_20090206(ByJA) **//
- for(var i=1;i<grd_prcpposlist.rows;i++){
- fChkHomeMatr(i);
- }
-
- model.setValue(sSIGNDATA_PATH + "/signaftcnts", signinfo); //true : 처방저장할 때마다 인증저장 태움
-
- var savesignlist = getNodeListCSV(model.instances(0).selectNodes(sSIGNDATA_PATH));
- model.makeValue("/root/send/savedata/saveflaginfo", saveflaginfolist);
- model.makeValue("/root/send/savedata/savergstinfo", savergstinfolist);
- model.makeValue("/root/send/savedata/saveprcpinfo", saveprcplist);
- model.makeValue("/root/send/savedata/savesigninfo", savesignlist);
-
- fSavePrcp(); //처방저장
- }
- }
- }
- }
- /**
- * @desc : 간호처방 SignData 생성
- * @
- * @param : signbfcnts - 인증 전 데이터
- * : signuserid - 인증자ID
- * : signcnfmflag - 인증확인여부
- * @return :
- * @author : 오지훈 2008. 1. 3
- * @---------------------------------------------------
- */
- function fMakeSignData(signbfcnts, userid, signcnfmflag){
- return zesfSignData(signbfcnts, userid, signcnfmflag);
- }
- /**
- * @desc : 간호 전처방 조회
- * @
- * @param :
- * @return :
- * @author : 오지훈 2008. 1. 3
- * @---------------------------------------------------
- */
- function fReqBfNursPrcpInfo(){
- if (model.getValue("/root/main/cond/patnm") == "" && model.getValue("/root/main/paminfo/list/pid") != "") {
- model.resetInstanceNode("/root/main/cond/pid");
- ipt_pid.refresh();
- messageBox("환자를 먼저 지정하십시오!", "C");
- return;
- }
- var ordtype = model.getValue("/root/main/patinfocond/patinfo/ordtype");
- var pid = model.getValue("/root/main/patinfocond/patinfo/pid");
- var cretno = model.getValue("/root/main/patinfocond/patinfo/cretno");
- var insukind = model.getValue("/root/main/patinfocond/patinfo/insukind");
- var prcpfromdd = model.getValue("/root/main/bfprcpinfo/bfcond/prcpfromdd");
- var prcptodd = model.getValue("/root/main/bfprcpinfo/bfcond/prcptodd");
- var srchflag = model.getValue("/root/main/bfprcpinfo/bfcond/srchflag");
- var srchclscd = model.getValue("/root/main/bfprcpinfo/bfcond/srchclscd");
- var srchdata = model.getValue("/root/main/bfprcpinfo/bfcond/srchdata");
- var srchdayflag = model.getValue("/root/main/bfprcpinfo/bfcond/srchdayflag");
- var ordercond = model.getValue("/root/main/bfprcpinfo/bfcond/ordercond");
- var ordercond2 = model.getValue("/root/main/bfprcpinfo/bfcond/ordercond2");
- //가정간호 여부(가정간호 환자인 경우는 전처방 조회시 원무정보 조건을 걸지 않음)
- var homecareyn = model.getValue("/root/main/cond/homecareyn");
- var deptcd = model.getValue("/root/main/cond/wardcd");
-
- if(ordtype == "O" || ordtype == "S"){
- var orddd = model.getValue("/root/main/patinfocond/patinfo/orddd");
-
- }else{
- var orddd = model.getValue("/root/main/patinfocond/patinfo/indd");
-
- }
-
- model.removeNodeset("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/pid" , pid);
- model.makeValue("/root/send/reqdata/orddd" , orddd);
- model.makeValue("/root/send/reqdata/cretno" , cretno);
- model.makeValue("/root/send/reqdata/insukind" , insukind);
- model.makeValue("/root/send/reqdata/prcpfromdd" , prcpfromdd);
- model.makeValue("/root/send/reqdata/prcptodd" , prcptodd);
- model.makeValue("/root/send/reqdata/ordtype" , ordtype);
- model.makeValue("/root/send/reqdata/srchflag" , srchflag);
- model.makeValue("/root/send/reqdata/srchclscd" , srchclscd);
- model.makeValue("/root/send/reqdata/srchdata" , srchdata);
- model.makeValue("/root/send/reqdata/srchdayflag", srchdayflag);
- model.makeValue("/root/send/reqdata/homecareyn" , homecareyn);
- model.makeValue("/root/send/reqdata/ordercond" , ordercond);
- model.makeValue("/root/send/reqdata/ordercond2" , ordercond2);
- model.makeValue("/root/send/reqdata/deptcd" , model.getValue("/root/main/cond/wardcd"));
- model.makeValue("/root/send/reqdata/prcpinptflag" , "09"); // 처방입력에 대한 구분종류 ('09':간호처방, '38':간호 미확인 구두처방, , '39':간호 확인 구두처방)
-
- grd_bfprcplist.rebuildStyle();
-
- if(submit("TRMNW10905")){
- // 처방일자로 구분선 표시(기준자료에 등록된 부서만)
- if( deptcd == model.getValue("/root/code/codeinfo/codelist[cdgrupid='I09' and cdid ='"+deptcd+"']/cdid")){
- var pGrdCnt = getNodesetCount(sBFPRCPLIST_PATH);
-
- if (pGrdCnt != 0 ) {
-
- var rgstdt1 = "";
- var rgstdt2 = "";
-
- for (var i = grd_bfprcplist.fixedRows; i <= grd_bfprcplist.rows; i++) {
-
- rgstdt1 = model.getValue(sBFPRCPLIST_PATH + "[" + i + "]/rgstdt");
- rgstdt2 = model.getValue(sBFPRCPLIST_PATH + "[" + (i+1) + "]/rgstdt");
-
- if (rgstdt1.substring(0,8) == rgstdt2.substring(0,8)){
-
- }else{
- if(i != 0){
- grd_bfprcplist.rowStyle(i, "all", "border-bottom-color") = "#ff0000";
- grd_bfprcplist.rowStyle(i, "all", "border-top-width") = "1";
- }
- }
- }
- grd_bfprcplist.refresh();
- }
- }
- }
-
- //전처방 검색 후 검색창 초기화
- model.resetInstanceNode("/root/main/bfprcpinfo/bfcond/srchdata");
- model.setFocus("ipt_bfsrchdata");
- ipt_bfsrchdata.refresh();
-
- //전처방 리스트에서 반납일 경우 텍스트 빨간색
- for ( i = 1; i<= getNodesetCount(sBFPRCPLIST_PATH); i++) {
- var prcphistcd = model.getValue(sBFPRCPLIST_PATH + "[" + i + "]/prcphistcd");
- if (prcphistcd == "L" || prcphistcd == "D" ) {
- grd_bfprcplist.rowStyle(i, "data", "color") = "#FF0000";
- }
- }
- model.refresh();
-
- }
- /**
- * @desc : 간호 임시처방 조회
- * @
- * @param :
- * @return :
- * @author : 성미연 2008. 5. 15
- * @---------------------------------------------------
- */
- function fReqTempNursPrcpInfo(){
- if (model.getValue("/root/main/cond/patnm") == "" && model.getValue("/root/main/paminfo/list/pid") != "") {
- model.resetInstanceNode("/root/main/cond/pid");
- ipt_pid.refresh();
- messageBox("환자를 먼저 지정하십시오!", "C");
- return;
- }
-
- if (model.getValue("/root/main/tempprcpinfo/tempcond/srchdata").length == 1 ){
- messageBox("검색어는 2자 이상","C001");
- model.setFocus("ipt_tempsrchdata");
- return;
- }
- var ordtype = model.getValue("/root/main/patinfocond/patinfo/ordtype");
- var pid = model.getValue("/root/main/patinfocond/patinfo/pid");
- var cretno = model.getValue("/root/main/patinfocond/patinfo/cretno");
- var insukind = model.getValue("/root/main/patinfocond/patinfo/insukind");
- var srchflag = model.getValue("/root/main/tempprcpinfo/tempcond/srchflag");
- var srchclscd = model.getValue("/root/main/tempprcpinfo/tempcond/srchclscd");
- var srchdata = model.getValue("/root/main/tempprcpinfo/tempcond/srchdata");
-
- if(ordtype == "O" || ordtype == "S"){ //외래환자는 임시처방 발생하지 않음
- return;
-
- }else{
- var orddd = model.getValue("/root/main/patinfocond/patinfo/indd");
-
- }
-
- model.removeNodeset("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/pid" , pid);
- model.makeValue("/root/send/reqdata/orddd" , orddd);
- model.makeValue("/root/send/reqdata/cretno" , cretno);
- model.makeValue("/root/send/reqdata/insukind" , insukind);
- model.makeValue("/root/send/reqdata/ordtype" , ordtype);
- model.makeValue("/root/send/reqdata/srchflag" , srchflag);
- model.makeValue("/root/send/reqdata/srchclscd" , srchclscd);
- model.makeValue("/root/send/reqdata/srchdata" , srchdata);
-
- grd_tempprcplist.rebuildStyle();
-
- if(submit("TRMNW10908")){
- //임시처방리스트에서 청구주기가 월일 경우 파란색
- for ( i = 1; i<= getNodesetCount(sTEMPPRCPLIST_PATH); i++) {
- var tempcol10 = model.getValue(sTEMPPRCPLIST_PATH + "[" + i + "]/tempcol10");
- if (tempcol10 == "4")
- grd_tempprcplist.rowStyle(i, "data", "color") = "#0000ff";
- }
- grd_tempprcplist.refresh();
- }
-
- //임시처방 검색 후 검색창 초기화
- model.resetInstanceNode("/root/main/tempprcpinfo/tempcond/srchdata");
- model.setFocus("ipt_tempsrchdata");
- ipt_tempsrchdata.refresh();
-
- model.refresh();
-
- }
- /**
- * @desc : 간호처방 기본값 설정
- * @
- * @param : desrow 목적지 노드의 row위치
- * @return :
- * @author : 오지훈 2008. 1. 4
- * @---------------------------------------------------
- */
- function fSetNursPrcpDefault(desrow){
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/status" , "I"); //처방상태(신규)
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpkindcd" , "20"); //처방분류코드(간호처방은 모두 추가)
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpstatcd" , "000"); //처방상태코드
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpauthflag" , 2); //처방권한구분, 의사와 공유하지 않음
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpinptflag" , "09"); //처방입력구분, 간호:09
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcphopedd" , model.getValue("/root/main/cond/prcpdd")); //처방희망일
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpmixno" , 0); //Mix번호
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prnprcpflag" , "N"); //PRN처방구분
- // model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/precureprcpflag" , "N"); //선처치처방구분_기준자료에서 설정한 값으로 설정_임미정ITC요청_20081208(ByJA)
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/drprcpetc10" , "N"); //대차구분
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/drgacptflag" , "-"); //DRG인정
-
- if ( model.getValue(sPRCPLIST_PATH + "[" + desrow + "]/able_erprcpflag") == "Y" // 응급가산 가능 처방
- && model.getValue("/root/main/paminfo/list/orgordtype") == "E" // 응급실 경유 환자
- && model.getValue("/root/main/paminfo/list/indd")+model.getValue("/root/main/paminfo/list/intm") >= getNewDate().getAddDate(-1,"D").getDateFormat("YYYYMMDDhhmm") // 내원 24시간 이내 환자 이면
- ) {
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/erprcpflag" , "Y"); //응급처방구분
- } else {
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/erprcpflag" , "N"); //응급처방구분
- }
-
- //20091021 khj 간호처방에서 야간(18:00~익일08:00)에 발생하는 처방 중 수가에서 야간 가산을 받을 수 있는 처방의 경우 간호처방 시 가산여부 “Y”로 자동세팅
- if (model.getValue("/root/code/codeinfo/codelist[cdgrupid='002']/cdid") == model.getValue("/root/main/cond/wardcd")
- && model.getValue("/root/main/cond/prcpdd")== getCurrentDate()
- && ( getCurrentTime().substring(0,2)< "08" || getCurrentTime().substring(0,2)>= "18")
- && model.getValue(sPRCPLIST_PATH + "[" + desrow + "]/estmcls")== "Y"
- ){
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/nigtprcpflag" , "Y"); //야간처방구분
- }else {
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/nigtprcpflag" , "N"); //야간처방구분
- }
-
- if ( model.getValue(sPRCPLIST_PATH + "[" + desrow + "]/estmcls")!= "Y" ){
- grd_prcpposlist.isReadOnly(desrow, grd_prcpposlist.colRef("nigtprcpflag") ) = true;
- }
-
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/portprcpflag" , "N"); //포터블처방구분
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/fixprcpflag" , "N"); //정액처방구분
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/choiordflag" , "-"); //원무기준으로 처리하기 위해, '-' 설정
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/anamneflag" , "N"); //기왕증구분
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/angioflagcd" , "-"); //Angio구분
- model.makeValue(sPRCPLIST_PATH + "[" + desrow + "]/homematrflag" , "N"); //귀가유치를 위한 물품여부
- model.makeValue(sPRCPLIST_PATH + "[" + desrow + "]/homematrqty" , "0"); //귀가유치를 위한 물품수량
-
- if( model.getValue(sPRCPLIST_PATH + "[" + desrow + "]/opansflagcd") == "") {
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/opansflagcd" , "-"); //수술마취구분
- }
-
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/offictourhealexamflag", "N"); //출장검진구분
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpdayno" , 1); //처방횟수(일자)
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpgenrflag" , model.getValue("/root/main/patinfocond/patinfo/ordtype"));
- model.setvalue(sPRCPLIST_PATH + "[" + desrow + "]/prcpsignflag" , ""); //전처방에서 2로 copy되어 ""로 초기화
- //환자 급비유형(수정이전 정보 : insukind, 수정이후 정보 : payflagcd)에 들어감)
- //model.setvalue(sPRCPLIST_PATH + "[" + desrow + "]/spynpy1" , model.getValue("/root/main/patinfocond/patinfo/insukind"));
-
- //처방수량단위 설정, 약품일 경우 '3', 그 이외는 '-'로 설정
- var prcpclscd = model.getValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpclscd");
- if(prcpclscd == "A2" || prcpclscd == "A4" || prcpclscd == "A6"){
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpqtyunitflag", "3");
- }else{
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpqtyunitflag", "-");
- }
-
- //가정간호 환자인 경우 처방적용일에 방문일자 셋팅
- if(model.getValue("/root/main/cond/homecareyn") == "Y") {
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpdelivefact", model.getValue("/root/main/cond/visitdd")); //방문일자
- }else{
- model.setValue(sPRCPLIST_PATH + "[" + desrow + "]/prcpdelivefact", model.getValue("/root/main/cond/prcpdd")); //적용일자
- }
-
- model.makeValue(sPRCPLIST_PATH + "[" + desrow + "]/fstrgstrnm", "");
- model.makeValue(sPRCPLIST_PATH + "[" + desrow + "]/resncnts", "");
- model.makeValue(sPRCPLIST_PATH + "[" + desrow + "]/confirmdrnm", "");
- model.makeValue(sPRCPLIST_PATH + "[" + desrow + "]/confirmdt", "");
- }
- /**
- * @desc : 간호처방 저장
- * @
- * @param :
- * @return :
- * @author : 오지훈 2008. 1. 4
- * @---------------------------------------------------
- */
- function fSavePrcp(){
-
- if(submit("TXMNW10901")){
- //오류팝업
- var prcpErrList = model.instances(0).selectNodes( "/root/temp/result/prcperrlist" );
- if ( prcpErrList.length > 0 ) {
- if ( !isNull(model.getValue ("/root/temp/result/prcperrlist/prcpcd"))){
- var xpt = window.screenleft + 100;
- var ypt = window.screenTop + 50;
- var coord = getRelativeCoordinate ( xpt, ypt );
- var mon = coord[0];
- xpt = coord[1];
- ypt = coord[2];
- open ( "SPMMO00600", mon, xpt, ypt, "prcpdetl", "/root/temp/result", "/root/result", "", false );
-
- model.removeNodeset("/root/temp/result/prcperrlist");
- model.refresh();
- }
- } else {
- model.toggle("case_bf"); //전처방 화면으로 변경
- btn_bf.dispatch("onclick");
- //처방 저장 후 전처방 조회시 저장된 처방이 보이도록 스크롤을 가장 위로 함
- grd_bfprcplist.topRow = 1;
- model.removeNodeset(sPRCPLIST_PATH);
- model.resetInstanceNode("/root/main/insumsginfo/insuinfo/limmsg");
- fReqBfNursPrcpInfo(); // 전처방 조회
- fReqTempNursPrcpInfo(); // 임시처방 조회
- if(getScreenMenuParameter() == "SMMNH" || opener.javascript.getParameter("screenParam") == "SMMNH"){
- fSearchHomePatInfo(); // 방문일자 조회_20090330(ByJA)
- }
- }
- }
- }
- /**
- * @desc : 처방저장 오류내역표시
- * @
- * @param :
- * @return :
- * @author : 성미연 2008. 2. 23
- * @---------------------------------------------------
- */
- function fDestDisplayErrlist(errListPath, gridID ){
- var gridObj = document.controls.item(gridID);
-
- gridObj.rebuildStyle();
- //전처방 리스트에서 반납일 경우 텍스트 빨간색
- for (var i = 1; i<= getNodesetCount(errListPath); i++) {
- var prcplineno = model.getValue(errListPath + "[" + i + "]/prcplineno");
- for (var j = 1; j< gridObj.rows; j++) {
- if (prcplineno == j ) {
- gridObj.rowStyle(j, "data", "color") = "#FF0000";
- }
-
- }
- }
- }
- /**
- * @desc : 처방 SET 그리드 클릭시
- * @
- * @param :
- * @return :
- * @author : 성미연 2008. 1. 9
- * @---------------------------------------------------
- */
- function fClickSetPrcp(mthdflag){
- if(isNull(mthdflag)) mthdflag = "dblclick"; //복사 버튼은 btnclick
- if ( !isDataCell() && mthdflag != "btnclick" ) {
- return;
- }
- if (grd_prcplist.row > 0 ){
-
- if (model.getValue("/root/main/cond/patnm") == "") {
- messageBox("해당 환자를", "C002");
- return;
- }
- if (grp_prcpapp.visible == true){
- messageBox("처방적용일을 확인 후 진행하세요.", "C");
- return;
- }
- if (model.getValue("/root/main/cond/homecareyn") == "Y" && model.getValue("/root/main/cond/visitdd") == "") {
-
- // 방문일자를 선택하지 않은 경우 안내 메시지와 함께 방문일자가 처방당일로 자동 설정 되도록 요청에 의해 수정_김숙인ITC요청_20081215수정(ByJA)
- var rtnval = messageBox("방문일을 선택하지 않으셨습니다. 방문일을 처방일과 동일하게 계속 진행하시겠습니까?", "S"); // return : yes=6, no=7
- if(rtnval == "6"){ // yes
- model.makeValue("/root/main/cond/visitdd", model.getValue("/root/main/cond/prcpdd"));
- cmb_visitdd.refresh();
- }else{
- return;
- }
-
- /* 원본_20081215
- // messageBox("방문일자를", "C002");
- // return;
- */
- }
-
- //ALL SIZE 처방 처리
- if(model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/prcpclscd") == "M2"
- && model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/matrallsizespecid") == "ALL") {
-
- var grupsnglflag = model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/grupsnglflag");
- //** prcpinptflag || '|' ||matrsetflag || '|' ||matrsizeflag || '|' ||calcscorcd AS calcscormastspec
- var calcscormastspec = (model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/calcscormastspec")).split("|");
- var matrsizeflag = calcscormastspec[2];
- var matrallsizespecid = model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/matrallsizespecid");
-
- var xpt = window.screenleft + 100;
- var ypt = window.screenTop + 50;
- var coord = getRelativeCoordinate ( xpt, ypt );
- var mon = coord[0];
- xpt = coord[1];
- ypt = coord[2];
-
- setParameter("scrnflag", "nursprcp");
- setParameter("grupsnglflag", 'S');
- setParameter("calcscorcd", calcscormastspec[3]);
- setParameter("matrallsizespecid", matrallsizespecid);
- setParameter("currow", grd_prcplist.row);
- setParameter("targetpath", "/root/main/prcp/prcplist");
- //setParameter("targetgridid", "grd_prcpposlist");
- modal("SPMNW11500", mon, xpt, ypt);
-
- }else{
- //처방 main grid로 약속처방 copy
- mnwAddNursPrcp(sPRCPSETLIST_PATH, "/root/main/prcp", grd_prcplist.row, "");
- fSetNursPrcpDefault(model.instances(0).selectNodes("/root/main/prcp/prcplist").length);
- model.setValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.rows + "]/status", "I"); //처방상태 : 신규
- }
-
- // 16.10.10_심사팀 요청에 의한 추가
- var sprcpcd = model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/prcpcd");
- model.makeValue("/root/send/reqdata/prcpcd", sprcpcd);
- //alert("시작 : " + sprcpcd );
- //alert(instance1.selectNodesXml("/root/send/reqdata"));
- submit("TRMNW10923", false); //부서콤보 조회
- if (model.getValue("/root/temp/insulinfo/insulinfo/insulinfo") == "Y") {
- messageBox("선별급여 품목이오니 보험기준 확인 후 저장바랍니다.", "E999");
- }
-
- /*
- // 16.09.27_심사팀 요청에 의한 추가_AYS
- if(model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/insulinfoyn") == "Y") {
- messageBox("선별급여 품목이오니 보험기준 확인 후 저장바랍니다.", "E999");
- }
- */
-
- fSetPrcpInfo();
- //신규처방은 반환컬럼 disable
- grd_prcpposlist.isReadOnly(model.instances(0).selectNodes("/root/main/prcp/prcplist").length, grd_prcpposlist.colRef("tempcol8")) = true;
- if ( model.getValue(sPRCPLIST_PATH + "[" + model.instances(0).selectNodes("/root/main/prcp/prcplist").length + "]/estmcls")!= "Y" ){
- grd_prcpposlist.isReadOnly(model.instances(0).selectNodes("/root/main/prcp/prcplist").length, grd_prcpposlist.colRef("nigtprcpflag") ) = true;
- }
-
-
- //수가 보험정보 조회
- var calcscormastspec = model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/calcscormastspec");
- var calcscorcd = calcscormastspec.split("|");
- fInsuMsgInfoRef(calcscorcd[3]);
-
-
-
-
- //20110328 이선경(경북대) : 물품코드일 경우 응급처방여부 체크 가능하고 물품이 아니면 체크불가
- /*
- var prcpclscd = model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/prcpclscd");
- var idx = model.instances(0).selectNodes("/root/main/prcp/prcplist").length;
- if(prcpclscd == "M2" || prcpclscd == "H4") {
- model.setvalue(sPRCPLIST_PATH + "[" + idx + "]/erprcpflag" , "N");
- } else {
- grd_prcpposlist.isReadOnly(idx, grd_prcpposlist.colRef("erprcpflag")) = true;
- }
- */
- }
- }
-
- /**
- * @desc : 전처방 그리드 클릭시
- * @
- * @param :
- * @return :
- * @author : 성미연 2008. 1. 9
- * @---------------------------------------------------
- */
- function fClickBfPrcp(mthdflag){
- if(isNull(mthdflag)) mthdflag = "dblclick"; //복사 버튼은 btnclick
-
- if ( !isDataCell() && mthdflag != "btnclick" ) {
- return;
- }
-
- if (grd_bfprcplist.row > 0 ){
-
- if (model.getValue("/root/main/cond/patnm") == "") {
- messageBox("해당 환자를", "C002");
- return;
- }
- if (grp_prcpapp.visible == true){
- messageBox("처방적용일을 확인 후 진행하세요.", "C");
- return;
- }
-
- var prcphistcd = model.getValue(sBFPRCPLIST_PATH + "[" + grd_bfprcplist.row + "]/prcphistcd");
- var flag = model.getValue(sBFPRCPLIST_PATH + "[" + grd_bfprcplist.row + "]/flag");
- var prcpcd = model.getValue(sBFPRCPLIST_PATH + "[" + grd_bfprcplist.row + "]/prcpcd");
-
- if(flag == "N") {
- messageBox("[" + prcpcd + "]처방은 수가가 종료되어 반환만 가능합니다.", "E");
- }
-
- if (prcphistcd == "L" || prcphistcd == "D" ) {
- return;
-
- }else{
- //가정간호
- if (model.getValue("/root/main/cond/homecareyn") == "Y"){
- if (model.getValue("/root/main/cond/visitdd") == ""){
- var rtnval = messageBox("방문일을 선택하지 않으셨습니다. 방문일을 처방일과 동일하게 계속 진행하시겠습니까?", "S"); // return : yes=6, no=7
- if(rtnval == "6"){ // yes
- model.makeValue("/root/main/cond/visitdd", model.getValue("/root/main/cond/prcpdd"));
- cmb_visitdd.refresh();
- }else{
- return;
- }
- /* 원본_20090122
- messageBox("방문일자를", "C002");
- return;
- */
- }
- //방문일자와 다른 방문일의 처방 클릭시 blocking
- if (model.getValue("/root/main/cond/visitdd") != model.getValue(sBFPRCPLIST_PATH + "[" + grd_bfprcplist.row + "]/prcpdelivefact")){
- messageBox("방문일이 동일한 처방에 대해서만 일괄 저장이 가능합니다.", "C");
- return;
- }
- }
- mnwAddNursPrcp(sBFPRCPLIST_PATH, "/root/main/prcp", grd_bfprcplist.row, "");
- fSetNursPrcpDefault(model.instances(0).selectNodes("/root/main/prcp/prcplist").length);
- model.setValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.rows + "]/status", "B"); //처방상태[전]
- }
-
- fSetPrcpInfo();
- if ( model.getValue(sPRCPLIST_PATH + "[" + model.instances(0).selectNodes("/root/main/prcp/prcplist").length + "]/estmcls")!= "Y" ){
- grd_prcpposlist.isReadOnly(model.instances(0).selectNodes("/root/main/prcp/prcplist").length, grd_prcpposlist.colRef("nigtprcpflag") ) = true;
- }
- //수가 보험정보 조회
- var calcscormastspec = model.getValue(sBFPRCPLIST_PATH + "[" + grd_bfprcplist.row + "]/calcscormastspec");
- var calcscorcd = calcscormastspec.split("|");
- fInsuMsgInfoRef(calcscorcd[3]);
- //20110328 이선경(경북대) : 물품코드일 경우 응급처방여부 체크 가능하고 물품이 아니면 체크불가
- /*
- var prcpclscd = model.getValue(sBFPRCPLIST_PATH + "[" + grd_bfprcplist.row + "]/prcpclscd");
- var idx = model.instances(0).selectNodes("/root/main/prcp/prcplist").length;
- if(prcpclscd == "M2") {
- model.setvalue(sPRCPLIST_PATH + "[" + idx + "]/erprcpflag" , "N");
- } else {
- grd_prcpposlist.isReadOnly(idx, grd_prcpposlist.colRef("erprcpflag")) = true;
- }
- */
- }
- }
- /**
- * @desc : 임시처방 그리드 클릭시
- * @
- * @param :
- * @return :
- * @author : 성미연 2008. 1. 9
- * @---------------------------------------------------
- */
- function fClickTempPrcp(){
- if (isDataCell()) {
- if (grd_tempprcplist.row > 0 ){
-
- if (model.getValue("/root/main/cond/patnm") == "") {
- messageBox("해당 환자를", "C002");
- return;
- }
- if (grp_prcpapp.visible == true){
- messageBox("처방적용일을 확인 후 진행하세요.", "C");
- return;
- }
- if (model.getValue("/root/main/cond/homecareyn") == "Y" && model.getValue("/root/main/cond/visitdd") == "") {
- messageBox("방문일자를", "C002");
- return;
- }
- if (grd_prcpposlist.findRow(model.getValue(sTEMPPRCPLIST_PATH + "[" + grd_tempprcplist.row + "]/tempcol21"), 1, grd_prcpposlist.colRef("tempcol21")) != -1) { //없으면 -1, 있으면 해당 row 리턴
- messageBox("처방이", "E006");
- return;
- }
-
- var prcpclscd = model.getValue(sTEMPPRCPLIST_PATH + "[" + grd_tempprcplist.row + "]/prcpclscd");
- var grupsnglflag = model.getValue(sTEMPPRCPLIST_PATH + "[" + grd_tempprcplist.row + "]/grupsnglflag");
- //** prcpinptflag || '|' ||matrsetflag || '|' ||matrsizeflag || '|' ||calcscorcd AS calcscormastspec
- var calcscormastspec = (model.getValue(sTEMPPRCPLIST_PATH + "[" + grd_tempprcplist.row + "]/calcscormastspec")).split("|");
- var matrsizeflag = calcscormastspec[2];
- var matrallsizespecid = model.getValue(sTEMPPRCPLIST_PATH + "[" + grd_tempprcplist.row + "]/matrallsizespecid"); //""
-
- //ALL SIZE 처방 처리(임시처방에서 처방발행시 활동진술문 중 규격이 매핑되어 있지 않은 경우)
- if(prcpclscd == "M2" && grupsnglflag == "S" && matrsizeflag == "Y" && (matrallsizespecid == "" || matrallsizespecid == "-")){
- var xpt = window.screenleft + 100;
- var ypt = window.screenTop + 50;
- var coord = getRelativeCoordinate ( xpt, ypt );
- var mon = coord[0];
- xpt = coord[1];
- ypt = coord[2];
-
- setParameter("scrnflag", "tempprcp");
- setParameter("grupsnglflag", 'S');
- setParameter("calcscorcd", calcscormastspec[3]);
- setParameter("matrallsizespecid", matrallsizespecid);
- setParameter("currow", grd_tempprcplist.row);
- setParameter("targetpath", "/root/main/prcp/prcplist");
- //setParameter("targetgridid", "grd_prcpposlist");
- modal("SPMNW11500", mon, xpt, ypt);
-
- }else{
- //처방 main grid로 임시처방 copy
- mnwAddNursPrcp(sTEMPPRCPLIST_PATH, "/root/main/prcp", grd_tempprcplist.row, "");
- fSetNursPrcpDefault(model.instances(0).selectNodes("/root/main/prcp/prcplist").length);
- model.setValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.rows + "]/status", "T"); //처방상태[임]
- }
-
- fSetPrcpInfo();
- //임시처방은 반환컬럼 disable
- grd_prcpposlist.isReadOnly(model.instances(0).selectNodes("/root/main/prcp/prcplist").length, grd_prcpposlist.colRef("tempcol8")) = true;
- if ( model.getValue(sPRCPLIST_PATH + "[" + model.instances(0).selectNodes("/root/main/prcp/prcplist").length + "]/estmcls")!= "Y" ){
- grd_prcpposlist.isReadOnly(model.instances(0).selectNodes("/root/main/prcp/prcplist").length, grd_prcpposlist.colRef("nigtprcpflag") ) = true;
- }
-
- //수가 보험정보 조회
- var calcscormastspec = model.getValue(sTEMPPRCPLIST_PATH + "[" + grd_tempprcplist.row + "]/calcscormastspec");
- var calcscorcd = calcscormastspec.split("|");
- fInsuMsgInfoRef(calcscorcd[3]);
- //20110328 이선경(경북대) : 물품코드일 경우 응급처방여부 체크 가능하고 물품이 아니면 체크불가
- /*
- var idx = model.instances(0).selectNodes("/root/main/prcp/prcplist").length;
- if(prcpclscd == "M2") {
- model.setvalue(sPRCPLIST_PATH + "[" + idx + "]/erprcpflag" , "N");
- } else {
- grd_prcpposlist.isReadOnly(idx, grd_prcpposlist.colRef("erprcpflag")) = true;
- }
- */
- }
- }
- }
- /**
- * @desc : 처방저장 그리드 저장 이전 셋팅
- * @
- * @param :
- * @return :
- * @author : 성미연 2008. 1. 9
- * @---------------------------------------------------
- */
- function fSetPrcpInfo(refYN){
- //KNUH, 처방복사 버튼 클릭하여 선택된 처방 리스트를 복사하는 기능을 위해 refYN 인자 추가 (2011.02.16 JJE)
- if( isNull(refYN) ) refYN = "Y";
-
- //환자상태가 병동, 응급의료센터일 경우 선처치 비활성화
- var ordtype = model.getValue("/root/main/patinfocond/patinfo/ordtype");
- if (ordtype == 'I' || ordtype == 'E') {
- grd_prcpposlist.colDisabled(grd_prcpposlist.colRef("precureprcpflag")) = true;
- } else {
- grd_prcpposlist.colDisabled(grd_prcpposlist.colRef("precureprcpflag")) = false;
- }
-
- //KNUH, 처방복사 버튼 클릭하여 선택된 처방 리스트를 복사하는 기능을 위해 refYN 값에 따라 refresh 처리 분기 (2011.02.16 JJE)
- if(refYN == "Y") grd_prcpposlist.refresh();
-
- //수술처방이 아닐 경우 수술유형 콤보 비활성화
- /*
- if (model.getValue("/root/main/prcp/prcplist[" + grd_prcpposlist.rows + "]/prcpclscd") != "H2"){
- grd_prcpposlist.colDisabled(grd_prcpposlist.colRef("opansflagcd")) = true;
- }
- */
- }
- /**
- * @desc : 처방저장 그리드에서 처방 삭제(드래그하여 delete key이용)
- * @
- * @param :
- * @return :
- * @author : 성미연 2008. 1. 9
- * @---------------------------------------------------
- */
- function fDragDelPrcp() {
- if (event.keyCode == "46") {
- for (i = 0; i < grd_prcpposlist.selectedRows; i++) {
- model.setValue("/root/main/prcp/prcplist[" + grd_prcpposlist.selectedRow(i) + "]/status", 'D');
- }
-
- for (i = 1; i <= getNodesetCount("/root/main/prcp/prcplist"); i++) {
- if (model.getValue("/root/main/prcp/prcplist[" + i + "]/status") == 'D') {
- grd_prcpposlist.deleteRow(i, false);
- i--;
- }
- }
- model.refresh();
- }
- }
-
- /**
- * @desc : 처방저장 그리드에서 반환컬럼 클릭시(물품 팝업, 수량, 총용량 변경)
- * @
- * @param :
- * @return :
- * @author : 성미연 2008. 1. 9
- * @---------------------------------------------------
- */
- function fClickRtn() {
- var iRow = grd_prcpposlist.row;
- var prcppkspec = model.getValue("/root/main/prcp/prcplist[" + iRow + "]/prcppkspec");
- var deptcd = "";
- var pid = model.getValue("/root/main/cond/pid");
- var indd = model.getValue("/root/main/paminfo/list/indd");
-
- if ( !isNull(model.getValue("/root/code/codeinfo/codelist[cdgrupid ='002' and cdid ='"+combo1.value+"']/cdid")) ) {
- deptcd = model.getValue("/root/init/patinfo/patlist[pid='" + pid + "']/grupcd");
- } else {
- deptcd = model.getValue("/root/main/cond/wardcd");
- }
- /*
- if(grd_prcpposlist.col == grd_prcpposlist.colRef("anamneflag")){
- var clincstdyflag = model.getValue("/root/main/cond/clincstdyflag");
- var anamneflag = model.getValue("/root/main/prcp/prcplist[" + iRow + "]/anamneflag");
- if(clincstdyflag == "Y") {
- messageBox ( "기왕증은 임상연구와 동시에 선택 할 수", "I004" );
- model.setValue("/root/main/prcp/prcplist[" + iRow + "]/anamneflag", "N");
- } else {
- if(anamneflag == "Y"){ //기왕증이 Y로 처리된 경우에만 보조유형선택 팝업 open
- var subcretno = fGetSubcretno(pid, indd, "anamneflag");
- if(subcretno == "0"){
- messageBox ( "환자의 부유형이 없거나 또는 선택되지 않았습니다.", "I999" );
- model.setValue("/root/main/prcp/prcplist[" + iRow + "]/anamneflag", "N");
- model.setValue("/root/main/prcp/prcplist[" + iRow + "]/subcretno", "0");
- } else {
- model.setValue("/root/main/prcp/prcplist[" + iRow + "]/subcretno", subcretno);
- }
- }else{ //기왕증이 N로 처리된 경우에는 subcretno 0로 처리
- model.setValue("/root/main/prcp/prcplist[" + iRow + "]/subcretno", "0");
- }
- }
- } else */
- if(grd_prcpposlist.col == grd_prcpposlist.colRef("tempcol8")){
- //전처방에서 복사된 처방일 경우([전])
- if(model.getValue("/root/main/prcp/prcplist[" + iRow + "]/status") == "B") {
- //전처방을 여러개 이동하고 반환시 두개이상 체크할 경우 alert(한개만 삭제 요청하도록)
- if (getNodesetCount(sPRCPLIST_PATH + "[prcppkspec = '"+ prcppkspec + "' and tempcol8 = 'Y']/tempcol8") > 1) {
- messageBox("반환요청이", "E006");
- model.setValue("/root/main/prcp/prcplist[" + iRow + "]/tempcol8", "N");
- grd_prcpposlist.refresh();
- return;
- }
-
- //물품반납부서 선택 팝업(재료인 경우)
- if (model.getValue("/root/main/prcp/prcplist[" + iRow + "]/tempcol8") == "Y"
- && model.getValue("/root/main/prcp/prcplist[" + iRow + "]/prcpclscd") == "M2"
- && model.getValue("/root/main/prcp/prcplist[" + iRow + "]/issdeptcd") != deptcd ) {
- fPopGoodRtn("/root/main/prcp/prcplist[" + iRow + "]", iRow);
- }
- //set처방, 검색 처방일 경우(신규 - row 삭제), 임시처방도 삭제
- }else{
- model.removeNode(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]");
- }
- } else if(grd_prcpposlist.col == grd_prcpposlist.colRef("prcpvol")){ //수량, 총용량 변경시
- if(!isNaN(model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/prcpvol"))) {
- DrugCalc ("prcpvol" , grd_prcpposlist.row);
- } else {
- model.setValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/prcpvol",model.getValue("/root/drugcalc/prcpvol"));
- }
- } else if(grd_prcpposlist.col == grd_prcpposlist.colRef("prcpqty")) {
- if(!isNaN(model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/prcpqty"))) {
- DrugCalc ("prcpqty" , grd_prcpposlist.row);
- } else {
- model.setValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/prcpqty",model.getValue("/root/drugcalc/prcpqty"));
- }
- } else if(grd_prcpposlist.col == grd_prcpposlist.colRef("drprcpetc7")) {
- if(!isNaN(model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/drprcpetc7"))) {
- DrugCalc ("drprcpetc7" , grd_prcpposlist.row);
- } else {
- model.setValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/drprcpetc7",model.getValue("/root/drugcalc/drprcpetc7"));
- }
- } else if(grd_prcpposlist.col == grd_prcpposlist.colRef("drprcpetc8")) {
- if(!isNaN(model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/drprcpetc8"))) {
- DrugCalc ("drprcpetc8" , grd_prcpposlist.row);
- } else {
- model.setValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/drprcpetc8",model.getValue("/root/drugcalc/drprcpetc8"));
- }
- } else if(grd_prcpposlist.col == grd_prcpposlist.colRef("prcptims")) {
- if(!isNaN(model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/prcptims"))) {
- DrugCalc ("prcptims" , grd_prcpposlist.row);
- } else {
- model.setValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/prcptims",model.getValue("/root/drugcalc/prcptims"));
- }
- } else if(grd_prcpposlist.col == grd_prcpposlist.colRef("drgacptflag")) {
- if(model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/drgacptflag") == "A") { // PCA용 약제
- messageBox ( "급여구분이 '본인부담'으로 변경 됩니다.", "I" );
- model.setValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/payflagcd", "1");
- } else if(model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/drgacptflag") == "B") { // 미용성형
- messageBox ( "급여구분이 '비급여'으로 변경 됩니다.", "I" );
- model.setValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/payflagcd", "2");
- }
- }
- model.refresh();
- }
- /**
- * @desc : 귀가유치물품 관련 데이터(여부,수량) 입력값 체크
- * @
- * @param : iRow-체크대상 행번호
- * @return :
- * @author : 김진아 2009.02.06
- * @---------------------------------------------------
- */
- function fChkHomeMatr(iRow){
- var ordtype = model.getValue("/root/main/patinfocond/patinfo/ordtype");
- var prcpclscd = model.getValue("/root/main/prcp/prcplist[" + iRow + "]/prcpclscd");
- var homematrflag = model.getValue("/root/main/prcp/prcplist[" + iRow + "]/homematrflag");
- var homematrqty = model.getValue("/root/main/prcp/prcplist[" + iRow + "]/homematrqty");
- var prcpqty = model.getValue("/root/main/prcp/prcplist[" + iRow + "]/prcpqty");
- if( (model.getValue("/root/main/prcp/prcplist[" + iRow + "]/homematrflag")=="Y")
- ||(model.getValue("/root/main/prcp/prcplist[" + iRow + "]/homematrqty") !="0")){
- if(ordtype!="O"){
- messageBox("귀가유치물품을 지정할 수 없는 환자입니다.", "I", "(외래환자만 지정가능)");
- model.makeValue("/root/main/prcp/prcplist[" + iRow + "]/homematrflag", "N");
- model.makeValue("/root/main/prcp/prcplist[" + iRow + "]/homematrqty" , "0");
- return ;
- } else if(prcpclscd!="M2"){
- messageBox("귀가유치물품을 지정할 수 없는 처방입니다.", "I", "(재료처방만 지정가능)");
- model.makeValue("/root/main/prcp/prcplist[" + iRow + "]/homematrflag", "N");
- model.makeValue("/root/main/prcp/prcplist[" + iRow + "]/homematrqty" , "0");
- return ;
- } else if(Number(prcpqty) < Number(homematrqty)){
- messageBox("처방수량보다 귀가유치물품수량이 더 많을 수 없습니다.", "I", "처방수량 확인 후 다시 지정하십시오.");
- model.makeValue("/root/main/prcp/prcplist[" + iRow + "]/homematrqty" , "0");
- return ;
- }
- }
- }
- /**
- * @desc : 총용량, 수량의 수정전 값을 instance에 넣어둔다.
- * @
- * @param :
- * @return :
- * @author : 성미연 2008. 3. 17
- * @---------------------------------------------------
- */
- function fSetPrcpVolQty() {
-
- var curCol = grd_prcpposlist.col;
-
- if(curCol == grd_prcpposlist.colRef("prcpvol")){
- model.setValue("/root/drugcalc/prcpvol", model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/prcpvol"));
- } else if(curCol == grd_prcpposlist.colRef("prcpqty")){
- model.setValue("/root/drugcalc/prcpqty", model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/prcpqty"));
- } else if(curCol == grd_prcpposlist.colRef("prcptims")){
- model.setValue("/root/drugcalc/prcptims", model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/prcptims"));
- } else if(curCol == grd_prcpposlist.colRef("drprcpetc7")){
- model.setValue("/root/drugcalc/drprcpetc7", model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/drprcpetc7"));
- } else if(curCol == grd_prcpposlist.colRef("drprcpetc8")){
- model.setValue("/root/drugcalc/drprcpetc8", model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.row + "]/drprcpetc8"));
- }
- }
- /**
- * @desc : 용량, 수량, 횟수를 수정했을 때 값계산
- * @
- * @param : flag : 용량, 수량, 횟수 변경 구분
- curRow : 수정할 현재 row
- * @return : void
- * @author : 마정민 2007. 4. 30
- * 소스카피 by cha
- * @---------------------------------------------------
- */
- /*
- function DrugCalc ( flag, curRow ) {
-
- var PrcpVol = model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol" );
- if ( isNull(PrcpVol) || PrcpVol == 0 ) {
- PrcpVol = "1";
- }
-
- var PrcpQty = model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty" );
- if ( isNull(PrcpQty) || PrcpQty == 0 ){
- PrcpQty = "1";
- }
- var bfPrcpVol = model.getValue ( "/root/drugcalc/prcpvol" );
- if ( isNull(bfPrcpVol) || bfPrcpVol == 0 ) {
- bfPrcpVol = "1";
- }
-
- var bfPrcpQty = model.getValue ( "/root/drugcalc/prcpqty" );
- if ( isNull(bfPrcpQty) || bfPrcpQty == 0 ) {
- bfPrcpQty = "1";
- }
-
- var calcPrcpVol = 0;
- var calcPrcpQty = 0;
-
- // if ( flag == "prcpvol" && bfPrcpVol != PrcpVol ) { // 용량을 수정했을 때: 수량 자동계산
- // calcPrcpQty = eval(PrcpVol) / eval(bfPrcpVol) * eval(PrcpQty)*1000;
- // calcPrcpQty = Math.round(calcPrcpQty)/1000;
- // model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty", calcPrcpQty );
- //
- // } else if ( flag == "prcpqty" && bfPrcpQty != PrcpQty ) { // 수량을 수정했을 때: 용량 자동계산
- // calcPrcpVol = eval(PrcpQty) / eval(bfPrcpQty) * eval(PrcpVol)*1000;
- // calcPrcpVol = Math.round(calcPrcpVol)/1000;
- // model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", calcPrcpVol );
- // }20100514 khj
- //20090820 마정민 수정. 약인 경우는 최초의 용량 수량 비율로 계산하는 것으로 수정
- var baseQty = getArrayData ( model.getValue ( "/root/main/prcp/prcplist[" + curRow + "]/drugmastspec" ) + "^", 0, 31 , "^", "|" );
- var baseVol = getArrayData ( model.getValue ( "/root/main/prcp/prcplist[" + curRow + "]/drugmastspec" ) + "^", 0, 32 , "^", "|" );
-
- if (model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpclscd" ).substring ( 0, 1 ) == "A" && !isNull(baseQty) && !isNull(baseVol)) {
- var baseQty = getArrayData ( model.getValue ( "/root/main/prcp/prcplist[" + curRow + "]/drugmastspec" ) + "^", 0, 31 , "^", "|" );
- var baseVol = getArrayData ( model.getValue ( "/root/main/prcp/prcplist[" + curRow + "]/drugmastspec" ) + "^", 0, 32 , "^", "|" );
-
- if ( flag == "prcpvol" && bfPrcpVol != PrcpVol ) { // 용량을 수정했을 때: 수량 자동계산
- calcPrcpQty = parseFloat(PrcpVol) / parseFloat(baseVol) * parseFloat(baseQty)*1000;
- calcPrcpQty = Math.round(calcPrcpQty)/1000;
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty", calcPrcpQty );
- } else if ( flag == "prcpqty" && bfPrcpQty != PrcpQty ) { // 수량을 수정했을 때: 용량 자동계산
- var prcpclscd = model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpclscd" );
- calcPrcpVol = parseFloat(PrcpQty) / parseFloat(baseQty) * parseFloat(baseVol)*1000;
- calcPrcpVol = Math.round(calcPrcpVol)/1000;
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", calcPrcpVol );
- }
- } else {
- if ( flag == "prcpvol" ) { // 용량을 수정했을 때: 수량 자동계산
- calcPrcpQty = eval(PrcpVol) / eval(bfPrcpVol) * eval(PrcpQty)*1000;
- calcPrcpQty = Math.round(calcPrcpQty)/1000;
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty", calcPrcpQty );
- } else if ( flag == "prcpqty" ) { // 수량을 수정했을 때: 용량 자동계산
- calcPrcpVol = eval(PrcpQty) / eval(bfPrcpQty) * eval(PrcpVol)*1000;
- calcPrcpVol = Math.round(calcPrcpVol)/1000;
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", calcPrcpVol );
- }
- }
- }
- */
- function DrugCalc ( flag, curRow ) {
-
- var PrcpVol = model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol" );
-
- if ( isNull(PrcpVol) || PrcpVol == 0 ) {
- PrcpVol = "1";
- }
- var PrcpQty = model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty" );
- if ( isNull(PrcpQty) || PrcpQty == 0 ){
- PrcpQty = "1";
- }
- var PrcpTims = model.getValue (sPRCPLIST_PATH + "[" + curRow + "]/prcptims" );
- if ( isNull(PrcpTims) || PrcpTims == 0 ) {
- PrcpTims = "1";
- }
- var drprcpetc7 = model.getValue (sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7" );
- var drprcpetc7_2 = model.getValue (sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7" );
- if ( isNull(drprcpetc7) || drprcpetc7 == 0 || drprcpetc7 == "-") {
- drprcpetc7 = "1";
- }
- var drprcpetc8 = model.getValue (sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8" );
- var drprcpetc8_2 = model.getValue (sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8" );
- if ( isNull(drprcpetc8) || drprcpetc8 == 0 || drprcpetc8 == "-") {
- drprcpetc8 = "1";
- }
-
- var bfPrcpVol = model.getValue ( "/root/drugcalc/prcpvol" );
- if ( isNull(bfPrcpVol) || bfPrcpVol == 0 ) {
- bfPrcpVol = "1";
- }
- var bfPrcpQty = model.getValue ( "/root/drugcalc/prcpqty" );
- if ( isNull(bfPrcpQty) || bfPrcpQty == 0 ) {
- bfPrcpQty = "1";
- }
- var bfprcpTims = model.getValue ( "/root/drugcalc/prcptims" );
- if ( isNull(bfprcpTims) || bfprcpTims == 0 ) {
- bfprcpTims = "1";
- }
- var bfdrprcpetc7 = model.getValue ( "/root/drugcalc/drprcpetc7" );
- if ( isNull(bfdrprcpetc7) || bfdrprcpetc7 == 0 ) {
- bfdrprcpetc7 = "1";
- }
- var bfdrprcpetc8 = model.getValue ( "/root/drugcalc/drprcpetc8" );
- if ( isNull(bfdrprcpetc8) || bfdrprcpetc8 == 0 ) {
- bfdrprcpetc8 = "1";
- }
- var calcPrcpVol = 0;
- var calcPrcpQty = 0;
- var calcPrcpTimeVol = 0;
- var calcPrcpTimeQty = 0;
-
- //20090820 마정민 수정. 약인 경우는 최초의 용량 수량 비율로 계산하는 것으로 수정
- var baseQty = getArrayData ( model.getValue ( "/root/main/prcp/prcplist[" + curRow + "]/drugmastspec" ) + "^", 0, 31 , "^", "|" );
- var baseVol = getArrayData ( model.getValue ( "/root/main/prcp/prcplist[" + curRow + "]/drugmastspec" ) + "^", 0, 32 , "^", "|" );
- var drugcntsvol = getArrayData ( model.getValue ( "/root/main/prcp/prcplist[" + curRow + "]/drugmastspec" ) + "^", 0, 1 , "^", "|" );
- var drugstndvol = getArrayData ( model.getValue ( "/root/main/prcp/prcplist[" + curRow + "]/drugmastspec" ) + "^", 0, 3 , "^", "|" );
- var drugpackvol = getArrayData ( model.getValue ( "/root/main/prcp/prcplist[" + curRow + "]/drugmastspec" ) + "^", 0, 5 , "^", "|" );
- var drugbasevol = getArrayData ( model.getValue ( "/root/main/prcp/prcplist[" + curRow + "]/drugmastspec" ) + "^", 0, 7 , "^", "|" );
- var baseTimeVol = drugcntsvol * drugbasevol / drugpackvol;
- var baseTimeQty = drugbasevol;
-
- if (model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpclscd" ).substring ( 0, 1 ) == "A" && !isNull(baseQty) && !isNull(baseVol)) {
- if ( flag == "prcpvol" && bfPrcpVol != PrcpVol ) { // 용량을 수정했을 때: 수량 자동계산
- calcPrcpQty = parseFloat(PrcpVol) / parseFloat(baseVol) * parseFloat(baseQty)*1000;
- calcPrcpQty = Math.round(calcPrcpQty)/1000;
-
- calcPrcpTimeQty = parseFloat(PrcpVol) / parseFloat(baseVol) * parseFloat(baseTimeQty)*1000;
- calcPrcpTimeQty = Math.round(calcPrcpTimeQty)/1000;
- calcPrcpTimeVol = parseFloat(PrcpVol) / parseFloat(baseVol) * parseFloat(baseTimeVol)*1000;
- calcPrcpTimeVol = Math.round(calcPrcpTimeVol)/1000;
-
- //start: 요청번호 9851, 인슐린주사제 변경 alert (2010.01.28 JJE)
- var cnclInptTxt = model.getValue(sPRCPLIST_PATH + "[" + curRow + "]/prcpcd");
- var prcpcdEndTxt = cnclInptTxt.substring(cnclInptTxt.length-1, cnclInptTxt.length);
- if(model.getValue(sPRCPLIST_PATH + "[" + curRow + "]/tempcol2") == "05|04|09" && (prcpcdEndTxt == "J" || prcpcdEndTxt == "P") && calcPrcpQty < 1){
- messageBox(cnclInptTxt + "\n\n소량 처방을 원하시는 경우에는\nUNIT 단위 코드(원 처방의 끝자리 J나 P를 뺀 코드)로 변경 처방하여 주시기 바랍니다.", "I");
- //model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", bfPrcpVol );
- //return;
- } //end
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty", calcPrcpQty );
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7", calcPrcpTimeVol );
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8", calcPrcpTimeQty );
-
- } else if ( flag == "prcpqty" && bfPrcpQty != PrcpQty ) { // 수량을 수정했을 때: 용량 자동계산
-
- var prcpclscd = model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpclscd" );
- calcPrcpVol = parseFloat(PrcpQty) / parseFloat(baseQty) * parseFloat(baseVol)*1000;
- calcPrcpVol = Math.round(calcPrcpVol)/1000;
-
- calcPrcpTimeQty = parseFloat(PrcpQty) / parseFloat(baseQty) * parseFloat(baseTimeQty)*1000;
- calcPrcpTimeQty = Math.round(calcPrcpTimeQty)/1000;
- calcPrcpTimeVol = parseFloat(PrcpQty) / parseFloat(baseQty) * parseFloat(baseTimeVol)*1000;
- calcPrcpTimeVol = Math.round(calcPrcpTimeVol)/1000;
-
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", calcPrcpVol );
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7", calcPrcpTimeVol );
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8", calcPrcpTimeQty );
-
-
- } else if ( flag == "drprcpetc7" && bfdrprcpetc7 != drprcpetc7 ) { // 용량을 수정했을 때: 수량 자동계산
-
-
-
- calcPrcpQty = parseFloat(drprcpetc7) / parseFloat(baseTimeVol) * parseFloat(baseQty)*1000;
- calcPrcpQty = Math.round(calcPrcpQty)/1000;
- calcPrcpTimeQty = parseFloat(drprcpetc7) / parseFloat(baseTimeVol) * parseFloat(baseTimeQty)*1000;
- calcPrcpTimeQty = Math.round(calcPrcpTimeQty)/1000;
-
- calcPrcpVol = parseFloat(drprcpetc7) / parseFloat(baseTimeVol) * parseFloat(baseVol)*1000;
- calcPrcpVol = Math.round(calcPrcpVol)/1000;
-
- //start: 요청번호 9851, 인슐린주사제 변경 alert (2010.01.28 JJE)
- var cnclInptTxt = model.getValue(sPRCPLIST_PATH + "[" + curRow + "]/prcpcd");
- var prcpcdEndTxt = cnclInptTxt.substring(cnclInptTxt.length-1, cnclInptTxt.length);
- if(model.getValue(sPRCPLIST_PATH + "[" + curRow + "]/tempcol2") == "05|04|09" && (prcpcdEndTxt == "J" || prcpcdEndTxt == "P") && calcPrcpQty < 1){
- messageBox(cnclInptTxt + "\n\n소량 처방을 원하시는 경우에는\nUNIT 단위 코드(원 처방의 끝자리 J나 P를 뺀 코드)로 변경 처방하여 주시기 바랍니다.", "I");
- //model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", bfPrcpVol );
- //return;
- } //end
-
- if(drprcpetc7.substr(0,1) == "0") {
- calcPrcpQty = "1";
- calcPrcpVol = "1";
- calcPrcpTimeQty = "1";
- }
- if(drprcpetc8.substr(0,1) == "0") {
- calcPrcpQty = "1";
- calcPrcpVol = "1";
- calcPrcpTimeQty = "1";
- }
-
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty", calcPrcpQty );
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", calcPrcpVol );
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8", calcPrcpTimeQty );
-
-
-
- } else if ( flag == "drprcpetc8" && bfdrprcpetc8 != drprcpetc8 ) { // 수량을 수정했을 때: 용량 자동계산
- calcPrcpVol = parseFloat(drprcpetc8) / parseFloat(baseTimeQty) * parseFloat(baseVol)*1000;
- calcPrcpVol = Math.round(calcPrcpVol)/1000;
-
- calcPrcpTimeVol = parseFloat(drprcpetc8) / parseFloat(baseTimeQty) * parseFloat(baseTimeVol)*1000;
- calcPrcpTimeVol = Math.round(calcPrcpTimeVol)/1000;
-
- calcPrcpQty = parseFloat(drprcpetc8) / parseFloat(baseTimeQty) * parseFloat(baseQty)*1000;
- calcPrcpQty = Math.round(calcPrcpQty)/1000;
-
- if(drprcpetc7.substr(0,1) == "0") {
- calcPrcpQty = "1";
- calcPrcpVol = "1";
- calcPrcpTimeQty = "1";
- }
- if(drprcpetc8.substr(0,1) == "0") {
- calcPrcpQty = "1";
- calcPrcpVol = "1";
- calcPrcpTimeQty = "1";
- }
-
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", calcPrcpVol );
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty", calcPrcpQty );
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7", calcPrcpTimeVol );
-
- var prcpclscd = model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpclscd" );
-
- }
- } else {
-
- if ( flag == "prcpvol" ) { // 용량을 수정했을 때: 수량 자동계산
- calcPrcpQty = eval(PrcpVol) / eval(bfPrcpVol) * eval(PrcpQty)*1000;
- calcPrcpQty = Math.round(calcPrcpQty)/1000;
- calcPrcpTimeVol = eval(PrcpVol) / eval(bfPrcpVol) * eval(drprcpetc7)*1000;
- calcPrcpTimeVol = Math.round(calcPrcpTimeVol)/1000;
- calcPrcpTimeQty = eval(PrcpVol) / eval(bfPrcpVol) * eval(drprcpetc8)*1000;
- calcPrcpTimeQty = Math.round(calcPrcpTimeQty)/1000;
-
- //start: 요청번호 9851, 인슐린주사제 변경 alert (2010.01.28 JJE)
- var cnclInptTxt = model.getValue(sPRCPLIST_PATH + "[" + curRow + "]/prcpcd");
- var prcpcdEndTxt = cnclInptTxt.substring(cnclInptTxt.length-1, cnclInptTxt.length);
- if(model.getValue(sPRCPLIST_PATH + "[" + curRow + "]/tempcol2") == "05|04|09" && (prcpcdEndTxt == "J" || prcpcdEndTxt == "P") && calcPrcpQty < 1){
- messageBox(cnclInptTxt + "\n\n소량 처방을 원하시는 경우에는\nUNIT 단위 코드(원 처방의 끝자리 J나 P를 뺀 코드)로 변경 처방하여 주시기 바랍니다.", "I");
- //model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", bfPrcpVol );
- //return;
- } //end
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty", calcPrcpQty );
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7", calcPrcpTimeVol );
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8", calcPrcpTimeQty );
-
- } else if ( flag == "prcpqty" ) { // 수량을 수정했을 때: 용량 자동계산
- var prcpclscd = model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpclscd" );
- calcPrcpVol = eval(PrcpQty) / eval(bfPrcpQty) * eval(PrcpVol)*1000;
- calcPrcpVol = Math.round(calcPrcpVol)/1000;
-
- calcPrcpTimeVol = eval(PrcpQty) / eval(bfPrcpQty) * eval(drprcpetc7)*1000;
- calcPrcpTimeVol = Math.round(calcPrcpTimeVol)/1000;
- calcPrcpTimeQty = eval(PrcpQty) / eval(bfPrcpQty) * eval(drprcpetc8)*1000;
- calcPrcpTimeQty = Math.round(calcPrcpTimeQty)/1000;
-
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", calcPrcpVol );
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7", calcPrcpTimeVol );
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8", calcPrcpTimeQty );
-
- if ( prcpclscd == "M2" ) {
- //20090330 마정민수정. 귀가유치용 물품처방은 의사처방 수량을 수정하면 귀가유치용물품수량컬럼에 같이 반영한다.
- if (!isNull(model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc4")) && model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc4")!= "-" && model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc4" )>0){
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc4", PrcpQty );
- }
- }
- } else if ( flag == "drprcpetc7" && bfdrprcpetc7 != drprcpetc7 ) { // 용량을 수정했을 때: 수량 자동계산
-
- calcPrcpTimeQty = eval(drprcpetc7) / eval(bfdrprcpetc7) * eval(drprcpetc8)*1000;
- calcPrcpTimeQty = Math.round(calcPrcpTimeQty)/1000;
- calcPrcpVol = eval(drprcpetc7) / eval(bfdrprcpetc7) * eval(PrcpVol)*1000;
- calcPrcpVol = Math.round(calcPrcpVol)/1000;
- calcPrcpQty = eval(drprcpetc7) / eval(bfdrprcpetc7) * eval(PrcpQty)*1000;
- calcPrcpQty = Math.round(calcPrcpQty)/1000;
-
- //start: 요청번호 9851, 인슐린주사제 변경 alert (2010.01.28 JJE)
- var cnclInptTxt = model.getValue(sPRCPLIST_PATH + "[" + curRow + "]/prcpcd");
- var prcpcdEndTxt = cnclInptTxt.substring(cnclInptTxt.length-1, cnclInptTxt.length);
- if(model.getValue(sPRCPLIST_PATH + "[" + curRow + "]/tempcol2") == "05|04|09" && (prcpcdEndTxt == "J" || prcpcdEndTxt == "P") && calcPrcpQty < 1){
- messageBox(cnclInptTxt + "\n\n소량 처방을 원하시는 경우에는\nUNIT 단위 코드(원 처방의 끝자리 J나 P를 뺀 코드)로 변경 처방하여 주시기 바랍니다.", "I");
- //model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", bfPrcpVol );
- //return;
- } //end
- if(drprcpetc7.substr(0,1) == "0" && drprcpetc7.substr(1,1) != ".") {
- calcPrcpQty = "1";
- calcPrcpVol = "1";
- calcPrcpTimeQty = "1";
-
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7", "1");
- }
- if(drprcpetc8.substr(0,1) == "0" && drprcpetc8.substr(1,1) != ".") {
- calcPrcpQty = "1";
- calcPrcpVol = "1";
- calcPrcpTimeQty = "1";
-
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7", "1");
- }
-
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty", calcPrcpQty );
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", calcPrcpVol );
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8", calcPrcpTimeQty );
-
- if ( isNull(drprcpetc7_2) || drprcpetc7_2 == 0 || drprcpetc7_2 == "-") {
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7", "1");
- }
-
- } else if ( flag == "drprcpetc8" && bfdrprcpetc8 != drprcpetc8 ) { // 수량을 수정했을 때: 용량 자동계산
- calcPrcpTimeVol = eval(drprcpetc8) / eval(bfdrprcpetc8) * eval(drprcpetc7)*1000;
- calcPrcpTimeVol = Math.round(calcPrcpTimeVol)/1000;
- calcPrcpVol = eval(drprcpetc8) / eval(bfdrprcpetc8) * eval(PrcpVol)*1000;
- calcPrcpVol = Math.round(calcPrcpVol)/1000;
- calcPrcpQty = eval(drprcpetc8) / eval(bfdrprcpetc8) * eval(PrcpQty)*1000;
- calcPrcpQty = Math.round(calcPrcpQty)/1000;
-
- if(drprcpetc7.substr(0,1) == "0" && drprcpetc7.substr(1,1) != ".") {
- calcPrcpQty = "1";
- calcPrcpVol = "1";
- calcPrcpTimeVol = "1";
-
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8", "1");
- }
- if(drprcpetc8.substr(0,1) == "0" && drprcpetc8.substr(1,1) != ".") {
- calcPrcpQty = "1";
- calcPrcpVol = "1";
- calcPrcpTimeVol = "1";
-
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8", "1");
- }
-
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpvol", calcPrcpVol );
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpqty", calcPrcpQty );
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc7", calcPrcpTimeVol );
-
- if ( isNull(drprcpetc8_2) || drprcpetc8_2 == 0 || drprcpetc8_2 == "-") {
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc8", "1");
- }
-
- var prcpclscd = model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/prcpclscd" );
- if ( prcpclscd == "M2" ) {
- //20090330 마정민수정. 귀가유치용 물품처방은 의사처방 수량을 수정하면 귀가유치용물품수량컬럼에 같이 반영한다.
- if (!isNull(model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc4")) && model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc4")!= "-" && model.getValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc4" )>0){
- model.setValue ( sPRCPLIST_PATH + "[" + curRow + "]/drprcpetc4", PrcpQty );
- }
- }
- }
- }
-
- }
-
-
-
- /**
- * @desc : 처방저장 그리드 오른쪽 마우스 클릭시(적용일자 팝업, 반납부서 팝업)
- * @
- * @param :
- * @return :
- * @author : 성미연 2008. 1. 9
- * @---------------------------------------------------
- */
- function fClickBkPrcp(){
- if (grd_prcpposlist.colRef("orgprcpnm") == grd_prcpposlist.mouseCol ||grd_prcpposlist.colRef("prcpcd") == grd_prcpposlist.mouseCol
- ||grd_prcpposlist.colRef("drugmthdspccdnm") == grd_prcpposlist.mouseCol ||grd_prcpposlist.colRef("goodmodel") == grd_prcpposlist.mouseCol
- ||grd_prcpposlist.colRef("matrallsizespecid") == grd_prcpposlist.mouseCol ) {
- //tf서브메뉴 띄우지 않음
- window.showPopupMenu(true);
- if (event.button == 3) {
- window.setPopupMenu(true, "/root/main/popupmenu/prcpposlist/item", "name", "func", false);
- model.refresh();
- }
- else{
- // window.setPopupMenu(false);
- return;
- }
- }else{
- grd_prcpposlist.row = grd_prcpposlist.mouseRow;
- if (event.button == 3 && isDataCell() == true ) {
-
- //적용일자 팝업(가정간호일 경우는 사용하지 않음)
- if (model.getValue("/root/main/cond/homecareyn") == "" && grd_prcpposlist.mouseCol == grd_prcpposlist.colRef("prcpdelivefact")){
-
- //tf서브메뉴 띄우지 않음
- window.showPopupMenu(false);
-
- var yPos = event.y;
- if (yPos < 425) {
- grp_prcpapp.attribute("left") = "955px";
- grp_prcpapp.attribute("top") = (yPos + 80)+"px";
- } else {
- grp_prcpapp.attribute("left") = "955px";
- grp_prcpapp.attribute("top") = "506px";
- }
- grp_prcpapp.visible = true;
- model.setValue("/root/main/prcpposinfo/cond/prcpappdd", model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.mouseRow + "]/prcpdelivefact"));
-
- //물품반납부서선택 팝업(재료인 경우)
- } else if(model.getValue(sPRCPLIST_PATH + "[" + grd_prcpposlist.mouseRow + "]/prcpclscd") == "M2"){
- if (grd_prcpposlist.isReadOnly(grd_prcpposlist.mouseRow, grd_prcpposlist.colRef("tempcol8")) == false &&
- grd_prcpposlist.valueMatrix(grd_prcpposlist.mouseRow, grd_prcpposlist.colRef("tempcol8")) == "Y" ) {
- //tf서브메뉴 띄우지 않음
- window.showPopupMenu(false);
- fPopGoodRtn(sPRCPLIST_PATH + "[" + grd_prcpposlist.mouseRow + "]", grd_prcpposlist.mouseRow);
- }
- }
-
- model.refresh();
- //window.showPopupMenu(true);
- }
- }
- }
- /**
- * @desc : 물품부서 팝업
- * @
- * @param :
- * @return :
- * @author : 성미연 2008. 1. 9
- * @---------------------------------------------------
- */
- function fPopGoodRtn(GridPath, iRow) {
- var rtndeptcd = fGetPrcpPos();
-
- setParameter("rtndeptcd", rtndeptcd);
- open("SPMNW11400","1","300","500", "SPMNW11400", GridPath, "/root/main/prcp/prcplist");
-
- /*
- if (model.getValue("/root/main/prcpposinfo/cond/goodrtnyn") != 'Y') { //물품반납부서 지정 버튼을 누르지 않았을 경우 반환 해지
- model.setValue("/root/main/prcpposinfo/prcpinfo/prcplist[" + iRow + "]/return", "false");
- // model.setValue("/root/main/prcpposinfo/cond/dcdeptcd", model.getValue("/root/main/prcpposinfo/cond/dcdeptcd"));
- model.refresh();
- }
- */
- }
- /**
- * @desc : 처방위치 return
- * @
- * @param :
- * @return :
- * @author : 성미연 2008. 1. 9
- * @---------------------------------------------------
- */
- function fGetPrcpPos() {
- var PrcpPosCD = "";
- var pid=model.getValue("/root/main/cond/pid");
-
- if (model.getValue("/root/main/prcpposinfo/cond/poscd") == '1') { //환자위치
- if ( !isNull(model.getValue("/root/code/codeinfo/codelist[cdgrupid ='002' and cdid ='"+combo1.value+"']/cdid")) ) {
- PrcpPosCD = model.getValue("/root/init/patinfo/patlist[pid='" + pid + "']/grupcd");
- } else {
- PrcpPosCD = model.getValue("/root/main/cond/wardcd");
- }
-
- } else { //User위치
- PrcpPosCD = model.getValue("/root/main/prcpposinfo/cond/deptcd");
- }
- return PrcpPosCD;
- }
-
- /**
- * @desc : 실제처방 적용일 팝업 확인 클릭시
- * @
- * @param :
- * @return :
- * @author : 성미연 2008. 1. 9
- * @---------------------------------------------------
- */
- function fPrcpAppDDInfo(){
- //적용일자 미래입력 불가능
- var prcpappdd = model.getValue("/root/main/prcpposinfo/cond/prcpappdd");
-
- //** 입원환자의 경우 입원일 이전으로 처방입력 불가 추가_20080822(ByJA) **//
- var ordtype = model.getValue("/root/main/patinfocond/patinfo/ordtype");
- var indd = model.getValue("/root/main/patinfocond/patinfo/indd");
- var orddd = model.getValue("/root/main/patinfocond/patinfo/orddd");
-
- if(ordtype == "I"){
- if(indd > prcpappdd){
- messageBox("입원일자["+indd.substr(0,4)+"-"+indd.substr(4,2)+"-"+indd.substr(6,2)+"] 이전으로 입력할 수", "I004");
- model.setFocus("ipt_prcpappdd");
- return;
- }
- }else if(ordtype == "O"){
- if(orddd > prcpappdd){
- messageBox("진료일자["+orddd.substr(0,4)+"-"+orddd.substr(4,2)+"-"+orddd.substr(6,2)+"] 이전으로 입력할 수", "I004");
- model.setFocus("ipt_prcpappdd");
- return;
- }
- }
-
-
- if (prcpappdd <= getCurrentDate()) {
- model.setValue(sPRCPLIST_PATH+ "[" + grd_prcpposlist.row + "]/prcpdelivefact", prcpappdd);
- } else {
- messageBox("미래일자는 입력할 수", "I004");
- model.setFocus("ipt_prcpappdd");
- return;
- }
- grp_prcpapp.visible = false;
- //tf서브메뉴 사용
- window.showPopupMenu(true);
- model.refresh();
- }
- /**
- * @desc : 처방목록 그리드 확대/축소
- * @
- * @param : state - true : 확대, false : 축소
- * @return :
- * @author : 성미연 2008. 2. 5
- * @---------------------------------------------------
- */
- function fprcpsetzoomToggle(state){
- if(state) {
- btn_zoom.attribute("text") = "축소";
- switch1.attribute("width")= "900";
- grd_prcplist.attribute("width") = "753";
- grd_prcplist.colWidth(grd_prcplist.colRef("orgprcpnm")) = 290;
- } else {
- btn_zoom.attribute("text") = "확대";
- switch1.attribute("width")= "500";
- grd_prcplist.attribute("width") = "350";
- grd_prcplist.colWidth(grd_prcplist.colRef("orgprcpnm")) = 211;
- }
- }
- /**
- * @desc : 전처방 그리드 확대/축소
- * @
- * @param : state - true : 확대, false : 축소
- * @return :
- * @author : 성미연 2008. 2. 5
- * @---------------------------------------------------
- */
- function fbfzoomToggle(state){
- if(state) {
- btn_bfzoom.attribute("text") = "축소";
- switch1.attribute("width")= "1165";
- grd_bfprcplist.attribute("width") = "1155";
- grd_bfprcplist.colWidth(grd_bfprcplist.colRef("prcpnm")) = 233;
- } else {
- btn_bfzoom.attribute("text") = "확대";
- switch1.attribute("width")= "500";
- grd_bfprcplist.attribute("width") = "489";
- grd_bfprcplist.colWidth(grd_bfprcplist.colRef("prcpnm")) = 117;
- }
- }
- /**
- * @desc : 임시처방 그리드 확대/축소
- * @
- * @param : state - true : 확대, false : 축소
- * @return :
- * @author : 성미연 2008. 6. 17
- * @---------------------------------------------------
- */
- function ftempzoomToggle(state){
- if(state) {
- btn_tempzoom.attribute("text") = "축소";
- switch1.attribute("width")= "692";
- grd_tempprcplist.attribute("width") = "690";
- grd_tempprcplist.colWidth(grd_tempprcplist.colRef("drugmthdspccdnm")) = 150;
- } else {
- btn_tempzoom.attribute("text") = "확대";
- switch1.attribute("width")= "500";
- grd_tempprcplist.attribute("width") = "493";
- grd_tempprcplist.colWidth(grd_tempprcplist.colRef("prcpnm")) = 230;
- grd_tempprcplist.colWidth(grd_tempprcplist.colRef("drugmthdspccdnm")) = 95;
- }
- }
- function fDelPrcp() {
- for (i = 0; i < grd_prcpposlist.selectedRows; i++) {
- model.setValue("/root/main/prcp/prcplist[" + grd_prcpposlist.selectedRow(i) + "]/status", 'D');
- }
- for (i = 1; i <= getNodesetCount("/root/main/prcp/prcplist"); i++) {
- if (model.getValue("/root/main/prcp/prcplist[" + i + "]/status") == 'D') {
- grd_prcpposlist.deleteRow(i, false);
- i--;
- }
- }
- model.refresh();
-
- }
- function fnZoneDisp() {
-
- //응급의료센터(2280200000)인 경우
- //병동정보대신에 구역정보가 보임)(20080620)
- if ( !isNull(model.getValue("/root/code/codeinfo/codelist[cdgrupid ='002' and cdid ='"+combo1.value+"']/cdid")) ) {
- caption15.visible = false;
- cmb_room.visible = false;
- cap_Zone.visible = true;
- cmb_Zone.visible = true;
-
-
- //20110830_KNUH_Start
- //cmb_settingrn.visible = false;
- //cap_settingrn.visible = false;
- //20110830_KNUH_End
-
- cmb_room.value = "-";
-
- var zonecd = model.getValue("/root/main/paminfo/list/sectioncd");
- if( !isNull(zonecd) && zonecd != "-" ){
- cmb_Zone.value = model.getValue("/root/main/paminfo/list/sectioncd");
- } else {
- cmb_Zone.value = "-";
- }
- //cmb_settingrn.visible = false;
-
-
- } else {
- caption15.visible = true;
- cmb_room.visible = true;
-
-
- //cmb_settingrn.visible =true;
- cap_Zone.visible = false;
- cmb_Zone.visible = false;
- cmb_Zone.value = "";
-
- //20110830_KNUH_Start
- //cmb_settingrn.visible = true;
- //cap_settingrn.visible = true;
- //20110830_KNUH_End
-
- }
- model.refresh();
- }
-
- /**
- * @desc : KNUH, 처방복사 버튼 클릭하여 선택된 처방 리스트를 복사하는 기능
- * @
- * @param :
- * @return :
- * @author : JJE 2011. 2. 16
- * @---------------------------------------------------
- */
- function fClickSetPrcpRows(){
- var selectedRows = grd_prcplist.selectedRows;
- var prcpPosListRows = grd_prcpposlist.rows;
- var str = "";
-
- if(selectedRows == 1 ){
- fClickSetPrcp("btnclick");
- return;
- }
-
- if (selectedRows > 0 ){
- if (model.getValue("/root/main/cond/patnm") == ""){
- messageBox("해당 환자를", "C002");
- return;
- }
-
- if (grp_prcpapp.visible == true){
- messageBox("처방적용일을 확인 후 진행하세요.", "C");
- return;
- }
-
- if (model.getValue("/root/main/cond/homecareyn") == "Y" && model.getValue("/root/main/cond/visitdd") == "") {
- // 방문일자를 선택하지 않은 경우 안내 메시지와 함께 방문일자가 처방당일로 자동 설정 되도록 요청에 의해 수정_김숙인ITC요청_20081215수정(ByJA)
- var rtnval = messageBox("방문일을 선택하지 않으셨습니다. 방문일을 처방일과 동일하게 계속 진행하시겠습니까?", "S"); // return : yes=6, no=7
- if(rtnval == "6"){ // yes
- model.makeValue("/root/main/cond/visitdd", model.getValue("/root/main/cond/prcpdd"));
- cmb_visitdd.refresh();
- }else{
- return;
- }
- }
-
- for (i=0; i<selectedRows; i++){
- var iRow = grd_prcplist.selectedrow(i);
-
- //ALL SIZE 처방 처리
- if(model.getValue(sPRCPSETLIST_PATH + "[" + iRow + "]/prcpclscd") == "M2" && model.getValue(sPRCPSETLIST_PATH + "[" + iRow + "]/matrallsizespecid") == "ALL") {
- var grupsnglflag = model.getValue(sPRCPSETLIST_PATH + "[" + iRow + "]/grupsnglflag");
- var calcscormastspec = (model.getValue(sPRCPSETLIST_PATH + "[" + iRow + "]/calcscormastspec")).split("|");
- var matrsizeflag = calcscormastspec[2];
- var matrallsizespecid = model.getValue(sPRCPSETLIST_PATH + "[" + iRow + "]/matrallsizespecid");
-
- var xpt = window.screenleft + 100;
- var ypt = window.screenTop + 50;
- var coord = getRelativeCoordinate ( xpt, ypt );
- var mon = coord[0];
- xpt = coord[1];
- ypt = coord[2];
-
- setParameter("scrnflag", "nursprcp");
- setParameter("grupsnglflag", 'S');
- setParameter("calcscorcd", calcscormastspec[3]);
- setParameter("matrallsizespecid", matrallsizespecid);
- setParameter("currow", iRow);
- setParameter("targetpath", "/root/main/prcp/prcplist");
- //setParameter("targetgridid", "grd_prcpposlist");
- modal("SPMNW11500", mon, xpt, ypt);
-
- }else{
- //처방 main grid로 약속처방 copy
- mnwAddNursPrcp(sPRCPSETLIST_PATH, "/root/main/prcp", iRow, "");
- fSetNursPrcpDefault(model.instances(0).selectNodes("/root/main/prcp/prcplist").length);
- model.setValue(sPRCPLIST_PATH + "[" + prcpPosListRows + "]/status", "I"); //처방상태 : 신규
- prcpPosListRows++;
- }
-
- fSetPrcpInfo("N");
-
- // 16.10.10_심사팀 요청에 의한 추가
- var sprcpcd = model.getValue(sPRCPSETLIST_PATH + "[" + iRow + "]/prcpcd");
- model.makeValue("/root/send/reqdata/prcpcd", sprcpcd);
- submit("TRMNW10923", false);
- if (model.getValue("/root/temp/insulinfo/insulinfo/insulinfo") == "Y") {
- str = str + sprcpcd + "," ;
- }
-
- // 16.09.27_심사팀 요청에 의한 추가_AYS
- //if(model.getValue(sPRCPSETLIST_PATH + "[" + grd_prcplist.row + "]/insulinfoyn") == "Y") {
- // str = str + model.getValue(sPRCPSETLIST_PATH + "[" + iRow + "]/prcpcd") + ",";
- //}
-
- //신규처방은 반환컬럼 disable
- /*grd_prcpposlist.isReadOnly(model.instances(0).selectNodes("/root/main/prcp/prcplist").length, grd_prcpposlist.colRef("tempcol8")) = true;
- if ( model.getValue(sPRCPLIST_PATH + "[" + model.instances(0).selectNodes("/root/main/prcp/prcplist").length + "]/estmcls")!= "Y" ){
- grd_prcpposlist.isReadOnly(model.instances(0).selectNodes("/root/main/prcp/prcplist").length, grd_prcpposlist.colRef("nigtprcpflag") ) = true;
- }*/
- } //end for
-
- // 16.09.27_심사팀 요청에 의한 추가_AYS
- if (str.length > 1) {
- str = str.substr(0, str.length - 1);
- messageBox("처방코드 " + str + "는 선별급여 품목이오니 보험기준 확인 후 저장바랍니다.", "E999");
- }
-
- model.refresh();
- }
-
- }
- /**
- * @desc : KNUH, 전처방복사 버튼 클릭하여 선택된 처방 리스트를 복사하는 기능
- * @
- * @param :
- * @return :
- * @author : JJE 2011. 2. 17
- * @---------------------------------------------------
- */
- function fClickBfPrcpRows(){
- var selectedRows = grd_bfprcplist.selectedRows;
- var errRtnMsg = "";
- var prcpPosListRows = grd_prcpposlist.rows;
-
- if(selectedRows == 1 ){
- fClickBfPrcp("btnclick");
- return;
- }
- if (selectedRows > 0 ){
- if (model.getValue("/root/main/cond/patnm") == "") {
- messageBox("해당 환자를", "C002");
- return;
- }
-
- if (grp_prcpapp.visible == true){
- messageBox("처방적용일을 확인 후 진행하세요.", "C");
- return;
- }
-
- //가정간호
- if (model.getValue("/root/main/cond/homecareyn") == "Y"){
- if (model.getValue("/root/main/cond/visitdd") == ""){
- var rtnval = messageBox("방문일을 선택하지 않으셨습니다. 방문일을 처방일과 동일하게 계속 진행하시겠습니까?", "S"); // return : yes=6, no=7
- if(rtnval == "6"){ // yes
- model.makeValue("/root/main/cond/visitdd", model.getValue("/root/main/cond/prcpdd"));
- cmb_visitdd.refresh();
- }else{
- return;
- }
- }
- }
- var cnt = 0;
- var str = "";
- for (i=0; i<selectedRows; i++){
- var iRow = grd_bfprcplist.selectedrow(i);
-
- var flag = model.getValue(sBFPRCPLIST_PATH + "[" + iRow + "]/flag");
- var prcpcd = model.getValue(sBFPRCPLIST_PATH + "[" + iRow + "]/prcpcd");
-
- if(flag == "N") {
- if(cnt == 0) {
- str = prcpcd
- } else {
- str +=", " + prcpcd;
- }
- cnt++;
- }
-
- var prcphistcd = model.getValue(sBFPRCPLIST_PATH + "[" + iRow + "]/prcphistcd");
- if (prcphistcd == "L" || prcphistcd == "D" ) {
- continue;
-
- }else{
- //방문일자와 다른 방문일의 처방 클릭시 blocking
- if (model.getValue("/root/main/cond/homecareyn") == "Y"){
- if (model.getValue("/root/main/cond/visitdd") == ""){
- if (model.getValue("/root/main/cond/visitdd") != model.getValue(sBFPRCPLIST_PATH + "[" + iRow + "]/prcpdelivefact")){
- //messageBox("방문일이 동일한 처방에 대해서만 일괄 저장이 가능합니다.", "C");
- //return;
- if(errRtnMsg != "") errRtnMsg = errRtnMsg + ", ";
- errRtnMsg = errRtnMsg + model.getValue(sBFPRCPLIST_PATH + "[" + iRow + "]/prcpcd");
- continue;
- }
- }
- }
-
- mnwAddNursPrcp(sBFPRCPLIST_PATH, "/root/main/prcp", iRow, "");
- fSetNursPrcpDefault(model.instances(0).selectNodes("/root/main/prcp/prcplist").length);
- model.setValue(sPRCPLIST_PATH + "[" + prcpPosListRows + "]/status", "B"); //처방상태[전]
- prcpPosListRows++;
- }
-
- fSetPrcpInfo("N");
-
- if ( model.getValue(sPRCPLIST_PATH + "[" + model.instances(0).selectNodes("/root/main/prcp/prcplist").length + "]/estmcls")!= "Y" ){
- grd_prcpposlist.isReadOnly(model.instances(0).selectNodes("/root/main/prcp/prcplist").length, grd_prcpposlist.colRef("nigtprcpflag") ) = true;
- }
-
- } // end for
-
- if(cnt > 0) {
- messageBox("[" + str + "]처방은 수가가 종료되어 반환만 가능합니다.", "E");
- }
-
- model.refresh();
-
- if(errRtnMsg != ""){
- messageBox("방문일이 동일한 처방에 대해서만 일괄 저장이 가능합니다.\n" + errRtnMsg + "처방은 방문일이 동일하지 않습니다.", "C");
- }
- }
- }
- /**
- * @desc : 20110626_KNUH 보조유형 체크하는 로직
- * @
- * @param :
- * @return :
- * @author : dark9258 2011. 6. 26
- * @---------------------------------------------------
- */
- function fCheckSubKindCd() {
-
- var prcpgenrflag = model.getValue("/root/main/patinfocond/patinfo/ordtype");
- var pid = model.getValue("/root/main/paminfo/list/pid");
- var indd = model.getValue("/root/main/paminfo/list/indd");
-
- model.makeValue("/root/temp/send/pid", pid);
- model.makeValue("/root/temp/send/indd", indd);
-
- if(submit("TRMMO15701")){
- var nodelist = model.instances(0).selectNodes("/root/temp/patsupkind/patsupkind");
- if(nodelist != null) {
- if(nodelist.length > 1){
- clearParameter("SPMMO15700_subcretno");
- modal("SPMMO15700", "", "", "", "SPMMO15700", "/root/temp/patsupkind", "/root/main/patsupkind");
-
- var subcretno = getParameter("SPMMO15700_subcretno");
- if(subcretno == "0") {
- var rtn = messageBox("주유형으로 처방을 발행하시겠습니까?", "Q");
-
- if(rtn != "6") {
- return "false";
- }
- }
- if(subcretno == null || subcretno == "") {
- messageBox("유형을 선택하세요.", "E");
-
- return "false";
- }
- model.makeValue("/root/temp/prcpinfo/subcretno", subcretno);
- } else {
- model.makeValue("/root/temp/prcpinfo/subcretno", "0");
- }
- } else {
- model.makeValue("/root/temp/prcpinfo/subcretno", "0");
- }
- }
- return "true";
- }
- //20110828_KNUH_Start
- function fGetPatInfo() {
-
- var settingnurid = model.getValue("/root/main/cond/settingrnid");
-
- if(settingnurid == null || settingnurid == "") {
- cmb_room.disabled = false;
- } else {
- cmb_room.disabled = true;
- }
-
- model.removeNodeset("/root/send/reqdata");
- model.makeNode("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
- model.makeValue("/root/send/reqdata/settingrnid", model.getValue("/root/main/cond/settingrnid"));
-
- submit("TRMNW10902", false);
- model.setValue("/root/main/cond/roomcd", "-"); //해당 병실 셋팅
-
- cmb_room.refresh();
-
- //해당 병실의 환자 조회
- model.removeNodeset("/root/send/reqdata");
- model.makeNode("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/orddd", model.getValue("/root/main/cond/prcpdd"));
- model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/cond/wardcd"));
- model.makeValue("/root/send/reqdata/roomcd", model.getValue("/root/main/cond/roomcd"));
- model.makeValue("/root/send/reqdata/refflag", "room");
- model.makeValue("/root/send/reqdata/ordtype", "I");
-
- model.makeValue("/root/send/reqdata/settingrnid", model.getValue("/root/main/cond/settingrnid"));
-
- if(spcldept == model.getValue("/root/main/cond/wardcd")) {
- model.makeValue("/root/send/reqdata/spcldeptyn", "Y");
- } else {
- model.makeValue("/root/send/reqdata/spcldeptyn", "");
- }
- submit("TRMNW10903", false);
-
- model.setValue("/root/main/cond/patnm", "");
- model.setValue("/root/main/cond/pid", "");
-
- cmb_patnm.refresh();
- ipt_pid.refresh();
- cap_prtlnm.refresh();
-
- }
- function fCalcScorHbookPrcp(){
- fCalcScorHbook('prcp');
- }
- function fCalcScorHbookPrcppos(){
- fCalcScorHbook('prcppos');
- }
- function fCalcScorHbookPrcpbf(){
- fCalcScorHbook('bf');
- }
- function fClickEr(){
- if(grd_prcpposlist.colRef("erprcpflag") == grd_prcpposlist.mouseCol){
- if(grd_prcpposlist.valuematrix(grd_prcpposlist.row, grd_prcpposlist.colRef("erprcpflag")) == 'Y'){
- grd_prcpposlist.valuematrix(grd_prcpposlist.row, grd_prcpposlist.colRef("drprcpetc10"))='Y';
- }else{
- grd_prcpposlist.valuematrix(grd_prcpposlist.row, grd_prcpposlist.colRef("drprcpetc10"))='N';
- }
- }
- }
- function fprtlnm(pid){
-
- model.makeValue("/root/send/reqdata/pid", pid);
- submit("TRMNW10911");
-
- }
- //20110828_KNUH_End
- /**
- * @desc : 보험기준 조회
- * @
- * @param :
- * @return :
- * @author : AYS_16.09.26_본원 심사과 요청
- * @---------------------------------------------------
- */
- function fOpenInsuInfo() {
- prcpcd = model.getValue(sPRCPSETLIST_PATH +"[" + grd_prcplist.row + "]/prcpcd")
- model.makeValue("/root/temp/setparma/prcpcd", prcpcd);
- modal("SPPIZ01600", "1", "400", "400", "", "/root/temp/setparma/prcpcd" , "/root/send/item3/calcscorcd");
-
- model.removenode("/root/temp/picmmech");
- model.removenode("/root/temp/setparma");
- }
|