12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210 |
- var delayTime = "";
- var saveCnt = "";
- var saveState = "";
- function fInitialize(){
- saveCnt = "0";
- model.resetInstanceNode("/root/main/grthlist/list/grth");
- model.removeNodeset("/root/main/grthlist/list/grth");
- model.resetInstanceNode("/root/main/laborlist/list/labor");
- model.removeNodeset("/root/main/laborlist/list/labor");
- model.removeNodeset("/root/main/paminfo/pamlist");
-
- //20110808
- fGetHardCDList("N", 5555, 0 , "/root/init/dept/item"); //성장곡선관련 진료과
- //20110808
- combo4.select(0);
- var sPamInfo = getGlobalVariable("paminfo");
- setCSVToNode("/root/main/paminfo",sPamInfo,"pamlist"); //환자정보내리기
- var sPID = model.getValue("/root/main/paminfo/pamlist/pid");
- var hngnm = model.getValue("/root/main/paminfo/pamlist/hngnm");
- var brthdd = model.getValue("/root/main/paminfo/pamlist/brthdd");
- var rrgstno1 = model.getValue("/root/main/paminfo/pamlist/rrgstno1");
- if(brthdd == ""){
- if(sPID != ""){
- var temp = rrgstno1.substr(0,2);
- if(parseInt(temp) > 50){
- brthdd = "19"+rrgstno1;
- }
- else{
- brthdd = "20"+rrgstno1;
- }
- }
- }
- var sex = model.getValue("/root/main/paminfo/pamlist/sex");
- var orddeptcd = model.getValue("/root/main/paminfo/pamlist/orddeptcd");
- model.setValue("/root/send/pid", sPID);
- model.setValue("/root/main/cond/hngnm", hngnm);
- model.setValue("/root/main/cond/sex", sex);
- if(sPID != ""){
- model.setValue("/root/main/cond/rrgstno1", rrgstno1+"-*******");
- }
- model.setValue("/root/send/orgbrthdd", brthdd);
- var userid = getUserInfo("userid");
- var userDept = getUserInfo("dutplcecd");
-
- //2012/02/20 Start 칠곡 내분비대사센터에서 소아청소년과의 성장곡선을 오픈시 과코드를 변경
- if(getUserInfo("dutplceinstcd")=="032" && getUserInfo("dutplcecd")=="2363400000"){ //<-- 칠곡이면서 내분비대사센터로 로그인시
- userDept="2110000000"; //<-- 소아청소년과
- }
- //2012/02/20 End
-
- //2013/05/13 Start 칠곡 어린이병원 외래센터에서 소아청소년과의 성장곡선을 오픈시 과코드를 변경
- if(getUserInfo("dutplceinstcd")=="032" && getUserInfo("dutplcecd")=="2880000000"){ //<-- 칠곡이면서 어린이병원외래센터로 로그인시
- userDept="2110000000"; //<-- 소아청소년과
- }
- //2013/05/13 End
-
- //2014/03/06 Start 칠곡 발달재활센터에서 로그인시 과코드를 변경
- if(getUserInfo("dutplceinstcd")=="032" && getUserInfo("dutplcecd")=="2990000000"){ //<-- 칠곡이면서 어린이병원외래센터로 로그인시
- userDept="2110000000"; //<-- 소아청소년과
- }
-
- //2014/04/01 Start
- /*
- 소아청소년 내분비 2112300000
- 소아청소년 소화기영양 2112400000
- 소아청소년 신경 2112500000
- 신생아 2110500000
- 소아청소년 신장 2112600000
- 소아청소년 심장 2112700000
- 소아 알레르기 호흡기 2112800000
- 소아청소년 혈액종양 2112900000
- */
- if(getUserInfo("dutplceinstcd")=="032" && (getUserInfo("dutplcecd")=="2112300000" || getUserInfo("dutplcecd")=="2112400000" || getUserInfo("dutplcecd")=="2112500000" || getUserInfo("dutplcecd")=="2110500000" ||
- getUserInfo("dutplcecd")=="2112600000" || getUserInfo("dutplcecd")=="2112700000" || getUserInfo("dutplcecd")=="2112800000" || getUserInfo("dutplcecd")=="2112900000")){
- userDept="2110000000"; //<-- 소아청소년과
- }
- //2014/04/01 End
-
- //2013/05/13 End
- //2012/06/13 주석처리 Start
- /*
- if(userid == "DEVB08"){
- userDept = "2100000000";
- model.setValue("/root/send/orddeptcd", "2100000000");
- }
- */
- //2012/06/13 주석처리 End
-
- // 저장 버튼 권한관리
-
- switch(userDept){
- case "2110000000":
- case "2030000000":
- case "2070000000":
- case "3050146000":
- button7.disabled = false;
- button8.disabled = false;
- btn_gr.visible = true;
- break;
- case "2100000000":
- button13.disabled = false;
- button15.disabled = false;
- btn_lb.visible = true;
- break;
- case "2120000000":
- btn_ht.visible = true;
- break;
- }
- if(userDept=="3050146000"){
- model.setValue("/root/send/orddeptcd", "2030000000");
- }else if(userDept=="2070000000"){
- model.setValue("/root/send/orddeptcd", "2070000000");
- }else{
- model.setValue("/root/send/orddeptcd", userDept);
- }
-
- /*if(userid == "EMR" || userid == "DEVB08"){
- model.setValue("/root/send/orddeptcd", "2110000000");
- }*/
-
- // 미비 Popup시 화면 설정
- var unprepflag = opener.javascript.getParameter("unprepflag");
- if(unprepflag == "Y"){
- model.setValue("/root/send/orddeptcd", "2100000000");
- }
-
- // 성장도표, Labor note, 100 Hue test 선택
- orddeptcd = model.getValue("/root/send/orddeptcd");
- switch(orddeptcd){
- case "2110000000":
- case "2030000000":
- case "2070000000":
- model.setValue("/root/send/flag", "1");
- group2.visible = true;
- group3.visible = false;
- break;
- case "2100000000":
- model.setValue("/root/labor/send/flag", "2");
- group2.visible = false;
- group3.visible = true;
- break;
- }
- model.setValue("/root/rec/send/formflag", model.getValue("/root/send/flag"));
- if(sPID == "" && userid == "DEVB08"){
- model.setValue("/root/send/pid", "18942082");
- //model.setValue("/root/main/cond/hngnm", "이아이");
- //model.setValue("/root/main/cond/sex", "F");
- //model.setValue("/root/main/cond/rrgstno1", "030301-3******");
- //model.setValue("/root/send/orgbrthdd", "20030301");
- }
-
- model.setValue("/root/rec/send/fromdd", getDateAddc(getCurrentDate(), -365));
- model.setValue("/root/rec/send/todd", getCurrentDate());
- model.removeNodeset("/root/init/orddd");
- submit("TRMRF05201");
- var nodeCnt = getNodesetCount("/root/init/orddd");
- // 상단정보 받았을때 진료일자 선택 부분
- if(nodeCnt > 0){
- var ioflag = model.getValue("/root/main/paminfo/pamlist/ioflag");
- var orddd;
- if(ioflag == "I"){
- orddd = model.getValue("/root/main/paminfo/pamlist/indd");
- }
- else if(ioflag == "O"){
- orddd = model.getValue("/root/main/paminfo/pamlist/orddd");
- }
-
- var rowcnt = "";
-
- for( i = 1; i <= nodeCnt; i++ ){
- var ordtype = model.getValue("/root/init/orddd["+i+"]/ordtype");
- var dd = model.getValue("/root/init/orddd["+i+"]/orddd");
- if( ioflag == ordtype && orddd == dd){
- rowcnt = model.getValue("/root/init/orddd["+i+"]/rowcnt");
- }
- }
-
- if(rowcnt != ""){
- model.setValue("/root/send/ordd", rowcnt);
- }
- else if(rowcnt == "") {
-
- combo2.select(0);
- }
- }
- fCalcAge();
- // 그래프 선택
- fSelectGraph();
-
- if(orddeptcd == "2110000000" || orddeptcd == "2030000000" || orddeptcd == "2070000000"){
-
- fGetGrphData();
-
- // 행추가
- grd_grth.addRow();
- var cur_row = grd_grth.row-1;
- var curDate = getCurrentDate();
- var maskDate = curDate.substr(0, 4) + "-" + curDate.substr(4, 2) + "-" + curDate.substr(6, 2);
- model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/recdd", maskDate);
- //20110811
- var time=getCurrentTime();
- model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/rectime", time.substring(0, 4));
- //20110811
- model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/seq", grd_grth.row-1);
-
- fCalcGrid();
- model.refresh();
- // 출생 예정일
- var saveflag = "";
- saveflag = model.getValue("/root/send/saveflag");
- var year = model.getValue("/root/main/cond/year");
- var month = model.getValue("/root/main/cond/month");
- var result = saveflag.indexOf("7");
- if(result == "-1"){
- model.setValue("/root/send/brthschedd", "");
- input21.disabled = true;
- }
- else {
- input21.disabled = false;
- }
- if(saveflag == ""){
- // 25개월 이상 이면 2~18세 그래프 선택
- var sMonth = parseInt(year)*12 + parseInt(month);
- if(sMonth >24){
- model.setValue("/root/main/cond/chart", "2");
- model.setValue("/root/send/saveflag", "2");
- button1.selected = true;
- }
- else{
- model.setValue("/root/main/cond/chart", "1");
- model.setValue("/root/send/saveflag", "1");
- button2.selected = true;
- }
- }
- else{
- var vResult = saveflag.indexOf("1");
- var rslt = saveflag.indexOf("2");
- if(vResult != "-1"){
- model.setValue("/root/main/cond/chart", "1");
- button2.selected = true;
- }
- if(rslt != "-1"){
- model.setValue("/root/main/cond/chart", "2");
- button1.selected = true;
- }
- }
- model.refresh();
- var index = combo2.value;
-
- if(sPID != "" && nodeCnt > 0){
- var orddd = model.getValue("/root/init/orddd["+index+"]/orddd");
- var cretno = model.getValue("/root/init/orddd["+index+"]/cretno");
- var orddeptcd = model.getValue("/root/init/orddd["+index+"]/orddeptcd");
- var orddrid = model.getValue("/root/init/orddd["+index+"]/orddrid");
- var ordtype = model.getValue("/root/init/orddd["+index+"]/ordtype");
- model.setValue("/root/send/orddd", orddd);
- model.setValue("/root/send/cretno", cretno);
- model.setValue("/root/send/orddeptcd", orddeptcd);
- model.setValue("/root/send/orddrid", orddrid);
- model.setValue("/root/send/signgenrflag", ordtype);
- }
- fMakeChart();
- }else if(orddeptcd == "2100000000"){
- fGetLaborData();
- fMakeLaborGraph();
-
- }
-
- //2014/04/01 Start
- /*
- 소아청소년 내분비 2112300000
- 소아청소년 소화기영양 2112400000
- 소아청소년 신경 2112500000
- 신생아 2110500000
- 소아청소년 신장 2112600000
- 소아청소년 심장 2112700000
- 소아 알레르기 호흡기 2112800000
- 소아청소년 혈액종양 2112900000
- */
- if(getUserInfo("dutplceinstcd")=="032" && (getUserInfo("dutplcecd")=="2112300000" || getUserInfo("dutplcecd")=="2112400000" || getUserInfo("dutplcecd")=="2112500000" || getUserInfo("dutplcecd")=="2110500000" ||
- getUserInfo("dutplcecd")=="2112600000" || getUserInfo("dutplcecd")=="2112700000" || getUserInfo("dutplcecd")=="2112800000" || getUserInfo("dutplcecd")=="2112900000")){
-
- model.setValue("/root/send/orddeptcd", getUserInfo("dutplcecd"));
- combo1.refresh();
- }
- //2014/04/01 End
- }
- function fMakeChart(){
- TChart1.ClearChart();
- TChart1.RemoveAllSeries();
- TChart1.Axis.RemoveAllCustom();
- //TChart1.ClearChart();
-
- var graph = model.getValue("/root/main/cond/chart");
- var sex = model.getValue("/root/main/cond/sex");
- //margin 값 정하기
- TChart1.Panel.MarginTop = 2;
- TChart1.Panel.MarginLeft = 5;
- TChart1.Panel.MarginRight = 7;
- TChart1.Panel.MarginBottom = 3;
- // TChart1.Axis.Bottom.TickLength = 1010;
- //20110711 이정택 수정
- if(graph=="3" && sex=="M"){
- TChart1.Panel.MarginTop = 2.8;
- TChart1.Panel.MarginLeft = 6;
- TChart1.Panel.MarginRight = 7;
- TChart1.Panel.MarginBottom = 7.5;
- }else if(graph=="3" && sex=="F"){
- TChart1.Panel.MarginTop = 2.5;
- TChart1.Panel.MarginLeft = 6;
- TChart1.Panel.MarginRight = 7.2;
- TChart1.Panel.MarginBottom = 10;
- }else if(graph=="3" && sex==""){
- TChart1.Panel.MarginTop = 2.5;
- TChart1.Panel.MarginLeft = 6;
- TChart1.Panel.MarginRight = 7.2;
- TChart1.Panel.MarginBottom = 10;
- }
-
- if(graph=="4" && sex=="M"){
- TChart1.Panel.MarginTop = 2.8;
- TChart1.Panel.MarginLeft = 6;
- TChart1.Panel.MarginRight = 10.6;
- TChart1.Panel.MarginBottom = 7;
- }else if(graph=="4" && sex=="F"){
- TChart1.Panel.MarginTop = 2.5;
- TChart1.Panel.MarginLeft = 5.9;
- TChart1.Panel.MarginRight = 10.6;
- TChart1.Panel.MarginBottom = 8;
- }else if(graph=="4" && sex==""){
- TChart1.Panel.MarginTop = 2.5;
- TChart1.Panel.MarginLeft = 5.9;
- TChart1.Panel.MarginRight = 10.6;
- TChart1.Panel.MarginBottom = 8;
- }
- /* 20110808
- if(graph=="5" && sex=="M"){
- // TChart1.Panel.MarginTop = 2.8;
- // TChart1.Panel.MarginLeft = 6;
- TChart1.Panel.MarginRight = 9;
- TChart1.Panel.MarginBottom = 7.5;
- // TChart1.Panel.BevelInner = 0;
- // TChart1.Panel.BevelOuter = 0;
- }
- else if(graph=="5" && sex=="F"){
- TChart1.Panel.MarginTop = 2.5;
- TChart1.Panel.MarginLeft = 5.9;
- TChart1.Panel.MarginRight = 10.6;
- TChart1.Panel.MarginBottom = 8;
- }
- */
- //20110711 이정택 수정
- //하단축 칸 수 정하기와 눈금 없애기
- //TChart1.Axis.Bottom.SetMinMax (0, MinTimeConst * 60 * 24 * 7 - 1); //7일 동안 좌표를 표현
- if(graph == "2" || graph == "3" || graph == "5"){
- TChart1.Axis.Bottom.SetMinMax (2, 18.5); //7일 동안 좌표를 표현 (하루는 DivPerDay만큼 나눠짐)
- TChart1.Axis.Bottom.Increment = 1;
- }
- else if (graph == "1" || graph == "4"){
- TChart1.Axis.Bottom.SetMinMax (0, 36); //7일 동안 좌표를 표현 (하루는 DivPerDay만큼 나눠짐)
- TChart1.Axis.Bottom.Increment = 3;
- }
-
- TChart1.Axis.Bottom.MinorTickCount = 1;
- //TChart1.Axis.Bottom.Title.Caption = "개월";
- TChart1.Axis.Bottom.AxisPen.Color = 0x000000;
- //TChart1.Axis.Bottom.GridPen.Color = 0x000000; //축 점선의 색 설정
- TChart1.Axis.Bottom.Labels.Font.Color = 0x000000; //하단 축 눈금 명칭 색
- TChart1.Header.Visible = false;
- //TChart1.Header.Text(0)="성장도표"; //헤더제목넣기
- TChart1.Header.Font.Bold = true; //헤더 굵게
- TChart1.Header.Font.Size = 5; //헤더 사이즈
- TChart1.Aspect.View3D = 0; //2d 로 표현하기
- //TChart1.Aspect.Chart3DPercent = 2;
- TChart1.Zoom.enable = false; // zoom 사용하지 않기
- TChart1.Scroll.Enable = false; // scroll 사용하지 않기
- TChart1.Legend.Visible = false; // 그래프 참조 박스 띄우지 않기
- TChart1.Environment.MouseWheelScroll = false;
- //TChart1.Panel.Gradient.Visible = true; // 페널에 그라디언트 적용
- var cus_axis1 = TChart1.Axis.AddCustom(false); // 신장축(2-18)
- TChart1.Axis.Custom(0).Visible = false;
- TChart1.Axis.Custom(0).AxisPen.Color = 0x147814;
- TChart1.Axis.Custom(0).Title.Visible = false
- TChart1.Axis.Custom(0).Title.Caption = "신장"
- TChart1.Axis.Custom(0).Title.Font.Size = 8;
- // TChart1.Axis.Custom(0).Title.Font.Bold = true;
- TChart1.Axis.Custom(0).Title.Angle = 90;
- TChart1.Axis.Custom(0).PositionPercent = 0;
- TChart1.Axis.Custom(0).StartPosition = 0;
- TChart1.Axis.Custom(0).EndPosition = 100;
- TChart1.Axis.Custom(0).Automatic = false;
- TChart1.Axis.Custom(0).Maximum = 190;
- TChart1.Axis.Custom(0).Minimum = 60;
- TChart1.Axis.Custom(0).Increment = 5;
-
- var cus_axis2 = TChart1.Axis.AddCustom(false); // 체중축(2-18)
- TChart1.Axis.Custom(1).Visible = false;
- TChart1.Axis.Custom(1).AxisPen.Color = 0x00ff00;
- TChart1.Axis.Custom(1).Title.Visible = false
- TChart1.Axis.Custom(1).Title.Caption = "체중";
- TChart1.Axis.Custom(1).Title.Font.Size = 8;
- // TChart1.Axis.Custom(1).Title.Font.Bold = true;
- TChart1.Axis.Custom(1).Title.Angle = 90;
- TChart1.Axis.Custom(1).PositionPercent = 106;
- TChart1.Axis.Custom(1).Automatic = false;
- TChart1.Axis.Custom(1).Maximum = 135;
- TChart1.Axis.Custom(1).Minimum = 5;
- TChart1.Axis.Custom(1).Increment = 5;
-
- var cus_axis3 = TChart1.Axis.AddCustom(false); // 신장축(0-36)
- TChart1.Axis.Custom(2).Visible = false;
- TChart1.Axis.Custom(2).AxisPen.Color = 0x147814;
- TChart1.Axis.Custom(2).Title.Visible = false
- TChart1.Axis.Custom(2).Title.Caption = "신장";
- TChart1.Axis.Custom(2).Title.Font.Size = 8;
- // TChart1.Axis.Custom(1).Title.Font.Bold = true;
- TChart1.Axis.Custom(2).Title.Angle = 90;
- TChart1.Axis.Custom(2).PositionPercent = 0;
- TChart1.Axis.Custom(2).Automatic = false;
- TChart1.Axis.Custom(2).Maximum = 105;
- TChart1.Axis.Custom(2).Minimum = -10;
- TChart1.Axis.Custom(2).Increment = 5;
-
- var cus_axis4 = TChart1.Axis.AddCustom(false); // 체중축(0-36)
- TChart1.Axis.Custom(3).Visible = false;
- TChart1.Axis.Custom(3).AxisPen.Color = 0x00ff00;
- TChart1.Axis.Custom(3).Title.Visible = false
- TChart1.Axis.Custom(3).Title.Caption = "체중";
- TChart1.Axis.Custom(3).Title.Font.Size = 8;
- // TChart1.Axis.Custom(1).Title.Font.Bold = true;
- TChart1.Axis.Custom(3).Title.Angle = 90;
- TChart1.Axis.Custom(3).PositionPercent = 100;
- TChart1.Axis.Custom(3).Automatic = false;
- TChart1.Axis.Custom(3).Maximum = 25;
- TChart1.Axis.Custom(3).Minimum = 2;
- TChart1.Axis.Custom(3).Increment = 1;
-
- var cus_axis5 = TChart1.Axis.AddCustom(false); // 체질량축(2-18)
- TChart1.Axis.Custom(4).AxisPen.Color = 0x00ff00;
- TChart1.Axis.Custom(4).Title.Visible = false
- TChart1.Axis.Custom(4).Title.Caption = "체질량";
- TChart1.Axis.Custom(4).Title.Font.Size = 8;
- // TChart1.Axis.Custom(1).Title.Font.Bold = true;
- TChart1.Axis.Custom(4).Title.Angle = 90;
- TChart1.Axis.Custom(4).PositionPercent = 0;
- TChart1.Axis.Custom(4).Automatic = false;
- TChart1.Axis.Custom(4).Maximum = 32;
- TChart1.Axis.Custom(4).Minimum = 10;
- TChart1.Axis.Custom(4).Increment = 2;
-
- var cus_axis6 = TChart1.Axis.AddCustom(false); // 머리둘레축(0-36)
- TChart1.Axis.Custom(5).AxisPen.Color = 0x00ff00;
- TChart1.Axis.Custom(5).Title.Visible = false
- TChart1.Axis.Custom(5).Title.Caption = "머리둘레";
- TChart1.Axis.Custom(5).Title.Font.Size = 8;
- // TChart1.Axis.Custom(1).Title.Font.Bold = true;
- TChart1.Axis.Custom(5).Title.Angle = 90;
- TChart1.Axis.Custom(5).PositionPercent = 0;
- TChart1.Axis.Custom(5).Automatic = false;
- TChart1.Axis.Custom(5).Maximum = 58;
- TChart1.Axis.Custom(5).Minimum = 30;
- TChart1.Axis.Custom(5).Increment = 2;
-
- var cus_axis7 = TChart1.Axis.AddCustom(false); // 흉부둘레축
- TChart1.Axis.Custom(6).AxisPen.Color = 0x00ff00;
- TChart1.Axis.Custom(6).Title.Visible = false
- TChart1.Axis.Custom(6).Title.Caption = "머리둘레";
- TChart1.Axis.Custom(6).Title.Font.Size = 8;
- // TChart1.Axis.Custom(1).Title.Font.Bold = true;
- TChart1.Axis.Custom(6).Title.Angle = 90;
- TChart1.Axis.Custom(6).PositionPercent = 0;
- TChart1.Axis.Custom(6).Automatic = false;
- TChart1.Axis.Custom(6).Maximum = 66;
- TChart1.Axis.Custom(6).Minimum = 25;
- TChart1.Axis.Custom(6).Increment = 1;
-
-
-
- TChart1.AddSeries (4);
- if(graph == "1"){
- TChart1.AddSeries (4);
- }
- else if(graph == "2"){
- TChart1.AddSeries (4);
- TChart1.AddSeries (4);
- TChart1.AddSeries (4);
- TChart1.AddSeries (4);
- }
-
- if(graph == "1"){
- TChart1.Series(0).VerticalAxisCustom = cus_axis3;
- TChart1.Series(1).VerticalAxisCustom = cus_axis4;
- }
-
- else if(graph == "2"){
- TChart1.Series(0).VerticalAxisCustom = cus_axis1;
- TChart1.Series(1).VerticalAxisCustom = cus_axis2;
- TChart1.Series(2).VerticalAxisCustom = cus_axis1;
- TChart1.Series(3).VerticalAxisCustom = cus_axis1;
- TChart1.Series(4).VerticalAxisCustom = cus_axis1;
- }
- else if(graph == "3"){
- TChart1.Series(0).VerticalAxisCustom = cus_axis5;
- }
- else if(graph == "4" || graph == "5"){
- TChart1.Series(0).VerticalAxisCustom = cus_axis6;
- }
- else if(graph == "6"){
- TChart1.Series(0).VerticalAxisCustom = cus_axis7;
- }
- //라인의 굵기를 정해준다.
-
- if(graph == "1"){
- TChart1.Series(0).Color = 0x147814;
- TChart1.Series(1).Color = 0x00ff00;
- }
-
- else if(graph == "2"){
- TChart1.Series(0).Color = 0x147814;
- TChart1.Series(1).Color = 0x00ff00;
- TChart1.Series(2).Color = 0x0000ff;
- TChart1.Series(3).Color = 0xff0000;
- TChart1.Series(4).Color = 0x000000;
- }
- TChart1.Series(0).asPoint.Pointer.Visible = true;
- TChart1.Series(0).asPoint.Pointer.Style = 1;
- TChart1.Series(0).asPoint.Pointer.VerticalSize = 3;
- TChart1.Series(0).asPoint.Pointer.HorizontalSize = 3;
- TChart1.Series(0).Marks.visible = false;
- TChart1.Series(0).Marks.Style = 0;
- TChart1.Series(0).Marks.ArrowLength = 10;
- TChart1.Series(0).Marks.Arrow.Style = 0;
- TChart1.Series(0).Marks.Arrow.Color = 0x147814;
-
-
- if(graph == "1"){
- TChart1.Series(1).asPoint.Pointer.Visible = true;
- TChart1.Series(1).asPoint.Pointer.Style = 1;
- TChart1.Series(1).asPoint.Pointer.VerticalSize = 3;
- TChart1.Series(1).asPoint.Pointer.HorizontalSize = 3;
- TChart1.Series(1).Marks.visible = false;
- TChart1.Series(1).Marks.Style = 0;
- TChart1.Series(1).Marks.ArrowLength = 10;
- TChart1.Series(1).Marks.Arrow.Style = 0;
- TChart1.Series(1).Marks.Arrow.Color = 0x00ff00;
- }
- else if(graph == "2"){
- TChart1.Series(1).asPoint.Pointer.Visible = true;
- TChart1.Series(1).asPoint.Pointer.Style = 1;
- TChart1.Series(1).asPoint.Pointer.VerticalSize = 3;
- TChart1.Series(1).asPoint.Pointer.HorizontalSize = 3;
- TChart1.Series(1).Marks.visible = false;
- TChart1.Series(1).Marks.Style = 0;
- TChart1.Series(1).Marks.ArrowLength = 10;
- TChart1.Series(1).Marks.Arrow.Style = 0;
- TChart1.Series(1).Marks.Arrow.Color = 0x00ff00;
-
- TChart1.Series(2).asPoint.Pointer.Visible = true;
- TChart1.Series(2).asPoint.Pointer.Style = 10;
- TChart1.Series(2).asPoint.Pointer.VerticalSize = 5;
- TChart1.Series(2).asPoint.Pointer.HorizontalSize = 5;
- TChart1.Series(2).Marks.visible = false;
- TChart1.Series(2).Marks.Style = 0;
- TChart1.Series(2).Marks.ArrowLength = -40;
- TChart1.Series(2).Marks.Arrow.Style = 0;
- TChart1.Series(2).Marks.Arrow.Color = 0xff0000;
-
- TChart1.Series(3).asPoint.Pointer.Visible = true;
- TChart1.Series(3).asPoint.Pointer.Style = 10;
- TChart1.Series(3).asPoint.Pointer.VerticalSize = 5;
- TChart1.Series(3).asPoint.Pointer.HorizontalSize = 5;
- TChart1.Series(3).Marks.visible = false;
- TChart1.Series(3).Marks.Style = 0;
- TChart1.Series(3).Marks.ArrowLength = 40;
- TChart1.Series(3).Marks.Arrow.Style = 0;
- TChart1.Series(3).Marks.Arrow.Color = 0xff0000;
-
- TChart1.Series(4).asPoint.Pointer.Visible = true;
- TChart1.Series(4).asPoint.Pointer.Style = 10;
- TChart1.Series(4).asPoint.Pointer.VerticalSize = 5;
- TChart1.Series(4).asPoint.Pointer.HorizontalSize = 5;
- TChart1.Series(4).Marks.visible = false;
- TChart1.Series(4).Marks.Style = 0;
- TChart1.Series(4).Marks.ArrowLength = 20;
- TChart1.Series(4).Marks.Arrow.Style = 0;
- TChart1.Series(4).Marks.Arrow.Color = 0xff0000;
- }
- //var imgCd = "D:\\CMCOracle\\application\\webapps\\emr\\formmngtweb\\images\\filemenu_bg.jpg";
-
- switch(graph){
- case "1":
- if(sex == "M"){
- var imgCd = getTChartBackgroundImage("boyheight1");
- }
- else{
- var imgCd = getTChartBackgroundImage("girlheight1");
- }
- break;
- case "2":
- if(sex == "M"){
- var imgCd = getTChartBackgroundImage("boyheight2");
- }
- else{
- var imgCd = getTChartBackgroundImage("girlheight2");
- }
- break;
-
- case "3":
- if(sex == "M"){
- var imgCd = getTChartBackgroundImage("boybmi");
- }
- else{
- var imgCd = getTChartBackgroundImage("girlbmi");
- }
- break;
-
- case "4":
- if(sex == "M"){
- var imgCd = getTChartBackgroundImage("boyhead1");
- }
- else{
- var imgCd = getTChartBackgroundImage("girlhead1");
- }
- break;
- case "5":
- if(sex == "M"){
- var imgCd = getTChartBackgroundImage("boyhead2");
- }
- else{
- var imgCd = getTChartBackgroundImage("girlhead2");
- }
- break;
- case "6":
- if(sex == "M"){
- var imgCd = getTChartBackgroundImage("boychst");
- }
- else{
- var imgCd = getTChartBackgroundImage("girlchst");
- }
- break;
-
- }
-
- //setBackImageLoad(TChart1, imgCd);
- TChart1.Panel.BackImageLoad(imgCd);
- //TChart1.Export.SaveToBitmapFile(getTChartBackgroundImage("boyheight1"));
- var x,y1,y2, y3, y4, y5, y6, temp;
- // 부모님신장 표시
- if(graph == "2"){
- model.refresh();
- var mh = model.getValue("/root/send/mht");
- var fh = model.getValue("/root/send/fht");
- var mph = model.getValue("/root/send/mpht");
- if(sex == "M"){
- mh = parseInt(parseFloat(mh) + 13);
- }
- else if(sex == "F"){
- fh = parseInt(parseFloat(fh) - 13);
- }
- if(mh != ""){
- TChart1.Series(2).AddXY (18, mh, "", TChart1.Series(2).Color);
- }
- if(fh != ""){
- TChart1.Series(3).AddXY (18, fh, "", TChart1.Series(3).Color);
- }
- if(mph != ""){
- TChart1.Series(4).AddXY (18, mph, "", TChart1.Series(4).Color);
- TChart1.Tools.Add(10);
- TChart1.Tools.Items(0).asAnnotation.Text = mph;
- TChart1.Tools.Items(0).asAnnotation.Shape.Top = 953-5*mph;
- TChart1.Tools.Items(0).asAnnotation.Shape.Left = 517;
- var textRow = 1;
- }else if(mph == ""){
- var textRow = 0;
- }
-
- }
-
- var nodeCnt = getNodesetCount("/root/main/grthlist/list/grth");
-
- for( i = 2; i <= nodeCnt+1; i++){
-
- if(graph == "1"){
-
- x = grd_grth.valueMatrix(i, grd_grth.colRef("month")); //월령
- y1 = grd_grth.valueMatrix(i, grd_grth.colRef("bdht")); // 신장
- y2 = grd_grth.valueMatrix(i, grd_grth.colRef("bdwt")); // 체중
- if(x == 0){
- x = 0.3
- }
- if(x != "" && y1 != ""){
- if(i==2){
- var f1=getDateInterval(model.getValue("/root/send/orgbrthdd"),grd_grth.valueMatrix(i, grd_grth.colRef("recdd")), "dd");
- TChart1.Series(0).AddXY (parseFloat(f1/(365*3)*36), y1, "", TChart1.Series(0).Color);
- }else{
- var f1=getDateInterval(model.getValue("/root/send/orgbrthdd"),grd_grth.valueMatrix(i, grd_grth.colRef("recdd")), "dd");
- TChart1.Series(0).AddXY (parseFloat(f1/(365*3)*36), y1, "", TChart1.Series(0).Color);
- }
- }
- if(x != "" && y2 != ""){
- if(i==2){
- var f2=getDateInterval(model.getValue("/root/send/orgbrthdd"),grd_grth.valueMatrix(i, grd_grth.colRef("recdd")), "dd");
- TChart1.Series(1).AddXY (parseFloat(f2/(365*3)*36), y2, "", TChart1.Series(1).Color);
- }else{
- var f2=getDateInterval(model.getValue("/root/send/orgbrthdd"),grd_grth.valueMatrix(i, grd_grth.colRef("recdd")), "dd");
- TChart1.Series(1).AddXY (parseFloat(f2/(365*3)*36), y2, "", TChart1.Series(1).Color);
- }
- }
- }
- else if(graph == "2"){
-
- x = grd_grth.valueMatrix(i, grd_grth.colRef("year")); // 연령
- temp = grd_grth.valueMatrix(i, grd_grth.colRef("month")); // 월령
- temp = parseInt((temp % 12)/12*10);
- x = x+"."+temp;
- y1 = grd_grth.valueMatrix(i, grd_grth.colRef("bdht")); // 신장
- y2 = grd_grth.valueMatrix(i, grd_grth.colRef("bdwt")); // 체중
- var text = grd_grth.valueMatrix(i, grd_grth.colRef("remark")); // 비고
- if(x != "" && y1 != ""){
- var s1=getDateInterval(model.getValue("/root/send/orgbrthdd"),grd_grth.valueMatrix(i, grd_grth.colRef("recdd")), "dd");
- TChart1.Series(0).AddXY (parseFloat(s1/(18*365)*18), y1, "", TChart1.Series(0).Color);
- }
- if(x != "" && y2 != ""){
- var s2=getDateInterval(model.getValue("/root/send/orgbrthdd"),grd_grth.valueMatrix(i, grd_grth.colRef("recdd")), "dd");
- TChart1.Series(1).AddXY (parseFloat(s2/(18*365)*18), y2, "", TChart1.Series(1).Color);
- }
- if(text != "" && x>=2){
- TChart1.Tools.Add(10);
- TChart1.Tools.Items(textRow).asAnnotation.Text = text;
- TChart1.Tools.Items(textRow).asAnnotation.Shape.Top = 900-y1*4;
- TChart1.Tools.Items(textRow).asAnnotation.Shape.Left = x*29.2 -30;
- textRow++;
- }
- }
- //20110804
- if(graph == "3"){
- x = grd_grth.valueMatrix(i, grd_grth.colRef("year")); //연령
- temp = grd_grth.valueMatrix(i, grd_grth.colRef("month")); // 월령
- temp = parseInt((temp % 12)/12*10);
- x = x+"."+temp;
- y3 = grd_grth.valueMatrix(i, grd_grth.colRef("bmi")); // 체질량
- var f3=getDateInterval(model.getValue("/root/send/orgbrthdd"),grd_grth.valueMatrix(i, grd_grth.colRef("recdd")), "dd");
- if(x != "" && y3 != ""){
- TChart1.Series(0).AddXY (parseFloat(f3/(18*365)*18), y3, "", TChart1.Series(0).Color);
- }
- }
- //20110804
- if(graph == "4"){
- x = grd_grth.valueMatrix(i, grd_grth.colRef("month")); //월령
- y4 = grd_grth.valueMatrix(i, grd_grth.colRef("headgirth")); // 머리둘레(0-36)
- var f4=getDateInterval(model.getValue("/root/send/orgbrthdd"),grd_grth.valueMatrix(i, grd_grth.colRef("recdd")), "dd");
- if(x != "" && y4 != ""){
- TChart1.Series(0).AddXY (parseFloat(f4/(365*3)*36), y4, "", TChart1.Series(0).Color);
- }
- }
- if(graph == "5"){
- x = grd_grth.valueMatrix(i, grd_grth.colRef("year")); //연령
- temp = grd_grth.valueMatrix(i, grd_grth.colRef("month")); // 월령
- temp = parseInt((temp % 12)/12*10);
- x = x+"."+temp;
- y5 = grd_grth.valueMatrix(i, grd_grth.colRef("headgirth")); // 머리둘레()
- if(x != "" && y5 != ""){
- TChart1.Series(0).AddXY (x, y5, "", TChart1.Series(0).Color);
- }
- }
- if(graph == "6"){
- x = grd_grth.valueMatrix(i, grd_grth.colRef("year")); //연령
- temp = grd_grth.valueMatrix(i, grd_grth.colRef("month")); // 월령
- temp = parseInt((temp % 12)/12*10);
- x = x+"."+temp;
- y6 = grd_grth.valueMatrix(i, grd_grth.colRef("chstgirth")); // 흉부둘레
- if(x != "" && y6 != ""){
- TChart1.Series(0).AddXY (x, y6, "", TChart1.Series(0).Color);
- }
- }
- }
- //TChart1.Export.SaveToBitmapFile(getTChartBackgroundImage("boyheight2"));
- }
-
- function fCalcAge(){
- var orgdd = model.getValue("/root/send/orgbrthdd");
- var maskDate = orgdd.substr(0, 4) + "-" + orgdd.substr(4, 2) + "-" + orgdd.substr(6, 2);
- model.setValue("/root/send/maskbrth", maskDate);
-
- var schedd = model.getValue("/root/send/brthschedd");
- var diff = getDateInterval(orgdd, getCurrentDate());
- var diffSche = getDateInterval(getCurrentDate(), schedd);
- diffSche = 280 - parseInt(diffSche);
- var year = parseInt(parseInt(diff) / 365);
- var month = parseInt(diff) % 365;
- var week = parseInt(parseInt(diffSche) / 7);
- var day = parseInt(diffSche) % 7;
-
- if(month > 334){
- month = 11;
- }
- else if(month > 304){
- month = 10;
- }
- else if(month > 273){
- month = 9;
- }
- else if(month > 243){
- month = 8;
- }
- else if(month > 212){
- month = 7;
- }
- else if(month > 181){
- month = 6;
- }
- else if(month > 151){
- month = 5;
- }
- else if(month > 120){
- month = 4;
- }
- else if(month > 90){
- month = 3;
- }
- else if(month > 59){
- month = 2;
- }
- else if(month > 31){
- month = 1;
- }
- else{
- month=0;
- }
- if(orgdd != ""){
- model.setValue("/root/main/cond/year", year);
- model.setValue("/root/main/cond/month", month);
- if(year>0){
- var age = year+"년 "+month+"개월";
- }else{
- var age = month+"개월";
- }
- model.setValue("/root/send/age", age);
- }
- if(schedd != ""){
- model.setValue("/root/main/cond/week", week);
- model.setValue("/root/main/cond/day", day);
- }
- model.refresh();
- var year = model.getValue("/root/main/cond/year");
- var month = model.getValue("/root/main/cond/month");
-
- var saveflag = "";
- saveflag = model.getValue("/root/send/saveflag");
- if(saveflag == ""){
- // 24개월 이상 이면 2~18세 그래프 선택
- if((year >= 2 && month >=1) || year >2){
- model.setValue("/root/main/cond/chart", "2");
- model.setValue("/root/send/saveflag", "2");
- button1.selected = true;
- }
- else{
- model.setValue("/root/main/cond/chart", "1");
- model.setValue("/root/send/saveflag", "1");
- button2.selected = true;
- }
- }
- else{
- var result = saveflag.indexOf("1");
- var rslt = saveflag.indexOf("2");
- if(result != "-1"){
- model.setValue("/root/main/cond/chart", "1");
- button2.selected = true;
- }
- if(rslt != "-1"){
- model.setValue("/root/main/cond/chart", "2");
- button1.selected = true;
- }
- }
- model.refresh();
- }
-
- function fSelectGraph(){
- model.removeNodeset("/root/init/orddd");
- submit("TRMRF05201");
- var rowcnt = "";
- var nodeCnt = getNodesetCount("/root/init/orddd");
-
- if(nodeCnt > 0){
- for( i = 1; i <= nodeCnt+1; i++ ){
- var ordtype = model.getValue("/root/init/orddd["+i+"]/dschdd");
- var dschdd = model.getValue("/root/init/orddd["+i+"]/dschdd");
- if( dschdd == "재원중"){
- rowcnt = model.getValue("/root/init/orddd["+i+"]/rowcnt");
- }
- }
- if(rowcnt != ""){
- model.setValue("/root/send/ordd", rowcnt);
- model.setValue("/root/send/orddd", model.getValue("/root/init/orddd["+rowcnt+"]/orddd"));
- model.setValue("/root/send/cretno", model.getValue("/root/init/orddd["+rowcnt+"]/cretno"));
- model.setValue("/root/send/orddrid", model.getValue("/root/init/orddd["+rowcnt+"]/orddrid"));
- model.setValue("/root/send/signgenrflag", model.getValue("/root/init/orddd["+rowcnt+"]/ordtype"));
- }
- else if(rowcnt == "") {
- //combo2.select(0);
- }
- }
- var dept = model.getValue("/root/send/orddeptcd");
- if(dept == "2110000000" || dept == "2030000000" || dept == "2070000000"){
- model.toggle("case_grth");
- model.toggle("case1");
- btn_gr.selected = true;
- btn_gr.visible = true;
- btn_lb.visible = false;
- btn_ht.visible = false;
- btn_rec.visible = false;
- var graph = model.getValue("/root/main/cond/chart");
-
- switch(graph){
- case "1":
- button2.selected=true;
- break;
- case "2":
- button1.selected=true;
- break;
- case "3":
- button3.selected=true;
- break;
- case "4":
- button4.selected=true;
- break;
- case "5":
- button12.selected=true;
- break;
- case "6":
- button6.selected=true;
- break;
- }
- fMakeChart();
- model.setValue("/root/send/flag", "1");
- group2.visible = true;
- group3.visible = false;
- }
- else if(dept == "2100000000"){
- model.toggle("case_labor");
- model.toggle("case2");
- btn_lb.selected = true;
- btn_gr.visible = false;
- btn_lb.visible = true;
- btn_ht.visible = false;
- btn_rec.visible = false;
- button14.selected = true;
- model.setValue("/root/labor/send/flag", "2");
- group2.visible = false;
- group3.visible = true;
- }
- else if(dept == "2120000000"){
- model.toggle("case_hue");
- model.toggle("case3");
- btn_ht.selected = true;
- btn_gr.visible = false;
- btn_lb.visible = false;
- btn_ht.visible = true;
- btn_rec.visible = false;
- model.setValue("/root/send/flag", "3");
- group2.visible = false;
- }
- model.refresh();
- }
-
- function fGetGrphData(){
- submit("TRMRF05202");
- model.copyNode("/root/main/sign", "/root/main/grthlist/list");
- model.removeNodeset("/root/main/grthlist/list/sign");
- var mh = model.getValue("/root/main/grthlist/list/grth[1]/mht");
- var fh = model.getValue("/root/main/grthlist/list/grth[1]/fht");
- var mph = model.getValue("/root/main/grthlist/list/grth[1]/mpht");
- var orgbrth = model.getValue("/root/main/grthlist/list/grth[1]/orgbrthdd");
- var brthschedd = model.getValue("/root/main/grthlist/list/grth[1]/brthschedd");
- var saveflag = model.getValue("/root/main/grthlist/list/grth[1]/saveflag");
- var fstrgstrnm = model.getValue("/root/main/grthlist/list/grth[1]/fstrgstrnm");
- var lastupdtrnm = model.getValue("/root/main/grthlist/list/grth[1]/lastupdtrnm");
- var signSave = model.getValue("/root/main/grthlist/list/grth[1]/signyn");
- saveState = signSave;
- if(signSave == "Y"){
- output1.value = "현재는 인증저장 상태입니다";
- }else if(saveflag != ""){
- output1.value = "현재는 임시저장 상태입니다";
- }
- model.setValue("/root/send/mht", mh);
- model.setValue("/root/send/fht", fh);
- model.setValue("/root/send/mpht", mph);
- model.setValue("/root/send/fstrgstrnm", fstrgstrnm);
- model.setValue("/root/send/lastupdtrnm", lastupdtrnm);
- if(orgbrth != ""){
- model.setValue("/root/send/orgbrthdd", orgbrth);
- var maskDate = orgbrth.substr(0, 4) + "-" + orgbrth.substr(4, 2) + "-" + orgbrth.substr(6, 2);
- model.setValue("/root/send/maskbrth", maskDate);
- var diff = getDateInterval(orgbrth, getCurrentDate());
- var year = parseInt(parseInt(diff) / 365);
- var month = parseInt(diff) % 365;
- if(month > 334){
- month = 11;
- }
- else if(month > 304){
- month = 10;
- }
- else if(month > 273){
- month = 9;
- }
- else if(month > 243){
- month = 8;
- }
- else if(month > 212){
- month = 7;
- }
- else if(month > 181){
- month = 6;
- }
- else if(month > 151){
- month = 5;
- }
- else if(month > 120){
- month = 4;
- }
- else if(month > 90){
- month = 3;
- }
- else if(month > 59){
- month = 2;
- }
- else if(month > 31){
- month = 1;
- }
- else{
- month=0;
- }
-
- model.setValue("/root/main/cond/year", year);
- model.setValue("/root/main/cond/month", month);
- if(year>0){
- var age = year+"년 "+month+"개월";
- }else{
- var age = month+"개월";
- }
- model.setValue("/root/send/age", age);
-
- }
- if(brthschedd != ""){
- model.setValue("/root/send/brthschedd", brthschedd);
- }
- //if(saveflag != ""){
- model.setValue("/root/send/saveflag", saveflag);
- //}
- }
-
- function fSetPopupPat(){
- model.setValue("/root/send/pid", model.getValue("/root/main/patinfo/patinfolist/pid"));
- model.setValue("/root/main/cond/hngnm", model.getValue("/root/main/patinfo/patinfolist/hngnm"));
- var rrgstno1 = model.getValue("/root/main/patinfo/patinfolist/rrgstno1");
- var rrgstno2 = model.getValue("/root/main/patinfo/patinfolist/rrgstno2");
- rrgstno1 = rrgstno1 +"-"+ rrgstno2.substr(0, 1) +"******";
- model.setValue("/root/main/cond/rrgstno1", rrgstno1);
- model.setValue("/root/main/cond/sex", model.getValue("/root/main/patinfo/patinfolist/sex"));
- model.setValue("/root/send/orgbrthdd", model.getValue("/root/main/patinfo/patinfolist/brthdd"));
- //model.setValue("/root/send/orddeptcd", model.getValue("/root/main/patinfo/patinfolist/lastorddeptcd"));
- }
-
- function fSetPopGraph(){
- fSetPopupPat();
- saveCnt = "0";
- model.removeNodeset("/root/init/orddd");
- submit("TRMRF05201");
- var rowcnt = "", cnt="";
- var nodeCnt = getNodesetCount("/root/init/orddd");
-
- if(nodeCnt > 0){
- for( i = 1; i <= nodeCnt+1; i++ ){
- var ordtype = model.getValue("/root/init/orddd["+i+"]/dschdd");
- var dschdd = model.getValue("/root/init/orddd["+i+"]/dschdd");
- if( dschdd == "재원중"){
- rowcnt = model.getValue("/root/init/orddd["+i+"]/rowcnt");
- }
- }
- if(rowcnt != ""){
- model.setValue("/root/send/ordd", rowcnt);
- model.setValue("/root/send/orddd", model.getValue("/root/init/orddd["+rowcnt+"]/orddd"));
- model.setValue("/root/send/cretno", model.getValue("/root/init/orddd["+rowcnt+"]/cretno"));
- //model.setValue("/root/send/orddeptcd", model.getValue("/root/init/orddd["+rowcnt+"]/orddeptcd"));
- model.setValue("/root/send/orddrid", model.getValue("/root/init/orddd["+rowcnt+"]/orddrid"));
- model.setValue("/root/send/signgenrflag", model.getValue("/root/init/orddd["+rowcnt+"]/ordtype"));
- }
- else if(rowcnt == "") {
-
- var lastdd = model.getValue("/root/main/patinfo/patinfolist/lastorddd")
- var lastdept = model.getValue("/root/main/patinfo/patinfolist/lastorddeptcd")
- var orddept = model.getValue("/root/send/orddeptcd")
- for( i = 1; i <= nodeCnt+1; i++ ){
- var torddd = model.getValue("/root/init/orddd["+i+"]/orddd");
-
- if( torddd == lastdd && lastdept == orddept){
- cnt = model.getValue("/root/init/orddd["+i+"]/rowcnt");
- }
- }
-
- if( cnt != ""){
- model.setValue("/root/send/ordd", cnt);
- model.setValue("/root/send/orddd", model.getValue("/root/init/orddd["+cnt+"]/orddd"));
- model.setValue("/root/send/cretno", model.getValue("/root/init/orddd["+cnt+"]/cretno"));
- model.setValue("/root/send/orddrid", model.getValue("/root/init/orddd["+cnt+"]/orddrid"));
- model.setValue("/root/send/signgenrflag", model.getValue("/root/init/orddd["+cnt+"]/ordtype"));
- } else if ( cnt == ""){
- combo2.select(0);
- model.setValue("/root/send/ordd", 1);
- model.setValue("/root/send/orddd", model.getValue("/root/init/orddd[1]/orddd"));
- model.setValue("/root/send/cretno", model.getValue("/root/init/orddd[1]/cretno"));
- model.setValue("/root/send/orddrid", model.getValue("/root/init/orddd[1]/orddrid"));
- model.setValue("/root/send/signgenrflag", model.getValue("/root/init/orddd[1]/ordtype"));
- }
- }
- }
- model.refresh();
- var tDept = model.getValue("/root/send/orddeptcd");
- if(tDept == "2110000000" || tDept == "2030000000" || tDept == "2070000000"){
- fGetGrphData();
- fSelectGraph();
- fCalcAge();
- // 행추가
- grd_grth.addRow();
- var cur_row = grd_grth.row-1;
- var curDate = getCurrentDate();
- var maskDate = curDate.substr(0, 4) + "-" + curDate.substr(4, 2) + "-" + curDate.substr(6, 2);
- model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/recdd", maskDate);
- model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/seq", grd_grth.row-1);
- fCalcGrid();
- model.refresh();
- fMakeChart();
- } else if(tDept == "2100000000"){
- fGetLaborData();
- fMakeLaborGraph();
- }
- }
-
- function fCalcGrid(){
- var cur_row = grd_grth.row-1;
- var recdd = model.getValue("/root/main/grthlist/list/grth["+cur_row+"]/recdd");
- //recdd = curDate.substr(0, 4) + "-" + curDate.substr(4, 2) + "-" + recdd.substr(6, 2);
- var ht = model.getValue("/root/main/grthlist/list/grth["+cur_row+"]/bdht");
- var wt = model.getValue("/root/main/grthlist/list/grth["+cur_row+"]/bdwt");
- var orgdd = model.getValue("/root/send/orgbrthdd");
- var schedd = model.getValue("/root/send/brthschedd");
- var diff = getDateInterval(orgdd, recdd);
- var diffSche = getDateInterval(getCurrentDate(), schedd);
- var year = parseInt(parseInt(diff) / 365);
- var month = parseInt(diff) % 365;
- var week = parseInt(parseInt(diffSche) / 7);
- var day = parseInt(diffSche) % 7;
-
- if(month > 334){
- month = 11;
- }
- else if(month > 304){
- month = 10;
- }
- else if(month > 273){
- month = 9;
- }
- else if(month > 243){
- month = 8;
- }
- else if(month > 212){
- month = 7;
- }
- else if(month > 181){
- month = 6;
- }
- else if(month > 151){
- month = 5;
- }
- else if(month > 120){
- month = 4;
- }
- else if(month > 90){
- month = 3;
- }
- else if(month > 59){
- month = 2;
- }
- else if(month > 31){
- month = 1;
- }
- else{
- month=0;
- }
- var temp = parseFloat(wt)/((parseFloat(ht)*(parseFloat(ht)*0.0001)));
- var temp2 = Math.pow(( parseFloat(wt) * parseFloat(ht)) / 3600, 0.5 );
-
- if(ht!="" && wt!=""){
- model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/bmi", parseFloat(temp).toFixed(2));
- model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/bsa", parseFloat(temp2).toFixed(2));
- }
- model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/year", year);
- model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/month", parseInt(year)*12+parseInt(month));
- if(year>0){
- year = year+"년 "+month+"개월";
- }else{
- year = month+"개월";
- }
- model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/yearmonth", year);
-
- if(schedd != ""){
- model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/week", week);
- var gatext = week + "주" + day + "일";
- model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/gatext", gatext);
- }
- model.refresh();
- }
-
- function fCalcMph(){
- var mh = parseInt(model.getValue("/root/send/mht"));
- var fh = parseInt(model.getValue("/root/send/fht"));
- var sex = model.getValue("/root/main/cond/sex");
- if(mh != mh || fh != fh){
- }else{
- if(sex == "M"){
- model.setValue("/root/send/mpht", (mh+fh+13)/2);
- }
- if(sex == "F"){
- model.setValue("/root/send/mpht", (mh+fh-13)/2);
- }
- }
- model.refresh();
- }
- function getDateAddc(inputday,addend){
- var backDate ="";
- var rt = 0;
- var yyyy = inputday.substring(0,4) +"";
- var mm = inputday.substring(4,6) +"";
- var dd = inputday.substring(6,8) +"";
- var startDate = new Date(yyyy,(eval(mm)-1),dd);
- startDate.setTime(startDate.getTime()+(86400000*addend));
- NowYear = startDate.getYear();// 년
- NowMonth = startDate.getMonth()+1;// 월
- NowDay = startDate.getDate(); // 일
- backDate += NowYear ; //년도
- if (NowMonth < 10 ) backDate += "0" + NowMonth ;
- else backDate += (startDate.getMonth() + 1);
- if (NowDay < 10 ) backDate += "0" + NowDay ;
- else backDate += (startDate.getDate());
-
- return backDate ;
- }
-
- function fCalcGa(){
- var edc = model.getValue("/root/labor/send/edc");
- var admission = model.getValue("/root/labor/send/admission");
- admission = admission.substr(0,4) + admission.substr(5,2) + admission.substr(8,2);
- var index = combo2.value;
- if(index != "" && edc != ""){
- if(admission != ""){
- var orddd = admission;
- }else if(admission == ""){
- var orddd = model.getValue("/root/init/orddd["+index+"]/orddd");
- }
- var tempGa = 280 - getDateInterval(orddd, edc);
- var week = parseInt(tempGa / 7);
- var day = tempGa % 7;
- var ga = week + "+" + day;
- if(week > 43){
- model.setValue("/root/labor/send/ga", "");
- }
- else{
- model.setValue("/root/labor/send/ga", ga);
- }
- }
-
- model.refresh();
- }
-
- function fMakeLaborGraph(){
-
- TChart2.ClearChart();
- TChart2.RemoveAllSeries();
- TChart2.Axis.RemoveAllCustom();
- //margin 값 정하기
- TChart2.Panel.MarginTop = 10;
- TChart2.Panel.MarginLeft = 5;
- TChart2.Panel.MarginRight = 5;
- TChart2.Panel.MarginBottom = 10;
-
- TChart2.Panel.Color = 0xffffff;
- //하단축 칸 수 정하기와 눈금 없애기
- TChart2.Axis.Bottom.SetMinMax (0, 15);
- TChart2.Axis.Bottom.Increment = 1;
-
- TChart2.Axis.Bottom.MinorTickCount = 0.5;
- TChart2.Axis.Bottom.Title.Caption = "Time";
- TChart2.Axis.Bottom.Title.Font.bold = true;
- TChart2.Axis.Bottom.AxisPen.Color = 0x000000;
- //TChart2.Axis.Bottom.GridPen.Color = 0x000000; //축 점선의 색 설정
- TChart2.Axis.Bottom.Labels.Font.Color = 0xffffff; //하단 축 눈금 명칭 색
- TChart2.Header.Visible = false;
- //TChart2.Header.Text(0)="성장도표"; //헤더제목넣기
- TChart2.Header.Font.Bold = true; //헤더 굵게
- TChart2.Header.Font.Size = 5; //헤더 사이즈
- TChart2.Aspect.View3D = 0; //2d 로 표현하기
- //TChart2.Aspect.Chart3DPercent = 2;
- TChart2.Zoom.enable = false; // zoom 사용하지 않기
- TChart2.Scroll.Enable = false; // scroll 사용하지 않기
- TChart2.Legend.Visible = false; // 그래프 참조 박스 띄우지 않기
- TChart2.Environment.MouseWheelScroll = false;
- //TChart2.Panel.Gradient.Visible = true; // 페널에 그라디언트 적용
- var cus_axis1 = TChart2.Axis.AddCustom(false); // CxDilat
- TChart2.Axis.Custom(0).Visible = true;
- TChart2.Axis.Custom(0).AxisPen.Color = 0xff0000;
- TChart2.Axis.Custom(0).Title.Visible = false;
- TChart2.Axis.Custom(0).Title.Caption = "CxDilat"
- TChart2.Axis.Custom(0).Title.Font.Size = 9;
- TChart2.Axis.Custom(0).Title.Font.Bold = true;
- TChart2.Axis.Custom(0).Title.Angle = 270;
- TChart2.Axis.Custom(0).PositionPercent = 0;
- TChart2.Axis.Custom(0).StartPosition = 0;
- TChart2.Axis.Custom(0).EndPosition = 100;
- TChart2.Axis.Custom(0).Automatic = false;
- TChart2.Axis.Custom(0).Maximum = 10;
- TChart2.Axis.Custom(0).Minimum = 0;
- TChart2.Axis.Custom(0).Increment = 1;
-
- var cus_axis2 = TChart2.Axis.AddCustom(false); // Station
- TChart2.Axis.Custom(1).Visible = false;
- TChart2.Axis.Custom(1).AxisPen.Color = 0x00ff00;
- TChart2.Axis.Custom(1).Title.Visible = false
- TChart2.Axis.Custom(1).Title.Caption = "Station";
- TChart2.Axis.Custom(1).Title.Font.Size = 9;
- //TChart2.Axis.Custom(1).Title.Font.Bold = true;
- TChart2.Axis.Custom(1).Title.Angle = 270;
- TChart2.Axis.Custom(1).PositionPercent = 100;
- TChart2.Axis.Custom(1).Automatic = false;
- TChart2.Axis.Custom(1).Maximum = 2.5;
- TChart2.Axis.Custom(1).Minimum = -2.5;
- TChart2.Axis.Custom(1).Increment = 1;
-
-
- TChart2.AddSeries (0);
- TChart2.AddSeries (0);
-
- TChart2.Series(0).VerticalAxisCustom = cus_axis1;
- TChart2.Series(1).VerticalAxisCustom = cus_axis2;
-
- //라인의 굵기를 정해준다.
-
- TChart2.Series(0).Color = 0xff0000;
- TChart2.Series(1).Color = 0x00ff00;
-
-
- TChart2.Series(0).asLine.Pointer.Visible = true;
- TChart2.Series(0).asLine.Pointer.Style = 5;
- TChart2.Series(0).asLine.Pointer.VerticalSize = 5;
- TChart2.Series(0).asLine.Pointer.HorizontalSize = 5;
- TChart2.Series(0).asLine.LinePen.width = 2;
- TChart2.Series(0).Marks.visible = false;
-
- TChart2.Series(1).asLine.Pointer.Visible = true;
- TChart2.Series(1).asLine.Pointer.Style = 7;
- TChart2.Series(1).asLine.Pointer.VerticalSize = 5;
- TChart2.Series(1).asLine.Pointer.HorizontalSize = 5;
- TChart2.Series(1).asLine.LinePen.width = 2;
- TChart2.Series(1).Marks.visible = false;
-
- var imgCd = getTChartBackgroundImage("labor");
- TChart2.Panel.BackImageLoad(imgCd);
-
- var laborNodeCnt = getNodesetCount("/root/main/laborlist/list/labor");
- var x, y1, y2, stage;
- var textRow = 0;
-
- if(laborNodeCnt <= 15){
- btn_labor1.visible = false;
- btn_labor2.visible = false;
- btn_labor3.visible = false;
- btn_labor4.visible = false;
- btn_labor5.visible = false;
- } else if(laborNodeCnt > 15 && laborNodeCnt <= 30){
- btn_labor1.visible = true;
- btn_labor2.visible = true;
- btn_labor3.visible = false;
- btn_labor4.visible = false;
- btn_labor5.visible = false;
- } else if(laborNodeCnt > 30 && laborNodeCnt <= 45){
- btn_labor1.visible = true;
- btn_labor2.visible = true;
- btn_labor3.visible = true;
- btn_labor4.visible = false;
- btn_labor5.visible = false;
- } else if(laborNodeCnt > 45 && laborNodeCnt <= 60){
- btn_labor1.visible = true;
- btn_labor2.visible = true;
- btn_labor3.visible = true;
- btn_labor4.visible = true;
- btn_labor5.visible = false;
- } else if(laborNodeCnt > 60 && laborNodeCnt <= 75){
- btn_labor1.visible = true;
- btn_labor2.visible = true;
- btn_labor3.visible = true;
- btn_labor4.visible = true;
- btn_labor5.visible = true;
- }
- var startRow = model.getValue("/root/labor/send/startRow");
- var tempX = 2;
- for( i = startRow; i <= parseInt(laborNodeCnt)+1; i++ ){
-
- x = grd_labor.valueMatrix(i, 9);
- y1 = grd_labor.valueMatrix(i, 3); // OS
- y2 = grd_labor.valueMatrix(i, 6); // Station
- stage = grd_labor.valueMatrix(i, 7); // Stage
- var text = grd_labor.valueMatrix(i, 1); // time
- if(y2 == 3){
- y2 = 2.5;
- }
- if(y2 == -3){
- y2 = -2.5;
- }
- if(y2 != 0){
- y2 = -y2;
- }
- if(y1 != ""){
- TChart2.Series(0).AddXY (tempX-1, y1, "", TChart2.Series(0).Color);
- }
- if(y2 != ""){
- TChart2.Series(1).AddXY (tempX-1, y2, "", TChart2.Series(1).Color);
- }
- if(text != ""){
- TChart2.Tools.Add(10);
- TChart2.Tools.Items(textRow).asAnnotation.Text = text.substr(0,5);
- TChart2.Tools.Items(textRow).asAnnotation.Shape.Transparent = true;
- TChart2.Tools.Items(textRow).asAnnotation.Shape.Top = 330;
- TChart2.Tools.Items(textRow).asAnnotation.Shape.Left = tempX*39.7-22;
- textRow++;
- }
- if(stage != ""){
- if(stage == "1" || stage == "2"){
- TChart2.Tools.Add(10);
- if(stage == "1"){
- TChart2.Tools.Items(textRow).asAnnotation.Text = "1st start";
- }
- if(stage == "2"){
- TChart2.Tools.Items(textRow).asAnnotation.Text = "2nd start";
- }
- //TChart2.Tools.Items(textRow).asAnnotation.Shape.Transparent = true;
- TChart2.Tools.Items(textRow).asAnnotation.Shape.Top = 340 - y1*29;
- TChart2.Tools.Items(textRow).asAnnotation.Shape.Left = tempX*39.7-22;
- textRow++;
-
- }
- if(stage == "3" || stage == "4"){
- TChart2.AddSeries (1);
- TChart2.Series(2).VerticalAxisCustom = cus_axis1;
- //TChart2.Series(2).asCandle.CandleStyle = 2;
- TChart2.Series(2).asBar.BarWidth = 3;
- var margin = TChart2.Series(2).asBar.BarMargin;
- TChart2.Series(2).Marks.visible = false;
- TChart2.Series(2).Color = 0x0000ff;
- TChart2.Series(2).AddXY (tempX-1, 10, "", TChart2.Series(2).Color);
- TChart2.Tools.Add(10);
- if(stage == "3"){
- TChart2.Tools.Items(textRow).asAnnotation.Text = "End";
- }
- if(stage == "4"){
- TChart2.Tools.Items(textRow).asAnnotation.Text = "Delivery";
- }
- TChart2.Tools.Items(textRow).asAnnotation.Shape.Transparent = true;
- TChart2.Tools.Items(textRow).asAnnotation.Shape.Top = 350;
- TChart2.Tools.Items(textRow).asAnnotation.Shape.Left = tempX*39.7-17;
- textRow++;
-
- }
- }
- tempX++;
- }
-
- }
- function fGetLaborData(){
- if(combo2.value != ""){
- var ordIndex = combo2.value;
- var orddd = model.getValue("/root/init/orddd["+ordIndex+"]/orddd");
- var cretno = model.getValue("/root/init/orddd["+ordIndex+"]/cretno");
- var ordtype = model.getValue("/root/init/orddd["+ordIndex+"]/ordtype");
- var pid = model.getValue("/root/send/pid");
- }
-
- model.setValue("/root/labor/send/orddd", orddd);
- model.setValue("/root/labor/send/cretno", cretno);
- model.setValue("/root/labor/send/signgenrflag", ordtype);
- model.setValue("/root/labor/send/pid", pid);
-
-
- submit("TRMRF05206");
- model.copyNode("/root/main/laborsign", "/root/main/laborlist/list");
- model.removeNodeset("/root/main/laborlist/list/sign");
- var labrCnt = getNodesetCount("/root/main/laborlist/list/labor");
-
- if(labrCnt == 0){
- var parity = model.getValue("/root/main/laborlist/list/base/parity");
- var nsd = model.getValue("/root/main/laborlist/list/base/nsd");
- var cs = model.getValue("/root/main/laborlist/list/base/cs");
- var edc = model.getValue("/root/main/laborlist/list/base/edc");
- var admission = model.getValue("/root/main/laborlist/list/base/admission");
-
- model.setValue("/root/labor/send/parity", parity);
- model.setValue("/root/labor/send/nsd", nsd);
- model.setValue("/root/labor/send/cs", cs);
- model.setValue("/root/labor/send/edc", edc);
- model.setValue("/root/labor/send/admission", admission);
-
- }else{
- var parity = model.getValue("/root/main/laborlist/list/labor[1]/parity");
- var nsd = model.getValue("/root/main/laborlist/list/labor[1]/nsd");
- var cs = model.getValue("/root/main/laborlist/list/labor[1]/cs");
- var edc = model.getValue("/root/main/laborlist/list/labor[1]/edc");
- var ga = model.getValue("/root/main/laborlist/list/labor[1]/ga");
- var admission = model.getValue("/root/main/laborlist/list/labor[1]/admission");
- var cc = model.getValue("/root/main/laborlist/list/labor[1]/cc");
- var pain = model.getValue("/root/main/laborlist/list/labor[1]/pain");
- var prom = model.getValue("/root/main/laborlist/list/labor[1]/prom");
- var afl = model.getValue("/root/main/laborlist/list/labor[1]/afl");
- var induction = model.getValue("/root/main/laborlist/list/labor[1]/induction");
- var oc = model.getValue("/root/main/laborlist/list/labor[1]/oc");
- var cd = model.getValue("/root/main/laborlist/list/labor[1]/cd");
- var fststage = model.getValue("/root/main/laborlist/list/labor[1]/fststage");
- var scndstage = model.getValue("/root/main/laborlist/list/labor[1]/scndstage");
- var total = model.getValue("/root/main/laborlist/list/labor[1]/total");
- var delivery = model.getValue("/root/main/laborlist/list/labor[1]/delivery");
- var other = model.getValue("/root/main/laborlist/list/labor[1]/other");
- var fstrgstrnm = model.getValue("/root/main/laborlist/list/labor[1]/fstrgstrnm");
- var lastupdtrnm = model.getValue("/root/main/laborlist/list/labor[1]/lastupdtrnm");
-
- var signSave = model.getValue("/root/main/laborlist/list/labor[1]/signyn");
- saveState = signSave;
- if(signSave == "Y"){
- output2.value = "현재는 인증저장 상태입니다";
- }else if(fstrgstrnm != ""){
- output2.value = "현재는 임시저장 상태입니다";
- }
- model.setValue("/root/labor/send/parity", parity);
- model.setValue("/root/labor/send/nsd", nsd);
- model.setValue("/root/labor/send/cs", cs);
- model.setValue("/root/labor/send/edc", edc);
- model.setValue("/root/labor/send/ga", ga);
- model.setValue("/root/labor/send/admission", admission);
- model.setValue("/root/labor/send/cc", cc);
- model.setValue("/root/labor/send/pain", pain);
- model.setValue("/root/labor/send/prom", prom);
- model.setValue("/root/labor/send/afl", afl);
- model.setValue("/root/labor/send/induction", induction);
- model.setValue("/root/labor/send/oc", oc);
- model.setValue("/root/labor/send/cd", cd);
- model.setValue("/root/labor/send/other", other);
- model.setValue("/root/labor/send/fststage", fststage);
- model.setValue("/root/labor/send/scndstage", scndstage);
- model.setValue("/root/labor/send/total", total);
- model.setValue("/root/labor/send/delivery", delivery);
- model.setValue("/root/labor/send/fstrgstrnm", fstrgstrnm);
- model.setValue("/root/labor/send/lastupdtrnm", lastupdtrnm);
- }
-
- fCalcGa();
- model.refresh();
- }
- function fSentence(){
- setParameter("comn_chosflag", "C") // C : 상용구
- setParameter("comn_formprogflag", "B") // A: Summary, B : 주호소
- setParameter("openmode", "select");
- modal("SPMRF04900");
- var rtn = getParameter("comncnts"); //내용
- setParameter("comncnts", "");
- var mouseRow = grd_labor.mouseRow;
-
- model.setValue("/root/main/laborlist/list/labor["+(mouseRow-1)+"]/remark", rtn);
- model.refresh();
- }
- function fLaborAddRow(){
- grd_labor.addRow();
- var cur_row = grd_labor.row-1;
- var chkCC = model.getValue("/root/labor/send/cc");
- var rslt = chkCC.indexOf("2");
- // Membrane 값 - 첫째줄이면 C/C 의 PROM 체크여부에 따라 둘째줄부터는 윗줄 값을 선택
- if(cur_row == "1"){
- if(rslt == "-1"){
- model.setValue("/root/main/laborlist/list/labor["+cur_row+"]/memb", "+");
- }else{
- model.setValue("/root/main/laborlist/list/labor["+cur_row+"]/memb", "-");
- }
- }else {
- model.setValue("/root/main/laborlist/list/labor["+cur_row+"]/memb", model.getValue("/root/main/laborlist/list/labor["+(cur_row-1)+"]/memb"));
- }
- var curDate = getCurrentDate();
- var curTime = getCurrentTime();
- var maskDate = curDate.substr(0, 4) + "-" + curDate.substr(4, 2) + "-" + curDate.substr(6, 2);
- var maskTime = curTime.substr(0, 2) + ":" + curTime.substr(2, 4);
- model.setValue("/root/main/laborlist/list/labor["+cur_row+"]/recdd", maskDate);
- model.setValue("/root/main/laborlist/list/labor["+cur_row+"]/rectm", maskTime);
- model.setValue("/root/main/laborlist/list/labor["+cur_row+"]/seq", grd_labor.row-1);
- model.setValue("/root/main/laborlist/list/labor["+cur_row+"]/position", model.getValue("/root/main/laborlist/list/labor["+(cur_row-1)+"]/position"));
- model.refresh();
- }
- function fTempMessage(){
- /*
- body.createChild("xforms:iviewer", "id:ivr_progress; src:../../../com/commonweb/xrw/SPZZZ00400_로딩중화면.xrw; left:435px; top:339px; width:330px; height:120px;");
- var ivrObjt = document.all("ivr_progress");
- var msg = "임시저장하셨네요ㅎㅎㅎ";
-
- ivrObjt.model.setValue("/root/main/msg", msg);
- ivrObjt.model.refresh();
- event.preventDefault();
- delayTime = window.setInterval("window.close()", 3000); */
-
-
- if(saveState == "Y"){
-
- }else if(saveCnt > 0){
- var closeYn = messageBox("임시저장 상태입니다. 종료", "S003", "인증저장");
- if(closeYn == 6){
- }else if(closeYn == 7){
- var selectedDept = model.getValue("/root/send/orddeptcd");
- if(selectedDept == "2110000000" || selectedDept == "2030000000" || selectedDept == "2070000000"){
- fGrthSignSave();
- }else if(selectedDept == "2100000000"){
- fLaborSignSave();
- }
- }else{
- event.preventDefault();
- }
- }
- }
- function fGrthSignSave(){
-
- saveCnt = parseInt(saveCnt) + 1;
- // 인증저장 데이터 인스턴스 정리
- var ordIndex = combo2.value;
- var tempOrddd = model.getValue("/root/init/orddd["+ordIndex+"]/orddd");
- var cretno = model.getValue("/root/init/orddd["+ordIndex+"]/cretno");
- var ordtype = model.getValue("/root/init/orddd["+ordIndex+"]/ordtype");
- model.setValue("/root/send/orddd", tempOrddd);
- model.setValue("/root/send/cretno", cretno);
- model.setValue("/root/send/signgenrflag", ordtype);
- model.setValue("/root/send/deptnm", combo1.label); // 진료과 인증데이터 넘김
- var tOrddd = model.getValue("/root/send/orddd");
- var maskord = tOrddd.substr(0, 4) + "-" + tOrddd.substr(4, 2) + "-" + tOrddd.substr(6, 2);
- model.setValue("/root/send/orddate", maskord); // 진료일자 인증데이터 넘김
- var tempY = model.getValue("/root/main/cond/year");
- var tempM = model.getValue("/root/main/cond/month");
- var tempMonth = parseInt(tempY)*12 + parseInt(tempM);
- tempMonth = tempMonth + "개월";
- model.setValue("/root/send/age2", tempMonth);
- var fstnm = model.getValue("/root/send/fstrgstrnm");
- if(fstnm == ""){
- model.setValue("/root/send/fstrgstrnm", getUserInfo("usernm"));
- }
- model.setValue("/root/send/lastupdtrnm", getUserInfo("usernm"));
-
- var wrtedd = getCurrentDate();
- var wrtetm = getCurrentTime();
- model.setValue("/root/send/wrtedd", wrtedd);
- model.setValue("/root/send/wrtetm", wrtetm);
-
- model.setValue("/root/send/recdd", wrtedd);
- model.setValue("/root/send/rectm", wrtetm);
-
- var ht="", wt="", hd="", chst="";
- for (i=grd_grth.fixedRows; i<grd_grth.rows; i++)
- {
-
- grd_grth.valueMatrix(i, grd_grth.colRef("seq")) = i;
- ht = grd_grth.valueMatrix(i, grd_grth.colRef("bdht")); // 신장
- wt = grd_grth.valueMatrix(i, grd_grth.colRef("bdwt")); // 체중
- hd = grd_grth.valueMatrix(i, grd_grth.colRef("headgirth")); // 머리둘레
- chst = grd_grth.valueMatrix(i, grd_grth.colRef("chstgirth")); // 흉부둘레
- bt = grd_grth.valueMatrix(i, grd_grth.colRef("bt"));
- sbp = grd_grth.valueMatrix(i, grd_grth.colRef("sbp"));
- dbp = grd_grth.valueMatrix(i, grd_grth.colRef("dbp"));
- pr = grd_grth.valueMatrix(i, grd_grth.colRef("pr"));
-
- if(ht=="" && wt=="" && hd=="" && chst=="" && bt=="" && sbp=="" && dbp=="" && pr=="" ){
- grd_grth.deleteitem(i);
- grd_grth.rowStatus(i) = 4;
- }else{
- grd_grth.rowStatus(i) = 1;
- }
-
- }
- //model.setValue("/root/send/cond",grd_grth.getUpdateData());
- var csvStr = grd_grth.getUpdateData("insert");
- setCSVToNode("/root/send/grid", csvStr, "list");
- sortNodeList("/root/send/grid/list", "recdd", "asc"); // 그리드 인스턴스 정렬
- var signrecinfo = model.instances(0).selectSingleNode("/root/send").xml;
- //var signrecinfo = "test";
- model.removeNodeset("/root/send/cond");
- model.makeValue("/root/send/cond",csvStr);
- model.removeNodeset("/root/send/grid");
- model.makeNode("/root/send/grid");
-
- var savef = model.getValue("/root/send/saveflag");
- if( savef.length != 10){
- var len = savef.length/2 +1.5;
- var formcd = "0000001766 0000001651 0000003157 0000001448 0000003174 0000002722";
- for(var i=1; i<len; i++){
- var form = savef.substr(2*i-2, 1);
- model.setValue("/root/main/cond/chart", form); //그래프 설정
- var code = formcd.substr(11*form-11, 10);
- model.setValue("/root/send/formcd"+i, code); //서식코드 설정
-
- var nodeCnt = getNodesetCount("/root/main/sign/sign");
- var signno = "";
- var odd = model.getValue("/root/send/orddd");
- for(var j = 1; j <= nodeCnt; j++ ){
- var vFormcd = model.getValue("/root/main/sign/sign["+j+"]/formcd");
- var signOrddd = model.getValue("/root/main/sign/sign["+j+"]/orddd");
-
- if( vFormcd == code && signOrddd == odd){
- signno = model.getValue("/root/main/sign/sign["+j+"]/signno");
- }
- }
- if(signno != ""){
- model.makeValue("/root/send/signno"+i, signno);
- //model.setValue("/root/send/recsaveflag", "Y");
- }else{
- model.makeValue("/root/send/signno"+i, "0");
- //model.setValue("/root/send/recsaveflag", "N");
- }
-
- fMakeChart();
- //TChart1.Export.SaveToJPEGFile("C:\\dell\\test.jpeg", false, 0, 70, 560, 696);
- //그래프 이미지 특정 폴더에 저장
- var fso, fldr;
- fladr = "C:/Program Files/himed/grthimage";
- fso = new ActiveXObject("Scripting.FileSystemObject");
-
- if (fso.FolderExists(fladr)) {
- TChart1.Export.SaveToJPEGFile(fladr+"/tchart.jpeg", false, 0, 100, 560, 696 );
-
- } else {
- fldr = fso.CreateFolder(fladr);
- TChart1.Export.SaveToJPEGFile(fladr+"/tchart.jpeg", false, 0, 100, 560, 696 );
-
- }
-
- var file = fladr+"/tchart.jpeg";
- //var f = fso.GetFile(file);
- //fChangeImage(file);
-
- var pos = file.lastIndexOf("\\");
- var localFileName= file.substring(pos+1, file.length);
-
- img_tmp.src = "";
- img_tmp.src = file;
-
- var ldata = img_tmp.getbase64data();
- model.makeValue("/root/send/imgdata"+i, ldata);
-
- }
- } else{
- fMakeChart();
- //TChart1.Export.SaveToJPEGFile("C:\\dell\\test.jpeg", false, 0, 70, 560, 696);
- //그래프 이미지 특정 폴더에 저장
- var fso, fldr;
- fladr = "C:/Program Files/himed/grthimage";
- fso = new ActiveXObject("Scripting.FileSystemObject");
-
- if (fso.FolderExists(fladr)) {
- TChart1.Export.SaveToJPEGFile(fladr+"/tchart.jpeg", false, 0, 100, 560, 696 );
- //sChartNum++;
- } else {
- fldr = fso.CreateFolder(fladr);
- TChart1.Export.SaveToJPEGFile(fladr+"/tchart.jpeg", false, 0, 100, 560, 696 );
- //sChartNum++;
- }
-
- var file = fladr+"/tchart.jpeg";
- //var f = fso.GetFile(file);
- //fChangeImage(file);
-
- var pos = file.lastIndexOf("\\");
- var localFileName= file.substring(pos+1, file.length);
-
- img_tmp.src = "";
- img_tmp.src = file;
-
- var ldata = img_tmp.getbase64data();
- model.setValue("/root/send/imgdata", ldata);
-
- var nodeCnt = getNodesetCount("/root/main/sign/sign");
- var signno = "";
- var orddd = model.getValue("/root/send/orddd");
- var code = model.getValue("root/send/formcd");
- for( i = 1; i <= nodeCnt; i++ ){
- var formcd = model.getValue("/root/main/sign/sign["+i+"]/formcd");
- var signOrddd = model.getValue("/root/main/sign/sign["+i+"]/orddd");
-
- if( formcd == code && signOrddd == orddd){
- signno = model.getValue("/root/main/sign/sign["+i+"]/signno");
- }
- }
- if(signno != ""){
- model.setValue("/root/send/signno", signno);
- model.setValue("/root/send/recsaveflag", "Y");
- }else{
- model.setValue("/root/send/signno", "0");
- model.setValue("/root/send/recsaveflag", "N");
- }
-
- }
-
- var sUserID = getUserInfo("userid");
-
- var rowcnt = combo2.value;
- var ordtype = model.getValue("/root/init/orddd["+rowcnt+"]/ordtype");
-
- // 입원 또는 응급일 경우 // 20111201 knuh 최원돈
- // 기록/처방 직전 인증저장이 정해진 시간(분 단위, 하드코드 401) 이내이면 인증서를 띄우지 않음(1/3)
- // SMMMO00100.js, MMR01300.js, MMR00100.js, SPMRF05200.js
- // 하드코드 값 가져오기 로직
- var ls_emrinptsavetime = fGetHardCDList("Y", 401, 3);
- var ll_emrinptsavetime = ls_emrinptsavetime == "" ? 0 : parseInt(ls_emrinptsavetime) * -1;
- // 인증서 매번 띄우기 위해 주석
- if(ordtype == "O"){
- var signedrecinfo = zesfSignData(signrecinfo, sUserID, false); //외래환자일경우 한번만 인증서 띄움
- }
- // 입원 또는 응급일 경우 // 20111201 knuh 최원돈
- // 기록/처방 직전 인증저장이 정해진 시간(분 단위, 하드코드 401) 이내이면 인증서를 띄우지 않음(2/3)
- // SMMMO00100.js, MMR01300.js, MMR00100.js, SPMRF05200.js
- // 띄우지 않는 로직
- else if ( ( ordtype == "I"
- || ordtype == "E")
- && ll_emrinptsavetime < 0
- && getGlobalVariable("emrinptsavetime") >= getCurrentDateTime().toDate("YYYYMMDD hhmmss").getAddDate(ll_emrinptsavetime, "m").getDateFormat("YYYYMMDD hhmmss"))
- {
- var signedrecinfo = zesfSignData(signrecinfo, sUserID, false); //외래환자일경우 한번만 인증서 띄움
- }
- else{
- var signedrecinfo = zesfSignData(signrecinfo, sUserID, true);
- }
-
- //var signedrecinfo = zesfSignData(signrecinfo, sUserID, true);
- if (signedrecinfo != ""){
- model.makeValue("/root/send/signaftcnts", signedrecinfo);
- model.makeValue("/root/send/signbfcnts", signrecinfo);
- model.setValue("/root/send/status", "U");
-
- /*var graph = model.getValue("/root/main/cond/chart");
- if(graph == "1"){
- var formcd = "0000001766";
- }else if(graph == "2"){
- var formcd = "0000001651";
- }
- var nodeCnt = getNodesetCount("/root/main/sign/sign");
- var signno = "";
- var orddd = model.getValue("/root/send/orddd");
- for( i = 1; i <= nodeCnt; i++ ){
- var code = model.getValue("/root/main/sign/sign["+i+"]/formcd");
- var signOrddd = model.getValue("/root/main/sign/sign["+i+"]/orddd");
-
- if( formcd == code && signOrddd == orddd){
- signno = model.getValue("/root/main/sign/sign["+i+"]/signno");
- }
- }
- if(signno != ""){
- model.setValue("/root/send/signno", signno);
- model.setValue("/root/send/recsaveflag", "Y");
- }else{
- model.setValue("/root/send/signno", "0");
- model.setValue("/root/send/recsaveflag", "N");
- }*/
-
- if(submit("TXMRF05202")){
- for(var i=1; i<8; i++){
- model.removenode("/root/send/imgdata"+i);
- }
- model.removenode("/root/send/signaftcnts");
- model.removenode("/root/send/signbfcnts");
- model.removenode("/root/send/cond");
- model.setValue("/root/send/wrtedd", "");
- model.setValue("/root/send/wrtetm", "");
- // 입원 또는 응급일 경우 // 20111201 knuh 최원돈
- // 기록/처방 직전 인증저장이 정해진 시간(분 단위, 하드코드 401) 이내이면 인증서를 띄우지 않음(3/3)
- // SMMMO00100.js, MMR01300.js, MMR00100.js, SPMRF05200.js
- // 인증저장된 시간을 저장.
- if (ordtype == "I" || ordtype == "E") {
- setGlobalVariable("emrinptsavetime", getCurrentDateTime());
- }
- }
- }else if (signedrecinfo == ""){
- for(var i=1; i<8; i++){
- model.removenode("/root/send/imgdata"+i);
- }
- model.removenode("/root/send/signaftcnts");
- model.removenode("/root/send/signbfcnts");
- model.removenode("/root/send/cond");
- model.setValue("/root/send/wrtedd", "");
- model.setValue("/root/send/wrtetm", "");
- }
- }
- function fLaborSignSave(){
- saveCnt = parseInt(saveCnt) + 1;
- var ordIndex = combo2.value;
- var orddd = model.getValue("/root/init/orddd["+ordIndex+"]/orddd");
- var cretno = model.getValue("/root/init/orddd["+ordIndex+"]/cretno");
- var ordtype = model.getValue("/root/init/orddd["+ordIndex+"]/ordtype");
- var pid = model.getValue("/root/send/pid");
-
- model.setValue("/root/labor/send/orddd", orddd);
- model.setValue("/root/labor/send/cretno", cretno);
- model.setValue("/root/labor/send/signgenrflag", ordtype);
- model.setValue("/root/labor/send/pid", pid);
- model.setValue("/root/labor/send/formcd", "0900004436");
-
- model.setValue("/root/labor/send/deptnm", combo1.label); // 진료과 인증데이터 넘김
- var tOrddd = model.getValue("/root/labor/send/orddd");
- var maskord = tOrddd.substr(0, 4) + "-" + tOrddd.substr(4, 2) + "-" + tOrddd.substr(6, 2);
- model.setValue("/root/labor/send/orddate", maskord); // 진료일자 인증데이터 넘김
-
- var fstnm = model.getValue("/root/labor/send/fstrgstrnm");
- if(fstnm == ""){
- model.setValue("/root/labor/send/fstrgstrnm", getUserInfo("usernm"));
- }
- model.setValue("/root/labor/send/lastupdtrnm", getUserInfo("usernm"));
-
- var wrtedd = getCurrentDate();
- var wrtetm = getCurrentTime();
- model.setValue("/root/labor/send/wrtedd", wrtedd);
- model.setValue("/root/labor/send/wrtetm", wrtetm);
- model.setValue("/root/labor/send/recdd", wrtedd);
- model.setValue("/root/labor/send/rectm", wrtetm);
- model.setValue("/root/labor/send/flag", "2");
- grd_labor.gridToInstance();
- var os="", st="";
- for (i=grd_labor.fixedRows; i<grd_labor.rows; i++)
- {
- grd_labor.valueMatrix(i, 9) = i ;
- os = grd_labor.valueMatrix(i, 3); // OS
- st = grd_labor.valueMatrix(i, 6); // Station
- if(os=="" && st==""){
- grd_labor.deleteitem(i);
- grd_labor.rowStatus(i) = 4;
- }else{
- grd_labor.rowStatus(i) = 1;
- }
-
- }
-
- var csvLabor = grd_labor.getUpdateData("insert");
- setCSVToNode("/root/labor/send/grid", csvLabor, "list");
- sortNodeList("/root/labor/send/grid/list", "recdd", "asc"); // 그리드 인스턴스 정렬
- var lGridCnt = getNodesetCount("/root/labor/send/grid/list");
- for( i = 1; i <= lGridCnt; i++ ){
- var rectm = model.getValue("/root/labor/send/grid/list["+i+"]/rectm");
- var stage = model.getValue("/root/labor/send/grid/list["+i+"]/stage");
- rectm = rectm.substr(0,5);
- model.setValue("/root/labor/send/grid/list["+i+"]/rectm", rectm);
- if(stage == "1"){
- model.setValue("/root/labor/send/grid/list["+i+"]/stage", "1st Start");
- }else if (stage == "2"){
- model.setValue("/root/labor/send/grid/list["+i+"]/stage", "2nd Start");
- }else if (stage == "3"){
- model.setValue("/root/labor/send/grid/list["+i+"]/stage", "End");
- }else if (stage == "4"){
- model.setValue("/root/labor/send/grid/list["+i+"]/stage", "Delivery");
- }
- }
-
- var laborNodeCnt = getNodesetCount("/root/main/laborlist/list/labor");
- if(laborNodeCnt <= 15){
- var imgCnt = 1;
- model.setValue("/root/labor/send/imgcnt", "1");
- } else if(laborNodeCnt > 15 && laborNodeCnt <= 30){
- var imgCnt = 2;
- model.setValue("/root/labor/send/imgcnt", "2");
- } else if(laborNodeCnt > 30 && laborNodeCnt <= 45){
- var imgCnt = 3;
- model.setValue("/root/labor/send/imgcnt", "3");
- } else if(laborNodeCnt > 45 && laborNodeCnt <= 60){
- var imgCnt = 4;
- model.setValue("/root/labor/send/imgcnt", "4");
- } else if(laborNodeCnt > 60 && laborNodeCnt <= 75){
- var imgCnt = 5;
- model.setValue("/root/labor/send/imgcnt", "5");
- }
- for(i=1; i<= imgCnt; i++){
- model.makeValue("/root/labor/send/imginfo["+i+"]/seqno", i);
- }
- var chkCC = model.getValue("/root/labor/send/cc");
- var rdInd = model.getValue("/root/labor/send/induction");
- var chkCD = model.getValue("/root/labor/send/cd");
-
- if(chkCC.indexOf("1") != "-1"){
- model.setValue("/root/labor/send/chpa", "1");
- }else{
- model.setValue("/root/labor/send/chpa", "");
- }
- if(chkCC.indexOf("2") != "-1"){
- model.setValue("/root/labor/send/chpr", "1");
- }else{
- model.setValue("/root/labor/send/chpr", "");
- }
- if(chkCC.indexOf("3") != "-1"){
- model.setValue("/root/labor/send/chaf", "1");
- }else{
- model.setValue("/root/labor/send/chaf", "");
- }
- if(chkCC.indexOf("4") != "-1"){
- model.setValue("/root/labor/send/chfo", "1");
- }else{
- model.setValue("/root/labor/send/chfo", "");
- }
- if(rdInd.indexOf("1") != "-1"){
- model.setValue("/root/labor/send/rdpo", "1");
- }else{
- model.setValue("/root/labor/send/rdpo", "");
- }
- if(rdInd.indexOf("2") != "-1"){
- model.setValue("/root/labor/send/rdob", "1");
- }else{
- model.setValue("/root/labor/send/rdob", "");
- }
- if(chkCD.indexOf("1") != "-1"){
- model.setValue("/root/labor/send/chpi", "1");
- }else{
- model.setValue("/root/labor/send/chpi", "");
- }
- if(chkCD.indexOf("2") != "-1"){
- model.setValue("/root/labor/send/chpr", "1");
- }else{
- model.setValue("/root/labor/send/chpr", "");
- }
- if(chkCD.indexOf("3") != "-1"){
- model.setValue("/root/labor/send/chol", "1");
- }else{
- model.setValue("/root/labor/send/chol", "");
- }
- if(chkCD.indexOf("4") != "-1"){
- model.setValue("/root/labor/send/chiu", "1");
- }else{
- model.setValue("/root/labor/send/chiu", "");
- }
- if(chkCD.indexOf("5") != "-1"){
- model.setValue("/root/labor/send/chof", "1");
- }else{
- model.setValue("/root/labor/send/chof", "");
- }
-
- var signrecinfo = model.instances(0).selectSingleNode("/root/labor/send").xml;
- //var signrecinfo = "test";
- model.removeNodeset("/root/labor/send/list");
- model.makeValue("/root/labor/send/list",csvLabor);
- model.removeNodeset("/root/labor/send/grid");
- model.makeNode("/root/labor/send/grid");
-
- for(i=1; i<= imgCnt; i++){
- model.setValue("/root/labor/send/startRow", i*15-13);
- fMakeLaborGraph();
-
- //그래프 이미지 특정 폴더에 저장
- var fso, fldr;
- fladr = "C:/Program Files/himed/laborimage";
- fso = new ActiveXObject("Scripting.FileSystemObject");
-
- if (fso.FolderExists(fladr)) {
- TChart2.Export.SaveToJPEGFile(fladr+"/tchart.jpeg", false, 0, 100, 658, 400 );
- //sChartNum++;
- } else {
- fldr = fso.CreateFolder(fladr);
- TChart2.Export.SaveToJPEGFile(fladr+"/tchart.jpeg", false, 0, 100, 658, 400 );
- //sChartNum++;
- }
-
- var file = fladr+"/tchart.jpeg";
-
- var pos = file.lastIndexOf("\\");
- var localFileName= file.substring(pos+1, file.length);
-
- img_tmp.src = "";
- img_tmp.src = file;
-
- var ldata = img_tmp.getbase64data();
- model.makeValue("/root/labor/send/imgdata"+i, ldata);
- }
-
-
- var nodeCnt = getNodesetCount("/root/main/laborsign/sign");
- var signno = "";
- var orddd = model.getValue("/root/labor/send/orddd");
- var code = model.getValue("root/labor/send/formcd");
- for( i = 1; i <= nodeCnt; i++ ){
- var formcd = model.getValue("/root/main/laborsign/sign["+i+"]/formcd");
- var signOrddd = model.getValue("/root/main/laborsign/sign["+i+"]/orddd");
- if( formcd == code && signOrddd == orddd){
- signno = model.getValue("/root/main/laborsign/sign["+i+"]/signno");
- }
- }
- if(signno != ""){
- model.setValue("/root/labor/send/signno", signno);
- model.setValue("/root/labor/send/recsaveflag", "Y");
- }else{
- model.setValue("/root/labor/send/signno", "0");
- model.setValue("/root/labor/send/recsaveflag", "N");
- }
-
- var sUserID = getUserInfo("userid");
-
- var rowcnt = combo2.value;
- var ordtype = model.getValue("/root/init/orddd["+rowcnt+"]/ordtype");
-
- // 인증서 매번 띄우기 위해 주석
- if(ordtype == "O"){
- var signedrecinfo = zesfSignData(signrecinfo, sUserID, false); //외래환자일경우 한번만 인증서 띄움
- }
- else{
- var signedrecinfo = zesfSignData(signrecinfo, sUserID, true);
- }
-
- //var signedrecinfo = zesfSignData(signrecinfo, sUserID, true);
- if (signedrecinfo != ""){
- model.makeValue("/root/labor/send/signaftcnts", signedrecinfo);
- model.makeValue("/root/labor/send/signbfcnts", signrecinfo);
- model.setValue("/root/labor/send/status", "U");
-
-
- if(submit("TXMRF05204")){
- for(var i=1; i<8; i++){
- model.removenode("/root/labor/send/imgdata"+i);
- }
- model.removenode("/root/labor/send/signaftcnts");
- model.removenode("/root/labor/send/signbfcnts");
- model.removenode("/root/labor/send/list");
- model.removeNodeset("/root/labor/send/imginfo");
- model.setValue("/root/labor/send/wrtedd", "");
- model.setValue("/root/labor/send/wrtetm", "");
- }
- }else if (signedrecinfo == ""){
- for(var i=1; i<8; i++){
- model.removenode("/root/labor/send/imgdata"+i);
- }
- model.removenode("/root/labor/send/signaftcnts");
- model.removenode("/root/labor/send/signbfcnts");
- model.removenode("/root/labor/send/cond");
- model.removeNodeset("/root/labor/send/imginfo");
- model.setValue("/root/labor/send/wrtedd", "");
- model.setValue("/root/labor/send/wrtetm", "");
- }
- }
- /**
- * 기록지에서 엔터키 쳤을시에 오른쪽으로 이동하는 이벤트
- */
- function fMoveFocus(){
- grd_grth.col=grd_grth.col+1;
-
- if(grd_grth.col==4){
- grd_grth.col=grd_grth.col+1;
- }
- grd_grth.editCell();
- model.refresh();
- }
- /**
- * 임시저장 / 인증저장시 환자의 과코드를 다시 확인
- * @return
- */
- function fDeptCheck(){
- var patorddeptcd1 = model.getValue("/root/send/orddeptcd");
- var patorddeptcd2 = model.getValue("/root/main/paminfo/pamlist/orddeptcd");
-
- if(patorddeptcd1!=patorddeptcd2){
- messageBox("환자의 진료과와 진료일자를 정확하게 선택하여 주시기 바랍니다.", "E");
- return false;
- }else{
- return true;
- }
- }
|