12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988 |
- //
- // ?? ?? ?? ???
- //
- var gvMyUIDPath = null;
- var gvOpUIDPath = null;
- var gvChUIDPath = null;
- var gvDate = null;
- var gvParamPath = null;
- var gvPropPath = null;
- var gvAuthPath = null;
- var gvTitlePath = null;
- var gvScnTypePath = null;
- var gvErrorMsgPath = null;
- var gvSystemPath = null;
- var gvMenuPath = null;
- var gvMenuGroupCdPath = null;
- var gvMenuPrestDeptCdPath = null;
- var gvMenuItemCdPath = null;
- var gvMenuParamPath = null;
- var gvSystemCd = null;
- //var gvMyCBOnClosePath = null;
- //var gvOpCBOnClosePath = null;
- //
- // ??? ?? ??
- //
- var gvReportPath = null;
- var gvSubReportPath = null;
- var gvReportPropsPath = null;
- var gvReportParamsPath = null;
- var gvReportOptionsPath = null;
- //???? ?? ??
- var gvPatientInfoPath = null;
- var gvOperationInfoPath = null;
- var gvConsultInfoPath = null;
- var gvPatientInfoFlagPath = null;
- var gvOrderBasicInfoPath = null;
- //???? ??
- var gvPopupMenuPath = null;
- function xforms_model_construct() {
- gvPropPath="/root/properties";
- gvMyUIDPath=gvPropPath+"/uid/myself";
- gvOpUIDPath=gvPropPath+"/uid/opener";
- gvChUIDPath=gvPropPath+"/uid/children/";
- // gvMyCBOnClosePath=gvPropPath+"/callback/onclose/myself";
- // gvOpCBOnClosePath=gvPropPath+"/callback/onclose/opener";
- gvParamPath=gvPropPath+"/parameters";
- gvChildClosePath=gvPropPath+"/childclose";
- gvSystemPath=gvPropPath+"/domain";
- gvAuthPath=gvPropPath+"/auth";
- gvMenuPath=gvPropPath+"/menu";
- gvMenuGroupCdPath=gvMenuPath+"/menugroupcd";
- gvMenuPrestDeptCdPath=gvMenuPath+"/menuprestdeptcd";
- gvMenuItemCdPath=gvMenuPath+"/menuitemcd";
- gvMenuParamPath=gvMenuPath+"/menuparam";
- gvTitlePath=gvPropPath+"/title";
- gvScnTypePath=gvPropPath+"/stype";
- gvErrorMsgPath=gvPropPath+"/error";
- gvReportPath=gvPropPath+"/report/mainreport";
- gvSubReportPath=gvPropPath+"/report/subreport";
- gvReportPropsPath=gvReportPath+"/props";
- gvReportParamsPath=gvReportPath+"/params";
- gvReportOptionsPath=gvReportPath+"/options";
- gvPatientInfoPath=gvPropPath+"/patient";
- gvOperationInfoPath=gvPatientInfoPath+"/operationinfo";
- gvConsultInfoPath=gvPatientInfoPath+"/consultinfo";
- gvPatientInfoFlagPath=gvPatientInfoPath+"/patientflag";
- gvOrderBasicInfoPath=gvPropPath+"/orderbasicinfo";
- gvPopupMenuPath=gvPropPath+"/popupmenu";
-
- // ??? UID ??(????? ??)
- // window.load()? xforms_model_construct() ? ????? ???? uid? ?????
- gvDate = new Date();
- var uid = gvDate.getTime();
-
- model.makeValue(gvMyUIDPath,uid);
- model.makeValue(gvOpUIDPath,"");
- model.makeValue(gvSystemPath,"");
-
- if (isPopup()) {
- // opener uid? ????.
- model.setValue(gvOpUIDPath,opener.model.getValue(gvMyUIDPath));
- // opener callback? ??? ????.
- // model.makeValue(gvOpCBOnClosePath,opener.model.getValue(gvMyCBOnClosePath));
- // opener? latest? uid? ????.
- opener.model.makeValue(gvChUIDPath+"latest",uid);
- // opener? ????? ????.
- model.makeValue(gvAuthPath,opener.model.getValue(gvAuthPath));
- // opener? ????????? ????.
- model.makeValue(gvMenuParamPath,opener.model.getValue(gvMenuParamPath));
- // ??? ???? ??? ??? ????.(???? ?? Open? ??)
- model.setValue(gvSystemPath,getGlobalVariable("systemcode"),true);
- setGlobalVariable("systemcode","");
- // ??? ?? ??
- setWindowSize();
-
- // ??? ??? ????. ?? addOpenWindow() ??? ????? ??.
- initTitle();
- // ?? ?? ??? ??
- addOpenWindow();
- } else {
- // ??? ??? ????.
- initTitle();
- // ???? ??? ?? ?? ????.
- setScreenAuth();
- // ??Parameter??? ????.
- setScreenMenuParameter();
- }
-
- // ????? ????.
- setScreenMenuGroup();
- // ??Item??? ????.
- setScreenMenuItem();
- // ???? ??? ???? ?? ????.
- setScreenPrestDeptCd();
- event.stopPropagation(); // ??? ??? ??(??? ? ??? 3? ????.)
- }
- function xforms_ready() {
- // ???? ???
- window.setPopupMenu(false);
- // ??? ???key ??
- //??? ???? ???? ?? ???? ??? ? ??.
- //????? accesskey ??? ???? onaccesskey ??? ?? ? DOMActivate ???? Dispatch ??.
- //body.attribute("accesskey") = "f1";
- }
- function xforms_close() {
- // event ??? model??? ???? head ??? propagation ??.
- if( document.all.item(event.currentTarget).elementName == "xhtml:head" ) {
- event.stopPropagation();
- return;
- }
- if ( isPopup() ) {
- // opener? childeren UID ??? ????.
- opener.model.removenode(gvChUIDPath+"child::*[text()=""+getMyUID()+""]");
- //??? ?? ?? ??? ??? ??
- if(window.type == "modal"){
- var viewerObj = getViewer("sysMessage");
- if (viewerObj != null && viewerObj.window.javascript.fGetLastModal != undefined){
- var modalWindowNm = viewerObj.window.javascript.fGetLastModal(getMyUID());
- if(modalWindowNm != null && modalWindowNm != ""){
- messageBox("?? ?? ????? ?? ?","C003","("+modalWindowNm.split('|')[3]+")");
- }
- }
- }
- }
- //event.stopPropagation();
- }
- function xforms_model_destruct() {
- // event ??? model??? ???? head ??? propagation ??.
- if( document.all.item(event.currentTarget).elementName == "xhtml:head" ) {
- event.stopPropagation();
- return;
- }
-
- //????? ???? ??
- var mainClose = getGlobalVariable("mainclose");
-
- if ( mainClose != "Y")
- {
- //????? ?? ????? ????.
- if ( isPopup() ) {
- // ??? ?? ?? ????? ????.
- setScreenLocation(getScreenID(),window.left,window.top);
-
- // ???? ???? ????.
- removeOpenWindow();
- //topmost??? ?? ??
- //opener.body.disabled = false;
- //opener.body.dispatch(model.getValue(gvOpCBOnClosePath));
- }
- }
- //event.stopPropagation();
- }
- /*
- function onaccesskey(){
- //accesskey ? ???
- var scnID = getScreenID();
- openHtml(getDomain()+"/docs/help/"+getBizName(scnID)+"/"+scnID+".html","Help","toolbar=no");
- event.stopPropagation();
- }
- */
- // ?????? ?? ???.
- function initTitle() {
- var titleValue = null;
- var syscd = model.getValue(gvSystemPath);
- if( syscd == null || syscd == "") {
- titleValue = document.head.title.text;
- } else {
- titleValue = document.head.title.text + "(" + getGlobalVariable("sysname"+syscd) + ")";
- }
- model.makeValue(gvTitlePath,titleValue);
-
- if (!isPopup() && getGlobalVariable("userinfos") != "") {
- var scrnTitle = "CMC nU " ;
- scrnTitle = scrnTitle + getUserInfo("systeminstnm") + " ";
- scrnTitle = scrnTitle + new String(htmlwindow.vision) + " ";
- scrnTitle = scrnTitle + getUserInfo("dutplcenm") + " ";
- scrnTitle = scrnTitle + getUserName() + " ";
- scrnTitle = scrnTitle + getTitleLoginDate() + " ";
- document.title = scrnTitle;
- }
- if (isPopup()) {
- document.title = titleValue;
- }
- }
- // ?? ??? ???? ??
- function getTitle() {
- return model.getValue(gvTitlePath);
- }
- //??? ?? ??
- function getTitleLoginDate() {
- var weekarr = new Array("?", "?", "?", "?", "?", "?", "?");
- var dt = getUserInfo("logindt");
- var dtyear = dt.substring(0,4);
- var dtmonth = dt.substring(4,6);
- var dtday = dt.substring(6,8);
- var dthour = dt.substring(8,10);
- var dtmin = dt.substring(10,12);
- var dtval = new Date(dtmonth+"/"+dtday+"/"+dtyear);
- var dtweek = weekarr[dtval.getDay()];
- var dtstr = dtyear + "?" + dtmonth + "?" + dtday + "? (" + dtweek + ") " + dthour +"?" + dtmin +"?";
-
- return dtstr;
- }
- // MIS??? ??? ????.
- function getMISSystemCd() {
- var systemcd = getSystemCd();
- var systeminstcd = systemcd.substring(3,6);
- var missystemcd = "";
- if(systeminstcd == "999"){
- missystemcd = "MIS999";
- }else if(systeminstcd == "888"){
- missystemcd = "MIS888";
- }else if(systeminstcd == "011" || systeminstcd == "012" || systeminstcd == "013" || systeminstcd == "016"){
- missystemcd = "MIS001";
- }else{
- missystemcd = systemcd;
- }
- return missystemcd;
- }
- // ??? ??? ????.
- function getSystemCd() {
- if (gvSystemCd != null) {
- return gvSystemCd;
- }
- if (htmlwindow.systemcd == undefined) {
- gvSystemCd = "";
- } else {
- gvSystemCd = new String(htmlwindow.systemcd);
- }
- return gvSystemCd;
- }
- // ??? ??? TF Viewer ??? ????.
- function getViewer(name) {
- return viewer.item(getSystemCd()+"_"+name);
- }
- //menugroupcd? ????.
- function setScreenMenuGroup(){
- model.makeValue(gvMenuGroupCdPath, getGlobalVariable("menugroupcd"));
- }
- //menuitemcd? ????.
- function setScreenMenuItem(){
- model.makeValue(gvMenuItemCdPath, getGlobalVariable("menuitemcd"));
- }
- // ???? ??? ???? ??? ????.
- function setScreenPrestDeptCd(){
- model.makeValue(gvMenuPrestDeptCdPath, getGlobalVariable("prestdeptcd"));
- }
- // ???? ??? ???? ??? ????.
- function getScreenPrestDeptCd(){
- return model.getValue(gvMenuPrestDeptCdPath);
- }
- // ??Parameter??? ????.
- function setScreenMenuParameter(){
- model.makeValue(gvMenuParamPath, getGlobalVariable("menuparam"));
- if(window.type != "iviewer") setGlobalVariable("menuparam","");
- }
- // ??Parameter??? ????.
- function getScreenMenuParameter(){
- return model.getValue(gvMenuParamPath);
- }
- // url??? ??ID? ????. url? null?? ?? ??? url? ????.
- function getScreenID(url) {
- if (url == null) {
- url = document.url;
- }
- var sp = url.split("/");
- return sp[sp.length-1].split(".")[0].substr(0,10);
- }
- //??? ??? ????.
- function setScreenAuth(){
- var viewerObj = getViewer("bizMain");
- //????(F5) ?? ??
- if ( viewerObj == null )
- {
- setGlobalVariable("scrnauth","11100000");
- }
- model.makeValue(gvAuthPath, getGlobalVariable("scrnauth"));
- if(window.type != "iviewer") setGlobalVariable("scrnauth","");
- }
- // ?? ??? ?? ??? ??
- function checkAuth(auth) {
- var f = auth.charAt(0);
- var a = getAuth();
- var v = '0';
- switch(f) {
- case 'r': // ????
- case 'R':
- v = a.charAt(0);
- break;
- case 'x': // ????
- case 'X':
- v = a.charAt(1);
- break;
- case 'p':
- case 'P':
- v = a.charAt(2);
- break;
- }
- if (v == '1') {
- return true;
- } else {
- return false;
- }
- }
- // ?? ??? ??? ??? ??
- function getAuth() {
- return model.getValue(gvAuthPath);
- }
- //?? ?? ??(_auth)? ?? ????(RXP)? ????.
- function setScreenBtnDisabled( documentObj ) {
- if (documentObj == null) {
- documentObj = document;
- }
- var childObjCnt = documentObj.controls.length;
- var childObj;
-
- for (var i=0; i < childObjCnt; i++) {
- childObj = documentObj.controls.item(i);
-
- if (childObj.elementName == "xforms:iviewer") {
- setScreenBtnDisabled( childObj.document );
- } else if (childObj.elementName == "xforms:button") {
- var btnAuth = childObj.attribute("_auth");
- if(btnAuth == "R" || btnAuth == "r" || btnAuth == "X" || btnAuth == "x" || btnAuth == "P" || btnAuth == "p"){
- childObj.disabled = !checkAuth(btnAuth);
- }
- }
- }
- }
- // ?? ??? UID? ??
- function getMyUID() {
- return model.getValue(gvMyUIDPath);
- }
- // Opener? UID? ??, Opener? ??? "" ??
- function getOpenerUID() {
- return model.getValue(gvOpUIDPath);
- }
- // WID? ? child ???? ?? UID? ??
- function getChildUID(wid) {
- var cid = model.getValue(gvChUIDPath+wid);
- if (cid==null) { cid=""; }
- return cid;
- }
- // Opener? ?? ???? ?????? ??? ????.
- function checkOpener() {
- if (isPopup()) {
- return (getOpenerUID()==opener.model.getValue(gvMyUIDPath));
- } else {
- return false;
- }
- }
- // wid? ???? open? child window ??? ??? UID? ??? ?? window??? ????.
- // child window? ??? ???? UID? ????? null? ????.
- function getChildWindow(wid) {
- return findChildWindow(getChildUID(wid));
- }
- // ???? child ??? ??? ??? UID? ??? cid? ???
- // window ??? ??? ????. ??? null
- function findChildWindow(cid) {
- var child = null;
- for(i=0;i<window.children.length;i++) {
- child = window.children.item(i);
- if (child.model.getValue(gvMyUIDPath)==cid) return child;
- }
- return null;
- }
- // ???? child ??? ??? ?? ID? sid? ??? window ???
- // ??? ????. ??? null
- function findChildWindowByScreenID(sid) {
- var child = null;
- for(i=0;i<window.children.length;i++) {
- child = window.children.item(i);
- if (child.javascript.getScreenID()==sid) return child;
- }
- return null;
- }
- //????? child??? ??? ?? ?? child? ?? ???.
- function closeChildWindow() {
- if(model.getValue(gvChildClosePath) == "Y"){
- var childCnt = window.children.length;
- for( var i = childCnt; i > 0; i-- ) {
- window.children.item(i-1).close();
- }
- }
- }
- //????? child? close??? ??
- function setCloseChildWindow(){
- model.makeValue(gvChildClosePath,"Y");
- }
- // ??? ???? ???? ????.
- function isPopup() {
- var stype = window.type;
- if (stype == "iviewer" || stype == "main") {
- return false;
- } else {
- return true;
- }
- }
- // wid? open? child window? activate??.
- function activateChild(wid) {
- var cwnd = window.children.item(wid);
- if (cwnd != null) {
- cwnd.activate();
- }
- }
- // opener? activate??.
- function activateOpener() {
- if (isPopup()) {
- opener.javascript.activateMyWindow();
- }
- }
- // ?? ?? window? activate??.
- function activateMyWindow() {
- if (isPopup()) {
- window.activate();
- } else { // main viewer ? ??
- htmlwindow.focus();
- }
- }
- //?? ?? ??
- function getScreenDisabled(){
- return body.disabled;
- }
- //??Object ????
- function setMenuDisabled(type){
- htmlwindow.setMenuDisabled(type);
- }
- function openInternal(openType,id,idType,monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos) {
-
- if (!checkTimeout()) {
- // session timeout ??? ??? session ?? ??
- setGlobalVariable("last_submit", (new Date()).getTime());
- }
-
- var url = null;
- var sid = getScreenID(id);
- if (wid == null || wid == "") {
- wid = sid;
- }
- if (prevPos == null) { // ?? ?? ?? ?? ??
- prevPos = true;
- }
-
- if ( idType == "url" ) { // idType == "url" ?? ID? ??? URL? open??.
- url = id;
- } else { // idType == "scn"
- //url = sid+".xrw";
- url = getScreenURL(sid);
- }
-
- // ??? ??
- var prop = null;
- if (monNo == null && xPos == null && yPos == null) { // ?? ?? ?? ?? ?? ?? ??? open
- var viewerObj = getViewer("sysMessage");
- if (viewerObj != null && viewerObj.window.javascript.fSetStatusMessage != undefined) {
- // ?? ?????? ?? ??? ??? ?? ??
- monNo = getCurrentMonitorNumber()-1;
- var monSize = viewerObj.window.javascript.fGetMonitorSize(monNo);
- xPos = monSize[0]/2 - 605; // 1211px/2
- yPos = monSize[1]/2 - 392; // 784px/2
- if (xPos < 0) { xPos = 0; }
- if (yPos < 0) { yPos = 0; }
- var loc = getAbsoluteLocation(monNo,xPos,yPos);
- xPos = loc[0];
- yPos = loc[1];
- prop = "top:"+yPos+"px;left:"+xPos+"px;width:1211px;height:784px;";
- } else {
- prop = "align:center;width:1211px;height:784px;";
- }
- } else {
- var xyPos = getScreenLocation(sid); // ?? ??? ???.
- var loc = null;
- if ( prevPos && xyPos != "") { // ?? ?? ??
- loc = xyPos.split("|");
- } else { // ??? ?? ??? ?? ??? ??
- if (xPos == "" || xPos == null) {xPos = 0;}
- if (yPos == "" || yPos == null) {yPos = 0;}
- if (monNo == "" || monNo == null) {monNo = getCurrentMonitorNumber();}
- monNo = parseInt(monNo)-1;
- if (monNo < 0) {
- monNo = 0;
- }
- loc = getAbsoluteLocation(monNo,xPos,yPos);
- }
- xPos = loc[0];
- yPos = loc[1];
- prop="top:"+yPos+"px;left:"+xPos+"px;";
- }
- // ??? ?? ???? ??
- if (userProp != null) {
- prop = prop + userProp;
- }
-
- // ?? ??ID? ?? ????? ????, ??? ?? ?? ?? ID? ???? ?? ???
- // ? ?? Activate ???. (2008.2.12 ??)
- var viewerObj = getViewer("sysMessage");
- var wd = null;
- if (viewerObj != null && viewerObj.window.javascript.fGetOpenWindow != undefined) {
- // ????? ?? ????. ????? ???? ? ??? ???? ???? ????.
- // ????? ?? ??? ?? ?? ??? ??(????????? ????? ??? ?? ??ID? ??? Modeless? ??)
- // var mainWnd = getMainViewer();
- // if (mainWnd != null && mainWnd.javascript.getScreenID() == sid) {
- // wd = mainWnd;
- // } else {
- wd = viewerObj.window.javascript.fGetOpenWindow(sid);
- // }
- } else { // ?? ??? ????. ??? opener, child ????? ???.
- if (isPopup() && opener.javascript.getScreenID() == sid) {
- wd = opener;
- } else if (getScreenID() == sid) {
- wd = window;
- } else {
- wd = findChildWindowByScreenID(sid);
- }
- }
-
- var cid = "";
- if (wd != null && openType =="modeless") { // modeless? ??? ?? ?? ID? ??? ??:activate
- cid = wd.javascript.getMyUID();
- wd.javascript.activateMyWindow(); // ???? ??? Activate ??.
- wd.body.dispatch("onActivate"); // Activate? ??
- } else { // replace??? ??? ?? ??ID? ??? ??? ?? ?? : ?? ??
- window.load(url,openType,wid,prop,ref,resultref);
- if (openType!="replace") {
- // open? ???? ??? uid? latest? ??????? ? ??
- // wid? ???? ??????.
- cid = model.getValue(gvChUIDPath+"latest");
- model.makeValue(gvChUIDPath+wid,cid);
- model.makeValue(gvChUIDPath+"latest",""); // latest? ??
- }
- }
- return cid;
- /**
- // wid ? ????? ??? ???? ??? uid? ????.
- var cid = getChildUID(wid);
-
- // uid? ????? ??? ???? ???? children??? ??? ????.
- if (cid != "") {
- var child = findChildWindow(cid);
- // ?? uid? ????? ??? activate ?? ????.
- if ( child!=null ) {
- child.activate();
- return cid;
- }
- }
-
- // ?? ?? ?? ?? ???? ??? replace??? uid? ?? ?? ??? ????.
- window.load(url,openType,wid,prop,ref,resultref);
- if (openType!="replace") {
- // open? ???? ??? uid? latest? ??????? ? ??
- // wid? ???? ??????.
- cid = model.getValue(gvChUIDPath+"latest");
- model.makeValue(gvChUIDPath+wid,cid);
- model.makeValue(gvChUIDPath+"latest",""); // latest? ??
- return cid;
- } else {
- return "";
- } **/
- }
- function open(id,monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos) {
- if (userProp == null) {
- userProp = "max:hidden;";
- } else {
- userProp = "max:hidden;" + userProp;
- }
- return openInternal("modeless",id,"scn",monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos);
- }
- function navigate(id,monNo,xPos,yPos,wid,ref,resultref) {
- //????
- var scrnauth = model.getValue(gvAuthPath);
- setGlobalVariable("scrnauth", scrnauth);
- //child close
- closeChildWindow();
- return openInternal("replace",id,"scn",monNo,xPos,yPos,wid,ref,resultref);
- }
- function modal(id,monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos) {
- var rtn = "";
- body.disabled = true;
- if (userProp == null) {
- userProp = "min:hidden;max:hidden;";
- } else {
- userProp = "min:hidden;max:hidden;" + userProp;
- }
-
- rtn = openInternal("modal",id,"scn",monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos);
-
- body.disabled = false;
- return rtn;
- }
- /*
- function topmost(id,monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos,onCloseEvent) {
- var rtn = "";
- body.disabled = true;
- if (userProp == null) {
- userProp = "min:hidden;max:hidden;";
- } else {
- userProp = "min:hidden;max:hidden;" + userProp;
- }
-
- model.makeValue(gvMyCBOnClosePath,onCloseEvent);
- rtn = openInternal("modeless_topmost",id,"scn",monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos);
-
- body.disabled = false;
- return rtn;
- }
- */
- function openUrl(url,monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos) {
- if (userProp == null) {
- userProp = "max:hidden;";
- } else {
- userProp = "max:hidden;" + userProp;
- }
- return openInternal("modeless",url,"url",monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos);
- }
- function navigateUrl(url,monNo,xPos,yPos,wid,ref,resultref) {
- //????
- var scrnauth = model.getValue(gvAuthPath);
- setGlobalVariable("scrnauth", scrnauth);
- return openInternal("replace",url,"url",monNo,xPos,yPos,wid,ref,resultref);
- }
- function modalUrl(url,monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos) {
- if (userProp == null) {
- userProp = "min:hidden;max:hidden;";
- } else {
- userProp = "min:hidden;max:hidden;" + userProp;
- }
- return openInternal("modal",url,"url",monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos);
- }
- // ???? Open
- function openExternal(syscd,id,monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos) {
- var url = getScreenURL(id,syscd);
- setGlobalVariable("systemcode", syscd.toUpperCase());
- var cid = openInternal("modeless",url,"url",monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos);
- setGlobalVariable("systemcode", "");
-
- return cid;
- }
- // ?? HTML Open
- function openHtml(url,wid,prop) {
- if (prop == null) {
- htmlwindow.open(url,wid);
- } else {
- htmlwindow.open(url,wid,prop);
- }
- }
- /**
- * ?? Size? ?? ??? ??
- */
- function setWindowSize(){
- //?????
- var pageWidth = body.attribute("pagewidth") == "" ? 1211 : parseInt(body.attribute("pagewidth"));
- var pageHeight = body.attribute("pageheight") == "" ? 800 : parseInt(body.attribute("pageheight"))+16;
- //? ??
- //?? OS? ???? ?? ??? ????? ?
- var captionSize = Math.abs(app.registry("HKEY_CURRENT_USER", "Control Panel\\Desktop\\WindowMetrics", "CaptionHeight" , "STRING"))/15;
- var marginWidth = 8;
- var marginHeight = captionSize+9;
- //?? ?? ??
- body.attribute("margin-top") = 8;
- body.attribute("margin-bottom") = 8;
- //??? ??
- window.setSize(pageWidth+marginWidth, pageHeight+marginHeight);
- }
- // ??? ??? ????
- function setSystemMessage(msg) {
- var viewerObj = getViewer("sysMessage");
- if (viewerObj != null && viewerObj.window.javascript.fSetStatusMessage != undefined) {
- viewerObj.window.javascript.fSetStatusMessage(msg);
- }
- }
- // ?? ?? ??? ????.
- function setScreenLocation(sid,xpos,ypos) {
- var viewerObj = getViewer("sysMessage");
- if (viewerObj != null && viewerObj.window.javascript.fSetScreenLocation != undefined) {
- viewerObj.window.javascript.fSetScreenLocation(sid,xpos,ypos);
- }
- }
- // ?? ?? ??? ????.
- function getScreenLocation(sid) {
- var viewerObj = getViewer("sysMessage");
- if (viewerObj != null && viewerObj.window.javascript.fGetScreenLocation != undefined) {
- return viewerObj.window.javascript.fGetScreenLocation(sid);
- } else {
- return "";
- }
- }
- // ????? ????? ????? ????.
- function getAbsoluteLocation(mon,xpos,ypos) {
- var viewerObj = getViewer("sysMessage");
- if (viewerObj != null && viewerObj.window.javascript.fGetAbsoluteCoordinate != undefined) {
- return viewerObj.window.javascript.fGetAbsoluteCoordinate(mon,xpos,ypos);
- } else {
- var abspos = new Array(2);
- abspos[0] = xpos;
- abspos[1] = ypos;
- return abspos;
- }
- }
- // ??? ?? ??? ??? ??? ??? ??? ????? ????.
- function getRelativeCoordinate(xpos,ypos){
- var viewerObj = getViewer("sysMessage");
- if (viewerObj != null && viewerObj.window.javascript.fGetRelativeCoordinate != undefined) {
- var coord = viewerObj.window.javascript.fGetRelativeCoordinate(xpos,ypos);
- coord[0] = coord[0]+1;
- return coord;
- } else {
- var coord = new Array(3);
- coord[0] = 1;
- coord[1] = xpos;
- coord[2] = ypos;
- return coord;
- }
- }
- function getCurrentMonitorNumber() {
- return getRelativeCoordinate(window.left,window.top)[0];
- }
- // ??? ??? ????? ??? ????.
- function addOpenWindow() {
- var viewerObj = getViewer("sysMessage");
- if (viewerObj != null && viewerObj.window.javascript.fAddOpenWindow != undefined) {
- // viewerObj.window.javascript.fAddOpenWindow(getScreenID()+"|"+getMyUID()+"|"+getTitle(),window);
- viewerObj.window.javascript.fAddOpenWindow(getScreenID()+"|"+getMyUID()+"|"+window.type+"|"+getTitle(),window);
- }
- }
- // ??? ??? ????? ???? ????.
- function removeOpenWindow() {
- var viewerObj = getViewer("sysMessage");
- if (viewerObj != null && viewerObj.window.javascript.fRemoveOpenWindow != undefined) {
- // viewerObj.window.javascript.fRemoveOpenWindow(getScreenID()+"|"+getMyUID()+"|"+getTitle());
- viewerObj.window.javascript.fRemoveOpenWindow(getScreenID()+"|"+getMyUID()+"|"+window.type+"|"+getTitle());
- }
- }
- // ?? ??? ??? ?? ID? sid? ??? ??? ??? ????.
- // ?? ??? ??? null? ????.
- function getOpenWindow(sid) {
- var viewerObj = getViewer("sysMessage");
- if (viewerObj != null && viewerObj.window.javascript.fGetOpenWindow != undefined) {
- return viewerObj.window.javascript.fGetOpenWindow(sid);
- } else {
- return null;
- }
- }
- // his main ??? ??? ????.
- // ?? window? ??? null? ????.
- function getMainViewer(){
- var viewerObj = getViewer("bizMain");
- //????(F5) ?? ??
- if ( viewerObj == null )
- {
- viewerObj = htmldocument.all.TFViewer1;
- }
- if ( viewerObj == null )
- {
- return null;
- } else{
- return viewerObj.window;
- }
- }
- //
- // ??? ??? ??
- //
- // parameter ??? ???? ??? ??
- function getParameterPath() {
- return gvParamPath;
- }
- // name ??? value ?? ??, ??? ?? name? ??? ??? ?? ???
- function setParameter(name, value){
- var valueNode = instance1.selectSingleNode(gvParamPath+"/"+name+"/"+name+"value");
- model.makeValue(gvParamPath+"/"+name+"/"+name+"value", value);
- }
- // name ??? value ?? ??
- function addParameter(name, value){
- var valueNode = instance1.selectSingleNode(gvParamPath+"/"+name+"/"+name+"value");
- if(valueNode==null){
- model.makeValue(gvParamPath+"/"+name+"/"+name+"value", value);
- }else{
- var nameNode = instance1.selectSingleNode(gvParamPath+"/"+name);
- valueNode = instance1.createNode("element", name+"value", "");
- valueNode.text = value;
- nameNode.appendChild(valueNode);
- }
- }
- // index ?? name? ?? ???, index ???? 1
- function getParameter(name, index){
- if (index==null) { index = 1; }
- return model.getValue(gvParamPath+"/"+name+"/"+name+"value["+index+"]");
- }
- function getParameterCount(name){
- return new Number(instance1.selectnodes(gvParamPath+"/"+name+"/"+name+"value").length);
- }
- // index ?? name? ?? ???, index ???? 1
- function removeParameter(name, index){
- if (index==null) { index = 1; }
- model.removeNode(gvParamPath+"/"+name+"/"+name+"value["+index+"]");
- }
- // name? ?? ?? ???
- function clearParameter(name){
- model.removeNode(gvParamPath+"/"+name);
- }
- // ??????? ???? ???? ???, ???? ???? ????.
- function getBizName(bizCode) {
- var firstChar = bizCode.charAt(2);
- //alert(firstChar);
- var bizName = "";
- switch(firstChar) {
- case 'P': // ??
- case 'p':
- bizName = "pam";
- break;
- case 'M': // EMR
- case 'm':
- bizName = "emr";
- break;
- case 'A': // ????
- case 'a':
- bizName = "ast";
- break;
- case 'L': // LIS
- case 'l':
- bizName = "lis";
- break;
- case 'R': // MIS
- case 'r':
- bizName = "mis";
- break;
- case 'Z': // ??
- case 'z':
- bizName = "com";
- break;
- case 'S': // ????
- case 's':
- bizName = "sts";
- break;
- case 'C': // CRM
- case 'c':
- bizName = "crm";
- break;
- case 'I': // CRC(??????)
- case 'i':
- bizName = "crc";
- break;
- case 'D': // CRD(????)
- case 'd':
- bizName = "crd";
- break;
- case 'T': // ??
- case 't':
- bizName = "tmp";
- break;
- default: // unknown
- bizName = "";
- break;
- }
-
- return bizName;
- }
- // ????? domain? ????.
- function getMainDomain() {
- var domainStr = getGlobalVariable("domain");
- if (domainStr == "") { // ????? ??
- domainStr = "http://localhost:9080";
- }
- return domainStr;
- }
- // syscd ? ???? ?? ???? ?? ??? URL? ??
- // syscd? null ?? ?? ??? ??? ??? ???? ?? ??? URL? ??
- function getDomain(syscd) {
- var domainStr = null;
- if (syscd == null || syscd == "") {
- syscd = model.getValue(gvSystemPath);
- }
- if (syscd == null || syscd == "") {
- domainStr = getMainDomain();
- } else {
- domainStr = getGlobalVariable("sysurl"+syscd.toUpperCase());
- }
- return domainStr;
- }
- function getScreenURL(sid,syscd) {
- return getDomain(syscd)+getScreenURI(sid);
- }
- function getScreenURI(sid) {
- return "/himed/webapps/cmc/web/xrw/"+sid+".xrw";
- }
- function getActionURI(submitID) {
- var bizName = getBizName(submitID);
- return "/himed/webapps/cmc/web/xrw/.live?submit_id="+submitID+"&business_id=" + bizName;
- }
- function getActionURL(submitID) {
- return getDomain()+getActionURI(submitID);
- }
- var gvOnSubmit = false;
- var gvShowAlert = false;
- var gvSuppressError = false;
- var gvForceSubmit = false;
- var gvHtmlRedirect = false;
- // ?? submit() ??? ???? ???? ???? ??? ??? MessageBox()? ????.
- function setAlertOn() {
- gvShowAlert = true;
- }
- // ?? submit() ??? ???? ???? ??? ?? ??? ???.
- function setErrorOff() {
- gvSuppressError = true;
- }
- // ?? submit() ??? ???? session timeout ? ???? submit()? ????? ??.
- function setForceOn() {
- gvForceSubmit = true;
- }
- // ?? submit() ??? ???? ??? HTML? ? ?? HTML ? ????? ????.
- function setHtmlRedirect() {
- gvHtmlRedirect = true;
- }
- // ?? ?? ?? ??
- function checkTimeout() {
- var timeOut = parseInt(getGlobalVariable("session_timeout"));
- if (isNaN(timeOut) || timeOut <= 0) { // timeout ???? ??
- return false;
- }
- var lastTime = getGlobalVariable("last_submit");
- var curTime = (new Date()).getTime();
- if (curTime - parseInt(lastTime) > (timeOut*60000)) {
- return true;
- } else {
- return false;
- }
- }
- function submit(submitID, refresh, ref, resultref, encoding) {
- var showAlert = gvShowAlert;
- var suppressError = gvSuppressError;
- gvShowAlert = false;
- gvSuppressError = false;
-
- if (!gvForceSubmit) {
- gvForceSubmit = false;
- if (checkTimeout()) {
- // ????? ???
- body.disabled = true;
- setParameter("type", "session");
- modal("SPZUM00400", "", "", "", "", "", "","width:241px;height:130px;align:center;");
- // window.load("../../../com/hismainweb/xrw/SPZUM00400_????.xrw","modal","","width:241px;height:130px;align:center;");
- body.disabled = false;
- if (checkTimeout()) {
- gvHtmlRedirect = false;
- return false; // ???? ??
- }
- }
- // submit ?? ????
- setGlobalVariable("last_submit", (new Date()).getTime());
- }
-
- // ?? submit ?? ?? ?? ??
- if (gvOnSubmit) {
- gvHtmlRedirect = false;
- return false;
- } else {
- gvOnSubmit = true;
- }
-
- var actionURL = getActionURL(submitID)
- + getUserSessionString(); // ????? query string ??.
- if ( refresh == null ) {
- refresh = true;
- }
-
- var retvalue = false;
-
- try {
- var sid = document.all(submitID);
- if (!sid) {
- messageBox("Submit["+submitID+"]? ????","E007");
- gvOnSubmit = false;
- gvHtmlRedirect = false;
- return false;
- }
- // ref? resultref? ????.
- // null ??? "" ?? ???? ???.
- if ( ref != null && ref != "" ) {
- sid.attribute("ref") = ref;
- }
-
- if ( resultref != null && resultref != "" ) {
- sid.attribute("resultref") = resultref;
- }
-
- // action url? ????.
- sid.attribute("action") = actionURL;
- if (encoding != null && encoding != "") {
- sid.attribute("encoding") = encoding;
- } else {
- sid.attribute("encoding") = "utf-8";
- }
- //alert(sid.attribute("encoding"));
- //sid.attribute("type") = "custom";
-
- // ??? submit???? ?? ?? ??? ????? ???.
- model.removeNode(gvErrorMsgPath);
-
- // ??? submit??.
- var ret = model.send(submitID, refresh, false, true);
-
- //alert("return = " + ret);
- if ( ret == 200 ) {
- // ???
- retvalue = showSystemMessage(showAlert,suppressError);
- } else {
- if (!suppressError) {
- messageBox("Submit["+submitID+"] ???","E009","[ret:"+ret+"]");
- }
- retvalue = false;
- }
- } catch (e) {
- if (!suppressError) {
- messageBox("Submit["+submitID+"] ???","E009","[exception:"+e+"]");
- }
- retvalue = false;
- }
-
- gvOnSubmit = false;
- gvHtmlRedirect = false;
- return retvalue;
- }
- function xforms_submit_error() {
- if (error.errorcode == 3003) {
- messageBox("?? ??? ? ???? ?? ??? ???? ?? ???","E009","[errorcode:"+error.errorcode+"]");
- event.stopPropagation();
- }
- }
- // ???? ??? ???? ??? ????.
- function showSystemMessage(showAlert,suppressError) {
- var type = model.getValue(gvErrorMsgPath+"/type");
- var code = model.getValue(gvErrorMsgPath+"/code");
- var msg = model.getValue(gvErrorMsgPath+"/msg");
- var desc = model.getValue(gvErrorMsgPath+"/description");
- if ( "error" == type ) {
- if (suppressError == null || !suppressError) {
- body.disabled = true;
- window.load("../../../com/commonweb/xrw/SPZZZ00100_?????.xrw","modal","","width:514px;height:198px;align:center;",gvErrorMsgPath,"/root/main");
- body.disabled = false;
- }
- return false;
- } else {
- setSystemMessage(msg);
- if (showAlert != null && showAlert) {
- messageBox(msg,"I");
- }
- return true;
- }
- }
- // submit? ?? ??? ?? ?? HTML ???? ??? ??
- function onredirecthtml() {
- if( document.all(event.target).elementName == "xforms:submission" && gvHtmlRedirect == false) {
- event.preventDefault();
- event.stopPropagation();
- }
- gvHtmlRedirect = false;
- }
- // submit ??? <resultKM ../> ? ?? ??
- function onerror() {
- var msg = error.description;
- var svrtime = error.errorSource;
- var pctime = (new Date()).getTime();
- // ?????? ??? ??? ???.
- setGlobalVariable("timediff", svrtime - pctime);
- event.stopPropagation();
-
- // ?? ??? instance? ??
- handleSystemMessage(msg);
- }
- // submit ??? ??? error event? ??? ????.
- function handleSystemMessage(msg) {
- // ?? ??? instance? ??
- var msgItem = msg.split("|");
- model.makeValue(gvErrorMsgPath+"/type",msgItem[0]); // error ?? info
- model.makeValue(gvErrorMsgPath+"/code",msgItem[1]); // error? ?? ????
- model.makeValue(gvErrorMsgPath+"/msg",msgItem[2].replace(";","\n"),true); // ???? newline ??? ; ? ?? ???????
- var description = "";
- if (msgItem[3] != null && msgItem[3] != "undefined") {
- description = msgItem[3];
- }
- if (msgItem[4] != null && msgItem[4] != "undefined") {
- description = description + "\n" + msgItem[4];
- }
- model.makeValue(gvErrorMsgPath+"/description",description); // error? ?? ????
- }
- // ??? ?? ?? ???? ?? ?? submit? ?? ??? ???
- // ?? ???? action URL? query string?? ????.
- // ?? ??? query string? ????.
- function getUserSessionString() {
- var sessionStr = "&macaddr="+getUserInfo("macaddr");
- var isAnonymous = getGlobalVariable("anonymous");
- if (isAnonymous == "true") { // ????? ?? ????? ????? ????.
- sessionStr = sessionStr + "&anony_session="+encodeURI(getUserInfos());
- }
- return sessionStr;
- }
- /**
- * msg_code : I(Information), C(Critical), E(Exclamation), Q(Question, YN), S(Select, YNC)
- *I001=???????.
- *I002=???????.
- *I003=???????.
- *I004=????.
- *I005=?????.
- *I006=?????.
- *I007=??????.
- *I008=????.
- *I009=???.
- *
- *C001=?????? !
- *C002=?????? !
- *C003=?????? !
- *
- *E001=? ? ????.
- *E002=??? ????.
- *E003=???????.
- *E004=???? ????.
- *E005=???????.
- *E006=???????.
- *E007=?????.
- *E008=???.
- *E009=???????.
- *E010=??? ?????.
- *E011=??? ?????.
- *E012=??? ?????.
- *E013=???? ????.
- *E014=???? ????.
- *E015=????? ?????.
- *E016=???? ????.
- *
- *Q001=?? ?????? ?
- *Q002=?? ?????? ?
- *Q003=?? ?????????
- *Q004=?? ???????
- *Q005=?? ???????
- *Q006=?? ???????
- *Q007=?? ???????
- *Q008=?? ???????
- *Q009=?? ???????
- *Q010=??? ???????
- *Q011=?? ???????
- *Q012=?? ???????
- *
- *S001=???? ?(Yes)\n??? ???(No)
- *S002=?????? ?(Yes)\n?????? ???(No)
- *return : yes=6, no=7
- */
- function messageBox(pMessage, pCode, pOptMsg) {
- var alertMsg = null;
- var msgTitle = null;
- var msgType = null;
- var msgData = null;
- var msgRtn = "";
- // Title Message
- switch( pCode.substr(0,1) ){
- case "I": msgTitle = "??";
- msgType = "64";
- break;
- case "C": msgTitle = "??";
- msgType = "16";
- break;
- case "E": msgTitle = "??";
- msgType = "48";
- break;
- case "Q": msgTitle = "??";
- msgType = "36";
- break;
- case "S": msgTitle = "??";
- msgType = "35";
- break;
- default : msgTitle = "??";
- msgType = "16";
- }
- // Message Data
- switch( pCode ){
- case "I001": alertMsg = " ???????."; break;
- case "I002": alertMsg = " ???????."; break;
- case "I003": alertMsg = " ???????."; break;
- case "I004": alertMsg = " ????."; break;
- case "I005": alertMsg = " ?????."; break;
- case "I006": alertMsg = " ?????."; break;
- case "I007": alertMsg = " ??????."; break;
- case "I008": alertMsg = " ????."; break;
- case "I009": alertMsg = " ???."; break;
- case "C001": alertMsg = " ??????."; break;
- case "C002": alertMsg = " ??????."; break;
- case "C003": alertMsg = " ??????."; break;
-
- case "E001": alertMsg = " ? ? ????."; break;
- case "E002": alertMsg = " ??? ????."; break;
- case "E003": alertMsg = " ???????."; break;
- case "E004": alertMsg = " ???? ????."; break;
- case "E005": alertMsg = " ???????."; break;
- case "E006": alertMsg = " ???????."; break;
- case "E007": alertMsg = " ?????."; break;
- case "E008": alertMsg = " ???."; break;
- case "E009": alertMsg = " ???????."; break;
- case "E010": alertMsg = " ??? ?????."; break;
- case "E011": alertMsg = " ??? ?????."; break;
- case "E012": alertMsg = " ??? ?????."; break;
- case "E013": alertMsg = " ???? ????."; break;
- case "E014": alertMsg = " ???? ????."; break;
- case "E015": alertMsg = " ????? ?????."; break;
- case "E016": alertMsg = " ???? ????."; break;
-
- case "Q001": alertMsg = " ?? ???????"; break;
- case "Q002": alertMsg = " ?? ???????"; break;
- case "Q003": alertMsg = " ?? ?????????"; break;
- case "Q004": alertMsg = " ?? ???????"; break;
- case "Q005": alertMsg = " ?? ???????"; break;
- case "Q006": alertMsg = " ?? ???????"; break;
- case "Q007": alertMsg = " ?? ???????"; break;
- case "Q008": alertMsg = " ?? ???????"; break;
- case "Q009": alertMsg = " ?? ???????"; break;
- case "Q010": alertMsg = " ??? ???????"; break;
- case "Q011": alertMsg = " ?? ???????"; break;
- case "Q012": alertMsg = " ?? ???????"; break;
-
- case "S001": alertMsg = " ???? ?(Yes)\n??? ???(No)? ??????."; break;
- case "S002": alertMsg = " ?????? ?(Yes)\n?????? ???(No)? ??????"; break;
- default : alertMsg = "";
- }
- if(pOptMsg == null || pOptMsg == ""){
- msgData = pMessage+alertMsg;
- }else{
- msgData = pMessage+alertMsg + "\n" + pOptMsg;
- }
- body.disabled = true;
- msgRtn = window.alert( msgData, msgTitle, msgType );
- body.disabled = false;
- return msgRtn;
- }
- // ??? ???? ?????
- function getUserId() {
- return getUserInfo("userid");
- }
- function getUserName() {
- return getUserInfo("usernm");
- }
- function getUserInfo(key) {
- if ( getGlobalVariable("userinfos") == "" ) {
- setDefaultUserInfo();
- }
- return getGlobalVariable(key);
- }
- function getUserInfos() {
- if ( getGlobalVariable("userinfos") == "" ) {
- setDefaultUserInfo();
- }
- return getGlobalVariable("userinfos");
- }
- function setDefaultUserInfo() {
- var userInfoKeyStr="userid|usernm|posinstcd|posinstnm|posdeptcd|posdeptnm|dutplceinstcd|dutplceinstnm|dutplcecd|dutplcenm|jobkindcd|jobkindnm|jobposcd|jobposnm|jobrespcd|jobrespnm|prfshipflagcd|prfshipflagnm|licnsno|specordyn|deptabbr|orddeptflag|wardflag|systemcd|systemnm|systeminstcd|systeminstnm|logindt|kmiip|kmiport|usergrp|ipaddr|dutinstcd|dutinstnm|dutunitcd|dutunitnm|mpphonno|orginstcd|orginstnm|orgdeptcd|orgdeptnm|userkindcd|ordsupdeptcd";
- var userInfoKeyArr = userInfoKeyStr.split("|");
- var userInfoStr = "";
- try {
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- var f = fso.GetFile("session.txt");
- var ts = f.OpenAsTextStream(1);
- userInfoStr = ts.ReadLine();
- ts.Close();
- } catch(e) {
- }
-
- var userInfoArr = userInfoStr.split("|");
- var len = userInfoKeyArr.length;
-
- setGlobalVariable("anonymous","true"); // ???????? ??????
- for(i=0;i<len;i++) {
- setGlobalVariable(userInfoKeyArr[i],userInfoArr[i]);
- }
- setGlobalVariable("userinfos", userInfoStr);
- }
- /*-------------------------------------------------------------------
- //?? ???? ?? ??
- ---------------------------------------------------------------------*/
- //?? ???? ????.
- function getPropertyName(key, bizCode){
- var bizName = "";
- var propertyName = "";
- if (bizCode == null || bizCode == "" || bizCode == "undefined")
- {
- bizName = "";
- }else{
- bizName = getBizName(bizCode)+"_";
- }
- return getSystemCd()+"_"+bizName+"gsv_"+key;
- }
- //????? ????.
- function setGlobalVariable(key, value, bizCode){
- model.property(getPropertyName(key, bizCode)) = value;
- return true;
- }
-
- //????? ????.
- function getGlobalVariable(key, bizCode){
- return model.property(getPropertyName(key, bizCode));
- }
- // ???? ?? ?? ??? ?? ??? ????.
- function getUserGroupList() {
- var usergrp = getUserInfo("usergrp");
- if (usergrp == null || usergrp == "") {
- return null;
- } else {
- return usergrp.split(",");
- }
- }
- // ???? ??? ?? ??? ??? ????? ??? ????.
- function checkUserGroup(grpname) {
- var usergrplist = getUserGroupList();
- if (usergrplist == null) {
- return false;
- }
- for(var i=0;i<usergrplist.length;i++) {
- if (grpname == usergrplist[i]) {
- return true;
- }
- }
- return false;
- }
- /*-------------------------------------------------------------------
- //???? ?? ??
- ---------------------------------------------------------------------*/
- /**
- * ???? key
- * pid : ????
- * pname : ???
- * age : ??(54/M)
- * addr : ??
- * insukind : ????
- * ininfo : ????
- * body : ??? ?
- * btype : ???
- * orddept : ???
- * apntdr : ???? - ???
- * attndr : ???? - ???
- * diagnosis : ???
- * operation : ????
- * allergy : ??? ??(Y^Y)
- * infection : ????(Y^Y^Y)
- * intncare : ??(Y)
- * cp : cp(Y)
- * addrdetl : ????
- * regstno : ????
- * telno : ????
- * zipcd : ????
- */
- function setPatientInfo(key, value) {
- var viewerObj = getViewer("patientInfo");
- if ( viewerObj != null){
- if ( key != "pid" && value.split("|")[0] == getPatientId()){
- return viewerObj.window.javascript.fSetPatientInfo(key, value.split("|")[1]);
- }else{
- return viewerObj.window.javascript.fSetPatientInfo(key, value);
- }
- }
- return false;
- }
- /**
- *???? ?? ??
- *value|value|value....
- */
- function setPatientInfos(values){
- var viewerObj = getViewer("patientInfo");
- if ( viewerObj != null ){
- return viewerObj.window.javascript.fSetPatientInfos(values);
- }
- return false;
- }
- //???? ??
- function delPatientInfos(){
- var viewerObj = getViewer("patientInfo");
- if ( viewerObj != null ){
- return viewerObj.window.javascript.fDelPatientInfos();
- }
- return false;
- }
- //???? ??
- function getPatientInfo(key) {
- var viewerObj = getViewer("patientInfo");
- if ( viewerObj != null ){
- return viewerObj.window.javascript.fGetPatientInfo(key);
- }
- return "";
- }
- //?????? ?? ??
- function getPatientInfos() {
- var viewerObj = getViewer("patientInfo");
- if ( viewerObj != null ){
- return viewerObj.window.javascript.fGetPatientInfos();
- }
- return "";
- }
- //???? ??
- function getPatientId() {
- var viewerObj = getViewer("patientInfo");
- if ( viewerObj != null ){
- return viewerObj.window.javascript.fGetPatientId();
- }
- return "";
- }
- //??? ??
- function getPatientName() {
- var viewerObj = getViewer("patientInfo");
- if ( viewerObj != null ){
- return viewerObj.window.javascript.fGetPatientName();
- }
- return "";
- }
- //????? ????.
- function setPatientFlag(value){
- var viewerObj = getViewer("patientInfo");
- if ( viewerObj != null){
- return viewerObj.window.javascript.fSetPatientFlag(value);
- }
- return false;
- }
- //????? ?? ????? ????.
- function setPatientInfoDetail(srcPath){
- var viewerObj = getViewer("patientInfo");
- var srcPath = instance1.selectSingleNode(srcPath);
- if ( viewerObj != null && srcPath != null){
- var destPath = viewerObj.window.javascript.fGetPatientInfoPath();
- if( destPath != ""){
- viewerObj.window.model.makeNode(destPath);
- viewerObj.window.model.copyNode(destPath, srcPath);
- return viewerObj.window.javascript.fCheckPatientId(destPath, "paminfo");
- }else{
- messageBox("?????","E014");
- }
- }
- return false;
- }
- //????? ?? ????? key? ???? value????.
- function getPatientInfoDetail(key) {
- var viewerObj = getViewer("patientInfo");
- if ( viewerObj != null ){
- return viewerObj.window.javascript.fGetPatientInfoDetail(key);
- }
- return "";
- }
- //????? ?? ???? ??? ????.
- //??? ??? ?? copy??.
- function getPatientInfoDetails(destPath) {
- var viewerObj = getViewer("patientInfo");
- var destPath = instance1.selectSingleNode(destPath);
- if ( viewerObj != null && destPath != null){
- srcPath = viewerObj.window.javascript.fGetPatientInfoPath();
- if(srcPath != ""){
- srcPath = viewerObj.window.instance1.selectSingleNode(srcPath);
- if(srcPath != null){
- model.copyNode(destPath, srcPath);
- return true;
- }
- }
- }
- return false;
- }
- //???? ????? ????.
- function setOperationInfo(srcPath){
- var viewerObj = getViewer("patientInfo");
- var srcPath = instance1.selectSingleNode(srcPath);
- if ( viewerObj != null && srcPath != null){
- viewerObj.window.model.makeNode(gvOperationInfoPath);
- viewerObj.window.model.copyNode(gvOperationInfoPath, srcPath);
- return viewerObj.window.javascript.fCheckPatientId(gvOperationInfoPath, "operation");
- }
- return false;
- }
- //key? ???? ???? ??? ????.
- function getOperationInfo(key){
- var viewerObj = getViewer("patientInfo");
- if ( viewerObj != null){
- return viewerObj.window.javascript.fGetOperationInfo(key);
- }
- return "";
- }
- //???? ??? ??? ??? ?? copyNode??.
- function getOperationInfos(destPath){
- var viewerObj = getViewer("patientInfo");
- var destPath = instance1.selectSingleNode(destPath);
- if ( viewerObj != null && destPath != null){
- var srcPath = viewerObj.window.instance1.selectSingleNode(gvOperationInfoPath);
- if(srcPath != null){
- model.copyNode(destPath, srcPath);
- return true;
- }
- }
- return false;
- }
- //???? ????? ????.
- function setConsultInfo(srcPath){
- var viewerObj = getViewer("patientInfo");
- var srcPath = instance1.selectSingleNode(srcPath);
- if ( viewerObj != null && srcPath != null){
- viewerObj.window.model.makeNode(gvConsultInfoPath);
- viewerObj.window.model.copyNode(gvConsultInfoPath, srcPath);
- return viewerObj.window.javascript.fCheckPatientId(gvConsultInfoPath, "consult");
- }
- return false;
- }
- //key? ???? ???? ??? ????.
- function getConsultInfo(key){
- var viewerObj = getViewer("patientInfo");
- if ( viewerObj != null){
- return viewerObj.window.javascript.fGetConsultInfo(key);
- }
- return "";
- }
- //???? ??? ??? ??? ?? copyNode??.
- function getConsultInfos(destPath) {
- var viewerObj = getViewer("patientInfo");
- var destPath = instance1.selectSingleNode(destPath);
- if ( viewerObj != null && destPath != null){
- var srcPath = viewerObj.window.instance1.selectSingleNode(gvConsultInfoPath);
- if(srcPath != null){
- model.copyNode(destPath, srcPath);
- return true;
- }
- }
- return false;
- }
- //??????? copyNode
- function getOrderBasicInfo(destPath){
- var viewerObj = getViewer("sysMessage");
- var destPath = instance1.selectSingleNode(destPath);
- if ( viewerObj != null && destPath != null){
- var srcPath = viewerObj.window.instance1.selectSingleNode(gvOrderBasicInfoPath);
- if(srcPath != null){
- model.copyNode(destPath, srcPath);
- return true;
- }
- }
- return false;
- }
- /*-------------------------------------------------------------------
- //??? ?? ?? ??
- ---------------------------------------------------------------------*/
- //???? ????.
- function exeReportPreview(rid, dataType, paramsXPath, submitId, print, printDialog, fileType, fileName, fileDialog, closeYn, monNo, parentObjId, printPaperBin, userService, showButton, printCount, zoomRate, printOption, dataXPath, mainDataXPath, subDataXPath)
- {
- var reportNode = instance1.selectSingleNode(gvReportPath);
- var syscd = getSystemCd();
- syscd = syscd.substr(3,3);
- if(syscd == "888" || syscd == "999" || syscd == "") syscd = "001";
- //??? ?? ?? ???
- if(reportNode != null){
- model.removeNodeset(gvReportPath);
- }
-
- model.makeNode(gvReportPath);
- model.makeNode(gvReportParamsPath);
- model.makeNode(gvReportPropsPath);
- model.makeNode(gvReportOptionsPath);
-
- paramsXPath = instance1.selectSingleNode(paramsXPath);
- if(paramsXPath != null){
- model.copyNode(gvReportParamsPath, paramsXPath);
- }
- model.makeValue(gvReportParamsPath+"/userid", getUserId());
- model.makeValue(gvReportParamsPath+"/logoimgurl", getImageURL("error_logo"+getLogoImageKey()));
- model.makeValue(gvReportParamsPath+"/url", rid);
- model.makeValue(gvReportPropsPath+"/rex_rptname", rid);
- model.makeValue(gvReportPropsPath+"/rex_datatype", dataType);
- model.makeValue(gvReportPropsPath+"/rex_submitid", submitId);
- model.makeValue(gvReportPropsPath+"/rex_userservice", userService);
- model.makeValue(gvReportPropsPath+"/rex_data_xpath", dataXPath);
- model.makeValue(gvReportPropsPath+"/rex_xpath", mainDataXPath);
- model.makeValue(gvReportPropsPath+"/rex_xpath1", subDataXPath);
- model.makeValue(gvReportOptionsPath+"/rex_print", print);
- model.makeValue(gvReportOptionsPath+"/rex_printdialog", printDialog);
- model.makeValue(gvReportOptionsPath+"/rex_printpaperbin", printPaperBin);
- model.makeValue(gvReportOptionsPath+"/rex_filetype", fileType);
- model.makeValue(gvReportOptionsPath+"/rex_filename", fileName);
- model.makeValue(gvReportOptionsPath+"/rex_filedialog", fileDialog);
- model.makeValue(gvReportOptionsPath+"/rex_close", closeYn);
- model.makeValue(gvReportOptionsPath+"/rex_showbutton", showButton);
- model.makeValue(gvReportOptionsPath+"/rex_printcount", printCount);
- model.makeValue(gvReportOptionsPath+"/rex_zoomrate", zoomRate);
- model.makeValue(gvReportOptionsPath+"/rex_printoption", printOption);
- if(parentObjId == null || parentObjId == ""){
- if(document.all("ivr_report") == null){
- //popup
- setParameter("onready","true");
- modal("SPZUR00100", monNo);
- }else{
- //iviewer
- ivr_report.window.javascript.fInitRexpert();
- }
- }else{
- var parentObj = document.all(parentObjId);
- if(parentObj != null){
- var childObj = document.all("ivr_"+parentObjId);
- if(childObj != null){
- childObj.window.javascript.fInitRexpert();
- }
- }
- }
- }
- //??? ???? Object? ????.
- function makeReportPreview(left, top, width, height, parentObjId){
- if(left==null || top==null || width==null || height==null){
- messageBox("???? ?????", "I004");
- }else{
- if(parentObjId == null || parentObjId == ""){
- if(document.all("ivr_report") == null){
- if(document.all("grp_biz") == null){
- body.createChild("xforms:iviewer", "id:ivr_report; src:../../../com/commonweb/xrw/SPZUR00100_???.xrw; left:"+left+"px; top:"+top+"px; width:"+width+"px; height:"+height+
- "px;");
- }else{
- grp_biz.createChild("xforms:iviewer", "id:ivr_report; src:../../../com/commonweb/xrw/SPZUR00100_???.xrw; left:"+left+"px; top:"+top+"px; width:"+width+"px; height:"+height+
- "px;");
- }
- }
- }else{
- var parentObj = document.all(parentObjId);
- if(parentObj != null){
- parentObj.createChild("xforms:iviewer", "id:ivr_"+parentObjId+"; src:../../../com/commonweb/xrw/SPZUR00100_???.xrw; left:"+left+"px; top:"+top+"px; width:"+width+"px; height:"+height+
- "px;");
- childObj = document.all("ivr_"+parentObjId);
- }
- }
- }
- }
- //?????? clear??.
- function resetReportPreview(parentObjId){
- if(parentObjId == null || parentObjId == ""){
- if(document.all("ivr_report") == null){
- var child = getChildWindow("SPZUR00100");
- if(child != null){
- child.javascript.fCloseReport();
- }
- }else{
- ivr_report.window.javascript.fCloseReport();
- }
- }else{
- var parentObj = document.all(parentObjId);
- if(parentObj != null){
- childObj = document.all("ivr_"+parentObjId);
- if(childObj != null){
- childObj.window.javascript.fCloseReport();
- }
- }
- }
- }
- //??? ????.
- function removeReportPreview(parentObjId){
- if(parentObjId == null || parentObjId == ""){
- if(document.all("ivr_report") != null){
- parentObjId = document.all("ivr_report").parent.attribute("id");
- document.all(parentObjId).removeChild("ivr_report");
- }
- }else{
- var parentObj = document.all(parentObjId);
- if(parentObj != null){
- parentObj.removeChild("ivr_"+parentObjId);
- }
- }
- }
- //??????
- function screenPrint(){
- modal("SPZUR00200");
- }
- //??? ??? url
- function getImageURL(imgcd){
- return getDomain()+"/himed/webapps/com/commonweb/images/"+imgcd+".gif";
- }
- //??? logo???
- function getLogoImageURL(syscd){
- return getImageURL("logo"+getLogoImageKey(syscd));
- }
- function getLogoImageKey(syscd){
- var imageKey = "";
- if(syscd == null || syscd == ""){
- syscd = getSystemCd();
- }
- if(syscd.toUpperCase() == "MIS001") {
- imageKey = getUserInfo("dutplceinstcd");
- }else{
- imageKey = syscd.substr(3,3);
- }
- if(!((imageKey >="011" && imageKey <= "018")|| imageKey == "103")){
- imageKey = "001";
- }
- return imageKey;
- }
- //loading ??
- function openLoadingBar(msg){
- setParameter("msg", msg);
- open("SPZZZ00400", "", "", "", "", "", "","width:327px; height:121px; caption:hidden; resize:false; align:center;");
- // open("SPZZZ00400", "", "", "", "SPZZZ00400", "/root/properties/loadingmsg", "/root/main/msg", "width:327px; height:121px; caption:hidden; align:center;" );
- }
- function closeLoadingBar(){
- var child = getChildWindow("SPZZZ00400");
- if(child != null) {
- child.close();
- }
- }
- //??? ???? ?? ?? ??
- function openPasswordValidate(titlemsg, helpMsg){
- setParameter("titlemsg", titlemsg);
- setParameter("helpmsg", helpMsg);
- modal("SPZUM00400", "", "", "", "", "", "","width:280px;height:270px;align:center;");
- return getParameter("pwdvalid");
- }
- //
- // Caching API
- //
- var gvCommonCachePath="/root/hidden/common/cache";
- // Cache?? itemname?? ??? ???? ??? resultref? ????.
- // ?? itemname?? ??? ???? true? ??? ??? ??? false? ????.
- // - itemname : cache?? ??? ??? ?? key
- // - resultref : cache? ??? ??? ??
- function copyFromCache(itemname,resultref) {
- var viewerObj = getViewer("sysMessage");
- if (viewerObj == null) {
- return false;
- }
-
- //itemnode = viewerObj.window.instance1.selectSingleNode(gvCommonCachePath+"/"+itemname);
- var srcPath = gvCommonCachePath+"/"+itemname;
- model.makeNode(resultref); // ??? resultref ?? ??
-
- // Cache ?? ?? ??
- var itemnode = viewerObj.window.instance1.selectSingleNode(srcPath);
- if (itemnode == null) {
- //alert("no cache");
- return false;
- } else {
- // ?? ?? ??
- var dueDate = itemnode.getAttribute("duedate");
- var curDate = (new Date()).valueOf();
- if (dueDate < curDate) { // ?? ?? ??
- //alert("obsolate");
- return false;
- }
- }
-
- // resultref ? ??
- model.copyNode(resultref,itemnode);
-
- return true;
-
-
- }
- // resultref ??? ???? ??? cache? ????.
- // - itemname : cache? ?? ??? ?? Key
- // - resultref : ?? ????? cache? ??
- // - ???? : ? (???? 10??)
- function storeIntoCache(itemname,resultref,duemin) {
- var viewerObj = getViewer("sysMessage");
- if (viewerObj == null) {
- return;
- }
- var destPath = gvCommonCachePath+"/"+itemname;
- viewerObj.window.model.makeNode(destPath); // ??? Cache ?? ??
-
- // resultref ?? ?? ??
- var itemnode = instance1.selectSingleNode(resultref);
-
- if (itemnode == null) {
- return;
- }
-
- // Cache? ??? ? ????? attribute? ??
- viewerObj.window.model.copyNode(destPath,itemnode);
- itemnode = viewerObj.window.instance1.selectSingleNode(destPath);
- if (itemnode != null) {
- var dueDate = (new Date()).valueOf();
- //alert(dueDate);
- if (duemin == null) {
- duemin = 600; // 10 hours
- }
- dueDate = dueDate + duemin*60*1000;
- //alert(dueDate);
- itemnode.setAttribute("duedate",dueDate);
- }
- }
|