 where Healthcare_Provider_Taxonomy_Code_15 is not NULL or Provider_License_Number_15 is not NULL or Provider_License_Number_State_Code_15 is not NULL or Healthcare_Provider_Primary_Taxonomy_Switch_15 is not NULL;
 
 
-/* The header table is a slimmed down table from the original flat table */
+/* The header table is a slimmed down table from the original flat table.  */
 drop table if exists NPPES_header;
     create table NPPES_header (
     NPI CHAR(10),

    Provider_License_Number_State_Code VARCHAR(2),
    Healthcare_Provider_Primary_Taxonomy_Switch VARCHAR(1));

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;

        depth integer,
         flattened_taxonomy_string varchar(200)
    );

/* Add binary variables for provider type. The alter table statements can be executed by group */
alter table healthcare_provider_taxonomy_processed add is_advanced_practice_midwife boolean;

alter table healthcare_provider_taxonomy_processed add is_allergy_and_immunology boolean;
