It seems that the intended way of passing the canonical url of the library is by passing canonical url in queryReference parameter.
The spec for the $sqlquery-run operation doesn't state this explicitly, but spec for $sqlquery-export does have a clarification about it: https://build.fhir.org/ig/FHIR/sql-on-fhir-v2/branches/sqlquery-export/OperationDefinition-SQLQueryExport.html#queryreference-clarification
The queryReference parameter MAY be specified using any of the following formats:
- relative URL on the server (e.g. “Library/patient-bp-query”)
- A canonical URL (e.g. “http://example.org/fhir/Library/patient-bp-query | 1.0.0”)
- An absolute URL (e.g. “http://example.org/fhir/Library/patient-bp-query”)
queryReference element is of type Reference and it doesn't look like putting the canonical url in the reference element is allowed.
Besides, it's hard for the implementer to distinguish between canonical and absolute URLs when parsing the passed parameter value:
- A canonical URL (e.g. “http://example.org/fhir/Library/patient-bp-query | 1.0.0”)
- An absolute URL (e.g. “http://example.org/fhir/Library/patient-bp-query”)
So what's the proper way of referencing Library when calling the operation?
It seems that the intended way of passing the canonical url of the library is by passing canonical url in
queryReferenceparameter.The spec for the
$sqlquery-runoperation doesn't state this explicitly, but spec for$sqlquery-exportdoes have a clarification about it: https://build.fhir.org/ig/FHIR/sql-on-fhir-v2/branches/sqlquery-export/OperationDefinition-SQLQueryExport.html#queryreference-clarificationqueryReference element is of type Reference and it doesn't look like putting the canonical url in the reference element is allowed.
Besides, it's hard for the implementer to distinguish between canonical and absolute URLs when parsing the passed parameter value:
So what's the proper way of referencing Library when calling the operation?