12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114 |
- <?xml version="1.0" encoding="EUC-KR"?>
- <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
- <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
- <xhtml:head>
- <xhtml:title>중증수술기간산정관리</xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <main>
- <list1>
- <ownbamtlist>
- <fromdd/>
- <todd/>
- <ownbamt/>
- </ownbamtlist>
- </list1>
- <list2>
- <opcdlist>
- <snglcalcscorcd/>
- <hngnm/>
- <execdd/>
- <fromdd/>
- <todd/>
- <payamt/>
- <flag/>
- <applyop/>
- </opcdlist>
- </list2>
- <list3>
- <insulist>
- <pid/>
- <hngnm/>
- <indd/>
- <appdd/>
- <insukind/>
- <suppkind/>
- <fromdd/>
- <todd/>
- <ownbrate/>
- <instcd/>
- <opertodd/>
- <clamflag/>
- <seqno/>
- <mskind/>
- <cretno/>
- </insulist>
- </list3>
- <list4>
- <pmbminsu/>
- </list4>
- <list5>
- <payamtperday>
- <execdd/>
- <payamt/>
- </payamtperday>
- </list5>
- </main>
- <send>
- <cond>
- <pid/>
- <indd/>
- <cretno/>
- <mskind/>
- <instcd/>
- <vcode/>
- <brateflag/>
- <brthdd/>
- <saveyn/>
- <ownbrate/>
- <cfe/>
- </cond>
- <uptoperdd>
- <pid/>
- <indd/>
- <cretno/>
- <instcd/>
- <insukind/>
- <suppkind/>
- <fromdd/>
- <todd/>
- <mskind/>
- <newoperdd/>
- </uptoperdd>
- </send>
- <hidden>
- <list1>
- <insulist>
- <pid/>
- <hngnm/>
- <indd/>
- <appdd/>
- <insukind/>
- <col01/>
- <fromdd/>
- <todd/>
- <ownbrate/>
- <instcd/>
- <opertodd/>
- <mskind/>
- <cretno/>
- </insulist>
- </list1>
- <list2>
- <insulist>
- <iphs_status/>
- <iphs_pid/>
- <iphs_indd/>
- <iphs_cretno/>
- <iphs_mskind/>
- <iphs_fromdd/>
- <iphs_seqno/>
- <iphs_todd/>
- <iphs_instcd/>
- <iphs_insukind/>
- <iphs_suppkind/>
- <iphs_opertodd/>
- </insulist>
- <rslt/>
- </list2>
- <temp/>
- <list3>
- <opcdlist/>
- </list3>
- <list4>
- <pid/>
- <mskind/>
- <calcbasedd/>
- <instcd/>
- <cretno/>
- <indd/>
- </list4>
- <list5>
- <kindlist>
- <fromdd/>
- <todd/>
- <suppkind/>
- </kindlist>
- </list5>
- <source>
- <pid/>
- <indd/>
- <cretno/>
- <mskind/>
- <brateflag/>
- <brthdd/>
- </source>
- <newoperddsend>
- <newoperdd/>
- </newoperddsend>
- <newoperddresult>
- <result>
- <inpt_count/>
- </result>
- </newoperddresult>
- </hidden>
- </root>
- </instance>
- <script type="javascript" ev:event="xforms-model-construct-done">
- <![CDATA[
- // [자연분만, 중증질환 기간산정 유형변경 처리유형]
- //
- // 1. 한개의 유형 30일 안넘은 경우
- // (AS-IS의경우 처음부터 기간을 미리 적용해놓음)
- // => (넘겨줄파라미터)
- // iphs key , insukind, suppkind, fromdd, todd
- // 예) 입원일 : 20070101, 현재일자 :20070115
- // =>파라미터 :Fromdd : 20070101, Todd : 20070130
- // insukind : 11, suppkind : 05
- // => 결과 : 20070101-20070130 (11:05)
- // 20070131-99991231 (11:00)
- // 2개 발생되어야함.
- //
- // 2. 한개의 유형 30일 초과의 경우 중간에 끊는경우
- // => (넘겨줄파라미터)
- // iphs key , insukind, suppkind, fromdd, todd
- // 예) 입월일 :20070101, 현재일자 20070331
- // =>파라미터 :Fromdd : 20070131, Todd : 20070228
- // insukind : 11, suppkind : 05
- // => 결과 : 20070101-20070130 (11:00)
- // 20070131-20070228 (11:05)
- // 20070301-99991231 (11:00)
- // 3개 발생되어야함.
- //
- // 3. 유형이 두개(11, 22) 존재하고 기간을 걸쳐서 중증일자를 적용하는경우
- // => (넘겨줄파라미터) : 유형별로 각각 호출한다.
- // iphs key , insukind, suppkind, fromdd, todd
- // 예)입원일자 :20070101, 현재일자 20070501
- // 유형별 기간 11:00 => 20070101- 20070331
- // 22:00 => 20070401 - 99991231
- // 이상태에서 중증기간을 20070315 - 20070413 으로 적용할경우
- // 첫번째 호출 :
- // =>파라미터 :Fromdd : 20070315, Todd : 20070331
- // insukind : 11, suppkind : 05
- // => 결과 : 20070101-20070315 (11:00)
- // 20070316-20070331 (11:05)
- // 2개 발생되어야함.
- // 두번째 호출 :
- // =>파라미터 :Fromdd : 20070315, Todd : 20070331
- // insukind : 22, suppkind : 05
- // => 결과 : 20070401-20070413 (22:05)
- // 20070414-99991231 (22:00)
- // 2개 발생되어야함.
- // fInitialize();
- ]]>
- </script>
- <submission id="TRPIJ01901" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/cond" resultref="/root/main"/>
- <submission id="TRPIJ01902" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/cond" resultref="/root/hidden/list1"/>
- <submission id="TXPIJ01902" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/hidden/list2/insulist" resultref="/root/hidden/list2/rslt"/>
- <submission id="TXPIJ01903" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/hidden/list4" resultref="/root/hidden/list4/rslt"/>
- <submission id="TRPIJ01903" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/cond" resultref="/root/"/>
- <submission id="TXPIJ01904" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/hidden/list2/insulist" resultref="/root/hidden/list2/rslt"/>
- <submission id="TXPIJ00205" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/hidden/list4/insulist"/>
- <submission id="TXPIJ01905" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/uptoperdd" resultref="/root/hidden/newoperddresult/result"/>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
- fInitialize();
- ]]>
- </script>
- </model>
- <script type="javascript" src="../../../com/commonweb/js/common.js"/>
- <script type="javascript" src="../../../com/commonweb/js/numericHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
- <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
- <script type="javascript" src="../../../pam/pamcomnweb/js/PAM.js"/>
- <script type="javascript">
- <![CDATA[
- // 화면 open시(와 초기화 버튼 클릭시) 화면 초기화 기능을 수행한다.
- function fInitialize() {
- model.removeNodeset("/root/main");
- //model.removeNodeset("/root/hidden");
-
- // 심사마감이나 퇴원이 되었을때는 조작을 할 수 없게 한다. - 20080924 박창원
- var saveyn = model.getValue("/root/send/cond/saveyn");
-
- if (saveyn == "Y") {
- messageBox("마감이나 퇴원, 중간청구,부적절한 유형적용,읽기전용 모드 상태입니다. 조작은 할 수","E001");
- btn_iphsrebuild.disabled = true;
- btn_opapply.disabled = true;
- btn_apply.disabled = true;
- }
-
- if (submit("TRPIJ01901")) {
- //var opcdcnt = getNodesetCount("/root/main/list2/opcdlist");
- var opcdcnt = getNodesetCount("/root/main/list2/opcdlist");
- var todd = "";
-
- opcdcnt = parseInt(opcdcnt);
-
- // 수술기간을 판단하여 금액을 산정한다.
- fOpPeriodAmt();
-
- // 첫번째 수술의 가장 많은 금액의 기간을 첫번째 수술의 기본적인 적용 시작일, 종료일로 해준다.
- grd_esscterm.colSort(grd_esscterm.colRef("ownbamt"))="desc";
- grd_esscterm.sort(1, 1, grd_esscterm.rows, 3)="usersort";
- grd_esscterm.gridToInstance();
- model.refresh();
- model.setValue("/root/main/list2/opcdlist[1]/fromdd", model.getValue("/root/main/list1/ownbamtlist[1]/fromdd"));
- model.setValue("/root/main/list2/opcdlist[1]/todd", model.getValue("/root/main/list1/ownbamtlist[1]/todd"));
- // 첫번째 수술에 급여총액 산출
- model.setValue("/root/main/list2/opcdlist[1]/payamt", model.getValue("/root/main/list1/ownbamtlist[1]/ownbamt"));
-
- grd_esscterm.colsort(1)="asc";
- grd_esscterm.sort(1, 1, grd_esscterm.rows, 3)="usersort";
- grd_esscterm.gridToInstance();
- model.refresh();
-
- if (opcdcnt > 1) {
- // 두번째 수술부터는 수술일로 부터 일괄적으로 30일을 적용한다.
- for (i=2;i<=opcdcnt;i++) {
- var execdd = model.getValue("/root/main/list2/opcdlist[" + i + "]/execdd");
- // 첫번째 수술과 수술일이 같은 경우는 날짜를 동일하게 맞춰준다. - 20090326 박창원
- var fstexecdd = model.getValue("/root/main/list2/opcdlist[1]/execdd");
-
- if (execdd == fstexecdd) {
- model.setValue("/root/main/list2/opcdlist[" + i + "]/fromdd", model.getValue("/root/main/list2/opcdlist[1]/fromdd"));
- model.setValue("/root/main/list2/opcdlist[" + i + "]/todd", model.getValue("/root/main/list2/opcdlist[1]/todd"));
- }else {
- model.setValue("/root/main/list2/opcdlist[" + i + "]/fromdd", execdd);
-
- thisYear = execdd.substring(0,4); // 현재 입력된 연
- thisMonth = execdd.substring(4,6); // 현재 입력된 월
- thisDay = execdd.substring(6,8); // 현재 입력된 일
- nextDate = new Date(thisYear, (thisMonth - 1), thisDay );
-
- nextDate.setDate(nextDate.getDate() + 29); // 30일 뒤인 다음날 날짜를 구한다.
-
- todd = "";
- todd += nextDate.getYear();
- if ((nextDate.getMonth() + 1) < 10) {
- todd += "0" + (nextDate.getMonth() + 1);
- }
- else {
- todd += (nextDate.getMonth() + 1);
- }
- if (nextDate.getDate() < 10) {
- todd += "0" + nextDate.getDate();
- } else {
- todd += nextDate.getDate();
- }
-
- model.setValue("/root/main/list2/opcdlist[" + i + "]/todd", todd);
- }
- model.setValue("/root/main/list2/opcdlist[" + i + "]/flag", "Y");
-
- // model.makeNode("/root/main/list2/opcdlist[" + i + "]/hfromdd");
- // model.setValue("/root/main/list2/opcdlist[" + i + "]/hfromdd", execdd);
-
- // 급여금액 계산
- // fCalcPayment(i,execdd,todd);
- // model.refresh();
- }
- for (j=2;j<=opcdcnt;j++) {
- var row = j;
- var payexecdd = model.getValue("/root/main/list2/opcdlist[" + j + "]/fromdd");
- var paytodd = model.getValue("/root/main/list2/opcdlist[" + j + "]/todd");
- fCalcPayment(row,payexecdd,paytodd);
- }
- model.refresh();
- }
-
- //submit("TRPIJ01903"); // 입원일부터 일자별로 급여 총액을 가져온다. 20080728 박창원
- model.refresh();
- }
- }
-
- // 수술기간을 판단하여 첫번째 수술의 금액을 산정하여 디스플레이한다. - 20080729 박창원
- function fOpPeriodAmt() {
- var sum_fromdd = new Array();
- var sum_todd = new Array();
- var sum_payamt = new Array();
-
- var opdd = new Array();
-
- var lowstartdd;
- var maxstartdd;
- var fromdd;
- var todd;
- var payamtsum = 0;
- var payamt = 0;
- var cnt = 0;
- var opcnt = 0;
-
- var indd = model.getValue("/root/send/cond/indd");
-
- // 수술일자를 setting
- for(i=1; i<=grd_operlist.rows; i++) {
- opdd[i] = model.getValue("/root/main/list2/opcdlist[" + i + "]/execdd");
- }
-
- // 무조건 오른쪽 리스트는 제1수술만 보여준다.
-
- // maxstartdd는 무조건 수술일
- maxstartdd = opdd[1];
-
- // 수술일과 입원일의 차이를 계산해서 29일 이내 이면 입원일이 lowstartdd이다.
- var interval = getDateInterval(indd,opdd[1]);
-
- if (interval < "29") {
- lowstartdd = indd;
- }
- else { // 29일 이내가 아니면 수술일로 부터 29일전이 lowstartdd이다.
- var tempdd;
-
- tempdd = opdd[1].toDate("YYYYMMDD");
- tempdd = tempdd.getAddDate(-29);
- lowstartdd = tempdd.getDateFormat();
- }
-
- //
- // 나눠진 lowstartdd, MaxStart기준으로 금액을 산정하여 합한다.
- for(i=1; i < 31;i++) {
- fromdd = lowstartdd;
- basedd = fromdd;
-
- // todd는 시작일로부터 29일을 더한다.
- todd = fromdd.toDate("YYYYMMDD");
- todd = todd.getAddDate(29);
- todd = todd.getDateFormat();
- // 금액을 합한다.
- for(j=1; j<31; j++) {
- payamt = model.getValue("/root/main/list5/payamtperday[execdd = " + basedd + "]/payamt");
-
- if (payamt == "") {
- payamt = 0;
- }
- if (isNaN(payamt) != true) {
- payamt = parseInt(payamt);
- payamtsum = payamtsum + payamt;
- }
- // basedd를 증가시킨다(하루씩)
- basedd = basedd.toDate("YYYYMMDD");
- basedd = basedd.getAddDate(1);
- basedd = basedd.getDateFormat();
-
- // basedd가 todd보다 클경우 빠져나간다.
- if (basedd > todd) {
- continue;
- }
- }
-
- // lowstartdd가 opdd보다 클경우 빠져나간다.
- if (fromdd > opdd[1]) {
- continue;
- }
-
- // 한 사이클의 시작종료에 대한 금액의 sum을 저장
- sum_fromdd[i] = fromdd;
- sum_todd[i] = todd;
- sum_payamt[i] = payamtsum;
-
- payamtsum = 0;
-
- cnt = cnt + 1;
-
- // lowstartdd를 증가시킨다(하루씩)
- lowstartdd = lowstartdd.toDate("YYYYMMDD");
- lowstartdd = lowstartdd.getAddDate(1);
- lowstartdd = lowstartdd.getDateFormat();
- }
-
- model.removeNodeset("/root/main/list1/ownbmtlist");
- for (i=1;i<cnt + 1;i++) {
- model.makeValue("/root/main/list1/ownbamtlist["+ i +"]/fromdd", sum_fromdd[i]);
- model.makeValue("/root/main/list1/ownbamtlist["+ i +"]/todd", sum_todd[i]);
- model.makeValue("/root/main/list1/ownbamtlist["+ i +"]/ownbamt", sum_payamt[i]);
- }
-
-
- /* // 수술이 두개일경우
- else if (grd_operlist.rows == 3) {
- // 두수술의 날짜가 30일 이상나는지 판단함
- // 첫번째 수술일과 두번째 수술일의 차이를 계산
- var interval = getDateInterval(opdd[2],opdd[1]);
- // 첫번째 수술일과 입원일의 차이를 계산
- var interval1 = getDateInterval(opdd[1],indd);
- // 두번째 수술일과 입원일의 차이를 계산
- var interval2 = getDateInterval(opdd[2],indd);
-
- // 명백하게 기간이 겹치기 때문에 합쳐야 되는 경우
- if (interval < "29" && interval1 < "29" && interval2 < "30") {
- fromdd = indd; // 시작일은 입원일이 된다.
- basedd = fromdd;
-
- // todd는 마지막수술일 + 29
- var lastopdd = opdd[2].toDate("YYYYMMDD");
- todd = lastopdd.getAddDate(29);
- todd = todd.getDateFormat();
-
- var period = getDateInterval(todd,fromdd);
-
- // 시작일 부터 종료일 까지 금액 함산
- for (i = 1; i<period; i++) {
- basedd = fromdd;
- payamt = model.getValue("/root/main/list5/payamtperday[execdd = " + basedd + "]/payamt");
-
- if (payamt == "") {
- payamt = 0;
- }
- if (isNaN(payamt) != true) {
- payamt = parseInt(payamt);
- payamtsum = payamtsum + payamt;
- }
-
- // basedd를 증가시킨다(하루씩)
- basedd = basedd.toDate("YYYYMMDD");
- basedd = basedd.getAddDate(1);
- basedd = basedd.getDateFormat();
-
- // 한 사이클의 시작종료에 대한 금액의 sum을 저장
- sum_fromdd[i] = fromdd;
- sum_todd[i] = todd;
- sum_payamt[i] = payamtsum;
-
- payamtsum = 0;
-
- cnt = cnt + 1;
- } // for i
-
- model.removeNodeset("/root/main/list1/ownbmtlist");
- for (i=1;i<cnt + 1;i++) {
- model.makeValue("/root/main/list1/ownbamtlist["+ i +"]/fromdd", sum_fromdd[i]);
- model.makeValue("/root/main/list1/ownbamtlist["+ i +"]/todd", sum_todd[i]);
- model.makeValue("/root/main/list1/ownbamtlist["+ i +"]/ownbamt", sum_payamt[i]);
- }
- } // if (interval < "29" && interval1 < "29" && interval2 < "30")
- } // else if (grd_operlist.rows == 2) */
- model.refresh();
- }
-
- // fromdd와 todd에 다른 급여 총액을 계산해서 수술코드 및 일자에 디스플레이
- function fCalcPayment(inptrow,fromdd,todd) {
- var row = inptrow;
-
- // 날짜에 따른 금액을 산정한다
- var payment = 0;
- var payfromdd = fromdd;
- var paytodd = todd;
-
- // 시작일과 종료일간의 차를 구함
- var period = getDateInterval(payfromdd, paytodd);
- // 시작일부터 종료일까지 금액산정
- for (i=1; i <= period + 1; i++) {
- var payexecdd = model.getValue("/root/main/list5/payamtperday[execdd =" + payfromdd + "]/payamt");
- if (payexecdd == "") {
- payexecdd = 0;
- }
- if (isNaN(payexecdd) != true) {
- payexecdd = parseInt(payexecdd);
- payment = payment + payexecdd;
- }
-
- // payfromdd 를 증가시킨다(하루씩)
- payfromdd = payfromdd.toDate("YYYYMMDD");
- payfromdd = payfromdd.getAddDate(1);
- payfromdd = payfromdd.getDateFormat();
-
- // payfromdd가 todd보다 클경우 빠져나간다.
- if (payfromdd > paytodd) {
- continue;
- }
- } //for i
- model.setValue("/root/main/list2/opcdlist[" + row + "]/payamt", payment);
- }
-
- //유형적용 완료후 소급처리 한다.
- function fReCalc() {
- // 입원일 부터 현재까지 계산한다(일일단위로 loop)
- var fromdd = model.getValue("/root/send/cond/indd");
- var curdd = getCurrentDate();
- var period = getDateInterval(fromdd, curdd);
- // fromdd부터 currentdate까지 loop
- for (i=1; i<= period + 1; i++) {
- model.makeNode("/root/hidden/list4/insulist/pid");
- model.makeNode("/root/hidden/list4/insulist/indd");
- model.makeNode("/root/hidden/list4/insulist/mskind");
- model.makeNode("/root/hidden/list4/insulist/calcbasedd");
- model.makeNode("/root/hidden/list4/insulist/cretno");
- model.setValue("/root/hidden/list4/insulist/pid", model.getValue("/root/send/cond/pid"));
- model.setValue("/root/hidden/list4/insulist/indd", model.getValue("/root/send/cond/indd"));
- model.setValue("/root/hidden/list4/insulist/mskind", model.getValue("/root/send/cond/mskind"));
- model.setValue("/root/hidden/list4/insulist/cretno", model.getValue("/root/send/cond/cretno"));
- model.setValue("/root/hidden/list4/insulist/calcbasedd", fromdd);
-
- submit("TXPIJ00205");
- // fromdd를 증가시킨다(하루씩)
- fromdd = fromdd.toDate("YYYYMMDD");
- fromdd = fromdd.getAddDate(1);
- fromdd = fromdd.getDateFormat();
- }
- }
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body pagewidth="820" pageheight="750" guideline="1,800;2,734;" style="margin-left:8; margin-top:8; margin-right:8; margin-bottom:8; ">
- <group id="group3" scroll="auto" style="left:0px; top:0px; width:800px; height:705px; ">
- <caption id="caption1" class="tit_2" style="left:559px; top:10px; width:255px; height:13px; ">수술일자별 기간/ 급여총액</caption>
- <line id="line1" class="line_1" style="x1:553px; y1:27px; x2:791px; y2:26px; "/>
- <datagrid id="grd_esscterm" nodeset="/root/main/list1/ownbamtlist" caption="시작일^종료일^급여총액" colsep="^" colwidth="70, 70, 75" dataheight="25" ellipsis="true" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="25" rowsep="|" tooltip="true" style="left:553px; top:31px; width:240px; height:309px; ">
- <col ref="fromdd" format="yyyy-mm-dd"/>
- <col ref="todd" format="yyyy-mm-dd"/>
- <col ref="ownbamt" format="#,###" style="text-align:right; "/>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- var torow = grd_operlist.row;
- var fromrow = grd_esscterm.row;
-
- if (grd_esscterm.isCell(event.target) && grd_esscterm.row >= grd_esscterm.fixedRows) {
- if ( grd_operlist.row >= grd_operlist.fixedRows) {
-
- var execdd = model.getValue("/root/main/list2/opcdlist[" + torow + "]/execdd");
- var fromdd = model.getValue("/root/main/list1/ownbamtlist[" + fromrow + "]/fromdd");
- var todd = model.getValue("/root/main/list1/ownbamtlist[" + fromrow + "]/todd");
- model.setValue("/root/main/list2/opcdlist[" + torow + "]/fromdd",model.getValue("/root/main/list1/ownbamtlist[" + fromrow + "]/fromdd"));
- model.setValue("/root/main/list2/opcdlist[" + torow + "]/todd",model.getValue("/root/main/list1/ownbamtlist[" + fromrow + "]/todd"));
- model.setValue("/root/main/list2/opcdlist[" + torow + "]/flag","Y");
- }
- }
-
- model.refresh();
- ]]>
- </script>
- </datagrid>
- <line id="line2" class="line_1" style="x1:0px; y1:26px; x2:548px; y2:27px; "/>
- <datagrid id="grd_operlist" nodeset="/root/main/list2/opcdlist" caption="수술코드^코드명칭^수술일자^적용시작일자^적용종료일자^급여총액^적용여부^" colsep="^" colwidth="60, 148, 71, 86, 78, 80, 60" dataheight="25" ellipsis="true" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="25" rowsep="|" tooltip="true" style="left:0px; top:31px; width:550px; height:309px; ">
- <col ref="snglcalcscorcd"/>
- <col ref="hngnm"/>
- <col ref="execdd" visibility="visible" format="yyyy-mm-dd" style="text-align:center; "/>
- <col ref="fromdd" type="inputdate" format="yyyy-mm-dd" style="text-align:center; "/>
- <col ref="todd" format="yyyy-mm-dd" style="text-align:center; "/>
- <col ref="payamt" format="#,###" style="text-align:right; "/>
- <col ref="flag" visibility="hidden"/>
- <col ref="applyop" visibility="hidden"/>
- <script type="javascript" ev:event="xforms-value-changed">
- <![CDATA[
- var row = grd_operlist.row;
- var col = grd_operlist.col;
- var indd = model.getValue("/root/send/cond/indd");
- var fromdd = model.getValue("/root/main/list2/opcdlist[" + row + "]/fromdd");
- var todd = model.getValue("/root/main/list2/opcdlist[" + row + "]/todd");
- var chkopdd = model.getValue("/root/main/list2/opcdlist[" + row + "]/execdd");
- var chktodd = model.getValue("/root/main/list2/opcdlist[" + row + "]/fromdd");
- var applyop = model.getValue("/root/main/list2/opcdlist[" + row + "]/applyop");
-
- // 이미 적용된 날짜와 기간이 겹치지 않게 하기 위해 20080915 박창원
- var maxv191192todd = "";
- var maxclamtodd = "";
- var oprows = grd_operlist.rows;
-
- for(i=1; i < oprows; i++) {
- if(model.getValue("/root/main/list2/opcdlist[" + i + "]/applyop") == "Y") {
- maxv191192todd = model.getValue("/root/main/list2/opcdlist[" + i + "]/todd");
- }
- }
-
- chktodd = chktodd.toDate("YYYYMMDD");
- chktodd = chktodd.getAddDate(29);
- chktodd = chktodd.getDateFormat();
- // 이미 적용되어잇는 보조유형의 날자를 지정하면 알럿 20080915 박창원
- if(applyop == "Y") {
- messageBox("이미 유형적용이 된 수술입니다. 유형복원 후 처리","I006");
- todd = todd.toDate("YYYYMMDD");
- todd = todd.getAddDate(-29);
- fromdd = todd.getDateFormat();
- model.setValue("/root/main/list2/opcdlist[" + row + "]/fromdd", fromdd);
- return;
- }
-
- // 이미적용되어있는 보조유형의 날짜를 침범하면 error 20080915 박창원
- if (fromdd < maxv191192todd) {
- messageBox("이미 적용되어있는 수술기간과 겹치게 선택","E001");
- todd = todd.toDate("YYYYMMDD");
- todd = todd.getAddDate(-29);
- fromdd = todd.getDateFormat();
- model.setValue("/root/main/list2/opcdlist[" + row + "]/fromdd", fromdd);
- return;
- }
- // 적용시작일자가 입원일보다 작으면 ERROR
- if (fromdd < indd) {
- messageBox("적용시작일을 입원일 이전으로 선택","E001");
- todd = todd.toDate("YYYYMMDD");
- todd = todd.getAddDate(-29);
- fromdd = todd.getDateFormat();
- model.setValue("/root/main/list2/opcdlist[" + row + "]/fromdd", fromdd);
- return;
- } else if((fromdd > chkopdd) || (chktodd < chkopdd)) { // 수술일자는 적용기간내에 있어야 한다.
- messageBox("적용기간은 수술일을 제외하여 선택","E001");
- todd = todd.toDate("YYYYMMDD");
- todd = todd.getAddDate(-29);
- fromdd = todd.getDateFormat();
- model.setValue("/root/main/list2/opcdlist[" + row + "]/fromdd", fromdd);
- return;
- }
- var beforefromdd = "";
- var todd = "";
-
- if (row > 1) {
- var beforerow = eval(row) - 1;
- var beforefromdd = model.getValue("/root/main/list2/opcdlist[" + beforerow + "]/fromdd");
-
- if (beforefromdd > fromdd) {
- messageBox("이전 수술에 대한 적용시작일자 보다 이전일 적용시작일자로 선택","E001");
- model.setValue("/root/main/list2/opcdlist[" + row + "]/fromdd", model.getValue("/root/main/list2/opcdlist[" + row + "]/hfromdd"));
- return;
- }
- }
-
- if (row >= 1) {
-
- thisYear = fromdd.substring(0,4); // 현재 입력된 연
- thisMonth = fromdd.substring(4,6); // 현재 입력된 월
- thisDay = fromdd.substring(6,8); // 현재 입력된 일
- nextDate = new Date(thisYear, (thisMonth - 1), thisDay );
-
- nextDate.setDate(nextDate.getDate() + 29); // 30일 뒤인 다음날 날짜를 구한다.
- todd = "";
- todd += nextDate.getYear();
- if ((nextDate.getMonth() + 1) < 10) {
- todd += "0" + (nextDate.getMonth() + 1);
- }
- else {
- todd += (nextDate.getMonth() + 1);
- }
- if (nextDate.getDate() < 10) {
- todd += "0" + nextDate.getDate();
- } else {
- todd += nextDate.getDate();
- }
- model.setValue("/root/main/list2/opcdlist[" + row + "]/fromdd", fromdd);
- model.setValue("/root/main/list2/opcdlist[" + row + "]/todd", todd);
- model.setValue("/root/main/list2/opcdlist[" + row + "]/flag", "Y");
- }
- // 날짜에 따른 금액을 산정한다
- if (col == grd_operlist.colRef("fromdd")) {
- fCalcPayment(row,fromdd,todd);
- } // if (col == grd_operlist.colRef("fromdd"))
-
- model.refresh();
- ]]>
- </script>
- </datagrid>
- <caption id="caption2" class="tit_2" style="left:2px; top:10px; width:150px; height:13px; ">수술코드 및 수술일자</caption>
- <caption id="caption3" class="tit_2" style="left:5px; top:471px; width:210px; height:13px; ">기간별 본인부담율 적용 내역</caption>
- <line id="line3" class="line_1" style="x1:0px; y1:486px; x2:792px; y2:486px; "/>
- <datagrid id="grd_appterm" nodeset="/root/hidden/list1/insulist" caption="환자번호^환자이름^입원일자^적용일자^보험유형^유형보조^시작일자^종료일자^본인부담율^instcd^유형종료예정일^caption1" colsep="^" colwidth="70, 60, 70, 70, 60, 87, 85, 85, 83, 60, 95, 100" dataheight="25" ellipsis="true" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="25" rowsep="|" tooltip="true" style="left:0px; top:493px; width:792px; height:182px; ">
- <col ref="pid"/>
- <col ref="hngnm"/>
- <col ref="indd" format="yyyy-mm-dd"/>
- <col ref="appdd" format="yyyy-mm-dd"/>
- <col ref="insukind"/>
- <col id="col01" ref="col01" type="combo">
- <choices>
- <itemset nodeset="/root/main/list4/pmbminsu">
- <label ref="cdnm"/>
- <value ref="suppkind"/>
- </itemset>
- </choices>
- </col>
- <col ref="fromdd" type="inputdate" format="yyyy-mm-dd"/>
- <col ref="todd" type="inputdate" format="yyyy-mm-dd"/>
- <col ref="ownbrate"/>
- <col ref="instcd" visibility="hidden"/>
- <col ref="opertodd" type="inputdate" format="yyyy-mm-dd"/>
- <col ref="cretno" visibility="hidden"/>
- <script type="javascript" ev:event="xforms-value-changed">
- <![CDATA[
- var row = grd_appterm.row;
- var insukind = model.getValue( "/root/hidden/list1/insulist[" + row + "]/insukind");
- for (var i=1; i<grd_appterm.rows; i++) {
- grd_appterm.cellComboNodeset(i,6) = "/root/main/list4/pmbminsu[insukind = '"+insukind+"']";
- }
- ]]>
- </script>
- </datagrid>
- <datagrid id="grd_insulist" nodeset="/root/main/list3/insulist" caption="환자번호^환자이름^입원일자^적용일자^보험유형^유형보조^시작일자^종료일자^본인부담율^instcd^유형종료예정일^청구여부^seqno^mskind^cretno" colsep="^" colwidth="70, 60, 70, 70, 60, 60, 85, 85, 83, 60, 95, 100, 100, 100, 100" dataheight="25" ellipsis="true" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="25" rowsep="|" tooltip="true" style="left:0px; top:381px; width:792px; height:84px; ">
- <col ref="pid"/>
- <col ref="hngnm"/>
- <col ref="indd" format="yyyy-mm-dd"/>
- <col ref="appdd" format="yyyy-mm-dd"/>
- <col ref="insukind"/>
- <col ref="suppkind"/>
- <col ref="fromdd" format="yyyy-mm-dd"/>
- <col ref="todd" format="yyyy-mm-dd"/>
- <col ref="ownbrate"/>
- <col ref="instcd" visibility="hidden"/>
- <col ref="opertodd"/>
- <col ref="clamflag" visibility="hidden"/>
- <col ref="seqno" visibility="hidden"/>
- <col ref="mskind" visibility="hidden" format="yyyy-mm-dd"/>
- <col ref="cretno" visibility="hidden"/>
- </datagrid>
- <caption id="caption4" class="tit_2" style="left:5px; top:361px; width:165px; height:13px; ">현재보험정보</caption>
- <line id="line4" class="line_1" style="x1:0px; y1:376px; x2:792px; y2:376px; "/>
- <shape id="roundrect1" class="roundrect_example" appearance="roundrect" ellipsewidth="10" ellipseheight="7" style="left:554px; top:351px; width:238px; height:23px; "/>
- <input id="ipt_pid" ref="/root/hidden/newoperddsend/newoperdd" class="input_default" inputtype="date" maxlength="10" style="left:648px; top:353px; width:91px; height:19px; "/>
- <caption id="caption5" style="left:557px; top:356px; width:89px; height:15px; font-size:8pt; ">유형종료예정일 :</caption>
- </group>
- <group id="group1" style="left:0px; top:709px; width:800px; height:27px; ">
- <button id="btn_apply" class="btn4_letter2" style="left:676px; top:5px; width:56px; height:22px; ">
- <caption>확정</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- // for(i = 0; i < grd_insulist.rows; i++){
- // var chk = model.getValue("/root/main/list3/insulist[" + i + " ]/suppkind");
- // if(chk == "05"){
- // messageBox("이미 적용된 중증기간이 있습니다. 원무팀에 연락하여 변경처리 전에는 작업 ","E001");
- // return;
- // }
- // }
- // 자료수집이 되었거나 이미 적용이된 수술유형의 경우를 판별해서 해당 유형의 종료일 + 1을 소급계산의 시작일로 하여야 하고
- // 유형변경시에도 제외되어야 한다(자료수집이나 중증 수술 유형적용이 된 환자는 입원일로 부터 소급계산) 20080915 박창원
- var chkv191192 = "N";
- var chkclam = "N";
- var maxv191192todd = "19000101";
- var maxclamtodd = "19000101";
- var maxdate;
- var insurows = grd_insulist.rows;
-
- for(i=1; i < insurows; i++) {
- if(model.getValue("/root/main/list3/insulist[" + i + "]/clamflag") == "Y") {
- maxclamtodd = model.getValue("/root/main/list3/insulist[" + i + "]/todd");
- }
- // 20090325 차상위 2종 적용 - 박창원
-
- if((model.getValue("/root/main/list3/insulist[" + i + "]/suppkind") == "05") || (model.getValue("/root/main/list3/insulist[" + i + "]/suppkind") == "39")){
- maxv191192todd = model.getValue("/root/main/list3/insulist[" + i + "]/todd");
- }
-
- if(maxclamtodd >= maxv191192todd) {
- maxdate = maxclamtodd;
- }else{
- maxdate = maxv191192todd;
- }
- }
-
- var tmp = messageBox("기간별 본인부담율 적용내역으로 유형번경 처리를", "Q004");
- if(tmp != 6){
- return;
- }
-
- var pre_fromdd = "";
- var pre_todd = "";
-
- //필수값들을 체크한다.
- for (var i = 1; i < grd_appterm.rows; i++) {
- var fromdd = model.getValue("/root/hidden/list1/insulist[" + i + "]/fromdd");
- var todd = model.getValue("/root/hidden/list1/insulist[" + i + "]/todd");
- var opertodd = model.getValue("/root/hidden/list1/insulist[" + i + "]/opertodd");
-
- if(i == 1){
- if(fromdd > todd){
- messageBox("유형시작일자가 종료일자보다 클 수 없습니다. 변경처리를","E001");
- return;
- }
- }else{
- if(fromdd > todd){
- messageBox("유형시작일자가 종료일자보다 클 수 없습니다. 변경처리를","E001");
- return;
- }
- /* if(pre_todd >= fromdd){
- messageBox("적용시작일자가 이전유형 종료일자 보다 작거나 같을수 없습니다. 변경처리를","E001");
- return;
- } */
-
- //유형종료 예정일이 없는경우는 체크 하지 않기 위해서 todd로 셋팅해준다.
- if(opertodd == ""){
- opertodd = todd;
- }
- if(opertodd > todd ){
- messageBox("유형종료예정일이 종료일자보다 클수 없습니다. 변경처리를","E001");
- return;
- }
- }
- pre_fromdd = fromdd;
- pre_todd = todd;
-
- }
- //기간별 본인부담 적용율 내역갯수만큼 돌면서 10%구간을 체크하여 유형번경 로직을 호출한다.
- for (var i = 1; i < grd_appterm.rows; i++) {
- var fromdate = model.getValue("/root/hidden/list1/insulist[" + i + " ]/fromdd");
- var ownbrate = model.getValue("/root/hidden/list1/insulist[" + i + " ]/ownbrate");
- if(ownbrate == "10" && (fromdate > maxv191192todd) ){ // 조건추가 이미 수술로 인해 적용된 유형이 있으면 제외하고 함. 20080915 박창원
- var pid = model.getValue("/root/hidden/list1/insulist[" + i + "]/pid");
- var indd = model.getValue("/root/hidden/list1/insulist[" + i + "]/indd");
- var cretno = model.getValue("/root/main/list3/insulist[1]/cretno");
- var fromdd = model.getValue("/root/hidden/list1/insulist[" + i + "]/fromdd");
- var seqno = model.getValue("/root/main/list3/insulist[" + (grd_insulist.rows - 1) + "]/seqno");
- var mskind = model.getValue("/root/main/list3/insulist[1]/mskind");
- var todd = model.getValue("/root/hidden/list1/insulist[" + i + "]/todd");
- var insukind = model.getValue("/root/hidden/list1/insulist[" + i + "]/insukind");
- var suppkind = model.getValue("/root/hidden/list1/insulist[" + i + "]/col01");
- var instcd = model.getValue("/root/hidden/list1/insulist[" + i + "]/instcd");
- var opertodd = model.getValue("/root/hidden/list1/insulist[" + i + "]/todd");
-
- model.resetInstanceNode("/root/hidden/list2/insulist");
- var cNode = instance1.selectSingleNode("/root/hidden/list2/insulist");
- if(cNode == null){
- if(pid){
- model.makeNode("/root/hidden/list2/insulist/iphs_status");
- model.makeNode("/root/hidden/list2/insulist/iphs_pid");
- model.makeNode("/root/hidden/list2/insulist/iphs_indd");
- model.makeNode("/root/hidden/list2/insulist/iphs_cretno");
- model.makeNode("/root/hidden/list2/insulist/iphs_fromdd");
- model.makeNode("/root/hidden/list2/insulist/iphs_seqno");
- model.makeNode("/root/hidden/list2/insulist/iphs_mskind");
- model.makeNode("/root/hidden/list2/insulist/iphs_todd");
- model.makeNode("/root/hidden/list2/insulist/iphs_insukind");
- model.makeNode("/root/hidden/list2/insulist/iphs_suppkind");
- model.makeNode("/root/hidden/list2/insulist/iphs_instcd");
- model.makeNode("/root/hidden/list2/insulist/iphs_opertodd");
-
- model.setValue("/root/hidden/list2/insulist/iphs_status","B");
- model.setValue("/root/hidden/list2/insulist/iphs_pid",pid);
- model.setValue("/root/hidden/list2/insulist/iphs_indd",indd);
- model.setValue("/root/hidden/list2/insulist/iphs_cretno",cretno);
- model.setValue("/root/hidden/list2/insulist/iphs_fromdd",fromdd);
- model.setValue("/root/hidden/list2/insulist/iphs_seqno",seqno);
- model.setValue("/root/hidden/list2/insulist/iphs_mskind",mskind);
- // 20100423 JHP 개심개두 종료일자를 무조건 99991231에서 변경함. 현재일자 기준 종료일이 이전이면 todd, 같거나 크면 99991231로 변경 시작
- // model.setValue("/root/hidden/list2/insulist/iphs_todd", "99991231"); // 이전
- var getcurdd = getCurrentDate();
- if(getcurdd > todd){
- model.setValue("/root/hidden/list2/insulist/iphs_todd", todd);
- }else{
- model.setValue("/root/hidden/list2/insulist/iphs_todd", "99991231");
- }
- // 20100423 JHP 개심개두 종료일자를 무조건 99991231에서 변경함. 현재일자 기준 종료일이 이전이면 todd, 같거나 크면 99991231로 변경 끝
- model.setValue("/root/hidden/list2/insulist/iphs_insukind",insukind);
- model.setValue("/root/hidden/list2/insulist/iphs_suppkind",suppkind);
- model.setValue("/root/hidden/list2/insulist/iphs_instcd",instcd);
- model.setValue("/root/hidden/list2/insulist/iphs_opertodd",opertodd);
-
- }
- }else{
- if(pid){
- model.setValue("/root/hidden/list2/insulist/iphs_status","B");
- model.setValue("/root/hidden/list2/insulist/iphs_pid",pid);
- model.setValue("/root/hidden/list2/insulist/iphs_indd",indd);
- model.setValue("/root/hidden/list2/insulist/iphs_cretno",cretno);
- model.setValue("/root/hidden/list2/insulist/iphs_fromdd",fromdd);
- model.setValue("/root/hidden/list2/insulist/iphs_seqno",seqno);
- model.setValue("/root/hidden/list2/insulist/iphs_mskind",mskind);
- // 20100423 JHP 개심개두 종료일자를 무조건 99991231에서 변경함. 현재일자 기준 종료일이 이전이면 todd, 같거나 크면 99991231로 변경 시작
- // model.setValue("/root/hidden/list2/insulist/iphs_todd", "99991231"); // 이전
- var getcurdd = getCurrentDate();
- if(getcurdd > todd){
- model.setValue("/root/hidden/list2/insulist/iphs_todd", todd);
- }else{
- model.setValue("/root/hidden/list2/insulist/iphs_todd", "99991231");
- }
- // 20100423 JHP 개심개두 종료일자를 무조건 99991231에서 변경함. 현재일자 기준 종료일이 이전이면 todd, 같거나 크면 99991231로 변경 끝
- model.setValue("/root/hidden/list2/insulist/iphs_insukind",insukind);
- model.setValue("/root/hidden/list2/insulist/iphs_suppkind",suppkind);
- model.setValue("/root/hidden/list2/insulist/iphs_instcd",instcd);
- model.setValue("/root/hidden/list2/insulist/iphs_opertodd",opertodd);
-
- }
- }
- model.removenode("/root/hidden/list2/rslt");
- submit("TXPIJ01902");
- model.refresh();
- }
- }
- if(messageBox("유형변경이 완료 되었습니다. 변경된 내역의 소급처리를", "Q004") == 6){
- var sWindowMsg = "수가계산중입니다...";
- callLoadingWindow(sWindowMsg);
- fReCalc() ;
- removeLoadingWindow();
- }
- messageBox("소급계산이", "I002");
- opener.model.refresh();
- opener.javascript.fGetItemInfo();
- activateOpener(); // (common.js)에서 제공하는 함수로 opener를 activate한다.
- window.close(); // F5 실행시 IE를 종료시킨다.
-
- // model.removeNodeset("/root/main");
- // submit("TRPIJ01901");
- // model.refresh();
- ]]>
- </script>
- </button>
- <button id="button2" class="btn4_letter2" style="left:736px; top:5px; width:56px; height:22px; ">
- <caption>닫기</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- window.close(); // F5 실행시 IE를 종료시킨다.
- ]]>
- </script>
- </button>
- <line id="line32" class="line_6" style="x1:0px; y1:0px; x2:799px; "/>
- <button id="btn_opapply" class="btn4_letter4" style="left:593px; top:5px; width:80px; height:22px; ">
- <caption>기간적용</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- // 모든수술이 기간적용이 되어 있을 경우 기간적용 버튼을 조작 하면 알럿
- // 모든수술이 전부 적용되었는지 확인 - 20080926 박창원
- var rows = grd_operlist.rows;
- var apply = "Y"
- for (i=1; i< rows; i++) {
- var applyop = model.getValue("/root/main/list2/opcdlist[" + i + "]/applyop");
- if (applyop == "N") {
- apply = "N";
- }
- }
-
- if (applyop == "Y") {
- messageBox("모든 수술이 유형적용 되어있습니다. 복원후에","C003");
- return;
- }
-
- // loop : 입원일로 부터 현재일까지 날짜와 보조유형(수술일 지정체크) 해서 보조유형을 담아 놓는다.
- var days = new Array();
- var daysuppkind = new Array();
- var indd = model.getValue("/root/send/cond/indd");
- var curdd = getCurrentDate();
- var pid = model.getValue("/root/send/cond/pid");
- var hngnm = model.getValue("/root/main/list3/insulist[1]/hngnm");
- var insukind = model.getValue("/root/main/list3/insulist[1]/insukind");
- var ownbrate = model.getValue("/root/send/cond/ownbrate");
- var lastoptodd = model.getValue("/root/main/list2/opcdlist[" + (grd_operlist.rows-1) + "]/todd");
- var cretno = model.getValue("/root/send/cond/cretno");
- var cfe = model.getValue("/root/send/cond/cfe");
-
- // 추가 : 20091029 JHP 기간적용시 instcd가 없어서 이후 중증요율 적용시 inpt의 suppkind가 변경이 없다. 하여 보험정보에서 추가함.
- var instcd = model.getValue("/root/main/list3/insulist[1]/instcd");
- temptodd = lastoptodd.toDate("YYYYMMDD");
- temptodd = temptodd.getAddDate(1);
- temptodd = temptodd.getDateFormat();
-
- // model.removeNodeset("/root/hidden/list5/kindlist");
- // model.makeNode("/root/hidden/list5/kindlist[1]/fromdd");
- // model.makeNode("/root/hidden/list5/kindlist[1]/todd");
- // model.makeNode("/root/hidden/list5/kindlist[1]/suppkind");
- // loop의 범위는 입원일로 부터 마지막 수술적용일자 + 1 까지이다.
- var period = getDateInterval(indd,temptodd);
- // alert(period);
- var applydate = indd;
-
- for(i=1; i<= period; i++) {
- // 지정된 수술일자를 판단하여 해당일에 대한 보조유형을 산출
- for(j=1; j< grd_operlist.rows;j++) {
- var opfromdd = model.getValue("/root/main/list2/opcdlist[" + j + "]/fromdd");
- var optodd = model.getValue("/root/main/list2/opcdlist[" + j + "]/todd");
-
- if ((applydate >= opfromdd) && (applydate <= optodd)) {
- days[i] = applydate;
- // 20090325 차상위적용
- if (cfe == "E" || cfe == "F") {
- daysuppkind[i] = "39";
- }else {
- daysuppkind[i] = "05";
- }
- //alert(applydate);
- } // if ((applydate >= fromdd) && (applydate <= todd))
- else {
- if (daysuppkind[i] != "05" && daysuppkind[i] != "39") {
- //alert("a" + applydate);
- days[i] = applydate;
- if (cfe == "E" || cfe == "F") {
- daysuppkind[i] = "33";
- } else {
- daysuppkind[i] = "00";
- }
- } // if (daysuppkind[i] != "05")
- } // else
- } // for j
- // applydate를 하루씩 증가
- // alert(days[i] + " " + daysuppkind[i]);
- applydate = applydate.toDate("YYYYMMDD");
- applydate = applydate.getAddDate(1);
- applydate = applydate.getDateFormat();
- } // for i
-
- // 유형의 기본 자료를 생성한다.
- var kindcnt = 1;
- var kindchange = "N";
- for (k=1; k<= period; k++) {
- var beforefromdd;
- var basisdd;
- var todd;
- var suppkind;
- var basissuppkind;
-
- if(k == 1) {
- fromdd = days[k];
- basisdd = days[k];
- suppkind = daysuppkind[k];
- basissuppkind = daysuppkind[k];
- kindchage = "N";
- } else {
- if (kindchange == "Y") {
- fromdd = days[k];
- suppkind = daysuppkind[k];
- kindchange = "N";
- }
- basisdd = days[k];
- basissuppkind = daysuppkind[k];
- }
- if (suppkind != basissuppkind) {
- todd = days[k];
- todd = todd.toDate("YYYYMMDD");
- todd = todd.getAddDate(-1);
- todd = todd.getDateFormat();
-
- if (kindcnt == 1) {
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/pid", pid);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/hngnm", hngnm);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/indd", indd);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/appdd", fromdd);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/insukind", insukind);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/col01", suppkind);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/fromdd", fromdd);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/todd", todd);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/cretno", cretno);
- if (suppkind == "00") {
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/ownbrate", 20);
- } else if (suppkind == "33") {
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/ownbrate", 14);
- } else {
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/ownbrate", "10");
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/opertodd", todd);
- }
-
- // 추가 : 20091029 JHP 기간적용시 instcd가 없어서 이후 중증요율 적용시 inpt의 suppkind가 변경이 없다. 하여 보험정보에서 추가함.
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/instcd", instcd);
- /* model.setValue("/root/hidden/list5/kindlist[" + kindcnt + "]/fromdd", fromdd);
- model.setValue("/root/hidden/list5/kindlist[" + kindcnt + "]/todd", todd);
- model.setValue("/root/hidden/list5/kindlist[" + kindcnt + "]/suppkind", suppkind); */
- kindcnt++;
- kindchange = "Y";
- } else {
- grd_appterm.addRow(true, true);
-
- fromdd = model.getValue("/root/hidden/list1/insulist[" + (kindcnt-1) + "]/todd").toDate("YYYYMMDD");
- fromdd = fromdd.getAddDate(1);
- fromdd = fromdd.getDateFormat();
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/pid", pid);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/hngnm", hngnm);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/indd", indd);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/appdd", fromdd);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/insukind", insukind);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/col01", suppkind);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/fromdd", fromdd);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/todd", todd);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/cretno", cretno);
- if (suppkind == "00") {
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/ownbrate", 20);
- } else if (suppkind == "33") {
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/ownbrate", 14);
- } else {
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/ownbrate", "10");
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/opertodd", todd);
- }
- // 추가 : 20091029 JHP 기간적용시 instcd가 없어서 이후 중증요율 적용시 inpt의 suppkind가 변경이 없다. 하여 보험정보에서 추가함.
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/instcd", instcd);
-
- kindcnt++;
- kindchange = "Y";
- }
- }
- if (k == period) {
- if(suppkind == "05" || suppkind == "39") {
- todd = lastoptodd;
- if(kindcnt != 1) {
- fromdd = model.getValue("/root/hidden/list1/insulist[" + (kindcnt-1) + "]/todd").toDate("YYYYMMDD");
- fromdd = fromdd.getAddDate(1);
- fromdd = fromdd.getDateFormat();
- }
- grd_appterm.addRow(true, true);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/pid", pid);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/hngnm", hngnm);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/indd", indd);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/appdd", fromdd);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/insukind", insukind);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/col01", suppkind);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/fromdd", fromdd);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/todd", todd);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/ownbrate", "10");
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/opertodd", todd);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/cretno", cretno);
- // 추가 : 20091029 JHP 기간적용시 instcd가 없어서 이후 중증요율 적용시 inpt의 suppkind가 변경이 없다. 하여 보험정보에서 추가함.
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/instcd", instcd);
-
- kindcnt ++;
- var lastfromdd = lastoptodd.toDate("YYYYMMDD");
- lastfromdd = lastfromdd.getAddDate(1);
- lastfromdd = lastfromdd.getDateFormat();
-
- todd = "99991231";
-
- grd_appterm.addRow(true, true);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/pid", pid);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/hngnm", hngnm);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/indd", indd);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/appdd", lastfromdd);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/insukind", insukind);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/fromdd", lastfromdd);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/todd", todd);
- if (cfe == "E" || cfe == "F") {
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/col01","33");
- } else {
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/col01","00");
- }
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/cretno", cretno);
- var suppkindcd = model.getValue("/root/hidden/list1/insulist[" + kindcnt + "]/col01");
- if (suppkindcd == "00") {
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/ownbrate", 20);
- } if (suppkindcd == "33") {
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/ownbrate", 14);
- }else {
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/ownbrate", ownbrate);
- }
- // 추가 : 20091029 JHP 기간적용시 instcd가 없어서 이후 중증요율 적용시 inpt의 suppkind가 변경이 없다. 하여 보험정보에서 추가함.
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/instcd", instcd);
-
- kindcnt++;
- } else {
- if (kindcnt != 1) {
- fromdd = model.getValue("/root/hidden/list1/insulist[" + (kindcnt-1) + "]/todd").toDate("YYYYMMDD");
- // alert(fromdd);
- fromdd = fromdd.getAddDate(1);
- fromdd = fromdd.getDateFormat();
- // alert(fromdd);
- }
-
- todd = "99991231";
- grd_appterm.addRow(true, true);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/pid", pid);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/hngnm", hngnm);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/indd", indd);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/appdd", fromdd);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/insukind", insukind);
- if (cfe == "E" || cfe == "F") {
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/col01","33");
- } else {
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/col01","00");
- }
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/fromdd", fromdd);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/todd", todd);
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/cretno", cretno);
- var suppkindcd = model.getValue("/root/hidden/list1/insulist[" + kindcnt + "]/col01");
- if (suppkindcd == "00") {
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/ownbrate", 20);
- } if (suppkindcd == "33") {
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/ownbrate", 14);
- }else {
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/ownbrate", ownbrate);
- }
- // 추가 : 20091029 JHP 기간적용시 instcd가 없어서 이후 중증요율 적용시 inpt의 suppkind가 변경이 없다. 하여 보험정보에서 추가함.
- model.setValue("/root/hidden/list1/insulist[" + kindcnt + "]/instcd", instcd);
-
- kindcnt++;
- }
-
- }
- } // for k
-
-
-
- /* var insulist = instance1.selectSingleNode("/root/main/list2/opcdlist");
-
- var new_todd = "";
- var thisYear = ""; // 현재 입력된 연
- var thisMonth = ""; // 현재 입력된 월
- var thisDay = ""; // 현재 입력된 일
- var nextDate = "";
- var nextfromdd = "";
- var beforefromdd = "";
- var nexttodd = "";
- var maxtodd = "";
-
- var row = 0;
-
- if(insulist != null){
-
- model.removeNodeset("/root/hidden/list3");
-
- var vcode = model.getValue("/root/send/cond/vcode");
- var opcdcnt = getNodesetCount("/root/main/list2/opcdlist");
-
- if (opcdcnt == 1) {
- model.makeNode("/root/hidden/list3/opcdlist/fromdd");
- model.makeNode("/root/hidden/list3/opcdlist/todd");
- model.setValue("/root/hidden/list3/opcdlist[" + opcdcnt + "]/fromdd",model.getValue("/root/main/list2/opcdlist[" + opcdcnt + " ]/fromdd"));
- model.setValue("/root/hidden/list3/opcdlist[" + opcdcnt + "]/todd",model.getValue("/root/main/list2/opcdlist[" + opcdcnt + " ]/todd"));
-
- } else {
- opcdcnt = eval(opcdcnt) +1;
-
- var vfromdd = "";
- var vtodd = "";
- var vflag = "";
- var pfromdd = "";
- var ptodd = "";
-
- for (i=1; i<opcdcnt; i++) {
-
- row = row + 1;
-
- vfromdd = model.getValue("/root/main/list2/opcdlist[" + row + " ]/fromdd");
- vtodd = model.getValue("/root/main/list2/opcdlist[" + row + " ]/todd");
- vflag = model.getValue("/root/main/list2/opcdlist[" + row + "]/flag");
-
- if (vfromdd == "") {
- messageBox("적용시작일자는","I003");
- return;
- }
-
- if (vtodd == "") {
- messageBox("적용종료일자는","I003");
- return;
- }
-
- if (row == 1) {
- pfromdd = vfromdd;
- ptodd = vtodd;
-
- model.makeNode("/root/hidden/list3/opcdlist[" + row + " ]/fromdd");
- model.makeNode("/root/hidden/list3/opcdlist[" + row + " ]/todd");
- model.makeNode("/root/hidden/list3/opcdlist[" + row + " ]/flag");
-
-
- model.setValue("/root/hidden/list3/opcdlist[" + row + "]/fromdd",vfromdd);
- model.setValue("/root/hidden/list3/opcdlist[" + row + "]/todd",vtodd);
- model.setValue("/root/hidden/list3/opcdlist[" + row + "]/flag",vflag);
-
- } else {
- if (ptodd > vfromdd) {
-
- row = row -1;
-
- model.setValue("/root/hidden/list3/opcdlist[" + row + "]/todd",vtodd);
-
- row = row +1;
-
- } else {
-
- var beforefromdd = "";
- var nexttodd = "";
-
- thisYear = ptodd.substring(0,4); // 현재 입력된 연
- thisMonth = ptodd.substring(4,6); // 현재 입력된 월
- thisDay = ptodd.substring(6,8); // 현재 입력된 일
- nextDate = new Date(thisYear, (thisMonth - 1), thisDay);
- nextDate.setHours(24); // 24시간 뒤인 다음날 날짜를 구한다.
- beforefromdd = "";
- beforefromdd += nextDate.getYear();
- if ((nextDate.getMonth() + 1) < 10) {
- beforefromdd += "0" + (nextDate.getMonth() + 1);
- }
- else {
- beforefromdd += (nextDate.getMonth() + 1);
- }
- if (nextDate.getDate() < 10) {
- beforefromdd += "0" + nextDate.getDate();
- }
- else {
- beforefromdd += nextDate.getDate();
- }
-
- thisYear = vfromdd.substring(0,4); // 현재 입력된 연
- thisMonth = vfromdd.substring(4,6); // 현재 입력된 월
- thisDay = vfromdd.substring(6,8); // 현재 입력된 일
- nextDate = new Date(thisYear, (thisMonth - 1), thisDay);
- nextDate.setHours(24); // 24시간 뒤인 다음날 날짜를 구한다. vv
- nexttodd = "";
- nexttodd += nextDate.getYear();
- if ((nextDate.getMonth() + 1) < 10) {
- nexttodd += "0" + (nextDate.getMonth() + 1);
- }
- else {
- nexttodd += (nextDate.getMonth() + 1);
- }
- if (nextDate.getDate() < 10) {
- nexttodd += "0" + nextDate.getDate();
- }
- else {
- nexttodd += nextDate.getDate();
- }
- pfromdd = vfromdd;
- ptodd = vtodd;
-
- // 적용 수술 건 중 적용기간 사이 기간을 새로운 기간으로 생성
- model.makeNode("/root/hidden/list3/opcdlist[" + row + " ]/fromdd");
- model.makeNode("/root/hidden/list3/opcdlist[" + row + " ]/todd");
- model.makeNode("/root/hidden/list3/opcdlist[" + row + " ]/flag");
-
- model.setValue("/root/hidden/list3/opcdlist[" + row + "]/fromdd",beforefromdd);
- model.setValue("/root/hidden/list3/opcdlist[" + row + "]/todd",nexttodd);
- model.setValue("/root/hidden/list3/opcdlist[" + row + "]/flag","N");
-
- // 해당 수술 건의 적용 기간 설정
- row = row +1;
- model.makeNode("/root/hidden/list3/opcdlist[" + row + " ]/fromdd");
- model.makeNode("/root/hidden/list3/opcdlist[" + row + " ]/todd");
- model.makeNode("/root/hidden/list3/opcdlist[" + row + " ]/flag");
- model.setValue("/root/hidden/list3/opcdlist[" + row + "]/fromdd",vfromdd);
- model.setValue("/root/hidden/list3/opcdlist[" + row + "]/todd",vtodd);
- model.setValue("/root/hidden/list3/opcdlist[" + row + "]/flag",vflag);
- }
- }
-
- }
- }
- }
-
- model.refresh();
- var rowcnt = getNodesetCount("/root/hidden/list3/opcdlist");
-
- model.removeNodeset("/root/hidden/list1");
- model.removeNodeset("/root/hidden/list2");
-
- model.refresh();
-
- for (m=0; m<rowcnt; m++) {
-
- var vcode = model.getValue("/root/send/cond/vcode");
- var row = m+1;
-
- var fromdd = model.getValue("/root/hidden/list3/opcdlist[" + row + " ]/fromdd");
- var todd = model.getValue("/root/hidden/list3/opcdlist[" + row + " ]/todd");
- var flag = model.getValue("/root/hidden/list3/opcdlist[" + row + " ]/flag");
- var insucnt = grd_insulist.rows;
-
- // 시작일자와 현재일자까지 30일 미만인 경우
- if (getDateInterval(fromdd,getCurrentDate()) < 30 ) {
-
- //보험정보 갯수 만큼 돌면서 체크한다.
- for (var i = 1; i < insucnt; i++) {
-
- var fromdd_term = model.getValue("/root/main/list3/insulist[" + i + " ]/fromdd");
- var todd_term = model.getValue("/root/main/list3/insulist[" + i + " ]/todd");
- var clamflag = model.getValue("/root/main/list3/insulist[" + i + " ]/clamflag");
-
- if(fromdd_term < fromdd && todd_term == '99991231' && clamflag == 'N'){
-
- grd_appterm.addrow();
- model.copyNode("/root/hidden/list1/insulist[" + grd_appterm.row + " ]", "/root/main/list3/insulist[" + i + " ]");
- thisYear = fromdd.substring(0,4); // 현재 입력된 연
- thisMonth = fromdd.substring(4,6); // 현재 입력된 월
- thisDay = fromdd.substring(6,8); // 현재 입력된 일
- nextDate = new Date(thisYear, (thisMonth - 1), thisDay);
- nextDate.setHours(-24); // 24시간 뒤인 다음날 날짜를 구한다.
- nextfromdd = "";
- nextfromdd += nextDate.getYear();
- if ((nextDate.getMonth() + 1) < 10) {
- nextfromdd += "0" + (nextDate.getMonth() + 1);
- }
- else {
- nextfromdd += (nextDate.getMonth() + 1);
- }
- if (nextDate.getDate() < 10) {
- nextfromdd += "0" + nextDate.getDate();
- }
- else {
- nextfromdd += nextDate.getDate();
- }
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/todd",nextfromdd);
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/opertodd",nextfromdd);
- grd_appterm.addrow();
- model.copyNode("/root/hidden/list1/insulist[" + grd_appterm.row + " ]", "/root/main/list3/insulist[" + i + " ]");
- if(vcode == "V191"){
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/suppkind", "05");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/ownbrate", "10");
- }else if(vcode == "V192"){
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/suppkind", "05");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/ownbrate", "10");
- }
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/opertodd",todd);
- }else if(todd_term != '99991231' && clamflag == 'Y'){
- grd_appterm.addrow();
- model.copyNode("/root/hidden/list1/insulist[" + grd_appterm.row + " ]", "/root/main/list3/insulist[" + i + " ]");
- }else{
- grd_appterm.addrow();
- model.copyNode("/root/hidden/list1/insulist[" + grd_appterm.row + " ]", "/root/main/list3/insulist[" + i + " ]");
- if(vcode == "V191"){
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/suppkind", "05");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/ownbrate", "10");
- }else if(vcode == "V192"){
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/suppkind", "05");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/ownbrate", "10");
- }
-
- if(todd_term > todd){
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/opertodd",todd);
- }
-
- }
- }
-
- } else {
- //보험정보 갯수 만큼 돌면서 체크한다.
- for (var i = 1; i < insucnt; i++) {
-
- var fromdd_term = model.getValue("/root/main/list3/insulist[" + i + " ]/fromdd");
- var todd_term = model.getValue("/root/main/list3/insulist[" + i + " ]/todd");
-
- //원유형 시작일자가, 적용 종료기간 보다 크면 해당 없음.
- if(fromdd_term > todd){
- continue;
- }
-
- maxtodd = model.getValue("/root/hidden/list1/insulist[" + grd_appterm.row + "]/todd");
-
- // 이전에 생성된 기간별 본인 부담율 적용 내역의 종료일자 이후 일 경우에만 추가 생성
- if (todd_term > maxtodd) {
-
- //해당유형의 Fromdd 기 심사자 선택한 기간보다 작은경우 선택한 기간이전 유형을 하나더 발생시킨다.
- if(fromdd_term < fromdd){
-
- grd_appterm.addrow();
- model.copyNode("/root/hidden/list1/insulist[" + grd_appterm.row + " ]", "/root/main/list3/insulist[" + i + " ]");
- thisYear = fromdd.substring(0,4); // 현재 입력된 연
- thisMonth = fromdd.substring(4,6); // 현재 입력된 월
- thisDay = fromdd.substring(6,8); // 현재 입력된 일
- nextDate = new Date(thisYear, (thisMonth - 1), thisDay);
- nextDate.setHours(-24); // 24시간 뒤인 다음날 날짜를 구한다.
- nextfromdd = "";
- nextfromdd += nextDate.getYear();
- if ((nextDate.getMonth() + 1) < 10) {
- nextfromdd += "0" + (nextDate.getMonth() + 1);
- }
- else {
- nextfromdd += (nextDate.getMonth() + 1);
- }
- if (nextDate.getDate() < 10) {
- nextfromdd += "0" + nextDate.getDate();
- }
- else {
- nextfromdd += nextDate.getDate();
- }
-
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/todd",nextfromdd);
- maxtodd = nextfromdd;
- //해당유형의 Todd 기 심사자 선택한 기간보다 작은경우 선택한 기간이후 유형을 하나더 발생시킨다.
- if(todd_term > todd){
-
- grd_appterm.addrow();
- model.copyNode("/root/hidden/list1/insulist[" + grd_appterm.row + " ]", "/root/main/list3/insulist[" + i + " ]");
-
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/fromdd", fromdd);
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/todd", todd);
- if(vcode == "V191"){
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/suppkind", "05");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/ownbrate", "10");
- }else if(vcode == "V192"){
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/suppkind", "05");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/ownbrate", "10");
- }
-
- grd_appterm.addrow();
- model.copyNode("/root/hidden/list1/insulist[" + grd_appterm.row + " ]", "/root/main/list3/insulist[" + i + " ]");
- new_todd = todd;
- thisYear = new_todd.substring(0,4); // 현재 입력된 연
- thisMonth = new_todd.substring(4,6); // 현재 입력된 월
- thisDay = new_todd.substring(6,8); // 현재 입력된 일
- nextDate = new Date(thisYear, (thisMonth - 1), thisDay);
- nextDate.setHours(24); // 24시간 뒤인 다음날 날짜를 구한다.
- nextfromdd = "";
- nextfromdd += nextDate.getYear();
- if ((nextDate.getMonth() + 1) < 10) {
- nextfromdd += "0" + (nextDate.getMonth() + 1);
- }
- else {
- nextfromdd += (nextDate.getMonth() + 1);
- }
- if (nextDate.getDate() < 10) {
- nextfromdd += "0" + nextDate.getDate();
- }
- else {
- nextfromdd += nextDate.getDate();
- }
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/fromdd", nextfromdd);
-
- }else if(todd_term == todd){
- grd_appterm.addrow();
- model.copyNode("/root/hidden/list1/insulist[" + grd_appterm.row + " ]", "/root/main/list3/insulist[" + i + " ]");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/fromdd", fromdd);
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/todd", todd);
- if(vcode == "V191"){
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/suppkind", "05");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/ownbrate", "10");
- }else if(vcode == "V192"){
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/suppkind", "05");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/ownbrate", "10");
- }
- //심사자가 선택한 Todd가 기존데이터 보다 큰경우는 미래 날짜로 미리 유형을 하나 더 만들어 놓는다.
- }else{
- grd_appterm.addrow();
- model.copyNode("/root/hidden/list1/insulist[" + grd_appterm.row + " ]", "/root/main/list3/insulist[" + i + " ]");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/fromdd", fromdd);
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/opertodd", todd);
-
- if(vcode == "V191"){
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/suppkind", "05");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/ownbrate", "10");
- }else if(vcode == "V192"){
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/suppkind", "05");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/ownbrate", "10");
- }
- }
- }else if(fromdd_term == fromdd){
- if(todd_term > todd){
- grd_appterm.addrow();
- model.copyNode("/root/hidden/list1/insulist[" + grd_appterm.row + " ]", "/root/main/list3/insulist[" + i + " ]");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/fromdd", fromdd);
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/todd", todd);
- if(vcode == "V191"){
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/suppkind", "05");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/ownbrate", "10");
- }else if(vcode == "V192"){
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/suppkind", "05");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/ownbrate", "10");
- }
- grd_appterm.addrow();
- model.copyNode("/root/hidden/list1/insulist[" + grd_appterm.row + " ]", "/root/main/list3/insulist[" + i + " ]");
- new_todd = todd;
- thisYear = new_todd.substring(0,4); // 현재 입력된 연
- thisMonth = new_todd.substring(4,6); // 현재 입력된 월
- thisDay = new_todd.substring(6,8); // 현재 입력된 일
- nextDate = new Date(thisYear, (thisMonth - 1), thisDay);
- nextDate.setHours(24); // 24시간 뒤인 다음날 날짜를 구한다.
- nextfromdd = "";
- nextfromdd += nextDate.getYear();
- if ((nextDate.getMonth() + 1) < 10) {
- nextfromdd += "0" + (nextDate.getMonth() + 1);
- }
- else {
- nextfromdd += (nextDate.getMonth() + 1);
- }
- if (nextDate.getDate() < 10) {
- nextfromdd += "0" + nextDate.getDate();
- }
- else {
- nextfromdd += nextDate.getDate();
- }
-
-
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/fromdd", nextfromdd);
- //심사자가 선택한 Todd가 기존데이터 보다 큰경우는 미래 날짜로 미리 유형을 하나 더 만들어 놓는다.
- }else{
-
- grd_appterm.addrow();
- model.copyNode("/root/hidden/list1/insulist[" + grd_appterm.row + " ]", "/root/main/list3/insulist[" + i + " ]");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/todd", todd);
- maxtodd = todd;
- if(vcode == "V191"){
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/suppkind", "05");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/ownbrate", "10");
- }else if(vcode == "V192"){
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/suppkind", "05");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/ownbrate", "10");
- }
- grd_appterm.addrow();
- model.copyNode("/root/hidden/list1/insulist[" + grd_appterm.row + " ]", "/root/main/list3/insulist[" + i + " ]");
- new_todd = todd;
- thisYear = new_todd.substring(0,4); // 현재 입력된 연
- thisMonth = new_todd.substring(4,6); // 현재 입력된 월
- thisDay = new_todd.substring(6,8); // 현재 입력된 일
- nextDate = new Date(thisYear, (thisMonth - 1), thisDay);
- nextDate.setHours(24); // 24시간 뒤인 다음날 날짜를 구한다.
- nextfromdd = "";
- nextfromdd += nextDate.getYear();
- if ((nextDate.getMonth() + 1) < 10) {
- nextfromdd += "0" + (nextDate.getMonth() + 1);
- }
- else {
- nextfromdd += (nextDate.getMonth() + 1);
- }
- if (nextDate.getDate() < 10) {
- nextfromdd += "0" + nextDate.getDate();
- }
- else {
- nextfromdd += nextDate.getDate();
- }
-
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/fromdd", nextfromdd);
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/todd", "99991211");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/opertodd", todd);
- }
- }else{
-
- grd_appterm.addrow();
- model.copyNode("/root/hidden/list1/insulist[" + grd_appterm.row + " ]", "/root/main/list3/insulist[" + i + " ]");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/todd",todd);
-
- //해당유형의 Todd가 심사자 선택한 기간보다 작은경우 선택한 기간이후 유형을 하나더 발생시킨다.
- if(todd_term > todd){
-
- new_todd = todd;
- thisYear = new_todd.substring(0,4); // 현재 입력된 연
- thisMonth = new_todd.substring(4,6); // 현재 입력된 월
- thisDay = new_todd.substring(6,8); // 현재 입력된 일
- nextDate = new Date(thisYear, (thisMonth - 1), thisDay);
- nextDate.setHours(24); // 24시간 뒤인 다음날 날짜를 구한다.
- nextfromdd = "";
- nextfromdd += nextDate.getYear();
- if ((nextDate.getMonth() + 1) < 10) {
- nextfromdd += "0" + (nextDate.getMonth() + 1);
- }
- else {
- nextfromdd += (nextDate.getMonth() + 1);
- }
- if (nextDate.getDate() < 10) {
- nextfromdd += "0" + nextDate.getDate();
- }
- else {
- nextfromdd += nextDate.getDate();
- }
-
- if ( fromdd_term < todd && todd_term > todd ) {
-
- if (flag == "Y") {
- if(vcode == "V191"){
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/suppkind", "05");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/ownbrate", "10");
- }else if(vcode == "V192"){
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/suppkind", "05");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/ownbrate", "10");
- }
- }
- }
-
- grd_appterm.addrow();
- model.copyNode("/root/hidden/list1/insulist[" + grd_appterm.row + " ]", "/root/main/list3/insulist[" + i + " ]");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/fromdd", nextfromdd);
-
-
- //심사자가 선택한 Todd가 기존데이터 보다 큰경우는 미래 날짜로 미리 유형을 하나 더 만들어 놓는다.
- }else{
-
- grd_appterm.addrow();
- model.copyNode("/root/hidden/list1/insulist[" + grd_appterm.row + " ]", "/root/main/list3/insulist[" + i + " ]");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/todd", todd);
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/opertodd", todd);
- }
- }
-
- } else {
-
- // 수술일자가 적용 기간에 포함 되지 않을 경우 이면서 마지막 수술건을 경우
- if ( todd >= nextfromdd && todd_term > todd ) {
-
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/todd", todd);
-
- grd_appterm.addrow();
- model.copyNode("/root/hidden/list1/insulist[" + grd_appterm.row + " ]", "/root/main/list3/insulist[" + i + " ]");
-
- new_todd = todd;
- thisYear = new_todd.substring(0,4); // 현재 입력된 연
- thisMonth = new_todd.substring(4,6); // 현재 입력된 월
- thisDay = new_todd.substring(6,8); // 현재 입력된 일
- nextDate = new Date(thisYear, (thisMonth - 1), thisDay);
- nextDate.setHours(24); // 24시간 뒤인 다음날 날짜를 구한다.
- nextfromdd = "";
- nextfromdd += nextDate.getYear();
- if ((nextDate.getMonth() + 1) < 10) {
- nextfromdd += "0" + (nextDate.getMonth() + 1);
- }
- else {
- nextfromdd += (nextDate.getMonth() + 1);
- }
- if (nextDate.getDate() < 10) {
- nextfromdd += "0" + nextDate.getDate();
- }
- else {
- nextfromdd += nextDate.getDate();
- }
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/fromdd", nextfromdd);
-
- } else {
-
- if (flag == "Y") {
- if(vcode == "V191"){
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/suppkind", "05");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/ownbrate", "10");
- }else if(vcode == "V192"){
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/suppkind", "05");
- model.setValue("/root/hidden/list1/insulist[" + grd_appterm.row + " ]/ownbrate", "10");
- }
- }
-
- }
- } // end fi
- } // end for
- } // end for
- } */
- //보험유형에 따른 유형보조의 콤보값을 셋팅해준다.
- for (var i=1; i<grd_appterm.rows; i++) {
- var insukind = model.getValue( "/root/hidden/list1/insulist[" + i + "]/insukind");
- grd_appterm.cellComboNodeset(i,6) = "/root/main/list4/pmbminsu[insukind = '"+insukind+"']";
- }
-
- model.refresh();
- ]]>
- </script>
- </button>
- <button id="btn_iphsrebuild" class="btn4_letter4" style="left:510px; top:5px; width:80px; height:22px; ">
- <caption>유형복원</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- // 2008.08.12 박창원
- // 유형복원은 자료수집이 되었을때는 안된다.
- // 유형복원은 현재 보험유형에서 선택된 row에 대해서만 작업한다.
- // 유형복원은 보조유형을 정상으로 바꾸고 똑같은 유형끼리 합친다.(이부분은 추가 확인이 필요)
-
- // 유형이 05 유형 하나밖에 없을 때에는 00으로 변경한다 - 20080926 박창원
- var count = grd_insulist.rows;
-
- if (count == 2) {
- // 유형을 정상유형으로 -> 이부분은 다른 케이스가 있는지 찾아봐야함
- model.resetInstanceNode("/root/hidden/list2/insulist");
-
- var pid = model.getValue("/root/main/list3/insulist[1]/pid");
- var indd = model.getValue("/root/main/list3/insulist[1]/indd");
- var cretno = model.getValue("/root/main/list3/insulist[1]/cretno");
- var fromdd = model.getValue("/root/main/list3/insulist[1]/fromdd");
- var seqno = model.getValue("/root/main/list3/insulist[1]/seqno");
- var mskind = model.getValue("/root/main/list3/insulist[1]/mskind");
- var todd = model.getValue("/root/main/list3/insulist[1]/todd");
- var insukind = model.getValue("/root/main/list3/insulist[1]/insukind");
- var instcd = model.getValue("/root/main/list3/insulist[1]/instcd");
-
- var cfe = model.getValue("/root/send/cond/cfe");
-
- if (cfe == "E" || cfe == "F") {
- suppkind = "33";
- } else {
- suppkind = "00";
- }
- var cNode = instance1.selectSingleNode("/root/hidden/list2/insulist");
-
- if(cNode == null){
- if(pid){
- model.makeNode("/root/hidden/list2/insulist/iphs_status");
- model.makeNode("/root/hidden/list2/insulist/iphs_pid");
- model.makeNode("/root/hidden/list2/insulist/iphs_indd");
- model.makeNode("/root/hidden/list2/insulist/iphs_cretno");
- model.makeNode("/root/hidden/list2/insulist/iphs_fromdd");
- model.makeNode("/root/hidden/list2/insulist/iphs_seqno");
- model.makeNode("/root/hidden/list2/insulist/iphs_mskind");
- model.makeNode("/root/hidden/list2/insulist/iphs_todd");
- model.makeNode("/root/hidden/list2/insulist/iphs_insukind");
- model.makeNode("/root/hidden/list2/insulist/iphs_suppkind");
- model.makeNode("/root/hidden/list2/insulist/iphs_instcd");
-
- model.setValue("/root/hidden/list2/insulist/iphs_status","B");
- model.setValue("/root/hidden/list2/insulist/iphs_pid",pid);
- model.setValue("/root/hidden/list2/insulist/iphs_indd",indd);
- model.setValue("/root/hidden/list2/insulist/iphs_cretno",cretno);
- model.setValue("/root/hidden/list2/insulist/iphs_fromdd",fromdd);
- model.setValue("/root/hidden/list2/insulist/iphs_seqno",seqno);
- model.setValue("/root/hidden/list2/insulist/iphs_mskind",mskind);
- model.setValue("/root/hidden/list2/insulist/iphs_todd",todd);
- model.setValue("/root/hidden/list2/insulist/iphs_instcd",instcd);
- model.setValue("/root/hidden/list2/insulist/iphs_insukind",insukind);
- model.setValue("/root/hidden/list2/insulist/iphs_suppkind",suppkind);
- }
- }else{
- if(pid){
- model.setValue("/root/hidden/list2/insulist/iphs_status","B");
- model.setValue("/root/hidden/list2/insulist/iphs_pid",pid);
- model.setValue("/root/hidden/list2/insulist/iphs_indd",indd);
- model.setValue("/root/hidden/list2/insulist/iphs_cretno",cretno);
- model.setValue("/root/hidden/list2/insulist/iphs_fromdd",fromdd);
- model.setValue("/root/hidden/list2/insulist/iphs_seqno",seqno);
- model.setValue("/root/hidden/list2/insulist/iphs_mskind",mskind);
- model.setValue("/root/hidden/list2/insulist/iphs_todd",todd);
- model.setValue("/root/hidden/list2/insulist/iphs_instcd",instcd);
- model.setValue("/root/hidden/list2/insulist/iphs_insukind",insukind);
- model.setValue("/root/hidden/list2/insulist/iphs_suppkind",suppkind);
- }
- }
-
- model.removenode("/root/hidden/list2/rslt");
- if (submit("TXPIJ01902")) { // 유형변경
- model.removeNodeset("/root/main/list3/insulist");
- // model.resetInstanceNode("/root/main/list3/insulist");
- submit("TRPIJ01903") // 유형 다시로드
- model.refresh();
- if(messageBox("유형복원이 완료 되었습니다. 변경된 내역의 소급처리를", "Q004") == 6){
- var sWindowMsg = "수가계산중입니다...";
- callLoadingWindow(sWindowMsg);
- fReCalc() ;
- removeLoadingWindow();
- }
- opener.model.refresh();
- opener.javascript.fGetItemInfo();
- messageBox("소급계산이", "I002");
- fInitialize();
- return;
- } else {
- return;
- }
- }
-
-
- // 선택된 유형의 자료수집여부를 판단하여 자료수집된 경우에는 유형복원 불가
- var row = grd_insulist.row;
-
- var clamflag = model.getValue("/root/main/list3/insulist[" + row + "]/clamflag");
-
- if (clamflag == "Y") {
- messageBox("자료수집이 되어 유형변경을 ","E001");
- return;
- }
-
- var suppkind = model.getValue("/root/main/list3/insulist[" + row + "]/suppkind");
- if (suppkind != "05" && suppkind != "39") {
- messageBox(" 개두개심술 외에는 유형변경을 ","E001");
- return;
- }
-
- // 유형을 정상유형으로 -> 이부분은 다른 케이스가 있는지 찾아봐야함
- model.resetInstanceNode("/root/hidden/list2/insulist");
-
- var pid = model.getValue("/root/main/list3/insulist[" + row + "]/pid");
- var indd = model.getValue("/root/main/list3/insulist[" + row + "]/indd");
- var cretno = model.getValue("/root/main/list3/insulist[" + row + "]/cretno");
- var fromdd = model.getValue("/root/main/list3/insulist[" + row + "]/fromdd");
- var seqno = model.getValue("/root/main/list3/insulist[" + row + "]/seqno");
- var mskind = model.getValue("/root/main/list3/insulist[" + row + "]/mskind");
- var todd = model.getValue("/root/main/list3/insulist[" + row + "]/todd");
- var insukind = model.getValue("/root/main/list3/insulist[" + row + "]/insukind");
- var instcd = model.getValue("/root/main/list3/insulist[1]/instcd");
- suppkind = "00"
- var cNode = instance1.selectSingleNode("/root/hidden/list2/insulist");
-
- if(cNode == null){
- if(pid){
- model.makeNode("/root/hidden/list2/insulist/iphs_status");
- model.makeNode("/root/hidden/list2/insulist/iphs_pid");
- model.makeNode("/root/hidden/list2/insulist/iphs_indd");
- model.makeNode("/root/hidden/list2/insulist/iphs_cretno");
- model.makeNode("/root/hidden/list2/insulist/iphs_fromdd");
- model.makeNode("/root/hidden/list2/insulist/iphs_seqno");
- model.makeNode("/root/hidden/list2/insulist/iphs_mskind");
- model.makeNode("/root/hidden/list2/insulist/iphs_todd");
- model.makeNode("/root/hidden/list2/insulist/iphs_insukind");
- model.makeNode("/root/hidden/list2/insulist/iphs_suppkind");
- model.makeNode("/root/hidden/list2/insulist/iphs_instcd");
-
- model.setValue("/root/hidden/list2/insulist/iphs_status","B");
- model.setValue("/root/hidden/list2/insulist/iphs_pid",pid);
- model.setValue("/root/hidden/list2/insulist/iphs_indd",indd);
- model.setValue("/root/hidden/list2/insulist/iphs_cretno",cretno);
- model.setValue("/root/hidden/list2/insulist/iphs_fromdd",fromdd);
- model.setValue("/root/hidden/list2/insulist/iphs_seqno",seqno);
- model.setValue("/root/hidden/list2/insulist/iphs_mskind",mskind);
- model.setValue("/root/hidden/list2/insulist/iphs_todd",todd);
- model.setValue("/root/hidden/list2/insulist/iphs_insukind",insukind);
- model.setValue("/root/hidden/list2/insulist/iphs_suppkind",suppkind);
- model.setValue("/root/hidden/list2/insulist/iphs_instcd",instcd);
- }
- }else{
- if(pid){
- model.setValue("/root/hidden/list2/insulist/iphs_status","B");
- model.setValue("/root/hidden/list2/insulist/iphs_pid",pid);
- model.setValue("/root/hidden/list2/insulist/iphs_indd",indd);
- model.setValue("/root/hidden/list2/insulist/iphs_cretno",cretno);
- model.setValue("/root/hidden/list2/insulist/iphs_fromdd",fromdd);
- model.setValue("/root/hidden/list2/insulist/iphs_seqno",seqno);
- model.setValue("/root/hidden/list2/insulist/iphs_mskind",mskind);
- model.setValue("/root/hidden/list2/insulist/iphs_todd",todd);
- model.setValue("/root/hidden/list2/insulist/iphs_insukind",insukind);
- model.setValue("/root/hidden/list2/insulist/iphs_suppkind",suppkind);
- model.setValue("/root/hidden/list2/insulist/iphs_instcd",instcd);
- }
- }
-
- model.removenode("/root/hidden/list2/rslt");
-
-
- submit("TXPIJ01902"); // 유형변경
- model.removeNodeset("/root/main/list3/insulist");
- // model.resetInstanceNode("/root/main/list3/insulist");
- submit("TRPIJ01903") // 유형 다시로드
- model.refresh();
-
- // 여기서부터는 유형 합치기
- // 합치기 위한 시작일자와 종료일자를 선정한다.(보험유형과 보조유형이 같으면 합치기 단, 자료수집이 된 유형은 합치는 대상에서 제외)
-
- var curmskind = model.getValue("/root/main/list3/insulist[" + row + "]/mskind");
- if (row == 1) {
- var nextsuppkind = model.getValue("/root/main/list3/insulist[" + (row + 1) + "]/suppkind");
- var nexttodd = model.getValue("/root/main/list3/insulist[" + (row + 1) + "]/todd");
- var nextmskind = model.getValue("/root/main/list3/insulist[" + (row + 1) + "]/mskind");
- var instcd = model.getValue("/root/main/list3/insulist[1]/instcd");
-
- if (nextsuppkind == "00" && (curmskind == nextmskind)) {
- todd = nexttodd;
- model.setValue("/root/hidden/list2/insulist/iphs_todd",todd);
- model.setValue("/root/hidden/list2/insulist/iphs_instcd",instcd); // 임시
- } else {
- model.setValue("/root/hidden/list2/insulist/iphs_todd",todd);
- model.setValue("/root/hidden/list2/insulist/iphs_instcd",instcd); // 임시
- }
- if(submit("TXPIJ01904")){
- model.removeNodeset("/root/main/list3/insulist");
- submit("TRPIJ01903") // 유형 다시로드
- model.refresh();
- if(messageBox("유형복원이 완료 되었습니다. 변경된 내역의 소급처리를", "Q004") == 6){
- var sWindowMsg = "수가계산중입니다...";
- callLoadingWindow(sWindowMsg);
- fReCalc() ;
- removeLoadingWindow();
- }
- opener.model.refresh();
- opener.javascript.fGetItemInfo();
- messageBox("소급계산이", "I002");
- fInitialize();
- // activateOpener(); // (common.js)에서 제공하는 함수로 opener를 activate한다.
- // window.close(); // F5 실행시 IE를 종료시킨다.
- }
- } else if (row > 1) {
- var prevsuppkind = model.getValue("/root/main/list3/insulist[" + (row - 1) + "]/suppkind");
- var prevfromdd = model.getValue("/root/main/list3/insulist[" + (row - 1) + "]/fromdd");
- var prevmskind = model.getValue("/root/main/list3/insulist[" + (row - 1) + "]/mskind");
- var prevclamflag = model.getValue("/root/main/list3/insulist[" + row + "]/clamflag");
- var nextsuppkind = model.getValue("/root/main/list3/insulist[" + (row + 1) + "]/suppkind");
- var nexttodd = model.getValue("/root/main/list3/insulist[" + (row + 1) + "]/todd");
- var nextclamflag = model.getValue("/root/main/list3/insulist[" + (row + 1) + "]/clamflag");
- var nextmskind = model.getValue("/root/main/list3/insulist[" + (row + 1) + "]/mskind");
- var instcd = model.getValue("/root/main/list3/insulist[1]/instcd");
- if (prevsuppkind == "00" && prevclamflag == "N" && (curmskind == prevmskind)) {
- fromdd = prevfromdd;
- model.setValue("/root/hidden/list2/insulist/iphs_fromdd",fromdd);
- model.setValue("/root/hidden/list2/insulist/iphs_instcd",instcd); // 임시
- }
- if (nextsuppkind == "00"&& nextclamflag == "N" && (curmskind == nextmskind)) {
- todd = nexttodd;
- model.setValue("/root/hidden/list2/insulist/iphs_todd",todd);
- model.setValue("/root/hidden/list2/insulist/iphs_instcd",instcd); // 임시
- }
- if(submit("TXPIJ01904")){
- model.removeNodeset("/root/main/list3/insulist");
- submit("TRPIJ01903") // 유형 다시로드
- model.refresh();
- if(messageBox("유형복원이 완료 되었습니다. 변경된 내역의 소급처리를", "Q004") == 6){
- var sWindowMsg = "수가계산중입니다...";
- callLoadingWindow(sWindowMsg);
- fReCalc() ;
- removeLoadingWindow();
- }
- opener.model.refresh();
- opener.javascript.fGetItemInfo();
- messageBox("소급계산이", "I002");
-
-
- // activateOpener(); // (common.js)에서 제공하는 함수로 opener를 activate한다.
- // window.close(); // F5 실행시 IE를 종료시킨다.
- }
- }
-
-
- /*model.setValue("/root/hidden/list2/insulist/iphs_fromdd","20080715");
- model.setValue("/root/hidden/list2/insulist/iphs_todd","99991231");
- model.setValue("/root/hidden/list2/insulist/iphs_instcd","012");
- submit("TXPIJ01904"); */
-
- model.removeNodeset("/root/main/list3/insulist");
- submit("TRPIJ01903") // 유형 다시로드
- model.refresh();
- /* model.resetInstanceNode("/root/hidden/source");
- model.makevalue("/root/hidden/source/pid", model.getValue("/root/send/cond/pid"));
- model.makevalue("/root/hidden/source/indd", model.getValue("/root/send/cond/indd"));
- model.makevalue("/root/hidden/source/cretno", model.getValue("/root/send/cond/cretno"));
- model.makevalue("/root/hidden/source/mskind", model.getValue("/root/send/cond/mskind"));
- modal("../../../pam/ipatmngtweb/xrw/SMPMI00400", "1","50", "50", "SMPMI00400", "/root/hidden/source", "/root/hidden/source", "", ""); */
- ]]>
- </script>
- </button>
- </group>
- <button id="btn_save" class="btn5_letter2" style="left:747px; top:353px; width:42px; height:19px; ">
- <caption>저장</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- var arow = grd_insulist.rows;
- var hrow = grd_insulist.row;
- if (hrow <= "0"){
- messageBox("변경할 유형이력을","C002");
- }else{
- var newoperdd = model.getValue("/root/hidden/newoperddsend/newoperdd");
- if(newoperdd == ""){
- messageBox("변경할 유형종료예정일을","C001");
- }else{
- var pid = model.getValue("/root/main/list3/insulist[" + hrow + "]/pid");
- var indd = model.getValue("/root/main/list3/insulist[" + hrow + "]/indd");
- var cretno = model.getValue("/root/main/list3/insulist[" + hrow + "]/cretno");
- var instcd = model.getValue("/root/main/list3/insulist[" + hrow + "]/instcd");
- var insukind = model.getValue("/root/main/list3/insulist[" + hrow + "]/insukind");
- var suppkind = model.getValue("/root/main/list3/insulist[" + hrow + "]/suppkind");
- var fromdd = model.getValue("/root/main/list3/insulist[" + hrow + "]/fromdd");
- var todd = model.getValue("/root/main/list3/insulist[" + hrow + "]/todd");
- var mskind = model.getValue("/root/main/list3/insulist[" + hrow + "]/mskind");
-
- model.setValue("/root/send/uptoperdd/pid",pid);
- model.setValue("/root/send/uptoperdd/indd",indd);
- model.setValue("/root/send/uptoperdd/cretno",cretno);
- model.setValue("/root/send/uptoperdd/instcd",instcd);
- model.setValue("/root/send/uptoperdd/insukind",insukind);
- model.setValue("/root/send/uptoperdd/suppkind",suppkind);
- model.setValue("/root/send/uptoperdd/fromdd",fromdd);
- model.setValue("/root/send/uptoperdd/todd",todd);
- model.setValue("/root/send/uptoperdd/mskind",mskind);
- model.setValue("/root/send/uptoperdd/newoperdd",newoperdd);
-
- submit("TXPIJ01905");
-
- var result = model.getValue("/root/hidden/newoperddresult/result/inpt_count");
- if(result == "완료"){
- messageBox("유형종료예정일 저장이","I002");
- fInitialize();
- }else {
- messageBox("유형종료예정일 저장에","E009");
- }
- }
- }
- ]]>
- </script>
- </button>
- </xhtml:body>
- </xhtml:html>
|