biocontext_kb.core.openfda
==========================

.. py:module:: biocontext_kb.core.openfda


Functions
---------

.. autoapisummary::

   biocontext_kb.core.openfda.count_drugs_by_field
   biocontext_kb.core.openfda.get_available_pharmacologic_classes
   biocontext_kb.core.openfda.get_drug_by_application_number
   biocontext_kb.core.openfda.get_drug_label_info
   biocontext_kb.core.openfda.get_drug_statistics
   biocontext_kb.core.openfda.get_generic_equivalents
   biocontext_kb.core.openfda.search_drugs_by_therapeutic_class
   biocontext_kb.core.openfda.search_drugs_fda


Package Contents
----------------

.. py:function:: count_drugs_by_field(field, search_filter = None, limit = 100)

   Count unique values in a field across FDA-approved drugs. Useful for statistical analysis.

   :returns: Results array with term and count for each unique value or error message.
   :rtype: dict


.. py:function:: get_available_pharmacologic_classes(class_type = 'epc', limit = 100)

   Get available pharmacologic classes from FDA database. Call this first to see available options.

   :returns: Class type, field, available_classes array with term/count, total_found or error message.
   :rtype: dict


.. py:function:: get_drug_by_application_number(application_number)

   Get detailed information about an FDA-approved drug by application number. Format: NDA/ANDA/BLA followed by 6 digits.

   :returns: FDA drug results with application details, products, sponsor information or error message.
   :rtype: dict


.. py:function:: get_drug_label_info(brand_name = None, generic_name = None, ndc = None)

   Get comprehensive drug labeling information from FDA. Includes active ingredients, dosage forms, administration routes.

   :returns: Drug label results with indications, warnings, dosage, active ingredients or error message.
   :rtype: dict


.. py:function:: get_drug_statistics()

   Get general statistics about the FDA Drugs@FDA database. Includes top sponsors, dosage forms, routes, marketing status.

   :returns: Top sponsors, dosage_forms, administration_routes, marketing_statuses with counts or error message.
   :rtype: dict


.. py:function:: get_generic_equivalents(brand_name)

   Find generic equivalents for a brand name drug. Searches ANDA entries with matching active ingredients.

   :returns: Brand drug info, generic_equivalents array, total_generics_found count or error message.
   :rtype: dict


.. py:function:: search_drugs_by_therapeutic_class(therapeutic_class, class_type = 'epc', limit = 25)

   Search for drugs by therapeutic or pharmacologic class. Use get_available_pharmacologic_classes() first for exact terms.

   :returns: FDA drug results array with application info, products, sponsor names or error message.
   :rtype: dict


.. py:function:: search_drugs_fda(brand_name = None, generic_name = None, active_ingredient = None, sponsor_name = None, application_number = None, marketing_status = None, dosage_form = None, route = None, search_type = 'or', sort_by = None, limit = 25, skip = 0)

   Search FDA Drugs@FDA database for approved drug products. Supports multiple search criteria.

   :returns: Results array with drug products including application numbers, sponsors, products array or error message.
   :rtype: dict


