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

# Smoking Status

## Overview

Representing a patient’s smoking behavior through the core FHIR Observation Resource.

The profile restricts observation code to be set in 72166-2 Tobacco smoking status NHIS (LOINC).

Each Observation has next elements:

* a status
* a category code of ‘social-history’
* a code for smoking observation
* a patient
* a date representing when the smoking status was recorded
* a result value code for smoking status

**Profile specific implementation guidance:**

This resource conforms to [USCDI V2 profile](https://www.healthit.gov/isa/united-states-core-data-interoperability-uscdi#uscdi-v2) for Observation - refer to [US Core Observation Profile](https://www.hl7.org/fhir/us/core/StructureDefinition-us-core-smokingstatus.html). Observation 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   |
| ---------------------------- | --------------------- |
| status                       | Observation.status    |
| code                         | Observation.code      |
| patient                      | Observation.subject   |
| smoking status recorded date | Observation.effective |
| value                        | Observation.value     |

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

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

* `status`
* `Slices for category`
  * ` category:SocialHistory`
* `code`
* `subject`
* `effectiveDateTime`
* `valueCodeableConcept`

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 Observation for a patient using the patient and code search parameters:

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

`GET [base url]/Observation?patient={Type/}`\[id]`&code=http://loinc.org|72166-2`

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

## Observation By Patient Id

Search for Observation by patient.

**METHOD** *GET*

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

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

## Observation By Id

Get Observation by ID.

**METHOD** *GET*

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

or

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

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

## Observation by patient and code

Get Observations for the specified patient and code search parameters

**METHOD** *GET*

```
GET [base url]/Observation?patient={Type/}[id]&code=http://loinc.org|72166-2
```

**PARAMS**\
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)\
\[id] - patient id\
`{Type/}` - Type for the Reference. *Example:* `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/fe1cd986-1ac7-4c26-b8b3-d632a48408fd&code=http://loinc.org|72166-2' \
--header 'Authorization: Bearer 1239b275-909e-4754-8f73-1e411fd6769e'
```
