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: 	nrf(T, Acc#{"oneTimeEventType" => EventType});
  nrf([{"invocationSequenceNumber", SeqNum} | T], Acc) ->
  	nrf(T, Acc#{"invocationSequenceNumber" => SeqNum});
  nrf([{"subscriptionId", {array, ["msisdn-" ++ MSISDN, "imsi-" ++ IMSI]}} | T], Acc) ->
  	nrf(T, Acc#{"msisdn" => MSISDN, "imsi" => IMSI});
  nrf([{"nfConsumerIdentification", {struct, [{"nodeFunctionality", NF}]}} | T], Acc) ->
  	nrf(T, Acc#{"nodeFunctionality" => NF});
  nrf([{"serviceRating", {array, ServiceRating}} | T], Acc) ->
  
negative.code: 	nrf(T, Acc);
  nrf([], Acc) ->
  	Acc.
  
  %% @hidden
  subscriptionId_map({array, Ids}, Acc) ->
  	subscriptionId_map(Ids, Acc#{"subscriptionId" => []});
  subscriptionId_map(["msisdn-" ++ MSISDN | T],
  		#{"subscriptionId" := SubscriptionIds} = Acc) ->
  	Acc1 = Acc#{"subscriptionId" =>
  			["msisdn-" ++ MSISDN | SubscriptionIds]},
  	subscriptionId_map(T, Acc1);
  subscriptionId_map(["imsi-" ++ IMSI | T],
  		#{"subscriptionId" := SubscriptionIds} = Acc) ->
  	Acc1 = Acc#{"subscriptionId" =>
  			["imsi-" ++ IMSI | SubscriptionIds]},
  	subscriptionId_map(T, Acc1);
  subscriptionId_map([_ | T], Acc) ->
  	subscriptionId_map(T, Acc);
  subscriptionId_map([], #{"subscriptionId" := SubscriptionIds} = Acc) ->
  	SubscriptionIds1 = lists:reverse(SubscriptionIds),
  	Acc#{"subscriptionId" := SubscriptionIds1}.
  
  %% @hidden
  subscriptionId_list(SubscriptionIds) ->
  	subscriptionId_list1(SubscriptionIds, []).
  %% @hidden
  subscriptionId_list1(["msisdn-" ++ MSISDN | T], Acc) ->
  	subscriptionId_list1(T, ["msisdn-" ++ MSISDN | Acc]);
  subscriptionId_list1(["imsi-" ++ IMSI | T], Acc) ->
  	subscriptionId_list1(T, ["imsi-" ++ IMSI| Acc]);
  subscriptionId_list1([_| T], Acc) ->
  	subscriptionId_list1(T, Acc);
  subscriptionId_list1([], Acc) ->
  	lists:reverse(Acc).
  
  -spec get_subscriber(SubscriptionIds) -> Subscriber
  	when
  		SubscriptionIds :: [Id],
  		Id :: string(),
  		Subscriber :: string().
  %% @hidden Get a subscriber id from list of subscribers.
  get_subscriber(["msisdn-" ++ MSISDN | _]) -> 
  	MSISDN;
  get_subscriber(["imsi-" ++ IMSI | _]) -> 
  	IMSI;
  get_subscriber([_ | T]) -> 
  	get_subscriber(T);
  get_subscriber([]) -> 
  	undefined.
  
  
  %% @hidden
  event_type(#{"oneTimeEventType" := "IEC"}) ->
  