<commit_before>// rerack approx gestation
$('#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 entire changelog
$('#change_log').html(
  '<%= escape_javascript(render partial: "patients/change_log", locals: { patient: @patient })%>'
);

// if pledge is sent, re-rack fulfillment info
<% if @patient.previous_changes.key?('pledge_sent') && current_user.allowed_data_access? %>
  // populate the fulfillment form if it's supposed to be there
  <% if @patient.pledge_sent? %>
    $('#fulfillment').html(
      '<%= escape_javascript(render partial: "patients/fulfillment", locals: { patient: @patient })%>'
    );
  <% end %>

  // properly set the button and make fulfillment show up, if it should
  $('#menu').html(
    '<%= escape_javascript(render partial: "patients/menu", locals: { patient: @patient })%>'
  );
<% elsif !@patient.pledge_sent %>
  // clear out fulfillment form
  $('#fulfillment').empty();
<% end %><commit_msg>pledge fulfillment now populating on submit pledge<commit_after>// rerack approx gestation
$('#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 entire changelog
$('#change_log').html(
  '<%= escape_javascript(render partial: "patients/change_log", locals: { patient: @patient })%>'
);

// if pledge is sent, re-rack fulfillment info
<% if @patient.previous_changes.key?('pledge_sent') && current_user.allowed_data_access? %>
  // populate the fulfillment form if it's supposed to be there
  <% if @patient.pledge_sent? %>
  $('#fulfillment').remove();
  $('#sections').append(
    '<%= escape_javascript(render partial: "patients/fulfillment", locals: { patient: @patient })%>'
  );
  <% end %>

  // properly set the button and make fulfillment show up, if it should
  $('#menu').html(
    '<%= escape_javascript(render partial: "patients/menu", locals: { patient: @patient })%>'
  );
<% elsif !@patient.pledge_sent %>
  // clear out fulfillment form
  $('#fulfillment').empty();
<% end %>
{'fraction_non_alphanumeric': 0.18291761148904007, 'fraction_numerical': 0.0, 'mean_word_length': 4.921700223713646, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '5809118', 'n_tokens_mistral': 891, 'n_tokens_neox': 834, 'n_words': 189}