//all functions are based off of participantManager (print, config, etc.) var participantIdManager={}; participantIdManager.print= function(msg){ console.log(msg); } participantIdManager.init= function(cb=null){ let that=this; let action=function(){that.afterScripts(cb);}; LABKEY.requiresScript(['crf/crfHTML.js','crf/generateRegistration.js'],action); } participantIdManager.afterScripts= function(cb=null){ crfHTML.init(); generateRegistration.init(cb); } participantIdManager.set= function(setup,data){ this.setup=setup; this.data=data; this.updateCrfEntry=function(){;} this.mode='STUDY'; //this.generateTable(); if (!("readonly" in this)){ this.readonly=new Object(); this.readonly['LOCAL']=false; this.readonly['STUDY']=false; } } participantIdManager.setMode= function(mode){ this.mode=mode; } participantIdManager.getMode= function(){ return this.mode; } participantIdManager.setReadonly= function(mode){ if (mode=="LOCAL"){ this.readonly[mode]=true; return; } this.readonly['STUDY']=true; } participantIdManager.clearReadonly= function(mode){ if (mode=='LOCAL'){ this.readonly[mode]=false; return; } this.readonly['STUDY']=false; } participantIdManager.isReadonly= function(mode){ if (mode=='LOCAL') return this.readonly['LOCAL']; return this.readonly['STUDY']; } participantIdManager.addSelectOptions= function(mode=null){ if (mode=="LOCAL") return; let input=this.getInputElement(mode); let fName='addParticipantSelectOptions'; this.print(fName+' input '+input); //here the lookup is being populated (registrationData) let demoRows=this.setup.getRows('registrationData'); this.print(fName+" demoRows: "+demoRows.length); let opts=new Object(); for (let i=0;i