various reference implementation patches

Hi everyone,

Pleased to meet you...I'm Leo, I work at MEDvision (formerly known as ZorgGemak, one of those shiny Dutch openEHR companies), I do some work on our version of Bert's openEHR kernel. I come bearing patches!

We've been making some more extended use of the reference implementation in our own codebase, particularly for doing some code and data generation, and for some associated automated testing. That means I'm slowly accumalating a batch of patches at

  https://github.com/ZorgGemak/java-libs/

especially in the rm-builder/RMInspector area, and their use in the xml and dadl bindings. I was thinking they might interest some people here :slight_smile:

Patches so far

Hi Leo, I wonder why you are working on the dadl-binding.

Do you have plans to use it as data-definition, or in another way?

Bert

Hey Bert,

For general information :

dADL has been renamed ODIN, see Github repo here <https://github.com/openEHR/odin&gt;\. The spec is very much alive and being maintained. It has been separated out from ADL (you will see this in the next release of openEHR) and I believe we'll continue to use it as something like a more powerful JSON kind of thing.

For interest - it's now not just limited to openEHR; the BMM files that we create in ODIN are now being used by CIMI, and there is an Enterprise Architect plugin for outputting an ODIN BMM file from a UML model.

Some of you may have noticed that the ADL workbench now serialises in ADL, JSON, YAML, XML and ODIN. Leo's comments below are correct - if you look at JSON and ODIN-ised archetypes you can more or less understand the structure. YAML is also reasonably readable. XML works of course, but more painful...

There is a Java dADL (ODIN) parser and serialiser. As it gets used, people here will probably have more requirements both of the component and maybe ODIN itself. Please make those needs known - here and especially on the issue tracker of the ODIN Git repo above.

thanks

- thomas

As far as I understand ODIN, which not much, I admit, but I think following is true.

ODIN, like DADL, and also like XML keep the object visible in the notation.
The main advantage above XML is emphasized, is the human readability.
I don't know whoever wants to read it. But there are good tools to make XML readable.

The disadvantage remains:
The client software must represent, in one way or another, the archetype-based object in its internal structures.
So this means that a GUI programmer still needs to understand and reproduce the object, so still needs to know all about the archetype/object. The programmer needs to understand the reference model.

I experienced this as a major blocker for getting OpenEHR implementors to work.
I tried it with people from India, and China, and Spain and Israel.
They were all overwhelmed by the complexity of what they needed to implement, just to write a simple GUI. Many of them failed in doing so. Weeks of support and Skype-sessions did not let them see the light.

This was really bad news for my OpenEHR-kernel.
I wondered why there were not many OpenEHR implementations at that time, and I think, the needed knowledge to work as a client-programmer was one of the causes.

ODIN is dADL, renamed, and separated into its own specification it’s more about being able to write it without special tools. And it’s 1/2 the size of the equivalent XML well if they have produced a Template Data Schema (TDS) or Template Data Object (TDO) then… not really. And some companies are producing complete UI from the template. I think they probably were trying to do the wrong thing. Most programmers don’t need to understand the archetype - just the templated set of data points. If they can’t do that they can’t do their work, even if they’re not using openEHR. for that you should just use TDS or TDO - that’s what they are for. You could design a different TDS or TDO to flatten even the data types to just numbers I guess, but I think programmers who can’t be bothered to deal with even that are being a bit lazy… it would be good if you can share some examples of this approach. I certainly agree that most developers should not have to read about ADL, most of openEHR RM or other complexities. That’s why we built the TDS, TDO, API and other generators (clearly more and better ones will come along in the future). Other ways of achieving this kind of programming are of interest, and we need to rationalise them and share them, so they are consistent and understandable, and easy to use. All in all, it sounds like very interesting work. - thomas

Hi folks,

I come bearing patches!

...

I'd hope someone with commit privileges would be happy to merge them back into the reference implementation.

What's the typical process?

While the odin/dadl/templating discussion is of course also fascinating...any interest in the code? What do I do? :slight_smile:

cheers,

Leo

Hi,

I'm Ralph and I also work at MEDvision. Currently I am trying to figure
out what kind of API those UI people would need.

I saw your comment about templates and I would like to know more about it.

I tried looking it up on the openEHR website but I could not find it.
Could you point me in the right direction where I could find:

- information about these templates
- opensource example projects

and most important:

- tools for creating these templates

Thanks,

Ralph van Etten
MEDvision360

The disadvantage remains:
The client software must represent, in one way or another, the archetype-based object in its internal structures.
So this means that a GUI programmer still needs to understand and reproduce the object, so still needs to know all about the archetype/object. The programmer needs to understand the reference model.

well if they have produced a Template Data Schema (TDS) or Template Data Object (TDO) then.... not really. And some companies are producing complete UI from the template.

You are right, Thomas, it is promising.

Now I need to explain why I decided to do it another way.
My path/value-work was started about three/five years ago, and the GUI-developers were/are happy with it.

So, first what was the emphasis in template-discussions a few years ago:

In that time, templating was often talked about in the context of combining archetypes.
This fitted in the idea of having several standard archetypes available in CKM and pick whatever one needed from them.

You can recognize this idea also in the fact, that there wasn't thought of archetypeId-structure in context of collisions which were very probable to happen in a world were people wrote archetypes themselves.
I remember how hard it was to explain my point on this on this list, a year ago. But now it is accepted.

So. in that time, I needed to leave the OpenEHR mainstream thinking about that.

In my experience archetypes to use were often inspired from CKM, good examples, that how it was understood.

