2370 |
22 Apr 14 |
nicklas |
var CaseSummary = function() |
2370 |
22 Apr 14 |
nicklas |
2 |
{ |
2370 |
22 Apr 14 |
nicklas |
var cs = {}; |
2593 |
19 Aug 14 |
nicklas |
var debug = 0; |
2919 |
11 Nov 14 |
nicklas |
var home; |
2370 |
22 Apr 14 |
nicklas |
var TRUNCATE_SIZE = [-1, 30, 20, 15]; |
3758 |
19 Feb 16 |
nicklas |
var defaultColClass = null; |
5011 |
05 Oct 18 |
nicklas |
var chainedItems = []; |
2370 |
22 Apr 14 |
nicklas |
9 |
|
2370 |
22 Apr 14 |
nicklas |
cs.initPage = function() |
2370 |
22 Apr 14 |
nicklas |
11 |
{ |
2370 |
22 Apr 14 |
nicklas |
Events.addEventHandler('showConfidential', 'change', cs.showConfidentialOnChange); |
5022 |
11 Oct 18 |
nicklas |
Events.addEventHandler('columnBalance', 'change', cs.columnBalance); |
2370 |
22 Apr 14 |
nicklas |
Events.doOnEnter('caseName', cs.caseSummary); |
2370 |
22 Apr 14 |
nicklas |
Buttons.addClickHandler('btnCaseSummary', cs.caseSummary); |
2370 |
22 Apr 14 |
nicklas |
Buttons.addClickHandler('printButton', cs.goPrint); |
2370 |
22 Apr 14 |
nicklas |
Buttons.addClickHandler('close', App.closeWindow); |
2370 |
22 Apr 14 |
nicklas |
18 |
|
2919 |
11 Nov 14 |
nicklas |
home = Data.get('page-data', 'home-reggie'); |
2370 |
22 Apr 14 |
nicklas |
var caseName = Data.get('page-data', 'case-name'); |
2370 |
22 Apr 14 |
nicklas |
var isAdmin = Data.int('page-data', 'admin'); |
2370 |
22 Apr 14 |
nicklas |
var isPatientCurator = Data.int('page-data', 'patient-curator'); |
2370 |
22 Apr 14 |
nicklas |
23 |
|
2370 |
22 Apr 14 |
nicklas |
var url = '../CaseSummary.servlet?ID='+App.getSessionId(); |
2370 |
22 Apr 14 |
nicklas |
url += '&cmd=GetCaseInfo'; |
2370 |
22 Apr 14 |
nicklas |
url += '&caseName='+encodeURIComponent(caseName); |
2610 |
28 Aug 14 |
nicklas |
Wizard.showLoadingAnimation('Loading information about case: ' + Strings.encodeTags(caseName)); |
2610 |
28 Aug 14 |
nicklas |
Wizard.asyncJsonRequest(url, cs.caseInfoLoaded); |
2610 |
28 Aug 14 |
nicklas |
29 |
} |
2610 |
28 Aug 14 |
nicklas |
30 |
|
2610 |
28 Aug 14 |
nicklas |
cs.caseInfoLoaded = function(response) |
2610 |
28 Aug 14 |
nicklas |
32 |
{ |
2610 |
28 Aug 14 |
nicklas |
Doc.show('all-info'); |
2370 |
22 Apr 14 |
nicklas |
34 |
|
2370 |
22 Apr 14 |
nicklas |
var caseInfo = response.caseInfo; |
2370 |
22 Apr 14 |
nicklas |
var site = response.site; |
2592 |
19 Aug 14 |
nicklas |
var patient = response.patient; |
2370 |
22 Apr 14 |
nicklas |
cs.initSections(response.sections); |
5022 |
11 Oct 18 |
nicklas |
39 |
|
5022 |
11 Oct 18 |
nicklas |
var maxItemsInLeftCol = 1; |
5022 |
11 Oct 18 |
nicklas |
var maxItemsInRightCol = 1; |
2370 |
22 Apr 14 |
nicklas |
42 |
|
6835 |
05 Sep 22 |
nicklas |
// Update title base on returned case name since the search may be something else (eg. personal number, pad, ...) |
6835 |
05 Sep 22 |
nicklas |
var caseName = response.caseName; |
6835 |
05 Sep 22 |
nicklas |
Data.set('page-data', 'case-name', caseName); |
6835 |
05 Sep 22 |
nicklas |
// Update header text to use the potentially changed case name |
6835 |
05 Sep 22 |
nicklas |
if (Doc.element('path-case-summary')) |
2370 |
22 Apr 14 |
nicklas |
48 |
{ |
6835 |
05 Sep 22 |
nicklas |
var title = 'Case summary - ' + Strings.encodeTags(caseName); |
6835 |
05 Sep 22 |
nicklas |
var originalCaseName = Data.get('page-data', 'original-case-name'); |
6835 |
05 Sep 22 |
nicklas |
if (response.matchedBy && caseName != originalCaseName) |
2370 |
22 Apr 14 |
nicklas |
52 |
{ |
6835 |
05 Sep 22 |
nicklas |
title += ' <span class="itemsubtype">(matched by '+Strings.encodeTags(response.matchedBy)+')</span>'; |
2370 |
22 Apr 14 |
nicklas |
54 |
} |
6835 |
05 Sep 22 |
nicklas |
Doc.element('path-case-summary').innerHTML = title; |
6835 |
05 Sep 22 |
nicklas |
56 |
} |
6835 |
05 Sep 22 |
nicklas |
57 |
|
6835 |
05 Sep 22 |
nicklas |
if (caseInfo) |
6835 |
05 Sep 22 |
nicklas |
59 |
{ |
3179 |
09 Mar 15 |
nicklas |
try |
3179 |
09 Mar 15 |
nicklas |
61 |
{ |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('case.name', cs.asLink('SAMPLE', caseInfo)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('case.registrationDate', cs.asDate(caseInfo.registrationDate)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('case.site', site ? site.name : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('case.consent', cs.asConsent(caseInfo.consent, cs.asDate(caseInfo.consentDate))); |
4496 |
10 May 17 |
nicklas |
cs.addColumn('case.laterality', cs.warnIfMissing(Strings.encodeTags(caseInfo.laterality))); |
4798 |
08 May 18 |
nicklas |
cs.addColumn('case.frozenTissueDate', cs.asDate(caseInfo.frozenTissueDate)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('case.comment', Strings.encodeTags(caseInfo.comment)); |
3179 |
09 Mar 15 |
nicklas |
69 |
} |
3179 |
09 Mar 15 |
nicklas |
catch (e) |
3179 |
09 Mar 15 |
nicklas |
71 |
{ |
3179 |
09 Mar 15 |
nicklas |
cs.logError('case-info', e); |
3179 |
09 Mar 15 |
nicklas |
73 |
} |
2370 |
22 Apr 14 |
nicklas |
74 |
} |
2370 |
22 Apr 14 |
nicklas |
else |
2370 |
22 Apr 14 |
nicklas |
76 |
{ |
2370 |
22 Apr 14 |
nicklas |
cs.addColumn('case.name', cs.asNoInfo('No case information has been registered')); |
2370 |
22 Apr 14 |
nicklas |
Doc.hide('case-details'); |
2370 |
22 Apr 14 |
nicklas |
79 |
} |
6835 |
05 Sep 22 |
nicklas |
80 |
|
2370 |
22 Apr 14 |
nicklas |
if (patient) |
2370 |
22 Apr 14 |
nicklas |
82 |
{ |
4496 |
10 May 17 |
nicklas |
try |
2370 |
22 Apr 14 |
nicklas |
84 |
{ |
4496 |
10 May 17 |
nicklas |
cs.addColumn('patient.name', cs.asLink('BIOSOURCE', patient)); |
4496 |
10 May 17 |
nicklas |
cs.addColumn('patient.registrationDate', cs.asDate(patient.registrationDate)); |
4496 |
10 May 17 |
nicklas |
cs.addColumn('patient.personalNumber', cs.warnIfMissing(Strings.encodeTags(patient.personalNumber))); |
4496 |
10 May 17 |
nicklas |
cs.addColumn('patient.allFirstNames', cs.warnIfMissing(Strings.encodeTags(patient.allFirstNames))); |
4496 |
10 May 17 |
nicklas |
cs.addColumn('patient.familyName', cs.warnIfMissing(Strings.encodeTags(patient.familyName))); |
4496 |
10 May 17 |
nicklas |
cs.addColumn('patient.gender', Strings.encodeTags(patient.gender)); |
4496 |
10 May 17 |
nicklas |
cs.addColumn('patient.allCases', cs.asCaseList(patient.allCases, caseName)); |
2370 |
22 Apr 14 |
nicklas |
92 |
} |
4496 |
10 May 17 |
nicklas |
catch (e) |
2370 |
22 Apr 14 |
nicklas |
94 |
{ |
4496 |
10 May 17 |
nicklas |
cs.logError('patient-info', e); |
2370 |
22 Apr 14 |
nicklas |
96 |
} |
2370 |
22 Apr 14 |
nicklas |
97 |
} |
2370 |
22 Apr 14 |
nicklas |
else |
2370 |
22 Apr 14 |
nicklas |
99 |
{ |
2370 |
22 Apr 14 |
nicklas |
cs.addColumn('patient.name', cs.asNoInfo('No patient information has been registered')); |
2370 |
22 Apr 14 |
nicklas |
Doc.hide('patient-details'); |
2370 |
22 Apr 14 |
nicklas |
102 |
} |
2370 |
22 Apr 14 |
nicklas |
103 |
|
4496 |
10 May 17 |
nicklas |
var blood = response.blood; |
2370 |
22 Apr 14 |
nicklas |
if (blood && blood.length > 0) |
2370 |
22 Apr 14 |
nicklas |
106 |
{ |
6425 |
29 Sep 21 |
nicklas |
blood.sort(cs.sortByIdDescending); |
5022 |
11 Oct 18 |
nicklas |
maxItemsInLeftCol = Math.max(maxItemsInLeftCol, blood.length); |
2370 |
22 Apr 14 |
nicklas |
for (var i = 0; i < blood.length; i++) |
2370 |
22 Apr 14 |
nicklas |
110 |
{ |
3179 |
09 Mar 15 |
nicklas |
try |
3179 |
09 Mar 15 |
nicklas |
112 |
{ |
3179 |
09 Mar 15 |
nicklas |
var b = blood[i]; |
6479 |
09 Nov 21 |
nicklas |
cs.addColumn('blood.name', cs.asLink('SAMPLE', b, 0, true)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('blood.registrationDate', cs.asDate(b.registrationDate)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('blood.consent', cs.asConsent(b.consent, cs.asDate(b.consentDate))); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('blood.bloodSample', Strings.encodeTags(b.bloodSample)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('blood.samplingDate', cs.warnIfMissing(cs.asDateTime(b.samplingDate))); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('blood.freezerDate', cs.warnIfMissing(cs.asDateTime(b.freezerDate, b.samplingDate))); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('blood.serum', Strings.encodeTags(b.serum)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('blood.comment', Strings.encodeTags(b.comment)); |
3179 |
09 Mar 15 |
nicklas |
122 |
} |
3179 |
09 Mar 15 |
nicklas |
catch (e) |
3179 |
09 Mar 15 |
nicklas |
124 |
{ |
3179 |
09 Mar 15 |
nicklas |
cs.logError('blood-info', e); |
3179 |
09 Mar 15 |
nicklas |
126 |
} |
2370 |
22 Apr 14 |
nicklas |
127 |
} |
2370 |
22 Apr 14 |
nicklas |
128 |
} |
2370 |
22 Apr 14 |
nicklas |
else |
2370 |
22 Apr 14 |
nicklas |
130 |
{ |
4496 |
10 May 17 |
nicklas |
cs.addColumn('blood.name', cs.asNoInfo('No blood information has been registered')); |
4496 |
10 May 17 |
nicklas |
Doc.hide('blood-details'); |
2370 |
22 Apr 14 |
nicklas |
133 |
} |
2370 |
22 Apr 14 |
nicklas |
134 |
|
3356 |
28 May 15 |
nicklas |
// Blood DNA |
4496 |
10 May 17 |
nicklas |
var bdna = response.bdna; |
3356 |
28 May 15 |
nicklas |
if (bdna && bdna.length > 0) |
3356 |
28 May 15 |
nicklas |
138 |
{ |
6425 |
29 Sep 21 |
nicklas |
bdna.sort(cs.sortByIdDescending); |
3356 |
28 May 15 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(bdna.length-1, TRUNCATE_SIZE.length)]; |
5022 |
11 Oct 18 |
nicklas |
//maxItemsInLeftCol = Math.max(maxItemsInLeftCol, bdna.length); |
3356 |
28 May 15 |
nicklas |
for (var i = 0; i < bdna.length; i++) |
3356 |
28 May 15 |
nicklas |
143 |
{ |
3356 |
28 May 15 |
nicklas |
try |
3356 |
28 May 15 |
nicklas |
145 |
{ |
3356 |
28 May 15 |
nicklas |
var d = bdna[i]; |
6479 |
09 Nov 21 |
nicklas |
cs.addColumn('bdna.name', cs.asLink('EXTRACT', d, 0, true)); |
3356 |
28 May 15 |
nicklas |
cs.addColumn('bdna.registrationDate', cs.asDate(d.registrationDate)); |
3356 |
28 May 15 |
nicklas |
cs.addColumn('bdna.storageBox', cs.asBioPlateLocation(d.bioWell)); |
3356 |
28 May 15 |
nicklas |
cs.addColumn('bdna.remainingQuantity', cs.asQuantity(d.remainingQuantity, ' µg')); |
3356 |
28 May 15 |
nicklas |
cs.addColumn('bdna.originalQuantity', cs.asQuantity(d.originalQuantity, ' µg')); |
3356 |
28 May 15 |
nicklas |
cs.addColumn('bdna.ndConc', cs.asQuantity(d.ndConc, ' ng/µl')); |
3356 |
28 May 15 |
nicklas |
cs.addColumn('bdna.comment', cs.truncate(d.comment, truncateAt)); |
3356 |
28 May 15 |
nicklas |
154 |
} |
3356 |
28 May 15 |
nicklas |
catch (e) |
3356 |
28 May 15 |
nicklas |
156 |
{ |
3356 |
28 May 15 |
nicklas |
cs.logError('bdna-info', e); |
3356 |
28 May 15 |
nicklas |
158 |
} |
3356 |
28 May 15 |
nicklas |
159 |
} |
3356 |
28 May 15 |
nicklas |
160 |
} |
3356 |
28 May 15 |
nicklas |
else |
3356 |
28 May 15 |
nicklas |
162 |
{ |
4496 |
10 May 17 |
nicklas |
cs.addColumn('bdna.name', cs.asNoInfo('No Blood DNA information has been registered')); |
4496 |
10 May 17 |
nicklas |
Doc.hide('bdna-details'); |
3356 |
28 May 15 |
nicklas |
165 |
} |
3356 |
28 May 15 |
nicklas |
166 |
|
6479 |
09 Nov 21 |
nicklas |
// GenotypeCall |
6479 |
09 Nov 21 |
nicklas |
var gtCall = response.genotypecall; |
6479 |
09 Nov 21 |
nicklas |
if (gtCall && gtCall.length > 0) |
6479 |
09 Nov 21 |
nicklas |
170 |
{ |
6479 |
09 Nov 21 |
nicklas |
gtCall.sort(cs.sortByIdDescending); |
6479 |
09 Nov 21 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(gtCall.length-1, TRUNCATE_SIZE.length)]; |
6479 |
09 Nov 21 |
nicklas |
for (var i = 0; i < gtCall.length; i++) |
6479 |
09 Nov 21 |
nicklas |
174 |
{ |
6479 |
09 Nov 21 |
nicklas |
try |
6479 |
09 Nov 21 |
nicklas |
176 |
{ |
6479 |
09 Nov 21 |
nicklas |
var gtc = gtCall[i]; |
6479 |
09 Nov 21 |
nicklas |
var scan = gtc.scan || {}; |
6479 |
09 Nov 21 |
nicklas |
var beadChip = gtc.beadChip || {}; |
6479 |
09 Nov 21 |
nicklas |
cs.addColumn('genotypecall.name', cs.asLink('DERIVEDBIOASSAY', gtc, 0, [gtc.name, gtc.bloodDna.name])); |
6479 |
09 Nov 21 |
nicklas |
cs.addColumn('genotypecall.chip', cs.asLink('PHYSICALBIOASSAY', beadChip)); |
6479 |
09 Nov 21 |
nicklas |
cs.addColumn('genotypecall.chipType', Strings.encodeTags(beadChip.chipType)); |
6479 |
09 Nov 21 |
nicklas |
cs.addColumn('genotypecall.scanDate', cs.asDateTime(scan.scanDate)); |
6479 |
09 Nov 21 |
nicklas |
cs.addColumn('genotypecall.callDate', cs.asDateTime(gtc.callDate)); |
6479 |
09 Nov 21 |
nicklas |
cs.addColumn('genotypecall.numCalls', cs.asCount(gtc.numCalls)); |
6479 |
09 Nov 21 |
nicklas |
cs.addColumn('genotypecall.callRate', cs.asPercent(gtc.callRate, true, 2)); |
6479 |
09 Nov 21 |
nicklas |
cs.addColumn('genotypecall.gcScore', (cs.asQuantity(gtc.gc50)||'-')+'/'+(cs.asQuantity(gtc.gc10)||'-')); |
6517 |
07 Dec 21 |
nicklas |
cs.addColumn('genotypecall.genotypeQc', cs.asGenotypeQc(gtc)); |
6479 |
09 Nov 21 |
nicklas |
cs.addColumn('genotypecall.comment', cs.truncate(gtc.comment, truncateAt)); |
6479 |
09 Nov 21 |
nicklas |
190 |
} |
6479 |
09 Nov 21 |
nicklas |
catch (e) |
6479 |
09 Nov 21 |
nicklas |
192 |
{ |
6479 |
09 Nov 21 |
nicklas |
cs.logError('genotypecall-info', e); |
6479 |
09 Nov 21 |
nicklas |
194 |
} |
6479 |
09 Nov 21 |
nicklas |
195 |
} |
6479 |
09 Nov 21 |
nicklas |
196 |
} |
6479 |
09 Nov 21 |
nicklas |
else |
6479 |
09 Nov 21 |
nicklas |
198 |
{ |
6479 |
09 Nov 21 |
nicklas |
cs.addColumn('genotypecall.name', cs.asNoInfo('No GenotypeCall information has been registered')); |
6479 |
09 Nov 21 |
nicklas |
Doc.hide('genotypecall-details'); |
6479 |
09 Nov 21 |
nicklas |
201 |
} |
6479 |
09 Nov 21 |
nicklas |
202 |
|
6882 |
22 Nov 22 |
nicklas |
// Methyltion |
6882 |
22 Nov 22 |
nicklas |
var methylation = response.methylation; |
6882 |
22 Nov 22 |
nicklas |
if (methylation && methylation.length > 0) |
6882 |
22 Nov 22 |
nicklas |
206 |
{ |
6882 |
22 Nov 22 |
nicklas |
methylation.sort(cs.sortByIdDescending); |
6882 |
22 Nov 22 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(methylation.length-1, TRUNCATE_SIZE.length)]; |
6882 |
22 Nov 22 |
nicklas |
for (var i = 0; i < methylation.length; i++) |
6882 |
22 Nov 22 |
nicklas |
210 |
{ |
6882 |
22 Nov 22 |
nicklas |
try |
6882 |
22 Nov 22 |
nicklas |
212 |
{ |
6882 |
22 Nov 22 |
nicklas |
var meth = methylation[i]; |
6882 |
22 Nov 22 |
nicklas |
var scan = meth.scan || {}; |
6882 |
22 Nov 22 |
nicklas |
var beadChip = meth.beadChip || {}; |
6882 |
22 Nov 22 |
nicklas |
var job = meth.job; |
6882 |
22 Nov 22 |
nicklas |
var adjustmentPlots = meth.adjustmentPlots; |
6882 |
22 Nov 22 |
nicklas |
var probes = []; |
6882 |
22 Nov 22 |
nicklas |
if (meth.ProbesI != null) probes[probes.length] = cs.asCount(meth.ProbesI)+' (I)'; |
6882 |
22 Nov 22 |
nicklas |
if (meth.ProbesII != null) probes[probes.length] = cs.asCount(meth.ProbesII)+' (II)'; |
6882 |
22 Nov 22 |
nicklas |
cs.addColumn('methylation.name', cs.asLink('DERIVEDBIOASSAY', meth, 0, [meth.name, meth.dna.name])); |
6882 |
22 Nov 22 |
nicklas |
cs.addColumn('methylation.donotuse', cs.asDoNotUse(meth)); |
6882 |
22 Nov 22 |
nicklas |
cs.addColumn('methylation.chip', cs.asLink('PHYSICALBIOASSAY', beadChip)); |
6882 |
22 Nov 22 |
nicklas |
cs.addColumn('methylation.chipType', Strings.encodeTags(beadChip.chipType)); |
6882 |
22 Nov 22 |
nicklas |
cs.addColumn('methylation.scanDate', cs.asDateTime(scan.scanDate)); |
6882 |
22 Nov 22 |
nicklas |
cs.addColumn('methylation.date', cs.asJob(job, truncateAt, 'Analyzing')); |
6882 |
22 Nov 22 |
nicklas |
cs.addColumn('methylation.probes', probes.join(' + ')); |
6882 |
22 Nov 22 |
nicklas |
cs.addColumn('methylation.warnings', meth.AnalysisFlag != null ? cs.asWarning(meth.AnalysisFlag) : null); |
6882 |
22 Nov 22 |
nicklas |
cs.addColumn('methylation.adjustmentPlots', adjustmentPlots && adjustmentPlots.type == 'FILE' ? 'Yes '+cs.asFileLink(adjustmentPlots, 'pdffile.png') : 'No'); |
6882 |
22 Nov 22 |
nicklas |
cs.addColumn('methylation.comment', cs.truncate(meth.comment, truncateAt)); |
6882 |
22 Nov 22 |
nicklas |
231 |
} |
6882 |
22 Nov 22 |
nicklas |
catch (e) |
6882 |
22 Nov 22 |
nicklas |
233 |
{ |
6882 |
22 Nov 22 |
nicklas |
cs.logError('methylation-info', e); |
6882 |
22 Nov 22 |
nicklas |
235 |
} |
6882 |
22 Nov 22 |
nicklas |
236 |
} |
6882 |
22 Nov 22 |
nicklas |
237 |
} |
6882 |
22 Nov 22 |
nicklas |
else |
6882 |
22 Nov 22 |
nicklas |
239 |
{ |
6882 |
22 Nov 22 |
nicklas |
cs.addColumn('methylation.name', cs.asNoInfo('No Methylation information has been registered')); |
6882 |
22 Nov 22 |
nicklas |
Doc.hide('methylation-details'); |
6882 |
22 Nov 22 |
nicklas |
242 |
} |
6479 |
09 Nov 21 |
nicklas |
243 |
|
4496 |
10 May 17 |
nicklas |
var specimen = response.specimen; |
4496 |
10 May 17 |
nicklas |
var noSpecimen = response.noSpecimen; |
6154 |
26 Feb 21 |
nicklas |
var numSpecimenOfAnyType = 0; |
3758 |
19 Feb 16 |
nicklas |
var yellowPrefixes = {}; |
2370 |
22 Apr 14 |
nicklas |
if (specimen && specimen.length > 0) |
2370 |
22 Apr 14 |
nicklas |
249 |
{ |
6425 |
29 Sep 21 |
nicklas |
specimen.sort(cs.sortByIdDescending); |
2370 |
22 Apr 14 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(specimen.length-1, TRUNCATE_SIZE.length)]; |
5022 |
11 Oct 18 |
nicklas |
maxItemsInLeftCol = Math.max(maxItemsInLeftCol, specimen.length); |
2370 |
22 Apr 14 |
nicklas |
for (var i = 0; i < specimen.length; i++) |
2370 |
22 Apr 14 |
nicklas |
254 |
{ |
3179 |
09 Mar 15 |
nicklas |
try |
3179 |
09 Mar 15 |
nicklas |
256 |
{ |
3179 |
09 Mar 15 |
nicklas |
var s = specimen[i]; |
5009 |
04 Oct 18 |
nicklas |
yellowPrefixes[s.name] = s.YellowLabel != null ? 'yellow-specimen' : null; |
5009 |
04 Oct 18 |
nicklas |
defaultColClass = cs.getDefaultColClass(s, yellowPrefixes); |
5011 |
05 Oct 18 |
nicklas |
cs.addColumn('specimen.name', cs.asLink('SAMPLE', s, 0, true)); |
7152 |
09 May 23 |
nicklas |
if (s.ExternalRef) cs.addColumn('specimen.externalRef', s.ExternalRef+cs.asImportJsonFile(s.importFile)); |
5009 |
04 Oct 18 |
nicklas |
cs.addColumn('specimen.donotuse', cs.asDoNotUse(s)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('specimen.registrationDate', cs.asDate(s.registrationDate)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('specimen.storageBox', cs.asBioPlateLocation(s.bioWell)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('specimen.laterality', cs.warnIfMissing(Strings.encodeTags(s.laterality))); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('specimen.samplingDate', cs.warnIfMissing(cs.asDateTime(s.samplingDate))); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('specimen.rnaLaterDate', cs.warnIfMissing(cs.asDateTime(s.rnaLaterDate, s.samplingDate))); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('specimen.pad', cs.warnIfMissing(Strings.encodeTags(s.pad))); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('specimen.biopsyType', s.biopsyType); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('specimen.remainingQuantity', cs.asQuantity(s.remainingQuantity, ' mg', 1000)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('specimen.originalQuantity', cs.asQuantity(s.originalQuantity, ' mg', 1000)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('specimen.nofPieces', s.nofPieces); |
7146 |
08 May 23 |
nicklas |
cs.addColumn('specimen.pathNote', cs.truncate(s.OtherPathNote, truncateAt)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('specimen.partitionComment', cs.truncate(s.partitionComment, truncateAt)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('specimen.comment', cs.truncate(s.comment, truncateAt)); |
6154 |
26 Feb 21 |
nicklas |
numSpecimenOfAnyType++; |
3179 |
09 Mar 15 |
nicklas |
277 |
} |
3179 |
09 Mar 15 |
nicklas |
catch (e) |
3179 |
09 Mar 15 |
nicklas |
279 |
{ |
3179 |
09 Mar 15 |
nicklas |
cs.logError('specimen-info', e); |
3179 |
09 Mar 15 |
nicklas |
281 |
} |
2370 |
22 Apr 14 |
nicklas |
282 |
} |
5019 |
10 Oct 18 |
nicklas |
defaultColClass = null; |
2370 |
22 Apr 14 |
nicklas |
284 |
} |
2370 |
22 Apr 14 |
nicklas |
if (noSpecimen && noSpecimen.length > 0) |
2370 |
22 Apr 14 |
nicklas |
286 |
{ |
6425 |
29 Sep 21 |
nicklas |
noSpecimen.sort(cs.sortByIdDescending); |
5022 |
11 Oct 18 |
nicklas |
maxItemsInLeftCol = Math.max(maxItemsInLeftCol, noSpecimen.length); |
2370 |
22 Apr 14 |
nicklas |
for (var i = 0; i < noSpecimen.length; i++) |
2370 |
22 Apr 14 |
nicklas |
290 |
{ |
3179 |
09 Mar 15 |
nicklas |
try |
3179 |
09 Mar 15 |
nicklas |
292 |
{ |
3179 |
09 Mar 15 |
nicklas |
var s = noSpecimen[i]; |
5011 |
05 Oct 18 |
nicklas |
cs.addColumn('nospecimen.name', cs.asLink('SAMPLE', s, 0, true)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('nospecimen.registrationDate', cs.asDate(s.registrationDate)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('nospecimen.laterality', cs.warnIfMissing(Strings.encodeTags(s.laterality))); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('nospecimen.samplingDate', cs.warnIfMissing(cs.asDate(s.samplingDate))); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('nospecimen.pad', cs.warnIfMissing(Strings.encodeTags(s.pad))); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('nospecimen.reasonIfNoSpecimen', Strings.encodeTags(s.reasonIfNoSpecimen)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('nospecimen.comment', cs.truncate(s.comment, truncateAt)); |
6579 |
10 Feb 22 |
nicklas |
var specimenExists = s.externalSpecimenExists=='Yes'; |
6579 |
10 Feb 22 |
nicklas |
cs.addColumn('nospecimen.externalSpecimenExists', specimenExists ? s.externalOperator || s.externalSpecimenExists : null); |
6579 |
10 Feb 22 |
nicklas |
cs.addColumn('nospecimen.liasonComment', specimenExists ? cs.truncate(s.liasonComment || '', truncateAt) : null); |
7146 |
08 May 23 |
nicklas |
cs.addColumn('nospecimen.pathNote', cs.truncate(s.OtherPathNote , truncateAt)); |
6579 |
10 Feb 22 |
nicklas |
305 |
|
6154 |
26 Feb 21 |
nicklas |
numSpecimenOfAnyType++; |
3179 |
09 Mar 15 |
nicklas |
307 |
} |
3179 |
09 Mar 15 |
nicklas |
catch (e) |
3179 |
09 Mar 15 |
nicklas |
309 |
{ |
3179 |
09 Mar 15 |
nicklas |
cs.logError('nospecimen-info', e); |
3179 |
09 Mar 15 |
nicklas |
311 |
} |
2370 |
22 Apr 14 |
nicklas |
312 |
} |
5019 |
10 Oct 18 |
nicklas |
defaultColClass = null; |
6154 |
26 Feb 21 |
nicklas |
314 |
} |
6154 |
26 Feb 21 |
nicklas |
315 |
|
6154 |
26 Feb 21 |
nicklas |
if (numSpecimenOfAnyType == 0) |
2370 |
22 Apr 14 |
nicklas |
317 |
{ |
4496 |
10 May 17 |
nicklas |
cs.addColumn('specimen.name', cs.asNoInfo('No specimen information has been registered')); |
4496 |
10 May 17 |
nicklas |
Doc.hide('specimen-details'); |
2370 |
22 Apr 14 |
nicklas |
Doc.hide('nospecimen-info'); |
2370 |
22 Apr 14 |
nicklas |
321 |
} |
6154 |
26 Feb 21 |
nicklas |
else |
6154 |
26 Feb 21 |
nicklas |
323 |
{ |
6154 |
26 Feb 21 |
nicklas |
if (!specimen || specimen.length == 0) |
6154 |
26 Feb 21 |
nicklas |
325 |
{ |
6154 |
26 Feb 21 |
nicklas |
cs.addColumn('specimen.name', cs.asNoInfo('No specimen received; see below for details')); |
6154 |
26 Feb 21 |
nicklas |
Doc.hide('specimen-details'); |
6154 |
26 Feb 21 |
nicklas |
328 |
} |
6154 |
26 Feb 21 |
nicklas |
if (!noSpecimen || noSpecimen.length == 0) Doc.hide('nospecimen-info'); |
6154 |
26 Feb 21 |
nicklas |
330 |
} |
2370 |
22 Apr 14 |
nicklas |
331 |
|
4496 |
10 May 17 |
nicklas |
var histology = response.histology; |
2370 |
22 Apr 14 |
nicklas |
if (histology && histology.length > 0) |
2370 |
22 Apr 14 |
nicklas |
334 |
{ |
6425 |
29 Sep 21 |
nicklas |
histology.sort(cs.sortByIdDescending); |
2370 |
22 Apr 14 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(histology.length-1, TRUNCATE_SIZE.length)]; |
5022 |
11 Oct 18 |
nicklas |
maxItemsInLeftCol = Math.max(maxItemsInLeftCol, histology.length); |
2370 |
22 Apr 14 |
nicklas |
for (var i = 0; i < histology.length; i++) |
2370 |
22 Apr 14 |
nicklas |
339 |
{ |
3179 |
09 Mar 15 |
nicklas |
try |
3179 |
09 Mar 15 |
nicklas |
341 |
{ |
3179 |
09 Mar 15 |
nicklas |
var h = histology[i]; |
5009 |
04 Oct 18 |
nicklas |
defaultColClass = cs.getDefaultColClass(h, yellowPrefixes); |
5011 |
05 Oct 18 |
nicklas |
cs.addColumn('histology.name', cs.asLink('SAMPLE', h, 0, true)); |
5009 |
04 Oct 18 |
nicklas |
cs.addColumn('histology.donotuse', cs.asDoNotUse(h)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('histology.registrationDate', cs.asDate(h.registrationDate)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('histology.partitionDate', cs.asDate(h.partitionDate)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('histology.usedQuantity', cs.asQuantity(h.originalQuantity, ' mg', 1000)); |
3179 |
09 Mar 15 |
nicklas |
349 |
|
3179 |
09 Mar 15 |
nicklas |
var embedded = h.embedDate ? true : false; |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('histology.embedded', embedded ? cs.asDate(h.embedDate) : 'No'); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('histology.embedProtocol', embedded ? cs.asLink('PROTOCOL', h.embedProtocol, truncateAt) : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('histology.paraffinBlock', embedded ? cs.asBioPlateLocation(h.bioWell) : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('histology.storageBox', embedded ? null : cs.asBioPlateLocation(h.bioWell)); |
3179 |
09 Mar 15 |
nicklas |
355 |
|
3179 |
09 Mar 15 |
nicklas |
var stained = h.stainDate ? true : false; |
3179 |
09 Mar 15 |
nicklas |
var bestStain = stained ? h.bestStain : null; |
3179 |
09 Mar 15 |
nicklas |
var scored = bestStain && bestStain.ScoreComplete != null ? true : false; |
3179 |
09 Mar 15 |
nicklas |
359 |
|
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('histology.stained', stained ? cs.asDate(h.stainDate) : 'No'); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('histology.nofSlides', stained ? h.numStains : null); |
6018 |
09 Oct 20 |
nicklas |
cs.addColumn('histology.heGlass', bestStain ? cs.asBioPlateLocation(bestStain.bioWell) + cs.asFileLink(bestStain.ndpiImage, 'ndpi.png', 'View NanoZoomer Digital Pathology Image') : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('histology.stainProtocol', stained ? cs.asLink('PROTOCOL', h.stainProtocol, truncateAt) : null); |
3373 |
09 Jun 15 |
nicklas |
364 |
|
3419 |
24 Jun 15 |
nicklas |
cs.addColumn('histology.scored', (scored ? (bestStain.ScoreComplete ? 'Complete' : 'In progress') : 'No')+cs.asFileLink(bestStain ? bestStain.image : null, 'picture.png')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('histology.scoreInvasiveCancer', scored ? cs.asPercent(bestStain.ScoreInvasiveCancer) : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('histology.scoreInsituCancer', scored ? cs.asPercent(bestStain.ScoreInsituCancer) : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('histology.scoreLymphocytes', scored ? cs.asPercent(bestStain.ScoreLymphocytes) : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('histology.scoreNormal', scored ? cs.asPercent(bestStain.ScoreNormal) : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('histology.scoreStroma', scored ? cs.asPercent(bestStain.ScoreStroma) : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('histology.scoreFat', scored ? cs.asPercent(bestStain.ScoreFat) : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('histology.scoreComments', scored ? cs.truncate(bestStain.comments, truncateAt) : null); |
3179 |
09 Mar 15 |
nicklas |
373 |
} |
3179 |
09 Mar 15 |
nicklas |
catch (e) |
3179 |
09 Mar 15 |
nicklas |
375 |
{ |
3179 |
09 Mar 15 |
nicklas |
cs.logError('histology-info', e); |
3179 |
09 Mar 15 |
nicklas |
377 |
} |
2370 |
22 Apr 14 |
nicklas |
378 |
} |
5019 |
10 Oct 18 |
nicklas |
defaultColClass = null; |
2370 |
22 Apr 14 |
nicklas |
380 |
} |
2370 |
22 Apr 14 |
nicklas |
else |
2370 |
22 Apr 14 |
nicklas |
382 |
{ |
4496 |
10 May 17 |
nicklas |
cs.addColumn('histology.name', cs.asNoInfo('No histology information has been registered')); |
4496 |
10 May 17 |
nicklas |
Doc.hide('histology-details'); |
2370 |
22 Apr 14 |
nicklas |
385 |
} |
2370 |
22 Apr 14 |
nicklas |
386 |
|
4496 |
10 May 17 |
nicklas |
var lysate = response.lysate; |
2370 |
22 Apr 14 |
nicklas |
if (lysate && lysate.length > 0) |
2370 |
22 Apr 14 |
nicklas |
389 |
{ |
6425 |
29 Sep 21 |
nicklas |
lysate.sort(cs.sortByIdDescending); |
2370 |
22 Apr 14 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(lysate.length-1, TRUNCATE_SIZE.length)]; |
5022 |
11 Oct 18 |
nicklas |
maxItemsInRightCol = Math.max(maxItemsInRightCol, lysate.length); |
2370 |
22 Apr 14 |
nicklas |
for (var i = 0; i < lysate.length; i++) |
2370 |
22 Apr 14 |
nicklas |
394 |
{ |
3179 |
09 Mar 15 |
nicklas |
try |
3179 |
09 Mar 15 |
nicklas |
396 |
{ |
3179 |
09 Mar 15 |
nicklas |
var lys = lysate[i]; |
5009 |
04 Oct 18 |
nicklas |
defaultColClass = cs.getDefaultColClass(lys, yellowPrefixes); |
5011 |
05 Oct 18 |
nicklas |
cs.addColumn('lysate.name', cs.asLink('EXTRACT', lys, 0, true)); |
5009 |
04 Oct 18 |
nicklas |
cs.addColumn('lysate.donotuse', cs.asDoNotUse(lys)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('lysate.registrationDate', cs.asDate(lys.registrationDate)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('lysate.partitionDate', cs.asDate(lys.partitionDate)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('lysate.usedQuantity', cs.asQuantity(lys.usedQuantity, ' mg', 1000)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('lysate.multiplePieces', lys.multiplePieces ? 'Yes' : 'No'); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('lysate.comment', cs.truncate(lys.comment, truncateAt)); |
3179 |
09 Mar 15 |
nicklas |
406 |
|
3179 |
09 Mar 15 |
nicklas |
var lysis = lys.lysisDate ? true : false; |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('lysate.lysisDate', lysis ? cs.asDate(lys.lysisDate) : 'No'); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('lysate.storageBox', lysis ? cs.asBioPlateLocation(lys.bioWell) : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('lysate.lysisProtocol', lysis ? cs.asLink('PROTOCOL', lys.lysisProtocol, truncateAt) : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('lysate.remainingQuantity', lysis ? cs.asQuantity(lys.remainingQuantity, ' µg') : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('lysate.originalQuantity', lysis ? cs.asQuantity(lys.originalQuantity, ' µg') : null); |
3179 |
09 Mar 15 |
nicklas |
413 |
} |
3179 |
09 Mar 15 |
nicklas |
catch (e) |
3179 |
09 Mar 15 |
nicklas |
415 |
{ |
3179 |
09 Mar 15 |
nicklas |
cs.logError('lysate-info', e); |
3179 |
09 Mar 15 |
nicklas |
417 |
} |
2370 |
22 Apr 14 |
nicklas |
418 |
} |
5019 |
10 Oct 18 |
nicklas |
defaultColClass = null; |
2370 |
22 Apr 14 |
nicklas |
420 |
} |
2370 |
22 Apr 14 |
nicklas |
else |
2370 |
22 Apr 14 |
nicklas |
422 |
{ |
4496 |
10 May 17 |
nicklas |
cs.addColumn('lysate.name', cs.asNoInfo('No lysate information has been registered')); |
4496 |
10 May 17 |
nicklas |
Doc.hide('lysate-details'); |
2370 |
22 Apr 14 |
nicklas |
425 |
} |
2370 |
22 Apr 14 |
nicklas |
426 |
|
4496 |
10 May 17 |
nicklas |
var rna = response.rna; |
2370 |
22 Apr 14 |
nicklas |
if (rna && rna.length > 0) |
2370 |
22 Apr 14 |
nicklas |
429 |
{ |
6425 |
29 Sep 21 |
nicklas |
rna.sort(cs.sortByIdDescending); |
2370 |
22 Apr 14 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(rna.length-1, TRUNCATE_SIZE.length)]; |
5022 |
11 Oct 18 |
nicklas |
maxItemsInRightCol = Math.max(maxItemsInRightCol, rna.length); |
2370 |
22 Apr 14 |
nicklas |
for (var i = 0; i < rna.length; i++) |
2370 |
22 Apr 14 |
nicklas |
434 |
{ |
3179 |
09 Mar 15 |
nicklas |
try |
3179 |
09 Mar 15 |
nicklas |
436 |
{ |
3179 |
09 Mar 15 |
nicklas |
var r = rna[i]; |
5009 |
04 Oct 18 |
nicklas |
defaultColClass = cs.getDefaultColClass(r, yellowPrefixes); |
5011 |
05 Oct 18 |
nicklas |
cs.addColumn('rna.name', cs.asLink('EXTRACT', r, 0, true)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('rna.flag', r.flag ? cs.asFlagInfo(r.flag, 'flag.png') : null); |
5009 |
04 Oct 18 |
nicklas |
cs.addColumn('rna.donotuse', cs.asDoNotUse(r)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('rna.registrationDate', cs.asDate(r.registrationDate)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('rna.storageBox', cs.asBioPlateLocation(r.bioWell)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('rna.usedQuantity', cs.asQuantity(r.usedQuantity, ' µg')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('rna.extractionDate', cs.asDate(r.extractionDate)+cs.asLabEnvLink('http://givare2.onk.lu.se/', r.extractionDate, 'RNA extraction: ' + r.name, 'thermometer.png')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('rna.extractionProtocol', cs.asLink('PROTOCOL', r.extractionProtocol, truncateAt)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('rna.remainingQuantity', cs.asQuantity(r.remainingQuantity, ' µg')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('rna.originalQuantity', cs.asQuantity(r.originalQuantity, ' µg')); |
6220 |
20 Apr 21 |
nicklas |
cs.addColumn('rna.conc', cs.asQuantity(r.conc, ' ng/µl')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('rna.comment', cs.truncate(r.comment, truncateAt)); |
3179 |
09 Mar 15 |
nicklas |
451 |
|
3179 |
09 Mar 15 |
nicklas |
var hasQc = r.nofQc ? true : false; |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('rna.qc', hasQc ? (r.qcDate ? cs.asDate(r.qcDate) : cs.asNoInfo('Waiting for Caliper...')) : 'No'); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('rna.nofQc', hasQc ? r.nofQc : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('rna.qcProtocol', hasQc ? cs.asLink('PROTOCOL', r.qcProtocol, truncateAt) : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('rna.qcPlate', hasQc ? cs.asBioPlateLocation(r.qcPlate)+cs.asFileLink(r.qcPdf, 'pdffile.png') : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('rna.qcRqs', hasQc && r.qcRqs ? Reggie.formatNumber(r.qcRqs, null, 1) : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('rna.qcRin', hasQc && r.qcRin ? Reggie.formatNumber(r.qcRin, null, 1) : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('rna.qcComment', hasQc ? cs.truncate(r.qcComment, truncateAt) : null); |
3179 |
09 Mar 15 |
nicklas |
460 |
} |
3179 |
09 Mar 15 |
nicklas |
catch (e) |
3179 |
09 Mar 15 |
nicklas |
462 |
{ |
3179 |
09 Mar 15 |
nicklas |
cs.logError('rna-info', e); |
3179 |
09 Mar 15 |
nicklas |
464 |
} |
2370 |
22 Apr 14 |
nicklas |
465 |
} |
5019 |
10 Oct 18 |
nicklas |
defaultColClass = null; |
2370 |
22 Apr 14 |
nicklas |
467 |
} |
2370 |
22 Apr 14 |
nicklas |
else |
2370 |
22 Apr 14 |
nicklas |
469 |
{ |
4496 |
10 May 17 |
nicklas |
cs.addColumn('rna.name', cs.asNoInfo('No RNA information has been registered')); |
4496 |
10 May 17 |
nicklas |
Doc.hide('rna-details'); |
2370 |
22 Apr 14 |
nicklas |
472 |
} |
2370 |
22 Apr 14 |
nicklas |
473 |
|
4496 |
10 May 17 |
nicklas |
var dna = response.dna; |
2370 |
22 Apr 14 |
nicklas |
if (dna && dna.length > 0) |
2370 |
22 Apr 14 |
nicklas |
476 |
{ |
6425 |
29 Sep 21 |
nicklas |
dna.sort(cs.sortByIdDescending); |
2370 |
22 Apr 14 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(dna.length-1, TRUNCATE_SIZE.length)]; |
5022 |
11 Oct 18 |
nicklas |
maxItemsInRightCol = Math.max(maxItemsInRightCol, dna.length); |
2370 |
22 Apr 14 |
nicklas |
for (var i = 0; i < dna.length; i++) |
2370 |
22 Apr 14 |
nicklas |
481 |
{ |
3179 |
09 Mar 15 |
nicklas |
try |
3179 |
09 Mar 15 |
nicklas |
483 |
{ |
3179 |
09 Mar 15 |
nicklas |
var d = dna[i]; |
5009 |
04 Oct 18 |
nicklas |
defaultColClass = cs.getDefaultColClass(d, yellowPrefixes); |
5011 |
05 Oct 18 |
nicklas |
cs.addColumn('dna.name', cs.asLink('EXTRACT', d, 0, true)); |
5009 |
04 Oct 18 |
nicklas |
cs.addColumn('dna.donotuse', cs.asDoNotUse(d)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('dna.registrationDate', cs.asDate(d.registrationDate)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('dna.storageBox', cs.asBioPlateLocation(d.bioWell)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('dna.extractionDate', cs.asDate(d.extractionDate)+cs.asLabEnvLink('http://givare2.onk.lu.se/', d.extractionDate, 'DNA extraction: ' + d.name, 'thermometer.png')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('dna.extractionProtocol', cs.asLink('PROTOCOL', d.extractionProtocol, truncateAt)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('dna.remainingQuantity', cs.asQuantity(d.remainingQuantity, ' µg')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('dna.originalQuantity', cs.asQuantity(d.originalQuantity, ' µg')); |
6220 |
20 Apr 21 |
nicklas |
cs.addColumn('dna.conc', cs.asQuantity(d.conc, ' ng/µl')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('dna.comment', cs.truncate(d.comment, truncateAt)); |
3179 |
09 Mar 15 |
nicklas |
496 |
} |
3179 |
09 Mar 15 |
nicklas |
catch (e) |
3179 |
09 Mar 15 |
nicklas |
498 |
{ |
3179 |
09 Mar 15 |
nicklas |
cs.logError('dna-info', e); |
3179 |
09 Mar 15 |
nicklas |
500 |
} |
2370 |
22 Apr 14 |
nicklas |
501 |
} |
5019 |
10 Oct 18 |
nicklas |
defaultColClass = null; |
2370 |
22 Apr 14 |
nicklas |
503 |
} |
2370 |
22 Apr 14 |
nicklas |
else |
2370 |
22 Apr 14 |
nicklas |
505 |
{ |
4496 |
10 May 17 |
nicklas |
cs.addColumn('dna.name', cs.asNoInfo('No DNA information has been registered')); |
4496 |
10 May 17 |
nicklas |
Doc.hide('dna-details'); |
2370 |
22 Apr 14 |
nicklas |
508 |
} |
2370 |
22 Apr 14 |
nicklas |
509 |
|
4496 |
10 May 17 |
nicklas |
var ft = response.flowThrough; |
2370 |
22 Apr 14 |
nicklas |
if (ft && ft.length > 0) |
2370 |
22 Apr 14 |
nicklas |
512 |
{ |
6425 |
29 Sep 21 |
nicklas |
ft.sort(cs.sortByIdDescending); |
2370 |
22 Apr 14 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(ft.length-1, TRUNCATE_SIZE.length)]; |
5022 |
11 Oct 18 |
nicklas |
maxItemsInRightCol = Math.max(maxItemsInRightCol, ft.length); |
2370 |
22 Apr 14 |
nicklas |
for (var i = 0; i < ft.length; i++) |
2370 |
22 Apr 14 |
nicklas |
517 |
{ |
3179 |
09 Mar 15 |
nicklas |
try |
3179 |
09 Mar 15 |
nicklas |
519 |
{ |
3179 |
09 Mar 15 |
nicklas |
var f = ft[i]; |
5009 |
04 Oct 18 |
nicklas |
defaultColClass = cs.getDefaultColClass(f, yellowPrefixes); |
5011 |
05 Oct 18 |
nicklas |
cs.addColumn('ft.name', cs.asLink('EXTRACT', f, 0, true)); |
5009 |
04 Oct 18 |
nicklas |
cs.addColumn('ft.donotuse', cs.asDoNotUse(f)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('ft.registrationDate', cs.asDate(f.registrationDate)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('ft.storageBox', cs.asBioPlateLocation(f.bioWell)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('ft.extractionDate', cs.asDate(f.extractionDate)+cs.asLabEnvLink('http://givare2.onk.lu.se/', f.extractionDate, 'FlowThrough extraction: ' + f.name, 'thermometer.png')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('ft.extractionProtocol', cs.asLink('PROTOCOL', f.extractionProtocol, truncateAt)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('ft.remainingQuantity', cs.asQuantity(f.remainingQuantity, ' µg')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('ft.originalQuantity', cs.asQuantity(f.originalQuantity, ' µg')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('ft.comment', cs.truncate(f.comment, truncateAt)); |
3179 |
09 Mar 15 |
nicklas |
531 |
} |
3179 |
09 Mar 15 |
nicklas |
catch (e) |
3179 |
09 Mar 15 |
nicklas |
533 |
{ |
3179 |
09 Mar 15 |
nicklas |
cs.logError('ft-info', e); |
3179 |
09 Mar 15 |
nicklas |
535 |
} |
2370 |
22 Apr 14 |
nicklas |
536 |
} |
5019 |
10 Oct 18 |
nicklas |
defaultColClass = null; |
2370 |
22 Apr 14 |
nicklas |
538 |
} |
2370 |
22 Apr 14 |
nicklas |
else |
2370 |
22 Apr 14 |
nicklas |
540 |
{ |
4496 |
10 May 17 |
nicklas |
cs.addColumn('ft.name', cs.asNoInfo('No FlowThrough information has been registered')); |
4496 |
10 May 17 |
nicklas |
Doc.hide('ft-details'); |
2370 |
22 Apr 14 |
nicklas |
543 |
} |
2370 |
22 Apr 14 |
nicklas |
544 |
|
4496 |
10 May 17 |
nicklas |
var mrna = response.mrna; |
2370 |
22 Apr 14 |
nicklas |
if (mrna && mrna.length > 0) |
2370 |
22 Apr 14 |
nicklas |
547 |
{ |
6425 |
29 Sep 21 |
nicklas |
mrna.sort(cs.sortByIdDescending); |
2370 |
22 Apr 14 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(mrna.length-1, TRUNCATE_SIZE.length)]; |
5022 |
11 Oct 18 |
nicklas |
maxItemsInRightCol = Math.max(maxItemsInRightCol, mrna.length); |
2370 |
22 Apr 14 |
nicklas |
for (var i = 0; i < mrna.length; i++) |
2370 |
22 Apr 14 |
nicklas |
552 |
{ |
3179 |
09 Mar 15 |
nicklas |
try |
3179 |
09 Mar 15 |
nicklas |
554 |
{ |
3179 |
09 Mar 15 |
nicklas |
var r = mrna[i]; |
5009 |
04 Oct 18 |
nicklas |
defaultColClass = cs.getDefaultColClass(r, yellowPrefixes); |
5011 |
05 Oct 18 |
nicklas |
cs.addColumn('mrna.name', cs.asLink('EXTRACT', r, 0, true)); |
5009 |
04 Oct 18 |
nicklas |
cs.addColumn('mrna.donotuse', cs.asDoNotUse(r)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('mrna.registrationDate', cs.asDate(r.registrationDate)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('mrna.storageBox', cs.asBioPlateLocation(r.bioWell)+cs.asFileLink(r.platePdf, 'pdffile.png')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('mrna.result', (r.result && r.result != 'Successful') ? cs.asFailInfo(r.result, 'error.png') : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('mrna.cleanupDate', cs.asDate(r.cleanupDate)+cs.asLabEnvLink('http://givare2.onk.lu.se/', r.cleanupDate, 'mRNA cleanup: ' + r.name, 'thermometer.png')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('mrna.usedQuantity', cs.asQuantity(r.usedQuantity, ' µg')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('mrna.comment', cs.truncate(r.comment, truncateAt)); |
3179 |
09 Mar 15 |
nicklas |
565 |
} |
3179 |
09 Mar 15 |
nicklas |
catch (e) |
3179 |
09 Mar 15 |
nicklas |
567 |
{ |
3179 |
09 Mar 15 |
nicklas |
cs.logError('mrna-info', e); |
3179 |
09 Mar 15 |
nicklas |
569 |
} |
2370 |
22 Apr 14 |
nicklas |
570 |
} |
5019 |
10 Oct 18 |
nicklas |
defaultColClass = null; |
2370 |
22 Apr 14 |
nicklas |
572 |
} |
2370 |
22 Apr 14 |
nicklas |
else |
2370 |
22 Apr 14 |
nicklas |
574 |
{ |
4496 |
10 May 17 |
nicklas |
cs.addColumn('mrna.name', cs.asNoInfo('No mRNA information has been registered')); |
4496 |
10 May 17 |
nicklas |
Doc.hide('mrna-details'); |
2370 |
22 Apr 14 |
nicklas |
577 |
} |
2370 |
22 Apr 14 |
nicklas |
578 |
|
4496 |
10 May 17 |
nicklas |
var cdna = response.cdna; |
2370 |
22 Apr 14 |
nicklas |
if (cdna && cdna.length > 0) |
2370 |
22 Apr 14 |
nicklas |
581 |
{ |
6425 |
29 Sep 21 |
nicklas |
cdna.sort(cs.sortByIdDescending); |
2370 |
22 Apr 14 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(cdna.length-1, TRUNCATE_SIZE.length)]; |
5022 |
11 Oct 18 |
nicklas |
maxItemsInRightCol = Math.max(maxItemsInRightCol, cdna.length); |
2370 |
22 Apr 14 |
nicklas |
for (var i = 0; i < cdna.length; i++) |
2370 |
22 Apr 14 |
nicklas |
586 |
{ |
3179 |
09 Mar 15 |
nicklas |
try |
3179 |
09 Mar 15 |
nicklas |
588 |
{ |
3179 |
09 Mar 15 |
nicklas |
var r = cdna[i]; |
5009 |
04 Oct 18 |
nicklas |
defaultColClass = cs.getDefaultColClass(r, yellowPrefixes); |
5011 |
05 Oct 18 |
nicklas |
cs.addColumn('cdna.name', cs.asLink('EXTRACT', r, 0, true)); |
5009 |
04 Oct 18 |
nicklas |
cs.addColumn('cdna.donotuse', cs.asDoNotUse(r)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('cdna.registrationDate', cs.asDate(r.registrationDate)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('cdna.storageBox', cs.asBioPlateLocation(r.bioWell)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('cdna.result', (r.result && r.result != 'Successful') ? cs.asFailInfo(r.result, 'error.png') : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('cdna.synthesisDate', cs.asDate(r.synthesisDate)+cs.asLabEnvLink('http://givare2.onk.lu.se/', r.synthesisDate, 'cDNA synthesis: ' + r.name, 'thermometer.png')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('cdna.comment', cs.truncate(r.comment, truncateAt)); |
3179 |
09 Mar 15 |
nicklas |
598 |
} |
3179 |
09 Mar 15 |
nicklas |
catch (e) |
3179 |
09 Mar 15 |
nicklas |
600 |
{ |
3179 |
09 Mar 15 |
nicklas |
cs.logError('cdna-info', e); |
3179 |
09 Mar 15 |
nicklas |
602 |
} |
2370 |
22 Apr 14 |
nicklas |
603 |
} |
5019 |
10 Oct 18 |
nicklas |
defaultColClass = null; |
2370 |
22 Apr 14 |
nicklas |
605 |
} |
2370 |
22 Apr 14 |
nicklas |
else |
2370 |
22 Apr 14 |
nicklas |
607 |
{ |
4496 |
10 May 17 |
nicklas |
cs.addColumn('cdna.name', cs.asNoInfo('No cDNA information has been registered')); |
4496 |
10 May 17 |
nicklas |
Doc.hide('cdna-details'); |
2370 |
22 Apr 14 |
nicklas |
610 |
} |
2370 |
22 Apr 14 |
nicklas |
611 |
|
4496 |
10 May 17 |
nicklas |
var lib = response.lib; |
2370 |
22 Apr 14 |
nicklas |
if (lib && lib.length > 0) |
2370 |
22 Apr 14 |
nicklas |
614 |
{ |
6425 |
29 Sep 21 |
nicklas |
lib.sort(cs.sortByIdDescending); |
2370 |
22 Apr 14 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(lib.length-1, TRUNCATE_SIZE.length)]; |
5022 |
11 Oct 18 |
nicklas |
maxItemsInRightCol = Math.max(maxItemsInRightCol, lib.length); |
2370 |
22 Apr 14 |
nicklas |
for (var i = 0; i < lib.length; i++) |
2370 |
22 Apr 14 |
nicklas |
619 |
{ |
3179 |
09 Mar 15 |
nicklas |
try |
3179 |
09 Mar 15 |
nicklas |
621 |
{ |
3179 |
09 Mar 15 |
nicklas |
var r = lib[i]; |
5009 |
04 Oct 18 |
nicklas |
defaultColClass = cs.getDefaultColClass(r, yellowPrefixes); |
5011 |
05 Oct 18 |
nicklas |
cs.addColumn('lib.name', cs.asLink('EXTRACT', r, 0, true)); |
5009 |
04 Oct 18 |
nicklas |
cs.addColumn('lib.donotuse', cs.asDoNotUse(r)); |
5522 |
24 Jun 19 |
nicklas |
cs.addColumn('lib.pipeline', r.pipeline); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('lib.registrationDate', cs.asDate(r.registrationDate)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('lib.storageBox', cs.asBioPlateLocation(r.bioWell)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('lib.result', (r.result && r.result != 'Successful') ? cs.asFailInfo(r.result, 'error.png') : null); |
5895 |
14 Apr 20 |
nicklas |
var libDate = r.cleanupDate || r.neoPrepDate || r.creationDate; |
3321 |
11 May 15 |
nicklas |
cs.addColumn('lib.libDate', cs.asDate(libDate)+cs.asLabEnvLink('http://givare2.onk.lu.se/', libDate, 'Library date: ' + r.name, 'thermometer.png')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('lib.remainingQuantity', cs.asQuantity(r.remainingQuantity, ' ng', 0.001)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('lib.originalQuantity', cs.asQuantity(r.originalQuantity, ' ng', 0.001)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('lib.barcode.name', r.barcode.name); |
3320 |
11 May 15 |
nicklas |
cs.addColumn('lib.size', cs.asQuantity(r.ca_size || r.library_size_est, '')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('lib.molarity', cs.asQuantity(r.library_molarity_est, ' nM')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('lib.adapterFrac', cs.asPercent(r.library_frac_adpt)); |
7286 |
15 Aug 23 |
nicklas |
cs.addColumn('lib.conc', cs.asQuantity(r.conc, ' ng/µl')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('lib.comment', cs.truncate(r.comment, truncateAt)); |
3179 |
09 Mar 15 |
nicklas |
640 |
} |
3179 |
09 Mar 15 |
nicklas |
catch (e) |
3179 |
09 Mar 15 |
nicklas |
642 |
{ |
3179 |
09 Mar 15 |
nicklas |
cs.logError('lib-info', e); |
3179 |
09 Mar 15 |
nicklas |
644 |
} |
2370 |
22 Apr 14 |
nicklas |
645 |
} |
5019 |
10 Oct 18 |
nicklas |
defaultColClass = null; |
2370 |
22 Apr 14 |
nicklas |
647 |
} |
2370 |
22 Apr 14 |
nicklas |
else |
2370 |
22 Apr 14 |
nicklas |
649 |
{ |
4496 |
10 May 17 |
nicklas |
cs.addColumn('lib.name', cs.asNoInfo('No library information has been registered')); |
4496 |
10 May 17 |
nicklas |
Doc.hide('lib-details'); |
2370 |
22 Apr 14 |
nicklas |
652 |
} |
2370 |
22 Apr 14 |
nicklas |
653 |
|
4496 |
10 May 17 |
nicklas |
var pooledLib = response.pooledlib; |
2370 |
22 Apr 14 |
nicklas |
if (pooledLib && pooledLib.length > 0) |
2370 |
22 Apr 14 |
nicklas |
656 |
{ |
6425 |
29 Sep 21 |
nicklas |
pooledLib.sort(cs.sortByIdDescending); |
2370 |
22 Apr 14 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(pooledLib.length-1, TRUNCATE_SIZE.length)]; |
5022 |
11 Oct 18 |
nicklas |
maxItemsInRightCol = Math.max(maxItemsInRightCol, pooledLib.length); |
2370 |
22 Apr 14 |
nicklas |
for (var i = 0; i < pooledLib.length; i++) |
2370 |
22 Apr 14 |
nicklas |
661 |
{ |
3179 |
09 Mar 15 |
nicklas |
try |
3179 |
09 Mar 15 |
nicklas |
663 |
{ |
3179 |
09 Mar 15 |
nicklas |
var r = pooledLib[i]; |
5012 |
05 Oct 18 |
nicklas |
cs.addColumn('pooledlib.name', cs.asLink('EXTRACT', r, 0, r.libNames)); |
5522 |
24 Jun 19 |
nicklas |
cs.addColumn('pooledlib.pipeline', r.pipeline); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('pooledlib.registrationDate', cs.asDate(r.registrationDate)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('pooledlib.poolDate', cs.asDate(r.poolDate)+cs.asLabEnvLink('http://givare2.onk.lu.se/', r.poolDate, 'Pooled library pooling: ' + r.name, 'thermometer.png')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('pooledlib.remainingQuantity', cs.asQuantity(r.remainingQuantity, ' ng', 0.001)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('pooledlib.originalQuantity', cs.asQuantity(r.originalQuantity, ' ng', 0.001)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('pooledlib.poolMolarity', cs.asQuantity(r.poolMolarity, ' nM')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('pooledlib.poolConc', cs.asQuantity(r.poolConc, ' ng/µl')); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('pooledlib.comment', cs.truncate(r.comment, truncateAt)); |
3179 |
09 Mar 15 |
nicklas |
674 |
} |
3179 |
09 Mar 15 |
nicklas |
catch (e) |
3179 |
09 Mar 15 |
nicklas |
676 |
{ |
3179 |
09 Mar 15 |
nicklas |
cs.logError('pooledlib-info', e); |
3179 |
09 Mar 15 |
nicklas |
678 |
} |
2370 |
22 Apr 14 |
nicklas |
679 |
} |
5019 |
10 Oct 18 |
nicklas |
defaultColClass = null; |
2370 |
22 Apr 14 |
nicklas |
681 |
} |
2370 |
22 Apr 14 |
nicklas |
else |
2370 |
22 Apr 14 |
nicklas |
683 |
{ |
4496 |
10 May 17 |
nicklas |
cs.addColumn('pooledlib.name', cs.asNoInfo('No pooled library information has been registered')); |
4496 |
10 May 17 |
nicklas |
Doc.hide('pooledlib-details'); |
2370 |
22 Apr 14 |
nicklas |
686 |
} |
2370 |
22 Apr 14 |
nicklas |
687 |
|
4496 |
10 May 17 |
nicklas |
var sequencingRuns = response.sequencingRun; |
2370 |
22 Apr 14 |
nicklas |
if (sequencingRuns && sequencingRuns.length > 0) |
2370 |
22 Apr 14 |
nicklas |
690 |
{ |
6425 |
29 Sep 21 |
nicklas |
sequencingRuns.sort(cs.sortByIdDescending); |
2370 |
22 Apr 14 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(sequencingRuns.length-1, TRUNCATE_SIZE.length)]; |
5022 |
11 Oct 18 |
nicklas |
maxItemsInRightCol = Math.max(maxItemsInRightCol, sequencingRuns.length); |
2370 |
22 Apr 14 |
nicklas |
for (var i = 0; i < sequencingRuns.length; i++) |
2370 |
22 Apr 14 |
nicklas |
695 |
{ |
3179 |
09 Mar 15 |
nicklas |
try |
3179 |
09 Mar 15 |
nicklas |
697 |
{ |
3179 |
09 Mar 15 |
nicklas |
var sr = sequencingRuns[i]; |
3179 |
09 Mar 15 |
nicklas |
var fc = sr.flowCell; |
5012 |
05 Oct 18 |
nicklas |
cs.addColumn('sequencingRun.name', cs.asLink('DERIVEDBIOASSAY', sr, 0, sr.libNames)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('sequencingRun.flowCell', cs.asLink('PHYSICALBIOASSAY', fc)); |
5522 |
24 Jun 19 |
nicklas |
cs.addColumn('sequencingRun.pipeline', sr.pipeline); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('sequencingRun.result', (sr.result && sr.result != 'Successful') ? cs.asFailInfo(sr.result, 'error.png') : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('sequencingRun.clusterDate', cs.asDate(fc.clusterDate)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('sequencingRun.startDate', cs.asDate(sr.startDate)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('sequencingRun.endDate', cs.asDate(sr.endDate)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('sequencingRun.comment', cs.truncate(sr.comment, truncateAt)); |
3179 |
09 Mar 15 |
nicklas |
708 |
} |
3179 |
09 Mar 15 |
nicklas |
catch (e) |
3179 |
09 Mar 15 |
nicklas |
710 |
{ |
3179 |
09 Mar 15 |
nicklas |
cs.logError('sequencingRun-info', e); |
3179 |
09 Mar 15 |
nicklas |
712 |
} |
2370 |
22 Apr 14 |
nicklas |
713 |
} |
5019 |
10 Oct 18 |
nicklas |
defaultColClass = null; |
2370 |
22 Apr 14 |
nicklas |
715 |
} |
2370 |
22 Apr 14 |
nicklas |
else |
2370 |
22 Apr 14 |
nicklas |
717 |
{ |
4496 |
10 May 17 |
nicklas |
cs.addColumn('sequencingRun.name', cs.asNoInfo('No sequencing information has been registered')); |
4496 |
10 May 17 |
nicklas |
Doc.hide('sequencingRun-details'); |
2370 |
22 Apr 14 |
nicklas |
720 |
} |
2370 |
22 Apr 14 |
nicklas |
721 |
|
7308 |
28 Aug 23 |
nicklas |
var mergedSequencesRNA = response.mergedSequencesRNA; |
7308 |
28 Aug 23 |
nicklas |
if (mergedSequencesRNA && mergedSequencesRNA.length > 0) |
2914 |
11 Nov 14 |
nicklas |
724 |
{ |
7308 |
28 Aug 23 |
nicklas |
mergedSequencesRNA.sort(cs.sortByIdDescending); |
7308 |
28 Aug 23 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(mergedSequencesRNA.length-1, TRUNCATE_SIZE.length)]; |
7308 |
28 Aug 23 |
nicklas |
maxItemsInRightCol = Math.max(maxItemsInRightCol, mergedSequencesRNA.length); |
7308 |
28 Aug 23 |
nicklas |
for (var i = 0; i < mergedSequencesRNA.length; i++) |
2914 |
11 Nov 14 |
nicklas |
729 |
{ |
3179 |
09 Mar 15 |
nicklas |
try |
3179 |
09 Mar 15 |
nicklas |
731 |
{ |
7308 |
28 Aug 23 |
nicklas |
var m = mergedSequencesRNA[i]; |
5009 |
04 Oct 18 |
nicklas |
defaultColClass = cs.getDefaultColClass(m, yellowPrefixes); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('mergedSequencesRNA.name', cs.asLink('DERIVEDBIOASSAY', m, 0, true)); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('mergedSequencesRNA.donotuse', cs.asDoNotUse(m)); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('mergedSequencesRNA.pipeline', m.pipeline); |
3179 |
09 Mar 15 |
nicklas |
var job = m.job; |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('mergedSequencesRNA.date', cs.asJob(job, truncateAt, 'Demuxing')); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('mergedSequencesRNA.result', (m.result && m.result != 'Successful') ? cs.asFailInfo(m.result, 'error.png') : null); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('mergedSequencesRNA.pfReads', cs.asCount(m.PF_READS)); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('mergedSequencesRNA.ptReads', cs.asCount(m.PT_READS)); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('mergedSequencesRNA.adapterReads', cs.asCount(m.ADAPTER_READS)); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('mergedSequencesRNA.comment', cs.truncate(m.comment, truncateAt)); |
3179 |
09 Mar 15 |
nicklas |
744 |
} |
3179 |
09 Mar 15 |
nicklas |
catch (e) |
3179 |
09 Mar 15 |
nicklas |
746 |
{ |
7308 |
28 Aug 23 |
nicklas |
cs.logError('mergedSequencesRNA-info', e); |
3179 |
09 Mar 15 |
nicklas |
748 |
} |
2914 |
11 Nov 14 |
nicklas |
749 |
} |
5019 |
10 Oct 18 |
nicklas |
defaultColClass = null; |
2914 |
11 Nov 14 |
nicklas |
751 |
} |
2914 |
11 Nov 14 |
nicklas |
else |
2914 |
11 Nov 14 |
nicklas |
753 |
{ |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('mergedSequencesRNA.name', cs.asNoInfo('No demux information has been registered')); |
7308 |
28 Aug 23 |
nicklas |
Doc.hide('mergedSequencesRNA-details'); |
2914 |
11 Nov 14 |
nicklas |
756 |
} |
2914 |
11 Nov 14 |
nicklas |
757 |
|
7308 |
28 Aug 23 |
nicklas |
var alignedSequencesRNA = response.alignedSequencesRNA; |
7308 |
28 Aug 23 |
nicklas |
if (alignedSequencesRNA && alignedSequencesRNA.length > 0) |
2914 |
11 Nov 14 |
nicklas |
760 |
{ |
7308 |
28 Aug 23 |
nicklas |
alignedSequencesRNA.sort(cs.sortByIdDescending); |
7308 |
28 Aug 23 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(alignedSequencesRNA.length-1, TRUNCATE_SIZE.length)]; |
7308 |
28 Aug 23 |
nicklas |
maxItemsInRightCol = Math.max(maxItemsInRightCol, alignedSequencesRNA.length); |
7308 |
28 Aug 23 |
nicklas |
for (var i = 0; i < alignedSequencesRNA.length; i++) |
2914 |
11 Nov 14 |
nicklas |
765 |
{ |
3179 |
09 Mar 15 |
nicklas |
try |
3179 |
09 Mar 15 |
nicklas |
767 |
{ |
7308 |
28 Aug 23 |
nicklas |
var a = alignedSequencesRNA[i]; |
5009 |
04 Oct 18 |
nicklas |
defaultColClass = cs.getDefaultColClass(a, yellowPrefixes); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesRNA.name', cs.asLink('DERIVEDBIOASSAY', a, 0, true)); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesRNA.donotuse', cs.asDoNotUse(a)); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesRNA.pipeline', a.pipeline); |
3179 |
09 Mar 15 |
nicklas |
var job = a.job; |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesRNA.software', cs.asLink('SOFTWARE', a.software, truncateAt)); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesRNA.date', cs.asJob(job, truncateAt, 'Aligning')); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesRNA.result', (a.result && a.result != 'Successful') ? cs.asFailInfo(a.result, 'error.png') : null); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesRNA.alignedPairs', cs.asCount(a.ALIGNED_PAIRS)); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesRNA.fractionDuplication', cs.asPercent(a.FRACTION_DUPLICATION, true)); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesRNA.genotypeQc', cs.asGenotypeQc(a)); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesRNA.comment', cs.truncate(a.comment, truncateAt)); |
3179 |
09 Mar 15 |
nicklas |
781 |
} |
3179 |
09 Mar 15 |
nicklas |
catch (e) |
3179 |
09 Mar 15 |
nicklas |
783 |
{ |
7308 |
28 Aug 23 |
nicklas |
cs.logError('alignedSequencesRNA-info', e); |
3179 |
09 Mar 15 |
nicklas |
785 |
} |
2914 |
11 Nov 14 |
nicklas |
786 |
} |
5019 |
10 Oct 18 |
nicklas |
defaultColClass = null; |
2914 |
11 Nov 14 |
nicklas |
788 |
} |
2914 |
11 Nov 14 |
nicklas |
else |
2914 |
11 Nov 14 |
nicklas |
790 |
{ |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesRNA.name', cs.asNoInfo('No aligned information has been registered')); |
7308 |
28 Aug 23 |
nicklas |
Doc.hide('alignedSequencesRNA-details'); |
2914 |
11 Nov 14 |
nicklas |
793 |
} |
2914 |
11 Nov 14 |
nicklas |
794 |
|
4496 |
10 May 17 |
nicklas |
var rawBioAssays = response.rawBioAssays; |
2918 |
11 Nov 14 |
nicklas |
if (rawBioAssays && rawBioAssays.length > 0) |
2918 |
11 Nov 14 |
nicklas |
797 |
{ |
6425 |
29 Sep 21 |
nicklas |
rawBioAssays.sort(cs.sortByIdDescending); |
2918 |
11 Nov 14 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(rawBioAssays.length-1, TRUNCATE_SIZE.length)]; |
5022 |
11 Oct 18 |
nicklas |
maxItemsInRightCol = Math.max(maxItemsInRightCol, rawBioAssays.length); |
2918 |
11 Nov 14 |
nicklas |
for (var i = 0; i < rawBioAssays.length; i++) |
2918 |
11 Nov 14 |
nicklas |
802 |
{ |
3179 |
09 Mar 15 |
nicklas |
try |
3179 |
09 Mar 15 |
nicklas |
804 |
{ |
3179 |
09 Mar 15 |
nicklas |
var raw = rawBioAssays[i]; |
5009 |
04 Oct 18 |
nicklas |
defaultColClass = cs.getDefaultColClass(raw, yellowPrefixes); |
5011 |
05 Oct 18 |
nicklas |
cs.addColumn('rawBioAssays.name', cs.asLink('RAWBIOASSAY', raw, 0, true)); |
5009 |
04 Oct 18 |
nicklas |
cs.addColumn('rawBioAssays.donotuse', cs.asDoNotUse(raw)); |
5548 |
08 Aug 19 |
nicklas |
cs.addColumn('rawBioAssays.pipeline', raw.pipeline); |
3179 |
09 Mar 15 |
nicklas |
var job = raw.job; |
3179 |
09 Mar 15 |
nicklas |
var geneReport = raw.geneReport; |
3534 |
08 Oct 15 |
nicklas |
var pilotReport = raw.pilotReport; |
6094 |
14 Dec 20 |
nicklas |
var scanbReport = raw.scanbReport; |
4674 |
08 Feb 18 |
nicklas |
cs.addColumn('rawBioAssays.type', Strings.encodeTags(raw.rawDataType)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('rawBioAssays.date', cs.asJob(job, truncateAt)); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('rawBioAssays.result', (raw.result && raw.result != 'Successful') ? cs.asFailInfo(raw.result, 'error.png') : null); |
3179 |
09 Mar 15 |
nicklas |
cs.addColumn('rawBioAssays.geneReport', geneReport && geneReport.type == 'FILE' ? 'Yes '+cs.asFileLink(geneReport, 'pdffile.png') : 'No'); |
3534 |
08 Oct 15 |
nicklas |
cs.addColumn('rawBioAssays.pilotReport', pilotReport && pilotReport.type == 'FILE' ? 'Yes '+cs.asFileLink(pilotReport, 'pdffile.png') : 'No'); |
6094 |
14 Dec 20 |
nicklas |
cs.addColumn('rawBioAssays.scanbReport', scanbReport && scanbReport.type == 'FILE' ? 'Yes '+cs.asFileLink(scanbReport, 'pdffile.png') : 'No'); |
5731 |
19 Nov 19 |
nicklas |
cs.addColumn('rawBioAssays.comment', cs.truncate(raw.comment, truncateAt)); |
3179 |
09 Mar 15 |
nicklas |
821 |
} |
3179 |
09 Mar 15 |
nicklas |
catch (e) |
3179 |
09 Mar 15 |
nicklas |
823 |
{ |
3179 |
09 Mar 15 |
nicklas |
cs.logError('rawBioAssays-info', e); |
3179 |
09 Mar 15 |
nicklas |
825 |
} |
2918 |
11 Nov 14 |
nicklas |
826 |
} |
5019 |
10 Oct 18 |
nicklas |
defaultColClass = null; |
2918 |
11 Nov 14 |
nicklas |
828 |
} |
2918 |
11 Nov 14 |
nicklas |
else |
2918 |
11 Nov 14 |
nicklas |
830 |
{ |
4496 |
10 May 17 |
nicklas |
cs.addColumn('rawBioAssays.name', cs.asNoInfo('No raw bioassay information has been registered')); |
4496 |
10 May 17 |
nicklas |
Doc.hide('rawBioAssays-details'); |
2918 |
11 Nov 14 |
nicklas |
833 |
} |
2914 |
11 Nov 14 |
nicklas |
834 |
|
7411 |
10 Nov 23 |
nicklas |
var variantCallingRNA = response.variantCallingRNA; |
7411 |
10 Nov 23 |
nicklas |
if (variantCallingRNA && variantCallingRNA.length > 0) |
5731 |
19 Nov 19 |
nicklas |
837 |
{ |
7411 |
10 Nov 23 |
nicklas |
variantCallingRNA.sort(cs.sortByIdDescending); |
7411 |
10 Nov 23 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(variantCallingRNA.length-1, TRUNCATE_SIZE.length)]; |
7411 |
10 Nov 23 |
nicklas |
maxItemsInRightCol = Math.max(maxItemsInRightCol, variantCallingRNA.length); |
7411 |
10 Nov 23 |
nicklas |
for (var i = 0; i < variantCallingRNA.length; i++) |
5731 |
19 Nov 19 |
nicklas |
842 |
{ |
5731 |
19 Nov 19 |
nicklas |
try |
5731 |
19 Nov 19 |
nicklas |
844 |
{ |
7411 |
10 Nov 23 |
nicklas |
var vcall = variantCallingRNA[i]; |
5731 |
19 Nov 19 |
nicklas |
defaultColClass = cs.getDefaultColClass(vcall, yellowPrefixes); |
7411 |
10 Nov 23 |
nicklas |
cs.addColumn('variantCallingRNA.name', cs.asLink('RAWBIOASSAY', vcall, 0, true)); |
7411 |
10 Nov 23 |
nicklas |
cs.addColumn('variantCallingRNA.donotuse', cs.asDoNotUse(vcall)); |
7411 |
10 Nov 23 |
nicklas |
cs.addColumn('variantCallingRNA.pipeline', vcall.pipeline); |
5760 |
26 Nov 19 |
nicklas |
var job = vcall.job; |
7411 |
10 Nov 23 |
nicklas |
cs.addColumn('variantCallingRNA.date', cs.asJob(job, truncateAt)); |
7411 |
10 Nov 23 |
nicklas |
cs.addColumn('variantCallingRNA.result', (vcall.result && vcall.result != 'Successful') ? cs.asFailInfo(vcall.result, 'error.png') : null); |
7411 |
10 Nov 23 |
nicklas |
cs.addColumn('variantCallingRNA.variants', cs.asVariantsFile(vcall)); |
6393 |
16 Sep 21 |
nicklas |
854 |
|
6393 |
16 Sep 21 |
nicklas |
var genotypingHtml = ''; |
6393 |
16 Sep 21 |
nicklas |
if (vcall.targetedGenotyping) |
6393 |
16 Sep 21 |
nicklas |
857 |
{ |
6393 |
16 Sep 21 |
nicklas |
for (var gtNo = 0; gtNo < vcall.targetedGenotyping.length; gtNo++) |
6393 |
16 Sep 21 |
nicklas |
859 |
{ |
6393 |
16 Sep 21 |
nicklas |
var gt = vcall.targetedGenotyping[gtNo]; |
6393 |
16 Sep 21 |
nicklas |
genotypingHtml += cs.asTargetedGenotypeFile(vcall, gt); |
6393 |
16 Sep 21 |
nicklas |
862 |
} |
6393 |
16 Sep 21 |
nicklas |
863 |
} |
7411 |
10 Nov 23 |
nicklas |
cs.addColumn('variantCallingRNA.genotyping', genotypingHtml); |
7411 |
10 Nov 23 |
nicklas |
cs.addColumn('variantCallingRNA.comment', cs.truncate(vcall.comment, truncateAt)); |
5731 |
19 Nov 19 |
nicklas |
866 |
} |
5731 |
19 Nov 19 |
nicklas |
catch (e) |
5731 |
19 Nov 19 |
nicklas |
868 |
{ |
7411 |
10 Nov 23 |
nicklas |
cs.logError('variantCallingRNA-info', e); |
5731 |
19 Nov 19 |
nicklas |
870 |
} |
5731 |
19 Nov 19 |
nicklas |
871 |
} |
5731 |
19 Nov 19 |
nicklas |
defaultColClass = null; |
5731 |
19 Nov 19 |
nicklas |
873 |
} |
5731 |
19 Nov 19 |
nicklas |
else |
5731 |
19 Nov 19 |
nicklas |
875 |
{ |
7411 |
10 Nov 23 |
nicklas |
cs.addColumn('variantCallingRNA.name', cs.asNoInfo('No variant calling information has been registered')); |
7411 |
10 Nov 23 |
nicklas |
Doc.hide('variantCallingRNA-details'); |
5731 |
19 Nov 19 |
nicklas |
878 |
} |
7308 |
28 Aug 23 |
nicklas |
879 |
|
7308 |
28 Aug 23 |
nicklas |
var mergedSequencesDNA = response.mergedSequencesDNA; |
7308 |
28 Aug 23 |
nicklas |
if (mergedSequencesDNA && mergedSequencesDNA.length > 0) |
7308 |
28 Aug 23 |
nicklas |
882 |
{ |
7308 |
28 Aug 23 |
nicklas |
mergedSequencesDNA.sort(cs.sortByIdDescending); |
7308 |
28 Aug 23 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(mergedSequencesDNA.length-1, TRUNCATE_SIZE.length)]; |
7308 |
28 Aug 23 |
nicklas |
maxItemsInRightCol = Math.max(maxItemsInRightCol, mergedSequencesDNA.length); |
7308 |
28 Aug 23 |
nicklas |
for (var i = 0; i < mergedSequencesDNA.length; i++) |
7308 |
28 Aug 23 |
nicklas |
887 |
{ |
7308 |
28 Aug 23 |
nicklas |
try |
7308 |
28 Aug 23 |
nicklas |
889 |
{ |
7308 |
28 Aug 23 |
nicklas |
var m = mergedSequencesDNA[i]; |
7308 |
28 Aug 23 |
nicklas |
defaultColClass = cs.getDefaultColClass(m, yellowPrefixes); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('mergedSequencesDNA.name', cs.asLink('DERIVEDBIOASSAY', m, 0, true)); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('mergedSequencesDNA.donotuse', cs.asDoNotUse(m)); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('mergedSequencesDNA.pipeline', m.pipeline); |
7308 |
28 Aug 23 |
nicklas |
var job = m.job; |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('mergedSequencesDNA.date', cs.asJob(job, truncateAt, 'Demuxing')); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('mergedSequencesDNA.result', (m.result && m.result != 'Successful') ? cs.asFailInfo(m.result, 'error.png') : null); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('mergedSequencesDNA.reads', cs.asCount(m.READS)); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('mergedSequencesDNA.comment', cs.truncate(m.comment, truncateAt)); |
7308 |
28 Aug 23 |
nicklas |
900 |
} |
7308 |
28 Aug 23 |
nicklas |
catch (e) |
7308 |
28 Aug 23 |
nicklas |
902 |
{ |
7308 |
28 Aug 23 |
nicklas |
cs.logError('mergedSequencesDNA-info', e); |
7308 |
28 Aug 23 |
nicklas |
904 |
} |
7308 |
28 Aug 23 |
nicklas |
905 |
} |
7308 |
28 Aug 23 |
nicklas |
defaultColClass = null; |
7308 |
28 Aug 23 |
nicklas |
907 |
} |
7308 |
28 Aug 23 |
nicklas |
else |
7308 |
28 Aug 23 |
nicklas |
909 |
{ |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('mergedSequencesDNA.name', cs.asNoInfo('No demux information has been registered')); |
7308 |
28 Aug 23 |
nicklas |
Doc.hide('mergedSequencesDNA-details'); |
7308 |
28 Aug 23 |
nicklas |
912 |
} |
7308 |
28 Aug 23 |
nicklas |
913 |
|
7308 |
28 Aug 23 |
nicklas |
var alignedSequencesDNA = response.alignedSequencesDNA; |
7308 |
28 Aug 23 |
nicklas |
if (alignedSequencesDNA && alignedSequencesDNA.length > 0) |
7308 |
28 Aug 23 |
nicklas |
916 |
{ |
7308 |
28 Aug 23 |
nicklas |
alignedSequencesDNA.sort(cs.sortByIdDescending); |
7308 |
28 Aug 23 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(alignedSequencesDNA.length-1, TRUNCATE_SIZE.length)]; |
7308 |
28 Aug 23 |
nicklas |
maxItemsInRightCol = Math.max(maxItemsInRightCol, alignedSequencesDNA.length); |
7308 |
28 Aug 23 |
nicklas |
for (var i = 0; i < alignedSequencesDNA.length; i++) |
7308 |
28 Aug 23 |
nicklas |
921 |
{ |
7308 |
28 Aug 23 |
nicklas |
try |
7308 |
28 Aug 23 |
nicklas |
923 |
{ |
7308 |
28 Aug 23 |
nicklas |
var a = alignedSequencesDNA[i]; |
7308 |
28 Aug 23 |
nicklas |
defaultColClass = cs.getDefaultColClass(a, yellowPrefixes); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesDNA.name', cs.asLink('DERIVEDBIOASSAY', a, 0, true)); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesDNA.donotuse', cs.asDoNotUse(a)); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesDNA.pipeline', a.pipeline); |
7308 |
28 Aug 23 |
nicklas |
var job = a.job; |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesDNA.software', cs.asLink('SOFTWARE', a.software, truncateAt)); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesDNA.date', cs.asJob(job, truncateAt, 'Aligning')); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesDNA.result', (a.result && a.result != 'Successful') ? cs.asFailInfo(a.result, 'error.png') : null); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesDNA.alignedPairs', cs.asCount(a.ALIGNED_PAIRS)); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesDNA.coverage', Reggie.formatNumber(a.MEAN_COVERAGE)+' ± '+Reggie.formatNumber(a.SD_COVERAGE)); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesDNA.fractionDuplication', cs.asPercent(a.FRACTION_DUPLICATION, true)+' (<span title="Optical duplicates">'+cs.asPercent(a.FRACTION_OPTICAL_DUPLICATION, true)+'</span>)'); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesDNA.genotypeQc', cs.asGenotypeQc(a)); |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesDNA.comment', cs.truncate(a.comment, truncateAt)); |
7308 |
28 Aug 23 |
nicklas |
938 |
} |
7308 |
28 Aug 23 |
nicklas |
catch (e) |
7308 |
28 Aug 23 |
nicklas |
940 |
{ |
7308 |
28 Aug 23 |
nicklas |
cs.logError('alignedSequencesDNA-info', e); |
7308 |
28 Aug 23 |
nicklas |
942 |
} |
7308 |
28 Aug 23 |
nicklas |
943 |
} |
7308 |
28 Aug 23 |
nicklas |
defaultColClass = null; |
7308 |
28 Aug 23 |
nicklas |
945 |
} |
7308 |
28 Aug 23 |
nicklas |
else |
7308 |
28 Aug 23 |
nicklas |
947 |
{ |
7308 |
28 Aug 23 |
nicklas |
cs.addColumn('alignedSequencesDNA.name', cs.asNoInfo('No aligned information has been registered')); |
7308 |
28 Aug 23 |
nicklas |
Doc.hide('alignedSequencesDNA-details'); |
7308 |
28 Aug 23 |
nicklas |
950 |
} |
5731 |
19 Nov 19 |
nicklas |
951 |
|
7296 |
23 Aug 23 |
nicklas |
var copyNumber = response.copyNumber; |
7296 |
23 Aug 23 |
nicklas |
if (copyNumber && copyNumber.length > 0) |
7296 |
23 Aug 23 |
nicklas |
954 |
{ |
7296 |
23 Aug 23 |
nicklas |
copyNumber.sort(cs.sortByIdDescending); |
7296 |
23 Aug 23 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(copyNumber.length-1, TRUNCATE_SIZE.length)]; |
7296 |
23 Aug 23 |
nicklas |
maxItemsInRightCol = Math.max(maxItemsInRightCol, copyNumber.length); |
7296 |
23 Aug 23 |
nicklas |
for (var i = 0; i < copyNumber.length; i++) |
7296 |
23 Aug 23 |
nicklas |
959 |
{ |
7296 |
23 Aug 23 |
nicklas |
try |
7296 |
23 Aug 23 |
nicklas |
961 |
{ |
7296 |
23 Aug 23 |
nicklas |
var cn = copyNumber[i]; |
7296 |
23 Aug 23 |
nicklas |
defaultColClass = cs.getDefaultColClass(cn, yellowPrefixes); |
7296 |
23 Aug 23 |
nicklas |
cs.addColumn('copyNumber.name', cs.asLink('DERIVEDBIOASSAY', cn, 0, true)); |
7296 |
23 Aug 23 |
nicklas |
cs.addColumn('copyNumber.donotuse', cs.asDoNotUse(cn)); |
7296 |
23 Aug 23 |
nicklas |
cs.addColumn('copyNumber.pipeline', cn.pipeline); |
7296 |
23 Aug 23 |
nicklas |
var job = cn.job; |
7296 |
23 Aug 23 |
nicklas |
cs.addColumn('copyNumber.date', cs.asJob(job, truncateAt)); |
7298 |
24 Aug 23 |
nicklas |
var parameters = []; |
7341 |
11 Sep 23 |
nicklas |
if (cn.ImbalanceTest) parameters[parameters.length] = Strings.encodeTags(cn.ImbalanceTest); |
7341 |
11 Sep 23 |
nicklas |
if (cn.Penalty) parameters[parameters.length] = 'p='+cn.Penalty; |
7341 |
11 Sep 23 |
nicklas |
if (cn.MinDepth) parameters[parameters.length] = 'dp='+cn.MinDepth; |
7298 |
24 Aug 23 |
nicklas |
if (cn.TauManual) parameters[parameters.length] = 'τ='+cn.TauManual; |
7298 |
24 Aug 23 |
nicklas |
if (cn.RhoManual) parameters[parameters.length] = 'ρ='+cn.RhoManual; |
7298 |
24 Aug 23 |
nicklas |
if (cn.PsiManual) parameters[parameters.length] = 'ψ='+cn.PsiManual; |
7298 |
24 Aug 23 |
nicklas |
cs.addColumn('copyNumber.parameters', parameters.join(', ')); |
7296 |
23 Aug 23 |
nicklas |
cs.addColumn('copyNumber.result', cn.AscatResult); |
7341 |
11 Sep 23 |
nicklas |
cs.addColumn('copyNumber.ploidy', Reggie.formatNumber(cn.Ploidy, null, 2)+(cn.NonAberrant=='Yes'?'; Non-aberrant':'')); |
7296 |
23 Aug 23 |
nicklas |
cs.addColumn('copyNumber.purity', cs.asPercent(cn.Purity, true, 0)); |
7296 |
23 Aug 23 |
nicklas |
cs.addColumn('copyNumber.gof', cs.asPercent(cn.GoodnessOfFit, false, 2)); |
7296 |
23 Aug 23 |
nicklas |
var plots = []; |
7296 |
23 Aug 23 |
nicklas |
if (cn.sunrisePlot) plots[plots.length] = cs.asFileLink(cn.sunrisePlot, 'ascatsunrise.png', 'Sunrise plot', 800, 800); |
7296 |
23 Aug 23 |
nicklas |
if (cn.ascatProfile) plots[plots.length] = cs.asFileLink(cn.ascatProfile, 'ascatprofile.png', 'ASCAT profile plot', 1500, 800); |
7296 |
23 Aug 23 |
nicklas |
if (cn.segmentationPlot) plots[plots.length] = cs.asFileLink(cn.segmentationPlot, 'aspcf.png', 'Segmentation plot', 1200, 800); |
7296 |
23 Aug 23 |
nicklas |
985 |
|
7296 |
23 Aug 23 |
nicklas |
cs.addColumn('copyNumber.plots', plots.join(' ')); |
7296 |
23 Aug 23 |
nicklas |
cs.addColumn('copyNumber.comment', cs.truncate(cn.comment, truncateAt)); |
7296 |
23 Aug 23 |
nicklas |
988 |
} |
7296 |
23 Aug 23 |
nicklas |
catch (e) |
7296 |
23 Aug 23 |
nicklas |
990 |
{ |
7296 |
23 Aug 23 |
nicklas |
cs.logError('copyNumber-info', e); |
7296 |
23 Aug 23 |
nicklas |
992 |
} |
7296 |
23 Aug 23 |
nicklas |
993 |
} |
7296 |
23 Aug 23 |
nicklas |
defaultColClass = null; |
7296 |
23 Aug 23 |
nicklas |
995 |
} |
7296 |
23 Aug 23 |
nicklas |
else |
7296 |
23 Aug 23 |
nicklas |
997 |
{ |
7296 |
23 Aug 23 |
nicklas |
cs.addColumn('copyNumber.name', cs.asNoInfo('No copy number information has been registered')); |
7296 |
23 Aug 23 |
nicklas |
Doc.hide('copyNumber-details'); |
7296 |
23 Aug 23 |
nicklas |
1000 |
} |
7296 |
23 Aug 23 |
nicklas |
1001 |
|
7411 |
10 Nov 23 |
nicklas |
var variantCallingDNA = response.variantCallingDNA; |
7411 |
10 Nov 23 |
nicklas |
if (variantCallingDNA && variantCallingDNA.length > 0) |
7411 |
10 Nov 23 |
nicklas |
1004 |
{ |
7411 |
10 Nov 23 |
nicklas |
variantCallingDNA.sort(cs.sortByIdDescending); |
7411 |
10 Nov 23 |
nicklas |
var truncateAt = TRUNCATE_SIZE[Math.min(variantCallingDNA.length-1, TRUNCATE_SIZE.length)]; |
7411 |
10 Nov 23 |
nicklas |
maxItemsInRightCol = Math.max(maxItemsInRightCol, variantCallingDNA.length); |
7411 |
10 Nov 23 |
nicklas |
for (var i = 0; i < variantCallingDNA.length; i++) |
7411 |
10 Nov 23 |
nicklas |
1009 |
{ |
7411 |
10 Nov 23 |
nicklas |
try |
7411 |
10 Nov 23 |
nicklas |
1011 |
{ |
7411 |
10 Nov 23 |
nicklas |
var vcall = variantCallingDNA[i]; |
7411 |
10 Nov 23 |
nicklas |
defaultColClass = cs.getDefaultColClass(vcall, yellowPrefixes); |
7411 |
10 Nov 23 |
nicklas |
cs.addColumn('variantCallingDNA.name', cs.asLink('RAWBIOASSAY', vcall, 0, true)); |
7411 |
10 Nov 23 |
nicklas |
cs.addColumn('variantCallingDNA.donotuse', cs.asDoNotUse(vcall)); |
7411 |
10 Nov 23 |
nicklas |
cs.addColumn('variantCallingDNA.pipeline', vcall.pipeline); |
7411 |
10 Nov 23 |
nicklas |
var job = vcall.job; |
7411 |
10 Nov 23 |
nicklas |
cs.addColumn('variantCallingDNA.date', cs.asJob(job, truncateAt)); |
7440 |
16 Nov 23 |
nicklas |
cs.addColumn('variantCallingDNA.pon', vcall.PanelOfNormals); |
7411 |
10 Nov 23 |
nicklas |
cs.addColumn('variantCallingDNA.result', (vcall.result && vcall.result != 'Successful') ? cs.asFailInfo(vcall.result, 'error.png') : null); |
7423 |
14 Nov 23 |
nicklas |
cs.addColumn('variantCallingDNA.variants', cs.asWgsVariantsFile(vcall)); |
7411 |
10 Nov 23 |
nicklas |
cs.addColumn('variantCallingDNA.callableBases', cs.asCount(vcall.CallableBases)); |
7411 |
10 Nov 23 |
nicklas |
cs.addColumn('variantCallingDNA.comment', cs.truncate(vcall.comment, truncateAt)); |
7411 |
10 Nov 23 |
nicklas |
1024 |
} |
7411 |
10 Nov 23 |
nicklas |
catch (e) |
7411 |
10 Nov 23 |
nicklas |
1026 |
{ |
7411 |
10 Nov 23 |
nicklas |
cs.logError('variantCallingRNA-info', e); |
7411 |
10 Nov 23 |
nicklas |
1028 |
} |
7411 |
10 Nov 23 |
nicklas |
1029 |
} |
7411 |
10 Nov 23 |
nicklas |
defaultColClass = null; |
7411 |
10 Nov 23 |
nicklas |
1031 |
} |
7411 |
10 Nov 23 |
nicklas |
else |
7411 |
10 Nov 23 |
nicklas |
1033 |
{ |
7411 |
10 Nov 23 |
nicklas |
cs.addColumn('variantCallingRNA.name', cs.asNoInfo('No variant calling information has been registered')); |
7411 |
10 Nov 23 |
nicklas |
Doc.hide('variantCallingRNA-details'); |
7411 |
10 Nov 23 |
nicklas |
1036 |
} |
7411 |
10 Nov 23 |
nicklas |
1037 |
|
5731 |
19 Nov 19 |
nicklas |
1038 |
|
2370 |
22 Apr 14 |
nicklas |
var linkedItems = document.getElementsByClassName('linked-item'); |
2370 |
22 Apr 14 |
nicklas |
for (var itemNo = 0; itemNo < linkedItems.length; itemNo++) |
2370 |
22 Apr 14 |
nicklas |
1041 |
{ |
2370 |
22 Apr 14 |
nicklas |
Events.addEventHandler(linkedItems[itemNo], 'click', Items.itemOnClick); |
2370 |
22 Apr 14 |
nicklas |
1043 |
} |
2370 |
22 Apr 14 |
nicklas |
1044 |
|
2370 |
22 Apr 14 |
nicklas |
var linkedFiles = document.getElementsByClassName('linked-file'); |
2370 |
22 Apr 14 |
nicklas |
for (var fileNo = 0; fileNo < linkedFiles.length; fileNo++) |
2370 |
22 Apr 14 |
nicklas |
1047 |
{ |
7296 |
23 Aug 23 |
nicklas |
Events.addEventHandler(linkedFiles[fileNo], 'click', Data.get(linkedFiles[fileNo], 'width') ? cs.openFileInPopup : Files.viewFileOnClick); |
2370 |
22 Apr 14 |
nicklas |
1049 |
} |
2370 |
22 Apr 14 |
nicklas |
1050 |
|
7151 |
09 May 23 |
nicklas |
var linkedJson = document.getElementsByClassName('json-import-file'); |
7151 |
09 May 23 |
nicklas |
for (var i = 0; i < linkedJson.length; i++) |
7151 |
09 May 23 |
nicklas |
1053 |
{ |
7151 |
09 May 23 |
nicklas |
Events.addEventHandler(linkedJson[i], 'click', cs.jsonImportFileOnClick); |
7151 |
09 May 23 |
nicklas |
1055 |
} |
7151 |
09 May 23 |
nicklas |
1056 |
|
4621 |
16 Nov 17 |
nicklas |
var linkedVcf = document.getElementsByClassName('vcf-link'); |
4621 |
16 Nov 17 |
nicklas |
for (var i = 0; i < linkedVcf.length; i++) |
4621 |
16 Nov 17 |
nicklas |
1059 |
{ |
4621 |
16 Nov 17 |
nicklas |
Events.addEventHandler(linkedVcf[i], 'click', cs.vcfLinkOnClick); |
4621 |
16 Nov 17 |
nicklas |
1061 |
} |
5731 |
19 Nov 19 |
nicklas |
1062 |
|
5731 |
19 Nov 19 |
nicklas |
var linkedVcf = document.getElementsByClassName('variants-link'); |
5731 |
19 Nov 19 |
nicklas |
for (var i = 0; i < linkedVcf.length; i++) |
5731 |
19 Nov 19 |
nicklas |
1065 |
{ |
5731 |
19 Nov 19 |
nicklas |
Events.addEventHandler(linkedVcf[i], 'click', cs.variantsLinkOnClick); |
5731 |
19 Nov 19 |
nicklas |
1067 |
} |
4621 |
16 Nov 17 |
nicklas |
1068 |
|
2501 |
12 Jun 14 |
olle |
var linkedLabEnvs = document.getElementsByClassName('linked-labenv'); |
2501 |
12 Jun 14 |
olle |
for (var labEnvNo = 0; labEnvNo < linkedLabEnvs.length; labEnvNo++) |
2501 |
12 Jun 14 |
olle |
1071 |
{ |
2501 |
12 Jun 14 |
olle |
Events.addEventHandler(linkedLabEnvs[labEnvNo], 'click', LabEnvs.viewDataOnClick); |
2501 |
12 Jun 14 |
olle |
1073 |
} |
2501 |
12 Jun 14 |
olle |
1074 |
|
2370 |
22 Apr 14 |
nicklas |
var linkedCases = document.getElementsByClassName('linked-case'); |
2370 |
22 Apr 14 |
nicklas |
for (var caseNo = 0; caseNo < linkedCases.length; caseNo++) |
2370 |
22 Apr 14 |
nicklas |
1077 |
{ |
2370 |
22 Apr 14 |
nicklas |
Events.addEventHandler(linkedCases[caseNo], 'click', cs.caseSummary); |
2370 |
22 Apr 14 |
nicklas |
1079 |
} |
5011 |
05 Oct 18 |
nicklas |
1080 |
|
5011 |
05 Oct 18 |
nicklas |
chainedItems = document.getElementsByClassName('chained-item'); |
5011 |
05 Oct 18 |
nicklas |
for (var itemNo = 0; itemNo < chainedItems.length; itemNo++) |
5011 |
05 Oct 18 |
nicklas |
1083 |
{ |
5019 |
10 Oct 18 |
nicklas |
Events.addEventHandler(chainedItems[itemNo], 'click', cs.chainedItemOnClick); |
5011 |
05 Oct 18 |
nicklas |
1085 |
} |
5019 |
10 Oct 18 |
nicklas |
1086 |
|
5059 |
29 Oct 18 |
nicklas |
if (maxItemsInRightCol >= Math.max(3, 2*maxItemsInLeftCol)) |
5022 |
11 Oct 18 |
nicklas |
1088 |
{ |
5022 |
11 Oct 18 |
nicklas |
Doc.element('columnBalance').value = 4; |
5022 |
11 Oct 18 |
nicklas |
Events.sendChangeEvent('columnBalance'); |
5022 |
11 Oct 18 |
nicklas |
1091 |
} |
5059 |
29 Oct 18 |
nicklas |
else if (maxItemsInLeftCol >= Math.max(3, 2*maxItemsInRightCol)) |
5022 |
11 Oct 18 |
nicklas |
1093 |
{ |
5022 |
11 Oct 18 |
nicklas |
Doc.element('columnBalance').value = 2; |
5022 |
11 Oct 18 |
nicklas |
Events.sendChangeEvent('columnBalance'); |
5022 |
11 Oct 18 |
nicklas |
1096 |
} |
5022 |
11 Oct 18 |
nicklas |
1097 |
|
5019 |
10 Oct 18 |
nicklas |
var highlight = Data.get('page-data', 'highlight')+'.'; |
5019 |
10 Oct 18 |
nicklas |
if (highlight) |
5019 |
10 Oct 18 |
nicklas |
1100 |
{ |
5019 |
10 Oct 18 |
nicklas |
var targetList = highlight.split(','); |
5021 |
11 Oct 18 |
nicklas |
var rootItem = cs.highlightChainedItems(targetList, targetList[0]); |
5021 |
11 Oct 18 |
nicklas |
if (rootItem) |
5021 |
11 Oct 18 |
nicklas |
1104 |
{ |
6479 |
09 Nov 21 |
nicklas |
// Repeat once more if the root item has a list of related chain-id values |
6479 |
09 Nov 21 |
nicklas |
var targetList = Data.get(rootItem, 'chain-id').split(','); |
6479 |
09 Nov 21 |
nicklas |
if (targetList.length > 1) cs.highlightChainedItems(targetList); |
5021 |
11 Oct 18 |
nicklas |
Doc.addClass(rootItem.parentNode, 'rootitem'); |
5021 |
11 Oct 18 |
nicklas |
1109 |
} |
5019 |
10 Oct 18 |
nicklas |
1110 |
} |
2370 |
22 Apr 14 |
nicklas |
1111 |
} |
2370 |
22 Apr 14 |
nicklas |
1112 |
|
5019 |
10 Oct 18 |
nicklas |
cs.chainedItemOnClick = function(event) |
5019 |
10 Oct 18 |
nicklas |
1114 |
{ |
5019 |
10 Oct 18 |
nicklas |
// A possible list of 'chain-id' values that should be highlighted |
5019 |
10 Oct 18 |
nicklas |
var targetList = Data.get(event.currentTarget, 'chain-id').split(','); |
5019 |
10 Oct 18 |
nicklas |
cs.highlightChainedItems(targetList); |
5021 |
11 Oct 18 |
nicklas |
Doc.addClass(event.currentTarget.parentNode, 'rootitem'); |
5019 |
10 Oct 18 |
nicklas |
1119 |
} |
5011 |
05 Oct 18 |
nicklas |
1120 |
|
5011 |
05 Oct 18 |
nicklas |
1121 |
/** |
5011 |
05 Oct 18 |
nicklas |
Highlight all items that share part of the name with the target |
5011 |
05 Oct 18 |
nicklas |
that was clicked. Note that parent items have a shorter name and |
5011 |
05 Oct 18 |
nicklas |
child items have a longer name so we need two tests. |
5011 |
05 Oct 18 |
nicklas |
1125 |
*/ |
5019 |
10 Oct 18 |
nicklas |
cs.highlightChainedItems = function(targetList, scrollTo) |
5011 |
05 Oct 18 |
nicklas |
1127 |
{ |
5019 |
10 Oct 18 |
nicklas |
// 'targetList' is a possible list of 'chain-id' values that should be highlighted |
5021 |
11 Oct 18 |
nicklas |
// 'autoScroll' is used as a marker so that that only the first <td> within the same <table> is scrolled into view |
5021 |
11 Oct 18 |
nicklas |
var autoScroll = new Date().getTime(); |
5021 |
11 Oct 18 |
nicklas |
var rootItem = null; |
5011 |
05 Oct 18 |
nicklas |
for (var itemNo = 0; itemNo < chainedItems.length; itemNo++) |
5011 |
05 Oct 18 |
nicklas |
1133 |
{ |
5011 |
05 Oct 18 |
nicklas |
var item = chainedItems[itemNo]; |
5012 |
05 Oct 18 |
nicklas |
var chainId = Data.get(item, 'chain-id').split(','); |
5012 |
05 Oct 18 |
nicklas |
var inChain = cs.hasCommonElement(targetList, chainId); |
5011 |
05 Oct 18 |
nicklas |
Doc.addOrRemoveClass(item.parentNode, 'chained', inChain); |
5021 |
11 Oct 18 |
nicklas |
Doc.removeClass(item.parentNode, 'rootitem'); |
5021 |
11 Oct 18 |
nicklas |
1139 |
|
5023 |
12 Oct 18 |
nicklas |
// This handles vertical scrolling to the root item |
5023 |
12 Oct 18 |
nicklas |
if (scrollTo && chainId.indexOf(scrollTo) >= 0) |
5023 |
12 Oct 18 |
nicklas |
1142 |
{ |
5023 |
12 Oct 18 |
nicklas |
item.parentNode.scrollIntoView(); |
5023 |
12 Oct 18 |
nicklas |
scrollTo = null; |
5023 |
12 Oct 18 |
nicklas |
rootItem = item; |
5023 |
12 Oct 18 |
nicklas |
1146 |
} |
5023 |
12 Oct 18 |
nicklas |
1147 |
|
5021 |
11 Oct 18 |
nicklas |
if (inChain) |
5021 |
11 Oct 18 |
nicklas |
1149 |
{ |
5021 |
11 Oct 18 |
nicklas |
// Try to scroll the highlighted item into view |
5021 |
11 Oct 18 |
nicklas |
// We need to get the <td> aligned left or right in the <div> that is the |
5021 |
11 Oct 18 |
nicklas |
// parent to the <table> |
5021 |
11 Oct 18 |
nicklas |
var td = item.parentNode; |
5021 |
11 Oct 18 |
nicklas |
var tbl = td.parentNode.parentNode.parentNode; // Moving: td -> tr -> thead -> table |
5021 |
11 Oct 18 |
nicklas |
var div = tbl.parentNode; |
5021 |
11 Oct 18 |
nicklas |
if (div.autoScroll != autoScroll) |
5021 |
11 Oct 18 |
nicklas |
1157 |
{ |
5021 |
11 Oct 18 |
nicklas |
if (td.offsetLeft < div.scrollLeft) |
5021 |
11 Oct 18 |
nicklas |
1159 |
{ |
5021 |
11 Oct 18 |
nicklas |
div.scrollLeft = td.offsetLeft; |
5021 |
11 Oct 18 |
nicklas |
div.autoScroll = autoScroll; |
5021 |
11 Oct 18 |
nicklas |
1162 |
} |
5021 |
11 Oct 18 |
nicklas |
else if (td.offsetLeft + td.offsetWidth > div.scrollLeft + div.offsetWidth) |
5021 |
11 Oct 18 |
nicklas |
1164 |
{ |
5021 |
11 Oct 18 |
nicklas |
div.scrollLeft = td.offsetLeft + td.offsetWidth - div.offsetWidth; |
5021 |
11 Oct 18 |
nicklas |
div.autoScroll = autoScroll; |
5021 |
11 Oct 18 |
nicklas |
1167 |
} |
5021 |
11 Oct 18 |
nicklas |
1168 |
} |
5021 |
11 Oct 18 |
nicklas |
1169 |
} |
5011 |
05 Oct 18 |
nicklas |
1170 |
} |
5021 |
11 Oct 18 |
nicklas |
return rootItem; |
5011 |
05 Oct 18 |
nicklas |
1172 |
} |
5011 |
05 Oct 18 |
nicklas |
1173 |
|
5012 |
05 Oct 18 |
nicklas |
1174 |
/** |
5012 |
05 Oct 18 |
nicklas |
Check if the two lists have at least a pair of elements |
5012 |
05 Oct 18 |
nicklas |
were one is a substring of the other. |
5012 |
05 Oct 18 |
nicklas |
1177 |
*/ |
5012 |
05 Oct 18 |
nicklas |
cs.hasCommonElement = function(list1, list2) |
5012 |
05 Oct 18 |
nicklas |
1179 |
{ |
5012 |
05 Oct 18 |
nicklas |
for (var i1 = 0; i1 < list1.length; i1++) |
5012 |
05 Oct 18 |
nicklas |
1181 |
{ |
5012 |
05 Oct 18 |
nicklas |
var e1 = list1[i1]; |
5012 |
05 Oct 18 |
nicklas |
for (var i2 = 0; i2 < list2.length; i2++) |
5012 |
05 Oct 18 |
nicklas |
1184 |
{ |
5012 |
05 Oct 18 |
nicklas |
var e2 = list2[i2]; |
5012 |
05 Oct 18 |
nicklas |
if (e2.indexOf(e1) == 0 || e1.indexOf(e2) == 0) return true; |
5012 |
05 Oct 18 |
nicklas |
1187 |
} |
5012 |
05 Oct 18 |
nicklas |
1188 |
} |
5012 |
05 Oct 18 |
nicklas |
return false; |
5012 |
05 Oct 18 |
nicklas |
1190 |
} |
5012 |
05 Oct 18 |
nicklas |
1191 |
|
2370 |
22 Apr 14 |
nicklas |
cs.initSections = function(sections) |
2370 |
22 Apr 14 |
nicklas |
1193 |
{ |
2370 |
22 Apr 14 |
nicklas |
for (var s = 0; s < sections.length; s++) |
2370 |
22 Apr 14 |
nicklas |
1195 |
{ |
2370 |
22 Apr 14 |
nicklas |
var section = sections[s]; |
2370 |
22 Apr 14 |
nicklas |
1197 |
|
2370 |
22 Apr 14 |
nicklas |
var details = Doc.element(section.id+'-details'); |
2370 |
22 Apr 14 |
nicklas |
// If the details section is 'forcibly' hidden (eg. no items of that type), ignore this call |
2370 |
22 Apr 14 |
nicklas |
if (details && details.style.display != 'none') |
2370 |
22 Apr 14 |
nicklas |
1201 |
{ |
2370 |
22 Apr 14 |
nicklas |
var headerDiv = Doc.element(section.id+'-header'); |
2370 |
22 Apr 14 |
nicklas |
if (headerDiv) |
2370 |
22 Apr 14 |
nicklas |
1204 |
{ |
2370 |
22 Apr 14 |
nicklas |
Doc.addClass(headerDiv, 'link'); |
2370 |
22 Apr 14 |
nicklas |
headerDiv.title = 'Hide/show details'; |
2370 |
22 Apr 14 |
nicklas |
headerDiv.sectionId = section.id; |
2370 |
22 Apr 14 |
nicklas |
Events.addEventHandler(headerDiv, 'click', cs.toggleDetails); |
2370 |
22 Apr 14 |
nicklas |
1209 |
} |
2370 |
22 Apr 14 |
nicklas |
1210 |
|
2370 |
22 Apr 14 |
nicklas |
var sectionDiv = Doc.element(section.id+'-info'); |
2370 |
22 Apr 14 |
nicklas |
Doc.addOrRemoveClass(sectionDiv, 'hide-details', section.hiddenDetails); |
2370 |
22 Apr 14 |
nicklas |
1213 |
} |
2370 |
22 Apr 14 |
nicklas |
1214 |
} |
2370 |
22 Apr 14 |
nicklas |
1215 |
} |
2370 |
22 Apr 14 |
nicklas |
1216 |
|
2370 |
22 Apr 14 |
nicklas |
cs.toggleDetails = function(event) |
2370 |
22 Apr 14 |
nicklas |
1218 |
{ |
2370 |
22 Apr 14 |
nicklas |
var sectionId = event.currentTarget.sectionId; |
2370 |
22 Apr 14 |
nicklas |
var details = Doc.element(sectionId+'-details'); |
2370 |
22 Apr 14 |
nicklas |
// If the details section is 'forcibly' hidden (eg. no items of that type), ignore this call |
2370 |
22 Apr 14 |
nicklas |
if (details.style.display == 'none') return; |
2370 |
22 Apr 14 |
nicklas |
1223 |
|
2370 |
22 Apr 14 |
nicklas |
// Add 'hide-details' class to main <div section-info> if it is visible |
2370 |
22 Apr 14 |
nicklas |
var section = Doc.element(sectionId+'-info'); |
2370 |
22 Apr 14 |
nicklas |
var isVisible = section.className.indexOf('hide-details') == -1; |
2370 |
22 Apr 14 |
nicklas |
Doc.addOrRemoveClass(section, 'hide-details', isVisible); |
2370 |
22 Apr 14 |
nicklas |
1228 |
|
2370 |
22 Apr 14 |
nicklas |
// Save to BASE setting |
2370 |
22 Apr 14 |
nicklas |
var url = '../CaseSummary.servlet?ID='+App.getSessionId(); |
2370 |
22 Apr 14 |
nicklas |
url += '&cmd=SetSectionVisibility'; |
2370 |
22 Apr 14 |
nicklas |
url += '§ion='+sectionId+'&hidden='+(isVisible ? 1 : 0); |
2610 |
28 Aug 14 |
nicklas |
Wizard.asyncJsonRequest(url, null, 'POST'); |
2370 |
22 Apr 14 |
nicklas |
1234 |
} |
2370 |
22 Apr 14 |
nicklas |
1235 |
|
5009 |
04 Oct 18 |
nicklas |
cs.getDefaultColClass = function(item, yellowPrefixes) |
5009 |
04 Oct 18 |
nicklas |
1237 |
{ |
5009 |
04 Oct 18 |
nicklas |
var defaultColClass = yellowPrefixes[item.name.substr(0,9)]; |
5009 |
04 Oct 18 |
nicklas |
if (item.DO_NOT_USE) |
5009 |
04 Oct 18 |
nicklas |
1240 |
{ |
5009 |
04 Oct 18 |
nicklas |
defaultColClass = 'donotuse ' + (defaultColClass || ''); |
5009 |
04 Oct 18 |
nicklas |
1242 |
} |
5009 |
04 Oct 18 |
nicklas |
return defaultColClass; |
5009 |
04 Oct 18 |
nicklas |
1244 |
} |
5009 |
04 Oct 18 |
nicklas |
1245 |
|
3758 |
19 Feb 16 |
nicklas |
cs.addColumn = function(id, value, className) |
2370 |
22 Apr 14 |
nicklas |
1247 |
{ |
2370 |
22 Apr 14 |
nicklas |
var tr = Doc.element(id); |
2370 |
22 Apr 14 |
nicklas |
var td = document.createElement('td'); |
3758 |
19 Feb 16 |
nicklas |
if (!className) className = defaultColClass; |
3758 |
19 Feb 16 |
nicklas |
if (className) td.className = className; |
2370 |
22 Apr 14 |
nicklas |
if (tr.hasAddedColumns) |
2370 |
22 Apr 14 |
nicklas |
1253 |
{ |
3758 |
19 Feb 16 |
nicklas |
td.className += ' extra-column'; |
2370 |
22 Apr 14 |
nicklas |
tr.childNodes[tr.childNodes.length-1].className += ' fixed-column'; |
2370 |
22 Apr 14 |
nicklas |
1256 |
} |
2370 |
22 Apr 14 |
nicklas |
tr.hasAddedColumns = true; |
2370 |
22 Apr 14 |
nicklas |
if (value != null) |
2370 |
22 Apr 14 |
nicklas |
1259 |
{ |
2370 |
22 Apr 14 |
nicklas |
td.innerHTML = value == '' ? ' ' : value; |
2370 |
22 Apr 14 |
nicklas |
if (tr.className.indexOf('dynamic-column') >= 0) |
2370 |
22 Apr 14 |
nicklas |
1262 |
{ |
2370 |
22 Apr 14 |
nicklas |
tr.style.display = 'table-row'; |
2370 |
22 Apr 14 |
nicklas |
1264 |
} |
2370 |
22 Apr 14 |
nicklas |
1265 |
} |
2370 |
22 Apr 14 |
nicklas |
else |
2370 |
22 Apr 14 |
nicklas |
1267 |
{ |
2370 |
22 Apr 14 |
nicklas |
td.innerHTML = ' '; |
2370 |
22 Apr 14 |
nicklas |
1269 |
} |
2370 |
22 Apr 14 |
nicklas |
tr.appendChild(td); |
2370 |
22 Apr 14 |
nicklas |
1271 |
} |
2370 |
22 Apr 14 |
nicklas |
1272 |
|
5011 |
05 Oct 18 |
nicklas |
cs.asLink = function(itemType, item, maxLength, chainable) |
2370 |
22 Apr 14 |
nicklas |
1274 |
{ |
2370 |
22 Apr 14 |
nicklas |
var link = ''; |
2370 |
22 Apr 14 |
nicklas |
if (item) |
2370 |
22 Apr 14 |
nicklas |
1277 |
{ |
2370 |
22 Apr 14 |
nicklas |
var name = cs.truncate(item.name, maxLength); |
5009 |
04 Oct 18 |
nicklas |
var tooltip = item.DO_NOT_USE ? 'DoNotUse-'+Strings.encodeTags(item.DO_NOT_USE + ': ' + (item.DO_NOT_USE_COMMENT || '')) : ''; |
2370 |
22 Apr 14 |
nicklas |
if (item.id) |
2370 |
22 Apr 14 |
nicklas |
1281 |
{ |
5009 |
04 Oct 18 |
nicklas |
link = '<span class="link linked-item" title="'+tooltip+'" data-item-type="'+itemType+'" data-item-id="'+item.id+'" data-no-edit="'+(item.editable ? 0 : 1)+'">'; |
2708 |
29 Sep 14 |
nicklas |
link += name + '</span>'; |
2370 |
22 Apr 14 |
nicklas |
1284 |
} |
2370 |
22 Apr 14 |
nicklas |
else |
2370 |
22 Apr 14 |
nicklas |
1286 |
{ |
2708 |
29 Sep 14 |
nicklas |
link = name; |
2370 |
22 Apr 14 |
nicklas |
1288 |
} |
5011 |
05 Oct 18 |
nicklas |
if (chainable) |
5011 |
05 Oct 18 |
nicklas |
1290 |
{ |
5012 |
05 Oct 18 |
nicklas |
var chainId = item.name; |
5012 |
05 Oct 18 |
nicklas |
if (chainable.length) chainId = chainable.join('.,'); |
5011 |
05 Oct 18 |
nicklas |
// NOTE! 'chain-id' is name of item + '.' to ensure correct matching of substrings ('foo.m2' is NOT in the same chain when starting at 'foo.m') |
5012 |
05 Oct 18 |
nicklas |
link += '<img class="chained-item" data-chain-id="'+Strings.encodeTags(chainId)+'." title="Highlight all parent/child items" src="'+home+'/images/parent-child.png">'; |
5011 |
05 Oct 18 |
nicklas |
1295 |
} |
2370 |
22 Apr 14 |
nicklas |
1296 |
} |
2370 |
22 Apr 14 |
nicklas |
return link; |
2370 |
22 Apr 14 |
nicklas |
1298 |
} |
2370 |
22 Apr 14 |
nicklas |
1299 |
|
7296 |
23 Aug 23 |
nicklas |
// Opens a file in a new window. If width and height is given a popup window is used |
7296 |
23 Aug 23 |
nicklas |
cs.asFileLink = function(file, icon, tooltip, width, height) |
2370 |
22 Apr 14 |
nicklas |
1302 |
{ |
2370 |
22 Apr 14 |
nicklas |
var link = ''; |
2370 |
22 Apr 14 |
nicklas |
if (file) |
2370 |
22 Apr 14 |
nicklas |
1305 |
{ |
7296 |
23 Aug 23 |
nicklas |
link = '<span class="link linked-file" data-file-id="'+file.id+'" data-width="'+(width||'')+'" data-height="'+(height||'')+'" title="'+(tooltip || '')+'"><img src="'+home+'/images/'+icon+'" style="margin-left: 2px; margin-bottom: -1px;"></span>'; |
2370 |
22 Apr 14 |
nicklas |
1307 |
} |
2370 |
22 Apr 14 |
nicklas |
return link; |
2370 |
22 Apr 14 |
nicklas |
1309 |
} |
2914 |
11 Nov 14 |
nicklas |
1310 |
|
2916 |
11 Nov 14 |
nicklas |
cs.asJob = function(job, maxLength, taskType) |
2914 |
11 Nov 14 |
nicklas |
1312 |
{ |
6453 |
22 Oct 21 |
nicklas |
if (!job) return ''; |
2914 |
11 Nov 14 |
nicklas |
var text = null; |
6453 |
22 Oct 21 |
nicklas |
var tooltip = 'Job on ' + Strings.encodeTags(job.serverNode); |
2914 |
11 Nov 14 |
nicklas |
if (job.status == 'ERROR') |
2914 |
11 Nov 14 |
nicklas |
1317 |
{ |
2914 |
11 Nov 14 |
nicklas |
text = cs.asFailInfo(cs.truncate(job.statusMessage, maxLength), 'error.png'); |
2914 |
11 Nov 14 |
nicklas |
1319 |
} |
2914 |
11 Nov 14 |
nicklas |
else if (!job.started) |
2914 |
11 Nov 14 |
nicklas |
1321 |
{ |
2914 |
11 Nov 14 |
nicklas |
text = 'Waiting since ' + cs.asDateTime(job.scheduled); |
2914 |
11 Nov 14 |
nicklas |
1323 |
} |
2914 |
11 Nov 14 |
nicklas |
else if (!job.ended) |
2914 |
11 Nov 14 |
nicklas |
1325 |
{ |
2915 |
11 Nov 14 |
nicklas |
text = (taskType || 'Running') + ' ('+cs.asPercent(job.percentComplete) + ' since ' + cs.asDateTime(job.started) + ')'; |
2914 |
11 Nov 14 |
nicklas |
1327 |
} |
2916 |
11 Nov 14 |
nicklas |
else |
2916 |
11 Nov 14 |
nicklas |
1329 |
{ |
2916 |
11 Nov 14 |
nicklas |
text = cs.asDateTime(job.ended); |
2916 |
11 Nov 14 |
nicklas |
1331 |
} |
6453 |
22 Oct 21 |
nicklas |
text = '<span class="link linked-item" data-item-type="JOB" data-item-id="'+job.id+'" title="'+tooltip+'">' + text + '</span>'; |
2914 |
11 Nov 14 |
nicklas |
return text; |
2914 |
11 Nov 14 |
nicklas |
1334 |
} |
2370 |
22 Apr 14 |
nicklas |
1335 |
|
2501 |
12 Jun 14 |
olle |
cs.asLabEnvLink = function(sensor, date, title, icon) |
2501 |
12 Jun 14 |
olle |
1337 |
{ |
2501 |
12 Jun 14 |
olle |
var link = ''; |
2501 |
12 Jun 14 |
olle |
// Check if BASE extension LabEnv is installed |
2501 |
12 Jun 14 |
olle |
var homeLabEnv = Data.get('page-data', 'home-labenv'); |
2501 |
12 Jun 14 |
olle |
if (homeLabEnv) |
2501 |
12 Jun 14 |
olle |
1342 |
{ |
2501 |
12 Jun 14 |
olle |
if (date) |
2501 |
12 Jun 14 |
olle |
1344 |
{ |
2501 |
12 Jun 14 |
olle |
if (sensor) |
2501 |
12 Jun 14 |
olle |
1346 |
{ |
2501 |
12 Jun 14 |
olle |
// Link to pop-up window with lab environment data for the chosen sensor and date |
2919 |
11 Nov 14 |
nicklas |
link = '<span class="link linked-labenv" data-sensor="'+sensor+'" data-date="'+date+'" data-title="'+title+'"><img src="'+home+'/images/'+icon+'"></span>'; |
2501 |
12 Jun 14 |
olle |
1349 |
} |
2501 |
12 Jun 14 |
olle |
1350 |
} |
2501 |
12 Jun 14 |
olle |
1351 |
} |
2501 |
12 Jun 14 |
olle |
return link; |
2501 |
12 Jun 14 |
olle |
1353 |
} |
2501 |
12 Jun 14 |
olle |
1354 |
|
2370 |
22 Apr 14 |
nicklas |
cs.asCaseList = function(allCases, mainCase) |
2370 |
22 Apr 14 |
nicklas |
1356 |
{ |
2370 |
22 Apr 14 |
nicklas |
var html = ''; |
2370 |
22 Apr 14 |
nicklas |
for (var i = 0; i < allCases.length; i++) |
2370 |
22 Apr 14 |
nicklas |
1359 |
{ |
2370 |
22 Apr 14 |
nicklas |
var cse = allCases[i]; |
2708 |
29 Sep 14 |
nicklas |
var cse2 = Strings.encodeTags(cse); |
2370 |
22 Apr 14 |
nicklas |
if (html != '') html += ', '; |
2370 |
22 Apr 14 |
nicklas |
if (cse != mainCase) |
2370 |
22 Apr 14 |
nicklas |
1364 |
{ |
2708 |
29 Sep 14 |
nicklas |
html += '<span class="link linked-case" data-case-name="'+cse2+'" title="Show summary of case #'+cse2+'">'+cse2+'</span>'; |
2370 |
22 Apr 14 |
nicklas |
1366 |
} |
2370 |
22 Apr 14 |
nicklas |
else |
2370 |
22 Apr 14 |
nicklas |
1368 |
{ |
2708 |
29 Sep 14 |
nicklas |
html += '<b>' + cse2 + '</b>'; |
2370 |
22 Apr 14 |
nicklas |
1370 |
} |
2370 |
22 Apr 14 |
nicklas |
1371 |
} |
2370 |
22 Apr 14 |
nicklas |
return allCases.length > 1 ? html : null; |
2370 |
22 Apr 14 |
nicklas |
1373 |
} |
2370 |
22 Apr 14 |
nicklas |
1374 |
|
2370 |
22 Apr 14 |
nicklas |
1375 |
|
2370 |
22 Apr 14 |
nicklas |
// Format value as a date |
2370 |
22 Apr 14 |
nicklas |
cs.asDate = function(value) |
2370 |
22 Apr 14 |
nicklas |
1378 |
{ |
2370 |
22 Apr 14 |
nicklas |
if (!value) return ''; |
2370 |
22 Apr 14 |
nicklas |
if (value.length == 8) |
2370 |
22 Apr 14 |
nicklas |
1381 |
{ |
2370 |
22 Apr 14 |
nicklas |
value = value.substr(0, 4) + '-' + value.substr(4, 2) + '-' + value.substr(6, 2); |
2370 |
22 Apr 14 |
nicklas |
1383 |
} |
2370 |
22 Apr 14 |
nicklas |
return value; |
2370 |
22 Apr 14 |
nicklas |
1385 |
} |
2370 |
22 Apr 14 |
nicklas |
1386 |
|
2370 |
22 Apr 14 |
nicklas |
// Format as date+time value |
2370 |
22 Apr 14 |
nicklas |
cs.asDateTime = function(value, compareToDate) |
2370 |
22 Apr 14 |
nicklas |
1389 |
{ |
2370 |
22 Apr 14 |
nicklas |
if (!value) return ''; |
2370 |
22 Apr 14 |
nicklas |
if (value.length == 8) |
2370 |
22 Apr 14 |
nicklas |
1392 |
{ |
2370 |
22 Apr 14 |
nicklas |
value = cs.asDate(value); |
2370 |
22 Apr 14 |
nicklas |
1394 |
} |
2370 |
22 Apr 14 |
nicklas |
else if (value.length == 13) |
2370 |
22 Apr 14 |
nicklas |
1396 |
{ |
2370 |
22 Apr 14 |
nicklas |
// If the compareToDate is the same day as the 'value' date, skip the date and replace with white-space |
2370 |
22 Apr 14 |
nicklas |
if (compareToDate && value.substr(0, 8) == compareToDate.substr(0, 8)) |
2370 |
22 Apr 14 |
nicklas |
1399 |
{ |
2370 |
22 Apr 14 |
nicklas |
value = '<span class="invisible">'+cs.asDate(value.substr(0, 8)) + '</span> ' + value.substr(9, 2) + ':'+value.substr(11, 2) |
2370 |
22 Apr 14 |
nicklas |
1401 |
} |
2370 |
22 Apr 14 |
nicklas |
else |
2370 |
22 Apr 14 |
nicklas |
1403 |
{ |
2370 |
22 Apr 14 |
nicklas |
value = cs.asDate(value.substr(0, 8)) + ' ' + value.substr(9, 2) + ':'+value.substr(11, 2); |
2370 |
22 Apr 14 |
nicklas |
1405 |
} |
2370 |
22 Apr 14 |
nicklas |
1406 |
} |
2370 |
22 Apr 14 |
nicklas |
return value; |
2370 |
22 Apr 14 |
nicklas |
1408 |
} |
2370 |
22 Apr 14 |
nicklas |
1409 |
|
2370 |
22 Apr 14 |
nicklas |
// Style the value as a quantity with (optional) unit |
2370 |
22 Apr 14 |
nicklas |
cs.asQuantity = function(value, unit, scale) |
2370 |
22 Apr 14 |
nicklas |
1412 |
{ |
6479 |
09 Nov 21 |
nicklas |
var result = ''; |
2370 |
22 Apr 14 |
nicklas |
if (value != null) |
2370 |
22 Apr 14 |
nicklas |
1415 |
{ |
2370 |
22 Apr 14 |
nicklas |
if (scale) value = value / scale; |
2610 |
28 Aug 14 |
nicklas |
result = Reggie.formatNumber(value, unit, 2); |
2370 |
22 Apr 14 |
nicklas |
1418 |
} |
2370 |
22 Apr 14 |
nicklas |
return result; |
2370 |
22 Apr 14 |
nicklas |
1420 |
} |
2370 |
22 Apr 14 |
nicklas |
1421 |
|
2370 |
22 Apr 14 |
nicklas |
// Style the value as a percentage value |
6479 |
09 Nov 21 |
nicklas |
cs.asPercent = function(value, isFraction, decimals) |
2370 |
22 Apr 14 |
nicklas |
1424 |
{ |
2370 |
22 Apr 14 |
nicklas |
var result = ''; |
2370 |
22 Apr 14 |
nicklas |
if (value != null) |
2370 |
22 Apr 14 |
nicklas |
1427 |
{ |
2914 |
11 Nov 14 |
nicklas |
if (isFraction) value = value * 100; |
6479 |
09 Nov 21 |
nicklas |
result = Reggie.formatNumber(value, '%', decimals || 1); |
2370 |
22 Apr 14 |
nicklas |
1430 |
} |
2370 |
22 Apr 14 |
nicklas |
return result; |
2370 |
22 Apr 14 |
nicklas |
1432 |
} |
2370 |
22 Apr 14 |
nicklas |
1433 |
|
5522 |
24 Jun 19 |
nicklas |
// Style the value as a count; |
5522 |
24 Jun 19 |
nicklas |
// values > 1 000 000 are given in millions |
5522 |
24 Jun 19 |
nicklas |
// valus > 1000 are given in thousands |
2914 |
11 Nov 14 |
nicklas |
cs.asCount = function(value) |
2914 |
11 Nov 14 |
nicklas |
1438 |
{ |
2914 |
11 Nov 14 |
nicklas |
var result = ''; |
2914 |
11 Nov 14 |
nicklas |
if (value != null) |
2914 |
11 Nov 14 |
nicklas |
1441 |
{ |
5522 |
24 Jun 19 |
nicklas |
if (value > 1000000) |
2914 |
11 Nov 14 |
nicklas |
1443 |
{ |
2914 |
11 Nov 14 |
nicklas |
result = Reggie.formatNumber(value / 1000000, 'M', 1); |
2914 |
11 Nov 14 |
nicklas |
1445 |
} |
5522 |
24 Jun 19 |
nicklas |
else if (value > 1000) |
5522 |
24 Jun 19 |
nicklas |
1447 |
{ |
5522 |
24 Jun 19 |
nicklas |
result = Reggie.formatNumber(value / 1000, 'k', 1); |
5522 |
24 Jun 19 |
nicklas |
1449 |
} |
2914 |
11 Nov 14 |
nicklas |
else |
2914 |
11 Nov 14 |
nicklas |
1451 |
{ |
2914 |
11 Nov 14 |
nicklas |
result = value; |
2914 |
11 Nov 14 |
nicklas |
1453 |
} |
2914 |
11 Nov 14 |
nicklas |
1454 |
} |
2914 |
11 Nov 14 |
nicklas |
return result; |
2914 |
11 Nov 14 |
nicklas |
1456 |
} |
2370 |
22 Apr 14 |
nicklas |
1457 |
|
2370 |
22 Apr 14 |
nicklas |
// Style the message as a warning message |
2370 |
22 Apr 14 |
nicklas |
cs.asWarning = function(message) |
2370 |
22 Apr 14 |
nicklas |
1460 |
{ |
2370 |
22 Apr 14 |
nicklas |
message = '<span class="warning">' + message + '</span>'; |
2370 |
22 Apr 14 |
nicklas |
return message; |
2370 |
22 Apr 14 |
nicklas |
1463 |
} |
2370 |
22 Apr 14 |
nicklas |
1464 |
|
2370 |
22 Apr 14 |
nicklas |
// Generate a 'Missing' warning if the value is missing |
2370 |
22 Apr 14 |
nicklas |
cs.warnIfMissing = function(value) |
2370 |
22 Apr 14 |
nicklas |
1467 |
{ |
2500 |
10 Jun 14 |
nicklas |
var message = value ? value : cs.asWarning('Missing'); |
2370 |
22 Apr 14 |
nicklas |
return message; |
2370 |
22 Apr 14 |
nicklas |
1470 |
} |
2370 |
22 Apr 14 |
nicklas |
1471 |
|
2370 |
22 Apr 14 |
nicklas |
// Style the message as a 'no information' message |
2370 |
22 Apr 14 |
nicklas |
cs.asNoInfo = function(message) |
2370 |
22 Apr 14 |
nicklas |
1474 |
{ |
2370 |
22 Apr 14 |
nicklas |
message = '<span class="no-info">' + message + '</span>'; |
2370 |
22 Apr 14 |
nicklas |
return message; |
2370 |
22 Apr 14 |
nicklas |
1477 |
} |
2370 |
22 Apr 14 |
nicklas |
1478 |
|
2370 |
22 Apr 14 |
nicklas |
// Style the message as a 'flag information' message |
2370 |
22 Apr 14 |
nicklas |
cs.asFlagInfo = function(message, icon) |
2370 |
22 Apr 14 |
nicklas |
1481 |
{ |
2919 |
11 Nov 14 |
nicklas |
message = '<span class="flag-info">' + message + ' ' + '<img src="'+home+'/images/'+icon+'"></span>'; |
2370 |
22 Apr 14 |
nicklas |
return message; |
2370 |
22 Apr 14 |
nicklas |
1484 |
} |
2370 |
22 Apr 14 |
nicklas |
1485 |
|
5009 |
04 Oct 18 |
nicklas |
// Style the message as a 'DoNotUse information' message |
5009 |
04 Oct 18 |
nicklas |
cs.asDoNotUse = function(item) |
5009 |
04 Oct 18 |
nicklas |
1488 |
{ |
5009 |
04 Oct 18 |
nicklas |
var message = null; |
5009 |
04 Oct 18 |
nicklas |
if (item.DO_NOT_USE) |
5009 |
04 Oct 18 |
nicklas |
1491 |
{ |
5009 |
04 Oct 18 |
nicklas |
message = Strings.encodeTags(item.DO_NOT_USE + ': ' + (item.DO_NOT_USE_COMMENT || '')); |
5009 |
04 Oct 18 |
nicklas |
1493 |
} |
5009 |
04 Oct 18 |
nicklas |
return message; |
5009 |
04 Oct 18 |
nicklas |
1495 |
} |
5009 |
04 Oct 18 |
nicklas |
1496 |
|
5009 |
04 Oct 18 |
nicklas |
1497 |
|
2370 |
22 Apr 14 |
nicklas |
// Style the message as a 'fail information' message |
2370 |
22 Apr 14 |
nicklas |
cs.asFailInfo = function(message, icon) |
2370 |
22 Apr 14 |
nicklas |
1500 |
{ |
2919 |
11 Nov 14 |
nicklas |
message = '<span class="fail-info">' + message + ' ' + '<img src="'+home+'/images/'+icon+'"></span>'; |
2370 |
22 Apr 14 |
nicklas |
return message; |
2370 |
22 Apr 14 |
nicklas |
1503 |
} |
2370 |
22 Apr 14 |
nicklas |
1504 |
|
2370 |
22 Apr 14 |
nicklas |
cs.asConsent = function(consent, consentDate) |
2370 |
22 Apr 14 |
nicklas |
1506 |
{ |
4496 |
10 May 17 |
nicklas |
var warn = !consent || !consentDate || consent != 'Yes'; |
2370 |
22 Apr 14 |
nicklas |
var message; |
2370 |
22 Apr 14 |
nicklas |
if (!consent) |
2370 |
22 Apr 14 |
nicklas |
1510 |
{ |
2370 |
22 Apr 14 |
nicklas |
message = 'Missing' + (consentDate ? ', ' + consentDate : ''); |
2370 |
22 Apr 14 |
nicklas |
1512 |
} |
2370 |
22 Apr 14 |
nicklas |
else |
2370 |
22 Apr 14 |
nicklas |
1514 |
{ |
2370 |
22 Apr 14 |
nicklas |
message = consent + ', ' + (consentDate ? consentDate : 'Missing date'); |
2370 |
22 Apr 14 |
nicklas |
1516 |
|
2370 |
22 Apr 14 |
nicklas |
1517 |
} |
2500 |
10 Jun 14 |
nicklas |
return warn ? cs.asWarning(message) : message; |
2370 |
22 Apr 14 |
nicklas |
1519 |
} |
2370 |
22 Apr 14 |
nicklas |
1520 |
|
2370 |
22 Apr 14 |
nicklas |
// A biowell as the location |
2370 |
22 Apr 14 |
nicklas |
cs.asBioPlateLocation = function(well) |
2370 |
22 Apr 14 |
nicklas |
1523 |
{ |
2370 |
22 Apr 14 |
nicklas |
if (!well) return ''; |
2370 |
22 Apr 14 |
nicklas |
var plate = well.bioPlate; |
2370 |
22 Apr 14 |
nicklas |
var text = cs.asLink('BIOPLATE', plate) + ' ' + well.location; |
2370 |
22 Apr 14 |
nicklas |
if (plate.storage) |
2370 |
22 Apr 14 |
nicklas |
1528 |
{ |
2370 |
22 Apr 14 |
nicklas |
var storage = plate.storage; |
2370 |
22 Apr 14 |
nicklas |
var tmp = []; |
2708 |
29 Sep 14 |
nicklas |
if (storage.name) tmp[tmp.length] = Strings.encodeTags(storage.name); |
2370 |
22 Apr 14 |
nicklas |
if (storage.section) tmp[tmp.length] = 'section: ' +storage.section; |
2370 |
22 Apr 14 |
nicklas |
if (storage.tray) tmp[tmp.length] = 'tray: ' +storage.tray; |
2370 |
22 Apr 14 |
nicklas |
if (storage.position) tmp[tmp.length] = 'position: ' +storage.position; |
2370 |
22 Apr 14 |
nicklas |
1535 |
|
2370 |
22 Apr 14 |
nicklas |
text = '<span class="more-info" title="' + tmp.join('; ')+'">' + text + ' </span>'; |
2370 |
22 Apr 14 |
nicklas |
1537 |
} |
2370 |
22 Apr 14 |
nicklas |
return text; |
2370 |
22 Apr 14 |
nicklas |
1539 |
} |
2370 |
22 Apr 14 |
nicklas |
1540 |
|
4621 |
16 Nov 17 |
nicklas |
cs.asGenotypeQc = function(alignment) |
4621 |
16 Nov 17 |
nicklas |
1542 |
{ |
4621 |
16 Nov 17 |
nicklas |
var result = cs.asCount(alignment.QC_GENOTYPE_COUNT); |
4658 |
26 Jan 18 |
nicklas |
if (alignment.QC_GENOTYPE_HET_PCT > 0) |
4621 |
16 Nov 17 |
nicklas |
1545 |
{ |
4658 |
26 Jan 18 |
nicklas |
result += ' (' + cs.asPercent(alignment.QC_GENOTYPE_HET_PCT, false) + ' HET)'; |
4621 |
16 Nov 17 |
nicklas |
1547 |
} |
4621 |
16 Nov 17 |
nicklas |
if (alignment.qcVcf) |
4621 |
16 Nov 17 |
nicklas |
1549 |
{ |
4621 |
16 Nov 17 |
nicklas |
result += '<span class="link vcf-link" data-file-id="'+alignment.qcVcf.id+'" data-item-id="'+alignment.id+'"><img src="'+home+'/images/vcf_file.png" style="margin-left: 2px;"></span>'; |
4621 |
16 Nov 17 |
nicklas |
1551 |
} |
4621 |
16 Nov 17 |
nicklas |
return result; |
4621 |
16 Nov 17 |
nicklas |
1553 |
} |
4621 |
16 Nov 17 |
nicklas |
1554 |
|
7151 |
09 May 23 |
nicklas |
cs.asImportJsonFile = function(file) |
7151 |
09 May 23 |
nicklas |
1556 |
{ |
7151 |
09 May 23 |
nicklas |
var link = ''; |
7151 |
09 May 23 |
nicklas |
if (file) |
7151 |
09 May 23 |
nicklas |
1559 |
{ |
7151 |
09 May 23 |
nicklas |
link = '<span class="link json-import-file" data-file-id="'+file.id+'" data-file-name="'+file.name+'" title="View the JSON file that was imported"><img src="'+home+'/images/download.png" style="margin-left: 2px; margin-bottom: -1px;"></span>'; |
7151 |
09 May 23 |
nicklas |
1561 |
} |
7151 |
09 May 23 |
nicklas |
return link; |
7151 |
09 May 23 |
nicklas |
1563 |
} |
7151 |
09 May 23 |
nicklas |
1564 |
|
5731 |
19 Nov 19 |
nicklas |
cs.asVariantsFile = function(vcall) |
5731 |
19 Nov 19 |
nicklas |
1566 |
{ |
5731 |
19 Nov 19 |
nicklas |
var result = cs.asCount(vcall.VariantsPassedFilter); |
5731 |
19 Nov 19 |
nicklas |
if (vcall.vcfFile) |
5731 |
19 Nov 19 |
nicklas |
1569 |
{ |
6393 |
16 Sep 21 |
nicklas |
result += '<span class="link variants-link" data-file-id="'+vcall.vcfFile.id+'" data-item-id="'+vcall.id+'" data-mode="variant-call"><img src="'+home+'/images/vcf_file.png" style="margin-left: 2px;"></span>'; |
5731 |
19 Nov 19 |
nicklas |
1571 |
} |
5731 |
19 Nov 19 |
nicklas |
return result; |
5731 |
19 Nov 19 |
nicklas |
1573 |
} |
5731 |
19 Nov 19 |
nicklas |
1574 |
|
7423 |
14 Nov 23 |
nicklas |
cs.asWgsVariantsFile = function(vcall) |
7423 |
14 Nov 23 |
nicklas |
1576 |
{ |
7423 |
14 Nov 23 |
nicklas |
var result = cs.asCount(vcall.VariantsPassedFilter); |
7423 |
14 Nov 23 |
nicklas |
if (vcall.vcfFile) |
7423 |
14 Nov 23 |
nicklas |
1579 |
{ |
7423 |
14 Nov 23 |
nicklas |
result += '<span class="link variants-link" data-file-id="'+vcall.vcfFile.id+'" data-item-id="'+vcall.id+'" data-mode="variant-call-wgs"><img src="'+home+'/images/vcf_file.png" style="margin-left: 2px;"></span>'; |
7423 |
14 Nov 23 |
nicklas |
1581 |
} |
7423 |
14 Nov 23 |
nicklas |
return result; |
7423 |
14 Nov 23 |
nicklas |
1583 |
} |
7423 |
14 Nov 23 |
nicklas |
1584 |
|
7423 |
14 Nov 23 |
nicklas |
1585 |
|
6393 |
16 Sep 21 |
nicklas |
cs.asTargetedGenotypeFile = function(vcall, vcf) |
6393 |
16 Sep 21 |
nicklas |
1587 |
{ |
6393 |
16 Sep 21 |
nicklas |
var result = '<div class="genotype-grid" title="'+Strings.encodeTags(vcf.TargetedGenotypeDescription||'')+'">'; |
6393 |
16 Sep 21 |
nicklas |
result += '<div>'+vcf.TargetedGenotype+'</div>'; |
6393 |
16 Sep 21 |
nicklas |
result += '<div>'+cs.asCount(vcf.NumTargetedVariants)+'/'+cs.asCount(vcf.NumTargetedGenotypes)+'</div>'; |
6393 |
16 Sep 21 |
nicklas |
result += '<div><span class="link variants-link" data-file-id="'+vcf.id+'" data-item-id="'+vcall.id+'" data-mode="genotype"><img src="'+home+'/images/vcf_file.png" style="margin-left: 2px;"></span></div>'; |
6393 |
16 Sep 21 |
nicklas |
result += '</div>'; |
6393 |
16 Sep 21 |
nicklas |
return result; |
6393 |
16 Sep 21 |
nicklas |
1594 |
} |
6393 |
16 Sep 21 |
nicklas |
1595 |
|
2370 |
22 Apr 14 |
nicklas |
cs.truncate = function(value, maxLength) |
2370 |
22 Apr 14 |
nicklas |
1597 |
{ |
2370 |
22 Apr 14 |
nicklas |
if (!value) return value; |
2370 |
22 Apr 14 |
nicklas |
if (maxLength > 2 && value.length > maxLength) |
2370 |
22 Apr 14 |
nicklas |
1600 |
{ |
2708 |
29 Sep 14 |
nicklas |
var tmp = '<span class="truncated" title="'+value+'">'+Strings.encodeTags(value.substring(0, maxLength-2)) + '...</span>'; |
2370 |
22 Apr 14 |
nicklas |
value = tmp; |
2370 |
22 Apr 14 |
nicklas |
1603 |
} |
2708 |
29 Sep 14 |
nicklas |
else |
2708 |
29 Sep 14 |
nicklas |
1605 |
{ |
2708 |
29 Sep 14 |
nicklas |
value = Strings.encodeTags(value); |
2708 |
29 Sep 14 |
nicklas |
1607 |
} |
2370 |
22 Apr 14 |
nicklas |
return value; |
2370 |
22 Apr 14 |
nicklas |
1609 |
} |
2370 |
22 Apr 14 |
nicklas |
1610 |
|
2370 |
22 Apr 14 |
nicklas |
cs.showConfidentialOnChange = function() |
2370 |
22 Apr 14 |
nicklas |
1612 |
{ |
2370 |
22 Apr 14 |
nicklas |
var frm = document.forms['reggie']; |
2370 |
22 Apr 14 |
nicklas |
Doc.addOrRemoveClass('all-info', 'hide-confidential', !frm.showConfidential.checked); |
2370 |
22 Apr 14 |
nicklas |
1615 |
} |
2370 |
22 Apr 14 |
nicklas |
1616 |
|
2370 |
22 Apr 14 |
nicklas |
cs.caseSummary = function(event) |
2370 |
22 Apr 14 |
nicklas |
1618 |
{ |
2370 |
22 Apr 14 |
nicklas |
var frm = document.forms['reggie']; |
2370 |
22 Apr 14 |
nicklas |
var caseName = Data.get(event.currentTarget, 'case-name'); |
2370 |
22 Apr 14 |
nicklas |
if (!caseName) |
2370 |
22 Apr 14 |
nicklas |
1622 |
{ |
2370 |
22 Apr 14 |
nicklas |
caseName = frm.caseName.value; |
2370 |
22 Apr 14 |
nicklas |
if (!caseName) |
2370 |
22 Apr 14 |
nicklas |
1625 |
{ |
2370 |
22 Apr 14 |
nicklas |
Forms.showNotification('caseName', 'Please enter a 7-digit case id', null, null, 'left'); |
2370 |
22 Apr 14 |
nicklas |
return; |
2370 |
22 Apr 14 |
nicklas |
1628 |
} |
2370 |
22 Apr 14 |
nicklas |
1629 |
} |
2370 |
22 Apr 14 |
nicklas |
var url = 'case_summary.jsp?ID='+App.getSessionId(); |
2370 |
22 Apr 14 |
nicklas |
url += '&caseName='+encodeURIComponent(caseName); |
5019 |
10 Oct 18 |
nicklas |
url += '&highlight='+encodeURIComponent(caseName); |
2370 |
22 Apr 14 |
nicklas |
url += '&pageType='+Data.get('page-data', 'page-type'); |
2370 |
22 Apr 14 |
nicklas |
location.href = url; |
2370 |
22 Apr 14 |
nicklas |
1635 |
} |
2370 |
22 Apr 14 |
nicklas |
1636 |
|
2370 |
22 Apr 14 |
nicklas |
cs.goPrint = function() |
2370 |
22 Apr 14 |
nicklas |
1638 |
{ |
2370 |
22 Apr 14 |
nicklas |
var caseName = Data.get('page-data', 'case-name'); |
2370 |
22 Apr 14 |
nicklas |
var printNote = '<b>Note!</b> For better printing set page orientation to <i>portrait</i>.<br>'; |
2370 |
22 Apr 14 |
nicklas |
printNote += ' You may have to <i>scale down</i> to fit everything on the width of the page.'; |
2610 |
28 Aug 14 |
nicklas |
Reggie.openPrintWindow('all-content', 'Case summary - ' + Strings.encodeTags(caseName), 'portrait', printNote, '../', 'case_summary.css'); |
2370 |
22 Apr 14 |
nicklas |
1643 |
} |
2370 |
22 Apr 14 |
nicklas |
1644 |
|
3179 |
09 Mar 15 |
nicklas |
1645 |
|
3179 |
09 Mar 15 |
nicklas |
cs.logError = function(section, err) |
3179 |
09 Mar 15 |
nicklas |
1647 |
{ |
3179 |
09 Mar 15 |
nicklas |
console.error(err); |
3179 |
09 Mar 15 |
nicklas |
section = Doc.element(section); |
3179 |
09 Mar 15 |
nicklas |
var div = document.createElement('div'); |
3179 |
09 Mar 15 |
nicklas |
div.className = 'messagecontainer error'; |
3179 |
09 Mar 15 |
nicklas |
div.innerHTML = err; |
3179 |
09 Mar 15 |
nicklas |
section.parentNode.insertBefore(div, section.nextSibling); |
3179 |
09 Mar 15 |
nicklas |
1654 |
} |
3179 |
09 Mar 15 |
nicklas |
1655 |
|
7151 |
09 May 23 |
nicklas |
cs.jsonImportFileOnClick = function(event) |
7151 |
09 May 23 |
nicklas |
1657 |
{ |
7151 |
09 May 23 |
nicklas |
var fileId = Data.get(event.currentTarget, 'file-id'); |
7151 |
09 May 23 |
nicklas |
var fileName = Data.get(event.currentTarget, 'file-name'); |
7151 |
09 May 23 |
nicklas |
1660 |
|
7151 |
09 May 23 |
nicklas |
var url = '../ExternalSpecimen.servlet?ID='+App.getSessionId(); |
7151 |
09 May 23 |
nicklas |
url += '&cmd=DownloadJsonFile'; |
7151 |
09 May 23 |
nicklas |
url += '&fileId='+fileId; |
7151 |
09 May 23 |
nicklas |
1664 |
|
7151 |
09 May 23 |
nicklas |
Dialogs.openPopup(url, fileName, 800, 800); |
7151 |
09 May 23 |
nicklas |
1666 |
} |
7151 |
09 May 23 |
nicklas |
1667 |
|
4621 |
16 Nov 17 |
nicklas |
cs.vcfLinkOnClick = function(event) |
4621 |
16 Nov 17 |
nicklas |
1669 |
{ |
4621 |
16 Nov 17 |
nicklas |
var fileId = Data.int(event.currentTarget, 'file-id'); |
4621 |
16 Nov 17 |
nicklas |
var itemId = Data.get(event.currentTarget, 'item-id'); |
4621 |
16 Nov 17 |
nicklas |
1672 |
|
4621 |
16 Nov 17 |
nicklas |
var url = home+'/analysis/view_genotypes.jsp?ID=' + App.getSessionId(); |
4621 |
16 Nov 17 |
nicklas |
url += '&fileId='+fileId; |
4621 |
16 Nov 17 |
nicklas |
url += '&itemId='+itemId; |
7433 |
15 Nov 23 |
nicklas |
Dialogs.openPopup(url, 'ViewVcf'+fileId, 750, 500); |
4621 |
16 Nov 17 |
nicklas |
1677 |
} |
4621 |
16 Nov 17 |
nicklas |
1678 |
|
5731 |
19 Nov 19 |
nicklas |
cs.variantsLinkOnClick = function(event) |
5731 |
19 Nov 19 |
nicklas |
1680 |
{ |
5731 |
19 Nov 19 |
nicklas |
var fileId = Data.int(event.currentTarget, 'file-id'); |
5731 |
19 Nov 19 |
nicklas |
var itemId = Data.get(event.currentTarget, 'item-id'); |
6393 |
16 Sep 21 |
nicklas |
var mode = Data.get(event.currentTarget, 'mode'); |
5731 |
19 Nov 19 |
nicklas |
1684 |
|
7423 |
14 Nov 23 |
nicklas |
var url; |
7423 |
14 Nov 23 |
nicklas |
if (mode == 'variant-call-wgs') |
7423 |
14 Nov 23 |
nicklas |
1687 |
{ |
7423 |
14 Nov 23 |
nicklas |
url = home+'/dnaseq-analysis/view_variants.jsp?ID=' + App.getSessionId(); |
7423 |
14 Nov 23 |
nicklas |
1689 |
} |
7423 |
14 Nov 23 |
nicklas |
else |
7423 |
14 Nov 23 |
nicklas |
1691 |
{ |
7423 |
14 Nov 23 |
nicklas |
url = home+'/analysis/view_variants.jsp?ID=' + App.getSessionId(); |
7423 |
14 Nov 23 |
nicklas |
1693 |
} |
5731 |
19 Nov 19 |
nicklas |
url += '&fileId='+fileId; |
5731 |
19 Nov 19 |
nicklas |
url += '&itemId='+itemId; |
6393 |
16 Sep 21 |
nicklas |
url += '&mode='+mode; |
7433 |
15 Nov 23 |
nicklas |
Dialogs.openPopup(url, 'ViewVariants'+fileId, 1100, 700); |
5731 |
19 Nov 19 |
nicklas |
1698 |
} |
5731 |
19 Nov 19 |
nicklas |
1699 |
|
7296 |
23 Aug 23 |
nicklas |
cs.openFileInPopup = function(event) |
7296 |
23 Aug 23 |
nicklas |
1701 |
{ |
7296 |
23 Aug 23 |
nicklas |
var fileId = Data.get(event.currentTarget, 'file-id'); |
7296 |
23 Aug 23 |
nicklas |
var width = Data.get(event.currentTarget, 'width', 900); |
7296 |
23 Aug 23 |
nicklas |
var height = Data.get(event.currentTarget, 'height', 600); |
7296 |
23 Aug 23 |
nicklas |
var controller = Items.getController('FILE'); |
7296 |
23 Aug 23 |
nicklas |
var url = App.getRoot() + controller.url; |
7296 |
23 Aug 23 |
nicklas |
url += '?ID='+App.getSessionId(); |
7296 |
23 Aug 23 |
nicklas |
url += '&cmd=ViewFile&item_id='+fileId; |
7296 |
23 Aug 23 |
nicklas |
1709 |
|
7296 |
23 Aug 23 |
nicklas |
Dialogs.openPopup(url, 'ViewFile'+fileId, width, height); |
7296 |
23 Aug 23 |
nicklas |
1711 |
} |
7296 |
23 Aug 23 |
nicklas |
1712 |
|
5022 |
11 Oct 18 |
nicklas |
cs.columnBalance = function(event) |
5022 |
11 Oct 18 |
nicklas |
1714 |
{ |
5022 |
11 Oct 18 |
nicklas |
Data.set('all-content', 'cbal', event.currentTarget.value); |
5022 |
11 Oct 18 |
nicklas |
1716 |
} |
5022 |
11 Oct 18 |
nicklas |
1717 |
|
6425 |
29 Sep 21 |
nicklas |
cs.sortByIdDescending = function(a, b) |
6425 |
29 Sep 21 |
nicklas |
1719 |
{ |
6425 |
29 Sep 21 |
nicklas |
return b.id - a.id; |
6425 |
29 Sep 21 |
nicklas |
1721 |
} |
6425 |
29 Sep 21 |
nicklas |
1722 |
|
2370 |
22 Apr 14 |
nicklas |
return cs; |
2370 |
22 Apr 14 |
nicklas |
1724 |
}(); |
2370 |
22 Apr 14 |
nicklas |
1725 |
|
2501 |
12 Jun 14 |
olle |
var LabEnvs = function() |
2501 |
12 Jun 14 |
olle |
1727 |
{ |
2501 |
12 Jun 14 |
olle |
var labenvs = {}; |
2501 |
12 Jun 14 |
olle |
1729 |
|
2501 |
12 Jun 14 |
olle |
1730 |
/** |
2501 |
12 Jun 14 |
olle |
Event handler that calls 'labenv.jar/reports/labenvironmentdatabaseeventpopup.jsp' |
2501 |
12 Jun 14 |
olle |
when clicking on the attached target. The sensor id should be stored |
2501 |
12 Jun 14 |
olle |
in attribute 'data-sensor', the date in 'data-date', |
2501 |
12 Jun 14 |
olle |
and the title in 'data-title'. |
2501 |
12 Jun 14 |
olle |
1735 |
*/ |
2501 |
12 Jun 14 |
olle |
labenvs.viewDataOnClick = function(event) |
2501 |
12 Jun 14 |
olle |
1737 |
{ |
2501 |
12 Jun 14 |
olle |
var homeLabEnv = Data.get('page-data', 'home-labenv'); |
2501 |
12 Jun 14 |
olle |
var title = Data.get(event.currentTarget, 'title'); |
2501 |
12 Jun 14 |
olle |
var sensor = Data.get(event.currentTarget, 'sensor'); |
2501 |
12 Jun 14 |
olle |
var date = Data.get(event.currentTarget, 'date'); |
2501 |
12 Jun 14 |
olle |
var url = homeLabEnv; |
2501 |
12 Jun 14 |
olle |
url += '/reports/labenvironmentdatabaseeventpopup.jsp'; |
2501 |
12 Jun 14 |
olle |
url += '?ID='+App.getSessionId(); |
2501 |
12 Jun 14 |
olle |
url += '&pageTitle='+encodeURIComponent(title); |
2501 |
12 Jun 14 |
olle |
url += '&labSensorUrl='+encodeURIComponent(sensor); |
2501 |
12 Jun 14 |
olle |
url += '&originDate='+encodeURIComponent(date); |
2501 |
12 Jun 14 |
olle |
Dialogs.openPopup(url, title, 820, 768); |
2501 |
12 Jun 14 |
olle |
1749 |
} |
2501 |
12 Jun 14 |
olle |
1750 |
|
2501 |
12 Jun 14 |
olle |
return labenvs; |
2501 |
12 Jun 14 |
olle |
1752 |
}(); |
2501 |
12 Jun 14 |
olle |
1753 |
|
2370 |
22 Apr 14 |
nicklas |
Doc.onLoad(CaseSummary.initPage); |