     Provider_License_Number_State_Code VARCHAR(2),
     Healthcare_Provider_Primary_Taxonomy_Switch VARCHAR(1));
 
+/* The taxonomy groups associated with a license are inserted into this table. The following inserts can be executed as a group */
+
 insert into provider_licenses (npi,sequence_id,Healthcare_Provider_Taxonomy_Code,Provider_License_Number,Provider_License_Number_State_Code,Healthcare_Provider_Primary_Taxonomy_Switch)
     select npf.npi, 1, Healthcare_Provider_Taxonomy_Code_1,Provider_License_Number_1,Provider_License_Number_State_Code_1,Healthcare_Provider_Primary_Taxonomy_Switch_1 from NPPES_flat npf
 where Healthcare_Provider_Taxonomy_Code_1 is not NULL or Provider_License_Number_1 is not NULL or Provider_License_Number_State_Code_1 is not NULL or Healthcare_Provider_Primary_Taxonomy_Switch_1 is not NULL;

    Other_Provider_Identifier_Issuer VARCHAR(80),
    Other_Provider_Identifier_State VARCHAR(2));

/* Identifiers are generated by denormalizing the NPPES_flat table */
insert into other_provider_identifiers (npi,sequence_id,Other_Provider_Identifier,Other_Provider_Identifier_Type_Code,Other_Provider_Identifier_Issuer,Other_Provider_Identifier_State)
    select npf.npi, 1, Other_Provider_Identifier_1,Other_Provider_Identifier_Type_Code_1,Other_Provider_Identifier_Issuer_1,Other_Provider_Identifier_State_1 from NPPES_flat npf
where Other_Provider_Identifier_1 is not NULL or Other_Provider_Identifier_Type_Code_1 is not NULL or Other_Provider_Identifier_Issuer_1 is not NULL or Other_Provider_Identifier_State_1 is not NULL;


create unique index pk_nsdpt_npi on npi_summary_detailed_primary_taxonomy(npi);

/*

Compare record count of this:

select count(*) from npi_summary_detailed_primary_taxonomy;

to

select count(*) from NPPES_flat;

 */



drop view if exists npi_summary_abridged_primary_taxonomy;
CREATE VIEW npi_summary_abridged_primary_taxonomy
AS
