Configuring DCM4CHEE to coerce anonymization

756 views
Skip to first unread message

Joey

unread,
Nov 11, 2016, 6:47:34 AM11/11/16
to dcm...@googlegroups.com
Hello,

I've read this topic, but don't quite understand how it works yet:

Where can I find more information about how coercion with cstorerq.xls works exaclty?

I'd like to anonymize a few attributes such as the patient name when the PACS receives scans, is this possible with coercion?
Or does it work the other way around? that is, certain attributes are transformed to another value when a scan is requested?

Thank you



Joey

unread,
Nov 11, 2016, 9:13:50 AM11/11/16
to dcm4che
I tried the following sheet in hopes of changing the Patient Name, but the name does not change:

<?xml version="1.0" encoding="UTF-8"?>
<!--
Sample C-STORE-RQ attribute coercion for copying request attributes exported
on root level to item of Request Attributes Sequence (0040,0275), which is
extracted into DB series record by default attribute filter configuration.
Therefore request attributes becomes available by DICOM Query C-FIND on
SERIES level.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 
<xsl:output method="xml" indent="no"/>
 
<!-- overwritten by application with actual values -->
 
<xsl:param name="calling" select="'SAMPLE_MOD'"/>
 
<xsl:param name="called" select="'DCM4CHEE'"/>
 
<xsl:param name="date" select="'20051206'"/>
 
<xsl:param name="time" select="'115600.000'"/>
 
<xsl:template match="/dataset">
   
<dataset>
       
<attr tag="001000010" vr="PN">TESTANON</attr>
   
</dataset>
 
</xsl:template>
</xsl:stylesheet>

I tried placing the cstorerq.xsl in:
dcm4chee/server/default/conf/dcm4chee-ae/MOD_AET/DCM4CHEE/

and after that in:
dcm4chee/server/default/conf/dcm4chee-ae/DCM4CHEE/

I restarted the server and did clearCache() under service=Templates after each attempt.

Any ideas?
And.. how to find out if the coerce sheet is being used?

Joey

unread,
Nov 11, 2016, 9:19:42 AM11/11/16
to dcm...@googlegroups.com
I suddenly remember I read something about this "CoerceBeforeWrite" option, where can I find this?

Edit: aha.. of course under service=StoreScp
Back to trying..

Edit: No luck unfortunately. Can anyone elaborate on how this directory should be named? is it just the $AET, or MOD_$AET?
And should it be inside this directory or on the same level as the default MOD_AE directory, i.e. in the dcm4chee-ae directory?


On Friday, November 11, 2016 at 12:47:34 PM UTC+1, Joey wrote:

Joey

unread,
Nov 11, 2016, 12:22:01 PM11/11/16
to dcm4che
Well, even when there is a cstorerq.xsl in the CoerceConfigDirectory, no changes are made.

fleetwoodfc

unread,
Nov 11, 2016, 9:39:41 PM11/11/16
to dcm4che
If you place in dcm4chee/server/default/conf/dcm4chee-ae it will apply the coercion to objects received from any source AET (Calling AE). For a specific source AE then create a folder with Calling AE name e.g. if you receive from AE TEST1 then create  dcm4chee/server/default/conf/dcm4chee-ae/TEST1/cstorerq.xsl 

fleetwoodfc

unread,
Nov 12, 2016, 10:52:35 AM11/12/16
to dcm4che
Your server.log should provide more information - e.g it logs if an attribute is changed. You can also set 'WriteCoercionXmlLog'  for service=StoreSCP to capture the actual xml generated.

Joey

unread,
Nov 12, 2016, 1:23:39 PM11/12/16
to dcm...@googlegroups.com
Thank you for your reply fleetwoodfc,
Can the tools of the dcm4che toolkit behave like a calling AE?
In other words, does coercion works when sending objects using the dcm4che toolkit's dcmsnd or storescu?

Edit:
I used the -L option and provided an arbitrary AET, TESTAET.
I think that seems to work, because the object is successfully sent to the "remote" AET and the output and logs now contain TESTAET->DCM4CHEE lines.
But, no coercion takes place with cstorerq.xsl being directly in dcm4chee-ae/.

Now I am also wondering what the role of dcm4chee-attribute-filter.xml is in this.

Joey

unread,
Nov 13, 2016, 9:40:37 AM11/13/16
to dcm...@googlegroups.com
Okay, this is emberrasing to say, but I made a typo in the template.
0010 0010, there was an extra zero in there somewhere.. you can see it in my second post.

After changing that, coercion happens, even without the -L option.

Edit:
So, coercion only changes data base entries, not the actual file is that correct?
I'd like to change the actual file so viewers won't display the patient name, etc.
Is this configurable?

On Friday, November 11, 2016 at 12:47:34 PM UTC+1, Joey wrote:

fleetwoodfc

unread,
Nov 14, 2016, 5:52:33 AM11/14/16
to dcm...@googlegroups.com
Do you have CoerceBeforeWrite set to true ?
 
p.s If the Viewer uses DICOM Q/R or WADO then the retrieved object should be the coerced version and not the original file.
Also use the -device option to change the Calling AE on dcmsnd.  

Joey

unread,
Nov 15, 2016, 5:39:32 AM11/15/16
to dcm4che
I have resorted to dcmsnd's -set option for now.
I think the viewer I use has some sort of cache, and insists on displaying the Patient Name if it's a scan I viewed prior to coercion / replacing attribute values.
Only when I upload new files of another test studycase I can see the replaced attribute value.

I am still curious about dcmsnd -a, but that might be another topic. I got what I was looking for now.
Thank you for your help.
Reply all
Reply to author
Forward
0 new messages