com.pixelmed.apps

## Class MultiModalitySimulator

- java.lang.Object
- - com.pixelmed.apps.MultiModalitySimulator

    public class MultiModalitySimulator
    extends java.lang.Object

This class implements a multi-modality simulator that takes a database of existing studies to provide a source of sample images and DICOM attributes, and for each modality within the database, generates random new patients and studies at random intervals using the current date and time.

For example:

    try {
        new MultiModalitySimulator("theirhost","11112","STORESCP","STORESCU","/tmp/testfile.dcm","1.2.840.10008.5.1.4.1.1.7","1.3.6.1.4.1.5962.1.1.0.0.0.1064923879.2077.3232235877",0,0);
    }
    catch (Exception e) {
        e.printStackTrace(System.err);
    }

From the command line:

    java -cp pixelmed.jar:lib/additional/commons-codec-1.3.jar:lib/additional/excalibur-bzip2-1.0.jar com.pixelmed.network.MultiModalitySimulator theirhost 11112 STORESCP STORESCU -  0 0

### Nested Class Summary

Nested Classes
`protected class` `MultiModalitySimulator.OurMultipleInstanceTransferStatusHandler`
`protected class` `MultiModalitySimulator.SpecificModalitySimulator`

### Field Summary

Fields
`protected static long` `accessionNumberCounter`
`protected java.lang.String` `calledAETitle`
`protected DatabaseInformationModel` `databaseInformationModel`
`protected int` `debugLevel`
`protected java.lang.String` `hostname`
`protected java.lang.String` `localFileNameColumnName`
`protected static java.lang.String[]` `modalities`
`protected java.lang.String` `modalityColumnName`
`protected java.lang.String[]` `patientNames`
`protected int` `port`
`protected java.lang.String` `seriesLocalParentReferenceColumnName`
`protected java.util.Map<java.lang.String,java.lang.Integer>` `sleepIntervalForModality`
`protected static int[]` `sleepIntervalForModalityInMinutes`

### Constructor Summary

Constructors
Constructor and Description
`MultiModalitySimulator(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String databaseFileName, int debugLevel)`

### Method Summary

Methods
`protected static void` `deleteFiles(SetOfDicomFiles dicomFiles)`
`protected void` `findFilesToSend(InformationEntity ie, java.lang.String localPrimaryKeyValue, java.util.List<java.lang.String> dicomFiles)`
`protected SetOfDicomFiles` `generateSyntheticStudyFromOriginal(java.util.List<java.lang.String> originalDicomFileNames, java.lang.String modality, java.lang.String aeTitleForMetaInformation, java.lang.String patientName, java.lang.String patientID, java.lang.String studyID, java.lang.String accessionNumber)`
`protected int` `getSleepIntervalForModalityInMilliseconds(java.lang.String modality)`
`static void` `main(java.lang.String[] arg)` Simulate modalities sending to the specified AE.

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

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

### Field Detail

#### modalities

    protected static java.lang.String[] modalities

#### sleepIntervalForModalityInMinutes

    protected static int[] sleepIntervalForModalityInMinutes

#### sleepIntervalForModality

    protected java.util.Map<java.lang.String,java.lang.Integer> sleepIntervalForModality

#### accessionNumberCounter

    protected static long accessionNumberCounter

#### patientNames

    protected java.lang.String[] patientNames

#### debugLevel

    protected int debugLevel

#### seriesLocalParentReferenceColumnName

    protected java.lang.String seriesLocalParentReferenceColumnName

#### localFileNameColumnName

    protected java.lang.String localFileNameColumnName

#### modalityColumnName

    protected java.lang.String modalityColumnName

#### databaseInformationModel

    protected DatabaseInformationModel databaseInformationModel

#### hostname

    protected java.lang.String hostname

#### port

    protected int port

#### calledAETitle

    protected java.lang.String calledAETitle

### Constructor Detail

#### MultiModalitySimulator

    public MultiModalitySimulator(java.lang.String hostname,
                          int port,
                          java.lang.String calledAETitle,
                          java.lang.String databaseFileName,
                          int debugLevel)
                           throws DicomException

Throws:
  `DicomException`

### Method Detail

#### getSleepIntervalForModalityInMilliseconds

    protected int getSleepIntervalForModalityInMilliseconds(java.lang.String modality)

#### findFilesToSend

    protected void findFilesToSend(InformationEntity ie,
                       java.lang.String localPrimaryKeyValue,
                       java.util.List<java.lang.String> dicomFiles)
                            throws DicomException

Throws:
  `DicomException`

#### generateSyntheticStudyFromOriginal

    protected SetOfDicomFiles generateSyntheticStudyFromOriginal(java.util.List<java.lang.String> originalDicomFileNames,
                                                     java.lang.String modality,
                                                     java.lang.String aeTitleForMetaInformation,
                                                     java.lang.String patientName,
                                                     java.lang.String patientID,
                                                     java.lang.String studyID,
                                                     java.lang.String accessionNumber)
                                                          throws DicomException,
                                                                 java.io.IOException

Throws:
  `DicomException`
  `java.io.IOException`

#### deleteFiles

    protected static void deleteFiles(SetOfDicomFiles dicomFiles)

#### main

    public static void main(java.lang.String[] arg)

Simulate modalities sending to the specified AE.

Parameters:
  `arg` - array of five strings - their hostname, their port, their AE Title, the source database name, and the debugging level