Package com.pixelmed.database

## Class DatabaseMediaImporter

- java.lang.Object
- - com.pixelmed.dicom.MediaImporter
  - - com.pixelmed.database.DatabaseMediaImporter

-     public class DatabaseMediaImporter
      extends MediaImporter

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.pixelmed.dicom.MediaImporter

      `MediaImporter.MediaImporterWithFileChooserDialogThread, MediaImporter.OurReadTerminationStrategy`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected DatabaseInformationModel` | `databaseInformationModel` |
    `protected java.io.File` | `savedInstancesFolder` |
    `protected StoredFilePathStrategy` | `storedFilePathStrategy` |

    - ### Fields inherited from class com.pixelmed.dicom.MediaImporter

      `logger, mediaDirectoryPath, progressBar, progressBarUpdater, terminateAfterIdentifyingGroup`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DatabaseMediaImporter​(java.lang.String mediaDirectoryPath, java.io.File savedInstancesFolder, DatabaseInformationModel databaseInformationModel, MessageLogger logger)` |
    `DatabaseMediaImporter​(java.lang.String mediaDirectoryPath, java.io.File savedInstancesFolder, StoredFilePathStrategy storedFilePathStrategy, DatabaseInformationModel databaseInformationModel, MessageLogger logger)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `doSomethingWithDicomFileOnMedia​(java.lang.String mediaFileName)` | Makes a copy of the DICOM file in the temporary folder, reads the DICOM attributes to extract the necessary information and inserts a reference to the copied file in the database.

    - ### Methods inherited from class com.pixelmed.dicom.MediaImporter

      `choosePathAndImportDicomFiles, choosePathAndImportDicomFiles, doSomethingWithDicomFileOnMedia, doSomethingWithUnwantedFileOnMedia, getDirectory, importDicomFiles, isOKToImport, logLn, main`

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

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

- - ### Field Detail

    - #### savedInstancesFolder

          protected java.io.File savedInstancesFolder

    - #### databaseInformationModel

          protected DatabaseInformationModel databaseInformationModel

    - #### storedFilePathStrategy

          protected StoredFilePathStrategy storedFilePathStrategy

  - ### Constructor Detail

    - #### DatabaseMediaImporter

          public DatabaseMediaImporter​(java.lang.String mediaDirectoryPath,
                                       java.io.File savedInstancesFolder,
                                       DatabaseInformationModel databaseInformationModel,
                                       MessageLogger logger)

    - #### DatabaseMediaImporter

          public DatabaseMediaImporter​(java.lang.String mediaDirectoryPath,
                                       java.io.File savedInstancesFolder,
                                       StoredFilePathStrategy storedFilePathStrategy,
                                       DatabaseInformationModel databaseInformationModel,
                                       MessageLogger logger)

  - ### Method Detail

    - #### doSomethingWithDicomFileOnMedia

          protected void doSomethingWithDicomFileOnMedia​(java.lang.String mediaFileName)

      Makes a copy of the DICOM file in the temporary folder, reads the DICOM attributes to extract the necessary information and inserts a reference to the copied file in the database.

      If any errors are encountered during this process, the exceptions are caught, logged to stderr, and no further action is taken. Copying is not performed until after the DICOM attributes are successfully extracted, but orphan temporary copies could exist if the database insertion fails.

      Overrides:
        `doSomethingWithDicomFileOnMedia` in class `MediaImporter`
      Parameters:
        `mediaFileName` - the fully qualified path name to a DICOM file