OPT version, schema & document

Many thanks to great contributors !
I’m Seung-Jong Yu and not a newbie but kind of lurker :slight_smile:

I can’t categorize my topic, so post here.
I have some OPT-related questions while I’m making some templates and export it in OPT using Better’s Archetype Designer.

Here are questions.

  1. OPT of Better’s Archetype Designer has some unknown attributes and omits those (via Cabolabs’ Operational Template XML Validator). For example, the former are “matches_negated” , “Ontology” and “component_ontologies”, the latter are “<node_id/>” and "<view>…</view> ".
    Do those follow the openEHR specification? If yes, gap in different OPT versions?

  2. For checking 1), I am searching OPT document and schema. But I have not found any clues in various resources yet. Then is below right?

(1) The link of OPT1.4 is dead ,but from other threads, there is no link now, so if I have question, a specific question needs to be posted on this forum. And OPT2 document is not finalized.

(2) All OPT Schemas are in https://github.com/openEHR/specifications-ITS-XML. Those are latest.

Any helpful comments are welcomed !

Best regards

Seung-Jong Yu MD

Hi ,

Thanks for flagging this up.

Could you send the template fileset AD-> Export-Template Fileset so we can see the specific example? Just attach it here?

I might try to move this to a more technical category but carry on replying here


Thank you for fast reply.

Please file attached and you also can see my “SOAP” template in “Seung-Jong” repository of Better’s Archetype Designer.

Seung-Jong Yu MD

2020년 3월 19일 (목) 오후 6:08, Ian McNicoll via openEHR discourse@openehr.org님이 작성:

(Attachment SOAP.zip is missing)

Hi sorry - the attachment is missing - I think Discourse may block some file attachments - can you send it to ian@freshehr.com and I will post it.

@sebastian.garde @borut.fabjan - can you help with this ?

Template File set is at - https://www.dropbox.com/s/odu67dh3c2x2lsd/SOAP.zip?dl=0

I cannot contribute much to this, but since you asked, I’ll share what little I know:

  • I can’t remember seeing matches_negated before.
  • Re ontology: this seems to exist as a separate element, but I am not sure I have seen this used. It seems you can just add term_definitions etc. directly to the definition in the opt14 and this seems to be what is done instead of separating this out into ontology and component_ontologies. Not sure if this is just interchangable. But if so, I would have expected the term_definitions etc. to be underneath, whereas in your example it is just the archetype ids on their own…This is probably syntactically ok, but not sure what purpose it would serve?

Hi, I don’t know if the schemas are being correctly versioned right now, but for OPT 1.4 validity you can check them on the openEHR Toolkit that validates against the OPT 1.4 XSD https://server001.cloudehrserver.com/cot/

I mentioned on another thread that the Marand tools might generate OPTs differently from the Template Designer, and also might be different to the OPT 1.4 XSD.

@sebastian.garde I add component_ontologies and <view>…</view> to original thread as unknown & omitting cases.

@pablo I agree. Better’s Archetype Designer may have their own syntaxes.

how can I solve it?

Ontology, component ontology and views were definitely introduced by the Ocean Template Designer so it is possible that the XSD has not been updated

I’m not sure about <match_negated> @borut.fabjan @matijap - any idea what this is for in the .opt? It is certainly not in the Ocean .opt that I can see.

The .opt generated by CKM (which based on an Ocean webservice, which should match TD behaviour) does contain the


Compared to the Better .opt it also does not contain and <component_ontologies> but I have checked and I know that TD definitely used to generate these elements. They are used to carry multiple languages within an .opt. I suspect the difference is that the Better version is always to generate these elements, even if the template carries only a single language, whilst Ocean generate it only when there are multiple languages.

So the upshot is that I think the only real difference in the two formats is <match_negated> which Better seeme to have introduced, and that the .xsd that Pablo has (and I think this was the only one that could be found) does not reflaect some other more recent changes (at least 5 years old) in .opt generation, whoich are in fact common to both Better and Ocean.

Suggest we clarify and then update the .xsd

@ian.mcnicoll Thank for your very helpful summary !

The issue I see is we don’t have a managed versioned environment for OPT XSDs, so everyone might be using a slightly different OPT structure. We need to know what is OPT 1.4 XSD v1.0 and what is OPT 1.4 XSD v2.0, and that should be differentiated from OPT 2.0 XSD v1.0 (note we have two versions of the OPT spec and different versions and revisions for the correspondent XSDs for each OPT version, and AFAIK no XSD is currently versioned so we don’t know what we are using, or what is current). This should be formally defined, “common practice” or “recent changes” is not a formal versioning system :frowning:

