Terminology queries are already standardised via AQL and supporting FHIR -see Support for AQL MATCHES and TERMINOOLGY in EhrBase? - #4 by vidi42
and is supported in both EhrBase and Better AFAIK.
Though note some slight confusion on exact syntax in the specs!
We can query both defining_code and mappings in AQL but when trying to query both for e.g as LOINC or SNOMED code, it is cumbersome.
I think treating the defining_code and mappings list as a single list for matching purposes, possibly with an AQL function, might be helpful, especially if we can combine the TerminologyID and term in a single token.
e.g. hasTerm('SNOMED-CT::123456", "SNOMED-CT::45345")
which searches both defining_code and the mappings list.
The other issue is how to document term mappings that the modeller wants enforced to be carried at run-time. Archetype term bindings are design-time suggestions only, and may not actually be correct in local template use. There may be a place for template -level bindings but these would still be different from mapping constraints i.e design-time recommendations .not actual mapping constraints.
@damoca - have you ever tried constraining mappings in LinkEHR or do we need a new kind of construct (especially as some of the mappings may be conditional or lookup driven. Is this a seperate layer even?