All Downloads are FREE. Search and download functionalities are using the official Maven repository.

webclient.js-i2b2.hive..hive_helpers.js.swp Maven / Gradle / Ivy

Go to download

Standalone service to to run the AKTIN broker and aggregator together with an i2b2 query frontend.

The newest version!
b0VIM 7.3?V?T??
mem61Mikes-MacBook-Pro-2.local~mem61/appdev/webclient/js-i2b2/hive/hive_helpers.jsutf-8
3210#"! Utp	$L)?oZ?gNe?	x
}?&adH
?
$????SB???uWVU(?
d
????i51!????U.?
?
?
?
?
t
q
U
?	?	?	?	d	D			????u\Y$????yuX??????????z:'$??I>?????hd???>?????q_\JGF?i2b2.h.getXNodeVal = function(xmlElement, nodeName, includeChildren) {};	return retArray;	}		console.dir(e);		console.error("An error occurred while trying to perform XPath query.");	} catch (e) {		}			}				rec = nodes.iterateNext();				retArray.push(rec);			while (rec) {			var rec = nodes.iterateNext();			var nodes = ownerDoc.evaluate(xPath, xmlDoc, null, XPathResult.ANY_TYPE, null);			if (!ownerDoc) {ownerDoc = xmlDoc; }			var ownerDoc = xmlDoc.ownerDocument;			// W3C XPath implementation (Internet standard)		else if (document.implementation && document.implementation.createDocument) {		}			retArray = xmlDoc.selectNodes(xPath);			} 				} catch(e) {}					xmlDoc.ownerDocument.setProperty("SelectionLanguage", "XPath");				try {			} catch(e) {				xmlDoc.setProperty("SelectionLanguage", "XPath");			try {  			// HACK: setProperty attempts execution when placed in IF statements' test condition, forced to use try-catch			// Microsoft's XPath implementation		if (window.ActiveXObject  || "ActiveXObject" in window) {	try {	}		return retArray;		console.warn("An invalid XMLDoc was passed to i2b2.h.XPath");	if (!xmlDoc) { 	var retArray = [];i2b2.h.XPath = function(xmlDoc, xPath) {};	return xmlDocRet;	*/	}		}			console.error(e.message)		catch (e) {		} 			xmlDocRet = parser.parseFromString(xmlString, "text/xml");			parser = new DOMParser();		{		try //Firefox, Mozilla, Opera, etc.	catch (e) {	} 		xmlDocRet.setProperty("SelectionLanguage", "XPath");		xmlDocRet.loadXML(xmlString);		xmlDocRet.async = "false";		xmlDocRet = new ActiveXObject("Microsoft.XMLDOM");	{	try //Internet Explorer	/* oring	*/	}		xmlDocRet = parser.parseFromString(xmlString, "text/xml");		parser = new DOMParser();		//Firefox, Mozilla, Opera, etc.	} else {		//xmlDocRet.setProperty("SelectionLanguage", "XPath");		xmlDocRet.loadXML(xmlString);		xmlDocRet.async = "false";		xmlDocRet = new ActiveXObject("Microsoft.XMLDOM");		//Internet Explorer	if (isActiveXSupported) {	//if (typeof window.ActiveXObject != "undefined")  && new window.ActiveXObject("Microsoft.XMLDOM")) {  		tr	}		xmlDocRet = new ActiveX	}	}		xmlDocRet = new ActiveXObject("	}		xmlDocRet = new ActiveXObject("	}		xmlDocRet = new ActiveXObject("Microsoft.XMLHTTP	}	var isActiveXSupported = false;	var xmlDocRet = false;i2b2.h.parseXml = function(xmlString){// ================================================================================================== //delete i2b2.protoObjhack;Object.isUndefined = i2b2.protoObjhack();});	return newFunction;	};		return false;		}			if (origFunction(arguments[i])) { return true; }		for(var i=0; i helpers'); */ * updated 9-15-08: RC4 launch [Nick Benik]  * ---------------------------------------------------------------------------------------- * @version 	1.3 * @author		Nick Benik, Griffin Weber MD PhD * @namespace	i2b2 * @inherits 	i2b2 * @projectDescription	Various helper functions used by the i2b2 framework and cells./**ad?n&????ncVK???????J?
?
?
?
`
[
8

?????????nmconsole.groupEnd();console.timeEnd('execute time');}	return sniffPackage;	sniffPackage.SignalOrigin = signalOrigin;	sniffPackage.CommDetails = results;	sniffPackage.CellAction = cellFuncName;	sniffPackage.CellName = cellName;//	}//		sniffPackage.ViewName = viewName;//	if (undefined == viewName) {	var sniffPackage = new i2b2_CellCommPackage();	function i2b2_CellCommPackage() {}//i2b2.h.BuildSniffPack = function(viewName, cellName, cellFuncName, results) {i2b2.h.BuildSniffPack = function(cellName, cellFuncName, results, signalOrigin) {// helper function to build a sniffer package for Cell Communications events}	}		return x.xml;	catch (e) {	}		}			return 'Browser not supported yet. (Try Firefox)';		} else {			return s;		if (s) {		var s = xmlSerializer.serializeToString(x);		xmlSerializer = new XMLSerializer();	try {	var xmlSerializer;i2b2.h.Xml2String = function(x) {ad?1L??????t;1?
?
?
?
?
?
?
V
9

??????LG9???????lYVO?
{
p
:
*
 
?	?	?	?	?	F		??pN=%?????|yx1+i2b2i2i2b2.h.getXNodeVal = function(xmlElement, nodeName, includeChildren) {};	return retArray;	}		console.dir(e);		console.error("An error occurred while trying to perform XPath query.");	} catch (e) {		}			}				rec = nodes.iterateNext();				retArray.push(rec);			while (rec) {			var rec = nodes.iterateNext();			var nodes = ownerDoc.evaluate(xPath, xmlDoc, null, XPathResult.ANY_TYPE, null);			if (!ownerDoc) {ownerDoc = xmlDoc; }			var ownerDoc = xmlDoc.ownerDocument;			// W3C XPath implementation (Internet standard)		else if (document.implementation && document.implementation.createDocument) {		}			retArray = xmlDoc.selectNodes(xPath);			} 				} catch(e) {}					xmlDoc.ownerDocument.setProperty("SelectionLanguage", "XPath");				try {			} catch(e) {				xmlDoc.setProperty("SelectionLanguage", "XPath");			try {  			// HACK: setProperty attempts execution when placed in IF statements' test condition, forced to use try-catch			// Microsoft's XPath implementation		if (window.ActiveXObject  || "ActiveXObject" in window) {	try {	}		return retArray;		console.warn("An invalid XMLDoc was passed to i2b2.h.XPath");	if (!xmlDoc) { 	var retArray = [];i2b2.h.XPath = function(xmlDoc, xPath) {};	return xmlDocRet;	*/	}		}			console.error(e.message)		catch (e) {		} 			xmlDocRet = parser.parseFromString(xmlString, "text/xml");			parser = new DOMParser();		{		try //Firefox, Mozilla, Opera, etc.	catch (e) {	} 		xmlDocRet.setProperty("SelectionLanguage", "XPath");		xmlDocRet.loadXML(xmlString);		xmlDocRet.async = "false";		xmlDocRet = new ActiveXObject("Microsoft.XMLDOM");	{	try //Internet Explorer	/* oring		}		xmlDocRet = parser.parseFromString(xmlString, "text/xml");		parser = new DOMParser();		//Firefox, Mozilla, Opera, etc.	} else {		//xmlDocRet.setProperty("SelectionLanguage", "XPath");		xmlDocRet.loadXML(xmlString);		xmlDocRet.async = "false";		xmlDocRet = new ActiveXObject("Microsoft.XMLDOM");		//Internet Explorer	if (isActiveXSupported) {	//if (typeof window.ActiveXObject != "undefined")  && new window.ActiveXObject("Microsoft.XMLDOM")) {  		try { new ActiveXObject ("MSXML2.DOMDocument.6.0"); isActiveXSupported =  true; } catch (e) { isActiveXSupported =  false; }ad7????F????????xufdc/?
?
?
?
?
b
W
L
3
????vkgdURQP????pQ,?
?
?
?
d
U

?	?	?	w	[	X	<		??????olF&??QNML%??????rTIFE???????I#
???????k*&# ?????iP9!wbD76		mn.show();//		mn.style.cursor = 'wait';		mn.zindex = 50000;		mn.innerHTML = "

LOADING

"; mn.style.height=h-10; mn.style.width=w-10; var mn = $('topMask'); if (h < 517) {h = 517;} if (w < 840) {w = 840;} var h = sz.height; var w = sz.width; var sz = document.viewport.getDimensions(); show: function() {i2b2.h.LoadingMask = {}; } } refTemplateVals[vname] = this.Escape(refTemplateVals[vname]); // escaping value if (!ignore) { } } break; ignore = true; if (vname == arryIgnoreVars[i]) { for (var i=0; i"); var t = new String(inStrValue);i2b2.h.Unescape = function(inStrValue) {}; return t; t = t.replace(/>/g, ">"); t = t.replace(/ 30 && diff > 0) { hourdifference--; } if (minute != minuteUTC && minuteUTC < 30 && diff < 0) { hourdifference--; } var timezone; var second = inDate.getSeconds(); var minutedifference; var minuteUTC = inDate.getUTCMinutes(); var minute = inDate.getMinutes(); var hourdifference = Math.abs(diff); var diff = hour - hourUTC; var hourUTC = inDate.getUTCHours(); var hour = inDate.getHours(); var day = inDate.getDate(); var month = inDate.getMonth() + 1; if (year < 2000) year = year + 1900; var year = inDate.getYear(); if (!inDate) { inDate = new Date(); }i2b2.h.GenerateISO8601DateTime = function(inDate) {}; return retId; } } break; retId += String.fromCharCode(Math.floor(Math.random() * 26)+97); // lower case letter case 2: break; retId += String.fromCharCode(Math.floor(Math.random() * 26)+65); // upper case letter case 1: break; retId += Math.floor(Math.random() * 10).toString(); // add a number case 0: switch(Math.floor(Math.random() * 3)) { IdLen++; while (IdLen <= ReqIdLength) { var retId = ""; var IdLen = 0;i2b2.h.GenerateAlphaNumId = function(ReqIdLength) {} return final; } final = undefined; } else { } } final += gotten[i].nodeValue; for (var i=0; i 0) { var final = ""; var gotten = i2b2.h.XPath(xmlElement, "descendant-or-self::"+nodeName+"/text()");ad$?Z??????????$ ???}K&? ? ? j  ? h  ? ? 3 - ? i c . ? ? ? Z  ???wdV ???HB<8 ????kQ"?je???C? ???uL0??^*???? contextJoin: function(sContextName) { }, return this._createContextProxy(cl_JoinMutextRef); cl_JoinMutextRef.openThreads++; var cl_JoinMutextRef = this._contexts[validName]; // add ourselves to the thread count this._contexts[validName] = new JoiningMutexContext(validName, fZeroRunFunction, bSingleRun); var bSingleRun = Boolean.parseTo(bSingleRun); } this.active = true; this.executionCount = 0; this.executeOnce = inSingleExecution; this.openThreads = 0; this.callbackFinished = inFinishFunction; this.name = inName; function JoiningMutexContext(inName, inFinishFunction, inSingleExecution) { // create new context object } return {error: true, errorObj: e, errorMsg: 'an error occurred within JoiningMutex.contextCreate()'}; } catch(e) { delete this._contexts[validName]; this._contexts[validName] = true; // verify that the name can be used as an object identifier (with throw an error if invalid) } return {error: true, errorObj: undefined, errorMsg: 'JoiningMutex.contextCreate() failed because the giving context name already exists'}; if (this._contexts[validName]) { } validName = "AUTOGEN-"+this._contextGenID; this._contextGenID++; if (!validName) { try { var validName = sContextName; // make sure context is new contextCreate: function(sContextName, fZeroRunFunction, bSingleRun) { }, return new JoiningMutexContextProxy; } }; } return {error: true, errorObj: undefined, errorMsg: 'JoiningMutexProxy.ThreadFinished() failed because there are no outstanding thread executions'}; } else { } return false; // everything is OK but there are still outstanding threads to finish } else { return true; this._JoiningMutexContext.callbackFinished(); this._JoiningMutexContext.executionCount++; } this._JoiningMutexContext.active = false; // this is going to be our only run of the callback function if (this._JoiningMutexContext.executeOnce) { // all threads finished if (this._JoiningMutexContext.openThreads == 0) { this._alreadyRun = true; this._JoiningMutexContext.openThreads--; if (this._JoiningMutexContext.openThreads > 0) { } return {error: true, errorObj: undefined, errorMsg: 'JoiningMutexProxy.ThreadFinished() failed because the MutexProxy has already been run'}; if (this._JoiningMutexContext._alreadyRun) { } return {error: true, errorObj: undefined, errorMsg: 'JoiningMutexProxy.ThreadFinished() failed because the giving context is no longer active'}; if (!this._JoiningMutexContext.active) { this.ThreadFinished = function() { this.isActive = function() { return this._JoiningMutexContext.active; }; this.executionCount = function() { return this._JoiningMutexContext.executionCount; }; this.executeOnce = function() { return this._JoiningMutexContext.executeOnce; }; this.openThreads = function() { return this._JoiningMutexContext.openThreads; }; this.name = function() { return this._JoiningMutexContext.name; }; this._alreadyRun = false; this._JoiningMutexContext = cl_JoinMutextRef; function JoiningMutexContextProxy() { var cl_JoinMutextRef = contextRef; // and route actions to the JoinMutex singleton // create a proxy object (via closure) to encapsulate data _createContextProxy: function(contextRef) { _contextGenID: 0, _contexts: {},i2b2.h.JoiningMutex = { // created this object to allow the joining of forked execution paths (Waiting for Multiple AJAX calls)}; } mn.hide(); mn.innerHTML=''; var mn = $('topMask'); // hide the loading mask hide: function() { },adMg??? ???^Z? ? ? D 9   ? ? ? ? | q < ? ? V .      ? ?  i I '  ? ? ? ? ? ? ? ? ? X & ????qj@ ????|U2/.???^4'%$#?e??W1 ?????B??rW: closure_Counter++; var prevID = closure_Counter; function closure_nextID() { var closure_Counter = 0 ;i2b2.GUID = (function() {// ================================================================================================== //// is not accessable from other calls... Let the scope-chain bending begin!// The closure counter gets wrapped into a private "bubble" within the JsVM that// This is a special closure-based function to return a unique ID every time called.} return (inputValue==true); } return /\btrue/i.match(inputValue); if (typeof inputValue == "string") {Boolean.parseTo = function(inputValue) {Object.isBoolean = function(testObj) { return YAHOO.lang.isBoolean(testObj); }Object.isNull = function(testObj) { return YAHOO.lang.isNull(testObj); }Object.isObject = function(testObj) { return YAHOO.lang.isObject(testObj); }// ================================================================================================== //// wrap YUI functions into the JS Object constructor to augment Protype-JS functions} return num; if (pad > 0 ) num = "0".repeat(pad)+num; var pad = req_digits - num.length; num = parseInt(num, 10)+"";function padNumber(num, req_digits) {// ================================================================================================== //}; return new Array(l+1).join(this);String.prototype.repeat = function(l){// ================================================================================================== //// Extend JS Objects } } return true; } catch (e) { return Object.isUndefined(t); var t = eval("("+sObjectHierarchy+")"); try {i2b2.h.isBadObjPath = function(sObjectHierarchy) {); }) if (!i2b2.h.allowAnalysis()) { $('allowAnalysis').hide(); } // remove the analysis link if configuration tells us to i2b2.h.debugElements(document.documentElement); // remove debugging functionality from GUI (function(en,co,a) {i2b2.events.afterLogin.subscribe(} } } tns[i].hide(); } else { tns[i].show(); if (sflg) { for (var i=0; i data structure mismatches // This is an enhanced version which overrides the default function within theYAHOO.widget.TreeView.getNode = function(treeId, nodeIndex) {YAHOO.widget.TreeView.getNode_orig = YAHOO.widget.TreeView.getNode;} return tree; } while (!isDone) } isDone = true; } else { tdiv = tdiv.parentNode; if (tdiv.parentNode) { } if (tree) { isDone = true; } var tree = this.getTree(tdiv.id); if (tdiv.id) { do { if (!tdiv) { return undefined; } var tdiv = $(divChild); var isDone = false; var parentNode;YAHOO.widget.TreeView.findTreeByChildDiv = function(divChild) {// ================================================================================================== //// Extend the YAHOO.widget.TreeView object} return undefined; } if (arr && arr.length == 2) { return arr[1]; } var arr = obj.constructor.toString().match(/function\s*(\w+)/); if (obj && obj.constructor && obj.constructor.toString) {function getObjectClass(obj) {Object.getClass = getObjectClass;// ================================================================================================== //// only on objects that match a specific type// function needed to perform processing function parseBoolean(inputStr) { return /\btrue/i.match(inputStr); }// ================================================================================================== //// Global helper functions })(); return (function() { return closure_nextID(); }); } return closure_Counter; if (prevID > closure_Counter) console.error("[i2b2.GUID function's internal counter encountered an overflow!!!]");ad x???RM=:9???vqa^]D? ? ? { x : ? ? s r d b a ` _  ? ? u Z ; + '  ? ? ? ? C  ? ? ? ? t _ J ! ?????d4 ?????wXQK???????)???e@('?????UT ????pcXKGDC????C   aOverlays[aOverlays.length] = p_oElement.parentNode; if (Panel && Dom.hasClass(p_oElement, Panel.CSS_PANEL)) { if (oOverlay && !Dom.isAncestor(oElement, oOverlay)) { Panel = YAHOO.widget.Panel; var oOverlay = Dom.hasClass(p_oElement, Overlay.CSS_OVERLAY), function isOverlayElement(p_oElement) { } } return 0; } else { return 1; } else if (nZIndex1 < nZIndex2) { return -1; if (nZIndex1 > nZIndex2) { nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 0 : parseInt(sZIndex2, 10); nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 0 : parseInt(sZIndex1, 10), sZIndex2 = Dom.getStyle(p_oOverlay2, "zIndex"), var sZIndex1 = Dom.getStyle(p_oOverlay1, "zIndex"), function compareZIndexDesc(p_oOverlay1, p_oOverlay2) { oElement = this.element; var aOverlays = [], var Lang = YAHOO.lang; var Overlay = YAHOO.widget.Overlay; var Dom = YAHOO.util.Dom;i2b2.bugfix1.prototype.bringToTop = function() {i2b2.bugfix1 = function () {};// to modal forms during initial creation. TODO: REMOVE THIS WHEN YAHOO FIXES THIS BUG!// Patch a bug in the YUI overlay subsystem which ignores/destroys zIndex parameter given // ================================================================================================== //} } } } catch(e) { console.warn("Error while reattaching DD handlers: "+e.message); } } } t.isTarget = ddTargeted; t.groups = Object.clone(ddGrps); t.init(ddId); t._domRef = fEl; if (t._domRef != fEl) { // reattach } else { } t.unreg(); t._domRef = null; // only after the DD has been initialized // remove DD for non-existent HTML elements and if (t.available) { if (!fEl) { var fEl = $(el); var ddTargeted = t.isTarget; var ddCfg = Object.clone(t.config); var ddGrps = Object.clone(t.groups); var ddId = t.id; // copy the info var t = YAHOO.util.DDM.ids[grps][el]; try { for (var el in YAHOO.util.DDM.ids[grps]) { // interaction groups for (var grps in YAHOO.util.DDM.ids) {YAHOO.util.DDM.reattachHandlers = function() {// gotten detached and have (newer copies of) their elements in the visible DOM tree// this function is a very clever hack to reattach all YUI drag & drop handlers which have} return false; } thisNode = thisNode.parent; } return true; if (thisNode == srchNode) { while (thisNode.parent) { if (!srchNode) { return undefined; } var thisNode = this; // is the current node a descendant of srchNode? Used to prevent parents being dragged into its child nodes.YAHOO.widget.Node.prototype.isDescendant = function(srchNode) {} return true; objTree.setDynamicLoad(i2b2.CRC.ctrlr.QT._loadTreeDataForNode,1); // reattach the dynamic load event if it was lost recursiveTreePopulate(objTree._nodes, objTree.root, recursiveTreePopulate); //recursiveSetTree(objTree, objTree.root, recursiveSetTree); } obRootNode.children[i].applyParent(obRootNode); for (var i=0; i #   ? ? ? [ V R O L 0 ? ? ? ? ? ? ? ? ? ? "  ? ? ? ? ? ? ? H F E ????{o@?????sD ??????;/* ???m????/#????~]QI(????????21// ================================================================================================== //} } break; alert("captured "+c+" :: "+r+" :: "+t); } return; i2b2.hive.MsgSniffer.showStack("PM Admin", ["PM:Admin"]); if (c=="PM" && r=="Admin") { } return; i2b2.hive.MsgSniffer.show(); if (c=="PLUGINMGR" && r=="PlugView") { } return; i2b2.hive.MsgSniffer.showStack("Query Tool", ["CRC:QueryTool"]); if (c=="CRC" && r=="QT") { } return; i2b2.hive.MsgSniffer.showStack("History", ["CRC:History", "CRC:SDX:QueryMaster", "CRC:SDX:QueryInstance", "CRC:SDX:PatientRecordSet"], ["CRC"]); if (c=="CRC" && r=="history") { } return; i2b2.hive.MsgSniffer.showStack("Ontology Search", ["ONT:SDX:Concept","ONT:FindBy","ONT:generalView"], ["ONT"]); if (c=="ONT" && r=="find") { } return; i2b2.hive.MsgSniffer.showStack("Ontology Navigation", ["ONT:SDX:Concept","ONT:generalView"], ["ONT"]); if (c=="ONT" && r=="nav") { } return; i2b2.hive.MsgSniffer.showStack("Workplace", ["WORK:Workplace"], ["WORK"]); if (c=="WORK" && r=="main") { case "Stack": break; i2b2.hive.MsgSniffer.showSingleMsgResponse(s); } s = ''; } else { s = s.replace(new RegExp('>','g'),'>'); s = s.replace(new RegExp('<','g'),'<'); if (s) { var s = i2b2[c].view[r]['query'+t]; case "Response": break; i2b2.hive.MsgSniffer.showSingleMsgRequest(s); } s = ''; } else { s = s.replace(new RegExp('>','g'),'>'); s = s.replace(new RegExp('<','g'),'<'); if (s) { var s = i2b2[c].view[r]['query'+t]; case "Request": switch (t) {function showXML(c,r,t) {// ================================================================================================== //} console.error('getHtmlText(): no innerText or textContent.'); } } return node.textContent; if (node.textContent) { } else { return node.innerText; if (node.innerText) { // IE;function getHtmlText(node) {// ================================================================================================== //// AJAX/XMLsetTimeout('i2b2.bugfix2()',200);}; delete i2b2.bugfix2; delete i2b2.bugfix1; YAHOO.lang.augmentProto(YAHOO.widget.Overlay, i2b2.bugfix1, true);i2b2.bugfix2 = function() {}; } } } this.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2)); if (bRequiresBump) { // = any zIndex given in the initial creation settings> } } bRequiresBump = true; nTopZIndex = this.cfg.config.zindex.value; if (parseInt(this.cfg.config.zindex.value, 10) >= parseInt(nTopZIndex,10)) { if (!Lang.isUndefined(this.cfg.config.zindex)) { // = any zIndex given in the initial creation settings> } } bRequiresBump = true; if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) { // Don't rely on DOM order to stack if 2 overlays are at the same zindex. var nNextZIndex = Dom.getStyle(aOverlays[1], "zIndex"); } else if (aOverlays.length > 1) { bRequiresBump = true; if (oTopOverlay != oElement) { var bRequiresBump = false; if (!isNaN(nTopZIndex)) { nTopZIndex = Dom.getStyle(oTopOverlay, "zIndex"); if (oTopOverlay) { nTopZIndex; var oTopOverlay = aOverlays[0], aOverlays.sort(compareZIndexDesc); Dom.getElementsBy(isOverlayElement, "DIV", document.body); } } } aOverlays[aOverlays.length] = p_oElement; } else {




© 2015 - 2025 Weber Informatics LLC | Privacy Policy