Got feedback or spotted a mistake?
Leave a comment at the end of this page or email contact@krishagni.com
Populate the value based on the selection of other field value/s
Using custom configuration, users should be able to configure to populate the value based on the selection of other field value/s.
Example : Based on the selection of 'Laterality' and 'Location', field value for pathology status is set. Laterality= left and Location='Anterior' then set the default value 'Left Anterior' to the pathology status field.
"specimen.laterality": [
"function(opts) {",
" var laterality = opts.fns.get(opts.object, opts.field) || ''; ",
" var location = opts.fns.get(opts.object, 'specimen.extensionDetail.attrsMap.DD22') || ''; ",
" if (['Left', 'Right'].indexOf(laterality) != -1 && ['Posterior', 'Anterior'].indexOf(location) != -1) { ",
" opts.fns.set(opts.object, 'specimen.pathology', laterality + ' ' + location); ",
" angular.forEach(opts.viewCtx.spmnCtx.aliquots, ",
" function(aliquot) { ",
" opts.fns.set(aliquot, 'laterality', laterality); ",
" opts.fns.set(aliquot, 'pathology', laterality + ' ' + location); ",
" }",
" );",
" } ",
"}"
],
Screenshot after selecting the value for 'Laterality' and 'Location' and default value set for 'Pathology status':