var ATLAS_ANATOMY = 'Atlas Anatomy'; var CLINICAL_ILLUSTRATION = 'Clinical Illustrations'; var CLINICAL_ANIMATION = 'Clinical Animations'; var OpenedModuleItemList = []; var ModDetail = []; var moduleData; var modName; var moduleDataObj = {}; moduleDataObj.AAData = []; moduleDataObj.DAData = []; moduleDataObj.CIData = []; moduleDataObj.CAData = []; moduleDataObj.ThreeDData = []; moduleDataObj.AIData = []; moduleDataObj.LabData = []; moduleDataObj.PICData = []; moduleDataObj.VideoData = []; AIA.service('ModuleService', function ($http, DataService) { return { loadModuleDataBasedOnModuleName: function (moduleName) { var jsonPath; modName = moduleName; //debugger; if (moduleName == ATLAS_ANATOMY) { jsonPath = '~/../content/data/json/aa/aa_dat_contentlist.json'; } else if (moduleName == CLINICAL_ANIMATION) { //to do, in next phase of project jsonPath = '~/../content/data/json/ca/ca_dat_contentlist.json'; } else if (moduleName == CLINICAL_ILLUSTRATION) { //to do, in next phase of project jsonPath = '~/../content/data/json/ci/ci_dat_contentlist.json'; } return $http.get(jsonPath, function (response) { moduleData = new jinqJs() .from(response.data.root.Item) .select(); return moduleData; }); }, GetOpenedTileData: function (id, moduleJson) { if (modName == ATLAS_ANATOMY) { var AADataForSelectedItem = []; var title = id; var selectedTileData = new jinqJs() .from(moduleJson.data.root.Item) .where("_Title == " + title) .select(); AADataForSelectedItem.push(selectedTileData[0]._ImageId); AADataForSelectedItem.push(selectedTileData[0]._BodyRegion); AADataForSelectedItem.push(selectedTileData[0]._BodySystem); AADataForSelectedItem.push(selectedTileData[0]._ImageName); AADataForSelectedItem.push(selectedTileData[0]._ImageType); AADataForSelectedItem.push(selectedTileData[0]._TileImageName); AADataForSelectedItem.push(selectedTileData[0]._Title); AADataForSelectedItem.push("ViewOrientation: " + selectedTileData[0]._ViewOrientation); return AADataForSelectedItem; } }, getPinDataForImage: function (imageName) { var pindataFileNamePart1 = imageName.replace("aa_img_", ""); var pinFileNamePart2 = pindataFileNamePart1.replace(".jpg", ""); var pinDatajsonPath = '~/../content/data/json/aa/aa_pindata/aa_dat_pindata_' + pinFileNamePart2 + '.json'; return $http.get(pinDatajsonPath, function (response) { var pinData = new jinqJs() .from(response.data.Root.Item) .select(); return pinData; }); }, getTermTextDataForPin: function (moduleName) { var jsonPath; if (moduleName == ATLAS_ANATOMY) { jsonPath = '~/../content/data/json/aa/aa_dat_term.json'; } return $http.get(jsonPath, function (response) { var termdata = new jinqJs() .from(response.data.Terms.Term) .select(); // alert(pinData.Root.Item); return termdata; }); }, getTermTextDataForAAImage: function (imageId) { var jsonPath = '~/../content/data/json/aa/aa_pinterm/aa_dat_pinterm_' + imageId + '.json'; return $http.get(jsonPath, function (response) { return response; }); }, getData: function (param) { var jsonPath = '~/../content/data/json/aa/aa_pinterm/aa_dat_pinterm_' + param + '.json'; }, getModuleData: function (moduleName) { if (moduleName == "ATLAS_ANATOMY") return moduleDataObj.AAData; else if (moduleName == "DISSECTIBLE_ANATOMY") return moduleDataObj.DAData; else if (moduleName == "CLINICAL_ILLUSTRATIONS") return moduleDataObj.CIData; else if (moduleName == "CLINICAL_ANIMATIONS") return moduleDataObj.CAData; else if (moduleName == "THREE_D_ANATOMY") return moduleDataObj.ThreeDData; else if (moduleName == "ADAM_IMAGES") return moduleDataObj.AIData; else if (moduleName == "LAB_EXERCISE") return moduleDataObj.LabData; else if (moduleName == "MY_PICTURES") return moduleDataObj.PICData; else if (moduleName == "MY_ANIMATIONS") return moduleDataObj.VideoData; }, setModuleData: function (windowData, windowId) { if (windowData.mType == "MY_PICTURES") { moduleDataObj.PICData.push({ currentWindowId: windowId, mType: windowData.mType, containsCapturedContent: windowData.containsCapturedContent, anatomyTitle: windowData.windowTitle, scrollPosition: windowData.scrollPosition, imageId: windowData.imageId, imageSource: windowData.imageSource, maximised: windowData.maximised, minimised: windowData.minimised, id: windowData.id, position: windowData.position, size: windowData.size, contextMenu: windowData.contextMenu, annotationData: windowData.annotationData, imgLeft:windowData.imgLeft }); } else if (windowData.mType == "MY_ANIMATIONS") { moduleDataObj.VideoData.push({ currentWindowId: windowId, mType: windowData.mType, containsCapturedContent: windowData.containsCapturedContent, anatomyTitle: windowData.windowTitle, scrollPosition: windowData.scrollPosition, imageId: windowData.imageId, videoSource: windowData.videoSource, maximised: windowData.maximised, minimised: windowData.minimised, id: windowData.id, position: windowData.position, size: windowData.size, contextMenu: windowData.contextMenu }); } else if (windowData.mType == "LAB_EXERCISE") { moduleDataObj.LabData.push({ currentWindowId: windowId, mType: windowData.mType, threeDData:windowData.threeDData, containsCapturedContent: windowData.containsCapturedContent, anatomyTitle: windowData.windowTitle, scrollPosition: windowData.scrollPosition, keywords: windowData.keywords, maximised: windowData.maximised, minimised: windowData.minimised, id: windowData.id, lastQuize: windowData.lastQuize, position: windowData.position, size: windowData.size, contextMenu: windowData.contextMenu, contentPath: windowData.contentPath }); } else if (windowData.mType == "THREE_D_ANATOMY") { moduleDataObj.ThreeDData.push({ currentWindowId: windowId, mType: windowData.mType, containsCapturedContent: windowData.containsCapturedContent, anatomyTitle: windowData.windowTitle, imageId: windowData.imageId, maximised: windowData.maximised, minimised: windowData.minimised, id: windowData.id, position: windowData.position, size: windowData.size, }); } else if (windowData.mType == "ADAM_IMAGES") { moduleDataObj.AIData.push({ currentWindowId: windowId, mType: windowData.mType, containsCapturedContent: windowData.containsCapturedContent, anatomyTitle: windowData.windowTitle, scrollPosition: windowData.scrollPosition, imageId: windowData.imageId, maximised: windowData.maximised, minimised: windowData.minimised, id: windowData.id, position: windowData.position, size: windowData.size, contextMenu: windowData.contextMenu, annotationData: windowData.annotationData, imgLeft:windowData.imgLeft }); } else if (windowData.mType == "CLINICAL_ANIMATIONS") { moduleDataObj.CAData.push({ currentWindowId: windowId, mType: windowData.mType, containsCapturedContent: windowData.containsCapturedContent, textVisible: windowData.textVisible, anatomyTitle: windowData.windowTitle, scrollPosition: windowData.scrollFlvPosition, imageId: windowData.imageId, maximised: windowData.maximised, minimised: windowData.minimised, id: windowData.id, position: windowData.position, size: windowData.size, contextMenu: windowData.contextMenu }); } else if (windowData.mType == "CLINICAL_ILLUSTRATIONS") { moduleDataObj.CIData.push({ currentWindowId: windowId, mType: windowData.mType, containsCapturedContent: windowData.containsCapturedContent, textVisible: windowData.textVisible, anatomyTitle: windowData.windowTitle, scrollPosition: windowData.scrollPosition, imageId: windowData.imageId, maximised: windowData.maximised, minimised: windowData.minimised, id: windowData.id, position: windowData.position, size: windowData.size, contextMenu: windowData.contextMenu, annotationData: windowData.annotationData, imgLeft:windowData.imgLeft }); } else if (windowData.mType == "ATLAS_ANATOMY") { moduleDataObj.AAData.push({ currentWindowId: windowId, mType: windowData.mType, anatomyTitle: windowData.windowTitle, selectedPinTermId: windowData.selectedStructureID, selectedPins: windowData.selectedPins, selectedBodysystemId: windowData.bodySystemId, hideAnnotations: windowData.hideCallOuts, scrollPosition: windowData.scrollPosition, zoomLevel: windowData.scaleIndex, showSelectedPins: windowData.showSelectedPins, hideAllPins: windowData.hideAllPins, showAllPins:windowData.showAllPins, selectedCallouts: windowData.selectedCallouts, imageId: windowData.imageId, maximised: windowData.maximised, minimised: windowData.minimised, annotationData:windowData.annotationData, id:windowData.id, position: windowData.position, size: windowData.size, contextMenu: windowData.contextMenu, showHideAnnotations: windowData.showHideAnnotations }); } else if (windowData.mType == "DISSECTIBLE_ANATOMY") { moduleDataObj.DAData.push({ currentWindowId: windowId, currentBodyViewId: windowData.id, windowTitle: windowData.windowTitle, skinId: windowData.skinId, isModestyOn: windowData.isModestyOn, size: windowData.size, position: windowData.position, layerNumber: windowData.layerNumber, zoom: windowData.zoom, maximised: windowData.maximised, highlightOptionsSelectedId: windowData.highlightOptionsSelectedId, selectedStructureId: windowData.selectedStructureId, isModuleLoaded: windowData.isModuleLoaded, isTopToolBarVisible: windowData.isTopToolBarVisible, transparencyValue: windowData.transparencyValue, imageId: windowData.imageId, containsCapturedContent: windowData.containsCapturedContent, layerNumberTransparency: windowData.layerNumberTransparency, isTitleBarVisible: windowData.isTitleBarVisible, clickedTermList: windowData.clickedTermList, isResizeLock: windowData.isResizeLock, mode: windowData.mode, isLeftToolBarVisible: windowData.isLeftToolBarVisible, contentDescriptorId: windowData.contentDescriptorId, // bodySystemTermList: windowData.bodySystemTermList, isTransparent: windowData.isTransparent, windowListId: windowData.windowListId, canvasVScrollX: windowData.canvasVScrollX, canvasHScrollX: windowData.canvasHScrollX, callOuts: windowData.callOuts, mType: windowData.mType, isCallOutVisible: windowData.isCallOutVisible, minimised: windowData.minimised, annotationData: windowData.annotationData, transparencyBounds: windowData.transparencyBounds, transparencyX: windowData.transparencyX, transparencyY: windowData.transparencyY, layerNumberBeforeTBDraw: windowData.layerNumberBeforeTBDraw, showHideAnnotations: windowData.showHideAnnotations }); } }, ClearWinData: function () { moduleDataObj.DAData = []; moduleDataObj.AAData = []; moduleDataObj.CIData = []; moduleDataObj.CAData = []; moduleDataObj.ThreeDData = []; moduleDataObj.AIData = []; moduleDataObj.LabData = []; moduleDataObj.PICData = []; moduleDataObj.VideoData = []; }, ClearWinDataByModule: function (moduleName) { if (moduleName == "ATLAS_ANATOMY") { moduleDataObj.AAData = []; } else if (moduleName == "DISSECTIBLE_ANATOMY") { moduleDataObj.DAData = []; } else if (moduleName == "CLINICAL_ILLUSTRATIONS") { moduleDataObj.CIData = []; } else if (moduleName == "CLINICAL_ANIMATIONS") { moduleDataObj.CAData = []; } else if (moduleName == "THREE_D_ANATOMY") { moduleDataObj.ThreeDData = []; } else if (moduleName == "ADAM_IMAGES") { moduleDataObj.AIData = []; } else if (moduleName == "LAB_EXERCISE") { moduleDataObj.LabData = []; } else if (moduleName == "MY_PICTURES") { moduleDataObj.PICData = []; } else if (moduleName == "MY_ANIMATIONS") { moduleDataObj.VideoData = []; } }, }; });