Moving Hanging Protocols updates back to the viewers

This commit is contained in:
Eloízio Salgado committed 2017-03-02 10:18:11 -03:00
1 parent e10453b919
commit bec8f21c0a
19 files changed
+1626 -183

No files matched your search

@@ -3,8 +3,8 @@ import { InstanceMetadata } from './InstanceMetadata';
export class SeriesMetadata extends Metadata {
constructor(data) {
super(data);
constructor(data, uid) {
super(data, uid);
// Initialize Private Properties
Object.defineProperties(this, {
_seriesInstanceUID: {
@@ -18,6 +18,12 @@ export class SeriesMetadata extends Metadata {
enumerable: false,
writable: false,
value: []
},
_firstInstance: {
configurable: false,
enumerable: false,
writable: true,
value: null
}
});
// Initialize Public Properties
@@ -77,6 +83,23 @@ export class SeriesMetadata extends Metadata {
return result;
}
/**
* Get the first instance of the current series retaining a consistent result across multiple calls.
* @return {InstanceMetadata} An instance of the InstanceMetadata class or null if it does not exist.
*/
getFirstInstance() {
let instance = this._firstInstance;
if (!(instance instanceof InstanceMetadata)) {
instance = null;
const found = this.getInstanceByIndex(0);
if (found instanceof InstanceMetadata) {
this._firstInstance = found;
instance = found;
}
}
return instance;
}
/**
* Find an instance by index.
* @param {number} index An integer representing a list index.