private boolean match(Attributes item, int[] is) { int val = item.getInt(tag, valueIndex, Integer.MIN_VALUE); if (val == Integer.MIN_VALUE) return matchNotPresent; for (int i : is) { if (i == val) return true; } return false; } }
public Attributes readNextDirectoryRecord(Attributes rec) throws IOException { return readRecord( rec.getInt(Tag.OffsetOfTheNextDirectoryRecord, 0)); }
public Attributes findLowerDirectoryRecord(Attributes rec, boolean ignorePrivate, Attributes keys, boolean ignoreCaseOfPN, boolean matchNoValue) throws IOException { return findRecordInUse( rec.getInt(Tag.OffsetOfReferencedLowerLevelDirectoryEntity, 0), ignorePrivate, keys, ignoreCaseOfPN, matchNoValue); }
public Attributes readLowerDirectoryRecord(Attributes rec) throws IOException { return readRecord( rec.getInt(Tag.OffsetOfReferencedLowerLevelDirectoryEntity, 0)); }
public Attributes findNextDirectoryRecord(Attributes rec, boolean ignorePrivate, Attributes keys, boolean ignoreCaseOfPN, boolean matchNoValue) throws IOException { return findRecordInUse( rec.getInt(Tag.OffsetOfTheNextDirectoryRecord, 0), ignorePrivate, keys, ignoreCaseOfPN, matchNoValue); }
@Override public void onDimseRSP(Association as, Attributes cmd, Attributes data) { if (cmd.getInt(Tag.Status, -1) != Status.Success) removeOutstandingResult(tuid ); super.onDimseRSP(as, cmd, data); } };
private static void promptIntTo(Attributes cmd, String name, int tag, StringBuilder sb) { int val = cmd.getInt(tag, 0); if (val != 0 || cmd.containsValue(tag)) sb.append(name).append(val); }
private static void promptMoveOriginatorTo(Attributes cmd, StringBuilder sb) { String aet = cmd.getString(Tag.MoveOriginatorApplicationEntityTitle, null); if (aet != null) sb.append(StringUtils.LINE_SEPARATOR) .append(" orig=") .append(aet) .append(" >> ") .append(cmd.getInt(Tag.MoveOriginatorMessageID, -1)) .append(":C-MOVE-RQ"); }
private static void promptIntTo(Attributes cmd, String name, int tag, StringBuilder sb) { int val = cmd.getInt(tag, 0); if (val != 0 || cmd.containsValue(tag)) sb.append(name).append(val); }
private void writeDirRecordHeader(Attributes rec) throws IOException { ByteUtils.intToBytesLE( rec.getInt(Tag.OffsetOfTheNextDirectoryRecord, 0), dirRecordHeader, 8); ByteUtils.shortToBytesLE( rec.getInt(Tag.RecordInUseFlag, 0), dirRecordHeader, 20); ByteUtils.intToBytesLE( rec.getInt(Tag.OffsetOfReferencedLowerLevelDirectoryEntity, 0), dirRecordHeader, 30); raf.seek(rec.getItemPosition() + 8); raf.write(dirRecordHeader); }
private Dimse dimseOf(Attributes cmd) throws AAbort { try { return Dimse.valueOf(cmd.getInt(Tag.CommandField, 0)); } catch (IllegalArgumentException e) { Dimse.LOG.info("{}: illegal DIMSE:", as); Dimse.LOG.info("\n{}", cmd); throw new AAbort(); } }
void onCancelRQ(Attributes cmd) throws IOException { incReceivedCount(Dimse.C_CANCEL_RQ); int msgId = cmd.getInt(Tag.MessageIDBeingRespondedTo, -1); CancelRQHandler handler = removeCancelRQHandler(msgId); if (handler != null) handler.onCancelRQ(this); }
private static void verifyImagePixelModule(Attributes metadata) throws DicomServiceException { for (int tag : IMAGE_PIXEL_TAGS) if (!metadata.containsValue(tag)) throw missingAttribute(tag); if (metadata.getInt(Tag.SamplesPerPixel, 1) > 1 && !metadata.containsValue(Tag.PlanarConfiguration)) throw missingAttribute(Tag.PlanarConfiguration); }
private Attributes findRecordInUse(int offset, boolean ignorePrivate, Attributes keys, boolean ignoreCaseOfPN, boolean matchNoValue) throws IOException { while (offset != 0) { Attributes item = readRecord(offset); if (inUse(item) && !(ignorePrivate && isPrivate(item)) && (keys == null || item.matches(keys, ignoreCaseOfPN, matchNoValue))) return item; offset = item.getInt(Tag.OffsetOfTheNextDirectoryRecord, 0); } return null; }
public synchronized boolean deleteRecord(Attributes rec) throws IOException { if (rec.getInt(Tag.RecordInUseFlag, 0) == INACTIVE) return false; // already disabled for (Attributes lowerRec = readLowerDirectoryRecord(rec); lowerRec != null; lowerRec = readNextDirectoryRecord(lowerRec)) deleteRecord(lowerRec); rec.setInt(Tag.RecordInUseFlag, VR.US, INACTIVE); markAsDirty(rec); return true; }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes cmd, PDVInputStream data) throws IOException { final int msgid = cmd.getInt(Tag.MessageID, 0); Exchange exchange = getEndpoint().createExchange(dimse, cmd, data); AsyncCallback callback = new EndpointDimseRQHandlerAsyncCallback( as, pc, dimse, msgid, exchange); AsyncProcessorHelper.process(getAsyncProcessor(), exchange, callback); }