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

## Overview

Clinical Tests addresses to the DiagnosticReport HL7® FHIR® resource.
The DiagnosticReport resource represents a resulted, patient-related, non-medication order and data associated with the order and the patient.

This resource returns textual results and discrete result components. It can return lab, imaging, and cardiology results. It can also return micro and EKG and pathology results that are not a scan. Scans filed into Epic are not returned by this resource.

This implementation SHALL support, at minimum, these three DiagnosticReport categories:

1. Cardiology (LP29708-2)
2. Pathology (LP7839-6)
3. Radiology (LP29684-5)

The following are example usage scenarios for the this profile:

* Query for a specific clinical test result such as electrocardiogram (ECG)
* Query for a specific imaging test result
* Query for a specific Radiology note (e.g., 84178-3 Interventional Radiology Note)
* Query for category of reports (e.g. all Cardiology reports)

Each Diagnostic Report has next elements:

* a status
* a category
* a code describing the type of report
* a patient
* the diagnostically relevant time (known as the “effective time” and typically the time of the procedure)

Each Diagnostic Report must support:

* the encounter the report occurred within
* an instant the report was released
* an author (actor) producing the report
* a reference to one or more test results
* a reference to one or more images
* a reference to the full report (presentedForm)

**Profile specific implementation guidance:**

* See [Clinical Notes Guidance](http://hl7.org/fhir/us/core/STU6.1/clinical-notes.html)

* The `DiagnosticReport.category` binding must support at a minimum the US Core DiagnosticReport Category Codes of Cardiology, Radiology, and Pathology. Other categories may be supported.

* A server will return how a customer has categorized their reports at a particular site. Categorization of reports is not consistent across sites. (e.g. a system may categorize an orthopedic note as cardiology.)

* For Diagnostic Imaging Reports systems **SHOULD** support using the subset of LOINC codes defined in CONF-DIR-19 in HL7 Implementation Guide for CDA Release 2: Imaging Integration, Levels 1, 2, and 3, Basic Imaging Reports in CDA and DICOM Diagnostic Imaging Reports (DIR) - Universal Realm, Release 1.0.

* Diagnostic imaging results in visual images requiring interpretation and clinical test results/reports may also reference images as part of the report. The DiagnosticReport resource links to both Media which represents a specific kind of Observation whose value is image data and ImagingStudy which represents the content in a DICOM imaging study.
  * Only Media is marked as must support in this profile
  * The imagingStudy element **MAY** be used by systems to reference ImagingStudy. However, it is not supported by the majority of systems and its inclusion would be an unnecessary barrier to adoption.

This resource conforms to [USCDI V3 profile](https://www.healthit.gov/isp/uscdi-data-class/clinical-notes#uscdi-v3) for Diagnostic Report - refers to [StructureDefinition US Core DiagnosticReport Note](https://hl7.org/fhir/us/core/STU6.1/StructureDefinition-us-core-diagnosticreport-note.html). DiagnosticReport 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

*DiagnosticReport**must support** these elements:*

* `status`
* `category`
* `code`
* `subject`
* `encounter`
* `effective[x]`
* `issued`
* `performer`
* `result`
* `media`
* `presentedForm`

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

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

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

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

`GET [base]/DiagnosticReport?patient={Type/}[id]&category={system|}[code]`

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

* including optional support for OR search on code (e.g.`code={system|}[code],{system|}[code],...`)

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

**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]/DiagnosticReport?patient={Type/}[id]&category={system|}[code]&date={gt|lt|ge|le}[date]{&date={gt|lt|ge|le}[date]&...}`

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

**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]/DiagnosticReport?patient={Type/}[id]&status={system|}[code]{,{system|}[code],...}`

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

* including optional support for *OR* search on `code` (e.g. `code={system|}[code],{system|}[code],...`)
* 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]/DiagnosticReport?patient={Type/}[id]&code={system|}[code]{,{system|}[code],...}&date={gt|lt|ge|le}[date]{&date={gt|lt|ge|le}[date]&...}`

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

## Diagnostic Report by Patient id

Search for DiagnosticReports by patient.

**METHOD** *GET*

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

**PARAMS**
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)
\{Type/} - optional reference type
\[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                                                                            |

**EXAMPLE:**

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

## Diagnostic Report by Patient and Category

Search for DiagnosticReports by combination patient and category.

**METHOD** *GET*

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

**PARAMS**
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)
\{Type/} - optional reference type
\[id] - Id for the Patient
\{system|} - The system for the category, e.g. [http://loinc.org](http://loinc.org)
\{code} - code for observation in the system, e.g. LP29684-5

**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/DiagnosticReport?patient=Patient/c5137fa5-3216-b12a-cbbc-a0c6bef361g7&category=http://loinc.org|LP29684-5' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## Diagnostic Report by Patient and Code

Search for DiagnosticReports by combination patient and code.

**METHOD** *GET*

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

**PARAMS**
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)
\{Type/} - optional reference type
\[id] - Id for the Patient
\{system|} - The system for the category, e.g. [http://loinc.org](http://loinc.org)
\{code} - code for observation in the system, e.g. 24323-8

**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/DiagnosticReport?patient=Patient/c5137fa5-3216-b12a-cbbc-a0c6bef361g7&code=http://loinc.org|24323-8' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## Diagnostic Report by Patient and Category and Date

Search for DiagnosticReports by combination patient and category and date.

**METHOD** *GET*

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

**PARAMS**
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)
\{Type/} - optional reference type
\[id] - Id for the Patient
\{system|} - The system for the category, e.g. [http://loinc.org](http://loinc.org)
\{code} - Code for observation in the system, e.g. 24323-8
\[date] - Filter's date
\{gt|lt|ge|le} - Search modifier `gr` or `lt` or `ge` or `le`. Specification [how to search by date in FHIR](http://hl7.org/fhir/R4/search.html#date)

**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/DiagnosticReport?patient=Patient/c5137fa5-3216-b12a-cbbc-a0c6bef361g7&category=http://loinc.org|LP29684-5&date=ge2010-01-14T00:00:00Z' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## Diagnostic Report by Patient and Status

Search for DiagnosticReports by combination patient and status.

**METHOD** *GET*

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

**PARAMS**
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)
\{Type/} - optional reference type
\[id] - Id for the Patient
\{system|} - The system for the category, e.g. [http://loinc.org](http://loinc.org)
\{code} - code for observation in the system, e.g. 24323-8

**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/DiagnosticReport?patient=Patient/c5137fa5-3216-b12a-cbbc-a0c6bef361g7&status=completed' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## Diagnostic Report by Patient and Code and Date

Search for DiagnosticReports by combination patient and code and date.

**METHOD** *GET*

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

**PARAMS**
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)
\{Type/} - optional reference type
\[id] - Id for the Patient
\{system|} - The system for the category, e.g. [http://loinc.org](http://loinc.org)
\{code} - code for observation in the system, e.g. 24323-8
\[date] - Filter's date
\{gt|lt|ge|le} - Search modifier `gr` or `lt` or `ge` or `le`. Specification [how to search by date in FHIR](http://hl7.org/fhir/R4/search.html#date)

**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/DiagnosticReport?patient=Patient/c5137fa5-3216-b12a-cbbc-a0c6bef361g7&code=http://loinc.org|24323-8&date=ge2019-01-14T00:00:00Z' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```
