<commit_before><entry>
  <act classCode="ACT" moodCode="EVN" <%== negation_indicator(entry) %>>
    <!-- Discharge Medication Entry -->
    <templateId root="2.16.840.1.113883.10.20.24.3.105" extension="2014-12-01"/>
    <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
    <code code="10183-2"
          codeSystem="2.16.840.1.113883.6.1" 
          codeSystemName="LOINC" 
          displayName="Discharge medication"/> 
    <statusCode code="active"/>
    <effectiveTime>
      <low <%= value_or_null_flavor(entry.start_time) %>/>
    </effectiveTime>
    <entryRelationship typeCode="SUBJ">
      <substanceAdministration moodCode="EVN" classCode="SBADM"
        <!-- Medication Activity (consolidation) template -->
        <templateId root="2.16.840.1.113883.10.20.22.4.16" extension="2014-06-09"/> 
        <!-- Medication, Active template -->
        <templateId root="2.16.840.1.113883.10.20.24.3.41" extension="2014-12-01"/>
        
        <id root="<%= UUID.generate %>"/>
        <text><%= entry.description %></text>
        <statusCode code="active"/> 
        <effectiveTime xsi:type="IVL_TS">
            <low <%= value_or_null_flavor(entry.start_time) %>/>
            <high <%= value_or_null_flavor(entry.end_time) %>/>
        </effectiveTime>
        <% if entry.administrationTiming.present?
          period = entry.administrationTiming['period'] %>
          <effectiveTime xsi:type="PIVL_TS" institutionSpecified="true" operator="A">
            <period value="<%= period['value']%>" unit="<%= period['unit']%>"/>
          </effectiveTime>
        <% end %>
        <% if entry.route.present? -%>
        <!-- Attribute: route -->
          <% vset = oid_for_code(entry.route.code,field_oids["ROUTE"], entry.record["bundle_id"]) %>
          <% if vset %>
            <routeCode code="<%= entry.route['code'] %>" codeSystem="<%= HealthDataStandards::Util::CodeSystemHelper.oid_for_code_system(entry.route['code_system']) %>" sdtc:valueSet="<%= vset %>"/>
          <% end %>
        <% end -%>
        
        <!-- Attribute: dose -->
        <% if entry.dose.present? -%>
          <doseQuantity value="<%= entry.dose['value']%>"/>
        <% end -%>

        <% if entry.product_form.present? -%>
        <administrationUnitCode code="<%= entry.product_form['code'] %>" codeSystem="<%= entry.product_form['codeSystem'] %>"/>
        <% end -%>

        <consumable>
          <manufacturedProduct classCode="MANU">
            <!-- Medication Information (consolidation) template --> 
            <templateId root="2.16.840.1.113883.10.20.22.4.23" extension="2014-06-09"/>
            <id root="<%= UUID.generate %>"/>
            <manufacturedMaterial>
              <%== code_display(entry,'preferred_code_sets' => ['RxNorm'],'value_set_map' => filtered_vs_map, 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
            </manufacturedMaterial>
            <manufacturerOrganization>
              <name>Medication Factory Inc.</name>
            </manufacturerOrganization>
          </manufacturedProduct>
        </consumable>
      </substanceAdministration>
    </entryRelationship>
    <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"]}) %>
  </act>
</entry>
<commit_msg>element missing end bracket<commit_after><entry>
  <act classCode="ACT" moodCode="EVN" <%== negation_indicator(entry) %>>
    <!-- Discharge Medication Entry -->
    <templateId root="2.16.840.1.113883.10.20.24.3.105" extension="2014-12-01"/>
    <id root="1.3.6.1.4.1.115" extension="<%= entry.id %>"/>
    <code code="10183-2"
          codeSystem="2.16.840.1.113883.6.1" 
          codeSystemName="LOINC" 
          displayName="Discharge medication"/> 
    <statusCode code="active"/>
    <effectiveTime>
      <low <%= value_or_null_flavor(entry.start_time) %>/>
    </effectiveTime>
    <entryRelationship typeCode="SUBJ">
      <substanceAdministration moodCode="EVN" classCode="SBADM">
        <!-- Medication Activity (consolidation) template -->
        <templateId root="2.16.840.1.113883.10.20.22.4.16" extension="2014-06-09"/> 
        <!-- Medication, Active template -->
        <templateId root="2.16.840.1.113883.10.20.24.3.41" extension="2014-12-01"/>
        
        <id root="<%= UUID.generate %>"/>
        <text><%= entry.description %></text>
        <statusCode code="active"/> 
        <effectiveTime xsi:type="IVL_TS">
            <low <%= value_or_null_flavor(entry.start_time) %>/>
            <high <%= value_or_null_flavor(entry.end_time) %>/>
        </effectiveTime>
        <% if entry.administrationTiming.present?
          period = entry.administrationTiming['period'] %>
          <effectiveTime xsi:type="PIVL_TS" institutionSpecified="true" operator="A">
            <period value="<%= period['value']%>" unit="<%= period['unit']%>"/>
          </effectiveTime>
        <% end %>
        <% if entry.route.present? -%>
        <!-- Attribute: route -->
          <% vset = oid_for_code(entry.route.code,field_oids["ROUTE"], entry.record["bundle_id"]) %>
          <% if vset %>
            <routeCode code="<%= entry.route['code'] %>" codeSystem="<%= HealthDataStandards::Util::CodeSystemHelper.oid_for_code_system(entry.route['code_system']) %>" sdtc:valueSet="<%= vset %>"/>
          <% end %>
        <% end -%>
        
        <!-- Attribute: dose -->
        <% if entry.dose.present? -%>
          <doseQuantity value="<%= entry.dose['value']%>"/>
        <% end -%>

        <% if entry.product_form.present? -%>
        <administrationUnitCode code="<%= entry.product_form['code'] %>" codeSystem="<%= entry.product_form['codeSystem'] %>"/>
        <% end -%>

        <consumable>
          <manufacturedProduct classCode="MANU">
            <!-- Medication Information (consolidation) template --> 
            <templateId root="2.16.840.1.113883.10.20.22.4.23" extension="2014-06-09"/>
            <id root="<%= UUID.generate %>"/>
            <manufacturedMaterial>
              <%== code_display(entry,'preferred_code_sets' => ['RxNorm'],'value_set_map' => filtered_vs_map, 'extra_content' => "sdtc:valueSet=\"#{value_set_oid}\"") %>
            </manufacturedMaterial>
            <manufacturerOrganization>
              <name>Medication Factory Inc.</name>
            </manufacturerOrganization>
          </manufacturedProduct>
        </consumable>
      </substanceAdministration>
    </entryRelationship>
    <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"]}) %>
  </act>
</entry>

{'fraction_non_alphanumeric': 0.19007761375741897, 'fraction_numerical': 0.04595951909907168, 'mean_word_length': 2.6551724137931036, 'pattern_counts': {'":': 0, '<': 159, '<?xml version=': 0, '>': 172, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 10, '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': '7148992', 'n_tokens_mistral': 2339, 'n_tokens_neox': 2055, 'n_words': 295}