Fail to DicomSend a file to dcm4che PACS - Storage would require forbidden Coercion of (0020,000E) Series Instance UID

1,092 views
Skip to first unread message

Thanasis Iliopoulos

unread,
Feb 24, 2015, 10:30:20 AM2/24/15
to dcm...@googlegroups.com
Hello,

i am trying to DICOM Send a dicomized pdf file to PACS and attach it to an already existing study in a separate node (as a different series). The exception i get is the following:

17:05:18,218 WARN  [StorageBean] inserting records for instance[uid=1.3.12.2.1107.5.2.30.26419.2015012312251185923500906] failed: Storage would require forbidden Coercion of (0020,
000E) Series Instance UID,UI,*1,#44,[2.25.165984029577686167923659986974014468234] to (0020,000E) Series Instance UID,UI,*1,#52,[1.3.12.2.1107.5.2.30.26419.2015012312251185923500905]
17:05:18,223 WARN  [StoreScpService] failed to update DB with entries for received 2015/2/24/17/989B7CAC/5B87CA61/5FFD8E23 - retry
org.dcm4che.net.DcmServiceException: Storage would require forbidden Coercion of (0020,000E) Series Instance UID,UI,*1,#44,[2.25.165984029577686167923659986974014468234] to (0020,000E) Series Instance UID,UI,*1,#52,[1.3.12.2.1107.5.2.30.26419.2015012312251185923500905]
        at org.dcm4chex.archive.ejb.entity.AttrUtils.coerceAttributes(AttrUtils.java:80)


For doing so, i am populating dicomized pdf with the original values of dicom tags stored in my database (local application). The full scenario is the following:

a) First i am anomymizing all dicoms of study and i am storing the original values of specific tags in my local database using the following code (i am doing so for sending/storing to a remote pacs):

public void anonymize(DicomObject ds) {
        try {
              StudyDetailsDAO stDet = new StudyDetailsDAOImpl();
              String caseId = Integer.toString(stDet.getStudyDetailsCaseId(ds.getString(Tag.StudyInstanceUID)));
            
              log.info("Inserting caseId: " + caseId + " of Study: " + ds.getString(Tag.StudyInstanceUID) + " to patientName and PatientId tags...");
            
              ds.putString(Tag.PatientName,VR.PN, caseId);
              ds.putString(Tag.PatientID,VR.PN, caseId);
            
              Calendar cal = Calendar.getInstance();
              ds.putDate(Tag.StudyDate, VR.DA, cal.getTime());
            
              ds.remove(Tag.OtherPatientIDs);
              ds.remove(Tag.OtherPatientIDsSequence);
              ds.remove(Tag.InstitutionName);
              ds.remove(Tag.InstitutionAddress);
              ds.remove(Tag.ReferringPhysicianName);
              ds.remove(Tag.PhysiciansOfRecord);
              ds.remove(Tag.OperatorsName);
              ds.remove(Tag.RequestingPhysician);
              
}

b) then when i want to attach the dicomized pdf to the existing study in my local PACS i am repopulating these tags as following:


