Removing search loops and proprietary tag definitions from DICOMTagDescriptions viewerbase utility.

This commit is contained in:
Emanuel F. Oliveira authored and Eloízio Salgado committed 2017-03-02 10:16:09 -03:00
1 parent e75330fe87
commit 0be2f5887a
5 files changed
+485 -419

No files matched your search

@@ -0,0 +1,42 @@
class StudySummary {
constructor(propertyMap) {
// Define the main immutable "_data" private property.
Object.defineProperty(this, '_data', {
configurable: false,
enumerable: false,
writable: false,
value: Object.create(null)
});
const hasOwn = Object.prototype.hasOwnProperty;
const data = this._data;
for (let property in propertyMap) {
if (hasOwn.call(propertyMap, property)) {
data[property] = propertyMap[property];
}
}
}
propertyExists(propertyName) {
const internalPropertyName = this.getInternalPropertyName(propertyName);
return (internalPropertyName in this._data);
}
getPropertyValue(propertyName) {
const internalPropertyName = this.getInternalPropertyName(propertyName);
return this._data[internalPropertyName];
}
/**
* This function is supposed to translate external property names into internal property names.
* By default it implements the simplest translation possible. For
*/
getInternalPropertyName(propertyName) {
return propertyName;
}
}