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())) {
ParseDicomHeader parseHeader = new ParseDicomHeader();
parseHeader.parseDicomHeaderFile(dcmFilePath.toFile());
} else {
}
} 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?