Encounter
The Encounter resource represents a care contact or service context for a patient in Open Aidn.
Open Aidn currently exposes selected fields from the base HL7 FHIR R4 Encounter resource. A formal Aidn profile may be published later.
Standards and profiles
- HL7 FHIR R4: Encounter
- HL7 FHIR R4 search: FHIR search
Endpoints
| Method | Path | Required scope | Description |
|---|---|---|---|
POST |
/Encounter/_search |
encounter.search |
Search using application/x-www-form-urlencoded body parameters. |
GET |
/Encounter/{id} |
encounter.read |
Read one Encounter by ID. |
Search responses are returned as FHIR Bundle resources with type set to searchset.
Search parameters
| Parameter | Type | Description |
|---|---|---|
identifier |
identifier | Patient identifier alias. Currently resolved in the same way as patient.Identifier. |
patient.Identifier |
identifier | Patient identifier used to filter encounters for one patient. |
type |
token | Service type filter. HomeService maps to Open Aidn home-service filtering. |
location |
identifier | Department or location identifier used to filter encounters. |
location.Identifier |
identifier | Same purpose as location. Use this when your client distinguishes between FHIR references and identifiers. |
_include |
token, repeatable | Adds supported referenced resources to the response bundle. |
A search without a patient or location filter returns an empty result set.
Supported includes
_include value |
Included resource | Description |
|---|---|---|
Encounter:subject |
Patient |
Adds referenced patient resources. |
Encounter:serviceProvider |
Organization |
Adds referenced service provider organizations. |
Encounter:location |
Location |
Adds referenced location resources. |
Encounter:participant |
Practitioner |
Adds referenced practitioner participants when available. |
When locations are included, Open Aidn may also include the managing organization referenced by the included Location.
Response fields
Open Aidn may expand the response over time, but integrations should currently expect data in these fields:
| Field | Description |
|---|---|
id |
Encounter identifier. |
meta.lastUpdated |
Last update timestamp when available. |
status |
FHIR Encounter status, such as in-progress, finished, cancelled, planned, or unknown. |
subject.reference |
Reference to the patient. |
serviceProvider.reference |
Reference to the organization providing the service. |
period |
Start and end time for the encounter. |
length |
Resource hours per week when available. |
location.location.reference |
Reference to the department or location. |
participant.individual.reference |
Reference to a practitioner or related person connected to the encounter. |
type.coding |
Service type coding and display text. |
Example search
POST /Encounter/_search HTTP/1.1
Host: <OPEN_AIDN_FHIR_HOST>
Accept: application/fhir+json
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer <ACCESS_TOKEN>
location.Identifier=<DEPARTMENT_ID>&_include=Encounter:subject
The response is a FHIR search bundle. Primary Encounter results are returned with mode = match; included resources are returned with mode = include.