EnginePlugin Interface Documentation
The EnginePlugin interface allows developers to integrate custom plugins into the Visiontree FHIR engine. These plugins can be used to intercept various engine events, enabling enhanced functionalities and behaviors.
Overview
Through the EnginePlugin, developers have the ability to extend and customize the engine's behavior at various lifecycle points, such as initialization, form loading, saving, and more.
Properties
name
name?: stringAn optional name for the plugin. If not provided, a unique identifier will be generated.
Methods
onLoad
(this: EngineAPI) => voidInvoked when the plugin has been loaded into the engine.
onInit
(this: EngineAPI) => void | Promise<unknown>Called before the engine's initialization process.
onReady
(this: EngineAPI) => voidInvoked after the engine has completed its initialization.
onFormLoad
(this: EngineAPI, form: Form) => voidTriggered when the engine loads a Questionnaire resource. This method provides an opportunity to modify the form before it is displayed.
onFormSave
(this: EngineAPI, questionnaireResponse: r4.QuestionnaireResponse) => Promise<unknown>Called when a save event is initiated for a form. It handles the creation or modification of a QuestionnaireResponse.
onFormChange
(this: EngineAPI, questionnaireResponse: r4.QuestionnaireResponse) => voidInvoked whenever there's a change in a form's QuestionnaireResponse. Useful for tracking form alterations or user inputs.
Conclusion
The EnginePlugin interface offers a powerful way to extend the Visiontree FHIR engine's functionalities. By understanding its methods and lifecycle hooks, developers can create custom plugins that seamlessly integrate with the engine, enhancing its behavior and capabilities.