Blockly for openEHR projects

Blockly is a javascript library that provides block-based editors to any given app.

I’ve used it personally to define a first version of a Snomed expression syntax editor in less than a week (and most of the time came from integrating an autocomplete widget with it) and I’m no javascript expert :smiley:
It’s a quite rewarding little piece of technology, because you get results quite fast.

I can see several use cases in the openEHR world:

  • AQL editor
  • Quick & dirty archetype editor (probably generated automatically from RM / BMM)
  • Task Planning editor (?)
  • etc.

For any given use case, at least the following things should be defined:

  1. Json definition of a given block (how is the block represented, which connections and blocks are allowed, etc)
    For this, there is already an official blockly-based editor to generate your blocks, but I recommend to read the documentation first.
  2. Define how your block transforms into a given language (AQL, ADL, etc.). This has to be done by hand as far as I know, but it’s as complex as your potential grammar
  3. (optional) Split your blocks into categories
  4. (optional) Define translations for your components labels
  5. (optional) Define any custom editor for your leaf nodes (defined also in JS)

Documentation is quite nice, with good examples. Seems to be a good community around it, specially in the educational area. There is already an open source project for an SQL blockly-based editor which maybe is also interesting.

3 Likes

Hi Diego,

I just tried the SQL example and cannot say that I’m impressed. I actually don’t find it intuitive at all. Would be nice to learn if this is just me :slight_smile:

Yeah, probably it’s too complicated. I highlighted it because probably some blocks could directly be reused for a given AQL editor, but as always is finding the balance between fidelity to the model vs usability (e.g. an ADL editor wouldn’t really need to provide the attribute edition to be useful)

I see potential use for many areas, one is the CDS/TP/RULES, and for modeling archetypes and templates this would be a great alternative for people just tired of working with trees :slight_smile:

I can tell might be a little difficult for AQL editing, but I enjoyed to play around with the SQL example, is nice to discover what is possible/valid, and what is not. Maybe a good training tool!

An alternative is the App Inventor, which is used for high level programming (also a great learning/teaching tool) https://www.youtube.com/watch?v=R7EM81ihW9s

1 Like

The typical examples for blockly are also programing languages. In fact, one cool thing is that you can define several outputs from the same blocks (e.g. javascript & other programing languages). This could also be useful for openEHR rules, maybe outputting different versions or target formats

1 Like

BTW, one thing I didn’t mention that could be very interesting to explore to some scenarios (Task Plannning?) is that it supports collaborative usage (i.e. two different browsers changing the same model)

1 Like