anchor.diff:  					ServiceRating when is_list(ServiceRating) ->
   						UpdatedMap = maps:update("serviceRating", ServiceRating, NrfMap),
   						NrfResponse = nrf(UpdatedMap),
  -						{NrfResponse, diameter_request(RatingDataRef, 1, NrfMap),
  -								diameter_reply(RatingDataRef, 1, UpdatedMap)};
  +						{NrfResponse, diameter_request(RatingDataRef, interim, NrfMap),
  +								diameter_reply(RatingDataRef, interim, UpdatedMap)};
   					{error, out_of_credit} ->
  -						Problem = error_response(out_of_credit, undefined),
  -						{error, 403, Problem};
  +						Problem = rest_error_response(out_of_credit, undefined),
  +						{error, 403, Problem,
  +								diameter_error_response(out_of_credit, RatingDataRef, interim, NrfMap)};
   					{error, service_not_found} ->
   						InvalidParams = [#{param => "/subscriptionId",
   								reason => "Unknown subscriber identifier"}],
  -						Problem = error_response(service_not_found, InvalidParams),
  -						{error, 404, Problem};
  +						Problem = rest_error_response(service_not_found, InvalidParams),
  +						{error, 404, Problem,
  +								diameter_error_response(service_not_found, RatingDataRef, interim, NrfMap)};
   					{error, invalid_service_type} ->
   						InvalidParams = [#{param => "/serviceContextId",
   								reason => "Invalid Service Type"}],
  -						Problem = error_response(invalid_service_type, InvalidParams),
  -						{error, 400, Problem};
  +						Problem = rest_error_response(invalid_service_type, InvalidParams),
  +						{error, 400, Problem,
  +								diameter_error_response(invalid_service_type, RatingDataRef, interim, NrfMap)};
   					{error, Reason} ->
  -						{error, Reason}
  +						{error, Reason,
  +								diameter_error_response(charging_failed, RatingDataRef, interim, NrfMap)}
   				end;
   			_ ->
  -				Problem = error_response(charging_failed, undefined),
  +				error_logger:warning_report(["Unable to process DIAMETER Nrf request",
  +						{RatingDataRef, ratingDataRef}, {request, NrfRequest}, {flag, interim},
  +						{error, decode_failed}]),
  +				Problem = rest_error_response(charging_failed, undefined),
   				{error, 400, Problem}
   		end
   	of
  
positive.code: 			ok = ocs_log:acct_log(diameter, server(),
  					start, LogRequest, LogResponse, undefined),
  			{ok, Headers, ReponseBody};
  		{error, StatusCode, Problem1} ->
  			{error, StatusCode, Problem1};
  		{error, Reason1} ->
  			error_logger:warning_report(["Unable to process DIAMETER Nrf request",
  					{RatingDataRef, ratingDataRef}, {request, NrfRequest},
  					{error, Reason1}]),
  			{error, 500}
  	catch
  		?CATCH_STACK ->
  			?SET_STACK,
  			error_logger:warning_report(["Unable to process DIAMETER Nrf request",
  					{RatingDataRef, ratingDataRef}, {request, NrfRequest},
  					{error, Reason1}, {stack, StackTrace}]),
  			{error, 500}
  	end.
  
negative.code: 			'Origin-Host' = list_to_binary(ohost(DiamterConfig)),
  			'Origin-Realm' = list_to_binary(orealm(DiamterConfig)),
  			'Auth-Application-Id' = ?RO_APPLICATION_ID,
  			'CC-Request-Type' = event_type(RequestType),
  			'CC-Request-Number' = RequestNum,
  			'Multiple-Services-Credit-Control' = mscc(ServiceRating),
  			'Result-Code' = result_code(ServiceRating)}.
  
  -spec diameter_error(RatingDataRef, RequestType, ResultCode,
  		NrfReply) -> DiameterReply
  	when
  		RatingDataRef :: string(),
  		RequestType :: initial | interim | final | event,
  		ResultCode :: pos_integer(),
  		NrfReply :: map(),
  		DiameterReply :: #'3gpp_ro_CCA'{}.
  %% @doc Build a CCA DIAMETER CCA indicating an operation failure.
  %% @hidden
  diameter_error(RatingDataRef, RequestType, ResultCode,
  		#{"invocationSequenceNumber" := RequestNum}) ->
  	{ok, DiamterConfig} = application:get_env(ocs, diameter),
  	#'3gpp_ro_CCA'{'Session-Id' = RatingDataRef, 'Result-Code' = ResultCode,
  			'Origin-Host' = list_to_binary(ohost(DiamterConfig)),
  			'Origin-Realm' = list_to_binary(orealm(DiamterConfig)),
  			'Auth-Application-Id' = ?RO_APPLICATION_ID,
  			'CC-Request-Type' = event_type(RequestType),
  			'CC-Request-Number' = RequestNum}.
  
  %% @hidden
  result_code("SUCCESS") ->
  