Skip to content

Commit

Permalink
UPS Processor for DICOM Export: make Series Instance UID and Referenc…
Browse files Browse the repository at this point in the history
…ed SOP Sequence in Input Information Sequence optional fix dcm4che#2724 dcm4che/dcm4che#775
  • Loading branch information
gunterze committed Aug 19, 2020
1 parent 502de1f commit 342301a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ public RetrieveContext newRetrieveContextSTORE(
public RetrieveContext newRetrieveContextSTORE(
String localAET, String studyUID, String seriesUID, Sequence refSopSeq, String destAET)
throws ConfigurationException {
if (refSopSeq == null || refSopSeq.isEmpty()) {
return newRetrieveContextSTORE(localAET, studyUID, seriesUID, (String) null, destAET);
}
RetrieveContext ctx = newRetrieveContext(localAET, refSopSeq);
ctx.setStudyInstanceUIDs(studyUID);
ctx.setSeriesInstanceUIDs(seriesUID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
package org.dcm4chee.arc.ups.movescu;

import org.dcm4che3.data.*;
import org.dcm4che3.dcmr.ScopeOfAccumlation;
import org.dcm4che3.dcmr.ScopeOfAccumulation;
import org.dcm4che3.net.Association;
import org.dcm4che3.net.DimseRSP;
import org.dcm4che3.net.Status;
Expand Down Expand Up @@ -159,15 +159,15 @@ private static class KeysBuilder {

KeysBuilder(Attributes ups) {
Consumer<Attributes> retrieve = retrieveOf(
UPSUtils.getScheduledProcessingParameter(ups, ScopeOfAccumlation.CODE));
UPSUtils.getScheduledProcessingParameter(ups, ScopeOfAccumulation.CODE));
ups.getSequence(Tag.InputInformationSequence).stream().forEach(retrieve);
}

private Consumer<Attributes> retrieveOf(Optional<Code> scopeOfAccumlation) {
return scopeOfAccumlation.isPresent() ?
(scopeOfAccumlation.get().equalsIgnoreMeaning(ScopeOfAccumlation.Study)
(scopeOfAccumlation.get().equalsIgnoreMeaning(ScopeOfAccumulation.Study)
? this::retrieveStudies
: (scopeOfAccumlation.get().equalsIgnoreMeaning(ScopeOfAccumlation.Series)
: (scopeOfAccumlation.get().equalsIgnoreMeaning(ScopeOfAccumulation.Series)
? this::retrieveSeries
: this::retrieveInstances))
: this::retrieveInstances;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import org.dcm4che3.conf.api.ConfigurationException;
import org.dcm4che3.conf.api.ConfigurationNotFoundException;
import org.dcm4che3.data.*;
import org.dcm4che3.dcmr.ScopeOfAccumlation;
import org.dcm4che3.dcmr.ScopeOfAccumulation;
import org.dcm4che3.net.Status;
import org.dcm4che3.net.service.DicomServiceException;
import org.dcm4chee.arc.conf.UPSProcessingRule;
Expand Down Expand Up @@ -112,7 +112,7 @@ private RetrieveContext calculateMatches(Attributes ups, String destAET)
throws DicomServiceException {
RetrieveContext retrieveContext = null;
RetrieveLevel retrieveLevel = RetrieveLevel.of(
UPSUtils.getScheduledProcessingParameter(ups, ScopeOfAccumlation.CODE));
UPSUtils.getScheduledProcessingParameter(ups, ScopeOfAccumulation.CODE));
Set<String> suids = new HashSet<>();
for (Attributes inputInformation : ups.getSequence(Tag.InputInformationSequence)) {
RetrieveContext tmp = newRetrieveContext(retrieveLevel, inputInformation, destAET, suids);
Expand Down Expand Up @@ -179,8 +179,8 @@ RetrieveContext newRetrieveContextSTORE(RetrieveService retrieveService, String

public static RetrieveLevel of(Optional<Code> scopeOfAccumlation) {
return scopeOfAccumlation.isPresent() ?
(scopeOfAccumlation.get().equalsIgnoreMeaning(ScopeOfAccumlation.Study) ? STUDY :
(scopeOfAccumlation.get().equalsIgnoreMeaning(ScopeOfAccumlation.Series) ? SERIES : IMAGE))
(scopeOfAccumlation.get().equalsIgnoreMeaning(ScopeOfAccumulation.Study) ? STUDY :
(scopeOfAccumlation.get().equalsIgnoreMeaning(ScopeOfAccumulation.Series) ? SERIES : IMAGE))
: IMAGE;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

import org.dcm4che3.data.*;
import org.dcm4che3.dcmr.ProcedureDiscontinuationReasons;
import org.dcm4che3.dcmr.ScopeOfAccumlation;
import org.dcm4che3.dcmr.ScopeOfAccumulation;
import org.dcm4che3.hl7.HL7Charset;
import org.dcm4che3.io.SAXTransformer;
import org.dcm4che3.io.TemplatesCache;
Expand Down Expand Up @@ -821,7 +821,7 @@ private static Attributes createOnStore(StoreContext storeCtx, Calendar now, UPS
&& !attrs.contains(Tag.InputInformationSequence)) {
updateIncludeInputInformation(attrs.newSequence(Tag.InputInformationSequence, 1), storeCtx);
}
addScheduledProcessingParameter(attrs, ScopeOfAccumlation.CODE,
addScheduledProcessingParameter(attrs, ScopeOfAccumulation.CODE,
toScopeOfAccumlation(rule.getScopeOfAccumulation()));
return attrs;
}
Expand All @@ -844,11 +844,11 @@ private static Code toScopeOfAccumlation(Entity scopeOfAccumulation) {
if (scopeOfAccumulation != null)
switch (scopeOfAccumulation) {
case Study:
return ScopeOfAccumlation.Study;
return ScopeOfAccumulation.Study;
case Series:
return ScopeOfAccumlation.Series;
return ScopeOfAccumulation.Series;
case MPPS:
return ScopeOfAccumlation.PerformedProcedureStep;
return ScopeOfAccumulation.PerformedProcedureStep;
}
return null;
}
Expand Down

0 comments on commit 342301a

Please sign in to comment.