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

# Medication

## Overview

The Medication resource is used for the identification and definition of a medication for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use.

**Each Medication has next elements:**

* a medication code

**Profile specific implementation guidance:**

* RXNorm concepts are used and are defined as an extensible binding. USCDI V3+ recommends the National Drug Codes (NDC) as an optional terminology. They can be supplied as an additional coding element.
* Since the binding is extensible, when a code is unavailable just text is allowed.
* When the medication is compounded and is a list of ingredients, the code is still present and may contain only the text.

This resource conforms to [USCDI V3 profile](https://www.healthit.gov/isa/uscdi-data-class/medications#uscdi-v3) for Medication - refer to [StructureDefinition US Core Medication](http://hl7.org/fhir/us/core/STU6.1/StructureDefinition-us-core-medication.html). Medication response will be provided in JSON (refers to Capability Statement) format as per [FHIR](https://hl7.org/fhir) standard R4 version.

| USCore Data Element | FHIR Resource Field |
| ------------------- | ------------------- |
| medication code     | medication.code     |

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

**Medication must support these elements:**

* `code`

No required search criteria for us-core-medication profile.

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

## Medication By Id

Get Medication by ID.

**METHOD** *GET*

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

or

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

**PARAMS**\
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)\
\[id] - Id for Medication 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/Medication/c5137fa5-3216-b12a-cbbc-a0c6bef361g7' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```
