diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs index e9aa11c..394381a 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs @@ -207,13 +207,28 @@ namespace AIAHTML5.ADMIN.API.Controllers UserEntity.CreatorId = jsonUserData["Modifiedby"].Value(); JToken typeToken= jsonUserData["DeactivationDate"]; - if (typeToken.Type != JTokenType.Null) - { - UserEntity.DeactivationDate = typeToken.Value(); - } try { + try + { + if (typeToken.Type != JTokenType.Null) + { + string dateString=typeToken.Value(); + if(!string.IsNullOrWhiteSpace(dateString)) + { + UserEntity.DeactivationDate = typeToken.Value(); + } + + } + } + catch (Exception ex) + { + // Log exception code goes here + return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex.Message); + } + + Status = UserModel.UpdateUser(dbContext, UserEntity); if (Status.Equals("1")) { diff --git a/400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs b/400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs index 2d28bb3..b0c8883 100644 --- a/400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs +++ b/400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs @@ -46,5 +46,7 @@ namespace AIAHTML5.API.Constants public const string SAVE_AIA_IMAGE_JSON_DOCUMENTID = "SaveDocumentIdAIAImageJson"; public const string GET_AIA_IMAGE_JSON_DOCUMENTID = "GetDocumentIdAIAImageJson"; public const string CHECK_CERNER_USER_SESSION = "CheckCernerUserSession"; + public const string GET_USER_DETAIL_BYLOGIN_AND_ACCOUNT = "usp_GetUserDetailsByLoginIdandAccount"; + public const string UPDATE_CERNER_SESSION_INFO = "UpdateCernerSessionInfo"; } } \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.API/Controllers/CernerFhirController.cs b/400-SOURCECODE/AIAHTML5.API/Controllers/CernerFhirController.cs index d986949..4910742 100644 --- a/400-SOURCECODE/AIAHTML5.API/Controllers/CernerFhirController.cs +++ b/400-SOURCECODE/AIAHTML5.API/Controllers/CernerFhirController.cs @@ -12,6 +12,7 @@ using ADAM.CernerFHIR.Client; using ADAM.CernerFHIR.Helper; using ADAM.CernerFHIR.Model; using AIAHTML5.API.Models; +using eLearningPlayer.model; using HtmlAgilityPack; using Newtonsoft.Json.Linq; @@ -26,9 +27,29 @@ namespace AIAHTML5.API.Controllers } // GET api//5 - public string Get(int id) + public void Get(string id) { - return "value"; + //Update cerner user session values. + var cernerSessionId = id;// jsonData["sessionId"].Value(); + var db = new DBModel(); + var CernerUserSession = db.CheckCernerUserSession(cernerSessionId).SingleOrDefault(); + var NewLoginResult = AsyncToSyncTaskHelper.AsyncHelpers.RunSync(() => ADAM.CernerFHIR.Client.ResourceProcessor.GetCernerResourceRefreshToken(CernerUserSession.LoginResult)); + NewLoginResult.EndPointURL = NewLoginResult?.EndPointURL ?? CernerUserSession.LoginResult.EndPointURL; + if (NewLoginResult != null) + { + var UpdatedCernerUserSession = new CernerUserSessionInfo() + { + CernerCode = CernerUserSession.CernerCode, + FhirUserSessionId = cernerSessionId, + CernerInfoJWT = CernerUserSession.CernerInfoJWT, + LoginResult = NewLoginResult + }; + db.UpdateCernerFhirSessionInfo(UpdatedCernerUserSession); + } + + + //HttpResponseMessage response = null; + //return response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = null }; } // POST api/ @@ -71,6 +92,28 @@ namespace AIAHTML5.API.Controllers { } + [HttpGet] + [Route("UpdateToken")] + public HttpResponseMessage UpdateCernerToken(string sessionId) + { + //Update cerner user session values. + var cernerSessionId = sessionId;// jsonData["sessionId"].Value(); + var db = new DBModel(); + var CernerUserSession = db.CheckCernerUserSession(cernerSessionId).SingleOrDefault(); + var NewLoginResult = AsyncToSyncTaskHelper.AsyncHelpers.RunSync(() => ADAM.CernerFHIR.Client.ResourceProcessor.GetCernerResourceRefreshToken(CernerUserSession.LoginResult)); + NewLoginResult.EndPointURL = NewLoginResult.EndPointURL ?? CernerUserSession.LoginResult.EndPointURL; + var UpdatedCernerUserSession = new CernerUserSessionInfo() + { + CernerCode = CernerUserSession.CernerCode, + FhirUserSessionId = cernerSessionId, + CernerInfoJWT = CernerUserSession.CernerInfoJWT, + LoginResult = NewLoginResult + }; + db.UpdateCernerFhirSessionInfo(UpdatedCernerUserSession); + + HttpResponseMessage response = null; + return response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = null }; + } #region Cerner fhir resource call diff --git a/400-SOURCECODE/AIAHTML5.API/Controllers/CernerUserSessionController.cs b/400-SOURCECODE/AIAHTML5.API/Controllers/CernerUserSessionController.cs index 8d0ea82..a1ee7da 100644 --- a/400-SOURCECODE/AIAHTML5.API/Controllers/CernerUserSessionController.cs +++ b/400-SOURCECODE/AIAHTML5.API/Controllers/CernerUserSessionController.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; +using ADAM.CernerFHIR.Helper; using AIAHTML5.API.Models; using eLearningPlayer.model; using Newtonsoft.Json; @@ -51,5 +52,28 @@ namespace AIAHTML5.API.Controllers public void Delete(int id) { } + + [HttpGet] + [Route("UpdateCernerToken")] + public HttpResponseMessage UpdateCernerToken(string sessionId) + { + //Update cerner user session values. + var cernerSessionId = sessionId; + var db = new DBModel(); + var CernerUserSession = db.CheckCernerUserSession(cernerSessionId).SingleOrDefault(); + var NewLoginResult = AsyncToSyncTaskHelper.AsyncHelpers.RunSync(() => ADAM.CernerFHIR.Client.ResourceProcessor.GetCernerResourceRefreshToken(CernerUserSession.LoginResult)); + NewLoginResult.EndPointURL = NewLoginResult.EndPointURL ?? CernerUserSession.LoginResult.EndPointURL; + var UpdatedCernerUserSession = new CernerUserSessionInfo() + { + CernerCode = CernerUserSession.CernerCode, + FhirUserSessionId = cernerSessionId, + CernerInfoJWT = CernerUserSession.CernerInfoJWT, + LoginResult = NewLoginResult + }; + db.UpdateCernerFhirSessionInfo(UpdatedCernerUserSession); + + HttpResponseMessage response = null; + return response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = null }; + } } } \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs index fb59517..6311404 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs @@ -311,6 +311,44 @@ namespace AIAHTML5.API.Models return objUser; } + internal static BypassLogin ByPassLoginDetail(string loginId, string accountNumber) + { + BypassLogin objUser = null; + DBModel objModel = new DBModel(); + + SqlConnection conn = new SqlConnection(dbConnectionString); + SqlCommand cmd = new SqlCommand(); + SqlDataAdapter adapter; + DataSet ds = new DataSet(); + + cmd.Connection = conn; + cmd.CommandText = DBConstants.GET_USER_DETAIL_BYLOGIN_AND_ACCOUNT; + cmd.CommandType = CommandType.StoredProcedure; + cmd.Parameters.AddWithValue("@LoginId", loginId); + cmd.Parameters.AddWithValue("@AccountNumber", accountNumber); + + adapter = new SqlDataAdapter(cmd); + adapter.Fill(ds); + + if (ds != null && ds.Tables.Count > 0) + { + DataTable dt = ds.Tables[0]; + + if (dt.Rows.Count > 0) + { + foreach (DataRow dr in dt.Rows) + { + objUser = new BypassLogin(); + objUser.LoginId = dr["LoginId"].ToString(); + objUser.Password = dr["Password"].ToString(); + + } + } + } + + return objUser; + } + internal User GetSelectedSettings(int userId) { logger.Debug(" Inside GetSelectedSettings for userId = " + userId); @@ -1334,7 +1372,7 @@ namespace AIAHTML5.API.Models internal int SaveCernerFhirSessionInfo(CernerUserSessionInfo info) { - //if (CheckCernerUserSession(info.FhirUserSessionId).FhirUserSessionId != "") return 0; + if (CheckCernerUserSession(info.FhirUserSessionId).Count > 0) return UpdateCernerFhirSessionInfo(info); logger.Debug($" inside SaveCernerFhirSessionInfo for PatientId = { info.CernerInfoJWT.PatientId }"); @@ -1352,6 +1390,7 @@ namespace AIAHTML5.API.Models cmd.Parameters.AddWithValue("@Created", DateTime.Now); cmd.Parameters.AddWithValue("@Expires", info.LoginResult.AccessTokenExpiration); cmd.Parameters.AddWithValue("@Timeout", 10); // Now default set to 10 , cerner provided. + cmd.Parameters.AddWithValue("@EndPointUrl", info.LoginResult.EndPointURL); cmd.Parameters.AddWithValue("@AccessToken", info.LoginResult.AccessToken); cmd.Parameters.AddWithValue("@RefreshToken", info.LoginResult.RefreshToken); cmd.Parameters.AddWithValue("@PatientId", info.CernerInfoJWT.PatientId); @@ -1373,11 +1412,51 @@ namespace AIAHTML5.API.Models return result; } - internal CernerUserSessionInfo CheckCernerUserSession(string sessionId) + internal int UpdateCernerFhirSessionInfo(CernerUserSessionInfo info) + { + logger.Debug($" inside UpdateCernerFhirSessionInfo for PatientId = { info.CernerInfoJWT.PatientId }"); + + int result = 0; + SqlConnection conn = null; + try + { + conn = new SqlConnection(dbConnectionString); + SqlCommand cmd = new SqlCommand(); + conn.Open(); + cmd.Connection = conn; + cmd.CommandText = DBConstants.UPDATE_CERNER_SESSION_INFO; + cmd.CommandType = CommandType.StoredProcedure; + cmd.Parameters.AddWithValue("@SessionId", info.FhirUserSessionId); + cmd.Parameters.AddWithValue("@Created", DateTime.Now); + cmd.Parameters.AddWithValue("@Expires", info.LoginResult.AccessTokenExpiration); + cmd.Parameters.AddWithValue("@Timeout", 10); // Now default set to 10 , cerner provided. + cmd.Parameters.AddWithValue("@EndPointUrl", info.LoginResult.EndPointURL); + cmd.Parameters.AddWithValue("@AccessToken", info.LoginResult.AccessToken); + cmd.Parameters.AddWithValue("@RefreshToken", info.LoginResult.RefreshToken); + cmd.Parameters.AddWithValue("@PatientId", info.CernerInfoJWT.PatientId); + cmd.Parameters.AddWithValue("@Encounter", info.CernerInfoJWT.Encounter); + cmd.Parameters.AddWithValue("@Code", info.CernerCode); + + result = cmd.ExecuteNonQuery(); + } + catch (SqlException ex) + { + logger.Fatal($" Exception in SaveCernerFhirSessionInfo, Exception = {ex.Message }, STACKTRACE= {ex.StackTrace}"); + throw; + } + finally + { + conn.Dispose(); + } + + return result; + } + + internal List CheckCernerUserSession(string sessionId) { logger.Debug($" inside CheckCernerUserSession for sessionId = { sessionId }"); - CernerUserSessionInfo cernerUserSessionInfo = null; + List cernerUserSessionInfo = new List(); SqlConnection conn = null; DataTable dt = null; @@ -1398,7 +1477,7 @@ namespace AIAHTML5.API.Models if (dt != null && dt.Rows.Count > 0) { - cernerUserSessionInfo = new CernerUserSessionInfo() + cernerUserSessionInfo.Add(new CernerUserSessionInfo() { CernerCode = dt.Rows[0]["code"].ToString(), FhirUserSessionId = dt.Rows[0]["SessionId"].ToString(), @@ -1413,11 +1492,8 @@ namespace AIAHTML5.API.Models PatientId = dt.Rows[0]["PatientId"].ToString(), Encounter = dt.Rows[0]["Encounter"].ToString(), } - }; + }); } - else - cernerUserSessionInfo = new CernerUserSessionInfo(); - } catch (Exception ex) { @@ -1469,6 +1545,7 @@ namespace AIAHTML5.API.Models cernerUserSessionInfo.FhirUserSessionId = dr["SessionId"].ToString(); cernerUserSessionInfo.LoginResult = new ADAM.CernerFHIR.Helper.LoginResult() { + EndPointURL = dr["EndPointURL"].ToString(), AccessToken = dr["AccessToken"].ToString(), RefreshToken = dr["RefreshToken"].ToString() }; @@ -1587,6 +1664,6 @@ namespace AIAHTML5.API.Models conn.Dispose(); } } - + } } \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.API/Models/User.cs b/400-SOURCECODE/AIAHTML5.API/Models/User.cs index c6ba4ab..8b934c9 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/User.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/User.cs @@ -160,4 +160,11 @@ namespace AIAHTML5.API.Models } + public class BypassLogin + { + public string LoginId { get; set; } + public string Password { get; set; } + + } + } \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs index 766baa2..085aa1d 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs @@ -307,6 +307,13 @@ namespace AIAHTML5.API.Models return result; } + internal static BypassLogin ByPassLoginDetail(string loginId, string accountNumber) + { + BypassLogin objUser = null; + objUser = DBModel.ByPassLoginDetail(loginId, accountNumber); + + return objUser; + } internal static int SaveUserSelectedSettings(User selectedSettings) { diff --git a/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj b/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj index 210cdcb..a157d9c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj +++ b/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj @@ -52378,6 +52378,7 @@ + 10.0 diff --git a/400-SOURCECODE/AIAHTML5.Web/Web.config b/400-SOURCECODE/AIAHTML5.Web/Web.config index cd6a804..22195b1 100644 --- a/400-SOURCECODE/AIAHTML5.Web/Web.config +++ b/400-SOURCECODE/AIAHTML5.Web/Web.config @@ -11,7 +11,7 @@ - + diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js index 9d5ad30..f3d50ab 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js @@ -323,19 +323,20 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var imagePath = "~/../content/images/ca/thumbnails/" + value._ThumbnailImage; - var $el = $('
' - + '
' + var $el = $('').appendTo('#grid-view'); + + '

'+'('+ value._id+')

' + value._Title + '

').appendTo('#grid-view'); $compile($el)($scope); - + $(".sidebar").mCustomScrollbar({ autoHideScrollbar: true, //theme:"rounded" }); - }); + }); + $('#' + $rootScope.getLocalStorageValue("currentBodyViewId")).find('.thumbnail').addClass('HightLightThumbnail'); $timeout(function () { if ($rootScope.getLocalStorageValue('CAGridViewScroll') !== null && $location.url() == "/clinical-animations") { @@ -346,7 +347,22 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout 200); - $timeout(function () { $scope.EnableUI(); }, 400); + $timeout(function () { $scope.EnableUI(); + //open default animation + if($rootScope.siteUrlInfo.mtype!=null && $rootScope.siteUrlInfo.id!=null) + { + if($rootScope.siteUrlInfo.mtype.toLowerCase()=='ca' && $rootScope.siteUrlInfo.id!="") + { + $('#'+$rootScope.siteUrlInfo.id).trigger('click'); + //$('div[title="'+$rootScope.siteUrlInfo.title+'"]').trigger('click'); + } + + // clear detail + $rootScope.siteUrlInfo.mtype=null; + $rootScope.siteUrlInfo.id=null; + } + + }, 400); } @@ -536,9 +552,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.imagePath = "~/../content/images/ca/thumbnails/" + value._ThumbnailImage; var $el = $('
' - + '').appendTo('#grid-view'); + + '

'+'('+ value._id+')

' + value._Title + '

').appendTo('#grid-view'); $compile($el)($scope); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js index b66936a..64b1fd9 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js @@ -2878,7 +2878,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ for (var i = 0; i < $rootScope.DaWindowData.length; i++) { $scope.updatedWindowListForSaveCB.push({ - bodySystemTermList: $rootScope.DaWindowData[i].BodySystemData, + // bodySystemTermList: $rootScope.DaWindowData[i].BodySystemData, isTitleBarVisible: false, //BodySystemData.isTitleBarVisible,//N highlightOptionsSelectedId: 0, selectedStructureID: 0,//N diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 55a17b8..5e2d3cf 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -135,8 +135,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l 'minimised': false, 'maximised': false, 'id': 0, - 'moduleName': '', - 'mode': '', + 'moduleName': 'DISSECTIBLE_ANATOMY', + 'mode': 'NORMAL', 'isCBAnnotationActive':false, 'annotationData':{shapeStates:[],paintCanvasState:[]}, 'transparencyBounds': [], @@ -195,7 +195,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } } - $rootScope.SetwindowStoreData=function(windowviewid,keyname,value) + $scope.SetwindowStoreData=function(windowviewid,keyname,value) { for(var x=0 ;x < $rootScope.DaWindowData.length;x++){ @@ -389,7 +389,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var imagePath = "~/../content/images/DA/" + zoomValue + "/body-views/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage; - var $el = $('
' + var $el = $('').appendTo('#bodyViewList'); @@ -455,6 +455,30 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#CBDetailPageDiv').css('pointer-events', 'auto'); $('#CBDetailPageDiv').css('opacity', '1'); } + //fixing for mac os now + $scope.getOS = function () { + var userAgent = window.navigator.userAgent, + platform = window.navigator.platform, + macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'], + windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'], + iosPlatforms = ['iPhone', 'iPad', 'iPod'], + os = null; + + if (macosPlatforms.indexOf(platform) !== -1) { + os = 'MacOS'; + } else if (iosPlatforms.indexOf(platform) !== -1) { + os = 'iOS'; + } else if (windowsPlatforms.indexOf(platform) !== -1) { + os = 'Windows'; + } else if (/Android/.test(userAgent)) { + os = 'Android'; + } else if (!os && /Linux/.test(platform)) { + os = 'Linux'; + } + + return os; + } + $scope.openView = function ($event) { // open module bu openresource @@ -521,94 +545,129 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //load json data for body view $scope.loadDissectibleAnatomyData = function () { - // clear data set by curriculum builder - $rootScope.isCallFromOtherModule = undefined; - - $rootScope.MULTI_VIEW_ID += 1 - - var windowviewid = $rootScope.MULTI_VIEW_ID; - - if ($rootScope.refreshcheck == null) { - $location.path('/'); - } - $scope.ScopeVariablesDeclare(); - - // store exist module in module service + if($rootScope.cernerIntegrationActive) + { + $rootScope.isCallFromOtherModule = true; + // store exist module in module service var ExistData = ModuleService.getModuleData("DISSECTIBLE_ANATOMY"); if (ExistData != undefined && ExistData.length > 0) { // clear all module data before open new module in cb ModuleService.ClearWinDataByModule(ExistData.mType); } - var newWindowData = { - "mType": 'DISSECTIBLE_ANATOMY', - }; + var newWindowData = JSON.parse(sessionStorage.getItem("DAWindowObjectCerner")); + ModuleService.setModuleData(newWindowData, 0); + // close/remove prev panel when in minimised mode + + if($rootScope.DaWindowData!=undefined) + { + if($rootScope.DaWindowData.length>0) + { + for(var x=0 ;x < $rootScope.DaWindowData.length;x++){ + var winid=$rootScope.DaWindowData[x].multiwinid; + if ($('#daImagePanel_' + winid).html() != undefined) { + $('#daImagePanel_' + winid).remove(); + } + } + $rootScope.DaWindowData=[]; + } + } + $rootScope.ClearIframe(); + sessionStorage.removeItem('DAWindowObjectCerner'); + $location.url('/da-body-view'); + } + else + { - // close/remove prev panel when in minimised mode - - if($rootScope.DaWindowData!=undefined) - { - if($rootScope.DaWindowData.length>0) - { - for(var x=0 ;x < $rootScope.DaWindowData.length;x++){ - var winid=$rootScope.DaWindowData[x].multiwinid; - if ($('#daImagePanel_' + winid).html() != undefined) { - $('#daImagePanel_' + winid).remove(); - } - } - $rootScope.DaWindowData=[]; - } + // clear data set by curriculum builder + $rootScope.isCallFromOtherModule = undefined; + + $rootScope.MULTI_VIEW_ID += 1 + + var windowviewid = $rootScope.MULTI_VIEW_ID; + + if ($rootScope.refreshcheck == null) { + $location.path('/'); } + $scope.ScopeVariablesDeclare(); - $scope.initializeDAWindowData(windowviewid, true, undefined); + // store exist module in module service + var ExistData = ModuleService.getModuleData("DISSECTIBLE_ANATOMY"); - //get current path - var currentURL = $location.path(); - var selectedModuleName = ''; - angular.forEach($rootScope.userModules, function (value, key) { - if (value.slug === currentURL.replace('/', '')) { - selectedModuleName = value.name; - $rootScope.currentActiveModuleTitle = selectedModuleName; + if (ExistData != undefined && ExistData.length > 0) { + // clear all module data before open new module in cb + ModuleService.ClearWinDataByModule(ExistData.mType); } - }) + var newWindowData = { + "mType": 'DISSECTIBLE_ANATOMY', + }; + ModuleService.setModuleData(newWindowData, 0); + + // close/remove prev panel when in minimised mode + + if($rootScope.DaWindowData!=undefined) + { + if($rootScope.DaWindowData.length>0) + { + for(var x=0 ;x < $rootScope.DaWindowData.length;x++){ + var winid=$rootScope.DaWindowData[x].multiwinid; + if ($('#daImagePanel_' + winid).html() != undefined) { + $('#daImagePanel_' + winid).remove(); + } + } + $rootScope.DaWindowData=[]; + } + } + $scope.initializeDAWindowData(windowviewid, true, undefined); - $rootScope.ClearIframe(); + //get current path + var currentURL = $location.path(); + var selectedModuleName = ''; + angular.forEach($rootScope.userModules, function (value, key) { + if (value.slug === currentURL.replace('/', '')) { + selectedModuleName = value.name; + $rootScope.currentActiveModuleTitle = selectedModuleName; + } + }) - //load common data - var commondataJsonPath = '~/../content/data/json/da/da_dat_common.json'; - DataService.getAnotherJson(commondataJsonPath) - .then( - function (result) { + $rootScope.ClearIframe(); - $rootScope.CommonData = result; - $http({ method: 'GET', url: '~/../content/data/json/da/da_dat_contentlist.json' }).success(function (data) { + //load common data + var commondataJsonPath = '~/../content/data/json/da/da_dat_common.json'; - $rootScope.BodyViewData = data; - $scope.getDAViewList(); + DataService.getAnotherJson(commondataJsonPath) + .then( + function (result) { - }) - .error(function (data, status, headers, config) { - console.log(data); - }); + $rootScope.CommonData = result; + $http({ method: 'GET', url: '~/../content/data/json/da/da_dat_contentlist.json' }).success(function (data) { + $rootScope.BodyViewData = data; + $scope.getDAViewList(); - }, - function (error) { - console.log(error.statusText) - } - ) + }) + .error(function (data, status, headers, config) { + console.log(data); + }); - // $('#daLoaderLabel').css('visibility', 'hidden') - $rootScope.isLoading = false; + }, + function (error) { + console.log(error.statusText) + } + ) + + // $('#daLoaderLabel').css('visibility', 'hidden') + $rootScope.isLoading = false; - //push the details of open module in array $rootScope.openModules - $rootScope.openModules.push({ "ModuleId": 1 }); + //push the details of open module in array $rootScope.openModules + $rootScope.openModules.push({ "ModuleId": 1 }); + } } @@ -763,12 +822,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $rootScope.BodyViewData = data; - $scope.loadBodyView(windowviewid); + $scope.loadTermData(windowviewid); }) }) } else { - $scope.loadBodyView(windowviewid); + $scope.loadTermData(windowviewid); } } @@ -783,12 +842,40 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.viewID = 'daViewDA' + '_' + windowviewid; $scope.SetwindowStoreData(windowviewid, 'parentSlugName', 'da-view-list'); - $scope.loadBodyView(windowviewid); + $scope.loadTermData(windowviewid); } } - $rootScope.loadBodyView = function (windowviewid) { + $scope.loadTermData = function (windowviewid) { + var bodyViewId=$scope.GetwindowStoreData(windowviewid,'voId'); + // set gender + $scope.setGenderNameById(bodyViewId,windowviewid); + $rootScope.daloadSearchData(windowviewid); + //call time interval function until load Illustration data + var timeintval = null; + timeintval = $interval(function () { + var vocabTermDataArray = $scope.GetwindowStoreData(windowviewid, 'vocabTermDataArray'); + if (vocabTermDataArray!=null) { + $scope.stopVocab(); + $scope.loadBodyView(windowviewid); + } + else + { + console.log("waiting for search term Data"); + } + }, 100); + + $scope.stopVocab = function () { + if (angular.isDefined(timeintval)) { + $interval.cancel(timeintval); + timeintval = undefined; + } + }; + }, + + + $scope.loadBodyView = function (windowviewid) { if (document.getElementById('daBodyview') != null) { document.getElementById('daBodyview').style.pointerEvents = "none"; @@ -828,31 +915,39 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $rootScope.isVisibleLogin = false; console.log('currentBodyViewId picked from localStorage: ' + bodyViewId); - - // set gender - $scope.setGenderNameById(bodyViewId,windowviewid); + var currentViewTitle = $scope.GetwindowStoreData(windowviewid,'currentViewTitle'); console.log('current view title: ' + currentViewTitle); // store image title for export image $rootScope.StoreTitleName(currentViewTitle); - $rootScope.daloadSearchData(windowviewid); - + if ($rootScope.isCallFromOtherModule) { - // open JS panel for curriculum with define cornonate in CB jason - $rootScope.jsPanelWidth = $scope.daOpenInOtherModules.size.width;//1000; - $rootScope.jsPanelHeight = $scope.daOpenInOtherModules.size.height; - if($scope.daOpenInOtherModules.size.height<450) - $rootScope.jsPanelHeight = 450; - - $rootScope.jsPanelLeft = 320; - - $rootScope.jsPanelTop = $rootScope.cBModulejsPanelTop(); - if($location.url()!= "/curriculum-builder-detail") { + if($rootScope.cernerIntegrationActive) + { + $rootScope.jsPanelWidth = $(window).outerWidth() - 20; + $rootScope.jsPanelHeight = $(window).outerHeight() - 110; $rootScope.jsPanelLeft = 1; + $rootScope.jsPanelTop = 70; + $rootScope.cernerIntegrationActive=false; } + else + { + // open JS panel for curriculum with define cornonate in CB jason + $rootScope.jsPanelWidth = $scope.daOpenInOtherModules.size.width;//1000; + $rootScope.jsPanelHeight = $scope.daOpenInOtherModules.size.height; + if($scope.daOpenInOtherModules.size.height<450) + $rootScope.jsPanelHeight = 450; + + $rootScope.jsPanelLeft = 320; + $rootScope.jsPanelTop = $rootScope.cBModulejsPanelTop(); + if($location.url()!= "/curriculum-builder-detail") { + $rootScope.jsPanelLeft = 1; + } + } + } else { $rootScope.jsPanelWidth = $(window).outerWidth() - 20; @@ -993,7 +1088,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // 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. $scope.loadView = function (windowviewid) { - + $scope.DisableUI(); var bodyViewId=$scope.GetwindowStoreData(windowviewid,'voId'); if (document.getElementById('daViewDA_'+windowviewid) != null) { $scope.loadDAView(bodyViewId, windowviewid); @@ -1139,15 +1234,15 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l la =$scope.GetwindowStoreData(windviewid,'totalLayers'); var slideVal = la - ui.value; $("#txtLayerNumberDA_" + windviewid).val(slideVal); - + if ($scope.GetwindowStoreData(windviewid, 'isTransparent')) { + $scope.SetwindowStoreData(windowviewid, 'layerNumberTransparency', slideVal); + } $scope.SetwindowStoreData(windviewid,'layerNumber',slideVal); scope.LayerChange(windviewid); $("#annotationpaintbrushsize").removeClass("activebtncolor"); $("#annotationpainteraser").removeClass("activebtncolor"); - if ($scope.GetwindowStoreData(windviewid, 'isTransparent')) { - $scope.SetwindowStoreData(windowviewid, 'layerNumberTransparency', slideVal); - } + }); }, @@ -1453,6 +1548,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l console.log('callback searchWorker , time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); $scope.SetwindowStoreData(windowviewid,'TermNumberData',e.data.TermNumberData); + // store image for export + $scope.LoadImageToExport(windowviewid); console.log("$rootScope.TermNumberData = " + e.data.TermNumberData.TermData.Term.length); @@ -1504,14 +1601,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } console.log('JlinqActivity , time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); - + $scope.EnableUI(); } } - // store image for export - $scope.LoadImageToExport(windowviewid); + } @@ -1804,8 +1900,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $("#btnNormalMode_" + windowviewid).removeClass("btn-primary"); } } - - $scope.setLayerNumberAndHighlightByTermListforCB(windowviewid); + $scope.setLayerNumberAndHighlightByTermListforCB(windowviewid); } @@ -2019,6 +2114,20 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#zoomValueDA_' + windowviewid).attr('value', $scope.GetwindowStoreData(windowviewid,'zoomInOut')); + var lastlayer=$scope.GetwindowStoreData(windowviewid,'layerNumber'); + + if ($scope.GetwindowStoreData(windowviewid, 'isTransparent')) { + lastlayer = $scope.GetwindowStoreData(windowviewid, 'layerNumberBeforeTBDraw'); + $scope.SetwindowStoreData(windowviewid, 'layerNumber', lastlayer); + } + else + { + var totalayer=$scope.GetwindowStoreData(windowviewid,'totalLayers'); + var sliderVal = parseInt(totalayer) - parseInt(lastlayer); + $('#txtLayerNumberDA_' + windowviewid).val(lastlayer); + $("#layerChangeSliderDA_" + windowviewid).slider("option", "value", sliderVal); + } + if (bodyRegionCoordinates != null || bodyRegionCoordinates != undefined) { angular.forEach(bodyRegionCoordinates, function (value, key) { @@ -2157,20 +2266,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var src = "content/images/DA/" + zoomValue + "/body-views/" + bodyVid + "/layers/0/" + value._BodyRegionId + "/" + $scope.figLaefImageName; $scope.DrawImage(rectangle.scaledHeight, rectangle.scaledWidth, rectangle.scaledX, rectangle.scaledY, src, 'modestyImg' + value._BodyRegionId, 'N', windowviewid) - var lastlayer=$scope.GetwindowStoreData(windowviewid,'layerNumber'); - - if ($scope.GetwindowStoreData(windowviewid, 'isTransparent')) { - lastlayer = $scope.GetwindowStoreData(windowviewid, 'layerNumberBeforeTBDraw'); - $scope.SetwindowStoreData(windowviewid, 'layerNumber', lastlayer); - } - else - { - var totalayer=$scope.GetwindowStoreData(windowviewid,'totalLayers'); - var sliderVal = parseInt(totalayer) - parseInt(lastlayer); - $('#txtLayerNumberDA_' + windowviewid).val(lastlayer); - $("#layerChangeSliderDA_" + windowviewid).slider("option", "value", sliderVal); - } - + if ((parseInt(dtlOfSktn[0]._lns) <= parseInt(lastlayer)) && (parseInt(dtlOfSktn[0]._lne) > parseInt(lastlayer)) && (dtlOfSktn[0]._isfr == 'Y')) { $rootScope.isLayerLessSeven = true; // using at home var ModestyValue=$scope.GetwindowStoreData(windowviewid,'ModestyValue'); @@ -2497,7 +2593,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.isLayerChange = false; } - if (evt.ctrlKey) { + //birendra + // for mac os Command key use for multi selection + if (evt.ctrlKey || evt.metaKey) { $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',true); } else @@ -2530,8 +2628,19 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid); - var verticalScrollPosition = canvasDiv.scrollTop; - var horizontlScrollPosition = canvasDiv.scrollLeft; + + //changing for mac os now + var os=$scope.getOS(); + if(os=='MacOS') + { + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-2; + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-2; + } + else + { + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-1; + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-1; + } var distanceXOnMirrorImage = (parseInt(mirrorCanvasX) + parseInt(mirrorCanvasWidth)) - (parseInt(mousePos.x) + horizontlScrollPosition);// - 135); @@ -3014,8 +3123,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if ($scope.isLayerChange == true) { $scope.isLayerChange = false; } - - if (evt.ctrlKey) { + //birendra + // for mac os Command key use for multi selection + if (evt.ctrlKey || evt.metaKey) { $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',true); console.log('CTRL ON') @@ -3057,14 +3167,25 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // alert(mousePos.x + ',' + mousePos.y); var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid); - var verticalScrollPosition = canvasDiv.scrollTop; - var horizontlScrollPosition = canvasDiv.scrollLeft; - - + //changing for mac os now + var os=$scope.getOS(); + if(os=='MacOS') + { + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-2; + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-2; + } + else + { + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-1; + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-1; + } + //We substracted 135, as the difference between flex and html coordinates for same organ is 135 - var actulalX = mousePos.x + horizontlScrollPosition; - var actualY = mousePos.y + verticalScrollPosition; - var RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y); + + var actulalX = mousePos.x + horizontlScrollPosition; + var actualY = mousePos.y + verticalScrollPosition; + + var RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y); //Modesty ON @@ -4961,7 +5082,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // we decide the size of speech bubble //2. - if (event.ctrlKey || event == "CBAnnotation") { + if (event.ctrlKey || event.metaKey || event == "CBAnnotation") { console.log('ctrl pressed'); $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',true); //2.1 create unique speech bubbles @@ -5001,7 +5122,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l for (var m = 0; m <= $scope.speechbubbleList.length - 1; m++) { if ( $scope.speechbubbleList[m].ids == sub_id1) { - $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); + $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); break; } } @@ -5090,7 +5211,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var verticalScrollPosition = canvasDiv.scrollTop; var horizontlScrollPosition = canvasDiv.scrollLeft; - $scope.angle(x-2, y, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, true,windid); + $scope.angle(x, y, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, true,windid); }, //Update Annotation Cordianate in case of show single Annotation stop: function (evt) { @@ -5141,7 +5262,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l else { $scope.longest_annotationT1 = $scope.annotationTextArrayT1.reduce(function (a, b) { return a.length > b.length ? a : b; }); $scope.longest_annotationT2 = $scope.annotationTextArrayT2.reduce(function (a, b) { return a.length > b.length ? a : b; }); - if (event.ctrlKey || event == "CBAnnotation") { + if (event.ctrlKey || event.metaKey || event == "CBAnnotation") { $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', true); @@ -5173,7 +5294,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if ( $scope.speechbubbleList != null || $scope.speechbubbleList != undefined) { for (var m = 0; m <= $scope.speechbubbleList.length - 1; m++) { if ( $scope.speechbubbleList[m].ids == sub_id1_anno) { - $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); + $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); break; } } @@ -5270,7 +5391,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var canvasDiv = document.getElementById('canvasDivDA_' + windid); var verticalScrollPosition = canvasDiv.scrollTop; var horizontlScrollPosition = canvasDiv.scrollLeft; - $scope.angle(x-2, y, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, false,windid); + $scope.angle(x, y, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, false,windid); }, //Update Annotation Cordianate in case of show single Annotation @@ -5434,13 +5555,29 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.createSpeechBubbleBasedOnAnnotationLength = function (pointClicked, x, y, id, tipx, tipy,windowviewid,speechBubbleCounter) { var isHighlightBodyWithCBTermData=$scope.GetwindowStoreData(windowviewid,'isHighlightBodyWithCBTermData'); - if (isHighlightBodyWithCBTermData == true) { - - var sppechBubbleHTML = "
"; - } - else { - var sppechBubbleHTML = "
"; - } + var os=$scope.getOS(); + if(os=='MacOS') + { + if (isHighlightBodyWithCBTermData == true) { + var sppechBubbleHTML = "
"; + } + else + { + var sppechBubbleHTML = "
"; + } + } + else + { + if (isHighlightBodyWithCBTermData == true) { + var sppechBubbleHTML = "
"; + } + else + { + var sppechBubbleHTML = "
"; + } + } + + //Issue #7286 :Undefined annotation should not appear for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { @@ -5522,22 +5659,51 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } var Globe = []; Globe.push({ currentX: x, currentY: y }); - document.getElementById('dot_'+windowviewid).style.display = 'block'; - document.getElementById('dot_'+windowviewid).style.left = ((Globe[0].currentX) - 6) + 'px'; - document.getElementById('dot_'+windowviewid).style.top = ((Globe[0].currentY) + 10) + 'px'; + + //changing for mac os now + var os=$scope.getOS(); + if(os=='MacOS') + { + document.getElementById('dot_'+windowviewid).style.display = 'block'; + document.getElementById('dot_'+windowviewid).style.left = ((Globe[0].currentX) - 4) + 'px'; + document.getElementById('dot_'+windowviewid).style.top = ((Globe[0].currentY) + 10.5) + 'px'; document.getElementById('bord_'+windowviewid).style.display = 'block'; - document.getElementById('bord_'+windowviewid).style.left = ((Globe[0].currentX) - 2) + 'px'; + document.getElementById('bord_'+windowviewid).style.left = ((Globe[0].currentX) + 0.5) + 'px'; document.getElementById('bord_'+windowviewid).style.top = ((Globe[0].currentY) + 0) + 'px'; document.getElementById('sppeachBubble_' + windowviewid + '-' + termNumber).style.display = 'block'; - document.getElementById('sppeachBubble_' + windowviewid + '-' + termNumber).style.left = ((Globe[0].currentX) - 2) + 'px'; - document.getElementById('sppeachBubble_' + windowviewid + '-' + termNumber).style.top = (Globe[0].currentY) + 'px'; + document.getElementById('sppeachBubble_' + windowviewid + '-' + termNumber).style.left = ((Globe[0].currentX) - 1) + 'px'; + document.getElementById('sppeachBubble_' + windowviewid + '-' + termNumber).style.top = ((Globe[0].currentY)+0) + 'px'; + } + else + { + document.getElementById('dot_'+windowviewid).style.display = 'block'; + document.getElementById('dot_'+windowviewid).style.left = ((Globe[0].currentX) - 4) + 'px'; + document.getElementById('dot_'+windowviewid).style.top = ((Globe[0].currentY) + 11.5) + 'px'; + document.getElementById('bord_'+windowviewid).style.display = 'block'; + document.getElementById('bord_'+windowviewid).style.left = ((Globe[0].currentX) + 0.5) + 'px'; + document.getElementById('bord_'+windowviewid).style.top = ((Globe[0].currentY) + 1) + 'px'; + + document.getElementById('sppeachBubble_' + windowviewid + '-' + termNumber).style.display = 'block'; + document.getElementById('sppeachBubble_' + windowviewid + '-' + termNumber).style.left = ((Globe[0].currentX) - 1) + 'px'; + document.getElementById('sppeachBubble_' + windowviewid + '-' + termNumber).style.top = ((Globe[0].currentY)-1) + 'px'; + + } } $scope.createSpeechBubbleBasedOnTransparencyWithCtrl = function (pointClicked_annotation, Exists_annotation, x, y, sub_id_annotation, windowviewid, TPspeechBubbleCounter) { - var sppechBubbleHTML_annotation = "
"; - if ($scope.longest_annotationT1.length > $scope.longest_annotationT2.length) { + var os=$scope.getOS(); + if(os=='MacOS') + { + var sppechBubbleHTML_annotation = "
"; + } + else + { + var sppechBubbleHTML_annotation = "
"; + } + + if ($scope.longest_annotationT1.length > $scope.longest_annotationT2.length) { if (Exists_annotation == 0) { $('#canvasDivDA_' + windowviewid).append(sppechBubbleHTML_annotation); for (var l = 0; l <= $scope.annotationTextArrayT1.length - 1; l++) { @@ -5638,15 +5804,34 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } var Globe = []; Globe.push({ currentX: x, currentY: y }); - document.getElementById('dot_annotation_'+windowviewid).style.display = 'block'; - document.getElementById('dot_annotation_'+windowviewid).style.left = ((Globe[0].currentX) - 6) + 'px'; - document.getElementById('dot_annotation_'+windowviewid).style.top = ((Globe[0].currentY) + 10) + 'px'; - document.getElementById('bord_annotation_'+windowviewid).style.display = 'block'; - document.getElementById('bord_annotation_'+windowviewid).style.left = ((Globe[0].currentX) - 2) + 'px'; - document.getElementById('bord_annotation_'+windowviewid).style.top = ((Globe[0].currentY)) + 'px'; - document.getElementById('sppeachBubble_annotation_' + windowviewid + '-' + termNumber).style.display = 'block'; - document.getElementById('sppeachBubble_annotation_' + windowviewid + '-' + termNumber).style.left = (Globe[0].currentX-2) + 'px'; - document.getElementById('sppeachBubble_annotation_' + windowviewid + '-' + termNumber).style.top = (Globe[0].currentY) + 'px'; + //changing for mac os now + var os=$scope.getOS(); + if(os=='MacOS') + { + document.getElementById('dot_annotation_'+windowviewid).style.display = 'block'; + document.getElementById('dot_annotation_'+windowviewid).style.left = ((Globe[0].currentX) - 4) + 'px'; + document.getElementById('dot_annotation_'+windowviewid).style.top = ((Globe[0].currentY) + 10.5) + 'px'; + document.getElementById('bord_annotation_'+windowviewid).style.display = 'block'; + document.getElementById('bord_annotation_'+windowviewid).style.left = ((Globe[0].currentX) + 0.5) + 'px'; + document.getElementById('bord_annotation_'+windowviewid).style.top = ((Globe[0].currentY) + 0) + 'px'; + document.getElementById('sppeachBubble_annotation_' + windowviewid + '-' + termNumber).style.display = 'block'; + document.getElementById('sppeachBubble_annotation_' + windowviewid + '-' + termNumber).style.left = (Globe[0].currentX - 1) + 'px'; + document.getElementById('sppeachBubble_annotation_' + windowviewid + '-' + termNumber).style.top = ((Globe[0].currentY) + 0) + 'px'; + + } + else + { + document.getElementById('dot_annotation_'+windowviewid).style.display = 'block'; + document.getElementById('dot_annotation_'+windowviewid).style.left = ((Globe[0].currentX) - 4) + 'px'; + document.getElementById('dot_annotation_'+windowviewid).style.top = ((Globe[0].currentY) + 11.5) + 'px'; + document.getElementById('bord_annotation_'+windowviewid).style.display = 'block'; + document.getElementById('bord_annotation_'+windowviewid).style.left = ((Globe[0].currentX) + 0.5) + 'px'; + document.getElementById('bord_annotation_'+windowviewid).style.top = ((Globe[0].currentY) + 1) + 'px'; + document.getElementById('sppeachBubble_annotation_' + windowviewid + '-' + termNumber).style.display = 'block'; + document.getElementById('sppeachBubble_annotation_' + windowviewid + '-' + termNumber).style.left = (Globe[0].currentX - 1) + 'px'; + document.getElementById('sppeachBubble_annotation_' + windowviewid + '-' + termNumber).style.top = ((Globe[0].currentY) - 1) + 'px'; + } + } @@ -6139,11 +6324,14 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.transparencyCanvasHeight = transparencyCanvas.height; $scope.transparencyCanvasWidth = transparencyCanvas.width; + //bind click listener transparencyCanvas.addEventListener('click', TransparencyCanvasClickListener); $(".ui-wrapper").css("z-index", $scope.GetwindowStoreData(windowviewid, 'UIWrapperZIndex')); + $(".ui-wrapper").css("left",TransparencyBoxStartX-2+ 'px'); + } @@ -6434,7 +6622,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l transparencyCanvas.addEventListener('click', TransparencyCanvasClickListener); $(".ui-wrapper").css("z-index", $scope.GetwindowStoreData(windowviewid, 'UIWrapperZIndex')); - + $(".ui-wrapper").css("left",$scope.startX-2+ 'px'); } if ($scope.TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && $scope.TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) { @@ -6668,16 +6856,18 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var WidthforTransImage = TBImageDimensions.WidthforTransImageTB; var HeightforTransImage = TBImageDimensions.HeightforTransImageTB; var YforTransImage = TBImageDimensions.YforTransImageTB; - + var tranparencyLayer; //0. get current layer number if (isResized || isLayerChanged) { //do nothing $scope.SetwindowStoreData(windowviewid,'transNumber',100); $("#tbSlider_" + windowviewid).slider('value', 100); + if ($scope.GetwindowStoreData(windowviewid, "isTransparencyActivated") == true && $scope.GetwindowStoreData(windowviewid, "isTransparent") == true) { + tranparencyLayer = $scope.GetwindowStoreData(windowviewid, 'layerNumberTransparency'); + } } - else { - var tranparencyLayer; + else { if ($scope.GetwindowStoreData(windowviewid, "isTransparencyActivated") == true && (($scope.GetwindowStoreData(windowviewid, "isNormalBtnClicked") == true || $scope.GetwindowStoreData(windowviewid, "isHighlightlBtnClicked") == true)) ){ tranparencyLayer = parseInt($('#txtLayerNumberDA_' + windowviewid).val()); $scope.SetwindowStoreData(windowviewid, 'isNormalBtnClicked', false); @@ -6701,6 +6891,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid,'layerNumber',tranparencyLayer); $scope.SetwindowStoreData(windowviewid, 'layerNumberTransparency', tranparencyLayer); } + var totalayer=$scope.GetwindowStoreData(windowviewid,'totalLayers'); var sliderVal = parseInt(totalayer) - parseInt(tranparencyLayer); @@ -7485,7 +7676,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.NormalTermNumber = RGBColor; } - if (event.ctrlKey) { + if (event.ctrlKey || event.metaKey) { $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', true); } else { @@ -7627,8 +7818,18 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var mousePos = $scope.getMousePos(evt.pageX,evt.pageY,windowviewid); var canvasDiv = document.getElementById("canvasDivDA_" + windowviewid); - var verticalScrollPosition = canvasDiv.scrollTop; - var horizontlScrollPosition = canvasDiv.scrollLeft; + //changing for mac os now + var os=$scope.getOS(); + if(os=='MacOS') + { + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-2; + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-2; + } + else + { + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-1; + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-1; + } //We substracted 135, as the difference between flex and html coordinates for same organ is 135 @@ -7809,8 +8010,18 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var tCanvasTotalHeight = parseInt(tCanvasTopAftrSplit[0]) + parseInt(tCanvasHeightAftrSplit[0]); var mousePos = $scope.getMousePos(evt.pageX,evt.pageY,windowviewid); var canvasDiv = document.getElementById('canvasDivDA_'+windowviewid); - var verticalScrollPosition = canvasDiv.scrollTop; - var horizontlScrollPosition = canvasDiv.scrollLeft; + //changing for mac os now + var os=$scope.getOS(); + if(os=='MacOS') + { + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-2; + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-2; + } + else + { + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-1; + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-1; + } var actulalX = mousePos.x + horizontlScrollPosition; var actualY = mousePos.y + verticalScrollPosition; @@ -7889,8 +8100,18 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var windowviewid = (evt.target.id).split("_")[len-1]; var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid); - var verticalScrollPosition = canvasDiv.scrollTop; - var horizontlScrollPosition = canvasDiv.scrollLeft; + //changing for mac os now + var os=$scope.getOS(); + if(os=='MacOS') + { + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-2; + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-2; + } + else + { + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-1; + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-1; + } var distanceXOnMirrorImage = (parseInt(mirrorCanvasX) + parseInt(mirrorCanvasWidth)) - (parseInt(mousePos.x) + horizontlScrollPosition);// - 135); @@ -7928,7 +8149,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //Added Method to Save TransparencyBox TermNumbers for SaveCB $scope.saveTBoxTermNumberForSaveCB = function (evt, windowviewid) { - if (evt.ctrlKey) { + if (evt.ctrlKey || evt.metaKey) { $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', true); } else { @@ -7951,8 +8172,18 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', false); } var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid); - var verticalScrollPosition = canvasDiv.scrollTop; - var horizontlScrollPosition = canvasDiv.scrollLeft; + //changing for mac os now + var os=$scope.getOS(); + if(os=='MacOS') + { + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-2; + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-2; + } + else + { + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-1; + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-1; + } var CurriculumTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData'); CurriculumTermData.push({ "transparentTermNumber": parseInt($scope.TBoxTermNumber), @@ -8499,7 +8730,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid,'zoomInOut',25); $('#zoomValueDA_' + windowviewid).attr('value', $scope.GetwindowStoreData(windowviewid,'zoomInOut')); } - + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + var canDiv = document.getElementById('canvasDivDA_' + windowviewid); + var canDivChildCount = canDiv.childElementCount; + if (canDivChildCount > 0) { + canDiv.innerHTML = ''; + } var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId'); $scope.CalculateImageCordinates(viewOrientationId,windowviewid); @@ -11366,22 +11603,22 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } - $scope.SaveImageToFhirResource = function () { - CernerFhirService.SaveImageToFhirResource(); - }; + //$scope.SaveImageToFhirResource = function () { + // CernerFhirService.SaveImageToFhirResource(); + //}; - $scope.LoadingDA = function () { - var json = $rootScope.GetCookie("CernerInfo"); - if (json !== null && json !== "") { - var data = JSON.parse(json); - if (data.isCernerUser) { - alert("Loading DA..."); - //call API - } - } - }; + //$scope.LoadingDA = function () { + // var json = $rootScope.GetCookie("CernerInfo"); + // if (json !== null && json !== "") { + // var data = JSON.parse(json); + // if (data.isCernerUser) { + // alert("Loading DA..."); + // //call API + // } + // } + //}; - $scope.LoadingDA(); + //$scope.LoadingDA(); }]) function OnGenderChange(event) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index b1e85f7..1b3a501 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -89,17 +89,6 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l licenseeAccountNumber: null }; - $rootScope.siteUrlInfo = { - siteIP: null, - remoteIPAddress: null, - status: null, - accountNumber: null, - edition: null, - urlReferer: null, - calsCreds: null, - userId: null, - password: null - } $rootScope.userData; $rootScope.userModules; $rootScope.passwordMismatchMessage; @@ -617,7 +606,11 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l } $scope.helpTopicLink = function () { - $rootScope.homeURL = $location.absUrl(); + var x = $location.absUrl(); + var pos = x.lastIndexOf($location.url()); + + $rootScope.homeURL =x.substring(0,pos+1); + var hTopicUrl = $rootScope.homeURL + "content/help/index.html"; var aboutADAM = $rootScope.homeURL + "content/help/about/Adam_Credits_AIA5.html"; @@ -647,10 +640,27 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l //some time value not remove then reload sessionStorage.removeItem('isModuleOpenByOpenResource'); sessionStorage.removeItem('ExitsCBFileDetail'); - $('#login').css('visibility', 'visible'); + $('#login').css('visibility', 'visible'); + $scope.CheckCernerUser(); + $scope.DocumentId = (new URL(location.href)).searchParams.get('documentId'); + $rootScope.checkRefreshButtonClick = 1; - $scope.CheckCernerLaunch(); + + $rootScope.siteUrlInfo = { + siteIP: null, + remoteIPAddress: null, + status: null, + accountNumber: null, + edition: null, + urlReferer: null, + calsCreds: null, + userId: null, + password: null, + mtype:null, + id:null + } + if (params != null && params != undefined && params != "") { $scope.ValidateClientSiteUrl(); @@ -914,6 +924,13 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l $location.path('/'); + + $timeout(function () { + + //currently open CA + $scope.RedirectToModule(); + + }, 100); } else @@ -1009,6 +1026,11 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l } else { $location.path('/'); + $timeout(function () { + //currently open CA + $scope.RedirectToModule(); + + }, 100); } } else { @@ -1048,11 +1070,35 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l } + $scope.RedirectToModule = function () { + + if($rootScope.siteUrlInfo.mtype!=null) + { + if($rootScope.siteUrlInfo.mtype.toLowerCase()=='ca') + $('#clinical-animations').trigger('click'); + } + + if ($scope.DocumentId !== null && $scope.DocumentId !== "") { + // Call API with DocumentId + CernerFhirService.GetJsonImageAIA($scope.DocumentId).then(function (result) { + console.log(result); + var WindowImageJson = jQuery.parseJSON(result.JsonData); + sessionStorage.setItem("DAWindowObjectCerner",JSON.stringify(WindowImageJson) ); + $rootScope.cernerIntegrationActive=true; + $scope.DocumentId = ""; + // Load DA module. + $timeout(function () { $('#da-view-list').trigger('click'); }, 200); + + }, function (error) { + console.log(' Error in opening DA module for Cerner = ' + error.statusText); + }); + } + } $scope.ValidateClientSiteUrl = function () { - + $rootScope.isCallFromSite = true; - + var siteInfo = params.split('&'); for (var i = 0; i < siteInfo.length; i++) { @@ -1063,27 +1109,48 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l if (isCalsCredantialForSIte == "True") { var paramInfo = siteInfo[i].split('='); - if (paramInfo[0] == 'calsCredantial') { - - $rootScope.siteUrlInfo.calsCreds = paramInfo[1]; - console.log("$rootScope.siteUrlInfo.calsCreds" + $rootScope.siteUrlInfo.calsCreds); + //added by birendra direct open CA module + if(paramInfo[0].toLowerCase() == 'mtype') + { + $rootScope.siteUrlInfo.mtype = paramInfo[1]; + console.log("$rootScope.siteUrlInfo.mtype" + $rootScope.siteUrlInfo.mtype); } - else if (paramInfo[0] == 'username') { - - $rootScope.siteUrlInfo.username = paramInfo[1]; - console.log("$rootScope.siteUrlInfo.username" + $rootScope.siteUrlInfo.username); + else if (paramInfo[0].toLowerCase() == 'id') { + + $rootScope.siteUrlInfo.id = paramInfo[1]; + console.log("$rootScope.siteUrlInfo.id" + $rootScope.siteUrlInfo.id); } - else if (paramInfo[0] == 'password') { - - $rootScope.siteUrlInfo.password = paramInfo[1]; - console.log("$rootScope.siteUrlInfo.password " + $rootScope.siteUrlInfo.password); + else if (paramInfo[0].toLowerCase() == 'username') { + + $rootScope.siteUrlInfo.userId = paramInfo[1]; + console.log("$rootScope.siteUrlInfo.username" + $rootScope.siteUrlInfo.userId); } + else if (paramInfo[0].toLowerCase() == 'accountnumber') { + + $rootScope.siteUrlInfo.accountNumber = paramInfo[1]; + console.log("$rootScope.siteUrlInfo.accountNumber" + $rootScope.siteUrlInfo.accountNumber); + } + + + // if (paramInfo[0] == 'calsCredantial') { - $rootScope.userInfo.username = $rootScope.siteUrlInfo.username; - $rootScope.userInfo.password = $rootScope.siteUrlInfo.password; - console.log("$rootScope.userInfo.username" + $rootScope.userInfo.username + " $rootScope.userInfo.password" + $rootScope.userInfo.password); - - + // $rootScope.siteUrlInfo.calsCreds = paramInfo[1]; + // console.log("$rootScope.siteUrlInfo.calsCreds" + $rootScope.siteUrlInfo.calsCreds); + // } + // else if (paramInfo[0] == 'username') { + + // $rootScope.siteUrlInfo.username = paramInfo[1]; + // console.log("$rootScope.siteUrlInfo.username" + $rootScope.siteUrlInfo.username); + // } + // else if (paramInfo[0] == 'password') { + + // $rootScope.siteUrlInfo.password = paramInfo[1]; + // console.log("$rootScope.siteUrlInfo.password " + $rootScope.siteUrlInfo.password); + // } + + //$rootScope.userInfo.username = $rootScope.siteUrlInfo.userId; + //$rootScope.userInfo.password = $rootScope.siteUrlInfo.password; + } else { var paramInfo = siteInfo[i].split('='); @@ -1105,7 +1172,7 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l else if (paramInfo[0] == 'urlReferer') { $rootScope.siteUrlInfo.urlReferer = paramInfo[1]; - console.log("$rootScope.siteUrlInfo.siteIP" + $rootScope.siteUrlInfo.siteIP); + console.log("$rootScope.siteUrlInfo.urlReferer" + $rootScope.siteUrlInfo.urlReferer); } else if (paramInfo[0] == 'remoteIPAddress') { @@ -1117,11 +1184,36 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l } } if (isCalsCredantialForSIte == "True") { - $rootScope.AuthenticateUser($rootScope.userInfo); + if($rootScope.siteUrlInfo.mtype!=null && $rootScope.siteUrlInfo.mtype.toLowerCase()=='ca' && $rootScope.siteUrlInfo.userId!=null && $rootScope.siteUrlInfo.accountNumber!=null) + { + AuthenticationService.ByPassLoginToOpenModule($rootScope.siteUrlInfo) + .then( + function (result) { + if(result!=null) + { + $rootScope.userInfo.username = result.LoginId; + $rootScope.userInfo.password = result.Password; + $rootScope.AuthenticateUser($rootScope.userInfo); + } + + }), + function (error) { + console.log(' Error in bypass login = ' + error.statusText); + $rootScope.errorMessage = error; + $("#messageModal").modal('show'); + } + + } + else + { + console.log(' invalid detail in bypass login'); + $rootScope.errorMessage = "authentication is not allowed due to invalid details format .\nPlease pass the correct details again!"; + $("#messageModal").modal('show'); + } + } else { - console.log($rootScope.siteUrlInfo); AuthenticationService.validateClientSite($rootScope.siteUrlInfo) @@ -1321,12 +1413,7 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l ) } - //$rootScope.siteUrlInfo.siteIP = siteInfo[0]; - //$rootScope.siteUrlInfo.remoteIPAddress = siteInfo[1]; - //$rootScope.siteUrlInfo.accountNumber = siteInfo[2]; - //$rootScope.siteUrlInfo.edition = siteInfo[3]; - //$rootScope.siteUrlInfo.urlReferer = siteInfo[4]; - + } @@ -1478,7 +1565,7 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l } else { - $location.path('/'); + $location.url('/'); } $rootScope.isVisibleLogin = false; } @@ -2590,7 +2677,10 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l } $rootScope.CIAnotationIdentifyModeOff = false; $rootScope.OnIdentifyClick = function () { - + //clear sketch js event for paint and erase + $.sketch = { tools: {}}; + $rootScope.shapeType = ""; + $(".btn-annotation").removeClass("activebtncolor"); $("#OnIdentify").addClass("annotationtoolbartab"); $("#DrawMode").removeClass("annotationtoolbartab"); @@ -2772,7 +2862,8 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l } $rootScope.DrawingMode = function () { - + //clear sketch js event for paint and erase + $.sketch = { tools: {}}; //Annotation History $rootScope.isAnnotaionToolBarDrawingModeActive = true; $("#OnIdentify").removeClass("annotationtoolbartab"); @@ -2847,6 +2938,8 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l //----Annotation Toolbar: Jcanvas----- $rootScope.DrawLine = function (e) { + //clear sketch js event for paint and erase + $.sketch = { tools: {}}; $('.btnCursor').removeClass('activebtncolor'); $(".btn-annotation").removeClass("activebtncolor"); $(".btn-annotation-line").addClass("activebtncolor"); @@ -2910,7 +3003,8 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l } $rootScope.DrawPin = function (e) { - + //clear sketch js event for paint and erase + $.sketch = { tools: {}}; $('.btnCursor').removeClass('activebtncolor'); $(".btn-annotation").removeClass("activebtncolor"); $(".btn-annotation-pin").addClass("activebtncolor"); @@ -2953,6 +3047,8 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l } $rootScope.Cursor = function () { + //clear sketch js event for paint and erase + $.sketch = { tools: {}}; $rootScope.shapeType = "cursor"; $(".btn-annotation").removeClass("activebtncolor"); // $("#" + e.currentTarget.id).removeClass("activebtncolor"); @@ -2981,7 +3077,8 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l } $rootScope.DrawRectangle = function (e) { - + //clear sketch js event for paint and erase + $.sketch = { tools: {}}; $('.btnCursor').removeClass('activebtncolor'); $(".btn-annotation").removeClass("activebtncolor"); $(".btn-annotation-rectangle").addClass("activebtncolor"); @@ -3082,13 +3179,12 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l } $rootScope.shapeType = "FreeStylePaint"; - var btnBrushSizeValue = $("#btnBrushSize").val(); - $rootScope.shapeSize = parseInt(btnBrushSizeValue); - $("#annotationpaintbrushsize").attr("data-size", $rootScope.shapeSize); + + $("#annotationpaintbrushsize").attr("data-size", parseInt($("#btnBrushSize").val())); $("#annotationpaintbrushsize").attr("data-color", $rootScope.shapestyleColorWithOpacity); - if ($rootScope.shapeSize == '') { + if (parseInt($("#btnBrushSize").val()) <1) { $("#" + canvasPaintId).sketch({ defaultSize: 1}); } else { @@ -3125,12 +3221,10 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l $rootScope.isAnnotaionToolBarDrawingModeActive = true; $rootScope.switchCanvasToPaintCanvas(paneld); - var btneraseBrushSizeValue = $("#btnBrushSize").val(); - $rootScope.shapeSize = parseInt(btneraseBrushSizeValue); $('#' + canvasPaintId).sketch(); - $("#annotationpainteraser").attr("data-size", $rootScope.shapeSize); + $("#annotationpainteraser").attr("data-size", parseInt($("#btnBrushSize").val())); $scope.PaintEraseEvent(); } } @@ -3149,14 +3243,14 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l this.stopPainting(); } this.color= $rootScope.shapestyleColorWithOpacity!=undefined ? $rootScope.shapestyleColorWithOpacity : "#fff"; - this.size=$rootScope.shapeSize; + this.size= parseInt($("#btnBrushSize").val()); if ($("#annotationpaintbrushsize").hasClass("activebtncolor")) { this.tool='marker'; this.startPainting(); } else if ($("#annotationpainteraser").hasClass("activebtncolor")) { this.tool='eraser'; - this.size=$rootScope.shapeSize>5?$rootScope.shapeSize:5; + this.size=parseInt($("#btnBrushSize").val())>5?parseInt($("#btnBrushSize").val()):5; this.startPainting(); } else @@ -3291,6 +3385,8 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l } $rootScope.DrawCircle = function (e) { + //clear sketch js event for paint and erase + $.sketch = { tools: {}}; $('.btnCursor').removeClass('activebtncolor'); $(".btn-annotation").removeClass("activebtncolor"); $(".btn-annotation-circle").addClass("activebtncolor"); @@ -3332,6 +3428,8 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l } $rootScope.DrawArrow = function (e) { + //clear sketch js event for paint and erase + $.sketch = { tools: {}}; $('.btnCursor').removeClass('activebtncolor'); $(".btn-annotation").removeClass("activebtncolor"); $(".btn-annotation-arrow").addClass("activebtncolor"); @@ -3372,6 +3470,8 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l } } $rootScope.DrawText = function () { + //clear sketch js event for paint and erase + $.sketch = { tools: {}}; $('.btnCursor').removeClass('activebtncolor'); $(".btn-annotation").removeClass("activebtncolor"); $(".btn-annotation-Text").addClass("activebtncolor"); @@ -3414,6 +3514,8 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l } $rootScope.DrawPolygon = function () { + //clear sketch js event for paint and erase + $.sketch = { tools: {}}; $("#OnIdentify").removeClass('annotationtoolbartab'); $("#DrawMode").addClass('annotationtoolbartab'); @@ -3657,6 +3759,12 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l }; } + $timeout(function(){ + $('.btnCursor').trigger('click'); + $(".btn-annotation").removeClass("activebtncolor"); + $('.btnCursor').addClass('activebtncolor'); + + },100) } @@ -4136,7 +4244,9 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l } $rootScope.jcanvasObjectArray = []; $rootScope.DrawRectangleOnModuleItem = function (canvasId, RectNumber, shapestyleFillColor, shapestyleborderColor, shapestyleOpacity, shapestyleborderWidth, offsetX1, offsetY1, width, height) { - if ($rootScope.isRectanglePreviewCompleted == true) { + if ($rootScope.isRectanglePreviewCompleted == true) { + if(width<30) width=30 ; + if(height<30) height=30; $rootScope.isRectanglePreviewCompleted = false; $("#"+canvasId).addLayer({ panelCanvasId:canvasId, @@ -4152,6 +4262,8 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l x: offsetX1, y: offsetY1, width: width, height: height, + minWidth:30, + minHeight:30, resizeFromCenter: false, add: function (layer) { var drawingPoints={ @@ -4287,7 +4399,9 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l $rootScope.DrawCircleOnModuleItem = function (canvasId, CircleNumber, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, offsetX1, offsetY1, width, height) { - if ($rootScope.isCirclePreviewCompleted == true) { + if ($rootScope.isCirclePreviewCompleted == true) { + if(width<30) width=30 ; + if(height<30) height=30; $rootScope.isCirclePreviewCompleted = false; $("#"+canvasId).addLayer({ panelCanvasId:canvasId, @@ -4304,6 +4418,8 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l y: offsetY1, width: width, height: height, + minWidth:30, + minHeight:30, // Place a handle at each side and each corner resizeFromCenter: false, handlePlacement: 'both', @@ -4446,7 +4562,7 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l strokeStyle: shapestyleborderColor, strokeWidth: shapestyleborderWidth, rounded: true, - startArrow: true, + endArrow: true, arrowRadius: 7, arrowAngle: 90, x1: offsetX1, y1: offsetY1, @@ -4708,7 +4824,7 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l strokeStyle: 'grey', strokeWidth: shapestyleborderWidth, fillStyle: radial, - x: offsetX1, y: offsetY1, + x: x, y: y, radius: 5, add: function (layer) { layer.draggable = false; @@ -4847,139 +4963,6 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l document.getElementById('modelbackground').style.display = "none"; } - $scope.RefreshShapeText=function(canvasId,selectedTextRect,selectedTextArea,areaText) - { - var contentWidthArray = []; - var contentHeightArray = []; - $rootScope.textWidth=[]; - var adjustWidth=0; - var text = areaText; - var stringText=""; - - var rectDimension = new jinqJs() - .from($rootScope.rectDimension) - .where('panelCanvasId == ' + canvasId,'name == ' + selectedTextRect) - .select(); - var textDimension = new jinqJs() - .from($rootScope.textDimension) - .where('panelCanvasId == ' + canvasId,'name == ' + selectedTextArea) - .select(); - - $("#atTextDiv").css({ "width": Math.abs(rectDimension[0].width), "height": Math.abs(rectDimension[0].height), "font-size": textDimension[0].textstyle.fontSize }); - - $("#textspan").empty(); - $("#textspan").css({"display":"inline-block"}); - - for (var i = 0; i <= text.length - 1; i++) { - if (contentWidthArray.length > 0) { - if (parseInt(contentWidthArray[0]) < $("#atTextDiv").width()) { - //store break line by enter key - var charvalue=text[i]; - var LineBreaksLen = (text[i].match(/\n/g)||[]).length; - var isaddchar=true; - if(LineBreaksLen>0) - { - var lastspace= $rootScope.textWidth[$rootScope.textWidth.length-1].character; - charvalue=" ";//replace break line in between text by white space - if(lastspace==charvalue) - { - isaddchar=false; - } - } - else - { - // handle multiple space - var lastspace= $rootScope.textWidth[$rootScope.textWidth.length-1].character; - if(lastspace==" " && charvalue==" ") - { - isaddchar=false; - } - - } - if(isaddchar) - { - stringText=stringText+charvalue; - $("#textspan").append(charvalue); - contentWidthArray = []; - $rootScope.textWidth.push({"panelCanvasId":canvasId, "id": "", "character": charvalue }); - contentWidthArray.push(Math.ceil($("#textspan").width())); - } - } - else { - var LineBreaksLen = (text[i].match(/\n/g)||[]).length; - if(LineBreaksLen<=0) - { - if(adjustWidth0) { - // update height - $rootScope.rectDimension = new jinqJs() - .from($rootScope.rectDimension) - .update(function (coll, index) { - coll[index].height = contentHeightArray[0].totalHeight; - coll[index].width = adjustWidth>0 ?adjustWidth:coll[index].width; - }) - .at('panelCanvasId == ' + canvasId,'name == ' + selectedTextRect) - .select(); - - - } - - $rootScope.textDimension = new jinqJs() - .from($rootScope.textDimension) - .update(function (coll, index) { coll[index].stringText = stringText; }) - .at('panelCanvasId == ' + canvasId,'name == ' + selectedTextArea) - .select(); - - contentHeightArray = [];//clear hieght - } - $scope.UpdateTextEditor=function(TextPropertyArray,fillStyle) { if (TextPropertyArray.length>0) { @@ -5071,7 +5054,11 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l if(areaText!=undefined) { //not use while open from CB - $scope.RefreshShapeText(canvasId,selectedTextRect,selectedTextArea,areaText); + $rootScope.textDimension = new jinqJs() + .from($rootScope.textDimension) + .update(function (coll, index) { coll[index].stringText = areaText; }) + .at('panelCanvasId == ' + canvasId,'name == ' + selectedTextArea) + .select(); } var rectDimension = new jinqJs() @@ -5100,8 +5087,35 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l } } } - - $("#" + canvasId).drawRect({ + + $("#" + canvasId).drawText({ + panelCanvasId:canvasId, + layer: true, + name: 'temptext',//use for intially adjust height and width of text for rectangle + fillStyle:textDimension[0].textstyle.fontColor, + fontStyle: textDimension[0].textstyle.fontWeight + " " + textDimension[0].textstyle.fontStyle, + fontSize: textDimension[0].textstyle.fontSize, + fromCenter: false, + fontFamily: textDimension[0].textstyle.fontFamily, + align: textDimension[0].textstyle.textAlignmt, + strokeWidth: 0, + text: textDimension[0].stringText, + x: rectDimension[0].x, y: rectDimension[0].y, + maxWidth:rectDimension[0].width, + add: function (layer) { + // internal use + // use to calculate minwidth of rectangle by longest word with applied css + var str=layer.text; + var splittext=str.split(" "); + var longtext= longest_string(splittext)[0]; + var test = document.getElementById("atTextDiv"); + test.style.fontSize = layer.fontSize; + test.style.fontFamily = layer.fontFamily; + test.style.fontWeight = layer.fontStyle.split(" ")[0]; + test.style.fontStyle = layer.fontStyle.split(" ")[1]; + $('#atTextDiv').html(longtext); + }, + }).drawRect({ panelCanvasId:canvasId, name: rectDimension[0].name, groups: [rectDimension[0].groupName], @@ -5115,10 +5129,10 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l fillStyle: rectDimension[0].shapestyle.fillStyle, fromCenter: false, x: rectDimension[0].x, y: rectDimension[0].y, - width: Math.abs(rectDimension[0].width), - height: Math.abs(rectDimension[0].height), - minWidth: Math.abs(rectDimension[0].width), - minHeight: Math.abs(rectDimension[0].height), + width: $("#" + canvasId).measureText('temptext').width>20?$("#" + canvasId).measureText('temptext').width+10:40, + height:$("#" + canvasId).measureText('temptext').height>20?$("#" + canvasId).measureText('temptext').height+10:40, + minWidth:document.getElementById("atTextDiv").clientWidth>20?document.getElementById("atTextDiv").clientWidth+10:40, + minHeight:$("#" + canvasId).measureText('temptext').height>20?$("#" + canvasId).measureText('temptext').height:40, resizeFromCenter: false, add: function (layer) { var drawingPoints={ @@ -5266,7 +5280,10 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l handlemove: function(layer) { if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) { var txtnumber=(layer.name).split('_')[1]; - var textareaName="TextArea_" +txtnumber; + var textareaName="TextArea_" +txtnumber; + // change min height of reactangle + var textheight=$("#" + layer.panelCanvasId).measureText(textareaName).height+10; + layer.minHeight= textheight; $("#" + layer.panelCanvasId).removeLayer(textareaName).drawLayers(); var textDimension = new jinqJs() @@ -5289,8 +5306,8 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l align: textDimension[0].textstyle.textAlignmt, strokeWidth: 0, text: textDimension[0].stringText, - x: layer.x, y: layer.y, - maxWidth:layer.width, + x: layer.x+5, y: layer.y+5, + maxWidth:layer.width-2, add: function (layer) { layer.draggable = true; }, @@ -5350,7 +5367,16 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l } } var txtnumber=(layer.name).split('_')[1]; - var textareaName="TextArea_" +txtnumber; + var textareaName="TextArea_" +txtnumber; + + $rootScope.rectDimension = new jinqJs() + .from($rootScope.rectDimension) + .update(function (coll, index) { + coll[index].height = layer.height; + coll[index].width = layer.width; + }) + .at('panelCanvasId == ' + layer.panelCanvasId,'name == ' + layer.name) + .select(); var rectDimension = new jinqJs() .from($rootScope.rectDimension) @@ -5404,10 +5430,12 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l align: textDimension[0].textstyle.textAlignmt, strokeWidth: 0, text: textDimension[0].stringText, - x: rectDimension[0].x, y: rectDimension[0].y, + x: rectDimension[0].x+5, y: rectDimension[0].y+5, maxWidth:rectDimension[0].width, add: function (layer) { - layer.draggable = true; + layer.draggable = true; + //remove temptext + $("#" + canvasId).removeLayer('temptext').drawLayers(); }, dragstop: function (layer) { if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) { @@ -5451,6 +5479,13 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l } } + function longest_string(str_ara) { + let max = str_ara[0].length; + str_ara.map(v => max = Math.max(max, v.length)); + var result = str_ara.filter(v => v.length == max); + return result; + } + $scope.dragstopEvent=function(panelCanvasId,rectName,textareaName,positionX,positionY) { if ((panelCanvasId).match("canvasAA")) { @@ -5771,19 +5806,19 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l case "Line": $(".line").remove(); $rootScope.isLinePreviewCompleted = true; - $("#" + canvasDivId).append("
"); + $("#" + canvasDivId).append("
"); $rootScope.Annotationangle(); break; case "Arrow": $(".arrow").remove(); $rootScope.isArrowPreviewCompleted = true; - $("#" + canvasDivId).append("
"); + $("#" + canvasDivId).append("
"); $rootScope.Annotationangle(); break; case "Pin": $(".pin").remove(); $rootScope.isPinPreviewCompleted = true; - $("#" + canvasDivId).append("
"); + $("#" + canvasDivId).append("
"); $rootScope.Annotationangle(); break; case "Circle": @@ -5847,9 +5882,11 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l break; case "Arrow": $('.arrow').css({ 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%', 'width': dottedLineWidth + 'px' }); + $('.arrowPoint').css({ 'left': dottedLineWidth + 'px' }); break; case "Pin": $('.pin').css({ 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%', 'width': dottedLineWidth + 'px' }); + $('.pinPoint').css({ 'left': dottedLineWidth + 'px' }); break; case "Circle": var classname=".circle" @@ -6425,11 +6462,15 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l $("#modelsettingsbackground").css("display", "none"); } $rootScope.CloseSetting = function () { - // $rootScope.errorMessage = LoginMessageConstants.INVALID_USER; + if($rootScope.isApplyBtnClicked) + { $("#saveSettingsMessageModal").modal('show'); $("#saveSettingsMessageModal").css('zIndex', 80000000000); - //$('#modal-settings').css("display", "none"); - //$("#modelsettingsbackground").css("display", "none"); + } + else + { + $rootScope.CancelSetting (); + } } $rootScope.saveSettings = function () { @@ -6561,6 +6602,12 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l $('#primarylaxican').attr("name", $rootScope.primaryLangID); } } + + $('#lexiconLangDropdown').html($('#lexiconLangDropdown').find('option').sort(function (x, y) { + + return $(x).text() > $(y).text() ? 1 : -1 + + })); } @@ -7465,8 +7512,9 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l { var imageInfo = $rootScope.UserImageExportData[0]; - $scope.saveDACernerWindowActivity();//Check for Cerner - + if($rootScope.isCernerUser){ + $scope.saveDACernerWindowActivity();//Check for Cerner + } AuthenticationService.UserLicenseExportImage(imageInfo) .then( function (result) { @@ -7475,23 +7523,24 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l var blob = dataURItoBlob(dataURL); - //Polulating object - $rootScope.CernerImageInfo.data = dataURL; - $rootScope.CernerImageInfo.name = fileName; - $rootScope.CernerImageInfo.blob = blob; - $rootScope.CernerImageInfo.imageInfo = imageInfo; - $rootScope.CernerImageInfo.imageInfoJson = $scope.updatedWindowListSaveCerner; - $rootScope.CernerImageInfo.CernerUserSessionId = $scope.GetSessionIdCookie(); - - //Call Cerner Fhir service - $scope.CallCernerService($rootScope.CernerImageInfo); - + if($rootScope.isCernerUser){ + //Polulating object + $rootScope.CernerImageInfo.data = dataURL; + $rootScope.CernerImageInfo.name = fileName; + $rootScope.CernerImageInfo.blob = blob; + $rootScope.CernerImageInfo.imageInfo = imageInfo; + $rootScope.CernerImageInfo.imageInfoJson = $scope.updatedWindowListSaveCerner; + $rootScope.CernerImageInfo.CernerUserSessionId = $scope.GetSessionIdCookie(); + + //Call Cerner Fhir service + $scope.CallCernerService($rootScope.CernerImageInfo); + } console.log(blob); saveAs(blob, fileName); $("#exportlogo").remove(); $("#filename").val(""); - + if(result!=null && result!="ADMIN" ) { var userid= $rootScope.userData.Id; @@ -7520,67 +7569,58 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l }); $(".export-image").css("display", "none"); - }; - + }, - //Save DISSECTIBLE_ANATOMY activity for DA Cerner. - $scope.saveDACernerWindowActivity = function () { - //$scope.updatedWindowListSaveCerner = {}; - if ($rootScope.DaWindowData !== undefined && $rootScope.DaWindowData.length > 0) { + //Save DISSECTIBLE_ANATOMY activity for Cerner. + $scope.saveDACernerWindowActivity = function () { + if ($rootScope.DaWindowData != undefined && $rootScope.DaWindowData.length > 0) { for (var i = 0; i < $rootScope.DaWindowData.length; i++) { $scope.updatedWindowListSaveCerner = { - - bodySystemTermList: $rootScope.DaWindowData[i].BodySystemData, - isTitleBarVisible: false, //BodySystemData.isTitleBarVisible,//N + + // bodySystemTermList: $rootScope.DaWindowData[i].BodySystemData, + isTitleBarVisible: false, highlightOptionsSelectedId: 0, selectedStructureID: 0,//N contentDescriptorId: 0, - callOuts: $rootScope.DaWindowData[i].CurriculumTermData, + callOuts: $rootScope.DaWindowData[i].CurriculumTermData, - //selectedCallouts: $rootScope.DaWindowData[i].CBselectedpinCordinate, layerNumber: parseInt($rootScope.DaWindowData[i].layerNumber) + 1, isModestyOn: $rootScope.DaWindowData[i].ModestyValue, - - isTopToolBarVisible: false, //$rootScope.DaWindowData[i].isTopToolBarVisible, + + isTopToolBarVisible: false, clickedTermList: $rootScope.DaWindowData[i].fullTermlist, minimised: $rootScope.DaWindowData[i].minimised, windowTitle: $rootScope.DaWindowData[i].currentViewTitle, - //scrollPosition: { - // vertical: $rootScope.DaWindowData[i].verticalScroll, - // horizontal: $rootScope.DaWindowData[i].horizontalScroll - //}, - + maximised: $rootScope.DaWindowData[i].maximised, size: { width: $rootScope.DaWindowData[i].width, height: $rootScope.DaWindowData[i].height }, - id: $rootScope.DaWindowData[i].voId, - + id: $rootScope.DaWindowData[i].voId, + imageId: $rootScope.DaWindowData[i].imageId, position: { top: $rootScope.DaWindowData[i].top, - left: $rootScope.DaWindowData[i].left + left: $rootScope.DaWindowData[i].left, }, mType: $rootScope.DaWindowData[i].moduleName, containsCapturedContent: true, - //contextMenu: { hideLeftBar: false, hideTitleBar: false, hideTopToolBar: false, lockResize: false }, - //activePinArray: $rootScope.DaWindowData[i].activePinArray, // Selected PINID on Body - //sliderVal: $rootScope.DaWindowData[i].sliderVal, + zoom: $rootScope.DaWindowData[i].zoomInOut, skinId: $rootScope.DaWindowData[i].curentEthnicity, - isResizeLock: false, //N + isResizeLock: false , //N mode: $rootScope.DaWindowData[i].mode, windowListId: 0,//N canvasVScrollX: $rootScope.DaWindowData[i].CanvasDivTopPosition, - canvasHScrollX: $rootScope.DaWindowData[i].CanvasDivLeftPosition, - isCallOutVisible: false, - annotationData: $rootScope.DaWindowData[i].annotationData, + canvasHScrollX: $rootScope.DaWindowData[i].CanvasDivLeftPosition, + isCallOutVisible: false, + annotationData:$rootScope.DaWindowData[i].annotationData, isLeftToolBarVisible: false, - isModuleLoaded: false, + isModuleLoaded: false, searchSelectedText: $rootScope.DaWindowData[i].searchSelectedText, - prevId: $rootScope.DaWindowData[i].prevId, //ActualTermnumber for chnages body image - + prevId: $rootScope.DaWindowData[i].prevId, + isTransparent: $rootScope.DaWindowData[i].isTransparent, transparencyBounds: $rootScope.DaWindowData[i].transparencyBounds, transparencyValue: $rootScope.DaWindowData[i].transNumber, @@ -7589,30 +7629,17 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l transparencyY: $rootScope.DaWindowData[i].transparencyY, layerNumberBeforeTBDraw: $rootScope.DaWindowData[i].layerNumberBeforeTBDraw, showHideAnnotations: $rootScope.DaWindowData[i].showHideAnnotations - - - }; + + + } } - } - }; + + } + }, $scope.CallCernerService = function (CernerImageInfo) { CernerFhirService.SaveImageToFhirResource(CernerImageInfo); - }; - - $scope.GetJsonImageAIA = function (documentId) { - CernerFhirService.GetJsonImageAIA(documentId).then(function (result) { - console.log(result); - var WindowImageJson = result.JsonData; - var Json = jQuery.parseJSON(WindowImageJson); - // Load DA module. - //$scope.AIAModuleOpenResourceInfo(Json); - //$scope.loadResourceOnCurrentSlide(ImageJson); - //AIAModuleOpenResoureInDA(ImageJson); - }, function (error) { - console.log(' Error in opening DA module = ' + error.statusText); - }); - }; + }, $rootScope.GetCookie = function (name) { var nameEQ = name + "="; @@ -7623,27 +7650,33 @@ AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$l if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length); } return null; - }; + }, $scope.GetSessionIdCookie = function () { var json = $rootScope.GetCookie("CernerInfo"); //var ASPSession = $rootScope.GetCookie("ASP.NET_SessionId"); // enable to retreive as set to HttpOnly. var data = JSON.parse(json); return data.CernerSessionId; - }; - - $scope.CheckCernerLaunch = function () { - var DocumentId = (new URL(location.href)).searchParams.get('documentId'); - if (DocumentId !== null && DocumentId !== "") { - alert("Document Id detected... Now loading DA module..."); - // Call API with DocumentId - $scope.GetJsonImageAIA(DocumentId); + }, + + $scope.CheckCernerUser = function () { + var json = $rootScope.GetCookie("CernerInfo"); + if (json !== null && json !== "") { + var data = JSON.parse(json); + if (data.isCernerUser) { + $rootScope.isCernerUser = true; + setInterval(function(){ $scope.CallUpdateCernerToken(data.CernerSessionId); }, 480000); // + return true; + } } - }; - + }, + $scope.CallUpdateCernerToken = function(sessionId){ + CernerFhirService.UpdateToken(sessionId); + }; }] ); + function printImagePreview(event) { var scope = angular.element(document.querySelector('[ng-controller="HomeController"]')).scope(); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js b/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js index 8a1307d..bb34f4c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js @@ -42,7 +42,26 @@ }); return deferred.promise; }, + ByPassLoginToOpenModule: function (urlDetail) { + var deferred = $q.defer(); + $http.post('/API/api/ByPassLoginToOpenModule', JSON.stringify(urlDetail), { + headers: { + 'Content-Type': 'application/json' + } + }) + .success(function (data, status, headers, config) { + console.log('success') + deferred.resolve(data); + }).error(function (data, status, headers, config) { + console.log('error') + deferred.reject(data); + $rootScope.errorMessage = data; + $("#messageModal").modal('show'); + + }); + return deferred.promise; + }, saveSetings: function (settings) { var deferred = $q.defer(); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/services/CernerFhirService.js b/400-SOURCECODE/AIAHTML5.Web/app/services/CernerFhirService.js index 423151f..9bafe9c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/services/CernerFhirService.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/services/CernerFhirService.js @@ -1,41 +1,51 @@  -AIA.factory('CernerFhirService', function ($http, $q) { +AIA.factory('CernerFhirService',function($http,$q) { return { - SaveImageToFhirResource: function (Base64ImageCerner) { + SaveImageToFhirResource: function(Base64ImageCerner) { - var deferred = $q.defer(); - - $http.post('/API/api/CernerFhir', JSON.stringify(Base64ImageCerner), { + var deferred=$q.defer(); + + $http.post('/API/api/CernerFhir',JSON.stringify(Base64ImageCerner),{ headers: { 'Content-Type': 'application/json' } - }).success(function (data, status, headers, config) { - console.log('success'); - deferred.resolve(data); - }).error(function (data, status, headers, config) { - console.log('error'); - deferred.reject(data); + }).success(function(data,status,headers,config) { + console.log('success'); + deferred.resolve(data); + }).error(function(data,status,headers,config) { + console.log('error'); + deferred.reject(data); }); return deferred.promise; }, - GetJsonImageAIA: function (documentId) { + GetJsonImageAIA: function(documentId) { + var deferred=$q.defer(); - var deferred = $q.defer(); - - $http.get('API/api/CernerUserSession/' + documentId) - .success(function (data, status, headers, config) { + $http.get('API/api/CernerUserSession/'+documentId) + .success(function(data,status,headers,config) { deferred.resolve(data); }) - .error(function () { + .error(function(data,status,headers,config) { deferred.reject(data); }); return deferred.promise; - } + }, + UpdateToken: function(sessionId) { + var deferred=$q.defer(); + + $http.get('/API/api/CernerFhir/'+sessionId) + .success(function(data,status) { + deferred.resolve(data); + }) + .error(function(data,status,headers,config) { + deferred.reject(data); + }); + } }; }); \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js b/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js index e9c6be6..f4e82a4 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js @@ -335,7 +335,7 @@ AIA.service('ModuleService', function ($http, DataService) { mode: windowData.mode, isLeftToolBarVisible: windowData.isLeftToolBarVisible, contentDescriptorId: windowData.contentDescriptorId, - bodySystemTermList: windowData.bodySystemTermList, + // bodySystemTermList: windowData.bodySystemTermList, isTransparent: windowData.isTransparent, windowListId: windowData.windowListId, canvasVScrollX: windowData.canvasVScrollX, diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html index 154545d..0384030 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html @@ -72,7 +72,7 @@ - {{item._Title}} + ({{item._id}}) {{item._Title}} {{item._BodyRegion}} @@ -88,7 +88,7 @@ - {{item._Title}} + ({{item._id}}) {{item._Title}} {{item._BodyRegion}} diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html index fe3a43e..f878d3e 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html @@ -264,7 +264,7 @@ -