EHRBase and ADL2.0

@NeoEHR could you please share some more info? How much handwork is needed to generate an api for a specific template? And what is the (data)model/schema for the api, usually it’s OpenAPI, right?

1 Like

@joostholslag I had to spend some time writing the generators, but now it takes no handwork to generate an api for a template. Is this what you meant?

I have OpenAPI and GraphQL generators, but they require some more work – mostly to decide how to represent all the complexities of BMM and ADL in these formats. Once that is done it would take “a day” of handwork to add it to the generators.

Closest to production are Java “domain model” classes. The first screenshot is a classic approach with named setters. The second is using a LOINC code to automatically set the corresponding values. This is the approach @thomas.beale “added” to the generator.

All the classes used in the example are generated from OPT2.

LOINC:

1 Like

When we speak of this kind of content-based API, it’s not canonical RM API calls like in the official openEHR API, it’s the API of a (Java / C# / whatever) class that is used at the programming level.

OpenAPI is what you write web-visible APIs with; the API of a Java class is not (on its own) visible through a web protocol like REST or Protobuf or whatever. Of course, it can be connected through to such a web API, if we wanted these kind of classes to be exposed that way, but they are normally used in two places:

  • client-side app programming, where you bind in the generated class(es) and your own code can make calls that create the (say) VitalSignsEncounterTemplate class, and then do a lot of calls like myVsTpl.setBloodPressureSystolic (args), etc, and then at the end make a call like generateJson;
  • server-side integration programming, where a data ingestion engine is processing data items and has determined (in our approach) the canonical LOINC code for the item (by various tricks) and has a data object to go with it (i.e. some Quantity representing the value of systolic BP); the calls will be then of the form setViaLoincCode (aLoincCode: String, args)

The classes generated by @NeoEHR 's tools from a template provide both of the above programming level APIs rolled into a Java class.

FYI: We got something similar in the EHRbase openEHR SDK, but ADL 1.4 only for now.