Puzzling MWL query result in production vs. test environment

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
vrogers
Posts: 4
Joined: Tue, 2021-02-16, 07:39

Puzzling MWL query result in production vs. test environment

#1 Post by vrogers »

Hello,

I successfully implemented a MWL query in our hospital's test environment.
Now that I'm moving into the production environment, the MWL query is returning a slightly different format, which I find puzzling. I don't know if it has to do with my query, or if it is due to a difference in the way the worklists are implemented in our test environment compared to the production environment. In the production environment, the query result contains two ScheduledProcedureStepStartDate elements, one of which is contained in the ScheduledProcedureStepSequence, and the other is outside of the sequence.

Does anyone know what causes the different results?
Thanks in advance!

My query is as follows:

Code: Select all

findscu -W -k "(0040,0002)=[20210322]"  -Xs mwlresults_20210322.xml -aec xxx <port> <IP> mwlquery.dcm
The mwlquery.dcm file contains:

Code: Select all

# Worklist query
#
(0010,0010) PN []                                       # PatientName
(0010,0020) LO []                                       # PatientID
(0032,1064) SQ                                          # RequestedProcedureCodeSequence
  (fffe,e000) na                                          # Item
    (0008,0104) LO []                                       # CodeMeaning
  (fffe,e00d) na (ItemDelimitationItem for re-encoding)   # ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # SequenceDelimitationItem
(0040,0100) SQ                                          # ScheduledProcedureStepSequence
  (fffe,e000) na                                          # Item
    (0008,0060) CS [PT]                                     # Modality
    (0040,0001) AE []                                       # ScheduledStationAETitle
    (0040,0002) DA []                                       # ScheduledProcedureStepStartDate
    (0040,0003) TM []                                       # ScheduledProcedureStepStarTime
    (0040,0007) LO []                                       # ScheduledProcedureStepDescription
    (0040,0020) CS []                                       # ScheduledProcedureStepStatus 
  (fffe,e00d) na (ItemDelimitationItem for re-encoding)   # ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # SequenceDelimitationItem
Here's an example of results in the test environment:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<responses type="C-FIND">
<data-set xfer="1.2.840.10008.1.2" name="Little Endian Implicit">
<element tag="0008,0005" vr="CS" vm="1" len="10" name="SpecificCharacterSet">ISO_IR 192</element>
<element tag="0010,0010" vr="PN" vm="1" len="18" name="PatientName">xxxx</element>
<element tag="0010,0020" vr="LO" vm="1" len="10" name="PatientID">xxxx</element>
<sequence tag="0032,1064" vr="SQ" card="1" name="RequestedProcedureCodeSequence">
<item card="1">
<element tag="0008,0104" vr="LO" vm="1" len="18" name="CodeMeaning">NM PET WHOLE BODY</element>
</item>
</sequence>
<sequence tag="0040,0100" vr="SQ" card="1" name="ScheduledProcedureStepSequence">
<item card="6">
<element tag="0008,0060" vr="CS" vm="1" len="2" name="Modality">PT</element>
<element tag="0040,0001" vr="AE" vm="1" len="6" name="ScheduledStationAETitle">xxxx</element>
<element tag="0040,0002" vr="DA" vm="1" len="8" name="ScheduledProcedureStepStartDate">20210311</element>
<element tag="0040,0003" vr="TM" vm="1" len="4" name="ScheduledProcedureStepStartTime">0740</element>
<element tag="0040,0007" vr="LO" vm="1" len="18" name="ScheduledProcedureStepDescription">NM PET WHOLE BODY</element>
<element tag="0040,0020" vr="CS" vm="1" len="10" name="ScheduledProcedureStepStatus">SCHEDULED</element>
</item>
</sequence>
</data-set>
And here is a result from the production environment (note the extra ScheduledProcedureStepStartDate between the RequestedProcedureCodeSequence and the ScheduledProcedureStepSequence):

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<responses type="C-FIND">
<data-set xfer="1.2.840.10008.1.2" name="Little Endian Implicit">
<element tag="0008,0005" vr="CS" vm="1" len="10" name="SpecificCharacterSet">ISO_IR 192</element>
<element tag="0010,0010" vr="PN" vm="1" len="14" name="PatientName">xxxx</element>
<element tag="0010,0020" vr="LO" vm="1" len="10" name="PatientID">xxxx</element>
<sequence tag="0032,1064" vr="SQ" card="1" name="RequestedProcedureCodeSequence">
<item card="1">
<element tag="0008,0104" vr="LO" vm="1" len="18" name="CodeMeaning">NM PET WHOLE BODY</element>
</item>
</sequence>
<element tag="0040,0002" vr="DA" vm="1" len="8" name="ScheduledProcedureStepStartDate">20210322</element>
<sequence tag="0040,0100" vr="SQ" card="1" name="ScheduledProcedureStepSequence">
<item card="6">
<element tag="0008,0060" vr="CS" vm="1" len="2" name="Modality">PT</element>
<element tag="0040,0001" vr="AE" vm="1" len="6" name="ScheduledStationAETitle">xxxx</element>
<element tag="0040,0002" vr="DA" vm="1" len="8" name="ScheduledProcedureStepStartDate">20210322</element>
<element tag="0040,0003" vr="TM" vm="1" len="4" name="ScheduledProcedureStepStartTime">1020</element>
<element tag="0040,0007" vr="LO" vm="1" len="18" name="ScheduledProcedureStepDescription">NM PET WHOLE BODY</element>
<element tag="0040,0020" vr="CS" vm="1" len="10" name="ScheduledProcedureStepStatus">SCHEDULED</element>
</item>
</sequence>
</data-set>

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Puzzling MWL query result in production vs. test environment

#2 Post by Michael Onken »

Hi,

the problem is in your query:

In the query file you have Scheduled Procedure Step Start Date (empty) within the sequence. That is actually the place where it belongs to.

In your command line, however, you set the same attribute at main dataset level, i.e. outside the sequence, with a value (20210322). So the client will transmit the attribute two times, one time empty in the query file and one time in the wrong position (main level) with a value (btw: do not include square brackets for the value).

The server can handle this in two different ways: Either it sees the main level attribute as an optional element and removes it from the result (thus showing it does not support such an attribute there), or it even returns an error since it realizes that it is sent in the wrong place and cannot be correct. In your case, the testing server responds the first way (kicks it out), the production sever should probably send an error but wants to be nice and just returns those unknown attributes at the same position as in the query. So the server is not that strict since it probably does not want to irritate broken clients.

The right way to do the query is:

Code: Select all

findscu -W -k "ScheduledProcedureStepSequence[0].ScheduledProcedureStepStartDate=20210322" ....
You can also use the tag numbers but I find this more "speaking".

Best regards,
Michael

vrogers
Posts: 4
Joined: Tue, 2021-02-16, 07:39

Re: Puzzling MWL query result in production vs. test environment

#3 Post by vrogers »

Ahhh, I see. That makes sense.
Thank you so much, I really appreciate the explanation! :)

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest