Browse Source

Modifying code for reports

tomcat8 @ merlin 3 years ago
parent
commit
37b07fbd5b

+ 1 - 0
views/formPortal.html

@@ -38,6 +38,7 @@ function init(){
 	config.div="formDiv";
 	config.debugArea="formStatus";
 	print(config,"Starting");
+	config.participantField="PatientId";
 	generateFormArray(config);
 }
 </script>

+ 20 - 8
views/review.html

@@ -1,25 +1,35 @@
 <h3>Title</h3>
 
-
-<p id="participantCode">Loading1b</p>
-<p id="visitCode">Loading2</p>
+<table>
+<tr>
+<th id="participantField">patientCode</th>
+<td id="participantCode">Loading1b</td>
+</tr>
+<tr>
+<th id="visitField">visitCode</th>
+<td id="visitCode">Loading2</td>
+</tr>
+</table>
 
 <div id="organ3">
 	<table>
 	<tr>
 		<td id="CT_organ3"></td>
 		<td id="PET_organ3"></td>
-		<td id="SUV_organ3"></td>
+		<td id="SUVall_organ3"></td>
+		<td id="SUVparticipant_organ3"></td>
 	</tr>
 	<tr>
 		<td id="CT_organ4"></td>
 		<td id="PET_organ4"></td>
-		<td id="SUV_organ4"></td>
+		<td id="SUVall_organ4"></td>
+		<td id="SUVparticipant_organ4"></td>
 	</tr>
 	<tr>
 		<td id="CT_organ5"></td>
 		<td id="PET_organ5"></td>
-		<td id="SUV_organ5"></td>
+		<td id="SUVall_organ5"></td>
+		<td id="SUVparticipant_organ5"></td>
 	</tr>
 	</table>
 </div>
@@ -39,7 +49,7 @@ document.getElementById("visitCode").innerHTML=visitCode;
 let project=LABKEY.ActionURL.getContainer();
 document.getElementById("debugCode").value+='\n'+project;
 
-let server="http://onko-nix.onko-i.si:8080/labkey";
+let server="https://merlin.fmf.uni-lj.si/labkey";
 let basePath=server+"/_webdav/";
 basePath+=project;
 basePath+="/@files/preprocessedImages/";
@@ -70,7 +80,9 @@ for (let i=0;i<organs.length;i++){
 	document.getElementById(type+"_organ"+organ).appendChild(img1);
 }
 LABKEY.requiresScript('/vis/genericChart/genericChartHelper.js', 
-      function(){LABKEY.vis.GenericChartHelper.loadVisDependencies(dependencyCallback);});
+      function(){LABKEY.vis.GenericChartHelper.loadVisDependencies(plotAll);});
+LABKEY.requiresScript('/vis/genericChart/genericChartHelper.js', 
+      function(){LABKEY.vis.GenericChartHelper.loadVisDependencies(plotParticipant);});
 
 
 </script>

+ 5 - 57
views/reviewMP.html

@@ -11,28 +11,7 @@
 </tr>
 </table>
 
-<div id="organ3">
-	<table>
-	<tr>
-		<td id="CT_organ3"></td>
-		<td id="PET_organ3"></td>
-		<td id="SUVall_organ3"></td>
-		<td id="SUVparticipant_organ3"></td>
-	</tr>
-	<tr>
-		<td id="CT_organ4"></td>
-		<td id="PET_organ4"></td>
-		<td id="SUVall_organ4"></td>
-		<td id="SUVparticipant_organ4"></td>
-	</tr>
-	<tr>
-		<td id="CT_organ5"></td>
-		<td id="PET_organ5"></td>
-		<td id="SUVall_organ5"></td>
-		<td id="SUVparticipant_organ5"></td>
-	</tr>
-	</table>
-</div>
+<div id="reportDiv"></div>
 <div id="debugDiv">
 	<textarea id="debugCode"></textarea>
 </div>
@@ -46,41 +25,10 @@ let participantCode=searchParams.get('participantCode');
 let visitCode=searchParams.get('visitCode');
 document.getElementById("participantCode").innerHTML=participantCode;
 document.getElementById("visitCode").innerHTML=visitCode;
