|
@@ -66,6 +66,50 @@ function(id,formId){
|
|
|
return pMap[id][formId];
|
|
|
}
|
|
|
|
|
|
+//not used (but implements an idea)
|
|
|
+participantPortal.getParticipantCRFEntryList=
|
|
|
+function(id){
|
|
|
+ let pMap=this.getParticipantMap();
|
|
|
+ if (!(id in pMap))
|
|
|
+ return new Array();
|
|
|
+ let idPMap=pMap[id];
|
|
|
+ let crfEntryList=new Array();
|
|
|
+ for (let formId in idPMap){
|
|
|
+ let arr=idPMap[formId];
|
|
|
+ for (let i=0;i<arr.length;i++){
|
|
|
+ entry=arr[i];
|
|
|
+ crfEntryList.push(entry);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return crfEntryList;
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+participantPortal.anyCrfInProgress=
|
|
|
+function(id){
|
|
|
+ //find out if any of crfs related to participant with id is in In Progress status
|
|
|
+ //count crfs in progress
|
|
|
+ let fName='[participantPortal.anyCrfInProgress '+id+']';
|
|
|
+ let pMap=this.getParticipantMap();
|
|
|
+ if (!(id in pMap)){
|
|
|
+ //this.print(fName+' not found');
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ let idPMap=pMap[id];
|
|
|
+ let count=0;
|
|
|
+ for (let formId in idPMap){
|
|
|
+ let arr=idPMap[formId];
|
|
|
+ //this.print(fName+' checking formId '+formId+'('+arr.length+')');
|
|
|
+ for (let i=0;i<arr.length;i++){
|
|
|
+ entry=arr[i];
|
|
|
+ //this.print(fName+' entry '+entry['entryId']+' status '+entry['FormStatus']);
|
|
|
+ if (entry['FormStatus']==1){
|
|
|
+ count+=1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return count;
|
|
|
+}
|
|
|
|
|
|
|
|
|
participantPortal.generateFormArray=
|
|
@@ -153,9 +197,14 @@ function(){
|
|
|
for (q in regMap){
|
|
|
let key=regMap[q]['Key'];
|
|
|
let label=crfSetup.getParticipantLabel(regMap[q]);
|
|
|
- this.print(fName+' key '+key+' label '+label+' site '+site);
|
|
|
+ let crfInProgress=this.anyCrfInProgress(label);
|
|
|
+ this.print(fName+' key '+key+' label '+label+' site '+site+' in progress: '+crfInProgress);
|
|
|
+
|
|
|
this.addToKeyMap(key,label);
|
|
|
if (site && regMap[q]['site']!=site) continue;
|
|
|
+ if (crfInProgress>0){
|
|
|
+ label='*'+label;
|
|
|
+ }
|
|
|
updatedMap[key]=label;
|
|
|
}
|
|
|
updatedMap[1000]='NONE';
|
|
@@ -188,9 +237,12 @@ function(){
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
//let selectId=crfSetup.getStudyId(selectIdText);
|
|
|
- let selectId=selectIdText;
|
|
|
+ //drop trailing *
|
|
|
+ let selectId=selectIdText.replace('*','');
|
|
|
+
|
|
|
+
|
|
|
//let formId=formIds[Object.keys(formIds)[0]];
|
|
|
//this.printParticipantArray();
|
|
|
this.print(fName+' rows '+this.displayTable.rows.length);
|