Attribute Coercion - Polish special characters in MWL response

191 views
Skip to first unread message

Wiktor P

unread,
Jul 25, 2022, 6:41:20 AM7/25/22
to dcm4che
Hi All,

Your support with below issue will be greatly appreciated :)

Software versions:
dcm4chee-arc 5.13.1
findscu from pynetdiacom (https://pydicom.github.io/pynetdicom/stable/apps/findscu.html) (also tested on findscu from binaries)

Goal:
Set attribute coercion to replace polish special characters in FIND responses (e.g. Patient Root Query/Retrieve Information Model and Modality Worklist Information Model)
Attribute coercion will be set only for C-FIND RSP, I don't want to permanently modify the data. Medical device itself needs to show data without polish special characters to avoid
decoding errors.


Steps to reproduce:
1. Attribute coercion was added to Archive Device - settings are visible on the attached screenshot.

2. XSL stylesheet was added to Vendor Data and uploaded - stylesheet url was verified (file exists and was loaded correctly)

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="@*|node()">
    <xsl:copy>
        <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
</xsl:template>

<xsl:template match="DicomAttribute[@tag='00100010']/PersonName/Alphabetic/FamilyName">
<FamilyName>
      <xsl:value-of select="translate(.,'ąćęłńóśżźĄĆĘŁŃÓŚŻŹ','acelnoszzACELNOSZZ')"/>
</FamilyName>
</xsl:template>

<xsl:template match="DicomAttribute[@tag='00100010']/PersonName/Alphabetic/GivenName">
<GivenName>
      <xsl:value-of select="translate(.,'ąćęłńóśżźĄĆĘŁŃÓŚŻŹ','acelnoszzACELNOSZZ')"/>
</GivenName>
</xsl:template>

</xsl:stylesheet>


3. Following queries were executed:
a) python -m pynetdicom findscu HOST PORT --called-aet AET -k QueryRetrieveLevel=PATIENT -k PatientName="Kłos^Tomasz"

Returns "Klos^Tomasz" -> this is expected behaviour of applied transformation (replaced 'ł' to 'l' in this case).
Status: OK

b) python -m pynetdicom findscu HOST PORT --called-aet AET -k PatientName="Kłos^Tomasz" -W        (query worklist items)
Response returns "Kłos^Tomasz" - transformation was not applied !
Status: Failure

Summary:
What is the reason the xsl transformation is not working on MWL responses? (see point 3b)
It is working perfectly fine when applied to Patient level instead of MWL level.
I expect that added attribute coercion should work in all listed cases.


Best regards,
Wiktor
attribute coercion - screen.PNG

Vrinda Nayak

unread,
Jul 25, 2022, 9:28:06 AM7/25/22
to dcm4che
You may check with dcm4che library toolkit's findscu tool - the results are as expected (used your stylesheet)
attrCoercionConfig.png
study.png
findscu-tool-results.png
mwl.png

Wiktor P

unread,
Jul 27, 2022, 5:00:23 AM7/27/22
to dcm4che
I tried to use the original findscu tool as you suggested, below are the results.
Unfortunately, it still doesn't work - which is a really strange case given the proper xls file.

Following command was run in Windows cmd line using findscu from version 5.13.1 (matching with deployed dcm4chee version) and 5.26.1 as well.
This test case is connected with name "Kwiatek Róża", which should be transformed to "Kwiatek Roza".


.\findscu -M MWL -b DCM4CHEE -c DCM4CHEE@HOST:PORT -r PatientName

Using findscu from dcm4che-5.13.1-bin generates the following dataset:
10:42:14,300 DEBUG - Dataset:
(0008,0005) CS [ISO_IR 192] SpecificCharacterSet
(0010,0010) PN [Kwiatek^Róża] PatientName

Using findscu from dcm4che-5.26.1-bin generates the following dataset:
10:33:16.041 DEBUG - DCM4CHEE->DCM4CHEE(1) >> 1:C-FIND-RSP Dataset:
(0008,0005) CS [ISO_IR 192] SpecificCharacterSet
(0010,0010) PN [Kwiatek^R├│┼╝a] PatientName

**********************************************************************************
Moreover, may I get your advice on the matter below?

.\findscu -M PatientRoot -b DCM4CHEE -c DCM4CHEE@HOST:PORT -r PatientName

I expect this command to change the QueryRetrieveLevel from Study (default) to Patient.
However in debug message Study as QueryRetrieveLevel is still present:

10:44:38,286 DEBUG - Dataset:
(0008,0052) CS [STUDY] QueryRetrieveLevel

Do you know what could be the reason of this behaviour?

Vrinda Nayak

unread,
Jul 27, 2022, 5:15:26 AM7/27/22
to dcm4che
See the findscu tool help
-L <PATIENT|STUDY|SERIES|IMAGE>          specifies retrieve level. Use
                                                                                    STUDY for PatientRoot,
                                                                                    StudyRoot, PatientStudyOnly by
                                                                                    default.
-M <name>                                                             specifies Information Model.
                                                                                   Supported names: PatientRoot,
                                                                                   StudyRoot, PatientStudyOnly,
                                                                                   MWL, UPSPull, UPSWatch,
                                                                                   UPSQuery, HangingProtocol or
                                                                                   ColorPalette. If no Information
                                                                                   Model is specified, StudyRoot
                                                                                   will be used.

As for (0010,0010) PN [Kwiatek^R├│┼╝a] PatientName, check first Patient Name stored on creation of MWL in archive

Wiktor P

unread,
Jul 28, 2022, 5:44:22 AM7/28/22
to dcm4che
Yes, regarding the second issue using -L helped, thanks :)

Regarding the transformation issue, value visible in the user interface was attached. It is stored in archive with Polish letters, which is as expected as we only want to modify the data when reading from archive.

Findscu doesn't show properly transformed output in both cases, however it shows incorrect characters only in findscu 5.26.1 and correct ones (however not transformed!) in version 5.13.1 - and this is strange given the query was run on the same dataset.
From_GUI.png

Vrinda Nayak

unread,
Jul 28, 2022, 7:07:18 AM7/28/22
to dcm4che
Are you sure you are really using dcm4che toolkit's findscu tool and not the same tool prepackaged by some other software? Not reproducible with findscu (dockerized) tool - checked also for "Kwiatek Róża". See attached.
findscu-docker.png
findscu.png
KwiatekRóża-patientInArchive.png
Message has been deleted

Wiktor P

unread,
Jul 28, 2022, 7:25:08 AM7/28/22
to dcm4che
I downloaded the tools using recommended link from the Github repo for binaries: https://github.com/dcm4che/dcm4che/blob/master/README.md

And get the files for both versions from this directory: https://sourceforge.net/projects/dcm4che/files/dcm4che3/

Vrinda Nayak

unread,
Jul 28, 2022, 7:42:41 AM7/28/22
to dcm4che
Looking at the screenshot from one of your last posts, it seems you are using quite an old version of the archive. I tested your stylesheet and coercion on my local system with the latest archive version. While this part of the code (coercion using stylesheets) has not been changed for a long time, as a test you may run a base minimum version of archive following Running minimum set of archive services on a single host and retest.
Reply all
Reply to author
Forward
0 new messages