<commit_before><% content_for :head do %>
  <script type="text/javascript">
    $(document).ready(function() {
      <% poll_for_updates = false %>
      <% @vendor.expected_results.each do |result| %>
      <%   if result['numerator']=='?' %>
      <%     poll_for_updates = true %>
      <%   end %>
      <% end %>
      <% if poll_for_updates %>
        $("#upload_results_button").hide();
        $.cypress.addPoll("<%= vendor_path(@vendor) %>", null, function() { $("#upload_results_button").show(); });
      <% end %>
      
      $('#upload_pqri_dialog').dialog({
        title: 'Upload Results',
        autoOpen: false,
        closeOnEscape: true,
        draggable: true,
        position: 'center',
        width: 'auto',
        height: 'auto',
        modal: true,
        show: 'fade',
        hide: 'fade',
        resizeable: false,
        buttons: {
          Upload: function() {
            $('#edit_vendor_<%= @vendor._id %>').submit();
            $(this).dialog('close');
          },
          Cancel: function() {
            $(this).dialog('close');
          }
        }
      });
      
      $('#upload_results_button').click(function(event) {
        $('#upload_pqri_dialog').dialog('open');        
        event.preventDefault();
      });
    });
  </script>
<% end %>
<div id="container">
   <%= render :partial=>"shared/header" %>

  <div>
    <section class="tb">
      <%= link_to "Master Patient List", patients_vendor_path, {:class=>"cmd"} %>
      <%= link_to "Edit Profile", edit_vendor_path, {:class=>"cmd"} %>
      <%= link_to "Upload Results", "", {:id => 'upload_results_button', :class=>"cmd"} %>
      <%= link_to "Download C32s", zipc32_vendor_path, {:class=>"cmd"} %>
      <%= link_to "Download CCRs", zipccr_vendor_path, {:class=>"cmd"} %>
      <%= link_to "Download CSV", csv_vendor_path, {:class=>"cmd"} %>
      <nav class="breadcrumb">
        <%= link_to "Certification Dashboard", root_path %> &raquo;
        <span><%= @vendor.name %></span>
      </nav>
    </section>
    <section class="candidate">
      
      <dl class="vendor">
        <dt>Candidate EHR:</dt> <dd><%= @vendor.name %></dd>
        <dt>url:</dt> <dd><a href="<%= @vendor['url'] %>"><%= @vendor['url'] %></a></dd>
      </dl>
      
      <dl>
        <dt>EHR POC:</dt> <dd><%= @vendor.poc %></dd>
        <dt>E-mail:</dt>  <dd><%= @vendor.email %></dd>
        <dt>Phone:</dt>   <dd><%= @vendor.tel %></dd>
      </dl>
      <dl>
        <dt>Proctor:</dt> <dd><%= @vendor.proctor %></dd>
        <dt>E-mail:</dt>  <dd><%= @vendor.proctor_email %></dd>
        <dt>Phone:</dt>   <dd><%= @vendor.proctor_tel %></dd>
      </dl>
    </section>

    <section class="records">
        <label>Notes</label>:
        <% note = Note.new %>
        <%= simple_form_for note, :url => add_note_vendor_path do |f| %>
          <%= f.input_field :text, :as => :text, :rows => 1, :columns => 80 %>
          <%= f.button :submit, :value => 'add' %>
        <% end %>
        <% if @vendor.notes %>
          <% @vendor.notes.each do |note| %>
            <time datetime="<%= note.time.strftime('%Y-%m-%d') %>"><%= note.time.strftime('%m/%d/%Y') %></time>: 
            <%= note.text %><!-- <a href="#">edit</a> -->
            <%= button_to 'delete', {:action=>'delete_note', :id=>@vendor.id, "note[id]"=>note.id}, :method=>:delete, :confirm=>'Are you sure?' %>
            <br/>
          <% end %>
        <% end %>
        <a href="<%= vendor_url(@vendor.id.to_s) %>.pdf" class="ccr_export">Export PDF</a>
    </section>
   
    <section id="quality_measures">
      <table>
        <% if @vendor.failing_measures.size > 0 %><commit_msg>removed the pdf export link if there are no reported results<commit_after><% content_for :head do %>
  <script type="text/javascript">
    $(document).ready(function() {
      <% poll_for_updates = false %>
      <% @vendor.expected_results.each do |result| %>
      <%   if result['numerator']=='?' %>
      <%     poll_for_updates = true %>
      <%   end %>
      <% end %>
      <% if poll_for_updates %>
        $("#upload_results_button").hide();
        $.cypress.addPoll("<%= vendor_path(@vendor) %>", null, function() { $("#upload_results_button").show(); });
      <% end %>
      
      $('#upload_pqri_dialog').dialog({
        title: 'Upload Results',
        autoOpen: false,
        closeOnEscape: true,
        draggable: true,
        position: 'center',
        width: 'auto',
        height: 'auto',
        modal: true,
        show: 'fade',
        hide: 'fade',
        resizeable: false,
        buttons: {
          Upload: function() {
            $('#edit_vendor_<%= @vendor._id %>').submit();
            $(this).dialog('close');
          },
          Cancel: function() {
            $(this).dialog('close');
          }
        }
      });
      
      $('#upload_results_button').click(function(event) {
        $('#upload_pqri_dialog').dialog('open');        
        event.preventDefault();
      });
    });
  </script>
