Query / Retrieve Worklist

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
ROGERBP
Posts: 14
Joined: Fri, 2007-03-02, 18:21

Query / Retrieve Worklist

#1 Post by ROGERBP »

Hi,

Do you have any example of how to query a worklist SCP and manage the answer?

Exemple: I´d like to know how many patients have been scheduled for XA modality today. How can I create this question, send to SCP and get the answer to show a list to the user?

thanks

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1446
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#2 Post by Marco Eichelberg »

On command line level, copy/paste the following into a text file and convert into a DICOM file using dump2dcm:

Code: Select all

(0008,0050) SH    []                                                        #     6,  1  AccessionNumber
(0010,0010) PN    []                                                        #     6,  1  PatientName
(0010,0020) LO    []                                                        #     6,  1  PatientID
(0010,0030) DA    []                                                        #     8,  1  PatientBirthDate
(0010,0040) CS    []                                                        #     2,  1  PatientSex
(0010,2000) LO    []                                                        #    18,  2  MedicalAlerts
(0010,2110) LO    []                                                        #    12,  2  ContrastAllergies
(0020,000d) UI    []                                                        #    38,  1  StudyInstanceUID
(0032,1032) PN    []                                                        #    10,  1  RequestingPhysician
(0032,1060) LO    []                                                        #     8,  1  RequestedProcedureDescription
(0040,0100) SQ                                                              #   250,  1  ScheduledProcedureStepSequence
    (fffe,e000) na                                                              #   242,  1  Item
        (0008,0060) CS    [XA]                                                        #     2,  1  Modality
        (0032,1070) LO    []                                                        #     6,  1  RequestedContrastAgent
        (0040,0001) AE    []                                                        #     8,  2  ScheduledStationAETitle
        (0040,0002) DA    []                                                        #     8,  1  ScheduledProcedureStepStartDate
        (0040,0003) TM    []                                                        #     6,  1  ScheduledProcedureStepStartTime
        (0040,0006) PN    []                                                        #     8,  1  ScheduledPerformingPhysiciansName
        (0040,0007) LO    []                                                        #     8,  1  ScheduledProcedureStepDescription
        (0040,0009) SH    []                                                        #     8,  1  ScheduledProcedureStepID
        (0040,0010) SH    []                                                        #     6,  2  ScheduledStationName
        (0040,0011) SH    []                                                        #     4,  1  ScheduledProcedureStepLocation
        (0040,0012) LO    []                                                        #    16,  1  PreMedication
        (0040,0400) LT    []                                                        #    30,  1  CommentsOnTheScheduledProcedureStep
    (fffe,e00d) na    (ItemDelimitationItem for re-encoding)                    #     0,  1  ItemDelimitationItem
(fffe,e0dd) na    (SequenceDelimitationItem for re-enc.)                    #     0,  1  SequenceDelimitationItem
(0040,1001) SH    []                                                        #     6,  1  RequestedProcedureID
(0040,1003) SH    []                                                        #     4,  1  RequestedProcedurePriority
Then use findscu to send this as a query to the Worklist SCP:

Code: Select all

findscu --verbose --call THEIR_AETITLE --aetitle OUR_AETITLE hostname port query.dcm
On API level, look at the source code for findscu - this implements exactly what you need. Each worklist entry will be one incoming DICOM dataset (DcmDataset object) that you need to process and display to the user.

ROGERBP
Posts: 14
Joined: Fri, 2007-03-02, 18:21

#3 Post by ROGERBP »

Thank you very much

ROGERBP
Posts: 14
Joined: Fri, 2007-03-02, 18:21

#4 Post by ROGERBP »

Could tell me how to build this query at API level?

ROGERBP
Posts: 14
Joined: Fri, 2007-03-02, 18:21

#5 Post by ROGERBP »

Sorry, I´ve already found out how to do that.
I´d like to know where are de dataset´s from the answer.
Are they in the callback function?

ROGERBP
Posts: 14
Joined: Fri, 2007-03-02, 18:21

#6 Post by ROGERBP »

I´d like to know where are de dataset´s from the answer.
Are they in the callback function?
I´ve found that too.
Now, one more doubt, how can I do to query the SCP for studies scheduled from one date to another.
Example: I´d like to know how many patients have been scheduled for XA modality from 07/01/2007 to 07/31/2007.

Markus Sabin
Posts: 99
Joined: Tue, 2005-07-12, 13:50
Location: Erlangen, Germany

#7 Post by Markus Sabin »

Format for date-span in DICOM:

20070701-20070731

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1446
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#8 Post by Marco Eichelberg »

This thread is an excellent example for the fact that sometimes it is helpful not to answer immediately to questions in the forum :wink:

ROGERBP
Posts: 14
Joined: Fri, 2007-03-02, 18:21

#9 Post by ROGERBP »

Sorry,

But some times, we simply don´t how long it´ll take to come to an answer

Post Reply

Who is online

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