Set up dcm4chee-proxy to whilelist DICOM files based on attributes

267 views
Skip to first unread message

Luke deGruchy

unread,
Dec 10, 2015, 1:18:01 PM12/10/15
to dcm4che
I'm very new to dcm4chee-proxy and would like to use it as a filter to only send DICOM that conforms to certain attribute values.

As a very simple example, any DICOM with a modality of US would be sent to MY_AE_TITLE, but any DICOM with any other modality, say, CT, would be sent nowhere.

I'm currently struggling to get this to work.   For instance, I've set up a forwarding rule in dcm4chee-wizard with a destination URI of aet:MY_AE_TITLE_1, which will always occur, regardless of how I set up MPPS to Dose SR Template URI and/or Dose SR IOD Template URI.   This also happens regardless of my SOP instance UID.   Nothing every gets sent to MY_AE_TITLE_2.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml"/>
    <xsl:template match="/NativeDicomModel">
        <Result>
            <xsl:choose>
                <xsl:when test="DicomAttribute[@tag='00080018']/Value = '1.2.3.4'">
                    <Destination aet="MY_AE_TITLE_2"/>
                </xsl:when>
                <xsl:otherwise>
                    <Destination aet="DEVNULL"/>
                </xsl:otherwise>
            </xsl:choose>
        </Result>
    </xsl:template>
</xsl:stylesheet>

So my goal in this example is to ensure that only DICOM with SOP instance UID 1.2.3.4 gets sent to MY_AE_TITLE_2 while DICOM with any other SOP instance UID goes nowhere.   DEVNULL is just an example of non-existent AE title.

Is there something I'm missing?   Sorry, but I've had a really hard time finding documentation on this, and would appreciate any help you can provide.

Luke deGruchy

unread,
Jan 4, 2016, 11:08:37 AM1/4/16
to dcm4che
Sorry, but I'm bumping this.

Is this a feature of dc4chee-proxy, or is this unsupported?

Hesham Elbadawi

unread,
Jan 6, 2016, 7:26:55 AM1/6/16
to dcm...@googlegroups.com
Hi Luke,

First of all ultrasound is not MPPS.

Basically if i understand correctly what you are trying to do is only receive ultrasounds to
MY_AE_TITLE_1 and ignore everything else.

so what you should do is either setup one device DEVULL as a dicom STORESCP that ignores all received files
(This is easily done with the dcm4che3 library using the ignore option of the STORESCP)
and not just forward to a destination that doesn't exist otherwise your proxy will try and repeat many time before failure which causes a load.

Another way is to forward to a
DEVULL that you set up that has a host that doesn't exist on your network

however modify the connection exception parameter

dcmRetryNum to 0

This is done with the following config

<node name="dcmRetry">
<map/>
<node name="AssociationStateException">
<map>
<entry key="dcmDeleteAfterFinalRetry" value="true"/>
<entry key="dcmRetryDelay" value="1"/>
<entry key="dcmRetryNum" value="0"/>
<entry key="dcmRetryObject" value="AssociationStateException"/>
</map>
</node>
<node name="ConnectionException">
<map>
<entry key="dcmDeleteAfterFinalRetry" value="true"/>
<entry key="dcmRetryDelay" value="1"/>
<entry key="dcmRetryNum" value="0"/>
<entry key="dcmRetryObject" value="ConnectionException"/>
</map>
</node>
</node>

Second is to have the following xsl in your configuration path for JBoss.


<
xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output method="xml"/>
<xsl:template match="/NativeDicomModel">
<Result>
<xsl:choose>
        <xsl:when test="DicomAttribute[@tag='00080060']/Value = 'US'">
<Destination aet="MY_AE_TITLE_1"/>

</xsl:when>
<xsl:otherwise>
<Destination aet="DEVNULL"/>
</xsl:otherwise>
</xsl:choose>
</Result>
</xsl:template>
</xsl:stylesheet>

Third you need to setup one single forward rule that looks like the following:

<node name="dcmForwardRule">
<map/>
<node name="MyRule">
<map>
<entry key="cn" value="MyRule"/>
<entry key="dicomDescription" value="Example ForwardRule"/>
<entry key="labeledURI.#" value="1"/>
<entry key="labeledURI.1" value="${jboss.server.config.url}/dcm4chee-proxy/myxslrule.xml"/>
</map>
</node>
</map>
</node>

Now all modality of type US will be accepted and forwarded to destination My_AETITLE_1 and everything else dropped.

Regards,
Hesham
Reply all
Reply to author
Forward
0 new messages