As I said, the idea was using lego-stones and connect them with templates.
But this was hard to sell as a specific advantage of OpenEHR. Because most reference models offer this LEGO-concept.
Even well-thought-of legacy does. Like LDAP, in LDAP you find this LEGO-idea.

In addition, in the perception of many people, archetypes needed to be complete datasets which served a specific data-requirement/context completely.
You can also see this in the meta-information in archetypes.
So, what was then the use of having a concept of combining parts of them?

I remember that it was an example written by you why HL7 was no good. (my interpretation/remembrance of your writing)
The HL7 community had an ADDR datatype. And if one thing was bad, it was creating an ADDR-datatype, because there was no way, you could be sure every possible address convention would fit in it.
There are so many address-conventions, or name conventions that it is hard to write LEGO-stones which define them suitable for all cases.

I often, gratefully, used this example, but after that saying that using parts of the CKM-standard-defined ADDR-archetype in templates, seemed conflicting.
What would be the use of templates then?
So I explained that OpenEHR always gives the possibility to write your own Address-archetype, and I did not mention the archetypeID collisions which would became possible then.

I made my money with OpenEHR, but the customers thinking was HL7, that was what they learned at school.
So if they wanted OpenEHR, they wanted it to fit in their thinking, but leaving out the disadvantages.
HL7 was so rich, it had the extensive CDA, but also the summaries like VMR or other summary-definitions, software-eco-system, and tons of message-definitions.

I also had that joke, for those who do not know it:
B: I create an HL7 standard which makes all others obsolete
C: I create an HL7 stand......

How many hours I talked in explaining why OpenEHR is better then CDA or other HL7-definitions.
People had difficulties to believe that, because CDA was widely accepted on the market.
Additionally, It often turned out that they often did not know HL7 and they did not know OpenEHR, but still, that were the people to decide. That were the people to convince.
What they did was talking to more people to question, and making lists of features.
Most important arguments I used were flexibility and ownership. Just call, and we write an archetype.
It gave the idea of having control and specific needs being served

So, templates as a way of combining archetypes did not fit very well in this philosophy.
That was the level of thinking at decision-makers and technical state of art, only a few years ago.

Now you describe as main advantages of templates, that it is a way of communicating with the OpenEHR-kernel without needing much understanding of what OpenEHR is in detail.
You are right in this, I never thought about it.
What I created is a kind of templates, but then not externally defined.
Because some archetypes behave like a template, like Compositions, it are the content-items which decide the kind of composition. The composition itself is just a slot-connector, with some additional information.

So, that is how it works, for me
Think of having every leaf-node in an archetype having a unique-path inside that archetype, and then there is the leaf-value. There maybe slotted archetypes in the path.

But I think that what you describe now as template-use, a communication-protocol, will be the mainstream. So I will adapt it to to my kernel. Thanks for this advise.
I don't think it is hard to do, because, as I said, a kind of templating was already in my concept. The TDO-idea is very good, that is very convincing.
I am sure I can find matured worked out definitions or examples of this.

Only one remark on your writing rests to explain

But what the GUI-programmer really would need to know is how to communicate, for example a blood-pressure.
There was no need for the GUI-programmer to understand the difference between DvCodedText, CodePhrase, DvQuantity, ItemList, ItemTree, Composition, Section, ContentItem.
The GUI-programmer just needed a location to write the value 180, while sitting.
(I know, high bloodpressure, the patient is at medical care for reason :wink:

for that you should just use TDS or TDO - that's what they are for. You could design a different TDS or TDO to flatten even the data types to just numbers I guess, but I think programmers who can't be bothered to deal with even that are being a bit lazy...

I shouldn't call them lazy, mostly people are under pressure, and they want a working solution.
I am sure you agree with this when you think again.

Projects have time-schedules, and it is not possible to say something like: we are defining a solution for next year. We postpone the project, and then the money stops flowing, but we have our savings and wait.
I know other companies, well known companies, which had similar struggle too, a few years ago.

regards
Bert

Hi Leo,

Picking this up…
I guess Rong should decide what to do with it.
Personally, I think most of your changes are uncontentious, but I have a few minor questions below which probably simply show my misunderstanding of what you did - see below.

Well, ok, but is Math.floor() correct in l. 69 +74? Math.floor(1.1)==1 is true, but for unitary, 1.1 is still a wrong denominator? Likewise for the denominator? So the cases you catch are correct, but they are only a subset? For the other checks you commented out (ll. 81): Are you sure that they won’t work? (This of course assumes that isBothIntegral() actually checks correctly if they are integral.) Not sure I understand why this may cause a StackOverflowError…can you clarify? The problem with simply leaving it out is that equals() and hashCode() won’t work reliably anymore when only the parentResource is different? Personally, I am happy with removing log4j. Cheers Sebastian

Hi Sebastian,

Picking this up...

Thanks muchly!

I guess Rong should decide what to do with it.

:slight_smile:

Personally, I think most of your changes are uncontentious, but I have a few minor questions below which probably simply show my misunderstanding of what you did - see below.

Great to hear.

Numbers

Hi Leo,
first of all, thanks for the fixes, they are very welcome. :slight_smile:
Sorry for the late reply, it's been almost a month since your first e-mail...
Rong said to go ahead with the merge, and for what I've read from Sebastian, he is ok with the changes too (please let me know otherwise).

Can you do a pull request? I guess I could do it myself but I wanted to check with you before, in case you have other changes.

Cheers,

iago

Hi Iago,

Great to hear from you, I was getting worried :). Yes, sure, I'll submit a pull request.

I think I have a few other minor changes since, this evening I'll sort through what is and is not useful since there's one or two changes since my original e-mail that you definitely don't want, so I have to filter that out and make sure you can get one pull request that applies cleanly!

cheers,

Leo