0

Through the execution of findscu.exe, I am receiving following output, stored in a QByteArray. I want to extract/parse from the whole output the value of DIMSE Status.

I: Request Identifiers:
I: 
I: # Dicom-Data-Set
I: # Used TransferSyntax: Little Endian Explicit
I: (0002,0012) UI [1.2.276.0.100.1.1.1]                    #  20, 1 ImplementationClassUID
I: (0002,0013) SH [4214.0]                                 #   6, 1 ImplementationVersionName
I: (0008,0005) CS (no value available)                     #   0, 0 SpecificCharacterSet
I: (0008,0018) UI [1.2.276.0.7230010.3.1.4.3837053799.912.1265629243.1] #  52, 1 SOPInstanceUID
I: (0008,0052) CS [IMAGE]                                  #   6, 1 QueryRetrieveLevel
I: (0010,0010) PN [M Acc]                                  #  16, 1 PatientName
I: (0020,000d) UI [1.2.392.200036.9133.3.1.115178.2.20090710143458407] #  50, 1 StudyInstanceUID
I: (0020,000e) UI [1.2.392.200036.9133.3.1.115178.4.20100203133138039] #  50, 1 SeriesInstanceUID
I: 
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
W: Move response with error status (Failed: UnableToProcess)
I: Received Final Move Response
D: ===================== INCOMING DIMSE MESSAGE ====================
D: Message Type                  : C-MOVE RSP
D: Message ID Being Responded To : 1
D: Affected SOP Class UID        : MOVEStudyRootQueryRetrieveInformationModel
D: Remaining Suboperations       : 0
D: Completed Suboperations       : 0
D: Failed Suboperations          : 0
D: Warning Suboperations         : 0
D: Data Set                      : none
D: DIMSE Status                  : 0xc005: Error: Failed - Unable to process
D: ======================= END DIMSE MESSAGE =======================
I: Releasing Association
-------------------------------
error:
===============================

The result of following parsing attend does not result any value. I am asking, whether the format of my regular expression is correct?

QList<QByteArray> outputLines = output.split('\n');
for (auto itOutput = outputLines.begin(); itOutput != outputLines.end(); ++itOutput)
{
  QString line = QString::fromLatin1(*itOutput);
  
  QRegExp matchExprDimseResponse(toQString("( DIMSE Status: )(\\d+)"));
  parsedResultMessage.push_back(matchExprDimseResponse.capturedTexts().first().toUtf8());
  cout << "parsedResultMessage: " << parsedResultMessage.toStdString() << endl;
}
mystic.06
  • 189
  • 8
  • 1
    Nice example on using QRegExp (which is deprecated btw, use QRegularExpression instead) without any need... `DIMSE Status:` is not in your example output shown above. `if line.contains("DIMSE Status") cout << line.split(':')[1]` – chehrlic Nov 11 '22 at 13:07

0 Answers0