# Error parsing ADL 1.4 Archetype

**URL:** https://discourse.openehr.org/t/error-parsing-adl-1-4-archetype/6309
**Category:** Archie
**Created:** [9 February 2025 19:23 UTC](https://discourse.openehr.org/t/error-parsing-adl-1-4-archetype/6309 "2025-02-09T19:23:11Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![grahamegrieve](https://discourse.openehr.org/user_avatar/discourse.openehr.org/grahamegrieve/32/3602_2.png) [@grahamegrieve](https://discourse.openehr.org/u/grahamegrieve)
#### Post date: [9 February 2025 19:23 UTC](https://discourse.openehr.org/t/error-parsing-adl-1-4-archetype/6309/1 "2025-02-09T19:23:11Z")

</div>

I’m parsing an ADL 1.4 archetype:

```json
 private Archetype load14(InputStream stream) throws ParserConfigurationException, SAXException, IOException, ADLParseException {
    ADL14ConversionConfiguration conversionConfiguration = new ADL14ConversionConfiguration();
    ADL14Parser parser = new ADL14Parser(BuiltinReferenceModels.getMetaModels());
    Archetype archetype = parser.parse(stream, conversionConfiguration);
    return archetype;
  }

```

I get this error:

> model for openEHR.EHR version null not found

It was working, and I don’t think I’ve changed anything? Any hints what I should look at?

---

<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: [10 February 2025 08:13 UTC](https://discourse.openehr.org/t/error-parsing-adl-1-4-archetype/6309/2 "2025-02-10T08:13:45Z")

</div>

Hello Grahame,

Is it possible to have a look at the archetype? I assume you are using archie to load an ADL 1.4 archetype

---

<div class="post-metadata">

### Author: ![grahamegrieve](https://discourse.openehr.org/user_avatar/discourse.openehr.org/grahamegrieve/32/3602_2.png) [@grahamegrieve](https://discourse.openehr.org/u/grahamegrieve)
#### Post date: [10 February 2025 08:43 UTC](https://discourse.openehr.org/t/error-parsing-adl-1-4-archetype/6309/3 "2025-02-10T08:43:40Z")

</div>

here: [openEHR-EHR-OBSERVATION.blood\_pressure.v2.adl](https://discourse.openehr.org/uploads/short-url/sZE4uJKolSFqSrOeRUmcmUYOIO9.adl) (221.0 KB)

And yes, load an ADL 1.4 archetype

---

<div class="post-metadata">

### Author: ![borut.jures](https://discourse.openehr.org/user_avatar/discourse.openehr.org/borut.jures/32/1391_2.png) [@borut.jures](https://discourse.openehr.org/u/borut.jures)
#### Post date: [10 February 2025 09:22 UTC](https://discourse.openehr.org/t/error-parsing-adl-1-4-archetype/6309/4 "2025-02-10T09:22:45Z")

</div>

The error is thrown here: [archie/aom/src/main/java/com/nedap/archie/rminfo/MetaModels.java at 0bc2087de9631b1f5a9a666774b04c108e8f7c66 · openEHR/archie · GitHub](https://github.com/openEHR/archie/blob/0bc2087de9631b1f5a9a666774b04c108e8f7c66/aom/src/main/java/com/nedap/archie/rminfo/MetaModels.java#L134)

```auto
if(selectedModel == null && selectedBmmModel == null) {
   throw new ModelNotFoundException(String.format("model for %s.%s version %s not found", rmPublisher, rmPackage, rmRelease));
}

```

The `rmRelease` is `null`. The ADL grammar has `rm_release` meta tag in the archetype header. This is missing in your archetype (but it is also missing for all archetypes downloaded from CKM). I’m used to specify it explicitly:

```auto
archetype (adl_version=2.1.0; rm_release=1.1.0)

```

It looks to me that [overriddenVersion](https://github.com/openEHR/archie/blob/0bc2087de9631b1f5a9a666774b04c108e8f7c66/aom/src/main/java/com/nedap/archie/rminfo/MetaModels.java#L93) is `null` and the `rm_release` from the archetype is used (but is not found in ADL) resulting in the `null` for the `rmVersion` argument:

```auto
public void selectModel(Archetype archetype) throws ModelNotFoundException { ;
    String overriddenVersion = getOverriddenModelVersion(archetype.getArchetypeId().getRmPublisher(), archetype.getArchetypeId().getRmPackage());
    selectModel(archetype, overriddenVersion == null ? archetype.getRmRelease(): overriddenVersion);
}

```

There were recent PRs that might have broken using a default `rm_version`: [ADL14Converter.java](https://github.com/openEHR/archie/pull/648/files#diff-802e7accc9b7027d859c03218f4da9b404ae763f4d8d0805cda47b9bede61682)

---

<div class="post-metadata">

### Author: ![grahamegrieve](https://discourse.openehr.org/user_avatar/discourse.openehr.org/grahamegrieve/32/3602_2.png) [@grahamegrieve](https://discourse.openehr.org/u/grahamegrieve)
#### Post date: [12 February 2025 17:37 UTC](https://discourse.openehr.org/t/error-parsing-adl-1-4-archetype/6309/5 "2025-02-12T17:37:18Z")

</div>

thanks. I’m not familiar enough with the code base to figure out what’s going on with the default version but I can work around it by injected the rm\_release into the archetype. Is 1.1.0 the right version for ADL 1.4 too?

---

<div class="post-metadata">

### Author: ![joostholslag](https://discourse.openehr.org/user_avatar/discourse.openehr.org/joostholslag/32/1981_2.png) [@joostholslag](https://discourse.openehr.org/u/joostholslag)
#### Post date: [13 February 2025 15:04 UTC](https://discourse.openehr.org/t/error-parsing-adl-1-4-archetype/6309/6 "2025-02-13T15:04:23Z")

</div>

It’s independent from adl. It depends on the archetype. If you view the adl2 representation it shows it’s rm 1.1.0. So try that one. or maybe try a newer version of Archie, I think v3.13.1 reverts the changes borut mentions.

---

<div class="post-metadata">

### Author: ![grahamegrieve](https://discourse.openehr.org/user_avatar/discourse.openehr.org/grahamegrieve/32/3602_2.png) [@grahamegrieve](https://discourse.openehr.org/u/grahamegrieve)
#### Post date: [13 February 2025 18:47 UTC](https://discourse.openehr.org/t/error-parsing-adl-1-4-archetype/6309/7 "2025-02-13T18:47:07Z")

</div>

Doesn’t look like v3.13.1 fixes them, but I can work around this by injecting the rm\_version into the archetype on the fly - thanks

---

<div class="post-metadata">

### Author: ![joostholslag](https://discourse.openehr.org/user_avatar/discourse.openehr.org/joostholslag/32/1981_2.png) [@joostholslag](https://discourse.openehr.org/u/joostholslag)
#### Post date: [14 February 2025 06:01 UTC](https://discourse.openehr.org/t/error-parsing-adl-1-4-archetype/6309/8 "2025-02-14T06:01:38Z")

</div>

@MattijsK want do you think is going on regarding archie?

---

<div class="post-metadata">

### Author: ![MattijsK](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/m/e36b37/32.png) [@MattijsK](https://discourse.openehr.org/u/MattijsK)
#### Post date: [14 February 2025 09:57 UTC](https://discourse.openehr.org/t/error-parsing-adl-1-4-archetype/6309/9 "2025-02-14T09:57:45Z")

</div>

Hey all,

We’ve looked into this a bit and we can’t seem to reproduce this error at all with your code and given archetype @grahamegrieve. Archie seems to be able to handle an adl 1.4 archetype without rm\_release just fine. Are we missing something?

The code changes mentioned by @borut.jures also don’t touch the parsing of 1.4 archetypes (only the conversion to adl 2) and also on older versions of Archie we can’t seem to reproduce this.

@borut.jures, you mention that you specify the rm\_release specifically, is this because of the same reason? Is this something you can reproduce?

---

<div class="post-metadata">

### Author: ![grahamegrieve](https://discourse.openehr.org/user_avatar/discourse.openehr.org/grahamegrieve/32/3602_2.png) [@grahamegrieve](https://discourse.openehr.org/u/grahamegrieve)
#### Post date: [14 February 2025 18:39 UTC](https://discourse.openehr.org/t/error-parsing-adl-1-4-archetype/6309/10 "2025-02-14T18:39:22Z")

</div>

I don’t know - as I said, it worked before. My code is here: [fhir-ig-publisher/org.hl7.fhir.publisher.core/src/main/java/org/hl7/fhir/igtools/openehr/ArchetypeImporter.java at master · HL7/fhir-ig-publisher · GitHub](https://github.com/HL7/fhir-ig-publisher/blob/master/org.hl7.fhir.publisher.core/src/main/java/org/hl7/fhir/igtools/openehr/ArchetypeImporter.java)

is it because I try to load it as 2.0 first?

---

<div class="post-metadata">

### Author: ![pablo](https://discourse.openehr.org/user_avatar/discourse.openehr.org/pablo/32/3505_2.png) [@pablo](https://discourse.openehr.org/u/pablo)
#### Post date: [14 February 2025 18:57 UTC](https://discourse.openehr.org/t/error-parsing-adl-1-4-archetype/6309/11 "2025-02-14T18:57:38Z")

</div>

@grahamegrieve did you try the adl-parser from [GitHub - openEHR/java-libs: Standard Java libraries for Java implementations of openEHR](https://github.com/openEHR/java-libs) ?

I use that and it works perfectly.

---

<div class="post-metadata">

### Author: ![grahamegrieve](https://discourse.openehr.org/user_avatar/discourse.openehr.org/grahamegrieve/32/3602_2.png) [@grahamegrieve](https://discourse.openehr.org/u/grahamegrieve)
#### Post date: [16 February 2025 21:06 UTC](https://discourse.openehr.org/t/error-parsing-adl-1-4-archetype/6309/12 "2025-02-16T21:06:39Z")

</div>

I didn’t find it, that’s why. If I can’t get this sorted, I’ll look at that

---

<div class="post-metadata">

### Author: ![pablo](https://discourse.openehr.org/user_avatar/discourse.openehr.org/pablo/32/3505_2.png) [@pablo](https://discourse.openehr.org/u/pablo)
#### Post date: [17 February 2025 00:54 UTC](https://discourse.openehr.org/t/error-parsing-adl-1-4-archetype/6309/13 "2025-02-17T00:54:11Z")

</div>

Just in case you use it, this is the code you’ll need to parse an ALD 1.4 archetype

> <https://github.com/ppazos/openEHR-ADL/blob/master/lib/src/main/groovy/com/cabolabs/openehr/adl/ArchetypeManager.groovy#L157-L167>

---

<div class="post-metadata">

### Author: ![MattijsK](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/m/e36b37/32.png) [@MattijsK](https://discourse.openehr.org/u/MattijsK)
#### Post date: [17 February 2025 14:25 UTC](https://discourse.openehr.org/t/error-parsing-adl-1-4-archetype/6309/14 "2025-02-17T14:25:03Z")

</div>

Hey Grahame, we put some more time into this and tried running your exact code and on our side it still works without any problems. So hopefully you can manage to find and fix it yourself, or otherwise you can indeed use the other option given in this thread.

---

<div class="post-metadata">

### Author: ![grahamegrieve](https://discourse.openehr.org/user_avatar/discourse.openehr.org/grahamegrieve/32/3602_2.png) [@grahamegrieve](https://discourse.openehr.org/u/grahamegrieve)
#### Post date: [18 February 2025 00:41 UTC](https://discourse.openehr.org/t/error-parsing-adl-1-4-archetype/6309/15 "2025-02-18T00:41:03Z")

</div>

That’s weird because it’s still happening, and it originally didn’t. I don’t know the code - is there anything in particular I should look for when I debug?

---

<div class="post-metadata">

### Author: ![MattijsK](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/m/e36b37/32.png) [@MattijsK](https://discourse.openehr.org/u/MattijsK)
#### Post date: [19 February 2025 12:34 UTC](https://discourse.openehr.org/t/error-parsing-adl-1-4-archetype/6309/16 "2025-02-19T12:34:13Z")

</div>

Very strange indeed. We ran exactly this piece of code with the archetype that you provider earlier in this thread:

```auto
public void checkArchetype(InputStream stream, String name) throws ParserConfigurationException, SAXException, IOException, ADLParseException {
    byte[] cnt = FileUtilities.streamToBytes(stream);
    try {
      archetype = load20(new ByteArrayInputStream(cnt));
    } catch (Exception e20) {
      try {
        archetype = load14(new ByteArrayInputStream(cnt));
      } catch (Exception e14) {
        if (e20.getMessage().equals(e14.getMessage())) {
          throw new FHIRException("Error reading "+name+": "+e20.getMessage(), e20);
        } else {
          throw new FHIRException("Error reading "+name+". ADL 1.4: "+e14.getMessage()+"; ADL 2: "+e20.getMessage(), e20);          
        }
      }
    }
  }

```

If you are indeed also using the latest Archie version and that exact archetype, then I’m not sure what else you can do to debug. Other than actually starting a debugger, running the code and finding the exact place where the exception is thrown and giving us more information about the variables at that point.

---

<div class="post-metadata">

### Author: ![borut.jures](https://discourse.openehr.org/user_avatar/discourse.openehr.org/borut.jures/32/1391_2.png) [@borut.jures](https://discourse.openehr.org/u/borut.jures)
#### Post date: [20 February 2025 16:57 UTC](https://discourse.openehr.org/t/error-parsing-adl-1-4-archetype/6309/17 "2025-02-20T16:57:42Z")

</div>

@MattijsK Discourse stopped sending me updates 8 days ago (2nd time this year) and I just saw your question:

> [@MattijsK](#):
>
> @borut.jures, you mention that you specify the rm\_release specifically, is this because of the same reason? Is this something you can reproduce?

I didn’t mean to write that “I” specify the rm\_release. It is only that almost all archetypes/templates I’ve received in the past had the `rm_release` meta tag in their headers.

Also note that I don’t use Archie – I just try to build my implementation to match the high standards that Archie provides 😊

* * *

p.s. It is still strange to me that the `rm_release` meta tag is missing when exporting from CKM 🤔 Will everybody have to agree to the same implicit default RM release if someday we have RM 1.x and RM 2.x? Wouldn’t it be better if CKM added explicit `rm_release` meta tag?
