Skip to content

Commit

Permalink
Optionally ignore received objects belonging to a different Series t…
Browse files Browse the repository at this point in the history
…han previous received objects with equal SOP Instance UID fix #4518
  • Loading branch information
gunterze committed Jun 13, 2024
1 parent 59d047f commit f9a823d
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Apache Directory Studio on June 12, 2024, 3:18:36 PM
# Generated by Apache Directory Studio on June 13, 2024, 11:27:53 AM

# SCHEMA "DCM4CHEE-ARCHIVE"
dn: cn=dcm4chee-archive, ou=schema
Expand Down Expand Up @@ -6427,7 +6427,7 @@ m-oid: 1.2.40.0.13.1.15.110.3.481
m-name: dcmRelationalMismatchPolicy
m-description: Specifies behavior on receive of objects, which SOP Instance UID
matches a previous received object belonging to a different Series. Enumerated
values: IGNORE, OVERWRITE, STORE_ADDITIONALLY; IGNORE if absent.
values: IGNORE, REJECT, OVERWRITE, STORE_ADDITIONALLY; IGNORE if absent.
m-equality: caseExactIA5Match
m-syntax: 1.3.6.1.4.1.1466.115.121.1.26
m-singleValue: TRUE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2343,7 +2343,7 @@ attributeTypes: ( 1.2.40.0.13.1.15.110.3.480 NAME 'dcmQStarVerificationStorageID
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE )
attributeTypes: ( 1.2.40.0.13.1.15.110.3.481 NAME 'dcmRelationalMismatchPolicy'
DESC 'Specifies behavior on receive of objects, which SOP Instance UID matches a previous received object belonging to a different Series. Enumerated values: IGNORE, OVERWRITE, STORE_ADDITIONALLY; IGNORE if absent.'
DESC 'Specifies behavior on receive of objects, which SOP Instance UID matches a previous received object belonging to a different Series. Enumerated values: IGNORE, REJECT, OVERWRITE, STORE_ADDITIONALLY; IGNORE if absent.'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2813,7 +2813,7 @@ attributetype ( 1.2.40.0.13.1.15.110.3.480 NAME 'dcmQStarVerificationStorageID'
SINGLE-VALUE )

attributetype ( 1.2.40.0.13.1.15.110.3.481 NAME 'dcmRelationalMismatchPolicy'
DESC 'Specifies behavior on receive of objects, which SOP Instance UID matches a previous received object belonging to a different Series. Enumerated values: IGNORE, OVERWRITE, STORE_ADDITIONALLY; IGNORE if absent.'
DESC 'Specifies behavior on receive of objects, which SOP Instance UID matches a previous received object belonging to a different Series. Enumerated values: IGNORE, REJECT, OVERWRITE, STORE_ADDITIONALLY; IGNORE if absent.'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2343,7 +2343,7 @@ olcAttributeTypes: ( 1.2.40.0.13.1.15.110.3.480 NAME 'dcmQStarVerificationStorag
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE )
olcAttributeTypes: ( 1.2.40.0.13.1.15.110.3.481 NAME 'dcmRelationalMismatchPolicy'
DESC 'Specifies behavior on receive of objects, which SOP Instance UID matches a previous received object belonging to a different Series. Enumerated values: IGNORE, OVERWRITE, STORE_ADDITIONALLY; IGNORE if absent.'
DESC 'Specifies behavior on receive of objects, which SOP Instance UID matches a previous received object belonging to a different Series. Enumerated values: IGNORE, REJECT, OVERWRITE, STORE_ADDITIONALLY; IGNORE if absent.'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2342,7 +2342,7 @@ olcAttributeTypes: ( 1.2.40.0.13.1.15.110.3.480 NAME 'dcmQStarVerificationStorag
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE )
olcAttributeTypes: ( 1.2.40.0.13.1.15.110.3.481 NAME 'dcmRelationalMismatchPolicy'
DESC 'Specifies behavior on receive of objects, which SOP Instance UID matches a previous received object belonging to a different Series. Enumerated values: IGNORE, OVERWRITE, STORE_ADDITIONALLY; IGNORE if absent.'
DESC 'Specifies behavior on receive of objects, which SOP Instance UID matches a previous received object belonging to a different Series. Enumerated values: IGNORE, REJECT, OVERWRITE, STORE_ADDITIONALLY; IGNORE if absent.'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@
* @since Jun 2024
*/
public enum RelationalMismatchPolicy {
IGNORE, OVERWRITE, STORE_ADDITIONALLY
IGNORE, REJECT, OVERWRITE, STORE_ADDITIONALLY
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public interface StoreService {
int CONFLICTING_PID_NOT_ACCEPTED = 0xA778;
int CONFLICTING_PATIENT_ATTRS_REJECTED = 0xA779;
int DELETION_OF_STUDY_IN_PROGRESS = 0xA77A;
int RELATIONAL_MISMATCH = 0xA77B;

String DUPLICATE_REJECTION_NOTE_MSG = "Rejection Note [uid={0}] already received.";
String SUBSEQUENT_OCCURRENCE_OF_REJECTED_OBJECT_MSG = "Subsequent occurrence of rejected Object [uid={0}, rejection={1}]";
Expand All @@ -91,6 +92,7 @@ public interface StoreService {
String CONFLICTING_PID_NOT_ACCEPTED_MSG = "Patient ID {0} differs from Patient ID {1} in previous received object of Study[uid={2}].";
String CONFLICTING_PATIENT_ATTRS_REJECTED_MSG = "Patient with {0} differs from previous received object in attribute {1} {2}";
String DELETION_OF_STUDY_IN_PROGRESS_MSG = "Deletion of Study[uid={0}] in progress.";
String RELATIONAL_MISMATCH_MSG = "{0}[uid={1}] differs from {0}[uid={2}] in previous received object[uid={3}]";

StoreSession newStoreSession(Association as);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,14 @@ && getRejectionNote(arcDev, prevInstance.getConceptNameCode()) != null) {
return result;
}
}
if (arcAE.relationalMismatchPolicy() == RelationalMismatchPolicy.IGNORE
&& isRelationalMismatch(ctx, prevInstance)) {
logInfo(IGNORE_RELATIONAL_MISMATCH, ctx);
return result;
if (isRelationalMismatch(ctx, prevInstance)) {
switch (arcAE.relationalMismatchPolicy()) {
case IGNORE:
logInfo(IGNORE_RELATIONAL_MISMATCH, ctx);
return result;
case REJECT:
throw relationalMismatch(ctx, prevInstance);
}
}
}
}
Expand Down Expand Up @@ -366,6 +370,17 @@ private boolean contains(Collection<Location> locations, ReadContext readContext
return false;
}

private DicomServiceException relationalMismatch(StoreContext ctx, Instance prevInstance) {
Series prevSeries = prevInstance.getSeries();
Study prevStudy = prevSeries.getStudy();
return new DicomServiceException(StoreService.RELATIONAL_MISMATCH,
!ctx.getStudyInstanceUID().equals(prevStudy.getStudyInstanceUID())
? MessageFormat.format(StoreService.RELATIONAL_MISMATCH_MSG, "Study",
ctx.getStudyInstanceUID(), prevStudy.getStudyInstanceUID(), ctx.getSopInstanceUID())
: MessageFormat.format(StoreService.RELATIONAL_MISMATCH_MSG, "Series",
ctx.getSeriesInstanceUID(), prevSeries.getSeriesInstanceUID(), ctx.getSopInstanceUID()));
}

private DicomServiceException subsequentOccurrenceOfRejectedObject(RejectedInstance rejectedInstance) {
return new DicomServiceException(StoreService.SUBSEQUENT_OCCURRENCE_OF_REJECTED_OBJECT,
MessageFormat.format(StoreService.SUBSEQUENT_OCCURRENCE_OF_REJECTED_OBJECT_MSG,
Expand Down

0 comments on commit f9a823d

Please sign in to comment.