Class PseudonymizeAndSequester.OurMediaImporter

java.lang.Object
com.pixelmed.dicom.MediaImporter
com.pixelmed.apps.PseudonymizeAndSequester.OurMediaImporter
Enclosing class:
PseudonymizeAndSequester

protected class PseudonymizeAndSequester.OurMediaImporter extends MediaImporter

A protected class that actually does all the work of finding and processing the files.

  • Constructor Details

    • OurMediaImporter

      public OurMediaImporter(MessageLogger logger, String inputPathName, String outputFolderCleanName, String outputFolderDirtyName, String pseudonymizationControlFileName, String pseudonymizationResulttByOriginalPatientIDFileName, String pseudonymizationResultByOriginalStudyInstanceUIDFileName, String failedFilesFileName, String uidMapResultFileName, boolean keepAllPrivate, boolean addContributingEquipmentSequence, boolean keepDescriptors, boolean keepSeriesDescriptors, boolean keepProtocolName, boolean keepPatientCharacteristics, boolean keepDeviceIdentity, boolean keepInstitutionIdentity, int handleDates, int handleStructuredContent) throws FileNotFoundException, IOException

      De-identify the DICOM Attributes and pseudonymize them and sequester any files that may have risk of identity leakage.

      Parameters:
      logger -
      outputFolderCleanName - where to store all the low risk processed output files (must already exist)
      outputFolderDirtyName - where to store all the high risk processed output files (must already exist)
      pseudonymizationControlFileName - values to use for pseudonymization, may be null or empty in which case random values are used
      pseudonymizationResulttByOriginalPatientIDFileName - file into which to store pseudonymization by original PatientID performed
      pseudonymizationResultByOriginalStudyInstanceUIDFileName - file into which to store pseudonymization by original StudyInstanceUID performed
      failedFilesFileName - file into which to store the paths of files that failed to process
      uidMapResultFileName - file into which to store the map of original to new UIDs
      keepAllPrivate - retain all private attributes, not just known safe ones
      addContributingEquipmentSequence - whether or not to add ContributingEquipmentSequence
      keepDescriptors - if true, keep the text description and comment attributes
      keepSeriesDescriptors - if true, keep the series description even if all other descriptors are removed
      keepProtocolName - if true, keep protocol name even if all other descriptors are removed
      keepPatientCharacteristics - if true, keep patient characteristics (such as might be needed for PET SUV calculations)
      keepDeviceIdentity - if true, keep device identity
      keepInstitutionIdentity - if true, keep institution identity
      handleDates - keep, remove or modify dates and times
      handleStructuredContent - keep, remove or modify structured content
      Throws:
      FileNotFoundException
      IOException
  • Method Details

    • finish

      protected void finish() throws IOException
      Throws:
      IOException
    • doSomethingWithDicomFileOnMedia

      protected void doSomethingWithDicomFileOnMedia(String dicomFileName, String inputTransferSyntaxUID, String sopClassUID)

      De-identify the DICOM Attributes and pseudonymize them and sequester if may have risk of identity leakage.

      Implements the following options of ClinicalTrialsAttributes.removeOrNullIdentifyingAttributes():

      keepDescriptors, keepSeriesDescriptors, keepProtocolName, keepPatientCharacteristics, keepDeviceIdentity, keepInstitutionIdentity, ClinicalTrialsAttributes.HandleDates.keep

      Also performs AttributeList.removeUnsafePrivateAttributes()

      Also performs ClinicalTrialsAttributes.remapUIDAttributes(AttributeList)

      The pixel data is not redacted.

      The output file is stored in the outputFolderName specified in the constructor and is named ...

      Any exceptions encountered during processing are logged to stderr, and processing of the next file will continue.

      Overrides:
      doSomethingWithDicomFileOnMedia in class MediaImporter
      Parameters:
      dicomFileName - the fully qualified path name to a DICOM file
      inputTransferSyntaxUID - the Transfer Syntax of the Data Set if a DICOM file, from the DICOMDIR or Meta Information Header
      sopClassUID - the SOP Class of the Data Set if a DICOM file, from the DICOMDIR or Meta Information Header
    • isOKToImport

      protected boolean isOKToImport(String sopClassUID, String transferSyntaxUID)

      Allows all types of DICOM files, images or not, with any Transfer Syntax to be processed

      Overrides:
      isOKToImport in class MediaImporter
      Parameters:
      sopClassUID -
      transferSyntaxUID -
      Returns:
      true if is suitable