def obtain_occurrence_identifier(stripped_id, stripped_lvn, stripped_sdc, is_variable)
      if is_variable || (stripped_sdc.include? 'qdm_var')
        occurrence_lvn_regex = 'occ[A-Z]of_qdm_var'
        occurrence_id_regex = 'occ[A-Z]of_qdm_var'
        occ_index = 3
        return handle_occurrence_var(stripped_id, stripped_lvn, stripped_sdc, occurrence_id_regex, occurrence_lvn_regex, occ_index)
      else
        occurrence_lvn_regex = 'Occurrence[A-Z]of'
        occurrence_id_regex = 'Occurrence[A-Z]_'
        occ_index = 10

        occurrence_identifier = handle_occurrence_var(
          stripped_id, stripped_lvn, stripped_sdc,
          "#{occurrence_id_regex}#{stripped_sdc}", "#{occurrence_lvn_regex}#{stripped_sdc}",
          occ_index)
        return occurrence_identifier if occurrence_identifier.present?

        stripped_sdc[occ_index] if stripped_sdc.match(
          /(^#{occurrence_id_regex}| ^#{occurrence_id_regex}qdm_var_| ^#{occurrence_lvn_regex})| ^#{occurrence_lvn_regex}qdm_var_/)
      end
    end
def obtain_occurrence_identifier(stripped_id, stripped_lvn, stripped_sdc, is_variable)
      if is_variable || (stripped_sdc.include? 'qdm_var')
        occurrence_lvn_regex = 'occ[A-Z]of_qdm_var'
        occurrence_id_regex = 'occ[A-Z]of_qdm_var'
        occ_index = 3
        return handle_occurrence_var(stripped_id, stripped_lvn, stripped_sdc, occurrence_id_regex, occurrence_lvn_regex, occ_index)
      else
        occurrence_lvn_regex = 'Occurrence[A-Z]of'
        occurrence_id_regex = 'Occurrence[A-Z]_'
        occ_index = 10

        occurrence_identifier = handle_occurrence_var(
          stripped_id, stripped_lvn, stripped_sdc,
          "#{occurrence_id_regex}#{stripped_sdc}", "#{occurrence_lvn_regex}#{stripped_sdc}",
          occ_index)
        return occurrence_identifier if occurrence_identifier.present?

        stripped_sdc[occ_index] if stripped_sdc.match(
          /(^#{occurrence_id_regex}| ^#{occurrence_id_regex}qdm_var_| ^#{occurrence_lvn_regex})| ^#{occurrence_lvn_regex}qdm_var_/)
      end
    end
Using the id, source data criteria id, and local variable name (and whether or not it's a variable),
  extract the occurrence identifiter (if one exists).