|
From: <nr...@us...> - 2011-07-07 15:43:24
|
Revision: 15661
http://dcm4che.svn.sourceforge.net/dcm4che/?rev=15661&view=rev
Author: nroduit
Date: 2011-07-07 15:43:14 +0000 (Thu, 07 Jul 2011)
Log Message:
-----------
Add http tags for WADO
Modified Paths:
--------------
weasis/weasis_framework/trunk/weasis-dicom/weasis-dicom-codec/src/main/java/org/weasis/dicom/codec/wado/WadoParameters.java
weasis/weasis_framework/trunk/weasis-dicom/weasis-dicom-explorer/src/main/java/org/weasis/dicom/explorer/wado/DownloadManager.java
weasis/weasis_framework/trunk/weasis-dicom/weasis-dicom-explorer/src/main/java/org/weasis/dicom/explorer/wado/LoadSeries.java
weasis/weasis_framework/trunk/weasis-dicom/weasis-dicom-explorer/src/main/resources/config/wado_query.xsd
Modified: weasis/weasis_framework/trunk/weasis-dicom/weasis-dicom-codec/src/main/java/org/weasis/dicom/codec/wado/WadoParameters.java
===================================================================
--- weasis/weasis_framework/trunk/weasis-dicom/weasis-dicom-codec/src/main/java/org/weasis/dicom/codec/wado/WadoParameters.java 2011-07-07 14:52:44 UTC (rev 15660)
+++ weasis/weasis_framework/trunk/weasis-dicom/weasis-dicom-codec/src/main/java/org/weasis/dicom/codec/wado/WadoParameters.java 2011-07-07 15:43:14 UTC (rev 15661)
@@ -10,8 +10,10 @@
******************************************************************************/
package org.weasis.dicom.codec.wado;
+import java.util.ArrayList;
+import java.util.List;
+
import org.weasis.core.api.media.data.TagW;
-import org.weasis.dicom.codec.Messages;
public class WadoParameters {
@@ -21,19 +23,21 @@
public static final String TAG_WADO_ADDITIONNAL_PARAMETERS = "additionnalParameters"; //$NON-NLS-1$
public static final String TAG_WADO_OVERRIDE_TAGS = "overrideDicomTagsList"; //$NON-NLS-1$
public static final String TAG_WADO_WEB_LOGIN = "webLogin"; //$NON-NLS-1$
+ public static final String TAG_HTTP_TAG_LIST = "httpTagList"; //$NON-NLS-1$
private final String wadoURL;
private final boolean requireOnlySOPInstanceUID;
private final String additionnalParameters;
private final int[] overrideDicomTagIDList;
private final String webLogin;
+ private final List<WadoParameters.HttpTag> httpTaglist;
public WadoParameters(String wadoURL, boolean requireOnlySOPInstanceUID, String additionnalParameters,
String overrideDicomTagsList, String webLogin) {
- if (wadoURL == null) {
+ if (wadoURL == null)
throw new IllegalArgumentException("wadoURL cannot be null"); //$NON-NLS-1$
- }
this.wadoURL = wadoURL;
+ this.httpTaglist = new ArrayList<WadoParameters.HttpTag>(2);
this.webLogin = webLogin == null ? null : webLogin.trim();
this.requireOnlySOPInstanceUID = requireOnlySOPInstanceUID;
this.additionnalParameters = additionnalParameters == null ? "" : additionnalParameters; //$NON-NLS-1$
@@ -52,6 +56,16 @@
}
}
+ public List<WadoParameters.HttpTag> getHttpTaglist() {
+ return httpTaglist;
+ }
+
+ public void addHttpTag(String key, String value) {
+ if (key != null && value != null) {
+ httpTaglist.add(new HttpTag(key, value));
+ }
+ }
+
public String getWebLogin() {
return webLogin;
}
@@ -76,11 +90,29 @@
if (overrideDicomTagIDList != null) {
int tagID = tagElement.getId();
for (int overTag : overrideDicomTagIDList) {
- if (tagID == overTag) {
+ if (tagID == overTag)
return true;
- }
}
}
return false;
}
+
+ public static class HttpTag {
+ private final String key;
+ private final String value;
+
+ public HttpTag(String key, String value) {
+ this.key = key;
+ this.value = value;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ }
}
Modified: weasis/weasis_framework/trunk/weasis-dicom/weasis-dicom-explorer/src/main/java/org/weasis/dicom/explorer/wado/DownloadManager.java
===================================================================
--- weasis/weasis_framework/trunk/weasis-dicom/weasis-dicom-explorer/src/main/java/org/weasis/dicom/explorer/wado/DownloadManager.java 2011-07-07 14:52:44 UTC (rev 15660)
+++ weasis/weasis_framework/trunk/weasis-dicom/weasis-dicom-explorer/src/main/java/org/weasis/dicom/explorer/wado/DownloadManager.java 2011-07-07 15:43:14 UTC (rev 15661)
@@ -145,6 +145,29 @@
if (TagW.DICOM_LEVEL.Patient.name().equals(xmler.getName().getLocalPart())) {
patient = readPatient(model, seriesList, xmler, wadoParameters);
pat++;
+ } else if (WadoParameters.TAG_HTTP_TAG_LIST.equals(xmler.getName()
+ .getLocalPart())) {
+ boolean state = true;
+ while (xmler.hasNext() && state) {
+ eventType = xmler.next();
+ switch (eventType) {
+ case XMLStreamConstants.START_ELEMENT:
+ if ("Tag".equals(xmler.getName().getLocalPart())) {
+ String httpkey = getTagAttribute(xmler, "key", null); //$NON-NLS-1$
+ String httpvalue = getTagAttribute(xmler, "value", null); //$NON-NLS-1$
+ wadoParameters.addHttpTag(httpkey, httpvalue);
+ }
+ break;
+ case XMLStreamConstants.END_ELEMENT:
+ if (WadoParameters.TAG_HTTP_TAG_LIST.equals(xmler.getName()
+ .getLocalPart())) {
+ state = false;
+ }
+ break;
+ default:
+ break;
+ }
+ }
}
break;
default:
Modified: weasis/weasis_framework/trunk/weasis-dicom/weasis-dicom-explorer/src/main/java/org/weasis/dicom/explorer/wado/LoadSeries.java
===================================================================
--- weasis/weasis_framework/trunk/weasis-dicom/weasis-dicom-explorer/src/main/java/org/weasis/dicom/explorer/wado/LoadSeries.java 2011-07-07 14:52:44 UTC (rev 15660)
+++ weasis/weasis_framework/trunk/weasis-dicom/weasis-dicom-explorer/src/main/java/org/weasis/dicom/explorer/wado/LoadSeries.java 2011-07-07 15:43:14 UTC (rev 15661)
@@ -69,6 +69,7 @@
import org.weasis.dicom.codec.DicomMediaIO;
import org.weasis.dicom.codec.TransferSyntax;
import org.weasis.dicom.codec.wado.WadoParameters;
+import org.weasis.dicom.codec.wado.WadoParameters.HttpTag;
import org.weasis.dicom.explorer.DicomExplorer;
import org.weasis.dicom.explorer.DicomModel;
import org.weasis.dicom.explorer.MimeSystemAppFactory;
@@ -574,6 +575,11 @@
if (wadoParameters.getWebLogin() != null) {
httpCon.setRequestProperty("Authorization", "Basic " + wadoParameters.getWebLogin()); //$NON-NLS-1$ //$NON-NLS-2$
}
+ if (wadoParameters.getHttpTaglist().size() > 0) {
+ for (HttpTag tag : wadoParameters.getHttpTaglist()) {
+ httpCon.setRequestProperty(tag.getKey(), tag.getValue());
+ }
+ }
// Connect to server.
httpCon.connect();
@@ -721,6 +727,11 @@
if (wadoParameters.getWebLogin() != null) {
httpCon.setRequestProperty("Authorization", "Basic " + wadoParameters.getWebLogin()); //$NON-NLS-1$ //$NON-NLS-2$
}
+ if (wadoParameters.getHttpTaglist().size() > 0) {
+ for (HttpTag tag : wadoParameters.getHttpTaglist()) {
+ httpCon.setRequestProperty(tag.getKey(), tag.getValue());
+ }
+ }
// Specify what portion of file to download.
httpCon.setRequestProperty("Range", "bytes=" + downloaded + "-"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
// Connect to server.
Modified: weasis/weasis_framework/trunk/weasis-dicom/weasis-dicom-explorer/src/main/resources/config/wado_query.xsd
===================================================================
--- weasis/weasis_framework/trunk/weasis-dicom/weasis-dicom-explorer/src/main/resources/config/wado_query.xsd 2011-07-07 14:52:44 UTC (rev 15660)
+++ weasis/weasis_framework/trunk/weasis-dicom/weasis-dicom-explorer/src/main/resources/config/wado_query.xsd 2011-07-07 15:43:14 UTC (rev 15661)
@@ -107,11 +107,21 @@
<xsd:pattern value="((0x[0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F]){1}(,0x[0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F])*)?"/>
</xsd:restriction>
</xsd:simpleType>
+
+ <xsd:group name="httpTagList">
+ <xsd:sequence>
+ <xsd:element name="Tag" minOccurs="0" maxOccurs="unbounded" >
+ <xsd:attribute name="key" type="xsd:string" use="required" />
+ <xsd:attribute name="value" type="xsd:string" use="required" />
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:group>
<!-- DESCRIPTION OF WADO_QUERY XML DOCUMENT -->
<xsd:element name="wado_query" type="WADOQuery"/>
<xsd:complexType name="WADOQuery">
+ <xsd:group ref="httpTagList"/>
<xsd:sequence>
<xsd:element name="Patient" type="Patient" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
@@ -159,5 +169,6 @@
<xsd:attribute name="SOPInstanceUID" type="dicomVrUI" use="required"/>
<xsd:attribute name="TransferSyntaxUID" type="dicomVrUI"/>
<xsd:attribute name="InstanceNumber" type="dicomVrIS"/>
+ <xsd:attribute name="DirectDownloadFile" type="xsd:string" />
</xsd:complexType>
</xsd:schema>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|