Group
Group is a FHIR resource that represents a collection of entities such as people, medications, or devices. In the context of Flexpa API, Group resources are automatically created during data synchronization to provide a convenient way to reference all patients retrieved in a sync job.
When Flexpa API processes a sync job, it automatically creates a Group resource containing references to all Patient resources retrieved during that operation. This provides an organizational structure that links a patient authorization to the complete set of patients retrieved.
The Group resource ID is set to match the patient authorization ID, creating a direct 1:1 relationship between the authorization and the group of patients it represents. This makes it easy to query for all patients associated with a specific authorization.
https://api.flexpa.com/fhir/Group
#Schema
#Overview
The FHIR R4 Group resource represents a collection of entities. As a FHIR resource, it follows standard FHIR patterns with common elements like resourceType, id, meta, and identifier.
Flexpa API automatically creates Group resources during sync operations to organize Patient resources. These groups are always of type person and represent actual collections (not definitions), indicated by the actual field being set to true.
The Group resource serves as an organizational tool that connects a patient authorization to all patients retrieved during the associated sync job. Because the Group ID matches the patient authorization ID, you can easily retrieve all patients for a specific authorization.
Group resources are created automatically during sync jobs and do not need to be explicitly requested. They will be included in the bundle of resources returned by sync operations.
Elements
- idid
The unique identifier for the Group resource. For Flexpa-generated groups, this matches the patient authorization ID, creating a 1:1 relationship between the authorization and the group.
- metaMeta
Metadata about the resource. See also Tags defined by Flexpa.
- lastUpdatedinstant
The last time the group was updated
- typecode
The type of entities in the group
personGroup contains Person or Patient resources (used by Flexpa)
animalGroup contains Animal resources
practitionerGroup contains Practitioner resources
deviceGroup contains Device resources
medicationGroup contains Medication resources
substanceGroup contains Substance resources
- actualboolean
Whether this group represents an actual collection of entities or a definition. For Flexpa-generated groups, this is always true, indicating the group represents actual Patient resources that were retrieved.
- memberarray
The entities that are members of this group
- entityReference(Patient|Practitioner|Device|Medication|Substance)
Reference to the entity that is a member of the group. For Flexpa-generated groups, these are always Patient references in the format Patient/[id].
Group Example
{
"resourceType": "Group",
"id": "f1903dfc-1d2f-45ba-bf24-05cc2b062182",
"type": "person",
"actual": true,
"member": [
{
"entity": {
"reference": "Patient/19fbd276-1690-5c51-bae2-ad4ae52c97e4"
}
},
{
"entity": {
"reference": "Patient/e8abda93-50e9-5c8e-a6f6-8921f544e45e"
}
}
]
}
#API
GEThttps://api.flexpa.com/fhir/Group/:id
A read is the most basic operation in FHIR. It allows you to retrieve the current version of a single resource by its ID.
For Flexpa-generated Group resources, the Group ID matches the patient authorization ID. This means you can retrieve the group of all patients associated with a specific authorization by using the authorization ID as the Group ID.
Request path parameters
- idstring
The identifier of the Group resource to retrieve. For Flexpa-generated groups, this is the patient authorization ID.
ACCESS_TOKEN=flexpa-link-access-token
curl https://api.flexpa.com/fhir/Group/[authorization-id] \
-H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
"resourceType": "Group",
"id": "f1903dfc-1d2f-45ba-bf24-05cc2b062182",
"type": "person",
"actual": true,
"member": [
{
"entity": {
"reference": "Patient/19fbd276-1690-5c51-bae2-ad4ae52c97e4"
}
}
]
}
GEThttps://api.flexpa.com/fhir/Group
Searches on Flexpa API follow the RESTful style of the FHIR specification by submitting a GET HTTP request to the base URL of the resource with parameters to define the exact search criteria to filter the response.
Search parameters
- memberreference
Reference to an entity (typically a Patient) that is a member of the group
- typetoken
The type of resources the group contains (for Flexpa-generated groups, this is person)
- actualtoken
Whether the group represents an actual group of entities (for Flexpa-generated groups, this is true)
- _idtoken
The logical resource ID. For Flexpa-generated groups, this matches the patient authorization ID.
ACCESS_TOKEN=flexpa-link-access-token
curl https://api.flexpa.com/fhir/Group \
-H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
"resourceType": "Bundle",
"type": "searchset",
"total": 1,
"entry": [
{
"resource": {
"resourceType": "Group",
"id": "f1903dfc-1d2f-45ba-bf24-05cc2b062182",
"type": "person",
"actual": true,
"member": [
{
"entity": {
"reference": "Patient/19fbd276-1690-5c51-bae2-ad4ae52c97e4"
}
}
]
}
}
]
}