Skip to content

Purge instance records from DB

Vrinda edited this page Feb 6, 2024 · 2 revisions

Overview

Using this feature is beneficial when the archive would be receiving thousands of studies daily amounting to millions of records in few months or if there's a constraint on size/speed of the database. To use this feature one needs to accumulate the metadata on series level which will accumulate the metadata of all instances of series to a zip file which would be used later for query/retrieve of instance records which are to be purged.

Configuration

Using Archive UI

  1. Go to Menu->Configuration, then on Devices page, Edit the dcm4chee-arc device. Go to Extensions and
    Edit extension of Device Extension. Again go to its Extensions and Edit extension of Archive Device.
  2. Enter values in fields Remove Instance Records Delay, Remove Instance Records Polling Interval, Remove Instance Records Fetch Size, Aggregate Series Metadata Delay, Series Metadata Storage ID, Update Series Metadata Polling Interval and Update Series Metadata Fetch Size as required by one's application needs or with values as shown below and Save.
  3. On Archive Device level, create a new Storage Descriptor as Child Object as required by one's application needs or with values as shown below and Save.

Using LDAP

One may either

  • create a LDIF file (e.g.):

      version: 1
      dn: dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
      changetype: modify
      add: dcmPurgeInstanceRecordsDelay
      dcmPurgeInstanceRecordsDelay: PT1M
    
      dn: dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
      changetype: modify
      add: dcmPurgeInstanceRecordsPollingInterval
      dcmPurgeInstanceRecordsPollingInterval: PT1M
    
      dn: dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
      changetype: modify
      add: dcmPurgeInstanceRecordsFetchSize
      dcmPurgeInstanceRecordsFetchSize: 10
    
      dn: dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
      changetype: modify
      add: dcmSeriesMetadataStorageID
      dcmSeriesMetadataStorageID: series-metadata
    
      dn: dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
      changetype: modify
      add: dcmSeriesMetadataDelay
      dcmSeriesMetadataDelay: PT1M
    
      dn: dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
      changetype: modify
      add: dcmSeriesMetadataPollingInterval
      dcmSeriesMetadataPollingInterval: PT1M
    
      dn: dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
      changetype: modify
      add: dcmSeriesMetadataFetchSize
      dcmSeriesMetadataFetchSize: 10
    
      dn: dcmStorageID=series-metadata,dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
      objectClass: dcmStorage
      dcmStorageID: series-metadata
      dcmURI: ${jboss.server.data.url}/series-metadata/
      dcmProperty: pathFormat={now,date,yyyy/MM/dd}/{0020000D}/{0020000E}/metadata.zip
      dcmProperty: checkMountFile=NO_MOUNT
    

    and import it to the LDAP Server by using the ldapmodify command line utility.

  • or use the Add Attribute... and Add Value... function of Apache Directory Studio to add attributes on Archive device, Application Entity levels (e.g.: dicomDeviceName=dcm4chee-arc, dicomAETitle=DCM4CHEE) in the Archive Configuration.

  • Refer Generic Storage for configuring storage of series-metadata.

One may refer to Archive Device, Archive Network AE and Storage to understand the description of attributes.

Refer ISO-8601 Duration format for more know-how on Durations.

Go to the Control tab on Configuration page in archive UI and reload the configuration.

Testing

One can test this feature using the archive UI and dcm4che tools as shown below :

  1. Send studies to archive using storescu tool

     storescu -c DCM4CHEE@localhost:11112 <path-to.study>
    
  2. After waiting for the configured delays of dcmSeriesMetadataDelay and dcmPurgeInstanceRecordsDelay; using archive UI, one can verify value of the private attribute Instance Record Purge State of Series on series level to be PURGED as shown below :

instance_purge_state.png

Note : If the archive is already containing millions of studies and one wants to accumulate the metadata and purge the instance records from DB then one may set the series.metadata_update_time and series.inst_purge_time table columns to current date time for the above feature to take effect.

Clone this wiki locally