Add your comments directly to the page. Include links to any relevant research, data, or feedback.

Status

Impact

Driver

Pablo Pazos 

Approver

Contributors

Add stakeholders

Informed

Due date

When does this decision need to be made by?

Outcome

What did you decide?

Background

When using parameters in AQL queries, there is no specification about the use of quotes: if the substitution will or not check for quotes to be present and add if not, or if parameter substitution will not add the queries around the substituted value.

PP:

About this issue, IIRC I detected inconsistencies between implementations on the quotes applied to the parameters, for instance:

Option 1) explicit quotes, substitution doesn’t check or add quotes

select e/ehr_id, e/time_created, e/system_id from EHR e CONTAINS COMPOSITION c WHERE c/archetype_node_id=’$archetype_id’

vs.

Option 2) implicit quotes, substitution check and adds quotes if missing

select e/ehr_id, e/time_created, e/system_id from EHR e CONTAINS COMPOSITION c WHERE c/archetype_node_id=$archetype_id

If the implementation does a simple substitution of values, option 1 would be correct, since what finishes in the WHERE condition is a string constant. But if the replacement already considers adding the quotes if those are missing, the second example will work as well.

The issue is: there is no specification around this, or at least I didn’t find it.

This might also be considered as one of those processing rules that we need to define, maybe a “pre-processing” rule in this case.

Further reading on discourse: https://discourse.openehr.org/t/aql-3-rules-for-parameter-substitution-on-aql-which-types-will-add-or-not-quotes/251

Options considered

Option 1:

Option 2:

Pablo

(plus)

Ian

(plus)

Christian

(plus)

Thomas

(plus)

Sebastian I

(plus)

(plus)

Action items

Add action items to close the loop on open questions or concerns

Outcome

The quote criteria for parameters should be added to the spec.