def remove_population_preconditions(doc)
      # population sections
      pop_ids = doc.xpath("//cda:populationCriteriaSection/cda:component[@typeCode='COMP']/*/cda:id",
                          HQMF2::Document::NAMESPACES)
      # find the population entries and get their ids
      pop_ids.each do |p_id|
        doc.xpath("//cda:precondition[./cda:criteriaReference/cda:id[@extension='#{p_id['extension']}' and @root='#{p_id['root']}']]",
                  HQMF2::Document::NAMESPACES).remove
      end
    end
def remove_population_preconditions(doc)
      # population sections
      pop_ids = doc.xpath("//cda:populationCriteriaSection/cda:component[@typeCode='COMP']/*/cda:id",
                          HQMF2::Document::NAMESPACES)
      # find the population entries and get their ids
      pop_ids.each do |p_id|
        doc.xpath("//cda:precondition[./cda:criteriaReference/cda:id[@extension='#{p_id['extension']}' and @root='#{p_id['root']}']]",
                  HQMF2::Document::NAMESPACES).remove
      end
    end
If a precondition references a population, remove it