Commit 21aa3b41d0ff1d9b96dc8b0a459481548f769eac

Authored by Jagmohan Bodra
2 parents 1c3ad09d 152889a0

Added more features

400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs
... ... @@ -207,13 +207,28 @@ namespace AIAHTML5.ADMIN.API.Controllers
207 207 UserEntity.CreatorId = jsonUserData["Modifiedby"].Value<int>();
208 208  
209 209 JToken typeToken= jsonUserData["DeactivationDate"];
210   - if (typeToken.Type != JTokenType.Null)
211   - {
212   - UserEntity.DeactivationDate = typeToken.Value<DateTime>();
213   - }
214 210  
215 211 try
216 212 {
  213 + try
  214 + {
  215 + if (typeToken.Type != JTokenType.Null)
  216 + {
  217 + string dateString=typeToken.Value<String>();
  218 + if(!string.IsNullOrWhiteSpace(dateString))
  219 + {
  220 + UserEntity.DeactivationDate = typeToken.Value<DateTime>();
  221 + }
  222 +
  223 + }
  224 + }
  225 + catch (Exception ex)
  226 + {
  227 + // Log exception code goes here
  228 + return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex.Message);
  229 + }
  230 +
  231 +
217 232 Status = UserModel.UpdateUser(dbContext, UserEntity);
218 233 if (Status.Equals("1"))
219 234 {
... ...
400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs
... ... @@ -46,5 +46,7 @@ namespace AIAHTML5.API.Constants
46 46 public const string SAVE_AIA_IMAGE_JSON_DOCUMENTID = "SaveDocumentIdAIAImageJson";
47 47 public const string GET_AIA_IMAGE_JSON_DOCUMENTID = "GetDocumentIdAIAImageJson";
48 48 public const string CHECK_CERNER_USER_SESSION = "CheckCernerUserSession";
  49 + public const string GET_USER_DETAIL_BYLOGIN_AND_ACCOUNT = "usp_GetUserDetailsByLoginIdandAccount";
  50 + public const string UPDATE_CERNER_SESSION_INFO = "UpdateCernerSessionInfo";
49 51 }
50 52 }
51 53 \ No newline at end of file
... ...
400-SOURCECODE/AIAHTML5.API/Controllers/CernerFhirController.cs
... ... @@ -12,6 +12,7 @@ using ADAM.CernerFHIR.Client;
12 12 using ADAM.CernerFHIR.Helper;
13 13 using ADAM.CernerFHIR.Model;
14 14 using AIAHTML5.API.Models;
  15 +using eLearningPlayer.model;
15 16 using HtmlAgilityPack;
16 17 using Newtonsoft.Json.Linq;
17 18  
... ... @@ -26,9 +27,29 @@ namespace AIAHTML5.API.Controllers
26 27 }
27 28  
28 29 // GET api/<controller>/5
29   - public string Get(int id)
  30 + public void Get(string id)
30 31 {
31   - return "value";
  32 + //Update cerner user session values.
  33 + var cernerSessionId = id;// jsonData["sessionId"].Value<string>();
  34 + var db = new DBModel();
  35 + var CernerUserSession = db.CheckCernerUserSession(cernerSessionId).SingleOrDefault();
  36 + var NewLoginResult = AsyncToSyncTaskHelper.AsyncHelpers.RunSync(() => ADAM.CernerFHIR.Client.ResourceProcessor.GetCernerResourceRefreshToken(CernerUserSession.LoginResult));
  37 + NewLoginResult.EndPointURL = NewLoginResult?.EndPointURL ?? CernerUserSession.LoginResult.EndPointURL;
  38 + if (NewLoginResult != null)
  39 + {
  40 + var UpdatedCernerUserSession = new CernerUserSessionInfo()
  41 + {
  42 + CernerCode = CernerUserSession.CernerCode,
  43 + FhirUserSessionId = cernerSessionId,
  44 + CernerInfoJWT = CernerUserSession.CernerInfoJWT,
  45 + LoginResult = NewLoginResult
  46 + };
  47 + db.UpdateCernerFhirSessionInfo(UpdatedCernerUserSession);
  48 + }
  49 +
  50 +
  51 + //HttpResponseMessage response = null;
  52 + //return response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = null };
32 53 }
33 54  
34 55 // POST api/<controller>
... ... @@ -71,6 +92,28 @@ namespace AIAHTML5.API.Controllers
71 92 {
72 93 }
73 94  
  95 + [HttpGet]
  96 + [Route("UpdateToken")]
  97 + public HttpResponseMessage UpdateCernerToken(string sessionId)
  98 + {
  99 + //Update cerner user session values.
  100 + var cernerSessionId = sessionId;// jsonData["sessionId"].Value<string>();
  101 + var db = new DBModel();
  102 + var CernerUserSession = db.CheckCernerUserSession(cernerSessionId).SingleOrDefault();
  103 + var NewLoginResult = AsyncToSyncTaskHelper.AsyncHelpers.RunSync(() => ADAM.CernerFHIR.Client.ResourceProcessor.GetCernerResourceRefreshToken(CernerUserSession.LoginResult));
  104 + NewLoginResult.EndPointURL = NewLoginResult.EndPointURL ?? CernerUserSession.LoginResult.EndPointURL;
  105 + var UpdatedCernerUserSession = new CernerUserSessionInfo()
  106 + {
  107 + CernerCode = CernerUserSession.CernerCode,
  108 + FhirUserSessionId = cernerSessionId,
  109 + CernerInfoJWT = CernerUserSession.CernerInfoJWT,
  110 + LoginResult = NewLoginResult
  111 + };
  112 + db.UpdateCernerFhirSessionInfo(UpdatedCernerUserSession);
  113 +
  114 + HttpResponseMessage response = null;
  115 + return response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = null };
  116 + }
74 117  
75 118 #region Cerner fhir resource call
76 119  
... ...
400-SOURCECODE/AIAHTML5.API/Controllers/CernerUserSessionController.cs
... ... @@ -4,6 +4,7 @@ using System.Linq;
4 4 using System.Net;
5 5 using System.Net.Http;
6 6 using System.Web.Http;
  7 +using ADAM.CernerFHIR.Helper;
7 8 using AIAHTML5.API.Models;
8 9 using eLearningPlayer.model;
9 10 using Newtonsoft.Json;
... ... @@ -51,5 +52,28 @@ namespace AIAHTML5.API.Controllers
51 52 public void Delete(int id)
52 53 {
53 54 }
  55 +
  56 + [HttpGet]
  57 + [Route("UpdateCernerToken")]
  58 + public HttpResponseMessage UpdateCernerToken(string sessionId)
  59 + {
  60 + //Update cerner user session values.
  61 + var cernerSessionId = sessionId;
  62 + var db = new DBModel();
  63 + var CernerUserSession = db.CheckCernerUserSession(cernerSessionId).SingleOrDefault();
  64 + var NewLoginResult = AsyncToSyncTaskHelper.AsyncHelpers.RunSync(() => ADAM.CernerFHIR.Client.ResourceProcessor.GetCernerResourceRefreshToken(CernerUserSession.LoginResult));
  65 + NewLoginResult.EndPointURL = NewLoginResult.EndPointURL ?? CernerUserSession.LoginResult.EndPointURL;
  66 + var UpdatedCernerUserSession = new CernerUserSessionInfo()
  67 + {
  68 + CernerCode = CernerUserSession.CernerCode,
  69 + FhirUserSessionId = cernerSessionId,
  70 + CernerInfoJWT = CernerUserSession.CernerInfoJWT,
  71 + LoginResult = NewLoginResult
  72 + };
  73 + db.UpdateCernerFhirSessionInfo(UpdatedCernerUserSession);
  74 +
  75 + HttpResponseMessage response = null;
  76 + return response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = null };
  77 + }
54 78 }
55 79 }
56 80 \ No newline at end of file
... ...
400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs
... ... @@ -311,6 +311,44 @@ namespace AIAHTML5.API.Models
311 311 return objUser;
312 312 }
313 313  
  314 + internal static BypassLogin ByPassLoginDetail(string loginId, string accountNumber)
  315 + {
  316 + BypassLogin objUser = null;
  317 + DBModel objModel = new DBModel();
  318 +
  319 + SqlConnection conn = new SqlConnection(dbConnectionString);
  320 + SqlCommand cmd = new SqlCommand();
  321 + SqlDataAdapter adapter;
  322 + DataSet ds = new DataSet();
  323 +
  324 + cmd.Connection = conn;
  325 + cmd.CommandText = DBConstants.GET_USER_DETAIL_BYLOGIN_AND_ACCOUNT;
  326 + cmd.CommandType = CommandType.StoredProcedure;
  327 + cmd.Parameters.AddWithValue("@LoginId", loginId);
  328 + cmd.Parameters.AddWithValue("@AccountNumber", accountNumber);
  329 +
  330 + adapter = new SqlDataAdapter(cmd);
  331 + adapter.Fill(ds);
  332 +
  333 + if (ds != null && ds.Tables.Count > 0)
  334 + {
  335 + DataTable dt = ds.Tables[0];
  336 +
  337 + if (dt.Rows.Count > 0)
  338 + {
  339 + foreach (DataRow dr in dt.Rows)
  340 + {
  341 + objUser = new BypassLogin();
  342 + objUser.LoginId = dr["LoginId"].ToString();
  343 + objUser.Password = dr["Password"].ToString();
  344 +
  345 + }
  346 + }
  347 + }
  348 +
  349 + return objUser;
  350 + }
  351 +
314 352 internal User GetSelectedSettings(int userId)
315 353 {
316 354 logger.Debug(" Inside GetSelectedSettings for userId = " + userId);
... ... @@ -1334,7 +1372,7 @@ namespace AIAHTML5.API.Models
1334 1372 internal int SaveCernerFhirSessionInfo(CernerUserSessionInfo info)
1335 1373 {
1336 1374  
1337   - //if (CheckCernerUserSession(info.FhirUserSessionId).FhirUserSessionId != "") return 0;
  1375 + if (CheckCernerUserSession(info.FhirUserSessionId).Count > 0) return UpdateCernerFhirSessionInfo(info);
1338 1376  
1339 1377 logger.Debug($" inside SaveCernerFhirSessionInfo for PatientId = { info.CernerInfoJWT.PatientId }");
1340 1378  
... ... @@ -1352,6 +1390,7 @@ namespace AIAHTML5.API.Models
1352 1390 cmd.Parameters.AddWithValue("@Created", DateTime.Now);
1353 1391 cmd.Parameters.AddWithValue("@Expires", info.LoginResult.AccessTokenExpiration);
1354 1392 cmd.Parameters.AddWithValue("@Timeout", 10); // Now default set to 10 , cerner provided.
  1393 + cmd.Parameters.AddWithValue("@EndPointUrl", info.LoginResult.EndPointURL);
1355 1394 cmd.Parameters.AddWithValue("@AccessToken", info.LoginResult.AccessToken);
1356 1395 cmd.Parameters.AddWithValue("@RefreshToken", info.LoginResult.RefreshToken);
1357 1396 cmd.Parameters.AddWithValue("@PatientId", info.CernerInfoJWT.PatientId);
... ... @@ -1373,11 +1412,51 @@ namespace AIAHTML5.API.Models
1373 1412 return result;
1374 1413 }
1375 1414  
1376   - internal CernerUserSessionInfo CheckCernerUserSession(string sessionId)
  1415 + internal int UpdateCernerFhirSessionInfo(CernerUserSessionInfo info)
  1416 + {
  1417 + logger.Debug($" inside UpdateCernerFhirSessionInfo for PatientId = { info.CernerInfoJWT.PatientId }");
  1418 +
  1419 + int result = 0;
  1420 + SqlConnection conn = null;
  1421 + try
  1422 + {
  1423 + conn = new SqlConnection(dbConnectionString);
  1424 + SqlCommand cmd = new SqlCommand();
  1425 + conn.Open();
  1426 + cmd.Connection = conn;
  1427 + cmd.CommandText = DBConstants.UPDATE_CERNER_SESSION_INFO;
  1428 + cmd.CommandType = CommandType.StoredProcedure;
  1429 + cmd.Parameters.AddWithValue("@SessionId", info.FhirUserSessionId);
  1430 + cmd.Parameters.AddWithValue("@Created", DateTime.Now);
  1431 + cmd.Parameters.AddWithValue("@Expires", info.LoginResult.AccessTokenExpiration);
  1432 + cmd.Parameters.AddWithValue("@Timeout", 10); // Now default set to 10 , cerner provided.
  1433 + cmd.Parameters.AddWithValue("@EndPointUrl", info.LoginResult.EndPointURL);
  1434 + cmd.Parameters.AddWithValue("@AccessToken", info.LoginResult.AccessToken);
  1435 + cmd.Parameters.AddWithValue("@RefreshToken", info.LoginResult.RefreshToken);
  1436 + cmd.Parameters.AddWithValue("@PatientId", info.CernerInfoJWT.PatientId);
  1437 + cmd.Parameters.AddWithValue("@Encounter", info.CernerInfoJWT.Encounter);
  1438 + cmd.Parameters.AddWithValue("@Code", info.CernerCode);
  1439 +
  1440 + result = cmd.ExecuteNonQuery();
  1441 + }
  1442 + catch (SqlException ex)
  1443 + {
  1444 + logger.Fatal($" Exception in SaveCernerFhirSessionInfo, Exception = {ex.Message }, STACKTRACE= {ex.StackTrace}");
  1445 + throw;
  1446 + }
  1447 + finally
  1448 + {
  1449 + conn.Dispose();
  1450 + }
  1451 +
  1452 + return result;
  1453 + }
  1454 +
  1455 + internal List<CernerUserSessionInfo> CheckCernerUserSession(string sessionId)
1377 1456 {
1378 1457 logger.Debug($" inside CheckCernerUserSession for sessionId = { sessionId }");
1379 1458  
1380   - CernerUserSessionInfo cernerUserSessionInfo = null;
  1459 + List<CernerUserSessionInfo> cernerUserSessionInfo = new List<CernerUserSessionInfo>();
1381 1460 SqlConnection conn = null;
1382 1461 DataTable dt = null;
1383 1462  
... ... @@ -1398,7 +1477,7 @@ namespace AIAHTML5.API.Models
1398 1477  
1399 1478 if (dt != null && dt.Rows.Count > 0)
1400 1479 {
1401   - cernerUserSessionInfo = new CernerUserSessionInfo()
  1480 + cernerUserSessionInfo.Add(new CernerUserSessionInfo()
1402 1481 {
1403 1482 CernerCode = dt.Rows[0]["code"].ToString(),
1404 1483 FhirUserSessionId = dt.Rows[0]["SessionId"].ToString(),
... ... @@ -1413,11 +1492,8 @@ namespace AIAHTML5.API.Models
1413 1492 PatientId = dt.Rows[0]["PatientId"].ToString(),
1414 1493 Encounter = dt.Rows[0]["Encounter"].ToString(),
1415 1494 }
1416   - };
  1495 + });
1417 1496 }
1418   - else
1419   - cernerUserSessionInfo = new CernerUserSessionInfo();
1420   -
1421 1497 }
1422 1498 catch (Exception ex)
1423 1499 {
... ... @@ -1469,6 +1545,7 @@ namespace AIAHTML5.API.Models
1469 1545 cernerUserSessionInfo.FhirUserSessionId = dr["SessionId"].ToString();
1470 1546 cernerUserSessionInfo.LoginResult = new ADAM.CernerFHIR.Helper.LoginResult()
1471 1547 {
  1548 + EndPointURL = dr["EndPointURL"].ToString(),
1472 1549 AccessToken = dr["AccessToken"].ToString(),
1473 1550 RefreshToken = dr["RefreshToken"].ToString()
1474 1551 };
... ... @@ -1587,6 +1664,6 @@ namespace AIAHTML5.API.Models
1587 1664 conn.Dispose();
1588 1665 }
1589 1666 }
1590   -
  1667 +
1591 1668 }
1592 1669 }
1593 1670 \ No newline at end of file
... ...
400-SOURCECODE/AIAHTML5.API/Models/User.cs
... ... @@ -160,4 +160,11 @@ namespace AIAHTML5.API.Models
160 160  
161 161 }
162 162  
  163 + public class BypassLogin
  164 + {
  165 + public string LoginId { get; set; }
  166 + public string Password { get; set; }
  167 +
  168 + }
  169 +
163 170 }
164 171 \ No newline at end of file
... ...
400-SOURCECODE/AIAHTML5.API/Models/Users.cs
... ... @@ -307,6 +307,13 @@ namespace AIAHTML5.API.Models
307 307 return result;
308 308 }
309 309  
  310 + internal static BypassLogin ByPassLoginDetail(string loginId, string accountNumber)
  311 + {
  312 + BypassLogin objUser = null;
  313 + objUser = DBModel.ByPassLoginDetail(loginId, accountNumber);
  314 +
  315 + return objUser;
  316 + }
310 317  
311 318 internal static int SaveUserSelectedSettings(User selectedSettings)
312 319 {
... ...
400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj
... ... @@ -52378,6 +52378,7 @@
52378 52378 <Compile Include="model\CernerUserImageAIA.cs" />
52379 52379 <Compile Include="model\CernerUserSessionInfo.cs" />
52380 52380 <Compile Include="model\UtilityCerner.cs" />
  52381 + <Compile Include="UriExtensions.cs" />
52381 52382 </ItemGroup>
52382 52383 <PropertyGroup>
52383 52384 <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
... ...
400-SOURCECODE/AIAHTML5.Web/Web.config
... ... @@ -11,7 +11,7 @@
11 11 <appSettings>
12 12 <add key="owin:AutomaticAppStartup" value="false" />
13 13 <add key="CernerClientId" value="a3492f40-dd21-43e7-b874-dc5b74be519b" />
14   - <add key="CernerRedirectURL" value="http://localhost:3030" />
  14 + <add key="CernerRedirectURL" value="https://localhost:3031" />
15 15 <add key="CernerScope" value="user/Patient.read user/DocumentReference.read user/DocumentReference.write user/Binary.read launch online_access openid profile" />
16 16 <add key="AIAAPIURL" value="http://localhost:3030/API/"/>
17 17 </appSettings>
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js
... ... @@ -323,19 +323,20 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
323 323 var imagePath = "~/../content/images/ca/thumbnails/" + value._ThumbnailImage;
324 324  
325 325  
326   - var $el = $('<div id="' + value._id + '" class="col-sm-3 col-md-2" title = "' + value._Title + '" data-ng-click="openView($event)">'
327   - + '<div class="thumbnail" >'
  326 + var $el = $('<div id="' + value._id + '" class="col-sm-3 col-md-2" title = "'+ value._Title + '" data-ng-click="openView($event)">'
  327 + + '<div class="thumbnail" ><a href="#">'
328 328 + '<img id="' + value._Title + '" class="img-responsive" style="width:100%;height:100%;" ng-src="' + imagePath + '" alt="" title="" >'
329   - + '<div class="caption"><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view');
  329 + + '<div class="caption"><p>'+'('+ value._id+')</p><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view');
330 330  
331 331 $compile($el)($scope);
332   -
  332 +
333 333 $(".sidebar").mCustomScrollbar({
334 334 autoHideScrollbar: true,
335 335 //theme:"rounded"
336 336 });
337 337  
338   - });
  338 + });
  339 +
