diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index 6f36d07..9f22b5b 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -1305,6 +1305,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.pinDataUrl = "aa_dat_pinterm_" + imageId; $rootScope.bodySystemTermArray = []; $rootScope.sortedListArray = []; + $rootScope.duplicateListArray = []; $.ajax({ url: '~/../content/data/json/aa/aa_pinterm/' + $scope.pinDataUrl + '.json', type: 'GET', @@ -1318,16 +1319,22 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou if ($scope.aaPinData[i]._BodySystemName.toLowerCase() == bodySystemName.toLowerCase()) { for (var j = 0 ; j <= $rootScope.bodySystemTermArray.length - 1; j++) { if ($scope.aaPinData[i]._TermId == $rootScope.bodySystemTermArray[j].termNumbr) { - if ($rootScope.bodySystemTermArray[j].language == "1") { + if ($rootScope.bodySystemTermArray[j].language == $rootScope.lexiconLanguageArray[0].id) { console.log($rootScope.bodySystemTermArray[j].text); - $rootScope.sortedListArray.push({ "title": $rootScope.bodySystemTermArray[j].text, "id": $rootScope.bodySystemTermArray[j].termNumbr }); - + $rootScope.duplicateListArray.push({ "title": $rootScope.bodySystemTermArray[j].text, "id": $rootScope.bodySystemTermArray[j].termNumbr }); } } } } } - + var temp = []; + for (var i = 0; i <= $rootScope.duplicateListArray.length - 1; i++) { + var termID = $rootScope.duplicateListArray[i].id; + if ($.inArray(termID, temp) == -1) { + temp.push(termID); + $rootScope.sortedListArray.push({ "title": $rotScope.duplicateListArray[i].title, "id": termID }); + } + } for (var i = 0; i <= $rootScope.sortedListArray.length - 1; i++) { @@ -1360,7 +1367,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $("#totalTerms").html("" + $("#termList option").length + " Structures"); } } - $scope.GetAnnotationBasedOnActualTermNo = function (actualTermNo) { + $scope.GetAnnotationBasedOnActualTermNo = function (actualTermNo) { var languageArray = $rootScope.lexiconLanguageArray;