findscu -Key Attributes - nested tags

161 views
Skip to first unread message

Nico

unread,
Jun 25, 2018, 11:48:58 PM6/25/18
to dcm...@googlegroups.com

Hi All,

How can I modify a value for a nested tag while building the KEY Attribute for findscu ?

           keys.setString(Tag.QueryRetrieveLevel, VR.CS, "STUDY");          
           keys
.setString(Tag.StudyInstanceUID, VR.UI);
           keys
.setString(Tag.PatientName, VR.PN);
           keys
.setString(Tag.PatientID, VR.LO);
           keys
.setString(Tag.AccessionNumber,VR.SH);

The tag I want to modify is ScheduledProcedureStepStartDate like this "20060705-20190707"

I've tried this , but wont work since it is a nested tag   (Parent tag :ScheduledProcedureStepSequence)

keys.setString(Tag.ScheduledProcedureStepStartDate, VR.DA,"20060705-20190707");

I also tried the next lines, but they wont allow me to set date tag
           keys.ensureSequence(Tag.ScheduledProcedureStepSequence,0);
           keys
.newSequence(Tag.ScheduledProcedureStepSequence,Tag.ScheduledProcedureStepStartDate);

Does anyone know how to setString for this nested tag? ScheduledProcedureStepStartDate

Regards,
Nicolás

Prakash Jayaraman

unread,
Jun 26, 2018, 5:38:51 AM6/26/18
to dcm...@googlegroups.com
You have to create separate dataset (tag object) for SPS Sequence and add it to Tag.ScheduledProcedureStepSequence object.

On Tue, Jun 26, 2018 at 9:19 AM Nico <nicola...@gmail.com> wrote:

Hi All,

How can I set a value for a nested tag while building the KEY Attribute for findscu ?

--
You received this message because you are subscribed to the Google Groups "dcm4che" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dcm4che+u...@googlegroups.com.
To post to this group, send email to dcm...@googlegroups.com.
Visit this group at https://groups.google.com/group/dcm4che.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Nico

unread,
Jun 26, 2018, 10:10:29 PM6/26/18
to dcm4che
Hi Prakash Jayaraman,

I'm trying your suggestion.

Thank you!

Regards,
Nicolás

Nico

unread,
Jun 26, 2018, 10:45:29 PM6/26/18
to dcm...@googlegroups.com

Thank you  Prakash Jayaraman,

I tried your suggestion , like the following

Attributes keys = new Attributes();          
keys.setString(Tag.QueryRetrieveLevel, VR.CS, "STUDY");          
keys
.setString(Tag.StudyInstanceUID, VR.UI);
keys
.setString(Tag.PatientName, VR.PN);
keys
.setString(Tag.PatientID, VR.LO);
keys
.setString(Tag.AccessionNumber, VR.SH);


//
 
Attributes  scheduledProcedure = new Attributes();//Building new dataset (nested tags)
 
Sequence seq = keys.newSequence(Tag.ScheduledProcedureStepSequence, 0);//Building a sequence within the main dataset
  scheduledProcedure
.setString(Tag.ScheduledProcedureStepStartDate, VR.DA, "20180516-20180516");//Modifying the a tag within the new dataset.
  seq
.add(scheduledProcedure);//adding the new Dataset to the main dataset.



Result :
 
23:41:02,147 DEBUG - Dataset:
(0008,0050) SH [] AccessionNumber
(0008,0052) CS [STUDY] QueryRetrieveLevel
(0010,0010) PN [] PatientName
(0010,0020) LO [] PatientID
(0020,000D) UI [] StudyInstanceUID

(0040,0100) SQ [1 Items] ScheduledProcedureStepSequence
>Item #1
>(0040,0002) DA [20180516-20180516] ScheduledProcedureStepStartDate

Is this what you meant ? any suggestion ... is welcome.

Thank you again,

Regards,
Nico

Prakash Jayaraman

