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

The US Core Observation Clinical Test Result Profile is based upon the core FHIR Observation Resource, and, along with the [US Core DiagnosticReport Profile for Report and Note exchange](/articles/fhir/uscdi-clinical-tests-diagnostic-report), meets the US Core Data for Interoperability (USCDI) v2 ‘Clinical Tests’ requirements. Clinical tests includes non-imaging and non-laboratory tests performed on a patient that results in structured or unstructured (narrative) findings specific to the patient, such as electrocardiogram (ECG), visual acuity exam, macular exam, or graded exercise testing (GXT), to facilitate the diagnosis and management of conditions.

The following are example usage scenarios for the this profile:

**Example Usage Scenarios:**

The following are example usage scenarios for the this profile:

* Query for non-imaging and non-laboratory tests results for a patient
* Record or update clinical tests results belonging to a Patient

**Each Observation has next elements:**

* a status
* a category code of `clinical-test`
* a LOINC code, if available, which tells you what is being measured
* a patient

**Each Observation supports next elements:**

* a time indicating when the measurement was taken
* a result value or a reason why the data is absent
  * if the result value is a numeric quantity, a standard UCUM unit

**Profile specific implementation guidance:**

* This profile defines a Valueset based on a starter set of example clinical test LOINC codes identified in the [Appendix B in US Core Data for Interoperability (USCDI) Task Force 2021 HITAC Phase 3 Recommendations Report Letter](https://www.healthit.gov/sites/default/files/page/2021-10/2021-09-09_USCDI_TF_2021_HITAC_Phase%203_%20Recommendations%20Report_Signed_508.pdf). It is not intended to be complete and implementers are expected include other LOINC or other codes to meet their business needs.
* The `Observation.category` element provides an efficient way of restricting search on observations to “clinical-test” observations. However, clients need to understand that data categorization is somewhat subjective. The categorization applied by the source may not align with the client’s expectations. Clients may find it more useful to use queries based on a specific code or set of codes or to perform additional client side filtering of query results.
* Additional codes that translate or map to the Observation code or category codes are allowed. For example:
  * providing both a local code and LOINC code
  * providing a more specific code , a [SNOMED CT](http://hl7.org/fhir/R4/valueset-procedure-code.html) concept, or system specific codes in addition to the ‘clinical-test’ category code.
* Systems **SHOULD** support `Observation.effectivePeriod` to accurately represent procedure tests that are collected over a period of time .
* An Observation without a value, **SHALL** include a reason why the data is absent unless there are 1) component observations, or 2) reporting panel observations using `Observation.hasMember`.
* See the [General Guidance](/articles/fhir/us-core-guidance) Section for further guidance on using UCUM
* For imaging and laboratory tests the corresponding US Core Diagnostic Imaging Result Observation Profile and US Core Laboratory Result Observation Profile should be used instead.

This resource conforms to [USCDI V2 profile](https://www.healthit.gov/isa/uscdi-data-class/clinical-tests#uscdi-v2) for Observation - refers to [US Core Observation Profile for Report and Note Exchange](http://hl7.org/fhir/us/core/StructureDefinition-us-core-observation-clinical-test.html). Observation 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

*Observation**must support** these elements:*

* `status`
* `Slices for category`\
  -`category:clinical-test`
* `code`
* `subject`
* `effectiveDateTime`
* `valueQuantity`
* `valueCodeableConcept`
* `valueString`
* `dataAbsentReason`

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 using the combination of the `patient` and `category` search parameters:

`GET [base]/Observation?patient={Type/}[id]&category={system|}[code]&category=http://terminology.hl7.org/CodeSystem/observation-category|clinical-test`

**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]/Observation?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]/Observation?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 `category` and `status` search parameters:

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

`GET [base]/Observation?patient={Type/}[id]&category=http://terminology.hl7.org/CodeSystem/observation-category|clinical-test&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]/Observation?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 and Category

Search for ObservaDiagnosticReportstion by combination patient and category.

**METHOD** *GET*

```
[base url]/Observation?patient={Type/}[id]&category=http://terminology.hl7.org/CodeSystem/observation-category|clinical-test
```

**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/Observation?patient=Patient/c5137fa5-3216-b12a-cbbc-a0c6bef361g7&category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## Observation by Patient and Code

Search for Observation by combination patient and code.

**METHOD** *GET*

```
[base url]/Observation?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. 44974-4

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

## Observation by Patient and Category and Date

Search for Observations by combination patient and category and date.

**METHOD** *GET*

```
[base url]/Observation?patient={Type/}[id]&category=http://terminology.hl7.org/CodeSystem/observation-category|clinical-test&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/Observation?patient=Patient/c5137fa5-3216-b12a-cbbc-a0c6bef361g7&category=http://terminology.hl7.org/CodeSystem/observation-category|clinical-test&date=ge2010-01-14T00:00:00Z' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## Observation by Patient and Category and Status

Search for Observations by combination patient and Category and Status.

**METHOD** *GET*

```
[base url]/Observation?patient={Type/}[id]&category=http://terminology.hl7.org/CodeSystem/observation-category|clinical-test&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. final

**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/Observation?patient=Patient/c5137fa5-3216-b12a-cbbc-a0c6bef361g7&category=http://terminology.hl7.org/CodeSystem/observation-category|clinical-test&status=final' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## Observation by Patient and Code and Date

Search for Observations by combination patient and code and date.

**METHOD** *GET*

```
[base url]/ObsDiagnosticReportervation?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. 2339-0\
\[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/Observation?patient=Patient/c5137fa5-3216-b12a-cbbc-a0c6bef361g7&code=http://loinc.org|2339-0&date=ge2019-01-14T00:00:00Z' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```
