Created
December 12, 2019 18:39
-
-
Save lighth7015/7df4ab3c108361c40df080c7f69fb9ab to your computer and use it in GitHub Desktop.
SQL to execute
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT "primary"."NDC" as "primaryNDC", | |
"generic"."NDC" as "genericNDC", | |
"primary"."MONY", | |
"primary"."ProductName" as "primaryDrug", | |
"generic"."ProductName" as "genericDrug", | |
"primary"."Strength", | |
"primary"."StrengthUOM", | |
FROM "drugs" AS "primary", | |
"drugs" AS "generic" | |
WHERE ("primary"."TpaRestrictionCode" IS NULL OR "primary"."TpaRestrictionCode" NOT IN (3, 4, 'B', 'L')) | |
AND "primary"."RouteOfAdministration" IN ('IJ', 'SC') | |
AND "primary"."DoseForm" IN ('INJ', 'SUSP', 'SOLR', 'SOLN') | |
AND "primary"."GPI" = "generic"."GPI" | |
AND ( "primary"."DrugName" LIKE '%insulin%' OR "primary"."GenericName" LIKE '%insulin%' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment