> ## 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.

# Clinical Notes

## Overview

Clinical Notes Information addresses:

* Clinical Notes HL7® FHIR® description [US Core 6.1.0](http://hl7.org/fhir/us/core/STU6.1/clinical-notes.html)

Clinical notes are a key component in communicating a patient’s current status. In the context of this implementation the term “clinical notes” refers to the wide variety of documents generated on behalf of a patient in many care activities. They include notes to support transitions of care, care planning, quality reporting, billing, and even handwritten notes by providers.

This implementation defines how systems exchange eight “Common Clinical Notes” and three DiagnosticReport categories.

This implementation SHALL support, at minimum, these eight “Common Clinical Notes”:

1. Consultation Note (11488-4)
2. Discharge Summary (18842-5)
3. History & Physical Note (34117-2)
4. Procedures Note (28570-0)
5. Progress Note (11506-3)
6. Imaging Narrative (18748-4)
7. Laboratory Report Narrative (11502-2)
8. Pathology Report Narrative (11526-1)

**Example Usage Scenarios:**

The following are example usage scenarios for the US Core DocumentReference profile. See the Clinical Notes section for additional detail on using this profile for Clinical Notes:

* Query for all documents belonging to a Patient
* Query for a specific Clinical Note type (e.g. Discharge Summary or Continuity of Care Document (CCD))
* Query for all Clinical Notes belonging to a Patient
* Write a new Note to a Patient’s Chart

**Each DocumentReference has next elements:**

* a status
* a code describing the type of document
* a document category
* a patient
* an address (e.g. url) where the document can be retrieved or the content as inline base64 encoded data
* the MIME type (i.e. contentType) of the document

**Each DocumentReference must support:**

* a business identifier for the DocumentReference (possibly generated by the transcription system or EHR)
* date and time the reference was created
* an author
* a code identifying the specific details about the format of the document — over and above the content’s MIME type
* the patient encounter that is being referenced
* clinically relevant date

**Profile specific implementation guidance:**

* See [Clinical Notes](http://hl7.org/fhir/us/core/clinical-notes.html)
* The DocumentReference.type binding must support at a minimum the [5 Common Clinical Notes](http://hl7.org/fhir/us/core/ValueSet-us-core-clinical-note-type.html) and may extend to the full [US Core DocumentReference Type Value Set](http://hl7.org/fhir/us/core/ValueSet-us-core-documentreference-type.html)
* For a C-CDA Clinical Summary of Care (CCD):
  * The document type code is the LOINC code 34133-9 *Summary of episode note*.
  * The format code is `urn:hl7-org:sdwg:ccda-structuredBody:2.1`
* The DocumentReference resources can represent the referenced content using either an address where the document can be retrieved using `DocumentReference.attachment.url` or the content as inline base64 encoded data using `DocumentReference.attachment.data`.
  * Although both are marked as must support, the server system is not required to support both an address and inline base64 encoded data, but SHALL support at least one of these elements.
  * The client application **SHALL** support both elements.
  * The `content.url` may refer to a FHIR Binary Resource (i.e. \[base]/Binary/\[id]), FHIR Document Bundle (i.e \[base]/Bundle/\[id] or other endpoint.
    * If the endpoint is outside of the FHIR base URL, it **SHOULD NOT** require additional authorization to access.
* The organization responsible for the DocumentReference **SHALL** be present either in DocumentReference.custodian or accessible in the Provenance resource targeting the DocumentReference using `Provenance.agent.who` or `Provenance.agent.onBehalfOf`.
  * Some system may also expose the same organization in referenced Encounter in `Encounter.serviceProvider`.

This resource conforms to [USCDI V3 profile](https://www.healthit.gov/isp/uscdi-data-class/clinical-notes#uscdi-v3)
For DocumentReference - refers to [StructureDefinition US Core DocumentReference](http://hl7.org/fhir/us/core/STU6.1/StructureDefinition-us-core-documentreference.html).

DocumentReference response will be provided in JSON (refers to Capability Statement) format as per [FHIR](https://hl7.org/fhir) standard R4 version.

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

*DocumentReference**must support** these elements:*

* `identifier`
* `status`
* `type`
* `category`
* `subject`
* `date`
* `author`
* `content`
  * `attachment`
    * `contentType`
    * `data`
    * `url`
  * `format`
* `context`
  * `encounter`
  * `period`

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

Please note, the `DocumentReference.content.attachment.url` field uses a different base URL from the Elation FHIR host. We host these attachments from the Elation APIv2 root URLs, these are `https://sandbox.elation.com/` (for the FHIR sandbox environment) and `https://app.elationemr.com/` (for the FHIR production environment). In addition, you will need to request an Elation APIv2 token (as per [the APIv2 authentication documentation](https://docs.elationhealth.com/reference/get-token)) to be able to download these attachments. Please contact support if you require assistance.

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

**SHALL** support fetching a DocumentReference using the `_id` search parameter:
`GET [base url]/DocumentReference?_id=[id]`

**SHALL** support searching for all DocumentReference for a patient using the `patient` search parameter:

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

**SHALL** support searching using the combination of the `patient` and `category` search parameters:
`GET [base url]/DocumentReference?patient={Type/}[id]&category=http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category|clinical-note`

**SHALL** support searching using the combination of the `patient` and `category` and `date` 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]/DocumentReference?patient={Type/}[id]&category=http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category|clinical-note&date={gt|lt|ge|le}[date]{&date={gt|lt|ge|le}[date]&...}`

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

*The following search parameters and search parameter combinations SHOULD be supported (**optional**):*

**SHOULD** support searching using the combination of the `patient` and `status` search parameters:

* including support for *OR* search on `status` (e.g. `status={system|}[code],{system|}[code],...`)
  `GET [base url]/DocumentReference?patient={Type/}[id]&status={system|}[code]{,{system|}[code],...}`

**SHOULD** support searching using the combination of the `patient` and `type` and `period` search parameters:

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

## DocumentReference By Id

Search for DocumentReference by id.

**METHOD** *GET*

```
GET [base url]/DocumentReference/[id]
```

or

```
GET [base url]/DocumentReference?_id=[id]
```

**PARAMS**
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)
\[id] - Id for the DocumentReference

**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                                                                            |

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/DocumentReference/a11b21f6-1ac7-ca23-1ba2-a021f6532a5d' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## DocumentReference By patient

Search for All DocumentReference by a specific patient.

**METHOD** *GET*

```
GET [base url]/DocumentReference?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                                                                            |

**EXAMPLE:**

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

## DocumentReference By patient and category

Fetches a bundle of all DocumentReference resources for the specified patient and category = `clinical-note`

**METHOD** *GET*

```
GET [base url]/DocumentReference?patient={Type/}[id]&category=http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category|clinical-note
```

**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                                                                            |

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/DocumentReference?patient=Patient/1137192&category=http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category|clinical-note' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## DocumentReference By patient and category and date

Fetches a bundle of all DocumentReference resources for the specified patient and category = clinical=note and date

**METHOD** *GET*

```
GET [base url]/DocumentReference?patient={Type/}[id]&category=http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category|clinical-note&date={gt|lt|ge|le}[date]{&date={gt|lt|ge|le}[date]&...}
```

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

**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                                                                            |

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/DocumentReference?patient=Patient/1235541&category=http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category|clinical-note&date=ge2020-01-01T00:00:00Z' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## DocumentReference By patient and type

Fetches a bundle of all DocumentReference resources for the specified patient and type

**METHOD** *GET*

```
GET [base url]/DocumentReference?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 Patient resource
\{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                                                                            |

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/DocumentReference?patient=Patient/1316024&type=http://loinc.org|18842-5' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## DocumentReference By patient and status

Fetches a bundle of all DocumentReference resources for the specified patient and status

**METHOD** *GET*

```
GET [base url]/DocumentReference?patient={Type/}[id]&status={system|}[code]{,{system|}[code],...}
```

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

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/DocumentReference?patient=Patient/1316024&status=superseded' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## DocumentReference By patient and type and period

Fetches a bundle of all DocumentReference resources for the specified patient and type and period.

**METHOD** *GET*

```
GET [base]/DocumentReference?patient={Type/}[id]&type={system|}[code]&period={gt|lt|ge|le}[date]{&period={gt|lt|ge|le}[date]&...}
```

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

**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                                                                            |

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/DocumentReference?patient=Patient/1316024&type=http://loinc.org |34133-9&period=ge2020-01-01T00:00:00Z' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```
