extensions/net.sf.basedb.meludi/trunk/resources/libprep/add_new_libprep_kit.js

Code
Comments
Other
Rev Date Author Line
3554 20 Oct 15 olle 1 var AddLibPrepKit = function()
3554 20 Oct 15 olle 2 {
3554 20 Oct 15 olle 3   var exreg = {};
3554 20 Oct 15 olle 4   var debug = 0;
3554 20 Oct 15 olle 5   
3646 03 Dec 15 olle 6   var kitNameIsValid = false;
3554 20 Oct 15 olle 7   var reagentFileIsValid = false;
3554 20 Oct 15 olle 8   var consumablesInputIsValid = false;
3554 20 Oct 15 olle 9   var jsonConsumables = {};
3554 20 Oct 15 olle 10   
3554 20 Oct 15 olle 11   // Page initialization
3554 20 Oct 15 olle 12   exreg.initPage = function()
3554 20 Oct 15 olle 13   {
3554 20 Oct 15 olle 14     // Step 1
3554 20 Oct 15 olle 15     Events.addEventHandler('step-1', 'wizard-validate', exreg.validateStep1);
3646 03 Dec 15 olle 16     Events.addEventHandler('kitName', 'change', exreg.kitNameOnChange);
3554 20 Oct 15 olle 17     Events.addEventHandler('expirationDate', 'change', exreg.expirationDateOnChange);
3554 20 Oct 15 olle 18     Events.addEventHandler('reagentFile', 'change', exreg.reagentFileOnChange);
3554 20 Oct 15 olle 19
3554 20 Oct 15 olle 20     Buttons.addClickHandler('clearReagents', exreg.clearReagents);
3554 20 Oct 15 olle 21     Buttons.addClickHandler('downloadReagentLotNoFile', exreg.downloadReagentLotNoFile);
3554 20 Oct 15 olle 22     
3554 20 Oct 15 olle 23     // Navigation
3554 20 Oct 15 olle 24     Buttons.addClickHandler('gocancel', Wizard.cancelWizard);
3554 20 Oct 15 olle 25     Buttons.addClickHandler('gorestart', Wizard.restartWizard);
3554 20 Oct 15 olle 26     Buttons.addClickHandler('gonext', Wizard.goNextOnClick);
3554 20 Oct 15 olle 27     Buttons.addClickHandler('goregister', Wizard.goRegister);
3554 20 Oct 15 olle 28 /*
3554 20 Oct 15 olle 29     Buttons.addClickHandler('gocreate', exreg.createProtocol);
3554 20 Oct 15 olle 30 */
3554 20 Oct 15 olle 31     
3554 20 Oct 15 olle 32     // Final registration
3554 20 Oct 15 olle 33     Events.addEventHandler('wizard', 'wizard-submit', exreg.submit);
3554 20 Oct 15 olle 34
3554 20 Oct 15 olle 35     exreg.initializeStep1();
3554 20 Oct 15 olle 36   }
3554 20 Oct 15 olle 37
3554 20 Oct 15 olle 38   exreg.initializeStep1 = function()
3554 20 Oct 15 olle 39   {
3554 20 Oct 15 olle 40     var frm = document.forms['meludi'];
3646 03 Dec 15 olle 41     // Reset reagent fields
3646 03 Dec 15 olle 42     exreg.clearReagents();
3554 20 Oct 15 olle 43     // Reset JSON object for consumables
3554 20 Oct 15 olle 44     jsonConsumables = {};
3554 20 Oct 15 olle 45
3676 18 Dec 15 olle 46     // Get next kit name
3676 18 Dec 15 olle 47     var url = '../LibPrep.servlet?ID='+App.getSessionId();
3676 18 Dec 15 olle 48     url += '&cmd=GetNextAutoGeneratedKitName';
3676 18 Dec 15 olle 49     Wizard.showLoadingAnimation('Loading next kit name');
3676 18 Dec 15 olle 50     Wizard.asyncJsonRequest(url, exreg.nextKitNameLoaded);
3676 18 Dec 15 olle 51   }
3676 18 Dec 15 olle 52
3676 18 Dec 15 olle 53   exreg.nextKitNameLoaded = function(response)
3676 18 Dec 15 olle 54   {
3676 18 Dec 15 olle 55     var frm = document.forms['meludi'];
3676 18 Dec 15 olle 56     frm.kitName.value = response.name;
5272 30 Jan 19 olle 57     var kitNamePrefix = response.kitNamePrefix;
5272 30 Jan 19 olle 58     var numDigitsInName = response.numDigitsInName;
3676 18 Dec 15 olle 59     
3554 20 Oct 15 olle 60     Wizard.setCurrentStep(1);
3554 20 Oct 15 olle 61     Doc.show('step-1');
3554 20 Oct 15 olle 62     Doc.hide('gonext');
3554 20 Oct 15 olle 63     Doc.show('gocancel');
5272 30 Jan 19 olle 64     Doc.element('kitNameText').innerHTML = 'Kit name in format ("' + kitNamePrefix + '" + ' + numDigitsInName + ' digits).';
3646 03 Dec 15 olle 65 /*
3554 20 Oct 15 olle 66     Doc.hide('gocreate');
3646 03 Dec 15 olle 67 */
3554 20 Oct 15 olle 68     Doc.show('goregister');
3554 20 Oct 15 olle 69
3554 20 Oct 15 olle 70     Wizard.keepSessionAlive();
5272 30 Jan 19 olle 71
5272 30 Jan 19 olle 72     // Call exreg.kitNameOnChange() to check if kit name is valid
5272 30 Jan 19 olle 73     exreg.kitNameOnChange();
3554 20 Oct 15 olle 74   }
3554 20 Oct 15 olle 75
3554 20 Oct 15 olle 76   exreg.validateStep1 = function(event)
3554 20 Oct 15 olle 77   {
3554 20 Oct 15 olle 78     var frm = document.forms['meludi'];
3646 03 Dec 15 olle 79     // Add library preparation kit data to JSONObject jsonConsumables
3646 03 Dec 15 olle 80     exreg.addConsumablesInput();
3646 03 Dec 15 olle 81     if (!kitNameIsValid || !consumablesInputIsValid)
3554 20 Oct 15 olle 82     {
3554 20 Oct 15 olle 83       event.preventDefault();
3554 20 Oct 15 olle 84     }
3554 20 Oct 15 olle 85   }
3554 20 Oct 15 olle 86
3554 20 Oct 15 olle 87   exreg.clearReagents = function()
3554 20 Oct 15 olle 88   {
3554 20 Oct 15 olle 89     var frm = document.forms['meludi'];
3554 20 Oct 15 olle 90
3554 20 Oct 15 olle 91     // Clear reagent values
3554 20 Oct 15 olle 92
3554 20 Oct 15 olle 93     // General
3554 20 Oct 15 olle 94     frm.kitName.value = null;
3554 20 Oct 15 olle 95     frm.libraryPrepBox1.value = null;
3554 20 Oct 15 olle 96     frm.indexKit.value = null;
3554 20 Oct 15 olle 97     frm.contentSetBox3.value = null;
3554 20 Oct 15 olle 98     frm.oligoPoolA_FPA.value = null;
3554 20 Oct 15 olle 99     frm.oligoPoolB_FPB.value = null;
3554 20 Oct 15 olle 100     frm.oligoHybridizationSequencingReagent3.value = null;
3554 20 Oct 15 olle 101     frm.stringentWash1_SW1.value = null;
3554 20 Oct 15 olle 102     frm.extensionLigationMix3.value = null;
3554 20 Oct 15 olle 103     frm.pcrMasterMix2_PMM2.value = null;
3554 20 Oct 15 olle 104     frm.ub1.value = null;
3554 20 Oct 15 olle 105     frm.tdp.value = null;
3554 20 Oct 15 olle 106     frm.filterplate.value = null;
3554 20 Oct 15 olle 107     // Index 1 Primers Lot Numbers
3554 20 Oct 15 olle 108     frm.indexPrimerA701.value = null;
3554 20 Oct 15 olle 109     frm.indexPrimerA702.value = null;
3554 20 Oct 15 olle 110     frm.indexPrimerA703.value = null;
3554 20 Oct 15 olle 111     frm.indexPrimerA704.value = null;
3554 20 Oct 15 olle 112     frm.indexPrimerA705.value = null;
3554 20 Oct 15 olle 113     frm.indexPrimerA706.value = null;
3554 20 Oct 15 olle 114     frm.indexPrimerA707.value = null;
3554 20 Oct 15 olle 115     frm.indexPrimerA708.value = null;
3554 20 Oct 15 olle 116     frm.indexPrimerA709.value = null;
3554 20 Oct 15 olle 117     frm.indexPrimerA710.value = null;
3554 20 Oct 15 olle 118     frm.indexPrimerA711.value = null;
3554 20 Oct 15 olle 119     frm.indexPrimerA712.value = null;
3554 20 Oct 15 olle 120     // Index 2 Primers Lot Numbers
3554 20 Oct 15 olle 121     frm.indexPrimerA501.value = null;
3554 20 Oct 15 olle 122     frm.indexPrimerA502.value = null;
3554 20 Oct 15 olle 123     frm.indexPrimerA503.value = null;
3554 20 Oct 15 olle 124     frm.indexPrimerA504.value = null;
3554 20 Oct 15 olle 125     frm.indexPrimerA505.value = null;
3554 20 Oct 15 olle 126     frm.indexPrimerA506.value = null;
3554 20 Oct 15 olle 127     frm.indexPrimerA507.value = null;
3554 20 Oct 15 olle 128     frm.indexPrimerA508.value = null;
3554 20 Oct 15 olle 129     // Expiration date
3554 20 Oct 15 olle 130     frm.expirationDate.value = null;
3646 03 Dec 15 olle 131
3646 03 Dec 15 olle 132     // Call exreg.kitNameOnChange() to mark blank name as invalid
3646 03 Dec 15 olle 133     exreg.kitNameOnChange();
3554 20 Oct 15 olle 134   }
3554 20 Oct 15 olle 135   
3554 20 Oct 15 olle 136   exreg.addConsumablesInput = function()
3554 20 Oct 15 olle 137   {
3554 20 Oct 15 olle 138     var frm = document.forms['meludi'];
3554 20 Oct 15 olle 139     consumablesInputIsValid = false;
3554 20 Oct 15 olle 140
3554 20 Oct 15 olle 141     var jsonHeaders = exreg.createJsonHeader();
3554 20 Oct 15 olle 142
3554 20 Oct 15 olle 143     // Column data are stored in JSONArrays
3554 20 Oct 15 olle 144     var jsonKitName = [];
3554 20 Oct 15 olle 145     var jsonLibraryPrepBox1 = [];
3554 20 Oct 15 olle 146     var jsonIndexKit = [];
3554 20 Oct 15 olle 147     var jsonContentSetBox3 = [];
3554 20 Oct 15 olle 148     var jsonOligoPoolA_FPA = [];
3554 20 Oct 15 olle 149     var jsonOligoPoolB_FPB = [];
3554 20 Oct 15 olle 150     var jsonOligoHybridizationSequencingReagent3 = [];
3554 20 Oct 15 olle 151     var jsonStringentWash1_SW1 = [];
3554 20 Oct 15 olle 152     var jsonExtensionLigationMix3 = [];
3554 20 Oct 15 olle 153     var jsonPcrMasterMix2_PMM2 = [];
3554 20 Oct 15 olle 154     var jsonUB1 = [];
3554 20 Oct 15 olle 155     var jsonTDP = [];
3554 20 Oct 15 olle 156     var jsonFilterplate = [];
3554 20 Oct 15 olle 157     
3554 20 Oct 15 olle 158     var jsonIndexPrimerA701 = [];
3554 20 Oct 15 olle 159     var jsonIndexPrimerA702 = [];
3554 20 Oct 15 olle 160     var jsonIndexPrimerA703 = [];
3554 20 Oct 15 olle 161     var jsonIndexPrimerA704 = [];
3554 20 Oct 15 olle 162     var jsonIndexPrimerA705 = [];
3554 20 Oct 15 olle 163     var jsonIndexPrimerA706 = [];
3554 20 Oct 15 olle 164     var jsonIndexPrimerA707 = [];
3554 20 Oct 15 olle 165     var jsonIndexPrimerA708 = [];
3554 20 Oct 15 olle 166     var jsonIndexPrimerA709 = [];
3554 20 Oct 15 olle 167     var jsonIndexPrimerA710 = [];
3554 20 Oct 15 olle 168     var jsonIndexPrimerA711 = [];
3554 20 Oct 15 olle 169     var jsonIndexPrimerA712 = [];
3554 20 Oct 15 olle 170     
3554 20 Oct 15 olle 171     var jsonIndexPrimerA501 = [];
3554 20 Oct 15 olle 172     var jsonIndexPrimerA502 = [];
3554 20 Oct 15 olle 173     var jsonIndexPrimerA503 = [];
3554 20 Oct 15 olle 174     var jsonIndexPrimerA504 = [];
3554 20 Oct 15 olle 175     var jsonIndexPrimerA505 = [];
3554 20 Oct 15 olle 176     var jsonIndexPrimerA506 = [];
3554 20 Oct 15 olle 177     var jsonIndexPrimerA507 = [];
3554 20 Oct 15 olle 178     var jsonIndexPrimerA508 = [];
3554 20 Oct 15 olle 179
3554 20 Oct 15 olle 180     var jsonExpirationDate = [];
3554 20 Oct 15 olle 181
3554 20 Oct 15 olle 182     var j = 0;
3554 20 Oct 15 olle 183     // General
3554 20 Oct 15 olle 184     jsonKitName[j] = frm.kitName.value;
3554 20 Oct 15 olle 185     jsonLibraryPrepBox1[j] = frm.libraryPrepBox1.value;
3554 20 Oct 15 olle 186     jsonIndexKit[j] = frm.indexKit.value;
3554 20 Oct 15 olle 187     jsonContentSetBox3[j] = frm.contentSetBox3.value;
3554 20 Oct 15 olle 188     jsonOligoPoolA_FPA[j] = frm.oligoPoolA_FPA.value;
3554 20 Oct 15 olle 189     jsonOligoPoolB_FPB[j] = frm.oligoPoolB_FPB.value;
3554 20 Oct 15 olle 190     jsonOligoHybridizationSequencingReagent3[j] = frm.oligoHybridizationSequencingReagent3.value;
3554 20 Oct 15 olle 191     jsonStringentWash1_SW1[j] = frm.stringentWash1_SW1.value;
3554 20 Oct 15 olle 192     jsonExtensionLigationMix3[j] = frm.extensionLigationMix3.value;
3554 20 Oct 15 olle 193     jsonPcrMasterMix2_PMM2[j] = frm.pcrMasterMix2_PMM2.value;
3554 20 Oct 15 olle 194     jsonUB1[j] = frm.ub1.value;
3554 20 Oct 15 olle 195     jsonTDP[j] = frm.tdp.value;
3554 20 Oct 15 olle 196     jsonFilterplate[j] = frm.filterplate.value;
3554 20 Oct 15 olle 197     // Index 1 Primers Lot Numbers
3554 20 Oct 15 olle 198     jsonIndexPrimerA701[j] = frm.indexPrimerA701.value;
3554 20 Oct 15 olle 199     jsonIndexPrimerA702[j] = frm.indexPrimerA702.value;
3554 20 Oct 15 olle 200     jsonIndexPrimerA703[j] = frm.indexPrimerA703.value;
3554 20 Oct 15 olle 201     jsonIndexPrimerA704[j] = frm.indexPrimerA704.value;
3554 20 Oct 15 olle 202     jsonIndexPrimerA705[j] = frm.indexPrimerA705.value;
3554 20 Oct 15 olle 203     jsonIndexPrimerA706[j] = frm.indexPrimerA706.value;
3554 20 Oct 15 olle 204     jsonIndexPrimerA707[j] = frm.indexPrimerA707.value;
3554 20 Oct 15 olle 205     jsonIndexPrimerA708[j] = frm.indexPrimerA708.value;
3554 20 Oct 15 olle 206     jsonIndexPrimerA709[j] = frm.indexPrimerA709.value;
3554 20 Oct 15 olle 207     jsonIndexPrimerA710[j] = frm.indexPrimerA710.value;
3554 20 Oct 15 olle 208     jsonIndexPrimerA711[j] = frm.indexPrimerA711.value;
3554 20 Oct 15 olle 209     jsonIndexPrimerA712[j] = frm.indexPrimerA712.value;
3554 20 Oct 15 olle 210     // Index 2 Primers Lot Numbers
3554 20 Oct 15 olle 211     jsonIndexPrimerA501[j] = frm.indexPrimerA501.value;
3554 20 Oct 15 olle 212     jsonIndexPrimerA502[j] = frm.indexPrimerA502.value;
3554 20 Oct 15 olle 213     jsonIndexPrimerA503[j] = frm.indexPrimerA503.value;
3554 20 Oct 15 olle 214     jsonIndexPrimerA504[j] = frm.indexPrimerA504.value;
3554 20 Oct 15 olle 215     jsonIndexPrimerA505[j] = frm.indexPrimerA505.value;
3554 20 Oct 15 olle 216     jsonIndexPrimerA506[j] = frm.indexPrimerA506.value;
3554 20 Oct 15 olle 217     jsonIndexPrimerA507[j] = frm.indexPrimerA507.value;
3554 20 Oct 15 olle 218     jsonIndexPrimerA508[j] = frm.indexPrimerA508.value;
3554 20 Oct 15 olle 219     // Expiration date
3554 20 Oct 15 olle 220     jsonExpirationDate[j] = frm.expirationDate.value;
3554 20 Oct 15 olle 221
3554 20 Oct 15 olle 222     jsonConsumables['Headers'] = jsonHeaders;
3554 20 Oct 15 olle 223
3554 20 Oct 15 olle 224     jsonConsumables['KitName'] = jsonKitName;
3554 20 Oct 15 olle 225     jsonConsumables['LibraryPrepBox1'] = jsonLibraryPrepBox1;
3554 20 Oct 15 olle 226     jsonConsumables['IndexKit'] = jsonIndexKit;
3554 20 Oct 15 olle 227     jsonConsumables['ContentSetBox3'] = jsonContentSetBox3;
3554 20 Oct 15 olle 228     jsonConsumables['OligoPoolA_FPA'] = jsonOligoPoolA_FPA;
3554 20 Oct 15 olle 229     jsonConsumables['OligoPoolB_FPB'] = jsonOligoPoolB_FPB;
3554 20 Oct 15 olle 230     jsonConsumables['OligoHybridizationSequencingReagent3'] = jsonOligoHybridizationSequencingReagent3;
3554 20 Oct 15 olle 231     jsonConsumables['StringentWash1_SW1'] = jsonStringentWash1_SW1;
3554 20 Oct 15 olle 232     jsonConsumables['ExtensionLigationMix3'] = jsonExtensionLigationMix3;
3554 20 Oct 15 olle 233     jsonConsumables['PcrMasterMix2_PMM2'] = jsonPcrMasterMix2_PMM2;
3554 20 Oct 15 olle 234     jsonConsumables['UB1'] = jsonUB1;
3554 20 Oct 15 olle 235     jsonConsumables['TDP'] = jsonTDP;
3554 20 Oct 15 olle 236     jsonConsumables['Filterplate'] = jsonFilterplate;
3554 20 Oct 15 olle 237
3554 20 Oct 15 olle 238     jsonConsumables['IndexPrimerA701'] = jsonIndexPrimerA701;
3554 20 Oct 15 olle 239     jsonConsumables['IndexPrimerA702'] = jsonIndexPrimerA702;
3554 20 Oct 15 olle 240     jsonConsumables['IndexPrimerA703'] = jsonIndexPrimerA703;
3554 20 Oct 15 olle 241     jsonConsumables['IndexPrimerA704'] = jsonIndexPrimerA704;
3554 20 Oct 15 olle 242     jsonConsumables['IndexPrimerA705'] = jsonIndexPrimerA705;
3554 20 Oct 15 olle 243     jsonConsumables['IndexPrimerA706'] = jsonIndexPrimerA706;
3554 20 Oct 15 olle 244     jsonConsumables['IndexPrimerA707'] = jsonIndexPrimerA707;
3554 20 Oct 15 olle 245     jsonConsumables['IndexPrimerA708'] = jsonIndexPrimerA708;
3554 20 Oct 15 olle 246     jsonConsumables['IndexPrimerA709'] = jsonIndexPrimerA709;
3554 20 Oct 15 olle 247     jsonConsumables['IndexPrimerA710'] = jsonIndexPrimerA710;
3554 20 Oct 15 olle 248     jsonConsumables['IndexPrimerA711'] = jsonIndexPrimerA711;
3554 20 Oct 15 olle 249     jsonConsumables['IndexPrimerA712'] = jsonIndexPrimerA712;
3554 20 Oct 15 olle 250
3554 20 Oct 15 olle 251     jsonConsumables['IndexPrimerA501'] = jsonIndexPrimerA501;
3554 20 Oct 15 olle 252     jsonConsumables['IndexPrimerA502'] = jsonIndexPrimerA502;
3554 20 Oct 15 olle 253     jsonConsumables['IndexPrimerA503'] = jsonIndexPrimerA503;
3554 20 Oct 15 olle 254     jsonConsumables['IndexPrimerA504'] = jsonIndexPrimerA504;
3554 20 Oct 15 olle 255     jsonConsumables['IndexPrimerA505'] = jsonIndexPrimerA505;
3554 20 Oct 15 olle 256     jsonConsumables['IndexPrimerA506'] = jsonIndexPrimerA506;
3554 20 Oct 15 olle 257     jsonConsumables['IndexPrimerA507'] = jsonIndexPrimerA507;
3554 20 Oct 15 olle 258     jsonConsumables['IndexPrimerA508'] = jsonIndexPrimerA508;
3554 20 Oct 15 olle 259
3554 20 Oct 15 olle 260     jsonConsumables['ExpirationDate'] = jsonExpirationDate;
3554 20 Oct 15 olle 261
3554 20 Oct 15 olle 262     //Wizard.setInputStatus('consumablesFile', 'valid');
3554 20 Oct 15 olle 263     consumablesInputIsValid = true;
3554 20 Oct 15 olle 264   }
3554 20 Oct 15 olle 265
3554 20 Oct 15 olle 266   exreg.createJsonHeader = function()
3554 20 Oct 15 olle 267   {
3554 20 Oct 15 olle 268     // Column data are stored in JSONArrays
3554 20 Oct 15 olle 269     var jsonHeaders = [];
3554 20 Oct 15 olle 270
3554 20 Oct 15 olle 271     // General
3554 20 Oct 15 olle 272     jsonHeaders[jsonHeaders.length] = 'TruSight Tumor Library Preparation partI';
3554 20 Oct 15 olle 273     jsonHeaders[jsonHeaders.length] = 'TruSight Tumor Library Prep Box 1';
3554 20 Oct 15 olle 274     jsonHeaders[jsonHeaders.length] = 'TruSight Tumor Index Kit';
3554 20 Oct 15 olle 275     jsonHeaders[jsonHeaders.length] = 'TruSight Tumor Content Set Box 3';
3554 20 Oct 15 olle 276     jsonHeaders[jsonHeaders.length] = 'TruSight Tumor Oligo Pool A (FPA)';
3554 20 Oct 15 olle 277     jsonHeaders[jsonHeaders.length] = 'TruSight Tumor Oligo Pool B (FPB)';
3554 20 Oct 15 olle 278     jsonHeaders[jsonHeaders.length] = 'Oligo Hybridization for Sequencing Reagent 3 (OHS3)';
3554 20 Oct 15 olle 279     jsonHeaders[jsonHeaders.length] = 'Stringent Wash 1 (SW1)';
3554 20 Oct 15 olle 280     jsonHeaders[jsonHeaders.length] = 'Extension Ligation Mix 3 (ELM3)';
3554 20 Oct 15 olle 281     jsonHeaders[jsonHeaders.length] = 'PCR Master Mix 2 (PMM2)';
3554 20 Oct 15 olle 282     jsonHeaders[jsonHeaders.length] = 'UB1';
3554 20 Oct 15 olle 283     jsonHeaders[jsonHeaders.length] = 'TDP';
3554 20 Oct 15 olle 284     jsonHeaders[jsonHeaders.length] = 'Filterplate';
3554 20 Oct 15 olle 285     // Index 1 Primers Lot Numbers
3554 20 Oct 15 olle 286     jsonHeaders[jsonHeaders.length] = 'Index Primer A701';
3554 20 Oct 15 olle 287     jsonHeaders[jsonHeaders.length] = 'Index Primer A702';
3554 20 Oct 15 olle 288     jsonHeaders[jsonHeaders.length] = 'Index Primer A703';
3554 20 Oct 15 olle 289     jsonHeaders[jsonHeaders.length] = 'Index Primer A704';
3554 20 Oct 15 olle 290     jsonHeaders[jsonHeaders.length] = 'Index Primer A705';
3554 20 Oct 15 olle 291     jsonHeaders[jsonHeaders.length] = 'Index Primer A706';
3554 20 Oct 15 olle 292     jsonHeaders[jsonHeaders.length] = 'Index Primer A707';
3554 20 Oct 15 olle 293     jsonHeaders[jsonHeaders.length] = 'Index Primer A708';
3554 20 Oct 15 olle 294     jsonHeaders[jsonHeaders.length] = 'Index Primer A709';
3554 20 Oct 15 olle 295     jsonHeaders[jsonHeaders.length] = 'Index Primer A710';
3554 20 Oct 15 olle 296     jsonHeaders[jsonHeaders.length] = 'Index Primer A711';
3554 20 Oct 15 olle 297     jsonHeaders[jsonHeaders.length] = 'Index Primer A712';
3554 20 Oct 15 olle 298     // Index 2 Primers Lot Numbers
3554 20 Oct 15 olle 299     jsonHeaders[jsonHeaders.length] = 'Index Primer A501';
3554 20 Oct 15 olle 300     jsonHeaders[jsonHeaders.length] = 'Index Primer A502';
3554 20 Oct 15 olle 301     jsonHeaders[jsonHeaders.length] = 'Index Primer A503';
3554 20 Oct 15 olle 302     jsonHeaders[jsonHeaders.length] = 'Index Primer A504';
3554 20 Oct 15 olle 303     jsonHeaders[jsonHeaders.length] = 'Index Primer A505';
3554 20 Oct 15 olle 304     jsonHeaders[jsonHeaders.length] = 'Index Primer A506';
3554 20 Oct 15 olle 305     jsonHeaders[jsonHeaders.length] = 'Index Primer A507';
3554 20 Oct 15 olle 306     jsonHeaders[jsonHeaders.length] = 'Index Primer A508';
3554 20 Oct 15 olle 307     // Expiration date
3554 20 Oct 15 olle 308     jsonHeaders[jsonHeaders.length] = 'Expiration date';
3554 20 Oct 15 olle 309
3554 20 Oct 15 olle 310     return jsonHeaders;
3554 20 Oct 15 olle 311   }
3554 20 Oct 15 olle 312
3646 03 Dec 15 olle 313   exreg.kitNameOnChange = function()
3646 03 Dec 15 olle 314   {
3646 03 Dec 15 olle 315     var frm = document.forms['meludi'];
3646 03 Dec 15 olle 316     
3646 03 Dec 15 olle 317     var kitName = frm.kitName.value;
3646 03 Dec 15 olle 318     if (kitName == null || kitName == '')
3646 03 Dec 15 olle 319     {
3646 03 Dec 15 olle 320       kitNameIsValid = false;
3646 03 Dec 15 olle 321       Wizard.setInputStatus('kitName', 'invalid', 'Not a valid name');
3646 03 Dec 15 olle 322       return;
3646 03 Dec 15 olle 323     }
3646 03 Dec 15 olle 324
3646 03 Dec 15 olle 325     kitNameIsValid = true;
3646 03 Dec 15 olle 326     Wizard.setInputStatus('kitName', 'valid');
3646 03 Dec 15 olle 327   }
3646 03 Dec 15 olle 328
3554 20 Oct 15 olle 329   exreg.expirationDateOnChange = function()
3554 20 Oct 15 olle 330   {
3554 20 Oct 15 olle 331     var frm = document.forms['meludi'];
3554 20 Oct 15 olle 332     
3554 20 Oct 15 olle 333     var expirationDateIsValid = Wizard.isValid('expirationDate');
3554 20 Oct 15 olle 334     
3554 20 Oct 15 olle 335     if (!expirationDateIsValid) return;
3554 20 Oct 15 olle 336
3554 20 Oct 15 olle 337     var expirationDate = Dates.parseString(frm.expirationDate.value, 'yyyyMMdd');
3554 20 Oct 15 olle 338     if (expirationDate == null)
3554 20 Oct 15 olle 339     {
3554 20 Oct 15 olle 340       Wizard.setInputStatus('expirationDate', 'invalid', 'Not a valid date');
3554 20 Oct 15 olle 341       return;
3554 20 Oct 15 olle 342     }
3554 20 Oct 15 olle 343     var currentDate = Dates.parseString(exreg.getTodaysDate(), 'yyyyMMdd');
3554 20 Oct 15 olle 344     if (currentDate > expirationDate)
3554 20 Oct 15 olle 345     {
3554 20 Oct 15 olle 346       Wizard.setInputStatus('expirationDate', 'warning', 'Expiration date is already passed!');
3554 20 Oct 15 olle 347       return;
3554 20 Oct 15 olle 348     }
3554 20 Oct 15 olle 349
3554 20 Oct 15 olle 350     Wizard.setInputStatus('expirationDate', 'valid');
3554 20 Oct 15 olle 351   }
3554 20 Oct 15 olle 352
3554 20 Oct 15 olle 353   exreg.getTodaysDate = function()
3554 20 Oct 15 olle 354   {
3554 20 Oct 15 olle 355     // Get current time stamp
3554 20 Oct 15 olle 356     var now = new Date();
3554 20 Oct 15 olle 357     return exreg.timestampToDateString(now);
3554 20 Oct 15 olle 358   }
3554 20 Oct 15 olle 359
3554 20 Oct 15 olle 360   exreg.timestampToDateString = function(timestamp)
3554 20 Oct 15 olle 361   {
3554 20 Oct 15 olle 362     // Get  date in components yyyy, mm, dd
3554 20 Oct 15 olle 363     var yyyy = timestamp.getFullYear();
3554 20 Oct 15 olle 364     var mm = timestamp.getMonth()+1; //January is 0!
3554 20 Oct 15 olle 365     if (mm < 10)
3554 20 Oct 15 olle 366     {
3554 20 Oct 15 olle 367       mm = '0' + mm;
3554 20 Oct 15 olle 368     }
3554 20 Oct 15 olle 369     var dd = timestamp.getDate();
3554 20 Oct 15 olle 370     if (dd < 10)
3554 20 Oct 15 olle 371     {
3554 20 Oct 15 olle 372       dd = '0' + dd;
3554 20 Oct 15 olle 373     }
3554 20 Oct 15 olle 374     var dateString = '' + yyyy + mm + dd;
3554 20 Oct 15 olle 375
3554 20 Oct 15 olle 376     return dateString;
3554 20 Oct 15 olle 377   }
3554 20 Oct 15 olle 378
3554 20 Oct 15 olle 379   exreg.reagentFileOnChange = function()
3554 20 Oct 15 olle 380   {
3554 20 Oct 15 olle 381     var frm = document.forms['meludi'];
3554 20 Oct 15 olle 382     var file = frm.reagentFile.files[0];
3554 20 Oct 15 olle 383     
3554 20 Oct 15 olle 384     var reader = new FileReader();
3554 20 Oct 15 olle 385     reader.onload = exreg.reagentFileLoaded;
3554 20 Oct 15 olle 386     reader.readAsText(file);
3554 20 Oct 15 olle 387   }
3554 20 Oct 15 olle 388
3554 20 Oct 15 olle 389   exreg.reagentFileLoaded = function(event)
3554 20 Oct 15 olle 390   {
3554 20 Oct 15 olle 391     exreg.parseReagentFile(event.target.result);
3554 20 Oct 15 olle 392   }
3554 20 Oct 15 olle 393
3554 20 Oct 15 olle 394   exreg.parseReagentFile = function(data)
3554 20 Oct 15 olle 395   {
3554 20 Oct 15 olle 396     var frm = document.forms['meludi'];
3554 20 Oct 15 olle 397     reagentFileIsValid = false;
3554 20 Oct 15 olle 398
3554 20 Oct 15 olle 399     var numReagentItems = 0;
3554 20 Oct 15 olle 400
3554 20 Oct 15 olle 401     // Reset the column numbers
3554 20 Oct 15 olle 402     var kitNameColumnNo = -1;
3554 20 Oct 15 olle 403     var libraryPrepBox1ColumnNo = -1;
3554 20 Oct 15 olle 404     var indexKitColumnNo = -1;
3554 20 Oct 15 olle 405     var contentSetBox3ColumnNo = -1;
3554 20 Oct 15 olle 406     var oligoPoolA_FPAColumnNo = -1;
3554 20 Oct 15 olle 407     var oligoPoolB_FPBColumnNo = -1;
3554 20 Oct 15 olle 408     var oligoHybridizationSequencingReagent3ColumnNo = -1;
3554 20 Oct 15 olle 409     var stringentWash1_SW1ColumnNo = -1;
3554 20 Oct 15 olle 410     var extensionLigationMix3ColumnNo = -1;
3554 20 Oct 15 olle 411     var pcrMasterMix2_PMM2ColumnNo = -1;
3554 20 Oct 15 olle 412     var ub1ColumnNo = -1;
3554 20 Oct 15 olle 413     var tdpColumnNo = -1;
3554 20 Oct 15 olle 414     var filterplateColumnNo = -1;
3554 20 Oct 15 olle 415     
3554 20 Oct 15 olle 416     var indexPrimerA701ColumnNo = -1;
3554 20 Oct 15 olle 417     var indexPrimerA702ColumnNo = -1;
3554 20 Oct 15 olle 418     var indexPrimerA703ColumnNo = -1;
3554 20 Oct 15 olle 419     var indexPrimerA704ColumnNo = -1;
3554 20 Oct 15 olle 420     var indexPrimerA705ColumnNo = -1;
3554 20 Oct 15 olle 421     var indexPrimerA706ColumnNo = -1;
3554 20 Oct 15 olle 422     var indexPrimerA707ColumnNo = -1;
3554 20 Oct 15 olle 423     var indexPrimerA708ColumnNo = -1;
3554 20 Oct 15 olle 424     var indexPrimerA709ColumnNo = -1;
3554 20 Oct 15 olle 425     var indexPrimerA710ColumnNo = -1;
3554 20 Oct 15 olle 426     var indexPrimerA711ColumnNo = -1;
3554 20 Oct 15 olle 427     var indexPrimerA712ColumnNo = -1;
3554 20 Oct 15 olle 428     
3554 20 Oct 15 olle 429     var indexPrimerA501ColumnNo = -1;
3554 20 Oct 15 olle 430     var indexPrimerA502ColumnNo = -1;
3554 20 Oct 15 olle 431     var indexPrimerA503ColumnNo = -1;
3554 20 Oct 15 olle 432     var indexPrimerA504ColumnNo = -1;
3554 20 Oct 15 olle 433     var indexPrimerA505ColumnNo = -1;
3554 20 Oct 15 olle 434     var indexPrimerA506ColumnNo = -1;
3554 20 Oct 15 olle 435     var indexPrimerA507ColumnNo = -1;
3554 20 Oct 15 olle 436     var indexPrimerA508ColumnNo = -1;
3554 20 Oct 15 olle 437
3554 20 Oct 15 olle 438     var expirationDateColumnNo = -1;
3554 20 Oct 15 olle 439
3554 20 Oct 15 olle 440     // Reset the existing values
3554 20 Oct 15 olle 441     var kitName = '';
3554 20 Oct 15 olle 442     var libraryPrepBox1 = '';
3554 20 Oct 15 olle 443     var indexKit = '';
3554 20 Oct 15 olle 444     var contentSetBox3 = '';
3554 20 Oct 15 olle 445     var oligoPoolA_FPA = '';
3554 20 Oct 15 olle 446     var oligoPoolB_FPB = '';
3554 20 Oct 15 olle 447     var oligoHybridizationSequencingReagent3 = '';
3554 20 Oct 15 olle 448     var stringentWash1_SW1 = '';
3554 20 Oct 15 olle 449     var extensionLigationMix3 = '';
3554 20 Oct 15 olle 450     var pcrMasterMix2_PMM2 = '';
3554 20 Oct 15 olle 451     var ub1 = '';
3554 20 Oct 15 olle 452     var tdp = '';
3554 20 Oct 15 olle 453     var filterplate = '';
3554 20 Oct 15 olle 454     
3554 20 Oct 15 olle 455     var indexPrimerA701 = '';
3554 20 Oct 15 olle 456     var indexPrimerA702 = '';
3554 20 Oct 15 olle 457     var indexPrimerA703 = '';
3554 20 Oct 15 olle 458     var indexPrimerA704 = '';
3554 20 Oct 15 olle 459     var indexPrimerA705 = '';
3554 20 Oct 15 olle 460     var indexPrimerA706 = '';
3554 20 Oct 15 olle 461     var indexPrimerA707 = '';
3554 20 Oct 15 olle 462     var indexPrimerA708 = '';
3554 20 Oct 15 olle 463     var indexPrimerA709 = '';
3554 20 Oct 15 olle 464     var indexPrimerA710 = '';
3554 20 Oct 15 olle 465     var indexPrimerA711 = '';
3554 20 Oct 15 olle 466     var indexPrimerA712 = '';
3554 20 Oct 15 olle 467     
3554 20 Oct 15 olle 468     var indexPrimerA501 = '';
3554 20 Oct 15 olle 469     var indexPrimerA502 = '';
3554 20 Oct 15 olle 470     var indexPrimerA503 = '';
3554 20 Oct 15 olle 471     var indexPrimerA504 = '';
3554 20 Oct 15 olle 472     var indexPrimerA505 = '';
3554 20 Oct 15 olle 473     var indexPrimerA506 = '';
3554 20 Oct 15 olle 474     var indexPrimerA507 = '';
3554 20 Oct 15 olle 475     var indexPrimerA508 = '';
3554 20 Oct 15 olle 476
3554 20 Oct 15 olle 477     var expirationDate = '';
3554 20 Oct 15 olle 478
3554 20 Oct 15 olle 479     // Find column separator as first character after first occurrence of search string
3554 20 Oct 15 olle 480     var separator = ExtractUtils.findSeparator(data, "TruSight Tumor Library Preparation partI");
3554 20 Oct 15 olle 481     if (separator == null)
3554 20 Oct 15 olle 482     {
3554 20 Oct 15 olle 483       // Comma is default separator
3554 20 Oct 15 olle 484       separator = ',';
3554 20 Oct 15 olle 485     }
3554 20 Oct 15 olle 486     var columnSplitRegexp = new RegExp(" *" + separator + " *",'');
3554 20 Oct 15 olle 487     var lines = data.split(/[\n\r]+/);
3554 20 Oct 15 olle 488     var columns = lines[0].split(columnSplitRegexp);
3554 20 Oct 15 olle 489
3554 20 Oct 15 olle 490     var numImported = 0;
3554 20 Oct 15 olle 491     for (var i = 1; i < lines.length; i++)
3554 20 Oct 15 olle 492     {
3554 20 Oct 15 olle 493       if (lines[i].match(/^\s*$/)) continue; // Ignore empty lines
3554 20 Oct 15 olle 494       var row = lines[i].split(columnSplitRegexp);
3554 20 Oct 15 olle 495       if (row.length > 1) 
3554 20 Oct 15 olle 496       {
3554 20 Oct 15 olle 497         var key = row[0];
3554 20 Oct 15 olle 498         if (!key || key == '') continue; // with the next line
3554 20 Oct 15 olle 499
3554 20 Oct 15 olle 500         if (key == 'TruSight Tumor Library Preparation partI')
3554 20 Oct 15 olle 501         {
3554 20 Oct 15 olle 502           // Header line
3554 20 Oct 15 olle 503           for (var j = 0; j < row.length; j++)
3554 20 Oct 15 olle 504           {
3554 20 Oct 15 olle 505             if (row[j] == 'TruSight Tumor Library Preparation partI')
3554 20 Oct 15 olle 506             {
3554 20 Oct 15 olle 507               kitNameColumnNo = j;
3554 20 Oct 15 olle 508             }
3554 20 Oct 15 olle 509             else if (row[j] == 'TruSight Tumor Library Prep Box 1')
3554 20 Oct 15 olle 510             {
3554 20 Oct 15 olle 511               libraryPrepBox1ColumnNo = j;
3554 20 Oct 15 olle 512             }
3554 20 Oct 15 olle 513             else if (row[j] == 'TruSight Tumor Index Kit')
3554 20 Oct 15 olle 514             {
3554 20 Oct 15 olle 515               indexKitColumnNo = j;
3554 20 Oct 15 olle 516             }
3554 20 Oct 15 olle 517             else if (row[j] == 'TruSight Tumor Content Set Box 3')
3554 20 Oct 15 olle 518             {
3554 20 Oct 15 olle 519               contentSetBox3ColumnNo = j;
3554 20 Oct 15 olle 520             }
3554 20 Oct 15 olle 521             else if (row[j] == 'TruSight Tumor Oligo Pool A (FPA)')
3554 20 Oct 15 olle 522             {
3554 20 Oct 15 olle 523               oligoPoolA_FPAColumnNo = j;
3554 20 Oct 15 olle 524             }
3554 20 Oct 15 olle 525             else if (row[j] == 'TruSight Tumor Oligo Pool B (FPB)')
3554 20 Oct 15 olle 526             {
3554 20 Oct 15 olle 527               oligoPoolB_FPBColumnNo = j;
3554 20 Oct 15 olle 528             }
3554 20 Oct 15 olle 529             else if (row[j] == 'Oligo Hybridization for Sequencing Reagent 3 (OHS3)')
3554 20 Oct 15 olle 530             {
3554 20 Oct 15 olle 531               oligoHybridizationSequencingReagent3ColumnNo = j;
3554 20 Oct 15 olle 532             }
3554 20 Oct 15 olle 533             else if (row[j] == 'Stringent Wash 1 (SW1)')
3554 20 Oct 15 olle 534             {
3554 20 Oct 15 olle 535               stringentWash1_SW1ColumnNo = j;
3554 20 Oct 15 olle 536             }
3554 20 Oct 15 olle 537             else if (row[j] == 'Extension Ligation Mix 3 (ELM3)')
3554 20 Oct 15 olle 538             {
3554 20 Oct 15 olle 539               extensionLigationMix3ColumnNo = j;
3554 20 Oct 15 olle 540             }
3554 20 Oct 15 olle 541             else if (row[j] == 'PCR Master Mix 2 (PMM2)')
3554 20 Oct 15 olle 542             {
3554 20 Oct 15 olle 543               pcrMasterMix2_PMM2ColumnNo = j;
3554 20 Oct 15 olle 544             }
3554 20 Oct 15 olle 545             else if (row[j] == 'UB1')
3554 20 Oct 15 olle 546             {
3554 20 Oct 15 olle 547               ub1ColumnNo = j;
3554 20 Oct 15 olle 548             }
3554 20 Oct 15 olle 549             else if (row[j] == 'TDP')
3554 20 Oct 15 olle 550             {
3554 20 Oct 15 olle 551               tdpColumnNo = j;
3554 20 Oct 15 olle 552             }
3554 20 Oct 15 olle 553             else if (row[j] == 'Filterplate')
3554 20 Oct 15 olle 554             {
3554 20 Oct 15 olle 555               filterplateColumnNo = j;
3554 20 Oct 15 olle 556             }
3554 20 Oct 15 olle 557             else if (row[j] == 'A701')
3554 20 Oct 15 olle 558             {
3554 20 Oct 15 olle 559               indexPrimerA701ColumnNo = j;
3554 20 Oct 15 olle 560             }
3554 20 Oct 15 olle 561             else if (row[j] == 'A702')
3554 20 Oct 15 olle 562             {
3554 20 Oct 15 olle 563               indexPrimerA702ColumnNo = j;
3554 20 Oct 15 olle 564             }
3554 20 Oct 15 olle 565             else if (row[j] == 'A703')
3554 20 Oct 15 olle 566             {
3554 20 Oct 15 olle 567               indexPrimerA703ColumnNo = j;
3554 20 Oct 15 olle 568             }
3554 20 Oct 15 olle 569             else if (row[j] == 'A704')
3554 20 Oct 15 olle 570             {
3554 20 Oct 15 olle 571               indexPrimerA704ColumnNo = j;
3554 20 Oct 15 olle 572             }
3554 20 Oct 15 olle 573             else if (row[j] == 'A705')
3554 20 Oct 15 olle 574             {
3554 20 Oct 15 olle 575               indexPrimerA705ColumnNo = j;
3554 20 Oct 15 olle 576             }
3554 20 Oct 15 olle 577             else if (row[j] == 'A706')
3554 20 Oct 15 olle 578             {
3554 20 Oct 15 olle 579               indexPrimerA706ColumnNo = j;
3554 20 Oct 15 olle 580             }
3554 20 Oct 15 olle 581             else if (row[j] == 'A707')
3554 20 Oct 15 olle 582             {
3554 20 Oct 15 olle 583               indexPrimerA707ColumnNo = j;
3554 20 Oct 15 olle 584             }
3554 20 Oct 15 olle 585             else if (row[j] == 'A708')
3554 20 Oct 15 olle 586             {
3554 20 Oct 15 olle 587               indexPrimerA708ColumnNo = j;
3554 20 Oct 15 olle 588             }
3554 20 Oct 15 olle 589             else if (row[j] == 'A709')
3554 20 Oct 15 olle 590             {
3554 20 Oct 15 olle 591               indexPrimerA709ColumnNo = j;
3554 20 Oct 15 olle 592             }
3554 20 Oct 15 olle 593             else if (row[j] == 'A710')
3554 20 Oct 15 olle 594             {
3554 20 Oct 15 olle 595               indexPrimerA710ColumnNo = j;
3554 20 Oct 15 olle 596             }
3554 20 Oct 15 olle 597             else if (row[j] == 'A711')
3554 20 Oct 15 olle 598             {
3554 20 Oct 15 olle 599               indexPrimerA711ColumnNo = j;
3554 20 Oct 15 olle 600             }
3554 20 Oct 15 olle 601             else if (row[j] == 'A712')
3554 20 Oct 15 olle 602             {
3554 20 Oct 15 olle 603               indexPrimerA712ColumnNo = j;
3554 20 Oct 15 olle 604             }
3554 20 Oct 15 olle 605             else if (row[j] == 'A501')
3554 20 Oct 15 olle 606             {
3554 20 Oct 15 olle 607               indexPrimerA501ColumnNo = j;
3554 20 Oct 15 olle 608             }
3554 20 Oct 15 olle 609             else if (row[j] == 'A502')
3554 20 Oct 15 olle 610             {
3554 20 Oct 15 olle 611               indexPrimerA502ColumnNo = j;
3554 20 Oct 15 olle 612             }
3554 20 Oct 15 olle 613             else if (row[j] == 'A503')
3554 20 Oct 15 olle 614             {
3554 20 Oct 15 olle 615               indexPrimerA503ColumnNo = j;
3554 20 Oct 15 olle 616             }
3554 20 Oct 15 olle 617             else if (row[j] == 'A504')
3554 20 Oct 15 olle 618             {
3554 20 Oct 15 olle 619               indexPrimerA504ColumnNo = j;
3554 20 Oct 15 olle 620             }
3554 20 Oct 15 olle 621             else if (row[j] == 'A505')
3554 20 Oct 15 olle 622             {
3554 20 Oct 15 olle 623               indexPrimerA505ColumnNo = j;
3554 20 Oct 15 olle 624             }
3554 20 Oct 15 olle 625             else if (row[j] == 'A506')
3554 20 Oct 15 olle 626             {
3554 20 Oct 15 olle 627               indexPrimerA506ColumnNo = j;
3554 20 Oct 15 olle 628             }
3554 20 Oct 15 olle 629             else if (row[j] == 'A507')
3554 20 Oct 15 olle 630             {
3554 20 Oct 15 olle 631               indexPrimerA507ColumnNo = j;
3554 20 Oct 15 olle 632             }
3554 20 Oct 15 olle 633             else if (row[j] == 'A508')
3554 20 Oct 15 olle 634             {
3554 20 Oct 15 olle 635               indexPrimerA508ColumnNo = j;
3554 20 Oct 15 olle 636             }
3554 20 Oct 15 olle 637             else if (row[j] == 'Expiration date')
3554 20 Oct 15 olle 638             {
3554 20 Oct 15 olle 639               expirationDateColumnNo = j;
3554 20 Oct 15 olle 640             }
3554 20 Oct 15 olle 641           }
3554 20 Oct 15 olle 642         }
3554 20 Oct 15 olle 643
3554 20 Oct 15 olle 644         // Check if key starts with "ML_"
3554 20 Oct 15 olle 645         if (key.match(/^ML_.*$/))
3554 20 Oct 15 olle 646         {
3554 20 Oct 15 olle 647           // Library preparation kit line
3554 20 Oct 15 olle 648           if (kitNameColumnNo >= 0)
3554 20 Oct 15 olle 649           {
3554 20 Oct 15 olle 650             kitName = row[kitNameColumnNo];
3554 20 Oct 15 olle 651           }
3554 20 Oct 15 olle 652           if (libraryPrepBox1ColumnNo >= 0)
3554 20 Oct 15 olle 653           {
3554 20 Oct 15 olle 654             libraryPrepBox1 = row[libraryPrepBox1ColumnNo];
3554 20 Oct 15 olle 655           }
3554 20 Oct 15 olle 656           if (indexKitColumnNo >= 0)
3554 20 Oct 15 olle 657           {
3554 20 Oct 15 olle 658             indexKit = row[indexKitColumnNo];
3554 20 Oct 15 olle 659           }
3554 20 Oct 15 olle 660           if (contentSetBox3ColumnNo >= 0)
3554 20 Oct 15 olle 661           {
3554 20 Oct 15 olle 662             contentSetBox3 = row[contentSetBox3ColumnNo];
3554 20 Oct 15 olle 663           }
3554 20 Oct 15 olle 664           if (oligoPoolA_FPAColumnNo >= 0)
3554 20 Oct 15 olle 665           {
3554 20 Oct 15 olle 666             oligoPoolA_FPA = row[oligoPoolA_FPAColumnNo];
3554 20 Oct 15 olle 667           }
3554 20 Oct 15 olle 668           if (oligoPoolB_FPBColumnNo >= 0)
3554 20 Oct 15 olle 669           {
3554 20 Oct 15 olle 670             oligoPoolB_FPB = row[oligoPoolB_FPBColumnNo];
3554 20 Oct 15 olle 671           }
3554 20 Oct 15 olle 672           if (oligoHybridizationSequencingReagent3ColumnNo >= 0)
3554 20 Oct 15 olle 673           {
3554 20 Oct 15 olle 674             oligoHybridizationSequencingReagent3 = row[oligoHybridizationSequencingReagent3ColumnNo];
3554 20 Oct 15 olle 675           }
3554 20 Oct 15 olle 676           if (stringentWash1_SW1ColumnNo >= 0)
3554 20 Oct 15 olle 677           {
3554 20 Oct 15 olle 678             stringentWash1_SW1 = row[stringentWash1_SW1ColumnNo];
3554 20 Oct 15 olle 679           }
3554 20 Oct 15 olle 680           if (extensionLigationMix3ColumnNo >= 0)
3554 20 Oct 15 olle 681           {
3554 20 Oct 15 olle 682             extensionLigationMix3 = row[extensionLigationMix3ColumnNo];
3554 20 Oct 15 olle 683           }
3554 20 Oct 15 olle 684           if (pcrMasterMix2_PMM2ColumnNo >= 0)
3554 20 Oct 15 olle 685           {
3554 20 Oct 15 olle 686             pcrMasterMix2_PMM2 = row[pcrMasterMix2_PMM2ColumnNo];
3554 20 Oct 15 olle 687           }
3554 20 Oct 15 olle 688           if (ub1ColumnNo >= 0)
3554 20 Oct 15 olle 689           {
3554 20 Oct 15 olle 690             ub1 = row[ub1ColumnNo];
3554 20 Oct 15 olle 691           }
3554 20 Oct 15 olle 692           if (tdpColumnNo >= 0)
3554 20 Oct 15 olle 693           {
3554 20 Oct 15 olle 694             tdp = row[tdpColumnNo];
3554 20 Oct 15 olle 695           }
3554 20 Oct 15 olle 696           if (filterplateColumnNo >= 0)
3554 20 Oct 15 olle 697           {
3554 20 Oct 15 olle 698             filterplate = row[filterplateColumnNo];
3554 20 Oct 15 olle 699           }
3554 20 Oct 15 olle 700           if (indexPrimerA701ColumnNo >= 0)
3554 20 Oct 15 olle 701           {
3554 20 Oct 15 olle 702             indexPrimerA701 = row[indexPrimerA701ColumnNo];
3554 20 Oct 15 olle 703           }
3554 20 Oct 15 olle 704           if (indexPrimerA702ColumnNo >= 0)
3554 20 Oct 15 olle 705           {
3554 20 Oct 15 olle 706             indexPrimerA702 = row[indexPrimerA702ColumnNo];
3554 20 Oct 15 olle 707           }
3554 20 Oct 15 olle 708           if (indexPrimerA703ColumnNo >= 0)
3554 20 Oct 15 olle 709           {
3554 20 Oct 15 olle 710             indexPrimerA703 = row[indexPrimerA703ColumnNo];
3554 20 Oct 15 olle 711           }
3554 20 Oct 15 olle 712           if (indexPrimerA704ColumnNo >= 0)
3554 20 Oct 15 olle 713           {
3554 20 Oct 15 olle 714             indexPrimerA704 = row[indexPrimerA704ColumnNo];
3554 20 Oct 15 olle 715           }
3554 20 Oct 15 olle 716           if (indexPrimerA705ColumnNo >= 0)
3554 20 Oct 15 olle 717           {
3554 20 Oct 15 olle 718             indexPrimerA705 = row[indexPrimerA705ColumnNo];
3554 20 Oct 15 olle 719           }
3554 20 Oct 15 olle 720           if (indexPrimerA706ColumnNo >= 0)
3554 20 Oct 15 olle 721           {
3554 20 Oct 15 olle 722             indexPrimerA706 = row[indexPrimerA706ColumnNo];
3554 20 Oct 15 olle 723           }
3554 20 Oct 15 olle 724           if (indexPrimerA707ColumnNo >= 0)
3554 20 Oct 15 olle 725           {
3554 20 Oct 15 olle 726             indexPrimerA707 = row[indexPrimerA707ColumnNo];
3554 20 Oct 15 olle 727           }
3554 20 Oct 15 olle 728           if (indexPrimerA708ColumnNo >= 0)
3554 20 Oct 15 olle 729           {
3554 20 Oct 15 olle 730             indexPrimerA708 = row[indexPrimerA708ColumnNo];
3554 20 Oct 15 olle 731           }
3554 20 Oct 15 olle 732           if (indexPrimerA709ColumnNo >= 0)
3554 20 Oct 15 olle 733           {
3554 20 Oct 15 olle 734             indexPrimerA709 = row[indexPrimerA709ColumnNo];
3554 20 Oct 15 olle 735           }
3554 20 Oct 15 olle 736           if (indexPrimerA710ColumnNo >= 0)
3554 20 Oct 15 olle 737           {
3554 20 Oct 15 olle 738             indexPrimerA710 = row[indexPrimerA710ColumnNo];
3554 20 Oct 15 olle 739           }
3554 20 Oct 15 olle 740           if (indexPrimerA711ColumnNo >= 0)
3554 20 Oct 15 olle 741           {
3554 20 Oct 15 olle 742             indexPrimerA711 = row[indexPrimerA711ColumnNo];
3554 20 Oct 15 olle 743           }
3554 20 Oct 15 olle 744           if (indexPrimerA712ColumnNo >= 0)
3554 20 Oct 15 olle 745           {
3554 20 Oct 15 olle 746             indexPrimerA712 = row[indexPrimerA712ColumnNo];
3554 20 Oct 15 olle 747           }
3554 20 Oct 15 olle 748           if (indexPrimerA501ColumnNo >= 0)
3554 20 Oct 15 olle 749           {
3554 20 Oct 15 olle 750             indexPrimerA501 = row[indexPrimerA501ColumnNo];
3554 20 Oct 15 olle 751           }
3554 20 Oct 15 olle 752           if (indexPrimerA502ColumnNo >= 0)
3554 20 Oct 15 olle 753           {
3554 20 Oct 15 olle 754             indexPrimerA502 = row[indexPrimerA502ColumnNo];
3554 20 Oct 15 olle 755           }
3554 20 Oct 15 olle 756           if (indexPrimerA503ColumnNo >= 0)
3554 20 Oct 15 olle 757           {
3554 20 Oct 15 olle 758             indexPrimerA503 = row[indexPrimerA503ColumnNo];
3554 20 Oct 15 olle 759           }
3554 20 Oct 15 olle 760           if (indexPrimerA504ColumnNo >= 0)
3554 20 Oct 15 olle 761           {
3554 20 Oct 15 olle 762             indexPrimerA504 = row[indexPrimerA504ColumnNo];
3554 20 Oct 15 olle 763           }
3554 20 Oct 15 olle 764           if (indexPrimerA505ColumnNo >= 0)
3554 20 Oct 15 olle 765           {
3554 20 Oct 15 olle 766             indexPrimerA505 = row[indexPrimerA505ColumnNo];
3554 20 Oct 15 olle 767           }
3554 20 Oct 15 olle 768           if (indexPrimerA506ColumnNo >= 0)
3554 20 Oct 15 olle 769           {
3554 20 Oct 15 olle 770             indexPrimerA506 = row[indexPrimerA506ColumnNo];
3554 20 Oct 15 olle 771           }
3554 20 Oct 15 olle 772           if (indexPrimerA507ColumnNo >= 0)
3554 20 Oct 15 olle 773           {
3554 20 Oct 15 olle 774             indexPrimerA507 = row[indexPrimerA507ColumnNo];
3554 20 Oct 15 olle 775           }
3554 20 Oct 15 olle 776           if (indexPrimerA508ColumnNo >= 0)
3554 20 Oct 15 olle 777           {
3554 20 Oct 15 olle 778             indexPrimerA508 = row[indexPrimerA508ColumnNo];
3554 20 Oct 15 olle 779           }
3554 20 Oct 15 olle 780           if (expirationDateColumnNo >= 0)
3554 20 Oct 15 olle 781           {
3554 20 Oct 15 olle 782             expirationDate = row[expirationDateColumnNo];
3554 20 Oct 15 olle 783           }
3554 20 Oct 15 olle 784         }
3554 20 Oct 15 olle 785       }
3554 20 Oct 15 olle 786     }
3554 20 Oct 15 olle 787
3554 20 Oct 15 olle 788     // Update presented reagent lot number values
3554 20 Oct 15 olle 789
3554 20 Oct 15 olle 790     // General
3554 20 Oct 15 olle 791     frm.kitName.value = kitName;
3554 20 Oct 15 olle 792     frm.libraryPrepBox1.value = libraryPrepBox1;
3554 20 Oct 15 olle 793     frm.indexKit.value = indexKit;
3554 20 Oct 15 olle 794     frm.contentSetBox3.value = contentSetBox3;
3554 20 Oct 15 olle 795     frm.oligoPoolA_FPA.value = oligoPoolA_FPA;
3554 20 Oct 15 olle 796     frm.oligoPoolB_FPB.value = oligoPoolB_FPB;
3554 20 Oct 15 olle 797     frm.oligoHybridizationSequencingReagent3.value = oligoHybridizationSequencingReagent3;
3554 20 Oct 15 olle 798     frm.stringentWash1_SW1.value = stringentWash1_SW1;
3554 20 Oct 15 olle 799     frm.extensionLigationMix3.value = extensionLigationMix3;
3554 20 Oct 15 olle 800     frm.pcrMasterMix2_PMM2.value = pcrMasterMix2_PMM2;
3554 20 Oct 15 olle 801     frm.ub1.value = ub1;
3554 20 Oct 15 olle 802     frm.tdp.value = tdp;
3554 20 Oct 15 olle 803     frm.filterplate.value = filterplate;
3554 20 Oct 15 olle 804     // Index 1 Primers Lot Numbers
3554 20 Oct 15 olle 805     frm.indexPrimerA701.value = indexPrimerA701;
3554 20 Oct 15 olle 806     frm.indexPrimerA702.value = indexPrimerA702;
3554 20 Oct 15 olle 807     frm.indexPrimerA703.value = indexPrimerA703;
3554 20 Oct 15 olle 808     frm.indexPrimerA704.value = indexPrimerA704;
3554 20 Oct 15 olle 809     frm.indexPrimerA705.value = indexPrimerA705;
3554 20 Oct 15 olle 810     frm.indexPrimerA706.value = indexPrimerA706;
3554 20 Oct 15 olle 811     frm.indexPrimerA707.value = indexPrimerA707;
3554 20 Oct 15 olle 812     frm.indexPrimerA708.value = indexPrimerA708;
3554 20 Oct 15 olle 813     frm.indexPrimerA709.value = indexPrimerA709;
3554 20 Oct 15 olle 814     frm.indexPrimerA710.value = indexPrimerA710;
3554 20 Oct 15 olle 815     frm.indexPrimerA711.value = indexPrimerA711;
3554 20 Oct 15 olle 816     frm.indexPrimerA712.value = indexPrimerA712;
3554 20 Oct 15 olle 817     // Index 2 Primers Lot Numbers
3554 20 Oct 15 olle 818     frm.indexPrimerA501.value = indexPrimerA501;
3554 20 Oct 15 olle 819     frm.indexPrimerA502.value = indexPrimerA502;
3554 20 Oct 15 olle 820     frm.indexPrimerA503.value = indexPrimerA503;
3554 20 Oct 15 olle 821     frm.indexPrimerA504.value = indexPrimerA504;
3554 20 Oct 15 olle 822     frm.indexPrimerA505.value = indexPrimerA505;
3554 20 Oct 15 olle 823     frm.indexPrimerA506.value = indexPrimerA506;
3554 20 Oct 15 olle 824     frm.indexPrimerA507.value = indexPrimerA507;
3554 20 Oct 15 olle 825     frm.indexPrimerA508.value = indexPrimerA508;
3554 20 Oct 15 olle 826     // Expiration date
3554 20 Oct 15 olle 827     frm.expirationDate.value = expirationDate;
3554 20 Oct 15 olle 828
3554 20 Oct 15 olle 829     if (numImported != numReagentItems)
3554 20 Oct 15 olle 830     {
3554 20 Oct 15 olle 831       Wizard.setInputStatus('reagentFile', 'invalid', 'Could not find values for all ' + numReagentItems + ' samples: ' + numImported);
3554 20 Oct 15 olle 832       return;
3554 20 Oct 15 olle 833     }
3554 20 Oct 15 olle 834
3646 03 Dec 15 olle 835     // Call exreg.kitNameOnChange() to update kit name valid flag
3646 03 Dec 15 olle 836     exreg.kitNameOnChange();
3646 03 Dec 15 olle 837
3554 20 Oct 15 olle 838     Wizard.setInputStatus('reagentFile', 'valid');
3554 20 Oct 15 olle 839     reagentFileIsValid = true;
3554 20 Oct 15 olle 840   }
3554 20 Oct 15 olle 841
3554 20 Oct 15 olle 842 /*
3554 20 Oct 15 olle 843   exreg.initializeStep2 = function()
3554 20 Oct 15 olle 844   {
3554 20 Oct 15 olle 845     var frm = document.forms['meludi'];
3554 20 Oct 15 olle 846     var consumablesFileName = frm.consumablesFile.value;
3554 20 Oct 15 olle 847     Doc.element('detailsConsumablesFileName').innerHTML = '<b>Consumables file: ' + consumablesFileName + '</b>';
3554 20 Oct 15 olle 848 //alert("exreg.initializeStep2(): Start consumablesFile = " + consumablesFileName);
3554 20 Oct 15 olle 849     var html = '<table id="detailsTable" class="step-form">';
3554 20 Oct 15 olle 850
3554 20 Oct 15 olle 851     // First header row
3554 20 Oct 15 olle 852     html += '<thead>';
3554 20 Oct 15 olle 853     html += '<tr>';
3554 20 Oct 15 olle 854     html += '<th>TruSight Tumor Library Preparation partI</th>';
3554 20 Oct 15 olle 855     html += '<th class="dottedleft">TruSight Tumor Library Prep Box 1</th>';
3554 20 Oct 15 olle 856     html += '<th class="dottedleft">TruSight Tumor Index Kit</th>';
3554 20 Oct 15 olle 857     html += '<th class="dottedleft">TruSight Tumor Content Set Box 3</th>';
3554 20 Oct 15 olle 858     html += '<th class="dottedleft">TruSight Tumor Oligo Pool A (FPA)</th>';
3554 20 Oct 15 olle 859     html += '<th class="dottedleft">TruSight Tumor Oligo Pool B (FPB)</th>';
3554 20 Oct 15 olle 860     html += '<th class="dottedleft">Oligo Hybridization for Sequencing Reagent 3 (OHS3)</th>';
3554 20 Oct 15 olle 861     html += '<th class="dottedleft">Stringent Wash 1 (SW1)</th>';
3554 20 Oct 15 olle 862     html += '<th class="dottedleft">Extension Ligation Mix 3 (ELM3)</th>';
3554 20 Oct 15 olle 863     html += '<th class="dottedleft">PCR Master Mix 2 (PMM2)</th>';
3554 20 Oct 15 olle 864     html += '<th class="dottedleft">UB1</th>';
3554 20 Oct 15 olle 865     html += '<th class="dottedleft">TDP</th>';
3554 20 Oct 15 olle 866     html += '<th class="dottedleft">Filterplate</th>';
3554 20 Oct 15 olle 867     html += '<th colspan="12" class="dottedleft">Index 1 Primers Lot Number</th>';
3554 20 Oct 15 olle 868     html += '<th colspan="8" class="dottedleft">Index 2 Primers Lot Number</th>';
3554 20 Oct 15 olle 869     html += '</tr>';
3554 20 Oct 15 olle 870     // Second header row
3554 20 Oct 15 olle 871     html += '<tr>';
3554 20 Oct 15 olle 872     html += '<th></th>';
3554 20 Oct 15 olle 873     html += '<th class="dottedleft"></th>';
3554 20 Oct 15 olle 874     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 875     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 876     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 877     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 878     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 879     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 880     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 881     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 882     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 883     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 884     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 885     // Index 1 Primers Lot Number
3554 20 Oct 15 olle 886     html += '<td class="dottedleft">ATCACGAC</td>';
3554 20 Oct 15 olle 887     html += '<td class="dottedleft">ACAGTGGT</td>';
3554 20 Oct 15 olle 888     html += '<td class="dottedleft">CAGATCCA</td>';
3554 20 Oct 15 olle 889     html += '<td class="dottedleft">ACAAACGG</td>';
3554 20 Oct 15 olle 890     html += '<td class="dottedleft">ACCCAGCA</td>';
3554 20 Oct 15 olle 891     html += '<td class="dottedleft">AACCCCTC</td>';
3554 20 Oct 15 olle 892     html += '<td class="dottedleft">CCCAACCT</td>';
3554 20 Oct 15 olle 893     html += '<td class="dottedleft">CACCACAC</td>';
3554 20 Oct 15 olle 894     html += '<td class="dottedleft">GAAACCCA</td>';
3554 20 Oct 15 olle 895     html += '<td class="dottedleft">TGTGACCA</td>';
3554 20 Oct 15 olle 896     html += '<td class="dottedleft">AGGGTCAA</td>';
3554 20 Oct 15 olle 897     html += '<td class="dottedleft">AGGAGTGG</td>';
3554 20 Oct 15 olle 898     // Index 2 Primers Lot Number
3554 20 Oct 15 olle 899     html += '<td class="dottedleft">TGAACCTT</td>';
3554 20 Oct 15 olle 900     html += '<td class="dottedleft">TGCTAAGT</td>';
3554 20 Oct 15 olle 901     html += '<td class="dottedleft">TGTTCTCT</td>';
3554 20 Oct 15 olle 902     html += '<td class="dottedleft">TAAGACAC</td>';
3554 20 Oct 15 olle 903     html += '<td class="dottedleft">CTAATCGA</td>';
3554 20 Oct 15 olle 904     html += '<td class="dottedleft">CTAGAACA</td>';
3554 20 Oct 15 olle 905     html += '<td class="dottedleft">TAAGTTCC</td>';
3554 20 Oct 15 olle 906     html += '<td class="dottedleft">TAGACCTA</td>';
3554 20 Oct 15 olle 907     html += '</tr>';
3554 20 Oct 15 olle 908     // Third header row
3554 20 Oct 15 olle 909     html += '<tr>';
3554 20 Oct 15 olle 910     html += '<th></th>';
3554 20 Oct 15 olle 911     html += '<th class="dottedleft"></th>';
3554 20 Oct 15 olle 912     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 913     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 914     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 915     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 916     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 917     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 918     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 919     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 920     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 921     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 922     html += '<td class="dottedleft"></td>';
3554 20 Oct 15 olle 923     // Index 1 Primers Lot Number
3554 20 Oct 15 olle 924     html += '<td class="dottedleft">A701</td>';
3554 20 Oct 15 olle 925     html += '<td class="dottedleft">A702</td>';
3554 20 Oct 15 olle 926     html += '<td class="dottedleft">A703</td>';
3554 20 Oct 15 olle 927     html += '<td class="dottedleft">A704</td>';
3554 20 Oct 15 olle 928     html += '<td class="dottedleft">A705</td>';
3554 20 Oct 15 olle 929     html += '<td class="dottedleft">A706</td>';
3554 20 Oct 15 olle 930     html += '<td class="dottedleft">A707</td>';
3554 20 Oct 15 olle 931     html += '<td class="dottedleft">A708</td>';
3554 20 Oct 15 olle 932     html += '<td class="dottedleft">A709</td>';
3554 20 Oct 15 olle 933     html += '<td class="dottedleft">A710</td>';
3554 20 Oct 15 olle 934     html += '<td class="dottedleft">A711</td>';
3554 20 Oct 15 olle 935     html += '<td class="dottedleft">A712</td>';
3554 20 Oct 15 olle 936     // Index 2 Primers Lot Number
3554 20 Oct 15 olle 937     html += '<td class="dottedleft">A501</td>';
3554 20 Oct 15 olle 938     html += '<td class="dottedleft">A502</td>';
3554 20 Oct 15 olle 939     html += '<td class="dottedleft">A503</td>';
3554 20 Oct 15 olle 940     html += '<td class="dottedleft">A504</td>';
3554 20 Oct 15 olle 941     html += '<td class="dottedleft">A505</td>';
3554 20 Oct 15 olle 942     html += '<td class="dottedleft">A506</td>';
3554 20 Oct 15 olle 943     html += '<td class="dottedleft">A507</td>';
3554 20 Oct 15 olle 944     html += '<td class="dottedleft">A508</td>';
3554 20 Oct 15 olle 945     html += '</tr>';
3554 20 Oct 15 olle 946     html += '</thead>';
3554 20 Oct 15 olle 947     html += '<tbody>';
3554 20 Oct 15 olle 948
3554 20 Oct 15 olle 949     // Get JSONArrays with data for kits
3554 20 Oct 15 olle 950
3554 20 Oct 15 olle 951     var jsonHeaders = jsonConsumables['Headers'];
3554 20 Oct 15 olle 952
3554 20 Oct 15 olle 953     var jsonKitName = jsonConsumables['KitName'];
3554 20 Oct 15 olle 954     var jsonLibraryPrepBox1 = jsonConsumables['LibraryPrepBox1'];
3554 20 Oct 15 olle 955     var jsonIndexKit = jsonConsumables['IndexKit'];
3554 20 Oct 15 olle 956     var jsonContentSetBox3 = jsonConsumables['ContentSetBox3'];
3554 20 Oct 15 olle 957     var jsonOligoPoolA_FPA = jsonConsumables['OligoPoolA_FPA'];
3554 20 Oct 15 olle 958     var jsonOligoPoolB_FPB = jsonConsumables['OligoPoolB_FPB'];
3554 20 Oct 15 olle 959     var jsonOligoHybridizationSequencingReagent3 = jsonConsumables['OligoHybridizationSequencingReagent3'];
3554 20 Oct 15 olle 960     var jsonStringentWash1_SW1 = jsonConsumables['StringentWash1_SW1'];
3554 20 Oct 15 olle 961     var jsonExtensionLigationMix3 = jsonConsumables['ExtensionLigationMix3'];
3554 20 Oct 15 olle 962     var jsonPcrMasterMix2_PMM2 = jsonConsumables['PcrMasterMix2_PMM2'];
3554 20 Oct 15 olle 963     var jsonUB1 = jsonConsumables['UB1'];
3554 20 Oct 15 olle 964     var jsonTDP = jsonConsumables['TDP'];
3554 20 Oct 15 olle 965     var jsonFilterplate = jsonConsumables['Filterplate'];
3554 20 Oct 15 olle 966     
3554 20 Oct 15 olle 967     var jsonIndexPrimerA701 = jsonConsumables['IndexPrimerA701'];
3554 20 Oct 15 olle 968     var jsonIndexPrimerA702 = jsonConsumables['IndexPrimerA702'];
3554 20 Oct 15 olle 969     var jsonIndexPrimerA703 = jsonConsumables['IndexPrimerA703'];
3554 20 Oct 15 olle 970     var jsonIndexPrimerA704 = jsonConsumables['IndexPrimerA704'];
3554 20 Oct 15 olle 971     var jsonIndexPrimerA705 = jsonConsumables['IndexPrimerA705'];
3554 20 Oct 15 olle 972     var jsonIndexPrimerA706 = jsonConsumables['IndexPrimerA706'];
3554 20 Oct 15 olle 973     var jsonIndexPrimerA707 = jsonConsumables['IndexPrimerA707'];
3554 20 Oct 15 olle 974     var jsonIndexPrimerA708 = jsonConsumables['IndexPrimerA708'];
3554 20 Oct 15 olle 975     var jsonIndexPrimerA709 = jsonConsumables['IndexPrimerA709'];
3554 20 Oct 15 olle 976     var jsonIndexPrimerA710 = jsonConsumables['IndexPrimerA710'];
3554 20 Oct 15 olle 977     var jsonIndexPrimerA711 = jsonConsumables['IndexPrimerA711'];
3554 20 Oct 15 olle 978     var jsonIndexPrimerA712 = jsonConsumables['IndexPrimerA712'];
3554 20 Oct 15 olle 979     
3554 20 Oct 15 olle 980     var jsonIndexPrimerA501 = jsonConsumables['IndexPrimerA501'];
3554 20 Oct 15 olle 981     var jsonIndexPrimerA502 = jsonConsumables['IndexPrimerA502'];
3554 20 Oct 15 olle 982     var jsonIndexPrimerA503 = jsonConsumables['IndexPrimerA503'];
3554 20 Oct 15 olle 983     var jsonIndexPrimerA504 = jsonConsumables['IndexPrimerA504'];
3554 20 Oct 15 olle 984     var jsonIndexPrimerA505 = jsonConsumables['IndexPrimerA505'];
3554 20 Oct 15 olle 985     var jsonIndexPrimerA506 = jsonConsumables['IndexPrimerA506'];
3554 20 Oct 15 olle 986     var jsonIndexPrimerA507 = jsonConsumables['IndexPrimerA507'];
3554 20 Oct 15 olle 987     var jsonIndexPrimerA508 = jsonConsumables['IndexPrimerA508'];
3554 20 Oct 15 olle 988
3554 20 Oct 15 olle 989     var numItems = jsonKitName.length;
3554 20 Oct 15 olle 990
3554 20 Oct 15 olle 991     for (var i = 0; i < numItems; i++)
3554 20 Oct 15 olle 992     {
3554 20 Oct 15 olle 993       html += '<tr class="highlight">';
3554 20 Oct 15 olle 994       html += '<th>' + Strings.encodeTags(jsonKitName[i]) + '</th>';
3554 20 Oct 15 olle 995       html += '<td class="dottedleft">' + Strings.encodeTags(jsonLibraryPrepBox1[i]) + '</td>';
3554 20 Oct 15 olle 996       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexKit[i]) + '</td>';
3554 20 Oct 15 olle 997       html += '<td class="dottedleft">' + Strings.encodeTags(jsonContentSetBox3[i]) + '</td>';
3554 20 Oct 15 olle 998       html += '<td class="dottedleft">' + Strings.encodeTags(jsonOligoPoolA_FPA[i]) + '</td>';
3554 20 Oct 15 olle 999       html += '<td class="dottedleft">' + Strings.encodeTags(jsonOligoPoolB_FPB[i]) + '</td>';
3554 20 Oct 15 olle 1000       html += '<td class="dottedleft">' + Strings.encodeTags(jsonOligoHybridizationSequencingReagent3[i]) + '</td>';
3554 20 Oct 15 olle 1001       html += '<td class="dottedleft">' + Strings.encodeTags(jsonStringentWash1_SW1[i]) + '</td>';
3554 20 Oct 15 olle 1002       html += '<td class="dottedleft">' + Strings.encodeTags(jsonExtensionLigationMix3[i]) + '</td>';
3554 20 Oct 15 olle 1003       html += '<td class="dottedleft">' + Strings.encodeTags(jsonPcrMasterMix2_PMM2[i]) + '</td>';
3554 20 Oct 15 olle 1004       html += '<td class="dottedleft">' + Strings.encodeTags(jsonUB1[i]) + '</td>';
3554 20 Oct 15 olle 1005       html += '<td class="dottedleft">' + Strings.encodeTags(jsonTDP[i]) + '</td>';
3554 20 Oct 15 olle 1006       html += '<td class="dottedleft">' + Strings.encodeTags(jsonFilterplate[i]) + '</td>';
3554 20 Oct 15 olle 1007
3554 20 Oct 15 olle 1008       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexPrimerA701[i]) + '</td>';
3554 20 Oct 15 olle 1009       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexPrimerA702[i]) + '</td>';
3554 20 Oct 15 olle 1010       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexPrimerA703[i]) + '</td>';
3554 20 Oct 15 olle 1011       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexPrimerA704[i]) + '</td>';
3554 20 Oct 15 olle 1012       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexPrimerA705[i]) + '</td>';
3554 20 Oct 15 olle 1013       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexPrimerA706[i]) + '</td>';
3554 20 Oct 15 olle 1014       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexPrimerA707[i]) + '</td>';
3554 20 Oct 15 olle 1015       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexPrimerA708[i]) + '</td>';
3554 20 Oct 15 olle 1016       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexPrimerA709[i]) + '</td>';
3554 20 Oct 15 olle 1017       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexPrimerA710[i]) + '</td>';
3554 20 Oct 15 olle 1018       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexPrimerA711[i]) + '</td>';
3554 20 Oct 15 olle 1019       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexPrimerA712[i]) + '</td>';
3554 20 Oct 15 olle 1020
3554 20 Oct 15 olle 1021       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexPrimerA501[i]) + '</td>';
3554 20 Oct 15 olle 1022       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexPrimerA502[i]) + '</td>';
3554 20 Oct 15 olle 1023       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexPrimerA503[i]) + '</td>';
3554 20 Oct 15 olle 1024       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexPrimerA504[i]) + '</td>';
3554 20 Oct 15 olle 1025       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexPrimerA505[i]) + '</td>';
3554 20 Oct 15 olle 1026       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexPrimerA506[i]) + '</td>';
3554 20 Oct 15 olle 1027       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexPrimerA507[i]) + '</td>';
3554 20 Oct 15 olle 1028       html += '<td class="dottedleft">' + Strings.encodeTags(jsonIndexPrimerA508[i]) + '</td>';
3554 20 Oct 15 olle 1029
3554 20 Oct 15 olle 1030       html += '</tr>';
3554 20 Oct 15 olle 1031     }
3554 20 Oct 15 olle 1032     html += '</tbody>';
3554 20 Oct 15 olle 1033     html += '</table>';
3554 20 Oct 15 olle 1034     Doc.element('detailsSection').innerHTML = html;
3554 20 Oct 15 olle 1035
3554 20 Oct 15 olle 1036     Wizard.setCurrentStep(2);
3554 20 Oct 15 olle 1037     Doc.show('gocancel');
3554 20 Oct 15 olle 1038     Doc.show('gocreate');
3554 20 Oct 15 olle 1039     Doc.show('goregister');
3554 20 Oct 15 olle 1040     
3554 20 Oct 15 olle 1041     Wizard.keepSessionAlive();
3554 20 Oct 15 olle 1042 //alert("exreg.initializeStep2(): End consumablesFile = " + consumablesFileName);
3554 20 Oct 15 olle 1043   }
3554 20 Oct 15 olle 1044 */
3554 20 Oct 15 olle 1045
3554 20 Oct 15 olle 1046   exreg.downloadReagentLotNoFile = function()
3554 20 Oct 15 olle 1047   {
3554 20 Oct 15 olle 1048     var frm = document.forms['meludi'];
3554 20 Oct 15 olle 1049     // Add library preparation kit data to JSONObject jsonConsumables
3554 20 Oct 15 olle 1050     exreg.addConsumablesInput();
3554 20 Oct 15 olle 1051
3554 20 Oct 15 olle 1052     var reagentInfo = {};
3554 20 Oct 15 olle 1053     var url = '../LibPrep.servlet?ID='+App.getSessionId();
3554 20 Oct 15 olle 1054     url += '&cmd=PrepareDownloadReagentLotNoFile';
3554 20 Oct 15 olle 1055     url += '&referenceName='+encodeURIComponent(frm.kitName.value);
3554 20 Oct 15 olle 1056     url += '&expirationDate='+encodeURIComponent(frm.expirationDate.value);
3554 20 Oct 15 olle 1057
3554 20 Oct 15 olle 1058     // Reagents
3554 20 Oct 15 olle 1059     reagentInfo = jsonConsumables;
3554 20 Oct 15 olle 1060
3554 20 Oct 15 olle 1061     // POST
3554 20 Oct 15 olle 1062     Wizard.showLoadingAnimation('Performing registration...');
3554 20 Oct 15 olle 1063     Wizard.asyncJsonRequest(url, exreg.downloadReagentLotNoFileResults, 'POST', JSON.stringify(reagentInfo));
3554 20 Oct 15 olle 1064   }
3554 20 Oct 15 olle 1065
3554 20 Oct 15 olle 1066   exreg.downloadReagentLotNoFileResults = function(response)
3554 20 Oct 15 olle 1067   {
3554 20 Oct 15 olle 1068     var tmpFilePath = response;
3554 20 Oct 15 olle 1069     var frm = document.forms['meludi'];
3554 20 Oct 15 olle 1070     var url = '../LibPrep.servlet?ID='+App.getSessionId();
3554 20 Oct 15 olle 1071     url += '&cmd=DownloadReagentLotNoFile';
3554 20 Oct 15 olle 1072     url += '&referenceName='+encodeURIComponent(frm.kitName.value);
3554 20 Oct 15 olle 1073     url += '&expirationDate='+encodeURIComponent(frm.expirationDate.value);
3554 20 Oct 15 olle 1074     url += '&tmpFilePath='+encodeURIComponent(tmpFilePath);
3554 20 Oct 15 olle 1075     window.open(url);
3554 20 Oct 15 olle 1076   }
3554 20 Oct 15 olle 1077
3554 20 Oct 15 olle 1078   exreg.submit = function()
3554 20 Oct 15 olle 1079   {
3554 20 Oct 15 olle 1080     var frm = document.forms['meludi'];
3554 20 Oct 15 olle 1081     
3554 20 Oct 15 olle 1082     var submitInfo = {};
3554 20 Oct 15 olle 1083     submitInfo = jsonConsumables;
3554 20 Oct 15 olle 1084
3554 20 Oct 15 olle 1085     // Library preparation reagent file
3554 20 Oct 15 olle 1086     submitInfo.referenceName = frm.kitName.value;
3554 20 Oct 15 olle 1087     submitInfo.expirationDate = frm.expirationDate.value;
3554 20 Oct 15 olle 1088
3554 20 Oct 15 olle 1089     var url = '../LibPrep.servlet?ID='+App.getSessionId();
3627 26 Nov 15 olle 1090     url += '&cmd=RegisterKits';
3554 20 Oct 15 olle 1091     Wizard.showLoadingAnimation('Performing registration...');
3554 20 Oct 15 olle 1092     Wizard.asyncJsonRequest(url, exreg.submissionResults, 'POST', JSON.stringify(submitInfo));
3554 20 Oct 15 olle 1093   }
3554 20 Oct 15 olle 1094   
3554 20 Oct 15 olle 1095   exreg.submissionResults = function(response)
3554 20 Oct 15 olle 1096   {
3554 20 Oct 15 olle 1097     Wizard.showFinalMessage(response.messages);
3554 20 Oct 15 olle 1098     Doc.show('gorestart');
3554 20 Oct 15 olle 1099 /*
3554 20 Oct 15 olle 1100     Doc.show('gocreate');
3554 20 Oct 15 olle 1101 */
3554 20 Oct 15 olle 1102   }
3554 20 Oct 15 olle 1103
3554 20 Oct 15 olle 1104   return exreg;
3554 20 Oct 15 olle 1105 }();
3554 20 Oct 15 olle 1106
3554 20 Oct 15 olle 1107 Doc.onLoad(AddLibPrepKit.initPage);
3554 20 Oct 15 olle 1108