The good, the bad and the "Wat?" of current simplified FLAT/SimSDT openEHR exchange format

Confusing subject #1: CONTEXT, CTX etc
Regarding context, ctx and event_context it gets a bit confusing especially when you come from (a fairly natural start of) having looked only at RM-spec (for example fig 14 below) and have not yet discovered https://specifications.openehr.org/releases/SM/latest/simplified_im_b.htm reverse-engineereed object model spec. of the simplified formats (“FLAT” and “STRUCTURED”) - that e.g. figure 6 and 7 below are copied from.

…/ctx/…
If we understand explanations in simplified_im_b and a related discussion correctly, then the “ctx” object seems to provide a possibility to set a mixed bag of defaults that will be (re)used in several parts of a COMPOSITION if not provided in other input. Note that “ctx” is a flat map of variables, NOT a mapping to any particluar RM context-related object.

…/context/…
Examples in the spec having a “…/context/…” are pointing to partially different things depending on if we’re talking about the (no longer actively deveoped?) “simNC” example…

    "/context/health_care_facility|name":"Northumbria Community NHS",
    "/context/health_care_facility|identifier":"999999-345",

…that points to the actual EVENT_CONTEXT object of the canonical RM model (as shown in the UML diagram in figure 14 below) - or if we are talking about the “simSDT” (now actively used by both Better and EHRbase) example…

  "laboratory_order/context/_health_care_facility|id": "999999-345",
  "laboratory_order/context/_health_care_facility|id_scheme": "2.16.840.1.113883.2.1.4.3",
  "laboratory_order/context/_health_care_facility|id_namespace": "NHS-UK",
  "laboratory_order/context/_health_care_facility|name": "Northumbria Community NHS",

…that actually points to the simplified S_EVENT_CONTEXT of the simplified_im_b model (see figure 6 below).

This really confused us, since in the real canonical RM the ways of setting an identifier (or several identifiers) for health_care_facility using PARTY_IDENTIFIED…
image
…should, according to Common Information Model allow/force us to add a list of several identifiers ( identifiers : List<DV_IDENTIFIER>) not just a single identifier that looks like is is attached directly to the to the (S_)PARTY_IDENTIFIED object. We do have use cases where it would be convenient to add more than one identifier to (S_)PARTY_IDENTIFIED objects.

So here comes actual questions:
Is it not possible (or just undocumented how) to add more than one identifier (e.g. a list of identifiers) to e.g. health_care_facility (and other S_PARTY_IDENTIFIED objects) using simSDT/FLAT format when submitting a COMPOSITION? Is it also impossible to use the external_ref attribute (that points to a PARTY_REF)?

…/event_context/…
Adding to confusion is that when you use the “OUTPUT” variant of FLAT/simSDT the …/context/… object is nowhere to be seen anymore, instead you get a structure like

  "chemoform-mba.v5/event_context/start_time": "2023-04-04T00:35:42.71+02:00",
  "chemoform-mba.v5/event_context/setting|code": "238",
  "chemoform-mba.v5/event_context/setting|value": "other care",
  "chemoform-mba.v5/event_context/setting|terminology": "openehr",

(The example comes from our experiments available in Release ChemoForm-MBA.v5.rc8 · regionstockholm/CKM-mirror-via-modellbibliotek · GitHub )

And this would probably be understandable if you knew that in “OUTPUT” mode we always get something looking more lik the RM for EVENT_CONTEXT, but for “INPUT” mode you shlould use the “ctx” or “context” way…
…BUT even when generating examples in “INPUT” mode in we get a mix of …/ctx/… and …/event_context/…

  "ctx/health_care_facility|name": "Hospital",
  "ctx/health_care_facility|id": "9091",
  "chemoform-mba.v5/event_context/vårdenhet/namn": "Namn 74",
  "chemoform-mba.v5/event_context/vårdenhet/identifierare:0": "79f7d19f-cc7c-4f95-9d9e-6ad4499a4d58",
  "chemoform-mba.v5/event_context/vårdenhet/identifierare:0|issuer": "Issuer",
  "chemoform-mba.v5/event_context/vårdenhet/identifierare:0|assigner": "Assigner",
  "chemoform-mba.v5/event_context/vårdenhet/identifierare:0|type": "Prescription"

Wat? Ah, maybe it’s a way of enabling use of the other_context attribute of (S_)EVENT_CONTEXT - but why not make the path less confusing …/event_context/other_context/…

After this we thought - “maybe we can use the path …/event_context/health_care_facility/… also for input purposes” to e.g. add a list of idenitfiers to health_care_facility, but then we get errors from the CDRs when trying to commit a COMPOSITION. (Thus the question in bold above…) Or maybe it would work better if not exporting with Swedish as the primary template language?

Phew…

IMAGES refenced above


Source: EHR Information Model figure 14


Source: openEHR Simplified Information Model 'B' figure 6


Source: openEHR Simplified Information Model 'B' figure 7

1 Like