3176 |
06 Mar 15 |
olle |
var ExtractionProtocol = function() |
3176 |
06 Mar 15 |
olle |
2 |
{ |
3176 |
06 Mar 15 |
olle |
var ep = {}; |
3176 |
06 Mar 15 |
olle |
var debug = 0; |
3176 |
06 Mar 15 |
olle |
5 |
|
3210 |
26 Mar 15 |
olle |
ep.TITLE = 'MeLuDI'; |
3176 |
06 Mar 15 |
olle |
var COLORS = ['blue', 'green', 'yellow', 'red']; |
3176 |
06 Mar 15 |
olle |
var nextColor = 0; |
4128 |
26 Sep 16 |
olle |
var projectName; |
3176 |
06 Mar 15 |
olle |
var meludiVersion; |
3176 |
06 Mar 15 |
olle |
11 |
|
3176 |
06 Mar 15 |
olle |
// Page initialization |
3176 |
06 Mar 15 |
olle |
ep.initPage = function() |
3176 |
06 Mar 15 |
olle |
14 |
{ |
3176 |
06 Mar 15 |
olle |
Buttons.addClickHandler('print-button', Wizard.goPrint); |
3176 |
06 Mar 15 |
olle |
var numItems = Data.get('page-data', 'numitems'); |
3176 |
06 Mar 15 |
olle |
var submitInfoJsonStr = Data.get('page-data', 'submitinfo'); |
4128 |
26 Sep 16 |
olle |
projectName = Data.get('page-data', 'projectname'); |
3176 |
06 Mar 15 |
olle |
meludiVersion = Data.get('page-data', 'meludiversion'); |
3176 |
06 Mar 15 |
olle |
ep.initializeProtocol(submitInfoJsonStr); |
3176 |
06 Mar 15 |
olle |
21 |
} |
3176 |
06 Mar 15 |
olle |
22 |
|
3176 |
06 Mar 15 |
olle |
ep.initializeProtocol = function(submitInfoJsonStr) |
3176 |
06 Mar 15 |
olle |
24 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3176 |
06 Mar 15 |
olle |
26 |
|
3176 |
06 Mar 15 |
olle |
var submitInfo = JSON.parse(submitInfoJsonStr); |
3180 |
17 Mar 15 |
olle |
var docMode = submitInfo.docMode; |
3176 |
06 Mar 15 |
olle |
var itemInfo = submitInfo.items; |
3432 |
29 Jun 15 |
olle |
var startListName = submitInfo.startListName; |
3501 |
21 Sep 15 |
olle |
var isolationDate = submitInfo.isolationDate; |
3501 |
21 Sep 15 |
olle |
var extractionOperator = submitInfo.extractionOperator; |
3501 |
21 Sep 15 |
olle |
33 |
|
3501 |
21 Sep 15 |
olle |
// Specimen reagents |
3501 |
21 Sep 15 |
olle |
var xyleneSpecimen = submitInfo.xyleneSpecimen; |
3501 |
21 Sep 15 |
olle |
var etoh995Specimen = submitInfo.etoh995Specimen; |
3501 |
21 Sep 15 |
olle |
var bufferPkdSpecimen = submitInfo.bufferPkdSpecimen; |
3501 |
21 Sep 15 |
olle |
var bufferAtlSpecimen = submitInfo.bufferAtlSpecimen; |
3501 |
21 Sep 15 |
olle |
var proteinaseKSpecimen = submitInfo.proteinaseKSpecimen; |
3501 |
21 Sep 15 |
olle |
var rnaseASpecimen = submitInfo.rnaseASpecimen; |
3501 |
21 Sep 15 |
olle |
41 |
|
3501 |
21 Sep 15 |
olle |
// QIAcube |
3501 |
21 Sep 15 |
olle |
var qiacubeDate = submitInfo.qiacubeDate; |
3176 |
06 Mar 15 |
olle |
var qiacubeOperator = submitInfo.qiacubeOperator; |
3501 |
21 Sep 15 |
olle |
var qiacubeRunNo = submitInfo.qiacubeRunNo; |
3176 |
06 Mar 15 |
olle |
var allPrepFfpeKit = submitInfo.allPrepFfpeKit; |
3501 |
21 Sep 15 |
olle |
var etoh995 = submitInfo.etoh995; |
3501 |
21 Sep 15 |
olle |
var bufferRlt = submitInfo.bufferRlt; |
3501 |
21 Sep 15 |
olle |
var bufferFrn = submitInfo.bufferFrn; |
3501 |
21 Sep 15 |
olle |
var bufferRpe = submitInfo.bufferRpe; |
3501 |
21 Sep 15 |
olle |
var bufferAl = submitInfo.bufferAl; |
3501 |
21 Sep 15 |
olle |
var bufferAw1 = submitInfo.bufferAw1; |
3501 |
21 Sep 15 |
olle |
var bufferAw2 = submitInfo.bufferAw2; |
3501 |
21 Sep 15 |
olle |
var bufferAte = submitInfo.bufferAte; |
3501 |
21 Sep 15 |
olle |
var bufferRdd = submitInfo.bufferRdd; |
3501 |
21 Sep 15 |
olle |
var rnaseFreeWater = submitInfo.rnaseFreeWater; |
3436 |
02 Jul 15 |
olle |
var dnaseMix = submitInfo.dnaseMix; |
3501 |
21 Sep 15 |
olle |
var rneasyMinEluteSpinColumn = submitInfo.rneasyMinEluteSpinColumn; |
3501 |
21 Sep 15 |
olle |
var qiaampMinEluteSpinColumn = submitInfo.qiaampMinEluteSpinColumn; |
3501 |
21 Sep 15 |
olle |
60 |
|
3501 |
21 Sep 15 |
olle |
// Quality control reagents |
3324 |
11 May 15 |
olle |
var kapaSybrFast = submitInfo.kapaSybrFast; |
3324 |
11 May 15 |
olle |
var qualityControlPrimersQcpRgt = submitInfo.qualityControlPrimersQcpRgt; |
3438 |
03 Jul 15 |
olle |
var qualityControlTemplateQct = submitInfo.qualityControlTemplateQct; |
3324 |
11 May 15 |
olle |
var qubitDnaHighSens = submitInfo.qubitDnaHighSens; |
3324 |
11 May 15 |
olle |
var qubitDnaBroadRange = submitInfo.qubitDnaBroadRange; |
3501 |
21 Sep 15 |
olle |
67 |
|
3501 |
21 Sep 15 |
olle |
// Various |
3180 |
17 Mar 15 |
olle |
var dnaDefaultVolume = submitInfo.dnaDefaultVolume; |
3176 |
06 Mar 15 |
olle |
var dnaProtocolName = submitInfo.dnaProtocolName; |
3176 |
06 Mar 15 |
olle |
var rnaProtocolName = submitInfo.rnaProtocolName; |
3329 |
11 May 15 |
olle |
var protocolName = submitInfo.extractionProtocolName; |
3329 |
11 May 15 |
olle |
//var protocolVersionNo = submitInfo.protocolVersionNo; |
3329 |
11 May 15 |
olle |
var protocolVersionNo = '1.0'; |
3199 |
19 Mar 15 |
olle |
var protocolPreviewFlag = submitInfo.protocolPreviewFlag; |
3176 |
06 Mar 15 |
olle |
var numQiacubeItems = itemInfo.length; |
3176 |
06 Mar 15 |
olle |
77 |
|
3176 |
06 Mar 15 |
olle |
// Header data |
3336 |
13 May 15 |
olle |
var docModeText = 'Protocol'; |
3180 |
17 Mar 15 |
olle |
if (docMode && docMode == 'report') |
3180 |
17 Mar 15 |
olle |
81 |
{ |
3180 |
17 Mar 15 |
olle |
docModeText = 'Report'; |
3180 |
17 Mar 15 |
olle |
83 |
} |
3176 |
06 Mar 15 |
olle |
if (protocolVersionNo == null || protocolVersionNo == '') |
3176 |
06 Mar 15 |
olle |
85 |
{ |
3176 |
06 Mar 15 |
olle |
protocolVersionNo = '?'; |
3176 |
06 Mar 15 |
olle |
87 |
} |
3199 |
19 Mar 15 |
olle |
var protocolPreviewText = ''; |
3199 |
19 Mar 15 |
olle |
if (protocolPreviewFlag != null && protocolPreviewFlag == 'true') |
3199 |
19 Mar 15 |
olle |
90 |
{ |
3203 |
20 Mar 15 |
olle |
protocolPreviewText = ' <i>(preview)</i>'; |
3199 |
19 Mar 15 |
olle |
92 |
} |
3501 |
21 Sep 15 |
olle |
93 |
/* |
3336 |
13 May 15 |
olle |
var headerText = 'Lab Tracking ' + docModeText + ' for Allprep isolation v' + protocolVersionNo + protocolPreviewText + ' <span class="meludi">' + ExtractionProtocol.TITLE + ' ' + meludiVersion + '</span>'; |
3501 |
21 Sep 15 |
olle |
95 |
*/ |
3501 |
21 Sep 15 |
olle |
var headerText = 'Lab Tracking ' + docModeText + ' for FFPE extraction v' + protocolVersionNo + protocolPreviewText + ' <span class="meludi">' + ExtractionProtocol.TITLE + ' ' + meludiVersion + '</span>'; |
3336 |
13 May 15 |
olle |
Doc.element('allprepLabTrackingProtocolHeader').innerHTML = headerText; |
3501 |
21 Sep 15 |
olle |
98 |
/* |
3336 |
13 May 15 |
olle |
Doc.element('allprepLabTrackingProtocolHeader2').innerHTML = protocolName; |
3501 |
21 Sep 15 |
olle |
100 |
*/ |
3501 |
21 Sep 15 |
olle |
101 |
|
4128 |
26 Sep 16 |
olle |
Doc.element('projectnameid').innerHTML = Strings.encodeTags(projectName); |
3432 |
29 Jun 15 |
olle |
Doc.element('startlistid').innerHTML = Strings.encodeTags(startListName); |
3501 |
21 Sep 15 |
olle |
104 |
|
3180 |
17 Mar 15 |
olle |
Doc.element('isolationdate').innerHTML = Strings.encodeTags(isolationDate); |
3501 |
21 Sep 15 |
olle |
Doc.element('operator').innerHTML = Strings.encodeTags(extractionOperator); |
3501 |
21 Sep 15 |
olle |
Doc.element('extractionprotocol').innerHTML = Strings.encodeTags(protocolName); |
3501 |
21 Sep 15 |
olle |
108 |
|
3501 |
21 Sep 15 |
olle |
// Specimen reagents |
3501 |
21 Sep 15 |
olle |
Doc.element('xyleneSpecimen').innerHTML = Strings.encodeTags(xyleneSpecimen); |
3501 |
21 Sep 15 |
olle |
Doc.element('etoh995Specimen').innerHTML = Strings.encodeTags(etoh995Specimen); |
3501 |
21 Sep 15 |
olle |
Doc.element('bufferPkdSpecimen').innerHTML = Strings.encodeTags(bufferPkdSpecimen); |
3501 |
21 Sep 15 |
olle |
Doc.element('bufferAtlSpecimen').innerHTML = Strings.encodeTags(bufferAtlSpecimen); |
3501 |
21 Sep 15 |
olle |
Doc.element('proteinaseKSpecimen').innerHTML = Strings.encodeTags(proteinaseKSpecimen); |
3501 |
21 Sep 15 |
olle |
Doc.element('rnaseASpecimen').innerHTML = Strings.encodeTags(rnaseASpecimen); |
3501 |
21 Sep 15 |
olle |
116 |
|
3501 |
21 Sep 15 |
olle |
// QIAcube |
3501 |
21 Sep 15 |
olle |
Doc.element('qiacubeDate').innerHTML = Strings.encodeTags(qiacubeDate); |
3501 |
21 Sep 15 |
olle |
//Doc.element('qiacubeRunNo').innerHTML = Strings.encodeTags(qiacubeRunNo); |
3501 |
21 Sep 15 |
olle |
Doc.element('qiacubeOperator').innerHTML = Strings.encodeTags(qiacubeOperator); |
3501 |
21 Sep 15 |
olle |
Doc.element('allPrepFfpeKit').innerHTML = Strings.encodeTags(allPrepFfpeKit); |
3501 |
21 Sep 15 |
olle |
Doc.element('etoh995').innerHTML = Strings.encodeTags(etoh995); |
3501 |
21 Sep 15 |
olle |
Doc.element('bufferRlt').innerHTML = Strings.encodeTags(bufferRlt); |
3501 |
21 Sep 15 |
olle |
Doc.element('bufferFrn').innerHTML = Strings.encodeTags(bufferFrn); |
3501 |
21 Sep 15 |
olle |
Doc.element('bufferRpe').innerHTML = Strings.encodeTags(bufferRpe); |
3501 |
21 Sep 15 |
olle |
Doc.element('bufferAl').innerHTML = Strings.encodeTags(bufferAl); |
3501 |
21 Sep 15 |
olle |
Doc.element('bufferAw1').innerHTML = Strings.encodeTags(bufferAw1); |
3501 |
21 Sep 15 |
olle |
Doc.element('bufferAw2').innerHTML = Strings.encodeTags(bufferAw2); |
3501 |
21 Sep 15 |
olle |
Doc.element('bufferAte').innerHTML = Strings.encodeTags(bufferAte); |
3501 |
21 Sep 15 |
olle |
Doc.element('bufferRdd').innerHTML = Strings.encodeTags(bufferRdd); |
3501 |
21 Sep 15 |
olle |
Doc.element('rnaseFreeWater').innerHTML = Strings.encodeTags(rnaseFreeWater); |
3501 |
21 Sep 15 |
olle |
Doc.element('dnaseMix').innerHTML = Strings.encodeTags(dnaseMix); |
3501 |
21 Sep 15 |
olle |
Doc.element('rneasyMinEluteSpinColumn').innerHTML = Strings.encodeTags(rneasyMinEluteSpinColumn); |
3501 |
21 Sep 15 |
olle |
Doc.element('qiaampMinEluteSpinColumn').innerHTML = Strings.encodeTags(qiaampMinEluteSpinColumn); |
3501 |
21 Sep 15 |
olle |
135 |
|
3501 |
21 Sep 15 |
olle |
// Quality control reagents |
3501 |
21 Sep 15 |
olle |
Doc.element('kapaSybrFast').innerHTML = Strings.encodeTags(kapaSybrFast); |
3501 |
21 Sep 15 |
olle |
Doc.element('qualityControlPrimersQcpRgt').innerHTML = Strings.encodeTags(qualityControlPrimersQcpRgt); |
3501 |
21 Sep 15 |
olle |
Doc.element('qualityControlTemplateQct').innerHTML = Strings.encodeTags(qualityControlTemplateQct); |
3291 |
30 Apr 15 |
olle |
140 |
/* |
3501 |
21 Sep 15 |
olle |
Doc.element('qubitDnaHighSens').innerHTML = Strings.encodeTags(qubitDnaHighSens); |
3501 |
21 Sep 15 |
olle |
142 |
*/ |
3501 |
21 Sep 15 |
olle |
Doc.element('qubitDnaBroadRange').innerHTML = Strings.encodeTags(qubitDnaBroadRange); |
3501 |
21 Sep 15 |
olle |
144 |
|
3501 |
21 Sep 15 |
olle |
145 |
|
3501 |
21 Sep 15 |
olle |
//Doc.element('ffpeDnaRnaKitLotNo').innerHTML = Strings.encodeTags(allPrepFfpeKit); |
3501 |
21 Sep 15 |
olle |
//Doc.element('proteinaseKLotNo').innerHTML = Strings.encodeTags(proteinaseKSpecimen); |
3501 |
21 Sep 15 |
olle |
//Doc.element('dnaseMixLotNo').innerHTML = Strings.encodeTags(dnaseMix); |
3501 |
21 Sep 15 |
olle |
//Doc.element('kapaSybrFastLotNo').innerHTML = Strings.encodeTags(kapaSybrFast); |
3501 |
21 Sep 15 |
olle |
//Doc.element('qualityControlPrimersQcpRgtNo').innerHTML = Strings.encodeTags(qualityControlPrimersQcpRgt); |
3501 |
21 Sep 15 |
olle |
//Doc.element('qualityControlTemplateQctLotNo').innerHTML = Strings.encodeTags(qualityControlTemplateQct); |
3501 |
21 Sep 15 |
olle |
//Doc.element('qubitDnaHighSensLotNo').innerHTML = Strings.encodeTags(qubitDnaHighSens); |
3501 |
21 Sep 15 |
olle |
//Doc.element('qubitDnaBroadRangeLotNo').innerHTML = Strings.encodeTags(qubitDnaBroadRange); |
3501 |
21 Sep 15 |
olle |
154 |
/* |
3180 |
17 Mar 15 |
olle |
if (dnaDefaultVolume) |
3176 |
06 Mar 15 |
olle |
156 |
{ |
3180 |
17 Mar 15 |
olle |
Doc.element('dnaElutionVolume').innerHTML = ep.encodeFloatTags(dnaDefaultVolume) + ' µl'; |
3176 |
06 Mar 15 |
olle |
158 |
} |
3291 |
30 Apr 15 |
olle |
159 |
*/ |
3176 |
06 Mar 15 |
olle |
160 |
|
3176 |
06 Mar 15 |
olle |
// Item data |
3176 |
06 Mar 15 |
olle |
var accumItemNo = 0; |
3176 |
06 Mar 15 |
olle |
accumItemNo = tableRowsForItems(accumItemNo, itemInfo, 'Item', 'item'); |
3176 |
06 Mar 15 |
olle |
accumItemNo = tableRowForOptionalCounterbalanceItem(accumItemNo, itemInfo, 'Item', 'item'); |
3176 |
06 Mar 15 |
olle |
165 |
|
3176 |
06 Mar 15 |
olle |
Doc.show('all-protocol'); |
3176 |
06 Mar 15 |
olle |
167 |
} |
3176 |
06 Mar 15 |
olle |
168 |
|
3176 |
06 Mar 15 |
olle |
function tableRowsForItems( |
3176 |
06 Mar 15 |
olle |
accumItemNo, |
3176 |
06 Mar 15 |
olle |
itemJsonArr, |
3176 |
06 Mar 15 |
olle |
itemType, |
3176 |
06 Mar 15 |
olle |
itemTypeVarName) |
3176 |
06 Mar 15 |
olle |
174 |
{ |
3176 |
06 Mar 15 |
olle |
// Table item row |
3176 |
06 Mar 15 |
olle |
var html = ''; |
3176 |
06 Mar 15 |
olle |
if (itemJsonArr && itemJsonArr.length > 0) |
3176 |
06 Mar 15 |
olle |
178 |
{ |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < itemJsonArr.length; i++) |
3176 |
06 Mar 15 |
olle |
180 |
{ |
3176 |
06 Mar 15 |
olle |
var item = itemJsonArr[i]; |
3176 |
06 Mar 15 |
olle |
182 |
/* |
3176 |
06 Mar 15 |
olle |
var storageId = '-'; |
3176 |
06 Mar 15 |
olle |
var storagePosition = '-'; |
3176 |
06 Mar 15 |
olle |
185 |
*/ |
3176 |
06 Mar 15 |
olle |
var qiacubePosition = '-'; |
3176 |
06 Mar 15 |
olle |
var platePos = '-'; |
3276 |
29 Apr 15 |
olle |
var rnaStorageBox = '-'; |
3176 |
06 Mar 15 |
olle |
var rnaConc = null; |
3276 |
29 Apr 15 |
olle |
var dnaStorageBox = '-'; |
3176 |
06 Mar 15 |
olle |
var dnaConc = null; |
3176 |
06 Mar 15 |
olle |
var dnaDeltaCt = null; |
3176 |
06 Mar 15 |
olle |
var specimenComment = null; |
3176 |
06 Mar 15 |
olle |
var rnaComment = null; |
3176 |
06 Mar 15 |
olle |
var dnaComment = null; |
3176 |
06 Mar 15 |
olle |
var comment = null; |
3176 |
06 Mar 15 |
olle |
if (item) |
3176 |
06 Mar 15 |
olle |
198 |
{ |
3176 |
06 Mar 15 |
olle |
199 |
/* |
3176 |
06 Mar 15 |
olle |
storageId = ep.asBioPlateName(item.bioWell); |
3176 |
06 Mar 15 |
olle |
storagePosition = ep.asPureBioPlateLocation(item.bioWell); |
3176 |
06 Mar 15 |
olle |
202 |
*/ |
3176 |
06 Mar 15 |
olle |
qiacubePosition = item.qiacubePosition; |
3293 |
30 Apr 15 |
olle |
204 |
|
3293 |
30 Apr 15 |
olle |
// RNA extract from specimen |
3176 |
06 Mar 15 |
olle |
var rna = item.rna; |
3176 |
06 Mar 15 |
olle |
if (rna) |
3176 |
06 Mar 15 |
olle |
208 |
{ |
3276 |
29 Apr 15 |
olle |
//platePos = rna.well; |
3276 |
29 Apr 15 |
olle |
platePos = rna.nanoDropWell; |
3276 |
29 Apr 15 |
olle |
if (rna.bioWell) |
3276 |
29 Apr 15 |
olle |
212 |
{ |
3276 |
29 Apr 15 |
olle |
rnaStorageBox = Strings.encodeTags(item.rna.bioWell.bioPlate.name + '[' + item.rna.bioWell.location + ']'); |
3276 |
29 Apr 15 |
olle |
214 |
} |
3176 |
06 Mar 15 |
olle |
rnaConc = rna.ndConc; |
3176 |
06 Mar 15 |
olle |
rnaComment = rna.comment; |
3176 |
06 Mar 15 |
olle |
217 |
} |
3176 |
06 Mar 15 |
olle |
218 |
|
3293 |
30 Apr 15 |
olle |
// DNA extract from specimen |
3176 |
06 Mar 15 |
olle |
var dna = item.dna; |
3176 |
06 Mar 15 |
olle |
if (dna) |
3176 |
06 Mar 15 |
olle |
222 |
{ |
3276 |
29 Apr 15 |
olle |
if (dna.bioWell) |
3276 |
29 Apr 15 |
olle |
224 |
{ |
3276 |
29 Apr 15 |
olle |
dnaStorageBox = Strings.encodeTags(item.dna.bioWell.bioPlate.name + '[' + item.dna.bioWell.location + ']'); |
3276 |
29 Apr 15 |
olle |
226 |
} |
3176 |
06 Mar 15 |
olle |
dnaConc = dna.qubitConc; |
3176 |
06 Mar 15 |
olle |
dnaDeltaCt = dna.deltaCt; |
3176 |
06 Mar 15 |
olle |
dnaComment = dna.comment; |
3176 |
06 Mar 15 |
olle |
230 |
} |
3293 |
30 Apr 15 |
olle |
231 |
|
3293 |
30 Apr 15 |
olle |
// Input RNA item storage location should be displayed in the RNA extract storage location column |
3293 |
30 Apr 15 |
olle |
if (ep.isRna(item) && item.bioWell != null) |
3293 |
30 Apr 15 |
olle |
234 |
{ |
3293 |
30 Apr 15 |
olle |
rnaStorageBox = Strings.encodeTags(item.bioWell.bioPlate.name + '[' + item.bioWell.location + ']'); |
3293 |
30 Apr 15 |
olle |
236 |
} |
3293 |
30 Apr 15 |
olle |
237 |
|
3293 |
30 Apr 15 |
olle |
// Input DNA item storage location should be displayed in the DNA extract storage location column |
3293 |
30 Apr 15 |
olle |
if (ep.isDna(item) && item.bioWell != null) |
3293 |
30 Apr 15 |
olle |
240 |
{ |
3293 |
30 Apr 15 |
olle |
dnaStorageBox = Strings.encodeTags(item.bioWell.bioPlate.name + '[' + item.bioWell.location + ']'); |
3293 |
30 Apr 15 |
olle |
242 |
} |
3176 |
06 Mar 15 |
olle |
var specimenComment = item.comment; |
3176 |
06 Mar 15 |
olle |
244 |
} |
3246 |
14 Apr 15 |
olle |
if (item.operatorDeliveryComment) |
3246 |
14 Apr 15 |
olle |
246 |
{ |
3246 |
14 Apr 15 |
olle |
comment = item.operatorDeliveryComment; |
3246 |
14 Apr 15 |
olle |
248 |
} |
3176 |
06 Mar 15 |
olle |
if (specimenComment) |
3176 |
06 Mar 15 |
olle |
250 |
{ |
3246 |
14 Apr 15 |
olle |
if (comment) |
3246 |
14 Apr 15 |
olle |
252 |
{ |
3246 |
14 Apr 15 |
olle |
comment += ' '; |
3246 |
14 Apr 15 |
olle |
254 |
} |
3246 |
14 Apr 15 |
olle |
else |
3246 |
14 Apr 15 |
olle |
256 |
{ |
3246 |
14 Apr 15 |
olle |
comment = ''; |
3246 |
14 Apr 15 |
olle |
258 |
} |
3246 |
14 Apr 15 |
olle |
comment += 'Specimen: ' + specimenComment; |
3176 |
06 Mar 15 |
olle |
260 |
} |
3176 |
06 Mar 15 |
olle |
if (rnaComment) |
3176 |
06 Mar 15 |
olle |
262 |
{ |
3176 |
06 Mar 15 |
olle |
if (comment) |
3176 |
06 Mar 15 |
olle |
264 |
{ |
3176 |
06 Mar 15 |
olle |
comment += ' '; |
3176 |
06 Mar 15 |
olle |
266 |
} |
3176 |
06 Mar 15 |
olle |
else |
3176 |
06 Mar 15 |
olle |
268 |
{ |
3176 |
06 Mar 15 |
olle |
comment = ''; |
3176 |
06 Mar 15 |
olle |
270 |
} |
3176 |
06 Mar 15 |
olle |
comment += 'RNA: ' + rnaComment; |
3176 |
06 Mar 15 |
olle |
272 |
} |
3176 |
06 Mar 15 |
olle |
if (dnaComment) |
3176 |
06 Mar 15 |
olle |
274 |
{ |
3176 |
06 Mar 15 |
olle |
if (comment) |
3176 |
06 Mar 15 |
olle |
276 |
{ |
3176 |
06 Mar 15 |
olle |
comment += ' '; |
3176 |
06 Mar 15 |
olle |
278 |
} |
3176 |
06 Mar 15 |
olle |
else |
3176 |
06 Mar 15 |
olle |
280 |
{ |
3176 |
06 Mar 15 |
olle |
comment = ''; |
3176 |
06 Mar 15 |
olle |
282 |
} |
3176 |
06 Mar 15 |
olle |
comment += 'DNA: ' + dnaComment; |
3176 |
06 Mar 15 |
olle |
284 |
} |
3176 |
06 Mar 15 |
olle |
//alert("tableRowsForItems(): i = " + i + " itemType = " + itemType + " name = " + item.name + " qiacubePosition = " + qiacubePosition + " platePos = " + platePos + " rnaConc = " + rnaConc + " dnaConc = " + dnaConc + " comment = " + comment); |
3176 |
06 Mar 15 |
olle |
// Create HTML code for table column with checkbox for marking destroyed items |
3176 |
06 Mar 15 |
olle |
// var selectedCheckboxHtml = '<td><b><div class=\"colorbox\"></div>Selected </b></td>'; |
3176 |
06 Mar 15 |
olle |
// Insert item data in table columns |
3176 |
06 Mar 15 |
olle |
Doc.element('sample.'+accumItemNo).innerHTML = Strings.encodeTags(item.name); |
3176 |
06 Mar 15 |
olle |
290 |
/* |
3176 |
06 Mar 15 |
olle |
Doc.element('storageId.'+accumItemNo).innerHTML = Strings.encodeTags(storageId); |
3176 |
06 Mar 15 |
olle |
Doc.element('storagePosition.'+accumItemNo).innerHTML = Strings.encodeTags(storagePosition); |
3176 |
06 Mar 15 |
olle |
293 |
*/ |
3176 |
06 Mar 15 |
olle |
Doc.element('qiacubePosition.'+accumItemNo).innerHTML = Strings.encodeTags(qiacubePosition); |
3176 |
06 Mar 15 |
olle |
Doc.element('nanodropPlatePosition.'+accumItemNo).innerHTML = Strings.encodeTags(platePos); |
3276 |
29 Apr 15 |
olle |
Doc.element('rnaStorageBox.'+accumItemNo).innerHTML = Strings.encodeTags(rnaStorageBox); |
3176 |
06 Mar 15 |
olle |
Doc.element('rnaConc.'+accumItemNo).innerHTML = ep.encodeFloatTags(rnaConc); |
3276 |
29 Apr 15 |
olle |
Doc.element('dnaStorageBox.'+accumItemNo).innerHTML = Strings.encodeTags(dnaStorageBox); |
3176 |
06 Mar 15 |
olle |
Doc.element('dnaConc.'+accumItemNo).innerHTML = ep.encodeFloatTags(dnaConc); |
3176 |
06 Mar 15 |
olle |
Doc.element('deltaCt.'+accumItemNo).innerHTML = ep.encodeFloatTags(dnaDeltaCt); |
3176 |
06 Mar 15 |
olle |
Doc.element('remark.'+accumItemNo).innerHTML = Strings.encodeTags(comment); |
3176 |
06 Mar 15 |
olle |
302 |
|
3176 |
06 Mar 15 |
olle |
// Increment accumulated item number |
3176 |
06 Mar 15 |
olle |
accumItemNo++; |
3176 |
06 Mar 15 |
olle |
305 |
} |
3176 |
06 Mar 15 |
olle |
306 |
} |
3176 |
06 Mar 15 |
olle |
return accumItemNo; |
3176 |
06 Mar 15 |
olle |
308 |
} |
3176 |
06 Mar 15 |
olle |
309 |
|
3176 |
06 Mar 15 |
olle |
function tableRowForOptionalCounterbalanceItem( |
3176 |
06 Mar 15 |
olle |
accumItemNo, |
3176 |
06 Mar 15 |
olle |
itemJsonArr, |
3176 |
06 Mar 15 |
olle |
itemType, |
3176 |
06 Mar 15 |
olle |
itemTypeVarName) |
3176 |
06 Mar 15 |
olle |
315 |
{ |
3176 |
06 Mar 15 |
olle |
// Find number of QIAcube items |
3176 |
06 Mar 15 |
olle |
var lastQiacubeItem; |
3176 |
06 Mar 15 |
olle |
var numQiacubeItems = 0; |
3176 |
06 Mar 15 |
olle |
if (itemJsonArr && itemJsonArr.length > 0) |
3176 |
06 Mar 15 |
olle |
320 |
{ |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < itemJsonArr.length; i++) |
3176 |
06 Mar 15 |
olle |
322 |
{ |
3176 |
06 Mar 15 |
olle |
var item = itemJsonArr[i]; |
3176 |
06 Mar 15 |
olle |
if (item) |
3176 |
06 Mar 15 |
olle |
325 |
{ |
3176 |
06 Mar 15 |
olle |
var qiacubePosition = item.qiacubePosition; |
3176 |
06 Mar 15 |
olle |
if (qiacubePosition != null && qiacubePosition != '' && qiacubePosition != '-') |
3176 |
06 Mar 15 |
olle |
328 |
{ |
3176 |
06 Mar 15 |
olle |
lastQiacubeItem = item; |
3176 |
06 Mar 15 |
olle |
numQiacubeItems++; |
3176 |
06 Mar 15 |
olle |
331 |
} |
3176 |
06 Mar 15 |
olle |
332 |
} |
3176 |
06 Mar 15 |
olle |
333 |
} |
3176 |
06 Mar 15 |
olle |
334 |
} |
3176 |
06 Mar 15 |
olle |
if (numQiacubeItems == 1 || numQiacubeItems == 11 || numQiacubeItems == 23) |
3176 |
06 Mar 15 |
olle |
336 |
{ |
3176 |
06 Mar 15 |
olle |
// Table item row |
3176 |
06 Mar 15 |
olle |
var html = ''; |
3276 |
29 Apr 15 |
olle |
var name = 'COUNTER-BALANCE'; |
3176 |
06 Mar 15 |
olle |
var qiacubePosition = '-'; |
3176 |
06 Mar 15 |
olle |
var comment = 'Reminder to use counterbalance'; |
3176 |
06 Mar 15 |
olle |
var lastQiacubePos = lastQiacubeItem.qiacubePosition; |
3176 |
06 Mar 15 |
olle |
var lastQiacubePrefix = lastQiacubePos.substring(0,1); |
3176 |
06 Mar 15 |
olle |
if (numQiacubeItems == 1) |
3176 |
06 Mar 15 |
olle |
345 |
{ |
3176 |
06 Mar 15 |
olle |
qiacubePosition = lastQiacubePrefix + '7'; |
3176 |
06 Mar 15 |
olle |
347 |
} |
3176 |
06 Mar 15 |
olle |
else if (numQiacubeItems == 11) |
3176 |
06 Mar 15 |
olle |
349 |
{ |
3176 |
06 Mar 15 |
olle |
qiacubePosition = lastQiacubePrefix + '12'; |
3176 |
06 Mar 15 |
olle |
351 |
} |
3176 |
06 Mar 15 |
olle |
else if (numQiacubeItems == 23) |
3176 |
06 Mar 15 |
olle |
353 |
{ |
3176 |
06 Mar 15 |
olle |
qiacubePosition = lastQiacubePrefix + '12'; |
3176 |
06 Mar 15 |
olle |
355 |
} |
3176 |
06 Mar 15 |
olle |
// Create HTML code for table column with checkbox for marking destroyed items |
3176 |
06 Mar 15 |
olle |
// Insert item data in table columns |
3176 |
06 Mar 15 |
olle |
Doc.element('sample.'+accumItemNo).innerHTML = Strings.encodeTags(name); |
3176 |
06 Mar 15 |
olle |
Doc.element('qiacubePosition.'+accumItemNo).innerHTML = Strings.encodeTags(qiacubePosition); |
3176 |
06 Mar 15 |
olle |
Doc.element('nanodropPlatePosition.'+accumItemNo).innerHTML = Strings.encodeTags('-'); |
3276 |
29 Apr 15 |
olle |
Doc.element('rnaStorageBox.'+accumItemNo).innerHTML = Strings.encodeTags('-'); |
3176 |
06 Mar 15 |
olle |
Doc.element('rnaConc.'+accumItemNo).innerHTML = Strings.encodeTags('-'); |
3276 |
29 Apr 15 |
olle |
Doc.element('dnaStorageBox.'+accumItemNo).innerHTML = Strings.encodeTags('-'); |
3176 |
06 Mar 15 |
olle |
Doc.element('dnaConc.'+accumItemNo).innerHTML = Strings.encodeTags('-'); |
3176 |
06 Mar 15 |
olle |
Doc.element('deltaCt.'+accumItemNo).innerHTML = Strings.encodeTags('-'); |
3176 |
06 Mar 15 |
olle |
Doc.element('remark.'+accumItemNo).innerHTML = Strings.encodeTags(comment); |
3176 |
06 Mar 15 |
olle |
367 |
|
3176 |
06 Mar 15 |
olle |
// Increment accumulated item number |
3176 |
06 Mar 15 |
olle |
accumItemNo++; |
3176 |
06 Mar 15 |
olle |
370 |
} |
3176 |
06 Mar 15 |
olle |
// Table item row |
3176 |
06 Mar 15 |
olle |
return accumItemNo; |
3176 |
06 Mar 15 |
olle |
373 |
} |
3176 |
06 Mar 15 |
olle |
374 |
|
3293 |
30 Apr 15 |
olle |
ep.isRna = function(item) |
3293 |
30 Apr 15 |
olle |
376 |
{ |
3293 |
30 Apr 15 |
olle |
var isRna = false; |
3293 |
30 Apr 15 |
olle |
if (item != null) |
3293 |
30 Apr 15 |
olle |
379 |
{ |
3293 |
30 Apr 15 |
olle |
var name = item.name; |
3293 |
30 Apr 15 |
olle |
if (name != null) |
3293 |
30 Apr 15 |
olle |
382 |
{ |
3293 |
30 Apr 15 |
olle |
// Check if item name ends with ".r" |
3293 |
30 Apr 15 |
olle |
if (name.indexOf('.r') == (name.length - 2)) |
3293 |
30 Apr 15 |
olle |
385 |
{ |
3293 |
30 Apr 15 |
olle |
isRna = true; |
3293 |
30 Apr 15 |
olle |
387 |
} |
3293 |
30 Apr 15 |
olle |
388 |
} |
3293 |
30 Apr 15 |
olle |
389 |
} |
3293 |
30 Apr 15 |
olle |
return isRna; |
3293 |
30 Apr 15 |
olle |
391 |
} |
3293 |
30 Apr 15 |
olle |
392 |
|
3293 |
30 Apr 15 |
olle |
ep.isDna = function(item) |
3293 |
30 Apr 15 |
olle |
394 |
{ |
3293 |
30 Apr 15 |
olle |
var isDna = false; |
3293 |
30 Apr 15 |
olle |
if (item != null) |
3293 |
30 Apr 15 |
olle |
397 |
{ |
3293 |
30 Apr 15 |
olle |
var name = item.name; |
3293 |
30 Apr 15 |
olle |
if (name != null) |
3293 |
30 Apr 15 |
olle |
400 |
{ |
3293 |
30 Apr 15 |
olle |
// Check if item name ends with ".d" |
3293 |
30 Apr 15 |
olle |
if (name.indexOf('.d') == (name.length - 2)) |
3293 |
30 Apr 15 |
olle |
403 |
{ |
3293 |
30 Apr 15 |
olle |
isDna = true; |
3293 |
30 Apr 15 |
olle |
405 |
} |
3293 |
30 Apr 15 |
olle |
406 |
} |
3293 |
30 Apr 15 |
olle |
407 |
} |
3293 |
30 Apr 15 |
olle |
return isDna; |
3293 |
30 Apr 15 |
olle |
409 |
} |
3293 |
30 Apr 15 |
olle |
410 |
|
3176 |
06 Mar 15 |
olle |
ep.encodeFloatTags = function(value) |
3176 |
06 Mar 15 |
olle |
412 |
{ |
3176 |
06 Mar 15 |
olle |
var encodedValue = value; |
3176 |
06 Mar 15 |
olle |
if (!value) |
3176 |
06 Mar 15 |
olle |
415 |
{ |
3176 |
06 Mar 15 |
olle |
encodedValue = Strings.encodeTags(value); |
3176 |
06 Mar 15 |
olle |
417 |
} |
3176 |
06 Mar 15 |
olle |
return encodedValue; |
3176 |
06 Mar 15 |
olle |
419 |
} |
3176 |
06 Mar 15 |
olle |
420 |
|
3176 |
06 Mar 15 |
olle |
// A biowell as plate name |
3176 |
06 Mar 15 |
olle |
ep.asBioPlateName = function(well) |
3176 |
06 Mar 15 |
olle |
423 |
{ |
3176 |
06 Mar 15 |
olle |
if (!well) return ''; |
3176 |
06 Mar 15 |
olle |
var plate = well.bioPlate; |
3176 |
06 Mar 15 |
olle |
if (!plate) return ''; |
3176 |
06 Mar 15 |
olle |
var text = plate.name; |
3176 |
06 Mar 15 |
olle |
return text; |
3176 |
06 Mar 15 |
olle |
429 |
} |
3176 |
06 Mar 15 |
olle |
430 |
|
3176 |
06 Mar 15 |
olle |
// A biowell as the location |
3176 |
06 Mar 15 |
olle |
ep.asPureBioPlateLocation = function(well) |
3176 |
06 Mar 15 |
olle |
433 |
{ |
3176 |
06 Mar 15 |
olle |
if (!well) return ''; |
3176 |
06 Mar 15 |
olle |
var plate = well.bioPlate; |
3176 |
06 Mar 15 |
olle |
var text = well.location; |
3176 |
06 Mar 15 |
olle |
if (plate.storage) |
3176 |
06 Mar 15 |
olle |
438 |
{ |
3176 |
06 Mar 15 |
olle |
var storage = plate.storage; |
3176 |
06 Mar 15 |
olle |
var tmp = []; |
3176 |
06 Mar 15 |
olle |
if (storage.name) tmp[tmp.length] = storage.name; |
3176 |
06 Mar 15 |
olle |
if (storage.section) tmp[tmp.length] = 'section: ' +storage.section; |
3176 |
06 Mar 15 |
olle |
if (storage.tray) tmp[tmp.length] = 'tray: ' +storage.tray; |
3176 |
06 Mar 15 |
olle |
if (storage.position) tmp[tmp.length] = 'position: ' +storage.position; |
3176 |
06 Mar 15 |
olle |
text = text + ' ' + tmp.join('; '); |
3176 |
06 Mar 15 |
olle |
446 |
} |
3176 |
06 Mar 15 |
olle |
return text; |
3176 |
06 Mar 15 |
olle |
448 |
} |
3176 |
06 Mar 15 |
olle |
449 |
|
3176 |
06 Mar 15 |
olle |
return ep; |
3176 |
06 Mar 15 |
olle |
451 |
}(); |
3176 |
06 Mar 15 |
olle |
452 |
|
3176 |
06 Mar 15 |
olle |
Doc.onLoad(ExtractionProtocol.initPage); |
3176 |
06 Mar 15 |
olle |
454 |
|