|
@@ -1487,7 +1487,7 @@ function populateTable(listName,writeMode,setup){
|
|
|
|
|
|
function getHelpVar(queryName,code,setup){
|
|
|
let fName='[getHelpVar('+code+')]';
|
|
|
-
|
|
|
+ print(fName);
|
|
|
let subs=code.match(/_[^_]*_/g);
|
|
|
if (!subs){
|
|
|
print(fName+' no match for '+code);
|
|
@@ -1519,6 +1519,11 @@ function getHelpVar(queryName,code,setup){
|
|
|
value=setup.setVariables[vField];
|
|
|
}
|
|
|
else{
|
|
|
+ //robustify
|
|
|
+ if (config.formConfig.dataQueries[query].rows.length==0){
|
|
|
+ print(fName+' returning INVALID');
|
|
|
+ return "INVALID";
|
|
|
+ }
|
|
|
value=config.formConfig.dataQueries[query].rows[0][vField];
|
|
|
}
|
|
|
if (lField==undefined){
|
|
@@ -1547,7 +1552,7 @@ function getHelpVar(queryName,code,setup){
|
|
|
for (let x in rpc){
|
|
|
code=code.replace(x,rpc[x]);
|
|
|
}
|
|
|
- print('Returning '+code);
|
|
|
+ print(fName+' returning '+code);
|
|
|
return code;
|
|
|
}
|
|
|
|
|
@@ -1594,18 +1599,22 @@ function populateHelp(listName,helpRows,setup){
|
|
|
let fName='[populateHelp]';
|
|
|
for (let i=0; i<helpRows.length; i++){
|
|
|
let eh=helpRows[i];
|
|
|
+ let id=setup.sectionId+'_help'+eh.setup['Key']
|
|
|
+ let el=config.document.getElementById(id);
|
|
|
let lookup=eh.field['lookup'];
|
|
|
let qName=lookup.queryName;
|
|
|
let tLookup=config.formConfig.lookup[qName];
|
|
|
let varName=getHelpVar(listName,eh.setup['fieldDescriptor'],setup);
|
|
|
+ if (varName=="INVALID"){
|
|
|
+ el.value="Please select patient/timepoint";
|
|
|
+ continue;
|
|
|
+ }
|
|
|
let text="";
|
|
|
for (let j=0;j<tLookup.rows.length;j++){
|
|
|
print(tLookup.rows[j][tLookup.keyColumn]+' '+tLookup.rows[j][tLookup.displayColumn]+
|
|
|
' '+tLookup.rows[j][varName]);
|
|
|
text+=tLookup.rows[j][tLookup.displayColumn]+" - "+tLookup.rows[j][varName]+"\n";
|
|
|
}
|
|
|
- let id=setup.sectionId+'_help'+eh.setup['Key']
|
|
|
- let el=config.document.getElementById(id);
|
|
|
print(fName+' setting '+id+': '+el);
|
|
|
el.value=text;
|
|
|
}
|
|
@@ -3200,7 +3209,7 @@ function setFormConfig(){
|
|
|
//add object to store form related data
|
|
|
config.formConfig=new Object();
|
|
|
|
|
|
- config.formConfig.softwareVersion='0.15.06';
|
|
|
+ config.formConfig.softwareVersion='0.15.07';
|
|
|
let debug=true;
|
|
|
|
|
|
if (debug)
|