parameters: (self, file)
docstring: Send DICOM file to the specified modality. If the transfer fails due to
          an unsupported presentation context, attempt the transfer a second time using
          a custom configuration that provides.
docstring_summary: Send DICOM file to the specified modality. If the transfer fails due to
          an unsupported presentation context, attempt the transfer a second time using
          a custom configuration that provides.
docstring_tokens: Send DICOM file to the specified modality . If the transfer fails due to an unsupported presentation context attempt the transfer a second time using a custom configuration that provides .
function: def start(self, file):
      """ Send DICOM file to the specified modality. If the transfer fails due to
          an unsupported presentation context, attempt the transfer a second time using
          a custom configuration that provides.
      """
  
      if self.dicomSend(file):
        # success
        return True
  
      stdout = self.process.readAllStandardOutput()
      stderr = self.process.readAllStandardError()
      logging.debug('DICOM send using standard configuration failed: process error code is %d' % self.process.error())
      logging.debug('DICOM send process standard out is: %s' % stdout)
      logging.debug('DICOM send process standard error is: %s' % stderr)
  
      # Retry transfer with alternative configuration with presentation contexts which support SEG/SR.
      # A common cause of failure is an incomplete set of dcmtk/DCMSCU presentation context UIDS.
      # Refer to https://book.orthanc-server.com/faq/dcmtk-tricks.html#id2 for additional detail.
      logging.info('Retry transfer with alternative dicomscu configuration: %s' % self.extended_dicom_config_path)
  
      # Terminate transfer and notify user of failure
      if self.dicomSend(file, config=os.path.join(RESOURCE_ROOT, self.extended_dicom_config_path)):
        # success
        return True
  
      stdout = self.process.readAllStandardOutput()
      stderr = self.process.readAllStandardError()
      logging.debug('DICOM send using extended configuration failed: process error code is %d' % self.process.error())
      logging.debug('DICOM send process standard out is: %s' % stdout)
      logging.debug('DICOM send process standard error is: %s' % stderr)
  
      userMsg = f"Could not send {file} to {self.destinationUrl.host()}:{self.destinationUrl.port()}"
      raise UserWarning(userMsg)
function_tokens: def start ( self , file ) : if self . dicomSend ( file ) : # success return True stdout = self . process . readAllStandardOutput ( ) stderr = self . process . readAllStandardError ( ) logging . debug ( 'DICOM send using standard configuration failed: process error code is %d' % self . process . error ( ) ) logging . debug ( 'DICOM send process standard out is: %s' % stdout ) logging . debug ( 'DICOM send process standard error is: %s' % stderr ) # Retry transfer with alternative configuration with presentation contexts which support SEG/SR. # A common cause of failure is an incomplete set of dcmtk/DCMSCU presentation context UIDS. # Refer to https://book.orthanc-server.com/faq/dcmtk-tricks.html#id2 for additional detail. logging . info ( 'Retry transfer with alternative dicomscu configuration: %s' % self . extended_dicom_config_path ) # Terminate transfer and notify user of failure if self . dicomSend ( file , config = os . path . join ( RESOURCE_ROOT , self . extended_dicom_config_path ) ) : # success return True stdout = self . process . readAllStandardOutput ( ) stderr = self . process . readAllStandardError ( ) logging . debug ( 'DICOM send using extended configuration failed: process error code is %d' % self . process . error ( ) ) logging . debug ( 'DICOM send process standard out is: %s' % stdout ) logging . debug ( 'DICOM send process standard error is: %s' % stderr ) userMsg = f"Could not send {file} to {self.destinationUrl.host()}:{self.destinationUrl.port()}" raise UserWarning ( userMsg )