Package com.pixelmed.apps

# Class DoseReporterWithLegacyOCRAndAutoSendToRegistry

java.lang.Object
com.pixelmed.apps.DoseReporterWithLegacyOCRAndAutoSendToRegistry

public class DoseReporterWithLegacyOCRAndAutoSendToRegistry extends Object

A class to wait for incoming dose screen images and SRs and send them to pre-configured registry.

The class has no public methods other than the constructor and a main method that is useful as a utility.

External (unsecure) SQL access to the database is possible if the Application.DatabaseServerName property is specified; further details are described in `com.pixelmed.database.DatabaseInformationModel`; for example:

    % java -cp lib/additional/hsqldb.jar org.hsqldb.util.DatabaseManagerSwing --url "jdbc:hsqldb:hsql://localhost/testserverdb"

For how to configure the necessary properties file, see:

See Also:
  - `NetworkApplicationProperties`
  - `DatabaseApplicationProperties`

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`protected class`
`DoseReporterWithLegacyOCRAndAutoSendToRegistry.CandidateFile`
`protected class`
`DoseReporterWithLegacyOCRAndAutoSendToRegistry.OurPatientStudySeriesInstanceModel`
`protected class`
`DoseReporterWithLegacyOCRAndAutoSendToRegistry.OurReceivedObjectHandler`
`protected class`
`DoseReporterWithLegacyOCRAndAutoSendToRegistry.ReceivedFileProcessor`
`protected class`
`DoseReporterWithLegacyOCRAndAutoSendToRegistry.WatchDatabaseAndSendToRegistry`
`protected class`
`DoseReporterWithLegacyOCRAndAutoSendToRegistry.WatchRemoteAEsForNewDoseInformation`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected String`
`buildDate`
`protected DatabaseInformationModel`
`databaseInformationModel`
`protected static int`
`daysBackwardsFromTodayToQuery`
`protected String`
`defaultDaysBackwardsFromTodayToQuery`
`protected String`
`defaultIntervalAfterLastInstanceReceivedToWaitBeforeProcessingStudy`
`protected static String`
`defaultPropertiesFileName`
`protected String`
`defaultRetainDeidentifiedFiles`
`protected String`
`defaultRetainGeneratedRDSRFiles`
`protected String`
`defaultRetainSourceFilesUsedForSRGeneration`
`protected String`
`defaultSleepTimeBetweenPassesToProcessReceivedFiles`
`protected String`
`defaultSleepTimeBetweenPassesToQueryRemoteAEs`
`protected String`
`imageTypeColumnName`
`protected String`
`instanceCreatorUIDColumnName`
`protected String`
`instanceHasBeenSentToRegistryColumnName`
`protected String`
`instanceIsExposureDoseSequenceColumnName`
`protected String`
`instanceIsRadiationDoseScreenColumnName`
`protected String`
`instanceIsRadiationDoseSRColumnName`
`protected String`
`instanceLocalFileNameColumnName`
`protected String`
`instanceLocalFileReferenceTypeColumnName`
`protected String`
`instanceLocalParentReferenceColumnName`
`protected String`
`instanceLocalPrimaryKeyColumnName`
`protected static int`
`intervalAfterLastInstanceReceivedToWaitBeforeProcessingStudy`
`protected String`
`manufacturerColumnName`
`protected static final long`
`millisecondsPerDay`
`protected NetworkApplicationInformationFederated`
`networkApplicationInformation`
`protected NetworkApplicationProperties`
`networkApplicationProperties`
`protected String`
`ourCalledAETitle`
`protected Properties`
`properties`
`protected static String`
`propertyDelimitersForTokenizer_RemoteAEsForQuery`
`protected static String`
`propertyName_DaysBackwardsFromTodayToQuery`
`protected static String`
`propertyName_IntervalAfterLastInstanceReceivedToWaitBeforeProcessingStudy`
`protected static String`
`propertyName_RemoteAEsForQuery`
`protected static String`
`propertyName_RetainDeidentifiedFiles`
`protected static String`
`propertyName_RetainGeneratedRDSRFiles`
`protected static String`
`propertyName_RetainSourceFilesUsedForSRGeneration`
`protected static String`
`propertyName_SelectedDoseRegistry`
`protected static String`
`propertyName_SleepTimeBetweenPassesToProcessReceivedFiles`
`protected static String`
`propertyName_SleepTimeBetweenPassesToQueryRemoteAEs`
`protected List<String>`
`remoteAEsForQuery`
`protected FTPRemoteHost`
`remoteHost`
`protected boolean`
`retainDeidentifiedFiles`
`protected boolean`
`retainGeneratedRDSRFiles`
`protected boolean`
`retainSourceFilesUsedForSRGeneration`
`protected File`
`savedImagesFolder`
`protected static int`
`sleepTimeBetweenPassesToProcessReceivedFiles`
`protected static int`
`sleepTimeBetweenPassesToQueryRemoteAEs`
`protected String`
`sopClassUIDColumnName`
`protected String`
`sourceApplicationEntityTitleColumnName`
`protected StoredFilePathStrategy`
`storedFilePathStrategy`
`protected String`
`studyHasBeenProcessedColumnName`
`protected String`
`studyInstanceUIDColumnName`

## Constructor Summary

Constructors
Constructor
Description
`DoseReporterWithLegacyOCRAndAutoSendToRegistry(String propertiesFileName)`
Wait for incoming dose screen images and SRs and send to registry.

## Method Summary

Modifier and Type
Method
Description
`protected boolean`
`alreadyHaveIt(AttributeList uniqueKeys)`
`protected String`
`deidentifyFile(String dicomFileName)`
`protected void`
`deleteFilesAndDatabaseRecords(Set<DoseReporterWithLegacyOCRAndAutoSendToRegistry.CandidateFile> setOfFiles)`
`protected void`
`deleteFilesAndSetDatabaseRecordsToReferenced(Set<DoseReporterWithLegacyOCRAndAutoSendToRegistry.CandidateFile> setOfFiles)`
`protected long`
`findCandidateFilesToSendToRegistry(InformationEntity ie, String localPrimaryKeyValue, Set<DoseReporterWithLegacyOCRAndAutoSendToRegistry.CandidateFile> setOfOriginalSRFiles, Set<DoseReporterWithLegacyOCRAndAutoSendToRegistry.CandidateFile> setOfLegacyOCRSRFiles, Set<DoseReporterWithLegacyOCRAndAutoSendToRegistry.CandidateFile> setOfDoseScreenFiles, long mostRecentInsertionTime)`
`protected boolean`
`findSuitableSRFilesAndSendThemToRegistry(String studyLocalPrimaryKeyValue)`
`protected String`
`getBuildDate()`
Get the date the package was built.
`protected void`
`loadProperties(String propertiesFileName)`
Load properties.
`static void`
`main(String[] arg)`
Wait for incoming dose screen images and SRs and send to registry.
`protected void`
`makeSRFileAndSendFileToRegistry(CTDose ctDose)`
`protected void`
`sendFilesToRegistry(Set<DoseReporterWithLegacyOCRAndAutoSendToRegistry.CandidateFile> setOfSRFiles)`
`protected void`
`sendFileToRegistry(DoseReporterWithLegacyOCRAndAutoSendToRegistry.CandidateFile candidateFile)`
`protected void`
`sendFileToRegistry(String fileName)`
`protected void`
`setSelectedDatabaseRecordHasBeenSentToRegistry(String filename)`
`protected void`
`setSelectedDatabaseRecordIsExposureDoseSequence(String filename)`
`protected void`
`setSelectedDatabaseRecordIsRadiationDoseScreen(String filename)`
`protected void`
`setSelectedDatabaseRecordIsRadiationDoseSR(String filename)`

### Methods inherited from class java.lang.Object

`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### defaultPropertiesFileName

