pacsretrieve/pacsretrieve.py
def summaryReport_process(self, *args, **kwargs):
        """
        Generate a summary report based on CLI specs
        """

        l_dataStudy                 = []
        l_dataSeries                = []
        # self.str_seriesSummaryKeys  = ''
        # self.str_studySummaryKeys   = ''
        for k,v in kwargs.items():
            # if k == 'seriesSummaryKeys':    self.str_seriesSummaryKeys  = v
            # if k == 'seriesSummaryFile':    self.str_seriesSummaryFile  = v
            # if k == 'studySummaryKeys':     self.str_studySummaryKeys   = v
            # if k == 'studySummaryFile':     self.str_studySummaryFile   = v
            if k == 'dataStudy':            l_dataStudy                 = v
            if k == 'dataSeries':           l_dataSeries                = v
        
        pudb.set_trace()
        for report in ['series', 'study']:
            str_report      = ''
            if report == 'series':  
                l_data              = l_dataSeries
                l_summaryKeys       = self.str_seriesSummaryKeys.split(',')
                str_summaryFile     = self.str_seriesSummaryFile
            if report == 'study':   
                l_data              = l_dataStudy
                l_summaryKeys       = self.str_studySummaryKeys.split(',')
                str_summaryFile     = self.str_studySummaryFile

            if len(l_data):
                # Header
                for key in l_summaryKeys:
                    str_report  = str_report + "%-60s\t" % key

                # Body
                for entry in l_data:
                    str_report  = str_report + "\n"
                    for key in l_summaryKeys:
                        try:
                            str_value   = entry[key]['value']
                        except:
                            str_value   = self.entry_reprocessForKey(
                                                entry   = entry, 
                                                key     = key
                                                )
                        str_report  = str_report + "%-60s\t" % (str_value)

            if len(str_summaryFile):
                str_FQsummaryFile   = os.path.join(self.str_outputDir, str_summaryFile) 
                self.dp.qprint('Saving %s summary to %s' % (report, str_FQsummaryFile) )
                f = open(str_FQsummaryFile, 'w')
                f.write(str_report)
                f.close()

        Generate a summary report based on CLI specs
        
Generate a summary report based on CLI specs
Generate a summary report based on CLI specs
def summaryReport_process(self, *args, **kwargs):
        l_dataStudy                 = []
        l_dataSeries                = []
        for k,v in kwargs.items():
            if k == 'dataStudy':            l_dataStudy                 = v
            if k == 'dataSeries':           l_dataSeries                = v
        pudb.set_trace()
        for report in ['series', 'study']:
            str_report      = ''
            if report == 'series':  
                l_data              = l_dataSeries
                l_summaryKeys       = self.str_seriesSummaryKeys.split(',')
                str_summaryFile     = self.str_seriesSummaryFile
            if report == 'study':   
                l_data              = l_dataStudy
                l_summaryKeys       = self.str_studySummaryKeys.split(',')
                str_summaryFile     = self.str_studySummaryFile
            if len(l_data):
                for key in l_summaryKeys:
                    str_report  = str_report + "%-60s\t" % key
                for entry in l_data:
                    str_report  = str_report + "\n"
                    for key in l_summaryKeys:
                        try:
                            str_value   = entry[key]['value']
                        except:
                            str_value   = self.entry_reprocessForKey(
                                                entry   = entry, 
                                                key     = key
                                                )
                        str_report  = str_report + "%-60s\t" % (str_value)
            if len(str_summaryFile):
                str_FQsummaryFile   = os.path.join(self.str_outputDir, str_summaryFile) 
                self.dp.qprint('Saving %s summary to %s' % (report, str_FQsummaryFile) )
                f = open(str_FQsummaryFile, 'w')
                f.write(str_report)
                f.close()
def summaryReport_process ( self , * args , ** kwargs ) : l_dataStudy = [ ] l_dataSeries = [ ] for k , v in kwargs . items ( ) : if k == 'dataStudy' : l_dataStudy = v if k == 'dataSeries' : l_dataSeries = v pudb . set_trace ( ) for report in [ 'series' , 'study' ] : str_report = '' if report == 'series' : l_data = l_dataSeries l_summaryKeys = self . str_seriesSummaryKeys . split ( ',' ) str_summaryFile = self . str_seriesSummaryFile if report == 'study' : l_data = l_dataStudy l_summaryKeys = self . str_studySummaryKeys . split ( ',' ) str_summaryFile = self . str_studySummaryFile if len ( l_data ) : for key in l_summaryKeys : str_report = str_report + "%-60s\t" % key for entry in l_data : str_report = str_report + "\n" for key in l_summaryKeys : try : str_value = entry [ key ] [ 'value' ] except : str_value = self . entry_reprocessForKey ( entry = entry , key = key ) str_report = str_report + "%-60s\t" % ( str_value ) if len ( str_summaryFile ) : str_FQsummaryFile = os . path . join ( self . str_outputDir , str_summaryFile ) self . dp . qprint ( 'Saving %s summary to %s' % ( report , str_FQsummaryFile ) ) f = open ( str_FQsummaryFile , 'w' ) f . write ( str_report ) f . close ( )
Generate a summary report based on CLI specs
Generate a summary report based on CLI specs
"""
        Generate a summary report based on CLI specs
        """ # self.str_seriesSummaryKeys  = '' # self.str_studySummaryKeys   = '' # if k == 'seriesSummaryKeys':    self.str_seriesSummaryKeys  = v # if k == 'seriesSummaryFile':    self.str_seriesSummaryFile  = v # if k == 'studySummaryKeys':     self.str_studySummaryKeys   = v # if k == 'studySummaryFile':     self.str_studySummaryFile   = v # Header # Body
self