I am building a DICOM client using the dcm4che3 library and it's a bit confusing to me how I'm supposed to create the dicom query. I'm calling the CFIND method on the Association
class.
I've figured out how to create a basic query (eg search by PatientID) as follows:
Attributes query = new Attributes();
query.setString(Tag.PatientID, VR.LO, "12345");
So far so good.
But when I want to query using something like ScheduledProcedureStepStartDate
, I have to create a Sequence with a sub query something like this:
Attributes query = new Attributes();
Sequence sequence = query.newSequence(Tag.ScheduledProcedureStepSequence, 1);
Attributes subQuery = new Attributes();
subQuery.setDate(Tag.ScheduledProcedureStepStartDate, VR.DA, date);
sequence.add(subQuery);
I don't know the DICOM format in detail. So I figured this out quite by trial and error and using another DICOM client emulator and intercepting it's queries to try and figure out how it works.
So from this I have 3 questions:
- How can I query for
ScheduledProcedureStepStartDate
between two dates (i.e. using a From and To date). - When creating the query, is it possible to have the dcm4che3 library figure out how to make the Sequences, so I can just specify the Tag, VR and value I want in the query?
- When I query using the Sequence elements (eg
ScheduledProcedureStepSequence
->Modality
) it doesn't seem to work. Is there any trick to make this work?