Query www.dicomserver.co.uk's ExamDateAndTime

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Toeger
Posts: 5
Joined: Mon, 2023-06-05, 15:58

Query www.dicomserver.co.uk's ExamDateAndTime

#1 Post by Toeger »

I'm writing a program that queries a modality worklist via DCMTK. I'm using https://www.dicomserver.co.uk/Home/MWLTestData as a test server. I can successfully query the patient name, accession number and some other fields, but so far I failed to figure out how to get what is labeled "ExamDateAndTime". To get the patient name, I give the key DCM_PatientName, to get "DateOfBirth" I use DCM_PatientBirthDate, and those work fine. However, there is no DCM_ExamDateTime. The closest I found is DCM_ScheduledProcedureStepStartDateTime, but that doesn't return any data. I assume that it's simply unknown and optional/empty.

How can I retrieve the examination/procedure date/time?

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

Re: Query www.dicomserver.co.uk's ExamDateAndTime

#2 Post by Marco Eichelberg »

The attributes you are looking for are called Scheduled Procedure Step Start Date (0040,0002) and Scheduled Procedure Step Start Time (0040,0003). However, these attributes are not present in the main dataset, but encapsulated in the Scheduled Procedure Step Sequence (0040,0100). Try adding an empty Scheduled Procedure Step Sequence to the query dataset.

Toeger
Posts: 5
Joined: Mon, 2023-06-05, 15:58

Re: Query www.dicomserver.co.uk's ExamDateAndTime

#3 Post by Toeger »

I used the keys

Code: Select all

        DCM_AccessionNumber,
        DCM_InstitutionName,
        DCM_PatientName,
        DCM_PatientID,
        DCM_PatientBirthDate,
        DCM_PatientSex,
        DCM_ScheduledProcedureStepDescription,
        DCM_ScheduledProcedureStepLocation,
        DCM_ScheduledProcedureStepID,
        DCM_ScheduledProcedureStepModificationDateTime,
        DCM_ScheduledProcedureStepSequence,
        DCM_ScheduledProcedureStepStartDateTime,
        DCM_ScheduledProcedureStepStartDate,
        DCM_Modality,
and received as the first result (using responseIdentifiers->print(std::cout);)

Code: Select all

# Dicom-Data-Set
# Used TransferSyntax: Little Endian Explicit
(0008,0050) SH [125 ]                                   #   4, 1 AccessionNumber
(0008,0080) LO [Test Hospital ]                         #  14, 1 InstitutionName
(0010,0010) PN [Bowen^William^^Dr ]                     #  18, 1 PatientName
(0010,0020) LO [PAT004]                                 #   6, 1 PatientID
(0010,0030) DA [19560807]                               #   8, 1 PatientBirthDate
(0010,0040) CS [M ]                                     #   2, 1 PatientSex
It seems like I cannot get any ScheduledProcedureStep part. Also the Modality is missing.

Additionally I'm getting this output to stderr:

Code: Select all

I: Requesting Association
I: Association Accepted (Max Send PDV: 65524)
I: Sending Find Request (MsgID 1)
I: Request Identifiers:
I: 
I: # Dicom-Data-Set
I: # Used TransferSyntax: Little Endian Explicit
I: (0008,0050) SH (no value available)                     #   0, 0 AccessionNumber
I: (0008,0060) CS (no value available)                     #   0, 0 Modality
I: (0008,0080) LO (no value available)                     #   0, 0 InstitutionName
I: (0010,0010) PN (no value available)                     #   0, 0 PatientName
I: (0010,0020) LO (no value available)                     #   0, 0 PatientID
I: (0010,0030) DA (no value available)                     #   0, 0 PatientBirthDate
I: (0010,0040) CS (no value available)                     #   0, 0 PatientSex
I: (0040,0002) DA (no value available)                     #   0, 0 ScheduledProcedureStepStartDate
I: (0040,0007) LO (no value available)                     #   0, 0 ScheduledProcedureStepDescription
I: (0040,0009) SH (no value available)                     #   0, 0 ScheduledProcedureStepID
I: (0040,0011) SH (no value available)                     #   0, 0 ScheduledProcedureStepLocation
I: (0040,0100) SQ (Sequence with explicit length #=0)      #   0, 1 ScheduledProcedureStepSequence
I: (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) #   0, 0 SequenceDelimitationItem
I: (0040,4005) DT (no value available)                     #   0, 0 ScheduledProcedureStepStartDateTime
I: (0040,4010) DT (no value available)                     #   0, 0 ScheduledProcedureStepModificationDateTime
I: 
which I don't understand, since clearly the patient name is available and gets printed correctly.
Ah, I think I understand. It's printing the request data, not the reply data, and it's saying I did not request a specific patient name. If I had supplied a patient name I would presumably only receive entries for that patient from the worklist, which makes more sense to get for example today's scheduled procedures only, not the entire history. Though I'm passing the list as the overrideKeys to DcmFindSCU::performQuery which is a OFList<OFString>, so not sure how to add the value to that.

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

Re: Query www.dicomserver.co.uk's ExamDateAndTime

#4 Post by Marco Eichelberg »

What you are seeing there is indeed the query (C-FIND request). You are basically querying for everything, so you get all worklist items as response.

My understanding of class DcmFindSCU is that the syntax for the override keys is the same as the one used in the findscu command line tool, i.e. "(0010,0010)=SMITH*" or "PatientName=SMITH*" would be valid override key strings.

Toeger
Posts: 5
Joined: Mon, 2023-06-05, 15:58

Re: Query www.dicomserver.co.uk's ExamDateAndTime

#5 Post by Toeger »

The Tag=Value syntax works, thanks!
I'll see if I can make a minimal example for the ScheduledProcedure issue.

Post Reply

Who is online

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