Drugs Linked To Adverse EffectCondition

Overview

The fetchDrugsLinkedToAdverseEffectCondition endpoint retrieves a list of drugs that are linked to a specific adverse effect condition. This is useful for understanding the pharmacological landscape surrounding a particular adverse effect.

HTTP Request

GET https://www.britelink.io/api/adverse_effects/{ID}/drugs

URL Parameters

ParameterDescription
IDThe unique identifier of the adverse effect condition.

Usage

Fetching Drugs Linked to an Adverse Effect Condition

To retrieve drugs related to a specific adverse effect condition, include the condition's ID in the URL. The ID should correspond to an adverse effect condition in your database.

Example request:

curl -L 'https://www.britelink.io/api/adverse_effects/{adverseEffectConditionId}/drugs' \
-H 'Authorization: Bearer your-api-key'

Replace {adverseEffectConditionId} with the actual ID of the adverse effect condition.

Response Format

The response is a JSON array of objects, where each object represents a drug linked to the specified adverse effect condition. The information is formatted according to the FHIR (Fast Healthcare Interoperability Resources) standard.

Example response (truncated for brevity):

[
  {
    "resourceType": "Drug",
    "britelinkId": "DrugID",
    "tradeName": "DrugTradeName",
    "genericName": "DrugGenericName",
    "simpleDescription": "DrugSimpleDescription"
    // Additional drug-related details
  }
  // Additional drugs
]

Error Handling

The endpoint provides clear error messages and appropriate HTTP status codes for various error conditions, such as:

  • 400 Bad Request: Returned if the adverse effect condition ID is not provided in the URL.
  • 404 Not Found: Returned if no drugs are found linked to the specified adverse effect condition ID.
  • 500 Internal Server Error: Returned in case of an error during data retrieval from the database.

Notes

  • The endpoint is designed to be robust and efficient, handling large datasets and returning results quickly.
  • Ensure that the API key used for authorization is kept secure and not exposed in client-side code.