> ## Documentation Index
> Fetch the complete documentation index at: https://help.elationhealth.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Encounter Information

## Overview

Encounter Information addresses:

* Encounter HL7® FHIR® resource with [US Core Profile 6.1.0](https://hl7.org/fhir/us/core/STU6.1/StructureDefinition-us-core-encounter.html)

Encounter contains information about an interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. This profile meets the U.S. Core Data for Interoperability (USCDI) v3 requirements for Encounter Information.

An encounter has a class to distinguish between different health care settings such as inpatient, outpatient, emergency, etc. A patient may have one medical record number with multiple encounter numbers per facility or organization.

The Hospitalization component is intended to store the extended information relating to a hospitalization event. It is always expected to be the same period as the encounter itself. Where the period is different, another encounter instance should be used to capture this information as a partOf this encounter instance.

Each Encounter has next elements:

* a status
* a classification such as inpatient, outpatient or emergency
* an encounter type
* a patient

Each Encounter must support:

* an encounter identifier
* providers involved in the encounter
* when the encounter occurred
* reason for the visit
* the discharge disposition
* where the encounter occurred

**Profile specific implementation guidance:**

* To search for an [encounter diagnosis](/articles/fhir/uscdi-health-concerns-condition), query for Condition resources that reference the Encounter of interest and have a category of `encounter-diagnosis`.
* The Encounter resource can represent a reason using either a code with `Encounter.reasonCode`, or a reference with `Encounter.reasonReference` to Condition or other resource.
  * Although both are marked as must support, servers are not required to support both a code and a reference, but they **SHALL** support at least one of these elements.
  * The client application **SHALL** support both elements.
  * If Encounter.reasonReference references an Observation, it **SHOULD** conform to a US Core Observation if applicable. For example, a laboratory result **SHOULD** conform to the US Core Laboratory Result Observation Profile.
* This profile supports where the encounter occurred. The location address can be represented by the Location referenced by `Encounter.location.location` or indirectly through the Organization referenced by `Encounter.serviceProvider`.
  * Although both are marked as must support, servers are not required to support both `Encounter.location.location` and `Encounter.serviceProvider`, but they SHALL support at least one of these elements.
  * The client application **SHALL** support both elements.
  * If using `Encounter.location.location` it **SHOULD** conform to US Core Location. However, as a result of implementation feedback, it **MAY** reference the base FHIR Location resource. See this guidance on [Referencing US Core Profiles](https://www.hl7.org/fhir/us/core/general-guidance.html#referencing-us-core-profiles).

This resource refers to [US Core Encounter Profile 6.1.0](https://hl7.org/fhir/us/core/STU6.1/StructureDefinition-us-core-encounter.html). Encounter response will be provided in JSON (refers to Capability Statement) format as per [FHIR](https://hl7.org/fhir) standard R4 version.

| USCDI                 | USCore Data Element                                             | FHIR Resource Field                             |
| --------------------- | --------------------------------------------------------------- | ----------------------------------------------- |
| Encounter  Diagnosis  | [diagnosis](/articles/fhir/uscdi-encounter-diagnosis-condition) | Encounter.diagnosis                             |
| Encounter Time        | When the encounter occurred                                     | Encounter.period                                |
| Encounter Location    | Where the encounter occurred                                    | Encounter.location.location                     |
| Encounter Disposition | The discharge disposition                                       | Encounter.hospitalization.dischargeDisposition  |
| Encounter Type        | An encounter type                                               | Encounter.type                                  |
|                       | A status                                                        | Encounter.status                                |
|                       | An classification such as inpatient, outpatient or emergency    | Encounter.class                                 |
|                       | A patient                                                       | Encounter.subject                               |
|                       | An encounter identifier                                         | Encounter.identifier                            |
|                       | Providers involved in the encounter                             | Encounter.serviceProvider                       |
|                       | Reason for the visit                                            | Encounter.reasonCode, Encounter.reasonReference |

### Must support elements, mandatory and optional search parameters

*Encounter **must support** these elements:*

* `identifier`
* `status`
* `class`
* `type`
* `subject`
* `participant`
* `period`
* `reasonCode`
* `reasonReference`
* `hospitalization`
  * `dischargeDisposition`
* `location`
  * `location`
* `serviceProvider`

*Each Encounter Must Have (Mandatory):*

* `status`
* `class`
* `type`
* `subject`

*The following search parameters and search parameter combinations SHALL be supported:*

The syntax used to describe the interactions is described [here](/articles/fhir/us-core-guidance).

**SHALL** support fetching an encounter using the \_id search parameter:

`GET [base url]/Encounter/{id}`
or
`GET [base url]/Encounter?_id={id}`

**SHALL** support searching for all encounters for a patient using the `patient` search parameter:
`GET [base url]/Encounter?patient={Type/}[id]`

**SHALL** support searching using the combination of the `date` and `patient` search parameters:

including support for these date comparators: gt,lt,ge,le
including optional support for AND search on date (e.g.date=\[date]\&date=\[date]]&...)
`GET [base url]/Encounter?date={gt|lt|ge|le}[date]{&date={gt|lt|ge|le}[date]&...}&patient={Type/}[id]`

*The following search parameter combinations SHOULD be supported:*

**SHOULD** support searching using the `identifier` search parameter:
`GET [base url]/Encounter?identifier={system|}[code]`

**SHOULD** support searching using the combination of the `class` and `patient` search parameters:
`GET [base url]/Encounter?class={system|}[code]&patient={Type/}[id]`

**SHOULD** support searching using the combination of the `patient` and `type` search parameters:
`GET [base url]/Encounter?patient={Type/}[id]&type={system|}[code]`

**SHOULD** support searching using the combination of the `patient` and `location` search parameters:
`GET [base url]/Encounter?patient={Type/}[id]&location={Type/}[location_id]`

**SHOULD** support searching using the combination of the `patient` and `status` search parameters:
`GET [base]/Encounter?patient={Type/}[id]&status={system|}[code]`

**SHOULD** support searching using the combination of the `patient` and `discharge-disposition` search parameters:
`GET [base]/Encounter?patient={Type/}[id]&discharge-disposition={system|}[code]`

The response to any search operation is always a list of resources in a Bundle or an Operation Outcome.

## Encounter By Id

Get Encounter by id

**METHOD** *GET*

```
[base url]/Encounter/{id}
```

or

```
[base url]/Encounter?_id={id}
```

**PARAMS**
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)
\{id} - Id for Encounter resource

**HEADERS**

The Authorization token SHALL be obtained during the Authentication and Authorization process. Go to [Authentication and Authorization](/articles/fhir/authentication-authorization) for further details.

| Header        | Type       | Required/Optional | Value            |
| ------------- | ---------- | ----------------- | ---------------- |
| Authorization | **string** | required          | `Bearer <token>` |

**RESPONSES**

| Code | Description                        | Comment                                                                                                                                         |
| ---- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| 200  | OK                                 | The request was processed successfully                                                                                                          |
| 400  | Bad request                        | Invalid request parameters or FHIR operation outcome resource returned                                                                          |
| 401  | Unauthorized                       | This code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource |
| 404  | No route matched with those values | The request was able to communicate with a given server, but the server could not find what was requested                                       |
| 500  | Internal Server Error              | The server has encountered a situation it doesn't know how to handle                                                                            |

The response to any search operation is always a list of resources in a Bundle or an Operation Outcome.

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/Encounter/b3117fc5-3116-b12a-cbbc-a0c3def361g7' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## Encounter By Patient Id

Search all Encounter by the specified Patient

**METHOD** *GET*

```
[base url]/Encounter?patient={Type/}[id]
```

**PARAMS**
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)
\{Type/} - Type for the Reference. *Example:* `Patient/`
\[id] - Id for Patient resource

