Skip to content

Fix Error Combining Composite Token-Token Params #3642

Description

@juliangruendner

When a composite search parameter of type token-token (such as the standard code-value-concept and combo-code-value-concept, or the custom MII mii-provision-provision-code-type) is combined with another, more selective search parameter, the request fails with an AbstractMethodError.

The composite parameter is only affected when the query planner evaluates it as a secondary (seek) clause — i.e. when it is combined with a more selective clause. On its own, or as the leading (scan) clause, it works.

Reproduction

GET /fhir/Consent?category=2.16.840.1.113883.3.1937.777.24.2.184&mii-provision-provision-code-type=urn:oid:2.16.840.1.113883.3.1937.777.24.5.3|2.16.840.1.113883.3.1937.777.24.5.3.7$permit

returns:

{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "error",
      "code": "exception",
      "diagnostics": "Method blaze/db/impl/search_param/composite/token_token/SearchParamCompositeTokenToken._single_version_id_matcher(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; is abstract"
    }
  ]
}

The same error occurs with the standard code-value-concept parameter on Observation, for example Observation?patient=<id>&code-value-concept=<code>$<value> where the patient clause is more selective than the code-value-concept clause.

Cause

SearchParamCompositeTokenToken does not implement the -single-version-id-matcher method of the SearchParam protocol. That method is invoked whenever the parameter is filtered as a seek clause, so calling it on the unimplemented record raises the AbstractMethodError. The sibling SearchParamCompositeTokenQuantity (used by code-value-quantity) implements it, which is why token-quantity composites are unaffected.

Expected

The combined query returns the matching resources without error.

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions