4832 |
05 Jun 18 |
olle |
var PersInfo = function() |
4832 |
05 Jun 18 |
olle |
2 |
{ |
4832 |
05 Jun 18 |
olle |
var persinfo = {}; |
4832 |
05 Jun 18 |
olle |
var debug = 0; |
4832 |
05 Jun 18 |
olle |
5 |
|
4832 |
05 Jun 18 |
olle |
var caseInfo = null; |
4832 |
05 Jun 18 |
olle |
var bloodInfo = null; |
4832 |
05 Jun 18 |
olle |
8 |
|
4832 |
05 Jun 18 |
olle |
var pnrIsValid = false; |
4832 |
05 Jun 18 |
olle |
var pnrIsAcceptable = false; |
4832 |
05 Jun 18 |
olle |
var caseIsValid = false; |
4832 |
05 Jun 18 |
olle |
12 |
|
4832 |
05 Jun 18 |
olle |
var sampleItemPrefix = ''; |
4832 |
05 Jun 18 |
olle |
var sampleItemNumDigits = 5; |
4870 |
25 Jun 18 |
olle |
var bloodItemPrefix = ''; |
4832 |
05 Jun 18 |
olle |
var nofTubesIsValid = false; |
4958 |
03 Sep 18 |
olle |
var bloodItemNumDigits = 5; |
4832 |
05 Jun 18 |
olle |
var bloodSamplingDateIsValid = true; |
4832 |
05 Jun 18 |
olle |
var viableTumourCellsPercentIsValid = true; |
4832 |
05 Jun 18 |
olle |
var usesSitePrefix = false; |
4832 |
05 Jun 18 |
olle |
21 |
|
4832 |
05 Jun 18 |
olle |
// Well validation variable for input specimen, DNA, RNA |
4832 |
05 Jun 18 |
olle |
var wellIsValid = []; |
4832 |
05 Jun 18 |
olle |
// Well validation variables for extracts from specimen |
4832 |
05 Jun 18 |
olle |
var dnaWellIsValid = []; |
4832 |
05 Jun 18 |
olle |
var rnaWellIsValid = []; |
4832 |
05 Jun 18 |
olle |
27 |
|
4832 |
05 Jun 18 |
olle |
persinfo.initPage = function() |
4832 |
05 Jun 18 |
olle |
29 |
{ |
4832 |
05 Jun 18 |
olle |
30 |
|
4832 |
05 Jun 18 |
olle |
// Step 1 |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('step-1', 'wizard-validate', persinfo.validateStep1); |
4870 |
25 Jun 18 |
olle |
Events.addEventHandler('caseName', 'keypress', Wizard.goNextOnTabOrEnter); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('caseName', 'blur', persinfo.caseNameOnChange); |
4832 |
05 Jun 18 |
olle |
35 |
|
4832 |
05 Jun 18 |
olle |
// Step 2 |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('step-2', 'wizard-initialize', persinfo.initializeStep2); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('step-2', 'wizard-validate', persinfo.validateStep2); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('bloodArrivalDate', 'blur', Wizard.validateDate); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('bloodSamplingDate', 'blur', persinfo.bloodSamplingDateOnChange); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('nofTubes', 'keypress', Events.integerOnly); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('nofTubes', 'blur', persinfo.nofTubesOnChange); |
4832 |
05 Jun 18 |
olle |
//Events.addEventHandler('projectFocus', 'change', persinfo.projectFocusOnChange); |
4832 |
05 Jun 18 |
olle |
//Events.addEventHandler('site', 'change', persinfo.siteOnChange); |
4832 |
05 Jun 18 |
olle |
//Events.addEventHandler('specimenType', 'change', persinfo.specimenTypeOnChange); |
4832 |
05 Jun 18 |
olle |
//Events.addEventHandler('viableTumourCellsPercent', 'keypress', Events.integerOnly); |
4832 |
05 Jun 18 |
olle |
//Events.addEventHandler('viableTumourCellsPercent', 'blur', persinfo.viableTumourCellsPercentOnChange); |
4832 |
05 Jun 18 |
olle |
//Events.addEventHandler('otherPathNote', 'keypress', Wizard.goNextOnTab); |
4832 |
05 Jun 18 |
olle |
//Buttons.addClickHandler('selectAllMutationAnalysis', persinfo.mutationAnalysisSelectAll); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('padPreEntry', 'keypress', Wizard.goNextOnTab); |
4832 |
05 Jun 18 |
olle |
51 |
|
4870 |
25 Jun 18 |
olle |
// Step 3 |
4870 |
25 Jun 18 |
olle |
Events.addEventHandler('step-3', 'wizard-initialize', persinfo.initializeStep3); |
4870 |
25 Jun 18 |
olle |
Events.addEventHandler('step-3', 'wizard-validate', persinfo.validateStep3); |
4832 |
05 Jun 18 |
olle |
55 |
|
4832 |
05 Jun 18 |
olle |
// Navigation |
4832 |
05 Jun 18 |
olle |
Buttons.addClickHandler('gocancel', Wizard.cancelWizard); |
4832 |
05 Jun 18 |
olle |
Buttons.addClickHandler('gorestart', Wizard.restartWizard); |
4832 |
05 Jun 18 |
olle |
Buttons.addClickHandler('gonext', Wizard.goNextOnClick); |
4832 |
05 Jun 18 |
olle |
Buttons.addClickHandler('goregister', Wizard.goRegister); |
4832 |
05 Jun 18 |
olle |
Buttons.addClickHandler('goupdate', Wizard.goRegister); |
4832 |
05 Jun 18 |
olle |
Buttons.addClickHandler('downloadformbatch2', persinfo.downloadFormBatch2); |
4832 |
05 Jun 18 |
olle |
63 |
|
4832 |
05 Jun 18 |
olle |
// Final registration |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('wizard', 'wizard-submit', persinfo.submit); |
4832 |
05 Jun 18 |
olle |
66 |
|
4832 |
05 Jun 18 |
olle |
// Load configuration |
4832 |
05 Jun 18 |
olle |
persinfo.loadConfiguration(); |
4832 |
05 Jun 18 |
olle |
69 |
} |
4832 |
05 Jun 18 |
olle |
70 |
|
4832 |
05 Jun 18 |
olle |
persinfo.loadConfiguration = function() |
4832 |
05 Jun 18 |
olle |
72 |
{ |
4832 |
05 Jun 18 |
olle |
var url = '../Session.servlet?ID='+App.getSessionId(); |
4832 |
05 Jun 18 |
olle |
url += '&cmd=GetConfiguration' |
4832 |
05 Jun 18 |
olle |
var request = Ajax.getXmlHttpRequest(); |
4832 |
05 Jun 18 |
olle |
request.open("GET", url, true); |
4832 |
05 Jun 18 |
olle |
Ajax.setReadyStateHandler(request, persinfo.onConfiguration, persinfo.onConfiguration); |
4832 |
05 Jun 18 |
olle |
request.send(null); |
4832 |
05 Jun 18 |
olle |
79 |
} |
4832 |
05 Jun 18 |
olle |
80 |
|
4832 |
05 Jun 18 |
olle |
persinfo.onConfiguration = function(request) |
4832 |
05 Jun 18 |
olle |
82 |
{ |
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
84 |
|
4832 |
05 Jun 18 |
olle |
if (debug) |
4832 |
05 Jun 18 |
olle |
86 |
{ |
4832 |
05 Jun 18 |
olle |
App.debug(Strings.encodeTags(request.responseText)); |
4832 |
05 Jun 18 |
olle |
88 |
} |
4832 |
05 Jun 18 |
olle |
89 |
|
4832 |
05 Jun 18 |
olle |
var response; |
4832 |
05 Jun 18 |
olle |
var error = false; |
4832 |
05 Jun 18 |
olle |
try |
4832 |
05 Jun 18 |
olle |
93 |
{ |
4832 |
05 Jun 18 |
olle |
response = JSON.parse(request.responseText); |
4832 |
05 Jun 18 |
olle |
if (response.status != 'ok') |
4832 |
05 Jun 18 |
olle |
96 |
{ |
4832 |
05 Jun 18 |
olle |
error = response.message || response.stacktrace || 'Unexpected error'; |
4832 |
05 Jun 18 |
olle |
98 |
} |
4832 |
05 Jun 18 |
olle |
99 |
} |
4832 |
05 Jun 18 |
olle |
catch (ex) |
4832 |
05 Jun 18 |
olle |
101 |
{ |
4832 |
05 Jun 18 |
olle |
error = ex; |
4832 |
05 Jun 18 |
olle |
103 |
} |
4832 |
05 Jun 18 |
olle |
if (error) App.debug(error); |
4832 |
05 Jun 18 |
olle |
105 |
|
4832 |
05 Jun 18 |
olle |
// Get configuration result |
4832 |
05 Jun 18 |
olle |
var conf = response.configuration; |
4832 |
05 Jun 18 |
olle |
// Check for uses site prefix flag |
4832 |
05 Jun 18 |
olle |
usesSitePrefix = conf.usesSitePrefix; |
4870 |
25 Jun 18 |
olle |
sampleItemPrefix = conf.sampleItemPrefix; |
4870 |
25 Jun 18 |
olle |
sampleItemNumDigits = conf.sampleItemNumDigits; |
4870 |
25 Jun 18 |
olle |
bloodItemPrefix = conf.bloodItemPrefix; |
4958 |
03 Sep 18 |
olle |
bloodItemNumDigits = conf.bloodItemNumDigits; |
4832 |
05 Jun 18 |
olle |
114 |
/* |
4832 |
05 Jun 18 |
olle |
// Check for project focus default |
4832 |
05 Jun 18 |
olle |
var projectFocusDefault = conf.projectFocusDefault; |
4832 |
05 Jun 18 |
olle |
if (projectFocusDefault != null) |
4832 |
05 Jun 18 |
olle |
118 |
{ |
4832 |
05 Jun 18 |
olle |
frm.projectFocus.value = projectFocusDefault; |
4832 |
05 Jun 18 |
olle |
persinfo.projectFocusOnChange(); |
4832 |
05 Jun 18 |
olle |
121 |
} |
4832 |
05 Jun 18 |
olle |
// Check for specimen type default |
4832 |
05 Jun 18 |
olle |
var specimenTypeDefault = conf.specimenTypeDefault; |
4832 |
05 Jun 18 |
olle |
if (specimenTypeDefault != null) |
4832 |
05 Jun 18 |
olle |
125 |
{ |
4832 |
05 Jun 18 |
olle |
frm.specimenType.value = specimenTypeDefault; |
4832 |
05 Jun 18 |
olle |
127 |
} |
4832 |
05 Jun 18 |
olle |
// Check for specimen input type default |
4832 |
05 Jun 18 |
olle |
var specimenInputTypeDefault = conf.specimenInputTypeDefault; |
4832 |
05 Jun 18 |
olle |
if (specimenInputTypeDefault != null) |
4832 |
05 Jun 18 |
olle |
131 |
{ |
4832 |
05 Jun 18 |
olle |
frm.specimenInputType.value = specimenInputTypeDefault; |
4832 |
05 Jun 18 |
olle |
133 |
} |
4832 |
05 Jun 18 |
olle |
// Check for extracts from first specimen only default |
4832 |
05 Jun 18 |
olle |
var extractsFromFirstSpecimenOnlyDefault = conf.extractsFromFirstSpecimenOnlyDefault; |
4832 |
05 Jun 18 |
olle |
if (extractsFromFirstSpecimenOnlyDefault != null) |
4832 |
05 Jun 18 |
olle |
137 |
{ |
4832 |
05 Jun 18 |
olle |
frm.extractsFromFirstSpecimenOnlyCB.checked = extractsFromFirstSpecimenOnlyDefault; |
4832 |
05 Jun 18 |
olle |
139 |
} |
4832 |
05 Jun 18 |
olle |
140 |
*/ |
4832 |
05 Jun 18 |
olle |
141 |
|
4870 |
25 Jun 18 |
olle |
142 |
/* |
4832 |
05 Jun 18 |
olle |
// Continue with initializing info for case |
4832 |
05 Jun 18 |
olle |
var url = '../LabelGeneration.servlet?ID='+App.getSessionId(); |
4832 |
05 Jun 18 |
olle |
url += '&cmd=CountCases'; |
4832 |
05 Jun 18 |
olle |
Wizard.showLoadingAnimation('Loading cases...'); |
4832 |
05 Jun 18 |
olle |
Wizard.asyncJsonRequest(url, persinfo.caseInfoLoadedStep1); |
4870 |
25 Jun 18 |
olle |
148 |
*/ |
4870 |
25 Jun 18 |
olle |
Doc.show('step-1'); |
4870 |
25 Jun 18 |
olle |
Doc.show('gonext'); |
4870 |
25 Jun 18 |
olle |
151 |
|
4870 |
25 Jun 18 |
olle |
// Ensure that flag 'caseIsValid' is set to 'true' or error reported |
4870 |
25 Jun 18 |
olle |
persinfo.caseNameOnChange(); |
4832 |
05 Jun 18 |
olle |
154 |
} |
4832 |
05 Jun 18 |
olle |
155 |
|
4832 |
05 Jun 18 |
olle |
persinfo.caseInfoLoadedStep1 = function(response) |
4832 |
05 Jun 18 |
olle |
157 |
{ |
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
159 |
|
4832 |
05 Jun 18 |
olle |
sampleItemPrefix = response.sampleItemPrefix; |
4832 |
05 Jun 18 |
olle |
sampleItemNumDigits = response.sampleItemNumDigits; |
4870 |
25 Jun 18 |
olle |
bloodItemPrefix = response.bloodItemPrefix; |
4832 |
05 Jun 18 |
olle |
var nofCases = response.count; |
4832 |
05 Jun 18 |
olle |
if (nofCases == null) |
4832 |
05 Jun 18 |
olle |
165 |
{ |
4832 |
05 Jun 18 |
olle |
nofCases = 0; |
4832 |
05 Jun 18 |
olle |
167 |
} |
4832 |
05 Jun 18 |
olle |
var startNum = nofCases + 1; |
4832 |
05 Jun 18 |
olle |
// Pad number with leading zeros to get right number of digits |
4832 |
05 Jun 18 |
olle |
startNum = String('0000000000' + startNum).slice(-sampleItemNumDigits); |
4832 |
05 Jun 18 |
olle |
var startCase = sampleItemPrefix + startNum; |
4832 |
05 Jun 18 |
olle |
if (usesSitePrefix != null && usesSitePrefix) |
4832 |
05 Jun 18 |
olle |
173 |
{ |
4832 |
05 Jun 18 |
olle |
startCase = ''; |
4832 |
05 Jun 18 |
olle |
175 |
} |
4832 |
05 Jun 18 |
olle |
frm.caseName.value = startCase; |
4832 |
05 Jun 18 |
olle |
177 |
|
4832 |
05 Jun 18 |
olle |
Doc.show('step-1'); |
4832 |
05 Jun 18 |
olle |
Doc.show('gonext'); |
4832 |
05 Jun 18 |
olle |
180 |
|
4832 |
05 Jun 18 |
olle |
// Ensure that flag 'caseIsValid' is set to 'true' or error reported |
4832 |
05 Jun 18 |
olle |
persinfo.caseNameOnChange(); |
4832 |
05 Jun 18 |
olle |
183 |
} |
4832 |
05 Jun 18 |
olle |
184 |
|
4832 |
05 Jun 18 |
olle |
persinfo.caseNameOnChange = function() |
4832 |
05 Jun 18 |
olle |
186 |
{ |
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
var caseName = frm.caseName.value.toUpperCase(); |
4832 |
05 Jun 18 |
olle |
caseIsValid = false; |
4832 |
05 Jun 18 |
olle |
if (caseName == '') |
4832 |
05 Jun 18 |
olle |
191 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('caseName', 'invalid', 'Missing'); |
4832 |
05 Jun 18 |
olle |
frm.caseName.focus(); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
195 |
} |
4832 |
05 Jun 18 |
olle |
if (!Meludi.isValidCaseName2(caseName, sampleItemPrefix, sampleItemNumDigits)) |
4832 |
05 Jun 18 |
olle |
197 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('caseName', 'invalid', 'Only "' + sampleItemPrefix + '" + ' + sampleItemNumDigits + ' digits is allowed.'); |
4832 |
05 Jun 18 |
olle |
frm.caseName.focus(); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
201 |
} |
4832 |
05 Jun 18 |
olle |
202 |
|
4832 |
05 Jun 18 |
olle |
frm.caseName.value = caseName; |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('caseName', 'valid'); |
4832 |
05 Jun 18 |
olle |
caseIsValid = true; |
4832 |
05 Jun 18 |
olle |
206 |
|
4832 |
05 Jun 18 |
olle |
var url = '../BaseLineRegistration.servlet?ID='+App.getSessionId(); |
4832 |
05 Jun 18 |
olle |
url += '&cmd=GetCaseInfo&caseName=' + encodeURIComponent(caseName); |
4832 |
05 Jun 18 |
olle |
Wizard.showLoadingAnimation('Loading information about case...'); |
4832 |
05 Jun 18 |
olle |
Wizard.asyncJsonRequest(url, persinfo.onCaseInfoLoaded); |
4832 |
05 Jun 18 |
olle |
211 |
} |
4832 |
05 Jun 18 |
olle |
212 |
|
4832 |
05 Jun 18 |
olle |
persinfo.onCaseInfoLoaded = function(response) |
4832 |
05 Jun 18 |
olle |
214 |
{ |
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
216 |
|
4832 |
05 Jun 18 |
olle |
// Get biosource information from the AJAX response |
4832 |
05 Jun 18 |
olle |
caseInfo = response.caseInfo; |
4870 |
25 Jun 18 |
olle |
219 |
|
4870 |
25 Jun 18 |
olle |
220 |
/* |
4832 |
05 Jun 18 |
olle |
// If site determined by site prefix in case name, set site default value and disable site menu |
4832 |
05 Jun 18 |
olle |
//alert("persinfo.js:: persinfo.caseInfoLoaded: caseInfo.siteDefault = " + caseInfo.siteDefault); |
4832 |
05 Jun 18 |
olle |
if (caseInfo.siteDefault != null) |
4832 |
05 Jun 18 |
olle |
224 |
{ |
4832 |
05 Jun 18 |
olle |
frm.site.value = caseInfo.siteDefault; |
4832 |
05 Jun 18 |
olle |
frm.site.disabled = true; |
4832 |
05 Jun 18 |
olle |
227 |
} |
4832 |
05 Jun 18 |
olle |
228 |
|
4832 |
05 Jun 18 |
olle |
if (caseInfo && caseInfo.patient) |
4832 |
05 Jun 18 |
olle |
230 |
{ |
4832 |
05 Jun 18 |
olle |
frm.personalNumber.value = caseInfo.patient.personalNumber; |
4832 |
05 Jun 18 |
olle |
persinfo.personalNumberOnChange(); |
4832 |
05 Jun 18 |
olle |
Wizard.goNext(false); |
4832 |
05 Jun 18 |
olle |
234 |
} |
4870 |
25 Jun 18 |
olle |
235 |
*/ |
4832 |
05 Jun 18 |
olle |
236 |
} |
4832 |
05 Jun 18 |
olle |
237 |
|
4832 |
05 Jun 18 |
olle |
persinfo.validateStep1 = function(event) |
4832 |
05 Jun 18 |
olle |
239 |
{ |
4832 |
05 Jun 18 |
olle |
if (event.detail.auto) |
4832 |
05 Jun 18 |
olle |
241 |
{ |
4870 |
25 Jun 18 |
olle |
if (!caseIsValid) |
4832 |
05 Jun 18 |
olle |
243 |
{ |
4832 |
05 Jun 18 |
olle |
event.preventDefault(); |
4832 |
05 Jun 18 |
olle |
245 |
} |
4832 |
05 Jun 18 |
olle |
246 |
} |
4832 |
05 Jun 18 |
olle |
else |
4832 |
05 Jun 18 |
olle |
248 |
{ |
4870 |
25 Jun 18 |
olle |
if (!caseIsValid) event.preventDefault(); |
4832 |
05 Jun 18 |
olle |
250 |
} |
4832 |
05 Jun 18 |
olle |
251 |
} |
4832 |
05 Jun 18 |
olle |
252 |
|
4870 |
25 Jun 18 |
olle |
persinfo.initializeStep2 = function() |
4832 |
05 Jun 18 |
olle |
254 |
{ |
4832 |
05 Jun 18 |
olle |
// Check entered case and pnr with AJAX |
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
var updateMode = caseInfo.id && caseInfo.patient; |
4832 |
05 Jun 18 |
olle |
258 |
|
4832 |
05 Jun 18 |
olle |
// Generate list of specimen tubes |
4832 |
05 Jun 18 |
olle |
var hasUnknownSpecimen = false; |
4832 |
05 Jun 18 |
olle |
var hasSpecimen = caseInfo.specimen && caseInfo.specimen.length > 0; |
4832 |
05 Jun 18 |
olle |
var hasDna = caseInfo.dna && caseInfo.dna.length > 0; |
4832 |
05 Jun 18 |
olle |
var hasRna = caseInfo.rna && caseInfo.rna.length > 0; |
4832 |
05 Jun 18 |
olle |
var thisCasePlNumber = null; |
4832 |
05 Jun 18 |
olle |
var hasPlNumber = false; |
4832 |
05 Jun 18 |
olle |
var thisCasePAD = null; |
4832 |
05 Jun 18 |
olle |
var hasPAD = false; |
4832 |
05 Jun 18 |
olle |
var thisCaseBloodSamplingDate = null; |
4832 |
05 Jun 18 |
olle |
var thisCaseExtractionDate = null; |
4832 |
05 Jun 18 |
olle |
//var thisCaseTubeContentType = caseInfo.tubeContentType; |
4832 |
05 Jun 18 |
olle |
var thisCaseSpecimenType = null; |
4832 |
05 Jun 18 |
olle |
var thisCaseSpecimenInputType = null; |
4832 |
05 Jun 18 |
olle |
var thisCaseViableTumourCellsPercent = null; |
4832 |
05 Jun 18 |
olle |
var thisCasePadPreEntry = caseInfo.padPreEntry; |
4832 |
05 Jun 18 |
olle |
275 |
|
4832 |
05 Jun 18 |
olle |
frm.bloodArrivalDate.value = Dates.formatDate(new Date(), 'yyyyMMdd'); |
4832 |
05 Jun 18 |
olle |
frm.wholeBloodCB.checked = true; |
4832 |
05 Jun 18 |
olle |
frm.ffpeReferralCB.checked = true; |
4832 |
05 Jun 18 |
olle |
if (hasSpecimen) |
4832 |
05 Jun 18 |
olle |
280 |
{ |
4832 |
05 Jun 18 |
olle |
281 |
/* |
4832 |
05 Jun 18 |
olle |
var specimenTubes = ''; |
4832 |
05 Jun 18 |
olle |
for (var i = 0; i < caseInfo.specimen.length; i++) |
4832 |
05 Jun 18 |
olle |
284 |
{ |
4832 |
05 Jun 18 |
olle |
var specimen = caseInfo.specimen[i]; |
4832 |
05 Jun 18 |
olle |
specimenTubes += Strings.encodeTags(specimen.name); |
4832 |
05 Jun 18 |
olle |
if (specimen.plNumber && !hasPlNumber) |
4832 |
05 Jun 18 |
olle |
288 |
{ |
4832 |
05 Jun 18 |
olle |
hasPlNumber = true; |
4832 |
05 Jun 18 |
olle |
thisCasePlNumber = specimen.plNumber; |
4832 |
05 Jun 18 |
olle |
291 |
} |
4832 |
05 Jun 18 |
olle |
if (specimen.pad && !hasPAD) |
4832 |
05 Jun 18 |
olle |
293 |
{ |
4832 |
05 Jun 18 |
olle |
hasPAD = true; |
4832 |
05 Jun 18 |
olle |
thisCasePAD = specimen.pad; |
4832 |
05 Jun 18 |
olle |
296 |
} |
4832 |
05 Jun 18 |
olle |
if (specimen.bloodSamplingDate && !thisCaseBloodSamplingDate) |
4832 |
05 Jun 18 |
olle |
298 |
{ |
4832 |
05 Jun 18 |
olle |
thisCaseBloodSamplingDate = specimen.bloodSamplingDate; |
4832 |
05 Jun 18 |
olle |
300 |
} |
4832 |
05 Jun 18 |
olle |
if (specimen.specimenType && !thisCaseSpecimenType) |
4832 |
05 Jun 18 |
olle |
302 |
{ |
4832 |
05 Jun 18 |
olle |
thisCaseSpecimenType = specimen.specimenType; |
4832 |
05 Jun 18 |
olle |
304 |
} |
4832 |
05 Jun 18 |
olle |
if (specimen.specimenInputType && !thisCaseSpecimenInputType) |
4832 |
05 Jun 18 |
olle |
306 |
{ |
4832 |
05 Jun 18 |
olle |
thisCaseSpecimenInputType = specimen.specimenInputType; |
4832 |
05 Jun 18 |
olle |
308 |
} |
4832 |
05 Jun 18 |
olle |
if (specimen.viableTumourCellsPercent && !thisCaseViableTumourCellsPercent) |
4832 |
05 Jun 18 |
olle |
310 |
{ |
4832 |
05 Jun 18 |
olle |
thisCaseViableTumourCellsPercent = specimen.viableTumourCellsPercent; |
4832 |
05 Jun 18 |
olle |
312 |
} |
4832 |
05 Jun 18 |
olle |
specimenTubes += '<br>'; |
4832 |
05 Jun 18 |
olle |
314 |
} |
4832 |
05 Jun 18 |
olle |
Doc.element('tubeContentType').value = thisCaseTubeContentType; |
4832 |
05 Jun 18 |
olle |
Doc.element('specimenType').value = thisCaseSpecimenType; |
4832 |
05 Jun 18 |
olle |
Doc.element('specimenInputType').value = thisCaseSpecimenInputType; |
4832 |
05 Jun 18 |
olle |
318 |
*/ |
4832 |
05 Jun 18 |
olle |
319 |
|
4832 |
05 Jun 18 |
olle |
//Doc.show('specimenTubesSection'); |
4832 |
05 Jun 18 |
olle |
//Doc.element('specimenTubes').innerHTML = specimenTubes; |
4832 |
05 Jun 18 |
olle |
322 |
|
4832 |
05 Jun 18 |
olle |
//Doc.hide('nofTubesSection'); |
4832 |
05 Jun 18 |
olle |
//Doc.hide('bloodArrivalDateSection'); |
4832 |
05 Jun 18 |
olle |
325 |
|
4832 |
05 Jun 18 |
olle |
//Doc.show('specimenTubesSection'); |
4832 |
05 Jun 18 |
olle |
Doc.show('bloodSamplingDateSection'); |
4832 |
05 Jun 18 |
olle |
328 |
|
4832 |
05 Jun 18 |
olle |
//Doc.hide('mutationAnalysisSection'); |
4832 |
05 Jun 18 |
olle |
//Doc.hide('siteSection'); |
4832 |
05 Jun 18 |
olle |
//Doc.hide('sampleTypeSection'); |
4832 |
05 Jun 18 |
olle |
//Doc.hide('projectFocusSection'); |
4832 |
05 Jun 18 |
olle |
//Doc.hide('metastasisSiteSection'); |
4832 |
05 Jun 18 |
olle |
//Doc.hide('otherPathNoteSection'); |
4832 |
05 Jun 18 |
olle |
335 |
|
4832 |
05 Jun 18 |
olle |
// Populate 'Blood sampling date' field |
4832 |
05 Jun 18 |
olle |
if (thisCaseBloodSamplingDate != null) |
4832 |
05 Jun 18 |
olle |
338 |
{ |
4832 |
05 Jun 18 |
olle |
frm.bloodSamplingDate.value = thisCaseBloodSamplingDate.substring(0, 8); |
4832 |
05 Jun 18 |
olle |
persinfo.bloodSamplingDateOnChange(); |
4832 |
05 Jun 18 |
olle |
341 |
} |
4832 |
05 Jun 18 |
olle |
342 |
|
4832 |
05 Jun 18 |
olle |
// Populate 'Viable tumour cells percent' field |
4832 |
05 Jun 18 |
olle |
if (thisCaseViableTumourCellsPercent != null) |
4832 |
05 Jun 18 |
olle |
345 |
{ |
4832 |
05 Jun 18 |
olle |
frm.viableTumourCellsPercent.value = thisCaseViableTumourCellsPercent; |
4832 |
05 Jun 18 |
olle |
persinfo.viableTumourCellsPercentOnChange(); |
4832 |
05 Jun 18 |
olle |
348 |
} |
4832 |
05 Jun 18 |
olle |
349 |
|
4832 |
05 Jun 18 |
olle |
//frm.plNumber.value = thisCasePlNumber; |
4832 |
05 Jun 18 |
olle |
//frm.pad.value = thisCasePAD; |
4832 |
05 Jun 18 |
olle |
if (thisCasePadPreEntry != null) |
4832 |
05 Jun 18 |
olle |
353 |
{ |
4832 |
05 Jun 18 |
olle |
frm.padPreEntry.value = thisCasePadPreEntry; |
4832 |
05 Jun 18 |
olle |
355 |
} |
4832 |
05 Jun 18 |
olle |
356 |
|
4832 |
05 Jun 18 |
olle |
357 |
/* |
4832 |
05 Jun 18 |
olle |
if (caseInfo.id != null && typeof caseInfo.id != 'undefined') |
4832 |
05 Jun 18 |
olle |
359 |
{ |
4832 |
05 Jun 18 |
olle |
frm.bloodSamplingDate.disabled = true; |
4832 |
05 Jun 18 |
olle |
frm.tubeContentType.disabled = true; |
4832 |
05 Jun 18 |
olle |
frm.specimenType.disabled = true; |
4832 |
05 Jun 18 |
olle |
frm.specimenInputType.disabled = true; |
4832 |
05 Jun 18 |
olle |
frm.viableTumourCellsPercent.disabled = true; |
4832 |
05 Jun 18 |
olle |
365 |
} |
4832 |
05 Jun 18 |
olle |
366 |
*/ |
4832 |
05 Jun 18 |
olle |
367 |
|
4870 |
25 Jun 18 |
olle |
368 |
/* |
4832 |
05 Jun 18 |
olle |
// Existing cases for this patient |
4832 |
05 Jun 18 |
olle |
var hasUnknownCase = false; |
4832 |
05 Jun 18 |
olle |
if (patientInfo.cases && patientInfo.cases.length > 0) |
4832 |
05 Jun 18 |
olle |
372 |
{ |
4832 |
05 Jun 18 |
olle |
var cases = ''; |
4832 |
05 Jun 18 |
olle |
374 |
|
4832 |
05 Jun 18 |
olle |
if (patientInfo.cases.length == 1 || updateMode) |
4832 |
05 Jun 18 |
olle |
376 |
{ |
4832 |
05 Jun 18 |
olle |
if (!updateMode) |
4832 |
05 Jun 18 |
olle |
378 |
{ |
4832 |
05 Jun 18 |
olle |
cases += '[<i>new case</i>]<br>'; |
4832 |
05 Jun 18 |
olle |
380 |
} |
4832 |
05 Jun 18 |
olle |
381 |
} |
4832 |
05 Jun 18 |
olle |
382 |
|
4832 |
05 Jun 18 |
olle |
if (updateMode) |
4832 |
05 Jun 18 |
olle |
384 |
{ |
4832 |
05 Jun 18 |
olle |
if (caseInfo.merged) |
4832 |
05 Jun 18 |
olle |
386 |
{ |
4832 |
05 Jun 18 |
olle |
Doc.element('step-3-title').innerHTML = 'Update case \''+Strings.encodeTags(caseInfo.originalName)+'\' (which is merged with case \'' + Strings.encodeTags(caseInfo.name) + '\')'; |
4832 |
05 Jun 18 |
olle |
388 |
} |
4832 |
05 Jun 18 |
olle |
else |
4832 |
05 Jun 18 |
olle |
390 |
{ |
4832 |
05 Jun 18 |
olle |
Doc.element('step-3-title').innerHTML = 'Update case \''+Strings.encodeTags(caseInfo.name)+'\''; |
4832 |
05 Jun 18 |
olle |
392 |
} |
4832 |
05 Jun 18 |
olle |
393 |
|
4832 |
05 Jun 18 |
olle |
394 |
} |
4832 |
05 Jun 18 |
olle |
else if (patientInfo.cases.length == 2) |
4832 |
05 Jun 18 |
olle |
396 |
{ |
4832 |
05 Jun 18 |
olle |
Doc.element('step-3-title').innerHTML = 'Merge with existing case'; |
4832 |
05 Jun 18 |
olle |
398 |
} |
4832 |
05 Jun 18 |
olle |
else if (patientInfo.cases.length > 0) |
4832 |
05 Jun 18 |
olle |
400 |
{ |
4832 |
05 Jun 18 |
olle |
Doc.element('step-3-title').innerHTML = 'Create new case or merge with existing case'; |
4832 |
05 Jun 18 |
olle |
402 |
} |
4832 |
05 Jun 18 |
olle |
403 |
} |
4870 |
25 Jun 18 |
olle |
404 |
*/ |
4832 |
05 Jun 18 |
olle |
405 |
|
4870 |
25 Jun 18 |
olle |
Wizard.setCurrentStep(2); |
4832 |
05 Jun 18 |
olle |
407 |
/* |
4832 |
05 Jun 18 |
olle |
if (updateMode) |
4832 |
05 Jun 18 |
olle |
409 |
{ |
4832 |
05 Jun 18 |
olle |
Doc.show('goupdate'); |
4832 |
05 Jun 18 |
olle |
411 |
} |
4832 |
05 Jun 18 |
olle |
else |
4832 |
05 Jun 18 |
olle |
413 |
{ |
4832 |
05 Jun 18 |
olle |
Doc.show('goregister'); |
4832 |
05 Jun 18 |
olle |
415 |
} |
4832 |
05 Jun 18 |
olle |
Doc.show('gocancel'); |
4832 |
05 Jun 18 |
olle |
417 |
*/ |
4832 |
05 Jun 18 |
olle |
//frm.plNumber.focus(); |
4832 |
05 Jun 18 |
olle |
419 |
} |
4832 |
05 Jun 18 |
olle |
else if (hasDna) |
4832 |
05 Jun 18 |
olle |
421 |
{ |
4832 |
05 Jun 18 |
olle |
var dnaTubes = ''; |
4832 |
05 Jun 18 |
olle |
for (var i = 0; i < caseInfo.dna.length; i++) |
4832 |
05 Jun 18 |
olle |
424 |
{ |
4832 |
05 Jun 18 |
olle |
var dna = caseInfo.dna[i]; |
4832 |
05 Jun 18 |
olle |
dnaTubes += Strings.encodeTags(dna.name); |
4832 |
05 Jun 18 |
olle |
if (dna.extractionDate && !thisCaseExtractionDate) |
4832 |
05 Jun 18 |
olle |
428 |
{ |
4832 |
05 Jun 18 |
olle |
thisCaseExtractionDate = dna.extractionDate; |
4832 |
05 Jun 18 |
olle |
430 |
} |
4832 |
05 Jun 18 |
olle |
dnaTubes += '<br>'; |
4832 |
05 Jun 18 |
olle |
432 |
} |
4832 |
05 Jun 18 |
olle |
Doc.element('tubeContentType').value = thisCaseTubeContentType; |
4832 |
05 Jun 18 |
olle |
434 |
|
4832 |
05 Jun 18 |
olle |
frm.plNumber.disabled = true; |
4832 |
05 Jun 18 |
olle |
Doc.element('plNumberMessageText').innerHTML = "No PL-number can be saved for case without specimen."; |
4832 |
05 Jun 18 |
olle |
frm.pad.disabled = true; |
4832 |
05 Jun 18 |
olle |
Doc.element('padMessageText').innerHTML = "No PAD/CL number can be saved for case without specimen."; |
4832 |
05 Jun 18 |
olle |
439 |
|
4832 |
05 Jun 18 |
olle |
Doc.show('specimenTubesSection'); |
4832 |
05 Jun 18 |
olle |
Doc.element('specimenTubesTitle').innerHTML = "DNA tubes"; |
4832 |
05 Jun 18 |
olle |
Doc.element('specimenTubes').innerHTML = dnaTubes; |
4832 |
05 Jun 18 |
olle |
Doc.element('specimenTubesMessageText').innerHTML = "The DNA tube(s) associated with this case."; |
4832 |
05 Jun 18 |
olle |
444 |
|
4832 |
05 Jun 18 |
olle |
Doc.hide('nofTubesSection'); |
4832 |
05 Jun 18 |
olle |
Doc.hide('bloodArrivalDateSection'); |
4832 |
05 Jun 18 |
olle |
447 |
|
4832 |
05 Jun 18 |
olle |
Doc.show('specimenTubesSection'); |
4832 |
05 Jun 18 |
olle |
Doc.show('bloodSamplingDateSection'); |
4832 |
05 Jun 18 |
olle |
450 |
|
4832 |
05 Jun 18 |
olle |
Doc.hide('mutationAnalysisSection'); |
4832 |
05 Jun 18 |
olle |
Doc.hide('siteSection'); |
4832 |
05 Jun 18 |
olle |
Doc.hide('sampleTypeSection'); |
4832 |
05 Jun 18 |
olle |
Doc.hide('projectFocusSection'); |
4832 |
05 Jun 18 |
olle |
Doc.hide('metastasisSiteSection'); |
4832 |
05 Jun 18 |
olle |
Doc.hide('otherPathNoteSection'); |
4832 |
05 Jun 18 |
olle |
457 |
|
4832 |
05 Jun 18 |
olle |
thisCaseBloodSamplingDate = thisCaseExtractionDate; |
4832 |
05 Jun 18 |
olle |
// Populate 'Sampling date' field |
4832 |
05 Jun 18 |
olle |
if (thisCaseBloodSamplingDate != null) |
4832 |
05 Jun 18 |
olle |
461 |
{ |
4832 |
05 Jun 18 |
olle |
frm.bloodSamplingDate.value = thisCaseBloodSamplingDate.substring(0, 8); |
4832 |
05 Jun 18 |
olle |
persinfo.bloodSamplingDateOnChange(); |
4832 |
05 Jun 18 |
olle |
464 |
} |
4832 |
05 Jun 18 |
olle |
465 |
|
4832 |
05 Jun 18 |
olle |
frm.plNumber.value = thisCasePlNumber; |
4832 |
05 Jun 18 |
olle |
frm.pad.value = thisCasePAD; |
4832 |
05 Jun 18 |
olle |
468 |
|
4832 |
05 Jun 18 |
olle |
if (caseInfo.id != null && typeof caseInfo.id != 'undefined') |
4832 |
05 Jun 18 |
olle |
470 |
{ |
4832 |
05 Jun 18 |
olle |
frm.bloodSamplingDate.disabled = true; |
4832 |
05 Jun 18 |
olle |
//frm.tubeContentType.disabled = true; |
4832 |
05 Jun 18 |
olle |
frm.specimenType.disabled = true; |
4832 |
05 Jun 18 |
olle |
frm.specimenInputType.disabled = true; |
4832 |
05 Jun 18 |
olle |
frm.viableTumourCellsPercent.disabled = true; |
4832 |
05 Jun 18 |
olle |
476 |
} |
4832 |
05 Jun 18 |
olle |
477 |
|
4832 |
05 Jun 18 |
olle |
Wizard.setCurrentStep(3); |
4832 |
05 Jun 18 |
olle |
479 |
/* |
4832 |
05 Jun 18 |
olle |
if (updateMode) |
4832 |
05 Jun 18 |
olle |
481 |
{ |
4832 |
05 Jun 18 |
olle |
Doc.show('goupdate'); |
4832 |
05 Jun 18 |
olle |
483 |
} |
4832 |
05 Jun 18 |
olle |
else |
4832 |
05 Jun 18 |
olle |
485 |
{ |
4832 |
05 Jun 18 |
olle |
Doc.show('goregister'); |
4832 |
05 Jun 18 |
olle |
487 |
} |
4832 |
05 Jun 18 |
olle |
Doc.show('gocancel'); |
4832 |
05 Jun 18 |
olle |
489 |
*/ |
4832 |
05 Jun 18 |
olle |
frm.plNumber.focus(); |
4832 |
05 Jun 18 |
olle |
491 |
} |
4832 |
05 Jun 18 |
olle |
else if (hasRna) |
4832 |
05 Jun 18 |
olle |
493 |
{ |
4832 |
05 Jun 18 |
olle |
var rnaTubes = ''; |
4832 |
05 Jun 18 |
olle |
for (var i = 0; i < caseInfo.rna.length; i++) |
4832 |
05 Jun 18 |
olle |
496 |
{ |
4832 |
05 Jun 18 |
olle |
var rna = caseInfo.rna[i]; |
4832 |
05 Jun 18 |
olle |
rnaTubes += Strings.encodeTags(rna.name); |
4832 |
05 Jun 18 |
olle |
if (rna.extractionDate && !thisCaseExtractionDate) |
4832 |
05 Jun 18 |
olle |
500 |
{ |
4832 |
05 Jun 18 |
olle |
thisCaseExtractionDate = rna.extractionDate; |
4832 |
05 Jun 18 |
olle |
502 |
} |
4832 |
05 Jun 18 |
olle |
rnaTubes += '<br>'; |
4832 |
05 Jun 18 |
olle |
504 |
} |
4832 |
05 Jun 18 |
olle |
Doc.element('tubeContentType').value = thisCaseTubeContentType; |
4832 |
05 Jun 18 |
olle |
506 |
|
4832 |
05 Jun 18 |
olle |
frm.plNumber.disabled = true; |
4832 |
05 Jun 18 |
olle |
Doc.element('plNumberMessageText').innerHTML = "No PL-number can be saved for case without specimen."; |
4832 |
05 Jun 18 |
olle |
frm.pad.disabled = true; |
4832 |
05 Jun 18 |
olle |
Doc.element('padMessageText').innerHTML = "No PAD/CL number can be saved for case without specimen."; |
4832 |
05 Jun 18 |
olle |
511 |
|
4832 |
05 Jun 18 |
olle |
Doc.show('specimenTubesSection'); |
4832 |
05 Jun 18 |
olle |
Doc.element('specimenTubesTitle').innerHTML = "RNA tubes"; |
4832 |
05 Jun 18 |
olle |
Doc.element('specimenTubes').innerHTML = rnaTubes; |
4832 |
05 Jun 18 |
olle |
Doc.element('specimenTubesMessageText').innerHTML = "The RNA tube(s) associated with this case."; |
4832 |
05 Jun 18 |
olle |
516 |
|
4832 |
05 Jun 18 |
olle |
Doc.hide('nofTubesSection'); |
4832 |
05 Jun 18 |
olle |
Doc.hide('bloodArrivalDateSection'); |
4832 |
05 Jun 18 |
olle |
519 |
|
4832 |
05 Jun 18 |
olle |
Doc.show('specimenTubesSection'); |
4832 |
05 Jun 18 |
olle |
Doc.show('bloodSamplingDateSection'); |
4832 |
05 Jun 18 |
olle |
522 |
|
4832 |
05 Jun 18 |
olle |
Doc.hide('mutationAnalysisSection'); |
4832 |
05 Jun 18 |
olle |
Doc.hide('siteSection'); |
4832 |
05 Jun 18 |
olle |
Doc.hide('sampleTypeSection'); |
4832 |
05 Jun 18 |
olle |
Doc.hide('projectFocusSection'); |
4832 |
05 Jun 18 |
olle |
Doc.hide('metastasisSiteSection'); |
4832 |
05 Jun 18 |
olle |
Doc.hide('otherPathNoteSection'); |
4832 |
05 Jun 18 |
olle |
529 |
|
4832 |
05 Jun 18 |
olle |
thisCaseBloodSamplingDate = thisCaseExtractionDate; |
4832 |
05 Jun 18 |
olle |
// Populate 'Sampling date' field |
4832 |
05 Jun 18 |
olle |
if (thisCaseBloodSamplingDate != null) |
4832 |
05 Jun 18 |
olle |
533 |
{ |
4832 |
05 Jun 18 |
olle |
frm.bloodSamplingDate.value = thisCaseBloodSamplingDate.substring(0, 8); |
4832 |
05 Jun 18 |
olle |
persinfo.bloodSamplingDateOnChange(); |
4832 |
05 Jun 18 |
olle |
536 |
} |
4832 |
05 Jun 18 |
olle |
537 |
|
4832 |
05 Jun 18 |
olle |
frm.plNumber.value = thisCasePlNumber; |
4832 |
05 Jun 18 |
olle |
frm.pad.value = thisCasePAD; |
4832 |
05 Jun 18 |
olle |
540 |
|
4832 |
05 Jun 18 |
olle |
if (caseInfo.id != null && typeof caseInfo.id != 'undefined') |
4832 |
05 Jun 18 |
olle |
542 |
{ |
4832 |
05 Jun 18 |
olle |
frm.bloodSamplingDate.disabled = true; |
4832 |
05 Jun 18 |
olle |
frm.tubeContentType.disabled = true; |
4832 |
05 Jun 18 |
olle |
frm.specimenType.disabled = true; |
4832 |
05 Jun 18 |
olle |
frm.specimenInputType.disabled = true; |
4832 |
05 Jun 18 |
olle |
frm.viableTumourCellsPercent.disabled = true; |
4832 |
05 Jun 18 |
olle |
548 |
} |
4832 |
05 Jun 18 |
olle |
549 |
|
4832 |
05 Jun 18 |
olle |
Wizard.setCurrentStep(3); |
4832 |
05 Jun 18 |
olle |
551 |
/* |
4832 |
05 Jun 18 |
olle |
if (updateMode) |
4832 |
05 Jun 18 |
olle |
553 |
{ |
4832 |
05 Jun 18 |
olle |
Doc.show('goupdate'); |
4832 |
05 Jun 18 |
olle |
555 |
} |
4832 |
05 Jun 18 |
olle |
else |
4832 |
05 Jun 18 |
olle |
557 |
{ |
4832 |
05 Jun 18 |
olle |
Doc.show('goregister'); |
4832 |
05 Jun 18 |
olle |
559 |
} |
4832 |
05 Jun 18 |
olle |
Doc.show('gocancel'); |
4832 |
05 Jun 18 |
olle |
561 |
*/ |
4832 |
05 Jun 18 |
olle |
frm.plNumber.focus(); |
4832 |
05 Jun 18 |
olle |
563 |
} |
4832 |
05 Jun 18 |
olle |
else |
4832 |
05 Jun 18 |
olle |
565 |
{ |
4832 |
05 Jun 18 |
olle |
Doc.hide('specimenTubesSection'); |
4870 |
25 Jun 18 |
olle |
Wizard.setCurrentStep(2); |
4832 |
05 Jun 18 |
olle |
Doc.show('gocancel'); |
4832 |
05 Jun 18 |
olle |
Doc.show('gonext'); |
4832 |
05 Jun 18 |
olle |
570 |
|
4832 |
05 Jun 18 |
olle |
frm.bloodArrivalDate.value = Dates.formatDate(new Date(), 'yyyyMMdd'); |
4832 |
05 Jun 18 |
olle |
572 |
|
4836 |
07 Jun 18 |
olle |
if (thisCasePadPreEntry != null) |
4836 |
07 Jun 18 |
olle |
574 |
{ |
4836 |
07 Jun 18 |
olle |
frm.padPreEntry.value = thisCasePadPreEntry; |
4836 |
07 Jun 18 |
olle |
576 |
} |
4836 |
07 Jun 18 |
olle |
frm.nofTubes.setSelectionRange(0,3); |
4836 |
07 Jun 18 |
olle |
frm.nofTubes.value = 2; |
4836 |
07 Jun 18 |
olle |
//frm.plNumber.focus(); |
4832 |
05 Jun 18 |
olle |
//frm.nofTubes.setSelectionRange(0,1); |
4836 |
07 Jun 18 |
olle |
//frm.mutationAnalysisTst170.checked = true; |
4832 |
05 Jun 18 |
olle |
582 |
} |
4832 |
05 Jun 18 |
olle |
frm.nofTubes.setSelectionRange(0,3); |
4832 |
05 Jun 18 |
olle |
frm.nofTubes.value = 2; |
4832 |
05 Jun 18 |
olle |
585 |
|
4870 |
25 Jun 18 |
olle |
Doc.show('step-2'); |
4832 |
05 Jun 18 |
olle |
Doc.show('gocancel'); |
4832 |
05 Jun 18 |
olle |
Doc.show('gonext'); |
4832 |
05 Jun 18 |
olle |
589 |
|
4832 |
05 Jun 18 |
olle |
590 |
/* |
4832 |
05 Jun 18 |
olle |
var url = '../BaseLineRegistration.servlet?ID='+App.getSessionId(); |
4832 |
05 Jun 18 |
olle |
url += '&cmd=FindBloodStoragePositions'; |
4832 |
05 Jun 18 |
olle |
//url += '&nofTubes='+frm.nofTubes.value; |
4832 |
05 Jun 18 |
olle |
url += '&nofTubes=2'; |
4832 |
05 Jun 18 |
olle |
url += '&storageBoxSuffix='; |
4832 |
05 Jun 18 |
olle |
596 |
|
4832 |
05 Jun 18 |
olle |
Wizard.showLoadingAnimation('Looking for empty box positions...'); |
4832 |
05 Jun 18 |
olle |
Wizard.asyncJsonRequest(url, persinfo.bloodStoragePositionsLoaded); |
4832 |
05 Jun 18 |
olle |
599 |
*/ |
4832 |
05 Jun 18 |
olle |
600 |
} |
4832 |
05 Jun 18 |
olle |
601 |
|
4832 |
05 Jun 18 |
olle |
persinfo.bloodStoragePositionsLoaded = function(response) |
4832 |
05 Jun 18 |
olle |
603 |
{ |
4832 |
05 Jun 18 |
olle |
var freeWells = response.wells; |
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
//var tubeContentType = frm.tubeContentType.value; |
4832 |
05 Jun 18 |
olle |
var tubeContentType = 'Blood'; |
4832 |
05 Jun 18 |
olle |
var nofTubes = parseInt(frm.nofTubes.value); |
4832 |
05 Jun 18 |
olle |
609 |
|
4832 |
05 Jun 18 |
olle |
//alert("baseline_alt_rec.js::bloodStoragePositionsLoaded(): freeWells = " + JSON.stringify(freeWells)); |
4832 |
05 Jun 18 |
olle |
if (tubeContentType == 'Blood') |
4832 |
05 Jun 18 |
olle |
612 |
{ |
4832 |
05 Jun 18 |
olle |
for (var i = 0; i < nofTubes; i++) |
4832 |
05 Jun 18 |
olle |
614 |
{ |
4832 |
05 Jun 18 |
olle |
//wellIndex = 3*i; |
4832 |
05 Jun 18 |
olle |
wellIndex = i; |
4832 |
05 Jun 18 |
olle |
var bloodWell = null; |
4832 |
05 Jun 18 |
olle |
618 |
/* |
4832 |
05 Jun 18 |
olle |
if (i > 0) |
4832 |
05 Jun 18 |
olle |
620 |
{ |
4832 |
05 Jun 18 |
olle |
621 |
*/ |
4832 |
05 Jun 18 |
olle |
bloodWell = freeWells[wellIndex]; |
4832 |
05 Jun 18 |
olle |
//alert("baseline_alt_rec.js::bloodStoragePositionsLoaded(): i = " + i + " bloodWell = " + JSON.stringify(bloodWell)); |
4832 |
05 Jun 18 |
olle |
if (!bloodWell || bloodWell == '') |
4832 |
05 Jun 18 |
olle |
625 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('box.'+i, 'invalid', 'Missing box'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
628 |
} |
4832 |
05 Jun 18 |
olle |
629 |
/* |
4832 |
05 Jun 18 |
olle |
630 |
} |
4832 |
05 Jun 18 |
olle |
631 |
*/ |
4832 |
05 Jun 18 |
olle |
// Update form fields for blood storage plates |
4832 |
05 Jun 18 |
olle |
if (bloodWell) |
4832 |
05 Jun 18 |
olle |
634 |
{ |
4832 |
05 Jun 18 |
olle |
frm['box.'+i].value = bloodWell.bioPlate.name; |
4832 |
05 Jun 18 |
olle |
frm['row.'+i].value = Meludi.wellToAlpha(bloodWell.row); |
4832 |
05 Jun 18 |
olle |
frm['column.'+i].value = bloodWell.column+1; |
4832 |
05 Jun 18 |
olle |
638 |
} |
4832 |
05 Jun 18 |
olle |
639 |
|
4832 |
05 Jun 18 |
olle |
// Move focus to next field |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('box.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'row.'+i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('row.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'column.'+i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('column.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'dnaBox.'+i }); |
4832 |
05 Jun 18 |
olle |
644 |
|
4832 |
05 Jun 18 |
olle |
//Events.addEventHandler('nofSections.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'comment.'+i }); |
4832 |
05 Jun 18 |
olle |
646 |
|
4832 |
05 Jun 18 |
olle |
// Form validation |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('column.'+i, 'keypress', Events.integerOnly); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('box.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'Blood', 'index': i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('row.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'Blood', 'index': i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('column.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'Blood', 'index': i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('box.'+i, 'keyup', persinfo.boxOnKeyUp, { 'boxtype': 'Blood'}); |
4832 |
05 Jun 18 |
olle |
653 |
|
4832 |
05 Jun 18 |
olle |
wellIsValid[i] = true; |
4832 |
05 Jun 18 |
olle |
655 |
/* |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('position.'+i, 'valid'); |
4832 |
05 Jun 18 |
olle |
657 |
*/ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('box.'+i, 'valid'); |
4832 |
05 Jun 18 |
olle |
659 |
} |
4832 |
05 Jun 18 |
olle |
660 |
} |
4832 |
05 Jun 18 |
olle |
// No storage space is allocated for first specimen, |
4832 |
05 Jun 18 |
olle |
// since all amount is expected to be used for analysis. |
4832 |
05 Jun 18 |
olle |
// Specimen tube with i == 0 is therefore skipped. |
4832 |
05 Jun 18 |
olle |
if (tubeContentType == 'Specimen') |
4832 |
05 Jun 18 |
olle |
665 |
{ |
4832 |
05 Jun 18 |
olle |
for (var i = 0; i < nofTubes; i++) |
4832 |
05 Jun 18 |
olle |
667 |
{ |
4832 |
05 Jun 18 |
olle |
wellIndex = 3*i; |
4832 |
05 Jun 18 |
olle |
var specWell = null; |
4832 |
05 Jun 18 |
olle |
if (i > 0) |
4832 |
05 Jun 18 |
olle |
671 |
{ |
4832 |
05 Jun 18 |
olle |
specWell = freeWells[wellIndex]; |
4832 |
05 Jun 18 |
olle |
if (!specWell || specWell == '') |
4832 |
05 Jun 18 |
olle |
674 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('box.'+i, 'invalid', 'Missing box'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
677 |
} |
4832 |
05 Jun 18 |
olle |
678 |
} |
4832 |
05 Jun 18 |
olle |
// Update form fields for storage plates |
4832 |
05 Jun 18 |
olle |
if (specWell) |
4832 |
05 Jun 18 |
olle |
681 |
{ |
4832 |
05 Jun 18 |
olle |
frm['box.'+i].value = specWell.bioPlate.name; |
4832 |
05 Jun 18 |
olle |
frm['row.'+i].value = Meludi.wellToAlpha(specWell.row); |
4832 |
05 Jun 18 |
olle |
frm['column.'+i].value = specWell.column+1; |
4832 |
05 Jun 18 |
olle |
685 |
} |
4832 |
05 Jun 18 |
olle |
686 |
|
4832 |
05 Jun 18 |
olle |
// Move focus to next field |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('box.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'row.'+i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('row.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'column.'+i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('column.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'dnaBox.'+i }); |
4832 |
05 Jun 18 |
olle |
691 |
|
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('nofSections.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'comment.'+i }); |
4832 |
05 Jun 18 |
olle |
693 |
|
4832 |
05 Jun 18 |
olle |
// Form validation |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('column.'+i, 'keypress', Events.integerOnly); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('box.'+i, 'change', streg.wellOnChange, { 'boxtype': 'Specimen', 'index': i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('row.'+i, 'change', streg.wellOnChange, { 'boxtype': 'Specimen', 'index': i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('column.'+i, 'change', streg.wellOnChange, { 'boxtype': 'Specimen', 'index': i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('box.'+i, 'keyup', streg.boxOnKeyUp, { 'boxtype': 'Specimen'}); |
4832 |
05 Jun 18 |
olle |
700 |
|
4832 |
05 Jun 18 |
olle |
wellIsValid[i] = true; |
4832 |
05 Jun 18 |
olle |
702 |
/* |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('position.'+i, 'valid'); |
4832 |
05 Jun 18 |
olle |
704 |
*/ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('box.'+i, 'valid'); |
4832 |
05 Jun 18 |
olle |
706 |
} |
4832 |
05 Jun 18 |
olle |
707 |
} |
4832 |
05 Jun 18 |
olle |
708 |
} |
4832 |
05 Jun 18 |
olle |
709 |
|
4832 |
05 Jun 18 |
olle |
persinfo.plNumberOnChange = function() |
4832 |
05 Jun 18 |
olle |
711 |
{ |
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
var plNumber = frm.plNumber.value; |
4832 |
05 Jun 18 |
olle |
if (plNumber == '') |
4832 |
05 Jun 18 |
olle |
715 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('plNumber', 'warning', 'Missing'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
718 |
} |
4832 |
05 Jun 18 |
olle |
frm.plNumber.value = plNumber.replace(/\+/, '-'); |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('plNumber', 'valid'); |
4832 |
05 Jun 18 |
olle |
721 |
} |
4832 |
05 Jun 18 |
olle |
722 |
|
4832 |
05 Jun 18 |
olle |
persinfo.padOnChange = function() |
4832 |
05 Jun 18 |
olle |
724 |
{ |
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
var PAD = frm.pad.value; |
4832 |
05 Jun 18 |
olle |
if (PAD == '') |
4832 |
05 Jun 18 |
olle |
728 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('pad', 'warning', 'Missing'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
731 |
} |
4832 |
05 Jun 18 |
olle |
frm.pad.value = PAD.replace(/\+/, '-'); |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('pad', 'valid'); |
4832 |
05 Jun 18 |
olle |
734 |
} |
4832 |
05 Jun 18 |
olle |
735 |
|
4832 |
05 Jun 18 |
olle |
persinfo.bloodSamplingDateTimeFocus = function(event) |
4832 |
05 Jun 18 |
olle |
737 |
{ |
4832 |
05 Jun 18 |
olle |
if (event.keyCode == 13) |
4832 |
05 Jun 18 |
olle |
739 |
{ |
4832 |
05 Jun 18 |
olle |
var focusTo = caseInfo.specimen && caseInfo.specimen.length > 0 ? 'mutationAnalysis' : 'reasonIfNoSpecimen' |
4832 |
05 Jun 18 |
olle |
Doc.element(focusTo).focus(); |
4832 |
05 Jun 18 |
olle |
742 |
} |
4832 |
05 Jun 18 |
olle |
743 |
} |
4832 |
05 Jun 18 |
olle |
744 |
|
4832 |
05 Jun 18 |
olle |
persinfo.nofTubesOnChange = function() |
4832 |
05 Jun 18 |
olle |
746 |
{ |
4832 |
05 Jun 18 |
olle |
nofTubesIsValid = false; |
4832 |
05 Jun 18 |
olle |
748 |
|
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
var nofTubes = frm.nofTubes.value; |
4832 |
05 Jun 18 |
olle |
751 |
|
4832 |
05 Jun 18 |
olle |
if (nofTubes == '') |
4832 |
05 Jun 18 |
olle |
753 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('nofTubes', 'invalid', 'Missing'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
756 |
} |
4832 |
05 Jun 18 |
olle |
if (parseInt(nofTubes) < 1) |
4832 |
05 Jun 18 |
olle |
758 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('nofTubes', 'invalid', 'Must be at least 1'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
761 |
} |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('nofTubes', 'valid'); |
4832 |
05 Jun 18 |
olle |
nofTubesIsValid = true; |
4832 |
05 Jun 18 |
olle |
764 |
} |
4832 |
05 Jun 18 |
olle |
765 |
|
4832 |
05 Jun 18 |
olle |
persinfo.bloodSamplingDateOnChange = function() |
4832 |
05 Jun 18 |
olle |
767 |
{ |
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
bloodSamplingDateIsValid = false; |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('bloodSamplingDate'); |
4832 |
05 Jun 18 |
olle |
771 |
|
4832 |
05 Jun 18 |
olle |
var bloodSamplingDate = frm.bloodSamplingDate.value; |
4832 |
05 Jun 18 |
olle |
773 |
|
4832 |
05 Jun 18 |
olle |
if (bloodSamplingDate == '') |
4832 |
05 Jun 18 |
olle |
775 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('bloodSamplingDate', 'warning', 'Missing date'); |
4832 |
05 Jun 18 |
olle |
777 |
} |
4832 |
05 Jun 18 |
olle |
else |
4832 |
05 Jun 18 |
olle |
779 |
{ |
4832 |
05 Jun 18 |
olle |
// Auto-fill the date if it's only given with 4(MMdd) or 6(yyMMdd) digits. |
4832 |
05 Jun 18 |
olle |
bloodSamplingDate = Meludi.autoFillDate(bloodSamplingDate, true); |
4832 |
05 Jun 18 |
olle |
frm.bloodSamplingDate.value = bloodSamplingDate; |
4832 |
05 Jun 18 |
olle |
783 |
|
4832 |
05 Jun 18 |
olle |
if (bloodSamplingDate != '' && !Dates.isDate(bloodSamplingDate, 'yyyyMMdd')) |
4832 |
05 Jun 18 |
olle |
785 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('bloodSamplingDate', 'invalid', 'Not a valid date'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
788 |
} |
4832 |
05 Jun 18 |
olle |
789 |
|
4832 |
05 Jun 18 |
olle |
var bloodArrivalDate = frm.bloodArrivalDate.value; |
4832 |
05 Jun 18 |
olle |
if (bloodArrivalDate != '' && bloodArrivalDate < bloodSamplingDate) |
4832 |
05 Jun 18 |
olle |
792 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('bloodSamplingDate', 'invalid', 'Arrival date is before sampling date'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
795 |
} |
4832 |
05 Jun 18 |
olle |
796 |
|
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('bloodSamplingDate', 'valid'); |
4832 |
05 Jun 18 |
olle |
798 |
} |
4832 |
05 Jun 18 |
olle |
bloodSamplingDateIsValid = true; |
4832 |
05 Jun 18 |
olle |
800 |
} |
4832 |
05 Jun 18 |
olle |
801 |
|
4832 |
05 Jun 18 |
olle |
persinfo.projectFocusOnChange = function() |
4832 |
05 Jun 18 |
olle |
803 |
{ |
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
var projectFocus = frm.projectFocus.value; |
4832 |
05 Jun 18 |
olle |
806 |
|
4832 |
05 Jun 18 |
olle |
persinfo.mutationAnalysisReset(); |
4832 |
05 Jun 18 |
olle |
808 |
|
4832 |
05 Jun 18 |
olle |
809 |
/* |
4832 |
05 Jun 18 |
olle |
if (projectFocus == 'melanoma') |
4832 |
05 Jun 18 |
olle |
811 |
{ |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisNras.checked = true; |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisBraf.checked = true; |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisKit.checked = true; |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
816 |
} |
4832 |
05 Jun 18 |
olle |
if (projectFocus == 'lungcancer') |
4832 |
05 Jun 18 |
olle |
818 |
{ |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisKras.checked = true; |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisEgfr.checked = true; |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
822 |
} |
4832 |
05 Jun 18 |
olle |
if (projectFocus == 'coloncancer') |
4832 |
05 Jun 18 |
olle |
824 |
{ |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisKras.checked = true; |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisNras.checked = true; |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisBraf.checked = true; |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
829 |
} |
4832 |
05 Jun 18 |
olle |
if (projectFocus == 'GIST') |
4832 |
05 Jun 18 |
olle |
831 |
{ |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisPdgfra.checked = true; |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisKit.checked = true; |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
835 |
} |
4832 |
05 Jun 18 |
olle |
836 |
*/ |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisTst170.checked = true; |
4832 |
05 Jun 18 |
olle |
838 |
} |
4832 |
05 Jun 18 |
olle |
839 |
|
4832 |
05 Jun 18 |
olle |
persinfo.mutationAnalysisReset = function() |
4832 |
05 Jun 18 |
olle |
841 |
{ |
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
843 |
|
4832 |
05 Jun 18 |
olle |
844 |
/* |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisKras.checked = false; |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisNras.checked = false; |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisBraf.checked = false; |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisEgfr.checked = false; |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisAlkEml4.checked = false; |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisPdgfra.checked = false; |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisKit.checked = false; |
4832 |
05 Jun 18 |
olle |
852 |
*/ |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisTst170.checked = false; |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisOther.checked = false; |
4832 |
05 Jun 18 |
olle |
855 |
} |
4832 |
05 Jun 18 |
olle |
856 |
|
4832 |
05 Jun 18 |
olle |
persinfo.mutationAnalysisSelectAll = function() |
4832 |
05 Jun 18 |
olle |
858 |
{ |
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
860 |
|
4832 |
05 Jun 18 |
olle |
861 |
/* |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisKras.checked = true; |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisNras.checked = true; |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisBraf.checked = true; |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisEgfr.checked = true; |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisAlkEml4.checked = true; |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisPdgfra.checked = true; |
4832 |
05 Jun 18 |
olle |
frm.mutationAnalysisKit.checked = true; |
4832 |
05 Jun 18 |
olle |
869 |
*/ |
4832 |
05 Jun 18 |
olle |
//frm.mutationAnalysisTst170.checked = true; |
4832 |
05 Jun 18 |
olle |
//frm.mutationAnalysisOther.checked = true; |
4832 |
05 Jun 18 |
olle |
872 |
} |
4832 |
05 Jun 18 |
olle |
873 |
|
4832 |
05 Jun 18 |
olle |
persinfo.viableTumourCellsPercentOnChange = function() |
4832 |
05 Jun 18 |
olle |
875 |
{ |
4832 |
05 Jun 18 |
olle |
viableTumourCellsPercentIsValid = false; |
4832 |
05 Jun 18 |
olle |
877 |
|
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
var viableTumourCellsPercent = frm.viableTumourCellsPercent.value; |
4832 |
05 Jun 18 |
olle |
880 |
|
4832 |
05 Jun 18 |
olle |
if (viableTumourCellsPercent != null) |
4832 |
05 Jun 18 |
olle |
882 |
{ |
4832 |
05 Jun 18 |
olle |
if (parseInt(viableTumourCellsPercent) < 0) |
4832 |
05 Jun 18 |
olle |
884 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('viableTumourCellsPercent', 'invalid', 'Must be at least 0'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
887 |
} |
4832 |
05 Jun 18 |
olle |
if (parseInt(viableTumourCellsPercent) > 100) |
4832 |
05 Jun 18 |
olle |
889 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('viableTumourCellsPercent', 'invalid', 'Must be at most 100'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
892 |
} |
4832 |
05 Jun 18 |
olle |
893 |
} |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('viableTumourCellsPercent', 'valid'); |
4832 |
05 Jun 18 |
olle |
viableTumourCellsPercentIsValid = true; |
4832 |
05 Jun 18 |
olle |
896 |
} |
4832 |
05 Jun 18 |
olle |
897 |
|
4870 |
25 Jun 18 |
olle |
persinfo.validateStep2 = function(event) |
4832 |
05 Jun 18 |
olle |
899 |
{ |
4832 |
05 Jun 18 |
olle |
var isValid = bloodSamplingDateIsValid; |
4832 |
05 Jun 18 |
olle |
var hasSpecimen = caseInfo.specimen && caseInfo.specimen.length > 0; |
4832 |
05 Jun 18 |
olle |
if (hasSpecimen) |
4832 |
05 Jun 18 |
olle |
903 |
{ |
4832 |
05 Jun 18 |
olle |
isValid &= viableTumourCellsPercentIsValid; |
4832 |
05 Jun 18 |
olle |
905 |
} |
4832 |
05 Jun 18 |
olle |
if (!isValid) event.preventDefault(); |
4832 |
05 Jun 18 |
olle |
907 |
} |
4832 |
05 Jun 18 |
olle |
908 |
|
4870 |
25 Jun 18 |
olle |
persinfo.initializeStep3 = function() |
4832 |
05 Jun 18 |
olle |
910 |
{ |
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
//var tubeContentType = frm.tubeContentType.value; |
4832 |
05 Jun 18 |
olle |
var tubeContentType = 'Blood'; |
4832 |
05 Jun 18 |
olle |
var nofTubes = parseInt(frm.nofTubes.value); |
4832 |
05 Jun 18 |
olle |
//nofTubes = persinfo.fixNofTubes(tubeContentType, nofTubes); |
4832 |
05 Jun 18 |
olle |
//frm.nofTubes.value = nofTubes; |
4832 |
05 Jun 18 |
olle |
//var extractsFromFirstSpecimenOnly = frm.extractsFromFirstSpecimenOnlyCB.checked; |
4832 |
05 Jun 18 |
olle |
var storageBoxSuffix = persinfo.fetchStorageBoxSuffix(tubeContentType); |
4832 |
05 Jun 18 |
olle |
if (nofTubes > 2) Doc.addClass('step-2', 'auto-hide'); |
4832 |
05 Jun 18 |
olle |
920 |
|
4832 |
05 Jun 18 |
olle |
var html = ''; |
4832 |
05 Jun 18 |
olle |
922 |
|
4832 |
05 Jun 18 |
olle |
923 |
/* |
4832 |
05 Jun 18 |
olle |
// Add buttons for adding standard comments for all specimens/RNA/DNA |
4832 |
05 Jun 18 |
olle |
html += '<tr class="section-header">'; |
4832 |
05 Jun 18 |
olle |
html += '<td colspan="4">Standard comments</td>'; |
4832 |
05 Jun 18 |
olle |
html += '</tr>'; |
4832 |
05 Jun 18 |
olle |
928 |
|
4832 |
05 Jun 18 |
olle |
html += '<tr class="align-top">'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="subprompt"></td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td><div class="button basicbutton interactable" id="addCarvedOutComment" style="font-weight: normal;">Add "Utkarvad" (Carved out)</div></td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="status" id="addCarvedOutComment.status"></td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="help"><span id="addCarvedOutComment.message" class="message"></span>Click button to add standard comment for all items.</td>'; |
4832 |
05 Jun 18 |
olle |
html += '</tr>'; |
4832 |
05 Jun 18 |
olle |
935 |
|
4832 |
05 Jun 18 |
olle |
html += '<tr class="align-top">'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="subprompt"></td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td><div class="button basicbutton interactable" id="addMnbComment" style="font-weight: normal;">Add "MNB" (Medium needle biopsy)</div></td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="status" id="addMnbComment.status"></td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="help"><span id="addMnbComment.message" class="message"></span>Click button to add standard comment for all items.</td>'; |
4832 |
05 Jun 18 |
olle |
html += '</tr>'; |
4832 |
05 Jun 18 |
olle |
942 |
*/ |
4832 |
05 Jun 18 |
olle |
943 |
|
4832 |
05 Jun 18 |
olle |
for (var i=0; i < nofTubes; i++) |
4832 |
05 Jun 18 |
olle |
945 |
{ |
4832 |
05 Jun 18 |
olle |
var tubeContentTypeName = persinfo.fetchTubeContentTypeName(tubeContentType, i); |
4832 |
05 Jun 18 |
olle |
var tubeContentTypeNameInternal = persinfo.fetchTubeContentTypeNameInternal(tubeContentType, tubeContentTypeName); |
4832 |
05 Jun 18 |
olle |
var tubeName = persinfo.fetchTubeName(tubeContentType, caseInfo, i); |
4832 |
05 Jun 18 |
olle |
var tubeNo = i+caseInfo.specimenFirstIndex; |
4832 |
05 Jun 18 |
olle |
var tubeIdentifier = persinfo.fetchTubeIdentifier(tubeContentType, caseInfo, i); |
4832 |
05 Jun 18 |
olle |
951 |
/* |
4832 |
05 Jun 18 |
olle |
html += '<tr class="section-header">'; |
4832 |
05 Jun 18 |
olle |
html += '<td colspan="4">'+tubeContentTypeName+' tube '+tubeName+'</td>'; |
4832 |
05 Jun 18 |
olle |
html += '</tr>'; |
4832 |
05 Jun 18 |
olle |
955 |
*/ |
4832 |
05 Jun 18 |
olle |
956 |
|
4832 |
05 Jun 18 |
olle |
957 |
/* |
4832 |
05 Jun 18 |
olle |
var boxMsg = 'Box-number where the '+tubeContentTypeNameInternal+' tube is located in.'; |
4832 |
05 Jun 18 |
olle |
959 |
*/ |
4832 |
05 Jun 18 |
olle |
//var boxMsg = 'Box-number and position where the '+tubeContentTypeNameInternal+' tube is located.'; |
4969 |
07 Sep 18 |
olle |
var boxMsg = 'Box-number and position where whole blood tube #' + (i+1) + ' is located.'; |
4832 |
05 Jun 18 |
olle |
962 |
/* |
4832 |
05 Jun 18 |
olle |
var dnaBoxMsg = 'Box-number and position where the DNA extract will be located.'; |
4832 |
05 Jun 18 |
olle |
var rnaBoxMsg = 'Box-number and position where the RNA extract will be located.'; |
4832 |
05 Jun 18 |
olle |
965 |
*/ |
4832 |
05 Jun 18 |
olle |
var disabledAttribute = ''; |
4832 |
05 Jun 18 |
olle |
967 |
/* |
4832 |
05 Jun 18 |
olle |
if (i == 0 && tubeContentType == 'Specimen') |
4832 |
05 Jun 18 |
olle |
969 |
{ |
4832 |
05 Jun 18 |
olle |
boxMsg = 'No storage space allocated for first '+tubeContentTypeNameInternal+'; all amount expected to be used.'; |
4832 |
05 Jun 18 |
olle |
disabledAttribute = ' disabled'; |
4832 |
05 Jun 18 |
olle |
972 |
} |
4832 |
05 Jun 18 |
olle |
973 |
*/ |
4832 |
05 Jun 18 |
olle |
html += '<tr>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="subprompt">'+tubeContentTypeName+' '+tubeName+' '+'Box</td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="input">'; |
4832 |
05 Jun 18 |
olle |
977 |
/* |
4832 |
05 Jun 18 |
olle |
html += '<input type="text" name="box.'+i+'" id="box.'+i+'" style="width: 12em;" maxlength="12"'+disabledAttribute+'></td>'; |
4832 |
05 Jun 18 |
olle |
979 |
*/ |
4832 |
05 Jun 18 |
olle |
html += '<input type="text" name="box.'+i+'" id="box.'+i+'" style="width: 12em;" maxlength="12"'+disabledAttribute+'>'; |
4832 |
05 Jun 18 |
olle |
html += ' Row<input type="text" name="row.'+i+'" id="row.'+i+'" style="text-transform:uppercase; width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
4832 |
05 Jun 18 |
olle |
html += ' Column<input type="text" name="column.'+i+'" id="column.'+i+'" style="width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
4832 |
05 Jun 18 |
olle |
html += '</td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="status" id="box.'+i+'.status"></td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="help"><span id="box.'+i+'.message" class="message"></span>'+boxMsg+'<span id="position.'+i+'.message" class="message"></span></td>'; |
4832 |
05 Jun 18 |
olle |
html += '</tr>'; |
4832 |
05 Jun 18 |
olle |
987 |
/* |
4832 |
05 Jun 18 |
olle |
html += '<tr>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="subprompt">Row</td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="input">'; |
4832 |
05 Jun 18 |
olle |
html += '<input type="text" name="row.'+i+'" id="row.'+i+'" style="text-transform:uppercase; width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
4832 |
05 Jun 18 |
olle |
html += ' Column<input type="text" name="column.'+i+'" id="column.'+i+'" style="width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
4832 |
05 Jun 18 |
olle |
html += '</td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="status" id="position.'+i+'.status"></td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="help"><span id="position.'+i+'.message" class="message"></span></td>'; |
4832 |
05 Jun 18 |
olle |
html += '</tr>'; |
4832 |
05 Jun 18 |
olle |
997 |
*/ |
4832 |
05 Jun 18 |
olle |
998 |
|
4832 |
05 Jun 18 |
olle |
999 |
/* |
4832 |
05 Jun 18 |
olle |
if (tubeContentType == 'Specimen') |
4832 |
05 Jun 18 |
olle |
1001 |
{ |
4832 |
05 Jun 18 |
olle |
disabledAttribute = ''; |
4832 |
05 Jun 18 |
olle |
if (i == 0 || !extractsFromFirstSpecimenOnly) |
4832 |
05 Jun 18 |
olle |
1004 |
{ |
4832 |
05 Jun 18 |
olle |
html += '<tr>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="subprompt">DNA extract'+' '+tubeName+'.d '+'Box</td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="input">'; |
4832 |
05 Jun 18 |
olle |
html += '<input type="text" name="dnaBox.'+i+'" id="dnaBox.'+i+'" style="width: 12em;" maxlength="12"'+disabledAttribute+'>'; |
4832 |
05 Jun 18 |
olle |
html += ' Row<input type="text" name="dnaRow.'+i+'" id="dnaRow.'+i+'" style="text-transform:uppercase; width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
4832 |
05 Jun 18 |
olle |
html += ' Column<input type="text" name="dnaColumn.'+i+'" id="dnaColumn.'+i+'" style="width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
4832 |
05 Jun 18 |
olle |
html += '</td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="status" id="dnaBox.'+i+'.status"></td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="help"><span id="dnaBox.'+i+'.message" class="message"></span>'+dnaBoxMsg+'<span id="dnaPosition.'+i+'.message" class="message"></span></td>'; |
4832 |
05 Jun 18 |
olle |
html += '</tr>'; |
4832 |
05 Jun 18 |
olle |
1015 |
|
4832 |
05 Jun 18 |
olle |
html += '<tr>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="subprompt">RNA extract'+' '+tubeName+'.r '+'Box</td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="input">'; |
4832 |
05 Jun 18 |
olle |
html += '<input type="text" name="rnaBox.'+i+'" id="rnaBox.'+i+'" style="width: 12em;" maxlength="12"'+disabledAttribute+'>'; |
4832 |
05 Jun 18 |
olle |
html += ' Row<input type="text" name="rnaRow.'+i+'" id="rnaRow.'+i+'" style="text-transform:uppercase; width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
4832 |
05 Jun 18 |
olle |
html += ' Column<input type="text" name="rnaColumn.'+i+'" id="rnaColumn.'+i+'" style="width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
4832 |
05 Jun 18 |
olle |
html += '</td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="status" id="rnaBox.'+i+'.status"></td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="help"><span id="rnaBox.'+i+'.message" class="message"></span>'+rnaBoxMsg+'<span id="rnaPosition.'+i+'.message" class="message"></span></td>'; |
4832 |
05 Jun 18 |
olle |
html += '</tr>'; |
4832 |
05 Jun 18 |
olle |
1026 |
} |
4832 |
05 Jun 18 |
olle |
1027 |
|
4832 |
05 Jun 18 |
olle |
html += '<tr>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="subprompt">Number of sections</td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="input">'; |
4832 |
05 Jun 18 |
olle |
html += '<input type="text" name="nofSections.'+i+'" id="nofSections.'+i+'" style="width: 3em;" maxlength="2" value="1">'; |
4832 |
05 Jun 18 |
olle |
html += '</td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="status" id="nofSections.'+i+'.status"></td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="help"><span id="nofSections.'+i+'.message" class="message"></span>Number of sections (slices) in FFPE block.</td>'; |
4832 |
05 Jun 18 |
olle |
html += '</tr>'; |
4832 |
05 Jun 18 |
olle |
1036 |
} |
4832 |
05 Jun 18 |
olle |
1037 |
*/ |
4832 |
05 Jun 18 |
olle |
1038 |
|
4832 |
05 Jun 18 |
olle |
1039 |
/* |
4832 |
05 Jun 18 |
olle |
html += '<tr class="align-top">'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="subprompt">Operator delivery comment</td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="input"><textarea rows="3" name="comment.'+i+'" id="comment.'+i+'"></textarea></td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="status" id="comment.'+i+'.status"></td>'; |
4832 |
05 Jun 18 |
olle |
html += '<td class="help"><span id="comment.'+i+'.message" class="message"></span>In this field, enter information specific for '+tubeContentTypeNameInternal+' tube ' +tubeIdentifier+'.</td>'; |
4832 |
05 Jun 18 |
olle |
html += '</tr>'; |
4832 |
05 Jun 18 |
olle |
1046 |
*/ |
4832 |
05 Jun 18 |
olle |
1047 |
} |
4832 |
05 Jun 18 |
olle |
Doc.element('blood-tubes').innerHTML = html; |
4832 |
05 Jun 18 |
olle |
1049 |
|
4832 |
05 Jun 18 |
olle |
1050 |
/* |
4832 |
05 Jun 18 |
olle |
// Add click handlers for buttons for adding standard comments for all specimens/RNA/DNA |
4832 |
05 Jun 18 |
olle |
var addCarvedOutCommentGeneralButton = Doc.element('addCarvedOutComment'); |
4832 |
05 Jun 18 |
olle |
Buttons.addClickHandler(addCarvedOutCommentGeneralButton, persinfo.addCommentGeneral, {'nofTubes': nofTubes, 'text-field': 'comment.', 'text': 'Utkarvad.'}); |
4832 |
05 Jun 18 |
olle |
var addMnbCommentGeneralButton = Doc.element('addMnbComment'); |
4832 |
05 Jun 18 |
olle |
Buttons.addClickHandler(addMnbCommentGeneralButton, persinfo.addCommentGeneral, {'nofTubes': nofTubes, 'text-field': 'comment.', 'text': 'MNB.'}); |
4832 |
05 Jun 18 |
olle |
1056 |
*/ |
4832 |
05 Jun 18 |
olle |
1057 |
|
4870 |
25 Jun 18 |
olle |
Wizard.setCurrentStep(3); |
4832 |
05 Jun 18 |
olle |
Doc.show('goregister'); |
4832 |
05 Jun 18 |
olle |
Doc.show('gocancel'); |
4832 |
05 Jun 18 |
olle |
//frm['comment.0'].focus(); |
4832 |
05 Jun 18 |
olle |
1062 |
|
4832 |
05 Jun 18 |
olle |
var storageBoxSuffix = ''; |
4832 |
05 Jun 18 |
olle |
//var url = '../SpecimenTubeRegistration.servlet?ID='+App.getSessionId(); |
4832 |
05 Jun 18 |
olle |
var url = '../BaseLineRegistration.servlet?ID='+App.getSessionId(); |
4832 |
05 Jun 18 |
olle |
url += '&cmd=FindBloodStoragePositions'; |
4832 |
05 Jun 18 |
olle |
url += '&nofTubes='+frm.nofTubes.value; |
4832 |
05 Jun 18 |
olle |
url += '&storageBoxSuffix='+storageBoxSuffix; |
4832 |
05 Jun 18 |
olle |
//url += '&extractsFromFirstSpecimenOnly='+extractsFromFirstSpecimenOnly; |
4832 |
05 Jun 18 |
olle |
1070 |
|
4832 |
05 Jun 18 |
olle |
Wizard.showLoadingAnimation('Looking for empty box positions...'); |
4832 |
05 Jun 18 |
olle |
Wizard.asyncJsonRequest(url, persinfo.bloodStoragePositionsLoaded); |
4832 |
05 Jun 18 |
olle |
1073 |
} |
4832 |
05 Jun 18 |
olle |
1074 |
|
4832 |
05 Jun 18 |
olle |
persinfo.addCommentGeneral = function(event) |
4832 |
05 Jun 18 |
olle |
1076 |
{ |
4832 |
05 Jun 18 |
olle |
var nofTubes = Data.get(event.currentTarget, 'nofTubes', event.currentTarget.id); |
4832 |
05 Jun 18 |
olle |
var textFieldBase = Data.get(event.currentTarget, 'text-field', event.currentTarget.id); |
4832 |
05 Jun 18 |
olle |
var text = Data.get(event.currentTarget, 'text', event.currentTarget.id); |
4832 |
05 Jun 18 |
olle |
for (var i=0; i < nofTubes; i++) |
4832 |
05 Jun 18 |
olle |
1081 |
{ |
4832 |
05 Jun 18 |
olle |
var textField = Doc.element(textFieldBase+i); |
4832 |
05 Jun 18 |
olle |
if (textField) |
4832 |
05 Jun 18 |
olle |
1084 |
{ |
4832 |
05 Jun 18 |
olle |
if (text && text != '') |
4832 |
05 Jun 18 |
olle |
1086 |
{ |
4832 |
05 Jun 18 |
olle |
if (textField.value != '') |
4832 |
05 Jun 18 |
olle |
1088 |
{ |
4832 |
05 Jun 18 |
olle |
textField.value += ' '; |
4832 |
05 Jun 18 |
olle |
1090 |
} |
4832 |
05 Jun 18 |
olle |
textField.value += text; |
4832 |
05 Jun 18 |
olle |
1092 |
} |
4832 |
05 Jun 18 |
olle |
1093 |
} |
4832 |
05 Jun 18 |
olle |
1094 |
} |
4832 |
05 Jun 18 |
olle |
persinfo.setNumberOfSectionsFromComment(event); |
4832 |
05 Jun 18 |
olle |
1096 |
} |
4832 |
05 Jun 18 |
olle |
1097 |
|
4832 |
05 Jun 18 |
olle |
persinfo.addComment = function(event) |
4832 |
05 Jun 18 |
olle |
1099 |
{ |
4832 |
05 Jun 18 |
olle |
var textField = Doc.element(Data.get(event.currentTarget, 'text-field', event.currentTarget.id)); |
4832 |
05 Jun 18 |
olle |
var text = Data.get(event.currentTarget, 'text', event.currentTarget.id); |
4832 |
05 Jun 18 |
olle |
if (textField) |
4832 |
05 Jun 18 |
olle |
1103 |
{ |
4832 |
05 Jun 18 |
olle |
if (text && text != '') |
4832 |
05 Jun 18 |
olle |
1105 |
{ |
4832 |
05 Jun 18 |
olle |
if (textField.value != '') |
4832 |
05 Jun 18 |
olle |
1107 |
{ |
4832 |
05 Jun 18 |
olle |
textField.value += ' '; |
4832 |
05 Jun 18 |
olle |
1109 |
} |
4832 |
05 Jun 18 |
olle |
textField.value += text; |
4832 |
05 Jun 18 |
olle |
1111 |
} |
4832 |
05 Jun 18 |
olle |
1112 |
} |
4832 |
05 Jun 18 |
olle |
persinfo.setNumberOfSectionsFromComment(event); |
4832 |
05 Jun 18 |
olle |
1114 |
} |
4832 |
05 Jun 18 |
olle |
1115 |
|
4832 |
05 Jun 18 |
olle |
persinfo.setNumberOfSectionsFromComment = function(event) |
4832 |
05 Jun 18 |
olle |
1117 |
{ |
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
var nofTubes = Data.get(event.currentTarget, 'nofTubes', event.currentTarget.id); |
4832 |
05 Jun 18 |
olle |
var textFieldBase = Data.get(event.currentTarget, 'text-field', event.currentTarget.id); |
4832 |
05 Jun 18 |
olle |
for (var i=0; i < nofTubes; i++) |
4832 |
05 Jun 18 |
olle |
1122 |
{ |
4832 |
05 Jun 18 |
olle |
var numSections = 1; |
4832 |
05 Jun 18 |
olle |
var textField = Doc.element(textFieldBase+i); |
4832 |
05 Jun 18 |
olle |
if (textField) |
4832 |
05 Jun 18 |
olle |
1126 |
{ |
4832 |
05 Jun 18 |
olle |
var text = textField.value; |
4832 |
05 Jun 18 |
olle |
if (text && text != '') |
4832 |
05 Jun 18 |
olle |
1129 |
{ |
4832 |
05 Jun 18 |
olle |
// If comment "Utkarvad." and not "MNB." => number of sections set to 0 |
4832 |
05 Jun 18 |
olle |
if (text.indexOf('Utkarvad.') >= 0 && text.indexOf('MNB.') < 0) |
4832 |
05 Jun 18 |
olle |
1132 |
{ |
4832 |
05 Jun 18 |
olle |
numSections = 0; |
4832 |
05 Jun 18 |
olle |
1134 |
} |
4832 |
05 Jun 18 |
olle |
1135 |
} |
4832 |
05 Jun 18 |
olle |
1136 |
} |
4832 |
05 Jun 18 |
olle |
frm['nofSections.'+i].value = numSections; |
4832 |
05 Jun 18 |
olle |
1138 |
} |
4832 |
05 Jun 18 |
olle |
1139 |
} |
4832 |
05 Jun 18 |
olle |
1140 |
|
4832 |
05 Jun 18 |
olle |
persinfo.storagePositionsLoaded = function(response) |
4832 |
05 Jun 18 |
olle |
1142 |
{ |
4832 |
05 Jun 18 |
olle |
var freeWells = response.wells; |
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
var tubeContentType = frm.tubeContentType.value; |
4832 |
05 Jun 18 |
olle |
var nofTubes = parseInt(frm.nofTubes.value); |
4832 |
05 Jun 18 |
olle |
var extractsFromFirstSpecimenOnly = frm.extractsFromFirstSpecimenOnlyCB.checked; |
4832 |
05 Jun 18 |
olle |
1148 |
|
4832 |
05 Jun 18 |
olle |
// No storage space is allocated for first specimen, |
4832 |
05 Jun 18 |
olle |
// since all amount is expected to be used for analysis. |
4832 |
05 Jun 18 |
olle |
// Specimen tube with i == 0 is therefore skipped. |
4832 |
05 Jun 18 |
olle |
if (tubeContentType == 'Specimen') |
4832 |
05 Jun 18 |
olle |
1153 |
{ |
4832 |
05 Jun 18 |
olle |
for (var i = 0; i < nofTubes; i++) |
4832 |
05 Jun 18 |
olle |
1155 |
{ |
4832 |
05 Jun 18 |
olle |
wellIndex = 3*i; |
4832 |
05 Jun 18 |
olle |
var specWell = null; |
4832 |
05 Jun 18 |
olle |
if (i > 0) |
4832 |
05 Jun 18 |
olle |
1159 |
{ |
4832 |
05 Jun 18 |
olle |
specWell = freeWells[wellIndex]; |
4832 |
05 Jun 18 |
olle |
if (!specWell || specWell == '') |
4832 |
05 Jun 18 |
olle |
1162 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('box.'+i, 'invalid', 'Missing box'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
1165 |
} |
4832 |
05 Jun 18 |
olle |
1166 |
} |
4832 |
05 Jun 18 |
olle |
var dnaWell = null; |
4832 |
05 Jun 18 |
olle |
if (i == 0 || !extractsFromFirstSpecimenOnly) |
4832 |
05 Jun 18 |
olle |
1169 |
{ |
4832 |
05 Jun 18 |
olle |
dnaWell = freeWells[wellIndex+1]; |
4832 |
05 Jun 18 |
olle |
if (!dnaWell || dnaWell == '') |
4832 |
05 Jun 18 |
olle |
1172 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('dnaBox.'+i, 'invalid', 'Missing box'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
1175 |
} |
4832 |
05 Jun 18 |
olle |
1176 |
} |
4832 |
05 Jun 18 |
olle |
var rnaWell = null; |
4832 |
05 Jun 18 |
olle |
if (i == 0 || !extractsFromFirstSpecimenOnly) |
4832 |
05 Jun 18 |
olle |
1179 |
{ |
4832 |
05 Jun 18 |
olle |
rnaWell = freeWells[wellIndex+2]; |
4832 |
05 Jun 18 |
olle |
if (!rnaWell || rnaWell == '') |
4832 |
05 Jun 18 |
olle |
1182 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('rnaBox.'+i, 'invalid', 'Missing box'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
1185 |
} |
4832 |
05 Jun 18 |
olle |
1186 |
} |
4832 |
05 Jun 18 |
olle |
1187 |
|
4832 |
05 Jun 18 |
olle |
// Update form fields for storage plates |
4832 |
05 Jun 18 |
olle |
if (specWell) |
4832 |
05 Jun 18 |
olle |
1190 |
{ |
4832 |
05 Jun 18 |
olle |
frm['box.'+i].value = specWell.bioPlate.name; |
4832 |
05 Jun 18 |
olle |
frm['row.'+i].value = Meludi.wellToAlpha(specWell.row); |
4832 |
05 Jun 18 |
olle |
frm['column.'+i].value = specWell.column+1; |
4832 |
05 Jun 18 |
olle |
1194 |
} |
4832 |
05 Jun 18 |
olle |
1195 |
|
4832 |
05 Jun 18 |
olle |
if (dnaWell) |
4832 |
05 Jun 18 |
olle |
1197 |
{ |
4832 |
05 Jun 18 |
olle |
frm['dnaBox.'+i].value = dnaWell.bioPlate.name; |
4832 |
05 Jun 18 |
olle |
frm['dnaRow.'+i].value = Meludi.wellToAlpha(dnaWell.row); |
4832 |
05 Jun 18 |
olle |
frm['dnaColumn.'+i].value = dnaWell.column+1; |
4832 |
05 Jun 18 |
olle |
1201 |
} |
4832 |
05 Jun 18 |
olle |
1202 |
|
4832 |
05 Jun 18 |
olle |
if (rnaWell) |
4832 |
05 Jun 18 |
olle |
1204 |
{ |
4832 |
05 Jun 18 |
olle |
frm['rnaBox.'+i].value = rnaWell.bioPlate.name; |
4832 |
05 Jun 18 |
olle |
frm['rnaRow.'+i].value = Meludi.wellToAlpha(rnaWell.row); |
4832 |
05 Jun 18 |
olle |
frm['rnaColumn.'+i].value = rnaWell.column+1; |
4832 |
05 Jun 18 |
olle |
1208 |
} |
4832 |
05 Jun 18 |
olle |
1209 |
|
4832 |
05 Jun 18 |
olle |
// Move focus to next field |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('box.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'row.'+i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('row.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'column.'+i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('column.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'dnaBox.'+i }); |
4832 |
05 Jun 18 |
olle |
1214 |
|
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('dnaBox.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'dnaRow.'+i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('dnaRow.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'dnaColumn.'+i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('dnaColumn.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'rnaBox.'+i }); |
4832 |
05 Jun 18 |
olle |
1218 |
|
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('rnaBox.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'rnaRow.'+i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('rnaRow.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'rnaColumn.'+i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('rnaColumn.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'nofSections.'+i }); |
4832 |
05 Jun 18 |
olle |
1222 |
|
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('nofSections.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'comment.'+i }); |
4832 |
05 Jun 18 |
olle |
1224 |
|
4832 |
05 Jun 18 |
olle |
// Form validation |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('column.'+i, 'keypress', Events.integerOnly); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('box.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'Specimen', 'index': i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('row.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'Specimen', 'index': i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('column.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'Specimen', 'index': i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('box.'+i, 'keyup', persinfo.boxOnKeyUp, { 'boxtype': 'Specimen'}); |
4832 |
05 Jun 18 |
olle |
1231 |
|
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('dnaColumn.'+i, 'keypress', Events.integerOnly); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('dnaBox.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'DNA', 'index': i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('dnaRow.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'DNA', 'index': i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('dnaColumn.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'DNA', 'index': i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('dnaBox.'+i, 'keyup', persinfo.boxOnKeyUp, { 'boxtype': 'DNA'}); |
4832 |
05 Jun 18 |
olle |
1237 |
|
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('rnaColumn.'+i, 'keypress', Events.integerOnly); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('rnaBox.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'RNA', 'index': i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('rnaRow.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'RNA', 'index': i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('rnaColumn.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'RNA', 'index': i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('rnaBox.'+i, 'keyup', persinfo.boxOnKeyUp, { 'boxtype': 'RNA'}); |
4832 |
05 Jun 18 |
olle |
1243 |
|
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('nofSections.'+i, 'keypress', Events.integerOnly); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('nofSections.'+i, 'change', persinfo.nofSectionsOnChange, { 'index': i }); |
4832 |
05 Jun 18 |
olle |
1246 |
|
4832 |
05 Jun 18 |
olle |
wellIsValid[i] = true; |
4832 |
05 Jun 18 |
olle |
dnaWellIsValid[i] = true; |
4832 |
05 Jun 18 |
olle |
rnaWellIsValid[i] = true; |
4832 |
05 Jun 18 |
olle |
1250 |
/* |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('position.'+i, 'valid'); |
4832 |
05 Jun 18 |
olle |
1252 |
*/ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('box.'+i, 'valid'); |
4832 |
05 Jun 18 |
olle |
if (i == 0 || !extractsFromFirstSpecimenOnly) |
4832 |
05 Jun 18 |
olle |
1255 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('dnaBox.'+i, 'valid'); |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('rnaBox.'+i, 'valid'); |
4832 |
05 Jun 18 |
olle |
1258 |
} |
4832 |
05 Jun 18 |
olle |
if (tubeContentType == 'Specimen') |
4832 |
05 Jun 18 |
olle |
1260 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('nofSections.'+i, 'valid'); |
4832 |
05 Jun 18 |
olle |
1262 |
} |
4832 |
05 Jun 18 |
olle |
1263 |
} |
4832 |
05 Jun 18 |
olle |
1264 |
} |
4832 |
05 Jun 18 |
olle |
else if (tubeContentType == 'DNA' || tubeContentType == 'RNA' || tubeContentType == 'DNA_RNA') |
4832 |
05 Jun 18 |
olle |
1266 |
{ |
4832 |
05 Jun 18 |
olle |
for (var i = 0; i < nofTubes; i++) |
4832 |
05 Jun 18 |
olle |
1268 |
{ |
4832 |
05 Jun 18 |
olle |
var wellIndex = i; |
4832 |
05 Jun 18 |
olle |
var well = freeWells[wellIndex]; |
4832 |
05 Jun 18 |
olle |
if (!well || well == '') |
4832 |
05 Jun 18 |
olle |
1272 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('box.'+i, 'invalid', 'Missing box'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
1275 |
} |
4832 |
05 Jun 18 |
olle |
frm['box.'+i].value = well.bioPlate.name; |
4832 |
05 Jun 18 |
olle |
frm['row.'+i].value = Meludi.wellToAlpha(well.row); |
4832 |
05 Jun 18 |
olle |
frm['column.'+i].value = well.column+1; |
4832 |
05 Jun 18 |
olle |
1279 |
|
4832 |
05 Jun 18 |
olle |
// Move focus to next field |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('box.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'row.'+i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('row.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'column.'+i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('column.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'nofSections.'+i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('nofSections.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'comment.'+i }); |
4832 |
05 Jun 18 |
olle |
1285 |
|
4832 |
05 Jun 18 |
olle |
// Form validation |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('column.'+i, 'keypress', Events.integerOnly); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('box.'+i, 'change', persinfo.wellOnChange, { 'index': i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('row.'+i, 'change', persinfo.wellOnChange, { 'index': i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('column.'+i, 'change', persinfo.wellOnChange, { 'index': i }); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('box.'+i, 'keyup', persinfo.boxOnKeyUp); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('nofSections.'+i, 'keypress', Events.integerOnly); |
4832 |
05 Jun 18 |
olle |
Events.addEventHandler('nofSections.'+i, 'change', persinfo.nofSectionsOnChange, { 'index': i }); |
4832 |
05 Jun 18 |
olle |
1294 |
|
4832 |
05 Jun 18 |
olle |
wellIsValid[i] = true; |
4832 |
05 Jun 18 |
olle |
1296 |
/* |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('position.'+i, 'valid'); |
4832 |
05 Jun 18 |
olle |
1298 |
*/ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('box.'+i, 'valid'); |
4832 |
05 Jun 18 |
olle |
if (tubeContentType == 'Specimen') |
4832 |
05 Jun 18 |
olle |
1301 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('nofSections.'+i, 'valid'); |
4832 |
05 Jun 18 |
olle |
1303 |
} |
4832 |
05 Jun 18 |
olle |
1304 |
} |
4832 |
05 Jun 18 |
olle |
1305 |
} |
4832 |
05 Jun 18 |
olle |
1306 |
} |
4832 |
05 Jun 18 |
olle |
1307 |
|
4832 |
05 Jun 18 |
olle |
persinfo.fixNofTubes = function(tubeContentType, nofTubes) |
4832 |
05 Jun 18 |
olle |
1309 |
{ |
4832 |
05 Jun 18 |
olle |
if (tubeContentType == 'DNA') |
4832 |
05 Jun 18 |
olle |
1311 |
{ |
4832 |
05 Jun 18 |
olle |
nofTubes = 1; |
4832 |
05 Jun 18 |
olle |
1313 |
} |
4832 |
05 Jun 18 |
olle |
else if (tubeContentType == 'RNA') |
4832 |
05 Jun 18 |
olle |
1315 |
{ |
4832 |
05 Jun 18 |
olle |
nofTubes = 1; |
4832 |
05 Jun 18 |
olle |
1317 |
} |
4832 |
05 Jun 18 |
olle |
else if (tubeContentType == 'DNA_RNA') |
4832 |
05 Jun 18 |
olle |
1319 |
{ |
4832 |
05 Jun 18 |
olle |
nofTubes = 2; |
4832 |
05 Jun 18 |
olle |
1321 |
} |
4832 |
05 Jun 18 |
olle |
return nofTubes; |
4832 |
05 Jun 18 |
olle |
1323 |
} |
4832 |
05 Jun 18 |
olle |
1324 |
|
4832 |
05 Jun 18 |
olle |
persinfo.fetchStorageBoxSuffix = function(tubeContentType) |
4832 |
05 Jun 18 |
olle |
1326 |
{ |
4832 |
05 Jun 18 |
olle |
var storageBoxSuffix = null; |
4832 |
05 Jun 18 |
olle |
if (tubeContentType == 'Specimen') |
4832 |
05 Jun 18 |
olle |
1329 |
{ |
4832 |
05 Jun 18 |
olle |
storageBoxSuffix = '_sp'; |
4832 |
05 Jun 18 |
olle |
1331 |
} |
4832 |
05 Jun 18 |
olle |
else if (tubeContentType == 'DNA') |
4832 |
05 Jun 18 |
olle |
1333 |
{ |
4832 |
05 Jun 18 |
olle |
storageBoxSuffix = '_dna'; |
4832 |
05 Jun 18 |
olle |
1335 |
} |
4832 |
05 Jun 18 |
olle |
else if (tubeContentType == 'RNA') |
4832 |
05 Jun 18 |
olle |
1337 |
{ |
4832 |
05 Jun 18 |
olle |
storageBoxSuffix = '_rna'; |
4832 |
05 Jun 18 |
olle |
1339 |
} |
4832 |
05 Jun 18 |
olle |
else if (tubeContentType == 'DNA_RNA') |
4832 |
05 Jun 18 |
olle |
1341 |
{ |
4832 |
05 Jun 18 |
olle |
storageBoxSuffix = '_dna_rna'; |
4832 |
05 Jun 18 |
olle |
1343 |
} |
4832 |
05 Jun 18 |
olle |
return storageBoxSuffix; |
4832 |
05 Jun 18 |
olle |
1345 |
} |
4832 |
05 Jun 18 |
olle |
1346 |
|
4832 |
05 Jun 18 |
olle |
persinfo.fetchTubeContentTypeName = function(tubeContentType, tubeIndex) |
4832 |
05 Jun 18 |
olle |
1348 |
{ |
4832 |
05 Jun 18 |
olle |
var tubeContentTypeName = tubeContentType; |
4832 |
05 Jun 18 |
olle |
if (tubeContentType == 'DNA_RNA') |
4832 |
05 Jun 18 |
olle |
1351 |
{ |
4832 |
05 Jun 18 |
olle |
if (tubeIndex == 0) |
4832 |
05 Jun 18 |
olle |
1353 |
{ |
4832 |
05 Jun 18 |
olle |
tubeContentTypeName = 'DNA'; |
4832 |
05 Jun 18 |
olle |
1355 |
} |
4832 |
05 Jun 18 |
olle |
else if (tubeIndex == 1) |
4832 |
05 Jun 18 |
olle |
1357 |
{ |
4832 |
05 Jun 18 |
olle |
tubeContentTypeName = 'RNA'; |
4832 |
05 Jun 18 |
olle |
1359 |
} |
4832 |
05 Jun 18 |
olle |
1360 |
} |
4832 |
05 Jun 18 |
olle |
return tubeContentTypeName; |
4832 |
05 Jun 18 |
olle |
1362 |
} |
4832 |
05 Jun 18 |
olle |
1363 |
|
4832 |
05 Jun 18 |
olle |
persinfo.fetchTubeContentTypeNameInternal = function(tubeContentType, tubeContentTypeName) |
4832 |
05 Jun 18 |
olle |
1365 |
{ |
4832 |
05 Jun 18 |
olle |
var tubeContentTypeNameInternal = tubeContentTypeName; |
4832 |
05 Jun 18 |
olle |
// Convert all names except abbreviations to all lower case |
4832 |
05 Jun 18 |
olle |
if (tubeContentType == 'Specimen') |
4832 |
05 Jun 18 |
olle |
1369 |
{ |
4832 |
05 Jun 18 |
olle |
tubeContentTypeNameInternal = tubeContentTypeName.toLowerCase(); |
4832 |
05 Jun 18 |
olle |
1371 |
} |
4832 |
05 Jun 18 |
olle |
return tubeContentTypeNameInternal; |
4832 |
05 Jun 18 |
olle |
1373 |
} |
4832 |
05 Jun 18 |
olle |
1374 |
|
4832 |
05 Jun 18 |
olle |
persinfo.fetchTubeName = function(tubeContentType, caseInfo, tubeIndex) |
4832 |
05 Jun 18 |
olle |
1376 |
{ |
4832 |
05 Jun 18 |
olle |
var tubeName = Strings.encodeTags(caseInfo.originalName); |
4832 |
05 Jun 18 |
olle |
if (tubeContentType == 'Blood') |
4832 |
05 Jun 18 |
olle |
1379 |
{ |
4870 |
25 Jun 18 |
olle |
// Exchange sample item prefix for blood item prefix |
4870 |
25 Jun 18 |
olle |
if (tubeName.startsWith(sampleItemPrefix)) |
4958 |
03 Sep 18 |
olle |
1382 |
{ |
4958 |
03 Sep 18 |
olle |
//var tubeNameDigits = tubeName.substring(sampleItemPrefix.length); |
4958 |
03 Sep 18 |
olle |
tubeNameDigits = caseInfo.highestBloodItemNumber + (tubeIndex + 1); |
4958 |
03 Sep 18 |
olle |
tubeNameDigits = '0000000000000' + tubeNameDigits; |
4958 |
03 Sep 18 |
olle |
tubeNameDigits = tubeNameDigits.substring(tubeNameDigits.length - bloodItemNumDigits); |
4870 |
25 Jun 18 |
olle |
tubeName = bloodItemPrefix + tubeNameDigits; |
4870 |
25 Jun 18 |
olle |
1388 |
} |
4870 |
25 Jun 18 |
olle |
1389 |
|
4870 |
25 Jun 18 |
olle |
// Add suffix |
4958 |
03 Sep 18 |
olle |
if (bloodItemPrefix == sampleItemPrefix) |
4832 |
05 Jun 18 |
olle |
1392 |
{ |
4878 |
27 Jun 18 |
olle |
tubeName = tubeName+'.b'; |
4878 |
27 Jun 18 |
olle |
if (tubeIndex > 0) |
4878 |
27 Jun 18 |
olle |
1395 |
{ |
4878 |
27 Jun 18 |
olle |
tubeName = tubeName + (tubeIndex + 1); |
4878 |
27 Jun 18 |
olle |
1397 |
} |
4878 |
27 Jun 18 |
olle |
1398 |
} |
4832 |
05 Jun 18 |
olle |
1399 |
} |
4832 |
05 Jun 18 |
olle |
else if (tubeContentType == 'Specimen') |
4832 |
05 Jun 18 |
olle |
1401 |
{ |
4832 |
05 Jun 18 |
olle |
var tubeNo = tubeIndex + caseInfo.specimenFirstIndex; |
4832 |
05 Jun 18 |
olle |
tubeName = tubeName+'.'+tubeNo; |
4832 |
05 Jun 18 |
olle |
1404 |
} |
4832 |
05 Jun 18 |
olle |
else if (tubeContentType == 'DNA') |
4832 |
05 Jun 18 |
olle |
1406 |
{ |
4832 |
05 Jun 18 |
olle |
tubeName = tubeName+'.d'; |
4832 |
05 Jun 18 |
olle |
1408 |
} |
4832 |
05 Jun 18 |
olle |
else if (tubeContentType == 'RNA') |
4832 |
05 Jun 18 |
olle |
1410 |
{ |
4832 |
05 Jun 18 |
olle |
tubeName = tubeName+'.r'; |
4832 |
05 Jun 18 |
olle |
1412 |
} |
4832 |
05 Jun 18 |
olle |
else if (tubeContentType == 'DNA_RNA') |
4832 |
05 Jun 18 |
olle |
1414 |
{ |
4832 |
05 Jun 18 |
olle |
if (tubeIndex == 0) |
4832 |
05 Jun 18 |
olle |
1416 |
{ |
4832 |
05 Jun 18 |
olle |
tubeName = tubeName+'.d'; |
4832 |
05 Jun 18 |
olle |
1418 |
} |
4832 |
05 Jun 18 |
olle |
else if (tubeIndex == 1) |
4832 |
05 Jun 18 |
olle |
1420 |
{ |
4832 |
05 Jun 18 |
olle |
tubeName = tubeName+'.r'; |
4832 |
05 Jun 18 |
olle |
1422 |
} |
4832 |
05 Jun 18 |
olle |
1423 |
} |
4832 |
05 Jun 18 |
olle |
return tubeName; |
4832 |
05 Jun 18 |
olle |
1425 |
} |
4832 |
05 Jun 18 |
olle |
1426 |
|
4832 |
05 Jun 18 |
olle |
persinfo.fetchTubeIdentifier = function(tubeContentType, tubeName, tubeNo) |
4832 |
05 Jun 18 |
olle |
1428 |
{ |
4832 |
05 Jun 18 |
olle |
var tubeIdentifier = tubeName; |
4832 |
05 Jun 18 |
olle |
if (tubeContentType == 'Specimen') |
4832 |
05 Jun 18 |
olle |
1431 |
{ |
4832 |
05 Jun 18 |
olle |
tubeIdentifier = tubeNo; |
4832 |
05 Jun 18 |
olle |
1433 |
} |
4832 |
05 Jun 18 |
olle |
return tubeIdentifier; |
4832 |
05 Jun 18 |
olle |
1435 |
} |
4832 |
05 Jun 18 |
olle |
1436 |
|
4832 |
05 Jun 18 |
olle |
persinfo.boxOnKeyUp = function(event) |
4832 |
05 Jun 18 |
olle |
1438 |
{ |
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
var tubeContentType = frm.tubeContentType.value; |
4832 |
05 Jun 18 |
olle |
1441 |
|
4832 |
05 Jun 18 |
olle |
var boxType = Data.get(event.currentTarget, 'boxtype'); |
4832 |
05 Jun 18 |
olle |
var index = Data.int(event.currentTarget, 'index'); |
4832 |
05 Jun 18 |
olle |
1444 |
|
4832 |
05 Jun 18 |
olle |
// Get box prefix, default is for input tubes |
4832 |
05 Jun 18 |
olle |
var boxPrefix = 'box.'; |
4832 |
05 Jun 18 |
olle |
if (boxType && boxType == 'DNA') |
4832 |
05 Jun 18 |
olle |
1448 |
{ |
4832 |
05 Jun 18 |
olle |
boxPrefix = 'dnaBox.'; |
4832 |
05 Jun 18 |
olle |
1450 |
} |
4832 |
05 Jun 18 |
olle |
if (boxType && boxType == 'RNA') |
4832 |
05 Jun 18 |
olle |
1452 |
{ |
4832 |
05 Jun 18 |
olle |
boxPrefix = 'rnaBox.'; |
4832 |
05 Jun 18 |
olle |
1454 |
} |
4832 |
05 Jun 18 |
olle |
1455 |
|
4832 |
05 Jun 18 |
olle |
// Check box name |
4832 |
05 Jun 18 |
olle |
var boxIsValid = true; |
4832 |
05 Jun 18 |
olle |
var box = frm[boxPrefix+index].value; |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus(boxPrefix+index); |
4832 |
05 Jun 18 |
olle |
// Check for prefix "ML_" |
4832 |
05 Jun 18 |
olle |
if (box.indexOf('ML_') != 0) |
4832 |
05 Jun 18 |
olle |
1462 |
{ |
4832 |
05 Jun 18 |
olle |
boxIsValid = false; |
4832 |
05 Jun 18 |
olle |
1464 |
} |
4832 |
05 Jun 18 |
olle |
var suffix = '_sp'; |
4832 |
05 Jun 18 |
olle |
if (tubeContentType == 'DNA' || (boxType && boxType == 'DNA')) |
4832 |
05 Jun 18 |
olle |
1467 |
{ |
4832 |
05 Jun 18 |
olle |
suffix = '_dna'; |
4832 |
05 Jun 18 |
olle |
1469 |
} |
4832 |
05 Jun 18 |
olle |
else if (tubeContentType == 'RNA' || (boxType && boxType == 'RNA')) |
4832 |
05 Jun 18 |
olle |
1471 |
{ |
4832 |
05 Jun 18 |
olle |
suffix = '_rna'; |
4832 |
05 Jun 18 |
olle |
1473 |
} |
4832 |
05 Jun 18 |
olle |
// Check for suffix |
4832 |
05 Jun 18 |
olle |
if (box.indexOf(suffix) != (box.length - suffix.length)) |
4832 |
05 Jun 18 |
olle |
1476 |
{ |
4832 |
05 Jun 18 |
olle |
boxIsValid = false; |
4832 |
05 Jun 18 |
olle |
1478 |
} |
4832 |
05 Jun 18 |
olle |
1479 |
|
4832 |
05 Jun 18 |
olle |
if (!boxIsValid) |
4832 |
05 Jun 18 |
olle |
1481 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'invalid', 'Box name must start with "ML_" and end with "'+suffix+'"'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
1484 |
} |
4832 |
05 Jun 18 |
olle |
1485 |
} |
4832 |
05 Jun 18 |
olle |
1486 |
|
4832 |
05 Jun 18 |
olle |
persinfo.wellOnChange = function(event) |
4832 |
05 Jun 18 |
olle |
1488 |
{ |
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
var target = event.currentTarget; |
4832 |
05 Jun 18 |
olle |
1491 |
|
4832 |
05 Jun 18 |
olle |
var boxType = Data.get(target, 'boxtype'); |
4832 |
05 Jun 18 |
olle |
var index = Data.int(target, 'index'); |
4832 |
05 Jun 18 |
olle |
1494 |
|
4832 |
05 Jun 18 |
olle |
// Get well position prefixes, default is for input tubes |
4832 |
05 Jun 18 |
olle |
var boxPrefix = 'box.'; |
4832 |
05 Jun 18 |
olle |
var rowPrefix = 'row.'; |
4832 |
05 Jun 18 |
olle |
var columnPrefix = 'column.'; |
4832 |
05 Jun 18 |
olle |
if (boxType && boxType == 'DNA') |
4832 |
05 Jun 18 |
olle |
1500 |
{ |
4832 |
05 Jun 18 |
olle |
boxPrefix = 'dnaBox.'; |
4832 |
05 Jun 18 |
olle |
rowPrefix = 'dnaRow.'; |
4832 |
05 Jun 18 |
olle |
columnPrefix = 'dnaColumn.'; |
4832 |
05 Jun 18 |
olle |
1504 |
} |
4832 |
05 Jun 18 |
olle |
if (boxType && boxType == 'RNA') |
4832 |
05 Jun 18 |
olle |
1506 |
{ |
4832 |
05 Jun 18 |
olle |
boxPrefix = 'rnaBox.'; |
4832 |
05 Jun 18 |
olle |
rowPrefix = 'rnaRow.'; |
4832 |
05 Jun 18 |
olle |
columnPrefix = 'rnaColumn.'; |
4832 |
05 Jun 18 |
olle |
1510 |
} |
4832 |
05 Jun 18 |
olle |
var box = frm[boxPrefix+index].value; |
4832 |
05 Jun 18 |
olle |
var row = frm[rowPrefix+index].value; |
4832 |
05 Jun 18 |
olle |
var column = frm[columnPrefix+index].value; |
4832 |
05 Jun 18 |
olle |
1514 |
|
4832 |
05 Jun 18 |
olle |
//wellIsValid[index] = true; |
4832 |
05 Jun 18 |
olle |
if (!boxType || boxType == 'Specimen') |
4832 |
05 Jun 18 |
olle |
1517 |
{ |
4832 |
05 Jun 18 |
olle |
wellIsValid[index] = false; |
4832 |
05 Jun 18 |
olle |
1519 |
} |
4832 |
05 Jun 18 |
olle |
else if (boxType && boxType == 'DNA') |
4832 |
05 Jun 18 |
olle |
1521 |
{ |
4832 |
05 Jun 18 |
olle |
dnaWellIsValid[index] = false; |
4832 |
05 Jun 18 |
olle |
1523 |
} |
4832 |
05 Jun 18 |
olle |
else if (boxType && boxType == 'RNA') |
4832 |
05 Jun 18 |
olle |
1525 |
{ |
4832 |
05 Jun 18 |
olle |
rnaWellIsValid[index] = false; |
4832 |
05 Jun 18 |
olle |
1527 |
} |
4832 |
05 Jun 18 |
olle |
else |
4832 |
05 Jun 18 |
olle |
1529 |
{ |
4832 |
05 Jun 18 |
olle |
wellIsValid[index] = false; |
4832 |
05 Jun 18 |
olle |
1531 |
} |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus(boxPrefix+index); |
4832 |
05 Jun 18 |
olle |
1533 |
/* |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('position.'+index); |
4832 |
05 Jun 18 |
olle |
1535 |
*/ |
4832 |
05 Jun 18 |
olle |
1536 |
|
4832 |
05 Jun 18 |
olle |
if (box == '') |
4832 |
05 Jun 18 |
olle |
1538 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'invalid', 'Missing box'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
1541 |
} |
4832 |
05 Jun 18 |
olle |
1542 |
|
4832 |
05 Jun 18 |
olle |
// Position errors are reported on box message line |
4832 |
05 Jun 18 |
olle |
if (row == '') |
4832 |
05 Jun 18 |
olle |
1545 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'invalid', 'Missing row'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
1548 |
} |
4832 |
05 Jun 18 |
olle |
1549 |
|
4832 |
05 Jun 18 |
olle |
if (column == '') |
4832 |
05 Jun 18 |
olle |
1551 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'invalid', 'Missing column'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
1554 |
} |
4832 |
05 Jun 18 |
olle |
1555 |
|
4832 |
05 Jun 18 |
olle |
// Check for duplicates |
4832 |
05 Jun 18 |
olle |
var nofTubes = parseInt(frm.nofTubes.value); |
4832 |
05 Jun 18 |
olle |
for (var i=0; i < nofTubes; i++) |
4832 |
05 Jun 18 |
olle |
1559 |
{ |
4832 |
05 Jun 18 |
olle |
if (i != index) |
4832 |
05 Jun 18 |
olle |
1561 |
{ |
4832 |
05 Jun 18 |
olle |
if (box == frm.elements[boxPrefix+i].value && row == frm[rowPrefix+i].value && column == frm[columnPrefix+i].value) |
4832 |
05 Jun 18 |
olle |
1563 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'invalid', 'The position is already used once in this wizard'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
1566 |
} |
4832 |
05 Jun 18 |
olle |
1567 |
} |
4832 |
05 Jun 18 |
olle |
1568 |
} |
4832 |
05 Jun 18 |
olle |
1569 |
|
4832 |
05 Jun 18 |
olle |
//Wizard.setInputStatus('position.'+index, 'checking', 'Checking...'); |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'checking', 'Checking...'); |
4832 |
05 Jun 18 |
olle |
1572 |
|
4832 |
05 Jun 18 |
olle |
// Seems to be ok -- check if used by another sample |
4832 |
05 Jun 18 |
olle |
var request = Ajax.getXmlHttpRequest(); |
4832 |
05 Jun 18 |
olle |
var url = '../SpecimenTubeRegistration.servlet?ID='+App.getSessionId(); |
4832 |
05 Jun 18 |
olle |
url += '&cmd=ValidateWell'; |
4832 |
05 Jun 18 |
olle |
url += '&box=' + encodeURIComponent(box); |
4832 |
05 Jun 18 |
olle |
url += '&row=' + encodeURIComponent(row); |
4832 |
05 Jun 18 |
olle |
url += '&column=' + encodeURIComponent(column); |
4832 |
05 Jun 18 |
olle |
1580 |
|
4832 |
05 Jun 18 |
olle |
Wizard.asyncJsonRequest(url, function(response) { persinfo.onBoxValidated(response, boxType, index) } ); |
4832 |
05 Jun 18 |
olle |
1582 |
} |
4832 |
05 Jun 18 |
olle |
1583 |
|
4832 |
05 Jun 18 |
olle |
persinfo.onBoxValidated = function(response, boxType, index) |
4832 |
05 Jun 18 |
olle |
1585 |
{ |
4832 |
05 Jun 18 |
olle |
// Get well position prefixes, default is for input tubes |
4832 |
05 Jun 18 |
olle |
var boxPrefix = 'box.'; |
4832 |
05 Jun 18 |
olle |
if (boxType && boxType == 'DNA') |
4832 |
05 Jun 18 |
olle |
1589 |
{ |
4832 |
05 Jun 18 |
olle |
boxPrefix = 'dnaBox.'; |
4832 |
05 Jun 18 |
olle |
1591 |
} |
4832 |
05 Jun 18 |
olle |
if (boxType && boxType == 'RNA') |
4832 |
05 Jun 18 |
olle |
1593 |
{ |
4832 |
05 Jun 18 |
olle |
boxPrefix = 'rnaBox.'; |
4832 |
05 Jun 18 |
olle |
1595 |
} |
4832 |
05 Jun 18 |
olle |
1596 |
|
4832 |
05 Jun 18 |
olle |
//Wizard.setInputStatus('position.'+index); |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus(boxPrefix+index); |
4832 |
05 Jun 18 |
olle |
if (response.message) |
4832 |
05 Jun 18 |
olle |
1600 |
{ |
4832 |
05 Jun 18 |
olle |
//Wizard.setInputStatus(response.box ? 'box.'+index : 'position.'+index, 'invalid', Strings.encodeTags(response.message)); |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'invalid', Strings.encodeTags(response.message)); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
1604 |
} |
4832 |
05 Jun 18 |
olle |
1605 |
|
4832 |
05 Jun 18 |
olle |
//wellIsValid[index] = true; |
4832 |
05 Jun 18 |
olle |
if (!boxType || boxType == 'Specimen') |
4832 |
05 Jun 18 |
olle |
1608 |
{ |
4832 |
05 Jun 18 |
olle |
wellIsValid[index] = true; |
4832 |
05 Jun 18 |
olle |
1610 |
} |
4832 |
05 Jun 18 |
olle |
else if (boxType && boxType == 'DNA') |
4832 |
05 Jun 18 |
olle |
1612 |
{ |
4832 |
05 Jun 18 |
olle |
dnaWellIsValid[index] = true; |
4832 |
05 Jun 18 |
olle |
1614 |
} |
4832 |
05 Jun 18 |
olle |
else if (boxType && boxType == 'RNA') |
4832 |
05 Jun 18 |
olle |
1616 |
{ |
4832 |
05 Jun 18 |
olle |
rnaWellIsValid[index] = true; |
4832 |
05 Jun 18 |
olle |
1618 |
} |
4832 |
05 Jun 18 |
olle |
else |
4832 |
05 Jun 18 |
olle |
1620 |
{ |
4832 |
05 Jun 18 |
olle |
wellIsValid[index] = true; |
4832 |
05 Jun 18 |
olle |
1622 |
} |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'valid'); |
4832 |
05 Jun 18 |
olle |
1624 |
/* |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('position.'+index, 'valid'); |
4832 |
05 Jun 18 |
olle |
1626 |
*/ |
4832 |
05 Jun 18 |
olle |
1627 |
} |
4832 |
05 Jun 18 |
olle |
1628 |
|
4832 |
05 Jun 18 |
olle |
persinfo.nofSectionsOnChange = function(event) |
4832 |
05 Jun 18 |
olle |
1630 |
{ |
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
var target = event.currentTarget; |
4832 |
05 Jun 18 |
olle |
1633 |
|
4832 |
05 Jun 18 |
olle |
var index = Data.int(target, 'index'); |
4832 |
05 Jun 18 |
olle |
var nofSections = frm['nofSections.'+index].value; |
4832 |
05 Jun 18 |
olle |
1636 |
|
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('nofSections.'+index); |
4832 |
05 Jun 18 |
olle |
1638 |
|
4832 |
05 Jun 18 |
olle |
if (nofSections == '') |
4832 |
05 Jun 18 |
olle |
1640 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('nofSections'+index, 'invalid', 'Missing'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
1643 |
} |
4832 |
05 Jun 18 |
olle |
if (parseInt(nofSections) < 1) |
4832 |
05 Jun 18 |
olle |
1645 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('nofSections'+index, 'invalid', 'Must be at least 1'); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
1648 |
} |
4832 |
05 Jun 18 |
olle |
Wizard.setInputStatus('nofSections'+index, 'valid'); |
4832 |
05 Jun 18 |
olle |
1650 |
} |
4832 |
05 Jun 18 |
olle |
1651 |
|
4832 |
05 Jun 18 |
olle |
persinfo.validateStep4 = function(event) |
4832 |
05 Jun 18 |
olle |
1653 |
{ |
4832 |
05 Jun 18 |
olle |
var valid = false; |
4832 |
05 Jun 18 |
olle |
1655 |
|
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
var tubeContentType = frm.tubeContentType.value; |
4832 |
05 Jun 18 |
olle |
if (tubeContentType == 'Specimen') |
4832 |
05 Jun 18 |
olle |
1659 |
{ |
4832 |
05 Jun 18 |
olle |
for (var i = 0; i < wellIsValid.length; i++) |
4832 |
05 Jun 18 |
olle |
1661 |
{ |
4832 |
05 Jun 18 |
olle |
// No storage space is allocated for first specimen, |
4832 |
05 Jun 18 |
olle |
// since all amount is expected to be used for analysis. |
4832 |
05 Jun 18 |
olle |
// Specimen tube with i == 0 is therefore skipped. |
4832 |
05 Jun 18 |
olle |
if (i > 0) |
4832 |
05 Jun 18 |
olle |
1666 |
{ |
4832 |
05 Jun 18 |
olle |
if (!wellIsValid[i]) |
4832 |
05 Jun 18 |
olle |
1668 |
{ |
4832 |
05 Jun 18 |
olle |
event.preventDefault(); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
1671 |
} |
4832 |
05 Jun 18 |
olle |
1672 |
} |
4832 |
05 Jun 18 |
olle |
if (!dnaWellIsValid[i]) |
4832 |
05 Jun 18 |
olle |
1674 |
{ |
4832 |
05 Jun 18 |
olle |
event.preventDefault(); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
1677 |
} |
4832 |
05 Jun 18 |
olle |
if (!rnaWellIsValid[i]) |
4832 |
05 Jun 18 |
olle |
1679 |
{ |
4832 |
05 Jun 18 |
olle |
event.preventDefault(); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
1682 |
} |
4832 |
05 Jun 18 |
olle |
1683 |
} |
4832 |
05 Jun 18 |
olle |
1684 |
} |
4832 |
05 Jun 18 |
olle |
else |
4832 |
05 Jun 18 |
olle |
1686 |
{ |
4832 |
05 Jun 18 |
olle |
// Input DNA, RNA, or DNA + RNA |
4832 |
05 Jun 18 |
olle |
for (var i = 0; i < wellIsValid.length; i++) |
4832 |
05 Jun 18 |
olle |
1689 |
{ |
4832 |
05 Jun 18 |
olle |
if (!wellIsValid[i]) |
4832 |
05 Jun 18 |
olle |
1691 |
{ |
4832 |
05 Jun 18 |
olle |
event.preventDefault(); |
4832 |
05 Jun 18 |
olle |
return; |
4832 |
05 Jun 18 |
olle |
1694 |
} |
4832 |
05 Jun 18 |
olle |
1695 |
} |
4832 |
05 Jun 18 |
olle |
1696 |
} |
4832 |
05 Jun 18 |
olle |
1697 |
} |
4832 |
05 Jun 18 |
olle |
1698 |
|
4832 |
05 Jun 18 |
olle |
persinfo.submit = function() |
4832 |
05 Jun 18 |
olle |
1700 |
{ |
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4832 |
05 Jun 18 |
olle |
var updateMode = caseInfo.id; |
4832 |
05 Jun 18 |
olle |
1703 |
|
4833 |
07 Jun 18 |
olle |
// Check if FFPE referral form should be created |
4833 |
07 Jun 18 |
olle |
var ffpeReferral = frm.ffpeReferralCB.checked; |
4833 |
07 Jun 18 |
olle |
var referralPad = Strings.trim(frm.padPreEntry.value); |
4833 |
07 Jun 18 |
olle |
//alert("baseline_alt_rec.js::submit(): ffpeReferral = " + ffpeReferral + " referralPad = " + referralPad); |
4833 |
07 Jun 18 |
olle |
if (ffpeReferral) |
4833 |
07 Jun 18 |
olle |
1709 |
{ |
4908 |
12 Jul 18 |
olle |
var startItemName = caseInfo.referralId; |
4833 |
07 Jun 18 |
olle |
var nofFormSets = 1; |
4833 |
07 Jun 18 |
olle |
1712 |
|
4833 |
07 Jun 18 |
olle |
var url = '../ReferralGenerator.servlet?ID='+App.getSessionId(); |
4833 |
07 Jun 18 |
olle |
url += '&cmd=GenerateFfpeReferralForm'; |
4908 |
12 Jul 18 |
olle |
url += '&startitemname='+encodeURIComponent(startItemName); |
4833 |
07 Jun 18 |
olle |
url += '&nofformsets='+encodeURIComponent(nofFormSets); |
4833 |
07 Jun 18 |
olle |
url += '&pad='+encodeURIComponent(referralPad); |
4833 |
07 Jun 18 |
olle |
1718 |
|
4833 |
07 Jun 18 |
olle |
Wizard.showLoadingAnimation('Generating FFPE referral form...', 'ref-gen-progress'); |
4833 |
07 Jun 18 |
olle |
Wizard.asyncJsonRequest(url, persinfo.submit2); |
4833 |
07 Jun 18 |
olle |
1721 |
} |
4833 |
07 Jun 18 |
olle |
else |
4833 |
07 Jun 18 |
olle |
1723 |
{ |
4833 |
07 Jun 18 |
olle |
persinfo.submit2(); |
4833 |
07 Jun 18 |
olle |
1725 |
} |
4833 |
07 Jun 18 |
olle |
1726 |
} |
4833 |
07 Jun 18 |
olle |
1727 |
|
4833 |
07 Jun 18 |
olle |
persinfo.submit2 = function() |
4833 |
07 Jun 18 |
olle |
1729 |
{ |
4833 |
07 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4833 |
07 Jun 18 |
olle |
var updateMode = caseInfo.id; |
4833 |
07 Jun 18 |
olle |
1732 |
|
4832 |
05 Jun 18 |
olle |
//caseInfo.plNumber = frm.plNumber.value; |
4832 |
05 Jun 18 |
olle |
//caseInfo.pad = frm.pad.value; |
4832 |
05 Jun 18 |
olle |
caseInfo.bloodSamplingDate = Strings.trim(frm.bloodSamplingDate.value); |
4832 |
05 Jun 18 |
olle |
//caseInfo.tubeContentType = frm.tubeContentType.value; |
4832 |
05 Jun 18 |
olle |
caseInfo.tubeContentType = 'Blood'; |
4832 |
05 Jun 18 |
olle |
1738 |
/* |
4832 |
05 Jun 18 |
olle |
if (!updateMode) |
4832 |
05 Jun 18 |
olle |
1740 |
{ |
4832 |
05 Jun 18 |
olle |
1741 |
*/ |
4832 |
05 Jun 18 |
olle |
caseInfo.bloodArrivalDate = Strings.trim(frm.bloodArrivalDate.value); |
4832 |
05 Jun 18 |
olle |
caseInfo.wholeBlood = frm.wholeBloodCB.checked; |
4965 |
04 Sep 18 |
olle |
1744 |
/* |
4832 |
05 Jun 18 |
olle |
caseInfo.ctDNA = frm.ctDNACB.checked; |
4832 |
05 Jun 18 |
olle |
caseInfo.ctc = frm.ctcCB.checked; |
4965 |
04 Sep 18 |
olle |
1747 |
*/ |
4832 |
05 Jun 18 |
olle |
caseInfo.ffpeReferral = frm.ffpeReferralCB.checked; |
4832 |
05 Jun 18 |
olle |
caseInfo.padPreEntry = Strings.trim(frm.padPreEntry.value); |
4832 |
05 Jun 18 |
olle |
1750 |
/* |
4832 |
05 Jun 18 |
olle |
caseInfo.mutationAnalysisKras = frm.mutationAnalysisKras.checked; |
4832 |
05 Jun 18 |
olle |
caseInfo.mutationAnalysisNras = frm.mutationAnalysisNras.checked; |
4832 |
05 Jun 18 |
olle |
caseInfo.mutationAnalysisBraf = frm.mutationAnalysisBraf.checked; |
4832 |
05 Jun 18 |
olle |
caseInfo.mutationAnalysisEgfr = frm.mutationAnalysisEgfr.checked; |
4832 |
05 Jun 18 |
olle |
caseInfo.mutationAnalysisAlkEml4 = frm.mutationAnalysisAlkEml4.checked; |
4832 |
05 Jun 18 |
olle |
caseInfo.mutationAnalysisPdgfra = frm.mutationAnalysisPdgfra.checked; |
4832 |
05 Jun 18 |
olle |
caseInfo.mutationAnalysisKit = frm.mutationAnalysisKit.checked; |
4832 |
05 Jun 18 |
olle |
1758 |
*/ |
4832 |
05 Jun 18 |
olle |
1759 |
/* |
4832 |
05 Jun 18 |
olle |
caseInfo.mutationAnalysisTst170 = frm.mutationAnalysisTst170.checked; |
4832 |
05 Jun 18 |
olle |
caseInfo.mutationAnalysisOther = frm.mutationAnalysisOther.checked; |
4832 |
05 Jun 18 |
olle |
caseInfo.site = frm.site.value; |
4832 |
05 Jun 18 |
olle |
caseInfo.specimenType = frm.specimenType.value; |
4832 |
05 Jun 18 |
olle |
caseInfo.specimenInputType = frm.specimenInputType.value; |
4832 |
05 Jun 18 |
olle |
caseInfo.projectFocus = frm.projectFocus.value; |
4832 |
05 Jun 18 |
olle |
caseInfo.metastasisSite = frm.metastasisSite.value; |
4832 |
05 Jun 18 |
olle |
caseInfo.viableTumourCellsPercent = frm.viableTumourCellsPercent.value; |
4832 |
05 Jun 18 |
olle |
caseInfo.otherPathNote = frm.otherPathNote.value; |
4832 |
05 Jun 18 |
olle |
caseInfo.extractsFromFirstSpecimenOnly = frm.extractsFromFirstSpecimenOnlyCB.checked; |
4832 |
05 Jun 18 |
olle |
1770 |
*/ |
4832 |
05 Jun 18 |
olle |
1771 |
|
4832 |
05 Jun 18 |
olle |
var nofTubes = parseInt(frm.nofTubes.value); |
4832 |
05 Jun 18 |
olle |
caseInfo.blood = []; |
4832 |
05 Jun 18 |
olle |
for (var i = 0; i < nofTubes; i++) |
4832 |
05 Jun 18 |
olle |
1775 |
{ |
4832 |
05 Jun 18 |
olle |
var bloodTube ={}; |
4832 |
05 Jun 18 |
olle |
bloodTube.name = persinfo.fetchTubeName(caseInfo.tubeContentType, caseInfo, i); |
4832 |
05 Jun 18 |
olle |
1778 |
|
4832 |
05 Jun 18 |
olle |
bloodTube.box = frm['box.'+i].value; |
4832 |
05 Jun 18 |
olle |
bloodTube.row = frm['row.'+i].value; |
4832 |
05 Jun 18 |
olle |
bloodTube.column = frm['column.'+i].value; |
4832 |
05 Jun 18 |
olle |
//alert("baseline_alt_rec.js::submit(): i = " + i + " bloodTube = " + JSON.stringify(bloodTube)); |
4832 |
05 Jun 18 |
olle |
caseInfo.blood[i] = bloodTube; |
4832 |
05 Jun 18 |
olle |
1784 |
} |
4832 |
05 Jun 18 |
olle |
1785 |
/* |
4832 |
05 Jun 18 |
olle |
caseInfo.specimen = []; |
4832 |
05 Jun 18 |
olle |
for (var i = 0; i < nofTubes; i++) |
4832 |
05 Jun 18 |
olle |
1788 |
{ |
4832 |
05 Jun 18 |
olle |
var specimenTube ={}; |
4832 |
05 Jun 18 |
olle |
specimenTube.name = persinfo.fetchTubeName(caseInfo.tubeContentType, caseInfo, i); |
4832 |
05 Jun 18 |
olle |
1791 |
|
4832 |
05 Jun 18 |
olle |
specimenTube.box = frm['box.'+i].value; |
4832 |
05 Jun 18 |
olle |
specimenTube.row = frm['row.'+i].value; |
4832 |
05 Jun 18 |
olle |
specimenTube.column = frm['column.'+i].value; |
4832 |
05 Jun 18 |
olle |
var nofSections = null; |
4832 |
05 Jun 18 |
olle |
if (caseInfo.tubeContentType == 'Specimen') |
4832 |
05 Jun 18 |
olle |
1797 |
{ |
4832 |
05 Jun 18 |
olle |
if (i == 0 || !caseInfo.extractsFromFirstSpecimenOnly) |
4832 |
05 Jun 18 |
olle |
1799 |
{ |
4832 |
05 Jun 18 |
olle |
// Storage position for DNA extract from specimen |
4832 |
05 Jun 18 |
olle |
specimenTube.dnaBox = frm['dnaBox.'+i].value; |
4832 |
05 Jun 18 |
olle |
specimenTube.dnaRow = frm['dnaRow.'+i].value; |
4832 |
05 Jun 18 |
olle |
specimenTube.dnaColumn = frm['dnaColumn.'+i].value; |
4832 |
05 Jun 18 |
olle |
1804 |
|
4832 |
05 Jun 18 |
olle |
// Storage position for RNA extract from specimen |
4832 |
05 Jun 18 |
olle |
specimenTube.rnaBox = frm['rnaBox.'+i].value; |
4832 |
05 Jun 18 |
olle |
specimenTube.rnaRow = frm['rnaRow.'+i].value; |
4832 |
05 Jun 18 |
olle |
specimenTube.rnaColumn = frm['rnaColumn.'+i].value; |
4832 |
05 Jun 18 |
olle |
1809 |
} |
4832 |
05 Jun 18 |
olle |
1810 |
|
4832 |
05 Jun 18 |
olle |
nofSections = frm['nofSections.'+i].value; |
4832 |
05 Jun 18 |
olle |
1812 |
} |
4832 |
05 Jun 18 |
olle |
specimenTube.nofSections = nofSections; |
4832 |
05 Jun 18 |
olle |
specimenTube.comment = frm['comment.'+i].value; |
4832 |
05 Jun 18 |
olle |
specimenTube.specimenType = frm.specimenType.value; |
4832 |
05 Jun 18 |
olle |
specimenTube.specimenInputType = frm.specimenInputType.value; |
4832 |
05 Jun 18 |
olle |
caseInfo.specimen[i] = specimenTube; |
4832 |
05 Jun 18 |
olle |
1818 |
} |
4832 |
05 Jun 18 |
olle |
1819 |
*/ |
4832 |
05 Jun 18 |
olle |
1820 |
/* |
4832 |
05 Jun 18 |
olle |
1821 |
} |
4832 |
05 Jun 18 |
olle |
1822 |
*/ |
4832 |
05 Jun 18 |
olle |
var submitInfo = {}; |
4832 |
05 Jun 18 |
olle |
submitInfo.caseInfo = caseInfo; |
4832 |
05 Jun 18 |
olle |
1825 |
|
4832 |
05 Jun 18 |
olle |
var url = '../BaseLineRegistration.servlet?ID='+App.getSessionId(); |
4832 |
05 Jun 18 |
olle |
url += '&cmd=' + (updateMode ? 'UpdateCase' : 'CreateCase'); |
4832 |
05 Jun 18 |
olle |
Wizard.showLoadingAnimation('Registering case...'); |
4832 |
05 Jun 18 |
olle |
Wizard.asyncJsonRequest(url, persinfo.submissionResults, 'POST', JSON.stringify(submitInfo)); |
4832 |
05 Jun 18 |
olle |
1830 |
} |
4832 |
05 Jun 18 |
olle |
1831 |
|
4832 |
05 Jun 18 |
olle |
persinfo.submissionResults = function(response) |
4832 |
05 Jun 18 |
olle |
1833 |
{ |
4832 |
05 Jun 18 |
olle |
Wizard.showFinalMessage(response.messages); |
4832 |
05 Jun 18 |
olle |
Doc.show('gorestart'); |
4832 |
05 Jun 18 |
olle |
Doc.show('downloadformbatch2'); |
4832 |
05 Jun 18 |
olle |
1837 |
} |
4832 |
05 Jun 18 |
olle |
1838 |
|
4832 |
05 Jun 18 |
olle |
persinfo.downloadFormBatch1 = function() |
4832 |
05 Jun 18 |
olle |
1840 |
{ |
4832 |
05 Jun 18 |
olle |
persinfo.downloadFormBatch(1); |
4832 |
05 Jun 18 |
olle |
1842 |
} |
4832 |
05 Jun 18 |
olle |
1843 |
|
4832 |
05 Jun 18 |
olle |
persinfo.downloadFormBatch2 = function() |
4832 |
05 Jun 18 |
olle |
1845 |
{ |
4832 |
05 Jun 18 |
olle |
persinfo.downloadFormBatch(2); |
4832 |
05 Jun 18 |
olle |
1847 |
} |
4832 |
05 Jun 18 |
olle |
1848 |
|
4832 |
05 Jun 18 |
olle |
persinfo.downloadFormBatch = function(batchType) |
4832 |
05 Jun 18 |
olle |
1850 |
{ |
4832 |
05 Jun 18 |
olle |
var frm = document.forms['meludi']; |
4908 |
12 Jul 18 |
olle |
var startItemName = frm.caseName.value; |
4832 |
05 Jun 18 |
olle |
//var nofFormSets = frm.nofFormSets.value; |
4832 |
05 Jun 18 |
olle |
var nofFormSets = 1; |
4832 |
05 Jun 18 |
olle |
1855 |
|
4832 |
05 Jun 18 |
olle |
var url = '../ReferralGenerator.servlet?ID='+App.getSessionId(); |
4832 |
05 Jun 18 |
olle |
url += '&cmd=DownloadFormBatchFile'; |
4832 |
05 Jun 18 |
olle |
url += '&batchType='+batchType; |
4908 |
12 Jul 18 |
olle |
url += '&startitemname='+encodeURIComponent(startItemName); |
4832 |
05 Jun 18 |
olle |
url += '&nofformsets='+encodeURIComponent(nofFormSets); |
4832 |
05 Jun 18 |
olle |
window.open(url); |
4832 |
05 Jun 18 |
olle |
1862 |
} |
4832 |
05 Jun 18 |
olle |
1863 |
|
4832 |
05 Jun 18 |
olle |
return persinfo; |
4832 |
05 Jun 18 |
olle |
1865 |
}(); |
4832 |
05 Jun 18 |
olle |
1866 |
|
4832 |
05 Jun 18 |
olle |
Doc.onLoad(PersInfo.initPage); |
4832 |
05 Jun 18 |
olle |
1868 |
|