CONTRIBUTION builder supporting collaborative (multi user, multi device) editing? GraphQL? Operational Transformation?

I’ve read @erik.sundvall 's paper and this post about the “contribution builder”.

It took my brain cells 3 days to “tell me” that the “contribution builder” is my “toJson()” method on an OPT class (e.g. BloodPressure.toJson()). It has a reverse format of the “fromJson” on the AM’s “OperationalTemplate” class that loads the OPT.

Maybe I should rename it to “toContribution()” :thinking:
It prepares the canonical JSON that is part of the openEHR specifications. The JSON is then sent to the CDR’s REST API. I hope I got this part right (I still have some reading to do about contributions/compositions).

This way I can skip all the other intermediary formats (FLAT, SDT).

Here is a sample code of how it is used:

This is the BloodPressure class generated from the OPT:

There are 893 lines of similar classes - they stop when RM data types are reached:

The RM classes are also generated and are imported in the first line of the first screenshot above. The RM release (e.g. 1.1.0 in this case) is taken from the OPT.

p.s. Erik and I were discussing this via email but Erik asked to move it to the forum :blush:

1 Like