Mentions légales du service

Skip to content
Snippets Groups Projects
Commit b90c6121 authored by Guillaume Thomazon's avatar Guillaume Thomazon
Browse files

Add selection by SOP Class UID (affected and requested) and command field.

git-svn-id: https://scm.gforge.inria.fr/authscm/ycadoret/svn/gazelle/Maven/gazelle-proxy/trunk@33601 356b4b1a-1d2b-0410-8bf1-ffa24008f01e
parent c4aac559
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,6 @@ import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Lob;
import javax.persistence.Transient;
import net.ihe.gazelle.proxy.dicom.TxtInputHandler;
import net.ihe.gazelle.proxy.netty.ChannelType;
......@@ -53,7 +52,7 @@ import com.pixelmed.dicom.DicomDictionary;
import com.pixelmed.dicom.DicomException;
import com.pixelmed.dicom.DicomInputStream;
import com.pixelmed.dicom.SOPClassDescriptions;
import com.pixelmed.network.MessageServiceElementCommand;
import com.pixelmed.network.MessageServiceElementCommand_;
@Entity
@Name("dicomMessage")
......@@ -75,18 +74,41 @@ public class DicomMessage extends AbstractMessage implements java.io.Serializabl
@Lob
private String fileDump;
public ChannelType getChannelType() {
return ChannelType.DICOM;
}
@Column(name = "dicom_affectedsopclassuid")
private String infoAffectedSOPClassUID;
@Column(name = "dicom_commandfield")
private String infoCommandField;
@Column(name = "dicom_requestedsopclassuid")
private String infoRequestedSOPClassUID;
// Constructors
public String getInfoAffectedSOPClassUID() {
return infoAffectedSOPClassUID;
}
public String getInfoCommandField() {
return infoCommandField;
}
public String getInfoRequestedSOPClassUID() {
return infoRequestedSOPClassUID;
}
public ChannelType getChannelType() {
return ChannelType.DICOM;
}
public byte[] getFileCommandSet() {
return fileCommandSet;
}
public void setFileCommandSet(byte[] fileCommandSet) {
this.fileCommandSet = fileCommandSet;
dumpFileCommandSet();
}
public String getFileTransfertSyntax() {
......@@ -157,7 +179,7 @@ public class DicomMessage extends AbstractMessage implements java.io.Serializabl
}
int[] integerValues = attributeValue.getIntegerValues();
for (Integer fieldValue : integerValues) {
String commandFieldTmp = MessageServiceElementCommand.toString(fieldValue);
String commandFieldTmp = MessageServiceElementCommand_.toString(fieldValue);
bw.append(StringEscapeUtils.escapeHtml(commandFieldTmp));
bw.append(" ");
}
......@@ -212,6 +234,69 @@ public class DicomMessage extends AbstractMessage implements java.io.Serializabl
return "";
}
public void dumpFileCommandSet() {
if (getFileCommandSet() != null) {
AttributeList attributeList = new AttributeList();
try {
attributeList.read(new DicomInputStream(new ByteArrayInputStream(getFileCommandSet())));
Set<AttributeTag> keys = attributeList.keySet();
Iterator<AttributeTag> iterator = keys.iterator();
while (iterator.hasNext()) {
AttributeTag tag = iterator.next();
Attribute attributeValue = attributeList.get(tag);
// affected sop class
if (tag.equals(DICOM_DICTIONARY.getTagFromName("AffectedSOPClassUID"))) {
try {
String fieldValue = attributeValue.getDelimitedStringValuesOrEmptyString();
//See GazelleSOPClassDescriptions in DicomSCPScreener for more descriptions
String affectedSopClassUID = SOPClassDescriptions.getDescriptionFromUID(fieldValue);
if (affectedSopClassUID == null || affectedSopClassUID.equals("")) {
affectedSopClassUID = fieldValue;
}
infoAffectedSOPClassUID=affectedSopClassUID;
} catch (Exception e) {
e.printStackTrace();
}
}
// Command field
if (tag.equals(DICOM_DICTIONARY.getTagFromName("CommandField"))) {
try {
int[] integerValues = attributeValue.getIntegerValues();
for (Integer fieldValue : integerValues) {
String commandFieldTmp = MessageServiceElementCommand_.toString(fieldValue);
infoCommandField=commandFieldTmp;
}
} catch (Exception e) {
e.printStackTrace();
}
}
// requested sop class
if (tag.equals(DICOM_DICTIONARY.getTagFromName("RequestedSOPClassUID"))) {
try {
String fieldValue = attributeValue.getDelimitedStringValuesOrEmptyString();
//See GazelleSOPClassDescriptions in DicomSCPScreener for more descriptions
String requestedSopClassUID = SOPClassDescriptions.getDescriptionFromUID(fieldValue);
if (requestedSopClassUID == null || requestedSopClassUID.equals("")) {
requestedSopClassUID = fieldValue;
}
infoRequestedSOPClassUID=requestedSopClassUID;
} catch (Exception e) {
e.printStackTrace();
}
}
}
} catch (IOException e) {
e.printStackTrace();
} catch (DicomException e) {
e.printStackTrace();
}
}
}
public String getFileDump() {
return fileDump;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment