Class TaxDonorDataParser

java.lang.Object
simpaths.model.taxes.database.TaxDonorDataParser

public class TaxDonorDataParser extends Object
CLASS TO MANAGE TRANSLATION OF CSV DATA FROM UKMOD TO DATABASE FOR DONORS USED TO IMPUTE TAX AND BENEFIT PAYMENTS csv data are processed and saved to the DONORPERSON_{country code} table in the relational database. These data are used as working variables to construct the DONORTAXUNIT_{country code} table, which is then used exclusively \ for imputing tax and benefit payments, drawing heavily on SQL calls made via Hibernate
  • Constructor Details

    • TaxDonorDataParser

      public TaxDonorDataParser()
  • Method Details

    • databaseFromCSV

      public static void databaseFromCSV(Country country, int startYear, boolean isVisible)
      ENTRY POINT FOR MANAGER
      Parameters:
      country - country object, defines the country code
      startYear - first simulated year THE MANAGER IS 'run' FROM SimPathsStart
    • updateDefaultDonorTables

      public static void updateDefaultDonorTables(Connection conn, Country country)
    • stringAppender

      public static String stringAppender(Collection<String> strings)
      METHOD TO CONVERT COLLECTION OF STRINGS TO COMMA-SEPARATED SINGLE STRING
      Parameters:
      strings - collection of strings
    • constructAggregateTaxDonorPopulationCSVfile

      public static void constructAggregateTaxDonorPopulationCSVfile(Country country, boolean showGui)
      Constructs the tax donor population based on the data stored in .txt files produced by UKMOD. Note that in order to store this information in an efficient way, we make the important assumption that all UKMOD output for a particular country is derived from the same input population (this is plausible, given that UKMOD is a static microsimulation). When running UKMOD, the most recent input population for a particular country should be used (currently IT_2014_a2.txt and UK_2013_a3.txt). This method constructs a .csv file that aggregates the information from multiple UKMOD output .txt files, picking up the relevant columns for each UKMOD policy scenario, that will eventually be parsed into the JAS-mine input database.
    • populateDonorTaxUnitTables

      public static void populateDonorTaxUnitTables(Country country, boolean showGui)
      METHOD TO POPULATE TAX UNIT TABLES FROM PERSON LEVEL DATA