Is terminology_id=local compatible to not specifying a code list in the archetype?

In the conformance tests data sets I created, I have an OPT with an ELEMENT.value = DV_CODED_TEXT in which the terminology_id = local but there is no code list specified.

Since that is specified in an archetype and wasn’t constrained any more, this ends up in the OPT. And when I commit a COMPOSITION complying with that OPT I get a validation error, I guess from Archie, in EHRBASE, because the code specified, which is autogenerated, doesn’t match the DV_CODED_TEXT.value. I guess it is looking for codes and texts in the OPT, and since none is specified, it considers that an error.

But my question is about the archetype and template, is this case even valid?

Thanks

                     <children xsi:type="C_COMPLEX_OBJECT">
                        <rm_type_name>ELEMENT</rm_type_name>
                        <occurrences>
                          <lower_included>true</lower_included>
                          <upper_included>true</upper_included>
                          <lower_unbounded>false</lower_unbounded>
                          <upper_unbounded>false</upper_unbounded>
                          <lower>0</lower>
                          <upper>1</upper>
                        </occurrences>
                        <node_id>at0005</node_id>
                        <attributes xsi:type="C_SINGLE_ATTRIBUTE">
                          <rm_attribute_name>value</rm_attribute_name>
                          <existence>
                            <lower_included>true</lower_included>
                            <upper_included>true</upper_included>
                            <lower_unbounded>false</lower_unbounded>
                            <upper_unbounded>false</upper_unbounded>
                            <lower>0</lower>
                            <upper>1</upper>
                          </existence>
                          <children xsi:type="C_COMPLEX_OBJECT">
                            <rm_type_name>DV_CODED_TEXT</rm_type_name>
                            <occurrences>
                              <lower_included>true</lower_included>
                              <upper_included>true</upper_included>
                              <lower_unbounded>false</lower_unbounded>
                              <upper_unbounded>false</upper_unbounded>
                              <lower>1</lower>
                              <upper>1</upper>
                            </occurrences>
                            <node_id />
                            <attributes xsi:type="C_SINGLE_ATTRIBUTE">
                              <rm_attribute_name>defining_code</rm_attribute_name>
                              <existence>
                                <lower_included>true</lower_included>
                                <upper_included>true</upper_included>
                                <lower_unbounded>false</lower_unbounded>
                                <upper_unbounded>false</upper_unbounded>
                                <lower>1</lower>
                                <upper>1</upper>
                              </existence>
                              <children xsi:type="C_CODE_PHRASE">
                                <rm_type_name>CODE_PHRASE</rm_type_name>
                                <occurrences>
                                  <lower_included>true</lower_included>
                                  <upper_included>true</upper_included>
                                  <lower_unbounded>false</lower_unbounded>
                                  <upper_unbounded>false</upper_unbounded>
                                  <lower>1</lower>
                                  <upper>1</upper>
                                </occurrences>
                                <node_id />
                                <terminology_id>
                                  <value>local</value>
                                </terminology_id>
                              </children>
                            </attributes>
                          </children>
                        </attributes>
                      </children>

Just happened to be reworking the Antlr grammars for just this case tonight. [local::] is valid according to the existing grammar. I’m inclined to make it invalid, i.e. at least 2 at-codes are required (one is already handled with just [at0123]). If the intention is to allow ‘any at-code in the archetype’, no constraint at all is needed, so I can’t see any use for [local::].

The only case I can think of in ADL is the definition of a generic archetype so it can be constrained in specializations or in the template itself.

Though the issue is if that ends up in the OPT because there was no further constraint at ADL or template level.

So for archetypes it might be valid but I guess it shouldn’t be valid for templates/OPTs.

@thomas.beale I have fixed this on our test templates and recommended the team to add an extra validation for the REST API on the POST /template to verify for code text constraints with local terminology without a list of codes specified.

As said, I don’t think this is strictly wrong on archetypes. I guess it could be for “finalized” archetypes, which I think is supported in ADL 2.