ModuleService.js
8.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
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.CAData = [];
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;
},
setModuleData: function (windowData, windowId, SlideNo) {
if (windowData.mType == "ATLAS_ANATOMY") {
moduleDataObj.AAData.push({
slideId:SlideNo,
currentWindowId: windowId,
mType: windowData.mType,
anatomyTitle: windowData.windowTitle,
selectedPinTermId: windowData.selectedStructureID,
selectedPins: windowData.selectedPins,
selectedBodysystemId: windowData.bodySystemId,
hideAnnotations: windowData.hideCallOuts,
horizontalScroll: windowData.scrollPosition.horizontal + 'px',
verticalScroll: windowData.scrollPosition.vertical + 'px',
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,
});
}
else if (windowData.mType == "DISSECTIBLE_ANATOMY")
moduleDataObj.DAData.push({
slideId: SlideNo,
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,
});
},
ClearWinData: function () {
moduleDataObj.DAData = [];
moduleDataObj.AAData = [];
}
};
});