**HEADERS**

The Authorization token SHALL be obtained during the Authentication and Authorization process. Go to [Authentication and Authorization](/articles/fhir/authentication-authorization) for further details.

| Header        | Type       | Required/Optional | Value            |
| ------------- | ---------- | ----------------- | ---------------- |
| Authorization | **string** | required          | `Bearer <token>` |

**RESPONSES**

| Code | Description                        | Comment                                                                                                                                         |
| ---- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| 200  | OK                                 | The request was processed successfully                                                                                                          |
| 400  | Bad request                        | Invalid request parameters or FHIR operation outcome resource returned                                                                          |
| 401  | Unauthorized                       | This code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource |
| 404  | No route matched with those values | The request was able to communicate with a given server, but the server could not find what was requested                                       |
| 500  | Internal Server Error              | The server has encountered a situation it doesn't know how to handle                                                                            |

The response to any search operation is always a list of resources in a Bundle or an Operation Outcome.

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/Encounter?patient=Patient/b3117fc5-3116-b12a-cbbc-a0c3def361g7' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## Encounter for the Patient and for the period

Search all Encounters of the patient in a specific period defining period begin and/or period end

**METHOD** *GET*

```
[base url]/Encounter?date={gt|lt|ge|le}[date]{&date={gt|lt|ge|le}[date]&...}&patient={Type/}[id]
```

