Skip to content

Commit

Permalink
Replacing safe nav operator with Hash.dig to better handle the nested…
Browse files Browse the repository at this point in the history
… hashes.
  • Loading branch information
jkotanchik-SB committed Jan 8, 2021
1 parent 7134769 commit dc64899
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/measure-loader/source_data_criteria_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def extract_fields_from_standard_data_criteria(criteria, entry)
def extract_fields_from_single_code_reference_data_criteria(criteria)
single_code_reference = criteria.at_css('value[codeSystem][code]') || criteria.at_css('code[codeSystem][code]')
system_id = "#{single_code_reference['codeSystem']}_#{single_code_reference['codeSystemVersion']}".to_sym
concept = @single_code_concepts[system_id]&[single_code_reference['code'].to_sym] || get_concept_from_participation(criteria.at_css('participation'))
# concept = @single_code_concepts[system_id]&[single_code_reference['code'].to_sym] || get_concept_from_participation(criteria.at_css('participation'))
concept = @single_code_concepts&.dig(system_id, single_code_reference['code']&.to_sym) || get_concept_from_participation(criteria.at_css('participation'))
value_set = concept._parent
return {
description: concept.display_name,
Expand Down

0 comments on commit dc64899

Please sign in to comment.