Group

$group Operation

https://www.hl7.org/fhir/operations.html

https://www.hl7.org/fhir/STU3/operationdefinition.html

Overview

There are some use cases for which it is a helpful optimisation to group the search results based on some criteria, and then return only a limited number of those results.

An existing example of this is the $lastn operation.

More general grouping behaviour can be achieved by using the custom $group operation (for supported endpoints).

By default, this query will group results by day, and return only one result per day.

Endpoints

InteractionHTTPURLSupported Search ParamsPermitted User TypesDescriptionExamples (more)
operationGET/Observation/$groupNone
  • Patient
  • Professional
Retrieve Observation resources which match the specified search criteria, returning no more than 1 per day./Observation/$group?category=http://fhir.patientsknowbest.com/codesystem/observation-category|LABORATORY&patient=Patient/ca9db36c-1b77-4d12-9246-d78fa5d13e8c&date=ge2018-01-01&date=le2018-12-01

Mappings

FHIRPKBNotes
OperationDefinition.name"group" 
OperationDefinition.status"active" 
OperationDefinition.kind"operation" 
Operation.idempotenttrue 
OperationDefinition.code"group" 
OperationDefinition.resource
  • "Observation"
 
OperationDefinition.systemfalse 
OperationDefinition.typetrue 
OperationDefinition.instancefalse 
Subpages (1): Examples
Comments