<commit_before>/**
 * Created by harry on 16/12/9.
 */
(function() {

	'use strict';

	angular
		.module('app.main.submit', [])

		.controller('SubmitController', function ($scope, $rootScope, $http, $q, $uibModalInstance, toastr, CONFIG) {
			var ctrl = this;
			$scope.conclusion = {};

			$scope.selectOk = function() {

				// add/update visited departments
				$scope.patient.visitedDepartments = $scope.patient.visitedDepartments || [];
				var isExisted = false;
				for (var i=0; i<$scope.patient.visitedDepartments.length; i++) {
					if ($scope.patient.visitedDepartments[i] == $rootScope.login.department) {
						isExisted = true;
						break;
					}
				}
				var promises = [];
				if (!isExisted) {

					//todo: push not working
					var department = $rootScope.login.department;
					$scope.patient.visitedDepartments.push(department);
<commit_msg>fixed main process bugs. #2<commit_after>/**
 * Created by harry on 16/12/9.
 */
(function() {

	'use strict';

	angular
		.module('app.main.submit', [])

		.controller('SubmitController', function ($scope, $rootScope, $http, $q, $uibModalInstance, toastr, CONFIG) {
			var ctrl = this;
			$scope.conclusion = {};

			$scope.selectOk = function() {

				// add/update visited departments
				$scope.patient.visitedDepartments = $scope.patient.visitedDepartments || [];
				var isExisted = false;
				for (var i=0; i<$scope.patient.visitedDepartments.length; i++) {
					if ($scope.patient.visitedDepartments[i] == $rootScope.login.department) {
						isExisted = true;
						break;
					}
				}
				var promises = [];
				if (!isExisted) {

					$scope.patient.visitedDepartments.push($rootScope.login.department);
{'fraction_non_alphanumeric': 0.1566408576533651, 'fraction_numerical': 0.007742703990470518, 'mean_word_length': 3.3187660668380463, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3608575', 'n_tokens_mistral': 687, 'n_tokens_neox': 543, 'n_words': 111}