339 340 $('#' + $rootScope.getLocalStorageValue("currentBodyViewId")).find('.thumbnail').addClass('HightLightThumbnail');
340 341 $timeout(function () {
341 342 if ($rootScope.getLocalStorageValue('CAGridViewScroll') !== null && $location.url() == "/clinical-animations") {
... ... @@ -346,7 +347,22 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
346 347 200);
347 348  
348 349  
349   - $timeout(function () { $scope.EnableUI(); }, 400);
  350 + $timeout(function () { $scope.EnableUI();
  351 + //open default animation
  352 + if($rootScope.siteUrlInfo.mtype!=null && $rootScope.siteUrlInfo.id!=null)
  353 + {
  354 + if($rootScope.siteUrlInfo.mtype.toLowerCase()=='ca' && $rootScope.siteUrlInfo.id!="")
  355 + {
  356 + $('#'+$rootScope.siteUrlInfo.id).trigger('click');
  357 + //$('div[title="'+$rootScope.siteUrlInfo.title+'"]').trigger('click');
  358 + }
  359 +
  360 + // clear detail
  361 + $rootScope.siteUrlInfo.mtype=null;
  362 + $rootScope.siteUrlInfo.id=null;
  363 + }
  364 +
  365 + }, 400);
350 366  
351 367 }
352 368  
... ... @@ -536,9 +552,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
536 552 $scope.imagePath = "~/../content/images/ca/thumbnails/" + value._ThumbnailImage;
537 553  
538 554 var $el = $('<div id="' + value._id + '" class="col-sm-3 col-md-2" title = "' + value._Title + '" data-ng-click="openView($event)">'
539   - + '<div class="thumbnail" >'
  555 + + '<div class="thumbnail" ><a href="#">'
540 556 + '<img id="' + value._Title + '" class="img-responsive" style="width:100%;height:100%;" ng-src="' + $scope.imagePath + '" alt="" title="" >'
541   - + '<div class="caption"><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view');
  557 + + '<div class="caption"><p>'+'('+ value._id+')</p><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view');
542 558  
543 559  
544 560 $compile($el)($scope);
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js
... ... @@ -2878,7 +2878,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
2878 2878 for (var i = 0; i < $rootScope.DaWindowData.length; i++) {
2879 2879 $scope.updatedWindowListForSaveCB.push({
2880 2880  
2881   - bodySystemTermList: $rootScope.DaWindowData[i].BodySystemData,
  2881 + // bodySystemTermList: $rootScope.DaWindowData[i].BodySystemData,
2882 2882 isTitleBarVisible: false, //BodySystemData.isTitleBarVisible,//N
2883 2883 highlightOptionsSelectedId: 0,
2884 2884 selectedStructureID: 0,//N
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -135,8 +135,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
135 135 'minimised': false,
136 136 'maximised': false,
137 137 'id': 0,
138   - 'moduleName': '',
139   - 'mode': '',
  138 + 'moduleName': 'DISSECTIBLE_ANATOMY',
  139 + 'mode': 'NORMAL',
140 140 'isCBAnnotationActive':false,
141 141 'annotationData':{shapeStates:[],paintCanvasState:[]},
142 142 'transparencyBounds': [],
... ... @@ -195,7 +195,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
195 195 }
196 196 }
197 197  
198   - $rootScope.SetwindowStoreData=function(windowviewid,keyname,value)
  198 + $scope.SetwindowStoreData=function(windowviewid,keyname,value)
199 199 {
200 200 for(var x=0 ;x < $rootScope.DaWindowData.length;x++){
201 201  
... ... @@ -389,7 +389,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
389 389 var imagePath = "~/../content/images/DA/" + zoomValue + "/body-views/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage;
390 390  
391 391  
392   - var $el = $('<div id=' + value._id + ' class="col-sm-3 col-lg-2" title = ' + value._title + ' data-ng-click="openView($event)"><div class="thumbnail" >'
  392 + var $el = $('<div id=' + value._id + ' class="col-sm-3 col-lg-2" title = ' + value._title + ' data-ng-click="openView($event)"><div class="thumbnail" ><a href="#">'
393 393 + '<img class= "daImg" id="' + value._title + '" src="' + imagePath + '" alt="" title="" >'
394 394 + '<div class="caption"><p>' + value._title + '</p></div></a></div></div>').appendTo('#bodyViewList');
395 395  
... ... @@ -455,6 +455,30 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
455 455 $('#CBDetailPageDiv').css('pointer-events', 'auto');
456 456 $('#CBDetailPageDiv').css('opacity', '1');
457 457 }
  458 + //fixing for mac os now
  459 + $scope.getOS = function () {
  460 + var userAgent = window.navigator.userAgent,
  461 + platform = window.navigator.platform,
  462 + macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'],
  463 + windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'],
  464 + iosPlatforms = ['iPhone', 'iPad', 'iPod'],
  465 + os = null;
  466 +
  467 + if (macosPlatforms.indexOf(platform) !== -1) {
  468 + os = 'MacOS';
  469 + } else if (iosPlatforms.indexOf(platform) !== -1) {
  470 + os = 'iOS';
  471 + } else if (windowsPlatforms.indexOf(platform) !== -1) {
  472 + os = 'Windows';
  473 + } else if (/Android/.test(userAgent)) {
  474 + os = 'Android';
  475 + } else if (!os && /Linux/.test(platform)) {
  476 + os = 'Linux';
  477 + }
  478 +
  479 + return os;
  480 + }
  481 +
458 482  
459 483 $scope.openView = function ($event) {
460 484 // open module bu openresource
... ... @@ -521,94 +545,129 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
521 545 //load json data for body view
522 546 $scope.loadDissectibleAnatomyData = function () {
523 547  
524   - // clear data set by curriculum builder
525   - $rootScope.isCallFromOtherModule = undefined;
526   -
527   - $rootScope.MULTI_VIEW_ID += 1
528   -
529   - var windowviewid = $rootScope.MULTI_VIEW_ID;
530   -
531   - if ($rootScope.refreshcheck == null) {
532   - $location.path('/');
533   - }
534   - $scope.ScopeVariablesDeclare();
535   -
536   - // store exist module in module service
  548 + if($rootScope.cernerIntegrationActive)
  549 + {
  550 + $rootScope.isCallFromOtherModule = true;
  551 + // store exist module in module service
537 552 var ExistData = ModuleService.getModuleData("DISSECTIBLE_ANATOMY");
538 553  
539 554 if (ExistData != undefined && ExistData.length > 0) {
540 555 // clear all module data before open new module in cb
541 556 ModuleService.ClearWinDataByModule(ExistData.mType);
542 557 }
543   - var newWindowData = {
544   - "mType": 'DISSECTIBLE_ANATOMY',
545   - };
  558 + var newWindowData = JSON.parse(sessionStorage.getItem("DAWindowObjectCerner"));
  559 +
546 560 ModuleService.setModuleData(newWindowData, 0);
  561 + // close/remove prev panel when in minimised mode
  562 +
  563 + if($rootScope.DaWindowData!=undefined)
  564 + {
  565 + if($rootScope.DaWindowData.length>0)
  566 + {
  567 + for(var x=0 ;x < $rootScope.DaWindowData.length;x++){
  568 + var winid=$rootScope.DaWindowData[x].multiwinid;
  569 + if ($('#daImagePanel_' + winid).html() != undefined) {
  570 + $('#daImagePanel_' + winid).remove();
  571 + }
  572 + }
  573 + $rootScope.DaWindowData=[];
  574 + }
  575 + }
  576 + $rootScope.ClearIframe();
  577 + sessionStorage.removeItem('DAWindowObjectCerner');
  578 + $location.url('/da-body-view');
  579 + }
  580 + else
  581 + {
547 582  
548   - // close/remove prev panel when in minimised mode
549   -
550   - if($rootScope.DaWindowData!=undefined)
551   - {
552   - if($rootScope.DaWindowData.length>0)
553   - {
554   - for(var x=0 ;x < $rootScope.DaWindowData.length;x++){
555   - var winid=$rootScope.DaWindowData[x].multiwinid;
556   - if ($('#daImagePanel_' + winid).html() != undefined) {
557   - $('#daImagePanel_' + winid).remove();
558   - }
559   - }
560   - $rootScope.DaWindowData=[];
561   - }
  583 + // clear data set by curriculum builder
  584 + $rootScope.isCallFromOtherModule = undefined;
  585 +
  586 + $rootScope.MULTI_VIEW_ID += 1
  587 +
  588 + var windowviewid = $rootScope.MULTI_VIEW_ID;
  589 +
  590 + if ($rootScope.refreshcheck == null) {
  591 + $location.path('/');
562 592 }
  593 + $scope.ScopeVariablesDeclare();
563 594  
564   - $scope.initializeDAWindowData(windowviewid, true, undefined);
  595 + // store exist module in module service
  596 + var ExistData = ModuleService.getModuleData("DISSECTIBLE_ANATOMY");
565 597  
566   - //get current path
567   - var currentURL = $location.path();
568   - var selectedModuleName = '';
569   - angular.forEach($rootScope.userModules, function (value, key) {
570   - if (value.slug === currentURL.replace('/', '')) {
571   - selectedModuleName = value.name;
572   - $rootScope.currentActiveModuleTitle = selectedModuleName;
  598 + if (ExistData != undefined && ExistData.length > 0) {
  599 + // clear all module data before open new module in cb
  600 + ModuleService.ClearWinDataByModule(ExistData.mType);
573 601 }
574   - })
  602 + var newWindowData = {
  603 + "mType": 'DISSECTIBLE_ANATOMY',
  604 + };
  605 + ModuleService.setModuleData(newWindowData, 0);
  606 +
  607 + // close/remove prev panel when in minimised mode
  608 +
  609 + if($rootScope.DaWindowData!=undefined)
  610 + {
  611 + if($rootScope.DaWindowData.length>0)
  612 + {
  613 + for(var x=0 ;x < $rootScope.DaWindowData.length;x++){
  614 + var winid=$rootScope.DaWindowData[x].multiwinid;
  615 + if ($('#daImagePanel_' + winid).html() != undefined) {
  616 + $('#daImagePanel_' + winid).remove();
  617 + }
  618 + }
  619 + $rootScope.DaWindowData=[];
  620 + }
  621 + }
575 622  
  623 + $scope.initializeDAWindowData(windowviewid, true, undefined);
576 624  
577   - $rootScope.ClearIframe();
  625 + //get current path
  626 + var currentURL = $location.path();
  627 + var selectedModuleName = '';
  628 + angular.forEach($rootScope.userModules, function (value, key) {
  629 + if (value.slug === currentURL.replace('/', '')) {
  630 + selectedModuleName = value.name;
  631 + $rootScope.currentActiveModuleTitle = selectedModuleName;
  632 + }
  633 + })
578 634  
579   - //load common data
580   - var commondataJsonPath = '~/../content/data/json/da/da_dat_common.json';
581 635  
582   - DataService.getAnotherJson(commondataJsonPath)
583   - .then(
584   - function (result) {
  636 + $rootScope.ClearIframe();
585 637  
586   - $rootScope.CommonData = result;
587   - $http({ method: 'GET', url: '~/../content/data/json/da/da_dat_contentlist.json' }).success(function (data) {
  638 + //load common data
  639 + var commondataJsonPath = '~/../content/data/json/da/da_dat_common.json';
588 640  
589   - $rootScope.BodyViewData = data;
590   - $scope.getDAViewList();
  641 + DataService.getAnotherJson(commondataJsonPath)
  642 + .then(
  643 + function (result) {
591 644  
592   - })
593   - .error(function (data, status, headers, config) {
594   - console.log(data);
595   - });
  645 + $rootScope.CommonData = result;
  646 + $http({ method: 'GET', url: '~/../content/data/json/da/da_dat_contentlist.json' }).success(function (data) {
596 647  
  648 + $rootScope.BodyViewData = data;
  649 + $scope.getDAViewList();
597 650  
598   - },
599   - function (error) {
600   - console.log(error.statusText)
601   - }
602   - )
  651 + })
  652 + .error(function (data, status, headers, config) {
  653 + console.log(data);
  654 + });
603 655  
604   - // $('#daLoaderLabel').css('visibility', 'hidden')
605   - $rootScope.isLoading = false;
606 656  
  657 + },
  658 + function (error) {
  659 + console.log(error.statusText)
  660 + }
  661 + )
  662 +
  663 + // $('#daLoaderLabel').css('visibility', 'hidden')
  664 + $rootScope.isLoading = false;
607 665  
608 666  
609   - //push the details of open module in array $rootScope.openModules
610   - $rootScope.openModules.push({ "ModuleId": 1 });
611 667  
  668 + //push the details of open module in array $rootScope.openModules
  669 + $rootScope.openModules.push({ "ModuleId": 1 });
  670 + }
612 671  
613 672 }
614 673  
... ... @@ -763,12 +822,12 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
763 822  
764 823 $rootScope.BodyViewData = data;
765 824  
766   - $scope.loadBodyView(windowviewid);
  825 + $scope.loadTermData(windowviewid);
767 826 })
768 827 })
769 828 }
770 829 else {
771   - $scope.loadBodyView(windowviewid);
  830 + $scope.loadTermData(windowviewid);
772 831 }
773 832  
774 833 }
... ... @@ -783,12 +842,40 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
783 842 $scope.viewID = 'daViewDA' + '_' + windowviewid;
784 843 $scope.SetwindowStoreData(windowviewid, 'parentSlugName', 'da-view-list');
785 844  
786   - $scope.loadBodyView(windowviewid);
  845 + $scope.loadTermData(windowviewid);
787 846 }
788 847  
789 848 }
790 849  
791   - $rootScope.loadBodyView = function (windowviewid) {
  850 + $scope.loadTermData = function (windowviewid) {
  851 + var bodyViewId=$scope.GetwindowStoreData(windowviewid,'voId');
  852 + // set gender
  853 + $scope.setGenderNameById(bodyViewId,windowviewid);
  854 + $rootScope.daloadSearchData(windowviewid);
  855 + //call time interval function until load Illustration data
  856 + var timeintval = null;
  857 + timeintval = $interval(function () {
  858 + var vocabTermDataArray = $scope.GetwindowStoreData(windowviewid, 'vocabTermDataArray');
  859 + if (vocabTermDataArray!=null) {
  860 + $scope.stopVocab();
  861 + $scope.loadBodyView(windowviewid);
  862 + }
  863 + else
  864 + {
  865 + console.log("waiting for search term Data");
  866 + }
  867 + }, 100);
  868 +
  869 + $scope.stopVocab = function () {
  870 + if (angular.isDefined(timeintval)) {
  871 + $interval.cancel(timeintval);
  872 + timeintval = undefined;
  873 + }
  874 + };
  875 + },
  876 +
  877 +
  878 + $scope.loadBodyView = function (windowviewid) {
792 879  
793 880 if (document.getElementById('daBodyview') != null) {
794 881 document.getElementById('daBodyview').style.pointerEvents = "none";
... ... @@ -828,31 +915,39 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
828 915 $rootScope.isVisibleLogin = false;
829 916  
830 917 console.log('currentBodyViewId picked from localStorage: ' + bodyViewId);
831   -
832   - // set gender
833   - $scope.setGenderNameById(bodyViewId,windowviewid);
  918 +
834 919 var currentViewTitle = $scope.GetwindowStoreData(windowviewid,'currentViewTitle');
835 920 console.log('current view title: ' + currentViewTitle);
836 921  
837 922 // store image title for export image
838 923 $rootScope.StoreTitleName(currentViewTitle);
839   - $rootScope.daloadSearchData(windowviewid);
840   -
  924 +
841 925  
842 926 if ($rootScope.isCallFromOtherModule) {
843   - // open JS panel for curriculum with define cornonate in CB jason
844   - $rootScope.jsPanelWidth = $scope.daOpenInOtherModules.size.width;//1000;
845   - $rootScope.jsPanelHeight = $scope.daOpenInOtherModules.size.height;
846   - if($scope.daOpenInOtherModules.size.height<450)
847   - $rootScope.jsPanelHeight = 450;
848   -
849   - $rootScope.jsPanelLeft = 320;
850   -
851   - $rootScope.jsPanelTop = $rootScope.cBModulejsPanelTop();
852   - if($location.url()!= "/curriculum-builder-detail") {
  927 + if($rootScope.cernerIntegrationActive)
  928 + {
  929 + $rootScope.jsPanelWidth = $(window).outerWidth() - 20;
  930 + $rootScope.jsPanelHeight = $(window).outerHeight() - 110;
853 931 $rootScope.jsPanelLeft = 1;
  932 + $rootScope.jsPanelTop = 70;
  933 + $rootScope.cernerIntegrationActive=false;
854 934 }
  935 + else
  936 + {
  937 + // open JS panel for curriculum with define cornonate in CB jason
  938 + $rootScope.jsPanelWidth = $scope.daOpenInOtherModules.size.width;//1000;
  939 + $rootScope.jsPanelHeight = $scope.daOpenInOtherModules.size.height;
  940 + if($scope.daOpenInOtherModules.size.height<450)
  941 + $rootScope.jsPanelHeight = 450;
  942 +
  943 + $rootScope.jsPanelLeft = 320;
855 944  
  945 + $rootScope.jsPanelTop = $rootScope.cBModulejsPanelTop();
  946 + if($location.url()!= "/curriculum-builder-detail") {
  947 + $rootScope.jsPanelLeft = 1;
  948 + }
  949 + }
  950 +
856 951 }
857 952 else {
858 953 $rootScope.jsPanelWidth = $(window).outerWidth() - 20;
... ... @@ -993,7 +1088,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
993 1088  
994 1089 // we are loading most of alll data used in DA by this function so that at the time of any functionality delay in data laod will not happened.
995 1090 $scope.loadView = function (windowviewid) {
996   -
  1091 + $scope.DisableUI();
997 1092 var bodyViewId=$scope.GetwindowStoreData(windowviewid,'voId');
998 1093 if (document.getElementById('daViewDA_'+windowviewid) != null) {
999 1094 $scope.loadDAView(bodyViewId, windowviewid);
... ... @@ -1139,15 +1234,15 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
1139 1234 la =$scope.GetwindowStoreData(windviewid,'totalLayers');
1140 1235 var slideVal = la - ui.value;
1141 1236 $("#txtLayerNumberDA_" + windviewid).val(slideVal);
1142   -
  1237 + if ($scope.GetwindowStoreData(windviewid, 'isTransparent')) {
  1238 + $scope.SetwindowStoreData(windowviewid, 'layerNumberTransparency', slideVal);
  1239 + }
1143 1240 $scope.SetwindowStoreData(windviewid,'layerNumber',slideVal);
1144 1241 scope.LayerChange(windviewid);
1145 1242 $("#annotationpaintbrushsize").removeClass("activebtncolor");
1146 1243 $("#annotationpainteraser").removeClass("activebtncolor");
1147 1244  
1148   - if ($scope.GetwindowStoreData(windviewid, 'isTransparent')) {
1149   - $scope.SetwindowStoreData(windowviewid, 'layerNumberTransparency', slideVal);
1150   - }
  1245 +
1151 1246 });
1152 1247 },
1153 1248  
... ... @@ -1453,6 +1548,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
1453 1548 console.log('callback searchWorker , time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"));
1454 1549  
1455 1550 $scope.SetwindowStoreData(windowviewid,'TermNumberData',e.data.TermNumberData);
  1551 + // store image for export
  1552 + $scope.LoadImageToExport(windowviewid);
1456 1553  
1457 1554 console.log("$rootScope.TermNumberData = " + e.data.TermNumberData.TermData.Term.length);
1458 1555  
... ... @@ -1504,14 +1601,13 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
1504 1601 }
1505 1602  
1506 1603 console.log('JlinqActivity , time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"));
1507   -
  1604 + $scope.EnableUI();
1508 1605  
1509 1606 }
1510 1607  
1511 1608 }
1512 1609  
1513   - // store image for export
1514   - $scope.LoadImageToExport(windowviewid);
  1610 +
1515 1611  
1516 1612 }
1517 1613  
... ... @@ -1804,8 +1900,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
1804 1900 $("#btnNormalMode_" + windowviewid).removeClass("btn-primary");
1805 1901 }
1806 1902 }
1807   -
1808   - $scope.setLayerNumberAndHighlightByTermListforCB(windowviewid);
  1903 + $scope.setLayerNumberAndHighlightByTermListforCB(windowviewid);
