<commit_before>// rerack LMP calculation
$('#patient_appointment_date')
  .parent()
  .find('span.help-block')
  .text('Approx gestation at appt: <%= @patient.last_menstrual_period_at_appt %>');

// rerack status
$('#patient_status').text('<%= @patient.status %>');

// rerack current LMP
$('#patient_last_menstrual_period_weeks')
  .parent()
  .find('span.help-block')
  .text('Currently: <%= @patient.last_menstrual_period_display_short %>');

// refresh changelog
$('#change_log').html(
  '<%= escape_javascript(render partial: "patients/change_log", locals: { patient: @patient })%>'
);

// Rerack urgent status
$('#patient_urgent_flag').prop('checked', <%= @patient.urgent_flag? %>);

// if pledge is sent, re-rack fulfillment info
<% if current_user.allowed_data_access? && @patient.pledge_sent? %>
  // populate the fulfillment form if it's supposed to be there and not there already
  if ($('#pledge_fulfillment-menu-item').length == 0) {
    $('#pledge_fulfillment').empty()
                            .append('<%= escape_javascript(render partial: "patients/fulfillment", locals: { patient: @patient })%>');
    $('#menu-list').append(
      '<%= escape_javascript(render "patients/menu_item", link_for: "pledge_fulfillment", active: false) %>'
    );
  }
<% else %>
  // ensure fulfillment form is cleared out
  $('#pledge_fulfillment').empty();
  $('#pledge_fulfillment-menu-item').remove();
<% end %>

// Rerack pledge button
$('#menu-pledge-button').html(
  '<%= escape_javascript(render "patients/menu_pledge_button", patient: @patient) %>'
);

// If updating the accountants view, refresh the row
if($('#row-<%= @patient.id %>')) {
  $('#row-<%= @patient.id %>').html(
    '<%= escape_javascript(render "accountants/table_content_row", patient: @patient) %>'
  );
}

// flash the result
$('#flash').html('<%= escape_javascript(render partial: "layouts/messages") %>');
$('#flash').removeClass().hide().fadeIn('slow')
<commit_msg>close the update thing after 5s<commit_after>// rerack LMP calculation
$('#patient_appointment_date')
  .parent()
  .find('span.help-block')
  .text('Approx gestation at appt: <%= @patient.last_menstrual_period_at_appt %>');

// rerack status
$('#patient_status').text('<%= @patient.status %>');

// rerack current LMP
$('#patient_last_menstrual_period_weeks')
  .parent()
  .find('span.help-block')
  .text('Currently: <%= @patient.last_menstrual_period_display_short %>');

// refresh changelog
$('#change_log').html(
  '<%= escape_javascript(render partial: "patients/change_log", locals: { patient: @patient })%>'
);

// Rerack urgent status
$('#patient_urgent_flag').prop('checked', <%= @patient.urgent_flag? %>);

// if pledge is sent, re-rack fulfillment info
<% if current_user.allowed_data_access? && @patient.pledge_sent? %>
  // populate the fulfillment form if it's supposed to be there and not there already
  if ($('#pledge_fulfillment-menu-item').length == 0) {
    $('#pledge_fulfillment').empty()
                            .append('<%= escape_javascript(render partial: "patients/fulfillment", locals: { patient: @patient })%>');
    $('#menu-list').append(
      '<%= escape_javascript(render "patients/menu_item", link_for: "pledge_fulfillment", active: false) %>'
    );
  }
<% else %>
  // ensure fulfillment form is cleared out
  $('#pledge_fulfillment').empty();
  $('#pledge_fulfillment-menu-item').remove();
<% end %>

// Rerack pledge button
$('#menu-pledge-button').html(
  '<%= escape_javascript(render "patients/menu_pledge_button", patient: @patient) %>'
);

// If updating the accountants view, refresh the row
if($('#row-<%= @patient.id %>')) {
  $('#row-<%= @patient.id %>').html(
    '<%= escape_javascript(render "accountants/table_content_row", patient: @patient) %>'
  );
}

// flash the result
$('#flash').html('<%= escape_javascript(render partial: "layouts/messages") %>');
$('#flash').removeClass().hide().fadeIn('slow');
setTimeout(function() {
  $('#flash').hide();
}, 5000);

{'fraction_non_alphanumeric': 0.20292412402319132, 'fraction_numerical': 0.0017645576002016637, 'mean_word_length': 4.887240356083086, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6252471', 'n_tokens_mistral': 1338, 'n_tokens_neox': 1271, 'n_words': 254}