public void repopulateAnonData(String strDcmFilePath, DicomSeriesMeta dcmMeta) throws IOException {
        
        log.info("repopulating anonymized data for file: " + strDcmFilePath);
        CheckIfIsDicom dcmCheck = new CheckIfIsDicom();
        
        Path dcmFilePath = Paths.get(strDcmFilePath);
        
        DicomObject dcmObj6;
        DicomInputStream din6 = null;
        din6 = new DicomInputStream(dcmFilePath.toFile());
        dcmObj6 = din6.readDicomObject();
            
        try {
            
            log.info("Repopulating AccessionNumber: " + dcmMeta.getAccessionNumber());
            dcmObj6.putString(Tag.AccessionNumber, VR.SH ,dcmMeta.getAccessionNumber());
            
            log.info("Repopulating InstitutionAddress: " + dcmMeta.getInstitutionAddress());
            dcmObj6.putString(Tag.InstitutionAddress, VR.ST ,dcmMeta.getInstitutionAddress());
            
            log.info("Repopulating InstitutionName: " + dcmMeta.getInstitutionName());
            dcmObj6.putString(Tag.InstitutionName, VR.LO ,dcmMeta.getInstitutionName());
            
            log.info("Repopulating IssuerOfPatientID: " + dcmMeta.getIssuerOfPatientID());
            dcmObj6.putString(Tag.IssuerOfPatientID, VR.LO ,dcmMeta.getIssuerOfPatientID());
            
            log.info("Repopulating MediaStorageSOPInstanceUID: " + dcmMeta.getMediaStorageSOPInstanceUID());
            dcmObj6.putString(Tag.MediaStorageSOPInstanceUID, VR.UI ,dcmMeta.getMediaStorageSOPInstanceUID());
            
            log.info("Repopulating OperatorsName: " + dcmMeta.getOperatorsName());
            dcmObj6.putString(Tag.OperatorsName, VR.PN ,dcmMeta.getOperatorsName());
            
            log.info("Repopulating OtherPatientIDs: " + dcmMeta.getOtherPatientIDs());
            dcmObj6.putString(Tag.OtherPatientIDs, VR.LO ,dcmMeta.getOtherPatientIDs());

            log.info("Repopulating PatientAge: " + dcmMeta.getPatientAge());
            dcmObj6.putString(Tag.PatientAge, VR.AS ,dcmMeta.getPatientAge());
            
            log.info("Repopulating PatientBirthDate: " + dcmMeta.getPatientBirthDate());
            dcmObj6.putString(Tag.PatientBirthDate, VR.DA ,dcmMeta.getPatientBirthDate());
            
            log.info("Repopulating PatientID: " + dcmMeta.getPatientID());
            dcmObj6.putString(Tag.PatientID, VR.LO ,dcmMeta.getPatientID());
            
            log.info("Repopulating PatientName: " + dcmMeta.getPatientName());
            dcmObj6.putString(Tag.PatientName, VR.PN ,dcmMeta.getPatientName());
            
            log.info("Repopulating PatientSex: " + dcmMeta.getPatientSex());
            dcmObj6.putString(Tag.PatientSex, VR.CS ,dcmMeta.getPatientSex());
            
            log.info("Repopulating PhysiciansOfRecord: " + dcmMeta.getPhysiciansOfRecord());
            dcmObj6.putString(Tag.PhysiciansOfRecord,VR.PN ,dcmMeta.getPhysiciansOfRecord());
            
            log.info("Repopulating ReferringPhysicianName: " + dcmMeta.getReferringPhysicianName());
            dcmObj6.putString(Tag.ReferringPhysicianName, VR.PN ,dcmMeta.getReferringPhysicianName());
            
            log.info("Repopulating RequestingPhysician: " + dcmMeta.getRequestingPhysician());
            dcmObj6.putString(Tag.RequestingPhysician, VR.PN ,dcmMeta.getRequestingPhysician());
            
            log.info("Repopulating SOPInstanceUID: " + dcmMeta.getsOPInstanceUID());
            dcmObj6.putString(Tag.SOPInstanceUID, VR.UI ,dcmMeta.getsOPInstanceUID());

            log.info("Repopulating StudyDate: " + dcmMeta.getStudyDate());
            dcmObj6.putString(Tag.StudyDate, VR.DA ,dcmMeta.getStudyDate());
            
            log.info("Repopulating StudyID: " + dcmMeta.getStudyID());
            dcmObj6.putString(Tag.StudyID, VR.SH ,dcmMeta.getStudyID());
            
            log.info("Repopulating StudyInstanceUID: " + dcmMeta.getStudyInstanceUID());
            dcmObj6.putString(Tag.StudyInstanceUID, VR.UI,dcmMeta.getStudyInstanceUID());            
            
            log.info("Repopulating SeriesDescription: " + "REPORT");
            dcmObj6.putString(Tag.SeriesDescription, VR.LO,"REPORT");

            FileOutputStream fos = new FileOutputStream( new File(dcmFilePath.toString()), false);
            BufferedOutputStream bos = new BufferedOutputStream(fos);
            DicomOutputStream dos = new DicomOutputStream(bos);
                
            dos.writeDicomFile(dcmObj6);                
                            
            dos.close();
            bos.close();
            fos.close();
            
        } catch (Exception ex) {
            log.log(Level.ERROR, null, ex);;
        } finally {
            din6.close();
            if (!dcmCheck.checkIfDicomObjectFileB(dcmFilePath.toFile())) {
                    log.info("Fetched file is not a DICOM.");
            }
        }
        
        CheckIfIsDicom checker = new CheckIfIsDicom();
        try {
                if(checker.checkIfDicomObjectFileB(dcmFilePath.toFile())) {
                    log.info("Dicomization SUCCESS!");
                    ParseDicomHeader parseHeader =  new ParseDicomHeader();
                    parseHeader.parseDicomHeaderFile(dcmFilePath.toFile());
                } else {
                    log.info("Dicomization NOT SUCCESS!");
                }
        } catch (IOException ex) {
                log.log(Level.ERROR, null, ex);
        }            
        
}

I am not repopulating SeriesInstanceUID since i want the dicomized PDF to be send and attached to already existing study in a different node (different SeriesInstanceUID) ... for a reason when i am dicomizing the PDF an id is generated and attached ... How could i resolve this issue?

Why am i getting this error?

fleetwoodfc

