# How to add a Snomed CT code to each value in a list of ordinals?

**URL:** <https://discourse.openehr.org/t/how-to-add-a-snomed-ct-code-to-each-value-in-a-list-of-ordinals/742>\
**Category:** Archetype Designer\
**Created:** [29 May 2020 14:28 UTC](https://discourse.openehr.org/t/how-to-add-a-snomed-ct-code-to-each-value-in-a-list-of-ordinals/742 "2020-05-29T14:28:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanna.asberg](https://discourse.openehr.org/user_avatar/discourse.openehr.org/sanna.asberg/32/3487_2.png) [@sanna.asberg](https://discourse.openehr.org/u/sanna.asberg)\
**Post date:** [29 May 2020 14:28 UTC](https://discourse.openehr.org/t/how-to-add-a-snomed-ct-code-to-each-value-in-a-list-of-ordinals/742/1 "2020-05-29T14:28:04Z")

</div>

Looking at “Air or oxygen” in the archetype NEWS2. If I would like to add a Snomed CT code to each of the values in the ordinal - is that possible in Archetype designer? If so, where can I read about how to do that?

/Sanna

---

<div class="post-metadata">

**Author:** ![ian.mcnicoll](https://discourse.openehr.org/user_avatar/discourse.openehr.org/ian.mcnicoll/32/4430_2.png) [@ian.mcnicoll](https://discourse.openehr.org/u/ian.mcnicoll)\
**Post date:** [29 May 2020 17:20 UTC](https://discourse.openehr.org/t/how-to-add-a-snomed-ct-code-to-each-value-in-a-list-of-ordinals/742/2 "2020-05-29T17:20:56Z")

</div>

Hi Sanna,

Yes - via the Terminology tab. I have done a short [video demo](https://www.youtube.com/watch?v=BqUWVpnFXiw) which talks through the process.

Ian

 ![image](https://discourse.openehr.org/uploads/default/original/1X/1102da8e88b4b1edc37faad8333082ab5bad812f.png)

---

<div class="post-metadata">

**Author:** ![sanna.asberg](https://discourse.openehr.org/user_avatar/discourse.openehr.org/sanna.asberg/32/3487_2.png) [@sanna.asberg](https://discourse.openehr.org/u/sanna.asberg)\
**Post date:** [12 June 2020 09:32 UTC](https://discourse.openehr.org/t/how-to-add-a-snomed-ct-code-to-each-value-in-a-list-of-ordinals/742/3 "2020-06-12T09:32:29Z")

</div>

Thanks Ian! Great explanation.

/Sanna

---

<div class="post-metadata">

**Author:** ![Sidharth\_Ramesh](https://discourse.openehr.org/user_avatar/discourse.openehr.org/sidharth_ramesh/32/674_2.png) [@Sidharth\_Ramesh](https://discourse.openehr.org/u/Sidharth_Ramesh)\
**Post date:** [22 October 2020 06:39 UTC](https://discourse.openehr.org/t/how-to-add-a-snomed-ct-code-to-each-value-in-a-list-of-ordinals/742/4 "2020-10-22T06:39:15Z")

</div>

Hello @ian.mcnicoll. I am trying to constrain the possible values of a field in a template to a snomed CT subset. I am using Snomed CT Expression Constraint Language to represent the same (eg: \<\<123456) in an archetype. The constraint shows up in the ADL file under `constraint_definitions`. However, when I use the archetype in a template, the resulting OPT or Web Template file has no reference to this constraint. How do I access this constraint in the template file?  
Or is there a better method to achieving the same?

 ![image](https://discourse.openehr.org/uploads/default/original/1X/f47211354cd286b7abd2f50721fae4cc8baffe8a.png)

---

<div class="post-metadata">

**Author:** ![ian.mcnicoll](https://discourse.openehr.org/user_avatar/discourse.openehr.org/ian.mcnicoll/32/4430_2.png) [@ian.mcnicoll](https://discourse.openehr.org/u/ian.mcnicoll)\
**Post date:** [23 October 2020 09:50 UTC](https://discourse.openehr.org/t/how-to-add-a-snomed-ct-code-to-each-value-in-a-list-of-ordinals/742/5 "2020-10-23T09:50:40Z")

</div>

Can you post the archetype here? I think we are all quite quickly moving to using FHIR Valuesets to define these kind of constraints i.e manage them outside of the archetype or template.

---

<div class="post-metadata">

**Author:** ![Sidharth\_Ramesh](https://discourse.openehr.org/user_avatar/discourse.openehr.org/sidharth_ramesh/32/674_2.png) [@Sidharth\_Ramesh](https://discourse.openehr.org/u/Sidharth_Ramesh)\
**Post date:** [23 October 2020 10:54 UTC](https://discourse.openehr.org/t/how-to-add-a-snomed-ct-code-to-each-value-in-a-list-of-ordinals/742/6 "2020-10-23T10:54:37Z")

</div>

Thank you for your reply, sir. I have attached my archetype and the templates (both opt and the web template json).  
[openEHR-EHR-OBSERVATION.physical\_activity\_record.v0.adl](https://discourse.openehr.org/uploads/short-url/9WA5NPmdSba5du4MOCafNNBr9Xm.adl) (4.1 KB)  
[physical-activity-template.json](https://discourse.openehr.org/uploads/short-url/fgj2MXwm3TsAvMRVQ0irZffda1u.json) (7.4 KB)  
[physical-activity-template.opt](https://discourse.openehr.org/uploads/short-url/k2WXKUVUz5CwY8C030s5D9zddYD.opt) (40.1 KB)

I was just playing around with the archetype designer, so the archetype or the terminology constraints won’t make much sense clinically.

My goal is to generate the user interface using only the templates as input. This makes it easy for hospitals and doctors to design their own data entry requirements. And I wanted to include a terminology constraint (Snomed CT EQL: \<123456) on an element so that the UI will only search under that particular Snomed subset. Currently, I _could_ do this by adding an annotation to the field, which I have included in the files attached. Can you tell me the recommended way to achieve this? If we are using a FHIR ValueSet, then where does one reference it?
