lib/health-data-standards/export/csv.rb in health-data-standards-0.8.1 vs lib/health-data-standards/export/csv.rb in health-data-standards-1.0.0

- old
+ new

@@ -15,10 +15,15 @@ def generate_header ["patient_id", "first name", "last name", "gender","race","ethnicity","birthdate"] end def extract_patient_data(patient) - [patient.patient_id, patient.first, patient.last, patient.gender,patient.race,patient.ethnicity,Time.at(patient.birthdate).strftime('%m/%d/%Y')] + race = '' + ethnicity = '' + race = patient.race['name'] || patient.race if !patient.race.nil? + ethnicity = patient.ethnicity['name'] || patient.ethnicity if !patient.ethnicity.nil? + + [patient.patient_id, patient.first, patient.last, patient.gender, race, ethnicity, Time.at(patient.birthdate).strftime('%m/%d/%Y')] end extend self end \ No newline at end of file