Integration of FML Editor

en

The 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:

  1. Create an iframe element within your application.
  2. Provide the URL to the FML editor to the iframe.
  3. 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 object
  • json+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.


  1. https://gitlab.com/kodality/terminology/termx-fml

  2. https://gitlab.com/kodality/terminology/termx-fml/-/blob/main/src/app/context/iframe.context.ts#L10


Page last modified: Oct 17 2023 at 11:44 AM.