<%== render partial: "entry_attributes", locals: {entry: medication, code_sets: ["RxNorm", "CVX", "FDA"]}%>
<% if medication.administration_timing %>
<% end %>
<% if medication.route %>
<%== gc32_code_display medication, "tag_name" => "route", "attribute" => "route", "preferred_code_sets" => ["NCI Thesaurus"] %>
<% end %>
<% if medication.site %>
<%== gc32_code_display medication, "tag_name" => "site", "attribute" => "site", "preferred_code_sets" => ["SNOMED-CT"] %>
<% end %>
<%== quantity_display medication.dose, :dose %>
<% if medication.dose_indicator %>
<%=medication.dose_indicator%>
<% end %>
<% if medication.dose_restriction %>
<%= medication.dose_restriction["numerator"]%>
<%= medication.dose_restriction["denominator"]%>
<% end %>
<% if medication.product_form %>
<%== gc32_code_display medication, "tag_name" => "productForm", "attribute" => "product_form", "preferred_code_sets" => ["FDA", "NCI Thesaurus"] %>
<% end %>
<% if medication.delivery_method %>
<%== gc32_code_display medication, "tag_name" => "deliveryMethod", "attribute" => "delivery_method", "preferred_code_sets" => medication.delivery_method.keys %>
<% end %>
<% if medication.type_of_medication%>
<%== gc32_code_display medication, "tag_name" => "type", "attribute" => "type_of_medication", "preferred_code_sets" => ["SNOMED-CT"] %>
<% end %>
<% if medication.status_of_medication%>
<%== gc32_code_display medication, "tag_name" => "statusOfMedication", "attribute" => "status_of_medication", "preferred_code_sets" => ["SNOMED-CT"] %>
<% end %>
<%if medication.indication%>
<%== gc32_code_display medication, "tag_name" => "indication", "attribute" => "indication", "preferred_code_sets" => ["SNOMED-CT"] %>
<% end %>
<% if medication.vehicle %>
<%== gc32_code_display medication, "tag_name" => "vehicle", "attribute" => "vehicle", "preferred_code_sets" => ["SNOMED-CT"] %>
<% end%>
<% if medication.dose_indicator %>
<%= medication.dose_indicator %>
<% end %>
<% if medication.patient_instructions %>
<%=medication.patient_instructions%>
<% end %>
<% if medication.fulfillment_instructions %>
<%=medication.fulfillment_instructions%>
<% end %>
<% medication.fulfillment_history.each do |fh| %>
fillStatus="<%=fh.fill_status%>" <% end %>
<% if fh.fill_number %> fillNumber="<%=fh.fill_number%>" <% end %>>
<%=fh.prescription_number%>
<% if fh.dispense_date %>
<% end %>
<%== quantity_display fh.quantity_dispensed, :quantityDispensed %>
<% end %>
<% medication.order_information.each do |oi| %>
<%== "orderNumber=\"#{oi.order_number}\"" %> <% end %> <% if oi.fills %><%== "fills=\"#{oi.fills}\"" %><% end %>>
<% if oi.quantity_ordered %>
<%== quantity_display oi.quantity_ordered, "quantityOrdered" %>
<% end %>
<% if oi.order_date_time %>
<% end %>
<% if oi.order_expiration_date_time %>
<% end %>
<% end %>
<% include_providers ||= false %>
<% if include_providers %>
<% medication.order_information.each do |oi| %>
<% if oi.provider %>
<%== render partial: 'provider', locals: {provider: oi.provider, tag_name: 'prescriber'} %>
<% end %>
<% end %>
<% medication.fulfillment_history.each do |fh| %>
<% if oi.provider %>
<%== render partial: 'provider', locals: {provider: fh.provider, tag_name: 'pharmacist'} %>
<% end %>
<% end %>
<% end %>