scriptDetail

Query prescription details such as active ingredient, company labeler, and categorical details for all FDA National Drug Codes (NDCs).

Get Started with scriptEncounter

If you have already setup CareQuery, run the below code to get started with your first scriptDetail query.

Example:

🔍

Request all blood coagulation national drug codes (NDCs) details

# import package
from care_query.care_query import CareQuery

# instantiate and connect
cq = CareQuery(email = "your-email", 
               token = "your-api-token")

# construct query
query = cq.scriptDetail(pharm_class = ["blood coagulation factor [epc]", 
                                       "blood coagulation factors [cs]"]) 

# estimate query size (optional)
estimate = query.estimate() 

# return query sample data (optional)
sample = query.sample() 

# execute query to return results
data = query.execute() 

Query Parameters

The following a parameters are available within the scriptDetail query, including details on the parameter values.

descriptionoptions
FDA National Drug Code version 11 standardized code for a dispensed drugAny Valid National Drug Code
(Please see SCRIPT_DETAIL_TABLE or Unformatted NDC11 for full list of options)
Classifications of a drug product based on its therapeutic action, or how it works in the bodyvalues available
The active ingredient in a drug productvalues available
Classification of a drug product based on its regulatory status and how it is marketedvalues available
Number of rows returned in the data requestInteger or False
Binary indicator as to whether you'd like
query to be printed for review upon it's creation
True or False

Query Speed

scriptDetail - depending on the complexity and size of the query, most queries will return results within 30 seconds to 3 minutes.

⏲️

Median Query Speed: 1 minute and 30 seconds

Query Return Data

The scriptDetail query returns the SCRIPT_DETAIL_TABLE for all encounters that meet the criterion specified within the query.

The SCRIPT_DETAIL_TABLE provides comprehensive drug and provider details by NDC code.

featuredescriptionexample
ndcFDA standardized National Drug Code 11 for a dispensed drug00002021301
labelerA company or organization that is a manufacturer, repackager, relabeler, or distributor of drugseli lilly and company
product_typeA classification of a drug product based on its intended use and how it is regulated by the FDAhuman otc drug
substanceA substance is the active ingredient in a drug productinsulin
substance_unitThe unit of measurement for the active ingredient in a drug product[iU]/mL
dosage_formThe type of pharmaceutical formulation, such as a tablet, capsule, liquid, or injection, that a drug product is available ininjection, solution
routeMethod by which a drug product is administered to the bodyparenteral
marketing_categoryA classification of a drug product based on its regulatory status and how it is marketedbla
application_numberA unique identifier for an NDC labeler's request to obtain an NDC labeler codeBLA018780
pharm_classA list of classifications of a drug product based on its therapeutic action, or how it works in the bodyinsulin [cs],
insulin [epc]

Advanced Query Logic & Recipes

As one thinks about what the healthcare encounter's they'd like returned in a query...the diagnosis, procedure, location, time and specialty criterion...things can get quite complex.

scriptDetail gives users categorical groupings for ease of use, as well as SQL-like capabilities to tactfully specify AND and OR logic, right within the CareQuery API!

Please reference the following resources to better understand how to create rockstar queries!