<component>
  <!--Social History - CCDA-->
  <section>
    <templateId root="2.16.840.1.113883.10.20.22.2.17"/>
    <!-- Social history section template -->
    <code code="29762-2" codeSystem="2.16.840.1.113883.6.1"/>
    <title>Social History</title>
    <%== render :partial => 'narrative_block', :locals => {:entries => entries, :section => 'social_history'} %>
    <% entries.each_with_index do |entry, i| -%>
    <entry typeCode="DRIV">
      <observation classCode="OBS" moodCode="EVN">
        <templateId root="2.16.840.1.113883.10.20.22.4.38"/>
        <!-- Social history observation template -->
        <id root="<%= UUID.generate %>"/>
        <%== code_display(entry, {:preferred_code_sets => ['SNOMED-CT']}) %>
        <statusCode code="completed"/>
        <effectiveTime <%= value_or_null_flavor(entry.as_point_in_time) %>/>
      </observation>l
    </entry>
    <% end -%>
  </section>
</component>
<component>
  <!--Social History - CCDA-->
  <section>
    <templateId root="2.16.840.1.113883.10.20.22.2.17"/>
    <!-- Social history section template -->
    <code code="29762-2" codeSystem="2.16.840.1.113883.6.1"/>
    <title>Social History</title>
    <%== render :partial => 'narrative_block', :locals => {:entries => entries, :section => 'social_history'} %>
    <% entries.each_with_index do |entry, i| -%>
    <entry typeCode="DRIV">
      <observation classCode="OBS" moodCode="EVN">
        <templateId root="2.16.840.1.113883.10.20.22.4.38"/>
        <!-- Social history observation template -->
        <id root="<%= UUID.generate %>"/>
        <%== code_display(entry, {:preferred_code_sets => ['SNOMED-CT']}) %>
        <statusCode code="completed"/>
        <effectiveTime <%= value_or_null_flavor(entry.as_point_in_time) %>/>
      </observation>
    </entry>
    <% end -%>
  </section>
</component>

Remove stray "l" after closing observation tag
Remove stray "l" after closing observation tag