1809 1904  
1810 1905 }
1811 1906  
... ... @@ -2019,6 +2114,20 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
2019 2114  
2020 2115 $('#zoomValueDA_' + windowviewid).attr('value', $scope.GetwindowStoreData(windowviewid,'zoomInOut'));
2021 2116  
  2117 + var lastlayer=$scope.GetwindowStoreData(windowviewid,'layerNumber');
  2118 +
  2119 + if ($scope.GetwindowStoreData(windowviewid, 'isTransparent')) {
  2120 + lastlayer = $scope.GetwindowStoreData(windowviewid, 'layerNumberBeforeTBDraw');
  2121 + $scope.SetwindowStoreData(windowviewid, 'layerNumber', lastlayer);
  2122 + }
  2123 + else
  2124 + {
  2125 + var totalayer=$scope.GetwindowStoreData(windowviewid,'totalLayers');
  2126 + var sliderVal = parseInt(totalayer) - parseInt(lastlayer);
  2127 + $('#txtLayerNumberDA_' + windowviewid).val(lastlayer);
  2128 + $("#layerChangeSliderDA_" + windowviewid).slider("option", "value", sliderVal);
  2129 + }
  2130 +
2022 2131 if (bodyRegionCoordinates != null || bodyRegionCoordinates != undefined) {
2023 2132 angular.forEach(bodyRegionCoordinates, function (value, key) {
2024 2133  
... ... @@ -2157,20 +2266,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
2157 2266 var src = "content/images/DA/" + zoomValue + "/body-views/" + bodyVid + "/layers/0/" + value._BodyRegionId + "/" + $scope.figLaefImageName;
2158 2267  
2159 2268 $scope.DrawImage(rectangle.scaledHeight, rectangle.scaledWidth, rectangle.scaledX, rectangle.scaledY, src, 'modestyImg' + value._BodyRegionId, 'N', windowviewid)
2160   - var lastlayer=$scope.GetwindowStoreData(windowviewid,'layerNumber');
2161   -
2162   - if ($scope.GetwindowStoreData(windowviewid, 'isTransparent')) {
2163   - lastlayer = $scope.GetwindowStoreData(windowviewid, 'layerNumberBeforeTBDraw');
2164   - $scope.SetwindowStoreData(windowviewid, 'layerNumber', lastlayer);
2165   - }
2166   - else
2167   - {
2168   - var totalayer=$scope.GetwindowStoreData(windowviewid,'totalLayers');
2169   - var sliderVal = parseInt(totalayer) - parseInt(lastlayer);
2170   - $('#txtLayerNumberDA_' + windowviewid).val(lastlayer);
2171   - $("#layerChangeSliderDA_" + windowviewid).slider("option", "value", sliderVal);
2172   - }
2173   -
  2269 +
2174 2270 if ((parseInt(dtlOfSktn[0]._lns) <= parseInt(lastlayer)) && (parseInt(dtlOfSktn[0]._lne) > parseInt(lastlayer)) && (dtlOfSktn[0]._isfr == 'Y')) {
2175 2271 $rootScope.isLayerLessSeven = true; // using at home
2176 2272 var ModestyValue=$scope.GetwindowStoreData(windowviewid,'ModestyValue');
... ... @@ -2497,7 +2593,9 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
2497 2593 $scope.isLayerChange = false;
2498 2594 }
2499 2595  
2500   - if (evt.ctrlKey) {
  2596 + //birendra
  2597 + // for mac os Command key use for multi selection
  2598 + if (evt.ctrlKey || evt.metaKey) {
2501 2599 $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',true);
2502 2600 }
2503 2601 else
... ... @@ -2530,8 +2628,19 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
2530 2628  
2531 2629  
2532 2630 var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid);
2533   - var verticalScrollPosition = canvasDiv.scrollTop;
2534   - var horizontlScrollPosition = canvasDiv.scrollLeft;
  2631 +
  2632 + //changing for mac os now
  2633 + var os=$scope.getOS();
  2634 + if(os=='MacOS')
  2635 + {
  2636 + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-2;
  2637 + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-2;
  2638 + }
  2639 + else
  2640 + {
  2641 + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-1;
  2642 + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-1;
  2643 + }
2535 2644  
2536 2645 var distanceXOnMirrorImage = (parseInt(mirrorCanvasX) + parseInt(mirrorCanvasWidth)) - (parseInt(mousePos.x) + horizontlScrollPosition);// - 135);
2537 2646  
... ... @@ -3014,8 +3123,9 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
3014 3123 if ($scope.isLayerChange == true) {
3015 3124 $scope.isLayerChange = false;
3016 3125 }
3017   -
3018   - if (evt.ctrlKey) {
  3126 + //birendra
  3127 + // for mac os Command key use for multi selection
  3128 + if (evt.ctrlKey || evt.metaKey) {
3019 3129 $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',true);
3020 3130  
3021 3131 console.log('CTRL ON')
... ... @@ -3057,14 +3167,25 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
3057 3167 // alert(mousePos.x + ',' + mousePos.y);
3058 3168  
3059 3169 var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid);
3060   - var verticalScrollPosition = canvasDiv.scrollTop;
3061   - var horizontlScrollPosition = canvasDiv.scrollLeft;
3062   -
3063   -
  3170 + //changing for mac os now
  3171 + var os=$scope.getOS();
  3172 + if(os=='MacOS')
  3173 + {
  3174 + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-2;
  3175 + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-2;
  3176 + }
  3177 + else
  3178 + {
  3179 + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-1;
  3180 + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-1;
  3181 + }
  3182 +
3064 3183 //We substracted 135, as the difference between flex and html coordinates for same organ is 135
3065   - var actulalX = mousePos.x + horizontlScrollPosition;
3066   - var actualY = mousePos.y + verticalScrollPosition;
3067   - var RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y);
  3184 +
  3185 + var actulalX = mousePos.x + horizontlScrollPosition;
  3186 + var actualY = mousePos.y + verticalScrollPosition;
  3187 +
  3188 + var RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y);
3068 3189  
3069 3190  
3070 3191 //Modesty ON
... ... @@ -4961,7 +5082,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
4961 5082 // we decide the size of speech bubble
4962 5083 //2.
4963 5084  
4964   - if (event.ctrlKey || event == "CBAnnotation") {
  5085 + if (event.ctrlKey || event.metaKey || event == "CBAnnotation") {
4965 5086 console.log('ctrl pressed');
4966 5087 $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',true);
4967 5088 //2.1 create unique speech bubbles
... ... @@ -5001,7 +5122,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5001 5122 for (var m = 0; m <= $scope.speechbubbleList.length - 1; m++) {
5002 5123 if ( $scope.speechbubbleList[m].ids == sub_id1) {
5003 5124  
5004   - $scope.angle1( $scope.speechbubbleList[m].xaxis, $scope.speechbubbleList[m].yaxis, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, bor_id);
  5125 + $scope.angle1($scope.speechbubbleList[m].xaxis, $scope.speechbubbleList[m].yaxis, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, bor_id);
5005 5126 break;
5006 5127 }
5007 5128 }
... ... @@ -5090,7 +5211,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5090 5211  
5091 5212 var verticalScrollPosition = canvasDiv.scrollTop;
5092 5213 var horizontlScrollPosition = canvasDiv.scrollLeft;
5093   - $scope.angle(x-2, y, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, true,windid);
  5214 + $scope.angle(x, y, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, true,windid);
5094 5215 },
5095 5216 //Update Annotation Cordianate in case of show single Annotation
5096 5217 stop: function (evt) {
... ... @@ -5141,7 +5262,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5141 5262 else {
5142 5263 $scope.longest_annotationT1 = $scope.annotationTextArrayT1.reduce(function (a, b) { return a.length > b.length ? a : b; });
5143 5264 $scope.longest_annotationT2 = $scope.annotationTextArrayT2.reduce(function (a, b) { return a.length > b.length ? a : b; });
5144   - if (event.ctrlKey || event == "CBAnnotation") {
  5265 + if (event.ctrlKey || event.metaKey || event == "CBAnnotation") {
5145 5266  
5146 5267 $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', true);
5147 5268  
... ... @@ -5173,7 +5294,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5173 5294 if ( $scope.speechbubbleList != null || $scope.speechbubbleList != undefined) {
5174 5295 for (var m = 0; m <= $scope.speechbubbleList.length - 1; m++) {
5175 5296 if ( $scope.speechbubbleList[m].ids == sub_id1_anno) {
5176   - $scope.angle1( $scope.speechbubbleList[m].xaxis, $scope.speechbubbleList[m].yaxis, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, bor_id_anno);
  5297 + $scope.angle1($scope.speechbubbleList[m].xaxis, $scope.speechbubbleList[m].yaxis, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, bor_id_anno);
5177 5298 break;
5178 5299 }
5179 5300 }
... ... @@ -5270,7 +5391,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5270 5391 var canvasDiv = document.getElementById('canvasDivDA_' + windid);
5271 5392 var verticalScrollPosition = canvasDiv.scrollTop;
5272 5393 var horizontlScrollPosition = canvasDiv.scrollLeft;
5273   - $scope.angle(x-2, y, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, false,windid);
  5394 + $scope.angle(x, y, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, false,windid);
5274 5395 },
5275 5396  
5276 5397 //Update Annotation Cordianate in case of show single Annotation
... ... @@ -5434,13 +5555,29 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5434 5555  
5435 5556 $scope.createSpeechBubbleBasedOnAnnotationLength = function (pointClicked, x, y, id, tipx, tipy,windowviewid,speechBubbleCounter) {
5436 5557 var isHighlightBodyWithCBTermData=$scope.GetwindowStoreData(windowviewid,'isHighlightBodyWithCBTermData');
5437   - if (isHighlightBodyWithCBTermData == true) {
5438   -
5439   - var sppechBubbleHTML = "<div id ='" + pointClicked + "' class='com_" + windowviewid+"'><div class='multiLineAnnotation' style='z-index:60000; left:" + (x - 6) + "px;top:" + (y + 11) + "px;'' id='bubble" + speechBubbleCounter +"_" + windowviewid+ "'></div><div data=" + speechBubbleCounter + " id=" + id + " class='appendDragg' style='z-index:60000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size: 12px;font-weight:bold;background-color:#19100e;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;left:" + (tipx-4) + "px;top:" + tipy + "px;'><div style='z-index:7000;position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + speechBubbleCounter + " class='dynCross_" + windowviewid+"' style='width:18px' src=" + $rootScope.path + "></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:9000;' id='bord" + speechBubbleCounter+"_" + windowviewid+ "'></div></div>";
5440   - }
5441   - else {
5442   - var sppechBubbleHTML = "<div id ='" + pointClicked +"' class='com_" + windowviewid+"'><div class='multiLineAnnotation' style=' z-index:60000; left:" + (x - 6) + "px;top:" + (y + 11) + "px;'' id='bubble" + speechBubbleCounter +"_" + windowviewid+ "'></div><div data=" + speechBubbleCounter + " id=" + id + " class='appendDragg' style='z-index:60000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size: 12px;font-weight:bold;background-color:#19100e;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;left:" + (x-4) + "px;top:" + y + "px;'><div style='z-index:7000;position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + speechBubbleCounter + " class='dynCross_" + windowviewid+"' style='width:18px' src=" + $rootScope.path + "></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:9000;' id='bord" + speechBubbleCounter +"_" + windowviewid+ "'></div></div>";
5443   - }
  5558 + var os=$scope.getOS();
  5559 + if(os=='MacOS')
  5560 + {
  5561 + if (isHighlightBodyWithCBTermData == true) {
  5562 + var sppechBubbleHTML = "<div id ='" + pointClicked + "' class='com_" + windowviewid+"'><div class='multiLineAnnotation' style='z-index:60000; left:" + (x - 3) + "px;top:" + (y + 10.5) + "px;'' id='bubble" + speechBubbleCounter +"_" + windowviewid+ "'></div><div data=" + speechBubbleCounter + " id=" + id + " class='appendDragg' style='z-index:60000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size: 12px;font-weight:bold;background-color:#19100e;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;left:" + (tipx-3) + "px;top:" + tipy + "px;'><div style='z-index:7000;position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + speechBubbleCounter + " class='dynCross_" + windowviewid+"' style='width:18px' src=" + $rootScope.path + "></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:9000;' id='bord" + speechBubbleCounter+"_" + windowviewid+ "'></div></div>";
  5563 + }
  5564 + else
  5565 + {
  5566 + var sppechBubbleHTML = "<div id ='" + pointClicked +"' class='com_" + windowviewid+"'><div class='multiLineAnnotation' style=' z-index:60000; left:" + (x - 3) + "px;top:" + (y + 10.5) + "px;'' id='bubble" + speechBubbleCounter +"_" + windowviewid+ "'></div><div data=" + speechBubbleCounter + " id=" + id + " class='appendDragg' style='z-index:60000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size: 12px;font-weight:bold;background-color:#19100e;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;left:" + (x-3) + "px;top:" + y + "px;'><div style='z-index:7000;position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + speechBubbleCounter + " class='dynCross_" + windowviewid+"' style='width:18px' src=" + $rootScope.path + "></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:9000;' id='bord" + speechBubbleCounter +"_" + windowviewid+ "'></div></div>";
  5567 + }
  5568 + }
  5569 + else
  5570 + {
  5571 + if (isHighlightBodyWithCBTermData == true) {
  5572 + var sppechBubbleHTML = "<div id ='" + pointClicked + "' class='com_" + windowviewid+"'><div class='multiLineAnnotation' style='z-index:60000; left:" + (x - 4) + "px;top:" + (y + 11.5) + "px;'' id='bubble" + speechBubbleCounter +"_" + windowviewid+ "'></div><div data=" + speechBubbleCounter + " id=" + id + " class='appendDragg' style='z-index:60000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size: 12px;font-weight:bold;background-color:#19100e;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;left:" + (tipx-4) + "px;top:" + tipy + "px;'><div style='z-index:7000;position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + speechBubbleCounter + " class='dynCross_" + windowviewid+"' style='width:18px' src=" + $rootScope.path + "></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:9000;' id='bord" + speechBubbleCounter+"_" + windowviewid+ "'></div></div>";
  5573 + }
  5574 + else
  5575 + {
  5576 + var sppechBubbleHTML = "<div id ='" + pointClicked +"' class='com_" + windowviewid+"'><div class='multiLineAnnotation' style=' z-index:60000; left:" + (x - 4) + "px;top:" + (y + 11.5) + "px;'' id='bubble" + speechBubbleCounter +"_" + windowviewid+ "'></div><div data=" + speechBubbleCounter + " id=" + id + " class='appendDragg' style='z-index:60000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size: 12px;font-weight:bold;background-color:#19100e;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;left:" + (x-4) + "px;top:" + y + "px;'><div style='z-index:7000;position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + speechBubbleCounter + " class='dynCross_" + windowviewid+"' style='width:18px' src=" + $rootScope.path + "></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:9000;' id='bord" + speechBubbleCounter +"_" + windowviewid+ "'></div></div>";
  5577 + }
  5578 + }
  5579 +
  5580 +
5444 5581  
5445 5582 //Issue #7286 :Undefined annotation should not appear
5446 5583 for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) {
... ... @@ -5522,22 +5659,51 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5522 5659 }
5523 5660 var Globe = [];
5524 5661 Globe.push({ currentX: x, currentY: y });
5525   - document.getElementById('dot_'+windowviewid).style.display = 'block';
5526   - document.getElementById('dot_'+windowviewid).style.left = ((Globe[0].currentX) - 6) + 'px';
5527   - document.getElementById('dot_'+windowviewid).style.top = ((Globe[0].currentY) + 10) + 'px';
  5662 +
  5663 + //changing for mac os now
  5664 + var os=$scope.getOS();
  5665 + if(os=='MacOS')
  5666 + {
  5667 + document.getElementById('dot_'+windowviewid).style.display = 'block';
  5668 + document.getElementById('dot_'+windowviewid).style.left = ((Globe[0].currentX) - 4) + 'px';
  5669 + document.getElementById('dot_'+windowviewid).style.top = ((Globe[0].currentY) + 10.5) + 'px';
5528 5670 document.getElementById('bord_'+windowviewid).style.display = 'block';
5529   - document.getElementById('bord_'+windowviewid).style.left = ((Globe[0].currentX) - 2) + 'px';
  5671 + document.getElementById('bord_'+windowviewid).style.left = ((Globe[0].currentX) + 0.5) + 'px';
5530 5672 document.getElementById('bord_'+windowviewid).style.top = ((Globe[0].currentY) + 0) + 'px';
5531 5673  
5532 5674 document.getElementById('sppeachBubble_' + windowviewid + '-' + termNumber).style.display = 'block';
5533   - document.getElementById('sppeachBubble_' + windowviewid + '-' + termNumber).style.left = ((Globe[0].currentX) - 2) + 'px';
5534   - document.getElementById('sppeachBubble_' + windowviewid + '-' + termNumber).style.top = (Globe[0].currentY) + 'px';
  5675 + document.getElementById('sppeachBubble_' + windowviewid + '-' + termNumber).style.left = ((Globe[0].currentX) - 1) + 'px';
  5676 + document.getElementById('sppeachBubble_' + windowviewid + '-' + termNumber).style.top = ((Globe[0].currentY)+0) + 'px';
  5677 + }
  5678 + else
  5679 + {
  5680 + document.getElementById('dot_'+windowviewid).style.display = 'block';
  5681 + document.getElementById('dot_'+windowviewid).style.left = ((Globe[0].currentX) - 4) + 'px';
  5682 + document.getElementById('dot_'+windowviewid).style.top = ((Globe[0].currentY) + 11.5) + 'px';
  5683 + document.getElementById('bord_'+windowviewid).style.display = 'block';
  5684 + document.getElementById('bord_'+windowviewid).style.left = ((Globe[0].currentX) + 0.5) + 'px';
  5685 + document.getElementById('bord_'+windowviewid).style.top = ((Globe[0].currentY) + 1) + 'px';
  5686 +
  5687 + document.getElementById('sppeachBubble_' + windowviewid + '-' + termNumber).style.display = 'block';
  5688 + document.getElementById('sppeachBubble_' + windowviewid + '-' + termNumber).style.left = ((Globe[0].currentX) - 1) + 'px';
  5689 + document.getElementById('sppeachBubble_' + windowviewid + '-' + termNumber).style.top = ((Globe[0].currentY)-1) + 'px';
  5690 +
  5691 + }
5535 5692 }
5536 5693  
5537 5694 $scope.createSpeechBubbleBasedOnTransparencyWithCtrl = function (pointClicked_annotation, Exists_annotation, x, y, sub_id_annotation, windowviewid, TPspeechBubbleCounter) {
5538 5695  
5539   - var sppechBubbleHTML_annotation = "<div id ='" + pointClicked_annotation + "' class='com_anno_"+windowviewid+"'><div class='multiLineAnnotation' style='z-index:60000;left:" + (x - 5) + "px;top:" + (y + 9) + "px;'' id='bubble" + TPspeechBubbleCounter + "'></div><div data=" + TPspeechBubbleCounter + " id=" + sub_id_annotation + " class='appendDragg_annotation' style='z-index:60000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size: 12px;background-color:#19100e;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;left:" + (x-4) + "px;top:" + y + "px;'><div style='z-index:7000;position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + TPspeechBubbleCounter + " class='dynCross_anno_"+windowviewid+"' style='width:18px' src=" + $rootScope.path + "></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:59000;' id='bord_annotation" + TPspeechBubbleCounter +"_" + windowviewid+ "'></div></div>";
5540   - if ($scope.longest_annotationT1.length > $scope.longest_annotationT2.length) {
  5696 + var os=$scope.getOS();
  5697 + if(os=='MacOS')
  5698 + {
  5699 + var sppechBubbleHTML_annotation = "<div id ='" + pointClicked_annotation + "' class='com_anno_"+windowviewid+"'><div class='multiLineAnnotation' style='z-index:60000;left:" + (x - 3) + "px;top:" + (y + 10.5) + "px;'' id='bubble" + TPspeechBubbleCounter + "'></div><div data=" + TPspeechBubbleCounter + " id=" + sub_id_annotation + " class='appendDragg_annotation' style='z-index:60000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size: 12px;background-color:#19100e;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;left:" + (x-3) + "px;top:" + y + "px;'><div style='z-index:7000;position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + TPspeechBubbleCounter + " class='dynCross_anno_"+windowviewid+"' style='width:18px' src=" + $rootScope.path + "></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:59000;' id='bord_annotation" + TPspeechBubbleCounter +"_" + windowviewid+ "'></div></div>";
  5700 + }
  5701 + else
  5702 + {
  5703 + var sppechBubbleHTML_annotation = "<div id ='" + pointClicked_annotation + "' class='com_anno_"+windowviewid+"'><div class='multiLineAnnotation' style='z-index:60000;left:" + (x - 4) + "px;top:" + (y + 11.5) + "px;'' id='bubble" + TPspeechBubbleCounter + "'></div><div data=" + TPspeechBubbleCounter + " id=" + sub_id_annotation + " class='appendDragg_annotation' style='z-index:60000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size: 12px;background-color:#19100e;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;left:" + (x-4) + "px;top:" + y + "px;'><div style='z-index:7000;position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + TPspeechBubbleCounter + " class='dynCross_anno_"+windowviewid+"' style='width:18px' src=" + $rootScope.path + "></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:59000;' id='bord_annotation" + TPspeechBubbleCounter +"_" + windowviewid+ "'></div></div>";
  5704 + }
  5705 +
  5706 + if ($scope.longest_annotationT1.length > $scope.longest_annotationT2.length) {
5541 5707 if (Exists_annotation == 0) {
5542 5708 $('#canvasDivDA_' + windowviewid).append(sppechBubbleHTML_annotation);
5543 5709 for (var l = 0; l <= $scope.annotationTextArrayT1.length - 1; l++) {
... ... @@ -5638,15 +5804,34 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5638 5804 }
5639 5805 var Globe = [];
5640 5806 Globe.push({ currentX: x, currentY: y });
5641   - document.getElementById('dot_annotation_'+windowviewid).style.display = 'block';
5642   - document.getElementById('dot_annotation_'+windowviewid).style.left = ((Globe[0].currentX) - 6) + 'px';
5643   - document.getElementById('dot_annotation_'+windowviewid).style.top = ((Globe[0].currentY) + 10) + 'px';
5644   - document.getElementById('bord_annotation_'+windowviewid).style.display = 'block';
5645   - document.getElementById('bord_annotation_'+windowviewid).style.left = ((Globe[0].currentX) - 2) + 'px';
5646   - document.getElementById('bord_annotation_'+windowviewid).style.top = ((Globe[0].currentY)) + 'px';
5647   - document.getElementById('sppeachBubble_annotation_' + windowviewid + '-' + termNumber).style.display = 'block';
5648   - document.getElementById('sppeachBubble_annotation_' + windowviewid + '-' + termNumber).style.left = (Globe[0].currentX-2) + 'px';
5649   - document.getElementById('sppeachBubble_annotation_' + windowviewid + '-' + termNumber).style.top = (Globe[0].currentY) + 'px';
  5807 + //changing for mac os now
  5808 + var os=$scope.getOS();
  5809 + if(os=='MacOS')
  5810 + {
  5811 + document.getElementById('dot_annotation_'+windowviewid).style.display = 'block';
  5812 + document.getElementById('dot_annotation_'+windowviewid).style.left = ((Globe[0].currentX) - 4) + 'px';
  5813 + document.getElementById('dot_annotation_'+windowviewid).style.top = ((Globe[0].currentY) + 10.5) + 'px';
  5814 + document.getElementById('bord_annotation_'+windowviewid).style.display = 'block';
  5815 + document.getElementById('bord_annotation_'+windowviewid).style.left = ((Globe[0].currentX) + 0.5) + 'px';
  5816 + document.getElementById('bord_annotation_'+windowviewid).style.top = ((Globe[0].currentY) + 0) + 'px';
  5817 + document.getElementById('sppeachBubble_annotation_' + windowviewid + '-' + termNumber).style.display = 'block';
  5818 + document.getElementById('sppeachBubble_annotation_' + windowviewid + '-' + termNumber).style.left = (Globe[0].currentX - 1) + 'px';
  5819 + document.getElementById('sppeachBubble_annotation_' + windowviewid + '-' + termNumber).style.top = ((Globe[0].currentY) + 0) + 'px';
  5820 +
  5821 + }
  5822 + else
  5823 + {
  5824 + document.getElementById('dot_annotation_'+windowviewid).style.display = 'block';
  5825 + document.getElementById('dot_annotation_'+windowviewid).style.left = ((Globe[0].currentX) - 4) + 'px';
  5826 + document.getElementById('dot_annotation_'+windowviewid).style.top = ((Globe[0].currentY) + 11.5) + 'px';
  5827 + document.getElementById('bord_annotation_'+windowviewid).style.display = 'block';
  5828 + document.getElementById('bord_annotation_'+windowviewid).style.left = ((Globe[0].currentX) + 0.5) + 'px';
  5829 + document.getElementById('bord_annotation_'+windowviewid).style.top = ((Globe[0].currentY) + 1) + 'px';
  5830 + document.getElementById('sppeachBubble_annotation_' + windowviewid + '-' + termNumber).style.display = 'block';
  5831 + document.getElementById('sppeachBubble_annotation_' + windowviewid + '-' + termNumber).style.left = (Globe[0].currentX - 1) + 'px';
  5832 + document.getElementById('sppeachBubble_annotation_' + windowviewid + '-' + termNumber).style.top = ((Globe[0].currentY) - 1) + 'px';
  5833 + }
  5834 +
5650 5835  
5651 5836 }
5652 5837  
... ... @@ -6139,11 +6324,14 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
6139 6324  
6140 6325 $scope.transparencyCanvasHeight = transparencyCanvas.height;
6141 6326 $scope.transparencyCanvasWidth = transparencyCanvas.width;
  6327 +
6142 6328  
6143 6329 //bind click listener
6144 6330 transparencyCanvas.addEventListener('click', TransparencyCanvasClickListener);
6145 6331  
6146 6332 $(".ui-wrapper").css("z-index", $scope.GetwindowStoreData(windowviewid, 'UIWrapperZIndex'));
  6333 + $(".ui-wrapper").css("left",TransparencyBoxStartX-2+ 'px');
  6334 +
6147 6335  
6148 6336 }
6149 6337  
... ... @@ -6434,7 +6622,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
6434 6622 transparencyCanvas.addEventListener('click', TransparencyCanvasClickListener);
6435 6623  
6436 6624 $(".ui-wrapper").css("z-index", $scope.GetwindowStoreData(windowviewid, 'UIWrapperZIndex'));
6437   -
  6625 + $(".ui-wrapper").css("left",$scope.startX-2+ 'px');
6438 6626 }
6439 6627  
6440 6628 if ($scope.TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && $scope.TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) {
... ... @@ -6668,16 +6856,18 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
6668 6856 var WidthforTransImage = TBImageDimensions.WidthforTransImageTB;
6669 6857 var HeightforTransImage = TBImageDimensions.HeightforTransImageTB;
6670 6858 var YforTransImage = TBImageDimensions.YforTransImageTB;
6671   -
  6859 + var tranparencyLayer;
6672 6860 //0. get current layer number
6673 6861 if (isResized || isLayerChanged) {
6674 6862 //do nothing
6675 6863 $scope.SetwindowStoreData(windowviewid,'transNumber',100);
6676 6864 $("#tbSlider_" + windowviewid).slider('value', 100);
  6865 + if ($scope.GetwindowStoreData(windowviewid, "isTransparencyActivated") == true && $scope.GetwindowStoreData(windowviewid, "isTransparent") == true) {
  6866 + tranparencyLayer = $scope.GetwindowStoreData(windowviewid, 'layerNumberTransparency');
  6867 + }
6677 6868  
6678 6869 }
6679   - else {
6680   - var tranparencyLayer;
  6870 + else {
6681 6871 if ($scope.GetwindowStoreData(windowviewid, "isTransparencyActivated") == true && (($scope.GetwindowStoreData(windowviewid, "isNormalBtnClicked") == true || $scope.GetwindowStoreData(windowviewid, "isHighlightlBtnClicked") == true)) ){
6682 6872 tranparencyLayer = parseInt($('#txtLayerNumberDA_' + windowviewid).val());
6683 6873 $scope.SetwindowStoreData(windowviewid, 'isNormalBtnClicked', false);
... ... @@ -6701,6 +6891,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
6701 6891 $scope.SetwindowStoreData(windowviewid,'layerNumber',tranparencyLayer);
6702 6892 $scope.SetwindowStoreData(windowviewid, 'layerNumberTransparency', tranparencyLayer);
6703 6893 }
  6894 +
6704 6895 var totalayer=$scope.GetwindowStoreData(windowviewid,'totalLayers');
6705 6896 var sliderVal = parseInt(totalayer) - parseInt(tranparencyLayer);
6706 6897  
... ... @@ -7485,7 +7676,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7485 7676 $scope.NormalTermNumber = RGBColor;
7486 7677 }
7487 7678  
7488   - if (event.ctrlKey) {
  7679 + if (event.ctrlKey || event.metaKey) {
7489 7680 $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', true);
7490 7681 }
7491 7682 else {
... ... @@ -7627,8 +7818,18 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7627 7818 var mousePos = $scope.getMousePos(evt.pageX,evt.pageY,windowviewid);
7628 7819  
7629 7820 var canvasDiv = document.getElementById("canvasDivDA_" + windowviewid);
7630   - var verticalScrollPosition = canvasDiv.scrollTop;
7631   - var horizontlScrollPosition = canvasDiv.scrollLeft;
  7821 + //changing for mac os now
  7822 + var os=$scope.getOS();
  7823 + if(os=='MacOS')
  7824 + {
  7825 + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-2;
  7826 + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-2;
  7827 + }
  7828 + else
  7829 + {
  7830 + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-1;
  7831 + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-1;
  7832 + }
7632 7833  
7633 7834  
7634 7835 //We substracted 135, as the difference between flex and html coordinates for same organ is 135
... ... @@ -7809,8 +8010,18 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7809 8010 var tCanvasTotalHeight = parseInt(tCanvasTopAftrSplit[0]) + parseInt(tCanvasHeightAftrSplit[0]);
7810 8011 var mousePos = $scope.getMousePos(evt.pageX,evt.pageY,windowviewid);
7811 8012 var canvasDiv = document.getElementById('canvasDivDA_'+windowviewid);
7812   - var verticalScrollPosition = canvasDiv.scrollTop;
7813   - var horizontlScrollPosition = canvasDiv.scrollLeft;
  8013 + //changing for mac os now
  8014 + var os=$scope.getOS();
  8015 + if(os=='MacOS')
  8016 + {
  8017 + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-2;
  8018 + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-2;
  8019 + }
  8020 + else
  8021 + {
  8022 + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-1;
  8023 + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-1;
  8024 + }
7814 8025  
7815 8026 var actulalX = mousePos.x + horizontlScrollPosition;
7816 8027 var actualY = mousePos.y + verticalScrollPosition;
... ... @@ -7889,8 +8100,18 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7889 8100 var windowviewid = (evt.target.id).split("_")[len-1];
7890 8101  
7891 8102 var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid);
7892   - var verticalScrollPosition = canvasDiv.scrollTop;
7893   - var horizontlScrollPosition = canvasDiv.scrollLeft;
  8103 + //changing for mac os now
  8104 + var os=$scope.getOS();
  8105 + if(os=='MacOS')
  8106 + {
  8107 + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-2;
  8108 + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-2;
  8109 + }
  8110 + else
  8111 + {
  8112 + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-1;
  8113 + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-1;
  8114 + }
7894 8115  
7895 8116 var distanceXOnMirrorImage = (parseInt(mirrorCanvasX) + parseInt(mirrorCanvasWidth)) - (parseInt(mousePos.x) + horizontlScrollPosition);// - 135);
7896 8117  
... ... @@ -7928,7 +8149,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7928 8149  
7929 8150 //Added Method to Save TransparencyBox TermNumbers for SaveCB
7930 8151 $scope.saveTBoxTermNumberForSaveCB = function (evt, windowviewid) {
7931   - if (evt.ctrlKey) {
  8152 + if (evt.ctrlKey || evt.metaKey) {
7932 8153 $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', true);
7933 8154 }
7934 8155 else {
... ... @@ -7951,8 +8172,18 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7951 8172 $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', false);
7952 8173 }
7953 8174 var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid);
7954   - var verticalScrollPosition = canvasDiv.scrollTop;
7955   - var horizontlScrollPosition = canvasDiv.scrollLeft;
  8175 + //changing for mac os now
  8176 + var os=$scope.getOS();
  8177 + if(os=='MacOS')
  8178 + {
  8179 + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-2;
  8180 + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-2;
  8181 + }
  8182 + else
  8183 + {
  8184 + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-1;
  8185 + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-1;
  8186 + }
7956 8187 var CurriculumTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData');
7957 8188 CurriculumTermData.push({
7958 8189 "transparentTermNumber": parseInt($scope.TBoxTermNumber),
... ... @@ -8499,7 +8730,13 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8499 8730 $scope.SetwindowStoreData(windowviewid,'zoomInOut',25);
8500 8731 $('#zoomValueDA_' + windowviewid).attr('value', $scope.GetwindowStoreData(windowviewid,'zoomInOut'));
8501 8732 }
8502   -
  8733 + $rootScope.isLoading = true;
  8734 + $('#spinner').css('visibility', 'visible');
  8735 + var canDiv = document.getElementById('canvasDivDA_' + windowviewid);
  8736 + var canDivChildCount = canDiv.childElementCount;
  8737 + if (canDivChildCount > 0) {
  8738 + canDiv.innerHTML = '';
  8739 + }
8503 8740 var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId');
8504 8741 $scope.CalculateImageCordinates(viewOrientationId,windowviewid);
8505 8742  
... ... @@ -11366,22 +11603,22 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
11366 11603  
11367 11604 }
11368 11605  
11369   - $scope.SaveImageToFhirResource = function () {
11370   - CernerFhirService.SaveImageToFhirResource();
11371   - };
  11606 + //$scope.SaveImageToFhirResource = function () {
  11607 + // CernerFhirService.SaveImageToFhirResource();
  11608 + //};
11372 11609  
11373   - $scope.LoadingDA = function () {
11374   - var json = $rootScope.GetCookie("CernerInfo");
11375   - if (json !== null && json !== "") {
11376   - var data = JSON.parse(json);
11377   - if (data.isCernerUser) {
11378   - alert("Loading DA...");
11379   - //call API
11380   - }
11381   - }
11382   - };
  11610 + //$scope.LoadingDA = function () {
  11611 + // var json = $rootScope.GetCookie("CernerInfo");
  11612 + // if (json !== null && json !== "") {
  11613 + // var data = JSON.parse(json);
  11614 + // if (data.isCernerUser) {
  11615 + // alert("Loading DA...");
  11616 + // //call API
  11617 + // }
  11618 + // }
  11619 + //};
11383 11620  
11384   - $scope.LoadingDA();
  11621 + //$scope.LoadingDA();
11385 11622 }])
11386 11623  
11387 11624 function OnGenderChange(event) {
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -89,17 +89,6 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
89 89 licenseeAccountNumber: null
90 90 };
91 91  
92   - $rootScope.siteUrlInfo = {
93   - siteIP: null,
94   - remoteIPAddress: null,
95   - status: null,
96   - accountNumber: null,
97   - edition: null,
98   - urlReferer: null,
99   - calsCreds: null,
100   - userId: null,
101   - password: null
102   - }
103 92 $rootScope.userData;
104 93 $rootScope.userModules;
105 94 $rootScope.passwordMismatchMessage;
... ... @@ -617,7 +606,11 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
617 606 }
618 607  
619 608 $scope.helpTopicLink = function () {
620   - $rootScope.homeURL = $location.absUrl();
  609 + var x = $location.absUrl();
  610 + var pos = x.lastIndexOf($location.url());
  611 +
  612 + $rootScope.homeURL =x.substring(0,pos+1);
  613 +
621 614 var hTopicUrl = $rootScope.homeURL + "content/help/index.html";
622 615 var aboutADAM = $rootScope.homeURL + "content/help/about/Adam_Credits_AIA5.html";
623 616  
... ... @@ -647,10 +640,27 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
647 640 //some time value not remove then reload
648 641 sessionStorage.removeItem('isModuleOpenByOpenResource');
649 642 sessionStorage.removeItem('ExitsCBFileDetail');
650   - $('#login').css('visibility', 'visible');
  643 + $('#login').css('visibility', 'visible');
651 644  
  645 + $scope.CheckCernerUser();
  646 + $scope.DocumentId = (new URL(location.href)).searchParams.get('documentId');
  647 +
652 648 $rootScope.checkRefreshButtonClick = 1;
653   - $scope.CheckCernerLaunch();
  649 +
  650 + $rootScope.siteUrlInfo = {
  651 + siteIP: null,
  652 + remoteIPAddress: null,
  653 + status: null,
  654 + accountNumber: null,
  655 + edition: null,
  656 + urlReferer: null,
  657 + calsCreds: null,
  658 + userId: null,
  659 + password: null,
  660 + mtype:null,
  661 + id:null
  662 + }
  663 +
654 664 if (params != null && params != undefined && params != "") {
655 665  
656 666 $scope.ValidateClientSiteUrl();
... ... @@ -914,6 +924,13 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
914 924  
915 925  
916 926 $location.path('/');
  927 +
  928 + $timeout(function () {
  929 +
  930 + //currently open CA
  931 + $scope.RedirectToModule();
  932 +
  933 + }, 100);
917 934  
918 935 }
919 936 else
... ... @@ -1009,6 +1026,11 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
1009 1026 }
1010 1027 else {
1011 1028 $location.path('/');
  1029 + $timeout(function () {
  1030 + //currently open CA
  1031 + $scope.RedirectToModule();
  1032 +
  1033 + }, 100);
1012 1034 }
1013 1035 }
1014 1036 else {
... ... @@ -1048,11 +1070,35 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
1048 1070  
1049 1071 }
1050 1072  
  1073 + $scope.RedirectToModule = function () {
  1074 +
  1075 + if($rootScope.siteUrlInfo.mtype!=null)
  1076 + {
  1077 + if($rootScope.siteUrlInfo.mtype.toLowerCase()=='ca')
  1078 + $('#clinical-animations').trigger('click');
  1079 + }
  1080 +
  1081 + if ($scope.DocumentId !== null && $scope.DocumentId !== "") {
  1082 + // Call API with DocumentId
  1083 + CernerFhirService.GetJsonImageAIA($scope.DocumentId).then(function (result) {
  1084 + console.log(result);
  1085 + var WindowImageJson = jQuery.parseJSON(result.JsonData);
  1086 + sessionStorage.setItem("DAWindowObjectCerner",JSON.stringify(WindowImageJson) );
  1087 + $rootScope.cernerIntegrationActive=true;
  1088 + $scope.DocumentId = "";
  1089 + // Load DA module.
  1090 + $timeout(function () { $('#da-view-list').trigger('click'); }, 200);
  1091 +
  1092 + }, function (error) {
  1093 + console.log(' Error in opening DA module for Cerner = ' + error.statusText);
  1094 + });
  1095 + }
  1096 + }
1051 1097  
1052 1098 $scope.ValidateClientSiteUrl = function () {
1053   -
  1099 +
1054 1100 $rootScope.isCallFromSite = true;
1055   -
  1101 +
1056 1102 var siteInfo = params.split('&');
1057 1103  
1058 1104 for (var i = 0; i < siteInfo.length; i++) {
... ... @@ -1063,27 +1109,48 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
1063 1109  
1064 1110 if (isCalsCredantialForSIte == "True") {
1065 1111 var paramInfo = siteInfo[i].split('=');
1066   - if (paramInfo[0] == 'calsCredantial') {
1067   -
1068   - $rootScope.siteUrlInfo.calsCreds = paramInfo[1];
1069   - console.log("$rootScope.siteUrlInfo.calsCreds" + $rootScope.siteUrlInfo.calsCreds);
  1112 + //added by birendra direct open CA module
  1113 + if(paramInfo[0].toLowerCase() == 'mtype')
  1114 + {
  1115 + $rootScope.siteUrlInfo.mtype = paramInfo[1];
  1116 + console.log("$rootScope.siteUrlInfo.mtype" + $rootScope.siteUrlInfo.mtype);
1070 1117 }
1071   - else if (paramInfo[0] == 'username') {
1072   -
1073   - $rootScope.siteUrlInfo.username = paramInfo[1];
1074   - console.log("$rootScope.siteUrlInfo.username" + $rootScope.siteUrlInfo.username);
  1118 + else if (paramInfo[0].toLowerCase() == 'id') {
  1119 +
  1120 + $rootScope.siteUrlInfo.id = paramInfo[1];
  1121 + console.log("$rootScope.siteUrlInfo.id" + $rootScope.siteUrlInfo.id);
1075 1122 }
1076   - else if (paramInfo[0] == 'password') {
1077   -
1078   - $rootScope.siteUrlInfo.password = paramInfo[1];
1079   - console.log("$rootScope.siteUrlInfo.password " + $rootScope.siteUrlInfo.password);
  1123 + else if (paramInfo[0].toLowerCase() == 'username') {
  1124 +
  1125 + $rootScope.siteUrlInfo.userId = paramInfo[1];
  1126 + console.log("$rootScope.siteUrlInfo.username" + $rootScope.siteUrlInfo.userId);
1080 1127 }
  1128 + else if (paramInfo[0].toLowerCase() == 'accountnumber') {
  1129 +
  1130 + $rootScope.siteUrlInfo.accountNumber = paramInfo[1];
  1131 + console.log("$rootScope.siteUrlInfo.accountNumber" + $rootScope.siteUrlInfo.accountNumber);
  1132 + }
  1133 +
  1134 +
  1135 + // if (paramInfo[0] == 'calsCredantial') {
1081 1136  
1082   - $rootScope.userInfo.username = $rootScope.siteUrlInfo.username;
1083   - $rootScope.userInfo.password = $rootScope.siteUrlInfo.password;
1084   - console.log("$rootScope.userInfo.username" + $rootScope.userInfo.username + " $rootScope.userInfo.password" + $rootScope.userInfo.password);
1085   -
1086   -
  1137 + // $rootScope.siteUrlInfo.calsCreds = paramInfo[1];
  1138 + // console.log("$rootScope.siteUrlInfo.calsCreds" + $rootScope.siteUrlInfo.calsCreds);
  1139 + // }
  1140 + // else if (paramInfo[0] == 'username') {
  1141 +
  1142 + // $rootScope.siteUrlInfo.username = paramInfo[1];
  1143 + // console.log("$rootScope.siteUrlInfo.username" + $rootScope.siteUrlInfo.username);
  1144 + // }
  1145 + // else if (paramInfo[0] == 'password') {
  1146 +
  1147 + // $rootScope.siteUrlInfo.password = paramInfo[1];
  1148 + // console.log("$rootScope.siteUrlInfo.password " + $rootScope.siteUrlInfo.password);
  1149 + // }
  1150 +
  1151 + //$rootScope.userInfo.username = $rootScope.siteUrlInfo.userId;
  1152 + //$rootScope.userInfo.password = $rootScope.siteUrlInfo.password;
  1153 +
1087 1154 }
1088 1155 else {
1089 1156 var paramInfo = siteInfo[i].split('=');
... ... @@ -1105,7 +1172,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
1105 1172 else if (paramInfo[0] == 'urlReferer') {
1106 1173  
1107 1174 $rootScope.siteUrlInfo.urlReferer = paramInfo[1];
1108   - console.log("$rootScope.siteUrlInfo.siteIP" + $rootScope.siteUrlInfo.siteIP);
  1175 + console.log("$rootScope.siteUrlInfo.urlReferer" + $rootScope.siteUrlInfo.urlReferer);
1109 1176 }
1110 1177 else if (paramInfo[0] == 'remoteIPAddress') {
1111 1178  
... ... @@ -1117,11 +1184,36 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
1117 1184 }
1118 1185 }
1119 1186 if (isCalsCredantialForSIte == "True") {
1120   - $rootScope.AuthenticateUser($rootScope.userInfo);
  1187 + if($rootScope.siteUrlInfo.mtype!=null && $rootScope.siteUrlInfo.mtype.toLowerCase()=='ca' && $rootScope.siteUrlInfo.userId!=null && $rootScope.siteUrlInfo.accountNumber!=null)
  1188 + {
  1189 + AuthenticationService.ByPassLoginToOpenModule($rootScope.siteUrlInfo)
  1190 + .then(
  1191 + function (result) {
  1192 + if(result!=null)
  1193 + {
  1194 + $rootScope.userInfo.username = result.LoginId;
  1195 + $rootScope.userInfo.password = result.Password;
  1196 + $rootScope.AuthenticateUser($rootScope.userInfo);
  1197 + }
  1198 +
  1199 + }),
  1200 + function (error) {
  1201 + console.log(' Error in bypass login = ' + error.statusText);
  1202 + $rootScope.errorMessage = error;
  1203 + $("#messageModal").modal('show');
  1204 + }
  1205 +
  1206 + }
  1207 + else
  1208 + {
  1209 + console.log(' invalid detail in bypass login');
  1210 + $rootScope.errorMessage = "authentication is not allowed due to invalid details format .\nPlease pass the correct details again!";
  1211 + $("#messageModal").modal('show');
  1212 + }
  1213 +
1121 1214 }
1122 1215 else {
1123 1216  
1124   -
1125 1217 console.log($rootScope.siteUrlInfo);
1126 1218  
1127 1219 AuthenticationService.validateClientSite($rootScope.siteUrlInfo)
... ... @@ -1321,12 +1413,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
1321 1413 )
1322 1414  
1323 1415 }
1324   - //$rootScope.siteUrlInfo.siteIP = siteInfo[0];
1325   - //$rootScope.siteUrlInfo.remoteIPAddress = siteInfo[1];
1326   - //$rootScope.siteUrlInfo.accountNumber = siteInfo[2];
1327   - //$rootScope.siteUrlInfo.edition = siteInfo[3];
1328   - //$rootScope.siteUrlInfo.urlReferer = siteInfo[4];
1329   -
  1416 +
1330 1417  
1331 1418 }
1332 1419  
... ... @@ -1478,7 +1565,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
1478 1565 }
1479 1566 else {
1480 1567  
1481   - $location.path('/');
  1568 + $location.url('/');
1482 1569 }
1483 1570 $rootScope.isVisibleLogin = false;
1484 1571 }
... ... @@ -2590,7 +2677,10 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
2590 2677 }
2591 2678 $rootScope.CIAnotationIdentifyModeOff = false;
2592 2679 $rootScope.OnIdentifyClick = function () {
2593   -
  2680 + //clear sketch js event for paint and erase
  2681 + $.sketch = { tools: {}};
  2682 + $rootScope.shapeType = "";
  2683 + $(".btn-annotation").removeClass("activebtncolor");
2594 2684 $("#OnIdentify").addClass("annotationtoolbartab");
2595 2685 $("#DrawMode").removeClass("annotationtoolbartab");
2596 2686  
... ... @@ -2772,7 +2862,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
2772 2862 }
2773 2863  
2774 2864 $rootScope.DrawingMode = function () {
2775   -
  2865 + //clear sketch js event for paint and erase
  2866 + $.sketch = { tools: {}};
2776 2867 //Annotation History
2777 2868 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
2778 2869 $("#OnIdentify").removeClass("annotationtoolbartab");
... ... @@ -2847,6 +2938,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
2847 2938 //----Annotation Toolbar: Jcanvas-----
2848 2939  
2849 2940 $rootScope.DrawLine = function (e) {
  2941 + //clear sketch js event for paint and erase
  2942 + $.sketch = { tools: {}};
2850 2943 $('.btnCursor').removeClass('activebtncolor');
2851 2944 $(".btn-annotation").removeClass("activebtncolor");
2852 2945 $(".btn-annotation-line").addClass("activebtncolor");
... ... @@ -2910,7 +3003,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
2910 3003 }
2911 3004  
2912 3005 $rootScope.DrawPin = function (e) {
2913   -
  3006 + //clear sketch js event for paint and erase
  3007 + $.sketch = { tools: {}};
2914 3008 $('.btnCursor').removeClass('activebtncolor');
2915 3009 $(".btn-annotation").removeClass("activebtncolor");
2916 3010 $(".btn-annotation-pin").addClass("activebtncolor");
... ... @@ -2953,6 +3047,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
2953 3047 }
2954 3048  
2955 3049 $rootScope.Cursor = function () {
  3050 + //clear sketch js event for paint and erase
  3051 + $.sketch = { tools: {}};
2956 3052 $rootScope.shapeType = "cursor";
2957 3053 $(".btn-annotation").removeClass("activebtncolor");
2958 3054 // $("#" + e.currentTarget.id).removeClass("activebtncolor");
... ... @@ -2981,7 +3077,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
2981 3077 }
2982 3078  
2983 3079 $rootScope.DrawRectangle = function (e) {
2984   -
  3080 + //clear sketch js event for paint and erase
  3081 + $.sketch = { tools: {}};
2985 3082 $('.btnCursor').removeClass('activebtncolor');
2986 3083 $(".btn-annotation").removeClass("activebtncolor");
2987 3084 $(".btn-annotation-rectangle").addClass("activebtncolor");
... ... @@ -3082,13 +3179,12 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
3082 3179 }
3083 3180  
3084 3181 $rootScope.shapeType = "FreeStylePaint";
3085   - var btnBrushSizeValue = $("#btnBrushSize").val();
3086   - $rootScope.shapeSize = parseInt(btnBrushSizeValue);
3087   - $("#annotationpaintbrushsize").attr("data-size", $rootScope.shapeSize);
  3182 +
  3183 + $("#annotationpaintbrushsize").attr("data-size", parseInt($("#btnBrushSize").val()));
3088 3184  
3089 3185 $("#annotationpaintbrushsize").attr("data-color", $rootScope.shapestyleColorWithOpacity);
3090 3186  
3091   - if ($rootScope.shapeSize == '') {
  3187 + if (parseInt($("#btnBrushSize").val()) <1) {
3092 3188 $("#" + canvasPaintId).sketch({ defaultSize: 1});
3093 3189 }
3094 3190 else {
... ... @@ -3125,12 +3221,10 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
3125 3221  
3126 3222 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
3127 3223 $rootScope.switchCanvasToPaintCanvas(paneld);
3128   - var btneraseBrushSizeValue = $("#btnBrushSize").val();
3129   - $rootScope.shapeSize = parseInt(btneraseBrushSizeValue);
3130 3224  
3131 3225 $('#' + canvasPaintId).sketch();
3132 3226  
3133   - $("#annotationpainteraser").attr("data-size", $rootScope.shapeSize);
  3227 + $("#annotationpainteraser").attr("data-size", parseInt($("#btnBrushSize").val()));
3134 3228 $scope.PaintEraseEvent();
3135 3229 }
3136 3230 }
... ... @@ -3149,14 +3243,14 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
3149 3243 this.stopPainting();
3150 3244 }
3151 3245 this.color= $rootScope.shapestyleColorWithOpacity!=undefined ? $rootScope.shapestyleColorWithOpacity : "#fff";
3152   - this.size=$rootScope.shapeSize;
  3246 + this.size= parseInt($("#btnBrushSize").val());
3153 3247 if ($("#annotationpaintbrushsize").hasClass("activebtncolor")) {
3154 3248 this.tool='marker';
3155 3249 this.startPainting();
3156 3250 }
3157 3251 else if ($("#annotationpainteraser").hasClass("activebtncolor")) {
3158 3252 this.tool='eraser';
3159   - this.size=$rootScope.shapeSize>5?$rootScope.shapeSize:5;
  3253 + this.size=parseInt($("#btnBrushSize").val())>5?parseInt($("#btnBrushSize").val()):5;
3160 3254 this.startPainting();
3161 3255 }
3162 3256 else
... ... @@ -3291,6 +3385,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
3291 3385 }
3292 3386  
3293 3387 $rootScope.DrawCircle = function (e) {
  3388 + //clear sketch js event for paint and erase
  3389 + $.sketch = { tools: {}};
3294 3390 $('.btnCursor').removeClass('activebtncolor');
3295 3391 $(".btn-annotation").removeClass("activebtncolor");
3296 3392 $(".btn-annotation-circle").addClass("activebtncolor");
... ... @@ -3332,6 +3428,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
3332 3428 }
3333 3429  
3334 3430 $rootScope.DrawArrow = function (e) {
  3431 + //clear sketch js event for paint and erase
  3432 + $.sketch = { tools: {}};
3335 3433 $('.btnCursor').removeClass('activebtncolor');
3336 3434 $(".btn-annotation").removeClass("activebtncolor");
3337 3435 $(".btn-annotation-arrow").addClass("activebtncolor");
... ... @@ -3372,6 +3470,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
3372 3470 }
3373 3471 }
3374 3472 $rootScope.DrawText = function () {
  3473 + //clear sketch js event for paint and erase
  3474 + $.sketch = { tools: {}};
3375 3475 $('.btnCursor').removeClass('activebtncolor');
3376 3476 $(".btn-annotation").removeClass("activebtncolor");
3377 3477 $(".btn-annotation-Text").addClass("activebtncolor");
... ... @@ -3414,6 +3514,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
3414 3514 }
3415 3515  
3416 3516 $rootScope.DrawPolygon = function () {
  3517 + //clear sketch js event for paint and erase
  3518 + $.sketch = { tools: {}};
3417 3519 $("#OnIdentify").removeClass('annotationtoolbartab');
3418 3520 $("#DrawMode").addClass('annotationtoolbartab');
3419 3521  
... ... @@ -3657,6 +3759,12 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
3657 3759 };
3658 3760  
3659 3761 }
  3762 + $timeout(function(){
  3763 + $('.btnCursor').trigger('click');
  3764 + $(".btn-annotation").removeClass("activebtncolor");
  3765 + $('.btnCursor').addClass('activebtncolor');
  3766 +
  3767 + },100)
3660 3768 }
3661 3769  
3662 3770  
... ... @@ -4136,7 +4244,9 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
4136 4244 }
4137 4245 $rootScope.jcanvasObjectArray = [];
4138 4246 $rootScope.DrawRectangleOnModuleItem = function (canvasId, RectNumber, shapestyleFillColor, shapestyleborderColor, shapestyleOpacity, shapestyleborderWidth, offsetX1, offsetY1, width, height) {
4139   - if ($rootScope.isRectanglePreviewCompleted == true) {
  4247 + if ($rootScope.isRectanglePreviewCompleted == true) {
  4248 + if(width<30) width=30 ;
  4249 + if(height<30) height=30;
4140 4250 $rootScope.isRectanglePreviewCompleted = false;
4141 4251 $("#"+canvasId).addLayer({
4142 4252 panelCanvasId:canvasId,
... ... @@ -4152,6 +4262,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
4152 4262 x: offsetX1, y: offsetY1,
4153 4263 width: width,
4154 4264 height: height,
  4265 + minWidth:30,
  4266 + minHeight:30,
4155 4267 resizeFromCenter: false,
4156 4268 add: function (layer) {
4157 4269 var drawingPoints={
... ... @@ -4287,7 +4399,9 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
4287 4399  
4288 4400 $rootScope.DrawCircleOnModuleItem = function (canvasId, CircleNumber, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, offsetX1, offsetY1, width, height) {
4289 4401  
4290   - if ($rootScope.isCirclePreviewCompleted == true) {
  4402 + if ($rootScope.isCirclePreviewCompleted == true) {
  4403 + if(width<30) width=30 ;
  4404 + if(height<30) height=30;
4291 4405 $rootScope.isCirclePreviewCompleted = false;
4292 4406 $("#"+canvasId).addLayer({
4293 4407 panelCanvasId:canvasId,
... ... @@ -4304,6 +4418,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
4304 4418 y: offsetY1,
4305 4419 width: width,
4306 4420 height: height,
  4421 + minWidth:30,
  4422 + minHeight:30,
4307 4423 // Place a handle at each side and each corner
4308 4424 resizeFromCenter: false,
4309 4425 handlePlacement: 'both',
... ... @@ -4446,7 +4562,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
4446 4562 strokeStyle: shapestyleborderColor,
4447 4563 strokeWidth: shapestyleborderWidth,
4448 4564 rounded: true,
4449   - startArrow: true,
  4565 + endArrow: true,
4450 4566 arrowRadius: 7,
4451 4567 arrowAngle: 90,
4452 4568 x1: offsetX1, y1: offsetY1,
... ... @@ -4708,7 +4824,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
4708 4824 strokeStyle: 'grey',
4709 4825 strokeWidth: shapestyleborderWidth,
4710 4826 fillStyle: radial,
4711   - x: offsetX1, y: offsetY1,
  4827 + x: x, y: y,
4712 4828 radius: 5,
4713 4829 add: function (layer) {
4714 4830 layer.draggable = false;
... ... @@ -4847,139 +4963,6 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
4847 4963 document.getElementById('modelbackground').style.display = "none";
4848 4964 }
4849 4965  
4850   - $scope.RefreshShapeText=function(canvasId,selectedTextRect,selectedTextArea,areaText)
4851   - {
4852   - var contentWidthArray = [];
4853   - var contentHeightArray = [];
4854   - $rootScope.textWidth=[];
4855   - var adjustWidth=0;
4856   - var text = areaText;
4857   - var stringText="";
4858   -
4859   - var rectDimension = new jinqJs()
4860   - .from($rootScope.rectDimension)
4861   - .where('panelCanvasId == ' + canvasId,'name == ' + selectedTextRect)
4862   - .select();
4863   - var textDimension = new jinqJs()
4864   - .from($rootScope.textDimension)
4865   - .where('panelCanvasId == ' + canvasId,'name == ' + selectedTextArea)
4866   - .select();
4867   -
4868   - $("#atTextDiv").css({ "width": Math.abs(rectDimension[0].width), "height": Math.abs(rectDimension[0].height), "font-size": textDimension[0].textstyle.fontSize });
4869   -
4870   - $("#textspan").empty();
4871   - $("#textspan").css({"display":"inline-block"});
4872   -
4873   - for (var i = 0; i <= text.length - 1; i++) {
4874   - if (contentWidthArray.length > 0) {
4875   - if (parseInt(contentWidthArray[0]) < $("#atTextDiv").width()) {
4876   - //store break line by enter key
4877   - var charvalue=text[i];
4878   - var LineBreaksLen = (text[i].match(/\n/g)||[]).length;
4879   - var isaddchar=true;
4880   - if(LineBreaksLen>0)
4881   - {
4882   - var lastspace= $rootScope.textWidth[$rootScope.textWidth.length-1].character;
4883   - charvalue=" ";//replace break line in between text by white space
4884   - if(lastspace==charvalue)
4885   - {
4886   - isaddchar=false;
4887   - }
4888   - }
4889   - else
4890   - {
4891   - // handle multiple space
4892   - var lastspace= $rootScope.textWidth[$rootScope.textWidth.length-1].character;
4893   - if(lastspace==" " && charvalue==" ")
4894   - {
4895   - isaddchar=false;
4896   - }
4897   -
4898   - }
4899   - if(isaddchar)
4900   - {
4901   - stringText=stringText+charvalue;
4902   - $("#textspan").append(charvalue);
4903   - contentWidthArray = [];
4904   - $rootScope.textWidth.push({"panelCanvasId":canvasId, "id": "", "character": charvalue });
4905   - contentWidthArray.push(Math.ceil($("#textspan").width()));
4906   - }
4907   - }
4908   - else {
4909   - var LineBreaksLen = (text[i].match(/\n/g)||[]).length;
4910   - if(LineBreaksLen<=0)
4911   - {
4912   - if(adjustWidth<contentWidthArray[0])
4913   - {
4914   - adjustWidth=contentWidthArray[0];
4915   - }
4916   - contentWidthArray = [];
4917   - // handle multiple space
4918   - var lastspace= $rootScope.textWidth[$rootScope.textWidth.length-1].character;
4919   - if(lastspace!=" " && charvalue!=" ")
4920   - {
4921   - stringText=stringText+" "+text[i];
4922   - $("#textspan").text(' ');
4923   - }
4924   - else
4925   - {
4926   - stringText=stringText+text[i];
4927   - $("#textspan").text('');
4928   - }
4929   - $("#textspan").append(text[i]);
4930   - $rootScope.textWidth.push({"panelCanvasId":canvasId, "id": "", "character": text[i] });
4931   - contentWidthArray.push(Math.ceil($("#textspan").width()));
4932   - //due to dispaly none height not update again.
4933   - var totalheight = contentHeightArray[0].totalHeight;
4934   - contentHeightArray[0].totalHeight=totalheight+contentHeightArray[0].firstlineHeight;
4935   -
4936   - }
4937   -
4938   - }
4939   - }
4940   - else {
4941   - //initially ignore break line
4942   - var LineBreaksLen = (text[i].match(/\n/g)||[]).length;
4943   - if(LineBreaksLen<=0)
4944   - {
4945   - stringText=stringText+text[i];
4946   - $("#textspan").text(text[i]);
4947   - contentWidthArray = [];
4948   - $rootScope.textWidth.push({"panelCanvasId":canvasId, "id": "", "character": text[i] });;
4949   - contentWidthArray.push(Math.ceil($("#textspan").width()));
4950   - contentHeightArray.push({firstlineHeight:Math.ceil($("#textspan").height()),totalHeight:Math.ceil($("#textspan").height())});
4951   - }
4952   - }
4953   - }
4954   - $("#atTextDiv").removeAttr("style");
4955   - $("#atTextDiv").css({ "float": "left" });//reset style
4956   -
4957   - $("#textspan").css({"display":"none"});
4958   -
4959   - // manage height
4960   - if (contentHeightArray.length >0) {
4961   - // update height
4962   - $rootScope.rectDimension = new jinqJs()
4963   - .from($rootScope.rectDimension)
4964   - .update(function (coll, index) {
4965   - coll[index].height = contentHeightArray[0].totalHeight;
4966   - coll[index].width = adjustWidth>0 ?adjustWidth:coll[index].width;
4967   - })
4968   - .at('panelCanvasId == ' + canvasId,'name == ' + selectedTextRect)
4969   - .select();
4970   -
4971   -
4972   - }
4973   -
4974   - $rootScope.textDimension = new jinqJs()
4975   - .from($rootScope.textDimension)
4976   - .update(function (coll, index) { coll[index].stringText = stringText; })
4977   - .at('panelCanvasId == ' + canvasId,'name == ' + selectedTextArea)
4978   - .select();
4979   -
4980   - contentHeightArray = [];//clear hieght
4981   - }
4982   -
4983 4966 $scope.UpdateTextEditor=function(TextPropertyArray,fillStyle)
4984 4967 {
4985 4968 if (TextPropertyArray.length>0) {
... ... @@ -5071,7 +5054,11 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
5071 5054 if(areaText!=undefined)
5072 5055 {
5073 5056 //not use while open from CB
5074   - $scope.RefreshShapeText(canvasId,selectedTextRect,selectedTextArea,areaText);
  5057 + $rootScope.textDimension = new jinqJs()
  5058 + .from($rootScope.textDimension)
  5059 + .update(function (coll, index) { coll[index].stringText = areaText; })
  5060 + .at('panelCanvasId == ' + canvasId,'name == ' + selectedTextArea)
  5061 + .select();
5075 5062 }
5076 5063  
5077 5064 var rectDimension = new jinqJs()
... ... @@ -5100,8 +5087,35 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
5100 5087 }
5101 5088 }
5102 5089 }
5103   -
5104   - $("#" + canvasId).drawRect({
  5090 +
  5091 + $("#" + canvasId).drawText({
  5092 + panelCanvasId:canvasId,
  5093 + layer: true,
  5094 + name: 'temptext',//use for intially adjust height and width of text for rectangle
  5095 + fillStyle:textDimension[0].textstyle.fontColor,
  5096 + fontStyle: textDimension[0].textstyle.fontWeight + " " + textDimension[0].textstyle.fontStyle,
  5097 + fontSize: textDimension[0].textstyle.fontSize,
  5098 + fromCenter: false,
  5099 + fontFamily: textDimension[0].textstyle.fontFamily,
  5100 + align: textDimension[0].textstyle.textAlignmt,
  5101 + strokeWidth: 0,
  5102 + text: textDimension[0].stringText,
  5103 + x: rectDimension[0].x, y: rectDimension[0].y,
  5104 + maxWidth:rectDimension[0].width,
  5105 + add: function (layer) {
  5106 + // internal use
  5107 + // use to calculate minwidth of rectangle by longest word with applied css
  5108 + var str=layer.text;
  5109 + var splittext=str.split(" ");
  5110 + var longtext= longest_string(splittext)[0];
  5111 + var test = document.getElementById("atTextDiv");
  5112 + test.style.fontSize = layer.fontSize;
  5113 + test.style.fontFamily = layer.fontFamily;
  5114 + test.style.fontWeight = layer.fontStyle.split(" ")[0];
  5115 + test.style.fontStyle = layer.fontStyle.split(" ")[1];
  5116 + $('#atTextDiv').html(longtext);
  5117 + },
  5118 + }).drawRect({
5105 5119 panelCanvasId:canvasId,
5106 5120 name: rectDimension[0].name,
5107 5121 groups: [rectDimension[0].groupName],
... ... @@ -5115,10 +5129,10 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
5115 5129 fillStyle: rectDimension[0].shapestyle.fillStyle,
5116 5130 fromCenter: false,
5117 5131 x: rectDimension[0].x, y: rectDimension[0].y,
5118   - width: Math.abs(rectDimension[0].width),
5119   - height: Math.abs(rectDimension[0].height),
5120   - minWidth: Math.abs(rectDimension[0].width),
5121   - minHeight: Math.abs(rectDimension[0].height),
  5132 + width: $("#" + canvasId).measureText('temptext').width>20?$("#" + canvasId).measureText('temptext').width+10:40,
  5133 + height:$("#" + canvasId).measureText('temptext').height>20?$("#" + canvasId).measureText('temptext').height+10:40,
  5134 + minWidth:document.getElementById("atTextDiv").clientWidth>20?document.getElementById("atTextDiv").clientWidth+10:40,
  5135 + minHeight:$("#" + canvasId).measureText('temptext').height>20?$("#" + canvasId).measureText('temptext').height:40,
5122 5136 resizeFromCenter: false,
5123 5137 add: function (layer) {
5124 5138 var drawingPoints={
... ... @@ -5266,7 +5280,10 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
5266 5280 handlemove: function(layer) {
5267 5281 if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
5268 5282 var txtnumber=(layer.name).split('_')[1];
5269   - var textareaName="TextArea_" +txtnumber;
  5283 + var textareaName="TextArea_" +txtnumber;
  5284 + // change min height of reactangle
  5285 + var textheight=$("#" + layer.panelCanvasId).measureText(textareaName).height+10;
  5286 + layer.minHeight= textheight;
5270 5287 $("#" + layer.panelCanvasId).removeLayer(textareaName).drawLayers();
5271 5288  
5272 5289 var textDimension = new jinqJs()
... ... @@ -5289,8 +5306,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
5289 5306 align: textDimension[0].textstyle.textAlignmt,
5290 5307 strokeWidth: 0,
5291 5308 text: textDimension[0].stringText,
5292   - x: layer.x, y: layer.y,
5293   - maxWidth:layer.width,
  5309 + x: layer.x+5, y: layer.y+5,
  5310 + maxWidth:layer.width-2,
5294 5311 add: function (layer) {
5295 5312 layer.draggable = true;
5296 5313 },
... ... @@ -5350,7 +5367,16 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
5350 5367 }
5351 5368 }
5352 5369 var txtnumber=(layer.name).split('_')[1];
5353   - var textareaName="TextArea_" +txtnumber;
  5370 + var textareaName="TextArea_" +txtnumber;
  5371 +
  5372 + $rootScope.rectDimension = new jinqJs()
  5373 + .from($rootScope.rectDimension)
  5374 + .update(function (coll, index) {
  5375 + coll[index].height = layer.height;
  5376 + coll[index].width = layer.width;
  5377 + })
  5378 + .at('panelCanvasId == ' + layer.panelCanvasId,'name == ' + layer.name)
  5379 + .select();
5354 5380  
5355 5381 var rectDimension = new jinqJs()
5356 5382 .from($rootScope.rectDimension)
... ... @@ -5404,10 +5430,12 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
5404 5430 align: textDimension[0].textstyle.textAlignmt,
5405 5431 strokeWidth: 0,
5406 5432 text: textDimension[0].stringText,
5407   - x: rectDimension[0].x, y: rectDimension[0].y,
  5433 + x: rectDimension[0].x+5, y: rectDimension[0].y+5,
5408 5434 maxWidth:rectDimension[0].width,
5409 5435 add: function (layer) {
5410   - layer.draggable = true;
  5436 + layer.draggable = true;
  5437 + //remove temptext
  5438 + $("#" + canvasId).removeLayer('temptext').drawLayers();
5411 5439 },
5412 5440 dragstop: function (layer) {
5413 5441 if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
... ... @@ -5451,6 +5479,13 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
5451 5479 }
5452 5480 }
5453 5481  
  5482 + function longest_string(str_ara) {
  5483 + let max = str_ara[0].length;
  5484 + str_ara.map(v => max = Math.max(max, v.length));
  5485 + var result = str_ara.filter(v => v.length == max);
  5486 + return result;
  5487 + }
  5488 +
5454 5489 $scope.dragstopEvent=function(panelCanvasId,rectName,textareaName,positionX,positionY)
5455 5490 {
5456 5491 if ((panelCanvasId).match("canvasAA")) {
... ... @@ -5771,19 +5806,19 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
5771 5806 case "Line":
5772 5807 $(".line").remove();
5773 5808 $rootScope.isLinePreviewCompleted = true;
5774   - $("#" + canvasDivId).append("<div class='line' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;'></div>");
  5809 + $("#" + canvasDivId).append("<div class='line' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + ($rootScope.offsetY1+5) + "px;'></div>");
5775 5810 $rootScope.Annotationangle();
5776 5811 break;
5777 5812 case "Arrow":
5778 5813 $(".arrow").remove();
5779 5814 $rootScope.isArrowPreviewCompleted = true;
5780   - $("#" + canvasDivId).append("<div class='arrow' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + "px;'><div style='border-bottom: 9px solid transparent;border-right: 12px dashed #ccc;border-top: 7px solid transparent;height: 0;left: -6px;position: absolute;top: -8px;width: 0;'></div></div>");
  5815 + $("#" + canvasDivId).append("<div class='arrow' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + ($rootScope.offsetY1+5) + "px;width:" + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + "px;'><div class='arrowPoint' style='border-bottom: 9px solid transparent;border-left: 12px dashed #ccc;border-top: 7px solid transparent;height: 0;left:" + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + "px;position: absolute;top: -8px;width: 0;'></div></div>");
5781 5816 $rootScope.Annotationangle();
5782 5817 break;
5783 5818 case "Pin":
5784 5819 $(".pin").remove();
5785 5820 $rootScope.isPinPreviewCompleted = true;
5786   - $("#" + canvasDivId).append("<div class='pin' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + "px;'><div style='background-color:#fff;left: -8px;position: absolute;top: -6px;width: 10;height:12px;width:12px;border:2px dashed #808080;border-radius:50%;'></div></div>");
  5821 + $("#" + canvasDivId).append("<div class='pin' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + ($rootScope.offsetY1+5) + "px;width:" + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + "px;'><div class='pinPoint' style='background-color:#fff;left:" + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + "px;position: absolute;top: -6px;height:12px;width:12px;border:2px dashed #808080;border-radius:50%;'></div></div>");
5787 5822 $rootScope.Annotationangle();
5788 5823 break;
5789 5824 case "Circle":
... ... @@ -5847,9 +5882,11 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
5847 5882 break;
5848 5883 case "Arrow":
5849 5884 $('.arrow').css({ 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%', 'width': dottedLineWidth + 'px' });
  5885 + $('.arrowPoint').css({ 'left': dottedLineWidth + 'px' });
5850 5886 break;
5851 5887 case "Pin":
5852 5888 $('.pin').css({ 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%', 'width': dottedLineWidth + 'px' });
  5889 + $('.pinPoint').css({ 'left': dottedLineWidth + 'px' });
5853 5890 break;
5854 5891 case "Circle":
5855 5892 var classname=".circle"
... ... @@ -6425,11 +6462,15 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
6425 6462 $("#modelsettingsbackground").css("display", "none");
6426 6463 }
6427 6464 $rootScope.CloseSetting = function () {
6428   - // $rootScope.errorMessage = LoginMessageConstants.INVALID_USER;
  6465 + if($rootScope.isApplyBtnClicked)
  6466 + {
6429 6467 $("#saveSettingsMessageModal").modal('show');
6430 6468 $("#saveSettingsMessageModal").css('zIndex', 80000000000);
6431   - //$('#modal-settings').css("display", "none");
6432   - //$("#modelsettingsbackground").css("display", "none");
  6469 + }
  6470 + else
  6471 + {
  6472 + $rootScope.CancelSetting ();
  6473 + }
6433 6474 }
6434 6475  
6435 6476 $rootScope.saveSettings = function () {
... ... @@ -6561,6 +6602,12 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
6561 6602 $('#primarylaxican').attr("name", $rootScope.primaryLangID);
6562 6603 }
6563 6604 }
  6605 +
  6606 + $('#lexiconLangDropdown').html($('#lexiconLangDropdown').find('option').sort(function (x, y) {
  6607 +
  6608 + return $(x).text() > $(y).text() ? 1 : -1
  6609 +
  6610 + }));
6564 6611 }
6565 6612  
6566 6613  
... ... @@ -7465,8 +7512,9 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
7465 7512 {
7466 7513 var imageInfo = $rootScope.UserImageExportData[0];
7467 7514  
7468   - $scope.saveDACernerWindowActivity();//Check for Cerner
7469   -
  7515 + if($rootScope.isCernerUser){
  7516 + $scope.saveDACernerWindowActivity();//Check for Cerner
  7517 + }
7470 7518 AuthenticationService.UserLicenseExportImage(imageInfo)
7471 7519 .then(
7472 7520 function (result) {
... ... @@ -7475,23 +7523,24 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
7475 7523  
7476 7524 var blob = dataURItoBlob(dataURL);
7477 7525  
7478   - //Polulating object
7479   - $rootScope.CernerImageInfo.data = dataURL;
7480   - $rootScope.CernerImageInfo.name = fileName;
7481   - $rootScope.CernerImageInfo.blob = blob;
7482   - $rootScope.CernerImageInfo.imageInfo = imageInfo;
7483   - $rootScope.CernerImageInfo.imageInfoJson = $scope.updatedWindowListSaveCerner;
7484   - $rootScope.CernerImageInfo.CernerUserSessionId = $scope.GetSessionIdCookie();
7485   -
7486   - //Call Cerner Fhir service
7487   - $scope.CallCernerService($rootScope.CernerImageInfo);
7488   -
  7526 + if($rootScope.isCernerUser){
  7527 + //Polulating object
  7528 + $rootScope.CernerImageInfo.data = dataURL;
  7529 + $rootScope.CernerImageInfo.name = fileName;
  7530 + $rootScope.CernerImageInfo.blob = blob;
  7531 + $rootScope.CernerImageInfo.imageInfo = imageInfo;
  7532 + $rootScope.CernerImageInfo.imageInfoJson = $scope.updatedWindowListSaveCerner;
  7533 + $rootScope.CernerImageInfo.CernerUserSessionId = $scope.GetSessionIdCookie();
  7534 +
  7535 + //Call Cerner Fhir service
  7536 + $scope.CallCernerService($rootScope.CernerImageInfo);
  7537 + }
7489 7538  
7490 7539 console.log(blob);
7491 7540 saveAs(blob, fileName);
7492 7541 $("#exportlogo").remove();
7493 7542 $("#filename").val("");
7494   -
  7543 +
7495 7544 if(result!=null && result!="ADMIN" )
7496 7545 {
7497 7546 var userid= $rootScope.userData.Id;
... ... @@ -7520,67 +7569,58 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
7520 7569 });
7521 7570 $(".export-image").css("display", "none");
7522 7571  
7523   - };
7524   -
  7572 + },
7525 7573  
7526   - //Save DISSECTIBLE_ANATOMY activity for DA Cerner.
7527   - $scope.saveDACernerWindowActivity = function () {
7528   - //$scope.updatedWindowListSaveCerner = {};
7529   - if ($rootScope.DaWindowData !== undefined && $rootScope.DaWindowData.length > 0) {
  7574 + //Save DISSECTIBLE_ANATOMY activity for Cerner.
  7575 + $scope.saveDACernerWindowActivity = function () {
  7576 + if ($rootScope.DaWindowData != undefined && $rootScope.DaWindowData.length > 0) {
7530 7577 for (var i = 0; i < $rootScope.DaWindowData.length; i++) {
7531 7578 $scope.updatedWindowListSaveCerner = {
7532   -
7533   - bodySystemTermList: $rootScope.DaWindowData[i].BodySystemData,
7534   - isTitleBarVisible: false, //BodySystemData.isTitleBarVisible,//N
  7579 +
  7580 + // bodySystemTermList: $rootScope.DaWindowData[i].BodySystemData,
  7581 + isTitleBarVisible: false,
7535 7582 highlightOptionsSelectedId: 0,
7536 7583 selectedStructureID: 0,//N
7537 7584 contentDescriptorId: 0,
7538   - callOuts: $rootScope.DaWindowData[i].CurriculumTermData,
  7585 + callOuts: $rootScope.DaWindowData[i].CurriculumTermData,
7539 7586  
7540   - //selectedCallouts: $rootScope.DaWindowData[i].CBselectedpinCordinate,
7541 7587 layerNumber: parseInt($rootScope.DaWindowData[i].layerNumber) + 1,
7542 7588 isModestyOn: $rootScope.DaWindowData[i].ModestyValue,
7543   -
7544   - isTopToolBarVisible: false, //$rootScope.DaWindowData[i].isTopToolBarVisible,
  7589 +
  7590 + isTopToolBarVisible: false,
7545 7591 clickedTermList: $rootScope.DaWindowData[i].fullTermlist,
7546 7592 minimised: $rootScope.DaWindowData[i].minimised,
7547 7593 windowTitle: $rootScope.DaWindowData[i].currentViewTitle,
7548   - //scrollPosition: {
7549   - // vertical: $rootScope.DaWindowData[i].verticalScroll,
7550   - // horizontal: $rootScope.DaWindowData[i].horizontalScroll
7551   - //},
7552   -
  7594 +
7553 7595 maximised: $rootScope.DaWindowData[i].maximised,
7554 7596 size: {
7555 7597 width: $rootScope.DaWindowData[i].width,
7556 7598 height: $rootScope.DaWindowData[i].height
7557 7599 },
7558   - id: $rootScope.DaWindowData[i].voId,
7559   -
  7600 + id: $rootScope.DaWindowData[i].voId,
  7601 +
7560 7602 imageId: $rootScope.DaWindowData[i].imageId,
7561 7603 position: {
7562 7604 top: $rootScope.DaWindowData[i].top,
7563   - left: $rootScope.DaWindowData[i].left
  7605 + left: $rootScope.DaWindowData[i].left,
7564 7606 },
7565 7607 mType: $rootScope.DaWindowData[i].moduleName,
7566 7608 containsCapturedContent: true,
7567   - //contextMenu: { hideLeftBar: false, hideTitleBar: false, hideTopToolBar: false, lockResize: false },
7568   - //activePinArray: $rootScope.DaWindowData[i].activePinArray, // Selected PINID on Body
7569   - //sliderVal: $rootScope.DaWindowData[i].sliderVal,
  7609 +
7570 7610 zoom: $rootScope.DaWindowData[i].zoomInOut,
7571 7611 skinId: $rootScope.DaWindowData[i].curentEthnicity,
7572   - isResizeLock: false, //N
  7612 + isResizeLock: false , //N
7573 7613 mode: $rootScope.DaWindowData[i].mode,
7574 7614 windowListId: 0,//N
7575 7615 canvasVScrollX: $rootScope.DaWindowData[i].CanvasDivTopPosition,
7576   - canvasHScrollX: $rootScope.DaWindowData[i].CanvasDivLeftPosition,
7577   - isCallOutVisible: false,
7578   - annotationData: $rootScope.DaWindowData[i].annotationData,
  7616 + canvasHScrollX: $rootScope.DaWindowData[i].CanvasDivLeftPosition,
  7617 + isCallOutVisible: false,
  7618 + annotationData:$rootScope.DaWindowData[i].annotationData,
7579 7619 isLeftToolBarVisible: false,
7580   - isModuleLoaded: false,
  7620 + isModuleLoaded: false,
7581 7621 searchSelectedText: $rootScope.DaWindowData[i].searchSelectedText,
7582   - prevId: $rootScope.DaWindowData[i].prevId, //ActualTermnumber for chnages body image
7583   -
  7622 + prevId: $rootScope.DaWindowData[i].prevId,
  7623 +
7584 7624 isTransparent: $rootScope.DaWindowData[i].isTransparent,
7585 7625 transparencyBounds: $rootScope.DaWindowData[i].transparencyBounds,
7586 7626 transparencyValue: $rootScope.DaWindowData[i].transNumber,
... ... @@ -7589,30 +7629,17 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
7589 7629 transparencyY: $rootScope.DaWindowData[i].transparencyY,
7590 7630 layerNumberBeforeTBDraw: $rootScope.DaWindowData[i].layerNumberBeforeTBDraw,
7591 7631 showHideAnnotations: $rootScope.DaWindowData[i].showHideAnnotations
7592   -
7593   -
7594   - };
  7632 +
  7633 +
  7634 + }
7595 7635 }
7596   - }
7597   - };
  7636 +
  7637 + }
  7638 + },
7598 7639  
7599 7640 $scope.CallCernerService = function (CernerImageInfo) {
7600 7641 CernerFhirService.SaveImageToFhirResource(CernerImageInfo);
7601   - };
7602   -
7603   - $scope.GetJsonImageAIA = function (documentId) {
7604   - CernerFhirService.GetJsonImageAIA(documentId).then(function (result) {
7605   - console.log(result);
7606   - var WindowImageJson = result.JsonData;
7607   - var Json = jQuery.parseJSON(WindowImageJson);
7608   - // Load DA module.
7609   - //$scope.AIAModuleOpenResourceInfo(Json);
7610   - //$scope.loadResourceOnCurrentSlide(ImageJson);
7611   - //AIAModuleOpenResoureInDA(ImageJson);
7612   - }, function (error) {
7613   - console.log(' Error in opening DA module = ' + error.statusText);
7614   - });
7615   - };
  7642 + },
7616 7643  
7617 7644 $rootScope.GetCookie = function (name) {
7618 7645 var nameEQ = name + "=";
... ... @@ -7623,27 +7650,33 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;$scope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$l
7623 7650 if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
7624 7651 }
7625 7652 return null;
7626   - };
  7653 + },
7627 7654  
7628 7655 $scope.GetSessionIdCookie = function () {
7629 7656 var json = $rootScope.GetCookie("CernerInfo");
7630 7657 //var ASPSession = $rootScope.GetCookie("ASP.NET_SessionId"); // enable to retreive as set to HttpOnly.
7631 7658 var data = JSON.parse(json);
7632 7659 return data.CernerSessionId;
7633   - };
7634   -
7635   - $scope.CheckCernerLaunch = function () {
7636   - var DocumentId = (new URL(location.href)).searchParams.get('documentId');
7637   - if (DocumentId !== null && DocumentId !== "") {
7638   - alert("Document Id detected... Now loading DA module...");
7639   - // Call API with DocumentId
7640   - $scope.GetJsonImageAIA(DocumentId);
  7660 + },
  7661 +
  7662 + $scope.CheckCernerUser = function () {
  7663 + var json = $rootScope.GetCookie("CernerInfo");
  7664 + if (json !== null && json !== "") {
  7665 + var data = JSON.parse(json);
  7666 + if (data.isCernerUser) {
  7667 + $rootScope.isCernerUser = true;
  7668 + setInterval(function(){ $scope.CallUpdateCernerToken(data.CernerSessionId); }, 480000); //
  7669 + return true;
  7670 + }
7641 7671 }
7642   - };
7643   -
  7672 + },
7644 7673  
  7674 + $scope.CallUpdateCernerToken = function(sessionId){
  7675 + CernerFhirService.UpdateToken(sessionId);
  7676 + };
7645 7677 }]
7646 7678 );
  7679 +
7647 7680 function printImagePreview(event) {
7648 7681 var scope = angular.element(document.querySelector('[ng-controller="HomeController"]')).scope();
7649 7682  
... ...
400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js
... ... @@ -42,7 +42,26 @@
42 42 });
43 43 return deferred.promise;
44 44 },
  45 + ByPassLoginToOpenModule: function (urlDetail) {
  46 + var deferred = $q.defer();
45 47  
  48 + $http.post('/API/api/ByPassLoginToOpenModule', JSON.stringify(urlDetail), {
  49 + headers: {
  50 + 'Content-Type': 'application/json'
  51 + }
  52 + })
  53 + .success(function (data, status, headers, config) {
  54 + console.log('success')
  55 + deferred.resolve(data);
  56 + }).error(function (data, status, headers, config) {
  57 + console.log('error')
  58 + deferred.reject(data);
  59 + $rootScope.errorMessage = data;
  60 + $("#messageModal").modal('show');
  61 +
  62 + });
  63 + return deferred.promise;
  64 + },
46 65  
47 66 saveSetings: function (settings) {
48 67 var deferred = $q.defer();
... ...
400-SOURCECODE/AIAHTML5.Web/app/services/CernerFhirService.js
1 1 ๏ปฟ
2 2  
3   -AIA.factory('CernerFhirService', function ($http, $q) {
  3 +AIA.factory('CernerFhirService',function($http,$q) {
4 4 return {
5   - SaveImageToFhirResource: function (Base64ImageCerner) {
  5 + SaveImageToFhirResource: function(Base64ImageCerner) {
6 6  
7   - var deferred = $q.defer();
8   -
9   - $http.post('/API/api/CernerFhir', JSON.stringify(Base64ImageCerner), {
  7 + var deferred=$q.defer();
  8 +
  9 + $http.post('/API/api/CernerFhir',JSON.stringify(Base64ImageCerner),{
10 10 headers: {
11 11 'Content-Type': 'application/json'
12 12 }
13   - }).success(function (data, status, headers, config) {
14   - console.log('success');
15   - deferred.resolve(data);
16   - }).error(function (data, status, headers, config) {
17   - console.log('error');
18   - deferred.reject(data);
  13 + }).success(function(data,status,headers,config) {
  14 + console.log('success');
  15 + deferred.resolve(data);
  16 + }).error(function(data,status,headers,config) {
  17 + console.log('error');
  18 + deferred.reject(data);
19 19  
20 20 });
21 21  
22 22 return deferred.promise;
23 23 },
24 24  
25   - GetJsonImageAIA: function (documentId) {
  25 + GetJsonImageAIA: function(documentId) {
  26 + var deferred=$q.defer();
26 27  
27   - var deferred = $q.defer();
28   -
29   - $http.get('API/api/CernerUserSession/' + documentId)
30   - .success(function (data, status, headers, config) {
  28 + $http.get('API/api/CernerUserSession/'+documentId)
  29 + .success(function(data,status,headers,config) {
31 30 deferred.resolve(data);
32 31 })
33   - .error(function () {
  32 + .error(function(data,status,headers,config) {
34 33 deferred.reject(data);
35 34 });
36 35 return deferred.promise;
37   - }
  36 + },
38 37  
  38 + UpdateToken: function(sessionId) {
  39 + var deferred=$q.defer();
  40 +
  41 + $http.get('/API/api/CernerFhir/'+sessionId)
  42 + .success(function(data,status) {
  43 + deferred.resolve(data);
  44 + })
  45 + .error(function(data,status,headers,config) {
  46 + deferred.reject(data);
  47 + });
  48 + }
39 49  
40 50 };
41 51 });
42 52 \ No newline at end of file
... ...
400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js
... ... @@ -335,7 +335,7 @@ AIA.service(&#39;ModuleService&#39;, function ($http, DataService) {
335 335 mode: windowData.mode,
336 336 isLeftToolBarVisible: windowData.isLeftToolBarVisible,
337 337 contentDescriptorId: windowData.contentDescriptorId,
338   - bodySystemTermList: windowData.bodySystemTermList,
  338 + // bodySystemTermList: windowData.bodySystemTermList,
339 339 isTransparent: windowData.isTransparent,
340 340 windowListId: windowData.windowListId,
341 341 canvasVScrollX: windowData.canvasVScrollX,
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html
... ... @@ -72,7 +72,7 @@
72 72 <tbody id="ListViewDiv" ng-if="!filterstring" class="clstbody">
73 73 <tr id="{{item._id}}" ng-class="{selected: item._id === idSelected}" ng-click="showItem(item._id)" ng-dblclick="openView($event)" ng-repeat="item in selectedCAListViewData">
74 74 <td width="25%">
75   - {{item._Title}}
  75 + ({{item._id}}) {{item._Title}}
76 76 </td>
77 77 <td width="25%">
78 78 {{item._BodyRegion}}
... ... @@ -88,7 +88,7 @@
88 88 <tbody id="ListViewDiv" ng-if="filterstring" class="clstbody">
89 89 <tr ng-click="showItem(item._id)" ng-class="{selected: item._id === idSelected}" ng-dblclick="openView($event)" ng-repeat="item in searchCAListViewData">
90 90 <td width="25%">
91   - {{item._Title}}
  91 + ({{item._id}}) {{item._Title}}
92 92 </td>
93 93 <td width="25%">
94 94 {{item._BodyRegion}}
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html
... ... @@ -264,7 +264,7 @@
264 264 <img src="~/../content/images/DA/navigator-view.png" style="height:30px; width:50px" />
265 265 </button>
266 266  
267   - <div class="dropdown-menu" id="navigatorDiv" style="min-height: initial; min-width: initial; ">
  267 + <div class="dropdown-menu" id="navigatorDiv" style="min-height: initial; min-width: initial;left:-12px; ">
268 268 <div id="navDiv" align="center" style="min-width: initial; height: 119px; ">
269 269 <img id="navimg" alt="" />
270 270 <div id="draggable" class="draggable ui-widget-content dragdivposition draggable_navigator" ng-mouseup="ScrollCanvasDiv($event)">
... ...
400-SOURCECODE/AIAHTML5.Web/index.aspx
... ... @@ -786,15 +786,7 @@
786 786  
787 787 </div>
788 788 </div>
789   - <textarea class="form-control" id="text_area" rows="3" style="font-family: 'Verdana, sans-serif';font-size:14px; font-weight: normal; font-style: normal; color: #000; text-align: left; text-decoration: none;"></textarea>
790   -
791   - <!--code for horizonatl text going out-->
792   - <div id="atTextDiv" style="float:left;">
793   - <!-- <span id="duptextspan" style="float: left; display: none;"></span> -->
794   - <span id="textspan" style="display:none;"></span>
795   - </div>
796   - <!--code for horizonatl text going out-->
797   -
  789 + <textarea class="form-control" id="text_area" rows="3" style="font-family: 'Verdana, sans-serif';font-size:14px; font-weight: normal; font-style: normal; color: #000; text-align: left; text-decoration: none;"></textarea>
798 790 </div>
799 791 <div class="modal-footer">
800 792 <!--<button type="button" class="btn btn-default" ng-click="closeModal()" data-dismiss="modal">Close</button>-->
... ... @@ -805,8 +797,10 @@
805 797  
806 798 </div>
807 799  
808   -
809   -
  800 + <!--text area div to calculate width and height-->
  801 + <div id="atTextDiv" style="position: absolute; visibility: hidden; height: auto; width: auto; white-space: nowrap">
  802 + </div>
  803 +
810 804  
811 805 <!--List manager-->
812 806 <!--List manager-->
... ... @@ -1808,12 +1802,12 @@
1808 1802 <script>
1809 1803 $(function () {
1810 1804 function onBrushSizeChange() {
1811   - $('.btnCursor').trigger('click');
1812   - $('.btnCursor').addClass('activebtncolor');
1813   - $(".btn-annotation").removeClass("activebtncolor");
1814   - $(".btn-annotation-erase").removeClass("activebtncolor");
1815   - $(".btn-annotation-erase").removeClass("activebtncolor");
1816   - $(".annotationpaintbrushsize").removeClass("activebtncolor");
  1805 + //$('.btnCursor').trigger('click');
  1806 + // $('.btnCursor').addClass('activebtncolor');
  1807 + // $(".btn-annotation").removeClass("activebtncolor");
  1808 + // $(".btn-annotation-erase").removeClass("activebtncolor");
  1809 + // $(".btn-annotation-erase").removeClass("activebtncolor");
  1810 + // $(".annotationpaintbrushsize").removeClass("activebtncolor");
1817 1811 var x = $('#canvasPaint').css("z-index");
1818 1812  
1819 1813 var y = $('#canvas').css("z-index");
... ...
400-SOURCECODE/AIAHTML5.Web/index.aspx.cs
... ... @@ -16,6 +16,7 @@ using ADAM.CernerFHIR.Client;
16 16 using ADAM.CernerFHIR.Helper;
17 17 using ADAM.CernerFHIR.Model;
18 18 using AIAHTML5.API.Models;
  19 +using eLearningPlayer;
19 20 using eLearningPlayer.model;
20 21 using HtmlAgilityPack;
21 22  
... ... @@ -65,18 +66,32 @@ namespace ADAM.AIA
65 66 //var urlRedirect = Task.Factory.StartNew<Task<string>>(async () => await ResourceProcessor.CernerConfiguration(baseUrlFHIR, "auth", true));
66 67  
67 68 var AsyncTask = Task.Run(async () => await ResourceProcessor.CernerConfiguration(cernerEndPointURL, "auth", true));
68   - var urlRedirect = AsyncTask.Result;
69 69  
70   - Response.Redirect(urlRedirect + "&launch=" + cernerLaunch, false);
  70 + var AuthorizationUriRedirect = AsyncTask.Result;
  71 + if (null != CernerDocumentId && CernerDocumentId != "")
  72 + Response.Redirect(AuthorizationUriRedirect + "&launch=" + cernerLaunch + "&documentId=" + CernerDocumentId, true);
  73 + else
  74 + Response.Redirect(AuthorizationUriRedirect + "&launch=" + cernerLaunch, true);
71 75 }
72 76 else
73   - {
  77 + {
  78 + if (null != CernerDocumentId && CernerDocumentId != "")
  79 + {
  80 + Uri url = new Uri(Request.Url.PathAndQuery, UriKind.Relative);
  81 + var values = new { documentId = CernerDocumentId };
  82 + var result = url.ExtendQuery(values);
  83 + //Assert.That(result, Is.EqualTo(new Uri("/test?param1=new-value&param2=val2", UriKind.Relative)));
  84 + //HttpContext.Current.Request.QueryString.Add("documetId", CernerDocumentId);
  85 + //AddParameter(Request.Url, "documetId", CernerDocumentId);
  86 + //Response.Redirect(result.OriginalString, false);
  87 + }
74 88 ApiHelper.InitializeClient();// Initialize FHIR Client.
75 89 RegisterAsyncTask(new PageAsyncTask(() => ProcessCernerResourceAsync(cernerEndPointURL, cernerCode)));// Process FHIR Resource.
76 90 }
77 91 }
78 92 else if(null != CernerDocumentId && CernerDocumentId != "")
79 93 {
  94 + //AddParameter(Request.Url, "documetId", CernerDocumentId);
80 95 //ApiHelper.InitializeClient();// Initialize FHIR Client if required.
81 96 //RegisterAsyncTask(new PageAsyncTask(() => ProcessCernerDocumentResourceAsync(cernerEndPointURL, CernerDocumentId)));// Process FHIR Resource.
82 97 //Response.Write("Loading... to previous state DA !!");
... ... @@ -87,8 +102,23 @@ namespace ADAM.AIA
87 102 }
88 103 }
89 104  
90   - string c = "nm";
91   - if (Request.QueryString["account"] != null)
  105 + if (Request.QueryString["mtype"] != null)
  106 + {
  107 + //birendra
  108 + //open default CA module by query string
  109 + isCalsCredantial = true;
  110 +
  111 + string[] allQueryData = new string[Request.QueryString.AllKeys.Length];
  112 +
  113 + for(int i=0;i< Request.QueryString.AllKeys.Length; i++)
  114 + {
  115 + allQueryData[i] = Request.QueryString.AllKeys[i] + "=" + Request.QueryString[Request.QueryString.AllKeys[i]].ToString();
  116 + }
  117 + urlParams = string.Join("&", allQueryData);
  118 +
  119 + //urlParams = "mtype=" + Request.QueryString[allQueryData[].ToString() + "&id=" + Request.QueryString["id"].ToString() + "&username=" + Request.QueryString["username"].ToString() + "&password=" + Request.QueryString["password"].ToString();
  120 + }
  121 + else if (Request.QueryString["account"] != null)
92 122 {
93 123 // http://stackoverflow.com/questions/9032005/request-servervariableshttp-referer-is-not-working-in-ie
94 124 // http://stackoverflow.com/questions/5643773/http-referrer-not-always-being-passed?rq=1
... ... @@ -206,7 +236,15 @@ namespace ADAM.AIA
206 236 if (Session["iss"] != null && (cernerLaunch != "" || cernerCode != ""))
207 237 cernerEndPointURL = Session["iss"].ToString();
208 238  
209   - //If any error occurs with cerner
  239 + //Session store documetId
  240 + if(cernerEndPointURL != "" && cernerLaunch != "" && CernerDocumentId != "")
  241 + Session["documetId"] = CernerDocumentId;
  242 +
  243 + //Retreive session
  244 + if (Session["documetId"] != null && (cernerLaunch != "" || cernerCode != ""))
  245 + CernerDocumentId = Session["documetId"].ToString();
  246 +
  247 + //If any error occurs from cerner
210 248 if (Request.QueryString["error"] != null)
211 249 {
212 250 var error_uri = Request.QueryString["error_uri"].ToString();
... ... @@ -245,18 +283,8 @@ namespace ADAM.AIA
245 283 Session["Code"] = cernerCode; // set first time launch code.
246 284 Session["sessionId"] = sessionId;
247 285  
248   - //Create object and save to AIA DB
249   -
250   - var cernerUserSessionInfo = new CernerUserSessionInfo() {
251   - FhirUserSessionId = sessionId,
252   - LoginResult = token,
253   - CernerInfoJWT = cernerInfoJWT,
254   - CernerCode = cernerCode
255   - };
256   -
257   - //Call API.
258   - await Task.Run(async () => await SaveCernerUserSessionInfo(cernerUserSessionInfo));
259 286  
  287 + await CernerUserSession(sessionId, token, cernerInfoJWT, cernerCode);
260 288  
261 289 }
262 290 else
... ... @@ -273,6 +301,8 @@ namespace ADAM.AIA
273 301 Session["CernerToken"] = token;
274 302 Session["CernerInfoJWT"] = cernerInfoJWT;
275 303 Session["Code"] = cernerCode; // New launch code.
  304 +
  305 + await CernerUserSession(sessionId, token, cernerInfoJWT, cernerCode);
276 306 }
277 307 }
278 308  
... ... @@ -329,6 +359,31 @@ namespace ADAM.AIA
329 359 }
330 360 }
331 361  
  362 + private async Task CernerUserSession(string sessionId, LoginResult token, CernerInfoJWT cernerInfoJWT, string cernerCode)
  363 + {
  364 + //Create object and save to AIA DB
  365 +
  366 + var cernerUserSessionInfo = new CernerUserSessionInfo()
  367 + {
  368 + FhirUserSessionId = sessionId,
  369 + LoginResult = token,
  370 + CernerInfoJWT = cernerInfoJWT,
  371 + CernerCode = cernerCode
  372 + };
  373 +
  374 + //Call API.
  375 + await Task.Run(async () => await SaveCernerUserSessionInfo(cernerUserSessionInfo));
  376 + }
  377 +
  378 + //public static Uri AddParameter(this Uri url, string paramName, string paramValue)
  379 + //{
  380 + // var uriBuilder = new UriBuilder(url);
  381 + // var query = HttpUtility.ParseQueryString(uriBuilder.Query);
  382 + // query[paramName] = paramValue;
  383 + // uriBuilder.Query = query.ToString();
  384 +
  385 + // return uriBuilder.Uri;
  386 + //}
332 387 #endregion
333 388 }
334 389 }
335 390 \ No newline at end of file
... ...
400-SOURCECODE/AIAHTML5.Web/libs/sketch.js
... ... @@ -106,9 +106,13 @@ var __slice = Array.prototype.slice;
106 106 e.pageX = e.originalEvent.targetTouches[0].pageX;
107 107 e.pageY = e.originalEvent.targetTouches[0].pageY;
108 108 }
109   - $.sketch.tools[$(this).data('sketch').tool].onEvent.call($(this).data('sketch'), e);
110   - e.preventDefault();
111   - return false;
  109 + if($.sketch.tools[$(this).data('sketch').tool]!=undefined) //Birendra-after paint/erase create problem while drawing other shape
  110 + {
  111 + $.sketch.tools[$(this).data('sketch').tool].onEvent.call($(this).data('sketch'), e);
  112 + e.preventDefault();
  113 + return false;
  114 + }
  115 +
112 116 };
113 117 Sketch.prototype.redraw = function() {
114 118 var sketch;
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html
... ... @@ -301,7 +301,7 @@
301 301 <div class="form-group">
302 302 <label for="inputEmail3" class="col-sm-5 control-label">Deactivation Date :</label>
303 303 <div class="col-sm-7">
304   - <input class="form-control input-sm" id="DeactivationDate" placeholder="" type="text" formControlName="DeactivationDate">
  304 + <input class="form-control input-sm" id="DeactivationDate" placeholder="" type="text" formControlName="DeactivationDate" (keydown.space)="$event.preventDefault();">
305 305 <!-- <div *ngIf="!adduserFrm.controls.DeactivationDate.valid && adduserFrm.controls.DeactivationDate.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;"></div> -->
306 306 </div>
307 307 </div>
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts
... ... @@ -53,7 +53,6 @@ export class UsersList implements OnInit, AfterViewChecked {
53 53 selectedId: number = 0;
54 54 divClass: string;
55 55 isActive: boolean;
56   - deaDateblank:boolean;
57 56 NoRecord: string;
58 57 checkedRecords: Array<number>;
59 58 UncheckedRecords: Array<number>;
... ... @@ -102,7 +101,8 @@ export class UsersList implements OnInit, AfterViewChecked {
102 101 ModifiedDate: [''],
103 102 Createdby: [''],
104 103 Modifiedby: [''],
105   - DeactivationDate: ['',this.noWhitespaceValidator],
  104 + DeactivationDate: [''],
  105 + //DeactivationDate: ['',this.noWhitespaceValidator],
106 106 isActive: [false],
107 107 UserStatusActive: ['false'],
108 108 UserStatusInActive:['']
... ... @@ -341,7 +341,6 @@ export class UsersList implements OnInit, AfterViewChecked {
341 341 this.bindUsers(x);
342 342 }, error => this.error = <any>error);
343 343  
344   - //this.adduserFrm.controls['DeactivationDate'].setValue(this.datePipe.transform(this.UserEntity.DeactivationDate, 'MM/dd/yyyy'))
345 344 if (this.UserEntity.UserStatus == 'Active') {
346 345 this.adduserFrm.controls['UserStatusActive'].setValue('true')
347 346 }
... ... @@ -355,9 +354,7 @@ export class UsersList implements OnInit, AfterViewChecked {
355 354  
356 355 }
357 356 bindUsers(data) {
358   -
359   - //console.log(data);
360   - //alert(JSON.stringify(data));
  357 +
361 358 this.UserDetailEntity = data[0];
362 359 this.adduserFrm.controls['DeactivationDate'].setValue(this.datePipe.transform(this.UserDetailEntity.DeactivationDate, 'MM/dd/yyyy'))
363 360 this.adduserFrm.controls['Createdby'].setValue(this.UserDetailEntity.Createdby)
... ... @@ -378,6 +375,7 @@ export class UsersList implements OnInit, AfterViewChecked {
378 375 //this.managerightFrm.contains['UserId'].setValue(this.UserEntity.Id);
379 376  
380 377 }
  378 +
381 379  
382 380 public UpdateUser() {
383 381 this.alerts = '';
... ... @@ -401,21 +399,16 @@ export class UsersList implements OnInit, AfterViewChecked {
401 399 if (this.adduserFrm.value.FirstName == '') {
402 400 this.alerts += '</br><span>First Name is required.</span>';
403 401 }
404   - this.deaDateblank=false;
405   - if (this.adduserFrm.value.DeactivationDate == '' ||this.adduserFrm.value.DeactivationDate == null) {
406   - this.deaDateblank=true;
407   - //set date to pass from validation and later remove
408   - this.adduserFrm.controls['DeactivationDate'].setValue('01/01/2020');
  402 + if (this.adduserFrm.value.DeactivationDate != null) {
  403 + if(this.adduserFrm.value.DeactivationDate.trim() == '')
  404 + {
  405 + this.adduserFrm.controls['DeactivationDate'].setValue(null);
  406 + }
409 407 }
410 408  
411 409  
412 410 if (this.adduserFrm.valid && this.alerts == '') {
413 411 this.adduserFrm.controls['isActive'].setValue(this.adduserFrm.value.UserStatusActive) ;
414   -
415   - if(this.deaDateblank)
416   - {
417   - this.adduserFrm.controls['DeactivationDate'].setValue(null);
418   - }
419 412  
420 413 var Userobj = this.adduserFrm.value;
421 414  
... ...