Skip to content

Excel file PDP. Create importer

It's becoming more ad-hoc that I wish it to be, but it's coming.

Things that could already be on the database:

  • Language
  • Country
  • Location
  • Flying Team
  • Referals (Health Partner)
  • A subject with the same SS number, first name and last name
  • A studySubject with the same ND number, subject

Columns to be transformed to a standard format

  • Gender (it comes as 'm' or 'f')
  • Language (it comes as letters such as 'L', 'F', etc. or even 'Fin' or 'lt', or 'Sp'
  • Prefered writen language (same as language)
  • Country (it comes as LUX)
  • SS number (comes with spaces)
  • Date of birth (comes in format dd.mm.YYYY)
  • Date added (V1) # visits might have comments like (Tel)
  • ... (V2)
  • ... (V3)
  • ... (V4)

Boolean (Y/N or blank)

  • Deceased
  • Postponed
  • Resigned
  • Excluded
  • PDP 1.0

Assumptions

  • Column names remain the same
  • All study subjects can have all voucher types
  • Voucher activity column has no effect on the Subjects and only the IDs from Voucher References are used to add Vouchers. Important note here @piotr.gawron
  • All vouchers partners can do all voucher types
  • Assumed that vouchers are IN USE and that their expire 365 after their creation
  • The worker who issues the voucher is the referral (health partner)
  • Voucher Reference follows this condition nd_number, date, voucher_partner, voucher_type, num = 'ND0019-20180807-ZIT-IT-00173'.split('-')
assessments = OrderedDict([('Cognitive Test', 180), ('Risk Factor', 120),
                     ('Voucher Distribution', 120), ('Follow Up', 90)])
 
voucher_types_dict = OrderedDict([('Cognitive Activity', 'CA'), ('Neurofit', 'NF'), 
                           ('Mobilfit', 'MF'), ('Diet', 'D'), ('Consulte ORL', 'CORL'), 
                           ('Physical Activity', 'PA'), 
                           ('Individual Cognitive Training', 'IT'), 
                           ('Social', 'S'), ('Test', 'T')])

Not done

  • Add adequate locale to the Languages and flags.
  • Add adequate country id to the countries.

Notes on data

  • Some Subjects has no language so the default language is chosen.
  • A Subject has no preferred written language so the first language is chosen.
  • There are 3 invalid SS Numbers: 1943010852 (too short even for ancient SS numbers), 1936110312203, 1939121227113
Edited by Carlos Vega