# Archetype editor, CKM and v0 & v1

**URL:** https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380
**Category:** Technical (archive)
**Created:** [22 July 2015 11:33 UTC](https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380 "2015-07-22T11:33:24Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![Barnet\_David\_HEALTH](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/b/df705f/32.png) [@Barnet\_David\_HEALTH](https://discourse.openehr.org/u/Barnet_David_HEALTH)
#### Post date: [22 July 2015 11:33 UTC](https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380/1 "2015-07-22T11:33:24Z")

</div>

Hi All

I’m having a bit of an issue with CKM re-versioning archetypes and slots that reference Clusters.

When I create a new archetype in the archetype editor (Version 2.2.905 Beta), the archetype is saved as version 1. For example

“openEHR-EHR-OBSERVATION. blood\_pressure.v1.adl”

When I upload the archetype to CKM, the process renames the archetype to version 0 – for example “openEHR-EHR-OBSERVATION. blood\_pressure.v0” (we are hosted on version 1.4.0 of the Clinical Knowledge Manager)

The re-versioning becomes an issue when I use slots. In the Archetype editor I can assign a slot to a Cluster (for example), but this process creates a link to a version of the Cluster. If it’s a new Cluster, this will be version 1. When the Cluster and the archetype are uploaded to the CKM, they are both put back to version 0. However, the slot Cluster is looking for version 1 of the Cluster, which won’t exist on the CKM (so CKM can’t make the link between these 2 objects).

Does anyone have a work-around, or have some advice and guidance, for this issue?

Kind Regards

Dave Barnet  
Interoperability Lead

Interoperability Specifications

Health & Social Care Information Centre  
[david.barnet@hscic.gov.uk](mailto:david.barnet@hscic.gov.uk)  
[www.hscic.gov.uk](http://www.hscic.gov.uk)

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [22 July 2015 12:20 UTC](https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380/2 "2015-07-22T12:20:11Z")

</div>

Hi Dave,

I recognise the problem which is a result of the transition to a much richer and better versioning mechanism.

The Archetype Editor has been updated to handle the new versioning (on the openEHR Github, not released yet ) but we will need to adapt the slot fill regex to allow for .v0 archetypes, which are now the default for new, uncontrolled archetypes.

The default regex for slot-fill pattern needs to be changed to allow any Version not just V1

openEHR-EHR-CLUSTER.context\_detail(-[a-zA-Z0-9\_]+)\*.v1/}

I am not a regex expert - If someone can guide me on how to change this to allow .v\*, I can update the AE code.

We will almost certainly have to edit some legacy archetype ADL as well.

Ian

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [22 July 2015 12:55 UTC](https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380/3 "2015-07-22T12:55:32Z")

</div>

Put v[0-9] or v0-9\* to allow multiple subversions

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [22 July 2015 13:11 UTC](https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380/4 "2015-07-22T13:11:55Z")

</div>

Thanks Diego

What is the difference between the 2 ?

Ian

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [22 July 2015 13:29 UTC](https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380/5 "2015-07-22T13:29:46Z")

</div>

Second one allows both the new and the old versioning (e.g. v0.0.5 vs v0)

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [22 July 2015 14:00 UTC](https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380/6 "2015-07-22T14:00:10Z")

</div>

That will be the one then.

Thx

Ian

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [22 July 2015 14:26 UTC](https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380/7 "2015-07-22T14:26:57Z")

</div>

My understanding was that minor version and patch version would not be part of the normal archetype id, which is what you are looking for here?  
Otherwise you’d need to allow “-alpha” etc here as well?

Sebastian

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [22 July 2015 14:40 UTC](https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380/8 "2015-07-22T14:40:38Z")

</div>

Good point Sebastian,

I was really thinking towards the future and the same slot constraints appearing or being redefined in templates where tighter constraints might be needed.

Is that overkill?

Ian

---

<div class="post-metadata">

### Author: ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)
#### Post date: [22 July 2015 15:37 UTC](https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380/9 "2015-07-22T15:37:17Z")

</div>

Technically speaking, if we want to properly match any archetype in a slot, we need a regex that will match any level of versioning id. Since matched archetypes will eventually all have 3-part versions (but today might have only 1-part versions), we need to match thngs like

.v0  
.v1  
.v0.0.1  
.v3.0.2

and so on. So Diego's expression will do that. But Sebastian is correct - some of the matched archetypes could be test or research archetypes. So you need the remaining bit as well. You could in theory use:

v[0-9]+(\.[0-9]+(\.[0-9]+((-rc|-alpha)(\.[0-9]+)?)?)?)?  
but I would say it is overkill (you only use regexes like that when you think there could be garbage version ids and you want to catch them and reject them). A reasonable balance is probably something like

\.v[0-9]+.\*

which forces at least one digit of major version, and allows anything at all to come after, which is reasonable if we assume that no tools will create completely invalid version ids.

For reference, there are some useful regexes here \<[https://github.com/openEHR/adl-tools/blob/master/libraries/openehr/src/am/archetype/archetype\_hrid.e&gt;\](https://github.com/openEHR/adl-tools/blob/master/libraries/openehr/src/am/archetype/archetype_hrid.e&gt;%5C).

- thomas

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [22 July 2015 15:55 UTC](https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380/10 "2015-07-22T15:55:50Z")

</div>

Thanks Thomas,

I will go with

.v[0-9]+.\*

which will give us a bit of flexibility and solve Dave’s problem (I think!).

unless anyone strongly objects, of course.

Ian

---

<div class="post-metadata">

### Author: ![Peter\_Gummer1](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/p/258eb7/32.png) [@Peter\_Gummer1](https://discourse.openehr.org/u/Peter_Gummer1)
#### Post date: [22 July 2015 22:34 UTC](https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380/11 "2015-07-22T22:34:44Z")

</div>

Hi Ian,

The + is redundant here, since it’s just saying that there has to be one or more digits after the ‘v’. But the next thing that it says is that you can have anything at all after those digits.

So you might as well omit the +:

.v[0-9].\*

This says that there has to be a digit after the ‘v’, followed by anything at all. This amounts to the same, since any extra digits qualify as “anything at all”.

Peter

---

<div class="post-metadata">

### Author: ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)
#### Post date: [22 July 2015 23:06 UTC](https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380/12 "2015-07-22T23:06:44Z")

</div>

good point. Maybe a slightly more civilised version would be

\.v[0-9]+(\..\*)?

that forces there to be one or more digits, and if there is anything else, it must start with a dot. Somewhat safer perhaps.

- thomas

> **(attachments)**
>
> ![oceanfullsmall.jpg](https://discourse.openehr.org/images/transparent.png)  
> ![btnliprofileblue80x15.png](https://discourse.openehr.org/images/transparent.png)

---

<div class="post-metadata">

### Author: ![siljelb](https://discourse.openehr.org/user_avatar/discourse.openehr.org/siljelb/32/12_2.png) [@siljelb](https://discourse.openehr.org/u/siljelb)
#### Post date: [4 August 2015 08:45 UTC](https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380/13 "2015-08-04T08:45:18Z")

</div>

On a related note; the [openehr.org](http://openehr.org) website still advertises Archetype Editor v2.2.905 beta from 2013, and Template Designer 2.6.1213.3. Especially now after the v1 → v0 change, the newest builds should be linked from the web site.

> **(attachments)**
>
> ![oceanfullsmall.jpg](https://discourse.openehr.org/images/transparent.png)  
> ![btnliprofileblue80x15.png](https://discourse.openehr.org/images/transparent.png)

---

<div class="post-metadata">

### Author: ![siljelb](https://discourse.openehr.org/user_avatar/discourse.openehr.org/siljelb/32/12_2.png) [@siljelb](https://discourse.openehr.org/u/siljelb)
#### Post date: [7 August 2015 08:07 UTC](https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380/14 "2015-08-07T08:07:26Z")

</div>

I’m assuming there’s no reaction to this because everyone is still enjoying their well-earned holidays. J

But this is a serious issue, which leads to only people “in the know” being able to download updated tools and create and edit archetypes and templates which conform to the newest patterns. Precisely what we’d like to avoid, isn’t it?

> **(attachments)**
>
> ![oceanfullsmall.jpg](https://discourse.openehr.org/images/transparent.png)  
> ![btnliprofileblue80x15.png](https://discourse.openehr.org/images/transparent.png)

---

<div class="post-metadata">

### Author: ![Peter\_Gummer1](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/p/258eb7/32.png) [@Peter\_Gummer1](https://discourse.openehr.org/u/Peter_Gummer1)
#### Post date: [7 August 2015 08:54 UTC](https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380/15 "2015-08-07T08:54:42Z")

</div>

I’m assuming there’s no reaction to this because everyone is still enjoying their well-earned holidays. J

But this is a serious issue, which leads to only people “in the know” being able to download updated tools and create and edit archetypes and templates which conform to the newest patterns. Precisely what we’d like to avoid, isn’t it?

> **(attachments)**
>
> ![oceanfullsmall.jpg](https://discourse.openehr.org/images/transparent.png)  
> ![btnliprofileblue80x15.png](https://discourse.openehr.org/images/transparent.png)

---

<div class="post-metadata">

### Author: ![siljelb](https://discourse.openehr.org/user_avatar/discourse.openehr.org/siljelb/32/12_2.png) [@siljelb](https://discourse.openehr.org/u/siljelb)
#### Post date: [7 August 2015 09:09 UTC](https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380/16 "2015-08-07T09:09:43Z")

</div>

Thanks for replying Peter! J

I’ve personally used newer versions of both tools than what’s currently on the website, in fact we haven’t used TD v2.6 since we got our CKM in February 2014, since it doesn’t work with Norwegian Bokmål (nb) archetypes. If you need people to do testing for a release I’d be very happy to help, and I’m sure lots of other people would too. Is there any test documentation available so testers can know what to do and where to get the test versions of the tools?

> **(attachments)**
>
> ![oceanfullsmall.jpg](https://discourse.openehr.org/images/transparent.png)  
> ![btnliprofileblue80x15.png](https://discourse.openehr.org/images/transparent.png)

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [7 August 2015 09:20 UTC](https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380/17 "2015-08-07T09:20:28Z")

</div>

Hi Peter

I have been using the new versions of the tools in ‘live’ settings for some time now. I have not come across any showstopper issues. I think we are pretty well ready to go.

Ian

> **(attachments)**
>
> ![oceanfullsmall.jpg](https://discourse.openehr.org/images/transparent.png)  
> ![btnliprofileblue80x15.png](https://discourse.openehr.org/images/transparent.png)

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [7 August 2015 13:32 UTC](https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380/18 "2015-08-07T13:32:44Z")

</div>

Looking at this again, AE currently provides two choices

1. Do not include specialisation, in which case the slot constraint matches the provided slot archetype name and version exactly.

2. Include specialisation where any specialisation of the provided slot archetype is allowed (but currently only the same version of the supplied slot archetype).

I suggest that we leave (1) as -is to allow precise slot-fills to be defined but loosen (2) to allow any version.

Ian

> **(attachments)**
>
> ![btnliprofileblue80x15.png](https://discourse.openehr.org/images/transparent.png)  
> ![oceanfullsmall.jpg](https://discourse.openehr.org/images/transparent.png)

---

<div class="post-metadata">

### Author: ![Koray\_Atalag](https://discourse.openehr.org/user_avatar/discourse.openehr.org/koray_atalag/32/70_2.png) [@Koray\_Atalag](https://discourse.openehr.org/u/Koray_Atalag)
#### Post date: [9 August 2015 09:37 UTC](https://discourse.openehr.org/t/archetype-editor-ckm-and-v0-v1/15380/19 "2015-08-09T09:37:55Z")

</div>

+1

> **(attachments)**
>
> ![oceanfullsmall.jpg](https://discourse.openehr.org/images/transparent.png)  
> ![btnliprofileblue80x15.png](https://discourse.openehr.org/images/transparent.png)
