Thursday, August 8, 2013

What do NDC, NCPDP, NABP, NPI mean?

Today I will briefly talk about key terms in healthcare industry that I learned over time.

NDC: National Drug Code

The National Drug Code  (NDC) is a unique product identifier used in the United States for human drugs to identify the vendor (manufacturer), product and package size of all drugs and biologics recognized by the Food and Drug Administration (FDA). It is 10-digit numeric code with 3-segment numeric identifier assigned to each medication listed under Section 510 of FDCA. There are three kinds of combinations for NDC:  4-4-2, 5-3-2, or 5-4-1. 
  • The first segment, known as the labeler code, is assigned by FDA. A labeler is any firm that manufactures, repacks, or distributes a drug product.
  • The second segment, known as the product code, identifies a specific drug, strength, and dosage form of that drug.
  • The third segment, known as the package code, identifies the package size. 
The NDC can be found on the drug container (i.e., vial, bottle, or tube).
 
Pseudo-NDC
NDC derived by CMS (Centers for Medicare and Medicaid Services) is a 11-digit numeric code with a fixed length segmentation: 5-4-2. Since it is different from NDC by FDA, it is sometimes called pseudo-NDC. The NDC examples for diabetic supply list are shown below:


Since July 2013, all outpatient drug claims billed are required to include the J code and a valid NDC (National Drug Code), NDC quantity and NDC Unit of Measure (UOM). The NDC quantity is in the format of 9999.99 while the NDC UOM codes can be
  • F2: International Unit
  • GR: Gram
  • ME: Milligram
  • ML: Millilitre
  • UN: Unit

The NDCs on claims usually don't contain hyphens or spaces between segments.

NCPDP and NABP

A NCPDP Provider Identification number (NCPDP Provider ID) formerly known as the Pharmacy NABP number, is 7-digit code a to provide pharmacies with a unique, national identifier that would assist pharmacies in their interactions with pharmacy payers and claims processors.

NPI

A National Provider Identifier or NPI is a unique 10-digit identification number issued to health care providers in the United States by the Centers for Medicare and Medicaid Services (CMS) NPPES.

Reference: 
  1. CMS NDC 
  2. FDA NDC
  3. Anatomy Of The National Drug Code 

Monday, August 5, 2013

Concepts in Microsoft Association Rules: Lift, Support, Importance, and Probability

       You must have heard of the famous diapers and beer story that illustrates the correlation in shoppers' baskets. Market basket analysis by association rule mining has been widely used by retailers since 1990s to adjust store layouts, and to develop cross-promotion plans and catalogs. Nowadays instant recommendations with association rules becomes a hot spot for research. Microsoft Association Rules algorithm is a common algorithm to create association rules, which can be used in a market basket analysis. It supports several parameters that affect the behavior, performance, and accuracy of the resulting mining model. Therefore, it is important to have a clear understanding about these following concepts.      


LIFT


In data mining and association rule learning, lift is a measure of the performance of a model (association rule) at predicting or classifying cases as having an enhanced response (with respect to the population as a whole), measured against a random-choice targeting model. For example, suppose that 5% of the customers mailed a catalog without using the model would make a purchase. But a certain model (or rule) has identified a segment with a response rate of 15%. Then that segment would have a lift of 3.0 (15%/5%). Lift indicates how well the model improved the predictions over a random selection given actual results.

SUPPORT


Support is the probability of a transaction contains targeted item or itemset. The larger Support is, the larger number of cases that contain the targeted item or combination of items the model has. You can use parameter MINIMUM_SUPPORT and MAXIMUM_SUPPORT to define the thresholds. By default, MINIMUM_SUPPORT is 0.0 and MAXIMUM_SUPPORT is 1.0.

RULEs


The Rules tab in Microsoft Association Rules Viewer displays Probability, Importance, Rule that are related to rules that the mining algorithm finds.

Rule: A rule is a description of the presence of an item in a transaction based on the presence of other items.

Probability: The likelihood of a rule, defined as the probability of the right-hand item given the left-hand side item. By default, MINIMUM_PROBABILITY is 0.4. However, probability sometimes is misleading. For example, if every transaction contains a gift bag--perhaps the gift bag is added to each customer's cart automatically as a promotion, a rule predicting that gift bag has a probability of 1. It is accurate but not very useful. To flag the usefulness of a rule, Importance is the right measure to use.

Importance: A measure of the usefulness of a rule. A greater value means a better rule. The importance of a rule is calculated by the log likelihood of the right-hand side of the rule, given the left-hand side of the rule. For example, in the rule of If {A} then {B}, the importance is Log( Pr(A&B)/  Pr(B without A) ) .

Thursday, August 1, 2013

How to: Extract the Name from a Combination of Name and Title

Data transformation often requires to extract info/substring set from part of strings. If this substring set is a fixed length, it is easy to implement by functions of Substring in SSIS. However, when the substring set is in various length, you have to find out the rule first.

For example, if a column NameTitle is a combination of name and title, we want to separate name and title. Suppose that all members has only one string as titles, i.e., we have NameTitle = "Andrew S MD", how to separate "Andrew S" and "MD"?

SSIS expressions makes it easy to implement that kind of data transformation. For introduction of SSIS expressions, you can read Stairway to Integration Service: SSIS Expressions. Now go ahead to drag a Data Flow Task and get the source column. In Derived Column Transformation, define a column that "Add as a New Column", then follow the steps below to get its SSIS expression:

  1. Use LEN and REPLACE functions to find out the numbers of spaces NameTitle column contains. Replace all spaces with empty strings first. Then substract the length of original strings with the modified one. Pay attention to match parentheses in same colors.
    LEN([NAMETITLE])-LEN(Replace([NAMETITLE], " ", ""))
  2. Determine the location of the space right before titles (or space that separates name and title) by FINDSTRING function.
    FINDSTRING( [NAMETITLE], " ", LEN([NAMETITLE])-LEN(Replace([NAMETITLE], " ", "")) )
  3. Use the SUBSTRING function to retrieve names from NameTitle.
    SUBSTRING( [NAMETITLE], 1, FINDSTRING( [NAMETITLE], " ", LEN([NAMETITLE])-LEN(Replace([NAMETITLE], " ", "")) )-1 )
BTW, in Excel, you can use LEFT(A2, LEN(A2)- LEN(RIGHT(A2, LEN(A2)-SEARCH("@", SUBSTITUTE(A2, " ", "@", LEN(A2)_LEN(SUBSTITUTE(A2, " ", ""))))))-1) to extract names from the combination, if A2 is the location of NameTitle.