@@ -344,58 +344,6 @@ angular.module('starter').controller('VariableSearchCtrl',
344
344
function getPluralVariableCategoryName ( ) {
345
345
return $filter ( 'wordAliases' ) ( pluralize ( getVariableCategoryName ( ) , 1 ) ) ;
346
346
}
347
- var checkNameExists = function ( item ) {
348
- if ( ! item . name ) {
349
- var message = "variable doesn't have a name! variable: " + JSON . stringify ( item ) ;
350
- qmLog . error ( message ) ;
351
- qmLog . error ( message ) ;
352
- return false ;
353
- }
354
- return true ;
355
- } ;
356
- $scope . matchEveryWord = function ( ) {
357
- return function ( item ) {
358
- if ( $scope . state . variableSearchParameters . barcode ) {
359
- return true ;
360
- } // Name's not going to match the number
361
- if ( ! checkNameExists ( item ) ) {
362
- return false ;
363
- }
364
- if ( item . variableCategoryName ) {
365
- if ( $scope . state . variableSearchParameters . manualTracking && $scope . state . variableSearchParameters . searchPhrase . length < 5 ) {
366
- if ( item . variableCategoryName . indexOf ( 'Location' ) !== - 1 ||
367
- item . variableCategoryName . indexOf ( 'Software' ) !== - 1 ||
368
- item . variableCategoryName . indexOf ( 'Environment' ) !== - 1 ) {
369
- return false ;
370
- }
371
- }
372
- }
373
- if ( $scope . state . excludeDuplicateBloodPressure ) {
374
- if ( item . name . toLowerCase ( ) . indexOf ( 'diastolic' ) !== - 1 || item . name . toLowerCase ( ) . indexOf ( 'systolic' ) !== - 1 ) {
375
- return false ;
376
- }
377
- }
378
- if ( $scope . state . excludeSingularBloodPressure && item . name . toLowerCase ( ) === 'blood pressure' ) {
379
- return false ;
380
- }
381
- var variableObjectAsString = JSON . stringify ( item ) . toLowerCase ( ) ;
382
- var lowercaseVariableSearchQuery = $scope . state . variableSearchParameters . searchPhrase . toLowerCase ( ) ;
383
- var filterBy = lowercaseVariableSearchQuery . split ( / \s + / ) ;
384
- if ( lowercaseVariableSearchQuery ) {
385
- if ( ! filterBy . length ) {
386
- return true ;
387
- }
388
- } else {
389
- return true ;
390
- }
391
- return filterBy . every ( function ( word ) {
392
- var exists = variableObjectAsString . indexOf ( word ) ;
393
- if ( exists !== - 1 ) {
394
- return true ;
395
- }
396
- } ) ;
397
- } ;
398
- } ;
399
347
// https://open.fda.gov/api/reference/ API Key https://open.fda.gov/api/reference/
400
348
$scope . scanBarcode = function ( ) {
401
349
var params = getVariableSearchParameters ( ) ;
0 commit comments