Improve AQL to simplifying the querying of terms

From my limited understanding, AQL functions do not normally include the path - see AQL spec

WHERE e/value/defining_code/code_string matches TERMINOLOGY('expand', 'hl7.org/fhir/4.0', 'http://snomed.info/sct?fhir_vs=isa/50697003')

if we also want to search for terms in mappings then currently we have to do.

WHERE e/value/defining_code/code_string matches TERMINOLOGY('expand', 'hl7.org/fhir/4.0', 'http://snomed.info/sct?fhir_vs=isa/50697003')
OR 
 e/value/mappings/target/code_string matches TERMINOLOGY('expand', 'hl7.org/fhir/4.0', 'http://snomed.info/sct?fhir_vs=isa/50697003')

and it is even worse if looking for an array of terms as we have to query on the term and the terminologyId separately.

So I still think this is closer to current AQL function approaches

WHERE sys.name/value/CONTAINS_TERM(TERMINOLOGY(β€˜expand’, β€˜Index - FHIR v4.0.1’, β€˜http://snomed.info/sct?fhir_vs=isa/50697003’), β€˜=’ )

Happy to be proven wrong (again!)

Haha I can already see where I am wrong!

So I agree AQL function would be something like

CONTAINS_TERM(sys.name/value, TERMINOLOGY(…), β€˜=’ )

an RM function which flattens the current CODED_TEXT construct into something closer to a FHIR CodeableConcept might have extra utility however.

3 Likes