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 ParametersPermitted User TypesDescriptionExamples (more)
operationGET/Observation/$groupAs for Observation search.
  • 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/3d8afd18-0844-459a-b3c2-355d02e54c0a&date=ge2018-01-01&date=le2018-12-01

Mappings

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