unread,
Feb 24, 2015, 3:53:15 PM2/24/15
to dcm...@googlegroups.com
You will get this error if there is already have an object stored with uid=1.3.12.2.1107.5.2.30.26419.2015012312251185923500906 but with a different series uid.

Thanasis Iliopoulos

unread,
Feb 24, 2015, 5:07:06 PM2/24/15
to dcm...@googlegroups.com
Fleedwoodfc thanks for replying!

Yes indeed there is already a whole study with SOPInstanceUID = 1.3.12.2.1107.5.2.30.26419.2015012312251185923500906 and StudyInstanceUID = 152765433 ...

I want this extra dicomized pdf to be stored UNDER this study as a separate Series ... which dicom tags should i populate with different values apart from SeriesInstanceUID? 

At the moment as depicted in code i am using identical values for dicom tags: StudyInstanceUID, SOPInstanceUID etc.

fleetwoodfc

unread,
Feb 24, 2015, 5:51:13 PM2/24/15
to dcm...@googlegroups.com
SOPInstanceUID needs to be unique to the encapsulated pdf object.

Thanasis Iliopoulos

unread,
Mar 8, 2015, 5:22:46 PM3/8/15
to dcm...@googlegroups.com
OK!

now i am trying to send the DICOM file with a different SOPInstanceUID and i am getting:

23:06:04,003 WARN  [StoreScpService] SOP Instance UID in Dataset [2.25.227860789054905865463149387539476701251] differs from Affected SOP Instance UID[1.3.12.2.1107.5.2.30.26419.20
15022512062559209947045]
23:06:04,004 WARN  [StoreScpService] SOP Instance UID in Dataset [2.25.227860789054905865463149387539476701251] differs from Affected SOP Instance UID[1.3.12.2.1107.5.2.30.26419.20
15022512062559209947045]
org.dcm4che.net.DcmServiceException: SOP Instance UID in Dataset [2.25.227860789054905865463149387539476701251] differs from Affected SOP Instance UID[1.3.12.2.1107.5.2.30.26419.20
15022512062559209947045]
        at org.dcm4chex.archive.dcm.storescp.StoreScp.checkSOPInstanceUID(StoreScp.java:1334)
        at org.dcm4chex.archive.dcm.storescp.StoreScp.doActualCStore(StoreScp.java:535)
        at org.dcm4chex.archive.dcm.storescp.StoreScp.doCStore(StoreScp.java:496)
        at org.dcm4che.net.DcmServiceBase.c_store(DcmServiceBase.java:116)
        at org.dcm4cheri.net.ActiveAssociationImpl.run(ActiveAssociationImpl.java:230)
        at org.dcm4cheri.util.LF_ThreadPool.join(LF_ThreadPool.java:174)
        at org.dcm4cheri.net.ActiveAssociationImpl.run(ActiveAssociationImpl.java:164)
        at org.dcm4cheri.server.DcmHandlerImpl.handle(DcmHandlerImpl.java:249)
        at org.dcm4cheri.server.ServerImpl.run(ServerImpl.java:288)
        at org.dcm4cheri.util.LF_ThreadPool.join(LF_ThreadPool.java:174)
        at org.dcm4cheri.server.ServerImpl$1.run(ServerImpl.java:242)
        at java.lang.Thread.run(Thread.java:745)
23:06:04,004 INFO  [FsmImpl] sending [pc-3] 1:C_STORE_RSP
        class:  1.2.840.10008.5.1.4.1.1.104.1/Encapsulated PDF Storage
        inst:   1.3.12.2.1107.5.2.30.26419.2015022512062559209947045/?
        status: a900
        error comment:  SOP Instance UID in Dataset [2.25.227860789054905865463149387539


???

The case is very simple .. i have in dcm4che pacs a study and i want to send a dicom file and attach it to the same study in a separate node (as a different series) ... Which tags are required? and which tags should be the same (as of these of the existing study) and which should be different?

thanks...

On Wednesday, 25 February 2015 00:51:13 UTC+2, fleetwoodfc wrote:
SOPInstanceUID needs to be unique to the encapsulated pdf object.

On Tuesday, February 24, 2015 at 5:07:06 PM UTC-5, Thanasis Iliopoulos wrote:
Fleedwoodfc thanks for replying!

Yes indeed there is already a whole study with SOPInstanceUID = 1.3.12.2.1107.5.2.30.26419.2015012312251185923500906 and StudyInstanceUID = 152765433 ...

I want this extra dicomized pdf to be stored UNDER this study as a separate Series ... which dicom tags should i populate with different values apart from SeriesInstanceUID? 

At the moment as depicted in code i am using identical values for dicom tags: StudyInstanceUID, SOPInstanceUID etc

 
 
Reply all
Reply to author
Forward
0 new messages