One image from the same study cannot be uploaded to the system (version 1419)

  • Here with the error message: (some data masked)


    10/12/2020 9:35:15 AM [DICOM1] ***Failed SQLExecDirect : INSERT INTO DICOMStudies (StudyInsta, StudyDate, StudyTime, StudyID, StudyDescr, AccessionN, StudyModal, PatientNam, PatientBir, PatientSex, PatientID, AccessTime) VALUES ('1.2.826.0.1.3680043.6.49952.18092.20201012064348.2824.78.329653', '20201012', '092338', '2001048630F', 'Abdomen, Whole Abdomen (Appendix is not included)', '2001048630F', 'US', 'NGAN', '19760416', 'F', 'K112864A', 1602466496)

    10/12/2020 9:35:15 AM [DICOM1] ***Error: 2627: 23000: [Microsoft][SQL Server Native Client 11.0][SQL Server]Violation of PRIMARY KEY constraint 'PK__DICOMStu__3B309566C4403DA2'. Cannot insert duplicate key in object 'dbo.DICOMStudies'. The duplicate key value is (1.2.826.0.1.3680043.6.49952.18092.20201012064348.2824.78.329653).

    10/12/2020 9:35:15 AM [DICOM1] ***Unable to DB.Add()

    10/12/2020 9:35:15 AM [DICOM1] ***SQL: INSERT INTO DICOMStudies (StudyInsta, StudyDate, StudyTime, StudyID, StudyDescr, AccessionN, StudyModal, PatientNam, PatientBir, PatientSex, PatientID, AccessTime) VALUES ('1.2.826.0.1.3680043.6.49952.18092.20201012064348.2824.78.329653', '20201012', '092338', '2001048630F', 'Abdomen, Whole Abdomen (Appendix is not included)', '2001048630F', 'US', 'NGAN', '19760416', 'F', 'K112864A', 1602466496)

    10/12/2020 9:35:15 AM [DICOM1] ***Error: 2627: 23000: [Microsoft][SQL Server Native Client 11.0][SQL Server]Violation of PRIMARY KEY constraint 'PK__DICOMStu__3B309566C4403DA2'. Cannot insert duplicate key in object 'dbo.DICOMStudies'. The duplicate key value is (1.2.826.0.1.3680043.6.49952.18092.20201012064348.2824.78.329653).

    10/12/2020 9:35:15 AM [DICOM1] ***Error saving to SQL: K552864A\1.2.840.113663.1500.1.369996779.2.1.20201012.92339.31_0001_000001_160246651585c2.dcm



    2nd image and coming images for the same patient & study can save to the system.

  • I had checked from the database that there is no duplicate patient for same study. Is there anything else? It's strange that the second and fore-coming images for the same patient and same study can be uploaded successfully.

  • Ok,


    then this sounds like a race condition where images 1 and 2 are trying to create the same record at once. Are multiple images sent simultaneously? This has not been seen before and may be an issue specific for SQL server.


    Marcel

  • Hi,


    In mysql, sqlite and postgres the "Cannot insert duplicate key error" is caught and will not stop processing. The same should be done for SQL server. I do catch error 2601 which is intended to be this condition but there may be a change in SQL server. Can you find out what the error code is?


    Edit: I can get you a version of 1.4.19 or a version of 1.5.0b with the fix in if I am sure what the code is.


    Marcel

  • The error code is 2627. We found error in 1419 and 1500a


    Following with the error extraction from the serverstatus log:


    0/29/2020 10:26:49 AM [FXDICOM1] Query Tables: DICOMImages

    10/29/2020 10:26:49 AM [FXDICOM1] Columns : ObjectFile, DeviceName

    10/29/2020 10:26:49 AM [FXDICOM1] Where : SOPInstanc = '1.2.840.113663.1500.1.369996779.3.1.20201029.102319.796' AND ImagePat = 'C5129573'

    10/29/2020 10:26:49 AM [FXDICOM1] Order : (null)

    10/29/2020 10:26:49 AM [FXDICOM1] FreeStore Left 273584 on f:\

    10/29/2020 10:26:49 AM [FXDICOM1] Add to Table: DICOMImages

    10/29/2020 10:26:49 AM [FXDICOM1] Columns: SOPInstanc, SOPClassUI, ImageNumbe, ImageDate, ImageTime, SamplesPer, PhotoMetri, Rows, Colums, BitsStored, ImageType, ImagePat, SeriesInst, AccessTime, ObjectFile, DeviceName

    10/29/2020 10:26:49 AM [FXDICOM1] Values: '1.2.840.113663.1500.1.369996779.3.1.20201029.102319.796', '1.2.840.10008.5.1.4.1.1.6.1', '1', '20201029', '102319', '1', 'MONOCHROME2', '768', '1024', '8', 'ORIGINAL\PRIMARY\ABDOMINAL', 'C5129573', '1.2.840.113663.1500.1.369996779.2.1.20201029.101856.796', 1603938400, 'C5129573\1.2.840.113663.1500.1.369996779.2.1.20201029.101856.796_0001_000001_160393840903d1.dcm', 'MAG0'

    10/29/2020 10:26:49 AM [FXDICOM1] Query Tables: DICOMImages

    10/29/2020 10:26:49 AM [FXDICOM1] Columns : ObjectFile, DeviceName

    10/29/2020 10:26:49 AM [FXDICOM1] Where : SOPInstanc = '1.2.840.113663.1500.1.369996779.3.11.20201029.102428.921' AND ImagePat = 'C5129573'

    10/29/2020 10:26:49 AM [FXDICOM1] Order : (null)

    10/29/2020 10:26:49 AM [FXDICOM1] FreeStore Left 273584 on f:\

    10/29/2020 10:26:49 AM [FXDICOM1] Add to Table: DICOMImages

    10/29/2020 10:26:49 AM [FXDICOM1] Columns: SOPInstanc, SOPClassUI, ImageNumbe, ImageDate, ImageTime, SamplesPer, PhotoMetri, Rows, Colums, BitsStored, ImageType, ImagePat, SeriesInst, AccessTime, ObjectFile, DeviceName

    10/29/2020 10:26:49 AM [FXDICOM1] Values: '1.2.840.113663.1500.1.369996779.3.11.20201029.102428.921', '1.2.840.10008.5.1.4.1.1.6.1', '11', '20201029', '102428', '1', 'MONOCHROME2', '768', '1024', '8', 'ORIGINAL\PRIMARY\ABDOMINAL', 'C5129573', '1.2.840.113663.1500.1.369996779.2.1.20201029.101856.796', 1603938400, 'C5129573\1.2.840.113663.1500.1.369996779.2.1.20201029.101856.796_0001_000011_160393840903d2.dcm', 'MAG0'

    10/29/2020 10:26:49 AM [FXDICOM1] Query Tables: DICOMSeries

    10/29/2020 10:26:49 AM [FXDICOM1] Columns : SeriesInst,SeriesNumb,SeriesDate,SeriesTime,SeriesDesc,Modality,PatientPos,ContrastBo,Manufactur,ModelName,BodyPartEx,ProtocolNa,StationNam,Institutio,FrameOfRef,SeriesPat,StudyInsta

    10/29/2020 10:26:49 AM [FXDICOM1] Query Tables: DICOMSeries

    10/29/2020 10:26:49 AM [FXDICOM1] Columns : SeriesInst,SeriesNumb,SeriesDate,SeriesTime,SeriesDesc,Modality,PatientPos,ContrastBo,Manufactur,ModelName,BodyPartEx,ProtocolNa,StationNam,Institutio,FrameOfRef,SeriesPat,StudyInsta

    10/29/2020 10:26:49 AM [FXDICOM1] Where : SeriesInst = '1.2.840.113663.1500.1.369996779.2.1.20201029.101856.796' AND SeriesPat = 'C5129573'

    10/29/2020 10:26:49 AM [FXDICOM1] Order : (null)

    10/29/2020 10:26:49 AM [FXDICOM1] Where : SeriesInst = '1.2.840.113663.1500.1.369996779.2.1.20201029.101856.796' AND SeriesPat = 'C5129573'

    10/29/2020 10:26:49 AM [FXDICOM1] Order : (null)

    10/29/2020 10:26:49 AM [FXDICOM1] Add to Table: DICOMSeries

    10/29/2020 10:26:49 AM [FXDICOM1] Columns: SeriesInst, SeriesNumb, SeriesDate, SeriesTime, SeriesDesc, Modality, Manufactur, ModelName, ProtocolNa, Institutio, SeriesPat, StudyInsta, AccessTime

    10/29/2020 10:26:49 AM [FXDICOM1] Values: '1.2.840.113663.1500.1.369996779.2.1.20201029.101856.796', '1', '20201029', '101856', 'Abdomen, Whole Abdomen (Appendix is not included)', 'US', 'Philips Medical Systems', 'iU22', 'DR.KAN', 'HOSPITAL', 'C5129573', '1.2.826.0.1.3680043.6.62015.21452.20201029003505.2824.72.690706', 1603938400

    10/29/2020 10:26:49 AM [FXDICOM1] Add to Table: DICOMSeries

    10/29/2020 10:26:49 AM [FXDICOM1] Columns: SeriesInst, SeriesNumb, SeriesDate, SeriesTime, SeriesDesc, Modality, Manufactur, ModelName, ProtocolNa, Institutio, SeriesPat, StudyInsta, AccessTime

    10/29/2020 10:26:49 AM [FXDICOM1] Values: '1.2.840.113663.1500.1.369996779.2.1.20201029.101856.796', '1', '20201029', '101856', 'Abdomen, Whole Abdomen (Appendix is not included)', 'US', 'Philips Medical Systems', 'iU22', 'DR.KAN', 'HOSPITAL', 'C5129573', '1.2.826.0.1.3680043.6.62015.21452.20201029003505.2824.72.690706', 1603938400

    10/29/2020 10:26:49 AM [FXDICOM1] Query Tables: DICOMStudies

    10/29/2020 10:26:49 AM [FXDICOM1] Columns : StudyInsta,StudyDate,StudyTime,StudyID,StudyDescr,AccessionN,ReferPhysi,PatientsAg,PatientsWe,StudyModal,PatientNam,PatientBir,PatientSex,PatientID

    10/29/2020 10:26:49 AM [FXDICOM1] Where : StudyInsta = '1.2.826.0.1.3680043.6.62015.21452.20201029003505.2824.72.690706'

    10/29/2020 10:26:49 AM [FXDICOM1] Order : (null)

    10/29/2020 10:26:49 AM [FXDICOM1] ***Failed SQLExecDirect : INSERT INTO DICOMSeries (SeriesInst, SeriesNumb, SeriesDate, SeriesTime, SeriesDesc, Modality, Manufactur, ModelName, ProtocolNa, Institutio, SeriesPat, StudyInsta, AccessTime) VALUES ('1.2.840.113663.1500.1.369996779.2.1.20201029.101856.796', '1', '20201029', '101856', 'Abdomen, Whole Abdomen (Appendix is not included)', 'US', 'Philips Medical Systems', 'iU22', 'DR.KAN', 'HOSPITAL', 'C5129573', '1.2.826.0.1.3680043.6.62015.21452.20201029003505.2824.72.690706', 1603938400)

    10/29/2020 10:26:49 AM [FXDICOM1] ***Error: 2627: 23000: [Microsoft][SQL Server Native Client 11.0][SQL Server]Violation of PRIMARY KEY constraint 'PK__DICOMSer__5DC1FE0A1D28EEC9'. Cannot insert duplicate key in object 'dbo.DICOMSeries'. The duplicate key value is (1.2.840.113663.1500.1.369996779.2.1.20201029.101856.796).

    10/29/2020 10:26:49 AM [FXDICOM1] Add to Table: DICOMStudies

    10/29/2020 10:26:49 AM [FXDICOM1] ***Unable to DB.Add()

    10/29/2020 10:26:49 AM [FXDICOM1] ***SQL: INSERT INTO DICOMSeries (SeriesInst, SeriesNumb, SeriesDate, SeriesTime, SeriesDesc, Modality, Manufactur, ModelName, ProtocolNa, Institutio, SeriesPat, StudyInsta, AccessTime) VALUES ('1.2.840.113663.1500.1.369996779.2.1.20201029.101856.796', '1', '20201029', '101856', 'Abdomen, Whole Abdomen (Appendix is not included)', 'US', 'Philips Medical Systems', 'iU22', 'DR.KAN', 'TERESA`S HOSPITAL', 'C5129573', '1.2.826.0.1.3680043.6.62015.21452.20201029003505.2824.72.690706', 1603938400)

    10/29/2020 10:26:49 AM [FXDICOM1] Columns: StudyInsta, StudyDate, StudyTime, StudyID, StudyDescr, AccessionN, StudyModal, PatientNam, PatientBir, PatientSex, PatientID, AccessTime

    10/29/2020 10:26:49 AM [FXDICOM1] ***Error: 2627: 23000: [Microsoft][SQL Server Native Client 11.0][SQL Server]Violation of PRIMARY KEY constraint 'PK__DICOMSer__5DC1FE0A1D28EEC9'. Cannot insert duplicate key in object 'dbo.DICOMSeries'. The duplicate key value is (1.2.840.113663.1500.1.369996779.2.1.20201029.101856.796).

    10/29/2020 10:26:49 AM [FXDICOM1] Values: '1.2.826.0.1.3680043.6.62015.21452.20201029003505.2824.72.690706', '20201029', '101856', 'STHXR2001052891I', 'Abdomen, Whole Abdomen (Appendix is not included)', 'STHXR2001052891I', 'US', 'KU^CANDY', '19680810', 'F', 'C5129573', 1603938400

    10/29/2020 10:26:49 AM [FXDICOM1] Delete Record Table: DICOMImages

    10/29/2020 10:26:49 AM [FXDICOM1] Where : SOPInstanc = '1.2.840.113663.1500.1.369996779.3.1.20201029.102319.796' and SOPClassUI = '1.2.840.10008.5.1.4.1.1.6.1' and ImageNumbe = '1' and ImageDate = '20201029' and ImageTime = '102319' and SamplesPer = '1' and PhotoMetri = 'MONOCHROME2' and Rows = '768' and Colums = '1024' and BitsStored = '8' and ImageType = 'ORIGINAL\PRIMARY\ABDOMINAL' and ImagePat = 'C5129573' and SeriesInst = '1.2.840.113663.1500.1.369996779.2.1.20201029.101856.796'

    10/29/2020 10:26:49 AM [FXDICOM1] ***Error saving to SQL: C5129573\1.2.840.113663.1500.1.369996779.2.1.20201029.101856.796_0001_000001_160393840903d1.dcm

    10/29/2020 10:26:49 AM [FXDICOM1] Query Tables: DICOMPatients

    10/29/2020 10:26:49 AM [FXDICOM1] Columns : PatientID,PatientNam,PatientBir,PatientSex

    10/29/2020 10:26:49 AM [FXDICOM1] Where : PatientID = 'C5129573'

    10/29/2020 10:26:49 AM [FXDICOM1] Order : (null)

    10/29/2020 10:26:49 AM [FXDICOM1] Add to Table: DICOMPatients

    10/29/2020 10:26:49 AM [FXDICOM1] Columns: PatientID, PatientNam, PatientBir, PatientSex, AccessTime

    10/29/2020 10:26:49 AM [FXDICOM1] Values: 'C5129573', 'KU^CANDY', '19680810', 'F', 1603938400

    10/29/2020 10:26:49 AM [FXDICOM1] Written file: f:\dicomserver1419\data\C5129573\1.2.840.113663.1500.1.369996779.2.1.20201029.101856.796_0001_000011_160393840903d2.dcm

    10/29/2020 10:26:49 AM [FXDICOM1] Server Command := 0001

    10/29/2020 10:26:49 AM [FXDICOM1] Message ID := 227c

    10/29/2020 10:26:49 AM [FXDICOM1] 0000,0002 28 UI AffectedSOPClassUID "1.2.840.10008.5.1.4.1.1.6.1"

    10/29/2020 10:26:49 AM [FXDICOM1] 0000,0100 2 US CommandField 1

    10/29/2020 10:26:49 AM [FXDICOM1] 0000,0110 2 US MessageID 8828

    10/29/2020 10:26:49 AM [FXDICOM1] 0000,0700 2 US Priority 0

    10/29/2020 10:26:49 AM [FXDICOM1] 0000,0800 2 US DataSetType 258

    10/29/2020 10:26:49 AM [FXDICOM1] 0000,1000 56 UI AffectedSOPInstanceU "1.2.840.113663.1500.1.369996779.3.10.20201029.102424.156"

    10/29/2020 10:26:49 AM [FXDICOM1] 0002,0010 19 UI TransferSyntaxUID "1.2.840.10008.1.2.1"

    10/29/2020 10:26:49 AM [FXDICOM1] Server Command := 0001

    10/29/2020 10:26:49 AM [FXDICOM1] Message ID := 227d

  • Hi,


    I made an update on GitHub (I changed the code a while ago, but I wanted to be sure I had the correct error code..)


    https://github.com/marcelvanhe…5a0251f1144eb1272e52580dc


    If you download the zip of the latest github version you can find an updated 1.5.0b executable in install64 and install32.


    Marcel

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!