protected static String defaultPropertiesFileName

### propertyName_SelectedDoseRegistry

protected static String propertyName_SelectedDoseRegistry

### propertyName_SleepTimeBetweenPassesToProcessReceivedFiles

protected static String propertyName_SleepTimeBetweenPassesToProcessReceivedFiles

### propertyName_IntervalAfterLastInstanceReceivedToWaitBeforeProcessingStudy

protected static String propertyName_IntervalAfterLastInstanceReceivedToWaitBeforeProcessingStudy

### propertyName_SleepTimeBetweenPassesToQueryRemoteAEs

protected static String propertyName_SleepTimeBetweenPassesToQueryRemoteAEs

### propertyName_DaysBackwardsFromTodayToQuery

protected static String propertyName_DaysBackwardsFromTodayToQuery

### propertyName_RetainSourceFilesUsedForSRGeneration

protected static String propertyName_RetainSourceFilesUsedForSRGeneration

### propertyName_RetainGeneratedRDSRFiles

protected static String propertyName_RetainGeneratedRDSRFiles

### propertyName_RetainDeidentifiedFiles

protected static String propertyName_RetainDeidentifiedFiles

### propertyName_RemoteAEsForQuery

protected static String propertyName_RemoteAEsForQuery

### propertyDelimitersForTokenizer_RemoteAEsForQuery