Also AFAIK, this wasn’t discussed in the SEC and IMO should be a priority to avoid confusing devs.

1 Like

Completely agree Pablo. It is confusing for relative outsiders (and some of us insiders!!). The good news is, I think, that for practical purposes there is not a major issue - the various differences in actual .opt formats are pretty minor and any ‘real’ incompatibilities seem to have been resolved between Ocean and Better’s tooling.

The real issue is that the formal .xsd has not kept up with ‘de-facto standard’ usage and I suspect is not used internally by either Ocean or Better.

Id be happy to help pester tooling suppliers if someone (hello Pablo!!) could have a go at updating the .xsd to reflect current usage.

  1. Support ontology and component ontologies (Better and Ocean)

  2. Support view (Ocean only)

  3. Find out from Better about match_negated - Ian

I guess we need, before updating anything, to establish a versioning scheme and identify different XSDs around as different versions of the same initial XSD, which I would say is v1.0

In my case the first OPT 1.4 XSD that I found was in 2015, I think was part of the Template Designer or ADL Workbench, and did small changes since then, which are documented here https://github.com/ppazos/cabolabs-ehrserver/commits/branch_v1.5.1/xsd/OperationalTemplate.xsd

So the main thing would be to gather XSDs differnt implementers are using and do a diff to check what they have added, then say “this is v1.0, that is v1.1, etc”, after that, agree with them to use that version number/semver.

After that, I would also ask implementers to manage change requests in the main repo to avoid local changes, so the SEC can manage versions and releases.

Also would be useful to identify which XSD version is used on different modelling tools to avoid issues, which we are having right now between Ocean and Marand tools. In LinkEHR I think you can upload any XSD and work with that, would need input from @yampeku

Currently support to OPT in LinkEHR is handcrafted. If I remember correctly, I found some parts in OPT that weren’t in the XSD Pablo provided me back in the day, so kind of reverse engineered it.
On other matter, XSD import in LinkEHR is restricted to RM creation or data source definition for mapping.

Thanks Diego, would it be possible to use different OPT model versions or would that be a huge change to LinkEHR?

Probably they can be supported with not too much work, as more or less everything should be there. If it changes completely then more work would be needed.

I’m not sure we need ot support multiple versions, just a latest version, then properly handle it from there. In practice , things seem to be working pretty well without a ‘current’ XSD, and TBH if the tooling vendors are not rally using an XSD internally it is going to be quite tricky to find/pin-down older versions.

We basically have 3 ‘public’ tooling vendors


Right now Better / Ocean are virtually aligned, in working practice i.e the .opts are interchangable other than for some minor differences. Let;'s sort out those differences. document them, and cross-check with LinkEHR and go with that as the baseline. Then govern properly from now on?

Let’s be careful not to waste too much energy on an issue which I agree should be fixed but is not actually a practical problem right now for working tooling.

1 Like

Probably need to check with @sebastian.iancu who did a lot of work organising XSDs; don’t know whether he got a definitive one for the OPT 1.4, but the only things anyone should be using are in the specifications-ITS-XML Git repo. I don’t see an OPT XSD in there, but if we have a candidate, let’s put it in.

1 Like

That’s the problem - the only candidate that anyone could identify is the old version that Pablo has. It is out of date but the new aspects have mostly been in place for a long time - that version just needs updated to reflect what is actually a high degree of alignment in .opt.

I don’t think we need to “support” but to start “tracking” changes. Support means maintaining old versions, what I was referring to was to detect changes between versions and assign a version number to each one, then keep maintaining the last one, but have all the XSD versions under one versioned environment.

This is very easy thing to do, and I can do it, we just need the XSDs each provider is using, I can merge the XSDs into one file (http://www.strategicdevelopment.io/tools/SchemaLightener.php) then do a diff comparing 2 by 2 and noting the changes. The file with most changes will be the latest version, and I guess the one I have imported in 2015 is the first version.

Also this comparison will let us know if there are any incompatibilities between the XSDs out there, that is a more difficult thing to solve since different implementations might rely on different rules. That is why we can’t just keep track of the latest version only: implementations using incompatible XSDs will be forced to adapt and that might not be possible. Incompatible means some element is required by the new schema but was optional or didn’t exist on a previous one.

Would it be possible to get the XSDs from Better and Ocean?

1 Like

BTW the one I have is a merge from the multiple modular XSDs I found back in 2015, just because working with one file is easier than working with many. But I might have the original files somewhere on an old VM.