lib/roqua/healthy/a19/transformer.rb in roqua-healthy-1.5.4 vs lib/roqua/healthy/a19/transformer.rb in roqua-healthy-1.5.5

- old
+ new

@@ -1,10 +1,12 @@ # frozen_string_literal: true + require 'roqua/healthy/a19/name_parser' require 'roqua/healthy/a19/cdis_name_parser' require 'roqua/healthy/a19/impulse_name_parser' require 'roqua/healthy/a19/address_parser' +require 'roqua/healthy/a19/phone_validator' require 'active_support/core_ext/hash' module Roqua module Healthy module A19 @@ -121,14 +123,14 @@ # we only strip characters that we can be sure to not matter # letters are not stripped since they may be part of a comment, which usually means the # phone number is not useable for the purpose of a client's cell phone number def strip_non_phone_number_characters(number) - number.gsub(/[-\s\.]/, '') + Roqua::Healthy::A19::PhoneValidator.strip_non_phone_number_characters number end def phone_cell_number?(number) - strip_non_phone_number_characters(number) =~ /\A(\+31|0|0031)6\d{8}\z/ + Roqua::Healthy::A19::PhoneValidator.phone_cell_number? number end def name case source when "UMCG"