protected static String propertyDelimitersForTokenizer_RemoteAEsForQuery

### retainDeidentifiedFiles

protected boolean retainDeidentifiedFiles

### retainGeneratedRDSRFiles

protected boolean retainGeneratedRDSRFiles

### retainSourceFilesUsedForSRGeneration

protected boolean retainSourceFilesUsedForSRGeneration

### defaultRetainDeidentifiedFiles

protected String defaultRetainDeidentifiedFiles

### defaultRetainGeneratedRDSRFiles

protected String defaultRetainGeneratedRDSRFiles

### defaultRetainSourceFilesUsedForSRGeneration

protected String defaultRetainSourceFilesUsedForSRGeneration

### defaultSleepTimeBetweenPassesToProcessReceivedFiles

protected String defaultSleepTimeBetweenPassesToProcessReceivedFiles

### defaultIntervalAfterLastInstanceReceivedToWaitBeforeProcessingStudy

protected String defaultIntervalAfterLastInstanceReceivedToWaitBeforeProcessingStudy

### defaultSleepTimeBetweenPassesToQueryRemoteAEs

protected String defaultSleepTimeBetweenPassesToQueryRemoteAEs

### defaultDaysBackwardsFromTodayToQuery

protected String defaultDaysBackwardsFromTodayToQuery

### sleepTimeBetweenPassesToProcessReceivedFiles

protected static int sleepTimeBetweenPassesToProcessReceivedFiles

### intervalAfterLastInstanceReceivedToWaitBeforeProcessingStudy

protected static int intervalAfterLastInstanceReceivedToWaitBeforeProcessingStudy

### sleepTimeBetweenPassesToQueryRemoteAEs

protected static int sleepTimeBetweenPassesToQueryRemoteAEs

### daysBackwardsFromTodayToQuery

protected static int daysBackwardsFromTodayToQuery

### millisecondsPerDay

protected static final long millisecondsPerDay

See Also:
  - Constant Field Values

### properties

protected Properties properties

### networkApplicationProperties

protected NetworkApplicationProperties networkApplicationProperties

### networkApplicationInformation

protected NetworkApplicationInformationFederated networkApplicationInformation

### ourCalledAETitle

protected String ourCalledAETitle

### remoteAEsForQuery

protected List<String> remoteAEsForQuery

### databaseInformationModel

protected DatabaseInformationModel databaseInformationModel

### remoteHost

protected FTPRemoteHost remoteHost

### buildDate

protected String buildDate

### savedImagesFolder

protected File savedImagesFolder

### storedFilePathStrategy

protected StoredFilePathStrategy storedFilePathStrategy

### studyHasBeenProcessedColumnName

protected String studyHasBeenProcessedColumnName

### instanceHasBeenSentToRegistryColumnName

protected String instanceHasBeenSentToRegistryColumnName

### instanceIsRadiationDoseSRColumnName

protected String instanceIsRadiationDoseSRColumnName

### instanceIsRadiationDoseScreenColumnName

protected String instanceIsRadiationDoseScreenColumnName

### instanceIsExposureDoseSequenceColumnName

protected String instanceIsExposureDoseSequenceColumnName

### studyInstanceUIDColumnName

protected String studyInstanceUIDColumnName

### sopClassUIDColumnName

protected String sopClassUIDColumnName

### manufacturerColumnName

protected String manufacturerColumnName

### imageTypeColumnName

protected String imageTypeColumnName

### instanceCreatorUIDColumnName

protected String instanceCreatorUIDColumnName

### sourceApplicationEntityTitleColumnName

protected String sourceApplicationEntityTitleColumnName

### instanceLocalParentReferenceColumnName

protected String instanceLocalParentReferenceColumnName

### instanceLocalFileNameColumnName

protected String instanceLocalFileNameColumnName

### instanceLocalFileReferenceTypeColumnName

protected String instanceLocalFileReferenceTypeColumnName

### instanceLocalPrimaryKeyColumnName

protected String instanceLocalPrimaryKeyColumnName

## Constructor Details

### DoseReporterWithLegacyOCRAndAutoSendToRegistry

public DoseReporterWithLegacyOCRAndAutoSendToRegistry(String propertiesFileName) throws DicomException, DicomNetworkException, IOException, InterruptedException, FTPException

