2933 |
14 Nov 14 |
olle |
var PersInfo = function() |
2933 |
14 Nov 14 |
olle |
2 |
{ |
2933 |
14 Nov 14 |
olle |
var persinfo = {}; |
2933 |
14 Nov 14 |
olle |
var debug = 0; |
2933 |
14 Nov 14 |
olle |
5 |
|
2933 |
14 Nov 14 |
olle |
var patientInfo = null; |
2933 |
14 Nov 14 |
olle |
var caseInfo = null; |
2933 |
14 Nov 14 |
olle |
var bloodInfo = null; |
2933 |
14 Nov 14 |
olle |
9 |
|
2933 |
14 Nov 14 |
olle |
var pnrIsValid = false; |
2933 |
14 Nov 14 |
olle |
var pnrIsAcceptable = false; |
2933 |
14 Nov 14 |
olle |
var caseIsValid = false; |
2933 |
14 Nov 14 |
olle |
13 |
|
4155 |
07 Oct 16 |
olle |
var sampleItemPrefix = ''; |
4224 |
09 Nov 16 |
olle |
var sampleItemNumDigits = 5; |
2933 |
14 Nov 14 |
olle |
var nofTubesIsValid = false; |
2933 |
14 Nov 14 |
olle |
var samplingDateIsValid = true; |
3106 |
26 Jan 15 |
olle |
var viableTumourCellsPercentIsValid = true; |
4723 |
29 Mar 18 |
olle |
var usesSitePrefix = false; |
2933 |
14 Nov 14 |
olle |
20 |
|
3276 |
29 Apr 15 |
olle |
// Well validation variable for input specimen, DNA, RNA |
2933 |
14 Nov 14 |
olle |
var wellIsValid = []; |
3276 |
29 Apr 15 |
olle |
// Well validation variables for extracts from specimen |
3276 |
29 Apr 15 |
olle |
var dnaWellIsValid = []; |
3276 |
29 Apr 15 |
olle |
var rnaWellIsValid = []; |
2933 |
14 Nov 14 |
olle |
26 |
|
2933 |
14 Nov 14 |
olle |
persinfo.initPage = function() |
2933 |
14 Nov 14 |
olle |
28 |
{ |
2933 |
14 Nov 14 |
olle |
29 |
|
2933 |
14 Nov 14 |
olle |
// Step 1 |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('step-1', 'wizard-validate', persinfo.validateStep1); |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('caseName', 'keypress', Wizard.focusOnEnter); |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('caseName', 'blur', persinfo.caseNameOnChange); |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('personalNumber', 'keyup', persinfo.personalNumberOnChange); |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('personalNumber', 'keypress', Wizard.goNextOnTabOrEnter); |
2933 |
14 Nov 14 |
olle |
36 |
|
2933 |
14 Nov 14 |
olle |
// Step 2 |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('step-2', 'wizard-initialize', persinfo.initializeStep2); |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('step-2', 'wizard-validate', persinfo.validateStep2); |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('familyName', 'blur', persinfo.nameOnChange); |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('allFirstNames', 'blur', persinfo.nameOnChange); |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('allFirstNames', 'keypress', Wizard.goNextOnTabOrEnter); |
2933 |
14 Nov 14 |
olle |
43 |
|
2933 |
14 Nov 14 |
olle |
// Step 3 |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('step-3', 'wizard-initialize', persinfo.initializeStep3); |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('step-3', 'wizard-validate', persinfo.validateStep3); |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('plNumber', 'blur', persinfo.plNumberOnChange); |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('pad', 'blur', persinfo.padOnChange); |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('nofTubes', 'keypress', Events.integerOnly); |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('nofTubes', 'blur', persinfo.nofTubesOnChange); |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('arrivalDate', 'blur', Wizard.validateDate); |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('samplingDate', 'blur', persinfo.samplingDateOnChange); |
3232 |
08 Apr 15 |
olle |
Events.addEventHandler('projectFocus', 'change', persinfo.projectFocusOnChange); |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('site', 'change', persinfo.siteOnChange); |
3028 |
11 Dec 14 |
olle |
Events.addEventHandler('specimenType', 'change', persinfo.specimenTypeOnChange); |
3067 |
08 Jan 15 |
olle |
Events.addEventHandler('viableTumourCellsPercent', 'keypress', Events.integerOnly); |
3067 |
08 Jan 15 |
olle |
Events.addEventHandler('viableTumourCellsPercent', 'blur', persinfo.viableTumourCellsPercentOnChange); |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('otherPathNote', 'keypress', Wizard.goNextOnTab); |
3249 |
14 Apr 15 |
olle |
Buttons.addClickHandler('selectAllMutationAnalysis', persinfo.mutationAnalysisSelectAll); |
2933 |
14 Nov 14 |
olle |
60 |
|
2933 |
14 Nov 14 |
olle |
// Step 4 |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('step-4', 'wizard-initialize', persinfo.initializeStep4); |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('step-5', 'wizard-validate', persinfo.validateStep4); |
2933 |
14 Nov 14 |
olle |
64 |
|
2933 |
14 Nov 14 |
olle |
// Navigation |
2933 |
14 Nov 14 |
olle |
Buttons.addClickHandler('gocancel', Wizard.cancelWizard); |
2933 |
14 Nov 14 |
olle |
Buttons.addClickHandler('gorestart', Wizard.restartWizard); |
2933 |
14 Nov 14 |
olle |
Buttons.addClickHandler('gonext', Wizard.goNextOnClick); |
2933 |
14 Nov 14 |
olle |
Buttons.addClickHandler('goregister', Wizard.goRegister); |
2933 |
14 Nov 14 |
olle |
Buttons.addClickHandler('goupdate', Wizard.goRegister); |
2933 |
14 Nov 14 |
olle |
71 |
|
2933 |
14 Nov 14 |
olle |
// Final registration |
2933 |
14 Nov 14 |
olle |
Events.addEventHandler('wizard', 'wizard-submit', persinfo.submit); |
2933 |
14 Nov 14 |
olle |
74 |
|
4161 |
18 Oct 16 |
olle |
// Load configuration |
4161 |
18 Oct 16 |
olle |
persinfo.loadConfiguration(); |
4161 |
18 Oct 16 |
olle |
77 |
} |
4161 |
18 Oct 16 |
olle |
78 |
|
4161 |
18 Oct 16 |
olle |
persinfo.loadConfiguration = function() |
4161 |
18 Oct 16 |
olle |
80 |
{ |
4161 |
18 Oct 16 |
olle |
var url = '../Session.servlet?ID='+App.getSessionId(); |
4161 |
18 Oct 16 |
olle |
url += '&cmd=GetConfiguration' |
4161 |
18 Oct 16 |
olle |
var request = Ajax.getXmlHttpRequest(); |
4161 |
18 Oct 16 |
olle |
request.open("GET", url, true); |
4161 |
18 Oct 16 |
olle |
Ajax.setReadyStateHandler(request, persinfo.onConfiguration, persinfo.onConfiguration); |
4161 |
18 Oct 16 |
olle |
request.send(null); |
4161 |
18 Oct 16 |
olle |
87 |
} |
4161 |
18 Oct 16 |
olle |
88 |
|
4161 |
18 Oct 16 |
olle |
persinfo.onConfiguration = function(request) |
4161 |
18 Oct 16 |
olle |
90 |
{ |
4161 |
18 Oct 16 |
olle |
var frm = document.forms['meludi']; |
4161 |
18 Oct 16 |
olle |
92 |
|
4161 |
18 Oct 16 |
olle |
if (debug) |
4161 |
18 Oct 16 |
olle |
94 |
{ |
4161 |
18 Oct 16 |
olle |
App.debug(Strings.encodeTags(request.responseText)); |
4161 |
18 Oct 16 |
olle |
96 |
} |
4161 |
18 Oct 16 |
olle |
97 |
|
4161 |
18 Oct 16 |
olle |
var response; |
4161 |
18 Oct 16 |
olle |
var error = false; |
4161 |
18 Oct 16 |
olle |
try |
4161 |
18 Oct 16 |
olle |
101 |
{ |
4161 |
18 Oct 16 |
olle |
response = JSON.parse(request.responseText); |
4161 |
18 Oct 16 |
olle |
if (response.status != 'ok') |
4161 |
18 Oct 16 |
olle |
104 |
{ |
4161 |
18 Oct 16 |
olle |
error = response.message || response.stacktrace || 'Unexpected error'; |
4161 |
18 Oct 16 |
olle |
106 |
} |
4161 |
18 Oct 16 |
olle |
107 |
} |
4161 |
18 Oct 16 |
olle |
catch (ex) |
4161 |
18 Oct 16 |
olle |
109 |
{ |
4161 |
18 Oct 16 |
olle |
error = ex; |
4161 |
18 Oct 16 |
olle |
111 |
} |
4161 |
18 Oct 16 |
olle |
if (error) App.debug(error); |
4161 |
18 Oct 16 |
olle |
113 |
|
4161 |
18 Oct 16 |
olle |
// Get configuration result |
4161 |
18 Oct 16 |
olle |
var conf = response.configuration; |
4723 |
29 Mar 18 |
olle |
// Check for uses site prefix flag |
4723 |
29 Mar 18 |
olle |
usesSitePrefix = conf.usesSitePrefix; |
4161 |
18 Oct 16 |
olle |
// Check for project focus default |
4161 |
18 Oct 16 |
olle |
var projectFocusDefault = conf.projectFocusDefault; |
4161 |
18 Oct 16 |
olle |
if (projectFocusDefault != null) |
4161 |
18 Oct 16 |
olle |
121 |
{ |
4161 |
18 Oct 16 |
olle |
frm.projectFocus.value = projectFocusDefault; |
4161 |
18 Oct 16 |
olle |
persinfo.projectFocusOnChange(); |
4161 |
18 Oct 16 |
olle |
124 |
} |
4195 |
31 Oct 16 |
olle |
// Check for specimen type default |
4161 |
18 Oct 16 |
olle |
var specimenTypeDefault = conf.specimenTypeDefault; |
4161 |
18 Oct 16 |
olle |
if (specimenTypeDefault != null) |
4161 |
18 Oct 16 |
olle |
128 |
{ |
4161 |
18 Oct 16 |
olle |
frm.specimenType.value = specimenTypeDefault; |
4161 |
18 Oct 16 |
olle |
130 |
} |
4195 |
31 Oct 16 |
olle |
// Check for specimen input type default |
4195 |
31 Oct 16 |
olle |
var specimenInputTypeDefault = conf.specimenInputTypeDefault; |
4195 |
31 Oct 16 |
olle |
if (specimenInputTypeDefault != null) |
4195 |
31 Oct 16 |
olle |
134 |
{ |
4195 |
31 Oct 16 |
olle |
frm.specimenInputType.value = specimenInputTypeDefault; |
4195 |
31 Oct 16 |
olle |
136 |
} |
4248 |
22 Nov 16 |
olle |
// Check for extracts from first specimen only default |
4248 |
22 Nov 16 |
olle |
var extractsFromFirstSpecimenOnlyDefault = conf.extractsFromFirstSpecimenOnlyDefault; |
4248 |
22 Nov 16 |
olle |
if (extractsFromFirstSpecimenOnlyDefault != null) |
4248 |
22 Nov 16 |
olle |
140 |
{ |
4248 |
22 Nov 16 |
olle |
frm.extractsFromFirstSpecimenOnlyCB.checked = extractsFromFirstSpecimenOnlyDefault; |
4248 |
22 Nov 16 |
olle |
142 |
} |
4161 |
18 Oct 16 |
olle |
143 |
|
4161 |
18 Oct 16 |
olle |
// Continue with initializing info for case |
3148 |
26 Feb 15 |
olle |
var url = '../LabelGeneration.servlet?ID='+App.getSessionId(); |
3148 |
26 Feb 15 |
olle |
url += '&cmd=CountCases'; |
3148 |
26 Feb 15 |
olle |
Wizard.showLoadingAnimation('Loading cases...'); |
3148 |
26 Feb 15 |
olle |
Wizard.asyncJsonRequest(url, persinfo.caseInfoLoadedStep1); |
3148 |
26 Feb 15 |
olle |
149 |
} |
3148 |
26 Feb 15 |
olle |
150 |
|
3148 |
26 Feb 15 |
olle |
persinfo.caseInfoLoadedStep1 = function(response) |
3148 |
26 Feb 15 |
olle |
152 |
{ |
3148 |
26 Feb 15 |
olle |
var frm = document.forms['meludi']; |
3148 |
26 Feb 15 |
olle |
154 |
|
4155 |
07 Oct 16 |
olle |
sampleItemPrefix = response.sampleItemPrefix; |
4224 |
09 Nov 16 |
olle |
sampleItemNumDigits = response.sampleItemNumDigits; |
3148 |
26 Feb 15 |
olle |
var nofCases = response.count; |
3148 |
26 Feb 15 |
olle |
if (nofCases == null) |
3148 |
26 Feb 15 |
olle |
159 |
{ |
3148 |
26 Feb 15 |
olle |
nofCases = 0; |
3148 |
26 Feb 15 |
olle |
161 |
} |
3148 |
26 Feb 15 |
olle |
var startNum = nofCases + 1; |
4224 |
09 Nov 16 |
olle |
// Pad number with leading zeros to get right number of digits |
4224 |
09 Nov 16 |
olle |
startNum = String('0000000000' + startNum).slice(-sampleItemNumDigits); |
4155 |
07 Oct 16 |
olle |
var startCase = sampleItemPrefix + startNum; |
4723 |
29 Mar 18 |
olle |
if (usesSitePrefix != null && usesSitePrefix) |
4723 |
29 Mar 18 |
olle |
167 |
{ |
4723 |
29 Mar 18 |
olle |
startCase = ''; |
4723 |
29 Mar 18 |
olle |
169 |
} |
3148 |
26 Feb 15 |
olle |
frm.caseName.value = startCase; |
3148 |
26 Feb 15 |
olle |
171 |
|
2933 |
14 Nov 14 |
olle |
Doc.show('step-1'); |
2933 |
14 Nov 14 |
olle |
Doc.show('gonext'); |
3156 |
03 Mar 15 |
olle |
174 |
|
3156 |
03 Mar 15 |
olle |
// Ensure that flag 'caseIsValid' is set to 'true' or error reported |
3156 |
03 Mar 15 |
olle |
persinfo.caseNameOnChange(); |
2933 |
14 Nov 14 |
olle |
177 |
} |
2933 |
14 Nov 14 |
olle |
178 |
|
2933 |
14 Nov 14 |
olle |
persinfo.caseNameOnChange = function() |
2933 |
14 Nov 14 |
olle |
180 |
{ |
2933 |
14 Nov 14 |
olle |
var frm = document.forms['meludi']; |
2933 |
14 Nov 14 |
olle |
var caseName = frm.caseName.value.toUpperCase(); |
2933 |
14 Nov 14 |
olle |
caseIsValid = false; |
2933 |
14 Nov 14 |
olle |
if (caseName == '') |
2933 |
14 Nov 14 |
olle |
185 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('caseName', 'invalid', 'Missing'); |
2933 |
14 Nov 14 |
olle |
frm.caseName.focus(); |
2933 |
14 Nov 14 |
olle |
return; |
2933 |
14 Nov 14 |
olle |
189 |
} |
4224 |
09 Nov 16 |
olle |
if (!Meludi.isValidCaseName2(caseName, sampleItemPrefix, sampleItemNumDigits)) |
2933 |
14 Nov 14 |
olle |
191 |
{ |
4224 |
09 Nov 16 |
olle |
Wizard.setInputStatus('caseName', 'invalid', 'Only "' + sampleItemPrefix + '" + ' + sampleItemNumDigits + ' digits is allowed.'); |
2933 |
14 Nov 14 |
olle |
frm.caseName.focus(); |
2933 |
14 Nov 14 |
olle |
return; |
2933 |
14 Nov 14 |
olle |
195 |
} |
2933 |
14 Nov 14 |
olle |
196 |
|
2933 |
14 Nov 14 |
olle |
frm.caseName.value = caseName; |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('caseName', 'valid'); |
2933 |
14 Nov 14 |
olle |
caseIsValid = true; |
2933 |
14 Nov 14 |
olle |
200 |
|
2933 |
14 Nov 14 |
olle |
var url = '../PersonalRegistration.servlet?ID='+App.getSessionId(); |
2933 |
14 Nov 14 |
olle |
url += '&cmd=GetCaseInfo&caseName=' + encodeURIComponent(caseName); |
2933 |
14 Nov 14 |
olle |
Wizard.showLoadingAnimation('Loading information about case...'); |
2933 |
14 Nov 14 |
olle |
Wizard.asyncJsonRequest(url, persinfo.onCaseInfoLoaded); |
2933 |
14 Nov 14 |
olle |
205 |
} |
2933 |
14 Nov 14 |
olle |
206 |
|
2933 |
14 Nov 14 |
olle |
persinfo.onCaseInfoLoaded = function(response) |
2933 |
14 Nov 14 |
olle |
208 |
{ |
2933 |
14 Nov 14 |
olle |
var frm = document.forms['meludi']; |
2933 |
14 Nov 14 |
olle |
210 |
|
2933 |
14 Nov 14 |
olle |
// Get biosource information from the AJAX response |
2933 |
14 Nov 14 |
olle |
caseInfo = response.caseInfo; |
2933 |
14 Nov 14 |
olle |
213 |
|
4723 |
29 Mar 18 |
olle |
// If site determined by site prefix in case name, set site default value and disable site menu |
4723 |
29 Mar 18 |
olle |
//alert("persinfo.js:: persinfo.caseInfoLoaded: caseInfo.siteDefault = " + caseInfo.siteDefault); |
4723 |
29 Mar 18 |
olle |
if (caseInfo.siteDefault != null) |
4723 |
29 Mar 18 |
olle |
217 |
{ |
4723 |
29 Mar 18 |
olle |
frm.site.value = caseInfo.siteDefault; |
4723 |
29 Mar 18 |
olle |
frm.site.disabled = true; |
4723 |
29 Mar 18 |
olle |
220 |
} |
4723 |
29 Mar 18 |
olle |
221 |
|
2933 |
14 Nov 14 |
olle |
if (caseInfo && caseInfo.patient) |
2933 |
14 Nov 14 |
olle |
223 |
{ |
2933 |
14 Nov 14 |
olle |
frm.personalNumber.value = caseInfo.patient.personalNumber; |
2933 |
14 Nov 14 |
olle |
persinfo.personalNumberOnChange(); |
2933 |
14 Nov 14 |
olle |
Wizard.goNext(false); |
2933 |
14 Nov 14 |
olle |
227 |
} |
2933 |
14 Nov 14 |
olle |
228 |
} |
2933 |
14 Nov 14 |
olle |
229 |
|
2933 |
14 Nov 14 |
olle |
persinfo.personalNumberOnChange = function() |
2933 |
14 Nov 14 |
olle |
231 |
{ |
2933 |
14 Nov 14 |
olle |
var frm = document.forms['meludi']; |
2933 |
14 Nov 14 |
olle |
var pnr = frm.personalNumber.value; |
2933 |
14 Nov 14 |
olle |
pnrIsValid = false; |
2933 |
14 Nov 14 |
olle |
pnrIsAcceptable = true; |
2933 |
14 Nov 14 |
olle |
236 |
|
2933 |
14 Nov 14 |
olle |
var pnrLen = pnr.length; |
2933 |
14 Nov 14 |
olle |
if (pnrLen != 12 && pnrLen != 10) |
2933 |
14 Nov 14 |
olle |
239 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('personalNumber', 'warning', pnrLen < 12 ? 'Too short' : 'Too long'); |
2933 |
14 Nov 14 |
olle |
return; |
2933 |
14 Nov 14 |
olle |
242 |
} |
2933 |
14 Nov 14 |
olle |
243 |
|
2933 |
14 Nov 14 |
olle |
if (!pnr.match(/^\d+$/)) |
2933 |
14 Nov 14 |
olle |
245 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('personalNumber', 'warning', 'Non-standard personal number'); |
2933 |
14 Nov 14 |
olle |
return; |
2933 |
14 Nov 14 |
olle |
248 |
} |
2933 |
14 Nov 14 |
olle |
249 |
|
2933 |
14 Nov 14 |
olle |
var datePart = pnr.substring(0, pnrLen - 4); // Remove last four digits |
2933 |
14 Nov 14 |
olle |
var dateFormat = pnrLen == 10 ? 'yyMMdd' : 'yyyyMMdd'; |
2933 |
14 Nov 14 |
olle |
var isValidDate = Dates.isDate(datePart, dateFormat); |
2933 |
14 Nov 14 |
olle |
if (!isValidDate) |
2933 |
14 Nov 14 |
olle |
254 |
{ |
2933 |
14 Nov 14 |
olle |
var dayInMonth = parseInt(datePart.substring(-2), 10); // Last two characters |
2933 |
14 Nov 14 |
olle |
if (dayInMonth > 60) |
2933 |
14 Nov 14 |
olle |
257 |
{ |
2933 |
14 Nov 14 |
olle |
// 'Samordningsnummer' has day-in-month + 60; check this |
2933 |
14 Nov 14 |
olle |
dayInMonth -= 60; |
2933 |
14 Nov 14 |
olle |
var tmpPnr = pnr.substring(0, pnrLen - 6); // First 4 or 6 digits is year+month |
2933 |
14 Nov 14 |
olle |
if (dayInMonth < 10) tmpPnr += '0'; |
2933 |
14 Nov 14 |
olle |
tmpPnr += dayInMonth; |
2933 |
14 Nov 14 |
olle |
isValidDate = Dates.isDate(tmpPnr, dateFormat); |
2933 |
14 Nov 14 |
olle |
264 |
} |
2933 |
14 Nov 14 |
olle |
265 |
} |
2933 |
14 Nov 14 |
olle |
if (!isValidDate) |
2933 |
14 Nov 14 |
olle |
267 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('personalNumber', 'warning', 'Not a valid date'); |
2933 |
14 Nov 14 |
olle |
return; |
2933 |
14 Nov 14 |
olle |
270 |
} |
2933 |
14 Nov 14 |
olle |
271 |
|
2933 |
14 Nov 14 |
olle |
if (!Meludi.personalNumberControlDigitCheck(pnr.substr(pnrLen == 10 ? 0 : 2))) |
2933 |
14 Nov 14 |
olle |
273 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('personalNumber', 'warning', 'Invalid control digit'); |
2933 |
14 Nov 14 |
olle |
return; |
2933 |
14 Nov 14 |
olle |
276 |
} |
2933 |
14 Nov 14 |
olle |
277 |
|
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('personalNumber', 'valid'); |
2933 |
14 Nov 14 |
olle |
pnrIsValid = true; |
2933 |
14 Nov 14 |
olle |
Wizard.hideGoNextConfirmation(); |
2933 |
14 Nov 14 |
olle |
281 |
} |
2933 |
14 Nov 14 |
olle |
282 |
|
2933 |
14 Nov 14 |
olle |
persinfo.validateStep1 = function(event) |
2933 |
14 Nov 14 |
olle |
284 |
{ |
2933 |
14 Nov 14 |
olle |
if (event.detail.auto) |
2933 |
14 Nov 14 |
olle |
286 |
{ |
2933 |
14 Nov 14 |
olle |
if (!caseIsValid || !pnrIsValid) |
2933 |
14 Nov 14 |
olle |
288 |
{ |
2933 |
14 Nov 14 |
olle |
if (pnrIsAcceptable) |
2933 |
14 Nov 14 |
olle |
290 |
{ |
2933 |
14 Nov 14 |
olle |
var frm = document.forms['meludi']; |
2933 |
14 Nov 14 |
olle |
frm.personalNumber.focus(); |
2933 |
14 Nov 14 |
olle |
Wizard.showGoNextConfirmation(true, 'Check to verify registration of non-standard personal number.'); |
2933 |
14 Nov 14 |
olle |
294 |
} |
2933 |
14 Nov 14 |
olle |
event.preventDefault(); |
2933 |
14 Nov 14 |
olle |
296 |
} |
2933 |
14 Nov 14 |
olle |
297 |
} |
2933 |
14 Nov 14 |
olle |
else |
2933 |
14 Nov 14 |
olle |
299 |
{ |
2933 |
14 Nov 14 |
olle |
if (!caseIsValid || !pnrIsAcceptable) event.preventDefault(); |
2933 |
14 Nov 14 |
olle |
301 |
} |
2933 |
14 Nov 14 |
olle |
302 |
} |
2933 |
14 Nov 14 |
olle |
303 |
|
2933 |
14 Nov 14 |
olle |
persinfo.initializeStep2 = function(event) |
2933 |
14 Nov 14 |
olle |
305 |
{ |
2933 |
14 Nov 14 |
olle |
var frm = document.forms['meludi']; |
2933 |
14 Nov 14 |
olle |
var pnr = frm.personalNumber.value; |
2933 |
14 Nov 14 |
olle |
if (pnr.length == 10 && pnrIsValid) |
2933 |
14 Nov 14 |
olle |
309 |
{ |
2933 |
14 Nov 14 |
olle |
var year = Meludi.fullYear(parseInt(pnr.substr(0, 2), 10)); |
2933 |
14 Nov 14 |
olle |
pnr = year + pnr.substr(2); |
2933 |
14 Nov 14 |
olle |
312 |
} |
2933 |
14 Nov 14 |
olle |
313 |
|
2933 |
14 Nov 14 |
olle |
var url = '../PersonalRegistration.servlet?ID='+App.getSessionId(); |
2933 |
14 Nov 14 |
olle |
url += '&cmd=GetPatientInfo'; |
2933 |
14 Nov 14 |
olle |
url += '&personalNumber=' + encodeURIComponent(pnr); |
2933 |
14 Nov 14 |
olle |
url += '&pnrIsValid=' + pnrIsValid; |
2933 |
14 Nov 14 |
olle |
318 |
|
2933 |
14 Nov 14 |
olle |
Wizard.showLoadingAnimation('Loading patient information...'); |
2933 |
14 Nov 14 |
olle |
Wizard.asyncJsonRequest(url, persinfo.patientInfoLoaded); |
2933 |
14 Nov 14 |
olle |
321 |
} |
2933 |
14 Nov 14 |
olle |
322 |
|
2933 |
14 Nov 14 |
olle |
323 |
|
2933 |
14 Nov 14 |
olle |
persinfo.patientInfoLoaded = function(response) |
2933 |
14 Nov 14 |
olle |
325 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setCurrentStep(2); |
2933 |
14 Nov 14 |
olle |
// Get patient information from the AJAX response |
2933 |
14 Nov 14 |
olle |
patientInfo = response.patientInfo; |
2933 |
14 Nov 14 |
olle |
var frm = document.forms['meludi']; |
2933 |
14 Nov 14 |
olle |
330 |
|
2933 |
14 Nov 14 |
olle |
331 |
|
2933 |
14 Nov 14 |
olle |
frm.patientCode.value=patientInfo.name; |
2933 |
14 Nov 14 |
olle |
frm.familyName.value = patientInfo.familyName || ''; |
2933 |
14 Nov 14 |
olle |
frm.allFirstNames.value = patientInfo.allFirstNames || ''; |
2933 |
14 Nov 14 |
olle |
Doc.element('dateOfBirth').innerHTML = patientInfo.dateOfBirth ? Strings.encodeTags(patientInfo.dateOfBirth) : '---'; |
2933 |
14 Nov 14 |
olle |
Doc.element('gender').innerHTML = patientInfo.gender ? Strings.encodeTags(patientInfo.gender) : '---'; |
2933 |
14 Nov 14 |
olle |
frm.familyName.focus(); |
2933 |
14 Nov 14 |
olle |
338 |
|
2933 |
14 Nov 14 |
olle |
if (!patientInfo.id) |
2933 |
14 Nov 14 |
olle |
340 |
{ |
2933 |
14 Nov 14 |
olle |
if (!pnrIsValid) |
2933 |
14 Nov 14 |
olle |
342 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('gender', 'warning', 'Gender and DateOfBirth can\'t be automatically generated for non-standard Personal number'); |
2933 |
14 Nov 14 |
olle |
344 |
} |
2933 |
14 Nov 14 |
olle |
345 |
} |
2933 |
14 Nov 14 |
olle |
else |
2933 |
14 Nov 14 |
olle |
347 |
{ |
2933 |
14 Nov 14 |
olle |
Doc.element('step-2-title').innerHTML = 'Existing patient: Verify names'; |
2933 |
14 Nov 14 |
olle |
frm.patientCode.disabled = true; |
2933 |
14 Nov 14 |
olle |
350 |
} |
2933 |
14 Nov 14 |
olle |
351 |
|
2933 |
14 Nov 14 |
olle |
Doc.show('gonext'); |
2933 |
14 Nov 14 |
olle |
Doc.show('gocancel'); |
2933 |
14 Nov 14 |
olle |
354 |
|
2933 |
14 Nov 14 |
olle |
355 |
} |
2933 |
14 Nov 14 |
olle |
356 |
|
2933 |
14 Nov 14 |
olle |
persinfo.nameOnChange = function(event) |
2933 |
14 Nov 14 |
olle |
358 |
{ |
2933 |
14 Nov 14 |
olle |
var field = event.target; |
2933 |
14 Nov 14 |
olle |
patientInfo[field.name] = field.value; |
2933 |
14 Nov 14 |
olle |
if (field.value == '') |
2933 |
14 Nov 14 |
olle |
362 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus(field, 'warning', 'Missing'); |
2933 |
14 Nov 14 |
olle |
364 |
} |
2933 |
14 Nov 14 |
olle |
else |
2933 |
14 Nov 14 |
olle |
366 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus(field, 'valid'); |
2933 |
14 Nov 14 |
olle |
Wizard.hideGoNextConfirmation(); |
2933 |
14 Nov 14 |
olle |
369 |
} |
2933 |
14 Nov 14 |
olle |
370 |
} |
2933 |
14 Nov 14 |
olle |
371 |
|
2933 |
14 Nov 14 |
olle |
persinfo.validateStep2 = function(event) |
2933 |
14 Nov 14 |
olle |
373 |
{ |
2933 |
14 Nov 14 |
olle |
var valid = true; |
2933 |
14 Nov 14 |
olle |
var acceptable = true; |
2933 |
14 Nov 14 |
olle |
var frm = document.forms['meludi']; |
2933 |
14 Nov 14 |
olle |
377 |
|
2933 |
14 Nov 14 |
olle |
if (frm.allFirstNames.value == '') |
2933 |
14 Nov 14 |
olle |
379 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('allFirstNames', 'warning', 'Missing'); |
2933 |
14 Nov 14 |
olle |
valid = false; |
2933 |
14 Nov 14 |
olle |
382 |
} |
2933 |
14 Nov 14 |
olle |
else |
2933 |
14 Nov 14 |
olle |
384 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('allFirstNames', 'valid'); |
2933 |
14 Nov 14 |
olle |
386 |
} |
2933 |
14 Nov 14 |
olle |
387 |
|
2933 |
14 Nov 14 |
olle |
if (frm.familyName.value == '') |
2933 |
14 Nov 14 |
olle |
389 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('familyName', 'warning', 'Missing'); |
2933 |
14 Nov 14 |
olle |
valid = false; |
2933 |
14 Nov 14 |
olle |
392 |
} |
2933 |
14 Nov 14 |
olle |
else |
2933 |
14 Nov 14 |
olle |
394 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('familyName', 'valid'); |
2933 |
14 Nov 14 |
olle |
396 |
} |
2933 |
14 Nov 14 |
olle |
397 |
|
2933 |
14 Nov 14 |
olle |
// New patient only |
2933 |
14 Nov 14 |
olle |
if (!patientInfo.id) |
2933 |
14 Nov 14 |
olle |
400 |
{ |
2933 |
14 Nov 14 |
olle |
if (frm.patientCode.value == '') |
2933 |
14 Nov 14 |
olle |
402 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('patientCode', 'invalid', 'Missing'); |
2933 |
14 Nov 14 |
olle |
frm.patientCode.focus(); |
2933 |
14 Nov 14 |
olle |
valid = false; |
2933 |
14 Nov 14 |
olle |
acceptable = false; |
2933 |
14 Nov 14 |
olle |
407 |
} |
2933 |
14 Nov 14 |
olle |
else |
2933 |
14 Nov 14 |
olle |
409 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('patientCode', 'valid'); |
2933 |
14 Nov 14 |
olle |
patientInfo.name = frm.patientCode.value; |
2933 |
14 Nov 14 |
olle |
412 |
} |
2933 |
14 Nov 14 |
olle |
413 |
} |
2933 |
14 Nov 14 |
olle |
414 |
|
2933 |
14 Nov 14 |
olle |
if (event.detail.auto) |
2933 |
14 Nov 14 |
olle |
416 |
{ |
2933 |
14 Nov 14 |
olle |
if (!valid) |
2933 |
14 Nov 14 |
olle |
418 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.showGoNextConfirmation(true, 'Check to verify registration with missing name(s).'); |
2933 |
14 Nov 14 |
olle |
event.preventDefault(); |
2933 |
14 Nov 14 |
olle |
421 |
} |
2933 |
14 Nov 14 |
olle |
422 |
} |
2933 |
14 Nov 14 |
olle |
else |
2933 |
14 Nov 14 |
olle |
424 |
{ |
2933 |
14 Nov 14 |
olle |
if (!acceptable) event.preventDefault(); |
2933 |
14 Nov 14 |
olle |
426 |
} |
2933 |
14 Nov 14 |
olle |
427 |
|
2933 |
14 Nov 14 |
olle |
428 |
} |
2933 |
14 Nov 14 |
olle |
429 |
|
2933 |
14 Nov 14 |
olle |
persinfo.initializeStep3 = function() |
2933 |
14 Nov 14 |
olle |
431 |
{ |
2933 |
14 Nov 14 |
olle |
// Check entered case and pnr with AJAX |
2933 |
14 Nov 14 |
olle |
var frm = document.forms['meludi']; |
2933 |
14 Nov 14 |
olle |
var updateMode = caseInfo.id && caseInfo.patient; |
2933 |
14 Nov 14 |
olle |
435 |
|
2933 |
14 Nov 14 |
olle |
// Generate list of specimen tubes |
2933 |
14 Nov 14 |
olle |
var hasUnknownSpecimen = false; |
2933 |
14 Nov 14 |
olle |
var hasSpecimen = caseInfo.specimen && caseInfo.specimen.length > 0; |
3028 |
11 Dec 14 |
olle |
var hasDna = caseInfo.dna && caseInfo.dna.length > 0; |
3028 |
11 Dec 14 |
olle |
var hasRna = caseInfo.rna && caseInfo.rna.length > 0; |
2933 |
14 Nov 14 |
olle |
var thisCasePlNumber = null; |
2933 |
14 Nov 14 |
olle |
var hasPlNumber = false; |
2933 |
14 Nov 14 |
olle |
var thisCasePAD = null; |
2933 |
14 Nov 14 |
olle |
var hasPAD = false; |
2933 |
14 Nov 14 |
olle |
var thisCaseSamplingDate = null; |
3028 |
11 Dec 14 |
olle |
var thisCaseExtractionDate = null; |
3028 |
11 Dec 14 |
olle |
var thisCaseTubeContentType = caseInfo.tubeContentType; |
3028 |
11 Dec 14 |
olle |
var thisCaseSpecimenType = null; |
4195 |
31 Oct 16 |
olle |
var thisCaseSpecimenInputType = null; |
3067 |
08 Jan 15 |
olle |
var thisCaseViableTumourCellsPercent = null; |
3028 |
11 Dec 14 |
olle |
451 |
|
2933 |
14 Nov 14 |
olle |
if (hasSpecimen) |
2933 |
14 Nov 14 |
olle |
453 |
{ |
2933 |
14 Nov 14 |
olle |
var specimenTubes = ''; |
2933 |
14 Nov 14 |
olle |
for (var i = 0; i < caseInfo.specimen.length; i++) |
2933 |
14 Nov 14 |
olle |
456 |
{ |
2933 |
14 Nov 14 |
olle |
var specimen = caseInfo.specimen[i]; |
2933 |
14 Nov 14 |
olle |
specimenTubes += Strings.encodeTags(specimen.name); |
2933 |
14 Nov 14 |
olle |
if (specimen.plNumber && !hasPlNumber) |
2933 |
14 Nov 14 |
olle |
460 |
{ |
2933 |
14 Nov 14 |
olle |
hasPlNumber = true; |
2933 |
14 Nov 14 |
olle |
thisCasePlNumber = specimen.plNumber; |
2933 |
14 Nov 14 |
olle |
463 |
} |
2933 |
14 Nov 14 |
olle |
if (specimen.pad && !hasPAD) |
2933 |
14 Nov 14 |
olle |
465 |
{ |
2933 |
14 Nov 14 |
olle |
hasPAD = true; |
2933 |
14 Nov 14 |
olle |
thisCasePAD = specimen.pad; |
2933 |
14 Nov 14 |
olle |
468 |
} |
2933 |
14 Nov 14 |
olle |
if (specimen.samplingDate && !thisCaseSamplingDate) |
2933 |
14 Nov 14 |
olle |
470 |
{ |
2933 |
14 Nov 14 |
olle |
thisCaseSamplingDate = specimen.samplingDate; |
2933 |
14 Nov 14 |
olle |
472 |
} |
3028 |
11 Dec 14 |
olle |
if (specimen.specimenType && !thisCaseSpecimenType) |
3028 |
11 Dec 14 |
olle |
474 |
{ |
3028 |
11 Dec 14 |
olle |
thisCaseSpecimenType = specimen.specimenType; |
3028 |
11 Dec 14 |
olle |
476 |
} |
4195 |
31 Oct 16 |
olle |
if (specimen.specimenInputType && !thisCaseSpecimenInputType) |
4195 |
31 Oct 16 |
olle |
478 |
{ |
4195 |
31 Oct 16 |
olle |
thisCaseSpecimenInputType = specimen.specimenInputType; |
4195 |
31 Oct 16 |
olle |
480 |
} |
3067 |
08 Jan 15 |
olle |
if (specimen.viableTumourCellsPercent && !thisCaseViableTumourCellsPercent) |
3067 |
08 Jan 15 |
olle |
482 |
{ |
3067 |
08 Jan 15 |
olle |
thisCaseViableTumourCellsPercent = specimen.viableTumourCellsPercent; |
3067 |
08 Jan 15 |
olle |
484 |
} |
2933 |
14 Nov 14 |
olle |
specimenTubes += '<br>'; |
2933 |
14 Nov 14 |
olle |
486 |
} |
3028 |
11 Dec 14 |
olle |
Doc.element('tubeContentType').value = thisCaseTubeContentType; |
3028 |
11 Dec 14 |
olle |
Doc.element('specimenType').value = thisCaseSpecimenType; |
4195 |
31 Oct 16 |
olle |
Doc.element('specimenInputType').value = thisCaseSpecimenInputType; |
3028 |
11 Dec 14 |
olle |
490 |
|
2933 |
14 Nov 14 |
olle |
Doc.show('specimenTubesSection'); |
2933 |
14 Nov 14 |
olle |
Doc.element('specimenTubes').innerHTML = specimenTubes; |
2933 |
14 Nov 14 |
olle |
493 |
|
2933 |
14 Nov 14 |
olle |
Doc.hide('nofTubesSection'); |
2933 |
14 Nov 14 |
olle |
Doc.hide('arrivalDateSection'); |
2933 |
14 Nov 14 |
olle |
496 |
|
2933 |
14 Nov 14 |
olle |
Doc.show('specimenTubesSection'); |
2933 |
14 Nov 14 |
olle |
Doc.show('samplingDateSection'); |
2933 |
14 Nov 14 |
olle |
499 |
|
2933 |
14 Nov 14 |
olle |
Doc.hide('mutationAnalysisSection'); |
2933 |
14 Nov 14 |
olle |
Doc.hide('siteSection'); |
2933 |
14 Nov 14 |
olle |
Doc.hide('sampleTypeSection'); |
2933 |
14 Nov 14 |
olle |
Doc.hide('projectFocusSection'); |
4732 |
04 Apr 18 |
olle |
Doc.hide('metastasisSiteSection'); |
2933 |
14 Nov 14 |
olle |
Doc.hide('otherPathNoteSection'); |
2933 |
14 Nov 14 |
olle |
506 |
|
3028 |
11 Dec 14 |
olle |
// Populate 'Sampling date' field |
2933 |
14 Nov 14 |
olle |
if (thisCaseSamplingDate != null) |
2933 |
14 Nov 14 |
olle |
509 |
{ |
2933 |
14 Nov 14 |
olle |
frm.samplingDate.value = thisCaseSamplingDate.substring(0, 8); |
3157 |
04 Mar 15 |
olle |
persinfo.samplingDateOnChange(); |
2933 |
14 Nov 14 |
olle |
512 |
} |
2933 |
14 Nov 14 |
olle |
513 |
|
3067 |
08 Jan 15 |
olle |
// Populate 'Viable tumour cells percent' field |
3067 |
08 Jan 15 |
olle |
if (thisCaseViableTumourCellsPercent != null) |
3067 |
08 Jan 15 |
olle |
516 |
{ |
3067 |
08 Jan 15 |
olle |
frm.viableTumourCellsPercent.value = thisCaseViableTumourCellsPercent; |
3067 |
08 Jan 15 |
olle |
persinfo.viableTumourCellsPercentOnChange(); |
3067 |
08 Jan 15 |
olle |
519 |
} |
3067 |
08 Jan 15 |
olle |
520 |
|
2933 |
14 Nov 14 |
olle |
frm.plNumber.value = thisCasePlNumber; |
2933 |
14 Nov 14 |
olle |
frm.pad.value = thisCasePAD; |
2933 |
14 Nov 14 |
olle |
523 |
|
3028 |
11 Dec 14 |
olle |
if (caseInfo.id != null && typeof caseInfo.id != 'undefined') |
3028 |
11 Dec 14 |
olle |
525 |
{ |
3028 |
11 Dec 14 |
olle |
frm.samplingDate.disabled = true; |
3028 |
11 Dec 14 |
olle |
frm.tubeContentType.disabled = true; |
3028 |
11 Dec 14 |
olle |
frm.specimenType.disabled = true; |
4195 |
31 Oct 16 |
olle |
frm.specimenInputType.disabled = true; |
3067 |
08 Jan 15 |
olle |
frm.viableTumourCellsPercent.disabled = true; |
3028 |
11 Dec 14 |
olle |
531 |
} |
3028 |
11 Dec 14 |
olle |
532 |
|
2933 |
14 Nov 14 |
olle |
// Existing cases for this patient |
2933 |
14 Nov 14 |
olle |
var hasUnknownCase = false; |
2933 |
14 Nov 14 |
olle |
if (patientInfo.cases && patientInfo.cases.length > 0) |
2933 |
14 Nov 14 |
olle |
536 |
{ |
2933 |
14 Nov 14 |
olle |
var cases = ''; |
2933 |
14 Nov 14 |
olle |
538 |
|
2933 |
14 Nov 14 |
olle |
if (patientInfo.cases.length == 1 || updateMode) |
2933 |
14 Nov 14 |
olle |
540 |
{ |
2933 |
14 Nov 14 |
olle |
if (!updateMode) |
2933 |
14 Nov 14 |
olle |
542 |
{ |
2933 |
14 Nov 14 |
olle |
cases += '[<i>new case</i>]<br>'; |
2933 |
14 Nov 14 |
olle |
544 |
} |
2933 |
14 Nov 14 |
olle |
545 |
} |
2933 |
14 Nov 14 |
olle |
546 |
|
2933 |
14 Nov 14 |
olle |
if (updateMode) |
2933 |
14 Nov 14 |
olle |
548 |
{ |
2933 |
14 Nov 14 |
olle |
if (caseInfo.merged) |
2933 |
14 Nov 14 |
olle |
550 |
{ |
2933 |
14 Nov 14 |
olle |
Doc.element('step-3-title').innerHTML = 'Update case \''+Strings.encodeTags(caseInfo.originalName)+'\' (which is merged with case \'' + Strings.encodeTags(caseInfo.name) + '\')'; |
2933 |
14 Nov 14 |
olle |
552 |
} |
2933 |
14 Nov 14 |
olle |
else |
2933 |
14 Nov 14 |
olle |
554 |
{ |
2933 |
14 Nov 14 |
olle |
Doc.element('step-3-title').innerHTML = 'Update case \''+Strings.encodeTags(caseInfo.name)+'\''; |
2933 |
14 Nov 14 |
olle |
556 |
} |
2933 |
14 Nov 14 |
olle |
557 |
|
2933 |
14 Nov 14 |
olle |
558 |
} |
2933 |
14 Nov 14 |
olle |
else if (patientInfo.cases.length == 2) |
2933 |
14 Nov 14 |
olle |
560 |
{ |
2933 |
14 Nov 14 |
olle |
Doc.element('step-3-title').innerHTML = 'Merge with existing case'; |
2933 |
14 Nov 14 |
olle |
562 |
} |
2933 |
14 Nov 14 |
olle |
else if (patientInfo.cases.length > 0) |
2933 |
14 Nov 14 |
olle |
564 |
{ |
2933 |
14 Nov 14 |
olle |
Doc.element('step-3-title').innerHTML = 'Create new case or merge with existing case'; |
2933 |
14 Nov 14 |
olle |
566 |
} |
2933 |
14 Nov 14 |
olle |
567 |
} |
2933 |
14 Nov 14 |
olle |
568 |
|
2933 |
14 Nov 14 |
olle |
Wizard.setCurrentStep(3); |
2933 |
14 Nov 14 |
olle |
if (updateMode) |
2933 |
14 Nov 14 |
olle |
571 |
{ |
2933 |
14 Nov 14 |
olle |
Doc.show('goupdate'); |
2933 |
14 Nov 14 |
olle |
573 |
} |
2933 |
14 Nov 14 |
olle |
else |
2933 |
14 Nov 14 |
olle |
575 |
{ |
2933 |
14 Nov 14 |
olle |
Doc.show('goregister'); |
2933 |
14 Nov 14 |
olle |
577 |
} |
2933 |
14 Nov 14 |
olle |
Doc.show('gocancel'); |
2933 |
14 Nov 14 |
olle |
frm.plNumber.focus(); |
2933 |
14 Nov 14 |
olle |
580 |
} |
3028 |
11 Dec 14 |
olle |
else if (hasDna) |
2933 |
14 Nov 14 |
olle |
582 |
{ |
3028 |
11 Dec 14 |
olle |
var dnaTubes = ''; |
3028 |
11 Dec 14 |
olle |
for (var i = 0; i < caseInfo.dna.length; i++) |
2933 |
14 Nov 14 |
olle |
585 |
{ |
3028 |
11 Dec 14 |
olle |
var dna = caseInfo.dna[i]; |
3028 |
11 Dec 14 |
olle |
dnaTubes += Strings.encodeTags(dna.name); |
3028 |
11 Dec 14 |
olle |
if (dna.extractionDate && !thisCaseExtractionDate) |
3028 |
11 Dec 14 |
olle |
589 |
{ |
3028 |
11 Dec 14 |
olle |
thisCaseExtractionDate = dna.extractionDate; |
3028 |
11 Dec 14 |
olle |
591 |
} |
3028 |
11 Dec 14 |
olle |
dnaTubes += '<br>'; |
2933 |
14 Nov 14 |
olle |
593 |
} |
3028 |
11 Dec 14 |
olle |
Doc.element('tubeContentType').value = thisCaseTubeContentType; |
3028 |
11 Dec 14 |
olle |
595 |
|
3028 |
11 Dec 14 |
olle |
frm.plNumber.disabled = true; |
3028 |
11 Dec 14 |
olle |
Doc.element('plNumberMessageText').innerHTML = "No PL-number can be saved for case without specimen."; |
3028 |
11 Dec 14 |
olle |
frm.pad.disabled = true; |
3028 |
11 Dec 14 |
olle |
Doc.element('padMessageText').innerHTML = "No PAD/CL number can be saved for case without specimen."; |
3028 |
11 Dec 14 |
olle |
600 |
|
3028 |
11 Dec 14 |
olle |
Doc.show('specimenTubesSection'); |
3028 |
11 Dec 14 |
olle |
Doc.element('specimenTubesTitle').innerHTML = "DNA tubes"; |
3028 |
11 Dec 14 |
olle |
Doc.element('specimenTubes').innerHTML = dnaTubes; |
3028 |
11 Dec 14 |
olle |
Doc.element('specimenTubesMessageText').innerHTML = "The DNA tube(s) associated with this case."; |
3028 |
11 Dec 14 |
olle |
605 |
|
3028 |
11 Dec 14 |
olle |
Doc.hide('nofTubesSection'); |
3028 |
11 Dec 14 |
olle |
Doc.hide('arrivalDateSection'); |
3028 |
11 Dec 14 |
olle |
608 |
|
3028 |
11 Dec 14 |
olle |
Doc.show('specimenTubesSection'); |
3028 |
11 Dec 14 |
olle |
Doc.show('samplingDateSection'); |
3028 |
11 Dec 14 |
olle |
611 |
|
3028 |
11 Dec 14 |
olle |
Doc.hide('mutationAnalysisSection'); |
3028 |
11 Dec 14 |
olle |
Doc.hide('siteSection'); |
3028 |
11 Dec 14 |
olle |
Doc.hide('sampleTypeSection'); |
3028 |
11 Dec 14 |
olle |
Doc.hide('projectFocusSection'); |
4732 |
04 Apr 18 |
olle |
Doc.hide('metastasisSiteSection'); |
3028 |
11 Dec 14 |
olle |
Doc.hide('otherPathNoteSection'); |
3028 |
11 Dec 14 |
olle |
618 |
|
3028 |
11 Dec 14 |
olle |
thisCaseSamplingDate = thisCaseExtractionDate; |
3028 |
11 Dec 14 |
olle |
// Populate 'Sampling date' field |
3028 |
11 Dec 14 |
olle |
if (thisCaseSamplingDate != null) |
2933 |
14 Nov 14 |
olle |
622 |
{ |
3028 |
11 Dec 14 |
olle |
frm.samplingDate.value = thisCaseSamplingDate.substring(0, 8); |
3157 |
04 Mar 15 |
olle |
persinfo.samplingDateOnChange(); |
3028 |
11 Dec 14 |
olle |
625 |
} |
2933 |
14 Nov 14 |
olle |
626 |
|
3028 |
11 Dec 14 |
olle |
frm.plNumber.value = thisCasePlNumber; |
3028 |
11 Dec 14 |
olle |
frm.pad.value = thisCasePAD; |
2933 |
14 Nov 14 |
olle |
629 |
|
3028 |
11 Dec 14 |
olle |
if (caseInfo.id != null && typeof caseInfo.id != 'undefined') |
3028 |
11 Dec 14 |
olle |
631 |
{ |
3028 |
11 Dec 14 |
olle |
frm.samplingDate.disabled = true; |
3028 |
11 Dec 14 |
olle |
frm.tubeContentType.disabled = true; |
3028 |
11 Dec 14 |
olle |
frm.specimenType.disabled = true; |
4195 |
31 Oct 16 |
olle |
frm.specimenInputType.disabled = true; |
3067 |
08 Jan 15 |
olle |
frm.viableTumourCellsPercent.disabled = true; |
2933 |
14 Nov 14 |
olle |
637 |
} |
2933 |
14 Nov 14 |
olle |
638 |
|
3028 |
11 Dec 14 |
olle |
Wizard.setCurrentStep(3); |
3028 |
11 Dec 14 |
olle |
if (updateMode) |
3028 |
11 Dec 14 |
olle |
641 |
{ |
3028 |
11 Dec 14 |
olle |
Doc.show('goupdate'); |
3028 |
11 Dec 14 |
olle |
643 |
} |
3028 |
11 Dec 14 |
olle |
else |
3028 |
11 Dec 14 |
olle |
645 |
{ |
3028 |
11 Dec 14 |
olle |
Doc.show('goregister'); |
3028 |
11 Dec 14 |
olle |
647 |
} |
3028 |
11 Dec 14 |
olle |
Doc.show('gocancel'); |
3028 |
11 Dec 14 |
olle |
frm.plNumber.focus(); |
2933 |
14 Nov 14 |
olle |
650 |
} |
3028 |
11 Dec 14 |
olle |
else if (hasRna) |
2933 |
14 Nov 14 |
olle |
652 |
{ |
3028 |
11 Dec 14 |
olle |
var rnaTubes = ''; |
3028 |
11 Dec 14 |
olle |
for (var i = 0; i < caseInfo.rna.length; i++) |
2933 |
14 Nov 14 |
olle |
655 |
{ |
3028 |
11 Dec 14 |
olle |
var rna = caseInfo.rna[i]; |
3028 |
11 Dec 14 |
olle |
rnaTubes += Strings.encodeTags(rna.name); |
3028 |
11 Dec 14 |
olle |
if (rna.extractionDate && !thisCaseExtractionDate) |
2933 |
14 Nov 14 |
olle |
659 |
{ |
3028 |
11 Dec 14 |
olle |
thisCaseExtractionDate = rna.extractionDate; |
3028 |
11 Dec 14 |
olle |
661 |
} |
3028 |
11 Dec 14 |
olle |
rnaTubes += '<br>'; |
2933 |
14 Nov 14 |
olle |
663 |
} |
3028 |
11 Dec 14 |
olle |
Doc.element('tubeContentType').value = thisCaseTubeContentType; |
3028 |
11 Dec 14 |
olle |
665 |
|
3028 |
11 Dec 14 |
olle |
frm.plNumber.disabled = true; |
3028 |
11 Dec 14 |
olle |
Doc.element('plNumberMessageText').innerHTML = "No PL-number can be saved for case without specimen."; |
3028 |
11 Dec 14 |
olle |
frm.pad.disabled = true; |
3028 |
11 Dec 14 |
olle |
Doc.element('padMessageText').innerHTML = "No PAD/CL number can be saved for case without specimen."; |
3028 |
11 Dec 14 |
olle |
670 |
|
3028 |
11 Dec 14 |
olle |
Doc.show('specimenTubesSection'); |
3028 |
11 Dec 14 |
olle |
Doc.element('specimenTubesTitle').innerHTML = "RNA tubes"; |
3028 |
11 Dec 14 |
olle |
Doc.element('specimenTubes').innerHTML = rnaTubes; |
3028 |
11 Dec 14 |
olle |
Doc.element('specimenTubesMessageText').innerHTML = "The RNA tube(s) associated with this case."; |
3028 |
11 Dec 14 |
olle |
675 |
|
3028 |
11 Dec 14 |
olle |
Doc.hide('nofTubesSection'); |
3028 |
11 Dec 14 |
olle |
Doc.hide('arrivalDateSection'); |
3028 |
11 Dec 14 |
olle |
678 |
|
3028 |
11 Dec 14 |
olle |
Doc.show('specimenTubesSection'); |
3028 |
11 Dec 14 |
olle |
Doc.show('samplingDateSection'); |
2933 |
14 Nov 14 |
olle |
681 |
|
3028 |
11 Dec 14 |
olle |
Doc.hide('mutationAnalysisSection'); |
3028 |
11 Dec 14 |
olle |
Doc.hide('siteSection'); |
3028 |
11 Dec 14 |
olle |
Doc.hide('sampleTypeSection'); |
3028 |
11 Dec 14 |
olle |
Doc.hide('projectFocusSection'); |
4732 |
04 Apr 18 |
olle |
Doc.hide('metastasisSiteSection'); |
3028 |
11 Dec 14 |
olle |
Doc.hide('otherPathNoteSection'); |
3028 |
11 Dec 14 |
olle |
688 |
|
3028 |
11 Dec 14 |
olle |
thisCaseSamplingDate = thisCaseExtractionDate; |
3028 |
11 Dec 14 |
olle |
// Populate 'Sampling date' field |
3028 |
11 Dec 14 |
olle |
if (thisCaseSamplingDate != null) |
2933 |
14 Nov 14 |
olle |
692 |
{ |
3028 |
11 Dec 14 |
olle |
frm.samplingDate.value = thisCaseSamplingDate.substring(0, 8); |
3157 |
04 Mar 15 |
olle |
persinfo.samplingDateOnChange(); |
2933 |
14 Nov 14 |
olle |
695 |
} |
3028 |
11 Dec 14 |
olle |
696 |
|
3028 |
11 Dec 14 |
olle |
frm.plNumber.value = thisCasePlNumber; |
3028 |
11 Dec 14 |
olle |
frm.pad.value = thisCasePAD; |
3028 |
11 Dec 14 |
olle |
699 |
|
3028 |
11 Dec 14 |
olle |
if (caseInfo.id != null && typeof caseInfo.id != 'undefined') |
2933 |
14 Nov 14 |
olle |
701 |
{ |
3028 |
11 Dec 14 |
olle |
frm.samplingDate.disabled = true; |
3028 |
11 Dec 14 |
olle |
frm.tubeContentType.disabled = true; |
3028 |
11 Dec 14 |
olle |
frm.specimenType.disabled = true; |
4195 |
31 Oct 16 |
olle |
frm.specimenInputType.disabled = true; |
3067 |
08 Jan 15 |
olle |
frm.viableTumourCellsPercent.disabled = true; |
2933 |
14 Nov 14 |
olle |
707 |
} |
3028 |
11 Dec 14 |
olle |
708 |
|
3028 |
11 Dec 14 |
olle |
Wizard.setCurrentStep(3); |
3028 |
11 Dec 14 |
olle |
if (updateMode) |
2933 |
14 Nov 14 |
olle |
711 |
{ |
3028 |
11 Dec 14 |
olle |
Doc.show('goupdate'); |
2933 |
14 Nov 14 |
olle |
713 |
} |
3028 |
11 Dec 14 |
olle |
else |
3028 |
11 Dec 14 |
olle |
715 |
{ |
3028 |
11 Dec 14 |
olle |
Doc.show('goregister'); |
3028 |
11 Dec 14 |
olle |
717 |
} |
3028 |
11 Dec 14 |
olle |
Doc.show('gocancel'); |
3028 |
11 Dec 14 |
olle |
frm.plNumber.focus(); |
2933 |
14 Nov 14 |
olle |
720 |
} |
2933 |
14 Nov 14 |
olle |
else |
2933 |
14 Nov 14 |
olle |
722 |
{ |
3028 |
11 Dec 14 |
olle |
Doc.hide('specimenTubesSection'); |
3028 |
11 Dec 14 |
olle |
Wizard.setCurrentStep(3); |
3028 |
11 Dec 14 |
olle |
Doc.show('gocancel'); |
3028 |
11 Dec 14 |
olle |
Doc.show('gonext'); |
3028 |
11 Dec 14 |
olle |
727 |
|
3028 |
11 Dec 14 |
olle |
frm.arrivalDate.value = Dates.formatDate(new Date(), 'yyyyMMdd'); |
3028 |
11 Dec 14 |
olle |
729 |
|
3028 |
11 Dec 14 |
olle |
frm.plNumber.focus(); |
3028 |
11 Dec 14 |
olle |
frm.nofTubes.setSelectionRange(0,1); |
2933 |
14 Nov 14 |
olle |
732 |
} |
2933 |
14 Nov 14 |
olle |
733 |
} |
2933 |
14 Nov 14 |
olle |
734 |
|
2933 |
14 Nov 14 |
olle |
persinfo.plNumberOnChange = function() |
2933 |
14 Nov 14 |
olle |
736 |
{ |
2933 |
14 Nov 14 |
olle |
var frm = document.forms['meludi']; |
2933 |
14 Nov 14 |
olle |
var plNumber = frm.plNumber.value; |
2933 |
14 Nov 14 |
olle |
if (plNumber == '') |
2933 |
14 Nov 14 |
olle |
740 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('plNumber', 'warning', 'Missing'); |
2933 |
14 Nov 14 |
olle |
return; |
2933 |
14 Nov 14 |
olle |
743 |
} |
2933 |
14 Nov 14 |
olle |
frm.plNumber.value = plNumber.replace(/\+/, '-'); |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('plNumber', 'valid'); |
2933 |
14 Nov 14 |
olle |
746 |
} |
2933 |
14 Nov 14 |
olle |
747 |
|
2933 |
14 Nov 14 |
olle |
persinfo.padOnChange = function() |
2933 |
14 Nov 14 |
olle |
749 |
{ |
2933 |
14 Nov 14 |
olle |
var frm = document.forms['meludi']; |
2933 |
14 Nov 14 |
olle |
var PAD = frm.pad.value; |
2933 |
14 Nov 14 |
olle |
if (PAD == '') |
2933 |
14 Nov 14 |
olle |
753 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('pad', 'warning', 'Missing'); |
2933 |
14 Nov 14 |
olle |
return; |
2933 |
14 Nov 14 |
olle |
756 |
} |
2933 |
14 Nov 14 |
olle |
frm.pad.value = PAD.replace(/\+/, '-'); |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('pad', 'valid'); |
2933 |
14 Nov 14 |
olle |
759 |
} |
2933 |
14 Nov 14 |
olle |
760 |
|
2933 |
14 Nov 14 |
olle |
persinfo.samplingDateTimeFocus = function(event) |
2933 |
14 Nov 14 |
olle |
762 |
{ |
2933 |
14 Nov 14 |
olle |
if (event.keyCode == 13) |
2933 |
14 Nov 14 |
olle |
764 |
{ |
2933 |
14 Nov 14 |
olle |
var focusTo = caseInfo.specimen && caseInfo.specimen.length > 0 ? 'mutationAnalysis' : 'reasonIfNoSpecimen' |
2933 |
14 Nov 14 |
olle |
Doc.element(focusTo).focus(); |
2933 |
14 Nov 14 |
olle |
767 |
} |
2933 |
14 Nov 14 |
olle |
768 |
} |
2933 |
14 Nov 14 |
olle |
769 |
|
2933 |
14 Nov 14 |
olle |
persinfo.nofTubesOnChange = function() |
2933 |
14 Nov 14 |
olle |
771 |
{ |
2933 |
14 Nov 14 |
olle |
nofTubesIsValid = false; |
2933 |
14 Nov 14 |
olle |
773 |
|
2933 |
14 Nov 14 |
olle |
var frm = document.forms['meludi']; |
2933 |
14 Nov 14 |
olle |
var nofTubes = frm.nofTubes.value; |
2933 |
14 Nov 14 |
olle |
776 |
|
2933 |
14 Nov 14 |
olle |
if (nofTubes == '') |
2933 |
14 Nov 14 |
olle |
778 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('nofTubes', 'invalid', 'Missing'); |
2933 |
14 Nov 14 |
olle |
return; |
2933 |
14 Nov 14 |
olle |
781 |
} |
2933 |
14 Nov 14 |
olle |
if (parseInt(nofTubes) < 1) |
2933 |
14 Nov 14 |
olle |
783 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('nofTubes', 'invalid', 'Must be at least 1'); |
2933 |
14 Nov 14 |
olle |
return; |
2933 |
14 Nov 14 |
olle |
786 |
} |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('nofTubes', 'valid'); |
2933 |
14 Nov 14 |
olle |
nofTubesIsValid = true; |
2933 |
14 Nov 14 |
olle |
789 |
} |
2933 |
14 Nov 14 |
olle |
790 |
|
3157 |
04 Mar 15 |
olle |
persinfo.samplingDateOnChange = function() |
2933 |
14 Nov 14 |
olle |
792 |
{ |
2933 |
14 Nov 14 |
olle |
var frm = document.forms['meludi']; |
2933 |
14 Nov 14 |
olle |
samplingDateIsValid = false; |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('samplingDate'); |
2933 |
14 Nov 14 |
olle |
796 |
|
2933 |
14 Nov 14 |
olle |
var samplingDate = frm.samplingDate.value; |
2933 |
14 Nov 14 |
olle |
798 |
|
2933 |
14 Nov 14 |
olle |
if (samplingDate == '') |
2933 |
14 Nov 14 |
olle |
800 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('samplingDate', 'warning', 'Missing date'); |
2933 |
14 Nov 14 |
olle |
802 |
} |
2933 |
14 Nov 14 |
olle |
else |
2933 |
14 Nov 14 |
olle |
804 |
{ |
2933 |
14 Nov 14 |
olle |
// Auto-fill the date if it's only given with 4(MMdd) or 6(yyMMdd) digits. |
2933 |
14 Nov 14 |
olle |
samplingDate = Meludi.autoFillDate(samplingDate, true); |
2933 |
14 Nov 14 |
olle |
frm.samplingDate.value = samplingDate; |
2933 |
14 Nov 14 |
olle |
808 |
|
2933 |
14 Nov 14 |
olle |
if (samplingDate != '' && !Dates.isDate(samplingDate, 'yyyyMMdd')) |
2933 |
14 Nov 14 |
olle |
810 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('samplingDate', 'invalid', 'Not a valid date'); |
2933 |
14 Nov 14 |
olle |
return; |
2933 |
14 Nov 14 |
olle |
813 |
} |
2933 |
14 Nov 14 |
olle |
814 |
|
3159 |
04 Mar 15 |
olle |
var arrivalDate = frm.arrivalDate.value; |
3159 |
04 Mar 15 |
olle |
if (arrivalDate != '' && arrivalDate < samplingDate) |
3159 |
04 Mar 15 |
olle |
817 |
{ |
3159 |
04 Mar 15 |
olle |
Wizard.setInputStatus('samplingDate', 'invalid', 'Arrival date is before sampling date'); |
3159 |
04 Mar 15 |
olle |
return; |
3159 |
04 Mar 15 |
olle |
820 |
} |
3159 |
04 Mar 15 |
olle |
821 |
|
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('samplingDate', 'valid'); |
2933 |
14 Nov 14 |
olle |
823 |
} |
2933 |
14 Nov 14 |
olle |
samplingDateIsValid = true; |
2933 |
14 Nov 14 |
olle |
825 |
} |
2933 |
14 Nov 14 |
olle |
826 |
|
3232 |
08 Apr 15 |
olle |
persinfo.projectFocusOnChange = function() |
3232 |
08 Apr 15 |
olle |
828 |
{ |
3232 |
08 Apr 15 |
olle |
var frm = document.forms['meludi']; |
3232 |
08 Apr 15 |
olle |
var projectFocus = frm.projectFocus.value; |
3232 |
08 Apr 15 |
olle |
831 |
|
3232 |
08 Apr 15 |
olle |
persinfo.mutationAnalysisReset(); |
3232 |
08 Apr 15 |
olle |
833 |
|
3232 |
08 Apr 15 |
olle |
if (projectFocus == 'melanoma') |
3232 |
08 Apr 15 |
olle |
835 |
{ |
3232 |
08 Apr 15 |
olle |
frm.mutationAnalysisNras.checked = true; |
3232 |
08 Apr 15 |
olle |
frm.mutationAnalysisBraf.checked = true; |
3232 |
08 Apr 15 |
olle |
frm.mutationAnalysisKit.checked = true; |
3232 |
08 Apr 15 |
olle |
return; |
3232 |
08 Apr 15 |
olle |
840 |
} |
3232 |
08 Apr 15 |
olle |
if (projectFocus == 'lungcancer') |
3232 |
08 Apr 15 |
olle |
842 |
{ |
3232 |
08 Apr 15 |
olle |
frm.mutationAnalysisKras.checked = true; |
3232 |
08 Apr 15 |
olle |
frm.mutationAnalysisEgfr.checked = true; |
3232 |
08 Apr 15 |
olle |
return; |
3232 |
08 Apr 15 |
olle |
846 |
} |
3232 |
08 Apr 15 |
olle |
if (projectFocus == 'coloncancer') |
3232 |
08 Apr 15 |
olle |
848 |
{ |
3232 |
08 Apr 15 |
olle |
frm.mutationAnalysisKras.checked = true; |
3232 |
08 Apr 15 |
olle |
frm.mutationAnalysisNras.checked = true; |
3232 |
08 Apr 15 |
olle |
frm.mutationAnalysisBraf.checked = true; |
3232 |
08 Apr 15 |
olle |
return; |
3232 |
08 Apr 15 |
olle |
853 |
} |
3232 |
08 Apr 15 |
olle |
if (projectFocus == 'GIST') |
3232 |
08 Apr 15 |
olle |
855 |
{ |
3232 |
08 Apr 15 |
olle |
frm.mutationAnalysisPdgfra.checked = true; |
3232 |
08 Apr 15 |
olle |
frm.mutationAnalysisKit.checked = true; |
3232 |
08 Apr 15 |
olle |
return; |
3232 |
08 Apr 15 |
olle |
859 |
} |
3232 |
08 Apr 15 |
olle |
860 |
} |
3232 |
08 Apr 15 |
olle |
861 |
|
3232 |
08 Apr 15 |
olle |
persinfo.mutationAnalysisReset = function() |
3232 |
08 Apr 15 |
olle |
863 |
{ |
3232 |
08 Apr 15 |
olle |
var frm = document.forms['meludi']; |
3232 |
08 Apr 15 |
olle |
865 |
|
3232 |
08 Apr 15 |
olle |
frm.mutationAnalysisKras.checked = false; |
3232 |
08 Apr 15 |
olle |
frm.mutationAnalysisNras.checked = false; |
3232 |
08 Apr 15 |
olle |
frm.mutationAnalysisBraf.checked = false; |
3232 |
08 Apr 15 |
olle |
frm.mutationAnalysisEgfr.checked = false; |
3232 |
08 Apr 15 |
olle |
frm.mutationAnalysisAlkEml4.checked = false; |
3232 |
08 Apr 15 |
olle |
frm.mutationAnalysisPdgfra.checked = false; |
3232 |
08 Apr 15 |
olle |
frm.mutationAnalysisKit.checked = false; |
4730 |
04 Apr 18 |
olle |
frm.mutationAnalysisTst170.checked = false; |
3232 |
08 Apr 15 |
olle |
frm.mutationAnalysisOther.checked = false; |
3232 |
08 Apr 15 |
olle |
875 |
} |
3232 |
08 Apr 15 |
olle |
876 |
|
3249 |
14 Apr 15 |
olle |
persinfo.mutationAnalysisSelectAll = function() |
3249 |
14 Apr 15 |
olle |
878 |
{ |
3249 |
14 Apr 15 |
olle |
var frm = document.forms['meludi']; |
3249 |
14 Apr 15 |
olle |
880 |
|
3249 |
14 Apr 15 |
olle |
frm.mutationAnalysisKras.checked = true; |
3249 |
14 Apr 15 |
olle |
frm.mutationAnalysisNras.checked = true; |
3249 |
14 Apr 15 |
olle |
frm.mutationAnalysisBraf.checked = true; |
3249 |
14 Apr 15 |
olle |
frm.mutationAnalysisEgfr.checked = true; |
3249 |
14 Apr 15 |
olle |
frm.mutationAnalysisAlkEml4.checked = true; |
3249 |
14 Apr 15 |
olle |
frm.mutationAnalysisPdgfra.checked = true; |
3249 |
14 Apr 15 |
olle |
frm.mutationAnalysisKit.checked = true; |
4730 |
04 Apr 18 |
olle |
//frm.mutationAnalysisTst170.checked = true; |
3249 |
14 Apr 15 |
olle |
//frm.mutationAnalysisOther.checked = true; |
3249 |
14 Apr 15 |
olle |
890 |
} |
3249 |
14 Apr 15 |
olle |
891 |
|
3067 |
08 Jan 15 |
olle |
persinfo.viableTumourCellsPercentOnChange = function() |
3067 |
08 Jan 15 |
olle |
893 |
{ |
3067 |
08 Jan 15 |
olle |
viableTumourCellsPercentIsValid = false; |
3067 |
08 Jan 15 |
olle |
895 |
|
3067 |
08 Jan 15 |
olle |
var frm = document.forms['meludi']; |
3067 |
08 Jan 15 |
olle |
var viableTumourCellsPercent = frm.viableTumourCellsPercent.value; |
3067 |
08 Jan 15 |
olle |
898 |
|
3106 |
26 Jan 15 |
olle |
if (viableTumourCellsPercent != null) |
3067 |
08 Jan 15 |
olle |
900 |
{ |
3106 |
26 Jan 15 |
olle |
if (parseInt(viableTumourCellsPercent) < 0) |
3106 |
26 Jan 15 |
olle |
902 |
{ |
3106 |
26 Jan 15 |
olle |
Wizard.setInputStatus('viableTumourCellsPercent', 'invalid', 'Must be at least 0'); |
3106 |
26 Jan 15 |
olle |
return; |
3106 |
26 Jan 15 |
olle |
905 |
} |
3106 |
26 Jan 15 |
olle |
if (parseInt(viableTumourCellsPercent) > 100) |
3106 |
26 Jan 15 |
olle |
907 |
{ |
3106 |
26 Jan 15 |
olle |
Wizard.setInputStatus('viableTumourCellsPercent', 'invalid', 'Must be at most 100'); |
3106 |
26 Jan 15 |
olle |
return; |
3106 |
26 Jan 15 |
olle |
910 |
} |
3067 |
08 Jan 15 |
olle |
911 |
} |
3067 |
08 Jan 15 |
olle |
Wizard.setInputStatus('viableTumourCellsPercent', 'valid'); |
3067 |
08 Jan 15 |
olle |
viableTumourCellsPercentIsValid = true; |
3067 |
08 Jan 15 |
olle |
914 |
} |
3067 |
08 Jan 15 |
olle |
915 |
|
2933 |
14 Nov 14 |
olle |
persinfo.validateStep3 = function(event) |
2933 |
14 Nov 14 |
olle |
917 |
{ |
2933 |
14 Nov 14 |
olle |
var isValid = samplingDateIsValid; |
3067 |
08 Jan 15 |
olle |
var hasSpecimen = caseInfo.specimen && caseInfo.specimen.length > 0; |
3067 |
08 Jan 15 |
olle |
if (hasSpecimen) |
3067 |
08 Jan 15 |
olle |
921 |
{ |
3067 |
08 Jan 15 |
olle |
isValid &= viableTumourCellsPercentIsValid; |
3067 |
08 Jan 15 |
olle |
923 |
} |
2933 |
14 Nov 14 |
olle |
if (!isValid) event.preventDefault(); |
2933 |
14 Nov 14 |
olle |
925 |
} |
2933 |
14 Nov 14 |
olle |
926 |
|
2933 |
14 Nov 14 |
olle |
persinfo.initializeStep4 = function() |
2933 |
14 Nov 14 |
olle |
928 |
{ |
2933 |
14 Nov 14 |
olle |
var frm = document.forms['meludi']; |
3028 |
11 Dec 14 |
olle |
var tubeContentType = frm.tubeContentType.value; |
2933 |
14 Nov 14 |
olle |
var nofTubes = parseInt(frm.nofTubes.value); |
3028 |
11 Dec 14 |
olle |
nofTubes = persinfo.fixNofTubes(tubeContentType, nofTubes); |
3028 |
11 Dec 14 |
olle |
frm.nofTubes.value = nofTubes; |
4246 |
21 Nov 16 |
olle |
var extractsFromFirstSpecimenOnly = frm.extractsFromFirstSpecimenOnlyCB.checked; |
3028 |
11 Dec 14 |
olle |
var storageBoxSuffix = persinfo.fetchStorageBoxSuffix(tubeContentType); |
2933 |
14 Nov 14 |
olle |
if (nofTubes > 2) Doc.addClass('step-2', 'auto-hide'); |
2933 |
14 Nov 14 |
olle |
937 |
|
2933 |
14 Nov 14 |
olle |
var html = ''; |
3252 |
16 Apr 15 |
olle |
939 |
|
3252 |
16 Apr 15 |
olle |
// Add buttons for adding standard comments for all specimens/RNA/DNA |
3252 |
16 Apr 15 |
olle |
html += '<tr class="section-header">'; |
3252 |
16 Apr 15 |
olle |
html += '<td colspan="4">Standard comments</td>'; |
3252 |
16 Apr 15 |
olle |
html += '</tr>'; |
3252 |
16 Apr 15 |
olle |
944 |
|
3252 |
16 Apr 15 |
olle |
html += '<tr class="align-top">'; |
3252 |
16 Apr 15 |
olle |
html += '<td class="subprompt"></td>'; |
3252 |
16 Apr 15 |
olle |
html += '<td><div class="button basicbutton interactable" id="addCarvedOutComment" style="font-weight: normal;">Add "Utkarvad" (Carved out)</div></td>'; |
3252 |
16 Apr 15 |
olle |
html += '<td class="status" id="addCarvedOutComment.status"></td>'; |
3252 |
16 Apr 15 |
olle |
html += '<td class="help"><span id="addCarvedOutComment.message" class="message"></span>Click button to add standard comment for all items.</td>'; |
3252 |
16 Apr 15 |
olle |
html += '</tr>'; |
3252 |
16 Apr 15 |
olle |
951 |
|
3252 |
16 Apr 15 |
olle |
html += '<tr class="align-top">'; |
3252 |
16 Apr 15 |
olle |
html += '<td class="subprompt"></td>'; |
3252 |
16 Apr 15 |
olle |
html += '<td><div class="button basicbutton interactable" id="addMnbComment" style="font-weight: normal;">Add "MNB" (Medium needle biopsy)</div></td>'; |
3252 |
16 Apr 15 |
olle |
html += '<td class="status" id="addMnbComment.status"></td>'; |
3252 |
16 Apr 15 |
olle |
html += '<td class="help"><span id="addMnbComment.message" class="message"></span>Click button to add standard comment for all items.</td>'; |
3252 |
16 Apr 15 |
olle |
html += '</tr>'; |
3252 |
16 Apr 15 |
olle |
958 |
|
2933 |
14 Nov 14 |
olle |
for (var i=0; i < nofTubes; i++) |
2933 |
14 Nov 14 |
olle |
960 |
{ |
3028 |
11 Dec 14 |
olle |
var tubeContentTypeName = persinfo.fetchTubeContentTypeName(tubeContentType, i); |
3028 |
11 Dec 14 |
olle |
var tubeContentTypeNameInternal = persinfo.fetchTubeContentTypeNameInternal(tubeContentType, tubeContentTypeName); |
3028 |
11 Dec 14 |
olle |
var tubeName = persinfo.fetchTubeName(tubeContentType, caseInfo, i); |
2933 |
14 Nov 14 |
olle |
var tubeNo = i+caseInfo.specimenFirstIndex; |
3028 |
11 Dec 14 |
olle |
var tubeIdentifier = persinfo.fetchTubeIdentifier(tubeContentType, caseInfo, i); |
2933 |
14 Nov 14 |
olle |
html += '<tr class="section-header">'; |
3028 |
11 Dec 14 |
olle |
html += '<td colspan="4">'+tubeContentTypeName+' Tube '+tubeName+'</td>'; |
2933 |
14 Nov 14 |
olle |
html += '</tr>'; |
2933 |
14 Nov 14 |
olle |
969 |
|
3276 |
29 Apr 15 |
olle |
970 |
/* |
3028 |
11 Dec 14 |
olle |
var boxMsg = 'Box-number where the '+tubeContentTypeNameInternal+' tube is located in.'; |
3276 |
29 Apr 15 |
olle |
972 |
*/ |
3276 |
29 Apr 15 |
olle |
var boxMsg = 'Box-number and position where the '+tubeContentTypeNameInternal+' tube is located.'; |
3276 |
29 Apr 15 |
olle |
var dnaBoxMsg = 'Box-number and position where the DNA extract will be located.'; |
3276 |
29 Apr 15 |
olle |
var rnaBoxMsg = 'Box-number and position where the RNA extract will be located.'; |
2933 |
14 Nov 14 |
olle |
var disabledAttribute = ''; |
3253 |
17 Apr 15 |
olle |
if (i == 0 && tubeContentType == 'Specimen') |
2933 |
14 Nov 14 |
olle |
978 |
{ |
3276 |
29 Apr 15 |
olle |
boxMsg = 'No storage space allocated for first '+tubeContentTypeNameInternal+'; all amount expected to be used.'; |
2933 |
14 Nov 14 |
olle |
disabledAttribute = ' disabled'; |
2933 |
14 Nov 14 |
olle |
981 |
} |
2933 |
14 Nov 14 |
olle |
html += '<tr>'; |
3276 |
29 Apr 15 |
olle |
html += '<td class="subprompt">'+tubeContentTypeName+' '+tubeName+' '+'Box</td>'; |
2933 |
14 Nov 14 |
olle |
html += '<td class="input">'; |
3276 |
29 Apr 15 |
olle |
985 |
/* |
2933 |
14 Nov 14 |
olle |
html += '<input type="text" name="box.'+i+'" id="box.'+i+'" style="width: 12em;" maxlength="12"'+disabledAttribute+'></td>'; |
3276 |
29 Apr 15 |
olle |
987 |
*/ |
3276 |
29 Apr 15 |
olle |
html += '<input type="text" name="box.'+i+'" id="box.'+i+'" style="width: 12em;" maxlength="12"'+disabledAttribute+'>'; |
3276 |
29 Apr 15 |
olle |
html += ' Row<input type="text" name="row.'+i+'" id="row.'+i+'" style="text-transform:uppercase; width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
3276 |
29 Apr 15 |
olle |
html += ' Column<input type="text" name="column.'+i+'" id="column.'+i+'" style="width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
3276 |
29 Apr 15 |
olle |
html += '</td>'; |
2933 |
14 Nov 14 |
olle |
html += '<td class="status" id="box.'+i+'.status"></td>'; |
3276 |
29 Apr 15 |
olle |
html += '<td class="help"><span id="box.'+i+'.message" class="message"></span>'+boxMsg+'<span id="position.'+i+'.message" class="message"></span></td>'; |
2933 |
14 Nov 14 |
olle |
html += '</tr>'; |
3276 |
29 Apr 15 |
olle |
995 |
/* |
2933 |
14 Nov 14 |
olle |
html += '<tr>'; |
2933 |
14 Nov 14 |
olle |
html += '<td class="subprompt">Row</td>'; |
2933 |
14 Nov 14 |
olle |
html += '<td class="input">'; |
2933 |
14 Nov 14 |
olle |
html += '<input type="text" name="row.'+i+'" id="row.'+i+'" style="text-transform:uppercase; width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
2933 |
14 Nov 14 |
olle |
html += ' Column<input type="text" name="column.'+i+'" id="column.'+i+'" style="width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
2933 |
14 Nov 14 |
olle |
html += '</td>'; |
2933 |
14 Nov 14 |
olle |
html += '<td class="status" id="position.'+i+'.status"></td>'; |
2933 |
14 Nov 14 |
olle |
html += '<td class="help"><span id="position.'+i+'.message" class="message"></span></td>'; |
2933 |
14 Nov 14 |
olle |
html += '</tr>'; |
3276 |
29 Apr 15 |
olle |
1005 |
*/ |
2933 |
14 Nov 14 |
olle |
1006 |
|
3028 |
11 Dec 14 |
olle |
if (tubeContentType == 'Specimen') |
3028 |
11 Dec 14 |
olle |
1008 |
{ |
3276 |
29 Apr 15 |
olle |
disabledAttribute = ''; |
4246 |
21 Nov 16 |
olle |
if (i == 0 || !extractsFromFirstSpecimenOnly) |
4246 |
21 Nov 16 |
olle |
1011 |
{ |
4246 |
21 Nov 16 |
olle |
html += '<tr>'; |
4246 |
21 Nov 16 |
olle |
html += '<td class="subprompt">DNA extract'+' '+tubeName+'.d '+'Box</td>'; |
4246 |
21 Nov 16 |
olle |
html += '<td class="input">'; |
4246 |
21 Nov 16 |
olle |
html += '<input type="text" name="dnaBox.'+i+'" id="dnaBox.'+i+'" style="width: 12em;" maxlength="12"'+disabledAttribute+'>'; |
4246 |
21 Nov 16 |
olle |
html += ' Row<input type="text" name="dnaRow.'+i+'" id="dnaRow.'+i+'" style="text-transform:uppercase; width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
4246 |
21 Nov 16 |
olle |
html += ' Column<input type="text" name="dnaColumn.'+i+'" id="dnaColumn.'+i+'" style="width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
4246 |
21 Nov 16 |
olle |
html += '</td>'; |
4246 |
21 Nov 16 |
olle |
html += '<td class="status" id="dnaBox.'+i+'.status"></td>'; |
4246 |
21 Nov 16 |
olle |
html += '<td class="help"><span id="dnaBox.'+i+'.message" class="message"></span>'+dnaBoxMsg+'<span id="dnaPosition.'+i+'.message" class="message"></span></td>'; |
4246 |
21 Nov 16 |
olle |
html += '</tr>'; |
3276 |
29 Apr 15 |
olle |
1022 |
|
4246 |
21 Nov 16 |
olle |
html += '<tr>'; |
4246 |
21 Nov 16 |
olle |
html += '<td class="subprompt">RNA extract'+' '+tubeName+'.r '+'Box</td>'; |
4246 |
21 Nov 16 |
olle |
html += '<td class="input">'; |
4246 |
21 Nov 16 |
olle |
html += '<input type="text" name="rnaBox.'+i+'" id="rnaBox.'+i+'" style="width: 12em;" maxlength="12"'+disabledAttribute+'>'; |
4246 |
21 Nov 16 |
olle |
html += ' Row<input type="text" name="rnaRow.'+i+'" id="rnaRow.'+i+'" style="text-transform:uppercase; width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
4246 |
21 Nov 16 |
olle |
html += ' Column<input type="text" name="rnaColumn.'+i+'" id="rnaColumn.'+i+'" style="width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
4246 |
21 Nov 16 |
olle |
html += '</td>'; |
4246 |
21 Nov 16 |
olle |
html += '<td class="status" id="rnaBox.'+i+'.status"></td>'; |
4246 |
21 Nov 16 |
olle |
html += '<td class="help"><span id="rnaBox.'+i+'.message" class="message"></span>'+rnaBoxMsg+'<span id="rnaPosition.'+i+'.message" class="message"></span></td>'; |
4246 |
21 Nov 16 |
olle |
html += '</tr>'; |
4246 |
21 Nov 16 |
olle |
1033 |
} |
3276 |
29 Apr 15 |
olle |
1034 |
|
3276 |
29 Apr 15 |
olle |
html += '<tr>'; |
3028 |
11 Dec 14 |
olle |
html += '<td class="subprompt">Number of sections</td>'; |
3028 |
11 Dec 14 |
olle |
html += '<td class="input">'; |
3028 |
11 Dec 14 |
olle |
html += '<input type="text" name="nofSections.'+i+'" id="nofSections.'+i+'" style="width: 3em;" maxlength="2" value="1">'; |
3028 |
11 Dec 14 |
olle |
html += '</td>'; |
3028 |
11 Dec 14 |
olle |
html += '<td class="status" id="nofSections.'+i+'.status"></td>'; |
3028 |
11 Dec 14 |
olle |
html += '<td class="help"><span id="nofSections.'+i+'.message" class="message"></span>Number of sections (slices) in FFPE block.</td>'; |
3028 |
11 Dec 14 |
olle |
html += '</tr>'; |
3028 |
11 Dec 14 |
olle |
1043 |
} |
3028 |
11 Dec 14 |
olle |
1044 |
|
2933 |
14 Nov 14 |
olle |
html += '<tr class="align-top">'; |
2933 |
14 Nov 14 |
olle |
html += '<td class="subprompt">Operator delivery comment</td>'; |
2933 |
14 Nov 14 |
olle |
html += '<td class="input"><textarea rows="3" name="comment.'+i+'" id="comment.'+i+'"></textarea></td>'; |
2933 |
14 Nov 14 |
olle |
html += '<td class="status" id="comment.'+i+'.status"></td>'; |
3028 |
11 Dec 14 |
olle |
html += '<td class="help"><span id="comment.'+i+'.message" class="message"></span>In this field, enter information specific for '+tubeContentTypeNameInternal+' tube ' +tubeIdentifier+'.</td>'; |
2933 |
14 Nov 14 |
olle |
html += '</tr>'; |
2933 |
14 Nov 14 |
olle |
1051 |
} |
2933 |
14 Nov 14 |
olle |
Doc.element('specimen-tubes').innerHTML = html; |
2933 |
14 Nov 14 |
olle |
1053 |
|
3252 |
16 Apr 15 |
olle |
// Add click handlers for buttons for adding standard comments for all specimens/RNA/DNA |
3252 |
16 Apr 15 |
olle |
var addCarvedOutCommentGeneralButton = Doc.element('addCarvedOutComment'); |
3252 |
16 Apr 15 |
olle |
Buttons.addClickHandler(addCarvedOutCommentGeneralButton, persinfo.addCommentGeneral, {'nofTubes': nofTubes, 'text-field': 'comment.', 'text': 'Utkarvad.'}); |
3252 |
16 Apr 15 |
olle |
var addMnbCommentGeneralButton = Doc.element('addMnbComment'); |
3252 |
16 Apr 15 |
olle |
Buttons.addClickHandler(addMnbCommentGeneralButton, persinfo.addCommentGeneral, {'nofTubes': nofTubes, 'text-field': 'comment.', 'text': 'MNB.'}); |
3250 |
15 Apr 15 |
olle |
1059 |
|
2933 |
14 Nov 14 |
olle |
Wizard.setCurrentStep(4); |
2933 |
14 Nov 14 |
olle |
Doc.show('goregister'); |
2933 |
14 Nov 14 |
olle |
Doc.show('gocancel'); |
2933 |
14 Nov 14 |
olle |
frm['comment.0'].focus(); |
2933 |
14 Nov 14 |
olle |
1064 |
|
2933 |
14 Nov 14 |
olle |
var url = '../SpecimenTubeRegistration.servlet?ID='+App.getSessionId(); |
2933 |
14 Nov 14 |
olle |
url += '&cmd=FindStoragePositions'; |
2933 |
14 Nov 14 |
olle |
url += '&nofTubes='+frm.nofTubes.value; |
3028 |
11 Dec 14 |
olle |
url += '&storageBoxSuffix='+storageBoxSuffix; |
4246 |
21 Nov 16 |
olle |
url += '&extractsFromFirstSpecimenOnly='+extractsFromFirstSpecimenOnly; |
2933 |
14 Nov 14 |
olle |
1070 |
|
2933 |
14 Nov 14 |
olle |
Wizard.showLoadingAnimation('Looking for empty box positions...'); |
2933 |
14 Nov 14 |
olle |
Wizard.asyncJsonRequest(url, persinfo.storagePositionsLoaded); |
2933 |
14 Nov 14 |
olle |
1073 |
} |
2933 |
14 Nov 14 |
olle |
1074 |
|
3252 |
16 Apr 15 |
olle |
persinfo.addCommentGeneral = function(event) |
3252 |
16 Apr 15 |
olle |
1076 |
{ |
3252 |
16 Apr 15 |
olle |
var nofTubes = Data.get(event.currentTarget, 'nofTubes', event.currentTarget.id); |
3252 |
16 Apr 15 |
olle |
var textFieldBase = Data.get(event.currentTarget, 'text-field', event.currentTarget.id); |
3252 |
16 Apr 15 |
olle |
var text = Data.get(event.currentTarget, 'text', event.currentTarget.id); |
3252 |
16 Apr 15 |
olle |
for (var i=0; i < nofTubes; i++) |
3252 |
16 Apr 15 |
olle |
1081 |
{ |
3252 |
16 Apr 15 |
olle |
var textField = Doc.element(textFieldBase+i); |
3252 |
16 Apr 15 |
olle |
if (textField) |
3252 |
16 Apr 15 |
olle |
1084 |
{ |
3252 |
16 Apr 15 |
olle |
if (text && text != '') |
3252 |
16 Apr 15 |
olle |
1086 |
{ |
3252 |
16 Apr 15 |
olle |
if (textField.value != '') |
3252 |
16 Apr 15 |
olle |
1088 |
{ |
3252 |
16 Apr 15 |
olle |
textField.value += ' '; |
3252 |
16 Apr 15 |
olle |
1090 |
} |
3252 |
16 Apr 15 |
olle |
textField.value += text; |
3252 |
16 Apr 15 |
olle |
1092 |
} |
3252 |
16 Apr 15 |
olle |
1093 |
} |
3252 |
16 Apr 15 |
olle |
1094 |
} |
3670 |
17 Dec 15 |
olle |
persinfo.setNumberOfSectionsFromComment(event); |
3252 |
16 Apr 15 |
olle |
1096 |
} |
3252 |
16 Apr 15 |
olle |
1097 |
|
3250 |
15 Apr 15 |
olle |
persinfo.addComment = function(event) |
3250 |
15 Apr 15 |
olle |
1099 |
{ |
3250 |
15 Apr 15 |
olle |
var textField = Doc.element(Data.get(event.currentTarget, 'text-field', event.currentTarget.id)); |
3250 |
15 Apr 15 |
olle |
var text = Data.get(event.currentTarget, 'text', event.currentTarget.id); |
3250 |
15 Apr 15 |
olle |
if (textField) |
3250 |
15 Apr 15 |
olle |
1103 |
{ |
3250 |
15 Apr 15 |
olle |
if (text && text != '') |
3250 |
15 Apr 15 |
olle |
1105 |
{ |
3250 |
15 Apr 15 |
olle |
if (textField.value != '') |
3250 |
15 Apr 15 |
olle |
1107 |
{ |
3250 |
15 Apr 15 |
olle |
textField.value += ' '; |
3250 |
15 Apr 15 |
olle |
1109 |
} |
3250 |
15 Apr 15 |
olle |
textField.value += text; |
3250 |
15 Apr 15 |
olle |
1111 |
} |
3250 |
15 Apr 15 |
olle |
1112 |
} |
3670 |
17 Dec 15 |
olle |
persinfo.setNumberOfSectionsFromComment(event); |
3250 |
15 Apr 15 |
olle |
1114 |
} |
3250 |
15 Apr 15 |
olle |
1115 |
|
3670 |
17 Dec 15 |
olle |
persinfo.setNumberOfSectionsFromComment = function(event) |
3670 |
17 Dec 15 |
olle |
1117 |
{ |
3670 |
17 Dec 15 |
olle |
var frm = document.forms['meludi']; |
3670 |
17 Dec 15 |
olle |
var nofTubes = Data.get(event.currentTarget, 'nofTubes', event.currentTarget.id); |
3670 |
17 Dec 15 |
olle |
var textFieldBase = Data.get(event.currentTarget, 'text-field', event.currentTarget.id); |
3670 |
17 Dec 15 |
olle |
for (var i=0; i < nofTubes; i++) |
3670 |
17 Dec 15 |
olle |
1122 |
{ |
3670 |
17 Dec 15 |
olle |
var numSections = 1; |
3670 |
17 Dec 15 |
olle |
var textField = Doc.element(textFieldBase+i); |
3670 |
17 Dec 15 |
olle |
if (textField) |
3670 |
17 Dec 15 |
olle |
1126 |
{ |
3670 |
17 Dec 15 |
olle |
var text = textField.value; |
3670 |
17 Dec 15 |
olle |
if (text && text != '') |
3670 |
17 Dec 15 |
olle |
1129 |
{ |
3670 |
17 Dec 15 |
olle |
// If comment "Utkarvad." and not "MNB." => number of sections set to 0 |
3670 |
17 Dec 15 |
olle |
if (text.indexOf('Utkarvad.') >= 0 && text.indexOf('MNB.') < 0) |
3670 |
17 Dec 15 |
olle |
1132 |
{ |
3670 |
17 Dec 15 |
olle |
numSections = 0; |
3670 |
17 Dec 15 |
olle |
1134 |
} |
3670 |
17 Dec 15 |
olle |
1135 |
} |
3670 |
17 Dec 15 |
olle |
1136 |
} |
3670 |
17 Dec 15 |
olle |
frm['nofSections.'+i].value = numSections; |
3670 |
17 Dec 15 |
olle |
1138 |
} |
3670 |
17 Dec 15 |
olle |
1139 |
} |
3670 |
17 Dec 15 |
olle |
1140 |
|
2933 |
14 Nov 14 |
olle |
persinfo.storagePositionsLoaded = function(response) |
2933 |
14 Nov 14 |
olle |
1142 |
{ |
2933 |
14 Nov 14 |
olle |
var freeWells = response.wells; |
2933 |
14 Nov 14 |
olle |
var frm = document.forms['meludi']; |
3028 |
11 Dec 14 |
olle |
var tubeContentType = frm.tubeContentType.value; |
2933 |
14 Nov 14 |
olle |
var nofTubes = parseInt(frm.nofTubes.value); |
4246 |
21 Nov 16 |
olle |
var extractsFromFirstSpecimenOnly = frm.extractsFromFirstSpecimenOnlyCB.checked; |
2933 |
14 Nov 14 |
olle |
1148 |
|
2933 |
14 Nov 14 |
olle |
// No storage space is allocated for first specimen, |
2933 |
14 Nov 14 |
olle |
// since all amount is expected to be used for analysis. |
2933 |
14 Nov 14 |
olle |
// Specimen tube with i == 0 is therefore skipped. |
3276 |
29 Apr 15 |
olle |
if (tubeContentType == 'Specimen') |
2933 |
14 Nov 14 |
olle |
1153 |
{ |
3276 |
29 Apr 15 |
olle |
for (var i = 0; i < nofTubes; i++) |
3276 |
29 Apr 15 |
olle |
1155 |
{ |
3276 |
29 Apr 15 |
olle |
wellIndex = 3*i; |
3276 |
29 Apr 15 |
olle |
var specWell = null; |
3276 |
29 Apr 15 |
olle |
if (i > 0) |
3276 |
29 Apr 15 |
olle |
1159 |
{ |
3276 |
29 Apr 15 |
olle |
specWell = freeWells[wellIndex]; |
3276 |
29 Apr 15 |
olle |
if (!specWell || specWell == '') |
3276 |
29 Apr 15 |
olle |
1162 |
{ |
3276 |
29 Apr 15 |
olle |
Wizard.setInputStatus('box.'+i, 'invalid', 'Missing box'); |
3276 |
29 Apr 15 |
olle |
return; |
3276 |
29 Apr 15 |
olle |
1165 |
} |
3276 |
29 Apr 15 |
olle |
1166 |
} |
4246 |
21 Nov 16 |
olle |
var dnaWell = null; |
4246 |
21 Nov 16 |
olle |
if (i == 0 || !extractsFromFirstSpecimenOnly) |
3276 |
29 Apr 15 |
olle |
1169 |
{ |
4246 |
21 Nov 16 |
olle |
dnaWell = freeWells[wellIndex+1]; |
4246 |
21 Nov 16 |
olle |
if (!dnaWell || dnaWell == '') |
4246 |
21 Nov 16 |
olle |
1172 |
{ |
4246 |
21 Nov 16 |
olle |
Wizard.setInputStatus('dnaBox.'+i, 'invalid', 'Missing box'); |
4246 |
21 Nov 16 |
olle |
return; |
4246 |
21 Nov 16 |
olle |
1175 |
} |
3276 |
29 Apr 15 |
olle |
1176 |
} |
4246 |
21 Nov 16 |
olle |
var rnaWell = null; |
4246 |
21 Nov 16 |
olle |
if (i == 0 || !extractsFromFirstSpecimenOnly) |
3276 |
29 Apr 15 |
olle |
1179 |
{ |
4246 |
21 Nov 16 |
olle |
rnaWell = freeWells[wellIndex+2]; |
4246 |
21 Nov 16 |
olle |
if (!rnaWell || rnaWell == '') |
4246 |
21 Nov 16 |
olle |
1182 |
{ |
4246 |
21 Nov 16 |
olle |
Wizard.setInputStatus('rnaBox.'+i, 'invalid', 'Missing box'); |
4246 |
21 Nov 16 |
olle |
return; |
4246 |
21 Nov 16 |
olle |
1185 |
} |
3276 |
29 Apr 15 |
olle |
1186 |
} |
3276 |
29 Apr 15 |
olle |
1187 |
|
3276 |
29 Apr 15 |
olle |
// Update form fields for storage plates |
3276 |
29 Apr 15 |
olle |
if (specWell) |
3276 |
29 Apr 15 |
olle |
1190 |
{ |
3276 |
29 Apr 15 |
olle |
frm['box.'+i].value = specWell.bioPlate.name; |
3276 |
29 Apr 15 |
olle |
frm['row.'+i].value = Meludi.wellToAlpha(specWell.row); |
3276 |
29 Apr 15 |
olle |
frm['column.'+i].value = specWell.column+1; |
3276 |
29 Apr 15 |
olle |
1194 |
} |
3276 |
29 Apr 15 |
olle |
1195 |
|
3276 |
29 Apr 15 |
olle |
if (dnaWell) |
3276 |
29 Apr 15 |
olle |
1197 |
{ |
3276 |
29 Apr 15 |
olle |
frm['dnaBox.'+i].value = dnaWell.bioPlate.name; |
3276 |
29 Apr 15 |
olle |
frm['dnaRow.'+i].value = Meludi.wellToAlpha(dnaWell.row); |
3276 |
29 Apr 15 |
olle |
frm['dnaColumn.'+i].value = dnaWell.column+1; |
3276 |
29 Apr 15 |
olle |
1201 |
} |
3276 |
29 Apr 15 |
olle |
1202 |
|
3276 |
29 Apr 15 |
olle |
if (rnaWell) |
3276 |
29 Apr 15 |
olle |
1204 |
{ |
3276 |
29 Apr 15 |
olle |
frm['rnaBox.'+i].value = rnaWell.bioPlate.name; |
3276 |
29 Apr 15 |
olle |
frm['rnaRow.'+i].value = Meludi.wellToAlpha(rnaWell.row); |
3276 |
29 Apr 15 |
olle |
frm['rnaColumn.'+i].value = rnaWell.column+1; |
3276 |
29 Apr 15 |
olle |
1208 |
} |
3276 |
29 Apr 15 |
olle |
1209 |
|
3276 |
29 Apr 15 |
olle |
// Move focus to next field |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('box.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'row.'+i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('row.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'column.'+i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('column.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'dnaBox.'+i }); |
3276 |
29 Apr 15 |
olle |
1214 |
|
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('dnaBox.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'dnaRow.'+i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('dnaRow.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'dnaColumn.'+i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('dnaColumn.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'rnaBox.'+i }); |
3276 |
29 Apr 15 |
olle |
1218 |
|
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('rnaBox.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'rnaRow.'+i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('rnaRow.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'rnaColumn.'+i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('rnaColumn.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'nofSections.'+i }); |
3276 |
29 Apr 15 |
olle |
1222 |
|
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('nofSections.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'comment.'+i }); |
3276 |
29 Apr 15 |
olle |
1224 |
|
3276 |
29 Apr 15 |
olle |
// Form validation |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('column.'+i, 'keypress', Events.integerOnly); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('box.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'Specimen', 'index': i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('row.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'Specimen', 'index': i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('column.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'Specimen', 'index': i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('box.'+i, 'keyup', persinfo.boxOnKeyUp, { 'boxtype': 'Specimen'}); |
3276 |
29 Apr 15 |
olle |
1231 |
|
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('dnaColumn.'+i, 'keypress', Events.integerOnly); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('dnaBox.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'DNA', 'index': i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('dnaRow.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'DNA', 'index': i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('dnaColumn.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'DNA', 'index': i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('dnaBox.'+i, 'keyup', persinfo.boxOnKeyUp, { 'boxtype': 'DNA'}); |
3276 |
29 Apr 15 |
olle |
1237 |
|
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('rnaColumn.'+i, 'keypress', Events.integerOnly); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('rnaBox.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'RNA', 'index': i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('rnaRow.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'RNA', 'index': i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('rnaColumn.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'RNA', 'index': i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('rnaBox.'+i, 'keyup', persinfo.boxOnKeyUp, { 'boxtype': 'RNA'}); |
3276 |
29 Apr 15 |
olle |
1243 |
|
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('nofSections.'+i, 'keypress', Events.integerOnly); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('nofSections.'+i, 'change', persinfo.nofSectionsOnChange, { 'index': i }); |
3276 |
29 Apr 15 |
olle |
1246 |
|
3276 |
29 Apr 15 |
olle |
wellIsValid[i] = true; |
3276 |
29 Apr 15 |
olle |
dnaWellIsValid[i] = true; |
3276 |
29 Apr 15 |
olle |
rnaWellIsValid[i] = true; |
3276 |
29 Apr 15 |
olle |
1250 |
/* |
3276 |
29 Apr 15 |
olle |
Wizard.setInputStatus('position.'+i, 'valid'); |
3276 |
29 Apr 15 |
olle |
1252 |
*/ |
3276 |
29 Apr 15 |
olle |
Wizard.setInputStatus('box.'+i, 'valid'); |
4246 |
21 Nov 16 |
olle |
if (i == 0 || !extractsFromFirstSpecimenOnly) |
4246 |
21 Nov 16 |
olle |
1255 |
{ |
4246 |
21 Nov 16 |
olle |
Wizard.setInputStatus('dnaBox.'+i, 'valid'); |
4246 |
21 Nov 16 |
olle |
Wizard.setInputStatus('rnaBox.'+i, 'valid'); |
4246 |
21 Nov 16 |
olle |
1258 |
} |
3276 |
29 Apr 15 |
olle |
if (tubeContentType == 'Specimen') |
3276 |
29 Apr 15 |
olle |
1260 |
{ |
3276 |
29 Apr 15 |
olle |
Wizard.setInputStatus('nofSections.'+i, 'valid'); |
3276 |
29 Apr 15 |
olle |
1262 |
} |
3276 |
29 Apr 15 |
olle |
1263 |
} |
3028 |
11 Dec 14 |
olle |
1264 |
} |
3276 |
29 Apr 15 |
olle |
else if (tubeContentType == 'DNA' || tubeContentType == 'RNA' || tubeContentType == 'DNA_RNA') |
3028 |
11 Dec 14 |
olle |
1266 |
{ |
3276 |
29 Apr 15 |
olle |
for (var i = 0; i < nofTubes; i++) |
3028 |
11 Dec 14 |
olle |
1268 |
{ |
3276 |
29 Apr 15 |
olle |
var wellIndex = i; |
3276 |
29 Apr 15 |
olle |
var well = freeWells[wellIndex]; |
3276 |
29 Apr 15 |
olle |
if (!well || well == '') |
3276 |
29 Apr 15 |
olle |
1272 |
{ |
3276 |
29 Apr 15 |
olle |
Wizard.setInputStatus('box.'+i, 'invalid', 'Missing box'); |
3276 |
29 Apr 15 |
olle |
return; |
3276 |
29 Apr 15 |
olle |
1275 |
} |
3276 |
29 Apr 15 |
olle |
frm['box.'+i].value = well.bioPlate.name; |
3276 |
29 Apr 15 |
olle |
frm['row.'+i].value = Meludi.wellToAlpha(well.row); |
3276 |
29 Apr 15 |
olle |
frm['column.'+i].value = well.column+1; |
2933 |
14 Nov 14 |
olle |
1279 |
|
3276 |
29 Apr 15 |
olle |
// Move focus to next field |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('box.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'row.'+i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('row.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'column.'+i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('column.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'nofSections.'+i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('nofSections.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'comment.'+i }); |
2933 |
14 Nov 14 |
olle |
1285 |
|
3276 |
29 Apr 15 |
olle |
// Form validation |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('column.'+i, 'keypress', Events.integerOnly); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('box.'+i, 'change', persinfo.wellOnChange, { 'index': i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('row.'+i, 'change', persinfo.wellOnChange, { 'index': i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('column.'+i, 'change', persinfo.wellOnChange, { 'index': i }); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('box.'+i, 'keyup', persinfo.boxOnKeyUp); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('nofSections.'+i, 'keypress', Events.integerOnly); |
3276 |
29 Apr 15 |
olle |
Events.addEventHandler('nofSections.'+i, 'change', persinfo.nofSectionsOnChange, { 'index': i }); |
2933 |
14 Nov 14 |
olle |
1294 |
|
3276 |
29 Apr 15 |
olle |
wellIsValid[i] = true; |
3276 |
29 Apr 15 |
olle |
1296 |
/* |
3276 |
29 Apr 15 |
olle |
Wizard.setInputStatus('position.'+i, 'valid'); |
3276 |
29 Apr 15 |
olle |
1298 |
*/ |
3276 |
29 Apr 15 |
olle |
Wizard.setInputStatus('box.'+i, 'valid'); |
3276 |
29 Apr 15 |
olle |
if (tubeContentType == 'Specimen') |
3276 |
29 Apr 15 |
olle |
1301 |
{ |
3276 |
29 Apr 15 |
olle |
Wizard.setInputStatus('nofSections.'+i, 'valid'); |
3276 |
29 Apr 15 |
olle |
1303 |
} |
3028 |
11 Dec 14 |
olle |
1304 |
} |
2933 |
14 Nov 14 |
olle |
1305 |
} |
2933 |
14 Nov 14 |
olle |
1306 |
} |
3028 |
11 Dec 14 |
olle |
1307 |
|
3028 |
11 Dec 14 |
olle |
persinfo.fixNofTubes = function(tubeContentType, nofTubes) |
3028 |
11 Dec 14 |
olle |
1309 |
{ |
3028 |
11 Dec 14 |
olle |
if (tubeContentType == 'DNA') |
3028 |
11 Dec 14 |
olle |
1311 |
{ |
3028 |
11 Dec 14 |
olle |
nofTubes = 1; |
3028 |
11 Dec 14 |
olle |
1313 |
} |
3028 |
11 Dec 14 |
olle |
else if (tubeContentType == 'RNA') |
3028 |
11 Dec 14 |
olle |
1315 |
{ |
3028 |
11 Dec 14 |
olle |
nofTubes = 1; |
3028 |
11 Dec 14 |
olle |
1317 |
} |
3028 |
11 Dec 14 |
olle |
else if (tubeContentType == 'DNA_RNA') |
3028 |
11 Dec 14 |
olle |
1319 |
{ |
3028 |
11 Dec 14 |
olle |
nofTubes = 2; |
3028 |
11 Dec 14 |
olle |
1321 |
} |
3028 |
11 Dec 14 |
olle |
return nofTubes; |
3028 |
11 Dec 14 |
olle |
1323 |
} |
2933 |
14 Nov 14 |
olle |
1324 |
|
3028 |
11 Dec 14 |
olle |
persinfo.fetchStorageBoxSuffix = function(tubeContentType) |
3028 |
11 Dec 14 |
olle |
1326 |
{ |
3028 |
11 Dec 14 |
olle |
var storageBoxSuffix = null; |
3028 |
11 Dec 14 |
olle |
if (tubeContentType == 'Specimen') |
3028 |
11 Dec 14 |
olle |
1329 |
{ |
3028 |
11 Dec 14 |
olle |
storageBoxSuffix = '_sp'; |
3028 |
11 Dec 14 |
olle |
1331 |
} |
3028 |
11 Dec 14 |
olle |
else if (tubeContentType == 'DNA') |
3028 |
11 Dec 14 |
olle |
1333 |
{ |
3253 |
17 Apr 15 |
olle |
storageBoxSuffix = '_dna'; |
3028 |
11 Dec 14 |
olle |
1335 |
} |
3028 |
11 Dec 14 |
olle |
else if (tubeContentType == 'RNA') |
3028 |
11 Dec 14 |
olle |
1337 |
{ |
3028 |
11 Dec 14 |
olle |
storageBoxSuffix = '_rna'; |
3028 |
11 Dec 14 |
olle |
1339 |
} |
3028 |
11 Dec 14 |
olle |
else if (tubeContentType == 'DNA_RNA') |
3028 |
11 Dec 14 |
olle |
1341 |
{ |
3253 |
17 Apr 15 |
olle |
storageBoxSuffix = '_dna_rna'; |
3028 |
11 Dec 14 |
olle |
1343 |
} |
3028 |
11 Dec 14 |
olle |
return storageBoxSuffix; |
3028 |
11 Dec 14 |
olle |
1345 |
} |
3028 |
11 Dec 14 |
olle |
1346 |
|
3028 |
11 Dec 14 |
olle |
persinfo.fetchTubeContentTypeName = function(tubeContentType, tubeIndex) |
3028 |
11 Dec 14 |
olle |
1348 |
{ |
3028 |
11 Dec 14 |
olle |
var tubeContentTypeName = tubeContentType; |
3028 |
11 Dec 14 |
olle |
if (tubeContentType == 'DNA_RNA') |
3028 |
11 Dec 14 |
olle |
1351 |
{ |
3028 |
11 Dec 14 |
olle |
if (tubeIndex == 0) |
3028 |
11 Dec 14 |
olle |
1353 |
{ |
3028 |
11 Dec 14 |
olle |
tubeContentTypeName = 'DNA'; |
3028 |
11 Dec 14 |
olle |
1355 |
} |
3028 |
11 Dec 14 |
olle |
else if (tubeIndex == 1) |
3028 |
11 Dec 14 |
olle |
1357 |
{ |
3028 |
11 Dec 14 |
olle |
tubeContentTypeName = 'RNA'; |
3028 |
11 Dec 14 |
olle |
1359 |
} |
3028 |
11 Dec 14 |
olle |
1360 |
} |
3028 |
11 Dec 14 |
olle |
return tubeContentTypeName; |
3028 |
11 Dec 14 |
olle |
1362 |
} |
3028 |
11 Dec 14 |
olle |
1363 |
|
3028 |
11 Dec 14 |
olle |
persinfo.fetchTubeContentTypeNameInternal = function(tubeContentType, tubeContentTypeName) |
3028 |
11 Dec 14 |
olle |
1365 |
{ |
3028 |
11 Dec 14 |
olle |
var tubeContentTypeNameInternal = tubeContentTypeName; |
3028 |
11 Dec 14 |
olle |
// Convert all names except abbreviations to all lower case |
3028 |
11 Dec 14 |
olle |
if (tubeContentType == 'Specimen') |
3028 |
11 Dec 14 |
olle |
1369 |
{ |
3028 |
11 Dec 14 |
olle |
tubeContentTypeNameInternal = tubeContentTypeName.toLowerCase(); |
3028 |
11 Dec 14 |
olle |
1371 |
} |
3028 |
11 Dec 14 |
olle |
return tubeContentTypeNameInternal; |
3028 |
11 Dec 14 |
olle |
1373 |
} |
3028 |
11 Dec 14 |
olle |
1374 |
|
3028 |
11 Dec 14 |
olle |
persinfo.fetchTubeName = function(tubeContentType, caseInfo, tubeIndex) |
3028 |
11 Dec 14 |
olle |
1376 |
{ |
3028 |
11 Dec 14 |
olle |
var tubeName = Strings.encodeTags(caseInfo.originalName); |
3028 |
11 Dec 14 |
olle |
if (tubeContentType == 'Specimen') |
3028 |
11 Dec 14 |
olle |
1379 |
{ |
3028 |
11 Dec 14 |
olle |
var tubeNo = tubeIndex + caseInfo.specimenFirstIndex; |
3028 |
11 Dec 14 |
olle |
tubeName = tubeName+'.'+tubeNo; |
3028 |
11 Dec 14 |
olle |
1382 |
} |
3028 |
11 Dec 14 |
olle |
else if (tubeContentType == 'DNA') |
3028 |
11 Dec 14 |
olle |
1384 |
{ |
3028 |
11 Dec 14 |
olle |
tubeName = tubeName+'.d'; |
3028 |
11 Dec 14 |
olle |
1386 |
} |
3028 |
11 Dec 14 |
olle |
else if (tubeContentType == 'RNA') |
3028 |
11 Dec 14 |
olle |
1388 |
{ |
3028 |
11 Dec 14 |
olle |
tubeName = tubeName+'.r'; |
3028 |
11 Dec 14 |
olle |
1390 |
} |
3028 |
11 Dec 14 |
olle |
else if (tubeContentType == 'DNA_RNA') |
3028 |
11 Dec 14 |
olle |
1392 |
{ |
3028 |
11 Dec 14 |
olle |
if (tubeIndex == 0) |
3028 |
11 Dec 14 |
olle |
1394 |
{ |
3028 |
11 Dec 14 |
olle |
tubeName = tubeName+'.d'; |
3028 |
11 Dec 14 |
olle |
1396 |
} |
3028 |
11 Dec 14 |
olle |
else if (tubeIndex == 1) |
3028 |
11 Dec 14 |
olle |
1398 |
{ |
3028 |
11 Dec 14 |
olle |
tubeName = tubeName+'.r'; |
3028 |
11 Dec 14 |
olle |
1400 |
} |
3028 |
11 Dec 14 |
olle |
1401 |
} |
3028 |
11 Dec 14 |
olle |
return tubeName; |
3028 |
11 Dec 14 |
olle |
1403 |
} |
3028 |
11 Dec 14 |
olle |
1404 |
|
3028 |
11 Dec 14 |
olle |
persinfo.fetchTubeIdentifier = function(tubeContentType, tubeName, tubeNo) |
3028 |
11 Dec 14 |
olle |
1406 |
{ |
3028 |
11 Dec 14 |
olle |
var tubeIdentifier = tubeName; |
3028 |
11 Dec 14 |
olle |
if (tubeContentType == 'Specimen') |
3028 |
11 Dec 14 |
olle |
1409 |
{ |
3028 |
11 Dec 14 |
olle |
tubeIdentifier = tubeNo; |
3028 |
11 Dec 14 |
olle |
1411 |
} |
3028 |
11 Dec 14 |
olle |
return tubeIdentifier; |
3028 |
11 Dec 14 |
olle |
1413 |
} |
3028 |
11 Dec 14 |
olle |
1414 |
|
2933 |
14 Nov 14 |
olle |
persinfo.boxOnKeyUp = function(event) |
2933 |
14 Nov 14 |
olle |
1416 |
{ |
2933 |
14 Nov 14 |
olle |
var frm = document.forms['meludi']; |
3028 |
11 Dec 14 |
olle |
var tubeContentType = frm.tubeContentType.value; |
2933 |
14 Nov 14 |
olle |
1419 |
|
3276 |
29 Apr 15 |
olle |
var boxType = Data.get(event.currentTarget, 'boxtype'); |
2933 |
14 Nov 14 |
olle |
var index = Data.int(event.currentTarget, 'index'); |
2933 |
14 Nov 14 |
olle |
1422 |
|
3276 |
29 Apr 15 |
olle |
// Get box prefix, default is for input tubes |
3276 |
29 Apr 15 |
olle |
var boxPrefix = 'box.'; |
3276 |
29 Apr 15 |
olle |
if (boxType && boxType == 'DNA') |
3276 |
29 Apr 15 |
olle |
1426 |
{ |
3276 |
29 Apr 15 |
olle |
boxPrefix = 'dnaBox.'; |
3276 |
29 Apr 15 |
olle |
1428 |
} |
3276 |
29 Apr 15 |
olle |
if (boxType && boxType == 'RNA') |
3276 |
29 Apr 15 |
olle |
1430 |
{ |
3276 |
29 Apr 15 |
olle |
boxPrefix = 'rnaBox.'; |
3276 |
29 Apr 15 |
olle |
1432 |
} |
3276 |
29 Apr 15 |
olle |
1433 |
|
3028 |
11 Dec 14 |
olle |
// Check box name |
3028 |
11 Dec 14 |
olle |
var boxIsValid = true; |
3276 |
29 Apr 15 |
olle |
var box = frm[boxPrefix+index].value; |
3276 |
29 Apr 15 |
olle |
Wizard.setInputStatus(boxPrefix+index); |
3028 |
11 Dec 14 |
olle |
// Check for prefix "ML_" |
3028 |
11 Dec 14 |
olle |
if (box.indexOf('ML_') != 0) |
2933 |
14 Nov 14 |
olle |
1440 |
{ |
3028 |
11 Dec 14 |
olle |
boxIsValid = false; |
2933 |
14 Nov 14 |
olle |
1442 |
} |
3028 |
11 Dec 14 |
olle |
var suffix = '_sp'; |
3276 |
29 Apr 15 |
olle |
if (tubeContentType == 'DNA' || (boxType && boxType == 'DNA')) |
3028 |
11 Dec 14 |
olle |
1445 |
{ |
3253 |
17 Apr 15 |
olle |
suffix = '_dna'; |
3253 |
17 Apr 15 |
olle |
1447 |
} |
3276 |
29 Apr 15 |
olle |
else if (tubeContentType == 'RNA' || (boxType && boxType == 'RNA')) |
3253 |
17 Apr 15 |
olle |
1449 |
{ |
3028 |
11 Dec 14 |
olle |
suffix = '_rna'; |
3028 |
11 Dec 14 |
olle |
1451 |
} |
3028 |
11 Dec 14 |
olle |
// Check for suffix |
3028 |
11 Dec 14 |
olle |
if (box.indexOf(suffix) != (box.length - suffix.length)) |
3028 |
11 Dec 14 |
olle |
1454 |
{ |
3028 |
11 Dec 14 |
olle |
boxIsValid = false; |
3028 |
11 Dec 14 |
olle |
1456 |
} |
3028 |
11 Dec 14 |
olle |
1457 |
|
3028 |
11 Dec 14 |
olle |
if (!boxIsValid) |
3028 |
11 Dec 14 |
olle |
1459 |
{ |
3276 |
29 Apr 15 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'invalid', 'Box name must start with "ML_" and end with "'+suffix+'"'); |
3028 |
11 Dec 14 |
olle |
return; |
3028 |
11 Dec 14 |
olle |
1462 |
} |
2933 |
14 Nov 14 |
olle |
1463 |
} |
2933 |
14 Nov 14 |
olle |
1464 |
|
2933 |
14 Nov 14 |
olle |
persinfo.wellOnChange = function(event) |
2933 |
14 Nov 14 |
olle |
1466 |
{ |
2933 |
14 Nov 14 |
olle |
var frm = document.forms['meludi']; |
2933 |
14 Nov 14 |
olle |
var target = event.currentTarget; |
2933 |
14 Nov 14 |
olle |
1469 |
|
3276 |
29 Apr 15 |
olle |
var boxType = Data.get(target, 'boxtype'); |
2933 |
14 Nov 14 |
olle |
var index = Data.int(target, 'index'); |
3276 |
29 Apr 15 |
olle |
1472 |
|
3276 |
29 Apr 15 |
olle |
// Get well position prefixes, default is for input tubes |
3276 |
29 Apr 15 |
olle |
var boxPrefix = 'box.'; |
3276 |
29 Apr 15 |
olle |
var rowPrefix = 'row.'; |
3276 |
29 Apr 15 |
olle |
var columnPrefix = 'column.'; |
3276 |
29 Apr 15 |
olle |
if (boxType && boxType == 'DNA') |
3276 |
29 Apr 15 |
olle |
1478 |
{ |
3276 |
29 Apr 15 |
olle |
boxPrefix = 'dnaBox.'; |
3276 |
29 Apr 15 |
olle |
rowPrefix = 'dnaRow.'; |
3276 |
29 Apr 15 |
olle |
columnPrefix = 'dnaColumn.'; |
3276 |
29 Apr 15 |
olle |
1482 |
} |
3276 |
29 Apr 15 |
olle |
if (boxType && boxType == 'RNA') |
3276 |
29 Apr 15 |
olle |
1484 |
{ |
3276 |
29 Apr 15 |
olle |
boxPrefix = 'rnaBox.'; |
3276 |
29 Apr 15 |
olle |
rowPrefix = 'rnaRow.'; |
3276 |
29 Apr 15 |
olle |
columnPrefix = 'rnaColumn.'; |
3276 |
29 Apr 15 |
olle |
1488 |
} |
3276 |
29 Apr 15 |
olle |
var box = frm[boxPrefix+index].value; |
3276 |
29 Apr 15 |
olle |
var row = frm[rowPrefix+index].value; |
3276 |
29 Apr 15 |
olle |
var column = frm[columnPrefix+index].value; |
2933 |
14 Nov 14 |
olle |
1492 |
|
3276 |
29 Apr 15 |
olle |
//wellIsValid[index] = true; |
3276 |
29 Apr 15 |
olle |
if (!boxType || boxType == 'Specimen') |
3276 |
29 Apr 15 |
olle |
1495 |
{ |
3276 |
29 Apr 15 |
olle |
wellIsValid[index] = false; |
3276 |
29 Apr 15 |
olle |
1497 |
} |
3276 |
29 Apr 15 |
olle |
else if (boxType && boxType == 'DNA') |
3276 |
29 Apr 15 |
olle |
1499 |
{ |
3276 |
29 Apr 15 |
olle |
dnaWellIsValid[index] = false; |
3276 |
29 Apr 15 |
olle |
1501 |
} |
3276 |
29 Apr 15 |
olle |
else if (boxType && boxType == 'RNA') |
3276 |
29 Apr 15 |
olle |
1503 |
{ |
3276 |
29 Apr 15 |
olle |
rnaWellIsValid[index] = false; |
3276 |
29 Apr 15 |
olle |
1505 |
} |
3276 |
29 Apr 15 |
olle |
else |
3276 |
29 Apr 15 |
olle |
1507 |
{ |
3276 |
29 Apr 15 |
olle |
wellIsValid[index] = false; |
3276 |
29 Apr 15 |
olle |
1509 |
} |
3276 |
29 Apr 15 |
olle |
Wizard.setInputStatus(boxPrefix+index); |
3276 |
29 Apr 15 |
olle |
1511 |
/* |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('position.'+index); |
3276 |
29 Apr 15 |
olle |
1513 |
*/ |
2933 |
14 Nov 14 |
olle |
1514 |
|
2933 |
14 Nov 14 |
olle |
if (box == '') |
2933 |
14 Nov 14 |
olle |
1516 |
{ |
3276 |
29 Apr 15 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'invalid', 'Missing box'); |
2933 |
14 Nov 14 |
olle |
return; |
2933 |
14 Nov 14 |
olle |
1519 |
} |
2933 |
14 Nov 14 |
olle |
1520 |
|
3276 |
29 Apr 15 |
olle |
// Position errors are reported on box message line |
2933 |
14 Nov 14 |
olle |
if (row == '') |
2933 |
14 Nov 14 |
olle |
1523 |
{ |
3276 |
29 Apr 15 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'invalid', 'Missing row'); |
2933 |
14 Nov 14 |
olle |
return; |
2933 |
14 Nov 14 |
olle |
1526 |
} |
2933 |
14 Nov 14 |
olle |
1527 |
|
2933 |
14 Nov 14 |
olle |
if (column == '') |
2933 |
14 Nov 14 |
olle |
1529 |
{ |
3276 |
29 Apr 15 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'invalid', 'Missing column'); |
2933 |
14 Nov 14 |
olle |
return; |
2933 |
14 Nov 14 |
olle |
1532 |
} |
2933 |
14 Nov 14 |
olle |
1533 |
|
2933 |
14 Nov 14 |
olle |
// Check for duplicates |
2933 |
14 Nov 14 |
olle |
var nofTubes = parseInt(frm.nofTubes.value); |
2933 |
14 Nov 14 |
olle |
for (var i=0; i < nofTubes; i++) |
2933 |
14 Nov 14 |
olle |
1537 |
{ |
2933 |
14 Nov 14 |
olle |
if (i != index) |
2933 |
14 Nov 14 |
olle |
1539 |
{ |
3276 |
29 Apr 15 |
olle |
if (box == frm.elements[boxPrefix+i].value && row == frm[rowPrefix+i].value && column == frm[columnPrefix+i].value) |
2933 |
14 Nov 14 |
olle |
1541 |
{ |
3276 |
29 Apr 15 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'invalid', 'The position is already used once in this wizard'); |
2933 |
14 Nov 14 |
olle |
return; |
2933 |
14 Nov 14 |
olle |
1544 |
} |
2933 |
14 Nov 14 |
olle |
1545 |
} |
2933 |
14 Nov 14 |
olle |
1546 |
} |
2933 |
14 Nov 14 |
olle |
1547 |
|
3276 |
29 Apr 15 |
olle |
//Wizard.setInputStatus('position.'+index, 'checking', 'Checking...'); |
3276 |
29 Apr 15 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'checking', 'Checking...'); |
2933 |
14 Nov 14 |
olle |
1550 |
|
2933 |
14 Nov 14 |
olle |
// Seems to be ok -- check if used by another sample |
2933 |
14 Nov 14 |
olle |
var request = Ajax.getXmlHttpRequest(); |
2933 |
14 Nov 14 |
olle |
var url = '../SpecimenTubeRegistration.servlet?ID='+App.getSessionId(); |
2933 |
14 Nov 14 |
olle |
url += '&cmd=ValidateWell'; |
2933 |
14 Nov 14 |
olle |
url += '&box=' + encodeURIComponent(box); |
2933 |
14 Nov 14 |
olle |
url += '&row=' + encodeURIComponent(row); |
2933 |
14 Nov 14 |
olle |
url += '&column=' + encodeURIComponent(column); |
2933 |
14 Nov 14 |
olle |
1558 |
|
3276 |
29 Apr 15 |
olle |
Wizard.asyncJsonRequest(url, function(response) { persinfo.onBoxValidated(response, boxType, index) } ); |
2933 |
14 Nov 14 |
olle |
1560 |
} |
2933 |
14 Nov 14 |
olle |
1561 |
|
3276 |
29 Apr 15 |
olle |
persinfo.onBoxValidated = function(response, boxType, index) |
2933 |
14 Nov 14 |
olle |
1563 |
{ |
3276 |
29 Apr 15 |
olle |
// Get well position prefixes, default is for input tubes |
3276 |
29 Apr 15 |
olle |
var boxPrefix = 'box.'; |
3276 |
29 Apr 15 |
olle |
if (boxType && boxType == 'DNA') |
3276 |
29 Apr 15 |
olle |
1567 |
{ |
3276 |
29 Apr 15 |
olle |
boxPrefix = 'dnaBox.'; |
3276 |
29 Apr 15 |
olle |
1569 |
} |
3276 |
29 Apr 15 |
olle |
if (boxType && boxType == 'RNA') |
3276 |
29 Apr 15 |
olle |
1571 |
{ |
3276 |
29 Apr 15 |
olle |
boxPrefix = 'rnaBox.'; |
3276 |
29 Apr 15 |
olle |
1573 |
} |
3276 |
29 Apr 15 |
olle |
1574 |
|
3276 |
29 Apr 15 |
olle |
//Wizard.setInputStatus('position.'+index); |
3276 |
29 Apr 15 |
olle |
Wizard.setInputStatus(boxPrefix+index); |
2933 |
14 Nov 14 |
olle |
if (response.message) |
2933 |
14 Nov 14 |
olle |
1578 |
{ |
3276 |
29 Apr 15 |
olle |
//Wizard.setInputStatus(response.box ? 'box.'+index : 'position.'+index, 'invalid', Strings.encodeTags(response.message)); |
3276 |
29 Apr 15 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'invalid', Strings.encodeTags(response.message)); |
2933 |
14 Nov 14 |
olle |
return; |
2933 |
14 Nov 14 |
olle |
1582 |
} |
2933 |
14 Nov 14 |
olle |
1583 |
|
3276 |
29 Apr 15 |
olle |
//wellIsValid[index] = true; |
3276 |
29 Apr 15 |
olle |
if (!boxType || boxType == 'Specimen') |
3276 |
29 Apr 15 |
olle |
1586 |
{ |
3276 |
29 Apr 15 |
olle |
wellIsValid[index] = true; |
3276 |
29 Apr 15 |
olle |
1588 |
} |
3276 |
29 Apr 15 |
olle |
else if (boxType && boxType == 'DNA') |
3276 |
29 Apr 15 |
olle |
1590 |
{ |
3276 |
29 Apr 15 |
olle |
dnaWellIsValid[index] = true; |
3276 |
29 Apr 15 |
olle |
1592 |
} |
3276 |
29 Apr 15 |
olle |
else if (boxType && boxType == 'RNA') |
3276 |
29 Apr 15 |
olle |
1594 |
{ |
3276 |
29 Apr 15 |
olle |
rnaWellIsValid[index] = true; |
3276 |
29 Apr 15 |
olle |
1596 |
} |
3276 |
29 Apr 15 |
olle |
else |
3276 |
29 Apr 15 |
olle |
1598 |
{ |
3276 |
29 Apr 15 |
olle |
wellIsValid[index] = true; |
3276 |
29 Apr 15 |
olle |
1600 |
} |
3276 |
29 Apr 15 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'valid'); |
3276 |
29 Apr 15 |
olle |
1602 |
/* |
2933 |
14 Nov 14 |
olle |
Wizard.setInputStatus('position.'+index, 'valid'); |
3276 |
29 Apr 15 |
olle |
1604 |
*/ |
2933 |
14 Nov 14 |
olle |
1605 |
} |
2933 |
14 Nov 14 |
olle |
1606 |
|
3028 |
11 Dec 14 |
olle |
persinfo.nofSectionsOnChange = function(event) |
3028 |
11 Dec 14 |
olle |
1608 |
{ |
3028 |
11 Dec 14 |
olle |
var frm = document.forms['meludi']; |
3028 |
11 Dec 14 |
olle |
var target = event.currentTarget; |
3028 |
11 Dec 14 |
olle |
1611 |
|
3028 |
11 Dec 14 |
olle |
var index = Data.int(target, 'index'); |
3028 |
11 Dec 14 |
olle |
var nofSections = frm['nofSections.'+index].value; |
3028 |
11 Dec 14 |
olle |
1614 |
|
3028 |
11 Dec 14 |
olle |
Wizard.setInputStatus('nofSections.'+index); |
3028 |
11 Dec 14 |
olle |
1616 |
|
3028 |
11 Dec 14 |
olle |
if (nofSections == '') |
3028 |
11 Dec 14 |
olle |
1618 |
{ |
3028 |
11 Dec 14 |
olle |
Wizard.setInputStatus('nofSections'+index, 'invalid', 'Missing'); |
3028 |
11 Dec 14 |
olle |
return; |
3028 |
11 Dec 14 |
olle |
1621 |
} |
3028 |
11 Dec 14 |
olle |
if (parseInt(nofSections) < 1) |
3028 |
11 Dec 14 |
olle |
1623 |
{ |
3028 |
11 Dec 14 |
olle |
Wizard.setInputStatus('nofSections'+index, 'invalid', 'Must be at least 1'); |
3028 |
11 Dec 14 |
olle |
return; |
3028 |
11 Dec 14 |
olle |
1626 |
} |
3028 |
11 Dec 14 |
olle |
Wizard.setInputStatus('nofSections'+index, 'valid'); |
3028 |
11 Dec 14 |
olle |
1628 |
} |
3028 |
11 Dec 14 |
olle |
1629 |
|
2933 |
14 Nov 14 |
olle |
persinfo.validateStep4 = function(event) |
2933 |
14 Nov 14 |
olle |
1631 |
{ |
2933 |
14 Nov 14 |
olle |
var valid = false; |
2933 |
14 Nov 14 |
olle |
1633 |
|
3276 |
29 Apr 15 |
olle |
var frm = document.forms['meludi']; |
3276 |
29 Apr 15 |
olle |
var tubeContentType = frm.tubeContentType.value; |
3276 |
29 Apr 15 |
olle |
if (tubeContentType == 'Specimen') |
2933 |
14 Nov 14 |
olle |
1637 |
{ |
3276 |
29 Apr 15 |
olle |
for (var i = 0; i < wellIsValid.length; i++) |
2933 |
14 Nov 14 |
olle |
1639 |
{ |
3276 |
29 Apr 15 |
olle |
// No storage space is allocated for first specimen, |
3276 |
29 Apr 15 |
olle |
// since all amount is expected to be used for analysis. |
3276 |
29 Apr 15 |
olle |
// Specimen tube with i == 0 is therefore skipped. |
3276 |
29 Apr 15 |
olle |
if (i > 0) |
3276 |
29 Apr 15 |
olle |
1644 |
{ |
3276 |
29 Apr 15 |
olle |
if (!wellIsValid[i]) |
3276 |
29 Apr 15 |
olle |
1646 |
{ |
3276 |
29 Apr 15 |
olle |
event.preventDefault(); |
3276 |
29 Apr 15 |
olle |
return; |
3276 |
29 Apr 15 |
olle |
1649 |
} |
3276 |
29 Apr 15 |
olle |
1650 |
} |
3276 |
29 Apr 15 |
olle |
if (!dnaWellIsValid[i]) |
3276 |
29 Apr 15 |
olle |
1652 |
{ |
3276 |
29 Apr 15 |
olle |
event.preventDefault(); |
3276 |
29 Apr 15 |
olle |
return; |
3276 |
29 Apr 15 |
olle |
1655 |
} |
3276 |
29 Apr 15 |
olle |
if (!rnaWellIsValid[i]) |
3276 |
29 Apr 15 |
olle |
1657 |
{ |
3276 |
29 Apr 15 |
olle |
event.preventDefault(); |
3276 |
29 Apr 15 |
olle |
return; |
3276 |
29 Apr 15 |
olle |
1660 |
} |
2933 |
14 Nov 14 |
olle |
1661 |
} |
2933 |
14 Nov 14 |
olle |
1662 |
} |
3276 |
29 Apr 15 |
olle |
else |
3276 |
29 Apr 15 |
olle |
1664 |
{ |
3276 |
29 Apr 15 |
olle |
// Input DNA, RNA, or DNA + RNA |
3276 |
29 Apr 15 |
olle |
for (var i = 0; i < wellIsValid.length; i++) |
3276 |
29 Apr 15 |
olle |
1667 |
{ |
3276 |
29 Apr 15 |
olle |
if (!wellIsValid[i]) |
3276 |
29 Apr 15 |
olle |
1669 |
{ |
3276 |
29 Apr 15 |
olle |
event.preventDefault(); |
3276 |
29 Apr 15 |
olle |
return; |
3276 |
29 Apr 15 |
olle |
1672 |
} |
3276 |
29 Apr 15 |
olle |
1673 |
} |
3276 |
29 Apr 15 |
olle |
1674 |
} |
2933 |
14 Nov 14 |
olle |
1675 |
} |
2933 |
14 Nov 14 |
olle |
1676 |
|
2933 |
14 Nov 14 |
olle |
persinfo.submit = function() |
2933 |
14 Nov 14 |
olle |
1678 |
{ |
2933 |
14 Nov 14 |
olle |
var frm = document.forms['meludi']; |
2933 |
14 Nov 14 |
olle |
var updateMode = caseInfo.id; |
2933 |
14 Nov 14 |
olle |
1681 |
|
2933 |
14 Nov 14 |
olle |
caseInfo.plNumber = frm.plNumber.value; |
2933 |
14 Nov 14 |
olle |
caseInfo.pad = frm.pad.value; |
2933 |
14 Nov 14 |
olle |
caseInfo.samplingDate = Strings.trim(frm.samplingDate.value); |
3028 |
11 Dec 14 |
olle |
caseInfo.tubeContentType = frm.tubeContentType.value; |
2933 |
14 Nov 14 |
olle |
if (!updateMode) |
2933 |
14 Nov 14 |
olle |
1687 |
{ |
2933 |
14 Nov 14 |
olle |
caseInfo.arrivalDate = Strings.trim(frm.arrivalDate.value); |
3123 |
09 Feb 15 |
olle |
caseInfo.mutationAnalysisKras = frm.mutationAnalysisKras.checked; |
3123 |
09 Feb 15 |
olle |
caseInfo.mutationAnalysisNras = frm.mutationAnalysisNras.checked; |
2933 |
14 Nov 14 |
olle |
caseInfo.mutationAnalysisBraf = frm.mutationAnalysisBraf.checked; |
2933 |
14 Nov 14 |
olle |
caseInfo.mutationAnalysisEgfr = frm.mutationAnalysisEgfr.checked; |
3123 |
09 Feb 15 |
olle |
caseInfo.mutationAnalysisAlkEml4 = frm.mutationAnalysisAlkEml4.checked; |
3123 |
09 Feb 15 |
olle |
caseInfo.mutationAnalysisPdgfra = frm.mutationAnalysisPdgfra.checked; |
3123 |
09 Feb 15 |
olle |
caseInfo.mutationAnalysisKit = frm.mutationAnalysisKit.checked; |
4730 |
04 Apr 18 |
olle |
caseInfo.mutationAnalysisTst170 = frm.mutationAnalysisTst170.checked; |
3123 |
09 Feb 15 |
olle |
caseInfo.mutationAnalysisOther = frm.mutationAnalysisOther.checked; |
2933 |
14 Nov 14 |
olle |
caseInfo.site = frm.site.value; |
3028 |
11 Dec 14 |
olle |
caseInfo.specimenType = frm.specimenType.value; |
4195 |
31 Oct 16 |
olle |
caseInfo.specimenInputType = frm.specimenInputType.value; |
2933 |
14 Nov 14 |
olle |
caseInfo.projectFocus = frm.projectFocus.value; |
4732 |
04 Apr 18 |
olle |
caseInfo.metastasisSite = frm.metastasisSite.value; |
3067 |
08 Jan 15 |
olle |
caseInfo.viableTumourCellsPercent = frm.viableTumourCellsPercent.value; |
2933 |
14 Nov 14 |
olle |
caseInfo.otherPathNote = frm.otherPathNote.value; |
4246 |
21 Nov 16 |
olle |
caseInfo.extractsFromFirstSpecimenOnly = frm.extractsFromFirstSpecimenOnlyCB.checked; |
2933 |
14 Nov 14 |
olle |
1706 |
|
2933 |
14 Nov 14 |
olle |
var nofTubes = parseInt(frm.nofTubes.value); |
2933 |
14 Nov 14 |
olle |
caseInfo.specimen = []; |
2933 |
14 Nov 14 |
olle |
for (var i = 0; i < nofTubes; i++) |
2933 |
14 Nov 14 |
olle |
1710 |
{ |
2933 |
14 Nov 14 |
olle |
var specimenTube ={}; |
3028 |
11 Dec 14 |
olle |
specimenTube.name = persinfo.fetchTubeName(caseInfo.tubeContentType, caseInfo, i); |
2933 |
14 Nov 14 |
olle |
1713 |
|
2933 |
14 Nov 14 |
olle |
specimenTube.box = frm['box.'+i].value; |
2933 |
14 Nov 14 |
olle |
specimenTube.row = frm['row.'+i].value; |
2933 |
14 Nov 14 |
olle |
specimenTube.column = frm['column.'+i].value; |
3028 |
11 Dec 14 |
olle |
var nofSections = null; |
3028 |
11 Dec 14 |
olle |
if (caseInfo.tubeContentType == 'Specimen') |
3028 |
11 Dec 14 |
olle |
1719 |
{ |
4246 |
21 Nov 16 |
olle |
if (i == 0 || !caseInfo.extractsFromFirstSpecimenOnly) |
4246 |
21 Nov 16 |
olle |
1721 |
{ |
4246 |
21 Nov 16 |
olle |
// Storage position for DNA extract from specimen |
4246 |
21 Nov 16 |
olle |
specimenTube.dnaBox = frm['dnaBox.'+i].value; |
4246 |
21 Nov 16 |
olle |
specimenTube.dnaRow = frm['dnaRow.'+i].value; |
4246 |
21 Nov 16 |
olle |
specimenTube.dnaColumn = frm['dnaColumn.'+i].value; |
3276 |
29 Apr 15 |
olle |
1726 |
|
4246 |
21 Nov 16 |
olle |
// Storage position for RNA extract from specimen |
4246 |
21 Nov 16 |
olle |
specimenTube.rnaBox = frm['rnaBox.'+i].value; |
4246 |
21 Nov 16 |
olle |
specimenTube.rnaRow = frm['rnaRow.'+i].value; |
4246 |
21 Nov 16 |
olle |
specimenTube.rnaColumn = frm['rnaColumn.'+i].value; |
4246 |
21 Nov 16 |
olle |
1731 |
} |
3276 |
29 Apr 15 |
olle |
1732 |
|
3028 |
11 Dec 14 |
olle |
nofSections = frm['nofSections.'+i].value; |
3028 |
11 Dec 14 |
olle |
1734 |
} |
3028 |
11 Dec 14 |
olle |
specimenTube.nofSections = nofSections; |
2933 |
14 Nov 14 |
olle |
specimenTube.comment = frm['comment.'+i].value; |
3028 |
11 Dec 14 |
olle |
specimenTube.specimenType = frm.specimenType.value; |
4195 |
31 Oct 16 |
olle |
specimenTube.specimenInputType = frm.specimenInputType.value; |
2933 |
14 Nov 14 |
olle |
caseInfo.specimen[i] = specimenTube; |
2933 |
14 Nov 14 |
olle |
1740 |
} |
2933 |
14 Nov 14 |
olle |
1741 |
} |
2933 |
14 Nov 14 |
olle |
var submitInfo = {}; |
2933 |
14 Nov 14 |
olle |
submitInfo.patientInfo = patientInfo; |
2933 |
14 Nov 14 |
olle |
submitInfo.caseInfo = caseInfo; |
2933 |
14 Nov 14 |
olle |
1745 |
|
2933 |
14 Nov 14 |
olle |
var url = '../PersonalRegistration.servlet?ID='+App.getSessionId(); |
2933 |
14 Nov 14 |
olle |
url += '&cmd=' + (updateMode ? 'UpdateCase' : 'CreateCase'); |
2933 |
14 Nov 14 |
olle |
Wizard.showLoadingAnimation('Registering case...'); |
2933 |
14 Nov 14 |
olle |
Wizard.asyncJsonRequest(url, persinfo.submissionResults, 'POST', JSON.stringify(submitInfo)); |
2933 |
14 Nov 14 |
olle |
1750 |
} |
2933 |
14 Nov 14 |
olle |
1751 |
|
2933 |
14 Nov 14 |
olle |
persinfo.submissionResults = function(response) |
2933 |
14 Nov 14 |
olle |
1753 |
{ |
2933 |
14 Nov 14 |
olle |
Wizard.showFinalMessage(response.messages); |
2933 |
14 Nov 14 |
olle |
Doc.show('gorestart'); |
2933 |
14 Nov 14 |
olle |
1756 |
} |
2933 |
14 Nov 14 |
olle |
1757 |
|
2933 |
14 Nov 14 |
olle |
return persinfo; |
2933 |
14 Nov 14 |
olle |
1759 |
}(); |
2933 |
14 Nov 14 |
olle |
1760 |
|
2933 |
14 Nov 14 |
olle |
Doc.onLoad(PersInfo.initPage); |
2933 |
14 Nov 14 |
olle |
1762 |
|