-let project=LABKEY.ActionURL.getContainer();
-document.getElementById("debugCode").value+='\n'+project;
-
-let server="https://merlin.fmf.uni-lj.si/labkey";
-let basePath=server+"/_webdav/";
-basePath+=project;
-basePath+="/@files/preprocessedImages/";
-basePath+=participantCode+"/"+visitCode+"/";
-document.getElementById("debugCode").value+='\n'+basePath;
-let studyPath=server+project;
-
-//let divImg=document.getElementById("organ3_PET");
-
-let organs=["3","4","5"];
-let im=["PET","CT"];
-for (let i=0;i<organs.length;i++){
-	let organ=organs[i];
-	let type="PET";
-
-	let img=document.createElement('img');
-	let imgSrc=basePath+participantCode+"-"+visitCode+"_"+type+"_"+organ+"_v5.png";
-	img.src=imgSrc;
-	img.width="300";
-	document.getElementById(type+"_organ"+organ).appendChild(img);
-							
-
-	type="CT";
-	let img1=document.createElement('img');
-	let img1Src=basePath+participantCode+"-"+visitCode+"_"+type+"_"+organ+"_v5.png";
-	img1.src=img1Src;
-	img1.width="300";
-	document.getElementById(type+"_organ"+organ).appendChild(img1);
-}
-LABKEY.requiresScript('/vis/genericChart/genericChartHelper.js', 
-      function(){LABKEY.vis.GenericChartHelper.loadVisDependencies(plotTime);});
 
+config.document=document;
+config.debugId="debugCode";
+print('Test');
+generateReviewSection("reviewMP","reportDiv",pickParticipantCodeFromPage);
 
 </script>

+ 1 - 1
views/reviewMP.view.xml

@@ -1,6 +1,6 @@
 <view xmlns="http://labkey.org/data/xml/view" title="Review">
 	<dependencies>
-			<dependency path="crf/crfReview.js"/>
+			<dependency path="crf/crfVisit.js"/>
 		</dependencies>
 	<permissions>
 		<permission name="login"/>

+ 9 - 65
views/reviewNM.html

@@ -1,37 +1,15 @@
-<h3>Title</h3>
-
+<h3>Nuclear medicine specialist's report</h3>
 <table>
 <tr>
-<th id="participantField">patientCode</th>
-<td id="participantCode">Loading1b</td>
+<th width="100" id="participantField">patientCode</th>
+<td id="participantCode">Loading</td>
 </tr>
 <tr>
 <th id="visitField">visitCode</th>
-<td id="visitCode">Loading2</td>
+<td id="visitCode">Loading</td>
 </tr>
 </table>
-
-<div id="organ3">
-	<table>
-	<tr>
-		<td id="CT_organ3"></td>
-		<td id="PET_organ3"></td>
-		<td id="SUVall_organ3"></td>
-		<td id="SUVparticipant_organ3"></td>
-	</tr>
-	<tr>
-		<td id="CT_organ4"></td>
-		<td id="PET_organ4"></td>
-		<td id="SUVall_organ4"></td>
-		<td id="SUVparticipant_organ4"></td>
-	</tr>
-	<tr>
-		<td id="CT_organ5"></td>
-		<td id="PET_organ5"></td>
-		<td id="SUVall_organ5"></td>
-		<td id="SUVparticipant_organ5"></td>
-	</tr>
-	</table>
+<div id="reportDiv">
 </div>
 <div id="debugDiv">
 	<textarea id="debugCode"></textarea>
@@ -46,43 +24,9 @@ let participantCode=searchParams.get('participantCode');
 let visitCode=searchParams.get('visitCode');
 document.getElementById("participantCode").innerHTML=participantCode;
 document.getElementById("visitCode").innerHTML=visitCode;