**PARAMS**
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)
\{gt|lt|ge|le} - Search modifiers for the date. See [Search specification](https://www.hl7.org/fhir/search.html#date) for more information.
\[date] - Beginning and/or ending for a period
\{Type/} - Type for the Reference. *Example:* `Patient/`
\[id] - Id for Patient resource

**HEADERS**

The Authorization token SHALL be obtained during the Authentication and Authorization process. Go to [Authentication and Authorization](/articles/fhir/authentication-authorization) for further details.

| Header        | Type       | Required/Optional | Value            |
| ------------- | ---------- | ----------------- | ---------------- |
| Authorization | **string** | required          | `Bearer <token>` |

**RESPONSES**

| Code | Description                        | Comment                                                                                                                                         |
| ---- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| 200  | OK                                 | The request was processed successfully                                                                                                          |
| 400  | Bad request                        | Invalid request parameters or FHIR operation outcome resource returned                                                                          |
| 401  | Unauthorized                       | This code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource |
| 404  | No route matched with those values | The request was able to communicate with a given server, but the server could not find what was requested                                       |
| 500  | Internal Server Error              | The server has encountered a situation it doesn't know how to handle                                                                            |

The response to any search operation is always a list of resources in a Bundle or an Operation Outcome.

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/Encounter?date=ge2021-01-01&date=le2021-12-31&patient=Patient/example' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## Encounter by Identifier

Search Encounter by the specified identifier

**METHOD** *GET*

```
[base url]/Encounter?identifier={system|}[code]
```

**PARAMS**
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)
\{system|} - Identifier system. FHIR search token parameter. See [Search specification](https://www.hl7.org/fhir/search.html#token) for more information.
\[code] - Identifier code. FHIR search token parameter. See [Search specification](https://www.hl7.org/fhir/search.html#token) for more information.

**HEADERS**

The Authorization token SHALL be obtained during the Authentication and Authorization process. Go to [Authentication and Authorization](/articles/fhir/authentication-authorization) for further details.

| Header        | Type       | Required/Optional | Value            |
| ------------- | ---------- | ----------------- | ---------------- |
| Authorization | **string** | required          | `Bearer <token>` |

**RESPONSES**

| Code | Description                        | Comment                                                                                                                                         |
| ---- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| 200  | OK                                 | The request was processed successfully                                                                                                          |
| 400  | Bad request                        | Invalid request parameters or FHIR operation outcome resource returned                                                                          |
| 401  | Unauthorized                       | This code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource |
| 404  | No route matched with those values | The request was able to communicate with a given server, but the server could not find what was requested                                       |
| 500  | Internal Server Error              | The server has encountered a situation it doesn't know how to handle                                                                            |

The response to any search operation is always a list of resources in a Bundle or an Operation Outcome.

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/Encounter?identifier=http://happyNation.io/visitId|00001' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## Encounter for the Patient by Class

Search all Encounters for the specific Patient by Encounter class.

**METHOD** *GET*

```
[base url]/Encounter?class={system|}[code]&patient={Type/}[id]
```

**PARAMS**
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)
\{system|} - Class system. FHIR search token parameter. See [Search specification](https://www.hl7.org/fhir/search.html#token) for more information.
\[code] - Class code. FHIR search token parameter. See [Search specification](https://www.hl7.org/fhir/search.html#token) for more information.
\{Type/} - Type for the Reference. *Example:* `Patient/`
\[id] - Id for the Patient

**HEADERS**

The Authorization token SHALL be obtained during the Authentication and Authorization process. Go to [Authentication and Authorization](/articles/fhir/authentication-authorization) for further details.

| Header        | Type       | Required/Optional | Value            |
| ------------- | ---------- | ----------------- | ---------------- |
| Authorization | **string** | required          | `Bearer <token>` |

**RESPONSES**

| Code | Description                        | Comment                                                                                                                                         |
| ---- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| 200  | OK                                 | The request was processed successfully                                                                                                          |
| 400  | Bad request                        | Invalid request parameters or FHIR operation outcome resource returned                                                                          |
| 401  | Unauthorized                       | This code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource |
| 404  | No route matched with those values | The request was able to communicate with a given server, but the server could not find what was requested                                       |
| 500  | Internal Server Error              | The server has encountered a situation it doesn't know how to handle                                                                            |

The response to any search operation is always a list of resources in a Bundle or an Operation Outcome.

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/Encounter?class=http://terminology.hl7.org/CodeSystem/v3-ActCode|AMB&patient=Patient/example' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## Encounter for the Patient by Type

Search all Encounters for the specific Patient by Encounter type.

**METHOD** *GET*

```
[base url]/Encounter?patient={Type/}[id]&type={system|}[code]
```

**PARAMS**
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)
\{Type/} - Type for the Reference. *Example:* `Patient/`
\[id] - Id for the Patient
\{system|} - Type system. FHIR search token parameter. See [Search specification](https://www.hl7.org/fhir/search.html#token) for more information.
\[code] - Type code. FHIR search token parameter. See [Search specification](https://www.hl7.org/fhir/search.html#token) for more information.

**HEADERS**

The Authorization token SHALL be obtained during the Authentication and Authorization process. Go to [Authentication and Authorization](/articles/fhir/authentication-authorization) for further details.

| Header        | Type       | Required/Optional | Value            |
| ------------- | ---------- | ----------------- | ---------------- |
| Authorization | **string** | required          | `Bearer <token>` |

**RESPONSES**

| Code | Description                        | Comment                                                                                                                                         |
| ---- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| 200  | OK                                 | The request was processed successfully                                                                                                          |
| 400  | Bad request                        | Invalid request parameters or FHIR operation outcome resource returned                                                                          |
| 401  | Unauthorized                       | This code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource |
| 404  | No route matched with those values | The request was able to communicate with a given server, but the server could not find what was requested                                       |
| 500  | Internal Server Error              | The server has encountered a situation it doesn't know how to handle                                                                            |

The response to any search operation is always a list of resources in a Bundle or an Operation Outcome.

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/Encounter?patient=Patient/example&type=http://snomed.info/sct|261665006' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## Encounter for the Patient by Encounter Location

Search all Encounters for the specific Patient by the specific Encounter Location. This API call supports searching using the combination of the patient and location search parameters.

**METHOD** *GET*

```
[base url]/Encounter?patient={Type/}[id]&location={locationType/}[locationId]
```

**PARAMS**
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)
\{Type/} - Type for the Reference. *Example:* `Patient/`
\[id] - Id for the Patient
\{locationType/} - Type for the Location Reference. *Example:* `Location/`
\[locationId] - Id for the Location

**HEADERS**

The Authorization token SHALL be obtained during the Authentication and Authorization process. Go to [Authentication and Authorization](/articles/fhir/authentication-authorization) for further details.

| Header        | Type       | Required/Optional | Value            |
| ------------- | ---------- | ----------------- | ---------------- |
| Authorization | **string** | required          | `Bearer <token>` |

**RESPONSES**

| Code | Description                        | Comment                                                                                                                                         |
| ---- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| 200  | OK                                 | The request was processed successfully                                                                                                          |
| 400  | Bad request                        | Invalid request parameters or FHIR operation outcome resource returned                                                                          |
| 401  | Unauthorized                       | This code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource |
| 404  | No route matched with those values | The request was able to communicate with a given server, but the server could not find what was requested                                       |
| 500  | Internal Server Error              | The server has encountered a situation it doesn't know how to handle                                                                            |

The response to any search operation is always a list of resources in a Bundle or an Operation Outcome.

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/Encounter?patient=Patient/example&location=Location/ward_001' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## Encounter for the Patient by Encounter Status

Search all Encounters for the specific Patient by the specific Encounter status. This API call supports searching using the combination of the patient and status search parameters.

**METHOD** *GET*

```
[base url]/Encounter?patient={Type/}[id]&status={system|}[code]
```

**PARAMS**
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)
\{Type/} - Type for the Reference. *Example:* `Patient/`
\[id] - Id for the Patient
\{system|} - Status system. FHIR search token parameter. See [Search specification](https://www.hl7.org/fhir/search.html#token) for more information.
\[code] - Status code. FHIR search token parameter. See [Search specification](https://www.hl7.org/fhir/search.html#token) for more information.

**HEADERS**

The Authorization token SHALL be obtained during the Authentication and Authorization process. Go to [Authentication and Authorization](/articles/fhir/authentication-authorization) for further details.

| Header        | Type       | Required/Optional | Value            |
| ------------- | ---------- | ----------------- | ---------------- |
| Authorization | **string** | required          | `Bearer <token>` |

**RESPONSES**

| Code | Description                        | Comment                                                                                                                                         |
| ---- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| 200  | OK                                 | The request was processed successfully                                                                                                          |
| 400  | Bad request                        | Invalid request parameters or FHIR operation outcome resource returned                                                                          |
| 401  | Unauthorized                       | This code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource |
| 404  | No route matched with those values | The request was able to communicate with a given server, but the server could not find what was requested                                       |
| 500  | Internal Server Error              | The server has encountered a situation it doesn't know how to handle                                                                            |

The response to any search operation is always a list of resources in a Bundle or an Operation Outcome.

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/Encounter?patient=Patient/aa74fca2-2c68-47a8-98b6-3857d3df75c4&status=finished' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## Encounter for the Patient by Encounter Discharge disposition

Search all Encounters using the combination of the specific Patient and discharge-disposition search parameters.

**METHOD** *GET*

```
[base url]/Encounter?patient={Type/}[id]&discharge-disposition={system|}[code]
```

**PARAMS**
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)
\{Type/} - Type for the Reference. *Example:* `Patient/`
\[id] - Id for the Patient
\{system|} - Discharge disposition system. FHIR search token parameter. See [Search specification](https://www.hl7.org/fhir/search.html#token) for more information.
\[code] - Discharge disposition code. FHIR search token parameter. See [Search specification](https://www.hl7.org/fhir/search.html#token) for more information.

**HEADERS**

The Authorization token SHALL be obtained during the Authentication and Authorization process. Go to [Authentication and Authorization](/articles/fhir/authentication-authorization) for further details.

| Header        | Type       | Required/Optional | Value            |
| ------------- | ---------- | ----------------- | ---------------- |
| Authorization | **string** | required          | `Bearer <token>` |

**RESPONSES**

| Code | Description                        | Comment                                                                                                                                         |
| ---- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| 200  | OK                                 | The request was processed successfully                                                                                                          |
| 400  | Bad request                        | Invalid request parameters or FHIR operation outcome resource returned                                                                          |
| 401  | Unauthorized                       | This code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource |
| 404  | No route matched with those values | The request was able to communicate with a given server, but the server could not find what was requested                                       |
| 500  | Internal Server Error              | The server has encountered a situation it doesn't know how to handle                                                                            |

The response to any search operation is always a list of resources in a Bundle or an Operation Outcome.

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/Encounter?patient=Patient/aa74fca2-2c68-47a8-98b6-3857d3df75c4&discharge-disposition=http://www.nubc.org/patient-discharge|01' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```
