Web component properties
Thsese properties are passed to the web component and can be accessed using the appropriate property names:
PluginProps
This is the main type passed to the web component. See below for the definitions of the various types used.
export interface PluginProps {
/** Unique identifier for the plugin instance */
id: string;
/** Human-readable name of the plugin */
name: string;
/** Screen context information */
screen: ScreenContext;
/** Application context information */
context: PluginContext;
/** Plugin-specific configuration settings */
settings: PluginSettings;
/** Medical imaging specific properties */
imaging: ImagingProps;
/** Callback to open modal/fullscreen view */
onOpenModal: (detail: ModalEventDetail) => void;
/** Callback to close modal/fullscreen view */
onCloseModal: (detail: ModalEventDetail) => void;
/** Callback to request a token for a specific subject and identifier(s) */
onRequestToken: (detail: TokenRequestDetail) => TokenRequestResponse;
/** Whether modal is currently open */
isModalOpen?: boolean;
}
PluginContext
/**
* Application context information
*/
export interface PluginContext {
/** Current environment */
environment: 'SANDBOX' | 'UAT' | 'PRODUCTION';
/** Unique customer identifier */
customerId: string;
/** Site identifier */
siteId: string;
/** Staff identifier */
staffId: string;
}
ScreenContext
/**
* Screen context information
*/
export interface ScreenContext {
/** View type where the component is rendered */
view: 'MEDICAL_IMAGES';
/** Maximum width constraint for the component */
maxWidth: number;
/** Optional maximum height constraint for the component */
maxHeight?: number;
}
PluginSettings
/**
* Plugin settings as key-value pairs
*/
export interface PluginSettings {
[setting: string]: string;
}
ImagingProps
/**
* Medical imaging specific properties
*/
export interface ImagingProps {
patientId: string;
// Array of image objects
images: Image[];
selectedImage: Image | null; // Currently selected image for viewing
}
Image
/**
* Image object representing a medical image
*/
export interface Image {
id: string;
fileName: string;
}
TokenRequest types
export type SubjectType = 'MEDICAL-IMAGE' | 'PATIENT-DETAILS' | 'CONFIGURATION-CAMERA';
/**
* Token request detail payload
*/
export interface TokenRequestDetail {
/** Plugin instance identifier */
pluginId: string;
/** Plugin name */
pluginName: string;
/** Plugin context information */
context: PluginContext;
/** Requested subject type */
subjectTypes: SubjectType[];
/** Requested subject IDs */
subjectIds: string[];
}
export interface TokenRequestResponse {
/** Request details */
detail: TokenRequestDetail;
/** Token value */
token: string;
}
ModalEventDetail
/**
* Standard modal event detail payload
*/
export interface ModalEventDetail {
/** Plugin instance identifier */
pluginId: string;
/** Plugin name */
pluginName: string;
/** Plugin context information */
context: PluginContext;
}