Getting Finding on a SR Document

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
paolom
Posts: 169
Joined: Tue, 2008-09-16, 15:02

Getting Finding on a SR Document

#1 Post by paolom »

Hi,

I need to retrieve the finding ( Code Value 121071) on a SR Document.

How can I iterate in the SR Doc and retrieve this information??

This is my code that doesn't work correctly

Code: Select all

        document.getTree().gotoRoot();
        do
        {
              // Print the code value of each node
             qDebug() << document.getTree().getCurrentContentItem().getCodeValue().getCodeValue().data();
            p = document.getTree().gotoNext();
            if ( p == 0 )
            {
                qDebug() << "------";
                p = document.getTree().goDown();
            }

        }
        while( p != 0 );
What's wrong or How can I make this?

Thanks

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

You could either use iterate() or gotoNamedNode().

paolom
Posts: 169
Joined: Tue, 2008-09-16, 15:02

#3 Post by paolom »

This is my code:

Code: Select all

    DcmFileFormat dcm;
    dcm.loadFile(sPath.toAscii());
    DSRDocument document;
    size_t p;
    if(document.read(*dcm.getDataset()).good())
    {
        document.getTree().gotoRoot();
        do
        {
            qDebug() << "Code Value: " <<  document.getTree().getCurrentContentItem().getCodeValue().getCodeValue().data();
            p = document.getTree().iterate();
        }
        while( p != 0 );
    }
The are 9 code value in the SR Document but the output show only two string and the others 7 are empty string.

How can I obtain correctly all the code value?!

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#4 Post by Jörg Riesmeier »

Could you please post the dsrdump (not dcmdump!) output of your SR document. Using option +Pc and +Pn would be helpful.

paolom
Posts: 169
Joined: Tue, 2008-09-16, 15:02

#5 Post by paolom »

Code: Select all

Basic Text SR Document

Patient            : xx^xx (M, 19721010, #40176568)
Manufacturer       : xx
Completion Flag    : COMPLETE
Verification Flag  : VERIFIED
                     20071017115300: xxx^Dott., xxx
Content Date/Time  : 20071017 115300

1  <CONTAINER:(18748-4,LN,"Referto di Diagnostica per Immagini")=CONTINUOUS>
1.1  <has concept mod CODE:(121049,DCM,"Lingua dei Contenuti")=(ita,ISO639_2,"Italiano")>
1.2  <has obs context CODE:(121005,DCM,"Tipo di Osservatore")=(121006,DCM,"Persona")>
1.3  <has obs context PNAME:(121008,DCM,"Osservatore")="xxx^Dott.">
1.4  <has obs context TEXT:(121009,DCM,"Organizzazione")="U.O. di Rad...">
1.5  <contains CONTAINER:(121062,DCM,"Richiesta")=CONTINUOUS>
1.5.1  <contains TEXT:(121062,DCM,"Richiesta")=" 19 TAC STADIAZIONE (L.)\n">
1.6  <contains CONTAINER:(121070,DCM,"Referti")=CONTINUOUS>
1.6.1  <contains TEXT:(121071,DCM,"Referto")=" TAC STADIAZIONE (L.) 20  \n...">

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#6 Post by Jörg Riesmeier »

This is what I expected: There are only two CODE content items (line 1.1 and 1.2).
If you want to access the Concept Name Code, you should use getConceptName() instead of getCodeValue().

paolom
Posts: 169
Joined: Tue, 2008-09-16, 15:02

#7 Post by paolom »

Thanks...this is the right code:

Code: Select all


    DcmFileFormat dcm;
    dcm.loadFile(sPath.toAscii());
    DSRDocument document;
    size_t p;
    if(document.read(*dcm.getDataset()).good())
    {
        document.getTree().gotoRoot();
        do
        {
            qDebug() << "Code value: " <<  document.getTree().getCurrentContentItem().getConceptName().getCodeValue().data();
                    
            p = document.getTree().iterate();
        }
        while( p != 0 );
   }

Post Reply

Who is online

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