# How to set external terminology validation

**URL:** <https://discourse.openehr.org/t/how-to-set-external-terminology-validation/3755>\
**Category:** Platform\
**Tags:** rest-apis, ehrbase\
**Created:** [28 March 2023 09:24 UTC](https://discourse.openehr.org/t/how-to-set-external-terminology-validation/3755 "2023-03-28T09:24:18Z")\
**Posts on this page:** 1\
**Showing post:** 25

<div class="post-metadata">

**Author:** ![Alex\_Paris](https://discourse.openehr.org/user_avatar/discourse.openehr.org/alex_paris/32/2564_2.png) [@Alex\_Paris](https://discourse.openehr.org/u/Alex_Paris)\
**Post date:** [31 March 2023 08:38 UTC](https://discourse.openehr.org/t/how-to-set-external-terminology-validation/3755/25 "2023-03-31T08:38:35Z")

</div>

I have done it like this:

```auto
Query<Record2<UUID, String>> query = Query.buildNativeQuery("select e/ehr_id/value, o/data[at0001]/events[at0002]/data[at0003]/items[at0004]/value/defining_code/code_string from EHR e contains COMPOSITION a [openEHR-EHR-COMPOSITION.externalterm.v0] contains OBSERVATION o [openEHR-EHR-OBSERVATION.externalterm.v0]", UUID.class, String.class);`
List<Record2<UUID, String>> result = openEhrClient.aqlEndpoint().execute(query);
result.forEach(res->{System.out.println(res.value1() + " "+ res.value2());});

```

---

_[View the full topic](https://discourse.openehr.org/t/how-to-set-external-terminology-validation/3755)._
