Sha256: 59c3556eacb0bf61e1e59182b5a995c704d8d9915e738dfa95aacb405034b4ca
Contents?: true
Size: 743 Bytes
Versions: 6
Compression:
Stored size: 743 Bytes
Contents
module HealthDataStandards module Export module CommaSV # Builds a CSV row representing the patient. # # @return csv representation of patient data def export(patient,header) csv = header ? [generate_header,extract_patient_data(patient)] : extract_patient_data(patient) end 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')] end extend self end end end
Version data entries
6 entries across 6 versions & 1 rubygems