<% end %>
<div id="container">
   <%= render :partial=>"shared/header" %>

  <div>
    <section class="tb">
      <%= link_to "Master Patient List", patients_vendor_path, {:class=>"cmd"} %>
      <%= link_to "Edit Profile", edit_vendor_path, {:class=>"cmd"} %>
      <%= link_to "Upload Results", "", {:id => 'upload_results_button', :class=>"cmd"} %>
      <%= link_to "Download C32s", zipc32_vendor_path, {:class=>"cmd"} %>
      <%= link_to "Download CCRs", zipccr_vendor_path, {:class=>"cmd"} %>
      <%= link_to "Download CSV", csv_vendor_path, {:class=>"cmd"} %>
      <nav class="breadcrumb">
        <%= link_to "Certification Dashboard", root_path %> &raquo;
        <span><%= @vendor.name %></span>
      </nav>
    </section>
    <section class="candidate">
      
      <dl class="vendor">
        <dt>Candidate EHR:</dt> <dd><%= @vendor.name %></dd>
        <dt>url:</dt> <dd><a href="<%= @vendor['url'] %>"><%= @vendor['url'] %></a></dd>
      </dl>
      
      <dl>
        <dt>EHR POC:</dt> <dd><%= @vendor.poc %></dd>
        <dt>E-mail:</dt>  <dd><%= @vendor.email %></dd>
        <dt>Phone:</dt>   <dd><%= @vendor.tel %></dd>
      </dl>
      <dl>
        <dt>Proctor:</dt> <dd><%= @vendor.proctor %></dd>
        <dt>E-mail:</dt>  <dd><%= @vendor.proctor_email %></dd>
        <dt>Phone:</dt>   <dd><%= @vendor.proctor_tel %></dd>
      </dl>
    </section>

    <section class="records">
        <label>Notes</label>:
        <% note = Note.new %>
        <%= simple_form_for note, :url => add_note_vendor_path do |f| %>
          <%= f.input_field :text, :as => :text, :rows => 1, :columns => 80 %>
          <%= f.button :submit, :value => 'add' %>
        <% end %>
        <% if @vendor.notes %>
          <% @vendor.notes.each do |note| %>
            <time datetime="<%= note.time.strftime('%Y-%m-%d') %>"><%= note.time.strftime('%m/%d/%Y') %></time>: 
            <%= note.text %><!-- <a href="#">edit</a> -->
            <%= button_to 'delete', {:action=>'delete_note', :id=>@vendor.id, "note[id]"=>note.id}, :method=>:delete, :confirm=>'Are you sure?' %>
            <br/>
          <% end %>
        <% end %>
        
        <% if @vendor.reported_results %>
          <a href="<%= vendor_url(@vendor.id.to_s) %>.pdf" class="ccr_export">Export PDF</a>
        <% end %>
    </section>
   
    <section id="quality_measures">
      <table>
        <% if @vendor.failing_measures.size > 0 %>
{'fraction_non_alphanumeric': 0.22580645161290322, 'fraction_numerical': 0.002150537634408602, 'mean_word_length': 2.3041740674955595, 'pattern_counts': {'":': 0, '<': 227, '<?xml version=': 0, '>': 265, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1661676', 'n_tokens_mistral': 2673, 'n_tokens_neox': 2453, 'n_words': 463}