Create native JSON composition format from OPT

yep. That was it. Thanks again

Hello again. I have a question probably for @birger.haarbrandt

When I invoke REST GET for a EHR I created and to which I already posted few compositions I receive the EHR with the contributions value null. This happens both for JSON and XML compositions posted.

The compositions are saved in the system. I’m sure because all the GET composition by compositionId call succeed.

Example of a REST GET EHR call response:
{“compositions”:null,“contributions”:null,“system_id”:{
“_type” : “HIER_OBJECT_ID”,
“value” : “7fb582bd-fec8-4305-8db8-1016d08e9691”
},“ehr_id”:{
“_type” : “HIER_OBJECT_ID”,
“value” : “af495abf-3ab0-486c-b283-1f5839dbb931”
},“ehr_status”:{
“_type” : “EHR_STATUS”,
“subject” : {
“_type” : “PARTY_SELF”,
“external_ref” : {
“_type” : “PARTY_REF”,
“namespace” : “default”,
“id” : {
“_type” : “HIER_OBJECT_ID”,
“value” : “b5041241-9dbd-4c52-9e97-3f61844af93a”
}
}
},
“uid” : {
“_type” : “HIER_OBJECT_ID”,
“value” : “d9921a01-6dc6-4afb-b9a4-ff7935354a3e”
},
“is_modifiable” : true,
“is_queryable” : true
},“time_created”:“2020-03-23T11:55:58.906604”}

There is actually functionality missing there. I hope that we can add this within our alpha phase within the next 2 months! Creating according AQL queries is straight forward.

all right. Thanks. Talking about AQL queries presently are supported only queries within a single EHR context ?
I read that is missing the ehr projection (ehr e projection not supported). That implies I cannot do population queries yet ? I mean queries where I look for all the EHRs that fit a certain constaint ? Or is there another way to do them?

EHRbase supports cross-patient queries. The projection thing is just that is has not been possible to use a partial paths when trying to retrieve the EHR ID. Try the following query as an example:

{
  "q":
    "select distinct e/ehr_id/value, c/uid/value from EHR e contains composition c "
}

This will get you all EHR IDs and the corresponding uids of the compositions

I now understand. Thank you for your explanation and example

no problem, I will also try to add a postman collection as part of the documentation to make things a bit easier.

1 Like

Hi @birger.haarbrandt,

I was creating queries through ehrExplorer and I came across this query:

select a#uid/value, a#archetype_details/template_id/value
from EHR e[ehr_id/value=‘2ddb12ef-c69b-4943-9358-34376c90d80a’]
contains COMPOSITION a
offset 0 limit 100

is this an example of projection? is projection marked then by the use of the # sign?

No this is Better’s internal AQL path syntax, used to power the AQL Builder. It will not run in a CDR.

You need to convert this to 'canonical AQ’L via the ‘Tidy-up’ option in Ehr Explorer and also remove the new lines.

select e/ehr_id/value as ehr_id, a/uid/value, a/archetype_details/template_id/value
from EHR e
contains COMPOSITION a

should work and return anyone who has a composition

Are there tools available for implementing BMM in other languages? Any Antlr grammar? How does a developer go about doing this? As far as I can see, Archie is the only open-source implementation of the openEHR RM and this seems to be a bottleneck.

There are at least 2 open source implems of the openEHR RM:

  • Archie - most recent, mutable-objects design
  • java-libs - immutable-objects design

For using BMM via Java, Archie is up to date with the BMMv2 that is in current use in openEHR. The current persistence format is ODIN-based, and is an object-graph based on the P_BMM transformation (BMM simplified for serial persistence).

BMM3, which is under development now will have a new serial syntax and grammar, but it is not available yet.

If you want an alternative to BMM, there is JSON schema, which is under development (Github repo), but I think already there is a complete RM. @sebastian.iancu and I think people in Highmed (@birger.haarbrandt ) have primarily developed this, so should be able to help with it.

There are other expressions of the RM, e.g. in XSD, but none are high-fidelity representations of the model, because these other formalisms lack generic classes and/or inheritance and/or other facilities, so they are technically mappings. However: they are perfectly usable, and are in use in various implementations.

Hope this helps.

1 Like