fix(datasource): configurability of additional data source extensions (#2931)
* feat(dataSource):Support more than one data source type. * Add consumer type
This commit is contained in:
1 parent
55a1704e4a
commit
3900e62641
18 files changed
+83
-29
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import * as OHIF from './index.js';
|
||||
import * as OHIF from './index';
|
||||
|
||||
describe('Top level exports', () => {
|
||||
test('have not changed', () => {
|
||||
@@ -31,6 +31,7 @@ describe('Top level exports', () => {
|
||||
'DisplaySetService',
|
||||
'MeasurementService',
|
||||
'ToolBarService',
|
||||
'Types',
|
||||
'ViewportGridService',
|
||||
'SegmentationService',
|
||||
'HangingProtocolService',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ExtensionManager, MODULE_TYPES } from './extensions';
|
||||
import { ServicesManager } from './services';
|
||||
import classes, { CommandsManager, HotkeysManager } from './classes/';
|
||||
import classes, { CommandsManager, HotkeysManager } from './classes';
|
||||
|
||||
import DICOMWeb from './DICOMWeb';
|
||||
import errorHandler from './errorHandler.js';
|
||||
@@ -8,8 +8,9 @@ import log from './log.js';
|
||||
import object from './object.js';
|
||||
import string from './string.js';
|
||||
import user from './user.js';
|
||||
import utils from './utils/';
|
||||
import utils from './utils';
|
||||
import defaults from './defaults';
|
||||
import * as Types from './types';
|
||||
|
||||
import {
|
||||
CineService,
|
||||
@@ -107,6 +108,7 @@ export {
|
||||
IWebApiDataSource,
|
||||
DicomMetadataStore,
|
||||
pubSubServiceInterface,
|
||||
Types,
|
||||
};
|
||||
|
||||
export { OHIF };
|
||||
@@ -1,7 +0,0 @@
|
||||
/** Defines a typescript type for study metadata */
|
||||
interface StudyMetadata {
|
||||
readonly StudyInstanceUID: string;
|
||||
StudyDescription?: string;
|
||||
}
|
||||
|
||||
export default StudyMetadata;
|
||||
@@ -1,7 +1,7 @@
|
||||
import pubSubServiceInterface from '../_shared/pubSubServiceInterface';
|
||||
import sortBy from '../../utils/sortBy';
|
||||
import ProtocolEngine from './ProtocolEngine';
|
||||
import StudyMetadata from '../DicomMetadataStore/StudyMetadata';
|
||||
import StudyMetadata from '../../types/StudyMetadata';
|
||||
import IDisplaySet from '../DisplaySetService/IDisplaySet';
|
||||
|
||||
const EVENTS = {
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* Just a function that consumes a single argument, with no return.
|
||||
*/
|
||||
type Consumer = (props: Record<string, unknown>) => void;
|
||||
export default Consumer;
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Consumer } from './Consumer';
|
||||
|
||||
|
||||
export default interface IPubSub {
|
||||
subscribe: (eventName: string, callback: Consumer) => void;
|
||||
_broadcastEvent: (
|
||||
eventName: string,
|
||||
callbackProps: Record<string, unknown>
|
||||
) => void;
|
||||
_unsubscribe: (eventName: string, listenerId: string) => void;
|
||||
_isValidEvent: (eventName: string) => boolean;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
/** Defines a typescript type for study metadata */
|
||||
|
||||
export interface PatientMetadata extends Record<string, unknown> {
|
||||
PatientName?: string;
|
||||
PatientId?: string;
|
||||
}
|
||||
|
||||
export interface StudyMetadata extends Record<string, unknown> {
|
||||
readonly StudyInstanceUID?: string;
|
||||
StudyDescription?: string;
|
||||
}
|
||||
|
||||
export interface SeriesMetadata extends StudyMetadata {
|
||||
readonly SeriesInstanceUID?: string;
|
||||
SeriesDescription?: string;
|
||||
SeriesNumber?: string | number;
|
||||
}
|
||||
|
||||
export interface InstanceMetadata extends SeriesMetadata {
|
||||
readonly SOPInstanceUID: string;
|
||||
InstanceNumber?: string | number;
|
||||
}
|
||||
export default StudyMetadata;
|
||||
@@ -0,0 +1,9 @@
|
||||
import {
|
||||
StudyMetadata,
|
||||
SeriesMetadata,
|
||||
InstanceMetadata,
|
||||
} from './StudyMetadata';
|
||||
|
||||
import Consumer from './Consumer';
|
||||
|
||||
export { StudyMetadata, SeriesMetadata, InstanceMetadata, Consumer };
|
||||
Reference in new issue
Block a user