# rxfoundry.clients.swifty_api.MedicationApi
All URIs are relative to */api*
Method | HTTP request | Description
------------- | ------------- | -------------
[**get_medication**](MedicationApi.md#get_medication) | **GET** /swifty/1/medications/{medication_uuid} | Get a medication by UUID
[**get_medication_formularies**](MedicationApi.md#get_medication_formularies) | **GET** /swifty/1/medications/{medication_uuid}/formularies | Get a medication's formularies by medication UUID
[**get_medication_instructions**](MedicationApi.md#get_medication_instructions) | **GET** /swifty/1/medications/{medication_uuid}/instructions | Get a medication by UUID
[**get_medications**](MedicationApi.md#get_medications) | **GET** /swifty/1/medications | Get all medications
# **get_medication**
> Medication get_medication(medication_uuid, pricing_program=pricing_program, deep=deep)
Get a medication by UUID
### Example
* Bearer (opaque) Authentication (opaque_token):
```python
import rxfoundry.clients.swifty_api
from rxfoundry.clients.swifty_api.models.medication import Medication
from rxfoundry.clients.swifty_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = rxfoundry.clients.swifty_api.Configuration(
host = "/api"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (opaque): opaque_token
configuration = rxfoundry.clients.swifty_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with rxfoundry.clients.swifty_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = rxfoundry.clients.swifty_api.MedicationApi(api_client)
medication_uuid = 'medication_uuid_example' # str |
pricing_program = 'pricing_program_example' # str | (optional)
deep = False # bool | (optional) (default to False)
try:
# Get a medication by UUID
api_response = api_instance.get_medication(medication_uuid, pricing_program=pricing_program, deep=deep)
print("The response of MedicationApi->get_medication:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MedicationApi->get_medication: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**medication_uuid** | **str**| |
**pricing_program** | **str**| | [optional]
**deep** | **bool**| | [optional] [default to False]
### Return type
[**Medication**](Medication.md)
### Authorization
[opaque_token](../README.md#opaque_token)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A single medication | - |
**404** | No medication found | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_medication_formularies**
> List[Formulary] get_medication_formularies(medication_uuid, page=page, results_per_page=results_per_page)
Get a medication's formularies by medication UUID
Number of results to return per page. Defaults to 10.
### Example
* Bearer (opaque) Authentication (opaque_token):
```python
import rxfoundry.clients.swifty_api
from rxfoundry.clients.swifty_api.models.formulary import Formulary
from rxfoundry.clients.swifty_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = rxfoundry.clients.swifty_api.Configuration(
host = "/api"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (opaque): opaque_token
configuration = rxfoundry.clients.swifty_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with rxfoundry.clients.swifty_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = rxfoundry.clients.swifty_api.MedicationApi(api_client)
medication_uuid = 'medication_uuid_example' # str |
page = 1 # int | Page number to return. Defaults to 1. (optional) (default to 1)
results_per_page = 10 # int | (optional) (default to 10)
try:
# Get a medication's formularies by medication UUID
api_response = api_instance.get_medication_formularies(medication_uuid, page=page, results_per_page=results_per_page)
print("The response of MedicationApi->get_medication_formularies:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MedicationApi->get_medication_formularies: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**medication_uuid** | **str**| |
**page** | **int**| Page number to return. Defaults to 1. | [optional] [default to 1]
**results_per_page** | **int**| | [optional] [default to 10]
### Return type
[**List[Formulary]**](Formulary.md)
### Authorization
[opaque_token](../README.md#opaque_token)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A list of formularies for a medication, if any exist | * X-Total-Count - Total number of prescriptions available
* X-Page - Current page number
* X-Per-Page - Number of prescriptions per page
* X-Total-Pages - Total number of pages available
|
**404** | No formulary found | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_medication_instructions**
> List[MedicationInstruction] get_medication_instructions(medication_uuid, q=q, page=page, results_per_page=results_per_page)
Get a medication by UUID
### Example
* Bearer (opaque) Authentication (opaque_token):
```python
import rxfoundry.clients.swifty_api
from rxfoundry.clients.swifty_api.models.medication_instruction import MedicationInstruction
from rxfoundry.clients.swifty_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = rxfoundry.clients.swifty_api.Configuration(
host = "/api"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (opaque): opaque_token
configuration = rxfoundry.clients.swifty_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with rxfoundry.clients.swifty_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = rxfoundry.clients.swifty_api.MedicationApi(api_client)
medication_uuid = 'medication_uuid_example' # str |
q = 'q_example' # str | (optional)
page = 1 # int | Page number to return. Defaults to 1. (optional) (default to 1)
results_per_page = 10 # int | (optional) (default to 10)
try:
# Get a medication by UUID
api_response = api_instance.get_medication_instructions(medication_uuid, q=q, page=page, results_per_page=results_per_page)
print("The response of MedicationApi->get_medication_instructions:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MedicationApi->get_medication_instructions: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**medication_uuid** | **str**| |
**q** | **str**| | [optional]
**page** | **int**| Page number to return. Defaults to 1. | [optional] [default to 1]
**results_per_page** | **int**| | [optional] [default to 10]
### Return type
[**List[MedicationInstruction]**](MedicationInstruction.md)
### Authorization
[opaque_token](../README.md#opaque_token)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A single medication | * X-Total-Count - Total number of prescriptions available
* X-Page - Current page number
* X-Per-Page - Number of prescriptions per page
* X-Total-Pages - Total number of pages available
* X-Scores - A dictionary of search scores for each prescriber
|
**404** | No medication found | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_medications**
> List[Medication] get_medications(q=q, pricing_program=pricing_program, page=page, results_per_page=results_per_page, deep=deep)
Get all medications
### Example
* Bearer (opaque) Authentication (opaque_token):
```python
import rxfoundry.clients.swifty_api
from rxfoundry.clients.swifty_api.models.medication import Medication
from rxfoundry.clients.swifty_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = rxfoundry.clients.swifty_api.Configuration(
host = "/api"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (opaque): opaque_token
configuration = rxfoundry.clients.swifty_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with rxfoundry.clients.swifty_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = rxfoundry.clients.swifty_api.MedicationApi(api_client)
q = 'q_example' # str | Filter medications by query. Searches the drug description, scd, sbd, strength, drug form and NDCs for the medication. (optional)
pricing_program = 'pricing_program_example' # str | (optional)
page = 1 # int | Page number to return. Defaults to 1. (optional) (default to 1)
results_per_page = 10 # int | Number of results to return per page. Defaults to 10. (optional) (default to 10)
deep = False # bool | If true, returns contained objects for the medication. If false, returns only the minimum fields. Defaults to false. (optional) (default to False)
try:
# Get all medications
api_response = api_instance.get_medications(q=q, pricing_program=pricing_program, page=page, results_per_page=results_per_page, deep=deep)
print("The response of MedicationApi->get_medications:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MedicationApi->get_medications: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**q** | **str**| Filter medications by query. Searches the drug description, scd, sbd, strength, drug form and NDCs for the medication. | [optional]
**pricing_program** | **str**| | [optional]
**page** | **int**| Page number to return. Defaults to 1. | [optional] [default to 1]
**results_per_page** | **int**| Number of results to return per page. Defaults to 10. | [optional] [default to 10]
**deep** | **bool**| If true, returns contained objects for the medication. If false, returns only the minimum fields. Defaults to false. | [optional] [default to False]
### Return type
[**List[Medication]**](Medication.md)
### Authorization
[opaque_token](../README.md#opaque_token)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A list of all medications | * X-Total-Count - Total number of prescriptions available
* X-Page - Current page number
* X-Per-Page - Number of prescriptions per page
* X-Total-Pages - Total number of pages available
* X-Scores - A dictionary of search scores for each prescriber
|
**404** | No medications found | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)