4733 |
05 Apr 18 |
olle |
var PersInfo = function() |
4733 |
05 Apr 18 |
olle |
2 |
{ |
4733 |
05 Apr 18 |
olle |
var persinfo = {}; |
4733 |
05 Apr 18 |
olle |
var debug = 0; |
4733 |
05 Apr 18 |
olle |
5 |
|
4733 |
05 Apr 18 |
olle |
var patientInfo = null; |
4733 |
05 Apr 18 |
olle |
var caseInfo = null; |
4733 |
05 Apr 18 |
olle |
var bloodInfo = null; |
4733 |
05 Apr 18 |
olle |
9 |
|
4733 |
05 Apr 18 |
olle |
var pnrIsValid = false; |
4733 |
05 Apr 18 |
olle |
var pnrIsAcceptable = false; |
4733 |
05 Apr 18 |
olle |
var caseIsValid = false; |
4733 |
05 Apr 18 |
olle |
13 |
|
4733 |
05 Apr 18 |
olle |
var sampleItemPrefix = ''; |
4733 |
05 Apr 18 |
olle |
var sampleItemNumDigits = 5; |
4733 |
05 Apr 18 |
olle |
var nofTubesIsValid = false; |
4733 |
05 Apr 18 |
olle |
var samplingDateIsValid = true; |
4733 |
05 Apr 18 |
olle |
var viableTumourCellsPercentIsValid = true; |
4733 |
05 Apr 18 |
olle |
var usesSitePrefix = false; |
4733 |
05 Apr 18 |
olle |
20 |
|
4733 |
05 Apr 18 |
olle |
// Well validation variable for input specimen, DNA, RNA |
4733 |
05 Apr 18 |
olle |
var wellIsValid = []; |
4733 |
05 Apr 18 |
olle |
// Well validation variables for extracts from specimen |
4733 |
05 Apr 18 |
olle |
var dnaWellIsValid = []; |
4733 |
05 Apr 18 |
olle |
var rnaWellIsValid = []; |
4733 |
05 Apr 18 |
olle |
26 |
|
4733 |
05 Apr 18 |
olle |
persinfo.initPage = function() |
4733 |
05 Apr 18 |
olle |
28 |
{ |
4733 |
05 Apr 18 |
olle |
29 |
|
4733 |
05 Apr 18 |
olle |
// Step 1 |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('step-1', 'wizard-validate', persinfo.validateStep1); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('caseName', 'keypress', Wizard.focusOnEnter); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('caseName', 'blur', persinfo.caseNameOnChange); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('personalNumber', 'keyup', persinfo.personalNumberOnChange); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('personalNumber', 'keypress', Wizard.goNextOnTabOrEnter); |
4733 |
05 Apr 18 |
olle |
36 |
|
4733 |
05 Apr 18 |
olle |
// Step 2 |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('step-2', 'wizard-initialize', persinfo.initializeStep2); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('step-2', 'wizard-validate', persinfo.validateStep2); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('familyName', 'blur', persinfo.nameOnChange); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('allFirstNames', 'blur', persinfo.nameOnChange); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('allFirstNames', 'keypress', Wizard.goNextOnTabOrEnter); |
4733 |
05 Apr 18 |
olle |
43 |
|
4733 |
05 Apr 18 |
olle |
// Step 3 |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('step-3', 'wizard-initialize', persinfo.initializeStep3); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('step-3', 'wizard-validate', persinfo.validateStep3); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('plNumber', 'blur', persinfo.plNumberOnChange); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('pad', 'blur', persinfo.padOnChange); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('nofTubes', 'keypress', Events.integerOnly); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('nofTubes', 'blur', persinfo.nofTubesOnChange); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('arrivalDate', 'blur', Wizard.validateDate); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('samplingDate', 'blur', persinfo.samplingDateOnChange); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('projectFocus', 'change', persinfo.projectFocusOnChange); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('site', 'change', persinfo.siteOnChange); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('specimenType', 'change', persinfo.specimenTypeOnChange); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('viableTumourCellsPercent', 'keypress', Events.integerOnly); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('viableTumourCellsPercent', 'blur', persinfo.viableTumourCellsPercentOnChange); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('otherPathNote', 'keypress', Wizard.goNextOnTab); |
4733 |
05 Apr 18 |
olle |
Buttons.addClickHandler('selectAllMutationAnalysis', persinfo.mutationAnalysisSelectAll); |
4733 |
05 Apr 18 |
olle |
60 |
|
4733 |
05 Apr 18 |
olle |
// Step 4 |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('step-4', 'wizard-initialize', persinfo.initializeStep4); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('step-5', 'wizard-validate', persinfo.validateStep4); |
4733 |
05 Apr 18 |
olle |
64 |
|
4733 |
05 Apr 18 |
olle |
// Navigation |
4733 |
05 Apr 18 |
olle |
Buttons.addClickHandler('gocancel', Wizard.cancelWizard); |
4733 |
05 Apr 18 |
olle |
Buttons.addClickHandler('gorestart', Wizard.restartWizard); |
4733 |
05 Apr 18 |
olle |
Buttons.addClickHandler('gonext', Wizard.goNextOnClick); |
4733 |
05 Apr 18 |
olle |
Buttons.addClickHandler('goregister', Wizard.goRegister); |
4733 |
05 Apr 18 |
olle |
Buttons.addClickHandler('goupdate', Wizard.goRegister); |
4733 |
05 Apr 18 |
olle |
71 |
|
4733 |
05 Apr 18 |
olle |
// Final registration |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('wizard', 'wizard-submit', persinfo.submit); |
4733 |
05 Apr 18 |
olle |
74 |
|
4733 |
05 Apr 18 |
olle |
// Load configuration |
4733 |
05 Apr 18 |
olle |
persinfo.loadConfiguration(); |
4733 |
05 Apr 18 |
olle |
77 |
} |
4733 |
05 Apr 18 |
olle |
78 |
|
4733 |
05 Apr 18 |
olle |
persinfo.loadConfiguration = function() |
4733 |
05 Apr 18 |
olle |
80 |
{ |
4733 |
05 Apr 18 |
olle |
var url = '../Session.servlet?ID='+App.getSessionId(); |
4733 |
05 Apr 18 |
olle |
url += '&cmd=GetConfiguration' |
4733 |
05 Apr 18 |
olle |
var request = Ajax.getXmlHttpRequest(); |
4733 |
05 Apr 18 |
olle |
request.open("GET", url, true); |
4733 |
05 Apr 18 |
olle |
Ajax.setReadyStateHandler(request, persinfo.onConfiguration, persinfo.onConfiguration); |
4733 |
05 Apr 18 |
olle |
request.send(null); |
4733 |
05 Apr 18 |
olle |
87 |
} |
4733 |
05 Apr 18 |
olle |
88 |
|
4733 |
05 Apr 18 |
olle |
persinfo.onConfiguration = function(request) |
4733 |
05 Apr 18 |
olle |
90 |
{ |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
92 |
|
4733 |
05 Apr 18 |
olle |
if (debug) |
4733 |
05 Apr 18 |
olle |
94 |
{ |
4733 |
05 Apr 18 |
olle |
App.debug(Strings.encodeTags(request.responseText)); |
4733 |
05 Apr 18 |
olle |
96 |
} |
4733 |
05 Apr 18 |
olle |
97 |
|
4733 |
05 Apr 18 |
olle |
var response; |
4733 |
05 Apr 18 |
olle |
var error = false; |
4733 |
05 Apr 18 |
olle |
try |
4733 |
05 Apr 18 |
olle |
101 |
{ |
4733 |
05 Apr 18 |
olle |
response = JSON.parse(request.responseText); |
4733 |
05 Apr 18 |
olle |
if (response.status != 'ok') |
4733 |
05 Apr 18 |
olle |
104 |
{ |
4733 |
05 Apr 18 |
olle |
error = response.message || response.stacktrace || 'Unexpected error'; |
4733 |
05 Apr 18 |
olle |
106 |
} |
4733 |
05 Apr 18 |
olle |
107 |
} |
4733 |
05 Apr 18 |
olle |
catch (ex) |
4733 |
05 Apr 18 |
olle |
109 |
{ |
4733 |
05 Apr 18 |
olle |
error = ex; |
4733 |
05 Apr 18 |
olle |
111 |
} |
4733 |
05 Apr 18 |
olle |
if (error) App.debug(error); |
4733 |
05 Apr 18 |
olle |
113 |
|
4733 |
05 Apr 18 |
olle |
// Get configuration result |
4733 |
05 Apr 18 |
olle |
var conf = response.configuration; |
4733 |
05 Apr 18 |
olle |
// Check for uses site prefix flag |
4733 |
05 Apr 18 |
olle |
usesSitePrefix = conf.usesSitePrefix; |
4733 |
05 Apr 18 |
olle |
// Check for project focus default |
4733 |
05 Apr 18 |
olle |
var projectFocusDefault = conf.projectFocusDefault; |
4733 |
05 Apr 18 |
olle |
if (projectFocusDefault != null) |
4733 |
05 Apr 18 |
olle |
121 |
{ |
4733 |
05 Apr 18 |
olle |
frm.projectFocus.value = projectFocusDefault; |
4733 |
05 Apr 18 |
olle |
persinfo.projectFocusOnChange(); |
4733 |
05 Apr 18 |
olle |
124 |
} |
4733 |
05 Apr 18 |
olle |
// Check for specimen type default |
4733 |
05 Apr 18 |
olle |
var specimenTypeDefault = conf.specimenTypeDefault; |
4733 |
05 Apr 18 |
olle |
if (specimenTypeDefault != null) |
4733 |
05 Apr 18 |
olle |
128 |
{ |
4733 |
05 Apr 18 |
olle |
frm.specimenType.value = specimenTypeDefault; |
4733 |
05 Apr 18 |
olle |
130 |
} |
4733 |
05 Apr 18 |
olle |
// Check for specimen input type default |
4733 |
05 Apr 18 |
olle |
var specimenInputTypeDefault = conf.specimenInputTypeDefault; |
4733 |
05 Apr 18 |
olle |
if (specimenInputTypeDefault != null) |
4733 |
05 Apr 18 |
olle |
134 |
{ |
4733 |
05 Apr 18 |
olle |
frm.specimenInputType.value = specimenInputTypeDefault; |
4733 |
05 Apr 18 |
olle |
136 |
} |
4733 |
05 Apr 18 |
olle |
// Check for extracts from first specimen only default |
4733 |
05 Apr 18 |
olle |
var extractsFromFirstSpecimenOnlyDefault = conf.extractsFromFirstSpecimenOnlyDefault; |
4733 |
05 Apr 18 |
olle |
if (extractsFromFirstSpecimenOnlyDefault != null) |
4733 |
05 Apr 18 |
olle |
140 |
{ |
4733 |
05 Apr 18 |
olle |
frm.extractsFromFirstSpecimenOnlyCB.checked = extractsFromFirstSpecimenOnlyDefault; |
4733 |
05 Apr 18 |
olle |
142 |
} |
4733 |
05 Apr 18 |
olle |
143 |
|
4733 |
05 Apr 18 |
olle |
// Continue with initializing info for case |
4733 |
05 Apr 18 |
olle |
var url = '../LabelGeneration.servlet?ID='+App.getSessionId(); |
4733 |
05 Apr 18 |
olle |
url += '&cmd=CountCases'; |
4733 |
05 Apr 18 |
olle |
Wizard.showLoadingAnimation('Loading cases...'); |
4733 |
05 Apr 18 |
olle |
Wizard.asyncJsonRequest(url, persinfo.caseInfoLoadedStep1); |
4733 |
05 Apr 18 |
olle |
149 |
} |
4733 |
05 Apr 18 |
olle |
150 |
|
4733 |
05 Apr 18 |
olle |
persinfo.caseInfoLoadedStep1 = function(response) |
4733 |
05 Apr 18 |
olle |
152 |
{ |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
154 |
|
4733 |
05 Apr 18 |
olle |
sampleItemPrefix = response.sampleItemPrefix; |
4733 |
05 Apr 18 |
olle |
sampleItemNumDigits = response.sampleItemNumDigits; |
4733 |
05 Apr 18 |
olle |
var nofCases = response.count; |
4733 |
05 Apr 18 |
olle |
if (nofCases == null) |
4733 |
05 Apr 18 |
olle |
159 |
{ |
4733 |
05 Apr 18 |
olle |
nofCases = 0; |
4733 |
05 Apr 18 |
olle |
161 |
} |
4733 |
05 Apr 18 |
olle |
var startNum = nofCases + 1; |
4733 |
05 Apr 18 |
olle |
// Pad number with leading zeros to get right number of digits |
4733 |
05 Apr 18 |
olle |
startNum = String('0000000000' + startNum).slice(-sampleItemNumDigits); |
4733 |
05 Apr 18 |
olle |
var startCase = sampleItemPrefix + startNum; |
4733 |
05 Apr 18 |
olle |
if (usesSitePrefix != null && usesSitePrefix) |
4733 |
05 Apr 18 |
olle |
167 |
{ |
4733 |
05 Apr 18 |
olle |
startCase = ''; |
4733 |
05 Apr 18 |
olle |
169 |
} |
4733 |
05 Apr 18 |
olle |
frm.caseName.value = startCase; |
4733 |
05 Apr 18 |
olle |
171 |
|
4733 |
05 Apr 18 |
olle |
Doc.show('step-1'); |
4733 |
05 Apr 18 |
olle |
Doc.show('gonext'); |
4733 |
05 Apr 18 |
olle |
174 |
|
4733 |
05 Apr 18 |
olle |
// Ensure that flag 'caseIsValid' is set to 'true' or error reported |
4733 |
05 Apr 18 |
olle |
persinfo.caseNameOnChange(); |
4733 |
05 Apr 18 |
olle |
177 |
} |
4733 |
05 Apr 18 |
olle |
178 |
|
4733 |
05 Apr 18 |
olle |
persinfo.caseNameOnChange = function() |
4733 |
05 Apr 18 |
olle |
180 |
{ |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
var caseName = frm.caseName.value.toUpperCase(); |
4733 |
05 Apr 18 |
olle |
caseIsValid = false; |
4733 |
05 Apr 18 |
olle |
if (caseName == '') |
4733 |
05 Apr 18 |
olle |
185 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('caseName', 'invalid', 'Missing'); |
4733 |
05 Apr 18 |
olle |
frm.caseName.focus(); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
189 |
} |
4733 |
05 Apr 18 |
olle |
if (!Meludi.isValidCaseName2(caseName, sampleItemPrefix, sampleItemNumDigits)) |
4733 |
05 Apr 18 |
olle |
191 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('caseName', 'invalid', 'Only "' + sampleItemPrefix + '" + ' + sampleItemNumDigits + ' digits is allowed.'); |
4733 |
05 Apr 18 |
olle |
frm.caseName.focus(); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
195 |
} |
4733 |
05 Apr 18 |
olle |
196 |
|
4733 |
05 Apr 18 |
olle |
frm.caseName.value = caseName; |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('caseName', 'valid'); |
4733 |
05 Apr 18 |
olle |
caseIsValid = true; |
4733 |
05 Apr 18 |
olle |
200 |
|
4733 |
05 Apr 18 |
olle |
var url = '../PersonalRegistration.servlet?ID='+App.getSessionId(); |
4733 |
05 Apr 18 |
olle |
url += '&cmd=GetCaseInfo&caseName=' + encodeURIComponent(caseName); |
4733 |
05 Apr 18 |
olle |
Wizard.showLoadingAnimation('Loading information about case...'); |
4733 |
05 Apr 18 |
olle |
Wizard.asyncJsonRequest(url, persinfo.onCaseInfoLoaded); |
4733 |
05 Apr 18 |
olle |
205 |
} |
4733 |
05 Apr 18 |
olle |
206 |
|
4733 |
05 Apr 18 |
olle |
persinfo.onCaseInfoLoaded = function(response) |
4733 |
05 Apr 18 |
olle |
208 |
{ |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
210 |
|
4733 |
05 Apr 18 |
olle |
// Get biosource information from the AJAX response |
4733 |
05 Apr 18 |
olle |
caseInfo = response.caseInfo; |
4733 |
05 Apr 18 |
olle |
213 |
|
4733 |
05 Apr 18 |
olle |
// If site determined by site prefix in case name, set site default value and disable site menu |
4733 |
05 Apr 18 |
olle |
//alert("persinfo.js:: persinfo.caseInfoLoaded: caseInfo.siteDefault = " + caseInfo.siteDefault); |
4733 |
05 Apr 18 |
olle |
if (caseInfo.siteDefault != null) |
4733 |
05 Apr 18 |
olle |
217 |
{ |
4733 |
05 Apr 18 |
olle |
frm.site.value = caseInfo.siteDefault; |
4733 |
05 Apr 18 |
olle |
frm.site.disabled = true; |
4733 |
05 Apr 18 |
olle |
220 |
} |
4733 |
05 Apr 18 |
olle |
221 |
|
4733 |
05 Apr 18 |
olle |
if (caseInfo && caseInfo.patient) |
4733 |
05 Apr 18 |
olle |
223 |
{ |
4733 |
05 Apr 18 |
olle |
frm.personalNumber.value = caseInfo.patient.personalNumber; |
4733 |
05 Apr 18 |
olle |
persinfo.personalNumberOnChange(); |
4733 |
05 Apr 18 |
olle |
Wizard.goNext(false); |
4733 |
05 Apr 18 |
olle |
227 |
} |
4733 |
05 Apr 18 |
olle |
228 |
} |
4733 |
05 Apr 18 |
olle |
229 |
|
4733 |
05 Apr 18 |
olle |
persinfo.personalNumberOnChange = function() |
4733 |
05 Apr 18 |
olle |
231 |
{ |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
var pnr = frm.personalNumber.value; |
4733 |
05 Apr 18 |
olle |
pnrIsValid = false; |
4733 |
05 Apr 18 |
olle |
pnrIsAcceptable = true; |
4733 |
05 Apr 18 |
olle |
236 |
|
4733 |
05 Apr 18 |
olle |
var pnrLen = pnr.length; |
4733 |
05 Apr 18 |
olle |
if (pnrLen != 12 && pnrLen != 10) |
4733 |
05 Apr 18 |
olle |
239 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('personalNumber', 'warning', pnrLen < 12 ? 'Too short' : 'Too long'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
242 |
} |
4733 |
05 Apr 18 |
olle |
243 |
|
4733 |
05 Apr 18 |
olle |
if (!pnr.match(/^\d+$/)) |
4733 |
05 Apr 18 |
olle |
245 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('personalNumber', 'warning', 'Non-standard personal number'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
248 |
} |
4733 |
05 Apr 18 |
olle |
249 |
|
4733 |
05 Apr 18 |
olle |
var datePart = pnr.substring(0, pnrLen - 4); // Remove last four digits |
4733 |
05 Apr 18 |
olle |
var dateFormat = pnrLen == 10 ? 'yyMMdd' : 'yyyyMMdd'; |
4733 |
05 Apr 18 |
olle |
var isValidDate = Dates.isDate(datePart, dateFormat); |
4733 |
05 Apr 18 |
olle |
if (!isValidDate) |
4733 |
05 Apr 18 |
olle |
254 |
{ |
4733 |
05 Apr 18 |
olle |
var dayInMonth = parseInt(datePart.substring(-2), 10); // Last two characters |
4733 |
05 Apr 18 |
olle |
if (dayInMonth > 60) |
4733 |
05 Apr 18 |
olle |
257 |
{ |
4733 |
05 Apr 18 |
olle |
// 'Samordningsnummer' has day-in-month + 60; check this |
4733 |
05 Apr 18 |
olle |
dayInMonth -= 60; |
4733 |
05 Apr 18 |
olle |
var tmpPnr = pnr.substring(0, pnrLen - 6); // First 4 or 6 digits is year+month |
4733 |
05 Apr 18 |
olle |
if (dayInMonth < 10) tmpPnr += '0'; |
4733 |
05 Apr 18 |
olle |
tmpPnr += dayInMonth; |
4733 |
05 Apr 18 |
olle |
isValidDate = Dates.isDate(tmpPnr, dateFormat); |
4733 |
05 Apr 18 |
olle |
264 |
} |
4733 |
05 Apr 18 |
olle |
265 |
} |
4733 |
05 Apr 18 |
olle |
if (!isValidDate) |
4733 |
05 Apr 18 |
olle |
267 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('personalNumber', 'warning', 'Not a valid date'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
270 |
} |
4733 |
05 Apr 18 |
olle |
271 |
|
4733 |
05 Apr 18 |
olle |
if (!Meludi.personalNumberControlDigitCheck(pnr.substr(pnrLen == 10 ? 0 : 2))) |
4733 |
05 Apr 18 |
olle |
273 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('personalNumber', 'warning', 'Invalid control digit'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
276 |
} |
4733 |
05 Apr 18 |
olle |
277 |
|
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('personalNumber', 'valid'); |
4733 |
05 Apr 18 |
olle |
pnrIsValid = true; |
4733 |
05 Apr 18 |
olle |
Wizard.hideGoNextConfirmation(); |
4733 |
05 Apr 18 |
olle |
281 |
} |
4733 |
05 Apr 18 |
olle |
282 |
|
4733 |
05 Apr 18 |
olle |
persinfo.validateStep1 = function(event) |
4733 |
05 Apr 18 |
olle |
284 |
{ |
4733 |
05 Apr 18 |
olle |
if (event.detail.auto) |
4733 |
05 Apr 18 |
olle |
286 |
{ |
4733 |
05 Apr 18 |
olle |
if (!caseIsValid || !pnrIsValid) |
4733 |
05 Apr 18 |
olle |
288 |
{ |
4733 |
05 Apr 18 |
olle |
if (pnrIsAcceptable) |
4733 |
05 Apr 18 |
olle |
290 |
{ |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
frm.personalNumber.focus(); |
4733 |
05 Apr 18 |
olle |
Wizard.showGoNextConfirmation(true, 'Check to verify registration of non-standard personal number.'); |
4733 |
05 Apr 18 |
olle |
294 |
} |
4733 |
05 Apr 18 |
olle |
event.preventDefault(); |
4733 |
05 Apr 18 |
olle |
296 |
} |
4733 |
05 Apr 18 |
olle |
297 |
} |
4733 |
05 Apr 18 |
olle |
else |
4733 |
05 Apr 18 |
olle |
299 |
{ |
4733 |
05 Apr 18 |
olle |
if (!caseIsValid || !pnrIsAcceptable) event.preventDefault(); |
4733 |
05 Apr 18 |
olle |
301 |
} |
4733 |
05 Apr 18 |
olle |
302 |
} |
4733 |
05 Apr 18 |
olle |
303 |
|
4733 |
05 Apr 18 |
olle |
persinfo.initializeStep2 = function(event) |
4733 |
05 Apr 18 |
olle |
305 |
{ |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
var pnr = frm.personalNumber.value; |
4733 |
05 Apr 18 |
olle |
if (pnr.length == 10 && pnrIsValid) |
4733 |
05 Apr 18 |
olle |
309 |
{ |
4733 |
05 Apr 18 |
olle |
var year = Meludi.fullYear(parseInt(pnr.substr(0, 2), 10)); |
4733 |
05 Apr 18 |
olle |
pnr = year + pnr.substr(2); |
4733 |
05 Apr 18 |
olle |
312 |
} |
4733 |
05 Apr 18 |
olle |
313 |
|
4733 |
05 Apr 18 |
olle |
var url = '../PersonalRegistration.servlet?ID='+App.getSessionId(); |
4733 |
05 Apr 18 |
olle |
url += '&cmd=GetPatientInfo'; |
4733 |
05 Apr 18 |
olle |
url += '&personalNumber=' + encodeURIComponent(pnr); |
4733 |
05 Apr 18 |
olle |
url += '&pnrIsValid=' + pnrIsValid; |
4733 |
05 Apr 18 |
olle |
318 |
|
4733 |
05 Apr 18 |
olle |
Wizard.showLoadingAnimation('Loading patient information...'); |
4733 |
05 Apr 18 |
olle |
Wizard.asyncJsonRequest(url, persinfo.patientInfoLoaded); |
4733 |
05 Apr 18 |
olle |
321 |
} |
4733 |
05 Apr 18 |
olle |
322 |
|
4733 |
05 Apr 18 |
olle |
323 |
|
4733 |
05 Apr 18 |
olle |
persinfo.patientInfoLoaded = function(response) |
4733 |
05 Apr 18 |
olle |
325 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setCurrentStep(2); |
4733 |
05 Apr 18 |
olle |
// Get patient information from the AJAX response |
4733 |
05 Apr 18 |
olle |
patientInfo = response.patientInfo; |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
330 |
|
4733 |
05 Apr 18 |
olle |
331 |
|
4733 |
05 Apr 18 |
olle |
frm.patientCode.value=patientInfo.name; |
4733 |
05 Apr 18 |
olle |
frm.familyName.value = patientInfo.familyName || ''; |
4733 |
05 Apr 18 |
olle |
frm.allFirstNames.value = patientInfo.allFirstNames || ''; |
4733 |
05 Apr 18 |
olle |
Doc.element('dateOfBirth').innerHTML = patientInfo.dateOfBirth ? Strings.encodeTags(patientInfo.dateOfBirth) : '---'; |
4733 |
05 Apr 18 |
olle |
Doc.element('gender').innerHTML = patientInfo.gender ? Strings.encodeTags(patientInfo.gender) : '---'; |
4733 |
05 Apr 18 |
olle |
frm.familyName.focus(); |
4733 |
05 Apr 18 |
olle |
338 |
|
4733 |
05 Apr 18 |
olle |
if (!patientInfo.id) |
4733 |
05 Apr 18 |
olle |
340 |
{ |
4733 |
05 Apr 18 |
olle |
if (!pnrIsValid) |
4733 |
05 Apr 18 |
olle |
342 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('gender', 'warning', 'Gender and DateOfBirth can\'t be automatically generated for non-standard Personal number'); |
4733 |
05 Apr 18 |
olle |
344 |
} |
4733 |
05 Apr 18 |
olle |
345 |
} |
4733 |
05 Apr 18 |
olle |
else |
4733 |
05 Apr 18 |
olle |
347 |
{ |
4733 |
05 Apr 18 |
olle |
Doc.element('step-2-title').innerHTML = 'Existing patient: Verify names'; |
4733 |
05 Apr 18 |
olle |
frm.patientCode.disabled = true; |
4733 |
05 Apr 18 |
olle |
350 |
} |
4733 |
05 Apr 18 |
olle |
351 |
|
4733 |
05 Apr 18 |
olle |
Doc.show('gonext'); |
4733 |
05 Apr 18 |
olle |
Doc.show('gocancel'); |
4733 |
05 Apr 18 |
olle |
354 |
|
4733 |
05 Apr 18 |
olle |
355 |
} |
4733 |
05 Apr 18 |
olle |
356 |
|
4733 |
05 Apr 18 |
olle |
persinfo.nameOnChange = function(event) |
4733 |
05 Apr 18 |
olle |
358 |
{ |
4733 |
05 Apr 18 |
olle |
var field = event.target; |
4733 |
05 Apr 18 |
olle |
patientInfo[field.name] = field.value; |
4733 |
05 Apr 18 |
olle |
if (field.value == '') |
4733 |
05 Apr 18 |
olle |
362 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus(field, 'warning', 'Missing'); |
4733 |
05 Apr 18 |
olle |
364 |
} |
4733 |
05 Apr 18 |
olle |
else |
4733 |
05 Apr 18 |
olle |
366 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus(field, 'valid'); |
4733 |
05 Apr 18 |
olle |
Wizard.hideGoNextConfirmation(); |
4733 |
05 Apr 18 |
olle |
369 |
} |
4733 |
05 Apr 18 |
olle |
370 |
} |
4733 |
05 Apr 18 |
olle |
371 |
|
4733 |
05 Apr 18 |
olle |
persinfo.validateStep2 = function(event) |
4733 |
05 Apr 18 |
olle |
373 |
{ |
4733 |
05 Apr 18 |
olle |
var valid = true; |
4733 |
05 Apr 18 |
olle |
var acceptable = true; |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
377 |
|
4733 |
05 Apr 18 |
olle |
if (frm.allFirstNames.value == '') |
4733 |
05 Apr 18 |
olle |
379 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('allFirstNames', 'warning', 'Missing'); |
4733 |
05 Apr 18 |
olle |
valid = false; |
4733 |
05 Apr 18 |
olle |
382 |
} |
4733 |
05 Apr 18 |
olle |
else |
4733 |
05 Apr 18 |
olle |
384 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('allFirstNames', 'valid'); |
4733 |
05 Apr 18 |
olle |
386 |
} |
4733 |
05 Apr 18 |
olle |
387 |
|
4733 |
05 Apr 18 |
olle |
if (frm.familyName.value == '') |
4733 |
05 Apr 18 |
olle |
389 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('familyName', 'warning', 'Missing'); |
4733 |
05 Apr 18 |
olle |
valid = false; |
4733 |
05 Apr 18 |
olle |
392 |
} |
4733 |
05 Apr 18 |
olle |
else |
4733 |
05 Apr 18 |
olle |
394 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('familyName', 'valid'); |
4733 |
05 Apr 18 |
olle |
396 |
} |
4733 |
05 Apr 18 |
olle |
397 |
|
4733 |
05 Apr 18 |
olle |
// New patient only |
4733 |
05 Apr 18 |
olle |
if (!patientInfo.id) |
4733 |
05 Apr 18 |
olle |
400 |
{ |
4733 |
05 Apr 18 |
olle |
if (frm.patientCode.value == '') |
4733 |
05 Apr 18 |
olle |
402 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('patientCode', 'invalid', 'Missing'); |
4733 |
05 Apr 18 |
olle |
frm.patientCode.focus(); |
4733 |
05 Apr 18 |
olle |
valid = false; |
4733 |
05 Apr 18 |
olle |
acceptable = false; |
4733 |
05 Apr 18 |
olle |
407 |
} |
4733 |
05 Apr 18 |
olle |
else |
4733 |
05 Apr 18 |
olle |
409 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('patientCode', 'valid'); |
4733 |
05 Apr 18 |
olle |
patientInfo.name = frm.patientCode.value; |
4733 |
05 Apr 18 |
olle |
412 |
} |
4733 |
05 Apr 18 |
olle |
413 |
} |
4733 |
05 Apr 18 |
olle |
414 |
|
4733 |
05 Apr 18 |
olle |
if (event.detail.auto) |
4733 |
05 Apr 18 |
olle |
416 |
{ |
4733 |
05 Apr 18 |
olle |
if (!valid) |
4733 |
05 Apr 18 |
olle |
418 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.showGoNextConfirmation(true, 'Check to verify registration with missing name(s).'); |
4733 |
05 Apr 18 |
olle |
event.preventDefault(); |
4733 |
05 Apr 18 |
olle |
421 |
} |
4733 |
05 Apr 18 |
olle |
422 |
} |
4733 |
05 Apr 18 |
olle |
else |
4733 |
05 Apr 18 |
olle |
424 |
{ |
4733 |
05 Apr 18 |
olle |
if (!acceptable) event.preventDefault(); |
4733 |
05 Apr 18 |
olle |
426 |
} |
4733 |
05 Apr 18 |
olle |
427 |
|
4733 |
05 Apr 18 |
olle |
428 |
} |
4733 |
05 Apr 18 |
olle |
429 |
|
4733 |
05 Apr 18 |
olle |
persinfo.initializeStep3 = function() |
4733 |
05 Apr 18 |
olle |
431 |
{ |
4733 |
05 Apr 18 |
olle |
// Check entered case and pnr with AJAX |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
var updateMode = caseInfo.id && caseInfo.patient; |
4733 |
05 Apr 18 |
olle |
435 |
|
4733 |
05 Apr 18 |
olle |
// Generate list of specimen tubes |
4733 |
05 Apr 18 |
olle |
var hasUnknownSpecimen = false; |
4733 |
05 Apr 18 |
olle |
var hasSpecimen = caseInfo.specimen && caseInfo.specimen.length > 0; |
4733 |
05 Apr 18 |
olle |
var hasDna = caseInfo.dna && caseInfo.dna.length > 0; |
4733 |
05 Apr 18 |
olle |
var hasRna = caseInfo.rna && caseInfo.rna.length > 0; |
4733 |
05 Apr 18 |
olle |
var thisCasePlNumber = null; |
4733 |
05 Apr 18 |
olle |
var hasPlNumber = false; |
4733 |
05 Apr 18 |
olle |
var thisCasePAD = null; |
4733 |
05 Apr 18 |
olle |
var hasPAD = false; |
4733 |
05 Apr 18 |
olle |
var thisCaseSamplingDate = null; |
4733 |
05 Apr 18 |
olle |
var thisCaseExtractionDate = null; |
4733 |
05 Apr 18 |
olle |
var thisCaseTubeContentType = caseInfo.tubeContentType; |
4733 |
05 Apr 18 |
olle |
var thisCaseSpecimenType = null; |
4733 |
05 Apr 18 |
olle |
var thisCaseSpecimenInputType = null; |
4733 |
05 Apr 18 |
olle |
var thisCaseViableTumourCellsPercent = null; |
4733 |
05 Apr 18 |
olle |
451 |
|
4733 |
05 Apr 18 |
olle |
if (hasSpecimen) |
4733 |
05 Apr 18 |
olle |
453 |
{ |
4733 |
05 Apr 18 |
olle |
var specimenTubes = ''; |
4733 |
05 Apr 18 |
olle |
for (var i = 0; i < caseInfo.specimen.length; i++) |
4733 |
05 Apr 18 |
olle |
456 |
{ |
4733 |
05 Apr 18 |
olle |
var specimen = caseInfo.specimen[i]; |
4733 |
05 Apr 18 |
olle |
specimenTubes += Strings.encodeTags(specimen.name); |
4733 |
05 Apr 18 |
olle |
if (specimen.plNumber && !hasPlNumber) |
4733 |
05 Apr 18 |
olle |
460 |
{ |
4733 |
05 Apr 18 |
olle |
hasPlNumber = true; |
4733 |
05 Apr 18 |
olle |
thisCasePlNumber = specimen.plNumber; |
4733 |
05 Apr 18 |
olle |
463 |
} |
4733 |
05 Apr 18 |
olle |
if (specimen.pad && !hasPAD) |
4733 |
05 Apr 18 |
olle |
465 |
{ |
4733 |
05 Apr 18 |
olle |
hasPAD = true; |
4733 |
05 Apr 18 |
olle |
thisCasePAD = specimen.pad; |
4733 |
05 Apr 18 |
olle |
468 |
} |
4733 |
05 Apr 18 |
olle |
if (specimen.samplingDate && !thisCaseSamplingDate) |
4733 |
05 Apr 18 |
olle |
470 |
{ |
4733 |
05 Apr 18 |
olle |
thisCaseSamplingDate = specimen.samplingDate; |
4733 |
05 Apr 18 |
olle |
472 |
} |
4733 |
05 Apr 18 |
olle |
if (specimen.specimenType && !thisCaseSpecimenType) |
4733 |
05 Apr 18 |
olle |
474 |
{ |
4733 |
05 Apr 18 |
olle |
thisCaseSpecimenType = specimen.specimenType; |
4733 |
05 Apr 18 |
olle |
476 |
} |
4733 |
05 Apr 18 |
olle |
if (specimen.specimenInputType && !thisCaseSpecimenInputType) |
4733 |
05 Apr 18 |
olle |
478 |
{ |
4733 |
05 Apr 18 |
olle |
thisCaseSpecimenInputType = specimen.specimenInputType; |
4733 |
05 Apr 18 |
olle |
480 |
} |
4733 |
05 Apr 18 |
olle |
if (specimen.viableTumourCellsPercent && !thisCaseViableTumourCellsPercent) |
4733 |
05 Apr 18 |
olle |
482 |
{ |
4733 |
05 Apr 18 |
olle |
thisCaseViableTumourCellsPercent = specimen.viableTumourCellsPercent; |
4733 |
05 Apr 18 |
olle |
484 |
} |
4733 |
05 Apr 18 |
olle |
specimenTubes += '<br>'; |
4733 |
05 Apr 18 |
olle |
486 |
} |
4733 |
05 Apr 18 |
olle |
Doc.element('tubeContentType').value = thisCaseTubeContentType; |
4733 |
05 Apr 18 |
olle |
Doc.element('specimenType').value = thisCaseSpecimenType; |
4733 |
05 Apr 18 |
olle |
Doc.element('specimenInputType').value = thisCaseSpecimenInputType; |
4733 |
05 Apr 18 |
olle |
490 |
|
4733 |
05 Apr 18 |
olle |
Doc.show('specimenTubesSection'); |
4733 |
05 Apr 18 |
olle |
Doc.element('specimenTubes').innerHTML = specimenTubes; |
4733 |
05 Apr 18 |
olle |
493 |
|
4733 |
05 Apr 18 |
olle |
Doc.hide('nofTubesSection'); |
4733 |
05 Apr 18 |
olle |
Doc.hide('arrivalDateSection'); |
4733 |
05 Apr 18 |
olle |
496 |
|
4733 |
05 Apr 18 |
olle |
Doc.show('specimenTubesSection'); |
4733 |
05 Apr 18 |
olle |
Doc.show('samplingDateSection'); |
4733 |
05 Apr 18 |
olle |
499 |
|
4733 |
05 Apr 18 |
olle |
Doc.hide('mutationAnalysisSection'); |
4733 |
05 Apr 18 |
olle |
Doc.hide('siteSection'); |
4733 |
05 Apr 18 |
olle |
Doc.hide('sampleTypeSection'); |
4733 |
05 Apr 18 |
olle |
Doc.hide('projectFocusSection'); |
4733 |
05 Apr 18 |
olle |
Doc.hide('metastasisSiteSection'); |
4733 |
05 Apr 18 |
olle |
Doc.hide('otherPathNoteSection'); |
4733 |
05 Apr 18 |
olle |
506 |
|
4733 |
05 Apr 18 |
olle |
// Populate 'Sampling date' field |
4733 |
05 Apr 18 |
olle |
if (thisCaseSamplingDate != null) |
4733 |
05 Apr 18 |
olle |
509 |
{ |
4733 |
05 Apr 18 |
olle |
frm.samplingDate.value = thisCaseSamplingDate.substring(0, 8); |
4733 |
05 Apr 18 |
olle |
persinfo.samplingDateOnChange(); |
4733 |
05 Apr 18 |
olle |
512 |
} |
4733 |
05 Apr 18 |
olle |
513 |
|
4733 |
05 Apr 18 |
olle |
// Populate 'Viable tumour cells percent' field |
4733 |
05 Apr 18 |
olle |
if (thisCaseViableTumourCellsPercent != null) |
4733 |
05 Apr 18 |
olle |
516 |
{ |
4733 |
05 Apr 18 |
olle |
frm.viableTumourCellsPercent.value = thisCaseViableTumourCellsPercent; |
4733 |
05 Apr 18 |
olle |
persinfo.viableTumourCellsPercentOnChange(); |
4733 |
05 Apr 18 |
olle |
519 |
} |
4733 |
05 Apr 18 |
olle |
520 |
|
4733 |
05 Apr 18 |
olle |
frm.plNumber.value = thisCasePlNumber; |
4733 |
05 Apr 18 |
olle |
frm.pad.value = thisCasePAD; |
4733 |
05 Apr 18 |
olle |
523 |
|
4733 |
05 Apr 18 |
olle |
if (caseInfo.id != null && typeof caseInfo.id != 'undefined') |
4733 |
05 Apr 18 |
olle |
525 |
{ |
4733 |
05 Apr 18 |
olle |
frm.samplingDate.disabled = true; |
4733 |
05 Apr 18 |
olle |
frm.tubeContentType.disabled = true; |
4733 |
05 Apr 18 |
olle |
frm.specimenType.disabled = true; |
4733 |
05 Apr 18 |
olle |
frm.specimenInputType.disabled = true; |
4733 |
05 Apr 18 |
olle |
frm.viableTumourCellsPercent.disabled = true; |
4733 |
05 Apr 18 |
olle |
531 |
} |
4733 |
05 Apr 18 |
olle |
532 |
|
4733 |
05 Apr 18 |
olle |
// Existing cases for this patient |
4733 |
05 Apr 18 |
olle |
var hasUnknownCase = false; |
4733 |
05 Apr 18 |
olle |
if (patientInfo.cases && patientInfo.cases.length > 0) |
4733 |
05 Apr 18 |
olle |
536 |
{ |
4733 |
05 Apr 18 |
olle |
var cases = ''; |
4733 |
05 Apr 18 |
olle |
538 |
|
4733 |
05 Apr 18 |
olle |
if (patientInfo.cases.length == 1 || updateMode) |
4733 |
05 Apr 18 |
olle |
540 |
{ |
4733 |
05 Apr 18 |
olle |
if (!updateMode) |
4733 |
05 Apr 18 |
olle |
542 |
{ |
4733 |
05 Apr 18 |
olle |
cases += '[<i>new case</i>]<br>'; |
4733 |
05 Apr 18 |
olle |
544 |
} |
4733 |
05 Apr 18 |
olle |
545 |
} |
4733 |
05 Apr 18 |
olle |
546 |
|
4733 |
05 Apr 18 |
olle |
if (updateMode) |
4733 |
05 Apr 18 |
olle |
548 |
{ |
4733 |
05 Apr 18 |
olle |
if (caseInfo.merged) |
4733 |
05 Apr 18 |
olle |
550 |
{ |
4733 |
05 Apr 18 |
olle |
Doc.element('step-3-title').innerHTML = 'Update case \''+Strings.encodeTags(caseInfo.originalName)+'\' (which is merged with case \'' + Strings.encodeTags(caseInfo.name) + '\')'; |
4733 |
05 Apr 18 |
olle |
552 |
} |
4733 |
05 Apr 18 |
olle |
else |
4733 |
05 Apr 18 |
olle |
554 |
{ |
4733 |
05 Apr 18 |
olle |
Doc.element('step-3-title').innerHTML = 'Update case \''+Strings.encodeTags(caseInfo.name)+'\''; |
4733 |
05 Apr 18 |
olle |
556 |
} |
4733 |
05 Apr 18 |
olle |
557 |
|
4733 |
05 Apr 18 |
olle |
558 |
} |
4733 |
05 Apr 18 |
olle |
else if (patientInfo.cases.length == 2) |
4733 |
05 Apr 18 |
olle |
560 |
{ |
4733 |
05 Apr 18 |
olle |
Doc.element('step-3-title').innerHTML = 'Merge with existing case'; |
4733 |
05 Apr 18 |
olle |
562 |
} |
4733 |
05 Apr 18 |
olle |
else if (patientInfo.cases.length > 0) |
4733 |
05 Apr 18 |
olle |
564 |
{ |
4733 |
05 Apr 18 |
olle |
Doc.element('step-3-title').innerHTML = 'Create new case or merge with existing case'; |
4733 |
05 Apr 18 |
olle |
566 |
} |
4733 |
05 Apr 18 |
olle |
567 |
} |
4733 |
05 Apr 18 |
olle |
568 |
|
4733 |
05 Apr 18 |
olle |
Wizard.setCurrentStep(3); |
4733 |
05 Apr 18 |
olle |
if (updateMode) |
4733 |
05 Apr 18 |
olle |
571 |
{ |
4733 |
05 Apr 18 |
olle |
Doc.show('goupdate'); |
4733 |
05 Apr 18 |
olle |
573 |
} |
4733 |
05 Apr 18 |
olle |
else |
4733 |
05 Apr 18 |
olle |
575 |
{ |
4733 |
05 Apr 18 |
olle |
Doc.show('goregister'); |
4733 |
05 Apr 18 |
olle |
577 |
} |
4733 |
05 Apr 18 |
olle |
Doc.show('gocancel'); |
4733 |
05 Apr 18 |
olle |
frm.plNumber.focus(); |
4733 |
05 Apr 18 |
olle |
580 |
} |
4733 |
05 Apr 18 |
olle |
else if (hasDna) |
4733 |
05 Apr 18 |
olle |
582 |
{ |
4733 |
05 Apr 18 |
olle |
var dnaTubes = ''; |
4733 |
05 Apr 18 |
olle |
for (var i = 0; i < caseInfo.dna.length; i++) |
4733 |
05 Apr 18 |
olle |
585 |
{ |
4733 |
05 Apr 18 |
olle |
var dna = caseInfo.dna[i]; |
4733 |
05 Apr 18 |
olle |
dnaTubes += Strings.encodeTags(dna.name); |
4733 |
05 Apr 18 |
olle |
if (dna.extractionDate && !thisCaseExtractionDate) |
4733 |
05 Apr 18 |
olle |
589 |
{ |
4733 |
05 Apr 18 |
olle |
thisCaseExtractionDate = dna.extractionDate; |
4733 |
05 Apr 18 |
olle |
591 |
} |
4733 |
05 Apr 18 |
olle |
dnaTubes += '<br>'; |
4733 |
05 Apr 18 |
olle |
593 |
} |
4733 |
05 Apr 18 |
olle |
Doc.element('tubeContentType').value = thisCaseTubeContentType; |
4733 |
05 Apr 18 |
olle |
595 |
|
4733 |
05 Apr 18 |
olle |
frm.plNumber.disabled = true; |
4733 |
05 Apr 18 |
olle |
Doc.element('plNumberMessageText').innerHTML = "No PL-number can be saved for case without specimen."; |
4733 |
05 Apr 18 |
olle |
frm.pad.disabled = true; |
4733 |
05 Apr 18 |
olle |
Doc.element('padMessageText').innerHTML = "No PAD/CL number can be saved for case without specimen."; |
4733 |
05 Apr 18 |
olle |
600 |
|
4733 |
05 Apr 18 |
olle |
Doc.show('specimenTubesSection'); |
4733 |
05 Apr 18 |
olle |
Doc.element('specimenTubesTitle').innerHTML = "DNA tubes"; |
4733 |
05 Apr 18 |
olle |
Doc.element('specimenTubes').innerHTML = dnaTubes; |
4733 |
05 Apr 18 |
olle |
Doc.element('specimenTubesMessageText').innerHTML = "The DNA tube(s) associated with this case."; |
4733 |
05 Apr 18 |
olle |
605 |
|
4733 |
05 Apr 18 |
olle |
Doc.hide('nofTubesSection'); |
4733 |
05 Apr 18 |
olle |
Doc.hide('arrivalDateSection'); |
4733 |
05 Apr 18 |
olle |
608 |
|
4733 |
05 Apr 18 |
olle |
Doc.show('specimenTubesSection'); |
4733 |
05 Apr 18 |
olle |
Doc.show('samplingDateSection'); |
4733 |
05 Apr 18 |
olle |
611 |
|
4733 |
05 Apr 18 |
olle |
Doc.hide('mutationAnalysisSection'); |
4733 |
05 Apr 18 |
olle |
Doc.hide('siteSection'); |
4733 |
05 Apr 18 |
olle |
Doc.hide('sampleTypeSection'); |
4733 |
05 Apr 18 |
olle |
Doc.hide('projectFocusSection'); |
4733 |
05 Apr 18 |
olle |
Doc.hide('metastasisSiteSection'); |
4733 |
05 Apr 18 |
olle |
Doc.hide('otherPathNoteSection'); |
4733 |
05 Apr 18 |
olle |
618 |
|
4733 |
05 Apr 18 |
olle |
thisCaseSamplingDate = thisCaseExtractionDate; |
4733 |
05 Apr 18 |
olle |
// Populate 'Sampling date' field |
4733 |
05 Apr 18 |
olle |
if (thisCaseSamplingDate != null) |
4733 |
05 Apr 18 |
olle |
622 |
{ |
4733 |
05 Apr 18 |
olle |
frm.samplingDate.value = thisCaseSamplingDate.substring(0, 8); |
4733 |
05 Apr 18 |
olle |
persinfo.samplingDateOnChange(); |
4733 |
05 Apr 18 |
olle |
625 |
} |
4733 |
05 Apr 18 |
olle |
626 |
|
4733 |
05 Apr 18 |
olle |
frm.plNumber.value = thisCasePlNumber; |
4733 |
05 Apr 18 |
olle |
frm.pad.value = thisCasePAD; |
4733 |
05 Apr 18 |
olle |
629 |
|
4733 |
05 Apr 18 |
olle |
if (caseInfo.id != null && typeof caseInfo.id != 'undefined') |
4733 |
05 Apr 18 |
olle |
631 |
{ |
4733 |
05 Apr 18 |
olle |
frm.samplingDate.disabled = true; |
4733 |
05 Apr 18 |
olle |
frm.tubeContentType.disabled = true; |
4733 |
05 Apr 18 |
olle |
frm.specimenType.disabled = true; |
4733 |
05 Apr 18 |
olle |
frm.specimenInputType.disabled = true; |
4733 |
05 Apr 18 |
olle |
frm.viableTumourCellsPercent.disabled = true; |
4733 |
05 Apr 18 |
olle |
637 |
} |
4733 |
05 Apr 18 |
olle |
638 |
|
4733 |
05 Apr 18 |
olle |
Wizard.setCurrentStep(3); |
4733 |
05 Apr 18 |
olle |
if (updateMode) |
4733 |
05 Apr 18 |
olle |
641 |
{ |
4733 |
05 Apr 18 |
olle |
Doc.show('goupdate'); |
4733 |
05 Apr 18 |
olle |
643 |
} |
4733 |
05 Apr 18 |
olle |
else |
4733 |
05 Apr 18 |
olle |
645 |
{ |
4733 |
05 Apr 18 |
olle |
Doc.show('goregister'); |
4733 |
05 Apr 18 |
olle |
647 |
} |
4733 |
05 Apr 18 |
olle |
Doc.show('gocancel'); |
4733 |
05 Apr 18 |
olle |
frm.plNumber.focus(); |
4733 |
05 Apr 18 |
olle |
650 |
} |
4733 |
05 Apr 18 |
olle |
else if (hasRna) |
4733 |
05 Apr 18 |
olle |
652 |
{ |
4733 |
05 Apr 18 |
olle |
var rnaTubes = ''; |
4733 |
05 Apr 18 |
olle |
for (var i = 0; i < caseInfo.rna.length; i++) |
4733 |
05 Apr 18 |
olle |
655 |
{ |
4733 |
05 Apr 18 |
olle |
var rna = caseInfo.rna[i]; |
4733 |
05 Apr 18 |
olle |
rnaTubes += Strings.encodeTags(rna.name); |
4733 |
05 Apr 18 |
olle |
if (rna.extractionDate && !thisCaseExtractionDate) |
4733 |
05 Apr 18 |
olle |
659 |
{ |
4733 |
05 Apr 18 |
olle |
thisCaseExtractionDate = rna.extractionDate; |
4733 |
05 Apr 18 |
olle |
661 |
} |
4733 |
05 Apr 18 |
olle |
rnaTubes += '<br>'; |
4733 |
05 Apr 18 |
olle |
663 |
} |
4733 |
05 Apr 18 |
olle |
Doc.element('tubeContentType').value = thisCaseTubeContentType; |
4733 |
05 Apr 18 |
olle |
665 |
|
4733 |
05 Apr 18 |
olle |
frm.plNumber.disabled = true; |
4733 |
05 Apr 18 |
olle |
Doc.element('plNumberMessageText').innerHTML = "No PL-number can be saved for case without specimen."; |
4733 |
05 Apr 18 |
olle |
frm.pad.disabled = true; |
4733 |
05 Apr 18 |
olle |
Doc.element('padMessageText').innerHTML = "No PAD/CL number can be saved for case without specimen."; |
4733 |
05 Apr 18 |
olle |
670 |
|
4733 |
05 Apr 18 |
olle |
Doc.show('specimenTubesSection'); |
4733 |
05 Apr 18 |
olle |
Doc.element('specimenTubesTitle').innerHTML = "RNA tubes"; |
4733 |
05 Apr 18 |
olle |
Doc.element('specimenTubes').innerHTML = rnaTubes; |
4733 |
05 Apr 18 |
olle |
Doc.element('specimenTubesMessageText').innerHTML = "The RNA tube(s) associated with this case."; |
4733 |
05 Apr 18 |
olle |
675 |
|
4733 |
05 Apr 18 |
olle |
Doc.hide('nofTubesSection'); |
4733 |
05 Apr 18 |
olle |
Doc.hide('arrivalDateSection'); |
4733 |
05 Apr 18 |
olle |
678 |
|
4733 |
05 Apr 18 |
olle |
Doc.show('specimenTubesSection'); |
4733 |
05 Apr 18 |
olle |
Doc.show('samplingDateSection'); |
4733 |
05 Apr 18 |
olle |
681 |
|
4733 |
05 Apr 18 |
olle |
Doc.hide('mutationAnalysisSection'); |
4733 |
05 Apr 18 |
olle |
Doc.hide('siteSection'); |
4733 |
05 Apr 18 |
olle |
Doc.hide('sampleTypeSection'); |
4733 |
05 Apr 18 |
olle |
Doc.hide('projectFocusSection'); |
4733 |
05 Apr 18 |
olle |
Doc.hide('metastasisSiteSection'); |
4733 |
05 Apr 18 |
olle |
Doc.hide('otherPathNoteSection'); |
4733 |
05 Apr 18 |
olle |
688 |
|
4733 |
05 Apr 18 |
olle |
thisCaseSamplingDate = thisCaseExtractionDate; |
4733 |
05 Apr 18 |
olle |
// Populate 'Sampling date' field |
4733 |
05 Apr 18 |
olle |
if (thisCaseSamplingDate != null) |
4733 |
05 Apr 18 |
olle |
692 |
{ |
4733 |
05 Apr 18 |
olle |
frm.samplingDate.value = thisCaseSamplingDate.substring(0, 8); |
4733 |
05 Apr 18 |
olle |
persinfo.samplingDateOnChange(); |
4733 |
05 Apr 18 |
olle |
695 |
} |
4733 |
05 Apr 18 |
olle |
696 |
|
4733 |
05 Apr 18 |
olle |
frm.plNumber.value = thisCasePlNumber; |
4733 |
05 Apr 18 |
olle |
frm.pad.value = thisCasePAD; |
4733 |
05 Apr 18 |
olle |
699 |
|
4733 |
05 Apr 18 |
olle |
if (caseInfo.id != null && typeof caseInfo.id != 'undefined') |
4733 |
05 Apr 18 |
olle |
701 |
{ |
4733 |
05 Apr 18 |
olle |
frm.samplingDate.disabled = true; |
4733 |
05 Apr 18 |
olle |
frm.tubeContentType.disabled = true; |
4733 |
05 Apr 18 |
olle |
frm.specimenType.disabled = true; |
4733 |
05 Apr 18 |
olle |
frm.specimenInputType.disabled = true; |
4733 |
05 Apr 18 |
olle |
frm.viableTumourCellsPercent.disabled = true; |
4733 |
05 Apr 18 |
olle |
707 |
} |
4733 |
05 Apr 18 |
olle |
708 |
|
4733 |
05 Apr 18 |
olle |
Wizard.setCurrentStep(3); |
4733 |
05 Apr 18 |
olle |
if (updateMode) |
4733 |
05 Apr 18 |
olle |
711 |
{ |
4733 |
05 Apr 18 |
olle |
Doc.show('goupdate'); |
4733 |
05 Apr 18 |
olle |
713 |
} |
4733 |
05 Apr 18 |
olle |
else |
4733 |
05 Apr 18 |
olle |
715 |
{ |
4733 |
05 Apr 18 |
olle |
Doc.show('goregister'); |
4733 |
05 Apr 18 |
olle |
717 |
} |
4733 |
05 Apr 18 |
olle |
Doc.show('gocancel'); |
4733 |
05 Apr 18 |
olle |
frm.plNumber.focus(); |
4733 |
05 Apr 18 |
olle |
720 |
} |
4733 |
05 Apr 18 |
olle |
else |
4733 |
05 Apr 18 |
olle |
722 |
{ |
4733 |
05 Apr 18 |
olle |
Doc.hide('specimenTubesSection'); |
4733 |
05 Apr 18 |
olle |
Wizard.setCurrentStep(3); |
4733 |
05 Apr 18 |
olle |
Doc.show('gocancel'); |
4733 |
05 Apr 18 |
olle |
Doc.show('gonext'); |
4733 |
05 Apr 18 |
olle |
727 |
|
4733 |
05 Apr 18 |
olle |
frm.arrivalDate.value = Dates.formatDate(new Date(), 'yyyyMMdd'); |
4733 |
05 Apr 18 |
olle |
729 |
|
4733 |
05 Apr 18 |
olle |
frm.plNumber.focus(); |
4733 |
05 Apr 18 |
olle |
frm.nofTubes.setSelectionRange(0,1); |
4734 |
05 Apr 18 |
olle |
frm.mutationAnalysisTst170.checked = true; |
4733 |
05 Apr 18 |
olle |
733 |
} |
4733 |
05 Apr 18 |
olle |
734 |
} |
4733 |
05 Apr 18 |
olle |
735 |
|
4733 |
05 Apr 18 |
olle |
persinfo.plNumberOnChange = function() |
4733 |
05 Apr 18 |
olle |
737 |
{ |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
var plNumber = frm.plNumber.value; |
4733 |
05 Apr 18 |
olle |
if (plNumber == '') |
4733 |
05 Apr 18 |
olle |
741 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('plNumber', 'warning', 'Missing'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
744 |
} |
4733 |
05 Apr 18 |
olle |
frm.plNumber.value = plNumber.replace(/\+/, '-'); |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('plNumber', 'valid'); |
4733 |
05 Apr 18 |
olle |
747 |
} |
4733 |
05 Apr 18 |
olle |
748 |
|
4733 |
05 Apr 18 |
olle |
persinfo.padOnChange = function() |
4733 |
05 Apr 18 |
olle |
750 |
{ |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
var PAD = frm.pad.value; |
4733 |
05 Apr 18 |
olle |
if (PAD == '') |
4733 |
05 Apr 18 |
olle |
754 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('pad', 'warning', 'Missing'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
757 |
} |
4733 |
05 Apr 18 |
olle |
frm.pad.value = PAD.replace(/\+/, '-'); |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('pad', 'valid'); |
4733 |
05 Apr 18 |
olle |
760 |
} |
4733 |
05 Apr 18 |
olle |
761 |
|
4733 |
05 Apr 18 |
olle |
persinfo.samplingDateTimeFocus = function(event) |
4733 |
05 Apr 18 |
olle |
763 |
{ |
4733 |
05 Apr 18 |
olle |
if (event.keyCode == 13) |
4733 |
05 Apr 18 |
olle |
765 |
{ |
4733 |
05 Apr 18 |
olle |
var focusTo = caseInfo.specimen && caseInfo.specimen.length > 0 ? 'mutationAnalysis' : 'reasonIfNoSpecimen' |
4733 |
05 Apr 18 |
olle |
Doc.element(focusTo).focus(); |
4733 |
05 Apr 18 |
olle |
768 |
} |
4733 |
05 Apr 18 |
olle |
769 |
} |
4733 |
05 Apr 18 |
olle |
770 |
|
4733 |
05 Apr 18 |
olle |
persinfo.nofTubesOnChange = function() |
4733 |
05 Apr 18 |
olle |
772 |
{ |
4733 |
05 Apr 18 |
olle |
nofTubesIsValid = false; |
4733 |
05 Apr 18 |
olle |
774 |
|
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
var nofTubes = frm.nofTubes.value; |
4733 |
05 Apr 18 |
olle |
777 |
|
4733 |
05 Apr 18 |
olle |
if (nofTubes == '') |
4733 |
05 Apr 18 |
olle |
779 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('nofTubes', 'invalid', 'Missing'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
782 |
} |
4733 |
05 Apr 18 |
olle |
if (parseInt(nofTubes) < 1) |
4733 |
05 Apr 18 |
olle |
784 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('nofTubes', 'invalid', 'Must be at least 1'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
787 |
} |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('nofTubes', 'valid'); |
4733 |
05 Apr 18 |
olle |
nofTubesIsValid = true; |
4733 |
05 Apr 18 |
olle |
790 |
} |
4733 |
05 Apr 18 |
olle |
791 |
|
4733 |
05 Apr 18 |
olle |
persinfo.samplingDateOnChange = function() |
4733 |
05 Apr 18 |
olle |
793 |
{ |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
samplingDateIsValid = false; |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('samplingDate'); |
4733 |
05 Apr 18 |
olle |
797 |
|
4733 |
05 Apr 18 |
olle |
var samplingDate = frm.samplingDate.value; |
4733 |
05 Apr 18 |
olle |
799 |
|
4733 |
05 Apr 18 |
olle |
if (samplingDate == '') |
4733 |
05 Apr 18 |
olle |
801 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('samplingDate', 'warning', 'Missing date'); |
4733 |
05 Apr 18 |
olle |
803 |
} |
4733 |
05 Apr 18 |
olle |
else |
4733 |
05 Apr 18 |
olle |
805 |
{ |
4733 |
05 Apr 18 |
olle |
// Auto-fill the date if it's only given with 4(MMdd) or 6(yyMMdd) digits. |
4733 |
05 Apr 18 |
olle |
samplingDate = Meludi.autoFillDate(samplingDate, true); |
4733 |
05 Apr 18 |
olle |
frm.samplingDate.value = samplingDate; |
4733 |
05 Apr 18 |
olle |
809 |
|
4733 |
05 Apr 18 |
olle |
if (samplingDate != '' && !Dates.isDate(samplingDate, 'yyyyMMdd')) |
4733 |
05 Apr 18 |
olle |
811 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('samplingDate', 'invalid', 'Not a valid date'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
814 |
} |
4733 |
05 Apr 18 |
olle |
815 |
|
4733 |
05 Apr 18 |
olle |
var arrivalDate = frm.arrivalDate.value; |
4733 |
05 Apr 18 |
olle |
if (arrivalDate != '' && arrivalDate < samplingDate) |
4733 |
05 Apr 18 |
olle |
818 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('samplingDate', 'invalid', 'Arrival date is before sampling date'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
821 |
} |
4733 |
05 Apr 18 |
olle |
822 |
|
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('samplingDate', 'valid'); |
4733 |
05 Apr 18 |
olle |
824 |
} |
4733 |
05 Apr 18 |
olle |
samplingDateIsValid = true; |
4733 |
05 Apr 18 |
olle |
826 |
} |
4733 |
05 Apr 18 |
olle |
827 |
|
4733 |
05 Apr 18 |
olle |
persinfo.projectFocusOnChange = function() |
4733 |
05 Apr 18 |
olle |
829 |
{ |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
var projectFocus = frm.projectFocus.value; |
4733 |
05 Apr 18 |
olle |
832 |
|
4733 |
05 Apr 18 |
olle |
persinfo.mutationAnalysisReset(); |
4733 |
05 Apr 18 |
olle |
834 |
|
4734 |
05 Apr 18 |
olle |
835 |
/* |
4733 |
05 Apr 18 |
olle |
if (projectFocus == 'melanoma') |
4733 |
05 Apr 18 |
olle |
837 |
{ |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisNras.checked = true; |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisBraf.checked = true; |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisKit.checked = true; |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
842 |
} |
4733 |
05 Apr 18 |
olle |
if (projectFocus == 'lungcancer') |
4733 |
05 Apr 18 |
olle |
844 |
{ |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisKras.checked = true; |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisEgfr.checked = true; |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
848 |
} |
4733 |
05 Apr 18 |
olle |
if (projectFocus == 'coloncancer') |
4733 |
05 Apr 18 |
olle |
850 |
{ |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisKras.checked = true; |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisNras.checked = true; |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisBraf.checked = true; |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
855 |
} |
4733 |
05 Apr 18 |
olle |
if (projectFocus == 'GIST') |
4733 |
05 Apr 18 |
olle |
857 |
{ |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisPdgfra.checked = true; |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisKit.checked = true; |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
861 |
} |
4734 |
05 Apr 18 |
olle |
862 |
*/ |
4734 |
05 Apr 18 |
olle |
frm.mutationAnalysisTst170.checked = true; |
4733 |
05 Apr 18 |
olle |
864 |
} |
4733 |
05 Apr 18 |
olle |
865 |
|
4733 |
05 Apr 18 |
olle |
persinfo.mutationAnalysisReset = function() |
4733 |
05 Apr 18 |
olle |
867 |
{ |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
869 |
|
4779 |
20 Apr 18 |
olle |
870 |
/* |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisKras.checked = false; |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisNras.checked = false; |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisBraf.checked = false; |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisEgfr.checked = false; |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisAlkEml4.checked = false; |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisPdgfra.checked = false; |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisKit.checked = false; |
4779 |
20 Apr 18 |
olle |
878 |
*/ |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisTst170.checked = false; |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisOther.checked = false; |
4733 |
05 Apr 18 |
olle |
881 |
} |
4733 |
05 Apr 18 |
olle |
882 |
|
4733 |
05 Apr 18 |
olle |
persinfo.mutationAnalysisSelectAll = function() |
4733 |
05 Apr 18 |
olle |
884 |
{ |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
886 |
|
4779 |
20 Apr 18 |
olle |
887 |
/* |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisKras.checked = true; |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisNras.checked = true; |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisBraf.checked = true; |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisEgfr.checked = true; |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisAlkEml4.checked = true; |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisPdgfra.checked = true; |
4733 |
05 Apr 18 |
olle |
frm.mutationAnalysisKit.checked = true; |
4779 |
20 Apr 18 |
olle |
895 |
*/ |
4733 |
05 Apr 18 |
olle |
//frm.mutationAnalysisTst170.checked = true; |
4733 |
05 Apr 18 |
olle |
//frm.mutationAnalysisOther.checked = true; |
4733 |
05 Apr 18 |
olle |
898 |
} |
4733 |
05 Apr 18 |
olle |
899 |
|
4733 |
05 Apr 18 |
olle |
persinfo.viableTumourCellsPercentOnChange = function() |
4733 |
05 Apr 18 |
olle |
901 |
{ |
4733 |
05 Apr 18 |
olle |
viableTumourCellsPercentIsValid = false; |
4733 |
05 Apr 18 |
olle |
903 |
|
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
var viableTumourCellsPercent = frm.viableTumourCellsPercent.value; |
4733 |
05 Apr 18 |
olle |
906 |
|
4733 |
05 Apr 18 |
olle |
if (viableTumourCellsPercent != null) |
4733 |
05 Apr 18 |
olle |
908 |
{ |
4733 |
05 Apr 18 |
olle |
if (parseInt(viableTumourCellsPercent) < 0) |
4733 |
05 Apr 18 |
olle |
910 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('viableTumourCellsPercent', 'invalid', 'Must be at least 0'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
913 |
} |
4733 |
05 Apr 18 |
olle |
if (parseInt(viableTumourCellsPercent) > 100) |
4733 |
05 Apr 18 |
olle |
915 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('viableTumourCellsPercent', 'invalid', 'Must be at most 100'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
918 |
} |
4733 |
05 Apr 18 |
olle |
919 |
} |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('viableTumourCellsPercent', 'valid'); |
4733 |
05 Apr 18 |
olle |
viableTumourCellsPercentIsValid = true; |
4733 |
05 Apr 18 |
olle |
922 |
} |
4733 |
05 Apr 18 |
olle |
923 |
|
4733 |
05 Apr 18 |
olle |
persinfo.validateStep3 = function(event) |
4733 |
05 Apr 18 |
olle |
925 |
{ |
4733 |
05 Apr 18 |
olle |
var isValid = samplingDateIsValid; |
4733 |
05 Apr 18 |
olle |
var hasSpecimen = caseInfo.specimen && caseInfo.specimen.length > 0; |
4733 |
05 Apr 18 |
olle |
if (hasSpecimen) |
4733 |
05 Apr 18 |
olle |
929 |
{ |
4733 |
05 Apr 18 |
olle |
isValid &= viableTumourCellsPercentIsValid; |
4733 |
05 Apr 18 |
olle |
931 |
} |
4733 |
05 Apr 18 |
olle |
if (!isValid) event.preventDefault(); |
4733 |
05 Apr 18 |
olle |
933 |
} |
4733 |
05 Apr 18 |
olle |
934 |
|
4733 |
05 Apr 18 |
olle |
persinfo.initializeStep4 = function() |
4733 |
05 Apr 18 |
olle |
936 |
{ |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
var tubeContentType = frm.tubeContentType.value; |
4733 |
05 Apr 18 |
olle |
var nofTubes = parseInt(frm.nofTubes.value); |
4733 |
05 Apr 18 |
olle |
nofTubes = persinfo.fixNofTubes(tubeContentType, nofTubes); |
4733 |
05 Apr 18 |
olle |
frm.nofTubes.value = nofTubes; |
4733 |
05 Apr 18 |
olle |
var extractsFromFirstSpecimenOnly = frm.extractsFromFirstSpecimenOnlyCB.checked; |
4733 |
05 Apr 18 |
olle |
var storageBoxSuffix = persinfo.fetchStorageBoxSuffix(tubeContentType); |
4733 |
05 Apr 18 |
olle |
if (nofTubes > 2) Doc.addClass('step-2', 'auto-hide'); |
4733 |
05 Apr 18 |
olle |
945 |
|
4733 |
05 Apr 18 |
olle |
var html = ''; |
4733 |
05 Apr 18 |
olle |
947 |
|
4733 |
05 Apr 18 |
olle |
// Add buttons for adding standard comments for all specimens/RNA/DNA |
4733 |
05 Apr 18 |
olle |
html += '<tr class="section-header">'; |
4733 |
05 Apr 18 |
olle |
html += '<td colspan="4">Standard comments</td>'; |
4733 |
05 Apr 18 |
olle |
html += '</tr>'; |
4733 |
05 Apr 18 |
olle |
952 |
|
4733 |
05 Apr 18 |
olle |
html += '<tr class="align-top">'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="subprompt"></td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td><div class="button basicbutton interactable" id="addCarvedOutComment" style="font-weight: normal;">Add "Utkarvad" (Carved out)</div></td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="status" id="addCarvedOutComment.status"></td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="help"><span id="addCarvedOutComment.message" class="message"></span>Click button to add standard comment for all items.</td>'; |
4733 |
05 Apr 18 |
olle |
html += '</tr>'; |
4733 |
05 Apr 18 |
olle |
959 |
|
4733 |
05 Apr 18 |
olle |
html += '<tr class="align-top">'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="subprompt"></td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td><div class="button basicbutton interactable" id="addMnbComment" style="font-weight: normal;">Add "MNB" (Medium needle biopsy)</div></td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="status" id="addMnbComment.status"></td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="help"><span id="addMnbComment.message" class="message"></span>Click button to add standard comment for all items.</td>'; |
4733 |
05 Apr 18 |
olle |
html += '</tr>'; |
4733 |
05 Apr 18 |
olle |
966 |
|
4733 |
05 Apr 18 |
olle |
for (var i=0; i < nofTubes; i++) |
4733 |
05 Apr 18 |
olle |
968 |
{ |
4733 |
05 Apr 18 |
olle |
var tubeContentTypeName = persinfo.fetchTubeContentTypeName(tubeContentType, i); |
4733 |
05 Apr 18 |
olle |
var tubeContentTypeNameInternal = persinfo.fetchTubeContentTypeNameInternal(tubeContentType, tubeContentTypeName); |
4733 |
05 Apr 18 |
olle |
var tubeName = persinfo.fetchTubeName(tubeContentType, caseInfo, i); |
4733 |
05 Apr 18 |
olle |
var tubeNo = i+caseInfo.specimenFirstIndex; |
4733 |
05 Apr 18 |
olle |
var tubeIdentifier = persinfo.fetchTubeIdentifier(tubeContentType, caseInfo, i); |
4733 |
05 Apr 18 |
olle |
html += '<tr class="section-header">'; |
4733 |
05 Apr 18 |
olle |
html += '<td colspan="4">'+tubeContentTypeName+' Tube '+tubeName+'</td>'; |
4733 |
05 Apr 18 |
olle |
html += '</tr>'; |
4733 |
05 Apr 18 |
olle |
977 |
|
4733 |
05 Apr 18 |
olle |
978 |
/* |
4733 |
05 Apr 18 |
olle |
var boxMsg = 'Box-number where the '+tubeContentTypeNameInternal+' tube is located in.'; |
4733 |
05 Apr 18 |
olle |
980 |
*/ |
4733 |
05 Apr 18 |
olle |
var boxMsg = 'Box-number and position where the '+tubeContentTypeNameInternal+' tube is located.'; |
4733 |
05 Apr 18 |
olle |
var dnaBoxMsg = 'Box-number and position where the DNA extract will be located.'; |
4733 |
05 Apr 18 |
olle |
var rnaBoxMsg = 'Box-number and position where the RNA extract will be located.'; |
4733 |
05 Apr 18 |
olle |
var disabledAttribute = ''; |
4733 |
05 Apr 18 |
olle |
if (i == 0 && tubeContentType == 'Specimen') |
4733 |
05 Apr 18 |
olle |
986 |
{ |
4733 |
05 Apr 18 |
olle |
boxMsg = 'No storage space allocated for first '+tubeContentTypeNameInternal+'; all amount expected to be used.'; |
4733 |
05 Apr 18 |
olle |
disabledAttribute = ' disabled'; |
4733 |
05 Apr 18 |
olle |
989 |
} |
4733 |
05 Apr 18 |
olle |
html += '<tr>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="subprompt">'+tubeContentTypeName+' '+tubeName+' '+'Box</td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="input">'; |
4733 |
05 Apr 18 |
olle |
993 |
/* |
4733 |
05 Apr 18 |
olle |
html += '<input type="text" name="box.'+i+'" id="box.'+i+'" style="width: 12em;" maxlength="12"'+disabledAttribute+'></td>'; |
4733 |
05 Apr 18 |
olle |
995 |
*/ |
4733 |
05 Apr 18 |
olle |
html += '<input type="text" name="box.'+i+'" id="box.'+i+'" style="width: 12em;" maxlength="12"'+disabledAttribute+'>'; |
4733 |
05 Apr 18 |
olle |
html += ' Row<input type="text" name="row.'+i+'" id="row.'+i+'" style="text-transform:uppercase; width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
4733 |
05 Apr 18 |
olle |
html += ' Column<input type="text" name="column.'+i+'" id="column.'+i+'" style="width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
4733 |
05 Apr 18 |
olle |
html += '</td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="status" id="box.'+i+'.status"></td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="help"><span id="box.'+i+'.message" class="message"></span>'+boxMsg+'<span id="position.'+i+'.message" class="message"></span></td>'; |
4733 |
05 Apr 18 |
olle |
html += '</tr>'; |
4733 |
05 Apr 18 |
olle |
1003 |
/* |
4733 |
05 Apr 18 |
olle |
html += '<tr>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="subprompt">Row</td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="input">'; |
4733 |
05 Apr 18 |
olle |
html += '<input type="text" name="row.'+i+'" id="row.'+i+'" style="text-transform:uppercase; width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
4733 |
05 Apr 18 |
olle |
html += ' Column<input type="text" name="column.'+i+'" id="column.'+i+'" style="width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
4733 |
05 Apr 18 |
olle |
html += '</td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="status" id="position.'+i+'.status"></td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="help"><span id="position.'+i+'.message" class="message"></span></td>'; |
4733 |
05 Apr 18 |
olle |
html += '</tr>'; |
4733 |
05 Apr 18 |
olle |
1013 |
*/ |
4733 |
05 Apr 18 |
olle |
1014 |
|
4733 |
05 Apr 18 |
olle |
if (tubeContentType == 'Specimen') |
4733 |
05 Apr 18 |
olle |
1016 |
{ |
4733 |
05 Apr 18 |
olle |
disabledAttribute = ''; |
4733 |
05 Apr 18 |
olle |
if (i == 0 || !extractsFromFirstSpecimenOnly) |
4733 |
05 Apr 18 |
olle |
1019 |
{ |
4733 |
05 Apr 18 |
olle |
html += '<tr>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="subprompt">DNA extract'+' '+tubeName+'.d '+'Box</td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="input">'; |
4733 |
05 Apr 18 |
olle |
html += '<input type="text" name="dnaBox.'+i+'" id="dnaBox.'+i+'" style="width: 12em;" maxlength="12"'+disabledAttribute+'>'; |
4733 |
05 Apr 18 |
olle |
html += ' Row<input type="text" name="dnaRow.'+i+'" id="dnaRow.'+i+'" style="text-transform:uppercase; width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
4733 |
05 Apr 18 |
olle |
html += ' Column<input type="text" name="dnaColumn.'+i+'" id="dnaColumn.'+i+'" style="width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
4733 |
05 Apr 18 |
olle |
html += '</td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="status" id="dnaBox.'+i+'.status"></td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="help"><span id="dnaBox.'+i+'.message" class="message"></span>'+dnaBoxMsg+'<span id="dnaPosition.'+i+'.message" class="message"></span></td>'; |
4733 |
05 Apr 18 |
olle |
html += '</tr>'; |
4733 |
05 Apr 18 |
olle |
1030 |
|
4733 |
05 Apr 18 |
olle |
html += '<tr>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="subprompt">RNA extract'+' '+tubeName+'.r '+'Box</td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="input">'; |
4733 |
05 Apr 18 |
olle |
html += '<input type="text" name="rnaBox.'+i+'" id="rnaBox.'+i+'" style="width: 12em;" maxlength="12"'+disabledAttribute+'>'; |
4733 |
05 Apr 18 |
olle |
html += ' Row<input type="text" name="rnaRow.'+i+'" id="rnaRow.'+i+'" style="text-transform:uppercase; width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
4733 |
05 Apr 18 |
olle |
html += ' Column<input type="text" name="rnaColumn.'+i+'" id="rnaColumn.'+i+'" style="width: 3em;" maxlength="2"'+disabledAttribute+'>'; |
4733 |
05 Apr 18 |
olle |
html += '</td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="status" id="rnaBox.'+i+'.status"></td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="help"><span id="rnaBox.'+i+'.message" class="message"></span>'+rnaBoxMsg+'<span id="rnaPosition.'+i+'.message" class="message"></span></td>'; |
4733 |
05 Apr 18 |
olle |
html += '</tr>'; |
4733 |
05 Apr 18 |
olle |
1041 |
} |
4733 |
05 Apr 18 |
olle |
1042 |
|
4733 |
05 Apr 18 |
olle |
html += '<tr>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="subprompt">Number of sections</td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="input">'; |
4733 |
05 Apr 18 |
olle |
html += '<input type="text" name="nofSections.'+i+'" id="nofSections.'+i+'" style="width: 3em;" maxlength="2" value="1">'; |
4733 |
05 Apr 18 |
olle |
html += '</td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="status" id="nofSections.'+i+'.status"></td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="help"><span id="nofSections.'+i+'.message" class="message"></span>Number of sections (slices) in FFPE block.</td>'; |
4733 |
05 Apr 18 |
olle |
html += '</tr>'; |
4733 |
05 Apr 18 |
olle |
1051 |
} |
4733 |
05 Apr 18 |
olle |
1052 |
|
4733 |
05 Apr 18 |
olle |
html += '<tr class="align-top">'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="subprompt">Operator delivery comment</td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="input"><textarea rows="3" name="comment.'+i+'" id="comment.'+i+'"></textarea></td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="status" id="comment.'+i+'.status"></td>'; |
4733 |
05 Apr 18 |
olle |
html += '<td class="help"><span id="comment.'+i+'.message" class="message"></span>In this field, enter information specific for '+tubeContentTypeNameInternal+' tube ' +tubeIdentifier+'.</td>'; |
4733 |
05 Apr 18 |
olle |
html += '</tr>'; |
4733 |
05 Apr 18 |
olle |
1059 |
} |
4733 |
05 Apr 18 |
olle |
Doc.element('specimen-tubes').innerHTML = html; |
4733 |
05 Apr 18 |
olle |
1061 |
|
4733 |
05 Apr 18 |
olle |
// Add click handlers for buttons for adding standard comments for all specimens/RNA/DNA |
4733 |
05 Apr 18 |
olle |
var addCarvedOutCommentGeneralButton = Doc.element('addCarvedOutComment'); |
4733 |
05 Apr 18 |
olle |
Buttons.addClickHandler(addCarvedOutCommentGeneralButton, persinfo.addCommentGeneral, {'nofTubes': nofTubes, 'text-field': 'comment.', 'text': 'Utkarvad.'}); |
4733 |
05 Apr 18 |
olle |
var addMnbCommentGeneralButton = Doc.element('addMnbComment'); |
4733 |
05 Apr 18 |
olle |
Buttons.addClickHandler(addMnbCommentGeneralButton, persinfo.addCommentGeneral, {'nofTubes': nofTubes, 'text-field': 'comment.', 'text': 'MNB.'}); |
4733 |
05 Apr 18 |
olle |
1067 |
|
4733 |
05 Apr 18 |
olle |
Wizard.setCurrentStep(4); |
4733 |
05 Apr 18 |
olle |
Doc.show('goregister'); |
4733 |
05 Apr 18 |
olle |
Doc.show('gocancel'); |
4733 |
05 Apr 18 |
olle |
frm['comment.0'].focus(); |
4733 |
05 Apr 18 |
olle |
1072 |
|
4733 |
05 Apr 18 |
olle |
var url = '../SpecimenTubeRegistration.servlet?ID='+App.getSessionId(); |
4733 |
05 Apr 18 |
olle |
url += '&cmd=FindStoragePositions'; |
4733 |
05 Apr 18 |
olle |
url += '&nofTubes='+frm.nofTubes.value; |
4733 |
05 Apr 18 |
olle |
url += '&storageBoxSuffix='+storageBoxSuffix; |
4733 |
05 Apr 18 |
olle |
url += '&extractsFromFirstSpecimenOnly='+extractsFromFirstSpecimenOnly; |
4733 |
05 Apr 18 |
olle |
1078 |
|
4733 |
05 Apr 18 |
olle |
Wizard.showLoadingAnimation('Looking for empty box positions...'); |
4733 |
05 Apr 18 |
olle |
Wizard.asyncJsonRequest(url, persinfo.storagePositionsLoaded); |
4733 |
05 Apr 18 |
olle |
1081 |
} |
4733 |
05 Apr 18 |
olle |
1082 |
|
4733 |
05 Apr 18 |
olle |
persinfo.addCommentGeneral = function(event) |
4733 |
05 Apr 18 |
olle |
1084 |
{ |
4733 |
05 Apr 18 |
olle |
var nofTubes = Data.get(event.currentTarget, 'nofTubes', event.currentTarget.id); |
4733 |
05 Apr 18 |
olle |
var textFieldBase = Data.get(event.currentTarget, 'text-field', event.currentTarget.id); |
4733 |
05 Apr 18 |
olle |
var text = Data.get(event.currentTarget, 'text', event.currentTarget.id); |
4733 |
05 Apr 18 |
olle |
for (var i=0; i < nofTubes; i++) |
4733 |
05 Apr 18 |
olle |
1089 |
{ |
4733 |
05 Apr 18 |
olle |
var textField = Doc.element(textFieldBase+i); |
4733 |
05 Apr 18 |
olle |
if (textField) |
4733 |
05 Apr 18 |
olle |
1092 |
{ |
4733 |
05 Apr 18 |
olle |
if (text && text != '') |
4733 |
05 Apr 18 |
olle |
1094 |
{ |
4733 |
05 Apr 18 |
olle |
if (textField.value != '') |
4733 |
05 Apr 18 |
olle |
1096 |
{ |
4733 |
05 Apr 18 |
olle |
textField.value += ' '; |
4733 |
05 Apr 18 |
olle |
1098 |
} |
4733 |
05 Apr 18 |
olle |
textField.value += text; |
4733 |
05 Apr 18 |
olle |
1100 |
} |
4733 |
05 Apr 18 |
olle |
1101 |
} |
4733 |
05 Apr 18 |
olle |
1102 |
} |
4733 |
05 Apr 18 |
olle |
persinfo.setNumberOfSectionsFromComment(event); |
4733 |
05 Apr 18 |
olle |
1104 |
} |
4733 |
05 Apr 18 |
olle |
1105 |
|
4733 |
05 Apr 18 |
olle |
persinfo.addComment = function(event) |
4733 |
05 Apr 18 |
olle |
1107 |
{ |
4733 |
05 Apr 18 |
olle |
var textField = Doc.element(Data.get(event.currentTarget, 'text-field', event.currentTarget.id)); |
4733 |
05 Apr 18 |
olle |
var text = Data.get(event.currentTarget, 'text', event.currentTarget.id); |
4733 |
05 Apr 18 |
olle |
if (textField) |
4733 |
05 Apr 18 |
olle |
1111 |
{ |
4733 |
05 Apr 18 |
olle |
if (text && text != '') |
4733 |
05 Apr 18 |
olle |
1113 |
{ |
4733 |
05 Apr 18 |
olle |
if (textField.value != '') |
4733 |
05 Apr 18 |
olle |
1115 |
{ |
4733 |
05 Apr 18 |
olle |
textField.value += ' '; |
4733 |
05 Apr 18 |
olle |
1117 |
} |
4733 |
05 Apr 18 |
olle |
textField.value += text; |
4733 |
05 Apr 18 |
olle |
1119 |
} |
4733 |
05 Apr 18 |
olle |
1120 |
} |
4733 |
05 Apr 18 |
olle |
persinfo.setNumberOfSectionsFromComment(event); |
4733 |
05 Apr 18 |
olle |
1122 |
} |
4733 |
05 Apr 18 |
olle |
1123 |
|
4733 |
05 Apr 18 |
olle |
persinfo.setNumberOfSectionsFromComment = function(event) |
4733 |
05 Apr 18 |
olle |
1125 |
{ |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
var nofTubes = Data.get(event.currentTarget, 'nofTubes', event.currentTarget.id); |
4733 |
05 Apr 18 |
olle |
var textFieldBase = Data.get(event.currentTarget, 'text-field', event.currentTarget.id); |
4733 |
05 Apr 18 |
olle |
for (var i=0; i < nofTubes; i++) |
4733 |
05 Apr 18 |
olle |
1130 |
{ |
4733 |
05 Apr 18 |
olle |
var numSections = 1; |
4733 |
05 Apr 18 |
olle |
var textField = Doc.element(textFieldBase+i); |
4733 |
05 Apr 18 |
olle |
if (textField) |
4733 |
05 Apr 18 |
olle |
1134 |
{ |
4733 |
05 Apr 18 |
olle |
var text = textField.value; |
4733 |
05 Apr 18 |
olle |
if (text && text != '') |
4733 |
05 Apr 18 |
olle |
1137 |
{ |
4733 |
05 Apr 18 |
olle |
// If comment "Utkarvad." and not "MNB." => number of sections set to 0 |
4733 |
05 Apr 18 |
olle |
if (text.indexOf('Utkarvad.') >= 0 && text.indexOf('MNB.') < 0) |
4733 |
05 Apr 18 |
olle |
1140 |
{ |
4733 |
05 Apr 18 |
olle |
numSections = 0; |
4733 |
05 Apr 18 |
olle |
1142 |
} |
4733 |
05 Apr 18 |
olle |
1143 |
} |
4733 |
05 Apr 18 |
olle |
1144 |
} |
4733 |
05 Apr 18 |
olle |
frm['nofSections.'+i].value = numSections; |
4733 |
05 Apr 18 |
olle |
1146 |
} |
4733 |
05 Apr 18 |
olle |
1147 |
} |
4733 |
05 Apr 18 |
olle |
1148 |
|
4733 |
05 Apr 18 |
olle |
persinfo.storagePositionsLoaded = function(response) |
4733 |
05 Apr 18 |
olle |
1150 |
{ |
4733 |
05 Apr 18 |
olle |
var freeWells = response.wells; |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
var tubeContentType = frm.tubeContentType.value; |
4733 |
05 Apr 18 |
olle |
var nofTubes = parseInt(frm.nofTubes.value); |
4733 |
05 Apr 18 |
olle |
var extractsFromFirstSpecimenOnly = frm.extractsFromFirstSpecimenOnlyCB.checked; |
4733 |
05 Apr 18 |
olle |
1156 |
|
4733 |
05 Apr 18 |
olle |
// No storage space is allocated for first specimen, |
4733 |
05 Apr 18 |
olle |
// since all amount is expected to be used for analysis. |
4733 |
05 Apr 18 |
olle |
// Specimen tube with i == 0 is therefore skipped. |
4733 |
05 Apr 18 |
olle |
if (tubeContentType == 'Specimen') |
4733 |
05 Apr 18 |
olle |
1161 |
{ |
4733 |
05 Apr 18 |
olle |
for (var i = 0; i < nofTubes; i++) |
4733 |
05 Apr 18 |
olle |
1163 |
{ |
4733 |
05 Apr 18 |
olle |
wellIndex = 3*i; |
4733 |
05 Apr 18 |
olle |
var specWell = null; |
4733 |
05 Apr 18 |
olle |
if (i > 0) |
4733 |
05 Apr 18 |
olle |
1167 |
{ |
4733 |
05 Apr 18 |
olle |
specWell = freeWells[wellIndex]; |
4733 |
05 Apr 18 |
olle |
if (!specWell || specWell == '') |
4733 |
05 Apr 18 |
olle |
1170 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('box.'+i, 'invalid', 'Missing box'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
1173 |
} |
4733 |
05 Apr 18 |
olle |
1174 |
} |
4733 |
05 Apr 18 |
olle |
var dnaWell = null; |
4733 |
05 Apr 18 |
olle |
if (i == 0 || !extractsFromFirstSpecimenOnly) |
4733 |
05 Apr 18 |
olle |
1177 |
{ |
4733 |
05 Apr 18 |
olle |
dnaWell = freeWells[wellIndex+1]; |
4733 |
05 Apr 18 |
olle |
if (!dnaWell || dnaWell == '') |
4733 |
05 Apr 18 |
olle |
1180 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('dnaBox.'+i, 'invalid', 'Missing box'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
1183 |
} |
4733 |
05 Apr 18 |
olle |
1184 |
} |
4733 |
05 Apr 18 |
olle |
var rnaWell = null; |
4733 |
05 Apr 18 |
olle |
if (i == 0 || !extractsFromFirstSpecimenOnly) |
4733 |
05 Apr 18 |
olle |
1187 |
{ |
4733 |
05 Apr 18 |
olle |
rnaWell = freeWells[wellIndex+2]; |
4733 |
05 Apr 18 |
olle |
if (!rnaWell || rnaWell == '') |
4733 |
05 Apr 18 |
olle |
1190 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('rnaBox.'+i, 'invalid', 'Missing box'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
1193 |
} |
4733 |
05 Apr 18 |
olle |
1194 |
} |
4733 |
05 Apr 18 |
olle |
1195 |
|
4733 |
05 Apr 18 |
olle |
// Update form fields for storage plates |
4733 |
05 Apr 18 |
olle |
if (specWell) |
4733 |
05 Apr 18 |
olle |
1198 |
{ |
4733 |
05 Apr 18 |
olle |
frm['box.'+i].value = specWell.bioPlate.name; |
4733 |
05 Apr 18 |
olle |
frm['row.'+i].value = Meludi.wellToAlpha(specWell.row); |
4733 |
05 Apr 18 |
olle |
frm['column.'+i].value = specWell.column+1; |
4733 |
05 Apr 18 |
olle |
1202 |
} |
4733 |
05 Apr 18 |
olle |
1203 |
|
4733 |
05 Apr 18 |
olle |
if (dnaWell) |
4733 |
05 Apr 18 |
olle |
1205 |
{ |
4733 |
05 Apr 18 |
olle |
frm['dnaBox.'+i].value = dnaWell.bioPlate.name; |
4733 |
05 Apr 18 |
olle |
frm['dnaRow.'+i].value = Meludi.wellToAlpha(dnaWell.row); |
4733 |
05 Apr 18 |
olle |
frm['dnaColumn.'+i].value = dnaWell.column+1; |
4733 |
05 Apr 18 |
olle |
1209 |
} |
4733 |
05 Apr 18 |
olle |
1210 |
|
4733 |
05 Apr 18 |
olle |
if (rnaWell) |
4733 |
05 Apr 18 |
olle |
1212 |
{ |
4733 |
05 Apr 18 |
olle |
frm['rnaBox.'+i].value = rnaWell.bioPlate.name; |
4733 |
05 Apr 18 |
olle |
frm['rnaRow.'+i].value = Meludi.wellToAlpha(rnaWell.row); |
4733 |
05 Apr 18 |
olle |
frm['rnaColumn.'+i].value = rnaWell.column+1; |
4733 |
05 Apr 18 |
olle |
1216 |
} |
4733 |
05 Apr 18 |
olle |
1217 |
|
4733 |
05 Apr 18 |
olle |
// Move focus to next field |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('box.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'row.'+i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('row.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'column.'+i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('column.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'dnaBox.'+i }); |
4733 |
05 Apr 18 |
olle |
1222 |
|
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('dnaBox.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'dnaRow.'+i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('dnaRow.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'dnaColumn.'+i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('dnaColumn.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'rnaBox.'+i }); |
4733 |
05 Apr 18 |
olle |
1226 |
|
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('rnaBox.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'rnaRow.'+i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('rnaRow.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'rnaColumn.'+i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('rnaColumn.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'nofSections.'+i }); |
4733 |
05 Apr 18 |
olle |
1230 |
|
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('nofSections.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'comment.'+i }); |
4733 |
05 Apr 18 |
olle |
1232 |
|
4733 |
05 Apr 18 |
olle |
// Form validation |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('column.'+i, 'keypress', Events.integerOnly); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('box.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'Specimen', 'index': i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('row.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'Specimen', 'index': i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('column.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'Specimen', 'index': i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('box.'+i, 'keyup', persinfo.boxOnKeyUp, { 'boxtype': 'Specimen'}); |
4733 |
05 Apr 18 |
olle |
1239 |
|
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('dnaColumn.'+i, 'keypress', Events.integerOnly); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('dnaBox.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'DNA', 'index': i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('dnaRow.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'DNA', 'index': i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('dnaColumn.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'DNA', 'index': i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('dnaBox.'+i, 'keyup', persinfo.boxOnKeyUp, { 'boxtype': 'DNA'}); |
4733 |
05 Apr 18 |
olle |
1245 |
|
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('rnaColumn.'+i, 'keypress', Events.integerOnly); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('rnaBox.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'RNA', 'index': i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('rnaRow.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'RNA', 'index': i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('rnaColumn.'+i, 'change', persinfo.wellOnChange, { 'boxtype': 'RNA', 'index': i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('rnaBox.'+i, 'keyup', persinfo.boxOnKeyUp, { 'boxtype': 'RNA'}); |
4733 |
05 Apr 18 |
olle |
1251 |
|
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('nofSections.'+i, 'keypress', Events.integerOnly); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('nofSections.'+i, 'change', persinfo.nofSectionsOnChange, { 'index': i }); |
4733 |
05 Apr 18 |
olle |
1254 |
|
4733 |
05 Apr 18 |
olle |
wellIsValid[i] = true; |
4733 |
05 Apr 18 |
olle |
dnaWellIsValid[i] = true; |
4733 |
05 Apr 18 |
olle |
rnaWellIsValid[i] = true; |
4733 |
05 Apr 18 |
olle |
1258 |
/* |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('position.'+i, 'valid'); |
4733 |
05 Apr 18 |
olle |
1260 |
*/ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('box.'+i, 'valid'); |
4733 |
05 Apr 18 |
olle |
if (i == 0 || !extractsFromFirstSpecimenOnly) |
4733 |
05 Apr 18 |
olle |
1263 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('dnaBox.'+i, 'valid'); |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('rnaBox.'+i, 'valid'); |
4733 |
05 Apr 18 |
olle |
1266 |
} |
4733 |
05 Apr 18 |
olle |
if (tubeContentType == 'Specimen') |
4733 |
05 Apr 18 |
olle |
1268 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('nofSections.'+i, 'valid'); |
4733 |
05 Apr 18 |
olle |
1270 |
} |
4733 |
05 Apr 18 |
olle |
1271 |
} |
4733 |
05 Apr 18 |
olle |
1272 |
} |
4733 |
05 Apr 18 |
olle |
else if (tubeContentType == 'DNA' || tubeContentType == 'RNA' || tubeContentType == 'DNA_RNA') |
4733 |
05 Apr 18 |
olle |
1274 |
{ |
4733 |
05 Apr 18 |
olle |
for (var i = 0; i < nofTubes; i++) |
4733 |
05 Apr 18 |
olle |
1276 |
{ |
4733 |
05 Apr 18 |
olle |
var wellIndex = i; |
4733 |
05 Apr 18 |
olle |
var well = freeWells[wellIndex]; |
4733 |
05 Apr 18 |
olle |
if (!well || well == '') |
4733 |
05 Apr 18 |
olle |
1280 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('box.'+i, 'invalid', 'Missing box'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
1283 |
} |
4733 |
05 Apr 18 |
olle |
frm['box.'+i].value = well.bioPlate.name; |
4733 |
05 Apr 18 |
olle |
frm['row.'+i].value = Meludi.wellToAlpha(well.row); |
4733 |
05 Apr 18 |
olle |
frm['column.'+i].value = well.column+1; |
4733 |
05 Apr 18 |
olle |
1287 |
|
4733 |
05 Apr 18 |
olle |
// Move focus to next field |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('box.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'row.'+i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('row.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'column.'+i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('column.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'nofSections.'+i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('nofSections.'+i, 'keypress', Wizard.focusOnEnter, { 'next-focus': 'comment.'+i }); |
4733 |
05 Apr 18 |
olle |
1293 |
|
4733 |
05 Apr 18 |
olle |
// Form validation |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('column.'+i, 'keypress', Events.integerOnly); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('box.'+i, 'change', persinfo.wellOnChange, { 'index': i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('row.'+i, 'change', persinfo.wellOnChange, { 'index': i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('column.'+i, 'change', persinfo.wellOnChange, { 'index': i }); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('box.'+i, 'keyup', persinfo.boxOnKeyUp); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('nofSections.'+i, 'keypress', Events.integerOnly); |
4733 |
05 Apr 18 |
olle |
Events.addEventHandler('nofSections.'+i, 'change', persinfo.nofSectionsOnChange, { 'index': i }); |
4733 |
05 Apr 18 |
olle |
1302 |
|
4733 |
05 Apr 18 |
olle |
wellIsValid[i] = true; |
4733 |
05 Apr 18 |
olle |
1304 |
/* |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('position.'+i, 'valid'); |
4733 |
05 Apr 18 |
olle |
1306 |
*/ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('box.'+i, 'valid'); |
4733 |
05 Apr 18 |
olle |
if (tubeContentType == 'Specimen') |
4733 |
05 Apr 18 |
olle |
1309 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('nofSections.'+i, 'valid'); |
4733 |
05 Apr 18 |
olle |
1311 |
} |
4733 |
05 Apr 18 |
olle |
1312 |
} |
4733 |
05 Apr 18 |
olle |
1313 |
} |
4733 |
05 Apr 18 |
olle |
1314 |
} |
4733 |
05 Apr 18 |
olle |
1315 |
|
4733 |
05 Apr 18 |
olle |
persinfo.fixNofTubes = function(tubeContentType, nofTubes) |
4733 |
05 Apr 18 |
olle |
1317 |
{ |
4733 |
05 Apr 18 |
olle |
if (tubeContentType == 'DNA') |
4733 |
05 Apr 18 |
olle |
1319 |
{ |
4733 |
05 Apr 18 |
olle |
nofTubes = 1; |
4733 |
05 Apr 18 |
olle |
1321 |
} |
4733 |
05 Apr 18 |
olle |
else if (tubeContentType == 'RNA') |
4733 |
05 Apr 18 |
olle |
1323 |
{ |
4733 |
05 Apr 18 |
olle |
nofTubes = 1; |
4733 |
05 Apr 18 |
olle |
1325 |
} |
4733 |
05 Apr 18 |
olle |
else if (tubeContentType == 'DNA_RNA') |
4733 |
05 Apr 18 |
olle |
1327 |
{ |
4733 |
05 Apr 18 |
olle |
nofTubes = 2; |
4733 |
05 Apr 18 |
olle |
1329 |
} |
4733 |
05 Apr 18 |
olle |
return nofTubes; |
4733 |
05 Apr 18 |
olle |
1331 |
} |
4733 |
05 Apr 18 |
olle |
1332 |
|
4733 |
05 Apr 18 |
olle |
persinfo.fetchStorageBoxSuffix = function(tubeContentType) |
4733 |
05 Apr 18 |
olle |
1334 |
{ |
4733 |
05 Apr 18 |
olle |
var storageBoxSuffix = null; |
4733 |
05 Apr 18 |
olle |
if (tubeContentType == 'Specimen') |
4733 |
05 Apr 18 |
olle |
1337 |
{ |
4733 |
05 Apr 18 |
olle |
storageBoxSuffix = '_sp'; |
4733 |
05 Apr 18 |
olle |
1339 |
} |
4733 |
05 Apr 18 |
olle |
else if (tubeContentType == 'DNA') |
4733 |
05 Apr 18 |
olle |
1341 |
{ |
4733 |
05 Apr 18 |
olle |
storageBoxSuffix = '_dna'; |
4733 |
05 Apr 18 |
olle |
1343 |
} |
4733 |
05 Apr 18 |
olle |
else if (tubeContentType == 'RNA') |
4733 |
05 Apr 18 |
olle |
1345 |
{ |
4733 |
05 Apr 18 |
olle |
storageBoxSuffix = '_rna'; |
4733 |
05 Apr 18 |
olle |
1347 |
} |
4733 |
05 Apr 18 |
olle |
else if (tubeContentType == 'DNA_RNA') |
4733 |
05 Apr 18 |
olle |
1349 |
{ |
4733 |
05 Apr 18 |
olle |
storageBoxSuffix = '_dna_rna'; |
4733 |
05 Apr 18 |
olle |
1351 |
} |
4733 |
05 Apr 18 |
olle |
return storageBoxSuffix; |
4733 |
05 Apr 18 |
olle |
1353 |
} |
4733 |
05 Apr 18 |
olle |
1354 |
|
4733 |
05 Apr 18 |
olle |
persinfo.fetchTubeContentTypeName = function(tubeContentType, tubeIndex) |
4733 |
05 Apr 18 |
olle |
1356 |
{ |
4733 |
05 Apr 18 |
olle |
var tubeContentTypeName = tubeContentType; |
4733 |
05 Apr 18 |
olle |
if (tubeContentType == 'DNA_RNA') |
4733 |
05 Apr 18 |
olle |
1359 |
{ |
4733 |
05 Apr 18 |
olle |
if (tubeIndex == 0) |
4733 |
05 Apr 18 |
olle |
1361 |
{ |
4733 |
05 Apr 18 |
olle |
tubeContentTypeName = 'DNA'; |
4733 |
05 Apr 18 |
olle |
1363 |
} |
4733 |
05 Apr 18 |
olle |
else if (tubeIndex == 1) |
4733 |
05 Apr 18 |
olle |
1365 |
{ |
4733 |
05 Apr 18 |
olle |
tubeContentTypeName = 'RNA'; |
4733 |
05 Apr 18 |
olle |
1367 |
} |
4733 |
05 Apr 18 |
olle |
1368 |
} |
4733 |
05 Apr 18 |
olle |
return tubeContentTypeName; |
4733 |
05 Apr 18 |
olle |
1370 |
} |
4733 |
05 Apr 18 |
olle |
1371 |
|
4733 |
05 Apr 18 |
olle |
persinfo.fetchTubeContentTypeNameInternal = function(tubeContentType, tubeContentTypeName) |
4733 |
05 Apr 18 |
olle |
1373 |
{ |
4733 |
05 Apr 18 |
olle |
var tubeContentTypeNameInternal = tubeContentTypeName; |
4733 |
05 Apr 18 |
olle |
// Convert all names except abbreviations to all lower case |
4733 |
05 Apr 18 |
olle |
if (tubeContentType == 'Specimen') |
4733 |
05 Apr 18 |
olle |
1377 |
{ |
4733 |
05 Apr 18 |
olle |
tubeContentTypeNameInternal = tubeContentTypeName.toLowerCase(); |
4733 |
05 Apr 18 |
olle |
1379 |
} |
4733 |
05 Apr 18 |
olle |
return tubeContentTypeNameInternal; |
4733 |
05 Apr 18 |
olle |
1381 |
} |
4733 |
05 Apr 18 |
olle |
1382 |
|
4733 |
05 Apr 18 |
olle |
persinfo.fetchTubeName = function(tubeContentType, caseInfo, tubeIndex) |
4733 |
05 Apr 18 |
olle |
1384 |
{ |
4733 |
05 Apr 18 |
olle |
var tubeName = Strings.encodeTags(caseInfo.originalName); |
4733 |
05 Apr 18 |
olle |
if (tubeContentType == 'Specimen') |
4733 |
05 Apr 18 |
olle |
1387 |
{ |
4733 |
05 Apr 18 |
olle |
var tubeNo = tubeIndex + caseInfo.specimenFirstIndex; |
4733 |
05 Apr 18 |
olle |
tubeName = tubeName+'.'+tubeNo; |
4733 |
05 Apr 18 |
olle |
1390 |
} |
4733 |
05 Apr 18 |
olle |
else if (tubeContentType == 'DNA') |
4733 |
05 Apr 18 |
olle |
1392 |
{ |
4733 |
05 Apr 18 |
olle |
tubeName = tubeName+'.d'; |
4733 |
05 Apr 18 |
olle |
1394 |
} |
4733 |
05 Apr 18 |
olle |
else if (tubeContentType == 'RNA') |
4733 |
05 Apr 18 |
olle |
1396 |
{ |
4733 |
05 Apr 18 |
olle |
tubeName = tubeName+'.r'; |
4733 |
05 Apr 18 |
olle |
1398 |
} |
4733 |
05 Apr 18 |
olle |
else if (tubeContentType == 'DNA_RNA') |
4733 |
05 Apr 18 |
olle |
1400 |
{ |
4733 |
05 Apr 18 |
olle |
if (tubeIndex == 0) |
4733 |
05 Apr 18 |
olle |
1402 |
{ |
4733 |
05 Apr 18 |
olle |
tubeName = tubeName+'.d'; |
4733 |
05 Apr 18 |
olle |
1404 |
} |
4733 |
05 Apr 18 |
olle |
else if (tubeIndex == 1) |
4733 |
05 Apr 18 |
olle |
1406 |
{ |
4733 |
05 Apr 18 |
olle |
tubeName = tubeName+'.r'; |
4733 |
05 Apr 18 |
olle |
1408 |
} |
4733 |
05 Apr 18 |
olle |
1409 |
} |
4733 |
05 Apr 18 |
olle |
return tubeName; |
4733 |
05 Apr 18 |
olle |
1411 |
} |
4733 |
05 Apr 18 |
olle |
1412 |
|
4733 |
05 Apr 18 |
olle |
persinfo.fetchTubeIdentifier = function(tubeContentType, tubeName, tubeNo) |
4733 |
05 Apr 18 |
olle |
1414 |
{ |
4733 |
05 Apr 18 |
olle |
var tubeIdentifier = tubeName; |
4733 |
05 Apr 18 |
olle |
if (tubeContentType == 'Specimen') |
4733 |
05 Apr 18 |
olle |
1417 |
{ |
4733 |
05 Apr 18 |
olle |
tubeIdentifier = tubeNo; |
4733 |
05 Apr 18 |
olle |
1419 |
} |
4733 |
05 Apr 18 |
olle |
return tubeIdentifier; |
4733 |
05 Apr 18 |
olle |
1421 |
} |
4733 |
05 Apr 18 |
olle |
1422 |
|
4733 |
05 Apr 18 |
olle |
persinfo.boxOnKeyUp = function(event) |
4733 |
05 Apr 18 |
olle |
1424 |
{ |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
var tubeContentType = frm.tubeContentType.value; |
4733 |
05 Apr 18 |
olle |
1427 |
|
4733 |
05 Apr 18 |
olle |
var boxType = Data.get(event.currentTarget, 'boxtype'); |
4733 |
05 Apr 18 |
olle |
var index = Data.int(event.currentTarget, 'index'); |
4733 |
05 Apr 18 |
olle |
1430 |
|
4733 |
05 Apr 18 |
olle |
// Get box prefix, default is for input tubes |
4733 |
05 Apr 18 |
olle |
var boxPrefix = 'box.'; |
4733 |
05 Apr 18 |
olle |
if (boxType && boxType == 'DNA') |
4733 |
05 Apr 18 |
olle |
1434 |
{ |
4733 |
05 Apr 18 |
olle |
boxPrefix = 'dnaBox.'; |
4733 |
05 Apr 18 |
olle |
1436 |
} |
4733 |
05 Apr 18 |
olle |
if (boxType && boxType == 'RNA') |
4733 |
05 Apr 18 |
olle |
1438 |
{ |
4733 |
05 Apr 18 |
olle |
boxPrefix = 'rnaBox.'; |
4733 |
05 Apr 18 |
olle |
1440 |
} |
4733 |
05 Apr 18 |
olle |
1441 |
|
4733 |
05 Apr 18 |
olle |
// Check box name |
4733 |
05 Apr 18 |
olle |
var boxIsValid = true; |
4733 |
05 Apr 18 |
olle |
var box = frm[boxPrefix+index].value; |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus(boxPrefix+index); |
4733 |
05 Apr 18 |
olle |
// Check for prefix "ML_" |
4733 |
05 Apr 18 |
olle |
if (box.indexOf('ML_') != 0) |
4733 |
05 Apr 18 |
olle |
1448 |
{ |
4733 |
05 Apr 18 |
olle |
boxIsValid = false; |
4733 |
05 Apr 18 |
olle |
1450 |
} |
4733 |
05 Apr 18 |
olle |
var suffix = '_sp'; |
4733 |
05 Apr 18 |
olle |
if (tubeContentType == 'DNA' || (boxType && boxType == 'DNA')) |
4733 |
05 Apr 18 |
olle |
1453 |
{ |
4733 |
05 Apr 18 |
olle |
suffix = '_dna'; |
4733 |
05 Apr 18 |
olle |
1455 |
} |
4733 |
05 Apr 18 |
olle |
else if (tubeContentType == 'RNA' || (boxType && boxType == 'RNA')) |
4733 |
05 Apr 18 |
olle |
1457 |
{ |
4733 |
05 Apr 18 |
olle |
suffix = '_rna'; |
4733 |
05 Apr 18 |
olle |
1459 |
} |
4733 |
05 Apr 18 |
olle |
// Check for suffix |
4733 |
05 Apr 18 |
olle |
if (box.indexOf(suffix) != (box.length - suffix.length)) |
4733 |
05 Apr 18 |
olle |
1462 |
{ |
4733 |
05 Apr 18 |
olle |
boxIsValid = false; |
4733 |
05 Apr 18 |
olle |
1464 |
} |
4733 |
05 Apr 18 |
olle |
1465 |
|
4733 |
05 Apr 18 |
olle |
if (!boxIsValid) |
4733 |
05 Apr 18 |
olle |
1467 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'invalid', 'Box name must start with "ML_" and end with "'+suffix+'"'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
1470 |
} |
4733 |
05 Apr 18 |
olle |
1471 |
} |
4733 |
05 Apr 18 |
olle |
1472 |
|
4733 |
05 Apr 18 |
olle |
persinfo.wellOnChange = function(event) |
4733 |
05 Apr 18 |
olle |
1474 |
{ |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
var target = event.currentTarget; |
4733 |
05 Apr 18 |
olle |
1477 |
|
4733 |
05 Apr 18 |
olle |
var boxType = Data.get(target, 'boxtype'); |
4733 |
05 Apr 18 |
olle |
var index = Data.int(target, 'index'); |
4733 |
05 Apr 18 |
olle |
1480 |
|
4733 |
05 Apr 18 |
olle |
// Get well position prefixes, default is for input tubes |
4733 |
05 Apr 18 |
olle |
var boxPrefix = 'box.'; |
4733 |
05 Apr 18 |
olle |
var rowPrefix = 'row.'; |
4733 |
05 Apr 18 |
olle |
var columnPrefix = 'column.'; |
4733 |
05 Apr 18 |
olle |
if (boxType && boxType == 'DNA') |
4733 |
05 Apr 18 |
olle |
1486 |
{ |
4733 |
05 Apr 18 |
olle |
boxPrefix = 'dnaBox.'; |
4733 |
05 Apr 18 |
olle |
rowPrefix = 'dnaRow.'; |
4733 |
05 Apr 18 |
olle |
columnPrefix = 'dnaColumn.'; |
4733 |
05 Apr 18 |
olle |
1490 |
} |
4733 |
05 Apr 18 |
olle |
if (boxType && boxType == 'RNA') |
4733 |
05 Apr 18 |
olle |
1492 |
{ |
4733 |
05 Apr 18 |
olle |
boxPrefix = 'rnaBox.'; |
4733 |
05 Apr 18 |
olle |
rowPrefix = 'rnaRow.'; |
4733 |
05 Apr 18 |
olle |
columnPrefix = 'rnaColumn.'; |
4733 |
05 Apr 18 |
olle |
1496 |
} |
4733 |
05 Apr 18 |
olle |
var box = frm[boxPrefix+index].value; |
4733 |
05 Apr 18 |
olle |
var row = frm[rowPrefix+index].value; |
4733 |
05 Apr 18 |
olle |
var column = frm[columnPrefix+index].value; |
4733 |
05 Apr 18 |
olle |
1500 |
|
4733 |
05 Apr 18 |
olle |
//wellIsValid[index] = true; |
4733 |
05 Apr 18 |
olle |
if (!boxType || boxType == 'Specimen') |
4733 |
05 Apr 18 |
olle |
1503 |
{ |
4733 |
05 Apr 18 |
olle |
wellIsValid[index] = false; |
4733 |
05 Apr 18 |
olle |
1505 |
} |
4733 |
05 Apr 18 |
olle |
else if (boxType && boxType == 'DNA') |
4733 |
05 Apr 18 |
olle |
1507 |
{ |
4733 |
05 Apr 18 |
olle |
dnaWellIsValid[index] = false; |
4733 |
05 Apr 18 |
olle |
1509 |
} |
4733 |
05 Apr 18 |
olle |
else if (boxType && boxType == 'RNA') |
4733 |
05 Apr 18 |
olle |
1511 |
{ |
4733 |
05 Apr 18 |
olle |
rnaWellIsValid[index] = false; |
4733 |
05 Apr 18 |
olle |
1513 |
} |
4733 |
05 Apr 18 |
olle |
else |
4733 |
05 Apr 18 |
olle |
1515 |
{ |
4733 |
05 Apr 18 |
olle |
wellIsValid[index] = false; |
4733 |
05 Apr 18 |
olle |
1517 |
} |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus(boxPrefix+index); |
4733 |
05 Apr 18 |
olle |
1519 |
/* |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('position.'+index); |
4733 |
05 Apr 18 |
olle |
1521 |
*/ |
4733 |
05 Apr 18 |
olle |
1522 |
|
4733 |
05 Apr 18 |
olle |
if (box == '') |
4733 |
05 Apr 18 |
olle |
1524 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'invalid', 'Missing box'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
1527 |
} |
4733 |
05 Apr 18 |
olle |
1528 |
|
4733 |
05 Apr 18 |
olle |
// Position errors are reported on box message line |
4733 |
05 Apr 18 |
olle |
if (row == '') |
4733 |
05 Apr 18 |
olle |
1531 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'invalid', 'Missing row'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
1534 |
} |
4733 |
05 Apr 18 |
olle |
1535 |
|
4733 |
05 Apr 18 |
olle |
if (column == '') |
4733 |
05 Apr 18 |
olle |
1537 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'invalid', 'Missing column'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
1540 |
} |
4733 |
05 Apr 18 |
olle |
1541 |
|
4733 |
05 Apr 18 |
olle |
// Check for duplicates |
4733 |
05 Apr 18 |
olle |
var nofTubes = parseInt(frm.nofTubes.value); |
4733 |
05 Apr 18 |
olle |
for (var i=0; i < nofTubes; i++) |
4733 |
05 Apr 18 |
olle |
1545 |
{ |
4733 |
05 Apr 18 |
olle |
if (i != index) |
4733 |
05 Apr 18 |
olle |
1547 |
{ |
4733 |
05 Apr 18 |
olle |
if (box == frm.elements[boxPrefix+i].value && row == frm[rowPrefix+i].value && column == frm[columnPrefix+i].value) |
4733 |
05 Apr 18 |
olle |
1549 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'invalid', 'The position is already used once in this wizard'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
1552 |
} |
4733 |
05 Apr 18 |
olle |
1553 |
} |
4733 |
05 Apr 18 |
olle |
1554 |
} |
4733 |
05 Apr 18 |
olle |
1555 |
|
4733 |
05 Apr 18 |
olle |
//Wizard.setInputStatus('position.'+index, 'checking', 'Checking...'); |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'checking', 'Checking...'); |
4733 |
05 Apr 18 |
olle |
1558 |
|
4733 |
05 Apr 18 |
olle |
// Seems to be ok -- check if used by another sample |
4733 |
05 Apr 18 |
olle |
var request = Ajax.getXmlHttpRequest(); |
4733 |
05 Apr 18 |
olle |
var url = '../SpecimenTubeRegistration.servlet?ID='+App.getSessionId(); |
4733 |
05 Apr 18 |
olle |
url += '&cmd=ValidateWell'; |
4733 |
05 Apr 18 |
olle |
url += '&box=' + encodeURIComponent(box); |
4733 |
05 Apr 18 |
olle |
url += '&row=' + encodeURIComponent(row); |
4733 |
05 Apr 18 |
olle |
url += '&column=' + encodeURIComponent(column); |
4733 |
05 Apr 18 |
olle |
1566 |
|
4733 |
05 Apr 18 |
olle |
Wizard.asyncJsonRequest(url, function(response) { persinfo.onBoxValidated(response, boxType, index) } ); |
4733 |
05 Apr 18 |
olle |
1568 |
} |
4733 |
05 Apr 18 |
olle |
1569 |
|
4733 |
05 Apr 18 |
olle |
persinfo.onBoxValidated = function(response, boxType, index) |
4733 |
05 Apr 18 |
olle |
1571 |
{ |
4733 |
05 Apr 18 |
olle |
// Get well position prefixes, default is for input tubes |
4733 |
05 Apr 18 |
olle |
var boxPrefix = 'box.'; |
4733 |
05 Apr 18 |
olle |
if (boxType && boxType == 'DNA') |
4733 |
05 Apr 18 |
olle |
1575 |
{ |
4733 |
05 Apr 18 |
olle |
boxPrefix = 'dnaBox.'; |
4733 |
05 Apr 18 |
olle |
1577 |
} |
4733 |
05 Apr 18 |
olle |
if (boxType && boxType == 'RNA') |
4733 |
05 Apr 18 |
olle |
1579 |
{ |
4733 |
05 Apr 18 |
olle |
boxPrefix = 'rnaBox.'; |
4733 |
05 Apr 18 |
olle |
1581 |
} |
4733 |
05 Apr 18 |
olle |
1582 |
|
4733 |
05 Apr 18 |
olle |
//Wizard.setInputStatus('position.'+index); |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus(boxPrefix+index); |
4733 |
05 Apr 18 |
olle |
if (response.message) |
4733 |
05 Apr 18 |
olle |
1586 |
{ |
4733 |
05 Apr 18 |
olle |
//Wizard.setInputStatus(response.box ? 'box.'+index : 'position.'+index, 'invalid', Strings.encodeTags(response.message)); |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'invalid', Strings.encodeTags(response.message)); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
1590 |
} |
4733 |
05 Apr 18 |
olle |
1591 |
|
4733 |
05 Apr 18 |
olle |
//wellIsValid[index] = true; |
4733 |
05 Apr 18 |
olle |
if (!boxType || boxType == 'Specimen') |
4733 |
05 Apr 18 |
olle |
1594 |
{ |
4733 |
05 Apr 18 |
olle |
wellIsValid[index] = true; |
4733 |
05 Apr 18 |
olle |
1596 |
} |
4733 |
05 Apr 18 |
olle |
else if (boxType && boxType == 'DNA') |
4733 |
05 Apr 18 |
olle |
1598 |
{ |
4733 |
05 Apr 18 |
olle |
dnaWellIsValid[index] = true; |
4733 |
05 Apr 18 |
olle |
1600 |
} |
4733 |
05 Apr 18 |
olle |
else if (boxType && boxType == 'RNA') |
4733 |
05 Apr 18 |
olle |
1602 |
{ |
4733 |
05 Apr 18 |
olle |
rnaWellIsValid[index] = true; |
4733 |
05 Apr 18 |
olle |
1604 |
} |
4733 |
05 Apr 18 |
olle |
else |
4733 |
05 Apr 18 |
olle |
1606 |
{ |
4733 |
05 Apr 18 |
olle |
wellIsValid[index] = true; |
4733 |
05 Apr 18 |
olle |
1608 |
} |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus(boxPrefix+index, 'valid'); |
4733 |
05 Apr 18 |
olle |
1610 |
/* |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('position.'+index, 'valid'); |
4733 |
05 Apr 18 |
olle |
1612 |
*/ |
4733 |
05 Apr 18 |
olle |
1613 |
} |
4733 |
05 Apr 18 |
olle |
1614 |
|
4733 |
05 Apr 18 |
olle |
persinfo.nofSectionsOnChange = function(event) |
4733 |
05 Apr 18 |
olle |
1616 |
{ |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
var target = event.currentTarget; |
4733 |
05 Apr 18 |
olle |
1619 |
|
4733 |
05 Apr 18 |
olle |
var index = Data.int(target, 'index'); |
4733 |
05 Apr 18 |
olle |
var nofSections = frm['nofSections.'+index].value; |
4733 |
05 Apr 18 |
olle |
1622 |
|
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('nofSections.'+index); |
4733 |
05 Apr 18 |
olle |
1624 |
|
4733 |
05 Apr 18 |
olle |
if (nofSections == '') |
4733 |
05 Apr 18 |
olle |
1626 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('nofSections'+index, 'invalid', 'Missing'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
1629 |
} |
4733 |
05 Apr 18 |
olle |
if (parseInt(nofSections) < 1) |
4733 |
05 Apr 18 |
olle |
1631 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('nofSections'+index, 'invalid', 'Must be at least 1'); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
1634 |
} |
4733 |
05 Apr 18 |
olle |
Wizard.setInputStatus('nofSections'+index, 'valid'); |
4733 |
05 Apr 18 |
olle |
1636 |
} |
4733 |
05 Apr 18 |
olle |
1637 |
|
4733 |
05 Apr 18 |
olle |
persinfo.validateStep4 = function(event) |
4733 |
05 Apr 18 |
olle |
1639 |
{ |
4733 |
05 Apr 18 |
olle |
var valid = false; |
4733 |
05 Apr 18 |
olle |
1641 |
|
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
var tubeContentType = frm.tubeContentType.value; |
4733 |
05 Apr 18 |
olle |
if (tubeContentType == 'Specimen') |
4733 |
05 Apr 18 |
olle |
1645 |
{ |
4733 |
05 Apr 18 |
olle |
for (var i = 0; i < wellIsValid.length; i++) |
4733 |
05 Apr 18 |
olle |
1647 |
{ |
4733 |
05 Apr 18 |
olle |
// No storage space is allocated for first specimen, |
4733 |
05 Apr 18 |
olle |
// since all amount is expected to be used for analysis. |
4733 |
05 Apr 18 |
olle |
// Specimen tube with i == 0 is therefore skipped. |
4733 |
05 Apr 18 |
olle |
if (i > 0) |
4733 |
05 Apr 18 |
olle |
1652 |
{ |
4733 |
05 Apr 18 |
olle |
if (!wellIsValid[i]) |
4733 |
05 Apr 18 |
olle |
1654 |
{ |
4733 |
05 Apr 18 |
olle |
event.preventDefault(); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
1657 |
} |
4733 |
05 Apr 18 |
olle |
1658 |
} |
4733 |
05 Apr 18 |
olle |
if (!dnaWellIsValid[i]) |
4733 |
05 Apr 18 |
olle |
1660 |
{ |
4733 |
05 Apr 18 |
olle |
event.preventDefault(); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
1663 |
} |
4733 |
05 Apr 18 |
olle |
if (!rnaWellIsValid[i]) |
4733 |
05 Apr 18 |
olle |
1665 |
{ |
4733 |
05 Apr 18 |
olle |
event.preventDefault(); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
1668 |
} |
4733 |
05 Apr 18 |
olle |
1669 |
} |
4733 |
05 Apr 18 |
olle |
1670 |
} |
4733 |
05 Apr 18 |
olle |
else |
4733 |
05 Apr 18 |
olle |
1672 |
{ |
4733 |
05 Apr 18 |
olle |
// Input DNA, RNA, or DNA + RNA |
4733 |
05 Apr 18 |
olle |
for (var i = 0; i < wellIsValid.length; i++) |
4733 |
05 Apr 18 |
olle |
1675 |
{ |
4733 |
05 Apr 18 |
olle |
if (!wellIsValid[i]) |
4733 |
05 Apr 18 |
olle |
1677 |
{ |
4733 |
05 Apr 18 |
olle |
event.preventDefault(); |
4733 |
05 Apr 18 |
olle |
return; |
4733 |
05 Apr 18 |
olle |
1680 |
} |
4733 |
05 Apr 18 |
olle |
1681 |
} |
4733 |
05 Apr 18 |
olle |
1682 |
} |
4733 |
05 Apr 18 |
olle |
1683 |
} |
4733 |
05 Apr 18 |
olle |
1684 |
|
4733 |
05 Apr 18 |
olle |
persinfo.submit = function() |
4733 |
05 Apr 18 |
olle |
1686 |
{ |
4733 |
05 Apr 18 |
olle |
var frm = document.forms['meludi']; |
4733 |
05 Apr 18 |
olle |
var updateMode = caseInfo.id; |
4733 |
05 Apr 18 |
olle |
1689 |
|
4733 |
05 Apr 18 |
olle |
caseInfo.plNumber = frm.plNumber.value; |
4733 |
05 Apr 18 |
olle |
caseInfo.pad = frm.pad.value; |
4733 |
05 Apr 18 |
olle |
caseInfo.samplingDate = Strings.trim(frm.samplingDate.value); |
4733 |
05 Apr 18 |
olle |
caseInfo.tubeContentType = frm.tubeContentType.value; |
4733 |
05 Apr 18 |
olle |
if (!updateMode) |
4733 |
05 Apr 18 |
olle |
1695 |
{ |
4733 |
05 Apr 18 |
olle |
caseInfo.arrivalDate = Strings.trim(frm.arrivalDate.value); |
4779 |
20 Apr 18 |
olle |
1697 |
/* |
4733 |
05 Apr 18 |
olle |
caseInfo.mutationAnalysisKras = frm.mutationAnalysisKras.checked; |
4733 |
05 Apr 18 |
olle |
caseInfo.mutationAnalysisNras = frm.mutationAnalysisNras.checked; |
4733 |
05 Apr 18 |
olle |
caseInfo.mutationAnalysisBraf = frm.mutationAnalysisBraf.checked; |
4733 |
05 Apr 18 |
olle |
caseInfo.mutationAnalysisEgfr = frm.mutationAnalysisEgfr.checked; |
4733 |
05 Apr 18 |
olle |
caseInfo.mutationAnalysisAlkEml4 = frm.mutationAnalysisAlkEml4.checked; |
4733 |
05 Apr 18 |
olle |
caseInfo.mutationAnalysisPdgfra = frm.mutationAnalysisPdgfra.checked; |
4733 |
05 Apr 18 |
olle |
caseInfo.mutationAnalysisKit = frm.mutationAnalysisKit.checked; |
4779 |
20 Apr 18 |
olle |
1705 |
*/ |
4733 |
05 Apr 18 |
olle |
caseInfo.mutationAnalysisTst170 = frm.mutationAnalysisTst170.checked; |
4733 |
05 Apr 18 |
olle |
caseInfo.mutationAnalysisOther = frm.mutationAnalysisOther.checked; |
4733 |
05 Apr 18 |
olle |
caseInfo.site = frm.site.value; |
4733 |
05 Apr 18 |
olle |
caseInfo.specimenType = frm.specimenType.value; |
4733 |
05 Apr 18 |
olle |
caseInfo.specimenInputType = frm.specimenInputType.value; |
4733 |
05 Apr 18 |
olle |
caseInfo.projectFocus = frm.projectFocus.value; |
4733 |
05 Apr 18 |
olle |
caseInfo.metastasisSite = frm.metastasisSite.value; |
4733 |
05 Apr 18 |
olle |
caseInfo.viableTumourCellsPercent = frm.viableTumourCellsPercent.value; |
4733 |
05 Apr 18 |
olle |
caseInfo.otherPathNote = frm.otherPathNote.value; |
4733 |
05 Apr 18 |
olle |
caseInfo.extractsFromFirstSpecimenOnly = frm.extractsFromFirstSpecimenOnlyCB.checked; |
4733 |
05 Apr 18 |
olle |
1716 |
|
4733 |
05 Apr 18 |
olle |
var nofTubes = parseInt(frm.nofTubes.value); |
4733 |
05 Apr 18 |
olle |
caseInfo.specimen = []; |
4733 |
05 Apr 18 |
olle |
for (var i = 0; i < nofTubes; i++) |
4733 |
05 Apr 18 |
olle |
1720 |
{ |
4733 |
05 Apr 18 |
olle |
var specimenTube ={}; |
4733 |
05 Apr 18 |
olle |
specimenTube.name = persinfo.fetchTubeName(caseInfo.tubeContentType, caseInfo, i); |
4733 |
05 Apr 18 |
olle |
1723 |
|
4733 |
05 Apr 18 |
olle |
specimenTube.box = frm['box.'+i].value; |
4733 |
05 Apr 18 |
olle |
specimenTube.row = frm['row.'+i].value; |
4733 |
05 Apr 18 |
olle |
specimenTube.column = frm['column.'+i].value; |
4733 |
05 Apr 18 |
olle |
var nofSections = null; |
4733 |
05 Apr 18 |
olle |
if (caseInfo.tubeContentType == 'Specimen') |
4733 |
05 Apr 18 |
olle |
1729 |
{ |
4733 |
05 Apr 18 |
olle |
if (i == 0 || !caseInfo.extractsFromFirstSpecimenOnly) |
4733 |
05 Apr 18 |
olle |
1731 |
{ |
4733 |
05 Apr 18 |
olle |
// Storage position for DNA extract from specimen |
4733 |
05 Apr 18 |
olle |
specimenTube.dnaBox = frm['dnaBox.'+i].value; |
4733 |
05 Apr 18 |
olle |
specimenTube.dnaRow = frm['dnaRow.'+i].value; |
4733 |
05 Apr 18 |
olle |
specimenTube.dnaColumn = frm['dnaColumn.'+i].value; |
4733 |
05 Apr 18 |
olle |
1736 |
|
4733 |
05 Apr 18 |
olle |
// Storage position for RNA extract from specimen |
4733 |
05 Apr 18 |
olle |
specimenTube.rnaBox = frm['rnaBox.'+i].value; |
4733 |
05 Apr 18 |
olle |
specimenTube.rnaRow = frm['rnaRow.'+i].value; |
4733 |
05 Apr 18 |
olle |
specimenTube.rnaColumn = frm['rnaColumn.'+i].value; |
4733 |
05 Apr 18 |
olle |
1741 |
} |
4733 |
05 Apr 18 |
olle |
1742 |
|
4733 |
05 Apr 18 |
olle |
nofSections = frm['nofSections.'+i].value; |
4733 |
05 Apr 18 |
olle |
1744 |
} |
4733 |
05 Apr 18 |
olle |
specimenTube.nofSections = nofSections; |
4733 |
05 Apr 18 |
olle |
specimenTube.comment = frm['comment.'+i].value; |
4733 |
05 Apr 18 |
olle |
specimenTube.specimenType = frm.specimenType.value; |
4733 |
05 Apr 18 |
olle |
specimenTube.specimenInputType = frm.specimenInputType.value; |
4733 |
05 Apr 18 |
olle |
caseInfo.specimen[i] = specimenTube; |
4733 |
05 Apr 18 |
olle |
1750 |
} |
4733 |
05 Apr 18 |
olle |
1751 |
} |
4733 |
05 Apr 18 |
olle |
var submitInfo = {}; |
4733 |
05 Apr 18 |
olle |
submitInfo.patientInfo = patientInfo; |
4733 |
05 Apr 18 |
olle |
submitInfo.caseInfo = caseInfo; |
4733 |
05 Apr 18 |
olle |
1755 |
|
4733 |
05 Apr 18 |
olle |
var url = '../PersonalRegistration.servlet?ID='+App.getSessionId(); |
4733 |
05 Apr 18 |
olle |
url += '&cmd=' + (updateMode ? 'UpdateCase' : 'CreateCase'); |
4733 |
05 Apr 18 |
olle |
Wizard.showLoadingAnimation('Registering case...'); |
4733 |
05 Apr 18 |
olle |
Wizard.asyncJsonRequest(url, persinfo.submissionResults, 'POST', JSON.stringify(submitInfo)); |
4733 |
05 Apr 18 |
olle |
1760 |
} |
4733 |
05 Apr 18 |
olle |
1761 |
|
4733 |
05 Apr 18 |
olle |
persinfo.submissionResults = function(response) |
4733 |
05 Apr 18 |
olle |
1763 |
{ |
4733 |
05 Apr 18 |
olle |
Wizard.showFinalMessage(response.messages); |
4733 |
05 Apr 18 |
olle |
Doc.show('gorestart'); |
4733 |
05 Apr 18 |
olle |
1766 |
} |
4733 |
05 Apr 18 |
olle |
1767 |
|
4733 |
05 Apr 18 |
olle |
return persinfo; |
4733 |
05 Apr 18 |
olle |
1769 |
}(); |
4733 |
05 Apr 18 |
olle |
1770 |
|
4733 |
05 Apr 18 |
olle |
Doc.onLoad(PersInfo.initPage); |
4733 |
05 Apr 18 |
olle |
1772 |
|