var crfSetup={}; crfSetup.print= function(msg){ console.log(msg); } crfSetup.init= function(cb=null){ let fName="[crfSetup:init]"; this.print(fName); let that=this; let action=function(){that.afterScripts(cb);} LABKEY.requiresScript(["crfTecant/runQuery.js"],action); } crfSetup.afterScripts= function(cb=null){ if (cb) cb(); } crfSetup.setContainer= function(label,container){ if (!(this.hasOwnProperty('container'))){ this.container=new Array(); } this.container[label]=container; } crfSetup.getContainer= function(label){ return this.container[label]; } crfSetup.getSettings= function(variable){ if (variable in this.settings){ return this.settings[variable]; } return null; } crfSetup.getRows= function(objectName){ if (objectName in this) return this[objectName].rows; return new Array(); } crfSetup.getMaps= function(){ if (!("maps" in this)) this.maps=new Object(); return this.maps; } crfSetup.getEntryMaps= function(){ if (!("entryMaps" in this)) this.entryMaps=new Object(); return this.entryMaps; } crfSetup.getMap= function(queryName){ let maps=this.getMaps(); if (!(queryName in maps)) this.parseMap(queryName); return maps[queryName]; } crfSetup.getEntryMap= function(queryName){ let entryMaps=this.getEntryMaps(); if (!(queryName in entryMaps)) this.parseEntryMap(queryName); return entryMaps[queryName]; } crfSetup.setContainers= function(cb=null){ this.setContainer('data',LABKEY.ActionURL.getContainer()); this.setContainer('config',LABKEY.ActionURL.getContainer()); this.setContainer('CRF',LABKEY.ActionURL.getContainer()); let selectRows=new Object(); //this is local data selectRows.containerPath=this.getContainer('CRF'); selectRows.schemaName='lists'; selectRows.queryName='crfSettings'; //store form related data to this object let that=this; selectRows.success=function(data){that.parseSettings(data,cb);}; LABKEY.Query.selectRows(selectRows); } crfSetup.parseSettings= function(data,cb){ let fName="[parseSettings]"; this.settings=new Array(); for (let i=0;i0) columnModel+=','; columnModel+=varRows[i]['staticVariable']; } e.columns=columnModel; let that=this; //let action=function(){that.fcontinue();}; //let action=function(){that.parseQueryMap(cb);}; let action=cb; runQuery.getDataFromQueries(this,queryArray,action); } crfSetup.selectFormSetupRows= function(formId){ let formSetupRows=new Array(); let config=this.config; let allRows=this.getRows("formSetup"); for (let i=0;i