@@ -26,6 +26,13 @@ def self.call(...) = new(...).call
2626
2727 private
2828
29+ GENDER_CODE_MAPPINGS = {
30+ female : "F" ,
31+ male : "M" ,
32+ not_known : "U" ,
33+ not_specified : "I"
34+ } . with_indifferent_access . freeze
35+
2936 attr_reader :team , :programme , :academic_year , :start_date , :end_date
3037
3138 def headers
@@ -50,7 +57,8 @@ def headers
5057 *vaccine_columns ( 2 ) ,
5158 *vaccine_columns ( 3 ) ,
5259 *vaccine_columns ( 4 ) ,
53- *vaccine_columns ( 5 )
60+ *vaccine_columns ( 5 ) ,
61+ "Gender"
5462 ]
5563 end
5664
@@ -150,14 +158,15 @@ def rows(patient:, vaccination_records:)
150158 *vaccine_fields ( records , 1 ) ,
151159 *vaccine_fields ( records , 2 ) ,
152160 *vaccine_fields ( records , 3 ) ,
153- *vaccine_fields ( records , 4 )
161+ *vaccine_fields ( records , 4 ) ,
162+ GENDER_CODE_MAPPINGS [ patient . gender_code ]
154163 ]
155164 end
156165 end
157166 end
158167
159168 def blank_vaccine_fields
160- [ "" , "" , "" , "" , "" , "" ]
169+ [ "" , "" , "" , "" , "" , "" , "" ]
161170 end
162171
163172 def vaccine_fields ( vaccination_records , index )
0 commit comments