unread,
Jun 27, 2018, 1:43:10 AM6/27/18
to dcm...@googlegroups.com
Yes, you are almost there. I think you have to set the sequence in to the key like keys.newSequence(Tag.ScheduledProcedureStepSequence, scheduledProcedure) - Here instead of values you will need to set sequence dataset. 

I haven't tested it. I'm telling this from my past MWL programming using dcm4che 2.x.

On Wed, Jun 27, 2018 at 8:15 AM Nico <nicola...@gmail.com> wrote:

Thank you  Prakash Jayaraman,

I tried your suggestion , like the following

Attributes keys = new Attributes();          
keys.setString(Tag.QueryRetrieveLevel, VR.CS, "STUDY");          
keys
.setString(Tag.StudyInstanceUID, VR.UI);
keys
.setString(Tag.PatientName, VR.PN);
keys
.setString(Tag.PatientID, VR.LO);
keys
.setString(Tag.AccessionNumber,VR.SH);


//
 
Attributes  scheduledProcedure = new Attributes();//Building new dataset (nested tags)

 
Sequence seq = keys.newSequence(Tag.ScheduledProcedureStepSequence,0);//Building a sequence within the main dataset
  scheduledProcedure
.setString(Tag.ScheduledProcedureStepStartDate, VR.DA, "20060705-20000707");//Modifying the a tag within the new dataset.

  seq
.add(scheduledProcedure);//adding the new Dataset to the main dataset.



Result :
 
23:41:02,147 DEBUG - Dataset:
(0008,0050) SH [] AccessionNumber
(0008,0052) CS [STUDY] QueryRetrieveLevel
(0010,0010) PN [] PatientName
(0010,0020) LO [] PatientID
(0020,000D) UI [] StudyInstanceUID

(0040,0100) SQ [1 Items] ScheduledProcedureStepSequence
>Item #1
>(0040,0002) DA [20060705-20000707] ScheduledProcedureStepStartDate

Is this what you meant ? any suggestion ... is welcome.

Thank you again,

Regards,
Nico

--

Nico

unread,
Jun 27, 2018, 7:18:45 PM6/27/18
to dcm...@googlegroups.com
Hi Prakash Jayaraman,

I think you mean this :

Attributes  scheduledProcedure = new Attributes();

scheduledProcedure
.setString(Tag.Modality, VR.CS);
keys
.newSequence(Tag.ScheduledProcedureStepSequence,0).add(scheduledProcedure);

I was searching code examples in dcm4che-tools and weasis and I found this :


   
private static void addReferencedPerformedProcedureStepSequence(String mppsiuid,
           
StoreSCU storescu) {
       
Attributes attrs = storescu.getAttributes();
       
Sequence seq = attrs.newSequence(Tag.ReferencedPerformedProcedureStepSequence, 1);
       
Attributes item = new Attributes(2);
        item
.setString(Tag.ReferencedSOPClassUID, VR.UI, UID.ModalityPerformedProcedureStepSOPClass);
        item
.setString(Tag.ReferencedSOPInstanceUID, VR.UI, mppsiuid);
        seq
.add(item);
   
}

I think I will stick to this way.

Regards,
Nicolás

Nico

unread,
Jun 28, 2018, 12:38:13 AM6/28/18
to dcm...@googlegroups.com
Now I'm facing an issue that I think I will post in a new  thread,

When I setString the PatientID tag with a value like 3000, dcm4chee pacs returns all the Worklist entries instead of the desired of just the desired one.

keys.setString(Tag.PatientID, VR.LO,"3000");        
keys
.setString(Tag.PatientName, VR.PN);
keys
.setString(Tag.AccessionNumber,VR.SH);


The Pacs returns :

(0008,0050) SH [223.1] AccessionNumber
(0010,0010) PN [SACH^MARTIN] PatientName
(0010,0020) LO [M4001] PatientID
-----------------------------
(0008,0050) SH [1189.2] AccessionNumber
(0010,0010) PN [BIACHELLA^MAXIMILIANO] PatientName
(0010,0020) LO [3000] PatientID

I am probably missing something.

Regards,
Reply all
Reply to author
Forward
0 new messages