templates/_allergy.gc32.erb in health-data-standards-0.8.1 vs templates/_allergy.gc32.erb in health-data-standards-1.0.0

- old
+ new

@@ -1,13 +1,23 @@ <allergy xmlns="urn:hl7-org:greencda:c32"> <id><%= allergy.id%></id> - <status><%= allergy.status%></status> <%== code_display allergy, "tag_name" => "code", 'preferred_code_sets' => ['SNOMED-CT', "RxNorm", "FDA"] %> - <type><%= allergy.type%></type> + <status><%= allergy.status%></status> + <freeText><%= allergy.free_text %></freeText> <effectiveTime> - <start><%= time_if_not_nil(allergy.start_time, allergy.time) %></start> + <% if allergy.start_time || allergy.end_time %> + <start><%= time_if_not_nil(allergy.start_time) %></start> <end><%= time_if_not_nil(allergy.end_time) %></end> + <% else %> + <%= time_if_not_nil(allergy.time) %> + <% end %> </effectiveTime> - <%== code_display allergy, "tag_name" => "reaction", 'preferred_code_sets' => ['SNOMED-CT'] %> - <%== code_display allergy, "tag_name" => "severity", 'preferred_code_sets' => ['SNOMED-CT'] %> -</allergy> - + <% if allergy.type %> + <%== code_display allergy, "tag_name" => "type", "attribute" => "type", 'preferred_code_sets' => ['RxNorm', 'SNOMED-CT'] %> + <% end %> + <% if allergy.reaction %> + <%== code_display allergy, "tag_name" => "reaction", "attribute" => "reaction", 'preferred_code_sets' => ['RxNorm', 'SNOMED-CT'] %> + <% end %> + <% if allergy.severity%> + <%== code_display allergy, "tag_name" => "severity", "attribute" => "severity", 'preferred_code_sets' => ['RxNorm', 'SNOMED-CT'] %> + <% end %> +</allergy> \ No newline at end of file