-let project=LABKEY.ActionURL.getContainer();
-document.getElementById("debugCode").value+='\n'+project;
-
-let server="https://merlin.fmf.uni-lj.si/labkey";
-let basePath=server+"/_webdav/";
-basePath+=project;
-basePath+="/@files/preprocessedImages/";
-basePath+=participantCode+"/"+visitCode+"/";
-document.getElementById("debugCode").value+='\n'+basePath;
-let studyPath=server+project;
-
-//let divImg=document.getElementById("organ3_PET");
-
-let organs=["3","4","5"];
-let im=["PET","CT"];
-for (let i=0;i<organs.length;i++){
-	let organ=organs[i];
-	let type="PET";
-
-	let img=document.createElement('img');
-	let imgSrc=basePath+participantCode+"-"+visitCode+"_"+type+"_"+organ+"_v5.png";
-	img.src=imgSrc;
-	img.width="300";
-	document.getElementById(type+"_organ"+organ).appendChild(img);
-							
-
-	type="CT";
-	let img1=document.createElement('img');
-	let img1Src=basePath+participantCode+"-"+visitCode+"_"+type+"_"+organ+"_v5.png";
-	img1.src=img1Src;
-	img1.width="300";
-	document.getElementById(type+"_organ"+organ).appendChild(img1);
-}
-LABKEY.requiresScript('/vis/genericChart/genericChartHelper.js', 
-      function(){LABKEY.vis.GenericChartHelper.loadVisDependencies(plotAll);});
-LABKEY.requiresScript('/vis/genericChart/genericChartHelper.js', 
-      function(){LABKEY.vis.GenericChartHelper.loadVisDependencies(plotParticipant);});
-
 
+config.document=document;
+config.debugId="debugCode";
+print('Test');
+generateReviewSection("reviewNM","reportDiv",pickParticipantCodeFromPage);
 </script>

+ 2 - 2
views/reviewNM.view.xml

@@ -1,6 +1,6 @@
-<view xmlns="http://labkey.org/data/xml/view" title="Review">
+<view xmlns="http://labkey.org/data/xml/view" title="Review Nuclear Medicine">
 	<dependencies>
-			<dependency path="crf/crfReview.js"/>
+			<dependency path="crf/crfVisit.js"/>
 		</dependencies>
 	<permissions>
 		<permission name="login"/>

+ 6 - 4
views/visit.html

@@ -56,7 +56,8 @@ function init(){
 	document.getElementById("crfRefId").innerHTML=crfRef;
 
 
-	let config=new Object();
+	//let config=new Object();
+	//config is part of crfVisit.js
 	//will this change if we are in views?
 	//config.review=true;
 	config.reviewMode=searchParams.get("reviewMode");
@@ -65,6 +66,8 @@ function init(){
 	//where to get ParticipantId
 	config.registrationQueryId=registrationQueryId;
 	config.registrationParticipantIdField="participantCode";
+	//pick this from study properties
+	config.participantField="PatientId";
 	config.masterForm="visitForm";
 	
 	config.document=document;
@@ -79,10 +82,9 @@ function init(){
 	config.submitReportId="submitReport";
 	
 	
-	clear(config);
-	print(config,"Container path"+config.containerPath);
+	clear();
 
-	generateMasterForm(config);
+	generateMasterForm();
 
 
 	

+ 4 - 3
views/visit.view.xml

@@ -1,8 +1,9 @@
 <view xmlns="http://labkey.org/data/xml/view" title="CRF Form">
 	<dependencies>
-			<dependency path="crf/crfVisit.js"/>
-	 		<dependency path="https://github.com/devongovett/pdfkit/releases/download/v0.10.0/pdfkit.standalone.js" />
-			<dependency path="https://github.com/devongovett/blob-stream/releases/download/v0.1.3/blob-stream.js"/>
+		<dependency path="crf/crfVisit.js"/>
+		<dependency path="crf/crfReview.js"/>
+		<!--<dependency path="https://github.com/devongovett/pdfkit/releases/download/v0.10.0/pdfkit.standalone.js" />-->
+		<!--<dependency path="https://github.com/devongovett/blob-stream/releases/download/v0.1.3/blob-stream.js"/>-->
 
  </dependencies>
 </view>

File diff suppressed because it is too large
+ 546 - 107
web/crf/crfVisit.js


+ 1 - 1
web/crf/formPortal.js

@@ -369,7 +369,7 @@ function setPatientId(config,formConfig,data,id){
 		let entry=formConfig.demographicData.rows[i];
 		let key=entry.lsid;
 		if (key!=participantCode) continue;
-		let participantId=entry.ParticipantId;
+		let participantId=entry[config.participantField];
 		config.document.getElementById(id).innerHTML=participantId;
 		break;
 	}

Some files were not shown because too many files changed in this diff