anchor.diff:  	ServiceType = service_type(list_to_binary(SCI)),
   	TS = calendar:universal_time(),
   	case ocs_rating:rate(diameter, ServiceType, ServiceId, ChargingKey,
  -			MCCMNC, Subscriber, TS, undefined, undefined, Flag,
  +			MCCMNC, get_subscriber(SubscriptionIds), TS, undefined, undefined, Flag,
   			Debits, Reserves, [{"invocationSequenceNumber", ISN}]) of
   		{ok, _, {Type, Amount} = _GrantedAmount} when Amount > 0 ->
   			RatedMap = Map4#{"resultCode" => "SUCCESS", "grantedUnit" => #{type(Type) => Amount},
   					"serviceContextId"=> SCI},
  -			rate(T, ISN, Subscriber, Flag, [RatedMap | Acc]);
  +			rate(T, ISN, SubscriptionIds, Flag, [RatedMap | Acc]);
   		{ok, _, {_, 0} = _GrantedAmount} ->
   			RatedMap = Map4#{"resultCode" => "SUCCESS", "serviceContextId" => SCI},
  -			rate(T, ISN, Subscriber, Flag, [RatedMap | Acc]);
  +			rate(T, ISN, SubscriptionIds, Flag, [RatedMap | Acc]);
   		{ok, _, {Type, Amount}, _} ->
   			RatedMap = Map4#{"resultCode" => "SUCCESS", "grantedUnit" => #{type(Type) => Amount},
   					"serviceContextId"=> SCI},
  -			rate(T, ISN, Subscriber, Flag, [RatedMap | Acc]);
  +			rate(T, ISN, SubscriptionIds, Flag, [RatedMap | Acc]);
   		{ok, _, _} ->
   			RatedMap = Map4#{"resultCode" => "SUCCESS", "serviceContextId" => SCI},
  -			rate(T, ISN, Subscriber, Flag, [RatedMap | Acc]);
  +			rate(T, ISN, SubscriptionIds, Flag, [RatedMap | Acc]);
   		{out_of_credit, _, _} ->
   			RatedMap = Map4#{"resultCode" => "QUOTA_LIMIT_REACHED",
   					"serviceContextId" => SCI},
  -			rate(T, ISN, Subscriber, Flag, [RatedMap | Acc]);
  +			rate(T, ISN, SubscriptionIds, Flag, [RatedMap | Acc]);
   		{error, Reason} ->
   			{error, Reason}
   	end;
  -rate([], _ISN, _Subscriber, _Flag, []) ->
  -	[];
   rate([], _ISN, _Subscriber, _Flag, Acc) ->
   	F = fun F([#{"resultCode" := "SUCCESS"} | _T]) ->
   			Acc;
  
positive.code: 		Reason :: term().
  %% @doc Add a rating data ref to the rating ref table.
  add_rating_ref(RatingDataRef, #{"nodeFunctionality" := NF,
  		"imsi" := IMSI, "msisdn" := MSISDN} = _NrfMap) ->
  	F = fun() ->
  			NewRef = #nrf_ref{rating_ref = RatingDataRef,
  					 nodeFunctionality = NF, imsi = IMSI, msisdn = MSISDN},
  			mnesia:write(nrf_ref, NewRef, write)
  	end,
  	case mnesia:transaction(F) of
  
negative.code: 		Reason :: term().
  %% @doc Rate Nrf Service Ratings.
  rate(#{"serviceRating" := ServiceRating, "invocationSequenceNumber" := ISN,
  		"subscriptionId" := SubscriptionIds}, Flag) ->
  	rate(ServiceRating, ISN, SubscriptionIds, Flag, []).
  %% @hidden
  rate([#{"serviceContextId" := SCI} = H | T],
  		ISN, SubscriptionIds, Flag, Acc) ->
  	{Map1, ServiceId} = case maps:find("serviceId", H) of
  		{ok, SI} ->
  			{#{"serviceId" => SI}, SI};
  