Composite Search Parameters

Since version 2308 Aidbox supports Composite Search Parameters.

Composite Search Parameters are special search parameters that match resources by two or more values, separated by a $ sign. Such search parameters will search not by simple intersection, like search-param1=value1&search-param2=value2, but more strictly.

For example, take a look at Observation resource structure and suppose we have following resource:

id: my-observation
component:
- code: loinc|12907-2
  valueQuantity: 
    value: 1
- code: loinc|12907-1
  valueQuantity: 
    value: 2
# ...

If we want search to match my-observation only if some component has both code = loinc|12907-2 and valueQuantity=1, we must use composite search:

GET /fhir/Observation?code-value-quantity=loinc|12907-2$1 // found
GET /fhir/Observation?code-value-quantity=loinc|12907-2$2 // not found
GET /fhir/Observation?code-value-quantity=loinc|12907-1$1 // not found
GET /fhir/Observation?code-value-quantity=loinc|12907-1$2 // found

However, if we use simple intersection, my-observation may be found in all cases:

GET /fhir/Observation?code=loinc|12907-2&value-quantity=1 // found
GET /fhir/Observation?code=loinc|12907-2&value-quantity=2 // found
GET /fhir/Observation?code=loinc|12907-1&value-quantity=1 // found
GET /fhir/Observation?code=loinc|12907-1&value-quantity=2 // found

To turn on in Aidbox project use:

BOX_SEARCH_COMPOSITE__SEARCH=true

Last updated