<% values.compact! if !values.empty? values.each do |ev| if ev.respond_to?(:codes) -%> <%== code_display(ev, 'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM'], 'tag_name' => 'value', 'extra_content' => "xsi:type=\"CD\"") %> <% elsif ev.respond_to?(:scalar) -%> <% if is_num?(ev.scalar) -%> unit="<%= ev.units %>"<% end -%>/> <% elsif is_bool?(ev.scalar)%> <% else -%> <%= ev.scalar %> <% end end end # else is empty else -%> <% end -%>