Wait for incoming dose screen images and SRs and send to registry.

Parameters:
  `propertiesFileName` -
Throws:
  `DicomException`
  `DicomNetworkException`
  `IOException`
  `InterruptedException`
  `FTPException`

## Method Details

### getBuildDate

protected String getBuildDate()

Get the date the package was built.

Returns:
  the build date

### loadProperties

protected void loadProperties(String propertiesFileName) throws IOException

Load properties.

Throws:
  `IOException` - thrown if properties file is missing

### deidentifyFile

protected String deidentifyFile(String dicomFileName) throws DicomException, IOException

Throws:
  `DicomException`
  `IOException`

### sendFileToRegistry

protected void sendFileToRegistry(String fileName) throws DicomException, IOException, NoSuchAlgorithmException, Exception

Throws:
  `DicomException`
  `IOException`
  `NoSuchAlgorithmException`
  `Exception`

### sendFileToRegistry

protected void sendFileToRegistry(DoseReporterWithLegacyOCRAndAutoSendToRegistry.CandidateFile candidateFile) throws DicomException, IOException, NoSuchAlgorithmException, Exception

Throws:
  `DicomException`
  `IOException`
  `NoSuchAlgorithmException`
  `Exception`

### sendFilesToRegistry

protected void sendFilesToRegistry(Set<DoseReporterWithLegacyOCRAndAutoSendToRegistry.CandidateFile> setOfSRFiles) throws DicomException, IOException, NoSuchAlgorithmException, Exception

Throws:
  `DicomException`
  `IOException`
  `NoSuchAlgorithmException`
  `Exception`

### makeSRFileAndSendFileToRegistry

protected void makeSRFileAndSendFileToRegistry(CTDose ctDose)

### deleteFilesAndDatabaseRecords

protected void deleteFilesAndDatabaseRecords(Set<DoseReporterWithLegacyOCRAndAutoSendToRegistry.CandidateFile> setOfFiles) throws DicomException, IOException

Throws:
  `DicomException`
  `IOException`

### deleteFilesAndSetDatabaseRecordsToReferenced

protected void deleteFilesAndSetDatabaseRecordsToReferenced(Set<DoseReporterWithLegacyOCRAndAutoSendToRegistry.CandidateFile> setOfFiles) throws DicomException, IOException

Throws:
  `DicomException`
  `IOException`

### findCandidateFilesToSendToRegistry

protected long findCandidateFilesToSendToRegistry(InformationEntity ie, String localPrimaryKeyValue, Set<DoseReporterWithLegacyOCRAndAutoSendToRegistry.CandidateFile> setOfOriginalSRFiles, Set<DoseReporterWithLegacyOCRAndAutoSendToRegistry.CandidateFile> setOfLegacyOCRSRFiles, Set<DoseReporterWithLegacyOCRAndAutoSendToRegistry.CandidateFile> setOfDoseScreenFiles, long mostRecentInsertionTime) throws DicomException

Throws:
  `DicomException`

### findSuitableSRFilesAndSendThemToRegistry

protected boolean findSuitableSRFilesAndSendThemToRegistry(String studyLocalPrimaryKeyValue) throws DicomException, IOException, NoSuchAlgorithmException, Exception

Throws:
  `DicomException`
  `IOException`
  `NoSuchAlgorithmException`
  `Exception`

### setSelectedDatabaseRecordIsRadiationDoseSR

protected void setSelectedDatabaseRecordIsRadiationDoseSR(String filename) throws DicomException

Throws:
  `DicomException`

### setSelectedDatabaseRecordIsRadiationDoseScreen

protected void setSelectedDatabaseRecordIsRadiationDoseScreen(String filename) throws DicomException

Throws:
  `DicomException`

### setSelectedDatabaseRecordIsExposureDoseSequence

protected void setSelectedDatabaseRecordIsExposureDoseSequence(String filename) throws DicomException

Throws:
  `DicomException`

### setSelectedDatabaseRecordHasBeenSentToRegistry

protected void setSelectedDatabaseRecordHasBeenSentToRegistry(String filename) throws DicomException

Throws:
  `DicomException`

### alreadyHaveIt

protected boolean alreadyHaveIt(AttributeList uniqueKeys) throws DicomException

Throws:
  `DicomException`

### main

public static void main(String[] arg)

Wait for incoming dose screen images and SRs and send to registry.

Parameters:
  `arg` - none