def process_presentation_context_response(presentation_contexts)
      # Storing approved syntaxes in an Hash with the syntax as key and the value being an array with presentation context ID and the transfer syntax chosen by the SCP.
      @approved_syntaxes = Hash.new
      rejected = Hash.new
      # Reset the presentation context instance variable:
      @link.presentation_contexts = Hash.new
      accepted_pc = 0
      presentation_contexts.each do |pc|
        # Determine what abstract syntax this particular presentation context's id corresponds to:
        id = pc[:presentation_context_id]
        raise "Error! Even presentation context ID received in the association response. This is not allowed according to the DICOM standard!" if id.even?
        abstract_syntax = find_abstract_syntax(id)
        if pc[:result] == 0
          accepted_pc += 1
          @approved_syntaxes[abstract_syntax] = [id, pc[:transfer_syntax]]
          @link.presentation_contexts[id] = pc[:transfer_syntax]
        else
          rejected[abstract_syntax] = [id, pc[:transfer_syntax]]
        end
      end
      if rejected.length == 0
        @request_approved = true
        if @approved_syntaxes.length == 1 and presentation_contexts.length == 1
          logger.info("The presentation context was accepted by host #{@host_ae}.")
        else
          logger.info("All #{presentation_contexts.length} presentation contexts were accepted by host #{@host_ae} (#{@host_ip}).")
        end
      else
        # We still consider the request 'approved' if at least one context were accepted:
        @request_approved = true if @approved_syntaxes.length > 0
        logger.error("One or more of your presentation contexts were denied by host #{@host_ae}!")
        @approved_syntaxes.each_pair do |key, value|
          sntx_k = (LIBRARY.uid(key) ? LIBRARY.uid(key).name : 'Unknown UID!')
          sntx_v = (LIBRARY.uid(value[1]) ? LIBRARY.uid(value[1]).name : 'Unknown UID!')
          logger.info("APPROVED: #{sntx_k} (#{sntx_v})")
        end
        rejected.each_pair do |key, value|
          sntx_k = (LIBRARY.uid(key) ? LIBRARY.uid(key).name : 'Unknown UID!')
          sntx_v = (LIBRARY.uid(value[1]) ? LIBRARY.uid(value[1]).name : 'Unknown UID!')
          logger.error("REJECTED: #{sntx_k} (#{sntx_v})")
        end
      end
    end
def process_presentation_context_response(presentation_contexts)
      # Storing approved syntaxes in an Hash with the syntax as key and the value being an array with presentation context ID and the transfer syntax chosen by the SCP.
      @approved_syntaxes = Hash.new
      rejected = Hash.new
      # Reset the presentation context instance variable:
      @link.presentation_contexts = Hash.new
      accepted_pc = 0
      presentation_contexts.each do |pc|
        # Determine what abstract syntax this particular presentation context's id corresponds to:
        id = pc[:presentation_context_id]
        raise "Error! Even presentation context ID received in the association response. This is not allowed according to the DICOM standard!" if id.even?
        abstract_syntax = find_abstract_syntax(id)
        if pc[:result] == 0
          accepted_pc += 1
          @approved_syntaxes[abstract_syntax] = [id, pc[:transfer_syntax]]
          @link.presentation_contexts[id] = pc[:transfer_syntax]
        else
          rejected[abstract_syntax] = [id, pc[:transfer_syntax]]
        end
      end
      if rejected.length == 0
        @request_approved = true
        if @approved_syntaxes.length == 1 and presentation_contexts.length == 1
          logger.info("The presentation context was accepted by host #{@host_ae}.")
        else
          logger.info("All #{presentation_contexts.length} presentation contexts were accepted by host #{@host_ae} (#{@host_ip}).")
        end
      else
        # We still consider the request 'approved' if at least one context were accepted:
        @request_approved = true if @approved_syntaxes.length > 0
        logger.error("One or more of your presentation contexts were denied by host #{@host_ae}!")
        @approved_syntaxes.each_pair do |key, value|
          sntx_k = (LIBRARY.uid(key) ? LIBRARY.uid(key).name : 'Unknown UID!')
          sntx_v = (LIBRARY.uid(value[1]) ? LIBRARY.uid(value[1]).name : 'Unknown UID!')
          logger.info("APPROVED: #{sntx_k} (#{sntx_v})")
        end
        rejected.each_pair do |key, value|
          sntx_k = (LIBRARY.uid(key) ? LIBRARY.uid(key).name : 'Unknown UID!')
          sntx_v = (LIBRARY.uid(value[1]) ? LIBRARY.uid(value[1]).name : 'Unknown UID!')
          logger.error("REJECTED: #{sntx_k} (#{sntx_v})")
        end
      end
    end
Processes the presentation contexts that are received in the association response
 to extract the transfer syntaxes which have been accepted for the various abstract syntaxes.

 === Parameters

 * <tt>presentation_contexts</tt> -- An array where each index contains a presentation context hash.