<%if entry.negationInd %>Not Done: <% end %><%= entry.description %> <% entry.codes.each do |set, codes| %> <% if concept_map %> <%=set %>: <%= codes.join(',') %> <% else %> <%=set %>: <%= codes.join(',') %> <% end %>
<% if concept_map %> <% matches = [] codes.each do |code| matches.concat(concept_map[set][code].values) end %> <% end %> <% end %> <%= entry.times_to_s %> <%= decode_hqmf_status(entry.status, entry.oid) %> <% entry.values.each do |value| %> <% if value.respond_to? :scalar %> <% units = value.try(:units) if(value.respond_to?(:units)) %> <%= value.try(:scalar) %> <%= units %>
<% elsif value.respond_to? :codes %> <% value.codes.each do |system, vals| %> <%= system %>: <%= vals.join(',') %> <% end %> <%= (value.description ? "(#{value.description})" : "(UNKNOWN CODED VALUE)")%>
<% else %> UNKNOWN VALUE <% end %> <% end %> <% (entry.attributes.keys.reject {|key| ['codes', 'time', 'description', 'mood_code', 'values', '_id', '_type', 'start_time', 'end_time', 'status_code', 'negationInd', 'negationReason', 'oid'].include? key}).each do |field| field_value = ThingWithCodes.convert_codes_to_s(entry.attributes[field]) rescue entry.attributes[field].to_s %> <%= field %>: (<%= field_value %>) <% end if entry.negationInd negation_reason = '' if entry.negationReason negation_reason = ThingWithCodes.convert_codes_to_s(entry.negationReason) rescue entry.negationReason.to_s end %> negation: <%= negation_reason %> <% end %>