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

Hi!
I recently created a template based on the COMPOSITION.review.v0 archetype. However, we ran into some issues when trying to save a composition in Better Studio. After spending some time troubleshooting, @erik.sundvall suspected that it might be a similar issue to the one described in this thread. I’d really appreciate any help in understanding whether this is the same kind of problem, and if so, how it can be resolved.
Ping @ian.mcnicoll :smiley:

This does look like the same problem

Scroll up yhrough this topic for the fix

The good, the bad and the "Wat?" of current simplified FLAT/SimSDT openEHR exchange format - #38 by ian.mcnicoll

Can you post the fixed archetype to ckm as a change request to prevent future issues for others.

2 Likes

I have now submitted a change request and attached a corrected archetype, which I believe has been fixed in the same way as COMPOSITION.self_reported_data.v1.

3 Likes

I’ve imported and committed the proposed new revision, with some minor fixes.

2 Likes

@ian.mcnicoll’s post cited above saved the day again today when some colleagues and I in an implementation tried to understand the “simplifications” done in the “simplified” format. There is a lot of non obvious black magic happening under the hood in the simplified format implementations that make it difficult to understand for somebody looking at the “normal” openEHR UML-diagrams. Now, thanks to heroic work of @sebastian.iancu and inventors from Better and implementers from Vitasytems and others there is finally an explanation of the black magic published at Simplified Formats for openEHR Data

Somebody just following an example-document for a specific simplifed format will likely have an easier time than somebody looking at the UML unaware of the black magic, so below is an example regarding the Swedish use of both 2x nested Organisation archetypes (in an ITEM_STRUCTURE under EVENT_CONTEXT.other_context) and the RM-built-in EVENT_CONTEXT.healthcare_facility to represent care units (“vĂ„rdenhet”) and healthcare provider organisations (“vĂ„rdgivare”) at different levels as described in https://openehr.atlassian.net/wiki/spaces/SWE/pages/1893105737/PDL+i+openEHR.

In the Swedish case we do not want to use external_ref inherited to PARTY_IDENTIFIER but rather use identifiers inside the PARTY_IDENTIFIER object itself:

When to use underscores and plural-“s” on the key identifier in this mix is far from obvious for beginners


Excerpt in simplified FLAT format:

        "granskning/context/_health_care_facility|name": "S BĂ€ckencancer MBA QA",
        "granskning/context/_health_care_facility/_identifier:0": "SE2321000016-C4DV",
        "granskning/context/_health_care_facility/_identifier:0|type": "urn:oid:1.2.752.29.4.19",
        "granskning/context/vÄrdenhet/namn": "OO Cancer TC QA",
        "granskning/context/vÄrdenhet/identifierare:0": "SE2321000016-ADNF",
        "granskning/context/vÄrdenhet/identifierare:0|type": "urn:oid:1.2.752.29.4.19",
        "granskning/context/vÄrdenhet/roll:0|code": "43741000",
        "granskning/context/vÄrdenhet/roll:0|value": "vÄrdenhet",
        "granskning/context/vÄrdenhet/roll:0|terminology": "http://snomed.info/sct/900000000000207008",
        "granskning/context/vÄrdenhet/vÄrdgivare/namn": "PDL-vÄrdgivare SLL IdP QA",
        "granskning/context/vÄrdenhet/vÄrdgivare/identifierare:0": "SE2321000016-I1MN",
        "granskning/context/vÄrdenhet/vÄrdgivare/identifierare:0|type": "urn:oid:1.2.752.29.4.19",
        "granskning/context/vÄrdenhet/vÄrdgivare/organisationsnummer:0": "2321000016",
        "granskning/context/vÄrdenhet/vÄrdgivare/organisationsnummer:0|type": "urn:oid:2.5.4.97",
        "granskning/context/vÄrdenhet/vÄrdgivare/roll:0|code": "143591000052106",
        "granskning/context/vÄrdenhet/vÄrdgivare/roll:0|value": "vÄrdgivare",
        "granskning/context/vÄrdenhet/vÄrdgivare/roll:0|terminology": "http://snomed.info/sct/45991000052106"

Excerpt in simplified STRUCTURED format:

                 {
                    "_health_care_facility": [
                        {
                            "|name": "S BĂ€ckencancer MBA QA",
                            "_identifier": [
                                {
                                    "|id": "SE2321000016-C4DV",
                                    "|type": "urn:oid:1.2.752.29.4.19"
                                }
                            ]
                        }
                    ],
                    "vÄrdenhet": [
                        {
                            "namn": [
                                "OO Cancer TC QA"
                            ],
                            "identifierare": [
                                {
                                    "|id": "SE2321000016-ADNF",
                                    "|type": "urn:oid:1.2.752.29.4.19"
                                }
                            ],
                            "roll": [
                                {
                                    "|code": "43741000",
                                    "|value": "vÄrdenhet",
                                    "|terminology": "http://snomed.info/sct/900000000000207008"
                                }
                            ],
                            "vÄrdgivare": [
                                {
                                    "namn": [
                                        "PDL-vÄrdgivare SLL IdP QA"
                                    ],
                                    "identifierare": [
                                        {
                                            "|id": "SE2321000016-I1MN",
                                            "|type": "urn:oid:1.2.752.29.4.19"
                                        }
                                    ],
                                    "organisationsnummer": [
                                        {
                                            "|id": "2321000016",
                                            "|type": "urn:oid:2.5.4.97"
                                        }
                                    ],
                                    "roll": [
                                        {
                                            "|code": "143591000052106",
                                            "|value": "vÄrdgivare",
                                            "|terminology": "http://snomed.info/sct/45991000052106"
                                        }
                                    ]
                                }
                            ]
                        }
                    ],

I understand you are talking about the current situation, though If I would design this from scratch, I would check for some unambiguous serialization processes for complex structures that might be more optimal than JSON, for instance PHP has a great serialization for complex objects/types.