Drug Name Search
The Drug Name Search endpoint allows for quick retrieval of drugs/product information, ideal for use with autocomplete forms. This functionality helps in efficiently finding the correct drugs/products by searching for names or related terms.
API Request
Use the following API request to search for drugs:
curl -L 'https://www.britelink.io/api/v1/drug_names?q=tylenol' \
-H 'Authorization: Bearer BRITE_API_KEY'
Query Parameters
q
(string): The name or partial name of the drug to search for.f
(boolean, default:false
): Set totrue
to enable fuzzy search.
Example
const apiUrl = "https://www.britelink.io/api/v1/drug_names";
// Function to fetch drug suggestions
const fetchSuggestions = async (inputValue) => {
try {
const response = await axios.get(apiUrl, {
headers: {
Authorization: `Bearer ${apiKey}`,
},
params: { q: inputValue, f: true },
});
const suggestions = response.data.map((result) => ({
id: result.id,
name: result.tradeName,
}));
console.log(suggestions);
} catch (error) {
console.error("Error fetching suggestions:", error);
}
};
Example Response
The API returns data in JSON format. Below is an example of the structure of the response (results may be abbreviated):
[
{
"id": "clrg9syik000fl908dgrpukj4",
"tradeName": "NAPRODOX 50,ROBOL,ROBOL -50,ZODOX-50,NAPRODOX 10,DOXORUBICIN HYDROCHLORIDE SANDOZ,ADRIM-50",
"genericName": "doxorubicin",
"registrationNo": "2002/9.3.2/4046,2002/9.3.2/4047,2022/9.3.2/6327,2020/9.3.2/6039,2020/9.3.2/6038,2015/9.3.2/5093,2015/9.3.2/5093,2021/9.3.2/6074",
"dateRegistered": "2022-09-23T00:00:00.000Z",
"strength": "10MG/5ML,50MG/25ML,10MG,50 MG,2MG/ML",
"form": "SOLUTION; INJECTION,",
"applicantName": "SANDOZ SA (PTY) WATERFALL 5-LR, MAGWA CRESCENT WEST, JUKSKEI VIEW WATERFALL CITY SOUTH AFRICA",
"principalName": "SANDOZ SA (PTY) WATERFALL 5-LR, MAGWA CRESCENT WEST, JUKSKEI VIEW WATERFALL CITY SOUTH AFRICA",
"categoryId": "clror0sft001049uoqnicd85j",
"foodInteractions": null,
"levelOfAvailability": "B",
"drugPriority": "E",
"categoryType": "PRESCRIPTION_PREPARATIONS_9TH_SCHEDULE_PP10",
"ispublished": false,
"createdAt": "2024-01-16T11:28:15.549Z",
"updatedAt": "2024-01-22T12:23:37.395Z",
"chemicalStructure": [
{
"id": "clrorld9x000tla08uhywn70j",
"name": "(8S,10S)-10-[(3-Amino-2,3,6-trideoxy-α-L-lyxo-hexopyranosyl)oxy]-8-glycoloyl-7,8,9,10-tetrahydro-6,8,11-trihydroxy-1-methoxy-5,12-naphthacenedione",
"formula": "C27H29NO11",
"molecularWeight": 543.52,
"casNumber": "23214-92-8",
"createdAt": "2024-01-22T10:08:23.925Z",
"updatedAt": "2024-01-22T10:08:23.925Z",
"drugId": "clrg9syik000fl908dgrpukj4"
}
],
"pharmacology": [
{
"id": "clrn4ny8x000pia08n8jb10vf",
"tradeName": "Cisplatin",
"genericName": null,
"registrationNo": null,
"dateRegistered": null,
"description": null,
"simpleDescription": null,
"clinicalDescription": null,
"strength": null,
"form": null,
"applicantName": null,
"principalName": null,
"categoryId": null,
"foodInteractions": null,
"levelOfAvailability": "A",
"drugPriority": "N",
"categoryType": "PRESCRIPTION_PREPARATIONS_9TH_SCHEDULE_PP",
"ispublished": false,
"createdAt": "2024-01-21T06:38:47.073Z",
"updatedAt": "2024-01-21T06:38:47.073Z"
}
]
}
]
Search with Fuzzy Matching
Please note that our current fuzzy searching allows for handling incomplete names, not misspellings.
Parameters
Parameter | Required/Optional | Description | Default Value | Acceptable Values |
---|---|---|---|---|
q | Required | The drug name or product to search for. | - | strings and nums |
f | Optional | Enable fuzzy search. Set to true to allow partial and approximate matches. | false | true , false |
Example Request
Search for "Tylenol" with fuzzy matching enabled:
curl -L 'https://www.britelink.io/api/v1/drug_names?q=tyle&f=true' \
-H 'Authorization: Bearer YOUR_API_KEY'
Here, the current fuzz algorithm is capable of auto-completing words in a sequence. For example, if you search for 'tyle' or 'yle,' the algorithm will successfully find matches like 'tylenol.' However, if the 'q' parameter contains a misspelling or includes random letters not in the word sequence, the fuzzy search will fail, resulting in empty results. Make sure to provide accurate input for the best search results.
Future Updates
In the current API version (V1), this request returns all available fields for each drug name. Future updates will introduce additional parameters to customize the response, such as excluding specific data.
- Fuzzy searching allows for handling misspellings and incomplete names, making the search more flexible and user-friendly.
- By default, fuzzy searching is disabled. To enable it, set the fuzzing
f
parameter totrue
. - The fuzzer algorithm will be able to handle mispellings in the
q
Use Case: Streamlining Medication Selection in Healthcare Applications
In healthcare applications, accurate and efficient drug identification is critical for healthcare professionals, pharmacists, and patients alike. The Drug Name Search endpoint can be leveraged to streamline the medication selection process in the following real-world scenarios:
-
Auto-Predictive Medication Suggestions: Healthcare applications can utilize this endpoint to provide auto-predictive medication suggestions as healthcare providers type in a drug name during prescription creation or medication orders. As a healthcare provider enters the initial characters of a drug name, the fuzzy matching capability enables the system to suggest relevant medications quickly. This saves time and reduces the risk of selecting the wrong medication.
-
Patient Medication History Retrieval: When accessing a patient's medication history, the endpoint allows healthcare professionals to search for a drug by name or related terms. This simplifies the retrieval of a patient's medication history and ensures that accurate information is readily available, aiding in better-informed medical decisions.
-
Retail Pharmacy Drug Search: Retail pharmacy applications can implement this endpoint to assist customers in finding the exact medication they need. Patients can input partial drug names or related terms, and the system will provide a list of relevant medications, helping customers make informed choices while purchasing over-the-counter or prescription drugs.
-
Inventory Management for Pharmacies: Pharmacies can use the endpoint to streamline inventory management. It enables pharmacists to quickly identify and restock drugs by searching for partial names or related terms. This ensures that pharmacies maintain an up-to-date inventory and can meet patient needs promptly.
-
Clinical Decision Support Systems: Integrated into clinical decision support systems, the Drug Name Search endpoint aids healthcare professionals in making evidence-based decisions. By offering auto-completing and fuzzy search capabilities, it assists in identifying suitable medications during patient assessment and treatment planning.
By incorporating the Drug Name Search endpoint into healthcare applications, developers can enhance the user experience, reduce errors, and improve patient safety by simplifying the drug selection process. This functionality ensures that healthcare professionals and patients can access accurate medication information swiftly and conveniently.