Integration of FML Editor
enThe FML Editor is a self-hosted web JavaScript application, providing a structured API for embedding within your application.
Running inside an iframe[1]
To run the FML editor within your application, follow these steps:
- Create an iframe element within your application.
- Provide the URL to the FML editor to the iframe.
- Establish communication between the iframe and your application using window.postMessage().
Initialization
The editor within the iframe will send an init
event when it’s ready to proceed with further actions.
To initialize the FML editor, the client should supply the bundle
, structure map
and optionally, contained resources
using the load
[2] action.
Saving
The save
event is triggered when the user clicks on the ‘Save’ button in the FML editor.
To save data, the client should send the export
action.
Optionally, the save format can be provided:
json
- composes FHIR StructureMap objectjson+svg
-json
+ snapshot of the main group as svg in the StructureMap extension
Once the data is prepared and ready for export, the FML editor sends the export
event with a StructureMap object as data.
TermX intergration
The diagram below illustrates the communication flow between the FML Editor and the TermX application.